[Pkg-electronics-commits] [pcb-rnd] 02/05: New upstream version 1.2.0
Bdale Garbee
bdale at moszumanska.debian.org
Wed Feb 15 17:08:02 UTC 2017
This is an automated email from the git hooks/post-receive script.
bdale pushed a commit to branch master
in repository pcb-rnd.
commit 5ed236a85d1b1be02465d88ff04e34cc489c9d86
Author: Bdale Garbee <bdale at gag.com>
Date: Wed Feb 15 10:06:53 2017 -0700
New upstream version 1.2.0
---
Changelog | 127 +-
INSTALL | 2 +-
Makefile | 68 +-
Makefile.conf.in | 17 +-
Release_notes | 20 +-
config.h.in | 21 +-
data/Makefile | 4 +-
doc-rnd/Autostyle.html | 14 -
doc-rnd/Makefile | 28 -
doc-rnd/README | 10 -
doc-rnd/TODO | 154 -
doc-rnd/conf/index.html | 92 -
doc-rnd/conf/index_user.html | 92 -
doc-rnd/conf/prio.html | 22 -
doc-rnd/conf/scalars.html | 56 -
doc-rnd/conf/sources.html | 72 -
doc-rnd/conf/syntax.html | 45 -
doc-rnd/conf/tree/rc.html | 25 -
doc-rnd/contrib.html | 66 -
doc-rnd/ddrc/proposal1.txt | 242 -
doc-rnd/ddrc/requirements.txt | 23 -
doc-rnd/devlog/20150816a_scriptig.html | 28 -
.../devlog/20150821a_parametric_requirements.html | 32 -
doc-rnd/devlog/20150830a_fork_faq.html | 257 -
doc-rnd/devlog/20150830b_back_ann.html | 304 -
doc-rnd/devlog/20151028_glib.html | 65 -
doc-rnd/devlog/20160101_cschem.html | 68 -
doc-rnd/devlog/20160409/header | 7 -
doc-rnd/devlog/20160409/header.csv | 1 -
doc-rnd/devlog/20160409/legend.txt | 60 -
doc-rnd/devlog/20160409/poll.html | 98 -
doc-rnd/devlog/20160826_virtusers.html | 65 -
doc-rnd/djopt/Makefile | 50 -
doc-rnd/features/ba.html | 68 -
doc-rnd/features/cycdrag.html | 46 -
doc-rnd/features/debian.html | 50 -
doc-rnd/features/debian_list.html | 64 -
doc-rnd/features/dynstyle.html | 38 -
doc-rnd/features/flagcomp.html | 41 -
doc-rnd/features/fp_wget.html | 55 -
doc-rnd/features/fullscreen.html | 38 -
doc-rnd/features/gpmi.html | 59 -
doc-rnd/features/grid.html | 99 -
doc-rnd/features/index.html | 61 -
doc-rnd/features/intconn.html | 90 -
doc-rnd/features/io.html | 41 -
doc-rnd/features/library_t.html | 46 -
doc-rnd/features/mincut.html | 65 -
doc-rnd/features/negselect.html | 41 -
doc-rnd/features/nonetlist.html | 71 -
doc-rnd/features/oldplugins.html | 69 -
doc-rnd/features/onpoint.html | 68 -
doc-rnd/features/pcb-fp.html | 54 -
doc-rnd/features/pcblib.html | 74 -
doc-rnd/features/polygrid.html | 35 -
doc-rnd/features/propedit.html | 65 -
doc-rnd/features/query.html | 42 -
doc-rnd/features/res.html | 147 -
doc-rnd/features/routings.html | 97 -
doc-rnd/features/scconfig.html | 33 -
doc-rnd/features/settings.html | 49 -
doc-rnd/features/square.html | 89 -
doc-rnd/features/tostyle.html | 68 -
doc-rnd/features/unglib.html | 35 -
doc-rnd/gpmi/packages/Makefile | 15 -
doc-rnd/gpmi/packages/actions.html | 123 -
doc-rnd/gpmi/packages/actions_ref.html | 82 -
doc-rnd/gpmi/packages/dialogs.html | 47 -
doc-rnd/gpmi/packages/dialogs_ref.html | 105 -
doc-rnd/gpmi/packages/hid.html | 76 -
doc-rnd/gpmi/packages/hid_ref.html | 205 -
doc-rnd/gpmi/packages/layout.html | 58 -
doc-rnd/gpmi/packages/layout_ref.html | 305 -
doc-rnd/gpmi/rosetta/30_move/ex.html | 36 -
doc-rnd/gpmi/rosetta/30_move/index.html | 74 -
doc-rnd/gpmi/rosetta/35_export_drill/ex.awk | 60 -
doc-rnd/gpmi/rosetta/35_export_drill/ex.lua | 65 -
doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl | 63 -
doc-rnd/gpmi/scripting_intro.html | 226 -
doc-rnd/gsch2pcb-rnd.htm | 49 -
doc-rnd/hacking/c89.html | 14 -
doc-rnd/hacking/data1.png | Bin 184597 -> 0 bytes
doc-rnd/hacking/indent.html | 15 -
doc-rnd/hacking/releasing.txt | 11 -
doc-rnd/hacking/src/data1.dot | 47 -
doc-rnd/help.html | 62 -
doc-rnd/index.html | 123 -
doc-rnd/irc.html | 43 -
doc-rnd/keys.html | 684 ---
doc-rnd/keys_mkey.html | 508 --
doc-rnd/man/Makefile | 58 -
doc-rnd/man/index.html | 3 -
doc-rnd/man/pcb-rnd.1 | 47 -
doc-rnd/man/pcb-rnd.1.html | 79 -
doc-rnd/man/pcb-rnd.1.mml | 38 -
doc-rnd/mods/after.png | Bin 2213 -> 0 bytes
doc-rnd/mods/gen.sh | 128 -
doc-rnd/mods/index.html | 136 -
doc-rnd/mods/mods.png | Bin 6212 -> 0 bytes
doc-rnd/mods/post.html | 3 -
doc-rnd/mods/pre.html | 60 -
doc-rnd/mods2/after.png | Bin 2232 -> 0 bytes
doc-rnd/mods2/before.png | Bin 2048 -> 0 bytes
doc-rnd/mods2/gen.sh | 128 -
doc-rnd/mods2/index.html | 159 -
doc-rnd/mods2/mods.png | Bin 7064 -> 0 bytes
doc-rnd/mods2/post.html | 3 -
doc-rnd/mods2/pre.html | 60 -
doc-rnd/mods3/after.png | Bin 1767 -> 0 bytes
doc-rnd/mods3/before.png | Bin 2048 -> 0 bytes
doc-rnd/mods3/gen.sh | 125 -
doc-rnd/mods3/index.html | 373 --
doc-rnd/mods3/mods.png | Bin 10881 -> 0 bytes
doc-rnd/mods3/pre.html | 60 -
doc-rnd/motivation.html | 109 -
doc-rnd/myfeature.html | 69 -
doc-rnd/news.html | 53 -
doc-rnd/packaging.txt | 90 -
doc-rnd/query/tutor_cli.html | 168 -
doc-rnd/wishlist.txt | 32 -
doc/Autostyle.html | 15 +
{doc-rnd => doc}/Autostyle.sh | 0
doc/Makefile | 28 +
doc/README | 12 +
doc/TODO | 196 +
{doc-rnd => doc}/UNIX.txt | 0
{doc-rnd => doc}/conf/groups.html | 0
doc/conf/index.html | 92 +
{doc-rnd => doc}/conf/index_prog.html | 0
doc/conf/index_user.html | 92 +
{doc-rnd => doc}/conf/lists.html | 0
{doc-rnd => doc}/conf/merging.png | Bin
{doc-rnd => doc}/conf/noextend.html | 0
{doc-rnd => doc}/conf/plugin_chk.html | 0
doc/conf/prio.html | 22 +
doc/conf/scalars.html | 56 +
doc/conf/sources.html | 72 +
{doc-rnd => doc}/conf/src/Makefile | 0
{doc-rnd => doc}/conf/src/merging.dot | 0
doc/conf/syntax.html | 45 +
{doc-rnd => doc}/conf/tree/CFN_BOOLEAN.html | 0
{doc-rnd => doc}/conf/tree/CFN_COLOR.html | 0
{doc-rnd => doc}/conf/tree/CFN_COORD.html | 0
{doc-rnd => doc}/conf/tree/CFN_INCREMENTS.html | 0
{doc-rnd => doc}/conf/tree/CFN_INTEGER.html | 0
{doc-rnd => doc}/conf/tree/CFN_LIST.html | 0
{doc-rnd => doc}/conf/tree/CFN_REAL.html | 0
{doc-rnd => doc}/conf/tree/CFN_STRING.html | 0
{doc-rnd => doc}/conf/tree/CFN_UNIT.html | 0
{doc-rnd => doc}/conf/tree/appearance.html | 0
{doc-rnd => doc}/conf/tree/appearance_color.html | 0
doc/conf/tree/appearance_loglevels.html | 14 +
.../conf/tree/appearance_messages.html | 0
{doc-rnd => doc}/conf/tree/appearance_misc.html | 0
{doc-rnd => doc}/conf/tree/appearance_pinout.html | 0
{doc-rnd => doc}/conf/tree/design.html | 0
{doc-rnd => doc}/conf/tree/editor.html | 0
doc/conf/tree/editor_selection.html | 8 +
{doc-rnd => doc}/conf/tree/editor_view.html | 0
doc/conf/tree/rc.html | 27 +
{doc-rnd => doc}/conf/tree/rc_path.html | 0
{doc-rnd => doc}/conf/tree/temp.html | 0
doc/contrib.html | 69 +
doc/developer/c89.html | 14 +
doc/developer/data.html | 103 +
doc/developer/data1.png | Bin 0 -> 206759 bytes
{doc-rnd => doc/developer}/ddrc/examples1.txt | 0
doc/developer/ddrc/proposal1.txt | 242 +
doc/developer/ddrc/requirements.txt | 23 +
{doc-rnd => doc/developer}/distros.txt | 0
doc/developer/hid_remote/Makefile | 9 +
doc/developer/hid_remote/fixlab.sh | 43 +
doc/developer/hid_remote/proto_high.html | 224 +
doc/developer/hid_remote/proto_low.html | 146 +
doc/developer/hid_remote/proto_parse.dot | 84 +
doc/developer/hid_remote/proto_parse.html | 38 +
doc/developer/hid_remote/proto_parse.svg | 597 ++
{doc-rnd/hacking => doc/developer}/import.html | 0
doc/developer/indent.html | 15 +
doc/developer/mods3/README | 10 +
doc/developer/mods3/after.png | 0
{doc-rnd/mods => doc/developer/mods3}/before.png | Bin
doc/developer/mods3/export.png | Bin 0 -> 4799 bytes
doc/developer/mods3/feature.png | Bin 0 -> 6453 bytes
doc/developer/mods3/fp.png | Bin 0 -> 1522 bytes
doc/developer/mods3/gen.sh | 152 +
doc/developer/mods3/hid.png | Bin 0 -> 2140 bytes
doc/developer/mods3/import.png | Bin 0 -> 2510 bytes
doc/developer/mods3/index.html | 436 ++
doc/developer/mods3/io.png | Bin 0 -> 2051 bytes
doc/developer/mods3/lib.png | Bin 0 -> 1487 bytes
doc/developer/mods3/mods.png | Bin 0 -> 2714 bytes
{doc-rnd => doc/developer}/mods3/post.html | 0
doc/developer/mods3/pre.html | 88 +
doc/developer/obj_func_naming.txt | 83 +
doc/developer/packaging.txt | 90 +
.../developer}/plugin_core_simple.html | 0
.../hacking => doc/developer}/plugin_naming.html | 0
doc/developer/releasing.txt | 11 +
doc/developer/renames | 1516 +++++
{doc-rnd/hacking => doc/developer}/src/Makefile | 0
doc/developer/src/data1.dot | 59 +
{doc-rnd => doc}/devlog/20150731a_menu.html | 0
{doc-rnd => doc}/devlog/20150731b_gtk.html | 0
{doc-rnd => doc}/devlog/20150801a_events.html | 0
{doc-rnd => doc}/devlog/20150803a_scriptig.html | 0
doc/devlog/20150816a_scriptig.html | 28 +
{doc-rnd => doc}/devlog/20150820a_dimensions.html | 0
{doc-rnd => doc}/devlog/20150820b_qf.html | 0
doc/devlog/20150821a_parametric_requirements.html | 32 +
doc/devlog/20150830a_fork_faq.html | 257 +
doc/devlog/20150830b_back_ann.html | 304 +
{doc-rnd => doc}/devlog/20150901a_back_ann.html | 0
doc/devlog/20151028_glib.html | 65 +
doc/devlog/20160101_cschem.html | 68 +
{doc-rnd => doc}/devlog/20160126.html | 0
{doc-rnd => doc}/devlog/20160313_unglib.html | 0
.../devlog/20160314_valgrind_flex.html | 0
{doc-rnd => doc}/devlog/20160409.html | 0
doc/devlog/20160409/header | 7 +
doc/devlog/20160409/header.csv | 1 +
doc/devlog/20160409/legend.txt | 60 +
{doc-rnd => doc}/devlog/20160409/pie_col_1.png | Bin
{doc-rnd => doc}/devlog/20160409/pie_col_2.png | Bin
{doc-rnd => doc}/devlog/20160409/pie_col_3.png | Bin
{doc-rnd => doc}/devlog/20160409/pie_col_4.png | Bin
{doc-rnd => doc}/devlog/20160409/pie_col_5.png | Bin
{doc-rnd => doc}/devlog/20160409/pie_col_7.png | Bin
{doc-rnd => doc}/devlog/20160409/poll.csv | 0
doc/devlog/20160409/poll.html | 98 +
{doc-rnd => doc}/devlog/20160409/poll.tsv | 0
{doc-rnd => doc}/devlog/20160716_sprint.html | 0
{doc-rnd => doc}/devlog/20160802.html | 0
{doc-rnd => doc}/devlog/20160808_model.html | 0
{doc-rnd => doc}/devlog/20160823_lhtpers.html | 0
doc/devlog/20160826_virtusers.html | 65 +
{doc-rnd => doc}/devlog/20160921_gl.html | 0
{doc-rnd => doc}/devlog/20161014_cleanup.html | 0
{doc-rnd => doc}/devlog/20162601/header | 0
{doc-rnd => doc}/devlog/20162601/header.csv | 0
{doc-rnd => doc}/devlog/20162601/poll.csv | 0
{doc-rnd => doc}/devlog/20162601/poll.html | 0
{doc-rnd => doc}/devlog/20162601/poll.tsv | 0
{doc-rnd => doc}/devlog/poll_common/gencsv.sh | 0
{doc-rnd => doc}/devlog/poll_common/genhtml.sh | 0
{doc-rnd => doc}/devlog/poll_common/genpie.sh | 0
{doc-rnd => doc}/devlog/res/20150830b_annot.dot | 0
{doc-rnd => doc}/devlog/res/20150830b_annot.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s0.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s1.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s2.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s3.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s4.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s5.png | Bin
{doc-rnd => doc}/devlog/res/20150830b_s6.png | Bin
{doc-rnd => doc}/devlog/res/Makefile | 0
doc/doc.html | 36 +
doc/features/ba.html | 70 +
doc/features/cycdrag.html | 48 +
doc/features/debian.html | 60 +
doc/features/debian_list.html | 67 +
doc/features/dynstyle.html | 40 +
doc/features/flagcomp.html | 43 +
doc/features/fp_wget.html | 57 +
doc/features/fullscreen.html | 40 +
doc/features/gpmi.html | 60 +
doc/features/grid.html | 101 +
{doc-rnd => doc}/features/grid_edge.png | Bin
{doc-rnd => doc}/features/grid_global_nosparse.png | Bin
{doc-rnd => doc}/features/grid_global_sparse.png | Bin
{doc-rnd => doc}/features/grid_local_16.png | Bin
{doc-rnd => doc}/features/grid_local_4.png | Bin
doc/features/index.html | 63 +
doc/features/intconn.html | 92 +
{doc-rnd => doc}/features/intconn1.png | Bin
{doc-rnd => doc}/features/intconn2.png | Bin
{doc-rnd => doc}/features/intconn3.png | Bin
doc/features/io.html | 43 +
{doc-rnd => doc}/features/jumper_1206.fp | 0
doc/features/library_t.html | 48 +
doc/features/mincut.html | 67 +
{doc-rnd => doc}/features/mincut.png | Bin
doc/features/negselect.html | 51 +
doc/features/nonetlist.html | 73 +
doc/features/oldplugins.html | 71 +
doc/features/onpoint.html | 70 +
doc/features/pcb-fp.html | 56 +
{doc-rnd => doc}/features/pcb-fp.png | Bin
doc/features/pcblib.html | 76 +
{doc-rnd => doc}/features/pcblib.png | Bin
doc/features/polygrid.html | 37 +
doc/features/propedit.html | 67 +
{doc-rnd => doc}/features/propedit.png | Bin
doc/features/query.html | 44 +
doc/features/res.html | 149 +
doc/features/routings.html | 99 +
doc/features/scconfig.html | 35 +
doc/features/settings.html | 51 +
doc/features/square.html | 91 +
{doc-rnd => doc}/features/square.pcb | 0
{doc-rnd => doc}/features/square.png | Bin
doc/features/tostyle.html | 70 +
doc/features/unglib.html | 37 +
{doc-rnd => doc}/gpmi_temp_inst.txt | 0
doc/help.html | 65 +
doc/index.html | 133 +
doc/irc.html | 46 +
doc/keys.html | 694 +++
doc/keys_mkey.html | 518 ++
{doc-rnd => doc}/mac.txt | 0
doc/man/Makefile | 64 +
{doc-rnd => doc}/man/README | 0
{doc-rnd => doc}/man/copyright.mml | 0
doc/man/fp2anim.1 | 67 +
doc/man/fp2anim.1.html | 98 +
doc/man/fp2anim.1.mml | 58 +
{doc-rnd => doc}/man/gsch2pcb-rnd.1 | 0
doc/man/index.html | 6 +
doc/man/pcb-prj2lht.1 | 32 +
doc/man/pcb-prj2lht.1.html | 58 +
doc/man/pcb-prj2lht.1.mml | 14 +
doc/man/pcb-rnd.1 | 47 +
doc/man/pcb-rnd.1.html | 79 +
doc/man/pcb-rnd.1.mml | 38 +
doc/man/pcb-strip.1 | 45 +
doc/man/pcb-strip.1.html | 75 +
doc/man/pcb-strip.1.mml | 30 +
doc/motivation.html | 111 +
doc/myfeature.html | 72 +
doc/news.html | 77 +
doc/plan.txt | 76 +
doc/resources/logo.pcb | 91 +
{doc-rnd => doc/resources}/logo128.png | Bin
{doc-rnd => doc/resources}/logo16.png | Bin
{doc-rnd => doc/resources}/logo256.png | Bin
{doc-rnd => doc/resources}/logo32.png | Bin
{doc-rnd => doc/resources}/logo64.png | Bin
doc/resources/logo_made_with.pcb | 82 +
{doc-rnd => doc/resources}/screenshot.jpg | Bin
doc/tutorials/7805/7805.lht | 994 +++
doc/tutorials/7805/7805.sch | 88 +
doc/tutorials/7805/Info.lht | 13 +
doc/tutorials/7805/Makefile | 5 +
doc/tutorials/7805/index.html | 96 +
doc/user/01_intro/Makefile | 2 +
doc/user/01_intro/flow.svg | 135 +
doc/user/01_intro/history.html | 38 +
doc/user/01_intro/index.html | 39 +
doc/user/01_intro/src/flow.dot | 45 +
doc/user/02_model/index.html | 419 ++
doc/user/02_model/obj_arc.png | Bin 0 -> 5096 bytes
doc/user/02_model/obj_line.png | Bin 0 -> 3526 bytes
doc/user/02_model/objects_basic.png | Bin 0 -> 3319 bytes
doc/user/02_model/objects_complex.png | Bin 0 -> 1147 bytes
doc/user/02_model/src/Makefile | 24 +
doc/user/02_model/src/obj_arc.lht | 2424 ++++++++
doc/user/02_model/src/obj_line.lht | 2342 ++++++++
doc/user/02_model/src/objects_basic.lht | 2282 +++++++
doc/user/02_model/src/objects_complex.lht | 2223 +++++++
doc/user/04_invoc/index.html | 27 +
.../01_gtk/base_window_highlight_coordsreadout.png | Bin 0 -> 41666 bytes
.../01_gtk/base_window_highlight_layerops.png | Bin 0 -> 41682 bytes
.../05_ui/01_gtk/base_window_highlight_main.png | Bin 0 -> 39971 bytes
.../05_ui/01_gtk/base_window_highlight_menus.png | Bin 0 -> 40613 bytes
.../01_gtk/base_window_highlight_opsreadout.png | Bin 0 -> 40869 bytes
.../01_gtk/base_window_highlight_routestyle.png | Bin 0 -> 40508 bytes
.../05_ui/01_gtk/base_window_highlight_workops.png | Bin 0 -> 40269 bytes
doc/user/05_ui/01_gtk/index.html | 92 +
doc/user/05_ui/02_cli/index.html | 26 +
doc/user/05_ui/index.html | 25 +
doc/user/06_feature/djopt/Makefile | 50 +
{doc-rnd => doc/user/06_feature}/djopt/Post.html | 0
{doc-rnd => doc/user/06_feature}/djopt/Pre.html | 0
.../user/06_feature}/djopt/debumpify.out.pcb | 0
.../user/06_feature}/djopt/debumpify.out.png | Bin
.../user/06_feature}/djopt/debumpify.pcb | 0
.../user/06_feature}/djopt/debumpify.png | Bin
.../user/06_feature}/djopt/debumpify.txt | 0
{doc-rnd => doc/user/06_feature}/djopt/index.html | 0
.../user/06_feature}/djopt/miter.out.pcb | 0
.../user/06_feature}/djopt/miter.out.png | Bin
{doc-rnd => doc/user/06_feature}/djopt/miter.pcb | 0
{doc-rnd => doc/user/06_feature}/djopt/miter.png | Bin
{doc-rnd => doc/user/06_feature}/djopt/miter.txt | 0
.../user/06_feature}/djopt/orthopull.out.pcb | 0
.../user/06_feature}/djopt/orthopull.out.png | Bin
.../user/06_feature}/djopt/orthopull.pcb | 0
.../user/06_feature}/djopt/orthopull.png | Bin
.../user/06_feature}/djopt/orthopull.txt | 0
.../user/06_feature}/djopt/unjaggy.out.pcb | 0
.../user/06_feature}/djopt/unjaggy.out.png | Bin
{doc-rnd => doc/user/06_feature}/djopt/unjaggy.pcb | 0
{doc-rnd => doc/user/06_feature}/djopt/unjaggy.png | Bin
{doc-rnd => doc/user/06_feature}/djopt/unjaggy.txt | 0
.../user/06_feature}/djopt/vianudge.out.pcb | 0
.../user/06_feature}/djopt/vianudge.out.png | Bin
.../user/06_feature}/djopt/vianudge.pcb | 0
.../user/06_feature}/djopt/vianudge.png | Bin
.../user/06_feature}/djopt/vianudge.txt | 0
.../user/06_feature}/djopt/viatrim.out.pcb | 0
.../user/06_feature}/djopt/viatrim.out.png | Bin
{doc-rnd => doc/user/06_feature}/djopt/viatrim.pcb | 0
{doc-rnd => doc/user/06_feature}/djopt/viatrim.png | Bin
{doc-rnd => doc/user/06_feature}/djopt/viatrim.txt | 0
{doc-rnd => doc/user/06_feature}/gpmi/Credits | 0
{doc-rnd => doc/user/06_feature}/gpmi/History | 0
{doc-rnd => doc/user/06_feature}/gpmi/Makefile | 0
{doc-rnd => doc/user/06_feature}/gpmi/Porting | 0
.../user/06_feature}/gpmi/gpmi_flow.dot | 0
.../user/06_feature}/gpmi/gpmi_flow.png | Bin
.../user/06_feature}/gpmi/gpmi_flow_exp.dot | 0
.../user/06_feature}/gpmi/gpmi_flow_exp.png | Bin
.../user/06_feature}/gpmi/gpmi_flow_load.dot | 0
.../user/06_feature}/gpmi/gpmi_flow_load.png | Bin
.../user/06_feature}/gpmi/gpmi_flow_menu.dot | 0
.../user/06_feature}/gpmi/gpmi_flow_menu.png | Bin
.../user/06_feature}/gpmi/gpmi_flow_reg.dot | 0
.../user/06_feature}/gpmi/gpmi_flow_reg.png | Bin
{doc-rnd => doc/user/06_feature}/gpmi/index.html | 0
doc/user/06_feature/gpmi/packages/Makefile | 15 +
.../user/06_feature}/gpmi/packages/XREF | 0
doc/user/06_feature/gpmi/packages/actions.html | 123 +
doc/user/06_feature/gpmi/packages/actions_ref.html | 82 +
doc/user/06_feature/gpmi/packages/dialogs.html | 47 +
doc/user/06_feature/gpmi/packages/dialogs_ref.html | 105 +
.../user/06_feature}/gpmi/packages/event_id.html | 0
doc/user/06_feature/gpmi/packages/hid.html | 76 +
doc/user/06_feature/gpmi/packages/hid_ref.html | 205 +
doc/user/06_feature/gpmi/packages/layout.html | 58 +
doc/user/06_feature/gpmi/packages/layout_ref.html | 305 +
.../user/06_feature}/gpmi/rosetta/10_hello/ID.desc | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ID.name | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.awk | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.bash | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.html | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.lua | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.pl | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.py | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.rb | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.scm | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.stt | 0
.../user/06_feature}/gpmi/rosetta/10_hello/ex.tcl | 0
.../06_feature}/gpmi/rosetta/10_hello/index.html | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ID.desc | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ID.name | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.awk | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.bash | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.html | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.lua | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.pl | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.py | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.rb | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.scm | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.stt | 0
.../06_feature}/gpmi/rosetta/10_hello_gui/ex.tcl | 0
.../gpmi/rosetta/10_hello_gui/index.html | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ID.desc | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ID.name | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.awk | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.bash | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.html | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.lua | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.pl | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.py | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.rb | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.scm | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.stt | 0
.../06_feature}/gpmi/rosetta/12_hello_menu/ex.tcl | 0
.../gpmi/rosetta/12_hello_menu/index.html | 0
.../user/06_feature}/gpmi/rosetta/30_move/ID.desc | 0
.../user/06_feature}/gpmi/rosetta/30_move/ID.name | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.awk | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.bash | 0
doc/user/06_feature/gpmi/rosetta/30_move/ex.html | 36 +
.../user/06_feature}/gpmi/rosetta/30_move/ex.lua | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.pl | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.py | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.rb | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.scm | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.stt | 0
.../user/06_feature}/gpmi/rosetta/30_move/ex.tcl | 0
.../06_feature/gpmi/rosetta/30_move/index.html | 74 +
.../gpmi/rosetta/35_export_drill/ID.desc | 0
.../gpmi/rosetta/35_export_drill/ID.name | 0
.../06_feature/gpmi/rosetta/35_export_drill/ex.awk | 60 +
.../gpmi/rosetta/35_export_drill/ex.html | 0
.../06_feature/gpmi/rosetta/35_export_drill/ex.lua | 65 +
.../06_feature/gpmi/rosetta/35_export_drill/ex.tcl | 65 +
.../gpmi/rosetta/35_export_drill/index.html | 0
doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc | 1 +
doc/user/06_feature/gpmi/rosetta/90_clock/ID.name | 1 +
doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk | 126 +
.../user/06_feature}/gpmi/rosetta/index.html | 0
.../user/06_feature}/gpmi/rosetta/index.templ.html | 0
doc/user/06_feature/gpmi/scripting_intro.html | 226 +
.../user/06_feature}/gpmi/util/Makefile | 0
.../user/06_feature}/gpmi/util/rosetta_genpages.sh | 0
{doc-rnd => doc/user/06_feature}/gpmi/util/tags | 0
doc/user/06_feature/query/tutor_cli.html | 168 +
doc/user/08_util/01_gsch2pcb-rnd.htm | 50 +
.../misc => doc/user/08_util}/install_cgi.html | 0
doc/user/default.css | 40 +
doc/user/index.html | 24 +
{doc-rnd => doc}/windows.txt | 0
doc/wishlist.txt | 34 +
pcblib/Makefile | 4 +-
pcblib/parametric/common.awk | 9 +
pcblib/parametric/qf | 27 +
pcblib/parametric/qf.awk | 46 +-
pcblib/parametric/qfn.awk | 2 +-
pcblib/parametric/qfp.awk | 2 +-
scconfig/Makefile | 5 +-
scconfig/Rev.h | 2 +-
scconfig/Rev.tab | 14 +
scconfig/gen_core_lists.sh | 4 +-
scconfig/hooks.c | 112 +-
scconfig/plugin_3state.h | 9 +
scconfig/plugins.h | 40 +-
scconfig/revtest.c | 6 +-
scconfig/src/default/arg.c | 2 +
scconfig/src/default/find_cc.c | 1 +
scconfig/src/default/find_fscalls.c | 2 +-
scconfig/src/util/arg_auto_set.c | 2 +
src/Makefile.dep | 6312 +++++++++++---------
src/Makefile.in | 70 +-
src/action_act.c | 27 +-
src/action_helper.c | 1134 ++--
src/action_helper.h | 52 +-
src/attrib.c | 115 +
src/attrib.h | 69 +
src/board.c | 324 +
src/board.h | 177 +
src/box.c | 85 +
src/box.h | 116 +-
src/buffer.c | 1318 ++--
src/buffer.h | 62 +-
src/build_run.c | 180 +
src/build_run.h | 37 +
src/buildin.c.in | 2 +-
src/buildin.h | 2 +-
src/change.c | 2543 ++------
src/change.h | 114 +-
src/change_act.c | 911 ++-
src/clip.c | 3 +-
src/clip.h | 6 +-
src/compat_cc.h | 71 +
src/compat_dl.c | 5 +-
src/compat_fs.c | 29 +-
src/compat_fs.h | 6 +-
src/compat_lrealpath.c | 8 +-
src/compat_lrealpath.h | 2 +-
src/compat_misc.c | 34 +-
src/compat_misc.h | 6 +-
src/compat_nls.h | 50 +
src/conf.c | 198 +-
src/conf.h | 30 +-
src/conf_act.c | 87 +-
src/conf_core.c | 11 +-
src/conf_core.h | 21 +-
src/conf_hid.c | 7 +-
src/conf_hid.h | 5 +-
src/const.h | 92 +-
src/copy.c | 319 +-
src/copy.h | 10 +-
src/create.c | 952 ---
src/create.h | 81 -
src/crosshair.c | 910 +--
src/crosshair.h | 108 +-
src/data.c | 230 +-
src/data.h | 97 +-
src/dolists.h | 8 +-
src/draw.c | 1569 +----
src/draw.h | 78 +-
src/draw_fab.c | 297 -
src/draw_fab.h | 39 -
src/drc.h | 47 +
src/drill.c | 243 -
src/drill.h | 31 -
src/error.c | 100 +-
src/error.h | 23 +-
src/event.c | 59 +-
src/event.h | 77 +-
src/file_act.c | 243 +-
src/find.c | 55 +-
src/find.h | 86 +-
src/find_act.c | 24 +-
src/find_clear.c | 89 +-
src/find_deadcode.c | 46 +-
src/find_debug.c | 28 +-
src/find_drc.c | 335 +-
src/find_geo.c | 235 +-
src/find_lookup.c | 683 +--
src/find_misc.c | 186 +-
src/find_print.c | 118 +-
src/flag.c | 87 +
src/flag.h | 240 +
src/flag_str.c | 580 ++
src/flag_str.h | 76 +
src/font.c | 147 +
src/font.h | 57 +
src/fptr_cast.c | 1 +
src/free_atexit.c | 21 +-
src/free_atexit.h | 30 +-
src/funchash.c | 24 +-
src/funchash.h | 16 +-
src/funchash_core.h | 2 +-
src/funchash_core_list.h | 2 +-
src/global.h | 554 --
src/global_element.h | 17 -
src/global_objs.h | 210 -
src/global_typedefs.h | 36 +-
src/globalconst.h | 111 +-
src/gui_act.c | 802 +--
src/heap.c | 40 +-
src/heap.h | 22 +-
src/hid.h | 179 +-
src/hid_actions.c | 150 +-
src/hid_actions.h | 26 +-
src/hid_attrib.c | 44 +-
src/hid_attrib.h | 38 +-
src/hid_cfg.c | 121 +-
src/hid_cfg.h | 71 +-
src/hid_cfg_action.c | 7 +-
src/hid_cfg_action.h | 2 +-
src/hid_cfg_input.c | 139 +-
src/hid_cfg_input.h | 84 +-
src/hid_color.c | 10 +-
src/hid_color.h | 4 +-
src/hid_draw_helpers.c | 283 +-
src/hid_draw_helpers.h | 14 +-
src/hid_extents.c | 109 +-
src/hid_extents.h | 2 +-
src/hid_flags.c | 34 +-
src/hid_flags.h | 8 +-
src/hid_helper.c | 104 +-
src/hid_helper.h | 17 +-
src/hid_init.c | 203 +-
src/hid_init.h | 38 +-
src/hid_nogui.c | 99 +-
src/hid_nogui.h | 4 +-
src/ht_element.c | 213 +-
src/ht_element.h | 4 +-
src/insert.c | 196 +-
src/insert.h | 8 +-
src/intersect.c | 47 +-
src/intersect.h | 6 +-
src/layer.c | 1023 ++--
src/layer.h | 255 +-
src/layer_ui.c | 76 +
src/layer_ui.h | 49 +
src/layer_vis.c | 301 +
src/layer_vis.h | 52 +
src/library.c | 144 +
src/library.h | 102 +
src/line.c | 534 --
src/line.h | 42 -
src/list_arc.c | 26 -
src/list_arc.h | 41 -
src/list_element.c | 30 -
src/list_element.h | 79 -
src/list_line.c | 26 -
src/list_line.h | 41 -
src/list_pad.c | 26 -
src/list_pad.h | 41 -
src/list_pin.c | 26 -
src/list_pin.h | 41 -
src/list_poly.c | 26 -
src/list_poly.h | 41 -
src/list_rat.c | 26 -
src/list_rat.h | 41 -
src/list_text.c | 26 -
src/list_text.h | 41 -
src/macro.h | 391 +-
src/main.c | 199 +-
src/main_act.c | 112 +-
src/math_helper.h | 66 +
src/mirror.c | 98 -
src/mirror.h | 44 -
src/misc.c | 1310 ----
src/misc.h | 103 -
src/misc_util.c | 90 +-
src/misc_util.h | 23 +-
src/move.c | 1007 +---
src/move.h | 66 +-
src/mymem.c | 765 ---
src/mymem.h | 111 -
src/netlist.c | 176 +-
src/netlist.h | 80 +-
src/netlist_act.c | 137 +-
src/obj_all.h | 8 +
src/obj_all_list.h | 8 +
src/obj_all_op.h | 8 +
src/obj_any.c | 1 +
src/obj_any.h | 36 +-
src/obj_arc.c | 716 +++
src/obj_arc.h | 124 +
src/obj_arc_draw.h | 37 +
src/obj_arc_list.c | 25 +
src/obj_arc_list.h | 44 +
src/obj_arc_op.h | 50 +
src/obj_arc_ui.c | 139 +
src/obj_arc_ui.h | 31 +
src/obj_common.c | 108 +
src/obj_common.h | 136 +
src/obj_elem.c | 1982 ++++++
src/obj_elem.h | 159 +
src/obj_elem_draw.h | 48 +
src/obj_elem_list.c | 32 +
src/obj_elem_list.h | 81 +
src/obj_elem_op.h | 53 +
src/obj_line.c | 849 +++
src/obj_line.h | 129 +
src/obj_line_draw.h | 37 +
src/obj_line_drcenf.c | 531 ++
src/obj_line_list.c | 25 +
src/obj_line_list.h | 43 +
src/obj_line_op.h | 52 +
src/obj_pad.c | 505 ++
src/obj_pad.h | 83 +
src/obj_pad_draw.h | 41 +
src/obj_pad_list.c | 25 +
src/obj_pad_list.h | 43 +
src/obj_pad_op.h | 42 +
src/obj_pinvia.c | 1058 ++++
src/obj_pinvia.h | 133 +
src/obj_pinvia_draw.h | 46 +
src/obj_pinvia_list.c | 25 +
src/obj_pinvia_list.h | 42 +
src/obj_pinvia_op.h | 60 +
src/obj_pinvia_therm.c | 438 ++
src/obj_pinvia_therm.h | 44 +
src/obj_poly.c | 761 +++
src/obj_poly.h | 120 +
src/obj_poly_draw.h | 39 +
src/obj_poly_list.c | 25 +
src/obj_poly_list.h | 43 +
src/obj_poly_op.h | 47 +
src/obj_rat.c | 289 +
src/obj_rat.h | 47 +
src/obj_rat_draw.h | 35 +
src/obj_rat_list.c | 25 +
src/obj_rat_list.h | 43 +
src/obj_rat_op.h | 36 +
src/obj_text.c | 581 ++
src/obj_text.h | 90 +
src/obj_text_draw.h | 37 +
src/obj_text_list.c | 25 +
src/obj_text_list.h | 43 +
src/obj_text_op.h | 44 +
src/object_act.c | 710 ++-
src/operation.h | 128 +
src/paths.c | 134 +-
src/paths.h | 63 +-
src/pcb-conf.lht | 6 +
src/pcb-menu-gtk.lht | 2 +-
src/pcb-menu-lesstif.lht | 2 +-
src/pcb-menu-mkey.lht | 2 +-
src/pcb-printf.c | 157 +-
src/pcb-printf.h | 10 +-
src/plug_footprint.c | 97 +-
src/plug_footprint.h | 62 +-
src/plug_footprint_act.c | 17 +-
src/plug_import.c | 22 +-
src/plug_import.h | 20 +-
src/plug_io.c | 413 +-
src/plug_io.h | 110 +-
src/plugins.c | 38 +-
src/plugins.h | 29 +-
src/polyarea.h | 159 +-
src/polygon.c | 1034 ++--
src/polygon.h | 88 +-
src/polygon1.c | 1178 ++--
src/polygon_act.c | 66 +-
src/rats.c | 491 +-
src/rats.h | 47 +-
src/rats_act.c | 117 +-
src/rats_patch.c | 158 +-
src/rats_patch.h | 57 +-
src/remove.c | 515 +-
src/remove.h | 22 +-
src/remove_act.c | 59 +-
src/rotate.c | 339 +-
src/rotate.h | 69 +-
src/route_style.c | 83 +-
src/route_style.h | 20 +-
src/rtree.c | 116 +-
src/rtree.h | 42 +-
src/rubberband.c | 492 --
src/rubberband.h | 38 -
src/search.c | 604 +-
src/search.h | 158 +-
src/select.c | 668 ++-
src/select.h | 32 +-
src/select_act.c | 195 +-
src/set.c | 278 -
src/set.h | 50 -
src/strflags.c | 540 --
src/strflags.h | 77 -
src/stub_draw_fab.c | 50 +
src/stub_draw_fab.h | 37 +
src/stub_mincut.c | 14 +-
src/stub_mincut.h | 6 +-
src/stub_stroke.c | 11 +-
src/stub_stroke.h | 8 +-
src/stub_vendor.c | 7 +-
src/stub_vendor.h | 6 +-
src/thermal.c | 438 --
src/thermal.h | 45 -
src/undo.c | 628 +-
src/undo.h | 103 +-
src/undo_act.c | 203 +-
src/unit.c | 69 +-
src/unit.h | 129 +-
src/vtlibrary.h | 17 +-
src/vtonpoint.c | 3 +
src/vtonpoint.h | 20 +-
src/vtptr.h | 5 +-
src/vtroutestyle.h | 13 +-
src_3rd/liblhtpers/lhtpers.c | 4 +-
src_3rd/liblhtpers/output.c | 2 +-
src_3rd/liblhtpers/tests/roundtrip/test.sh | 2 +-
src_3rd/liblihata/dom.c | 9 +-
src_3rd/liblihata/regression/dom_load.tts | 2 +-
src_3rd/liblihata/regression/quoting.lht | 12 +
src_3rd/liblihata/regression/ta_ins_r2.tts | 2 +-
src_3rd/liblihata/test_tree.c | 1 -
src_3rd/liblihata/tree.h | 2 +-
src_3rd/qparse/qparse.c | 14 +-
src_3rd/qparse/qparse.h | 2 +
src_plugins/Buildin.tmpasm | 2 +-
src_plugins/Common_enabled.tmpasm | 3 +
src_plugins/Plugin.tmpasm | 2 +-
src_plugins/acompnet/Makefile | 5 +
src_plugins/acompnet/Plug.tmpasm | 8 +
src_plugins/acompnet/README | 5 +
src_plugins/acompnet/acompnet.c | 118 +
src_plugins/autocrop/Makefile | 2 +-
src_plugins/autocrop/autocrop.c | 125 +-
src_plugins/autoplace/Makefile | 2 +-
src_plugins/autoplace/action.c | 23 +-
src_plugins/autoplace/autoplace.c | 324 +-
src_plugins/autoplace/autoplace.h | 2 +-
src_plugins/autoroute/Makefile | 2 +-
src_plugins/autoroute/action.c | 29 +-
src_plugins/autoroute/autoroute.c | 1619 +++--
src_plugins/autoroute/autoroute.h | 3 +-
src_plugins/autoroute/mtspace.c | 172 +-
src_plugins/autoroute/mtspace.h | 12 +-
src_plugins/autoroute/vector.c | 3 +-
src_plugins/boardflip/Makefile | 2 +-
src_plugins/boardflip/boardflip.c | 88 +-
src_plugins/dbus/Makefile | 2 +-
src_plugins/dbus/dbus-pcbmain.c | 36 +-
src_plugins/dbus/dbus.c | 18 +-
src_plugins/diag/Makefile | 2 +-
src_plugins/diag/diag.c | 65 +-
src_plugins/diag/diag_conf.c | 1 +
src_plugins/distalign/Makefile | 2 +-
src_plugins/distalign/distalign.c | 157 +-
src_plugins/distaligntext/Makefile | 2 +-
src_plugins/distaligntext/distaligntext.c | 186 +-
src_plugins/djopt/Makefile | 2 +-
src_plugins/djopt/djopt.c | 226 +-
src_plugins/djopt/djopt.h | 6 +-
src_plugins/draw_fab/Makefile | 6 +
src_plugins/draw_fab/Plug.tmpasm | 11 +
src_plugins/draw_fab/README | 5 +
src_plugins/draw_fab/draw_fab.c | 314 +
src_plugins/draw_fab/draw_fab_conf.h | 14 +
src_plugins/export_bboard/Makefile | 2 +-
src_plugins/export_bboard/bboard.c | 163 +-
src_plugins/export_bom/Makefile | 2 +-
src_plugins/export_bom/bom.c | 44 +-
src_plugins/export_dsn/Makefile | 2 +-
src_plugins/export_dsn/dsn.c | 162 +-
src_plugins/export_dxf/Makefile | 2 +-
src_plugins/export_dxf/dxf.c | 282 +-
src_plugins/export_gcode/Makefile | 2 +-
src_plugins/export_gcode/curve.c | 1 +
src_plugins/export_gcode/decompose.c | 1 +
src_plugins/export_gcode/gcode.c | 157 +-
src_plugins/export_gcode/gcode.h | 2 +-
src_plugins/export_gcode/trace.c | 7 +-
src_plugins/export_gerber/Makefile | 2 +-
src_plugins/export_gerber/gerber.c | 411 +-
src_plugins/export_ipcd356/Makefile | 2 +-
src_plugins/export_ipcd356/ipcd356.c | 163 +-
src_plugins/export_lpr/Makefile | 2 +-
src_plugins/export_lpr/lpr.c | 38 +-
src_plugins/export_nelma/Makefile | 2 +-
src_plugins/export_nelma/nelma.c | 220 +-
src_plugins/export_openscad/Makefile | 2 +-
src_plugins/export_openscad/scad.c | 171 +-
src_plugins/export_openscad/scad.h | 10 +-
src_plugins/export_openscad/scadcomp.c | 100 +-
src_plugins/export_openscad/scadproto.c | 5 -
src_plugins/export_png/Makefile | 2 +-
src_plugins/export_png/png.c | 315 +-
src_plugins/export_png/png.h | 2 +-
src_plugins/export_ps/Makefile | 2 +-
src_plugins/export_ps/eps.c | 223 +-
src_plugins/export_ps/ps.c | 292 +-
src_plugins/export_ps/ps.h | 6 +-
src_plugins/export_stat/Makefile | 5 +
src_plugins/export_stat/Plug.tmpasm | 8 +
src_plugins/export_stat/README | 5 +
src_plugins/export_stat/stat.c | 347 ++
src_plugins/export_svg/Makefile | 2 +-
src_plugins/export_svg/svg.c | 220 +-
src_plugins/export_test/Makefile | 2 +-
src_plugins/export_test/export_test.c | 72 +-
src_plugins/export_xy/Makefile | 2 +-
src_plugins/export_xy/xy.c | 78 +-
src_plugins/fontmode/Makefile | 2 +-
src_plugins/fontmode/fontmode.c | 88 +-
src_plugins/fp_fs/Makefile | 2 +-
src_plugins/fp_fs/fp_fs.c | 107 +-
src_plugins/fp_wget/Makefile | 2 +-
src_plugins/fp_wget/fp_wget.c | 2 +-
src_plugins/fp_wget/gedasymbols.c | 20 +-
src_plugins/fp_wget/gedasymbols.h | 6 +-
src_plugins/fp_wget/tester.c | 10 +-
src_plugins/fp_wget/wget_common.c | 1 +
src_plugins/gl/hidgl.c | 52 +-
src_plugins/gl/hidgl.h | 16 +-
src_plugins/gpmi/Makefile | 2 +-
src_plugins/gpmi/Plug.tmpasm | 2 +-
src_plugins/gpmi/pcb-gpmi/Makefile | 4 +-
src_plugins/gpmi/pcb-gpmi/gpmi_plugin/Makefile | 2 +-
.../gpmi_plugin/gpmi_pkg/actions/actions.c | 18 +-
.../gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h | 2 +-
.../gpmi_plugin/gpmi_pkg/dialogs/dialogs.c | 42 +-
.../gpmi_plugin/gpmi_pkg/dialogs/dialogs.h | 5 +-
.../gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c | 63 +-
.../gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h | 44 +-
.../gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c | 99 +-
.../gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h | 38 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_events.h | 4 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/coord.c | 2 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c | 108 +-
.../gpmi_plugin/gpmi_pkg/layout/debug_draw.c | 12 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c | 8 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c | 61 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h | 99 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/object.c | 34 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/page.c | 3 +-
.../pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c | 61 +-
.../gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c | 79 +-
.../gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h | 2 +-
.../gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c | 52 +-
src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c | 32 +-
src_plugins/hid_batch/Makefile | 2 +-
src_plugins/hid_batch/batch.c | 146 +-
src_plugins/hid_gtk/Makefile | 2 +-
src_plugins/hid_gtk/Plug.tmpasm | 1 +
.../hid_gtk/ghid-cell-renderer-visibility.c | 2 +
src_plugins/hid_gtk/ghid-coord-entry.c | 48 +-
src_plugins/hid_gtk/ghid-coord-entry.h | 6 +-
src_plugins/hid_gtk/ghid-layer-selector.c | 3 +-
src_plugins/hid_gtk/ghid-main-menu.c | 55 +-
src_plugins/hid_gtk/ghid-main-menu.h | 2 +-
src_plugins/hid_gtk/ghid-propedit.c | 50 +-
src_plugins/hid_gtk/ghid-route-style-selector.c | 267 +-
src_plugins/hid_gtk/ghid-route-style-selector.h | 9 +-
src_plugins/hid_gtk/ghid-search.c | 13 +-
src_plugins/hid_gtk/gschem_accel_label.c | 2 +
src_plugins/hid_gtk/gtk_conf_list.c | 3 +-
src_plugins/hid_gtk/gtkhid-gdk.c | 162 +-
src_plugins/hid_gtk/gtkhid-gl.c | 143 +-
src_plugins/hid_gtk/gtkhid-main.c | 423 +-
src_plugins/hid_gtk/gui-command-window.c | 7 +-
src_plugins/hid_gtk/gui-config.c | 136 +-
src_plugins/hid_gtk/gui-dialog-print.c | 35 +-
src_plugins/hid_gtk/gui-dialog.c | 143 +-
src_plugins/hid_gtk/gui-drc-window.c | 117 +-
src_plugins/hid_gtk/gui-drc-window.h | 12 +-
src_plugins/hid_gtk/gui-keyref-window.c | 1 +
src_plugins/hid_gtk/gui-library-window.c | 33 +-
src_plugins/hid_gtk/gui-log-window.c | 14 +-
src_plugins/hid_gtk/gui-misc.c | 47 +-
src_plugins/hid_gtk/gui-netlist-window.c | 180 +-
src_plugins/hid_gtk/gui-output-events.c | 66 +-
src_plugins/hid_gtk/gui-pinout-preview.c | 36 +-
src_plugins/hid_gtk/gui-pinout-preview.h | 4 +-
src_plugins/hid_gtk/gui-pinout-window.c | 7 +-
src_plugins/hid_gtk/gui-top-window.c | 189 +-
src_plugins/hid_gtk/gui-utils.c | 10 +-
src_plugins/hid_gtk/gui.h | 146 +-
src_plugins/hid_gtk/win_place.c | 20 +-
src_plugins/hid_lesstif/Makefile | 2 +-
src_plugins/hid_lesstif/Plug.tmpasm | 1 +
src_plugins/hid_lesstif/dialogs.c | 245 +-
src_plugins/hid_lesstif/lesstif.h | 11 +-
src_plugins/hid_lesstif/library.c | 41 +-
src_plugins/hid_lesstif/main.c | 527 +-
src_plugins/hid_lesstif/menu.c | 157 +-
src_plugins/hid_lesstif/netlist.c | 125 +-
src_plugins/hid_lesstif/styles.c | 47 +-
src_plugins/hid_remote/Makefile | 6 +
src_plugins/hid_remote/Plug.tmpasm | 12 +
src_plugins/hid_remote/README | 6 +
src_plugins/hid_remote/base64.c | 85 +
src_plugins/hid_remote/base64.h | 29 +
src_plugins/hid_remote/proto.c | 323 +
src_plugins/hid_remote/proto.h | 46 +
src_plugins/hid_remote/proto_lowcommon.h | 80 +
src_plugins/hid_remote/proto_lowdbg.h | 21 +
src_plugins/hid_remote/proto_lowparse.h | 310 +
src_plugins/hid_remote/proto_lowsend.h | 157 +
src_plugins/hid_remote/remote.c | 436 ++
src_plugins/import_dsn/Makefile | 2 +-
src_plugins/import_dsn/dsn.c | 45 +-
src_plugins/import_edif/Makefile | 2 +-
src_plugins/import_edif/edif.c | 795 +--
src_plugins/import_edif/edif.h | 18 +-
src_plugins/import_edif/edif.y | 17 +-
src_plugins/import_edif/import_edif.c | 12 +-
src_plugins/import_hyp/Makefile | 10 +
src_plugins/import_hyp/Plug.tmpasm | 18 +
src_plugins/import_hyp/README | 5 +
src_plugins/import_hyp/hyp_l.l | 376 ++
src_plugins/import_hyp/hyp_y.y | 831 +++
src_plugins/import_hyp/import_hyp.c | 103 +
src_plugins/import_hyp/parser.c | 669 +++
src_plugins/import_hyp/parser.h | 232 +
src_plugins/import_netlist/Makefile | 2 +-
src_plugins/import_netlist/import_netlist.c | 49 +-
src_plugins/import_sch/Makefile | 2 +-
src_plugins/import_sch/import_sch.c | 138 +-
src_plugins/io_kicad/Makefile | 2 +-
src_plugins/io_kicad/README | 4 +-
src_plugins/io_kicad/io_kicad.c | 14 +-
src_plugins/io_kicad/read.c | 370 +-
src_plugins/io_kicad/read.h | 4 +-
src_plugins/io_kicad/uniq_name.c | 1 +
src_plugins/io_kicad/write.c | 393 +-
src_plugins/io_kicad/write.h | 27 +-
src_plugins/io_kicad_legacy/Makefile | 2 +-
src_plugins/io_kicad_legacy/README | 4 +-
src_plugins/io_kicad_legacy/io_kicad_legacy.c | 13 +-
src_plugins/io_kicad_legacy/write.c | 312 +-
src_plugins/io_kicad_legacy/write.h | 27 +-
src_plugins/io_lihata/Makefile | 2 +-
src_plugins/io_lihata/README | 4 +-
src_plugins/io_lihata/common.c | 6 +-
src_plugins/io_lihata/common.h | 2 +-
src_plugins/io_lihata/io_lihata.c | 14 +-
src_plugins/io_lihata/read.c | 261 +-
src_plugins/io_lihata/read.h | 3 +-
src_plugins/io_lihata/write.c | 159 +-
src_plugins/io_lihata/write.h | 2 +-
src_plugins/io_lihata/write_style.c | 1 +
src_plugins/io_pcb/Makefile | 2 +-
src_plugins/io_pcb/Plug.tmpasm | 9 +-
src_plugins/io_pcb/attribs.c | 15 +-
src_plugins/io_pcb/attribs.h | 4 +-
src_plugins/io_pcb/file.c | 274 +-
src_plugins/io_pcb/file.h | 21 +-
src_plugins/io_pcb/flags.c | 68 -
src_plugins/io_pcb/flags.h | 117 -
src_plugins/io_pcb/io_pcb.c | 30 +-
src_plugins/io_pcb/parse_common.h | 8 +-
src_plugins/io_pcb/parse_l.c | 483 +-
src_plugins/io_pcb/parse_l.h | 53 +-
src_plugins/io_pcb/parse_l.l | 123 +-
src_plugins/io_pcb/parse_y.c | 640 +-
src_plugins/io_pcb/parse_y.h | 12 +-
src_plugins/io_pcb/parse_y.y | 332 +-
src_plugins/jostle/Makefile | 2 +-
src_plugins/jostle/jostle.c | 273 +-
src_plugins/lib_gensexpr/Makefile | 2 +-
src_plugins/lib_legacy_func/Makefile | 2 +-
src_plugins/lib_legacy_func/lib_legacy_func.c | 43 +-
src_plugins/lib_legacy_func/lib_legacy_func.h | 6 +-
src_plugins/loghid/Makefile | 2 +-
src_plugins/loghid/hid-logger.c | 68 +-
src_plugins/loghid/hid-logger.h | 2 +-
src_plugins/loghid/loghid.c | 35 +-
src_plugins/mincut/Makefile | 2 +-
src_plugins/mincut/rats_mincut.c | 82 +-
src_plugins/mincut/rats_mincut.h | 2 +-
src_plugins/oldactions/Makefile | 2 +-
src_plugins/oldactions/oldactions.c | 113 +-
src_plugins/plugins_feature.tmpasm | 3 +
src_plugins/plugins_io.tmpasm | 3 +
src_plugins/polycombine/Makefile | 2 +-
src_plugins/polycombine/polycombine.c | 105 +-
src_plugins/polystitch/Makefile | 2 +-
src_plugins/polystitch/polystitch.c | 79 +-
src_plugins/propedit/Makefile | 2 +-
src_plugins/propedit/propedit.c | 21 +-
src_plugins/propedit/props.c | 17 +-
src_plugins/propedit/props.h | 7 +-
src_plugins/propedit/propsel.c | 174 +-
src_plugins/puller/Makefile | 2 +-
src_plugins/puller/puller.c | 493 +-
src_plugins/query/Makefile | 2 +-
src_plugins/query/Plug.tmpasm | 1 -
src_plugins/query/README | 4 +-
src_plugins/query/basic_fnc.c | 2 +-
src_plugins/query/query.c | 3 +-
src_plugins/query/query.h | 4 +-
src_plugins/query/query_access.c | 102 +-
src_plugins/query/query_act.c | 30 +-
src_plugins/query/query_exec.c | 9 +-
src_plugins/query/query_l.c | 373 +-
src_plugins/query/query_l.h | 53 +-
src_plugins/query/query_l.l | 15 +-
src_plugins/query/query_y.c | 136 +-
src_plugins/query/query_y.h | 12 +-
src_plugins/query/query_y.y | 10 +-
src_plugins/renumber/Makefile | 2 +-
src_plugins/renumber/renumber.c | 80 +-
src_plugins/renumber/renumberblock.c | 30 +-
src_plugins/report/Makefile | 2 +-
src_plugins/report/Plug.tmpasm | 5 +-
src_plugins/report/drill.c | 306 +
src_plugins/report/drill.h | 64 +
src_plugins/report/report.c | 449 +-
src_plugins/report/report.h | 2 +-
src_plugins/rubberband_orig/Makefile | 6 +
src_plugins/rubberband_orig/Plug.tmpasm | 8 +
src_plugins/rubberband_orig/README | 5 +
src_plugins/rubberband_orig/rubberband.c | 815 +++
src_plugins/rubberband_orig/rubberband.h | 36 +
src_plugins/shand_cmd/Makefile | 2 +-
src_plugins/shand_cmd/command.c | 79 +-
src_plugins/shand_cmd/command.h | 2 +-
src_plugins/smartdisperse/Makefile | 2 +-
src_plugins/smartdisperse/smartdisperse.c | 95 +-
src_plugins/stroke/Makefile | 2 +-
src_plugins/stroke/stroke.c | 48 +-
src_plugins/teardrops/Makefile | 2 +-
src_plugins/teardrops/teardrops.c | 104 +-
src_plugins/toporouter/Makefile | 2 +-
src_plugins/toporouter/Plug.tmpasm | 5 +-
src_plugins/toporouter/toporouter.c | 242 +-
src_plugins/toporouter/toporouter.h | 9 +-
src_plugins/vendordrill/Makefile | 2 +-
src_plugins/vendordrill/vendor.c | 187 +-
src_plugins/vendordrill/vendor.h | 2 +-
tests/Makefile | 29 +-
tests/RTT/Export.sh | 160 +
tests/RTT/Proto.pcb | 43 +
tests/RTT/README | 3 +
tests/RTT/RTT_kicad_legacy_summary.txt | 17 +
tests/RTT/RTT_kicad_summary.txt | 26 +
tests/RTT/Remote_dump.sh | 12 +
tests/RTT/Rtt.sh | 16 +
tests/RTT/Rtt_all.sh | 16 +
tests/RTT/Vailidation.txt | 33 +
tests/RTT/arc_angles.pcb | 46 +
tests/RTT/arc_f_clear.pcb | 51 +
tests/RTT/arc_normal.pcb | 47 +
tests/RTT/arc_offpage.pcb | 44 +
tests/RTT/arc_sizes.pcb | 47 +
tests/RTT/coord_rounding.pcb | 45 +
tests/RTT/default_font | 309 +
tests/RTT/elem_pads.pcb | 68 +
tests/RTT/elem_pads_ds.pcb | 53 +
tests/RTT/elem_pins.pcb | 71 +
tests/RTT/elem_sides_smd.pcb | 63 +
tests/RTT/elem_sides_trh.pcb | 71 +
tests/RTT/layer_copper.pcb | 48 +
tests/RTT/layer_outline.pcb | 48 +
tests/RTT/layer_silk.pcb | 47 +
tests/RTT/layer_spc.pcb | 43 +
tests/RTT/line_f_clear.pcb | 51 +
tests/RTT/line_normal.pcb | 47 +
tests/RTT/line_offpage.pcb | 44 +
tests/RTT/line_overlap1.pcb | 45 +
tests/RTT/line_overlap2.pcb | 45 +
tests/RTT/line_overlap3.pcb | 45 +
tests/RTT/line_overlap4.pcb | 49 +
tests/RTT/line_zerolen.pcb | 44 +
tests/RTT/netlist.pcb | 74 +
tests/RTT/netlist_ba.pcb | 81 +
tests/RTT/poly_hole.pcb | 77 +
tests/RTT/poly_rect.pcb | 59 +
tests/RTT/poly_triangle.pcb | 59 +
tests/RTT/rat.pcb | 46 +
tests/RTT/ref/Proto.bom | 7 +
tests/RTT/ref/Proto.dsn | 57 +
tests/RTT/ref/Proto.gbr/Proto.fab.gbr | 1692 ++++++
tests/RTT/ref/Proto.net | 12 +
tests/RTT/ref/Proto.png | Bin 0 -> 163 bytes
tests/RTT/ref/Proto.ps.gz | Bin 0 -> 4503 bytes
tests/RTT/ref/Proto.remote.gz | Bin 0 -> 6004 bytes
tests/RTT/ref/Proto.svg | 17 +
tests/RTT/ref/Proto.xy | 8 +
tests/RTT/ref/arc_angles.bom | 7 +
tests/RTT/ref/arc_angles.dsn | 57 +
tests/RTT/ref/arc_angles.gbr/arc_angles.fab.gbr | 1818 ++++++
tests/RTT/ref/arc_angles.gbr/arc_angles.top.gbr | 18 +
tests/RTT/ref/arc_angles.net | 12 +
tests/RTT/ref/arc_angles.png | Bin 0 -> 1494 bytes
tests/RTT/ref/arc_angles.png.text | 22 +
tests/RTT/ref/arc_angles.ps.gz | Bin 0 -> 4755 bytes
tests/RTT/ref/arc_angles.remote.gz | Bin 0 -> 6327 bytes
tests/RTT/ref/arc_angles.svg | 21 +
tests/RTT/ref/arc_angles.xy | 8 +
tests/RTT/ref/arc_f_clear.bom | 7 +
tests/RTT/ref/arc_f_clear.dsn | 57 +
tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.fab.gbr | 1758 ++++++
tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.top.gbr | 198 +
tests/RTT/ref/arc_f_clear.net | 12 +
tests/RTT/ref/arc_f_clear.png | Bin 0 -> 2873 bytes
tests/RTT/ref/arc_f_clear.png.text | 24 +
tests/RTT/ref/arc_f_clear.ps.gz | Bin 0 -> 5801 bytes
tests/RTT/ref/arc_f_clear.remote.gz | Bin 0 -> 7620 bytes
tests/RTT/ref/arc_f_clear.svg | 25 +
tests/RTT/ref/arc_f_clear.xy | 8 +
tests/RTT/ref/arc_normal.bom | 7 +
tests/RTT/ref/arc_normal.dsn | 57 +
tests/RTT/ref/arc_normal.gbr/arc_normal.fab.gbr | 1842 ++++++
tests/RTT/ref/arc_normal.gbr/arc_normal.top.gbr | 20 +
tests/RTT/ref/arc_normal.net | 12 +
tests/RTT/ref/arc_normal.png | Bin 0 -> 2475 bytes
tests/RTT/ref/arc_normal.png.text | 21 +
tests/RTT/ref/arc_normal.ps.gz | Bin 0 -> 4867 bytes
tests/RTT/ref/arc_normal.remote.gz | Bin 0 -> 6440 bytes
tests/RTT/ref/arc_normal.svg | 22 +
tests/RTT/ref/arc_normal.xy | 8 +
tests/RTT/ref/arc_offpage.bom | 7 +
tests/RTT/ref/arc_offpage.dsn | 57 +
tests/RTT/ref/arc_offpage.gbr/arc_offpage.fab.gbr | 1800 ++++++
tests/RTT/ref/arc_offpage.gbr/arc_offpage.top.gbr | 15 +
tests/RTT/ref/arc_offpage.net | 12 +
tests/RTT/ref/arc_offpage.png | Bin 0 -> 1264 bytes
tests/RTT/ref/arc_offpage.png.text | 6 +
tests/RTT/ref/arc_offpage.ps.gz | Bin 0 -> 4783 bytes
tests/RTT/ref/arc_offpage.remote.gz | Bin 0 -> 6331 bytes
tests/RTT/ref/arc_offpage.svg | 19 +
tests/RTT/ref/arc_offpage.xy | 8 +
tests/RTT/ref/arc_sizes.bom | 7 +
tests/RTT/ref/arc_sizes.dsn | 57 +
tests/RTT/ref/arc_sizes.gbr/arc_sizes.fab.gbr | 1812 ++++++
tests/RTT/ref/arc_sizes.gbr/arc_sizes.top.gbr | 52 +
tests/RTT/ref/arc_sizes.net | 12 +
tests/RTT/ref/arc_sizes.png | Bin 0 -> 809 bytes
tests/RTT/ref/arc_sizes.png.text | 17 +
tests/RTT/ref/arc_sizes.ps.gz | Bin 0 -> 4704 bytes
tests/RTT/ref/arc_sizes.remote.gz | Bin 0 -> 6336 bytes
tests/RTT/ref/arc_sizes.svg | 21 +
tests/RTT/ref/arc_sizes.xy | 8 +
tests/RTT/ref/clearance.bom | 7 +
tests/RTT/ref/clearance.dsn | 59 +
tests/RTT/ref/clearance.gbr/clearance.fab.gbr | 1692 ++++++
tests/RTT/ref/clearance.gbr/clearance.top.gbr | 44 +
tests/RTT/ref/clearance.net | 12 +
tests/RTT/ref/clearance.png | Bin 0 -> 771 bytes
tests/RTT/ref/clearance.png.text | 11 +
tests/RTT/ref/clearance.ps.gz | Bin 0 -> 4698 bytes
tests/RTT/ref/clearance.remote.gz | Bin 0 -> 6278 bytes
tests/RTT/ref/clearance.svg | 20 +
tests/RTT/ref/clearance.xy | 8 +
tests/RTT/ref/coord_rounding.bom | 7 +
tests/RTT/ref/coord_rounding.dsn | 61 +
.../ref/coord_rounding.gbr/coord_rounding.fab.gbr | 1848 ++++++
.../ref/coord_rounding.gbr/coord_rounding.top.gbr | 15 +
tests/RTT/ref/coord_rounding.net | 12 +
tests/RTT/ref/coord_rounding.png | Bin 0 -> 878 bytes
tests/RTT/ref/coord_rounding.png.text | 5 +
tests/RTT/ref/coord_rounding.ps.gz | Bin 0 -> 4767 bytes
tests/RTT/ref/coord_rounding.remote.gz | Bin 0 -> 6459 bytes
tests/RTT/ref/coord_rounding.svg | 20 +
tests/RTT/ref/coord_rounding.xy | 8 +
tests/RTT/ref/elem_pads.bom | 9 +
tests/RTT/ref/elem_pads.dsn | 82 +
tests/RTT/ref/elem_pads.gbr/elem_pads.fab.gbr | 1788 ++++++
tests/RTT/ref/elem_pads.gbr/elem_pads.top.gbr | 21 +
tests/RTT/ref/elem_pads.gbr/elem_pads.topmask.gbr | 21 +
tests/RTT/ref/elem_pads.gbr/elem_pads.toppaste.gbr | 21 +
tests/RTT/ref/elem_pads.gbr/elem_pads.topsilk.gbr | 39 +
tests/RTT/ref/elem_pads.net | 19 +
tests/RTT/ref/elem_pads.png | Bin 0 -> 1244 bytes
tests/RTT/ref/elem_pads.ps.gz | Bin 0 -> 5014 bytes
tests/RTT/ref/elem_pads.remote.gz | Bin 0 -> 6721 bytes
tests/RTT/ref/elem_pads.svg | 50 +
tests/RTT/ref/elem_pads.xy | 10 +
tests/RTT/ref/elem_pads_ds.bom | 8 +
tests/RTT/ref/elem_pads_ds.dsn | 72 +
.../ref/elem_pads_ds.gbr/elem_pads_ds.bottom.gbr | 14 +
.../elem_pads_ds.gbr/elem_pads_ds.bottommask.gbr | 14 +
.../elem_pads_ds.gbr/elem_pads_ds.bottompaste.gbr | 14 +
.../RTT/ref/elem_pads_ds.gbr/elem_pads_ds.fab.gbr | 1794 ++++++
.../RTT/ref/elem_pads_ds.gbr/elem_pads_ds.top.gbr | 14 +
.../ref/elem_pads_ds.gbr/elem_pads_ds.topmask.gbr | 14 +
.../ref/elem_pads_ds.gbr/elem_pads_ds.toppaste.gbr | 14 +
.../ref/elem_pads_ds.gbr/elem_pads_ds.topsilk.gbr | 14 +
tests/RTT/ref/elem_pads_ds.png | Bin 0 -> 1456 bytes
tests/RTT/ref/elem_pads_ds.ps.gz | Bin 0 -> 4769 bytes
tests/RTT/ref/elem_pads_ds.remote.gz | Bin 0 -> 6381 bytes
tests/RTT/ref/elem_pads_ds.svg | 23 +
tests/RTT/ref/elem_pads_ds.xy | 9 +
tests/RTT/ref/elem_pins.bom | 8 +
tests/RTT/ref/elem_pins.dsn | 79 +
.../RTT/ref/elem_pins.gbr/elem_pins.bottommask.gbr | 41 +
tests/RTT/ref/elem_pins.gbr/elem_pins.fab.gbr | 1834 ++++++
tests/RTT/ref/elem_pins.gbr/elem_pins.topmask.gbr | 41 +
tests/RTT/ref/elem_pins.net | 16 +
tests/RTT/ref/elem_pins.png | Bin 0 -> 3181 bytes
tests/RTT/ref/elem_pins.ps.gz | Bin 0 -> 5488 bytes
tests/RTT/ref/elem_pins.remote.gz | Bin 0 -> 7184 bytes
tests/RTT/ref/elem_pins.svg | 92 +
tests/RTT/ref/elem_pins.xy | 10 +
tests/RTT/ref/elem_sides_smd.bom | 8 +
tests/RTT/ref/elem_sides_smd.dsn | 75 +
.../elem_sides_smd.gbr/elem_sides_smd.bottom.gbr | 15 +
.../elem_sides_smd.bottommask.gbr | 15 +
.../elem_sides_smd.bottompaste.gbr | 15 +
.../elem_sides_smd.bottomsilk.gbr | 29 +
.../ref/elem_sides_smd.gbr/elem_sides_smd.fab.gbr | 1770 ++++++
.../ref/elem_sides_smd.gbr/elem_sides_smd.top.gbr | 15 +
.../elem_sides_smd.gbr/elem_sides_smd.topmask.gbr | 15 +
.../elem_sides_smd.gbr/elem_sides_smd.toppaste.gbr | 15 +
.../elem_sides_smd.gbr/elem_sides_smd.topsilk.gbr | 26 +
tests/RTT/ref/elem_sides_smd.net | 16 +
tests/RTT/ref/elem_sides_smd.png | Bin 0 -> 1704 bytes
tests/RTT/ref/elem_sides_smd.ps.gz | Bin 0 -> 4993 bytes
tests/RTT/ref/elem_sides_smd.remote.gz | Bin 0 -> 6647 bytes
tests/RTT/ref/elem_sides_smd.svg | 36 +
tests/RTT/ref/elem_sides_smd.xy | 10 +
tests/RTT/ref/elem_sides_trh.bom | 8 +
tests/RTT/ref/elem_sides_trh.dsn | 79 +
.../elem_sides_trh.bottommask.gbr | 28 +
.../ref/elem_sides_trh.gbr/elem_sides_trh.fab.gbr | 1864 ++++++
.../elem_sides_trh.gbr/elem_sides_trh.topmask.gbr | 28 +
tests/RTT/ref/elem_sides_trh.net | 16 +
tests/RTT/ref/elem_sides_trh.png | Bin 0 -> 2073 bytes
tests/RTT/ref/elem_sides_trh.ps.gz | Bin 0 -> 5360 bytes
tests/RTT/ref/elem_sides_trh.remote.gz | Bin 0 -> 7122 bytes
tests/RTT/ref/elem_sides_trh.svg | 75 +
tests/RTT/ref/elem_sides_trh.xy | 10 +
tests/RTT/ref/layer_copper.bom | 7 +
tests/RTT/ref/layer_copper.dsn | 63 +
.../ref/layer_copper.gbr/layer_copper.bottom.gbr | 14 +
.../RTT/ref/layer_copper.gbr/layer_copper.fab.gbr | 1824 ++++++
.../ref/layer_copper.gbr/layer_copper.group2.gbr | 14 +
.../RTT/ref/layer_copper.gbr/layer_copper.top.gbr | 14 +
tests/RTT/ref/layer_copper.net | 12 +
tests/RTT/ref/layer_copper.png | Bin 0 -> 2288 bytes
tests/RTT/ref/layer_copper.ps.gz | Bin 0 -> 4792 bytes
tests/RTT/ref/layer_copper.remote.gz | Bin 0 -> 6378 bytes
tests/RTT/ref/layer_copper.svg | 23 +
tests/RTT/ref/layer_copper.xy | 8 +
tests/RTT/ref/layer_outline.bom | 7 +
tests/RTT/ref/layer_outline.dsn | 63 +
.../ref/layer_outline.gbr/layer_outline.fab.gbr | 1126 ++++
.../layer_outline.gbr/layer_outline.outline.gbr | 16 +
tests/RTT/ref/layer_outline.net | 12 +
tests/RTT/ref/layer_outline.png | Bin 0 -> 1908 bytes
tests/RTT/ref/layer_outline.ps.gz | Bin 0 -> 3551 bytes
tests/RTT/ref/layer_outline.remote.gz | Bin 0 -> 4335 bytes
tests/RTT/ref/layer_outline.svg | 19 +
tests/RTT/ref/layer_outline.xy | 8 +
tests/RTT/ref/layer_silk.bom | 7 +
tests/RTT/ref/layer_silk.dsn | 57 +
.../ref/layer_silk.gbr/layer_silk.bottomsilk.gbr | 14 +
tests/RTT/ref/layer_silk.gbr/layer_silk.fab.gbr | 1770 ++++++
.../RTT/ref/layer_silk.gbr/layer_silk.topsilk.gbr | 14 +
tests/RTT/ref/layer_silk.net | 12 +
tests/RTT/ref/layer_silk.png | Bin 0 -> 722 bytes
tests/RTT/ref/layer_silk.png.text | 6 +
tests/RTT/ref/layer_silk.ps.gz | Bin 0 -> 4638 bytes
tests/RTT/ref/layer_silk.remote.gz | Bin 0 -> 6216 bytes
tests/RTT/ref/layer_silk.svg | 19 +
tests/RTT/ref/layer_silk.xy | 8 +
tests/RTT/ref/layer_spc.bom | 7 +
tests/RTT/ref/layer_spc.dsn | 57 +
tests/RTT/ref/layer_spc.gbr/layer_spc.fab.gbr | 1908 ++++++
tests/RTT/ref/layer_spc.net | 12 +
tests/RTT/ref/layer_spc.png | Bin 0 -> 163 bytes
tests/RTT/ref/layer_spc.ps.gz | Bin 0 -> 4813 bytes
tests/RTT/ref/layer_spc.remote.gz | Bin 0 -> 6505 bytes
tests/RTT/ref/layer_spc.svg | 15 +
tests/RTT/ref/layer_spc.xy | 8 +
tests/RTT/ref/line_f_clear.bom | 7 +
tests/RTT/ref/line_f_clear.dsn | 65 +
.../RTT/ref/line_f_clear.gbr/line_f_clear.fab.gbr | 1763 ++++++
.../RTT/ref/line_f_clear.gbr/line_f_clear.top.gbr | 125 +
tests/RTT/ref/line_f_clear.net | 12 +
tests/RTT/ref/line_f_clear.png | Bin 0 -> 1519 bytes
tests/RTT/ref/line_f_clear.png.text | 23 +
tests/RTT/ref/line_f_clear.ps.gz | Bin 0 -> 5278 bytes
tests/RTT/ref/line_f_clear.remote.gz | Bin 0 -> 6936 bytes
tests/RTT/ref/line_f_clear.svg | 24 +
tests/RTT/ref/line_f_clear.xy | 8 +
tests/RTT/ref/line_normal.bom | 7 +
tests/RTT/ref/line_normal.dsn | 65 +
tests/RTT/ref/line_normal.gbr/line_normal.fab.gbr | 1839 ++++++
tests/RTT/ref/line_normal.gbr/line_normal.top.gbr | 20 +
tests/RTT/ref/line_normal.net | 12 +
tests/RTT/ref/line_normal.png | Bin 0 -> 1560 bytes
tests/RTT/ref/line_normal.ps.gz | Bin 0 -> 4819 bytes
tests/RTT/ref/line_normal.remote.gz | Bin 0 -> 6429 bytes
tests/RTT/ref/line_normal.svg | 22 +
tests/RTT/ref/line_normal.xy | 8 +
tests/RTT/ref/line_offpage.bom | 7 +
tests/RTT/ref/line_offpage.dsn | 59 +
.../RTT/ref/line_offpage.gbr/line_offpage.fab.gbr | 1884 ++++++
.../RTT/ref/line_offpage.gbr/line_offpage.top.gbr | 14 +
tests/RTT/ref/line_offpage.net | 12 +
tests/RTT/ref/line_offpage.png | Bin 0 -> 739 bytes
tests/RTT/ref/line_offpage.ps.gz | Bin 0 -> 4848 bytes
tests/RTT/ref/line_offpage.remote.gz | Bin 0 -> 6544 bytes
tests/RTT/ref/line_offpage.svg | 19 +
tests/RTT/ref/line_offpage.xy | 8 +
tests/RTT/ref/line_overlap1.bom | 7 +
tests/RTT/ref/line_overlap1.dsn | 61 +
.../ref/line_overlap1.gbr/line_overlap1.fab.gbr | 1802 ++++++
.../ref/line_overlap1.gbr/line_overlap1.top.gbr | 15 +
tests/RTT/ref/line_overlap1.net | 12 +
tests/RTT/ref/line_overlap1.png | Bin 0 -> 771 bytes
tests/RTT/ref/line_overlap1.ps.gz | Bin 0 -> 4733 bytes
tests/RTT/ref/line_overlap1.remote.gz | Bin 0 -> 6354 bytes
tests/RTT/ref/line_overlap1.svg | 20 +
tests/RTT/ref/line_overlap1.xy | 8 +
tests/RTT/ref/line_overlap2.bom | 7 +
tests/RTT/ref/line_overlap2.dsn | 61 +
.../ref/line_overlap2.gbr/line_overlap2.fab.gbr | 1838 ++++++
.../ref/line_overlap2.gbr/line_overlap2.top.gbr | 15 +
tests/RTT/ref/line_overlap2.net | 12 +
tests/RTT/ref/line_overlap2.png | Bin 0 -> 765 bytes
tests/RTT/ref/line_overlap2.ps.gz | Bin 0 -> 4794 bytes
tests/RTT/ref/line_overlap2.remote.gz | Bin 0 -> 6445 bytes
tests/RTT/ref/line_overlap2.svg | 20 +
tests/RTT/ref/line_overlap2.xy | 8 +
tests/RTT/ref/line_overlap3.bom | 7 +
tests/RTT/ref/line_overlap3.dsn | 61 +
.../ref/line_overlap3.gbr/line_overlap3.fab.gbr | 1803 ++++++
.../ref/line_overlap3.gbr/line_overlap3.top.gbr | 15 +
tests/RTT/ref/line_overlap3.net | 12 +
tests/RTT/ref/line_overlap3.png | Bin 0 -> 765 bytes
tests/RTT/ref/line_overlap3.ps.gz | Bin 0 -> 4734 bytes
tests/RTT/ref/line_overlap3.remote.gz | Bin 0 -> 6351 bytes
tests/RTT/ref/line_overlap3.svg | 20 +
tests/RTT/ref/line_overlap3.xy | 8 +
tests/RTT/ref/line_overlap4.bom | 7 +
tests/RTT/ref/line_overlap4.dsn | 61 +
.../ref/line_overlap4.gbr/line_overlap4.fab.gbr | 1929 ++++++
.../ref/line_overlap4.gbr/line_overlap4.top.gbr | 46 +
tests/RTT/ref/line_overlap4.net | 12 +
tests/RTT/ref/line_overlap4.png | Bin 0 -> 827 bytes
tests/RTT/ref/line_overlap4.ps.gz | Bin 0 -> 5038 bytes
tests/RTT/ref/line_overlap4.remote.gz | Bin 0 -> 6843 bytes
tests/RTT/ref/line_overlap4.svg | 21 +
tests/RTT/ref/line_overlap4.xy | 8 +
tests/RTT/ref/line_zerolen.bom | 7 +
tests/RTT/ref/line_zerolen.dsn | 59 +
.../RTT/ref/line_zerolen.gbr/line_zerolen.fab.gbr | 1764 ++++++
.../RTT/ref/line_zerolen.gbr/line_zerolen.top.gbr | 14 +
tests/RTT/ref/line_zerolen.net | 12 +
tests/RTT/ref/line_zerolen.png | Bin 0 -> 788 bytes
tests/RTT/ref/line_zerolen.ps.gz | Bin 0 -> 4710 bytes
tests/RTT/ref/line_zerolen.remote.gz | Bin 0 -> 6261 bytes
tests/RTT/ref/line_zerolen.svg | 19 +
tests/RTT/ref/line_zerolen.xy | 8 +
tests/RTT/ref/netlist.bom | 8 +
tests/RTT/ref/netlist.dsn | 80 +
tests/RTT/ref/netlist.gbr/netlist.bottommask.gbr | 23 +
tests/RTT/ref/netlist.gbr/netlist.fab.gbr | 1834 ++++++
tests/RTT/ref/netlist.gbr/netlist.topmask.gbr | 23 +
tests/RTT/ref/netlist.net | 16 +
tests/RTT/ref/netlist.png | Bin 0 -> 2179 bytes
tests/RTT/ref/netlist.ps.gz | Bin 0 -> 5253 bytes
tests/RTT/ref/netlist.remote.gz | Bin 0 -> 6880 bytes
tests/RTT/ref/netlist.svg | 75 +
tests/RTT/ref/netlist.xy | 9 +
tests/RTT/ref/netlist_ba.bom | 8 +
tests/RTT/ref/netlist_ba.dsn | 80 +
.../ref/netlist_ba.gbr/netlist_ba.bottommask.gbr | 23 +
tests/RTT/ref/netlist_ba.gbr/netlist_ba.fab.gbr | 2008 +++++++
.../RTT/ref/netlist_ba.gbr/netlist_ba.topmask.gbr | 23 +
tests/RTT/ref/netlist_ba.net | 16 +
tests/RTT/ref/netlist_ba.png | Bin 0 -> 2179 bytes
tests/RTT/ref/netlist_ba.ps.gz | Bin 0 -> 5458 bytes
tests/RTT/ref/netlist_ba.remote.gz | Bin 0 -> 7309 bytes
tests/RTT/ref/netlist_ba.svg | 75 +
tests/RTT/ref/netlist_ba.xy | 9 +
tests/RTT/ref/poly_hole.bom | 7 +
tests/RTT/ref/poly_hole.dsn | 57 +
tests/RTT/ref/poly_hole.gbr/poly_hole.fab.gbr | 1740 ++++++
tests/RTT/ref/poly_hole.gbr/poly_hole.top.gbr | 100 +
tests/RTT/ref/poly_hole.net | 12 +
tests/RTT/ref/poly_hole.png | Bin 0 -> 3254 bytes
tests/RTT/ref/poly_hole.ps.gz | Bin 0 -> 4814 bytes
tests/RTT/ref/poly_hole.remote.gz | Bin 0 -> 6497 bytes
tests/RTT/ref/poly_hole.svg | 27 +
tests/RTT/ref/poly_hole.xy | 8 +
tests/RTT/ref/poly_rect.bom | 7 +
tests/RTT/ref/poly_rect.dsn | 57 +
tests/RTT/ref/poly_rect.gbr/poly_rect.fab.gbr | 1785 ++++++
tests/RTT/ref/poly_rect.gbr/poly_rect.top.gbr | 37 +
tests/RTT/ref/poly_rect.net | 12 +
tests/RTT/ref/poly_rect.png | Bin 0 -> 569 bytes
tests/RTT/ref/poly_rect.ps.gz | Bin 0 -> 4775 bytes
tests/RTT/ref/poly_rect.remote.gz | Bin 0 -> 6345 bytes
tests/RTT/ref/poly_rect.svg | 22 +
tests/RTT/ref/poly_rect.xy | 8 +
tests/RTT/ref/poly_triangle.bom | 7 +
tests/RTT/ref/poly_triangle.dsn | 57 +
.../ref/poly_triangle.gbr/poly_triangle.fab.gbr | 1779 ++++++
.../ref/poly_triangle.gbr/poly_triangle.top.gbr | 33 +
tests/RTT/ref/poly_triangle.net | 12 +
tests/RTT/ref/poly_triangle.png | Bin 0 -> 2841 bytes
tests/RTT/ref/poly_triangle.png.text | 31 +
tests/RTT/ref/poly_triangle.ps.gz | Bin 0 -> 4757 bytes
tests/RTT/ref/poly_triangle.remote.gz | Bin 0 -> 6330 bytes
tests/RTT/ref/poly_triangle.svg | 22 +
tests/RTT/ref/poly_triangle.xy | 8 +
tests/RTT/ref/rat.bom | 7 +
tests/RTT/ref/rat.dsn | 57 +
tests/RTT/ref/rat.gbr/rat.fab.gbr | 1686 ++++++
tests/RTT/ref/rat.net | 12 +
tests/RTT/ref/rat.png | Bin 0 -> 163 bytes
tests/RTT/ref/rat.ps.gz | Bin 0 -> 4487 bytes
tests/RTT/ref/rat.remote.gz | Bin 0 -> 6038 bytes
tests/RTT/ref/rat.svg | 17 +
tests/RTT/ref/rat.xy | 8 +
tests/RTT/ref/text_rot.bom | 7 +
tests/RTT/ref/text_rot.dsn | 57 +
tests/RTT/ref/text_rot.gbr/text_rot.fab.gbr | 1950 ++++++
tests/RTT/ref/text_rot.gbr/text_rot.topsilk.gbr | 60 +
tests/RTT/ref/text_rot.net | 12 +
tests/RTT/ref/text_rot.png | Bin 0 -> 1751 bytes
tests/RTT/ref/text_rot.ps.gz | Bin 0 -> 4049 bytes
tests/RTT/ref/text_rot.remote.gz | Bin 0 -> 5378 bytes
tests/RTT/ref/text_rot.svg | 65 +
tests/RTT/ref/text_rot.xy | 8 +
tests/RTT/ref/text_scale.bom | 7 +
tests/RTT/ref/text_scale.dsn | 57 +
tests/RTT/ref/text_scale.gbr/text_scale.fab.gbr | 1980 ++++++
.../RTT/ref/text_scale.gbr/text_scale.topsilk.gbr | 52 +
tests/RTT/ref/text_scale.net | 12 +
tests/RTT/ref/text_scale.png | Bin 0 -> 1737 bytes
tests/RTT/ref/text_scale.png.text | 23 +
tests/RTT/ref/text_scale.ps.gz | Bin 0 -> 4034 bytes
tests/RTT/ref/text_scale.remote.gz | Bin 0 -> 5390 bytes
tests/RTT/ref/text_scale.svg | 56 +
tests/RTT/ref/text_scale.xy | 8 +
tests/RTT/ref/text_sides.bom | 7 +
tests/RTT/ref/text_sides.dsn | 57 +
.../ref/text_sides.gbr/text_sides.bottomsilk.gbr | 25 +
tests/RTT/ref/text_sides.gbr/text_sides.fab.gbr | 1974 ++++++
.../RTT/ref/text_sides.gbr/text_sides.topsilk.gbr | 22 +
tests/RTT/ref/text_sides.net | 12 +
tests/RTT/ref/text_sides.png | Bin 0 -> 904 bytes
tests/RTT/ref/text_sides.ps.gz | Bin 0 -> 3756 bytes
tests/RTT/ref/text_sides.remote.gz | Bin 0 -> 5161 bytes
tests/RTT/ref/text_sides.svg | 27 +
tests/RTT/ref/text_sides.xy | 8 +
tests/RTT/ref/thermal_last.bom | 7 +
tests/RTT/ref/thermal_last.dsn | 67 +
.../RTT/ref/thermal_last.gbr/thermal_last.fab.gbr | 2136 +++++++
.../ref/thermal_last.gbr/thermal_last.group2.gbr | 58 +
.../ref/thermal_last.gbr/thermal_last.group3.gbr | 118 +
tests/RTT/ref/thermal_last.net | 13 +
tests/RTT/ref/thermal_last.png | Bin 0 -> 2182 bytes
tests/RTT/ref/thermal_last.ps.gz | Bin 0 -> 15871 bytes
tests/RTT/ref/thermal_last.remote.gz | Bin 0 -> 18910 bytes
tests/RTT/ref/thermal_last.svg | 35 +
tests/RTT/ref/thermal_last.xy | 8 +
tests/RTT/ref/thermal_layer.bom | 7 +
tests/RTT/ref/thermal_layer.dsn | 85 +
.../ref/thermal_layer.gbr/thermal_layer.bottom.gbr | 67 +
.../ref/thermal_layer.gbr/thermal_layer.fab.gbr | 1896 ++++++
.../ref/thermal_layer.gbr/thermal_layer.top.gbr | 315 +
tests/RTT/ref/thermal_layer.net | 16 +
tests/RTT/ref/thermal_layer.png | Bin 0 -> 3630 bytes
tests/RTT/ref/thermal_layer.ps.gz | Bin 0 -> 7151 bytes
tests/RTT/ref/thermal_layer.remote.gz | Bin 0 -> 9025 bytes
tests/RTT/ref/thermal_layer.svg | 68 +
tests/RTT/ref/thermal_layer.xy | 8 +
tests/RTT/text_rot.pcb | 95 +
tests/RTT/text_scale.pcb | 87 +
tests/RTT/text_sides.pcb | 74 +
tests/RTT/thermal_last.pcb | 826 +++
tests/RTT/thermal_layer.pcb | 81 +
tests/conf/Makefile | 14 +-
tests/conf/conftest.c | 52 +-
tests/conf/tests/Makefile | 3 +-
tests/gsch2pcb-rnd/Makefile | 12 +
tests/gsch2pcb-rnd/simple/Makefile | 2 +-
tests/pcb-printf/Makefile | 15 +-
tests/pcb-printf/prcli.c | 8 +-
tests/pcb-printf/tester.c | 11 +-
tests/pcb-printf/tester.ref | 50 +-
tests/pcbflags/Makefile | 7 +-
tests/pcbflags/test.sh | 13 +-
tests/propedit/Makefile | 10 +-
tests/propedit/tester.c | 18 +
tests/remote/Makefile | 16 +
tests/remote/bin.msg | 6 +
tests/remote/bin.ref | 18 +
tests/remote/lists.msg | 1 +
tests/remote/lists.ref | 16 +
tests/remote/simple.msg | 2 +
tests/remote/simple.ref | 6 +
tests/remote/test_all.sh | 23 +
tests/remote/test_parse.c | 41 +
tests/remote/text.msg | 1 +
tests/remote/text.ref | 9 +
tests/strflags/Makefile | 4 +-
tests/strflags/tester.c | 53 +-
tests/uniq_name/Makefile | 8 +-
tests/uniq_name/tester.c | 10 +-
util/Makefile | 14 +-
util/devhelpers/chgstat.sh | 8 +-
util/devhelpers/inc_valid.sh | 56 +
util/devhelpers/pcb-rtrip | 9 +-
util/devhelpers/renamea.sh | 10 +
util/devhelpers/renamef.sh | 8 +
util/devhelpers/renameo.sh | 9 +
util/gsch2pcb-rnd/Makefile.in | 19 +-
util/gsch2pcb-rnd/glue.c | 14 +-
util/gsch2pcb-rnd/gsch2pcb.c | 128 +-
util/gsch2pcb-rnd/gsch2pcb.h | 2 +
util/gsch2pcb-rnd/gsch2pcb_rnd_conf.h | 1 +
util/gsch2pcb-rnd/method.h | 1 +
util/gsch2pcb-rnd/method_import.c | 3 +
util/gsch2pcb-rnd/method_pcb.c | 19 +-
util/gsch2pcb-rnd/netlister.c | 3 +
util/keylist.sh | 16 +-
util/pcb-prj2lht | 158 +
util/pcblib-param.cgi | 4 +-
1626 files changed, 146210 insertions(+), 46198 deletions(-)
diff --git a/Changelog b/Changelog
index a580f77..f6cda84 100644
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,130 @@
-pcb-rnd 1.1.4 (r5778)
+pcb-rnd 1.2.0 (r5967)
~~~~~~~~~~~~~~~~~~~~~
+ [unravel]
+ - Cleanup: reorganize the code around object types instead of the old, action-oriented approach
+ - Cleanup: prefix almost all core symbols with pcb_ or PCB_ so the code can be reused as a lib later
+
+ [doc]
+ -Add: start writing a new user doc
+
+ [arc]
+ -Fix: broken is-point-on-arc check for large angles (thanks Evan for the bugreport)
+ -Add: angle/radius edit UI
+
+ [conf]
+ -Fix: don't crash on empty project file
+ -Fix: when creating a new project file root, use the geda project file hash, not the pcb-rnd-config node - the project file is shared among programs
+
+ [gerber]
+ -Fix: emulate 0 long arc with a 0 long line to work around a gerbv bug
+ -Fix: simpler "do we print this layer?" logics, without caching
+ -Workaround: split >180 deg arcs because some viewers (e.g. gerbv) have hard time interpreting them
+
+ [gtk]
+ -Fix: <custom> route style logics: start out with the copy of style 0; after a deletion inherit the sizes from the deleted style
+ -Fix: don't reuse the static conf chg binding struct of fullscreen with solder side swap - it'll probably ruin both
+ -Fix: update bottom status line after flipping the board
+
+ [mods]
+ -Move: drill.[ch] to the report plugin
+ -Move: original rubberband code into a feature plugin
+ -Cleanup: convert some GUI HID actions to events so that multiple GUIs can bind to them
+ -Add: plugin frame for import_hyp
+ -Add: remote plugin (HID-level remote control over sockets)
+ -Add: draw_fab plugin behind a stub, move draw fab code from core to the new plugin
+ -Add: new export plugin: export_stat (board statistics)
+
+ [io]
+ -Add: an extra flag bit to allow non-fatal loads; make sure missing default.pcb doesn't generate an error message
+ -Add: proper handling of multiple file formats and file name extensions
+ -Fix: add new test parse call - fixes false alarm parser error messages
+ -Fix: don't change format on backup and tmp saves
+ -Fix: don't throw the "no font" warnign after loading a footprint because footprints are expected not to have font embedded
+
+ [io_kicad]
+ - Save and load in the kicad s-expression format
+
+ [io_lihata]
+ -Fix: don't save invalid nodes in the canonical format (backup saves)
+ -Add: (somewhat selectively) save and load the config subtree
+ -Add: one more emergency save on lihata merge failure and verbose error message with instructions
+
+ [layer]
+ -Cleanup: convert magic number macros to enum
+ -Cleanup: introduce layer id and layer group id types
+ -Cleanup: more explicit virtual layers
+ -Cleanup: remove the old layer API, including all the SL_ macros
+ -Cleanup: renames and refactoring to make the logical layer vs. physical layer concept more clear
+ -Split: move layer visibility (stack) functions out of layer.c
+ -Rename: mask layer names: use top/bottom instead of component/solder for consistency
+ -Add: UI layers (dynamic allocated debug layers with permanent objects)
+ -Add: new layer name generator, based on flags and virtual layer names
+
+ [pcblib-param]
+ -Fix: don't lose pad thickness unit when calculating new defaults for qf()
+ -Change: center pad of qf() is generated with no-paste (requested by John G)
+ -Add: qf() center pad paste matrix option (requested by John G)
+ -Add: qf() central pad mask option with cpad_mask; when not set, calculate it from pad geometry
+ -Add: qf() got a new rpad_round boolean; when manually set to true, generates round pads
+
+ [svg]
+ -Fix: arc support: use the large and sweep flags of svg path arc to get true PCB arcs
+ -Workaround: full circle arcs - the two endpoints should differ
+ -Workaround: make endpoints differ in a 0 deg long arc
+
+ [tests]
+ -Cleanup: update and enable most of the tests, unified output, central make test
+
+ [util]
+ -Add: prj2lht: script to convert old projects to new
+ -Fix: install the import schematics scm script in our own LIBDIR, because it's not reliable to find the gschem installation, rather use -L for gnetlist
+
+ [scconfig]
+ -Change: use $(MAKE) instead of make - this allows GNU make to run recursive parallel compilations (reported by Dima)
+ -Change: disable bison by default; use --enable-bison for developing the grammar
+ -Change: do not use gts for anything if toporouter is not configured
+ -Add: extra error if explicitly requested things differ from the results we got
+ -Add: make clean/distclean removes more scconfig related leftovers
+ -Add: optional support for DESTDIR for Debian
+
+ [core]
+ -Fix: C89: do not depend on <strings.h> or strcasecmp, implement our own
+ -Fix: HID API bug: invalidate_lr needs pcb_coord_t instead of int
+ -Fix: action Netlist() subcommand add modifies the INPUT netlist, not the EDITED because this is used bu import_sch
+ -Fix: attribute deletion by index didn't move all items properly (affects mainline as well)
+ -Fix: disable cycledrag when rubberband is enabled (they are incompatible)
+ -Fix: don't close a polygon twice on normal finish (fixes the excess need 3-point error message)
+ -Fix: don't crash when a pin/pad number is NULL
+ -Fix: don't warn for second hit on a plugin already loaded as long as the hash is the same
+ -Fix: get rid of pointerlist in favor of vtptr
+ -Fix: incorrect flag struct comparison; may have caused unpredictable undo bugs
+ -Fix: line-line intersect code detects and handles the corner case of parallel lines properly (checking wheter endpoints of lines are on the other line)
+ -Fix: make data bounding box function reentrant
+ -Fix: make move macros safer with the standard do { } while(0) wrapping
+ -Fix: make text, arc, line, pad, pin/via move macro safe: don't evaluate arguments twice, wrap in do {} while
+ -Fix: move an object by 0 pixels shouldn't inhibit all subsequent redraw
+ -Fix: negative selection box: limit box coord orders to two canonical forms, one positive, and one negative (fixes north-east to south-west selection on component-side view)
+ -Fix: pin move is really the same thing as via move, use the same macro
+ -Fix: polygon mirror should update the rtree (reported by Chad)
+ -Fix: rename old, gui-hid-defined Export() actions to ExportGUI (matching the ImportGUI()) - Export() is the name of the builtin, core action
+ -Fix: text rtree handling bug: EraseText should NOT have the side effect of removing the text from the rtree but the callers should do all rtree manipulation as needed
+ -Fix: undo text flag bug: add text join undo as text flag change, not as line flag change
+ -Fix: update rtree when mirroring arc in buffer
+ -Fix: use COORD_MAX for large coord values, don't assume coords will be 32 bits
+ -Fix: use the hid name passed with --gui, even if --gui is not the first argument; also allow using --hid instead of --gui (less confusing)
+ -Fix: when snap off, don't crash when action helper is trying to figure the endpoint of an arc
+ -Cleanup: classify all messages to be warnings, errors or info - no more PCB_MSG_DEFAULT
+ -Cleanup: remove unsafe (non-reentrant) arc ends query
+ -Add: --dump-plugins --dump-plugindirs CLI commands and DumpPlugins() and DumpPluginDirs() actions
+ -Add: central Export() action instead of gui-specific ones - this works without a GUI HID
+ -Add: conf setting to disable negative-box selection
+ -Add: conf setting to make negative-box selection symmetric (ignore Y coord sign)
+ -Add: support route style attributes
+
+pcb-rnd 1.1.4
+~~~~~~~~~~~~~
+ (1.1.4 is really an 1.1.3 with some bugfixes backported from 1.2.0)
+
[gsch2pcb-rnd]
-Add: method infrastructure
-Add: a method that uses the same mechanism as import_sch
diff --git a/INSTALL b/INSTALL
index bbe682e..41fc3c9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,7 +15,7 @@ cd src && ./pcb-rnd
(Note: it is important to cd to src to run pcb-rnd from source; src/pcb-rnd
won't work unless pcb-rnd is installed).
-If this doesn't work, please refer to doc-rnd/UNIX.txt or doc-rnd/mac.txt
+If this doesn't work, please refer to doc/UNIX.txt or doc-rnd/mac.txt
--
diff --git a/Makefile b/Makefile
index 9bfe337..155fc7e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,43 +1,51 @@
all: FORCE
- cd src && make
- cd util && make
- cd pcblib && make
-# cd doc-rnd && make
+ cd src && $(MAKE)
+ cd util && $(MAKE)
+ cd pcblib && $(MAKE)
+# cd doc && $(MAKE)
+
+test: FORCE
+ cd tests && $(MAKE) test
clean: FORCE
- cd src && make clean
- cd util && make clean
- cd pcblib && make clean
- cd doc-rnd && make clean
+ cd src && $(MAKE) clean
+ cd util && $(MAKE) clean
+ cd pcblib && $(MAKE) clean
+# cd doc && $(MAKE) clean
+ cd tests && $(MAKE) clean
+ cd src_3rd/sphash && $(MAKE) clean
distclean: FORCE
- make clean ; true
- cd doc-rnd && make distclean
- cd scconfig && make clean ; true
- cd src_3rd/genlist && make clean ; true
- cd src_3rd/genregex && make clean ; true
- cd src_3rd/genvector && make clean ; true
- cd src_3rd/gts && make clean ; true
- cd src_3rd/liblihata && make clean ; true
- cd src_3rd/liblihata/genht && make clean ; true
- cd src_3rd/qparse && make clean ; true
+ $(MAKE) clean ; true
+# cd doc && $(MAKE) distclean
+ cd src && $(MAKE) distclean
+ cd util/gsch2pcb-rnd && $(MAKE) distclean
+ cd src_3rd/genlist && $(MAKE) clean ; true
+ cd src_3rd/genregex && $(MAKE) clean ; true
+ cd src_3rd/genvector && $(MAKE) clean ; true
+ cd src_3rd/gts && $(MAKE) clean ; true
+ cd src_3rd/liblihata && $(MAKE) clean ; true
+ cd src_3rd/liblihata/genht && $(MAKE) clean ; true
+ cd src_3rd/qparse && $(MAKE) clean ; true
+ cd scconfig && $(MAKE) distclean ; true
+
install: FORCE
- cd src && make install
- cd util && make install
- cd pcblib && make install
- cd doc-rnd && make install
+ cd src && $(MAKE) install
+ cd util && $(MAKE) install
+ cd pcblib && $(MAKE) install
+ cd doc && $(MAKE) install
linstall: FORCE
- cd src && make linstall
- cd util && make linstall
- cd pcblib && make linstall
- cd doc-rnd && make linstall
+ cd src && $(MAKE) linstall
+ cd util && $(MAKE) linstall
+ cd pcblib && $(MAKE) linstall
+ cd doc && $(MAKE) linstall
uninstall: FORCE
- cd src && make uninstall
- cd util && make uninstall
- cd pcblib && make uninstall
- cd doc-rnd && make uninstall
+ cd src && $(MAKE) uninstall
+ cd util && $(MAKE) uninstall
+ cd pcblib && $(MAKE) uninstall
+ cd doc && $(MAKE) uninstall
FORCE:
diff --git a/Makefile.conf.in b/Makefile.conf.in
index 66a8f95..dc0e1ed 100644
--- a/Makefile.conf.in
+++ b/Makefile.conf.in
@@ -1,11 +1,16 @@
print [@# generated by ./configure, do not modify
+
+# Compatibility with autotools on DESTDIR - Debian really wants this
+# Still keep install_root as well, because that has a better name
+Install_root=$(install_root)$(DESTDIR)
+
# prefix is @/local/prefix@
-DOCDIR=$(install_root)@/local/prefix@/share/doc/pcb-rnd
-LIBDIR=$(install_root)@/local/prefix@/lib/pcb-rnd
-BINDIR=$(install_root)@/local/prefix@/bin
-ETCDIR=$(install_root)/etc
-DATADIR=$(install_root)@/local/prefix@/share/pcb-rnd
-MAN1DIR=$(install_root)@/local/prefix@/share/man/man1
+DOCDIR=$(Install_root)@/local/prefix@/share/doc/pcb-rnd
+LIBDIR=$(Install_root)@/local/prefix@/lib/pcb-rnd
+BINDIR=$(Install_root)@/local/prefix@/bin
+ETCDIR=$(Install_root)/etc
+DATADIR=$(Install_root)@/local/prefix@/share/pcb-rnd
+MAN1DIR=$(Install_root)@/local/prefix@/share/man/man1
RM=@/host/fstools/rm@
CP=@/host/fstools/cp@
LN=@/host/fstools/ln@
diff --git a/Release_notes b/Release_notes
index e27e2d9..85dfc77 100644
--- a/Release_notes
+++ b/Release_notes
@@ -1,4 +1,20 @@
-pcb-rnd 1.1.4
+pcb-rnd 1.2.0
~~~~~~~~~~~~~~
-This release is a backport of some critical fixes from 1.2.0 to 1.1.3.
+Finally, the long postponed major core cleanup has been implemented. This
+probably has been among the top 5 cleanups in the project history back to
+the 90s.
+First, the code is now reorganized to build up around object types
+instead of actions. This means there's an obj_line.c, obj_arc.c, etc.
+that know how to do everything with lines, arc, etc. The old code had
+everything built around actions, so there was move.c, rotate.c, etc.,
+that knew how to move, rotate, etc. all object types. The new
+organization makes it much simpler to change how objects behave or to
+introduce new objects.
+
+The second part of the cleanup was to add pcb_ and PCB_ prefix to global
+symbols in core API. This will allow us to split core into libs with
+external, public API later, without risking name clashes. This will provide
+better code reuse and cleaner, more stable API to external plugins.
+
+Among with the large cleanup, a lot of bugs have been found and fixed.
diff --git a/config.h.in b/config.h.in
index 9385d36..3d4a597 100644
--- a/config.h.in
+++ b/config.h.in
@@ -87,10 +87,10 @@ switch ?/target/libs/fs/stat/macros/S_ISLNK
end;
print {\n\n/* Define to 1 if Xinerama is available */\n}
-print_ternary libs/gui/xinerama/presents {#define HAVE_XINERAMA 1} {/*#undef HAVE_XINERAMA */}
+print_ternary ?libs/gui/xinerama/presents {#define HAVE_XINERAMA 1} {/*#undef HAVE_XINERAMA */}
print {\n\n/* Define to 1 if Xrender is available */\n}
-print_ternary libs/gui/xrender/presents {#define HAVE_XRENDER 1} {/*#undef HAVE_XRENDER */}
+print_ternary ?libs/gui/xrender/presents {#define HAVE_XRENDER 1} {/*#undef HAVE_XRENDER */}
print {\n\n/* Define to 1 if translation of program messages to the user's native language is requested. */\n}
print_ternary /local/pcb/want_nls {#define ENABLE_NLS 1} {/*#undef ENABLE_NLS */}
@@ -197,7 +197,7 @@ Cons: can't include from here, needs to be included from the bottom of the #incl
@?/local/pcb/include_stdint@
/* Coordinate type and properties, as detected by scconfig */
-typedef @/local/pcb/coord_type@ Coord;
+typedef @/local/pcb/coord_type@ pcb_coord_t;
#define COORD_MAX @/local/pcb/coord_max@
#define coord_abs @/local/pcb/coord_abs@
@@ -211,5 +211,20 @@ typedef @/local/pcb/long64@ pcb_long64_t;
/* ./configure --workaround requests: */
@?/local/pcb/workaround_defs@
+/* Make sure to catch usage of non-portable functions in debug mode
+ This is in here only because config.h should be included from every source
+ file. */
+#ifndef NDEBUG
+# undef strdup
+# undef strndup
+# undef snprintf
+# undef round
+# define strdup never_use_strdup__use_pcb_strdup
+# define strndup never_use_strndup__use_pcb_strndup
+# define snprintf never_use_snprintf__use_pcb_snprintf
+# define round never_use_round__use_pcb_round
+#endif
+
+
#endif
@]
diff --git a/data/Makefile b/data/Makefile
index 3cefb09..7ca473d 100644
--- a/data/Makefile
+++ b/data/Makefile
@@ -51,10 +51,10 @@ install_:
-i $(theme_icons)
install:
- make install_ CPC="$(CP)"
+ $(MAKE) install_ CPC="$(CP)"
linstall:
- make install_ CPC="$(LN)"
+ $(MAKE) install_ CPC="$(LN)"
uninstall:
$(RM) $(DOCDIR)/examples/tut1.pcb
diff --git a/doc-rnd/Autostyle.html b/doc-rnd/Autostyle.html
deleted file mode 100644
index 7e43607..0000000
--- a/doc-rnd/Autostyle.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
diff --git a/doc-rnd/Makefile b/doc-rnd/Makefile
deleted file mode 100644
index 96103c8..0000000
--- a/doc-rnd/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-MENU_RES=../src/pcb-menu-gtk.lht ../src/pcb-menu-lesstif.lht
-MENU_RES_MKEY=../src/pcb-menu-mkey.lht
-KEYLIST=../util/keylist.sh
-DEBLIST=../util/devhelpers/deblist.sh
-
-all: keys.html keys_mkey.html
- ./Autostyle.sh *.html features/*.html
-
-keys.html: $(MENU_RES) $(KEYLIST)
- $(KEYLIST) $(MENU_RES) > keys.html
-
-keys_mkey.html: $(MENU_RES_MKEY) $(KEYLIST)
- $(KEYLIST) $(MENU_RES_MKEY) > keys_mkey.html
-
-install:
- cd man && make install
-
-linstall:
- cd man && make linstall
-
-uninstall:
- cd man && make uninstall
-
-clean:
- cd man && make clean
-
-distclean:
- cd man && make distclean
diff --git a/doc-rnd/README b/doc-rnd/README
deleted file mode 100644
index 30444c7..0000000
--- a/doc-rnd/README
+++ /dev/null
@@ -1,10 +0,0 @@
-pcb-rnd "diff" documentation: this directory contains documentation
-on the features that differ from the original pcb version it was forked from.
-
-Most notable subdirectories:
- features/ details of pcb-rnd features
- conf/ documentation of the configuration system
- hacking/ documentation for developers
- devlog/ random thoughts and articles
-
-Documentation of the original version can be found in ../doc-orig
diff --git a/doc-rnd/TODO b/doc-rnd/TODO
deleted file mode 100644
index d12323d..0000000
--- a/doc-rnd/TODO
+++ /dev/null
@@ -1,154 +0,0 @@
-- BUGS
- ? all route styles deleted when using 'File>load layout data to paste buffer'
- + in the 45-deg line mode, while DRC enforce settings toggled 'on' can cause isolated trace crossing, violating DRC
- - save as: change format, save as again: it sets back the format to default but the file name is wrong [report:Erich]
-
-- Lihata persistent save:
- - flag compatibility: save unknown, string-flags as loaded by io_pcb
- - ind: space in ha:layer name
- - ind: symbol height is not in-line on the output
- - ind: indentation bug in via and netlists
- - ind: indentation bug in inline struct therm: closing } is preceded by indentation whitespace for some reason
- - keep numeric format: test all
- - keep unknown subtrees
-
-- replace settings with lihata (conf_*)
- - TEST:
- - vendor drill mapping (all functionality, including regex based refdes ignore)
- - route style in gtk and lesstif, save, load, 0, 1 or a lot of styles
- - route style vs. autorouter
-
-- query & advanced search
- - search expr wizard should pick up the expression from the button when clicked
- - field accessors:
- - pad area
- - pin area
- - line (and pad) length and length^2
- - make a run on alarge board, speed test, with -O0 and -O3:
- - iteration speed (a simple @)
- - eval speed (a simple @ with a lot of constants in an expr)
- - geo speed
- - regex and string cmp match speed vs. select by name
-
-CLEANUP #5
-- save/load bugs:
- - gtk load dialog extension filter should reflect known formats
- - when changing format in the save dialog, the file extension is not modified
- - there should be an "auto" or "guess by extension" option in the save dialog format
-- convert PCBChanged into an event (and provide a core action for compatibility)
-- rework the gpmi plugin to make it more standard in regard of the build system and to remove a few directories
-- dir rename trunk/pcblib/tru-hole should handle make correctly and not walk on existing web services or user installs
-- grid status line label doesn't update when using setvalue(grid,delta) add another hook to update this value [miloh]
-- Erich's select undo bug: place an element, select, save & load, unselect, undo 2 times: bad serial
-- Erich's gtk lag report: press 's' a lot then move the mouse - 's' ends up in the new loc!
-- conf: throw an error if user config can not be written
-- the TAB bug: (over ssh -X) press tab for a good 15 seconds; release; it won't work again for a fraction of a second
-- mark bug - ortho shouldn't use it, it should use last point (crosshair.X2); make sure nothing else abuses it [James]
-- conf:
- - remove CFN_INCREMENTS, test if saving increments from preferences works
- - config pov: change prio
- - gtk preferences: check what takes 131 megs of VIRT ram (on top); destroy the dialog structures when closed
- - gtk preferences: poly isle area widget missing from the sizes tab
- - debug why default layer names from the user config are ignored
- - fp_fs_search: kill anything that gets ':' separated string as path list, get a config list instead
- - switch the lesstif HID over from attribs to conf
- - remove redundancy: don't store values in the PCB struct that are in the design conf
- - increments are not really implemented
- - if font file is not found:
- - embedded version?
- - warn when try to write text on pcb?
-- action bug: gui_act.c shouldn't reference Crosshair.X directly; check d-fix.patch about how to fix it
-- next_gui: keep them open, hide
-- look for #warnings
-- fix librarychanged: disable update of gedasymbols on-start, make it an explicit refresh button
-- libstroke: zoom
-- cleanup/rewrite resources:
- - load/swap menus (TODO#1)
- - gpmi:
- - hid: hid_destroy (pair of hid_create)
- - cleanup on unload: remove menus
-- check whether local copy of gts is needed, bisect when toporouter broke
-- check gpmi when pcb-rnd is fully linstalled - broken symlinks?
-- multi-key: display state on the gui
-- implement loglevels and log style tags in the lesstif HID
-- TODO#3: works only on US keyboard
-- gsch2pcb: generalize plugin/buildin loading for external tools, check if gsch2pcb can work from plugins
-
-CLEANUP #6:
-- lihata board format:
- - pads should be polygons (0 long line can't be rotated!)
-- layer groups from config (e.g. CLI) is ignored
-- res:
- - search for vendor in the hid plugins, there should be no trace of it (vendor should register its in submenus with anchors)
- - re-add dynamic menus after a gui change:
- - either remember dynamic menus in a separate list so they can be rebuilt
- - or provide hooks and let plugins deal with it
- - gpmi: auto-remove menus by cookie (TODO#2)
- - load new res on the fly (replace the menu system):
- - low level reload code (re-add the dynamic menus too!)
- - action to reload if file name is known
- - gui load dialog with tags listed
-- decide about exporter policy:
- - png exports selection (even in not-as-shown), others don't
- - extend png hid attribs with a flag for this, maybe do the same for others
- - document the decision in "hacking"
-- reduce
- - export_bom: rewrite the string list code using htsp and/or lists
- - hash in hid_attrib.c?
- - nelma and gcode both invent .png name locally
- - get rid of gcode/lists.h, and vector.[ch] (autorouter)
- - vendordrill
- - search for /units, replace it with pcb-printf something
- - add round down
- - replace ignore_refdes, ignore_value and ignore_descr with genvector
- - mods:
- - gpmi (and other buildins/plugins) not showing up in the about box
-- self contained
- - files
- - default font
- - action (--show-paths!) and dialog box to print where the actual files are coming from
- - project specific menus from extra lihata files - maybe from project.lht
-- main.c:
- - SIGPIPE - detect it (needed for popen)
-
-CLEANUP #7: the big object split
-- remove pcb_obj_type_t from const.h - use obj_any.h instead
-
-
-
-
-FEATURES
-- BUILD: menuconfig and a config file for scconfig
-
-Low prio:
-- scconfig: check if it picks up settings from env vars (for a gentoo build)
-- replace mkdtemp() with something safer
-- display net names on pins, vias (and maybe tracks?) when zoomed in enough
-- DRC should warn for thin poly hair
-- rotate shaped vias don't rotate the shape (is via rotated at all?)
-- new examples
- - blinking led with parametric footprints
- - example of nonetlist: 1206 jumpers and logos
-- decide what to do with old doc - texi doesn't seem to work at all
-- rethink/rewrite the action/change infrastructure - too many void *ptr1
- pointers, too many code duplication
-- double sided board, poly on both layers; grab existing lines on one layer and
- move then around. If all layers are visible, redraw of the far side layer
- is slow and causes flickering elements from that layer until the front is
- redrawn. Maybe we should have less flushes?
-- gpmi:
- - dialog: attribute dialog: mini parser from text
- - fix debug draw in the gtk hid
- - ACTE_action(): coords should not be int but Coord
- - get timers to work
-- dmalloc: #include from the bottom from each file. Is this a good idea?!
-- win32 port {large}
- - clean up central Makefile.in rules:
- - remove cat, sed, grep where possible, use scconfig instead
-- arc bug: draw an arc with one end out of the drawing area; it will be jumpy and can not be placed properly
- -> AttachForCopy() calls SetCrosshairRange() that then sets corsshair max* which
- limits the arc to move freely. Problem: this is not arc-specific, this happens with any buffer copy! going for no-design-limit is probably better
-- while drawing a line, the temporary outline should reflect the layer color
-- push&shove
- - keep 45-deg knee when grabbing a point for drag&drop in non-all-dir
-- examine current handling of long options [miloh]
diff --git a/doc-rnd/conf/index.html b/doc-rnd/conf/index.html
deleted file mode 100644
index 47b3b5b..0000000
--- a/doc-rnd/conf/index.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<html>
-<body>
-<H1> The new config system in pcb-rnd </H1>
-<H2> Why, what was wrong with the old one? </H2>
-The old config system had several limitations that would have been
-hard to fix keeping the original design:
-<ul>
- <li> config settings were specified in a flat list - no <a href="groups.html"> grouping </a>
- <li> the core had a rather static system - HIDs or plugins couldn't extend it, thus they had <a href="noextend.html"> to invent their own </a> config files
- <li> ... this led to a variety of configuration formats; using one format not always because it was better suited for the task, but for historical reasons
- <li> ... this also led to a collection of config files - again not always split by boundaries of settings, but often by arbitrary boundaries of code
- <li> the old system didn't support lists or arrays well
- <li> it didn't have a coherent concept of how settings from different <a href="sources.html"> sources </a> would override eachother
- <li> ... this resulted in the rigid structure that most of the settings could come from only one place (e.g. if it's an user setting, the design won't be able to override it)
-</ul>
-
-<H2> What the new system offers </H2>
-<ul>
- <li> unified format: <a href="http://repo.hu/projects/lihata"> lihata </a> ...
- <li> ... more future proof: generic markup language - easier to extend wihtout having to worry about breaking the syntax
- <li> ... the configuration is represented in a tree, groupped by the nature of settings
- <li> ... there are <a href="lists.html">arrays and lists</a>
- <li> ... a config file can overwrite a list or <a href="lists.html">prepend/append</a> to it (e.g. design-level config prepending an extra library path keeping system set paths as well)
- <li> there are different <a href="sources.html"> sources </a> of configuration, e.g. system-wise, user-wise, project-wise, etc.
- <li> the user has the power to change default config <a href="prio.html">priorty per setting</a>; e.g. normally design config overrides user config, but it's possible to mark a setting from user config so strong that it overrides even the setting read from the .pcb file
- <li> the way settings are stored is flexible and extensible so that a plugin can define their subtree of settings
- <li> ... since the API even makes it easier to access such settings (vs. parsing your own config file), plugins will tend to use the unified config format/system instead of inventing teir own
- <li> ... the GUI (gtk's preferences dialog) thus can automatically handle the new settings
- <li> ... plugins don't have to implement actions to set/toggle/query their settings for the menu system, there are generic config set/toggle/query actions the menu config can use
- <li> ... plugins also get the multi-source, <a href="prio.html">priority-based config mechanism</a>
- <li> ... which also means plugin settings can be automatically saved as user setting, project setting or even design setting
- <li> all these are true for all kind of settings, be them GUI preferences, paths, layer colors, grid settings; there should be no exception
-</ul>
-
-<H2> How to get started </H2>
-<ul>
- <li> If you are an user, read the <a href="index_user.html">user documentation</a>
- <li> If you are an programmer, read the <a href="index_user.html">user documentation</a> and the <a href="index_prog.html">programmer documentation</a>
- <li> If you are a plugin programmer, there's a <a href="plugin_chk.html"> plugin programmer's conf checklist </a> that summarizes what to do
- <li> In any case, these links may help: <a href="syntax.html">syntax</a>, <a href="sources.html">config files</a>, <a href="prio.html">priority handling</a>
-</ul>
-
-
-<H2> But isn't this more complicated for the user? </H2>
-Hopefully not much. There are a few extra features, like
-multiple <a href="sources.html"> sources </a> with levels that did not
-exist in pcb and <a href="lists.html">lists with prepend/append</a>. Some of these
-features present in other software so users should be comfortable with the ideas.
-The learning curve is probably compensated by the more orthogonal system.
-The syntax is also geared for simplicity and easy use with text editors.
-Finally, the new preferences dialog in the GTK HID and config actions help
-the user to explore how settings got used from all the config sources. There's
-an intended layering in complexity: simple things can be done easily without
-having to understand the whole system.
-<p>
-All in all, the extra features the user needs to learn is comparable with
-the old customs that he/she can forget.
-
-<H2> And did it make the code more complicated? </H2>
-The size of the code did not change much after the initial config rewrite.
-The new system has new features, some of which brought in a few hundred lines of
-code, but a similar amount of old code could be removed. What came in is
-infrastructure, what had to go was a bunch of repetitive config parsing,
-boolean-setting-accessor-action code. This means on the long run, the more
-settings are added, the more the new system pays back.
-<p>
-Read access, which is far the most common way to use the config in the
-code (e.g. if (setting == true) { }) is very similar to the old Settings
-system. Write access needs to go through a function call API, but this
-is usually a single call per setting (instead of directly modifying a
-variable).
-<p>
-For plugin programmers, the new system makes life much easier as they can
-plug their settings in.
-
-
-<H2> Compatibility with mainline </H2>
-
-None. The new configuration system uses a new logical structure, new file
-format, new locations on the file system. Most setting names are the same
-or very similar to the old ones. Some settings are renamed for clarity:
-clearance is always called clearance, on the UI, in the code and in
-config files as well (mainline pcb sometimes call it keepaway).The new,
-tree-based logics adds a twist too: full names of settings are paths.
-
-<p>
-
-Since configuration is stored in new files, pcb-rnd settings do not interfere
-with pcb settings on any level.
-
-</body>
-</html>
diff --git a/doc-rnd/conf/index_user.html b/doc-rnd/conf/index_user.html
deleted file mode 100644
index 1b97a42..0000000
--- a/doc-rnd/conf/index_user.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<html>
-<body>
-<H1> The new config system in pcb-rnd </H1>
-<H2> User documentation </H2>
-As of 1.1.0, pcb-rnd switched to a <a href="syntax.html">lihata</a> based configuration system.
-The purpose of this document is to describes the basic system design going into
-enough details to provide the user with full control over the configuration.
-The other side, how the system is implemented is described in the
-<a href="index_prog.html"> programmer's manual </a> and there is also a
-<a href="plugin_chk.html">checklist</a> to assist plugin programmers.
-
-<h2> Architecture: data flows, merging, dispatching </h2>
-The final configuration is a collection of values for
-<a href="groups.html"> all known settings, arranged in a tree</a>. The <i>config
-tree</i> is a theoretical concept; different representations of the tree are
-actually built runtime, in-memory. Pcb-rnd code, plugins and utilities
-are constantly reading these in-memory representations to decide how to
-carry out their tasks.
-<p>
-Config settings are imported from multiple sources: from different files,
-from environment vareiables, from command line arguments, from the .pcb
-files on load. Any source can define any part of the <i>config tree</i>.
-When the configuration is processed, each source is read into a temporary
-tree and then all the temporary trees are merged into the final
-<i>config tree</i>. The following diagram demonstrates all configuration
-related data flows.
-<p>
-<img src="merging.png">
-</p>
-The leftmost column of nodes are the sources. (Note: paths mentioned there are
-the default paths, for reference, it is possible to change them compile-time.)
-Along the black arrows, from left to right, each source is imported into a
-tree representing a <i>role</i>: the role or
-<a href="sources.html">purpose of the source</a>. The next
-step is following the red arrows in two steps:
-<ul>
- <li> first merge all the role treesinto a flat list; this determines the value of each setting;
- <li> then dispatch the values to the right component of the code.
-</ul>
-Some components may change some of the settings run-time. The trivial example
-is the GUI (hid_gtk on this diagram) that provides menus and dialog boxes for
-the user to change settings. Such a change is always fed back (blue arrow)
-to the design role tree directly, from where the new value is again merged
-and dispatched along the red arrows. Changes in the design role are saved
-with the .pcb file (thus the bidirectional black arrow between the source and
-the in-memory tree for the design role). Occassionally the user wants to
-save parts of the setting as a <a href="sources.html"> project setting or
-as an user setting</a> - in this case, along the dashed blue lines, the
-corresponding project or user roles are modified. This again results in updating
-the hash and the binary representation; these roles also have
-bidirectional black arrows and their changes are also saved in the original
-source.
-
-<h2> Merge details </h2>
-In the new system it is up to the user to decide what settings are
-system-level and what settings are user- or project-level. This is possible
-because any source can define any setting. In the merging step (red arrows
-between roles and the hash) it may turn out that there are overlaps (multiple
-sources defining value for the same setting) or blind spots (no source
-sets a given item).
-
-<h3> overlaps </h3>
-Each setting in each source has a <a href="prio.html">prioirty.</a> The
-priority can be defined in the source, or if it is not defined, each source
-inherits a fallback default priority. The fallback is designed to provide
-the intuitive order: cli > design > project > user > system.
-<p>
-When multiple sources are describing a value for the same setting,
-priority decides the final value. Most settings are scalar:
-a single integer, string or a single "yes/no" or "on/off" value (e.g.
-the background color or whether polygons are thin-drawn). For scalars
-the rule is simple: the higher priority value wins and all lower priority
-values are discarded when putting the values into the hash. More
-details: <a href="scalars.html"> how different roles and priorities
-can be used with scalars.</a>
-
-<p>
-There are some settings that are represented as an array or list of
-values. They are described in a lihata list item ("li:") in the config
-files and are generally called lists in this document. How lists
-are merged is controlled by the merging <i>policy</i>, which can be
-in each source, just like the prioirty is set. Check out the
-<a href="lists.html">list merging section</a> for more details.
-
-<h3> blind spots </h3>
-At the end the code does need a value for each setting, so in the final
-render (after the hash) every setting must have a value. To avoid blind spots,
-values not initialized, there is a built-in configuration file, compiled into
-the executable. This file is loaded into role <i>CFR_INTERNAL</i>, and has
-the lowest priority. This configuration file contains the default value for
-all settings.
-
diff --git a/doc-rnd/conf/prio.html b/doc-rnd/conf/prio.html
deleted file mode 100644
index 688bdfd..0000000
--- a/doc-rnd/conf/prio.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<body>
-<H1> The new config system in pcb-rnd </H1>
-<H2> Priorities </H2>
-
-Priority is an integer property of each config root.
-<a href="syntax.html">Syntax-wise</a> it is part of the name of the config
-root. In the lihata config file it is either specified or omitted. When
-omitted, <a href="sources.html"> a role dependent default value</a> is
-used. The default values are chosen in an intuitive way, thus most
-commonly the priority value is omitted.
-<p>
-For <a href="scalars.html">scalar</a> settings, the highest priority
-value determines the final value of a setting after the merge. If there
-is a tie, role decides: the role closer to the CLI is stronger.
-<p>
-For <a href="lists.html">lists</a> and arrays, priority determines the
-order of merge, which changes the order of itmes in the final list as
-config roots prepend and append items.
-
-
-
diff --git a/doc-rnd/conf/scalars.html b/doc-rnd/conf/scalars.html
deleted file mode 100644
index 470600e..0000000
--- a/doc-rnd/conf/scalars.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<html>
-<body>
-<H1> The new config system in pcb-rnd </H1>
-<H2> Scalars </H2>
-
-Scalar settings have only one value after the merge. The only <i>policy</i>
-available is <i>overwrite</i> - this policy is applied regardless of the
-current policy setting.
-
-<h2> examples </h2>
-
-<h3> simple overwrite </h3>
-Config sources:
-<table border=1>
- <tr><th> role <th> priority <th> policy <th> content
- <tr><td> system <td> 200 <td> overwrite <th> A
- <tr><td> user <td> 400 <td> overwrite <th> (not defined)
- <tr><td> project <td> 600 <td> overwrite <th> Q
-</table>
-<p>
-Merge iterations:
-<table border=1>
- <tr><th> step <th> description <th> output list after executing this step <th> remarks
- <tr><td> 0. <td> reset the output <td> (empty) <td>
- <tr><td> 1. <td> apply <i>system</i> <td> A <td>
- <tr><td> 2. <td> apply <i>user</i> <td> A <td> "not defined" doesn't mean "empty", so the list is not deleted - no change
- <tr><td> 3. <td> apply <i>project</i><td> Q <td> replace the original output because of the overwrite policy
-</table>
-<p>Example scenario: system default overriden by a project setting.
-
-<h3> user-forced value </h3>
-Config sources append:
-<table border=1>
- <tr><th> role <th> priority <th> policy <th> content
- <tr><td> system <td> 200 <td> overwrite <th> A
- <tr><td> user <td> 650 <td> overwrite <th> E
- <tr><td> project <td> 600 <td> overwrite <th> Q
-</table>
-<p>
-Merge iterations:
-<table border=1>
- <tr><th> step <th> description <th> output list after executing this step <th> remarks
- <tr><td> 0. <td> reset the output <td> (empty) <td>
- <tr><td> 1. <td> apply <i>system</i> <td> A <td>
- <tr><td> 2. <td> apply <i>project</i><td> Q <td>
- <tr><td> 3. <td> apply <i>user</i> <td> E <td>
-</table>
-<p>Example scenario: user preference enforced: even if the project file would use
-'Q' for the given setting, the user prefers 'E'. This affects runtime
-(the value of the setting after the merge, in other words how pcb-rnd works),
-but does nto change the project configuration. This allows the given user to
-always use 'E' for the given setting while lets other users working on the
-same project use the value set in the project file.
-
-
-
diff --git a/doc-rnd/conf/sources.html b/doc-rnd/conf/sources.html
deleted file mode 100644
index 0ddf1fb..0000000
--- a/doc-rnd/conf/sources.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<html>
-<body>
-<H1> The new config system in pcb-rnd </H1>
-<H2> Sources </H2>
-There are different sources of configuration settings. These are
-different configuration files, sometimes located on the file system.
-The full list of config sources is:
-
-<table border=1>
-<tr><th> role <th> default<br>setting<br>prio <th> location <th> presence <th> remarks
-<tr><td> internal
- <td> 100
- <td> (compiled into the executable)
- <td> always
- <td> the ultimate fallback; allows pcb-rnd even if no other configuration file is found
-
-
-<tr><td> system
- <td> 200
- <td> /usr/share/pcb-rnd/pcb-conf.lht
- <td> recommended
- <td> should hold system and installation specific settigns, e.g. path to the system-wise installed footprint library
-
-<tr><td> default.pcb
- <td> 300
- <td> /usr/share/pcb-rnd/default.pcb
- <td> deprecated
- <td> pcb editable defaults
-
-<tr><td> user
- <td> 400
- <td> ~/.pcb-rnd/pcb-conf.lht
- <td> recommended
- <td> store user preferences, user's common footprint lib path, etc; this is the first file the user can modify (even from the GUI)
-
-<tr><td> environment
- <td> 500
- <td> environment variables (TODO)
- <td> occassional
- <td> inject the same (temporary) settings in multiple pcb-rnd sessions without having to change config files
-
-<tr><td> project
- <td> 600
- <td> projdect.lht in the project directory
- <td> optional
- <td> local project settings - useful for large projects with multiple design (.pcb) files
-
-<tr><td> design
- <td> 700
- <td> saved in the design (.pcb) file
- <td> optional, common
- <td> per design deviation from the user+system config
-
-<tr><td> cli
- <td> 800
- <td> command line argument
- <td> occassional
- <td> inject/change a setting for a single session; useful in batch/automated processing
-</table>
-
-<p>
-Pcb-rnd reads them all, then merges all settings into a master binary
-representation. If a setting is specified in multiple sources, the one
-with the higher priority wins, except for lists where it is also possible
-to prepend/append items. Default priorities are designed to result
-precedence in an intuitive way (e.g. design settigns overwrite user settings).
-However, <a href="prio.html">priority can be changed</a> per setting, resulting
-in weak settings ("use this value if it was not already set") or strong settings
-("I always want to use mincut, so I enable it from my user's config with high
-priority and a version controlled project setting can not turn it off")
-
-
diff --git a/doc-rnd/conf/syntax.html b/doc-rnd/conf/syntax.html
deleted file mode 100644
index c2b861e..0000000
--- a/doc-rnd/conf/syntax.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>
-<body>
-<H1> The new config system in pcb-rnd </H1>
-<H2> Config file syntax </H2>
-
-The config file sytnax is <a href="http://repo.hu/projects/lihata">lihata</a>.
-Most users don't need to understand most of the syntax, just follow the
-patterns seen in the examples. A few thumb of rules:
-<ul>
- <li> srtuctural nodes usually start with a ha: or li: prefix; which one needs to be used is pretty much tied to the node name; thus casual users don't need to care about what they are for, just remember them as part of the name
- <li> non-structural nodes are usually given in the form of name = value; use braces around the value if it contains any non-alphanumeric, non-whitespace character
- <li> list and array members should better be braced
- <li> list and array separator should be semicolon (not comma)
-</ul>
-
-<H3> config root syntax </H3>
-<p>
-A pcb-rnd config file, (or <i>document</i> for short) has a single root
-node whose name must be li:pcb-rnd-conf-v1 - this is the signature of the
-document. It is a flat list of one or more <i>config root/</i> subtrees.
-TODO: is this really a list or a hash?
-<p>
-Each config root is a partial description of the
-<a href=index_user.html"> config tree </a> (which is the logical
-confgiuration of all possible settings). Config roots have a policy and
-a <a href="prio.html">priority</a> attached. This is done in the name
-of the config root, which must be of the form of <i>policy-priority</i>,
-e.g. "overwrite-300" or "append-125". The priority part (with the dash)
-can be omitted (and then the per role default priority is used), e.g.
-"overwrite" or "append" are valid config root names.
-<p>
-Under the config root, a tree of sections (hashes) and setting values
-(text nodes) are built. These structures and values are in 1:1
-correspondance with <a href="groups.html">the config tree</a>. Excess
-(unknown) keys are considered a warning (except in the plugin/ and
-utils/ subtrees). Missing keys or missing subtrees is normal because a config
-root can be partial.
-<p>
-TODO: examples
-
-<H3> list syntax </h3>
-TODO: list syntax
-
-<H3> in project files </H3>
-TODO
diff --git a/doc-rnd/conf/tree/rc.html b/doc-rnd/conf/tree/rc.html
deleted file mode 100644
index 2ca707f..0000000
--- a/doc-rnd/conf/tree/rc.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<html><body>
-<h1>pcb-rnd conf tree</h1>
-<h2>subtree: rc</h2>
-<table border=1>
-<tr><th>node name <th> type <td> flags <td> description
-<tr><td> verbose <td><a href="CFN_INTEGER.html"> integer </a><td> 0 <td> <verbose>
-<tr><td> backup_interval <td><a href="CFN_INTEGER.html"> integer </a><td> 0 <td> time between two backups in seconds
-<tr><td> font_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> commands for file loading...
-<tr><td> file_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <file_command>
-<tr><td> file_path <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <file_path>
-<tr><td> library_shell <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <library_shell>
-<tr><td> library_search_paths <td><a href="CFN_LIST.html"> list </a><td> 0 <td> <library_search_paths>
-<tr><td> emergency_name <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template for emergency save anonymous .pcb files (when pcb-rnd crashes); optional field: %ld --> pid; must be shorter than 240 characters. Don't do emergency save if this item is empty.
-<tr><td> backup_name <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template for periodic backup anonymous .pcb files; optional fields: %P --> pid
-<tr><td> save_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> command to pipe the pcb, footprint or buffer file into, when saving (makes lihata persist impossible)
-<tr><td> keep_save_backups <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> a copy is made before a save operation overwrites an existing file; if this setting is true, keep the copy even after a successful save
-<tr><td> default_font_file <td><a href="CFN_LIST.html"> list </a><td> 0 <td> name of default font file (list of names to search)
-<tr><td> default_pcb_file <td><a href="CFN_LIST.html"> list </a><td> 0 <td> <default_pcb_file>
-<tr><td> script_filename <td><a href="CFN_STRING.html"> string </a><td> 0 <td> PCB Actions script to execute on startup
-<tr><td> action_string <td><a href="CFN_STRING.html"> string </a><td> 0 <td> PCB Actions string to execute on startup
-<tr><td> rat_path <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <rat_path>
-<tr><td> rat_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <rat_command>
-<tr><td> preferred_gui <td><a href="CFN_LIST.html"> list </a><td> 0 <td> if set, try GUI HIDs in this order when no GUI is explicitly selected
-<tr><td> have_regex <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> whether we have regex compiled in
-</table></body></html>
diff --git a/doc-rnd/contrib.html b/doc-rnd/contrib.html
deleted file mode 100644
index 6ba1bb3..0000000
--- a/doc-rnd/contrib.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - contribution </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - contribution </h1>
-
-If you are interested to help out, please contact me using
-<a href="irc.html"> the live chat (CET daytime)</a> or mail to:
-pcb-rnd (at) igor2.repo.hu.
-
-<H2> Contributing as a user </h2>
-Using pcb-rnd in production and just reporting bugs is already a huge contribution.
-<p>
-More dedicated users can join in scheduled, systematic testing. Such testing
-is split up into independent chunks that each can be done in an hour.
-<p>
-Even more dedicated users can join developing the documentation.
-<p>
-None of the above requires or assumes any programming skill.
-
-<H2> Contributing as a developer </h2>
-
-The project is lead in an autocratic way by Igor2.
-
-Developer freedom taken away:
-<ul>
- <li> the basic concept of pcb-rnd is set and won't change
- <li> the toolchain is chosen, and won't change; the usual hot topics: svn, scconfig, <a href="hacking/c89.html">C</a>.
- <li> don't add code that restricts usability for others; add code that increases usability for some; thus prefer to add code in plugins!
-</ul>
-<p>
-Developer freedom promptly granted:
-<ul>
- <li> svn commit access from day 0
- <li> work together in trunk/, not alone in a branch
- <li> pcb-rnd has a strong plugin support; want to implement a strange/controversial feature? In a plugin, almost anything goes
- <li> especially in plugins, work on whatever you want, even if noone else needs that feature
-</ul>
-<p>
-Coding style/indentation: there's an <a href="hacking/indent.html">unified style</a>
-in core and core plugins. If you work on those parts, try to stick to it. If you
-are working on a new plugin, it's still the preferred style but you can use
-a different style. However, the rule is that if someone else starts hacking
-that part too, he is allowed to convert the code to the unified format; but
-unified format can not be converted to anything else. So it's a one way
-process which long term grants unified style while not demotivates a plugin
-developer by forcing a style on him in the early, "when the bulk of the code
-is written" phase.
-</body>
-</html>
diff --git a/doc-rnd/ddrc/proposal1.txt b/doc-rnd/ddrc/proposal1.txt
deleted file mode 100644
index cffce71..0000000
--- a/doc-rnd/ddrc/proposal1.txt
+++ /dev/null
@@ -1,242 +0,0 @@
-Dynamic DRC proposal 1: a Declarative DRC language.
-
-P0 A DRC program is an unordered list of rules. Rules are evaluated and
- violations reported. The advantage of a declarative language is that
- intermediate results can be cached and reused.
-
-P1 The language is intended to be human readable and human writable, but
- the main goal is to let programs and scripts (e.g. netlisters) to
- generate it.
-
-P2 A rule consists of three parts:
- - the rule keyword; syntax: rule NAME
- - build variables (lists) using search statements
- - state assertions about those lists.
- - comments, empty lines
-
-P3 Variables are named by the user and are local to the rule (TODO)
-
-P4 Lists are ordered.
-
-P5 A list is consists of zero or more objects. An object is:
-P6 - the board
-P7 - a layer
-P8 - a board drawing primitive (line, arc, polygon, via, text)
-P9 - an element primitive (element line, element arc(?), pin, pad, element name)
-P10 - an element as a whole
-P11 - a net
-P61 - a 2D coordinate with or without layer information
-
-P12 Objects have named properties (or fields):
-P13 - core attributes: for each object type a predefined set of key=value
- pairs that always exist (e.g. thickness of a line, start angle of
- an arc); these field names starts with "p."
-P14 - user attributes: free-form key=value pairs optionally assigned by
- the user; these field names start with "a."
-
-P15 Note: the language is case sensitive with keywords and builtins using
- lowercase only. For better readability, in syntax description in this
- document uppercase words are user chosen identifiers or fields. Whitespace
- character sequences are usually treated as a single whitespace. (This
- does not mean identifiers have to be uppercase in a program.)
-
- The syntax of a search statement is:
-
-P16 let LISTNAME EXPR
-
-P17 It creates a list called LISTNAME and evaluates expression EXPR to all
- available objects and adds the objects that match EXPR to the list. Each
- matching object is added only once. The particular order of objects on
- the list is random. Object "matches EXPR" when the EXPR evaluated on
- the object yields true.
-
-P18 The current object used in the iteration during the search is called
- @.
-
-P19 An expression returns a value. A value can be:
-P20 - an object
-P21 - a list
-P22 - scalar: a number or string (might be suffixed, like "42 mm")
-P23 - void (empty, also known as false)
-
-P23 A value is considered true if:
-P24 - it is an existing object
-P25 - it is a non-empty list
-P26 - it is a non-zero number or non-empty string
-P69 - it is a valid coordinate
-
- An expression is one of:
-
- syntax meaning
- ----------------------------------------------------------------
-P27 (EXPR) change precedence
-P28 EXPR || EXPR logical OR (result: number)
-P29 EXPR && EXPR logical AND (result: number)
-P30 EXPR + EXPR add (number only)
-P31 EXPR - EXPR subtract (number only)
-P32 EXPR * EXPR multiply or ... (number only)
-P32 EXPR / EXPR multiply or ... (number only)
-P32 EXPR == EXPR the two values are equal
-P33 EXPR != EXPR the two values are not equal
-P71 EXPR ~ string regex match left EXPR using pattern right string
-P34 EXPR > EXPR left EXPR is greater than right EXPR (number only)
-P35 EXPR >= EXPR left EXPR is greater than or equal to right EXPR (number only)
-P36 EXPR < EXPR left EXPR is less than right EXPR (number only)
-P37 EXPR <= EXPR left EXPR is less than or equal to right EXPR (number only)
-P38 !EXPR logical NOT (result: number, 0 or 1)
-P39 FUNC(EXPR, EXPR, ...) call a function with 0 or more arguments
-P40 EXPR.field evaluated to the value of an object field (see P45, P46)
-
- The syntax of an assertion is:
-
-P41 assert EXPR
-
-P42 If the EXPR in an assert evaluates to false, a DRC violation is generated.
-
-P43 If an assert EXPR is a list anywhere else than in a function argument, it is
- evaluated for all valid members of the list (see P45, P46). For example
- if there is a variable called FOO, which is a list of objects
- (built using a search statement), expression
-
- FOO.p.thickness
-
- is evaluated as many times as many objects are on the list, and the
- full assert is checked each case. If there is another similar list
- called BAR, an expression:
-
- (FOO.p.thickness < BAR.p.thickness)
-
- will compare each possible pair of FOO and BAR objects. That is, if
- FOO has 4 objects and BAR has 15 objects, that is 4*15 = 60 comparisons.
-
-P44 However, each list is iterated only once, even if it is referenced multiple
- times in the same expression. For example, with the above lists:
-
- (FOO.p.clearance > 10 mil) && (FOO.p.thickness < BAR.p.thickness)
-
- the potential number of iterations is still 4*15, and not 4*4*15. In
- practice the engine leverages lazy evaluation so if FOO.p.clearance
- is smaller than 10 mil, the right size is not evaluated. See also: P45, P46.
-
-P45 A field reference is valid if the field exists. For example a line object
- has a thickness attribute, thus the .p.thickness is valid, but a polygon
- object does not have a thickness and .p.thickness on a polygon is invalid.
- An user attribute reference (e.g. field .a.baz) is valid if the attribute
- key exists in the given object.
-
-P46 Invalid fields are skipped in iterations. Thus if variable BLOBB is a list
- that consists of 3 line, 2 arc and a layer objects, the following assert
- will result in 2 comparisons only:
-
- (BLOBB.p.width >= 10 mm)
-
- (because only arc objects have valid .p.width field).
-
-P47. An invalid field in an expression is never considered an
- error. In an assert statement it causes skipping an iteration. In a
- search statement it evaluates to void.
-
-P48. A void value is never equal to anything. A void value is not equal
- even to another void value.
-
-P49. Comments are lines starting with #
-
-
- BUILTIN FUNCTIONS
-
-P70 list(LISTNAME)
- Within an expression, a reference to a list may become an iterator and
- refer to a single object. In case the expression needs the listm the
- list() function protects LISTNAME from becoming an iterator. For
- example llen(list(@)) is the number of all objects the design consists.
-
-P50 llen(EXPR)
- Returns to the number of items of a list (an integer number >= 0).
-
-P51 lvalid(EXPR, field)
- Returns a list of items on the list for which field is valid.
- EXPR can be a list or an object.
-
-P52 lunion(EXPR1, EXPR2)
- A new list is created; items of EXPR1 are copied to the new list in order.
- Those items from EXPR2 that are not on the list already are appended,
- keeping their order. The new list is returned.
-
- Both EXPR1 and EXPR2 can be either a list or an object.
-
- Note: order of arguments does matter (affects order of objects on the
- resulting list).
-
-P53 lintersect(EXPR1, EXPR2)
- A new list is created; items that are present on both EXPR1 and EXPR2
- are copied onto the new list. The new list is returned.
-
- Both EXPR1 and EXPR2 can be either a list or an object.
-
- Note 1: this function can be used as "is this object on the list" query:
- list_intersection(LIST, OBJ) will result an empty list (which means false)
- if OBJ is not on the list.
-
- Note 2: similarly, if both argument are objects, the result is false
- if the two arguments are not the same object.
-
-P54 lcomplement(EXPR1, EXPR2)
- Creates a new list with all items that are present in EXPR1 but not in
- EXPR2. The new list is returned.
-
- Both EXPR1 and EXPR2 can be either a list or an object.
-
-
-P55 ldiff(EXPR1, EXPR2)
- Creates a new list with all items that are present either in EXPR1 or in
- EXPR2 but not in both. The new list is returned.
-
-
-P56 distance(EXPR1, EXPR2)
- Calculates the shortest distance between two objects. Returns a number.
-
- Note: if any expression is a layer, the stack distance is calculated
- (which will be 0 for now, as pcb-rnd doesn't yet know about layer thickness).
- If the expression is a net, the whole shape of the net is used
- (expensive! use is_closer() instead)
- If the expression is the board, the operation is invalid (see P46).
-
-P57 is_closer(EXPR1, EXPR2, NUMBER)
- Checks if EXPR1 and EXPR2 are closer to each-other than NUMBER. It uses
- the classic bloat-and-find algorithm originally used by the classic DRC,
- thus it is much cheaper than distance(EXPR1, EXPR2) < NUMBER.
-
-P58 netlen(EXPR)
- Network length of EXRP1: sum of all non-overlapping trace/arc lengths that
- make up a network; polygons are approximated with their average diameter
- (TODO). If EXPR is an object, its length is returned.
-
-P59 netobjs(EXPR)
- Creates and returns a list of objects consists of a net.
-
-P60 type(EXPR, TYPENAME)
- EXPR is an object. Returns the object if it's type matches TYPENAME, else
- returns void (a.k.a. false). This call is useful to decide whether an
- object is of a specific type. TYPENAME is one of:
- - drawing primitive type: arc, line, polygon, text, via, element
- - element primitive type: element_line, element_name, pin, pad
- - misc type: layer, net
- - meta-type, or a group:
- - copper: primitive that results in copper (arc, line, polygon, text (on copper), via, pin, pad)
- - drilled: anything that drills the board (via, pin)
-
-P62 gridup(EXPR, NUM1, NUM2)
- If expression is an object, return a list of coordinates that are on
- the object, evenly spaced:
-P63 - for lines and arcs, the points are evenly spaced on the centerlane with
- a gap of NUM1, starting from both endpoints, having the corner case in
- the middle; if NUM2 is 0, the gap at the middle may be larger than NUM1,
- else it may be smaller than NUM1.
-P64 - for polygons take a grid of NUM1*NUM2 spacing (NUM1 is always axis
- aligned to X, NUM2 to Y). The offset of the grid is unspecified
-P65 - element and text are ignored
-P66 - a pad or pin is approximated with a polygon
-P67 - for networks, iterate over all objects and append unique coordinates on
- the resulting list
-P68 There's no guarantee on the particular order of the list.
-
diff --git a/doc-rnd/ddrc/requirements.txt b/doc-rnd/ddrc/requirements.txt
deleted file mode 100644
index b53c3f7..0000000
--- a/doc-rnd/ddrc/requirements.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-The Dynamic DRC should be able to solve at least these tasks:
- - check start grounding
- - require element placement on same layer
- - specify element proximity to each other on same layer
- - specify element proximity to the edge
- - specify element proximity to network or other copper feature
- on the same layer
- - perform copper vs. copper checks
- - minimal gap between an object or network and anything else
- - minimal gap between high voltage and low voltage networks
- - perform copper geometry checks
- - detect minimal width (high current)
- - detect poly hairpin
- - number and length of stubs (hight freq)
- - "via cage": a given network needs to be sorrounded by a set of gnd vias
- - network related copper checks
- - matched length lines (e.g. fast dram bus)
- - balanced transmission line (distance between the tracks)
- - match and/or limit number of vias
- - limit layer usage
- - require layer stackup properties, e.g. microstrip, stripline
- - e.g. require ground poly on the next layer
- - e.g. number of gaps in the ground poly the line jumps
diff --git a/doc-rnd/devlog/20150816a_scriptig.html b/doc-rnd/devlog/20150816a_scriptig.html
deleted file mode 100644
index 609f13b..0000000
--- a/doc-rnd/devlog/20150816a_scriptig.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<HTML>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-<h2> scripting, 2 </h2>
-I've been working on the documentation for pcb-rnd scripting lately.
-Proof reading and comments would be appreciated. The documents are
-work-in-progress.
-<p>
-I have a <a href="http://repo.hu/projects/pcb-rnd/gpmi/rosetta/index.html">Rosetta stone</a>
-of examples demonstrating how to write simple scripts.
-It doesn't explain how the system works, but shows easy-to-understand
-practical examples. Useful for those who like learn by doing and look up
-the "theoretical" background only after seeing things in practice.
-<p>
-Another document, the <a href="http://repo.hu/projects/pcb-rnd/gpmi/scripting_intro.html">
-scripting intro</a> focuses on explaining how things are built up. This
-one is useful for those who first want to understand the design and then
-look at how to do things in practice.
-<p>
-As a next step I plan to reorganize the package documentation and split
-them all into a high level "what's the concept" doc and a low level
-reference manual.
-<p>
-I also plan to improve the links between the docs and write more rosetta
-examples. I plan to have a few more all-language examples on the most
-basic things. The more complex examples would be written in awk, lua and
-maybe ruby.
-
diff --git a/doc-rnd/devlog/20150821a_parametric_requirements.html b/doc-rnd/devlog/20150821a_parametric_requirements.html
deleted file mode 100644
index 3ace404..0000000
--- a/doc-rnd/devlog/20150821a_parametric_requirements.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-<h2> requirements for parametric footprint generation </h2>
-
-It's appealing to write parametric footprint generators for new footprint
-families: invest some time once, and have a tool that can spit out
-dozens of footprints. However, it is not always worth having a generator
-instead of static footprints. The minimal requirements for a generator are:
-
-<ul>
-
-<li> the footprint family is a series of footprints that can be generated
-using the same code, with changing some base properties (e.g. number of
-pins)
-
-<li> dimensions and other properties can be calculated from the base
-properties with reasonable formulas and conditional code; e.g. sot* is not
-a good candidate for generation, as sot23 or sot89 can not be generated
-from some common anestor by varying one or two parameters, but would need
-a large table that translates package name to a pattern - easier to keep
-those in static footprint files
-
-<li> has a reasonable amount of existing variations; e.g. it is not worth
-writing a generator for the dsub family because there are only a few of
-them in common use (db9, db15, db25, and maybe db37).
-
-<li> preferably a link to a datasheet that shows at least 3 members of the
-family; if that's not possible, separate datasheets describing at least 3
-members of the family.
-
-</ul>
diff --git a/doc-rnd/devlog/20150830a_fork_faq.html b/doc-rnd/devlog/20150830a_fork_faq.html
deleted file mode 100644
index fc0e9be..0000000
--- a/doc-rnd/devlog/20150830a_fork_faq.html
+++ /dev/null
@@ -1,257 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-
-<H2> Fork FAQ </H2>
-
-This document contains my short answers to questions commonly popping up
-in endless flamewars on the geda mailing list. <b>The purpose of this
-document is not to convince anyone about any of the questions</b>, only
-to save me some time typing the same answers when someone asks me
-one these questions for the 100th time. As I don't want to convince you
-that my answers are the best ones, please don't try to convince me that
-they are bad. Been there, done that, never worked in either way: e.g.
-I never convinced any git fanboy to switch to svn, and they never
-convince me to switch to git.
-
-<H3> 1. Why did you fork? </H3>
-<a id="1"><a id="fork">
-<H4> 1.1. Fragmentation is bad, your fork is harmful! </H4>
-I agree that fragmentation is bad. I believe the same aspects of
-the current project management and especially the choice of VCS inevitably
-leads to forks (just look at how many git forks are out there!). Such
-fragmentation of developer and user resources may be bad for a project.
-However, these decisions are not mine: the project is set up like
-that, I can't change it
-<p>
-My fork is just a fork, just like any of the other forks. My fork happens to
-be in an svn repository. I don't think it changes anything important from the
-mainline's point of view.
-
-<H4> 1.2. ... but how will you get all these merged with mainline? </H4>
-I won't. I haven't really used the official, current mainline since like
-2011. I don't really care in what directions it evolves or whether it
-takes features, code or ideas from pcb-rnd or not.
-
-<H4> 1.3. ... but you are in the best position for a merge! </H4>
-I don't think so. I know my changes, but I don't know the changes happened
-in the mainline since ages. I am also not efficient with git. It wouldn't
-take me any less time than for mainline developers. Also please read point 1.2.:
-I have no motivation in spending any time on a merge.
-
-<H4> 1.4. Ok then, but you won't have too many users. </H4>
-Fine. My main intention was to produce a pcb editor for my own use. I am
-happy if it's also useful for others, so I publish it. Having users
-may increase code quality - but other than that, I don't get paid for having
-more users, the project doesn't die if I code it alone, so I am not worried
-about this.
-<p>
-<b>Update (Aug 2016):</b> an active user/contributor community is forming
-around pcb-rnd. It is not a one-man-show anymore.
-
-<H4> 1.5. I'd like to merge something from pcb-rnd to mainline </H4>
-Go ahead. I can help you by explaining my code. I won't generate
-patches, make changes to get my code compatible with the mainline or
-test how it performs in mainline versions.
-
-<H4> 1.6. I'd like to merge something from mainline to pcb-rnd </H4>
-If the feature is in line with the goals of pcb-rnd, fine, I'll give
-you svn commit access from day 0.
-
-<h4> 1.7. Would you abandon the development of pcb-rnd and join the mainline, if... </H4>
-Unlikely. There are many things I have in pcb-rnd which I believe won't ever
-happen in mainline. There are a few which I find critical: if I'd need to
-give up any single item from this list, that would be a deal-breaker for me:
-<ul>
- <li> simple, centralized VCS (not just the UI, the whole thing)
- <li> VCS based, zero-administration release and publish interface
- <li> a sane build system instead of autotools
- <li> the code won't switch to C++
-</ul>
-
-
-<h4> 1.8. Would you join the development of gschem? </h4>
-Unlikely. See point 1.7. Gschem is not aiming to a C++ transition AFAIK,
-but has a lot of scheme. I don't consider joining or contributing to
-gschem until those points listed in 1.7. are fixed and a new scheme
-policy is introduced. The new policy should be: "from now on
-do not write new code in scheme, use C; while making changes and fixes,
-convert affected scheme code to C. Long term, explicit plan: convert all
-scheme code to C and remove the guile dependency."
-<p>
-I don't expect any of this to happen.
-<p>
-<b>Update (Aug 2016):</b> Instead, I'll launch <a href="20160101_cschem.html"> cschem </a>.
-
-
-<H3> 2. git: did you know... </H3>
-<a id="2"><a id="git">
-Preface: I don't try to convince you not to use git in your project; in
-return, please don't try to convince me I should use git in mine.
-
-<H4> 2.1. ... that there was an svn frontend to git? </H4>
-Yes. 2/3 of my problems with git and DVCS in general are not of technical
-nature. I know the <b>concepts</b> of DVCS and I find them suboptimal in
-case of small teams. A different UI or a good document won't help in that.
-
-<H4> 2.2. ... that there was this great document about git? </H4>
-See 2.1.
-
-<H4> 2.3. ... that DVCS is the future, anything centralized is bad, svn is obsolete? </H4>
-These are not facts, but slogans I don't believe in.
-
-<H4> 2.4. What if someone has to develop offline for long? </H4>
-In the 21th century, when we have cheap mobile internet even in eastern
-Europe?
-
-<H4> 2.5. But feature X is harder with svn! </H4>
-Almost all those features are bad for team work in my experience. They
-are not even needed. Yes, some aspects of the development have to be
-done differently without those - but this is good for the project.
-
-<H4> 2.6. But there are no local repositories and you have to commit unfinished stuff and worry if anything breaks! And branching is hard </H4>
-This is the point. I do not branch. I do not attempt to work offline for long,
-whatever technical support the VCS may provide for that. I try to work in
-a team, on a common code base.
-<p>
-I commit small things. I make sure I do a big transition using
-these small commits in a way that the code stays compilable in between any
-two commits. It rarely breaks trunk/ for longer than a few minutes. I
-need a real branch once a decade.
-
-<H4> 2.7. But that's extra effort and makes life harder! </H4>
-Yes and no. It's certainly harder to design and carry out a big
-reorganization in small steps. This is an extra cost. However, the
-benefits outweight this: everyone working in the same repo,
-other developers see and comment what you are working on, if done right,
-merging is nearly never needed and conflicts are as rare as bugfree
-release of a multi-million line proprietary software.
-
-<h4> 2.8. I don't agree with any of this, git is better! </H4>
-Cool, so go on using git. I didn't try to convince you not to, I just
-explained why I won't.
-
-<H3> 3. opengl </H3>
-<a id="3"><a id="opengl">
-<H4> 3.1. But I need opengl! </H4>
-Use the mainline then. Or contribute the code for sane opengl support
-in pcb-rnd.
-<p>
-<b>Update (Aug 2016):</b> GUI HIDs are plugins now, multiple GUIs can
-be compiled and chosen run-time. Default GUI is a runtime configuration too.
-All we need to have an opengl GUI HID now is a gl-capable volunteer.
-
-<H4> 3.2. ... good, then please make that opengl hid!</H4>
-No, thanks. I don't need it, I wouldn't use it, there's no point in spending
-my time on it. If you need it, I invite you to do it.
-<p>
-<b>Update (Aug 2016):</b> I can do the build system and plugin administration
-part for you.
-
-<H4> 3.3. Did you know that opengl can be turned off in mainline? </H4>
-Yes. If I have a fork, I want its defaults to reflect my preferences.
-
-<H4> 3.4. But transparent renders are so good on a board with many layers! </H4>
-Not for me: transparency made even a 2 layer board cryptic when I tried. See
-3.1.
-
-
-<H3> 4. programming languages, file formats </H3>
-<a id="4"><a id="c">
-<H4> 4.1. switch to C++, it is so much better </H4>
-Nope. I prefer C.
-
-<H4> 4.2. but pcb-rnd doesn't compile with a C++ compiled </H4>
-Correct: pcb-rnd is written in C. It also doesn't compile with a Pascal
-compiler.
-
-<H4> 4.3. but mainline already invested in preparing a C++ transition </H4>
-Good for them. If I didn't have a fork, I'd fork the day when the first
-C++ class is committed.
-
-<H4> 4.4. we need SQL for the file format </H4>
-No, we don't. I prefer human readable text formats. No, converters won't
-solve that. No, I don't care if python has support for loading SQL files.
-<p>
-<b>Update (Aug 2016):</b> the file format is a replacable plugin now;
-it's even possible to have multiple alternative formats active in the same
-time. It's up to you to implement your format in a plugin.
-
-<H4> 4.3. we need to switch to xml/json (or python or perl arrays) </H4>
-No, we don't need to.
-<p>
-<b>Update (Aug 2016):</b> ... unless you implement it in a plugin, see point 4.4.
-
-<h4> 4.4. ... but they are easier to parse because of existing libs </h4>
-Yup, but in any real life task that part of the parsing is like 5%. The
-rest 95% needs to be programmed anyway. The costs of such a file format change
-is not justified by this minor gain.
-
-<h4> 4.5. ... but the current file format doesn't support feature X </h4>
-<small>
-True. And that's because the internal model (the in-core representation
-and <b>all the code handling that</b>) doesn't support the feature either.
-Changing the file format won't help that. It's similar to point 4.4.: 95%
-of the effort is needed to get the code to support the feature, and by that
-time the cost of getting it into the file format is very small. Costs
-are not justified.
-</small>
-<p>
-<b>Update (Aug 2016):</b> long term the new primary file format will be
-lihata to overcome the above limitations. Later on the internal representation
-may change too.
-
-<H4> 4.6. ... but I can't build a database of the current lib </h4>
-Too bad. Either figure how to do it, or just don't do it. pcb-rnd
-offers scripting, even in languages that have SQL support. In theory
-it wouldn't be that hard to write scripts running in PCB manipulating
-the buffer or even the in-core footprints on one end and connecting
-an SQL database on the other end.
-
-
-<H3> 5. scconfig, autotools, build systems </H3>
-<a id="5"><a id="scconfig">
-<h4> 5.1. scconfig doesn't support feature X that autotools does </h4>
-Are you sure? Maybe it does, just uses a different syntax. If not, did
-you try to send me a feature request?
-
-<h4> 5.2. scconfig's syntax is different </h4>
-Yes. Scconfig has a totally different internal model thus the UI differs
-too. Same as vim has a different UI than emacs, while they are both text
-editors and the two communities are not trying too hard to unify the UIs.
-
-<h4> 5.3. But ./configure has to have the same UI as autotools </h4>
-False.
-
-<h4> 5.4. Most people know autotools, there are merits in supporting the same features or UI </h4>
-I do realize that. I've been working on scconfig since 2008. I've invested
-a lot of time in it. Believe me, I did think it over before I decided that
-the benefits would overweight the drawbacks of developing/using a custom
-config/build system.
-
-<h4> 5.5. But autotools is so much better! </H4>
-No, it isn't. My experience is that with random open source projects
-on anything different from Linux, modern BSD, and sometimes windows, it
-just breaks at least 8 times out of 10. Try it once on IRIX or minix.
-
-<h4> 5.6. So why don't you rather fix autotools? </H4>
-I believe there are multiple design problems in autotools and most of
-the practical problems I faced when using it were directly caused by those.
-In a sense, I did fix these design problems by using a different design.
-The different design is called scconfig and it was much easier to
-write it from scratch.
-
-<h4> 5.7. But scconfig doesn't do cross compilation! </H4>
-False. It does. It's been supported since May 2008. It's been added
-about 1.5 months after the very first file.
-<p>
-<b>Update (Aug 2016):</b> as a practical example, windows .exe has
-been cross-compiled on a Linux box.
-
-<h4> 5.8. I just don't like scconfig. </H4>
-If you have something particular that makes you dislike scconfig,
-a missing feature for example, please let me know.
-<p>
-Else maybe you don't like using anything else than autotools. It's your
-choice; mine is that I do keep on using scconfig in my projects.
-
diff --git a/doc-rnd/devlog/20150830b_back_ann.html b/doc-rnd/devlog/20150830b_back_ann.html
deleted file mode 100644
index cb217e3..0000000
--- a/doc-rnd/devlog/20150830b_back_ann.html
+++ /dev/null
@@ -1,304 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-
-<H2> back annotation </H2>
-
-<H3> netlists, annotations </H3>
-
-Pcb-rnd (and mainline pcb) maintains a netlist as part of the design. Pcb
-doesn't modify the netlist. The netlist is imported from an external source,
-typically from gschem. This process is called forward annotation.
-<p>
-Sometimes there are a set of connections which contain pin pairs that could
-be swapped. For example the data lines of an external parallel SRAM interface
-to an MCU: it doesn't matter if data bit 1 at the MCU is wired to data bit
-1 or 5 of the SRAM, as there is an 1:1 mapping and no one else is using the
-same bus wires. In this case connections should be swapped during pcb routing
-and annotated back to gschem so that the schematics can be updated. Both
-paths are illustrated below.
-<p>
-<img src="res/20150830b_annot.png" alt="annotation paths">
-<p>
-Forward annotation passes on complete netlists along arrows forward1 and
-forward2. Back annotation would pass back netlists, changes or modification
-requests on the back1, back2 path. Gnetlist takes sch files to extract
-and build a netlist in whatever format the receiver needs. There should be a
-glue layer, called <i>foo</i> on the drawing, that does the reverse: receives
-whatever format the sender has and generates something that gschem will
-understand.
-
-<H3> Support in pcb-rnd: core </H3>
-Pcb-rnd gets a complete netlist. If the user could change the netlist directly,
-there should be some sort of diff tool in <i>foo</i> that can explain the
-changes to gschem, or a diff tool in gschem. What is worse, forward annotation
-happens much more often than back annotation and pcb-rnd would need to be able
-to merge a new netlist with local changes. The simple "gsch2pcb overwrites the
-netlist in pcb from whatever gnetlist produced" approach would not work.
-<p>
-An alternative is to keep the netlist as-is, and maintain a separate list of
-changes. The form proposed hereby is a table of "operation,pinID,net" or
-"operation,args...". Netlist operation is one of "del_conn", "add_conn" <!--, "del_net",
-"add_net"--> and "net_info". The table is called the <i>netlist patch</i>.
-<p>
-For example assume two components with pins A1, A2 and B1, B2, with connections
-n1=A1-B1 and n2=A2-B2. While routing the designer decides changing them to
-n1=A1-B2 and n2=A2-B1 would be easier and is acceptable by the design. The
-table of changes would contain this:
-<table border=1>
- <tr><th>op <th> pinID <th> net
- <tr><td>del_conn <td> B1 <td> n1
- <tr><td>del_conn <td> B2 <td> n2
- <tr><td>add_conn <td> B2 <td> n1
- <tr><td>add_conn <td> B1 <td> n2
-</table>
-The first two lines would remove pins B1 and B2 from n1 and n2. The last
-two would put them back, swapped. New nets could be created or unused nets
-could be removed using the add_net and del_net commands that have empty pinID.
-The table is ordered, rows are strictly executed from top to bottom.
-<p>
-Pcb-rnd would store this table in memory. When some code calls the netlist
-code to find out the members of a net, or which net a given pin is connected to,
-after running the original netlist code, the result would be adjusted by the table.
-<p>
-The table would be normalized after operations. For example:
-<table border=1>
- <tr><th>op <th> pinID <th> net
- <tr><td>del_conn <td> B1 <td> n1
- <tr><td>add_conn <td> B1 <td> n2
- <tr><td>add_conn <td> B1 <td> n3
- <tr><td>del_conn <td> B1 <td> n2
-</table>
-would be reduced to
-<table border=1>
- <tr><th>op <th> pinID <th> net
- <tr><td>del_conn <td> B1 <td> n1
- <tr><td>add_conn <td> B1 <td> n3
-</table>
-Simple linear crawls on the table seems sufficient: it is expected that
-pcb designers will make netlist modifications rarely and they will back
-annotate them ASAP. In extreme cases there may be 64 bit wide bus systems that
-need total reordering; even a 4 such reorders will introduce about 1024 items
-on the list which seems not too big for O(1) algorithms. See section TODO
-for better approaches.
-<p>
-Pcb-rnd would save the normalized table in the pcb file in a new section.
-Upon a netlist change in pcb (import/load netlist or load the pcb), pcb-rnd
-would check each row of the table: it is easy to decide whether that row
-has been implemented in the netlist or not. Obsolete rows of the table would
-be deleted.
-<p>
-A corner case is when B1 is removed from n1 and then added to n2 by the table,
-while a new forward annotation removes B1 from n1 and adds it to n3. In this
-case the first row of the table is deleted, as B1 is already removed from n1,
-but pcb-rnd has no chance to decide if netlist adding B1 to n3 should affect
-the table adding B1 to n2, so that rule is kept.
-<p>
-<b>net_info</b> is used to describe the <b>original</b> members of a net, in
-the state they were before any change on the netlist occured.
-
-<H3> Support in pcb-rnd: GUI </H3>
-A trivial idea is to extend the netlist window so that pins can be moved in
-between nets or deleted or assigned to nets. Changes should be marked. This
-is not the preferred way of editing the netlist, tho: not much more convenient
-than making changes in gschem and doing forward annotation.
-<p>
-There should be a separate dialog box or a separate region of the netlist box
-showing the <i>netlist patch</i> with edit capabilities.
-<p>
-Finally, the most important feature would be new actions resolving shorts.
-Using the above example (n1=A1-B1 and n2=A2-B2 changed to n1=A1-B2 and n2=A2-B1),
-I believe the user would:
-<table border=1>
- <tr><th> action <th> screenshot <th> patch list after the actions
- <tr><td><ul><li> look at initial rats</ul><td> <img src="res/20150830b_s0.png" width="50%"> <td> (empty)
- <tr><td><ul><li> first connect A1 to B1</ul> <td> <img src="res/20150830b_s1.png" width="50%"> <td> (empty)
-
- <tr><td><ul>
- <li> then realize it's very hard to connect A2 to B2 while the previous connection is there
- <li> he would then revert the first connection
- <li> and connect A1 to B2
- <li> which would cause shorts
- </ul><td> <img src="res/20150830b_s2.png" width="50%">
- <td>(empty)
-
- <tr><td><ul>
- <li> then he would use the "approve netlist change" hotkey/action on the network;
- this would add <i>netlist patch</i> commands for the A1-B2 connection,
- but would also keep the A1-B1 connection, which remains a rat; because
- of the new connection there'd be a rat between A1 and A2 or B1 and B2 too
- (all 4 pins connected together on the patched netlist at the moment!)
- </ul><td> <img src="res/20150830b_s3.png" width="50%">
- <td>
-<pre>
-net_info n1 A1 B1
-net_info n2 A2 B2
-del_conn B1 n1
-add_conn B1 n2
-</pre>
-
- <tr><td><ul>
- <li> the user would then use an action (maybe the same one?) on the rat line
- so that pcb-rnd would understand that rat is not needed anymore and
- would add a patch to remove the A1-B1 connection
- <li> the same thing would need to happen to the A2-B2 rat
- </ul><td> <img src="res/20150830b_s4.png" width="50%">
-<td>
-<pre>
-net_info n1 A1 B1
-net_info n2 A2 B2
-del_conn B1 n1
-add_conn B1 n2
-del_conn B2 n2
-</pre>
-
-
- <tr><td><ul><li> the user then would connect A2 to B1, which again is a short</ul><td><img src="res/20150830b_s5.png" width="50%">
- <tr><td><ul>
- <li> the user would approve it as a new connection
- <li> we have exactly 2 del_conn and 2 add_conn patches.
- </ul><td><img src="res/20150830b_s6.png" width="50%">
-<td>
-<pre>
-net_info n1 A1 B1
-net_info n2 A2 B2
-del_conn B1 n1
-add_conn B1 n2
-del_conn B2 n2
-add_conn B2 n1
-</pre>
-
-</table>
-An experienced user may think a few steps in advance and
-chose to first remove the A1-B1 and A2-B2 rats and then create the A1-B2
-and A2-B1 connections and then approve the two new connections.
-<p>
-An alternative is drag&drop ratline endpoint onto snap points; it may
-be tricky to convert that to net/pin relations if a rat line is between two
-line segments, tho.
-<p>
-These changes would live immediately, leaving the board free of shorts and
-rats. There should be, however, some warning in the "congratulation" message
-that tells the user a back annotation is still required.
-
-<H3> Support in gschem </H3>
-Ideally there should be a very small change in gschem and an optional
-plugin script could do the rest. The plugin script would be in contant
-with foo.
-<p>
-There are multiple ways pins can be connected to a net in gschem. It's
-probably not a good idea to have too much automatism in the gschem's side,
-trying to actually removing connections and adding new ones using the patch
-(or whatever info <i>foo</i> converted the patch into).
-<p>
-However, gschem should support four things natively:
-<ul>
- <li> it should have a concept of an unwanted pin-network connection; a connection
- becomes unwanted only when the back annotation says so
- <li> it should be able to mark unwanted connections on the active schematic page
- <li> it should be able to tell the user if there are unwanted connections on
- any of the pages open
- <li> it should be able to refresh its idea of unwanted connections while
- schematic pages are open
-</ul>
-<p>
-Displaying unwanted connections happen at:
-<ul>
- <li> a pin of a component is connected to a net using a "blue line" net: mark the pin-net connection point
- <li> a pin is directly connected to another pin, no net line in between: mark the connection point
- <li> a pin is connected to a net using a pin attribute: mark the pin
- <li> TODO: are there more?
-</ul>
-<p>
-TODO: there are a lot to think over about special cases related to
-multipage schematics, hierarchies, slots, split symbols.
-
-<H3> What <i>foo</i> does exactly </H3>
-... is not clear yet. It depends on what sort of support gschem would provide.
-
-<H3> Amendment 1: other parameters (1st sep)</H3>
-I originally forgot to mention my other intentions in the above document:
-back annotate non-netlist properites. It probably happened because netlist
-related stuff are the hardest to solve.
-<p>
-There are other parameters that sometimes change during routing. A common case
-for my 1 or 2 layer boards is when I originally intend to use 0603 parts but
-during routing I figure I need to pass a trace between the pads. I need to
-change the part to 0805 or 1206 (for two traces). I'd like to be able to
-do this <b>in-place</b> in pcb with an action that replaces the footprint
-but keeps the origin in place. This obviously still requires some manual
-fiddling afterwards, but would remove the long, tedious chain I have now:
-<ul>
- <li>1. remember or note down which parts to change footprints for
- <li>2. go back to gschem and change them
- <li>3. get the changes in pcb (I use gsch2pcb and Makefiles, one step; the import menu is one step too, just another one)
- <li>4. disperse the new elements
- <li>5. find where they used to be
- <li>6. and then do the fiddling to fit them in
-</ul>
-<p>
-The new process would be:
-<ul>
- <li> 1. get the footprint replaced, in-place; this would already approve the
- change and there'd be a command for it in the patch table
- <li> 2. do the fiddling to fit the new part in
- <li> 3. do a back annotation
- <li> (4. optionally, if we go for non-automatic change of attributes in gschem,
- change them manually in gschem, cycling through the affected
- items using some UI feature)
-</ul>
-<p>
-The same thing could work for values, which is the other attribute PCB also
-sees. The same mechanism could work from other programs as well, e.g. tuning
-the values of some parts in a simulator and then back annotating the changes
-to the schematics. The patch table format <i>foo</i> handles would be in the
-simplest plain text form.
-
-<a id="a2">
-<H3> Amendment 2: examples from gschem's point of view (3rd Sep)</H3>
-<h4> netlist change </h4>
-<ul>
- <li> The user creates the schematics and imports it in pcb; the original
- netlist contains a line "netname1 U1-1 CONN1-2"
- <li> The user, as part of some pin swapping, decides that U1-1 should be
- connected to net "netname2" instead of "netname1". Changes are
- done in pcb-rnd as described above.
- <li> The netlist patch generated for this single change by pcb-rnd would be:
- <pre>
-del_conn netname1 U1-1
-add_conn netname2 U1-1
- </pre>
- <li> the user may need to load the netlist patch in ghscem
- <li> In gschem there would be an indication that highlights any U1-1 pin or
- U1 symbol that makes a connection to netname 1, graphically or using
- attributes. When asked, gschem UI would also tell the user that U1-1 is
- now connected to netname1 but should be connected to netname2 instead.
- <li> The user would find this indication and would resolve the situation
- by whatever changes he finds appropriate
- <li> gschem would rerun the patch commands and would figure that the del_conn
- fails to run because U1-1 is no longer connected to netname1 and the add_conn
- fails too because U1-1 is connected to netname2. This leaves U1-1 without
- any known issue, so the indication on U1-1 would be gone.
-</ul>
-
-<h4> attribute change: footprint change </h4>
-<ul>
- <li> The user creates the schematics and imports it in pcb; originally
- U1 has an attribute footprint=DIP(8).
- <li> during the layout the user figures using the footpritn SO(8) is
- more appropriate. He does the change in pcb-rnd.
- <li> pcb-rnd emits the following netlist patch for this:
- <pre>
-change_attrib U1 footprint=DIP(8) footprint=SO(8)
- </pre>
- <p>
- (or it could be a del_attrib and add_attrib pair, like with connections)
- <li> the user may need to load the netlist patch in ghscem
- <li> In gschem there would be an indication that highlights any U1 instances
- that has footprint=DIP(8)
- <li> The user would find this indication and would resolve the situation
- by whatever changes he finds appropriate (e.g. change the attribute)
- <li> gschem would rerun the patch commands and would figure the change is
- no longer requred and would remove the indication
-</ul>
-
diff --git a/doc-rnd/devlog/20151028_glib.html b/doc-rnd/devlog/20151028_glib.html
deleted file mode 100644
index 76cf8b8..0000000
--- a/doc-rnd/devlog/20151028_glib.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-
-<H2> why glib is a bad idea </H2>
-
-Levente tried to compile pcb-rnd on bsd and used a different c compiler
-than gcc. For this in the first step I fixed the build system so that it
-doesn't have gcc --std=gnu99 but gcc --std=c99.
-<p>
-And then everything broke. A minilib I use for hashing,
-<a href="http://repo.hu/projects/genht">genht</a>, failed to
-link against hid/common/action.c. I first thought it was a bug in genht:
-genht was compiled without --std while the rest of the code compiled with
---std=gnu99 or --std=c99. Genht heavily depends on static inline
-functions for performance, maybe that's why.
-<p>
-So I tried to reproduce the situation in a hello-world like program and
-tried all combinaton of --std, -DNDEBUG, -rdynamic and all build flags
-used in pcb-rnd for the genht lib and the test program, but all combination
-worked. It looked like it broke only in pcb-rnd.
-<p>
-I gave up on the minimal test case and went back to pcb-rnd. I realized if
-the build is the same, the only way it may break is that some header
-included before genht's headers change some global state. I started to
-shuffle the #includes. Long story short, it turned out if <glib.h> is
-included before genht's headers, it breaks.
-<p>
-Some more tracing showed it was because glib over-#defines the keyword
-<i>inline</i> in a public header that gets included from glib.h. It's all wrapped
-in a complicated tree of #ifdefs, so it behaves differently depending on
-the --std setting.
-<p>
-The morale of the story is... Well, I have multiple conclusions.
-<ul>
-<li> glib is not a lib that tries to solve something, it is a prorgamming
-environment that tries to supersede C.
-
-<li> As such, it feels free to mess with the environment, redefine C
-keywords as it sees fit, because once you use glib, why would you use
-anything else? And once you use glib, you are programming in glib, not in
-"plain C".
-
-<li> Grepping through the pcb-rnd code, I see that pcb-rnd does not try to
-use glib as a programming environment, but needs only 2 and a half
-features: hash, list and rarely dynamic strings. Any other glib call is
-just a must that had to be done that way to get hashes and lists working.
-
-<li> genht is 510 sloc. I have a generic list implementation (which, by the
-way, is more efficient than glib's) It costs 256 sloc. So having
-type-independent hashes and lists in C89 costs less than 800 lines of code
-if you pick the right libs. Glib's <b>include/ alone is over 24000 sloc!</b>
-And in return glib breaks inline...
-</ul>
-
-<p>
-In a nuthsell this is why I don't believe in glib-like solve-all megalibs. I
-don't say size alone determines this, but size is a good indication of
-potential problems.
-<p>
-If I need hash and lists and the offer is longer than 5k sloc, I know it
-will bring a lot of unneeded bloat that likely to break things.
-
-</body>
-</html>
\ No newline at end of file
diff --git a/doc-rnd/devlog/20160101_cschem.html b/doc-rnd/devlog/20160101_cschem.html
deleted file mode 100644
index b7e3970..0000000
--- a/doc-rnd/devlog/20160101_cschem.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-
-<H2> cschem </H2>
-
-Cschem is a project I plan to start within the next few years. It's goals
-and some design concepts are similar to gschem's and geda's, while it
-also breaks some traditions to fix shortcomings in the design of geda. It's
-named after gschem, not after geda, to emphasize that the editor needs to
-be connected more to the rest of the system (see details later).
-<p>
-Some concepts cschem will try to follow (marking with * where there's major
-difference to geda):
-<ul>
- <li> 1. design
- <ul>
- <li> 1.1. modularity, aka. toolkit approach
- <li> 1.2. flexibility (trough attributes)
- <li> 1.3. one schematics file is one sheet
- <li> 1.4. multi page projects (hierarchic, flat)
- <li> 1.5. data is in structured text files (no builtin sql support in core)
- <li> 1.6. * the concept of a "project"; it's optional, tools can work on a set of schematics files _or_ on a complete project
- <li> 1.7. * nets and components are uniquely identifiable using the same identifiers by all projects
- <li> 1.8. * no excess "smartness" in the GUI editor: no slotting, no pin numbering, no auto renumbering, etc; these all should be done in the netlist layer and results fed back to the editor
- <li> 1.9. * direct, bidirectional communication between the editor (GUI) and the netlist layer <b>without</b> any integration of the two, through simple and clean API, keeping both parts replaceable; attributes cschem got back from the netlister are "volatile": not saved, do not override attributes provided by the user
- <li> 1.10. * less format-specific tricks built into the GUI code, more generic approaches (e.g. a search is a search, not a search-for-text-attribute and results on the result lists are any object of the design)
- <li> 1.11. * slotting, pin mapping, device mapping are in backends
- <li> 1.12. * back annotation should not be any harder than forward annotation
- <li> 1.13. * since a lot of info is invented in backends, not in the GUI (e.g. pin numbers, when slotting), the GUI needs to be able to switch between "views": what (combination of) backend(s) to get these info from; Note: this would also provide an interactive DRC on the GUI with the DRC still implemented in the netlister!
- <li> 1.14. * the scriptable plugin system is based on GPMI from the start to guarantee the tool is not tied to any one specific scripting engine or scripting language
- </ul>
- <li> 2. implementation
- <ul>
- <li> 2.1. a core library that does common things like figuring what objects are connected with net lines
- <li> 2.2. the simple GUI editor should provide the frame; exotic functions should come from user plugins
- <li> 2.3. a simple netlister that provides only generic (* absolutely no backend specific) queries; actual backends are implemented as plugins
- <li> 2.4. * the core library and the netlister and the GUI core are all implemented in plain C:
- <ul>
- <li> 2.4.1. * no dependency on any specific scripting engine or scripting language; no core functionality implemented in anything else but C
- <li> 2.4.2. * no dependency on big "solves-everything" libraries (e.g. no glib or cairo dependency)
- <li> 2.4.3. * the actual GUI is behind the plugin system (like PCB's HIDs)
- <li> 2.4.4. * the first gui, in accordance with the no big libraries, will not be gtk or qt but sdl2 based; this would guarantee to have a front end that doesn't need to be rewritten every 5 years just for the sake of the rewrite
- <li> 2.4.5. * scconfig instead of autotools: smaller, easier to maintain, works better outside of the gnu-win32 world
- </ul>
- </ul>
- <li> 3. project management
- <ul>
- <li> 3.1. automatic tests wherever possible, as early as possible
- <li> 3.2. * VCS: simple, centralized svn with straight linear developement, actively trying to avoid branching
- <li> 3.3. * near-zero-administration releases with svn commits
- <li> 3.4. * users should be able to submit bug reports anonymously, without having to register, without having to run javascript, java applet, flash, etc.
- </ul>
- </ul>
-</ul>
-
-<p>
-There are a lot of open questions:
-<ul>
- <li> q1. how buses should work
- <li> q2. how slotting should work (but at least we can have alternatives here)
- <li> q3. how hierarchical design should work
- <li> q4. * how the GUI should display large amount of attributes without making the whole page an unreadable mess
- <li> q5. flat vs. non-flat netlists - if turns out it's not just an implementation detail in a netlister backend
- <li> q6. * whether project file format is a custom format or just a top sch page referencing other sch pages - pcb-rnd is leading here, there is an optional project file format already defined, so this is more or less decided
- <li> q7. attribute conventions
-</ul>
-
diff --git a/doc-rnd/devlog/20160409/header b/doc-rnd/devlog/20160409/header
deleted file mode 100644
index afc3c0e..0000000
--- a/doc-rnd/devlog/20160409/header
+++ /dev/null
@@ -1,7 +0,0 @@
-1. Do you use the lesstif HID?
-2. If there were different menu resources files distributed with PCB, would you try them?
-3. Do you customize your menu resource file?
-4. If you do not costumize your menu resource file, it's because
-5. Do you miss multi-key sequences from the GTK hid?
-6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?
-7. Vendor (drill) mapping also uses a resource file.
diff --git a/doc-rnd/devlog/20160409/header.csv b/doc-rnd/devlog/20160409/header.csv
deleted file mode 100644
index b4ddf77..0000000
--- a/doc-rnd/devlog/20160409/header.csv
+++ /dev/null
@@ -1 +0,0 @@
-1. Do you use the lesstif HID?,2. If there were different menu resources files distributed with PCB, would you try them?,3. Do you customize your menu resource file?,4. If you do not costumize your menu resource file, it's because,5. Do you miss multi-key sequences from the GTK hid?,6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?,7. Vendor (drill) mapping also uses a resource file.,
\ No newline at end of file
diff --git a/doc-rnd/devlog/20160409/legend.txt b/doc-rnd/devlog/20160409/legend.txt
deleted file mode 100644
index 4812fb3..0000000
--- a/doc-rnd/devlog/20160409/legend.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-1. Do you use the lesstif HID? (select one)
-a. yes, exclusively
-b. yes, often
-c. sometimes, rarely
-d. never
-
-
-2. If there were different menu resources files distributed with PCB,
-would you try them? (select one)
-a. yes, I'd give each variant a try before deciding which one to use
-b. no, I'm fine with the default
-c. I don't know what a menu resource file is
-
-
-3. Do you customize your menu resource file? (select one)
-a. yes, always (e.g. I have an own variant I use with all installation of
-PCB)
-b. yes, sometimes, rarely (e.g. I once had to do something repeatedly and
-added a key binding for that)
-c. never, I know where I'd perform the changes if I ever needed
-them but defalts are good enough for now
-d. never, I don't know what a menu resource file is
-
-
-4. If you do not costumize your menu resource file, it's because (select
-zero or more):
-a. I don't need to
-b. the file is too long
-c. too many keys are taken, it's hard to find a free one
-d. I don't like the format of the file
-e. I don't like the idea of editing text config files, I want a GUI for
-this
-f. I don't want to diverge from the default settings (e.g. because of
-potetial hassle at a later upgrade)
-
-
-5. Do you miss multi-key sequences from the GTK hid? (select one)
-a. yes, I'd prefer to use them over modifiers (ctrl, alt, shift)
-b. yes, I'd use them together with the modifiers
-c. maybe I'd use some
-d. no, I prefer modifiers
-e. I hate the idea so much that I'd even disable it compile time if that
-was possible
-f. N/A, don't know
-
-
-6. If the GTK hid supported multi-key sequences, would that change any of
-your previous answers? (fill in zero or more with a letter)
-a. my new choice for 2. would be:
-b. my new choice for 3. would be:
-
-7. slightly off-topic: vendor (drill) mapping also uses a resource file.
-Do you use this feature? (select one)
-a. yes, often, many of my boards rely on vendor mapping and I maintain
-my own resource files per vendor
-b. yes, sometimes, rarely (e.g. I needed it once...)
-c. no, I know how to use it but never needed it
-d. no, I know the feature exists and I know where to look it up but I
-don't really know what exactly it can do or why I should bother
-e. no, I never heard about this feature
diff --git a/doc-rnd/devlog/20160409/poll.html b/doc-rnd/devlog/20160409/poll.html
deleted file mode 100644
index 351a1ba..0000000
--- a/doc-rnd/devlog/20160409/poll.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<html><body><table border=1>
-<tr>
-<th>1. Do you use the lesstif HID?
-<th>2. If there were different menu resources files distributed with PCB, would you try them?
-<th>3. Do you customize your menu resource file?
-<th>4. If you do not costumize your menu resource file, it's because
-<th>5. Do you miss multi-key sequences from the GTK hid?
-<th>6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?
-<th>7. Vendor (drill) mapping also uses a resource file.
-<tr><td>a<td>a<td>a<td>-<td>-<td>-<td>c
-<tr><td>d<td>a<td>c<td>f<td>a<td>-<td>d
-<tr><td>b<td>a<td>b<td>-<td>c<td>-<td>c
-<tr><td>d<td>c<td>d<td>a+f<td>c<td>-<td>e
-<tr><td>d<td>b<td>c<td>a+f<td>b<td>-<td>b
-<tr><td>d<td>a<td>a<td>a<td>d<td>-<td>c
-<tr><td>-<td>a<td>c<td>-<td>a<td>-<td>-
-<tr><td>c<td>a<td>b<td>f<td>a<td>-<td>c
-<tr><td>c<td>a<td>c<td>-<td>a<td>-<td>-
-<tr>
-<td><img src="pie_col_1.png">
-<td><img src="pie_col_2.png">
-<td><img src="pie_col_3.png">
-<td><img src="pie_col_4.png">
-<td><img src="pie_col_5.png">
-<td>
-<td><img src="pie_col_7.png">
-</table>
-<p>
-<h3> Legend </h3>
-<pre>
-1. Do you use the lesstif HID? (select one)
-a. yes, exclusively
-b. yes, often
-c. sometimes, rarely
-d. never
-
-
-2. If there were different menu resources files distributed with PCB,
-would you try them? (select one)
-a. yes, I'd give each variant a try before deciding which one to use
-b. no, I'm fine with the default
-c. I don't know what a menu resource file is
-
-
-3. Do you customize your menu resource file? (select one)
-a. yes, always (e.g. I have an own variant I use with all installation of
-PCB)
-b. yes, sometimes, rarely (e.g. I once had to do something repeatedly and
-added a key binding for that)
-c. never, I know where I'd perform the changes if I ever needed
-them but defalts are good enough for now
-d. never, I don't know what a menu resource file is
-
-
-4. If you do not costumize your menu resource file, it's because (select
-zero or more):
-a. I don't need to
-b. the file is too long
-c. too many keys are taken, it's hard to find a free one
-d. I don't like the format of the file
-e. I don't like the idea of editing text config files, I want a GUI for
-this
-f. I don't want to diverge from the default settings (e.g. because of
-potetial hassle at a later upgrade)
-
-
-5. Do you miss multi-key sequences from the GTK hid? (select one)
-a. yes, I'd prefer to use them over modifiers (ctrl, alt, shift)
-b. yes, I'd use them together with the modifiers
-c. maybe I'd use some
-d. no, I prefer modifiers
-e. I hate the idea so much that I'd even disable it compile time if that
-was possible
-f. N/A, don't know
-
-
-6. If the GTK hid supported multi-key sequences, would that change any of
-your previous answers? (fill in zero or more with a letter)
-a. my new choice for 2. would be:
-b. my new choice for 3. would be:
-
-7. slightly off-topic: vendor (drill) mapping also uses a resource file.
-Do you use this feature? (select one)
-a. yes, often, many of my boards rely on vendor mapping and I maintain
-my own resource files per vendor
-b. yes, sometimes, rarely (e.g. I needed it once...)
-c. no, I know how to use it but never needed it
-d. no, I know the feature exists and I know where to look it up but I
-don't really know what exactly it can do or why I should bother
-e. no, I never heard about this feature
-</pre>
-<h3> Downloads </h3>
-<ul>
- <li><a href="poll.csv"> csv data </a> | <a href="header.csv"> csv header </a>
- <li><a href="poll.tsv"> tsv data </a> (raw, no header)
- <li><a href="legend.txt"> legend </a>
-<ul>
-</body></html>
diff --git a/doc-rnd/devlog/20160826_virtusers.html b/doc-rnd/devlog/20160826_virtusers.html
deleted file mode 100644
index 2b92450..0000000
--- a/doc-rnd/devlog/20160826_virtusers.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
-
-<H2> Offer vs. pull (virtual users vs. active users) </H2>
-Pcb-rnd has an pulled-by-users policy on deciding what features to implement.
-Below I try to explain how we ended up using this policy.
-
-<h3> Past: offer, virtual users </H3>
-
-When I started pcb-rnd, although I published it, I didn't think anyone else
-would use it. It was just about having mainline with different default
-settings.
-<p>
-Later on I added a few features, and pcb-rnd slowly became much more than
-just different defaults. I felt other users may find the new features useful,
-so I had <i>put</i> it on offer: advertised the repository. I thought users
-would download and try the software. Judging from the feedback, they didn't. I
-didn't mind, becuase I was working on features I needed, to get pcb-rnd do what
-I wanted: I was my own target audience and anyone else trying pcb-rnd could
-only be a side effect. Until when I ran out of features because it already
-had everything I needed.
-<p>
-The next step was to implement features for other users. Between summer
-of 2015 and summer of 2016, I tried to be a bit more proactive: made
-public polls to map what users needed and tried to focus implementing
-those features. This did not bring too many users either.
-<p>
-This was when I realized what was really happening: I was <i>offering</i>
-features for <i>virtual</i> users, addressing my communication to the wide
-auidence. Noone really felt it was for him. Even if he was complaining about
-a missing feature in pcb and a few days later I announced the fix in pcb-rnd, it
-was not specifically for him, but for the Greater Good.
-<p>
-Virtual users nearly never became real users. My conclusion was that there
-was no point in implementing features for virtual users as noone ever would
-use those features.
-
-<h3> Present: pull, active users </H3>
-Mid summer 2016, I switched strategy. Instead of polling the crowd, I picked
-a few users with known feature requests and asked them if they were willing to
-test pcb-rnd if I implemented their feature. More than half of them said yes
-and many of them got hooked up. They all became productive, active members
-of the pcb-rnd community.
-<p>
-Learning from this experiece, the new strategy of pcb-rnd is as follows:
-<ul>
- <li> pull instead of offer: do not hope a new feature would attract users,
- rather arrange active users who then pull the project with their
- feature requests;
- <li> do not invest too much time in anything that is not currently pulled
- by actual, existing, active users; rather invest that time in fulfilling
- the needs of already existing users
- <li> reaching 100 users with an average of 0.1% activity will result in
- 0 active useres whereas reaching only 10 users with 30% activity
- will result in 3 active users; thus a small active communit around
- pcb-rnd is more efficient than the much larger geda community;
- <li> users really appreciate fast response on bugreports and feature requests.
- Instead of trying to impress virtual users, rather keep already interested
- users happy.
-</ul>
-
-
-
-
diff --git a/doc-rnd/djopt/Makefile b/doc-rnd/djopt/Makefile
deleted file mode 100644
index c6af240..0000000
--- a/doc-rnd/djopt/Makefile
+++ /dev/null
@@ -1,50 +0,0 @@
-PCB=../../src/pcb-rnd
-HTML=index.html
-CASES = \
- debumpify.$(TARGET) \
- miter.$(TARGET) \
- orthopull.$(TARGET) \
- unjaggy.$(TARGET) \
- vianudge.$(TARGET) \
- viatrim.$(TARGET)
-
-all:
- make conv TARGET=out.png
- make conv TARGET=png
- make index
-
-index:
- make index.html TARGET=txt
-
-index.html: Pre.html Post.html $(CASES) Makefile
- cat Pre.html > $(HTML)
- make conv TARGET=tbl
- cat Post.html >>$(HTML)
-
-conv: $(CASES)
-
-.SUFFIXES: .pcb .out.pcb .png .out.png .tbl
-.PRECIOUS: %.pcb %.out.pcb %.png %.out.png
-
-.pcb.out.pcb:
- echo "OptAutoOnly(); djopt($*); SaveTo(LayoutAs, $*.out.pcb.tmp);"| $(PCB) --gui batch $*.pcb
- awk '/Symbol.. . 1800./,/^Attribute/ { next } { print $$0 }' < $*.out.pcb.tmp > $*.out.pcb
- rm $*.out.pcb.tmp
-
-.pcb.tbl:
- echo '<tr><th>$*<td>'>>$(HTML)
- cat $*.txt >>$(HTML)
- echo ' <td><a href="$*.pcb"><img src="$*.png"></a> <td><a href="$*.out.pcb"><img src="$*.out.png"></a>'>>$(HTML)
-
-.pcb.png:
- $(PCB) -x png --dpi 300 $*.pcb
-
-out.pcb.out.png:
- $(PCB) -x png --dpi 300 $*.out.pcb
-
-clean:
- rm *.out.pcb *.png index.html 2>/dev/null; true
-
-
-
-
diff --git a/doc-rnd/features/ba.html b/doc-rnd/features/ba.html
deleted file mode 100644
index f8b00ad..0000000
--- a/doc-rnd/features/ba.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - back annotation </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [ba] patches </h1>
-Back annotation was a long standing missing functionality. There has been
-different suggestions, including:
-<ul>
- <li> back annotation is not needed at all, the user can do it manually
- <li> pcb should generate a new netlist, the user should run diff on the netlists and manually edit the schematics
- <li> gschem should be able to load netlists emitted by PCB; or gnetlist could reverse-process such a netlist
-</ul>
-<p>
-The current implementation allows pcb-rnd users to make deliberate pin
-swapping and footprint replacement. The changes can be saved in a
-"netlist patch" format. A modified gschem can load these and present them
-as search results pointing to parts of the schematics that need to be changed.
-There is a <a href="https://archive.org/details/pcb-rnd-back-annotation">
-demo video </a> about how this happens in practice.
-<p>
-The modified gschem can be checked out from svn://repo.hu/geda-gaf-ba/trunk
-<p>
-The underlying mechanism is versatile and potentially allows more changes
-to be back annotated. These are not yet accessible due to the lack of PCB
-actions and GUI.
-
-<h2> Design decisions </h2>
-This <a href="devlog/20150830b_back_ann.html"> devlog </a> entry functions
-as a design decision document.
-<a href="devlog/20150901a_back_ann.html"> Another entry </a> is a summary
-on how the feature ended up in a private feature-fork of gschem.
-
-<h2> save/load and compatibility </h2>
-Deliberate changes are tracked so that a new forward annotation from
-the old schematics won't break them. To do this, pcb-rnd saves a
-NetListPatch() section in the file. Mainline PCB can not handle this section.
-Compatibility, by use case:
-<ul>
- <li> 1. No back annotation is made in pcb-rnd: the file <b>stays compatible</b>
- <li> 2. Back annotation is made in pcb-rnd, then the changes are done on the schematics and a forward annotation is also done: the netlist patch in pcb-rnd becomes empty so the pcb file is <b>again compatible</b> with mainline pcb; this is called resolution of netlist patches
- <li> 3. There are unresolved netlist patches saved in pcb-rnd and the user attempts to load the pcb file in mainline pcb: <b>syntax error</b> (but no data loss); solution: resolve the netlist patch as described in point 2.
- <li> 4. Cheat for situation 3.: manually remove the NetListPatch() section from the save file. This way the back annotation info is lost, but mainline pcb can load the file again. This action is sort of "revert back annotation".
- <li> 5. Any file saved by mainline PCB can be opened by pcb-rnd, back annotation does not affect that.
-
-</ul>
-
-
-<h2> plans </h2>
-Back annotation for further changes, e.g. value change, naming/renaming nets,
-etc.
-</body>
-</html>
diff --git a/doc-rnd/features/cycdrag.html b/doc-rnd/features/cycdrag.html
deleted file mode 100644
index cca9844..0000000
--- a/doc-rnd/features/cycdrag.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [cycdrag] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [cycdrag] patches </h1>
-
-A long standing misfeature of pcb (and pcb-rnd) has been that when dragging the
-end of connected traces, pcb chosen one of the traces "randomly". It often
-didn't pick the one the user wanted to move. The workaround was to move the
-one that pcb picked and then return and move the target trace then
-move the other trace back. This gets even more annoying if there are more than
-two objects connected in the given point: 3 traces and a via for example.
-<p>
-The cycdrag patch addresses this issue by defining an action that can cycle
-through objects that could be dragged in the given point while the left mouse
-button is pressed. This lets the user explicitly select the one object to
-work on.
-<p>
-This <a href="https://archive.org/details/pcb-rnd-cycdrag"> demo video </a>
-demonstrates how it works with three lines and a via.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-It does not work with the lesstif HID. It does not work with the rubber band
-mode.
-
-</body>
-</html>
diff --git a/doc-rnd/features/debian.html b/doc-rnd/features/debian.html
deleted file mode 100644
index 7c8881e..0000000
--- a/doc-rnd/features/debian.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [debian] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [debian] patch </h1>
-
-Our current Debian packaging reflects the modularity of pcb-rnd: it has
-most plugins in separate packages. The main package is called
-<b>pcb-rnd-core</b>: this provides the executable and the footprint library
-and the batch HID. The GUI HIDs are in <b>pcb-rnd-gtk</b> and
-<b>pcb-rnd-lesstif</b> - it's possible to install neither, either or both.
-When there are multiple HIDs installed, the user can select one by the
---gui command line parameter or by changing the GUI preference in the
-configuration (the default preference is gtk > lesstif > batch).
-<p>
-The rest of the packages are features, importers and exporters, e.g.
-<b>pcb-rnd-svg</b> is the SVG exporter, <b>pcb-rnd-query</b> is the object
-query language needed for the advanced search.
-<p>
-A metapackage called <b>pcb-rnd</b> is provided for convenience: it installs
-the packages for the most common, yet small setup, with the GTK HID.
-<p>
-How to get the packages:
-<ul>
- <li> decide which packages you need; this <a href="debian_list.html"> package list </a> may help
- <li> use <i>apt-get install</i> after configuring <a href="http://repo.hu/debian"> repo.hu's debian repository </a> as source in your /etc/apt/sources.list
- <li> use <i>dpkg -i</i> after manually downloading the packages from repo.hu's <a href="http://repo.hu/debian/list.html"> flat package list </a> or from <a href="http://repo.hu/debian/pool/main/p/pcb-rnd"> the package pool </a>
- <li> build them on your Debian box: use svn trunk, install debhelper and all the build dependencies of pcb-rnd and run "fakeroot debian/rules binary" in trunk (shorthand: "make deb")
-</ul>
-
-<h2> plans </h2>
-No plans - this feature is fully implemented.
-</body>
-</html>
diff --git a/doc-rnd/features/debian_list.html b/doc-rnd/features/debian_list.html
deleted file mode 100644
index 138a53f..0000000
--- a/doc-rnd/features/debian_list.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-<html>
-<!-- THIS FILE IS GENERATED BY deblist.sh, DO NOT EDIT -->
-<head>
- <title> pcb-rnd - Debian package list </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - Debian package list </h1>
-<table border=1 cellspacing=0>
-<tr><th>name <th> internal dependencies <th> description
-
-<tr><td><b>pcb-rnd</b><td> pcb-rnd-core, pcb-rnd-gtk, pcb-rnd-gerber, pcb-rnd-lpr, pcb-rnd-png, pcb-rnd-propedit, pcb-rnd-query, pcb-rnd-report, pcb-rnd-svg, pcb-rnd-xy<td> pcb-rnd is load/save compatible with gEDA/PCB and kicad and offers various auxiliary import/export formats.<p> This metapackage installs the core and the most commonly used set of plugins.
-<tr><td><b>pcb-rnd-core</b><td> <td> This package contains the core program. Most functionality, including the GUI frontend, is in the corresponding plugin package.
-<tr><td><b>pcb-rnd-gtk</b><td> pcb-rnd-core<td> This package contains the GTK+ user-interface for pcb-rnd.
-<tr><td><b>pcb-rnd-lesstif</b><td> pcb-rnd-core<td> This package contains the Lesstif/Motif user-interface for pcb-rnd.
-<tr><td><b>pcb-rnd-autocrop</b><td> pcb-rnd-core<td> This package provides the autocrop feature that can resize the board to minimum around all the existing objects.
-<tr><td><b>pcb-rnd-autoplace</b><td> pcb-rnd-core<td> This package provides the autoplace feature used to place elements automatically and offers two different algorithms to do so.
-<tr><td><b>pcb-rnd-autoroute</b><td> pcb-rnd-core<td> This package provides the classic gEDA/pcb autorouter.
-<tr><td><b>pcb-rnd-diag</b><td> pcb-rnd-core<td> This package provides actions for debugging/diagnostic purposes. This feature may be needed for reporting bugs.
-<tr><td><b>pcb-rnd-distalign</b><td> pcb-rnd-core<td> This package provides actions for arranging elements in an array.
-<tr><td><b>pcb-rnd-distaligntext</b><td> pcb-rnd-core<td> This package provides actions for arranging text objects in an array.
-<tr><td><b>pcb-rnd-djopt</b><td> pcb-rnd-core<td> This package provides actions to clean up (optimize) tracks. It is especially useful after autorouting.
-<tr><td><b>pcb-rnd-gcode</b><td> pcb-rnd-core<td> This package allows exporting the design to gcode, useful for CNC milling.
-<tr><td><b>pcb-rnd-gerber</b><td> pcb-rnd-core<td> This package allows exporting the design to gerber, accepted by most PCB fab houses.
-<tr><td><b>pcb-rnd-lpr</b><td> pcb-rnd-core<td> This package allows printing directly from the GUI, using lpr.
-<tr><td><b>pcb-rnd-nelma</b><td> pcb-rnd-core<td> This package allows exporting the design to nelma, for numerical capacitance calculation (via external tool)
-<tr><td><b>pcb-rnd-png</b><td> pcb-rnd-core<td> This package allows exporting the design in various bitmap formats, including png and jpeg.
-<tr><td><b>pcb-rnd-svg</b><td> pcb-rnd-core<td> This package allows exporting the design in SVG, the Scalable Vector Graphics format. It is useful for publishing the design on the web.
-<tr><td><b>pcb-rnd-xy</b><td> pcb-rnd-core<td> This package allows exporting the design in XY, suitable for pick&place machines.
-<tr><td><b>pcb-rnd-fontmode</b><td> pcb-rnd-core<td> This package lets the user to turn the GUI into a PCB font editor.
-<tr><td><b>pcb-rnd-fp-wget</b><td> pcb-rnd-core<td> This package provides a wget based footprint accessor, which allows integrating web directories of footprints in the library. The only currently supported site is gedasymbols.org.
-<tr><td><b>pcb-rnd-edif</b><td> pcb-rnd-core<td> This package allows pcb-rnd to import netlists in the EDIF format.
-<tr><td><b>pcb-rnd-mincut</b><td> pcb-rnd-core<td> This package upgrades the indication of short circuits: instead of highlighting two random pins/pads, it tries to determine the minimal-cut that would resolve the short. In practice this means it makes a suggestion where to cut the networks to remove the short circuit.
-<tr><td><b>pcb-rnd-oldactions</b><td> pcb-rnd-core<td> This package provides some old user actions. These are not used daily anymore, but some old actions scripts may still depend on them.
-<tr><td><b>pcb-rnd-polycombine</b><td> pcb-rnd-core<td> This package provides actions to combine (merge) multiple polygons into a single, more complex polygon.
-<tr><td><b>pcb-rnd-propedit</b><td> pcb-rnd-core<td> This package provides the property editor function for the GUI. The property editor collects all properties and attributes of all selected objects in a table and allows the user to change them.
-<tr><td><b>pcb-rnd-puller</b><td> pcb-rnd-core<td> This package provides actions to "pull" tracks, minimizing their length.
-<tr><td><b>pcb-rnd-query</b><td> pcb-rnd-core<td> This package provides the query language used in the advanced search on the GUI.
-<tr><td><b>pcb-rnd-renumber</b><td> pcb-rnd-core<td> This package provides various actions to automatically renumber elements on the design. These actions change the refdes of some (or all) elements.
-<tr><td><b>pcb-rnd-report</b><td> pcb-rnd-core<td> This package provides the report action that displays basic information about design objects. Unlike propedit, report does not allow the user to manipulate any of the data reported.
-<tr><td><b>pcb-rnd-shand-cmd</b><td> pcb-rnd-core<td> This package provides 1..2 character long shorthands for the most commonly used core commands.
-<tr><td><b>pcb-rnd-smartdisperse</b><td> pcb-rnd-core<td> This package implements a smart algorithm to disperse elements. It is useful after importing a new design from the schematics. It is an alternative to autplace.
-<tr><td><b>pcb-rnd-stroke</b><td> pcb-rnd-core, pcb-rnd-gtk<td> This package implements mouse gestures using libstroke.
-<tr><td><b>pcb-rnd-teardrops</b><td> pcb-rnd-core<td> This package embeds each pin in a teardrop drawn from multiple arcs. May be useful for toner-transfer boards.
-<tr><td><b>pcb-rnd-vendordrill</b><td> pcb-rnd-core<td> This package provides vendor drill mapping and vendor specific design rule application.
-<tr><td><b>pcb-rnd-gsch2pcb</b><td> <td> This package provides the external tool gsch2pcb-rnd that can convert a gschem schematics to files that can be imported in pcb-rnd.
-
-</table>
-
diff --git a/doc-rnd/features/dynstyle.html b/doc-rnd/features/dynstyle.html
deleted file mode 100644
index 377d160..0000000
--- a/doc-rnd/features/dynstyle.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [dynstyle] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [dynstyle] patch </h1>
-
-Pcb-rnd doesn't have a hardwired limit on number of routing styles
-anymore. Routing styles can be created on the fly and are saved to and loaded
-from .pcb files.
-<p>
-There's no theoretical maximum explicitly set either. An implicit maximum
-exists and is sizeof(int) - should be at least 2^31 on most systems.
-
-<h2> save/load and compatibility </h2>
-The first 4 styles are loaded and preserved by mainline. Styles above
-4 would probably be deleted in a mainline load-save cycle. The number 4
-is a constant value that can be changed if mainline is recompiled.
-
-<h2> plans </h2>
-GUI HID representation of styles (especially in menus) need more testing.
-</body>
-</html>
diff --git a/doc-rnd/features/flagcomp.html b/doc-rnd/features/flagcomp.html
deleted file mode 100644
index 3e9b02f..0000000
--- a/doc-rnd/features/flagcomp.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [flagcomp] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [flagcomp] patch </h1>
-
-Many of the patches in this fork, and in possible future branches/forks
-may introduce new pin, pad or element flags. PCB loads and saves flags
-by converting the text representation to an in-memory binary format. Any
-flag not understood is lost.
-<p>
-This patch adds a linked list of string flags, filled in with the unknown
-flags while loading a PCB. On save, these flags are appended to the normal
-flag list. This preserves all unknown flags (but not order of flags) in
-a load/save cycle.
-
-<h2> save/load and compatibility </h2>
-This patch ensures compatibility in save/load cycles with flags introduced
-by later versions of mainline PCB or different branches/forks of PCB by
-not removing flags they introduced.
-
-<h2> plans </h2>
-No plans - this feature is fully implemented.
-</body>
-</html>
diff --git a/doc-rnd/features/fp_wget.html b/doc-rnd/features/fp_wget.html
deleted file mode 100644
index 6b8d007..0000000
--- a/doc-rnd/features/fp_wget.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [fp_wget] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [fp_wget] patch </h1>
-
-Since version 1.0.10, pcb-rnd implements a new footprint mechanism (see
-<a href="pcblib.html">[fp_fs]</a> and <a href="library_t.html">[library_t]</a>).
-The new code allows footprint backend plugins to get library from anywhere.
-The [fp_wget] plugin is an implementation that:
-<ul>
- <li> downloads a library list from the web on startup into a local cache
- <li> downloads footprints from the web on-demand into a local cache
-</ul>
-<p>
-This is all transparent, the user experience is that the remote library is
-like a read-only local library reachable from the library window.
-<p>
-A web site used as a library should be able to:
-<ul>
- <li> generate a plain text list of all footprints available
- <li> return the raw footprint file by name
-</ul>
-<p>
-The plugin uses external program <i>wget</i> to communicate on the web.
-
-
-<h3> How to configure for gedasymbols.org </h3>
-Add wget at gedasymbols in the library search path (e.g. in preferences as library-newlib).
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Better feedback on progress, explicit user requested refresh, refresh in
-the background.
-
-</body>
-</html>
diff --git a/doc-rnd/features/fullscreen.html b/doc-rnd/features/fullscreen.html
deleted file mode 100644
index 5f5ea73..0000000
--- a/doc-rnd/features/fullscreen.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - full screen gtk </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - full screen gtk </h1>
-On small screen the overhead of the menu line, bottom status line and left
-layer selection bar is just too expensive. Since 1.1.2, the gtk hid can
-be switched between the usual setup and a so called "full screen mode"
-where most widgets are hidden, leaving much more screen space to the
-editor widget. There's a FullScreen() action that can set or toggle
-the state and a default key binding in gtk on the backslash ('\') to
-toggle it.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Make hiding various parts of the GUI configurable. No plans to implement
-it for the lesstif HID.
-
-</body>
-</html>
diff --git a/doc-rnd/features/gpmi.html b/doc-rnd/features/gpmi.html
deleted file mode 100644
index 88624f5..0000000
--- a/doc-rnd/features/gpmi.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [gpmi] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [gpmi] patch </h1>
-
-Thanks to gpmi, pcb-rnd is scriptable in about 10 scripting languages (e.g.
-lua, awk, ruby, python, scheme, tcl). Scripts are integrated in pcb-rnd and
-have access to most of the internals. Scripts
-are able to:
- <ul>
- <li> register new actions
- <li> create new menus and submenus
- <li> execute existing actions
- <li> pop up simple dialog boxes (message, report, progress bar, file selection) -- <a href="https://archive.org/details/Pcb-rndCarcScript"> check out the video </a>
- <li> build and pop up custom dialog boxes (so called <i>attribute dialogs</i>)
- <li> search for objects (lines, arc, polys, vias, etc.) on the layout
- <li> change and move existing objects on the layout
- <li> create new objects on the layout
- <li> change "page" properties (dimensions of the board)
- <li> debug draw on the gui (slightly broken on gtk due to some gtk hid bugs)
- </ul>
-</ul>
-<p>
-This feature has three options:
-<ul>
- <li> <i>disabled</i>: not compiled at all - when gpmi is not installed (no gpmi scripting in PCB)
- <li> <i>buildin</i>: compiled and linked in the executable - pcb-rnd always can load and run scripts
- <li> <i>plugin</i>: compiled as a loadable plugin - pcb-rnd can load and run scripts if the plugin is installed
-</ul>
-
-<h3> Example </h3>
-Check out <a href="../gpmi/rosetta/index.html">the Rosetta stone </a> of
-pcb-rnd.
-
-<h2> save/load and compatibility </h2>
-Save/load files are not affected.
-
-<h2> plans </h2>
-Expose more internals, write more example scripts and documentation.
-
-</body>
-</html>
diff --git a/doc-rnd/features/grid.html b/doc-rnd/features/grid.html
deleted file mode 100644
index 1e44e40..0000000
--- a/doc-rnd/features/grid.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - gtk grid fixes </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - gtk grid fixes </h1>
-
-<h2> Problem with the original gtk grid </h2>
-
-The original code draws every grid point on screen, even the ones that are
-off the board. When the user zooms out with a dense grid, it can become too
-dense - the original code turns the grid off in this case.
-<p>
-If the grid is very dense, on a large screen the software render may slow down.
-This is noticeable in pan and zoom mostly. The bottleneck is the gtk call
-that draws the grid points: if there are too many of them, it's slow.
-
-
-<h2> New grid </h2>
-
-To overcome this problem, pcb-rnd offers configuration settings to limit
-the number of dots to be drawn. There are mainly two parallel approaches:
-using a <i>local grid</i> or draw less dots in a <i>global grid</i>. The
-old code defined only a global grid and did not have runtime settings for
-the properties of the grid.
-<p>
-There's a new "Grid properties" submenu in the view menu in the default
-gtk hid menu file. Screenshots were taken with this menu teared-down to
-demonstrate the settings.
-
-<h3> Global grid improvements </h3>
-
-The most trivial optimization is that grid points off the board are simply
-not drawn:
-<p>
-<img src="grid_edge.png">
-<p>
-Next, the compile-time configurable "minimum distance between grid points
-before it is too dense" setting is user configurable now. The default value
-can be changed in any of the usual
-<a href="../conf/sources.html">configuration sources</a>. However,
-when the configured density is reached while zooming out, there are two options.
-<p>
-The first, default option is to do the same that the original code did: just
-hide the grid:
-<p>
-<img src="grid_global_nosparse.png">
-<p>
-An alternative is to use <i>sparse global grid</i> which means only
-every 2nd, 3rd, 4th, ... Nth grid point is drawn. The cursor still snaps
-to every real grid point, so the grid got sparse only on the display. Note
-how the line is drawn on invisible grid points:
-<p>
-<img src="grid_global_sparse.png">
-
-<h3> Introduction of the local grid </h3>
-Another approach is to use a local grid. The grid helps finding whether
-existing objects are aligned or where the next move/click would end up.
-These are usually interesting only in a small range around the crosshair and
-less interesting on the other end of the board. Local grid draws the grid
-points only near the crosshair. Such local grid follows the crosshair
-everywhere:
-<p>
-<img src="grid_local_4.png">
-<p>
-The user can configure or interactively set the radius in which the grid
-points are drawn:
-<p>
-<img src="grid_local_16.png">
-<p>
-The radius is given in "number of grid points", thus the local grid yields
-a constant number of points that is independent of the actual grid size. When
-a local grid gets too dense, it is hidden - there's no sparse option, since
-local grids usually have too few points to make reasonable skips.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-This feature is gtk-specific and is complete. There are no plans to
-implement this in the lesstif HID at the moment.
-
-</body>
-</html>
diff --git a/doc-rnd/features/index.html b/doc-rnd/features/index.html
deleted file mode 100644
index 8073ff4..0000000
--- a/doc-rnd/features/index.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - features </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd </h1>
-<h2> Change summary, per topic </H2>
-<table border=1 cellspacing=0 cellpadding=5>
-<tr><th bgcolor=#eeeeee>commit message tag and doc<th bgcolor=#eeeeee>description
-<tr><td bgcolor=#ccccff><a href="gpmi.html">[gpmi]</a> <td bgcolor=#ddddff> scripting PCB (including GUI dialogs, actions, menus, changing the layout)
-<tr><td bgcolor=#ccccff><a href="intconn.html">[intconn]</a> <td bgcolor=#ddddff> component internal connections
-<tr><td bgcolor=#ccccff><a href="nonetlist.html">[nonetlist]</a> <td bgcolor=#ddddff> components that are not part of the netlist and should not cause shorts
-<tr><td bgcolor=#ccccff><a href="tostyle.html">[tostyle]</a> <td bgcolor=#ddddff> actions, menu and hotkey to change ring dia, line width, drill dia and clearance sizes to match the values defined for the current routing style
-<tr><td bgcolor=#ccccff><a href="mincut.html">[mincut]</a> <td bgcolor=#ddddff> minimal cut based warnings on shorts
-<tr><td bgcolor=#ccccff><a href="square.html">[square]</a> <td bgcolor=#ddddff> change square pad to a generic shaped-pin based on the octagon pin code - this is an alternative to teardrops
-<tr><td bgcolor=#ccccff><a href="flagcomp.html">[flagcomp]</a> <td bgcolor=#ddddff> unknown flag compatibility
-<tr><td bgcolor=#ccccff><a href="scconfig.html">[scconfig]</a> <td bgcolor=#ddddff> use scconfig instead of autotools
-<tr><td bgcolor=#ccccff><a href="pcb-fp.html">[pcb-fp]</a> <td bgcolor=#ddddff> generic parametric footprints; on-the-fly footprint generation by external tools written in any language (remove m4 hardwirings)
-<tr><td bgcolor=#ccccff><a href="pcblib.html">[pcblib], [fp_fs],
- [pcblib-param]</a> <td bgcolor=#ddddff> clean up the footprint library shipped
-<tr><td bgcolor=#ccccff><a href="library_t.html">[library_t]</a> <td bgcolor=#ddddff> footprint library is an arbitrary tree instead of a special, 2 level tree
-<tr><td bgcolor=#ccccff><a href="fp_wget.html">[fp_wget]</a> <td bgcolor=#ddddff> web based footprint libraries, integration of gedasymbols.org
-<tr><td bgcolor=#ccccff><a href="res.html">[res]</a> <td bgcolor=#ddddff> replace resource files with lihata and enable multi-key hotkeys in both gtk and lesstif hids
-<tr><td bgcolor=#ccccff><a href="debian.html">[debian]</a> <td bgcolor=#ddddff> Debian packaging the binaries configured to my own taste
-<tr><td bgcolor=#ccccff><a href="ba.html">[ba]</a> <td bgcolor=#ddddff> back annotation
-<tr><td bgcolor=#ccccff><a href="onpoint.html">[onpoint]</a> <td bgcolor=#ddddff> on-point by Robert Drehmel
-<tr><td bgcolor=#ccccff><a href="cycdrag.html">[cycdrag]</a> <td bgcolor=#ddddff> cycle drag; with additional feature: <a href="negselect.html"> negative box select </a>
-<tr><td bgcolor=#ccccff><a href="../mods3/">[mods]</a> <td bgcolor=#ddddff> modularize the code to reduce core size - for comparison, previous stats: <a href="../mods/">1.0.8</a>, <a href="../mods2/">1.0.9</a>
-<tr><td bgcolor=#ccccff><a href="unglib.html">[unglib]</a> <td bgcolor=#ddddff> remove glib dependency from core
-<tr><td bgcolor=#ccccff><a href="io.html">[io_*]</a> <td bgcolor=#ddddff> .pcb and .fp file format plugins
-<tr><td bgcolor=#ccccff><a href="dynstyle.html">[dynstyle]</a> <td bgcolor=#ddddff> dynamic routuing style: sypport more than 4 of them - with no limit
-<tr><td bgcolor=#ccccff><a href="../conf/index.html">[conf]</a> <td bgcolor=#ddddff> new, unified, config file system
-<tr><td bgcolor=#ccccff><a href="propedit.html">[propedit]</a> <td bgcolor=#ddddff> property/attribute editor (gtk)
-<tr><td bgcolor=#ccccff><a href="oldplugins.html">[oldplugins]</a> <td bgcolor=#ddddff> import old PCB plugins
-<tr><td bgcolor=#ccccff><a href="query.html">[query]</a> <td bgcolor=#ddddff> query language
-<tr><td bgcolor=#ccccff><a href="routings.html">routing styles</a> <td bgcolor=#ddddff> routing style fixes
-<tr><td bgcolor=#ccccff><a href="grid.html">(gtk grid)</a> <td bgcolor=#ddddff> gtk grid improvements: sparse global grids, local grids
-<tr><td bgcolor=#ccccff><a href="fullscreen.html">(full screen)</a><td bgcolor=#ddddff> gtk full screen edit mode
-<tr><td bgcolor=#ccccff><a href="settings.html">(settings)</a> <td bgcolor=#ddddff> minor changes in default settings
-
-
-<!--<tr><td><a href="polygrid.html">[polygrid]</a> <td> ps output: an option to draw grids in polygons instead of filling them -->
-</table>
-
-</body>
-</html>
diff --git a/doc-rnd/features/intconn.html b/doc-rnd/features/intconn.html
deleted file mode 100644
index d163f56..0000000
--- a/doc-rnd/features/intconn.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [intconn] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [intconn] patch </h1>
-
-There are parts with internal connections (e.g. pin 2 and 4 of a SO8
-package are internally connected). Mainline PCB can not handle this,
-leaving the following options:
-<ul>
- <li> connect both pins to the net from the schematics - this works if all the internally connected pins are required to connect to copper (common with GND or power pins) but is very inconvenient for signal pins where only one of them needs to be connected
- <li> back-annotate which pin is connected - there's no easy back annotation
- <li> one pin connected, the other is closer to the next target; PCB doesn't understand that they are already connected internally; normally one shouldn't use the internal connection of a component instead of copper; except for the common practice to use 0 ohm SMD resistors for jumping wires
-</ul>
-<p>
-The patch introduces a new pin flag <i>intconn(g)</i> which marks the pin
-to have internal connections in group <i>g</i>. If there
-are multiple pins using the same <i>g</i> value within a single element, they
-are internally connected. In other words, <i>g</i> is a group (or net name)
-within the element and pins can join to one of the numbered groups (or internal
-nets). The value of <i>g</i> shall be between 1 and 255, 0 means no internal
-connection (equivalent to the case when intconn(0) is omitted).
-<p>
-When pin numbers are displayed (key 'd'), internal connection groups are
-written in square brackets, e.g. "2 [9]" means "pin 2, internally connected
-to group 9".
-<p>
-Combined with the [<a href="nonetlist.html">nonetlist</a>] patch, this
-solves the "0-ohm 1206 jumper" problem: the element should be marked
-as nonetlist, with both pins set intconn(1) - this will result in a 2
-pad element, pads internally connected, that can be part of any one network
-without causing short.
-<h2> Example </h2>
-The first image depicts crossing traces, a common problem encountered when rats
-nesting a new layout from a netlist. One method to resolve such issues is to
-use a zero ohm jumper resistor that allows one signal trace to 'jump' across
-another.
-<p>
-The second image shows the layout routing the nonconflicting rats and a open
-unrouted point where the rat would require one trace to cross another.
-<p>
-In the third image a 1206 SMD footprint for a 0 Ohm 1206 resistor called J1 is
-placed with an intconn between the two pads which resolves the final rat line.
-<p>
-<img src="intconn1.png">
-<p>
-<img src="intconn2.png">
-<p>
-<img src="intconn3.png">
-<p>
-
-
-
-<h2> save/load and compatibility </h2>
-This patch introduces a new pin flag. In the following example
-pin 2 and 4 are connected internally as group 9, while pin 3
-does not have any internal connections:
-<pre>
-Pin[40000 60000 6000 3000 6600 2800 "2" "2" "square,intconn(9)"]
-Pin[40000 50000 6000 3000 6600 2800 "3" "3" "square"]
-Pin[40000 40000 6000 3000 6600 2800 "4" "4" "square,intconn(9)"]
-</pre>
-Mainline PCB will load the design ignoring internal connections -
-this may introduce new rats.
-<p>
-Mainline PCB doesn't save intconn() and elements are embedded in the file -
-once the design is loaded and saved with mainline PCB, internal connection
-info is lost.
-
-<h2> plans </h2>
-No plans - this feature is fully implemented. There is no plan for implementing
-a GUI, internal connections should be hand-edited into the element.
-</body>
-</html>
diff --git a/doc-rnd/features/io.html b/doc-rnd/features/io.html
deleted file mode 100644
index 5772e17..0000000
--- a/doc-rnd/features/io.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [io_*] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [io_*] patches </h1>
-
-Mainline PCB core was coupled with the file format; the [io] patch set is
-an effort to decouple any file design I/O from core. The original file format
-(plain text .pcb and .fp) lives on as plugin called io_pcb.
-
-<p>
-TODO
-
-<h2> save/load and compatibility </h2>
-Not affected when io_pcb is used and .pcb or .fp files are loaded or saved.
-<p>
-Using other io_* implementations will obviously result in files that are
-incompatible with mainline pcb (unless mainline pcb learns how to load those
-formats).
-
-<h2> plans </h2>
-The project is still in an early phase.
-
-</body>
-</html>
diff --git a/doc-rnd/features/library_t.html b/doc-rnd/features/library_t.html
deleted file mode 100644
index 30e7341..0000000
--- a/doc-rnd/features/library_t.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [library_t] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [library_t] patch </h1>
-
-The original code has a special setup for representing trees, C structures
-called LibraryMenu and LibraryEntry. This system can represent only a subset
-of trees: there is a root, a level consist of directories only and a next level,
-each directory consist of data nodes only. This has been enough for newlib,
-which strictly follows this model in the file system hierarchy. The lesstif
-HID also hardwired this model in the GUI.
-<p>
-In pcb-rnd this has been replaced with a new struct type called library_t
-that can represent an arbitrary tree: directories and files within directories
-down to many levels.
-<p>
-Both the gtk and the lesstif had has been modified accordingly and can
-properly display the tree. This in turn enables alternative footprint backend
-implementations such as <a href="fp_wget.html"> fp_wget <a> to import
-more complex libraries, e.g. the one on gedasymbols.org.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Finished, no plans.
-
-</body>
-</html>
diff --git a/doc-rnd/features/mincut.html b/doc-rnd/features/mincut.html
deleted file mode 100644
index ac9b7b3..0000000
--- a/doc-rnd/features/mincut.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [mincut] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [mincut] patch </h1>
-
-The original code was highlighting pins/pads only when a short came around
-after rats nest optimization. This was not very helpful on a complex board.
-There had been a long discussion on the mailing list about the best solutions.
-There were a few very good ideas, including:
-<ul>
- <li> manual tagging of objects (lines, polys, arcs, vias) with net and warn
- where two differently tagged net connects
- <li> automatic tagging based on "where it was connected first", then the same
- warning mechanism as above
- <li> trace history (using the undo buffer?) and go back until when it was
- not broken, check what exactly broke it
- <li> history combined with tagging
- <li> calculate minimal cut
-</ul>
-<p>
-I choose minimal cut for my patch because it doesn't require tracing the
-full history or any manual administration of nets vs. objects (which I
-would find inevitable even with manual tagging - directly or indirectly
-the user needs to be able to change net tags).
-<p>
-The minimal cut is the least amount of object whose removal would resolve
-the short. It is best demonstrated on an example:
-<p>
-<img src="mincut.png">
-<p>
-Removing all the marked lines/polys/vias would surely resolve the short
-(sometimes leaving rat lines behind). Minimal cut is better than randomly
-removing objects, tho: it guarantees that the minimal amount of objects
-are to be removed. On a complex board, this place is likely to be close
-to the place where the problem really is - much closer than the pins/pads.
-<p>
-Since mincut can be expensive on large boards, the feature can be enabled
-per board (a new PCB flag) and can be disbaled globally (--enable-mincut 0
-when starting PCB).
-
-<h2> save/load and compatibility </h2>
-New PCB flag enablemincut. Mainline pcb ignores this flag but does not
-preserve it.
-
-<h2> plans </h2>
-Finished, no plans.
-</body>
-</html>
diff --git a/doc-rnd/features/negselect.html b/doc-rnd/features/negselect.html
deleted file mode 100644
index 2daf76f..0000000
--- a/doc-rnd/features/negselect.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - negative box select </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [cycdrag] patches, negative box select </h1>
-
-When a selection is made using drag&drop (box selection), depending
-on the direction the rule for object selection differ:
-<ul>
- <li> drag from top-right towards bottom-left (positive sized box):
- select objects that are fully contained in the box (original behaviour)
- <li> drag from bottom-left towards top-right (negative sized box):
- select objects that are even partially within the box or merely touch
- the edge of the box
-</ul>
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Work more on some rough corners of the negative direction: e.g. pads are
-handled as 0 width lines so the selection has to hit the center.
-
-</body>
-</html>
diff --git a/doc-rnd/features/nonetlist.html b/doc-rnd/features/nonetlist.html
deleted file mode 100644
index b3e9ada..0000000
--- a/doc-rnd/features/nonetlist.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [nonetlist] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [nonetlist] patch </h1>
-
-The [nonetlist] patch adds an element flag that makes PCB ignore the marked
-element when dealing with netlists. This means connecting a net to a pin of
-a nonetlist element will not cause a short. The refdes of a nonetlist
-part is drawn with color element-color-nonetlist (ElementColor_nonetlist
-in the source; default value #777777, grey).
-<p>
-Uses of the nonetlist feature:
-<ul>
- <li> smd jumper: Combined with the [<a href="intconn.html">intconn</a>] patch, this
- solves the "0-ohm 1206 jumper" problem: the element should be marked
- as nonetlist, with both pins set intconn(1) - this will result in a 2
- pad element, pads internally connected, that can be part of any one network
- without causing short and passing the DRC.
- <li> mechanical parts that should not show up on the schematics:
- <ul>
- <li> mounting hole elements: single pin holes with silk marking the head of the screw
- <li> chassis (often with mounting holes or keep-out areas)
- <li> logos in footprints (no poly support in footprint - yet?)
- <li> mechanical parts which do not have solderable pins (plastic spacers, extra connector shields)
- <li> "spare connectors", e.g. unused/disconnected DIP sockets, pin grids, or connectors in the corner of the PCB for prototyping (dev-board style)
- </ul>
-</ul>
-<p>
-Preservation: gsch2pcb-rnd leaves nonetlist elements in the PCB.
-<h2> save/load and compatibility </h2>
-This patch introduces a new element flag. The following example demonstrates
-a <a href="jumper_1206.fp">1206 jumper footprint</a>:
-<pre>
-Element["nonetlist" "1206 jumper, 0 ohm" "" "1206" 0 0 -3150 -3150 0 100 ""]
-(
- Pad[-5905 -1181 -5905 1181 5118 2000 5718 "1" "1" "square,intconn(1)"]
- Pad[5905 -1181 5905 1181 5118 2000 5718 "2" "2" "square,intconn(1)"]
- ElementLine[-2362 -3740 2362 -3740 800]
- ElementLine[-2362 3740 2362 3740 800]
-)
-</pre>
-Mainline PCB will load the design ignoring internal connections and nonetlist
-flag - this will cause shorts on all connected pins/pads and will break
-the connection.
-<p>
-Mainline PCB doesn't save nonetlist and elements are embedded in the file -
-once the design is loaded and saved with mainline PCB, the flag is lost.
-After reloading the file in pcb-rnd, the element causes the same shorts
-as in mainline PCB.
-
-<h2> plans </h2>
-No plans, the feature is complete.
-</body>
-</html>
diff --git a/doc-rnd/features/oldplugins.html b/doc-rnd/features/oldplugins.html
deleted file mode 100644
index 2b1ba6d..0000000
--- a/doc-rnd/features/oldplugins.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [oldplugins] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [oldplugins] </h1>
-
-In this effort I imported a set of old PCB plugins to be core plugins of
-pcb-rnd. This will make it easier to keep them up to date, to defeat
-the bitrot effect. The feature plugins that got imported so far:
-<ul>
- <li> autocrop
- <li> boardflip
- <li> distalign
- <li> distaligntext
- <li> jostle - doesn't work properly
- <li> polycombine
- <li> polystich - segfaults
- <li> teardrops
- <li> renumberblock - as part of the renumber plugin
- <li> smaprtdisperse
-</ul>
-<p>
-The import/export plugins improted over the default set of the last official
-mainline release:
-<ul>
- <li> import_dsn - specctra importer - compiles, parser needs a full rewrite, it tries to read an s-expression line by line with fgets()
- <li> export_dsn - specctra exporter - compiles, produces valid-looking output - <b>need tester</b> to validate the output
- <li> export_bboard - breadboard exporter - compiles, produces valid-looking output - <b>need tester</b>
- <li> export_dxf - mechanical cad export - compiles, missing header data renders exported files unusable
- <li> export_ipcd356 - electrical test output - compiles, produces valid-looking output - <b>need tester</b>
- <li> export_openscad - 3d modeling - compiles, output sort of works, models not yet imported, <b>need tester</b>
-</ul>
-
-Plugins that won't be imported:
-<ul>
- <li> findelement - <a href="query.html">[query]</a> takes care of that
- <li> findrat - <a href="query.html">[query]</a> will take care of that
- <li> join-found - not clear what it would do
- <li> lockelements - <a href="query.html">[query]</a> can select elements then SetFlag() should be able to lock them
- <li> sedrename - <a href="query.html">[query]</a> will take care of that
- <li> upth2pth - <a href="query.html">[query]</a> will take care of that
- <li> ratsel - written in C++
- <li> stipple - written in C++
-</ul>
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Any interesting plugin is subject to be imported.
-
-</body>
-</html>
diff --git a/doc-rnd/features/onpoint.html b/doc-rnd/features/onpoint.html
deleted file mode 100644
index b1f722c..0000000
--- a/doc-rnd/features/onpoint.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [onpoint] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [onpoint] patches </h1>
-
-Robert Drehmel writes:
-<pre>
-When (e.g.) routing 5mm power traces on a small grid, it's not always easy to hit the
-point where the trace ended (which is the center of the semicircle at the end of the
-line) to start the next line. If you have selected the line tool, finding the end of
-the line can become guesswork as the cursor doesn't change shape like it does with the
-select tool.
-I want my traces to consist of lines and arcs that are perfectly connected and I want
-to work as fast as possible.
-
-Attached is a small patch that
-
- - makes it possible to deactivate snapping to "some sensible point along a line".
- (that's what a comment in the code says). This snapping algorithm gets in the way
- sometimes so you have to slowly go over a line to find out where it really ends,
- bouncing back and forth between the points of the small grid, the end of the line
- and these "sensible points", which is wasting time. The command is
- "Display(ToggleSnapOffGridLine)". It is still activated by default to avoid
- violating POLA.
-
- - more importantly, introduces a new command called "Display(ToggleHighlightOnPoint)"
- that highlights all lines and arcs which have (end)points exactly on the position
- where the cross hair is currently snapped to. It therefore helps finding the end
- points of lines and arcs, but sometimes also shows redundant traces, traces that
- aren't perfectly connected to each other, traces that don't end directly on the
- center of a via but should, etc. It works with thin draw too and I tested it with
- gtk and lesstif.
-
-I use the second option mostly in conjunction with deactivating the first. Both commands
-have been added to the menu by means of (g)pcb-menu.res.in and are available as command
-line options as well.
-Caveats:
- - The HID API expects all HIDs to make a copy of the color string when setting a color.
- - The function that lightens up a color could be improved.
- - I used it for a while, but after porting it from my local fork, it probably needs
- more testing.
-</pre>
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-The feature is complete.
-
-</body>
-</html>
diff --git a/doc-rnd/features/pcb-fp.html b/doc-rnd/features/pcb-fp.html
deleted file mode 100644
index e1892ce..0000000
--- a/doc-rnd/features/pcb-fp.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [pcb-fp] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [pcb-fp] patch </h1>
-
-Pcb-fp is an effort to clean up the footprint situation:
-<ul>
- <li> replace lib and newlib with pcblib, a library that tries to provide common footprints only
- <li> clear the syntax: if a footprint name contains parenthesis, it's generated (parametric footprint), else it's the name of a static footprint file
- <li> parametric footprints: replace m4 with a generic, language-independent footprint generator framework
- <ul>
- <li> implement libpcb_fp, which centralizes searching and loading footprints
- <li> fork gsch2pcb to gsch2pcb-rnd that uses libpcb_fp (and does not have any m4 references hardwired)
- <li> fork gnet_gsch2pcb.scm (the gnetlist backend) to remove m4 heuristics
- </ul>
-</ul>
-
-<h3> Example </h3>
-Intaractive parametric footprint selection in pcb-rnd:
-<p>
-<img src="pcb-fp.png">
-<p>
-An <a href="http://igor2.repo.hu/cgi-bin/pcblib-param.cgi"> online footprint generator web1.0 version</a> is also available.
-
-<h2> save/load and compatibility </h2>
-Save/load files are not affected. If a schematics is written for the new
-library and depends on parametric footprints:
-<ul>
- <li> mainline gsch2pcb won't find those footprints
- <li> mainline pcb won't show those footprints in the footprint selection dialog
-</ul>
-
-<h2> plans </h2>
-No plans - this feature is fully implemented.
-
-</body>
-</html>
diff --git a/doc-rnd/features/pcblib.html b/doc-rnd/features/pcblib.html
deleted file mode 100644
index 8e244c7..0000000
--- a/doc-rnd/features/pcblib.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [pcblib] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [pcblib] and [pcblib-param] and [fp_fs] patches </h1>
-<table border=0>
-<tr><td valign=top>
-The footprint library shipped with mainline pcb is cluttered with
-special puprose parts. I believe PCB encourages the user from
-an early stage to build his own library. Thus the purpose of
-the library shipped with PCB should be
-to provide a minimal collection of real essential footprints ...
-<ul>
- <li> ... for the very beginning of the learning curve;
- <li> ... and to be the core of the user's own library later.
-</ul>
-<p>
-[pcblib] is a replacement of newlib/ and lib/ and the m4 macros with
-such an essential core library of static footprints ("file elements")
-and easier-to-use parametric footprints.
-<p>
-There is an <a href="http://igor2.repo.hu/tmp/pcblib"> online map</a> of
-the library and <a href="http://igor2.repo.hu/cgi-bin/pcblib-param.cgi">
-an online interface to the parametric footprint generators. </a>
-
-<h2> Design decisions </h2>
-Parts are sorted only in a few directories: smd, tru-hole, connector and
-parametric. I believe there are so many orthogonal properties of footpritns
-that there's no obvious hierarchy. Also, pcblib contains much fewer footpritns
-than newlib so it should be still easy to navigate.
-<p>
-Parametric footprints are in a separate directory for now, even tho they
-would fit under smd, tru-hole or connector. The reason is purely historical
-and the layout may change in the future.
-
-<h2> Example </h2>
-To the right: Footprint selection dialog on pcblib, with the smd directory
-open. Note how few smd parts are there. Still, smd/ is the most crowded
-subdirectory!
-
-<h2> [fp_fs] </h2>
-As of vesion 1.0.10, the footprint list/search/load of footprints is a plugin.
-The original code that handles local file system footprint libraries (e.g.
-pcblib or newlib) is now a plugin. Altnerative plugins can be provided that work
-from databases or <a href="fp_wget.html"> from the web</a>. In extreme
-situations the file system based footprint plugin can even be disabled.
-
-<h2> save/load and compatibility </h2>
-Not affected: elements are embedded in the PCB.
-
-<h2> plans </h2>
-None, the feature is complete.
-<td>
-<td>
-<img src="pcblib.png">
-</table>
-</body>
-</html>
diff --git a/doc-rnd/features/polygrid.html b/doc-rnd/features/polygrid.html
deleted file mode 100644
index 39dcfdb..0000000
--- a/doc-rnd/features/polygrid.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [polygrid] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [polygrid] patch </h1>
-
-Polygrid adds an option to the ps exporter to fill polygons with a grid
-of horizontal and vertical lines instead of full fill. When toner transfer
-is used or test prints are produced, the grid may save some toner.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Fix bugs.
-<p>
-No (feature) plans - this feature is fully implemented.
-</body>
-</html>
diff --git a/doc-rnd/features/propedit.html b/doc-rnd/features/propedit.html
deleted file mode 100644
index da827fd..0000000
--- a/doc-rnd/features/propedit.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [propedit] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - [propedit] </h1>
-Since 1.1.2, pcb-rnd core is able to attach user defined <i>attributes</i>
-(arbitrary textual key=value pairs) to any object. The original mainline
-pcb-rnd was forked from already supported attributes on some objects (e.g.
-board attributes, net attributes) but not on all. However, the user had
-very little access to the attributes - no GUI or action would handle them.
-<p>
-Propedit introduces a property editor window in gtk that is able to
-edit attributes and core properties of all selected objects. Core properties
-include all hardwired properties of objects, such as geometry (e.g.
-trace width, hole diameter, clearance) or textual data (e.g. string of
-a text).
-<p>
-<img src="propedit.png">
-<p>
-Properties and attributes of the selected objects are collected in a
-sorted list - each row of the list is a property (starting with p/) or
-an attribute (starting with a/). For each row all values seen in the selection
-are also collected so that the following values can be presented on the list,
-per row:
-<ul>
- <li> the most common value
- <li> minimum value (for numeric value types)
- <li> maximum value (for numeric value types)
- <li> average value (for numeric value types)
-</ul>
-<p>
-When the user clicks on a row, an edit box is activated and the value can
-be changed. A combo box lists all existing values for the given row, so
-it is easy to unify the value of a property or attribute among all selected
-objects to one of the existing values, but the user is also free to enter
-a new value.
-<p>
-It is also possible to remove existing attributes or to add new attributes.
-
-<h2> save/load and compatibility </h2>
-Attributes of most objects can not be saved in the original .pcb format.
-The propedit feature is most useful when used with the lihata board format.
-
-<h2> plans </h2>
-Various improvements. Currently there's no plan to make this function available
-in the lesstif HID.
-
-</body>
-</html>
diff --git a/doc-rnd/features/query.html b/doc-rnd/features/query.html
deleted file mode 100644
index 6c3beb8..0000000
--- a/doc-rnd/features/query.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [query] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - [query] </h1>
-Pcb-rnd features a flexible query language that can list (or select or find, etc.)
-objects mathcing an expression. The language handles different data types,
-including lists, provides means to iterate over objects and lists, supports
-the common logical and arithmetic operators.
-<p>
-The query language is the engine behind the advanced search & select
-functionality. It is also the foundation of the programmable DRC.
-<p>
-The query language is implemented as a core plugin.
-<p>
-TODO: more details will come later, when the specification and implementation
-stabilizes.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Next stage will be a programmable DRC.
-
-</body>
-</html>
diff --git a/doc-rnd/features/res.html b/doc-rnd/features/res.html
deleted file mode 100644
index 81c8bd5..0000000
--- a/doc-rnd/features/res.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [res] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [res] patch </h1>
-
-PCB used to have an own file format for describing resources (menu structure
-and hotkey bindings, vendor drill mapping). The resource format was generic
-enough to describe these things, but the syntax was somewhat wierd: mixed
-positional and named fields. More precisely, composite nodes could contain
-named and anonymous subnodes, and the meaning of anonymous subnodes depended
-on their position in the anon-subnode-list.
-<p>
-The code that dealt with the in-memory representation of the resource tree
-was wierd and big chunks duplicated in the HIDs and vendor drill module. It
-was also hard to parse a resource file with external tools.
-<p>
-Since version 1.0.10, pcb-rnd replaces resource files with
-<a href="http://repo.hu/projects/lihata">lihata</a>. Lihata is a small, generic
-purpose container format that can describe arbitrary trees. Just like resource
-file syntax, lihata is optimized for hand-editing: no need to use excess
-quoting or long boilerplate blocks.
-<p>
-Liblihata also provides a lot of helper functions that made the code
-dealing with the menus and vendor drill resources much simpler and less
-redundant. Since the parser is small and external, and since there are
-external converter tools available, it is also easier to deal with the
-files outside of the pcb executable.
-
-<h2> menu files </h2>
-There are pcb-menu-gtk.lht and pcb-menu-lesstif.lht. They are in trunk/src
-in the source tree and are instaslled in the SHAREDIR. Currently each GUI
-HID (lesstif, gtk) loads the corresponding menu file.
-
-<h2> menu resource lihata structure </h2>
-The root of a menu resource file should be a <i>ha:</i> with the following
-children:
-<ul>
- <li> <i>li:mouse</i> for mouse button bindings
- <li> <i>li:main_menu</i> for describing the main menu
- <li> <i>li:popups</i> for describing the popup menus
-</ul>
-All children are optional, but recommended. Thus the file stucture, zoomed
-out, is:
-<pre>
-ha:{
- li:mouse { ... }
- li:main_menu { ... }
- li:popups { ... }
-}
-</pre>
-
-<h3> li:mouse </h3>
-The mouse subtree may contain a <i>li:</i> for each mouse button action;
-the children of the list are further <i>li:</i> nodes for key modifiers, whose
-children are text nodes: actions executed in order.
-<p>
-Buttons supported are: left, right, middle, up, down - the last two
-are for the scroll wheel. Modifier name should start with "press" or "release"
-optionally followed by modifier key suffixes separated with dashes, e.g.
-"press-alt-shift" means the given button is pressed while alt and shift
-were also pressed.
-<p>
-Example structure:
-<pre>
- li:mouse {
- li:left {
- li:press = { Mode(Notify) }
- li:press-ctrl = { Mode(Save); Mode(None); }
- }
- }
-</pre>
-
-<h3> li:main_menu </h3>
-The main menu is a list of menubar items that may host submenu items
-recursively. Each normal item is a hash with the following children:
-<ul>
- <li> <i>li:submenu</i> an ordered list of submenu nodes (should not have accel key or action)
- <li> <i>tip</i> tooltip text
- <li> <i>action</i> text or list of actions to execute when menu is selected
- <li> <i>a</i> a key description for an accelerator key (hotkey)
- <li> <i>li:a</i> a list of key descriptions for an accelerator keys (hotkeys); all keys will be bound to the menu and the first key is shown in the menu
-</ul>
-Special menu items are text nodes instead of hashes; they are:
-<ul>
- <li> starting with @, are dynamic, auto-generated items (e.g. layers; might be HID-dependent)
- <li> a singel dash: separator
-</ul>
-<p>
-A key description is a text in the form of:
-<ul>
- <li> the name of the node is the visible name of the menu item
- <li> <key>keyname, e.g. "<key>k" for key K, or "<key>F10" for F10
- <li> modifier<key>keyname, e.g. "Alt-<key>K" for Alt+K
- <li> modifier-modifier<key>keyname, e.g. "Shift-Alt-<key>K" for Shift+Alt+K; modifiers are Alt, Shift and Ctrl; order does not matter, all three can be used together.
- <li> multikey sequence: multiple of the above, separated by semicolons (protected with {} for lihata, as the text contains semicolon); e.g. "{<key>f;<key>o}" means the user presses "f" then "o". Sequences can be a dozen stroke long and any segment may use modifiers
-</ul>
-
-An example menu item with submenus (can be a main menu or a submenu of
-another menu item):
-<pre>
-ha:example menu item {
- li:submenu {
- ha:menu item {
- action=Save(ElementConnections)
- tip=example menu
- }
- -
- ha:another menu item {
- a={Shift-Alt<key>r}
- action={Action1(); Action2();}
- }
- }
-}
-</pre>
-
-<h3> li:popups </h3>
-Each children is a hash that describes a popup menu. A popup menu behaves
-exactly like a menu item, it should have a submenu list. Popup windows will
-be popped up by executing an action with the name of the popup menu.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-The resource file format conversion is done. There are other parts of the code
-that will probably get lihata instead of the current custom parsers, e.g.
-the preferences/settings file.
-
-</body>
-</html>
diff --git a/doc-rnd/features/routings.html b/doc-rnd/features/routings.html
deleted file mode 100644
index c920bfa..0000000
--- a/doc-rnd/features/routings.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - routing style fixes </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - routing style fixes </h1>
-
-<h2> Number of styles </h2>
-In the original code there are a compile-time fixed number (4) of routing
-styles. This is often not enough for more complex designs. While in theory
-this limit can be raised, the resulting .pcb files will be incomatible with
-pcb compilations using a different number of styles.
-<p>
-Pcb-rnd uses a dynamic vector for storing styles and allows any number
-of styles from 0 up to a very large value (2^31-1). There is no compile-time
-configurable limit. The number of default styles (and the actual style
-configuration) is coming from the template pcb file.
-<p>
-Creating a new style in the Route Styles dialog is not "for this session only"
-anymore - styles are saved with the design.
-
-<h2> Explicit custom style </h2>
-Pcb had 4 explicit styles and a hidden, implicit style. All drawing
-action uses the hidden style. When the user selects one of the explicit
-styles, its properties are copied into the implicit style. Any drawing
-action uses the implicit style, this it's sort of the "pen style".
-<p>
-In mainline PCB the implicit (or pen) style is hidden. As long as it always
-matches one of the existing styles, the user doesn't even know about it.
-However, if there are objects that do not comform to any of the existing
-styles, it is possible to bump into this. For example:
-<ul>
- <li> draw a line using one of the existing styles
- <li> increase the width (with the 's' key) a few times - now the style of the line does not match any of the existing styles
- <li> use the SetSame() action over the line (hover the pointer over the line and press 'a') - it will try to set the style that corresponds to the line
- <li> since no style matches the line's, the radio button gets deselected - that's good
- <li> now click on the Route Style button - it will show the properties of the last selected route style, even tho it is not selected at the moment
-</ul>
-<p>
-In contrast, pcb-rnd offers an explicit routing style called <i><custom></i>.
-If SetSame() is invoked on an object that doesn't match any of the existing styles,
-the <i><custom></i> style is selected:
-<ul>
- <li> no style marked on the radio button (just like in mainline)
- <li> the Route Style button opens with the <i><custom></i> style, with the values picked up from the object by SetSame
- <li> the user can change the values, which will affect the implicit pen style
- <li> this means the user can draw with the new settings, without having to create a permanent style
-</ul>
-<p>
-In other words, it is now possible to use the implicit pen style as temporal
-style, to explicitly set a line width, via diameter before placing a few
-unusual lines or vias, without having to create a new style. It is also
-possible to pick up the style of such an unusual object later, without the
-GUI confusing it with any of the existing styles.
-
-<h2> SetSame() bugs fixed </h2>
-A line does not have drill parameters. When mainline tries to pick up
-object properties for a line, it will pick thickness and clearance but
-will leave hole and ring diameters unchanged. This very often results in
-a mixed style: e.g. "signal" line properties picked up from a line while
-"power" hole/ring properties left over from the current style selection.
-Such a mixed pickup will result in the GUI get confused and not selecting any
-of the styles. The expected behaviour is to select the "signal" style if the
-line width/clearance matches the parameters of that style, and ignore the
-drill/ring parameters.
-<p>
-The same mixup happens for picking up arc parameters, and a similar mixup
-for via parameters (a via doesn't have a line width).
-<p>
-Pcb-rnd fixes this by searching for the matching style using only the parameters
-that the given object really had. This results in valid style selection
-the way the user may expect.
-
-<h2> save/load and compatibility </h2>
-Saving a design with number of styles not equal to 4 may cause problems
-when loading with mainline. The rest of these features do not affect
-compatibility.
-
-<h2> plans </h2>
-No plans - these features are fully implemented.
-</body>
-</html>
diff --git a/doc-rnd/features/scconfig.html b/doc-rnd/features/scconfig.html
deleted file mode 100644
index 93342dd..0000000
--- a/doc-rnd/features/scconfig.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [scconfig] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [scconfig] patch </h1>
-
-Pcb-rnd uses <a href="http://repo.hu/projects/scconfig">scconfig</a>
-for ./configure instead of autotools. Scconfig is smaller and easier
-to maintain.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-No plans - this feature is fully implemented by now.
-</body>
-</html>
diff --git a/doc-rnd/features/settings.html b/doc-rnd/features/settings.html
deleted file mode 100644
index f46c082..0000000
--- a/doc-rnd/features/settings.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - different default settings </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - settings </h1>
-
-There are a few minor changes in default settings compared to mainline
-pcb.
-<table border=1>
-<tr>
- <th> name
- <th> description
- <th> where to change
-
-<tr>
- <td> layers
- <td> the default layer stack is optimized for two sided boards with 3 layers on both sides
- <td> edit or replace /usr/share/pcb-rnd/default.pcb
-
-<tr>
- <td> styles & DRC
- <td> default styles and DRC settings are optimized for toner transfer
- <td> edit or replace /usr/share/pcb-rnd/default.pcb
-
-<tr>
- <td> grid
- <td> on startup "enable visible grid" is on and grid is set to 25 mil
- <td> change editor/draw_grid in pcb-conf.lht (in system install dir, in user dir) or in project.lht
-
-</table>
-
-</body>
-</html>
diff --git a/doc-rnd/features/square.html b/doc-rnd/features/square.html
deleted file mode 100644
index b6699b3..0000000
--- a/doc-rnd/features/square.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [square] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [square] patch </h1>
-Most of my PCBs end up in <i>toner transfer</i>. There are a lot
-of tricks around prototyping at home. One of the problems I often
-face is small rings peeling off during rework (and rework tend to
-happen on the first prototypes). The solution for this is increasing
-ring size - which is not suitable if traces are passing between pins.
-Another solution is to increase the area of the pin:
-<ul>
- <li> square pin: while it makes the pin slightly larger still letting traces pass between pins, it's too symmetrical and can not use up extra room
- <li> DJ's teardrop plugin: this increases the area only toward the trace, whereas very often there's more room on the opposite side
- <li> manually add an extra poly around the pin; with multiple pins it's hard to get the polys separate
- <li> manually add a short extra track on the pin, width matching the size of the pin; this is very close, but increases workload when components are moved, layers are changed
-</ul>
-<img src="square.png">
-<p>
-The patch takes an octagon pin and stretches points in various directions.
-There are 4 bits (for left, right, up and down) to indicate in which directions
-the stretch applies. Pressing 'q' on a pin cycles thru round pin, square pin,
-16 stretched octagons and the original octagon.
-<p>
-The code is also patched to handle clearances, shorts and connections (find.c).
-<p>
-Thermals are not fully working for funny shaped pins, but it has low priority:
-they still work fine for rounded and square pins and if there is a poly around
-the pin, I wouldn't use shaped pins anyway.
-
-<h2> save/load and compatibility </h2>
-This patch introduces a new pin flag called shape(n), where n is an integer
-selecting the shape of the pin when the square flag is also set:
-<pre>
-Pin[40000 60000 6000 3000 6600 2800 "8" "8" "square,shape(3)"]
-</pre>
-Mainline PCB will load the design ignoring the custom shape and will use a
-square pin. As long a traces end in the center point of the pin, this
-should not break connections.
-<p>
-Mainline PCB doesn't save shape() - once the design is loaded and saved with
-mainline PCB pin shape info is lost.
-
-<h2> plans </h2>
-In the original code there are separate code paths for round, octagonal and
-square pins. The separation repeats for at least:
-<ul>
- <li> drawing the pin shape
- <li> calculating the clearance
- <li> checking whether things overlap or connect (pin vs pin, pin vs line, etc.)
- <li> autorouter
-</ul>
-In most cases a set of hardwired constants are written in the C code. A notable
-exception was the octagon pin draw function, that had x and y offsets in a const
-table for 8 points and a loop to create the poly (or line segments in thin draw).
-<p>
-The [square] feature is a good base for cleaning up the code a bit and for
-moving toward a generic pin shape patch:
-<ul>
- <li> hardwired octagon calculations should be replaced to use the same x;y const offset table
- <li> the table should be replaced by a struct that describes length (number of points) - alternatively use POLYAREA
- <li> square pin should be renamed to polygon pin
- <li> octagon flag shall be removed - it should be a configuration of the x;y const table
- <li> square flag shall be removed - it should be a configuration
- <li> the only flag remaining should be shape(); if a pin is not shaped, it's round
- <li> the pin shape struct should have a field for compatibility - to mark the entry corresponding to the original square and octagon pins so PCB-rnd format can be converted to and from the mainline PCB format.
- <li> there should be a set of pin shapes in a default configuration table, including square and octagonal; these should be static
- <li> the PCB file format should be extended with an option to expand the pin shape table with custom shapes
- <li> UI: shapes could be imported (converted) from polys around vias
- <li> UI: since there may be a lot of pin shapes, a GUI selector alternative shall be offered while also keeping the cycle-thru 'q' key
-</ul>
-</body>
-</html>
diff --git a/doc-rnd/features/tostyle.html b/doc-rnd/features/tostyle.html
deleted file mode 100644
index 8978416..0000000
--- a/doc-rnd/features/tostyle.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [tostyle] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [tostyle] patch </h1>
-
-Footprints bring their own hole sizes, copper ring sizes and clearances.
-These parameters often depend on the manufacturing process, and such a value
-coming from a footprint may differ much from the values used on the board already.
-<p>
-PCB has actions (and menus and hotkeys) to change sizes manually. In my practice,
-I try to stick to the sizes defined in my routing styles and try to avoid
-manually changing clearances or ring sizes. Still, the random values coming
-from various footprints should be changed.
-<p>
-After many years of struggling with this, I realized the feature I need is
-a way to change object sizes to not a relative or absolute <i>number</i> but
-to the current <i>routing style</i>. The [tostyle] patch does exactly this.
-It implements the following new features:
-<ul>
- <li> change clearance size now works on elements: it changes the clearance of all pins/pads; this is the same as change drill has been working for a long time
- <li> size change actions normally take a value and a unit; if the value is not a number but text <b>style</b>, the value is copied from the currently active routing style
- <li> a new ChangeSizes() action that attempts to execute the other three change size actions with the same arguments and fails only if all of them failed; the three sizes are: main size, drill size, clearance size
- <li> a menu item and hotkey binding to key 'Shift+Y' (for routing stYle) that calls ChangeSizes() of the selected or current object(s) to resize them to the current routing style
-</ul>
-<p>
-The new route style set works on:
-<ul>
- <li> lines and arcs: sets their line width and clearance
- <li> vias and individual pins: sets their ring dia, drill dia and clearance
- <li> individual pads: sets their clearance
- <li> elements: set all their pins and pads
-</ul>
-
-<h2> Example </h2>
-GUI: select a routing style; hover above a line, a via, a pin/pad of an element
-or the silk of an element; press Shift+Y; undo if necessary.
-<p>
-CLI: select objects, execute action ChangeSizes(selected, style)
-<p>
-CLI: to adjust drill sizes only: select objects, execute action ChangeDrillSize(selected, style)
-
-
-<h2> save/load and compatibility </h2>
-Not affected, since the patch introduces actions and UI changes, no change
-related to the data model.
-
-<h2> plans </h2>
-No plans, the feature is complete.
-
-</body>
-</html>
diff --git a/doc-rnd/features/unglib.html b/doc-rnd/features/unglib.html
deleted file mode 100644
index ac57944..0000000
--- a/doc-rnd/features/unglib.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - [unglib] </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - the [unglib] patch </h1>
-
-Removes glib dependency from core, in favor of
-<a href="http://repo.hu/projects/articles/minilibs">minilibs</a> to help
-keeping the code <a href="devlog/20160313_unglib.html">small, modular
-and easier to fix</a>.
-
-<h2> save/load and compatibility </h2>
-Not affected.
-
-<h2> plans </h2>
-Remove glib dependency from the puller plugin.
-
-</body>
-</html>
diff --git a/doc-rnd/gpmi/packages/Makefile b/doc-rnd/gpmi/packages/Makefile
deleted file mode 100644
index 2d601b1..0000000
--- a/doc-rnd/gpmi/packages/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-ROOT=../../..
-GPMIDIR=$(ROOT)/src_plugins/gpmi/pcb-gpmi
-ALL= actions dialogs hid layout
-
-all: XREF $(ALL:%=%_ref.html)
-
-include $(GPMIDIR)/Makefile.config
-
-%_ref.html REF.% : $(GPMIDIR)/gpmi_plugin/gpmi_pkg/%.h
- $(ROOT)/util/genref.sh "$^" "$(ROOT)" "../packages/$*_ref.html" $(PCB_CFLAGS) >$*_ref.html
-
-XREF: $(ALL:%=REF.%)
- cat $^ > $@
-
-
diff --git a/doc-rnd/gpmi/packages/actions.html b/doc-rnd/gpmi/packages/actions.html
deleted file mode 100644
index f7bbf60..0000000
--- a/doc-rnd/gpmi/packages/actions.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<HTML>
-<BODY>
-<H1> The actions package </H1>
-
-The action package is used to register actions and menus in PCB and
-to execute existing actions. In PCB actions
-are generated when the user selects a menu, presses a key or issues a
-command on the PCB command line.
-
-<H2> Registration of new actions </H2>
-The script may register new actions
-using arbitrary action names. If any of the registered actions is
-detected, an ACTE_action event is sent to the script. If multiple
-actions are used in a script, argument <I>name</I> of the event handler
-can be used to identify the triggering action. <small>(This may be time consuming
-in scripting languages (a series of string comparison) - those scripts
-binding to frequent actions should not bind to too many different actions.)</small>
-pcb-gpmi guarantees that the event handler of a script is triggered only
-when an action is caught that previously was registered by the same script.
-<P>
-The process of binding an action:
-<OL>
- <LI> create an event handler for event <I>ACTE_action</I>
- <LI> register one or more actions using function <I>action_register</I>
- <LI> optional: when the event handler is triggered, check argument <I>name</I> (for scripts with multiple actions registered)
- <LI> optional: use argument <I>argc</I> and function <I>action_arg</I> to fetch action arguments
- <LI> optional: use arguments <I>x, y</I> to learn the cursor position on the layout.
-</OL>
-
-Example (written in lua):
-<PRE>
--- load the package
-PkgLoad("pcb-gpmi/actions", 0);
-
--- action callback
-function ev_action(id, name, argc, x, y)
- if name == "cake" then
- size = action_arg(1);
- -- put cake drawing code here
- else
- -- must be candy
- amount = action_arg(1);
- -- put candy drawing code here
- end
-end
-
--- register and bind action
-action_register("cake", "cake center xy?", "cake service", "cake(size)", "");
-action_register("candy", "candy cloud center xy?", "cake service", "candy(amount)", "");
-Bind("ACTE_action", "ev_action");
-</PRE>
-<p>
-When the script is unloaded all actions the script registered
-are removed from pcb-rnd automatically.
-
-<H2> Executing actions </H2>
-An existing action can be executed using the action() call. The only one
-argument is a command line string. The syntyax is the same as in pcb
-command line.
-
-Example (written in lua):
-<PRE>
-PkgLoad("pcb-rnd-gpmi/actions", 0);
-
-function ev_action1(id, name, argc, x, y)
- action("undo()")
- action("undo()")
-end
-
--- register and bind action
-action_register("untwo", "", "undo twice", "untwo()", "CONTEXT!");
-</PRE>
-<p>
-The above script registers a new action called untwo(). When untwo() is executed,
-it exectues action undo() twice.
-
-
-<H2> Creating menus </H2>
-It is possible to insert menus and submenus runtime, using the call
-create_menu(). The script should do this only after the gui has been initialized.
-The most common way is to create all menus from the ACTE_gui_init event,
-which is called after the gui finished setting up.
-<p>
-The first argument of create_menu() is the menu path. The path is a list
-of visible menu names separated by slashes (e.g. "/main_menu/File/Save as..." means
-"File" menu, "Save as..." submenu).
-<p>
-Paths are interpreted as menu paths, which are a slightly simplified version
-of lihata paths found in menu.lht. Basically there's a main directory directly
-under root that determines the type of the menu:
-<p>
-<ul>
- <li> /main_menu/ is the menubar
- <li> /popups/something/ is a popup menu called something; the lesstif HID does
- not support popups; popups are popped up by actions.
-</ul>
-<p>
-The simplification compared to lihata paths is that only menu and submenu
-names are on the path, so lihata nodes like "li:submenu" should be ignored.
-In other words, the path represents how the menus can be reached from the user
-interface, plus a "main menu type prefix" as discussed above.
-<p>
-By <b>convention</b>, scripts should
-create new menu items under the "/main_menu/Plugins/" menu.
-<p>
-The following example lua script registers a new menu item
-<pre>
-PkgLoad("pcb-rnd-gpmi/actions", 0);
-
-function ev_gui_init(argc, argv)
- create_menu("/main_menu/Plugins/foo", "undo()", "o", "Ctrl<Key>o", "tooltip for foo");
-end
-
--- register and bind action
-Bind("ACTE_gui_init", "ev_gui_init");
-</pre>
-<p>
-When the user clicks on the menu, the action script specified in the second argument
-of create_menu() is executed. Thus the script usually registers a new action
-first then registers one or more menu items executing those actions.
-
-</BODY>
-</HTML>
diff --git a/doc-rnd/gpmi/packages/actions_ref.html b/doc-rnd/gpmi/packages/actions_ref.html
deleted file mode 100644
index 5c1750d..0000000
--- a/doc-rnd/gpmi/packages/actions_ref.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<html>
-<body>
-<h1>PCB GPMI</h1>
-<h2>Reference manual for package actions</h2>
-<small>Automatically generated from actions.h</small>
-
-<h3> Events </h3>
-<dl>
-<p>Events do not have return value. The first argument is always <a href="event_id.html">the even id</a>. Event handlers defined in scripts get all event arguments converted to string (types below are informational).
-<a id="ACTE_action">
-<H4> ACTE_action(int event_id, const char* name, int argc, int x, int y) </H4>
-<pre>
- Generated when an action registered by the script is executed.
- Arguments:
- name: name of the action (as registed using function action_register())
- argc: number of arguments. Arguments can be accessed using function action_arg
- x, y: optional coords, if need_xy was not empty at action_register
-</pre>
-<a id="ACTE_gui_init">
-<H4> ACTE_gui_init(int event_id, int argc, char** argv) </H4>
-<pre>
- Generated right after gui initialization, before the gui main loop.
- Arguments:
- argc: number of arguments the gui was initialized with.
- argv[]: arguments the gui was initialized with - unaccessible for the scripts.
-</pre>
-<a id="ACTE_unload">
-<H4> ACTE_unload(int event_id, const char* conffile) </H4>
-<pre>
- Generated right before unloading a script to give the script a chance
- to clean up.
- Arguments:
- conffile: the name of the config file that originally triggered laoding the script, or empty if the script was loaded from the gui.
-</pre>
-</dl>
-<h3> Functions </h3>
-<dl>
-<p>The following functions are registered in script context.
-<a id="action_register">
-<H4> int action_register(const char* name, const char* need_xy, const char* description, const char* syntax) </H4>
-<pre>
- Register an action in PCB - when the action is executed, event
- ACTE_action is generated with the action name.
- Multiple actions can be registered. Any action registered by the script
- will trigger an ACTE_event sent to the script.
- Arguments:
- name: name of the action
- need_xy: the question the user is asked when he needs to choose a coordinate; if empty, no coordinate is asked
- description: description of the action (for the help)
- syntax: syntax of the action (for the help)
- Returns 0 on success.
-
-</pre>
-<a id="action_arg">
-<H4> const char* action_arg(int argn) </H4>
-<pre>
- extract the (argn)th event argument for the current action (makes sense only in an ACTE_action event handler
-</pre>
-<a id="action">
-<H4> int action(const char* cmdline) </H4>
-<pre>
- call an existing action using PCB syntax (e.g. foo(1, 2, 3))
- Returns non-zero on error; generally returns value of the action
- (which is also non-zero on error).
-</pre>
-<a id="create_menu">
-<H4> void create_menu(const char* path, const char* action, const char* mnemonic, const char* hotkey, const char* tooltip) </H4>
-<pre>
- Create a new menu or submenu at path. Missing parents are created
- automatically with empty action, mnemonic, hotkey and tooltip.
- Arguments:
- path: the full path of the new menu
- action: this action is executed when the user clicks on the menu
- mnemonic: which letter to underline in the menu text (will be the fast-jump-there key once the menu is open)
- hotkey: when this key is pressed in the main gui, the action is also triggered; the format is modifiers<Key>letter, where modifiers is Alt, Shift or Ctrl. This is the same syntax that is used in the .res files.
- tooltip: short help text
-</pre>
-</dl>
-
-</body>
-</html>
-
diff --git a/doc-rnd/gpmi/packages/dialogs.html b/doc-rnd/gpmi/packages/dialogs.html
deleted file mode 100644
index bb0e405..0000000
--- a/doc-rnd/gpmi/packages/dialogs.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<HTML>
-<BODY>
- <H1> dialogs package </H1>
- The purpose of this package is to expose the dialog box handling interface
- of the active GUI hid. Using this package scripts can pop up dialog boxes
- to inform or ask the user. If there is no active GUI, call logs are dumped
- on stderr. Note: message arguments usually may contain newline (\n) characters
- to split the message.
-
- <H2> Common conventions </H2>
- Dialog boxes are blocking calls to the GUI HID: when the script
- calls a dialog box, the script is suspended until the dialog box
- is closed by the user. In other words, dialog boxes behave
- as regular function calls from the scripts: when they return,
- the dialog is over and the result is known.
- <p>
- The only exception is <i>dialog_progress()</i>, which opens or
- updates or closes the already open progress dialog box, and
- returns immediately (even when the box is left open).
-
- <H2> Simple dialogs vs. custom dialogs </H2>
- Most of the calls will pop up a static dialog box. Static means
- that widgets are predefined by the GUI HID. The script
- is free to fill in data, but can not change the basic structure of
- the dialog box. For example <i>dialog_confirm(), dialog_prompt(),
- dialog_fileselect()</i> are static.
- <p>
- When the script needs a custom, dynamic dialog box, it needs to
- create an <i>attribute dialog</i>. The script sets up a HID
- structure using the hid package, builds up all the input fields
- then calls <i>dialog_attribute()</i> with the hid.
-
- <H2> Progress dialogs </H2>
-
- The script should call dialog_progress() periodicly from a process that
- runs time consuming calculations and check the return value and break
- the loop on cancel. The process should have an idea of how long it
- will take. This is passed on in argument <i>total</i>. As long as
- argument <i>so_far</i> is less than <i>total</i>, the dialog is
- open.
- <p>
- After the process has finished, a call with <i>so_far=total+1</i> should be
- made to make sure the window is closed. If the call returns non-zero,
- the process should be cancelled.
-
-</BODY>
-</HTML>
diff --git a/doc-rnd/gpmi/packages/dialogs_ref.html b/doc-rnd/gpmi/packages/dialogs_ref.html
deleted file mode 100644
index 4c2a30e..0000000
--- a/doc-rnd/gpmi/packages/dialogs_ref.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<html>
-<body>
-<h1>PCB GPMI</h1>
-<h2>Reference manual for package dialogs</h2>
-<small>Automatically generated from dialogs.h</small>
-
-<h3> Enums </h3>
-<dl>
-<p>Enum values should be passed on as strings.
-<a id="dialog_fileselect_e">
-<H4> dialog_fileselect_e</H4>
-<pre>
- Filter on what files a file select dialog should list
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> FS_NONE <td> none of the below
-<tr><td> FS_READ <td> when the selected file will be read, not written (HID_FILESELECT_READ)
-<tr><td> FS_NOT_EXIST <td> the function calling hid->fileselect will deal with the case when the selected file already exists. If not given, then the gui will prompt with an "overwrite?" prompt. Only used when writing. (HID_FILESELECT_MAY_NOT_EXIST)
-<tr><td> FS_TEMPLATE <td> the call is supposed to return a file template (for gerber output for example) instead of an actual file. Only used when writing. (HID_FILESELECT_IS_TEMPLATE)
-</table>
-</dl>
-<h3> Functions </h3>
-<dl>
-<p>The following functions are registered in script context.
-<a id="dialog_log">
-<H4> void dialog_log(const char* msg) </H4>
-<pre>
- Append a msg to the log (log window and/or stderr).
-</pre>
-<a id="dialog_confirm">
-<H4> int dialog_confirm(const char* msg, const char* ok, const char* cancel) </H4>
-<pre>
- Ask the user for confirmation (usually using a popup). Returns 0 for
- cancel and 1 for ok.
- Arguments:
- msg: message to the user
- ok: label of the OK button
- cancel: label of the cancel button
- Arguments "ok" and "cancel" may be empty (or NULL) in which
- case the GUI will use the default (perhaps localized) labels for
- those buttons.
-</pre>
-<a id="dialog_report">
-<H4> void dialog_report(const char* title, const char* msg) </H4>
-<pre>
- Pop up a report dialog.
- Arguments:
- title: title of the window
- msg: message
-</pre>
-<a id="dialog_prompt">
-<H4> char* dialog_prompt(const char* msg, const char* default_) </H4>
-<pre>
- Ask the user to input a string (usually in a popup).
- Arguments:
- msg: message or question text
- default_: default answer (this may be filled in on start)
- Returns the answer.
-</pre>
-<a id="dialog_fileselect">
-<H4> char* dialog_fileselect(const char* title, const char* descr, char* default_file_, char* default_ext, const char* history_tag, dialog_fileselect_t flags) </H4>
-<pre>
- Pops up a file selection dialog.
- Arguments:
- title: window title
- descr: description
- default_file_
- default_ext: default file name extension
- history_tag
- flags: one or more flags (see below)
- Returns the selected file or NULL (empty).
-</pre>
-<a id="dialog_beep">
-<H4> void dialog_beep(void) </H4>
-<pre>
- Audible beep
-</pre>
-<a id="dialog_progress">
-<H4> int dialog_progress(int so_far, int total, const char* message) </H4>
-<pre>
- Request the GUI hid to draw a progress bar.
- Arguments:
- int so_far: achieved state
- int total: maximum state
- const char *message: informs the users what they are waiting for
- If so_far is bigger than total, the progress bar is closed.
- Returns nonzero if the user wishes to cancel the operation.
-
-</pre>
-<a id="dialog_attribute">
-<H4> int dialog_attribute(hid_t* hid, const char* title, const char* descr) </H4>
-<pre>
- Pop up an attribute dialog; content (widgets) of the dialog box are coming
- from hid (see the hid package).
- Arguments:
- hid: widgets
- title: title of the window
- descr: descripting printed in the dialog
-</pre>
-</dl>
-
-</body>
-</html>
-
diff --git a/doc-rnd/gpmi/packages/hid.html b/doc-rnd/gpmi/packages/hid.html
deleted file mode 100644
index 1995d51..0000000
--- a/doc-rnd/gpmi/packages/hid.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<HTML>
-<BODY>
-<H1> hid package </H1>
-
-The hid package has two purposes:
-<UL>
- <LI> it is glue layer for exporter dialog boxes and <i>attribute dialog boxes</i>;
- <LI> it can register exporter HIDs in PCB
-</UL>
-
-<H2> Building a custom dialog box</H2>
-First hid_create() needs to be called. It returns a new hid_t, which is
-an opaq structure for the package that is used to describe attributes of
-an attribute dialog or an exporter hid. Attributes are added using
-hid_add_attribute(), which returns an unique ID of the attribute. The
-attribute ID can be used later for querying attribute value set by the
-user using hid_get_attribute().
-<p>
-The process of building a dialog box is closed by a call to
-<ul>
- <li> hid_register(), which registers a new exporter hid using the
- attributes of the dialog box; or
- <li> dialog_attribute() (of the dialog package) which pops up a custom
- dialog box immediately.
-</ul>
-
-<H2> Registering an exporter</H2>
- Function hid_register() registers the hid as an exporter. Should be
- called after all attributes have been added using hid_add_atrtibute().
- The export is coordinated by pcb core; when the user request an export
- using the exporter, a series of events are delivered to the script:
- <ol>
- <li> envelope events to set up exporting
- <li> many draw events to actually export the objects
- <li> an envelope event to finish exporting
- </ol>
-
- <H3> Envelope: events generated before or after exporting </H3>
- <UL>
- <LI>HIDE_get_export_options(void *hid): Generated before get_exporter_options returns the option list to the GUI hid
- <LI>HIDE_do_export_start(void *hid): Generated before export redraw starts
- <LI>HIDE_do_export_finish(void *hid): Generated after export redraw finihsed
- </UL>
-
- <H3> Drawing: events generated during exporting </H3>
- Note: there may be multiple <I>gc</I>s (graphic contexts), each having its own color, line
- properties, xor drawing and faded state. Graphic contexts are created
- and destroyed by the following events:
- <UL>
- <LI>HIDE_make_gc(void *hid, void *gc);
- <LI>HIDE_destroy_gc(void *hid, void *gc);
- </UL>
-
- <I>Gc</I> properties are changed by the following events:
- <UL>
- <LI>HIDE_set_layer(void *hid, const char *name, int group);
- <LI>HIDE_set_color(void *hid, void *gc, const char *name);
- <LI>HIDE_set_line_cap(void *hid, void *gc, EndCapStyle style);
- <LI>HIDE_set_line_width(void *hid, void *gc, int width);
- <LI>HIDE_set_draw_xor(void *hid, void *gc, int xor);
- <LI>HIDE_set_draw_faded(void *hid, void *gc, int faded);
- </UL>
-
- Finally, the actual drawing operations:
- <UL>
- <LI>HIDE_draw_line(void *hid, void *gc, int x1, int y1, int x2, int y2);
- <LI>HIDE_draw_arc(void *hid, void *gc, int cx, int cy, int xradius, int yradius, int start_angle, int delta_angle);
- <LI>HIDE_draw_rect(void *hid, void *gc, int x1, int y1, int x2, int y2);
- <LI>HIDE_fill_circle(void *hid, void *gc, int cx, int cy, int radius);
- <LI>HIDE_fill_polygon(void *hid, void *gc, int n_coords, int *x, int *y);
- <LI>HIDE_fill_rect(void *hid, void *gc, int x1, int y1, int x2, int y2);
- <LI>HIDE_use_mask(void *hid, int use_it); [TODO]
- </UL>
-
-</BODY>
-</HTML>
diff --git a/doc-rnd/gpmi/packages/hid_ref.html b/doc-rnd/gpmi/packages/hid_ref.html
deleted file mode 100644
index 079b243..0000000
--- a/doc-rnd/gpmi/packages/hid_ref.html
+++ /dev/null
@@ -1,205 +0,0 @@
-<html>
-<body>
-<h1>PCB GPMI</h1>
-<h2>Reference manual for package hid</h2>
-<small>Automatically generated from hid.h</small>
-
-<h3> Enums </h3>
-<dl>
-<p>Enum values should be passed on as strings.
-<a id="hid_attr_type_e">
-<H4> hid_attr_type_e</H4>
-<pre>
- Type of an HID attribute (usually a widget on an attribute dialog box)
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> HIDA_Label <td> non-editable label displayed on the GUI
-<tr><td> HIDA_Integer <td> a sugned integer value
-<tr><td> HIDA_Real <td> a floating point value
-<tr><td> HIDA_String <td> one line textual input
-<tr><td> HIDA_Boolean <td> true/false boolean value
-<tr><td> HIDA_Enum <td> select an item of a predefined list
-<tr><td> HIDA_Mixed <td> TODO
-<tr><td> HIDA_Path <td> path to a file or directory
-<tr><td> HIDA_Unit <td> select a dimension unit
-<tr><td> HIDA_Coord <td> enter a coordinate
-</table>
-<a id="EndCapStyle_e">
-<H4> EndCapStyle_e</H4>
-<pre>
- Line or arc ending style
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> Trace_Cap <td> filled circle (trace drawing)
-<tr><td> Square_Cap <td> rectangular lines (square pad)
-<tr><td> Round_Cap <td> round pins or round-ended pads, thermals
-<tr><td> Beveled_Cap <td> octagon pins or bevel-cornered pads
-</table>
-</dl>
-<h3> Events </h3>
-<dl>
-<p>Events do not have return value. The first argument is always <a href="event_id.html">the even id</a>. Event handlers defined in scripts get all event arguments converted to string (types below are informational).
-<a id="HIDE_get_export_options">
-<H4> HIDE_get_export_options(int event_id, void* hid) </H4>
-<pre>
- Called before get_exporter_options returns the option list to the GUI hid
-</pre>
-<a id="HIDE_do_export_start">
-<H4> HIDE_do_export_start(int event_id, void* hid) </H4>
-<pre>
- Called before export redraw starts
-</pre>
-<a id="HIDE_do_export_finish">
-<H4> HIDE_do_export_finish(int event_id, void* hid) </H4>
-<pre>
- Called after export redraw finihsed
-</pre>
-<a id="HIDE_set_layer">
-<H4> HIDE_set_layer(int event_id, void* hid, const char* name, int group, int empty) </H4>
-<pre>
- PCB callback events for drawing: change layer
-</pre>
-<a id="HIDE_set_color">
-<H4> HIDE_set_color(int event_id, void* hid, void* gc, const char* name) </H4>
-<pre>
- PCB callback events for drawing: change drawing color
-</pre>
-<a id="HIDE_set_line_cap">
-<H4> HIDE_set_line_cap(int event_id, void* hid, void* gc, EndCapStyle style) </H4>
-<pre>
- PCB callback events for drawing: change drawing line cap style
-</pre>
-<a id="HIDE_set_line_width">
-<H4> HIDE_set_line_width(int event_id, void* hid, void* gc, int width) </H4>
-<pre>
- PCB callback events for drawing: change drawing line width
-</pre>
-<a id="HIDE_set_draw_xor">
-<H4> HIDE_set_draw_xor(int event_id, void* hid, void* gc, int xor) </H4>
-<pre>
- PCB callback events for drawing: toggle xor drawing method
-</pre>
-<a id="HIDE_set_draw_faded">
-<H4> HIDE_set_draw_faded(int event_id, void* hid, void* gc, int faded) </H4>
-<pre>
- PCB callback events for drawing: toggle faded drawing method
-</pre>
-<a id="HIDE_draw_line">
-<H4> HIDE_draw_line(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2) </H4>
-<pre>
- PCB callback events for drawing: draw a line
-</pre>
-<a id="HIDE_draw_arc">
-<H4> HIDE_draw_arc(int event_id, void* hid, void* gc, int cx, int cy, int xradius, int yradius, double start_angle, double delta_angle) </H4>
-<pre>
- PCB callback events for drawing: draw an arc from center cx;cy
-</pre>
-<a id="HIDE_draw_rect">
-<H4> HIDE_draw_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2) </H4>
-<pre>
- PCB callback events for drawing: draw a rectangle
-</pre>
-<a id="HIDE_fill_circle">
-<H4> HIDE_fill_circle(int event_id, void* hid, void* gc, int cx, int cy, int radius) </H4>
-<pre>
- PCB callback events for drawing: draw a filled circle
-</pre>
-<a id="HIDE_fill_polygon">
-<H4> HIDE_fill_polygon(int event_id, void* hid, void* gc, int n_coords, int* x, int* y) </H4>
-<pre>
- PCB callback events for drawing: draw a filled ploygon
-</pre>
-<a id="HIDE_fill_rect">
-<H4> HIDE_fill_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2) </H4>
-<pre>
- PCB callback events for drawing: draw a filled rectangle
-</pre>
-<a id="HIDE_use_mask">
-<H4> HIDE_use_mask(int event_id, void* hid, int use_it) </H4>
-<pre>
- PCB callback events for drawing: TODO
-</pre>
-<a id="HIDE_make_gc">
-<H4> HIDE_make_gc(int event_id, void* hid, void* gc) </H4>
-<pre>
- PCB callback events for drawing: create a new graphical context
-</pre>
-<a id="HIDE_destroy_gc">
-<H4> HIDE_destroy_gc(int event_id, void* hid, void* gc) </H4>
-<pre>
- PCB callback events for drawing: destroy a graphical context
-</pre>
-<a id="HIDE_fill_pcb_pv">
-<H4> HIDE_fill_pcb_pv(int event_id, void* hid, void* fg_gc, void* bg_gc, void* pad, int drawHole, int mask) </H4>
-<pre>
- PCB callback events for drawing: TODO
-</pre>
-<a id="HIDE_fill_pcb_pad">
-<H4> HIDE_fill_pcb_pad(int event_id, void* hid, void* pad, int clear, int mask) </H4>
-<pre>
- PCB callback events for drawing: TODO
-</pre>
-</dl>
-<h3> Functions </h3>
-<dl>
-<p>The following functions are registered in script context.
-<a id="hid_create">
-<H4> hid_t* hid_create(char* hid_name, char* description) </H4>
-<pre>
- Creates a new hid context. Name and description matters only if the hid is
-registered as an exporter later.
-</pre>
-<a id="hid_add_attribute">
-<H4> int hid_add_attribute(hid_t* hid, char* attr_name, char* help, hid_attr_type_t type, int min, int max, char* default_val) </H4>
-<pre>
- Append an attribute in a hid previously created using hid_create().
- Arguments:
- hid: hid_t previously created using hid_create()
- attr_name: name of the attribute
- help: help text for the attribute
- type: type of the attribute (input widget type)
- min: minimum value of the attribute, if type is integer or real)
- max: maximum value of the attribute, if type is integer or real)
- default_val: default value of the attribute
- Returns an unique ID of the attribute the caller should store for
- later reference. For example this ID is used when retrieving the
- value of the attribute after the user finished entering data in
- the dialog.
-</pre>
-<a id="hid_get_attribute">
-<H4> char* hid_get_attribute(hid_t* hid, int attr_id) </H4>
-<pre>
- Query an attribute from the hid after dialog_attributes() returned.
- Arguments:
- hid: hid_t previously created using hid_create()
- attr_id: the unique ID of the attribute (returned by hid_add_attribute())
- Returns the value (converted to string) set by the user.
-</pre>
-<a id="hid_register">
-<H4> int hid_register(hid_t* hid) </H4>
-<pre>
- Register the hid; call it after a hid is created and its attributes
- are all set up
-</pre>
-<a id="hid_gpmi_data_set">
-<H4> void hid_gpmi_data_set(hid_t* h, void* data) </H4>
-<pre>
- For internal use
-</pre>
-<a id="hid_gpmi_data_get">
-<H4> hid_t* hid_gpmi_data_get(HID* h) </H4>
-<pre>
- For internal use
-</pre>
-<a id="hid_string2val">
-<H4> HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char* str) </H4>
-<pre>
- For internal use
-</pre>
-</dl>
-
-</body>
-</html>
-
diff --git a/doc-rnd/gpmi/packages/layout.html b/doc-rnd/gpmi/packages/layout.html
deleted file mode 100644
index 0e71575..0000000
--- a/doc-rnd/gpmi/packages/layout.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<HTML>
-<BODY>
-<H1> layout package </H1>
-
-Layout package searches and manipulates the current layout. Dimension units
-are in nanometer unless otherwise mentioned.
-
-<H2> Page: board dimensions</H2>
- Functions used to query or set width and height of the drawing:
- <UL>
- <LI>int layout_get_page_width();
- <LI>int layout_get_page_height();
- <LI>void layout_set_page_size(int width, int height);
- </UL>
-
-<H2> Layer manipulation </H2>
-Most functions perform operations similar to user commands affecting
-the current layer.
-The following few calls can change the current layer. Warning: this is the
-same current layer as the user's; the script most probably wants to save
-the current layer before changing it and then restore it after the operation.
- <UL>
- <LI>int layout_resolve_layer(const char *name): resolve layer number by name (case sensitive); returns negative number if not found
- <LI>int layout_get_current_layer(): returns the number of the current layer
- <LI>void layout_switch_to_layer(int layer): switch to layer (further actions will take place there)
- </UL>
-<p>
-
-<H2> Object searches </H2>
- Search results are collected on lists identified by their name (search_ID).
- If a new search is done with the same name, old search results for that
- name are discarded.
- Search functions return the number of objects found (size of the list) that can
- be then used while querying the results using layout_search_get().
- Results should be freed using layout_search_free() when they are no
- longer needed.
- <p>
- TODO: validity of a list in time
- <p>
-Once the search list is ready, the script can iterate over it and resolve
-the object handle of each object found, using layout_search_get(). Having
-an object handle, The layout_obj_*() functions may be used by the script
-to access fields of an object structure.
-
-<H2>Create new objects </H2>
- The layour_create_*() calls are used to create new objects on the current
- layer (set by layout_switch_to_layer()).
-
-
-<H2> API reference - page, untis and coordinates </H2>
-(angles are in radian)
-TODO
-
-<H2> API reference - debug draw </H2>
-TODO
-
-</BODY>
-</HTML>
diff --git a/doc-rnd/gpmi/packages/layout_ref.html b/doc-rnd/gpmi/packages/layout_ref.html
deleted file mode 100644
index 1b7b5b0..0000000
--- a/doc-rnd/gpmi/packages/layout_ref.html
+++ /dev/null
@@ -1,305 +0,0 @@
-<html>
-<body>
-<h1>PCB GPMI</h1>
-<h2>Reference manual for package layout</h2>
-<small>Automatically generated from layout.h</small>
-
-<h3> Enums </h3>
-<dl>
-<p>Enum values should be passed on as strings.
-<a id="layout_object_mask_e">
-<H4> layout_object_mask_e</H4>
-<pre>
- Object type search mask bits
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> OM_LINE <td> lines (traces, silk lines, not font)
-<tr><td> OM_TEXT <td> text written using the font
-<tr><td> OM_POLYGON <td> polygons, including rectangles
-<tr><td> OM_ARC <td> arcs, circles
-<tr><td> OM_VIA <td> vias and holes which are not part of a footprint
-<tr><td> OM_PIN <td> pins/pads of a footprint
-<tr><td> OM_ANY <td> shorthand for "find anything"
-</table>
-<a id="layout_object_coord_e">
-<H4> layout_object_coord_e</H4>
-<pre>
- Which coordinate of the object is referenced
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> OC_BX1 <td> bounding box X1
-<tr><td> OC_BX2 <td> bounding box X2
-<tr><td> OC_BY1 <td> bounding box Y1
-<tr><td> OC_BY2 <td> bounding box Y2
-<tr><td> OC_P1X <td> point 1 X
-<tr><td> OC_P2X <td> point 2 X
-<tr><td> OC_P1Y <td> point 1 Y
-<tr><td> OC_P2Y <td> point 2 Y
-<tr><td> OC_OBJ <td> the whole object
-<tr><td> OC_P1 <td> point 1 is P1X
-<tr><td> OC_P2 <td> point 2 is P2X
-</table>
-<a id="layout_flag_e">
-<H4> layout_flag_e</H4>
-<pre>
- of layout_object_coord_t
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> FL_NONE <td> <comment missing in the header>
-<tr><td> FL_SHOWNUMBER <td> <comment missing in the header>
-<tr><td> FL_LOCALREF <td> <comment missing in the header>
-<tr><td> FL_CHECKPLANS <td> <comment missing in the header>
-<tr><td> FL_SHOWDRC <td> <comment missing in the header>
-<tr><td> FL_RUBBERBAND <td> <comment missing in the header>
-<tr><td> FL_DESCRIPTION <td> <comment missing in the header>
-<tr><td> FL_NAMEONPCB <td> <comment missing in the header>
-<tr><td> FL_AUTODRC <td> <comment missing in the header>
-<tr><td> FL_ALLDIRECTION <td> <comment missing in the header>
-<tr><td> FL_SWAPSTARTDIR <td> <comment missing in the header>
-<tr><td> FL_UNIQUENAME <td> <comment missing in the header>
-<tr><td> FL_CLEARNEW <td> <comment missing in the header>
-<tr><td> FL_SNAPPIN <td> <comment missing in the header>
-<tr><td> FL_SHOWMASK <td> <comment missing in the header>
-<tr><td> FL_THINDRAW <td> <comment missing in the header>
-<tr><td> FL_ORTHOMOVE <td> <comment missing in the header>
-<tr><td> FL_LIVEROUTE <td> <comment missing in the header>
-<tr><td> FL_THINDRAWPOLY <td> <comment missing in the header>
-<tr><td> FL_LOCKNAMES <td> <comment missing in the header>
-<tr><td> FL_ONLYNAMES <td> <comment missing in the header>
-<tr><td> FL_NEWFULLPOLY <td> <comment missing in the header>
-<tr><td> FL_HIDENAMES <td> <comment missing in the header>
-<tr><td> FL_THERMALSTYLE1 <td> <comment missing in the header>
-<tr><td> FL_THERMALSTYLE2 <td> <comment missing in the header>
-<tr><td> FL_THERMALSTYLE3 <td> <comment missing in the header>
-<tr><td> FL_THERMALSTYLE4 <td> <comment missing in the header>
-<tr><td> FL_THERMALSTYLE5 <td> <comment missing in the header>
-</table>
-<a id="layer_field_e">
-<H4> layer_field_e</H4>
-<pre>
- Field name of the layer structure
-</pre>
-<table border=1>
-<tr><th>value <th>meaning
-<tr><td> LFLD_NUM_LINES <td> number of lines on the layer
-<tr><td> LFLD_NUM_TEXTS <td> number of texts on the layer
-<tr><td> LFLD_NUM_POLYS <td> number of polygons on the layer
-<tr><td> LFLD_NUM_ARCS <td> number of arcs on the layer
-<tr><td> LFLD_VISIBLE <td> non-zero if the layer is visible
-<tr><td> LFLD_NODRC <td> non-zero if the layer doesn't use DRC
-</table>
-</dl>
-<h3> Functions </h3>
-<dl>
-<p>The following functions are registered in script context.
-<a id="layout_search_box">
-<H4> int layout_search_box(const char* search_ID, layout_object_mask_t obj_types, int x1, int y1, int x2, int y2) </H4>
-<pre>
- creates a new search and adds all objects that matches obj_types mask within the given rectangle on the current layer
- Arguments:
- search_ID: unique name of the search (overwrites existing search on the same name)
- obj_types: on or more object types
- x1, y1, x2, y2: box the search is done within (PCB coords)
- Returns the number of object on the search list.
-</pre>
-<a id="layout_search_selected">
-<H4> int layout_search_selected(const char* search_ID, layout_object_mask_t obj_types) </H4>
-<pre>
- creates a new search and adds all selected objects
- Arguments:
- search_ID: unique name of the search (overwrites existing search on the same name)
- obj_types: on or more object types
- Returns the number of object on the search list.
-</pre>
-<a id="layout_search_found">
-<H4> int layout_search_found(const char* search_ID, layout_object_mask_t obj_types) </H4>
-<pre>
- creates a new search and adds all found objects (the green highlight)
- Arguments:
- search_ID: unique name of the search (overwrites existing search on the same name)
- obj_types: on or more object types
- Returns the number of object on the search list.
-</pre>
-<a id="layout_search_get">
-<H4> layout_object_t* layout_search_get(const char* search_ID, int n) </H4>
-<pre>
- Returns the nth object from a search list (or NULL pointer if n is beyond the list)
-</pre>
-<a id="layout_search_free">
-<H4> int layout_search_free(const char* search_ID) </H4>
-<pre>
- Frees all memory related to a search. Returns 0 on success.
- Argument:
- search_ID: unique name of the search (requires an existing search)
-</pre>
-<a id="layout_obj_coord">
-<H4> int layout_obj_coord(layout_object_t* obj, layout_object_coord_t coord) </H4>
-<pre>
- Return the requested coord of an object; except for the bounding box
- coordinates, the meaning of coordinates are object-specific.
- Point 1 and point 2 are usually endpoints of the object (line, arc),
- "the whole object" coordinate is a central point.
-</pre>
-<a id="layout_obj_type">
-<H4> layout_object_mask_t layout_obj_type(layout_object_t* obj) </H4>
-<pre>
- Return the type of an object (always a single bit)
-</pre>
-<a id="layout_obj_move">
-<H4> int layout_obj_move(layout_object_t* obj, layout_object_coord_t coord, int dx, int dy) </H4>
-<pre>
- Change location of an object or parts of the object (like move endpoint of a line);
- Arguments:
- obj: the object
- coord: which coordinate to drag (e.g. move only the endpoint)
- dx, dy: relative x and y coordinates the selected coordinate is displaced by
- Returns 0 on success
-</pre>
-<a id="layout_arc_angles">
-<H4> int layout_arc_angles(layout_object_t* obj, int relative, int start, int delta) </H4>
-<pre>
- change angles of an arc; start and delate are relative if relative is non-zero; returns 0 on success
-</pre>
-<a id="layout_create_line">
-<H4> int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int clearance, layout_flag_t flags) </H4>
-<pre>
- create a line
-</pre>
-<a id="layout_create_via">
-<H4> int layout_create_via(int x, int y, int thickness, int clearance, int mask, int hole, const char* name, layout_flag_t flags) </H4>
-<pre>
- create a named via
-</pre>
-<a id="layout_create_arc">
-<H4> int layout_create_arc(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, layout_flag_t flags) </H4>
-<pre>
- create a new arc; sa is start angle, dir is delta angle
-</pre>
-<a id="layout_switch_to_layer">
-<H4> void layout_switch_to_layer(int layer) </H4>
-<pre>
- switch to layer (further layer-specific actions will take place there)
-</pre>
-<a id="layout_get_current_layer">
-<H4> int layout_get_current_layer() </H4>
-<pre>
- returns the number of the current layer
-</pre>
-<a id="layout_resolve_layer">
-<H4> int layout_resolve_layer(const char* name) </H4>
-<pre>
- resolve layer number by name (case sensitive); returns negative number if not found
-</pre>
-<a id="layout_get_max_possible_layer">
-<H4> int layout_get_max_possible_layer() </H4>
-<pre>
- return the theoretical number of layers supported by PCB
-</pre>
-<a id="layout_get_max_copper_layer">
-<H4> int layout_get_max_copper_layer() </H4>
-<pre>
- return the actual number of copper layers on the current design
-</pre>
-<a id="layout_get_max_layer">
-<H4> int layout_get_max_layer() </H4>
-<pre>
- return the actual number of layers on the current design
-</pre>
-<a id="layout_layer_name">
-<H4> const char* layout_layer_name(int layer) </H4>
-<pre>
- return the name of a layer
-</pre>
-<a id="layout_layer_color">
-<H4> const char* layout_layer_color(int layer) </H4>
-<pre>
- return the color of a layer
-</pre>
-<a id="layout_layer_field">
-<H4> int layout_layer_field(int layer, layer_field_t fld) </H4>
-<pre>
- return an integer field of a layer
-</pre>
-<a id="layout_get_page_width">
-<H4> int layout_get_page_width() </H4>
-<pre>
- query or set width and height of the drawing
-</pre>
-<a id="layout_get_page_height">
-<H4> int layout_get_page_height() </H4>
-<pre>
-<comment missing in the header>
-</pre>
-<a id="layout_set_page_size">
-<H4> void layout_set_page_size(int width, int height) </H4>
-<pre>
-<comment missing in the header>
-</pre>
-<a id="mil2pcb_multiplier">
-<H4> double mil2pcb_multiplier() </H4>
-<pre>
- -- coordinate system -- (coord.c)
-</pre>
-<a id="mm2pcb_multiplier">
-<H4> double mm2pcb_multiplier() </H4>
-<pre>
-<comment missing in the header>
-</pre>
-<a id="current_grid_unit">
-<H4> const char* current_grid_unit() </H4>
-<pre>
-<comment missing in the header>
-</pre>
-<a id="debug_draw_request">
-<H4> int debug_draw_request(void) </H4>
-<pre>
- Initialize debug drawing; returns 1 if worked, 0 if denied
-</pre>
-<a id="debug_draw_flush">
-<H4> void debug_draw_flush(void) </H4>
-<pre>
- Flush the drawing
-</pre>
-<a id="debug_draw_finish">
-<H4> void debug_draw_finish(dctx_t* ctx) </H4>
-<pre>
- Finish (close) drawing
-</pre>
-<a id="debug_draw_dctx">
-<H4> dctx_t* debug_draw_dctx(void) </H4>
-<pre>
- Get the draw context of debug draw
-</pre>
-<a id="draw_set_color">
-<H4> void draw_set_color(dctx_t* ctx, const char* name) </H4>
-<pre>
- Debug draw style: set drawing color
-</pre>
-<a id="draw_set_line_width">
-<H4> void draw_set_line_width(dctx_t* ctx, int width) </H4>
-<pre>
- Debug draw style: set line width
-</pre>
-<a id="draw_set_draw_xor">
-<H4> void draw_set_draw_xor(dctx_t* ctx, int xor) </H4>
-<pre>
- Debug draw style: set whether drawing should happen in xor
-</pre>
-<a id="draw_set_draw_faded">
-<H4> void draw_set_draw_faded(dctx_t* ctx, int faded) </H4>
-<pre>
- Debug draw style: set whether drawing should happen in faded mode
-</pre>
-<a id="draw_line">
-<H4> void draw_line(dctx_t* ctx, int x1_, int y1_, int x2_, int y2_) </H4>
-<pre>
- Debug draw: draw a line using the current style settings
-</pre>
-</dl>
-
-</body>
-</html>
-
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.html b/doc-rnd/gpmi/rosetta/30_move/ex.html
deleted file mode 100644
index 08251a7..0000000
--- a/doc-rnd/gpmi/rosetta/30_move/ex.html
+++ /dev/null
@@ -1,36 +0,0 @@
-Load packages the script depends on:
-<ul>
- <li> <ref>actions</ref> for registering the new action;
- <li> <ref>layout</ref> for searching selected objects and moving objects.
-</ul>
-<p>
-Create a function <i>ev_action</i> that will be called when any of
-the actions registered by the script is executed. The script registers
-only one action, so it does not need to check which action caused
-the function to be called.
-<p>
-When the action event is called, first set up:
-<ul>
- <li> fetch event argument 0 and 1 using <ref>action_arg</ref>;
- <li> resolve the conversion rate from mm to PCB's units using <ref>mm2pcb_multiplier</ref>;
- <li> perform a search for all selected object using <ref>layout_search_selected</ref> (return value is the number of objects found), name the resulting list "mv_search"
-</ul>
-A loop then iterates over the objects on the list:
-<ul>
- <li> resolve the Nth element of the list using <ref>layout_search_get</ref>, referecing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer;
- <li> move the object using <ref>layout_obj_move</ref>; specify the object pointer, then which part of the object should be moved ("OC_OBJ" means the whole object) and relative offsets (dx and dy calculated earlier)
-</ul>
-Finally the search list shall be destroyed to reclaim memory, using <ref>layout_search_free</ref>.
-<p>
-
-In the "main" section of the script, bind event <ref>ACTE_action</ref> to
-our local function <i>ev_action</i> - this gets <i>ev_action</i> to
-be called when any of the actions registered by this script is executed.
-<p>
-Finally use <ref>action_register</ref> to register the action:
-<ul>
- <li> first argument is the name of the action
- <li> second is the xy query string; it is empty since this action won't need coordinates to operate on
- <li> third is the description that shows up in dumps and helps
- <li> fourth is the syntax description (also for helps)
-</ul>
diff --git a/doc-rnd/gpmi/rosetta/30_move/index.html b/doc-rnd/gpmi/rosetta/30_move/index.html
deleted file mode 100644
index b5969b9..0000000
--- a/doc-rnd/gpmi/rosetta/30_move/index.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<html><body>
-<!-- ******* DO NOT EDIT THIS FILE, it is generated by rosetta_genpages.sh ******* -->
-<-- back to the <a href="../index.html">index of Rosetta examples</a>
-<h1>action: move selected objects</h1>
-Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm.
-<H2> Example implementations </H2>
-<a href="ex.awk">awk</a>
- |
-<a href="ex.bash">bash</a>
- |
-<a href="ex.lua">lua</a>
- |
-<a href="ex.pl">pl</a>
- |
-<a href="ex.py">py</a>
- |
-<a href="ex.rb">rb</a>
- |
-<a href="ex.scm">scm</a>
- |
-<a href="ex.stt">stt</a>
- |
-<a href="ex.tcl">tcl</a>
-<h2> Explanation, step by step </h2>
-Load packages the script depends on:
-<ul>
-<li>
-<i>actions</i>
- for registering the new action;
-<li>
-<i>layout</i>
- for searching selected objects and moving objects. </ul>
-
-<p> Create a function
-<i>ev_action</i>
- that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called.
-<p> When the action event is called, first set up:
-<ul>
-<li> fetch event argument 0 and 1 using
-<i><a href="../../packages/actions_ref.html#action_arg">action_arg</a></i>
-;
-<li> resolve the conversion rate from mm to PCB's units using
-<i><a href="../../packages/layout_ref.html#mm2pcb_multiplier">mm2pcb_multiplier</a></i>
-;
-<li> perform a search for all selected object using
-<i><a href="../../packages/layout_ref.html#layout_search_selected">layout_search_selected</a></i>
- (return value is the number of objects found), name the resulting list "mv_search" </ul>
- A loop then iterates over the objects on the list:
-<ul>
-<li> resolve the Nth element of the list using
-<i><a href="../../packages/layout_ref.html#layout_search_get">layout_search_get</a></i>
-, referecing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer;
-<li> move the object using
-<i><a href="../../packages/layout_ref.html#layout_obj_move">layout_obj_move</a></i>
-; specify the object pointer, then which part of the object should be moved ("OC_OBJ" means the whole object) and relative offsets (dx and dy calculated earlier) </ul>
- Finally the search list shall be destroyed to reclaim memory, using
-<i><a href="../../packages/layout_ref.html#layout_search_free">layout_search_free</a></i>
-.
-<p> In the "main" section of the script, bind event
-<i><a href="../../packages/actions_ref.html#ACTE_action">ACTE_action</a></i>
- to our local function
-<i>ev_action</i>
- - this gets
-<i>ev_action</i>
- to be called when any of the actions registered by this script is executed.
-<p> Finally use
-<i><a href="../../packages/actions_ref.html#action_register">action_register</a></i>
- to register the action:
-<ul>
-<li> first argument is the name of the action
-<li> second is the xy query string; it is empty since this action won't need coordinates to operate on
-<li> third is the description that shows up in dumps and helps
-<li> fourth is the syntax description (also for helps) </ul>
-
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk b/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk
deleted file mode 100644
index c90a9e0..0000000
--- a/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk
+++ /dev/null
@@ -1,60 +0,0 @@
-BEGIN {
- PkgLoad("pcb-rnd-gpmi/hid", 0)
- PkgLoad("pcb-rnd-gpmi/layout", 0)
- PkgLoad("pcb-rnd-gpmi/dialogs", 0)
-
- hid = hid_create("drill", "drill list export")
- attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt")
- attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text")
- hid_register(hid)
-
- fmt = 0
- conv = mm2pcb_multiplier()
- channel = ""
- green_light = 0
-}
-
-function make_gc(event_id, hid, gc) {
- if (channel == "") {
- channel = hid_get_attribute(hid, attr_path)
-# awk: can't check whether the file can be open here
- fmt = hid_get_attribute(hid, attr_format)
- }
-}
-
-function destroy_gc(event_id, hid, gc) {
- if (channel != "") {
- close(channel)
- channel = ""
- }
-}
-
-function set_layer(event_id, hid, name, group, empty) {
- if (name == "topassembly")
- green_light = 1
- else
- green_light = 0
-}
-
-function fill_circle(event_id, hid, gc, cx, cy, r ,dia) {
- if (green_light) {
- cx = cx / conv
- cy = cy / conv
- dia = r / conv * 2
-
- if (fmt == "CSV") {
- print cx "," cy "," dia > channel
- } else if (fmt == "TSV") {
- print cx "\t" cy "\t" dia > channel
- } else if (fmt == "text") {
- print cx " " cy " " dia > channel
- }
- }
-}
-
-BEGIN {
- Bind("HIDE_make_gc", "make_gc")
- Bind("HIDE_destroy_gc", "destroy_gc")
- Bind("HIDE_set_layer", "set_layer")
- Bind("HIDE_fill_circle", "fill_circle")
-}
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua b/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua
deleted file mode 100644
index 9b1371c..0000000
--- a/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua
+++ /dev/null
@@ -1,65 +0,0 @@
-PkgLoad("pcb-rnd-gpmi/hid", 0)
-PkgLoad("pcb-rnd-gpmi/layout", 0)
-PkgLoad("pcb-rnd-gpmi/dialogs", 0)
-
-hid = hid_create("drill", "drill list export")
-attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt")
-attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text")
-hid_register(hid)
-
-fmt = 0
-conv = mm2pcb_multiplier()
-channel = nil
-green_light = 0
-
-function make_gc(event_id, hid, gc)
- if channel == nil
- then
- channel = io.open(hid_get_attribute(hid, attr_path), "w")
- if channel == nil
- then
- dialog_report("Error exporting drill", "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed.")
- return
- end
- fmt = hid_get_attribute(hid, attr_format)
- end
-end
-
-function destroy_gc(event_id, hid, gc)
- if channel ~= nil
- then
- channel:close()
- channel = nil
- end
-end
-
-function set_layer(event_id, hid, name, group, empty)
- if name == "topassembly"
- then
- green_light = 1
- else
- green_light = 0
- end
-end
-
-function fill_circle(event_id, hid, gc, cx, cy, r)
- if green_light
- then
- cx = cx / conv
- cy = cy / conv
- local dia = r / conv * 2
-
- if fmt == "CSV" then
- channel:write(cx .. "," .. cy .. "," .. dia .. "\n")
- elseif (fmt == "TSV") then
- channel:write(cx .. "\t" .. cy .. "\t" .. dia .. "\n")
- elseif (fmt == "text") then
- channel:write(cx .. " " .. cy .. " " .. dia .. "\n")
- end
- end
-end
-
-Bind("HIDE_make_gc", "make_gc")
-Bind("HIDE_destroy_gc", "destroy_gc")
-Bind("HIDE_set_layer", "set_layer")
-Bind("HIDE_fill_circle", "fill_circle")
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl b/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl
deleted file mode 100644
index 3311117..0000000
--- a/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl
+++ /dev/null
@@ -1,63 +0,0 @@
-PkgLoad pcb-rnd-gpmi/hid 0
-PkgLoad pcb-rnd-gpmi/layout 0
-PkgLoad pcb-rnd-gpmi/dialogs 0
-
-set hid [hid_create "drill" "drill list export"]
-set attr_path [hid_add_attribute $hid "filename" "name of the output file" "HIDA_Path" 0 0 "drill.txt"]
-set attr_format [hid_add_attribute $hid "format" "file format" "HIDA_Enum" 0 0 "CSV|TSV|text"]
-hid_register $hid
-
-set fmt 0
-set conv [mm2pcb_multiplier]
-set channel -1
-set green_light 0
-
-proc make_gc {event_id hid gc} {
- global channel attr_path attr_format fmt
-
- if {$channel == -1} {
- if {[catch {open [hid_get_attribute $hid $attr_path] "w"} channel]} {
- dialog_report "Error exporting drill" "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed."
- return
- }
- set fmt [hid_get_attribute $hid $attr_format]
- }
-}
-
-proc destroy_gc {event_id hid gc} {
- global channel
-
- if {$channel > -1} {
- close $channel
- set channel -1
- }
-}
-
-proc set_layer {event_id hid name group empty} {
- global green_light
-
- if { $name eq "topassembly" } { set green_light 1 } { set green_light 0 }
-}
-
-proc fill_circle {event_id hid gc cx cy r} {
- global channel conv fmt green_light
-
- if {$green_light} {
- set cx [expr $cx / $conv]
- set cy [expr $cy / $conv]
- set dia [expr $r / $conv * 2]
-
- if {$fmt eq "CSV"} {
- puts $channel "$cx,$cy,$dia"
- } elseif {$fmt eq "TSV"} {
- puts $channel "$cx $cy $dia"
- } elseif {$fmt eq "text"} {
- puts $channel "$cx $cy $dia"
- }
- }
-}
-
-Bind HIDE_make_gc make_gc
-Bind HIDE_destroy_gc destroy_gc
-Bind HIDE_set_layer set_layer
-Bind HIDE_fill_circle fill_circle
diff --git a/doc-rnd/gpmi/scripting_intro.html b/doc-rnd/gpmi/scripting_intro.html
deleted file mode 100644
index a70d50a..0000000
--- a/doc-rnd/gpmi/scripting_intro.html
+++ /dev/null
@@ -1,226 +0,0 @@
-<html>
-<body>
-<H1> Scripting intro </H1>
-This document is an introduction to GPMI for pcb-rnd users. It focuses on
-scripting pcb-rnd and doesn't discusses GPMI deeper than the minimum necessary.
-GPMI is more generic than shown here.
-<p>
-The scope of the document is to describe the relations between pcb-rnd,
-hids, GPMI, glue packages and scripts. Details on how specific glue
-packages access pcb-rnd internals (or how those internals work) are
-described in other documents.
-
-<H2> 1. pcb-rnd internals </H2>
-
-Since scripts are glued to pcb-rnd internals, scripters need to know
-the basic concepts of how pcb-rnd is structured.
-
-<H3> 1.1 pcb-rnd, HIDs, plugins and GPMI </h2>
-pcb-rnd consists of:
-<ul>
- <li> a <b>core</b> that handles the file format, data structures, UI and exporter logics
- <li> a <b>hid system</b> that is a layer between core and the HIDs
- <li> a set of <b>GUI HIDs</b> which are responsible for interactive graphical display of the current design
- <li> a set of <b>exporter HIDs</b> which are responsible for exporting offline representation of the current design
- <li> a <b>plugin system</b> that can load HIDs from on the fly, from dynamic loadable libraries (.so or .dll)
- <li> a <b>buildin system</b> which is the "static link" variant of the plugin system: some plugins can be selected to be statically linked into the pcb-rnd executable so they are "always loaded"
-</ul>
-<p>
-Note 1: at the moment GUI hids can not be plugins or buildins.
-<br>
-Note 2: plugins/buildins are always exporter HIDs technically, but in practice
-they do not have to offer exporting. This means such a HID plugin is loaded
-and registered as an exporter on paper, but it doesn't really create a
-new export facility, just sits there, interacting with pcb-rnd (creating
-menus, actions, etc). Most script plugins do this.
-<p>
-When pcb-rnd executable is compiled, the core, the default GUI and exporter HIDs
-and buildins are compiled into the executable. Later on
-<p>
-The <i>GPMI hid</i> is an <i>optional plugin</i> that, by compile-time choice
-of the user, can be:
-<ul>
- <li> left out all-together - pcb-rnd does not have scripting
- <li> compiled as a plugin - when the .so (or .dll) is put in the right directory, pcb-rnd loads it during startup and has scripting
- <li> compiled as buildin - becomes part of the pcb-rnd executable so that scripting is always available
-</ul>
-
-<H3> 1.2. Actions, menus, exporters </h2>
-The core implements actions. An action is a command with custom arguments,
-e.g. Delete(Selected). These actions are the commands on the default command
-line in pcb-rnd. In batch mode the command language uses these actions as well.
-Remote controlling pcb-rnd using the --listen switch will read these actions
-on the standard input.
-<p>
-GUI menus are configured to execute actions too. This also means it is impossible
-to realize an user-accessible functionality that can be triggered from
-the GUI command line, menu or batch input without making it an action.
-<p>
-The only exception, where new functionality is not behind a new action is
-exporters. An exporter is a structured dialog box of options and a set of
-callback functions implementing a drawing API. Exporting works by the following
-steps:
-<ol>
- <li> An exporter HID may register one or more exporters.
- <li> When the user tries to export the design, pcb-rnd lists all
- registered exporters.
- <li> The user chooses one, and the preconfigured dialog box
- with the selected exporter's options are popped up.
- <li> pcb-rnd core runs the dialog and saves the results if the user
- clicked on the ok button.
- <li> pcb-rnd starts the exporting process: it calls the callbacks
- to draw the design layer by layer, object by object.
-</ol>
-
-<H3> 1.3. How a script can interact with the user </h2>
-<ul>
- <li> The script may register <i>actions</i> - these actions are instantly accessible from the GUI command line, on stdin with --listen and in batch mode
- <li> The script may <i>create menus</i> and bind them to actions - when the menu is selected, the action is executed
- <li> The script may <i>bind to events</i> that will be generated asynchronously by pcb-rnd - when such an event is received, the script executes some code
- <li> The script may <i>register new exporter(s)</i> - the user will be able to export the design using the script
- <li> The script may run arbitrary code <i>"on load"</i> (when the script is loaded) - however, that time the design or even the GUI may not be loaded/initialized yet - this is useful for registering actions, bind to events or set up exporters
-</ul>
-
-
-<H2> 2. GPMI intro </H2>
-
-<H3> 2.1. GPMI's place in the pcb-rnd world </H3>
-<table border=0 widht=100%><tr><td valign=top>
-GPMI is a plugin/buildin HID. Instead of doing actual work, it loads scripts
-and provides a glue layer between pcb-rnd and the scripts. The actual work
-is performed by the scripts.
-The glue layer comes in two kinds:
-<ul>
- <li> gpmi module: dynamic lib written in C, knows how to load and interpret a script and how to deliver events to the script
- <li> gpmi package: dynamic lib, provides C functions the script can directly call; package functions then know how to deal with PCB internals
-</ul>
-Arrows drawn with dashed line represents a slow, <i>string based communication</i>.
-<td><img src="gpmi_flow.png"></table>
-
-<H3> 2.2. Module, script, script context, packages </H3>
-<table border=0 widht=100%><tr><td valign=top>
-Each time a script needs to be loaded, first a module is loaded and the name
-of the script is passed to the module. During module initialization, the module
-sets up a script interpreter and script context and loads the script into the
-context.
-<p>
-If there are 3 separate lua scripts running in pcb-rnd, there are 3 separate
-lua modules loaded, each dealing with one of the scripts. The process of
-loading a script is illustrated by highlighting the relevant paths with red
-for step 1 and green for step 2.
-<p>
-Step 0: the <b>GPMI HID</b> finds a script has to be loaded. The idea comes
-from the config file (pcb-rnd-gpmi.conf) or from the GUI (manage scripts)
-or as a request from a script already loaded.
-<p>
-Step 1: the <b>GPMI HID</b> loads the corresponding module which in turns
-loads the script. The script has a "main" part that is run on load. For
-most languages this is the global code sections; in some languages it is
-a specific function, usually called main. A few basic glue packages
-are already loaded before the script.
-<p>
-Step 2: the <b>script</b> can load glue packages. This usually happens
-from the on-load main part from the script. The actual mechanism is to
-call PkgLoad() from a glue package that was automatically loaded in
-Step 1. The green arrows represent this path: the script executes PkgLoad()
-which in turns loads other package(s) into the GPMI hid.
-<p>
-Packages are loaded only once and are globally accessible for multiple modules.
-<td><img src="gpmi_flow_load.png"></table>
-
-<H3> 2.3. Binding events, registering actions, creating menus </H3>
-<table border=0 widht=100%><tr><td valign=top>
-Binding an event in a script is done by calling the Bind() function
-(this is implemented in a package automatically loaded). The first
-argument is the name of the event, the second argument is the name of
-the script function that should be called when the event is triggered. Both
-arguments are strings. The event binding mechanism is shown in red in the
-map to the right.
-<p>
-The script can create new actions using the action_register() function
-(the actions package needs to be loaded first). A script may register multiple
-actions. This call is marked with green in the above map.
-If any of the actions registered by the script is called, the event "ACTE_action"
-is generated. This has two implications:
-<ul>
- <li> a script that registers actions needs to bind the ACTE_action event to serve the action requests
- <li> if a script registers multiple actions, in the event handler it needs to check which action triggered the event (e.g. with a switch()-like construction on the event name)
-</ul>
-<td><img src="gpmi_flow_reg.png"></table>
-
-<table border=0 widht=100%><tr><td valign=top>
-Menus are created using the create_menu() call. <b>Menus can be
-created only when the GUI is already set up - this may happen only
-after some of the scripts are already loaded</b>. Thus scripts shall
-create menus from an event handler bound to the ACTE_gui_init event.
-This event is triggered right after the GUI has been set up.
-On the map to the right the red arrows represent the path of ACTE_gui_init;
-the green arrows represent the reaction of the script, creating the new
-menu.
-<p>
-<td><img src="gpmi_flow_menu.png"></table>
-
-<H3> 2.4. Exporting </H3>
-<table border=0 widht=100%><tr><td valign=top>
-Exporter scripts first have to set up an exporter hid. This typically
-happens from their on-load main part. Related calls are in the hid
-package. The following map shows this process with red arrows:
-<p>
-When the user chooses to use the exporter, among the green arrows,
-a series of events are triggered and the script can generate output
-directly to a file from event handlers bound to these exporting events.
-<td><img src="gpmi_flow_exp.png"></table>
-
-<H3> 2.5. Making modifications on the design </H3>
-The purpose of a script might be to manipulate the objects in the current design.
-Such a script registers actions, and implements the handler of the actions
-using the layout package. The layout package provides calls to query,
-change and create design objects.
-
-
-<H2> 3. How it works in practice </H2>
-
-<H3> 3.1. Loading the GPMI plugin </H3>
-Check the output of ./configure, it will tell if gpmi is compiled as buildin
-or plugin (or not at all).
-If the gpmi plugin is compiled as a buildin, it is already loaded, no
-further steps are required.
-<p>
-If gpmi is a plugin, gpmi_plugin.so (or gpmi_plugin.dll) needs to be
-copied in one of the plugin directories pcb-rnd is looking into on startup:
-<table border=1>
- <tr><th> path <th> purpose
- <tr><td>
- <tr><td>$prefix/lib/pcb-rnd/plugins/$arch/ <td> system plugins, multihost
- <tr><td>$prefix/lib/pcb-rnd/plugins/ <td> system plugins
- <tr><td>~/.pcb/plugins/$arch/ <td> user plugins, multihost
- <tr><td>~/.pcb/plugins/ <td> user plugins
- <tr><td>./plugins/$arch/ <td> project plugins, multihost
- <tr><td>./plugins/ <td> project plugins
-</table>
-In the above table:
-<ul>
- <li> $prefix is the installation prefix (normally /usr)
- <li> $arch is the host arch triplet, e.g. i386-unknown-linux; this is useful if multiple architectures share the same NFS mounted plugin dir
- <li> ~ is the user home directory, if exists, e.g. /home/jdoe
- <li> ./ is the current working directory pcb has been started from; may be useful for project-local scripts
-</ul>
-
-<H3> 3.2. Loading scripts </H3>
-The gpmi plugin looks for a file called "pcb-rnd-gpmi.conf" in each of the
-plugin directories. Wherever the file is found, it is loaded and parsed.
-The file is plain text, each line describes a script to be loaded. Empty
-lines and lines starting with # are comments and are ignored.
-<p>
-Script load lines contain two words separated by a space: a module name
-and a script name. Relative paths in the the script name are relative to
-the directory the config file is found in.
-<p>
-Example config:
-<pre>
-# load the carc script (written in lua) from next to the config file:
-lua carc.lua
-
-# load foo.awk, whcih is a mawk script, from its installation path
-mawk /usr/lib/foo/foo.awk
-</pre>
diff --git a/doc-rnd/gsch2pcb-rnd.htm b/doc-rnd/gsch2pcb-rnd.htm
deleted file mode 100644
index 50dd864..0000000
--- a/doc-rnd/gsch2pcb-rnd.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd user manual </title>
-</head>
-<body>
-<h1> pcb-rnd - user manual </h1>
-
-<h2> 2. Utilities </h2>
-<p>
-<h2> 2.1. gsch2pcb-rnd </h2>
-<p>
-Gsch2pcb-rnd is a standalone utility that can extract netlists and
-element data from a schematics produced by gschem. Thus it is a glue
-between gschem and pcb-rnd, doing <i>forward annotation</i>. It is ideal
-for automating the design process as it can be easily called from
-Makefiles, shell scripts or other programs/scripts, whereas the
-"import schematics" feautre (import_sch plugin) is more geared for the
-GUI user.
-<p>
-Multiple <i>methods</i> of operation are offered - the user can select
-one of these by name, using the -m command line argument (e.g.
-<i>gsch2pcb-rnd -m importsep foo.sch</i>):
-<table border="1">
- <tr>
- <td> method name
- <td> description
- <tr>
- <td> pcb
- <td> The classic approach: load the existing extract elements from
- the .sch file, load the .pcb file, compare element lists, load
- footprint libraries and create .new.pcb and .net and .cmd and let
- the user handle the rest. Does <b>not</b> work with anything else
- than the .pcb format. This method is <b>deprecated</b> and is
- provided only for compatibility with some old workflows.
- <tr>
- <td> import
- <td> Runs the same gnetlist backend as the import_sch plugin. A single
- action command file generated with .cmd suffix. When executed
- (using action <i>ExcuteFile(foo.cmd)</i>), it syncs (replaces/creates)
- every element and sets up all nets. Pro: single-command import.
- Con: can't load netlist only or elements only.
- <tr>
- <td> importsep
- <td> Similar to import, but produces two files: a .cmd file with element
- updates only (can be appled the same way as import's) and a
- separate .net netlist file that can be imported the same way as the
- .net of the pcb method. Pro: the user can update elements-only or
- nets-only. Con: requires two user actions to get a full impoty.
-</table>
diff --git a/doc-rnd/hacking/c89.html b/doc-rnd/hacking/c89.html
deleted file mode 100644
index 9617af3..0000000
--- a/doc-rnd/hacking/c89.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd - C89 </h1>
-
-The code is written in C, namely C89 for most parts with a few exceptions
-written in C99. It's not yet decided whether the code will be C89 or C99
-long term. If it'll be C89, the C99 parts will be rewritten. If it'll be
-C99, new code can use C99 features freely. Until the decision, keep
-new code C89. Especlially watch out for these:
-<ul>
- <li> commengt: always use /* */, never //
- <li> don't mix variable declaration with code - open a new {} block, which will also scope your new variables, or better yet, split up the function into smaller, static functions, the compiler will inline them anyway
- <li> try to avoid vararg macros, use vararg functions instead
-</ul>
diff --git a/doc-rnd/hacking/data1.png b/doc-rnd/hacking/data1.png
deleted file mode 100644
index 3ed1629..0000000
Binary files a/doc-rnd/hacking/data1.png and /dev/null differ
diff --git a/doc-rnd/hacking/indent.html b/doc-rnd/hacking/indent.html
deleted file mode 100644
index d68f883..0000000
--- a/doc-rnd/hacking/indent.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>
-<body>
-<h1> pcb-rnd - indentation </h1>
-
-As of r1022 all old code is converted using indent(1) with the following
-command line:
-
-<pre>
-indent --line-length128 -brs -br -nce --tab-size2 -ut -npsl -npcs -hnl $*
-</pre>
-<p>
-Contributors are kindly asked to follow this style or run the above commandline
-on their code before sending a patch or commiting to svn.
-</body>
-</html>
diff --git a/doc-rnd/hacking/releasing.txt b/doc-rnd/hacking/releasing.txt
deleted file mode 100644
index 22772fc..0000000
--- a/doc-rnd/hacking/releasing.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-release check list
-
-0. test compile and test run a clean checkout on a clean system
- configure with --debug --all=buildin, then without
-1. check next version number and previous revision in tags/
-2. update the changelog
-3. rewrite the release notes
-4. modify version number in scconfig
-5. update changelog in debian/
-6. commit trunk
-7. svn tag using URLs
diff --git a/doc-rnd/hacking/src/data1.dot b/doc-rnd/hacking/src/data1.dot
deleted file mode 100644
index 1baecdd..0000000
--- a/doc-rnd/hacking/src/data1.dot
+++ /dev/null
@@ -1,47 +0,0 @@
-digraph pcb_data {
- PCBType_misc [label="misc fields:\nID\nName\nFileName\ncolors\ndrc settings\ncursor coords\ngrid\nlayergroups\nroute styles\n..."]
- PCBType_flags [label="flags:\nChanged\nViaOn (vias drawn?)\n..."]
- PCBType -> PCBType_misc
- PCBType -> PCBType_flags
- PCBType -> DataType
- PCBType [shape=box]
-
- PCB [label="extern PCBType PCB\nglobal variable\nholding the current\nboard" shape=diamond]
- PCB -> PCBType
-
- Buffers [label="extern BufferType Buffers[]\nglobal variable holding\nall paste buffers" shape=diamond]
- Buffers -> BufferType
-
- BufferType_misc [label="misc fields:\nbounding box\noffset"]
- BufferType -> BufferType_misc
- BufferType -> DataType
- BufferType [shape=box]
-
- DataType_lists [label="layer-independent lists:\nrats\nvias\nelements"]
- DataType_rtrees [label="layer-independent rtrees"]
- DataType_LayerN [label="LayerN: number of\nlayers in use"]
- DataType_layers [label="an array of layers"]
-
- DataType -> DataType_misc
- DataType -> DataType_LayerN
- DataType -> DataType_layers
- DataType -> DataType_lists
- DataType -> DataType_rtrees
- DataType [shape=box]
-
- DataType_layers -> LayerType
-
-
- LayerType_lines [label="list and rtree of lines"]
- LayerType_arcs [label="list and rtree of arcs"]
- LayerType_texts [label="list and rtree of text objects"]
- LayerType_polygons [label="list and rtree of polygons"]
- LayerType_misc [label="misc fields:\nflags\ncolors"]
-
- LayerType -> LayerType_misc
- LayerType -> LayerType_lines
- LayerType -> LayerType_arcs
- LayerType -> LayerType_texts
- LayerType -> LayerType_polygons
- LayerType [shape=box]
-}
diff --git a/doc-rnd/help.html b/doc-rnd/help.html
deleted file mode 100644
index 0f112b4..0000000
--- a/doc-rnd/help.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - help wanted </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - help wanted </h1>
-The project is looking for volunteers for the features listed below. If
-you want to contribute, you will need to have an svn client and an email
-client. Furthermore an IRC client is strongly recommended.
-<p>
-You will become part of the team and get svn commit right immediately
-when you start working.
-<p>
-<b>Don't have much free time?</b> Don't worry: the tasks below are split up in
-very small (1..2 hours) chunks. Coordination is granted, the administrative
-overhead is almost zero - you can focus on the task, and finish it whenever
-you have a free hour.
-<p>
-Worrying about your <b>contribution to go in /dev/null?</b> Don't: pcb-rnd
-has very short loops; you start contributing and get immediate feedback. Your
-work is part of the official thing immediately and revised and accepted (or
-rarely refused) within hours or at most days.
-<b>There are no bitrotting branches.</b>
-<p>
-You are not confident enough with your skills? pcb-rnd is an optimal
-project for learning. If you start contributing, you get support. There
-are small and simple entry level tasks. Most of the tasks don't require
-any programming skills.
-<p>
-Sign up: mail to pcb-rnd (at) igor2.repo.hu .
-If you want to work on a feature not listed below, feel free to drop me
-a mail.
-<p>
-<table border=1 cellspacing=0 cellpadding=0>
-<tr><th> ID <th> skill required <th> description
-<tr><td> tutorial <td> geda user <td> tutorial projects
-<tr><td> windows <td> geda user <td> generic testing on windows
-<tr><td> mtest <td> geda user <td> systematic manual testing
-<tr><td> doc <td> geda user, html<td> write sections of user documentation
-<tr><td> logo <td> designer <td> the official pcb-rnd logo
-<tr><td> banner <td> designer <td> pcb-rnd banner for the homepage
-<tr><td> icons <td> designer <td> icons, other graphical elements for the GTK HID
-<tr><td> css <td> designer <td> CSS for the homepage (only design/style, no content).
-<tr><td> atest <td> C/beginner <td> program automated test cases
-</table>
-</body>
-</html>
diff --git a/doc-rnd/index.html b/doc-rnd/index.html
deleted file mode 100644
index 5361d48..0000000
--- a/doc-rnd/index.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - main </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<br>
-<!--content-->
-<table border=0 cellpadding=10> <tr>
-<td valign=top bgcolor=#f2f2f2>
- <h2> Summary </h2>
- <table border=0 cellpadding=20>
- <tr><th align=right valign=top bgcolor=#ccccff>
- <table border=0 width=100% cellpadding=0 cellspacing=0><tr><td align=left><img src="logo128.png"><th align=right>pcb-rnd</table>
- <td bgcolor=#ddddff>
- <b>is a flexible, modular Printed Circuit Board editor</b>
- <p><a href="motivation.html">historically</a> is a fork of <a href="http://pcb.geda-project.org">PCB</a>
- <p>is an informal part of the geda project
- <p>features a lot of small and large <a href="features/index.html">improvements and bugfixes</a>
-
-
- <tr><th align=right valign=top bgcolor=#ccccff> Version Control <td bgcolor=#ddddff> <a href="http://igor2.repo.hu/cgi-bin/minisvn.cgi?cmd=browse&repo=pcb-rnd"> svn://repo.hu/pcb-rnd/trunk </a>
- <tr><th align=right valign=top bgcolor=#ccccff> Download <td bgcolor=#ddddff> <a href="releases/"> source releases </a>
- <tr><th align=right valign=top bgcolor=#ccccff> Comments, feedback, patches <td bgcolor=#ddddff> <a href="irc.html"> live chat with the developer </a><br>or mail to: pcb-rnd (at) igor2.repo.hu<br>Mailing list: pcb-rnd (at) list.repo.hu (send a mail with subject: subscribe)
- <tr><th align=right valign=top bgcolor=#ccccff> Contribution and support <td bgcolor=#ddddff>
- How to <a href="contrib.html"> join or contribute </a>
- <br>We are looking for <a href="help.html"> help</a>.
- <br>Do you have a <a href="myfeature.html">feature request</a>?
-
- <tr><th align=right valign=top bgcolor=#ccccff> Key features <td bgcolor=#ddddff>
- editor for multilayer Printed Circuit Boards
- <br> <a href="features/gpmi.html"> scriptable </a> in 10+ different scripting languages
- <br> <a href="features/pcblib.html">parametric footprint</a> generation, <a href="features/fp_wget.html"> web footprints </a>
- <br> <a href="mods3/">modular code</a> with a flexible plugin system
- <br> fits well in a UNIXy workflow
- <br> supports CLI and server applications
- <br> active development, frequent releases
- <br> friendly and efficient developer and user community
- <br> <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> predictable development cycles </a>
-
- <tr><th align=right valign=top bgcolor=#ccccff> Suported platforms <td bgcolor=#ddddff>
- Linux desktop (various distributions, from source)
- <br> <a href="mac.txt"> Mac OS X </a>
- <br> <a href="https://aur.archlinux.org/packages/pcb-rnd-svn/"> Arch Linux (user package) </a>
-<!-- <br> <a href="windows.txt"> Windows </a> -->
- <br> <a href="UNIX.txt"> IRIX 5.3 </a>
- <br> (Likely: any 90's UNIX system with motif)
- <br> Screen resolution as small as 800x600
- <br> GUI options: motif/lesstif, gtk
- <br><table border=0 width=100%><tr><td align=right><img src="screenshot.jpg"></table>
-</table>
-
-<!-- spacer -->
- <td width=0>
-
-<!-- rnd -->
- <td width=20% bgcolor=#f2f2f2>
- <h2> What is -rnd? </h2>
- <br>
- <table border=0 cellspacing=10 cellpadding=0 bgcolor=#ccffcc>
- <tr><td><font size=+2><b>R</b>a<b>ND</b>om</font> <td>
- When it started, it used to be a <a href="motivation.html">random collection of small fixes and improvements.</a> We got much further than that by now.
- </table>
-
- <p>
-
- <table border=0 cellspacing=10 cellpadding=0 bgcolor=#ccffcc>
- <tr>
- <td><font size=+2><b>R</b>espo<b>N</b>sive <b>D</b>evelopers</font>
- <td> Developers try to respond on user needs, adding features that are actually needed by current users.
- </table>
-
- <p>
-
- <table border=0 cellspacing=10 cellpadding=0 bgcolor=#ccffcc>
- <tr><td>
- <font size=+2><b>R</b>esponse <b>N</b>ot <b>D</b>elayed</font>
- <td> Bugrepots, user requests and patches submitted are answered ASAP. There are no patches bitrotting for months. There are no forgotten bugreports.
- </table>
-
- <p>
-
- <table border=0 cellspacing=10 cellpadding=0 bgcolor=#ccffcc width=400>
- <tr>
- <td><font size=+2><b>R</b>esearch <br><b>&</b> <br><b>D</b>evelopment</font>
- <br>
- <br>
- <b>R</b>�z�s, <br><b>N</b>eh�z <br><b>D</b>�nt�sek <br><small>(Brave, hard decisions)</small>
- <td> There is a constant experimentation with new features and directions. We are willing to try strange/unusual ideas without risking the stability of the daily workflow.
- </table>
-
- <p>
-
- <table border=0 cellspacing=10 cellpadding=0 bgcolor=#ccffcc>
- <tr>
- <td><font size=+2><b>R</b>ants <br><b>N</b>ow <br><b>D</b>issipating</font>
- <td> Instead of talking and ranting a lot about what could work better, we just sit down and make it work better.
- </table>
-
- <p>
-
- <table border=0 cellspacing=10 cellpadding=0 bgcolor=#ccffcc>
- <tr>
- <td><font size=+2><b>R</b>ather <br><b>N</b>icely <br><b>D</b>ecentralized</font>
- <td> <a href="mods3/"> Slim, generic core</a>; most of the code organized in replacable plugins. Most plugins depend only on the core.
- </table>
-
-</body>
-</html>
diff --git a/doc-rnd/irc.html b/doc-rnd/irc.html
deleted file mode 100644
index 176a499..0000000
--- a/doc-rnd/irc.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - IRC </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<H1> Live support via IRC (chat) </H1>
-<br>Irc <b>server</b>: repo.hu <b>Port</b>: 6667 <b>Channel</b>: #pcb-rnd
-<br>
-<p>I'm normally online as Igor2 between 5:00 CET and 19:00 CET; on Sunday there's an AFK-window between 11:00 CET and 16:00 CET. If I don't answer in a few minutes I'm probably away doing something, please be patient; say hi before you type your long question so you see if I'm available.
-<hr>
-<p>
-Below is an iframe of <a href="https://kiwiirc.com/client/repo.hu/?nick=pcbuser|?#pcb-rnd">
-kiwiirc </a> irc client configured with the above settings. If it doesn't
-work, please visit their <a href="https://kiwiirc.com"> page </a> and
-try to manually configure it, it's just 4 fields.
-<p>
-Using the web client: you may change your nickname; there's no password
-or registration or channel key or ssl of any form. Your real IP won't be
-shown on the IRC network (check kiwiirc's page about thier privacy
-policy).
-<p>
-Connecting with the web client may take some time, give it a minute.
-<hr>
-
-<iframe src="https://kiwiirc.com/client/repo.hu/?nick=pcbuser|?#pcb-rnd" style="border:0; width:100%; height:450px;"></iframe>
-
-</html>
-</body>
diff --git a/doc-rnd/keys.html b/doc-rnd/keys.html
deleted file mode 100644
index e9f27c9..0000000
--- a/doc-rnd/keys.html
+++ /dev/null
@@ -1,684 +0,0 @@
-<html><body>
-<h1> Key to action bindings </h1>
-<table border=1 cellspacing=0>
-<tr><th> key <th>pcb-menu-lesstif.lht <th>pcb-menu-gtk.lht
-<tr bgcolor=#DDFFFF>
- <th align=left>.
- <td> <I>'All-direction' lines</I><br>conf(toggle, editor/all_direction_lines, design)
- <td> <I>'All-direction' lines</I><br>conf(toggle, editor/all_direction_lines, design)
-<tr bgcolor=#FFFFFF>
- <th align=left>/
- <td> <I>Cycle Clip</I><br>Display(CycleClip)
- <td> <I>Cycle Clip</I><br>Display(CycleClip)
-<tr bgcolor=#DDFFFF>
- <th align=left>0
- <td> <I>Select Layer 10</I><br>SelectLayer(10)
- <td> <I>Select Layer 10</I><br>SelectLayer(10)
-<tr bgcolor=#FFFFFF>
- <th align=left>0-alt
- <td> <I>Select Layer 20</I><br>SelectLayer(20)
- <td> <I>Select Layer 20</I><br>SelectLayer(20)
-<tr bgcolor=#DDFFFF>
- <th align=left>0-alt-ctrl
- <td> <I>Toggle Layer 20</I><br>ToggleView(20)
- <td> <I>Toggle Layer 20</I><br>ToggleView(20)
-<tr bgcolor=#FFFFFF>
- <th align=left>0-ctrl
- <td> <I>Toggle Layer 10</I><br>ToggleView(10)
- <td> <I>Toggle Layer 10</I><br>ToggleView(10)
-<tr bgcolor=#DDFFFF>
- <th align=left>1
- <td> <I>Select Layer 1</I><br>SelectLayer(1)
- <td> <I>Select Layer 1</I><br>SelectLayer(1)
-<tr bgcolor=#FFFFFF>
- <th align=left>1-alt
- <td> <I>Select Layer 11</I><br>SelectLayer(11)
- <td> <I>Select Layer 11</I><br>SelectLayer(11)
-<tr bgcolor=#DDFFFF>
- <th align=left>1-alt-ctrl
- <td> <I>Toggle Layer 11</I><br>ToggleView(11)
- <td> <I>Toggle Layer 11</I><br>ToggleView(11)
-<tr bgcolor=#FFFFFF>
- <th align=left>1-ctrl
- <td> <I>Toggle Layer 1</I><br>ToggleView(1)
- <td> <I>Toggle Layer 1</I><br>ToggleView(1)
-<tr bgcolor=#DDFFFF>
- <th align=left>1-shift
- <td> <I>#1</I><br>PasteBuffer(1)
- <td> <I>Select Buffer #1</I><br>PasteBuffer(1)
-<tr bgcolor=#FFFFFF>
- <th align=left>2
- <td> <I>Select Layer 2</I><br>SelectLayer(2)
- <td> <I>Select Layer 2</I><br>SelectLayer(2)
-<tr bgcolor=#DDFFFF>
- <th align=left>2-alt
- <td> <I>Select Layer 12</I><br>SelectLayer(12)
- <td> <I>Select Layer 12</I><br>SelectLayer(12)
-<tr bgcolor=#FFFFFF>
- <th align=left>2-alt-ctrl
- <td> <I>Toggle Layer 12</I><br>ToggleView(12)
- <td> <I>Toggle Layer 12</I><br>ToggleView(12)
-<tr bgcolor=#DDFFFF>
- <th align=left>2-ctrl
- <td> <I>Toggle Layer 2</I><br>ToggleView(2)
- <td> <I>Toggle Layer 2</I><br>ToggleView(2)
-<tr bgcolor=#FFFFFF>
- <th align=left>2-shift
- <td> <I>#2</I><br>PasteBuffer(2)
- <td> <I>Select Buffer #2</I><br>PasteBuffer(2)
-<tr bgcolor=#DDFFFF>
- <th align=left>3
- <td> <I>Select Layer 3</I><br>SelectLayer(3)
- <td> <I>Select Layer 3</I><br>SelectLayer(3)
-<tr bgcolor=#FFFFFF>
- <th align=left>3-alt
- <td> <I>Select Layer 13</I><br>SelectLayer(13)
- <td> <I>Select Layer 13</I><br>SelectLayer(13)
-<tr bgcolor=#DDFFFF>
- <th align=left>3-alt-ctrl
- <td> <I>Toggle Layer 13</I><br>ToggleView(13)
- <td> <I>Toggle Layer 13</I><br>ToggleView(13)
-<tr bgcolor=#FFFFFF>
- <th align=left>3-ctrl
- <td> <I>Toggle Layer 3</I><br>ToggleView(3)
- <td> <I>Toggle Layer 3</I><br>ToggleView(3)
-<tr bgcolor=#DDFFFF>
- <th align=left>3-shift
- <td> <I>#3</I><br>PasteBuffer(3)
- <td> <I>Select Buffer #3</I><br>PasteBuffer(3)
-<tr bgcolor=#FFFFFF>
- <th align=left>4
- <td> <I>Select Layer 4</I><br>SelectLayer(4)
- <td> <I>Select Layer 4</I><br>SelectLayer(4)
-<tr bgcolor=#DDFFFF>
- <th align=left>4-alt
- <td> <I>Select Layer 14</I><br>SelectLayer(14)
- <td> <I>Select Layer 14</I><br>SelectLayer(14)
-<tr bgcolor=#FFFFFF>
- <th align=left>4-alt-ctrl
- <td> <I>Toggle Layer 14</I><br>ToggleView(14)
- <td> <I>Toggle Layer 14</I><br>ToggleView(14)
-<tr bgcolor=#DDFFFF>
- <th align=left>4-ctrl
- <td> <I>Toggle Layer 4</I><br>ToggleView(4)
- <td> <I>Toggle Layer 4</I><br>ToggleView(4)
-<tr bgcolor=#FFFFFF>
- <th align=left>4-shift
- <td> <I>#4</I><br>PasteBuffer(4)
- <td> <I>Select Buffer #4</I><br>PasteBuffer(4)
-<tr bgcolor=#DDFFFF>
- <th align=left>5
- <td> <I>Select Layer 5</I><br>SelectLayer(5)
- <td> <I>Select Layer 5</I><br>SelectLayer(5)
-<tr bgcolor=#FFFFFF>
- <th align=left>5-alt
- <td> <I>Select Layer 15</I><br>SelectLayer(15)
- <td> <I>Select Layer 15</I><br>SelectLayer(15)
-<tr bgcolor=#DDFFFF>
- <th align=left>5-alt-ctrl
- <td> <I>Toggle Layer 15</I><br>ToggleView(15)
- <td> <I>Toggle Layer 15</I><br>ToggleView(15)
-<tr bgcolor=#FFFFFF>
- <th align=left>5-ctrl
- <td> <I>Toggle Layer 5</I><br>ToggleView(5)
- <td> <I>Toggle Layer 5</I><br>ToggleView(5)
-<tr bgcolor=#DDFFFF>
- <th align=left>5-shift
- <td> <I>#5</I><br>PasteBuffer(5)
- <td> <I>Select Buffer #5</I><br>PasteBuffer(5)
-<tr bgcolor=#FFFFFF>
- <th align=left>6
- <td> <I>Select Layer 6</I><br>SelectLayer(6)
- <td> <I>Select Layer 6</I><br>SelectLayer(6)
-<tr bgcolor=#DDFFFF>
- <th align=left>6-alt
- <td> <I>Select Layer 16</I><br>SelectLayer(16)
- <td> <I>Select Layer 16</I><br>SelectLayer(16)
-<tr bgcolor=#FFFFFF>
- <th align=left>6-alt-ctrl
- <td> <I>Toggle Layer 16</I><br>ToggleView(16)
- <td> <I>Toggle Layer 16</I><br>ToggleView(16)
-<tr bgcolor=#DDFFFF>
- <th align=left>6-ctrl
- <td> <I>Toggle Layer 6</I><br>ToggleView(6)
- <td> <I>Toggle Layer 6</I><br>ToggleView(6)
-<tr bgcolor=#FFFFFF>
- <th align=left>7
- <td> <I>Select Layer 7</I><br>SelectLayer(7)
- <td> <I>Select Layer 7</I><br>SelectLayer(7)
-<tr bgcolor=#DDFFFF>
- <th align=left>7-alt
- <td> <I>Select Layer 17</I><br>SelectLayer(17)
- <td> <I>Select Layer 17</I><br>SelectLayer(17)
-<tr bgcolor=#FFFFFF>
- <th align=left>7-alt-ctrl
- <td> <I>Toggle Layer 17</I><br>ToggleView(17)
- <td> <I>Toggle Layer 17</I><br>ToggleView(17)
-<tr bgcolor=#DDFFFF>
- <th align=left>7-ctrl
- <td> <I>Toggle Layer 7</I><br>ToggleView(7)
- <td> <I>Toggle Layer 7</I><br>ToggleView(7)
-<tr bgcolor=#FFFFFF>
- <th align=left>8
- <td> <I>Select Layer 8</I><br>SelectLayer(8)
- <td> <I>Select Layer 8</I><br>SelectLayer(8)
-<tr bgcolor=#DDFFFF>
- <th align=left>8-alt
- <td> <I>Select Layer 18</I><br>SelectLayer(18)
- <td> <I>Select Layer 18</I><br>SelectLayer(18)
-<tr bgcolor=#FFFFFF>
- <th align=left>8-alt-ctrl
- <td> <I>Toggle Layer 18</I><br>ToggleView(18)
- <td> <I>Toggle Layer 18</I><br>ToggleView(18)
-<tr bgcolor=#DDFFFF>
- <th align=left>8-ctrl
- <td> <I>Toggle Layer 8</I><br>ToggleView(8)
- <td> <I>Toggle Layer 8</I><br>ToggleView(8)
-<tr bgcolor=#FFFFFF>
- <th align=left>9
- <td> <I>Select Layer 9</I><br>SelectLayer(9)
- <td> <I>Select Layer 9</I><br>SelectLayer(9)
-<tr bgcolor=#DDFFFF>
- <th align=left>9-alt
- <td> <I>Select Layer 19</I><br>SelectLayer(19)
- <td> <I>Select Layer 19</I><br>SelectLayer(19)
-<tr bgcolor=#FFFFFF>
- <th align=left>9-alt-ctrl
- <td> <I>Toggle Layer 19</I><br>ToggleView(19)
- <td> <I>Toggle Layer 19</I><br>ToggleView(19)
-<tr bgcolor=#DDFFFF>
- <th align=left>9-ctrl
- <td> <I>Toggle Layer 9</I><br>ToggleView(9)
- <td> <I>Toggle Layer 9</I><br>ToggleView(9)
-<tr bgcolor=#FFFFFF>
- <th align=left>:
- <td> <I>Command</I><br>Command()
- <td> <I>Command Entry</I><br>Command()
-<tr bgcolor=#DDFFFF>
- <th align=left>=
- <td> <I>SimpleOpts</I><br>djopt(simple)
- <td> <I>Simple optimization</I><br>djopt(simple)
-<tr bgcolor=#FFFFFF>
- <th align=left>=-shift
- <td> <I>Auto-Optimize</I><br>djopt(auto)
- <td> <I>Auto-Optimize</I><br>djopt(auto)
-<tr bgcolor=#DDFFFF>
- <th align=left>[
- <td> <I>Temp Arrow ON</I><br>Mode(Save); Mode(Arrow); Mode(Notify)
- <td> <I>Temp Arrow ON</I><br>Mode(Save); Mode(Arrow); Mode(Notify)
-<tr bgcolor=#FFFFFF>
- <th align=left>\
- <td>
- <td> <I>Full screen</I><br>fullscreen(toggle)
-<tr bgcolor=#DDFFFF>
- <th align=left>]
- <td> <I>Temp Arrow OFF</I><br>Mode(Release); Mode(Restore)
- <td> <I>Temp Arrow OFF</I><br>Mode(Release); Mode(Restore)
-<tr bgcolor=#FFFFFF>
- <th align=left>`
- <td> <I>Zoom Toggle</I><br>Zoom(Toggle)
- <td>
-<tr bgcolor=#DDFFFF>
- <th align=left>a
- <td> <I>Set Same</I><br>SetSame()
- <td> <I>Set Same</I><br>SetSame()
-<tr bgcolor=#FFFFFF>
- <th align=left>a-alt
- <td> <I>Select all visible</I><br>Select(All)
- <td> <I>Select all visible</I><br>Select(All)
-<tr bgcolor=#DDFFFF>
- <th align=left>a-alt-shift
- <td> <I>Unselect all</I><br>Unselect(All)
- <td> <I>Unselect all</I><br>Unselect(All)
-<tr bgcolor=#FFFFFF>
- <th align=left>b
- <td> <I>Flip Object</I><br>Flip(Object)
- <td> <I>Flip Object</I><br>Flip(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>b-alt-ctrl
- <td>
- <td> <I>netlist patch for back annotation</I><br>SavePatch()
-<tr bgcolor=#FFFFFF>
- <th align=left>b-shift
- <td> <I>Move selected elements to other side</I><br>Flip(SelectedElements)
- <td> <I>Move selected elements to other side</I><br>Flip(SelectedElements)
-<tr bgcolor=#DDFFFF>
- <th align=left>backspace
- <td> <I>Remove</I><br>Delete(Selected)
- <td> <I>Remove Selected</I><br>RemoveSelected()
-<tr bgcolor=#FFFFFF>
- <th align=left>backspace-shift
- <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
- <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
-<tr bgcolor=#DDFFFF>
- <th align=left>c
- <td> <I>Center cursor</I><br>Center()
- <td> <I>Center cursor</I><br>Center()
-<tr bgcolor=#FFFFFF>
- <th align=left>c-ctrl
- <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Mode(PasteBuffer)
- <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
-<tr bgcolor=#DDFFFF>
- <th align=left>d
- <td> <I>Pins/Via show Name/Number</I><br>Display(PinOrPadName)
- <td> <I>Pins/Via show Name/Number</I><br>Display(PinOrPadName)
-<tr bgcolor=#FFFFFF>
- <th align=left>d-shift
- <td> <I>Pinout</I><br>Display(Pinout)
-<br> <b>Error: key prefix collision</b>
- <td> <I>Pinout</I><br>Display(Pinout)
-<tr bgcolor=#DDFFFF>
- <th align=left>delete
- <td> <I>Delete selected objects</I><br>Delete(Selected)
- <td> <I>Remove</I><br>Mode(Save); Mode(Remove); Mode(Notify); Mode(Restore)
-<tr bgcolor=#FFFFFF>
- <th align=left>delete-shift
- <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
- <td> <I>Remove selected objects</I><br>RemoveSelected()
-<tr bgcolor=#DDFFFF>
- <th align=left>down
- <td> <I>Step Down</I><br>Cursor(Warp,0,-1,grid)
- <td> <I>Step Down</I><br>Cursor(Warp,0,-1,grid)
-<tr bgcolor=#FFFFFF>
- <th align=left>down-shift
- <td> <I>Step +Down</I><br>Cursor(Pan,0,-50,view)
- <td> <I>Step +Down</I><br>Cursor(Pan,0,-50,view)
-<tr bgcolor=#DDFFFF>
- <th align=left>e
- <td> <I>Erase rats-nest</I><br>DeleteRats(AllRats)
- <td> <I>Erase rats nest</I><br>DeleteRats(AllRats)
-<tr bgcolor=#FFFFFF>
- <th align=left>e-ctrl
- <td>
- <td> <I>Edit properties of selected...</I><br>PropEdit(Selected)
-<tr bgcolor=#DDFFFF>
- <th align=left>e-shift
- <td> <I>Erase selected rats</I><br>DeleteRats(SelectedRats)
- <td> <I>Erase selected rats</I><br>DeleteRats(SelectedRats)
-<tr bgcolor=#FFFFFF>
- <th align=left>enter
- <td> <I>"Click"</I><br>Mode(Notify); Mode(Release)
- <td> <I>Click</I><br>Mode(Notify); Mode(Release)
-<tr bgcolor=#DDFFFF>
- <th align=left>escape
- <td> <I>Cancel</I><br>Mode(Cancel)
- <td> <I>Cancel</I><br>Mode(Escape)
-<tr bgcolor=#FFFFFF>
- <th align=left>f
- <td> <I>Find Connections</I><br>Connection(Reset); Connection(Find)
- <td> <I>Find Connections</I><br>Connection(Reset); Connection(Find)
-<tr bgcolor=#DDFFFF>
- <th align=left>f-alt-shift
- <td>
- <td> <I>Replace footprint</I><br>ReplaceFootprint()
-<tr bgcolor=#FFFFFF>
- <th align=left>f-ctrl
- <td> <I>Lookup connection to object</I><br>GetXY(Click on the object); Connection(Find)
- <td> <I>Lookup connection to object</I><br>GetXY(Click on the object); Connection(Find)
-<tr bgcolor=#DDFFFF>
- <th align=left>f-shift
- <td> <I>Reset all connections</I><br>Connection(Reset); Display(Redraw)
- <td> <I>Reset all connections</I><br>Connection(Reset); Display(Redraw)
-<tr bgcolor=#FFFFFF>
- <th align=left>f1
- <td> <I>Via</I><br>Mode(Via)
- <td> <I>Via</I><br>Mode(Via)
-<tr bgcolor=#DDFFFF>
- <th align=left>f10
- <td> <I>Thermal</I><br>Mode(Thermal)
- <td> <I>Thermal</I><br>Mode(Thermal)
-<tr bgcolor=#FFFFFF>
- <th align=left>f11
- <td> <I>Arrow</I><br>Mode(Arrow)
- <td> <I>Arrow</I><br>Mode(Arrow)
-<tr bgcolor=#DDFFFF>
- <th align=left>f12
- <td> <I>Lock</I><br>Mode(Lock)
- <td> <I>Lock</I><br>Mode(Lock)
-<tr bgcolor=#FFFFFF>
- <th align=left>f2
- <td> <I>Line</I><br>Mode(Line)
- <td> <I>Line</I><br>Mode(Line)
-<tr bgcolor=#DDFFFF>
- <th align=left>f3
- <td> <I>Arc</I><br>Mode(Arc)
- <td> <I>Arc</I><br>Mode(Arc)
-<tr bgcolor=#FFFFFF>
- <th align=left>f4
- <td> <I>Text</I><br>Mode(Text)
- <td> <I>Text</I><br>Mode(Text)
-<tr bgcolor=#DDFFFF>
- <th align=left>f5
- <td> <I>Rectangle</I><br>Mode(Rectangle)
- <td> <I>Rectangle</I><br>Mode(Rectangle)
-<tr bgcolor=#FFFFFF>
- <th align=left>f6
- <td> <I>Polygon</I><br>Mode(Polygon)
- <td> <I>Polygon</I><br>Mode(Polygon)
-<tr bgcolor=#DDFFFF>
- <th align=left>f7
- <td> <I>Buffer</I><br>Mode(PasteBuffer)
- <td> <I>Buffer</I><br>Mode(PasteBuffer)
-<tr bgcolor=#FFFFFF>
- <th align=left>f7-shift
- <td> <I>Rotate buffer 90 deg CCW</I><br>Mode(PasteBuffer); PasteBuffer(Rotate,1)
- <td> <I>Rotate buffer 90 deg CCW</I><br>Mode(PasteBuffer); PasteBuffer(Rotate,1)
-<tr bgcolor=#DDFFFF>
- <th align=left>f8
- <td> <I>Remove</I><br>Mode(Remove)
- <td> <I>Remove</I><br>Mode(Remove)
-<tr bgcolor=#FFFFFF>
- <th align=left>f9
- <td> <I>Rotate</I><br>Mode(Rotate)
- <td> <I>Rotate</I><br>Mode(Rotate)
-<tr bgcolor=#DDFFFF>
- <th align=left>g
- <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
- <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>g-ctrl
- <td> <I>Grid +0.05mm</I><br>SetValue(Grid,+0.05,mm)
- <td> <I>Grid +0.05mm</I><br>SetValue(Grid,+0.05,mm)
-<tr bgcolor=#DDFFFF>
- <th align=left>g-ctrl-shift
- <td> <I>Grid -0.05mm</I><br>SetValue(Grid,-0.05,mm)
- <td> <I>Grid -0.05mm</I><br>SetValue(Grid,-0.05,mm)
-<tr bgcolor=#FFFFFF>
- <th align=left>g-shift
- <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
- <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>h
- <td> <I>ToggleHideName Object</I><br>ToggleHideName(Object)
- <td> <I>ToggleHideName Object</I><br>ToggleHideName(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>h-ctrl
- <td> <I>ChangeHole Object</I><br>ChangeHole(Object)
- <td> <I>ChangeHole Object</I><br>ChangeHole(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>h-shift
- <td> <I>ToggleHideName SelectedElement</I><br>ToggleHideName(SelectedElements)
- <td> <I>ToggleHideName SelectedElement</I><br>ToggleHideName(SelectedElements)
-<tr bgcolor=#FFFFFF>
- <th align=left>i
- <td>
- <td> <I>Library</I><br>DoWindows(Library)
-<tr bgcolor=#DDFFFF>
- <th align=left>insert
- <td> <I>Insert Point</I><br>Mode(InsertPoint)
- <td> <I>Insert Point</I><br>Mode(InsertPoint)
-<tr bgcolor=#FFFFFF>
- <th align=left>j
- <td> <I>ChangeJoin Object</I><br>ChangeJoin(Object)
- <td> <I>ChangeJoin Object</I><br>ChangeJoin(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>j-shift
- <td> <I>ChangeJoin SelectedObject</I><br>ChangeJoin(SelectedObjects)
- <td> <I>ChangeJoin SelectedObject</I><br>ChangeJoin(SelectedObjects)
-<tr bgcolor=#FFFFFF>
- <th align=left>k
- <td> <I>Clear Object +2 mil</I><br>ChangeClearSize(Object,+2,mil)
- <td> <I>Clear Object +2 mil</I><br>ChangeClearSize(Object,+2,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>k-ctrl
- <td> <I>Clear Selected +2 mil</I><br>ChangeClearSize(SelectedObjects,+2,mil)
- <td> <I>Clear Selected +2 mil</I><br>ChangeClearSize(SelectedObjects,+2,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>k-ctrl-shift
- <td> <I>Clear Selected -2 mil</I><br>ChangeClearSize(SelectedObjects,-2,mil)
- <td> <I>Clear Selected -2 mil</I><br>ChangeClearSize(SelectedObjects,-2,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>k-shift
- <td> <I>Clear Object -2 mil</I><br>ChangeClearSize(Object,-2,mil)
- <td> <I>Clear Object -2 mil</I><br>ChangeClearSize(Object,-2,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>l
- <td> <I>Line Tool size +5 mil</I><br>SetValue(LineSize,+5,mil)
- <td> <I>Line Tool size +5 mil</I><br>SetValue(LineSize,+5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>l-shift
- <td> <I>Line Tool size -5 mil</I><br>SetValue(LineSize,-5,mil)
- <td> <I>Line Tool size -5 mil</I><br>SetValue(LineSize,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>left
- <td> <I>Step Left</I><br>Cursor(Warp,-1,0,grid)
- <td> <I>Step Left</I><br>Cursor(Warp,-1,0,grid)
-<tr bgcolor=#DDFFFF>
- <th align=left>left-shift
- <td> <I>Step +Left</I><br>Cursor(Pan,-50,0,view)
- <td> <I>Step +Left</I><br>Cursor(Pan,-50,0,view)
-<tr bgcolor=#FFFFFF>
- <th align=left>m
- <td> <I>Move Object to current layer</I><br>MoveToCurrentLayer(Object)
- <td> <I>Move Object to current layer</I><br>MoveToCurrentLayer(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>m-ctrl
- <td> <I>MarkCrosshair</I><br>MarkCrosshair()
- <td> <I>MarkCrosshair</I><br>MarkCrosshair()
-<tr bgcolor=#FFFFFF>
- <th align=left>m-shift
- <td> <I>Move selected to current layer</I><br>MoveToCurrentLayer(Selected)
- <td> <I>Move selected to current layer</I><br>MoveToCurrentLayer(Selected)
-<tr bgcolor=#DDFFFF>
- <th align=left>n
- <td> <I>Change text on layout</I><br>ChangeName(Object)
- <td> <I>text on layout</I><br>ChangeName(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>n-alt
- <td>
- <td> <I>Nonetlist</I><br>ChangeNonetlist(Element)
-<tr bgcolor=#DDFFFF>
- <th align=left>n-ctrl
- <td> <I>Start new layout</I><br>New()
- <td> <I>Start New Layout</I><br>New()
-<tr bgcolor=#FFFFFF>
- <th align=left>n-ctrl-shift
- <td> <I>Change text on layout</I><br>ChangeName(Object, Number)
- <td> <I>pin on layout</I><br>ChangeName(Object, Number)
-<tr bgcolor=#DDFFFF>
- <th align=left>n-shift
- <td> <I>Select shortest rat</I><br>AddRats(Close)
- <td> <I>Select shortest rat</I><br>AddRats(Close)
-<tr bgcolor=#FFFFFF>
- <th align=left>o
- <td> <I>Optimize rats-nest</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)
- <td> <I>Optimize rats nest</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)
-<tr bgcolor=#DDFFFF>
- <th align=left>o-ctrl
- <td> <I>ChangeOctagon Object</I><br>ChangeOctagon(Object)
- <td> <I>ChangeOctagon Object</I><br>ChangeOctagon(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>o-shift
- <td> <I>AddRats to selected pins</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)
- <td> <I>AddRats to selected pins</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)
-<tr bgcolor=#DDFFFF>
- <th align=left>p
- <td> <I>Polygon PreviousPoint</I><br>Polygon(PreviousPoint)
- <td> <I>Polygon PreviousPoint</I><br>Polygon(PreviousPoint)
-<tr bgcolor=#FFFFFF>
- <th align=left>p-alt
- <td> <I>Manage plugins...</I><br>ManagePlugins()
- <td> <I>Manage plugins...</I><br>ManagePlugins()
-<tr bgcolor=#DDFFFF>
- <th align=left>p-ctrl
- <td> <I>Auto-place selected elements</I><br>AutoPlaceSelected()
- <td> <I>Auto-place selected elements</I><br>AutoPlaceSelected()
-<tr bgcolor=#FFFFFF>
- <th align=left>p-ctrl-shift
- <td> <I>Thin draw poly</I><br>conf(toggle, editor/thin_draw_poly, design)
- <td> <I>Thin draw poly</I><br>conf(toggle, editor/thin_draw_poly, design)
-<tr bgcolor=#DDFFFF>
- <th align=left>p-shift
- <td> <I>Polygon Close</I><br>Polygon(Close)
- <td> <I>Polygon Close</I><br>Polygon(Close)
-<tr bgcolor=#FFFFFF>
- <th align=left>q
- <td> <I>ChangeSquare Object</I><br>ChangeSquare(Object)
- <td> <I>ChangeSquare Object</I><br>ChangeSquare(ToggleObject)
-<tr bgcolor=#DDFFFF>
- <th align=left>q-ctrl
- <td> <I>Quit Program</I><br>Quit()
- <td> <I>Quit Program</I><br>Quit()
-<tr bgcolor=#FFFFFF>
- <th align=left>r
- <td> <I>Report net length</I><br>Report(NetLength)
- <td>
-<tr bgcolor=#DDFFFF>
- <th align=left>r-alt
- <td> <I>Auto-route selected rats</I><br>AutoRoute(SelectedRats)
- <td> <I>Auto-route selected rats</I><br>AutoRoute(SelectedRats)
-<tr bgcolor=#FFFFFF>
- <th align=left>r-ctrl
- <td> <I>Generate object report</I><br>ReportObject()
- <td> <I>Generate object report</I><br>ReportObject()
-<tr bgcolor=#DDFFFF>
- <th align=left>r-shift
- <td> <I>Redo last undone operation</I><br>Redo()
- <td> <I>Redo last undone operation</I><br>Redo()
-<tr bgcolor=#FFFFFF>
- <th align=left>right
- <td> <I>Step Right</I><br>Cursor(Warp,1,0,grid)
- <td> <I>Step Right</I><br>Cursor(Warp,1,0,grid)
-<tr bgcolor=#DDFFFF>
- <th align=left>right-shift
- <td> <I>Step +Right</I><br>Cursor(Pan,50,0,view)
- <td> <I>Step +Right</I><br>Cursor(Pan,50,0,view)
-<tr bgcolor=#FFFFFF>
- <th align=left>s
- <td> <I>ChangeSize +5 mil</I><br>ChangeSize(Object,+5,mil)
- <td> <I>ChangeSize +5 mil</I><br>ChangeSize(Object,+5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>s-alt
- <td> <I>ChangeDrill +5 mil</I><br>ChangeDrillSize(Object,+5,mil)
- <td> <I>ChangeDrill +5 mil</I><br>ChangeDrillSize(Object,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>s-alt-shift
- <td> <I>ChangeDrill -5 mil</I><br>ChangeDrillSize(Object,-5,mil)
- <td> <I>ChangeDrill -5 mil</I><br>ChangeDrillSize(Object,-5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>s-ctrl
- <td> <I>Save layout</I><br>Save(Layout)
- <td> <I>Save Layout</I><br>Save(Layout)
-<tr bgcolor=#FFFFFF>
- <th align=left>s-ctrl-shift
- <td> <I>Save layout as...</I><br>Save(LayoutAs)
- <td> <I>Save Layout As...</I><br>Save(LayoutAs)
-<tr bgcolor=#DDFFFF>
- <th align=left>s-shift
- <td> <I>ChangeSize -5 mil</I><br>ChangeSize(Object,-5,mil)
- <td> <I>ChangeSize -5 mil</I><br>ChangeSize(Object,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>space
- <td> <I>Arrow</I><br>Mode(Arrow)
- <td> <I>Arrow Mode</I><br>Mode(Arrow)
-<tr bgcolor=#DDFFFF>
- <th align=left>t
- <td> <I>Text Tool scale +10 mil</I><br>SetValue(TextScale,+10,mil)
- <td> <I>Text Tool scale +10 mil</I><br>SetValue(TextScale,+10,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>t-shift
- <td> <I>Text Tool scale -10 mil</I><br>SetValue(TextScale,-10,mil)
- <td> <I>Text Tool scale -10 mil</I><br>SetValue(TextScale,-10,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>tab
- <td> <I>Flip up/down</I><br>SwapSides(V)
- <td> <I>Flip up/down</I><br>SwapSides(V)
-<tr bgcolor=#FFFFFF>
- <th align=left>tab-ctrl
- <td> <I>Spin 180�</I><br>SwapSides(R)
- <td> <I>Spin 180 degrees</I><br>SwapSides(R)
-<tr bgcolor=#DDFFFF>
- <th align=left>tab-ctrl-shift
- <td> <I>Swap Sides</I><br>SwapSides()
- <td> <I>Swap Sides</I><br>SwapSides()
-<tr bgcolor=#FFFFFF>
- <th align=left>tab-shift
- <td> <I>Flip left/right</I><br>SwapSides(H)
- <td> <I>Flip left/right</I><br>SwapSides(H)
-<tr bgcolor=#DDFFFF>
- <th align=left>u
- <td> <I>Undo last operation</I><br>Undo()
- <td> <I>Undo last operation</I><br>Undo()
-<tr bgcolor=#FFFFFF>
- <th align=left>u-ctrl-shift
- <td> <I>Clear undo-buffer</I><br>Undo(ClearList)
- <td> <I>Clear undo-buffer</I><br>Undo(ClearList)
-<tr bgcolor=#DDFFFF>
- <th align=left>up
- <td> <I>Step Up</I><br>Cursor(Warp,0,1,grid)
- <td> <I>Step Up</I><br>Cursor(Warp,0,1,grid)
-<tr bgcolor=#FFFFFF>
- <th align=left>up-shift
- <td> <I>Step +Up</I><br>Cursor(Pan,0,50,view)
- <td> <I>Step +Up</I><br>Cursor(Pan,0,50,view)
-<tr bgcolor=#DDFFFF>
- <th align=left>v
- <td> <I>Zoom Max</I><br>Zoom()
- <td> <I>Zoom Max</I><br>Zoom()
-<tr bgcolor=#FFFFFF>
- <th align=left>v-alt
- <td> <I>Via Tool drill +5 mil</I><br>SetValue(ViaDrillingHole,+5,mil)
- <td> <I>Via Tool drill +5 mil</I><br>SetValue(ViaDrillingHole,+5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>v-alt-shift
- <td> <I>Via Tool drill -5 mil</I><br>SetValue(ViaDrillingHole,-5,mil)
- <td> <I>Via Tool drill -5 mil</I><br>SetValue(ViaDrillingHole,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>v-ctrl
- <td> <I>Paste buffer to layout</I><br>Mode(PasteBuffer)
- <td> <I>Paste buffer to layout</I><br>Mode(PasteBuffer)
-<tr bgcolor=#DDFFFF>
- <th align=left>v-ctrl-shift
- <td> <I>Via Tool size -5 mil</I><br>SetValue(ViaSize,-5,mil)
- <td> <I>Via Tool size -5 mil</I><br>SetValue(ViaSize,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>v-shift
- <td> <I>Via Tool size +5 mil</I><br>SetValue(ViaSize,+5,mil)
- <td> <I>Via Tool size +5 mil</I><br>SetValue(ViaSize,+5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>w
- <td> <I>Add All Rats</I><br>AddRats(AllRats)
- <td> <I>Add All Rats</I><br>AddRats(AllRats)
-<tr bgcolor=#FFFFFF>
- <th align=left>w-shift
- <td> <I>AddRats Selected</I><br>AddRats(SelectedRats)
- <td> <I>AddRats Selected</I><br>AddRats(SelectedRats)
-<tr bgcolor=#DDFFFF>
- <th align=left>x
- <td>
- <td> <I>Cycle object being dragged</I><br>CycleDrag()
-<tr bgcolor=#FFFFFF>
- <th align=left>x-ctrl
- <td> <I>Cut selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
- <td> <I>Cut selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
-<tr bgcolor=#DDFFFF>
- <th align=left>x-shift
- <td>
- <td> <I>Swap nets on two selected pins</I><br>net(swap)
-<tr bgcolor=#FFFFFF>
- <th align=left>y
- <td> <I>Puller</I><br>Puller()
- <td> <I>Puller</I><br>Puller()
-<tr bgcolor=#DDFFFF>
- <th align=left>y-shift
- <td> <I>ChangeSizes to Route style</I><br>ChangeSizes(Object,style,mil)
- <td> <I>ChangeSizes to Route style</I><br>ChangeSizes(Object,style,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>z
- <td> <I>Zoom In 20%</I><br>Zoom(-1.2)
- <td> <I>Zoom In 20%</I><br>Zoom(-1.2)
-<tr bgcolor=#DDFFFF>
- <th align=left>z-alt
- <td> <I>Undo</I><br>Undo()
- <td>
-<tr bgcolor=#FFFFFF>
- <th align=left>z-shift
- <td> <I>Zoom Out 20%</I><br>Zoom(+1.2)
- <td> <I>Zoom Out 20%</I><br>Zoom(+1.2)
-<tr bgcolor=#DDFFFF>
- <th align=left>|
- <td> <I>Thin draw</I><br>conf(toggle, editor/thin_draw, design)
- <td> <I>Thin draw</I><br>conf(toggle, editor/thin_draw, design)
-</table>
-<br>pcb-menu-lesstif.lht: d-shift vs. d-shift;
-</body></html>
diff --git a/doc-rnd/keys_mkey.html b/doc-rnd/keys_mkey.html
deleted file mode 100644
index cce2d30..0000000
--- a/doc-rnd/keys_mkey.html
+++ /dev/null
@@ -1,508 +0,0 @@
-<html><body>
-<h1> Key to action bindings </h1>
-<table border=1 cellspacing=0>
-<tr><th> key <th>pcb-menu-mkey.lht
-<tr bgcolor=#DDFFFF>
- <th align=left>.
- <td> <I>'All-direction' lines</I><br>conf(toggle, editor/all_direction_lines, design)
-<tr bgcolor=#FFFFFF>
- <th align=left>/
- <td> <I>Cycle Clip</I><br>Display(CycleClip)
-<tr bgcolor=#DDFFFF>
- <th align=left>0
- <td> <I>Select Layer 10</I><br>SelectLayer(10)
-<tr bgcolor=#FFFFFF>
- <th align=left>0-alt
- <td> <I>Select Layer 20</I><br>SelectLayer(20)
-<tr bgcolor=#DDFFFF>
- <th align=left>0-alt-ctrl
- <td> <I>Toggle Layer 20</I><br>ToggleView(20)
-<tr bgcolor=#FFFFFF>
- <th align=left>0-ctrl
- <td> <I>Toggle Layer 10</I><br>ToggleView(10)
-<tr bgcolor=#DDFFFF>
- <th align=left>1
- <td> <I>Select Layer 1</I><br>SelectLayer(1)
-<tr bgcolor=#FFFFFF>
- <th align=left>1-alt
- <td> <I>Select Layer 11</I><br>SelectLayer(11)
-<tr bgcolor=#DDFFFF>
- <th align=left>1-alt-ctrl
- <td> <I>Toggle Layer 11</I><br>ToggleView(11)
-<tr bgcolor=#FFFFFF>
- <th align=left>1-ctrl
- <td> <I>Toggle Layer 1</I><br>ToggleView(1)
-<tr bgcolor=#DDFFFF>
- <th align=left>1-shift
- <td> <I>Buffer/Select Buffer #1</I><br>PasteBuffer(1)
-<tr bgcolor=#FFFFFF>
- <th align=left>2
- <td> <I>Select Layer 2</I><br>SelectLayer(2)
-<tr bgcolor=#DDFFFF>
- <th align=left>2-alt
- <td> <I>Select Layer 12</I><br>SelectLayer(12)
-<tr bgcolor=#FFFFFF>
- <th align=left>2-alt-ctrl
- <td> <I>Toggle Layer 12</I><br>ToggleView(12)
-<tr bgcolor=#DDFFFF>
- <th align=left>2-ctrl
- <td> <I>Toggle Layer 2</I><br>ToggleView(2)
-<tr bgcolor=#FFFFFF>
- <th align=left>2-shift
- <td> <I>Buffer/Select Buffer #2</I><br>PasteBuffer(2)
-<tr bgcolor=#DDFFFF>
- <th align=left>3
- <td> <I>Select Layer 3</I><br>SelectLayer(3)
-<tr bgcolor=#FFFFFF>
- <th align=left>3-alt
- <td> <I>Select Layer 13</I><br>SelectLayer(13)
-<tr bgcolor=#DDFFFF>
- <th align=left>3-alt-ctrl
- <td> <I>Toggle Layer 13</I><br>ToggleView(13)
-<tr bgcolor=#FFFFFF>
- <th align=left>3-ctrl
- <td> <I>Toggle Layer 3</I><br>ToggleView(3)
-<tr bgcolor=#DDFFFF>
- <th align=left>3-shift
- <td> <I>Buffer/Select Buffer #3</I><br>PasteBuffer(3)
-<tr bgcolor=#FFFFFF>
- <th align=left>4
- <td> <I>Select Layer 4</I><br>SelectLayer(4)
-<tr bgcolor=#DDFFFF>
- <th align=left>4-alt
- <td> <I>Select Layer 14</I><br>SelectLayer(14)
-<tr bgcolor=#FFFFFF>
- <th align=left>4-alt-ctrl
- <td> <I>Toggle Layer 14</I><br>ToggleView(14)
-<tr bgcolor=#DDFFFF>
- <th align=left>4-ctrl
- <td> <I>Toggle Layer 4</I><br>ToggleView(4)
-<tr bgcolor=#FFFFFF>
- <th align=left>4-shift
- <td> <I>Buffer/Select Buffer #4</I><br>PasteBuffer(4)
-<tr bgcolor=#DDFFFF>
- <th align=left>5
- <td> <I>Select Layer 5</I><br>SelectLayer(5)
-<tr bgcolor=#FFFFFF>
- <th align=left>5-alt
- <td> <I>Select Layer 15</I><br>SelectLayer(15)
-<tr bgcolor=#DDFFFF>
- <th align=left>5-alt-ctrl
- <td> <I>Toggle Layer 15</I><br>ToggleView(15)
-<tr bgcolor=#FFFFFF>
- <th align=left>5-ctrl
- <td> <I>Toggle Layer 5</I><br>ToggleView(5)
-<tr bgcolor=#DDFFFF>
- <th align=left>5-shift
- <td> <I>Buffer/Select Buffer #5</I><br>PasteBuffer(5)
-<tr bgcolor=#FFFFFF>
- <th align=left>6
- <td> <I>Select Layer 6</I><br>SelectLayer(6)
-<tr bgcolor=#DDFFFF>
- <th align=left>6-alt
- <td> <I>Select Layer 16</I><br>SelectLayer(16)
-<tr bgcolor=#FFFFFF>
- <th align=left>6-alt-ctrl
- <td> <I>Toggle Layer 16</I><br>ToggleView(16)
-<tr bgcolor=#DDFFFF>
- <th align=left>6-ctrl
- <td> <I>Toggle Layer 6</I><br>ToggleView(6)
-<tr bgcolor=#FFFFFF>
- <th align=left>7
- <td> <I>Select Layer 7</I><br>SelectLayer(7)
-<tr bgcolor=#DDFFFF>
- <th align=left>7-alt
- <td> <I>Select Layer 17</I><br>SelectLayer(17)
-<tr bgcolor=#FFFFFF>
- <th align=left>7-alt-ctrl
- <td> <I>Toggle Layer 17</I><br>ToggleView(17)
-<tr bgcolor=#DDFFFF>
- <th align=left>7-ctrl
- <td> <I>Toggle Layer 7</I><br>ToggleView(7)
-<tr bgcolor=#FFFFFF>
- <th align=left>8
- <td> <I>Select Layer 8</I><br>SelectLayer(8)
-<tr bgcolor=#DDFFFF>
- <th align=left>8-alt
- <td> <I>Select Layer 18</I><br>SelectLayer(18)
-<tr bgcolor=#FFFFFF>
- <th align=left>8-alt-ctrl
- <td> <I>Toggle Layer 18</I><br>ToggleView(18)
-<tr bgcolor=#DDFFFF>
- <th align=left>8-ctrl
- <td> <I>Toggle Layer 8</I><br>ToggleView(8)
-<tr bgcolor=#FFFFFF>
- <th align=left>9
- <td> <I>Select Layer 9</I><br>SelectLayer(9)
-<tr bgcolor=#DDFFFF>
- <th align=left>9-alt
- <td> <I>Select Layer 19</I><br>SelectLayer(19)
-<tr bgcolor=#FFFFFF>
- <th align=left>9-alt-ctrl
- <td> <I>Toggle Layer 19</I><br>ToggleView(19)
-<tr bgcolor=#DDFFFF>
- <th align=left>9-ctrl
- <td> <I>Toggle Layer 9</I><br>ToggleView(9)
-<tr bgcolor=#FFFFFF>
- <th align=left>:
- <td> <I>Command Entry</I><br>Command()
-<tr bgcolor=#DDFFFF>
- <th align=left>=
- <td> <I>Simple optimization</I><br>djopt(simple)
-<tr bgcolor=#FFFFFF>
- <th align=left>=-shift
- <td> <I>Auto-Optimize</I><br>djopt(auto)
-<tr bgcolor=#DDFFFF>
- <th align=left>[
- <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>\
- <td> <I>Full screen</I><br>fullscreen(toggle)
-<tr bgcolor=#DDFFFF>
- <th align=left>]
- <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>a-alt
- <td> <I>Select all visible</I><br>Select(All)
-<tr bgcolor=#DDFFFF>
- <th align=left>a-alt-shift
- <td> <I>Unselect all</I><br>Unselect(All)
-<tr bgcolor=#FFFFFF>
- <th align=left>a<br> c
- <td> <I>Library</I><br>DoWindows(Library)
-<tr bgcolor=#DDFFFF>
- <th align=left>b
- <td> <I>Flip Object</I><br>Flip(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>b-alt-ctrl
- <td> <I>netlist patch for back annotation</I><br>SavePatch()
-<tr bgcolor=#DDFFFF>
- <th align=left>b-shift
- <td> <I>Move selected elements to other side</I><br>Flip(SelectedElements)
-<tr bgcolor=#FFFFFF>
- <th align=left>backspace
- <td> <I>Remove Selected</I><br>RemoveSelected()
-<tr bgcolor=#DDFFFF>
- <th align=left>backspace-shift
- <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
-<tr bgcolor=#FFFFFF>
- <th align=left>c
- <td> <I>Center cursor</I><br>Center()
-<tr bgcolor=#DDFFFF>
- <th align=left>c-ctrl<br>
- <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
-<tr bgcolor=#FFFFFF>
- <th align=left>d
- <td> <I>Pins/Via show Name/Number</I><br>Display(PinOrPadName)
-<tr bgcolor=#DDFFFF>
- <th align=left>d-shift
- <td> <I>Pinout</I><br>Display(Pinout)
-<tr bgcolor=#FFFFFF>
- <th align=left>delete
- <td> <I>Remove</I><br>Mode(Save); Mode(Remove); Mode(Notify); Mode(Restore)
-<tr bgcolor=#DDFFFF>
- <th align=left>delete-shift
- <td> <I>Remove selected objects</I><br>RemoveSelected()
-<tr bgcolor=#FFFFFF>
- <th align=left>down
- <td> <I>Step Down</I><br>Cursor(Warp,0,-1,grid)
-<tr bgcolor=#DDFFFF>
- <th align=left>down-shift
- <td> <I>Step +Down</I><br>Cursor(Pan,0,-50,view)
-<tr bgcolor=#FFFFFF>
- <th align=left>e-shift
- <td> <I>Erase selected rats</I><br>DeleteRats(SelectedRats)
-<tr bgcolor=#DDFFFF>
- <th align=left>e<br> c
- <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
-<tr bgcolor=#FFFFFF>
- <th align=left>e<br> d
- <td> <I>Remove</I><br>Mode(Save); Mode(Remove); Mode(Notify); Mode(Restore)
-<tr bgcolor=#DDFFFF>
- <th align=left>e<br> i
- <td> <I>Buffer/Mirror buffer (up/down)</I><br>Mode(PasteBuffer); PasteBuffer(Mirror)
-<tr bgcolor=#FFFFFF>
- <th align=left>e<br> r
- <td> <I>Rotate buffer 90 deg CCW</I><br>
-<tr bgcolor=#DDFFFF>
- <th align=left>e<br> r-shift
- <td> <I>Redo last undone operation</I><br>Redo()
-<tr bgcolor=#FFFFFF>
- <th align=left>e<br> u-shift
- <td> <I>Undo last operation</I><br>Undo()
-<tr bgcolor=#DDFFFF>
- <th align=left>e<br> x
- <td> <I>text on layout</I><br>ChangeName(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>enter
- <td> <I>Click</I><br>Mode(Notify); Mode(Release)
-<tr bgcolor=#DDFFFF>
- <th align=left>f-alt-shift
- <td> <I>Replace footprint</I><br>ReplaceFootprint()
-<tr bgcolor=#FFFFFF>
- <th align=left>f-ctrl
- <td> <I>Lookup connection to object</I><br>GetXY(Click on the object); Connection(Find)
-<tr bgcolor=#DDFFFF>
- <th align=left>f-shift
- <td> <I>Reset all connections</I><br>Connection(Reset); Display(Redraw)
-<tr bgcolor=#FFFFFF>
- <th align=left>f<br> a
- <td> <I>Save Layout As...</I><br>Save(LayoutAs)
-<tr bgcolor=#DDFFFF>
- <th align=left>f<br> c
- <td> <I>Quit Program</I><br>Quit()
-<tr bgcolor=#FFFFFF>
- <th align=left>f<br> i
- <td> <I>Export layout...</I><br>Export()
-<tr bgcolor=#DDFFFF>
- <th align=left>f<br> n
- <td> <I>Start New Layout</I><br>New()
-<tr bgcolor=#FFFFFF>
- <th align=left>f<br> o
- <td> <I>Load layout</I><br>Load(Layout)
-<tr bgcolor=#DDFFFF>
- <th align=left>f<br> p
- <td> <I>Print layout...</I><br>Print()
-<tr bgcolor=#FFFFFF>
- <th align=left>f<br> r
- <td> <I>Revert</I><br>Load(Revert,none)
-<tr bgcolor=#DDFFFF>
- <th align=left>f<br> s
- <td> <I>Save Layout</I><br>Save(Layout)
-<tr bgcolor=#FFFFFF>
- <th align=left>g
- <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>g-ctrl
- <td> <I>Grid +0.05mm</I><br>SetValue(Grid,+0.05,mm)
-<tr bgcolor=#FFFFFF>
- <th align=left>g-ctrl-shift
- <td> <I>Grid -0.05mm</I><br>SetValue(Grid,-0.05,mm)
-<tr bgcolor=#DDFFFF>
- <th align=left>g-shift
- <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>h-ctrl
- <td> <I>ChangeHole Object</I><br>ChangeHole(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>h-shift
- <td> <I>ToggleHideName SelectedElement</I><br>ToggleHideName(SelectedElements)
-<tr bgcolor=#FFFFFF>
- <th align=left>h<br> a
- <td> <I>About...</I><br>About()
-<tr bgcolor=#DDFFFF>
- <th align=left>j
- <td> <I>ChangeJoin Object</I><br>ChangeJoin(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>j-shift
- <td> <I>ChangeJoin SelectedObject</I><br>ChangeJoin(SelectedObjects)
-<tr bgcolor=#DDFFFF>
- <th align=left>k
- <td> <I>Clear Object +2 mil</I><br>ChangeClearSize(Object,+2,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>k-ctrl
- <td> <I>Clear Selected +2 mil</I><br>ChangeClearSize(SelectedObjects,+2,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>k-ctrl-shift
- <td> <I>Clear Selected -2 mil</I><br>ChangeClearSize(SelectedObjects,-2,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>k-shift
- <td> <I>Clear Object -2 mil</I><br>ChangeClearSize(Object,-2,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>l
- <td> <I>Line Tool size +5 mil</I><br>SetValue(LineSize,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>l-shift
- <td> <I>Line Tool size -5 mil</I><br>SetValue(LineSize,-5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>left
- <td> <I>Step Left</I><br>Cursor(Warp,-1,0,grid)
-<tr bgcolor=#FFFFFF>
- <th align=left>left-shift
- <td> <I>Step +Left</I><br>Cursor(Pan,-50,0,view)
-<tr bgcolor=#DDFFFF>
- <th align=left>m
- <td> <I>Move Object to current layer</I><br>MoveToCurrentLayer(Object)
-<tr bgcolor=#FFFFFF>
- <th align=left>m-ctrl
- <td> <I>MarkCrosshair</I><br>MarkCrosshair()
-<tr bgcolor=#DDFFFF>
- <th align=left>m-shift
- <td> <I>Move selected to current layer</I><br>MoveToCurrentLayer(Selected)
-<tr bgcolor=#FFFFFF>
- <th align=left>n
- <td> <I>text on layout</I><br>ChangeName(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>n-alt
- <td> <I>Nonetlist</I><br>ChangeNonetlist(Element)
-<tr bgcolor=#FFFFFF>
- <th align=left>n-ctrl
- <td> <I>Start New Layout</I><br>New()
-<tr bgcolor=#DDFFFF>
- <th align=left>n-ctrl-shift
- <td> <I>pin on layout</I><br>ChangeName(Object, Number)
-<tr bgcolor=#FFFFFF>
- <th align=left>n-shift
- <td> <I>Select shortest rat</I><br>AddRats(Close)
-<tr bgcolor=#DDFFFF>
- <th align=left>o
- <td> <I>Optimize rats nest</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)
-<tr bgcolor=#FFFFFF>
- <th align=left>o-ctrl
- <td> <I>ChangeOctagon Object</I><br>ChangeOctagon(Object)
-<tr bgcolor=#DDFFFF>
- <th align=left>o-shift
- <td> <I>AddRats to selected pins</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)
-<tr bgcolor=#FFFFFF>
- <th align=left>p
- <td> <I>Polygon PreviousPoint</I><br>Polygon(PreviousPoint)
-<tr bgcolor=#DDFFFF>
- <th align=left>p-alt
- <td> <I>Manage plugins...</I><br>ManagePlugins()
-<tr bgcolor=#FFFFFF>
- <th align=left>p-ctrl
- <td> <I>Auto-place selected elements</I><br>AutoPlaceSelected()
-<tr bgcolor=#DDFFFF>
- <th align=left>p-ctrl-shift
- <td> <I>Thin draw poly</I><br>conf(toggle, editor/thin_draw_poly, design)
-<tr bgcolor=#FFFFFF>
- <th align=left>p-shift
- <td> <I>Polygon Close</I><br>Polygon(Close)
-<tr bgcolor=#DDFFFF>
- <th align=left>q
- <td> <I>ChangeSquare Object</I><br>ChangeSquare(ToggleObject)
-<tr bgcolor=#FFFFFF>
- <th align=left>q-ctrl
- <td> <I>Quit Program</I><br>Quit()
-<tr bgcolor=#DDFFFF>
- <th align=left>r-alt
- <td> <I>Auto-route selected rats</I><br>AutoRoute(SelectedRats)
-<tr bgcolor=#FFFFFF>
- <th align=left>r-ctrl
- <td> <I>Generate object report</I><br>ReportObject()
-<tr bgcolor=#DDFFFF>
- <th align=left>r-shift
- <td> <I>Redo last undone operation</I><br>Redo()
-<tr bgcolor=#FFFFFF>
- <th align=left>right
- <td> <I>Step Right</I><br>Cursor(Warp,1,0,grid)
-<tr bgcolor=#DDFFFF>
- <th align=left>right-shift
- <td> <I>Step +Right</I><br>Cursor(Pan,50,0,view)
-<tr bgcolor=#FFFFFF>
- <th align=left>s
- <td> <I>ChangeSize +5 mil</I><br>ChangeSize(Object,+5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>s-alt
- <td> <I>ChangeDrill +5 mil</I><br>ChangeDrillSize(Object,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>s-alt-shift
- <td> <I>ChangeDrill -5 mil</I><br>ChangeDrillSize(Object,-5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>s-ctrl
- <td> <I>Save Layout</I><br>Save(Layout)
-<tr bgcolor=#FFFFFF>
- <th align=left>s-ctrl-shift
- <td> <I>Save Layout As...</I><br>Save(LayoutAs)
-<tr bgcolor=#DDFFFF>
- <th align=left>s-shift
- <td> <I>ChangeSize -5 mil</I><br>ChangeSize(Object,-5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>space
- <td> <I>Arrow Mode</I><br>Mode(Arrow)
-<tr bgcolor=#DDFFFF>
- <th align=left>t
- <td> <I>Text Tool scale +10 mil</I><br>SetValue(TextScale,+10,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>t-shift
- <td> <I>Text Tool scale -10 mil</I><br>SetValue(TextScale,-10,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>tab
- <td> <I>Flip up/down</I><br>SwapSides(V)
-<tr bgcolor=#FFFFFF>
- <th align=left>tab-ctrl
- <td> <I>Spin 180 degrees</I><br>SwapSides(R)
-<tr bgcolor=#DDFFFF>
- <th align=left>tab-ctrl-shift
- <td> <I>Swap Sides</I><br>SwapSides()
-<tr bgcolor=#FFFFFF>
- <th align=left>tab-shift
- <td> <I>Flip left/right</I><br>SwapSides(H)
-<tr bgcolor=#DDFFFF>
- <th align=left>u
- <td> <I>Undo last operation</I><br>Undo()
-<tr bgcolor=#FFFFFF>
- <th align=left>u-ctrl-shift
- <td> <I>Clear undo-buffer</I><br>Undo(ClearList)
-<tr bgcolor=#DDFFFF>
- <th align=left>up
- <td> <I>Step Up</I><br>Cursor(Warp,0,1,grid)
-<tr bgcolor=#FFFFFF>
- <th align=left>up-shift
- <td> <I>Step +Up</I><br>Cursor(Pan,0,50,view)
-<tr bgcolor=#DDFFFF>
- <th align=left>v-alt
- <td> <I>Via Tool drill +5 mil</I><br>SetValue(ViaDrillingHole,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>v-alt-shift
- <td> <I>Via Tool drill -5 mil</I><br>SetValue(ViaDrillingHole,-5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>v-ctrl
- <td> <I>Paste buffer to layout</I><br>Mode(PasteBuffer)
-<tr bgcolor=#FFFFFF>
- <th align=left>v-ctrl-shift
- <td> <I>Via Tool size -5 mil</I><br>SetValue(ViaSize,-5,mil)
-<tr bgcolor=#DDFFFF>
- <th align=left>v-shift
- <td> <I>Via Tool size +5 mil</I><br>SetValue(ViaSize,+5,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>v<br> e
- <td> <I>Zoom Max</I><br>Zoom()
-<tr bgcolor=#DDFFFF>
- <th align=left>v<br> f
- <td> <I>Zoom Max</I><br>Zoom()
-<tr bgcolor=#FFFFFF>
- <th align=left>v<br> i
- <td> <I>Zoom In 2X</I><br>Zoom(-2)
-<tr bgcolor=#DDFFFF>
- <th align=left>v<br> o
- <td> <I>Zoom Out 2X</I><br>Zoom(+2)
-<tr bgcolor=#FFFFFF>
- <th align=left>w
- <td> <I>Add All Rats</I><br>AddRats(AllRats)
-<tr bgcolor=#DDFFFF>
- <th align=left>w-shift
- <td> <I>AddRats Selected</I><br>AddRats(SelectedRats)
-<tr bgcolor=#FFFFFF>
- <th align=left>x
- <td> <I>Cycle object being dragged</I><br>CycleDrag()
-<tr bgcolor=#DDFFFF>
- <th align=left>x-ctrl
- <td> <I>Cut selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
-<tr bgcolor=#FFFFFF>
- <th align=left>x-shift
- <td> <I>Swap nets on two selected pins</I><br>net(swap)
-<tr bgcolor=#DDFFFF>
- <th align=left>y
- <td> <I>Puller</I><br>Puller()
-<tr bgcolor=#FFFFFF>
- <th align=left>y-ctrl
- <td> <I>Redo last undone operation</I><br>Redo()
-<tr bgcolor=#DDFFFF>
- <th align=left>y-shift
- <td> <I>ChangeSizes to Route style</I><br>ChangeSizes(Object,style,mil)
-<tr bgcolor=#FFFFFF>
- <th align=left>z
- <td> <I>Zoom In 20%</I><br>Zoom(-1.2)
-<tr bgcolor=#DDFFFF>
- <th align=left>z-ctrl
- <td> <I>Undo last operation</I><br>Undo()
-<tr bgcolor=#FFFFFF>
- <th align=left>z-shift
- <td> <I>Zoom Out 20%</I><br>Zoom(+1.2)
-<tr bgcolor=#DDFFFF>
- <th align=left>|
- <td> <I>Thin draw</I><br>conf(toggle, editor/thin_draw, design)
-</table>
-
-</body></html>
diff --git a/doc-rnd/man/Makefile b/doc-rnd/man/Makefile
deleted file mode 100644
index 4364dbb..0000000
--- a/doc-rnd/man/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-# This Makefile is a plain old hand written one; all configuration settings
-# are included from ../../Makefile.conf which is scconfig generated
-
-IN=pcb-rnd.1.mml
-OUT_HTML = pcb-rnd.1.html
-OUT_MAN1 = pcb-rnd.1
-OUT_LINT = pcb-rnd.1.lint
-
-OUTPUT = $(OUT_HTML) $(OUT_MAN1) index.html
-MML = /usr/bin/mml
-
-all: $(OUTPUT)
-
-lint: pcb-rnd.1.lint
-
-.SUFFIXES: .html .mml .lint
-
-.mml.html: .mml_linkmap
- $(MML) -i copyright.mml -f html $< > $@
-
-.mml:
- $(MML) -i copyright.mml -f man $< > $@
-
-.mml_linkmap:
- $(MML) -i copyright.mml -f linkmap $(IN) > $@
-
-index.html:
- @echo "<HTML><BODY>" > $@
- $(MML) -i copyright.mml -f indexhtml $(IN) >> $@
- @echo "</BODY></HTML>" >> $@
-
-clean:
-
-distclean:
-
-genclean:
- rm $(OUTPUT) 2>/dev/null ; true
-
-.mml.lint:
- $(MML) -i copyright.mml -f lint $<
-
-install_:
- $(MKDIR) "$(MAN1DIR)"
- $(CPC) "`pwd`/pcb-rnd.1" "$(MAN1DIR)/pcb-rnd.1"
- $(CPC) "`pwd`/gsch2pcb-rnd.1" "$(MAN1DIR)/gsch2pcb-rnd.1"
-
-uninstall:
- $(RM) "$(MAN1DIR)/pcb-rnd.1"
- $(RM) "$(MAN1DIR)/gsch2pcb-rnd.1"
-
-install:
- make install_ CPC="$(CP)"
-
-linstall:
- make install_ CPC="$(LN)"
-
-include ../../Makefile.conf
-
diff --git a/doc-rnd/man/index.html b/doc-rnd/man/index.html
deleted file mode 100644
index 778a6e6..0000000
--- a/doc-rnd/man/index.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<HTML><BODY>
- <LI> <a href="pcb-rnd.1.html">pcb-rnd</a> <I>(1)</I> -- pcb-rnd - Printed Circuit Board editor
-</BODY></HTML>
diff --git a/doc-rnd/man/pcb-rnd.1 b/doc-rnd/man/pcb-rnd.1
deleted file mode 100644
index 7ce2b59..0000000
--- a/doc-rnd/man/pcb-rnd.1
+++ /dev/null
@@ -1,47 +0,0 @@
-.\" pcb-rnd - manual
-.\" Copyright (C) 2016 Tibor 'Igor2' Palinkas
-.\"
-.\" 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: pcb-rnd[removethis]@igor2.repo.hu
-.TH pcb-rnd 1 2016-10-29 "" "pcb-rnd manual"
-.SH NAME
-pcb-rnd - Printed Circuit Board editor
-.SH SYNPOSIS
-.nf
-.sp
-\fBpcb-rnd [\fIoptions\fB] [\fIinputfile\fB]
-.fi
-.SH DECSRIPTION
-
-.BR pcb-rnd
-is a modular PCB editor. The main use is interactive editing. If no \fI-x\fR is specified on the command line, the graphical editor mode is initiated. Automated, headless processing is also possible with \fI-x\fR or \fI--gui batch\fR.
-.SH OPTIONS
-
-
-.TP
-
-.B -x \fIexporter\fR [\fIexportflags] \fIinputfile\fR\fR
-Instead of interactive editing, export the design (loaded from \fIinputfile\fR) to a file using the specified \fIexporter\fR plugin. A list of exporter-specific parameters may follow to control the details of the process.
-.TP
-
-.B --gui \fIhid\fR
-Use the \fIhid\fR plugin for the "gui" frontend. Common choices are "gtk" or "lesstif" for graphical user intrfaces and "batch" for a headless command-line interface (or automated batch processing).
-.TP
-
-.B -c \fIpath=val\fR
-Set a config node in role CFR_CLI. The path of the node is \fIpath\fR (e.g. editor/grid) and the new value is \fIval\fR (e.g. 5mm).
-.PP
-
diff --git a/doc-rnd/man/pcb-rnd.1.html b/doc-rnd/man/pcb-rnd.1.html
deleted file mode 100644
index 9194ce0..0000000
--- a/doc-rnd/man/pcb-rnd.1.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<HTML><BODY>
-<!--
-pcb-rnd - manual
-Copyright (C) 2016 Tibor 'Igor2' Palinkas
-
-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: pcb-rnd[removethis]@igor2.repo.hu
--->
-<table width=100%>
-<TR>
- <TH align=left> pcb-rnd 1
- <TH align=middle> 2016-10-29
- <TH align=right> pcb-rnd manual
-</table>
-
-
-
-<H3>NAME</H3>
-<blockquote>
-pcb-rnd - Printed Circuit Board editor
-</blockquote>
-
-<H3>SYNPOSIS</H3>
-<blockquote>
-<P>
-<tt><B>pcb-rnd</B> [<I>options</I>] [<I>inputfile</I>]</tt>
-
-
-
-</blockquote>
-
-<H3>DESCRIPTION</H3>
-<blockquote>
-<B>pcb-rnd</B> is a modular PCB editor. The main use is interactive editing. If no <I>-x</I> is specified on the command line, the graphical editor mode is initiated. Automated, headless processing is also possible with <I>-x</I> or <I>--gui batch</I>.
-</blockquote>
-
-
-<H3>OPTIONS</H3>
-<blockquote>
-
-<table border=1>
-
- <TR>
-
- <TD> -x <I>exporter</I> [<I>exportflags] <I>inputfile</I></I>
- <TD> Instead of interactive editing, export the design (loaded from <I>inputfile</I>) to a file using the specified <I>exporter</I> plugin. A list of exporter-specific parameters may follow to control the details of the process.
- <TR>
-
- <TD> --gui <I>hid</I>
- <TD> Use the <I>hid</I> plugin for the "gui" frontend. Common choices are "gtk" or "lesstif" for graphical user intrfaces and "batch" for a headless command-line interface (or automated batch processing).
- <TR>
-
- <TD> -c <I>path=val</I>
- <TD> Set a config node in role CFR_CLI. The path of the node is <I>path</I> (e.g. editor/grid) and the new value is <I>val</I> (e.g. 5mm).
-</table>
-</blockquote>
-<P>
-<table width=100%>
-<TR>
- <TH align=left> pcb-rnd 1
- <TH align=middle> 2016-10-29
- <TH align=right> pcb-rnd manual
-</table>
-
-
-</BODY></HTML>
diff --git a/doc-rnd/man/pcb-rnd.1.mml b/doc-rnd/man/pcb-rnd.1.mml
deleted file mode 100644
index 916ffe7..0000000
--- a/doc-rnd/man/pcb-rnd.1.mml
+++ /dev/null
@@ -1,38 +0,0 @@
-<title>pcb-rnd</title>
-<sect>1</sect>
-<date>2016-10-29</date>
-
-<name> pcb-rnd - Printed Circuit Board editor </name>
-<syn> <call>pcb-rnd</call> [<arg>options</arg>] [<arg>inputfile</arg>] </syn>
-
-<description>
-<call>pcb-rnd</call> is a modular PCB editor. The main use is interactive
-editing. If no <arg>-x</arg> is specified on the command line, the
-graphical editor mode is initiated. Automated, headless processing
-is also possible with <arg>-x</arg> or <arg>--gui batch</arg>.
-</description>
-
-<options>
-<kvlist>
- <item>
- <key> -x <arg>exporter</arg> [<arg>exportflags] <arg>inputfile</arg> </key>
- <value> Instead of interactive editing, export the design (loaded from
- <arg>inputfile</arg>) to a file using the specified
- <arg>exporter</arg> plugin. A list of exporter-specific parameters
- may follow to control the details of the process. </value>
- </item>
- <item>
- <key> --gui <arg>hid</arg> </key>
- <value> Use the <arg>hid</arg> plugin for the "gui" frontend. Common
- choices are "gtk" or "lesstif" for graphical user intrfaces
- and "batch" for a headless command-line interface (or automated
- batch processing). </value>
- </item>
- <item>
- <key> -c <arg>path=val</arg> </key>
- <value> Set a config node in role CFR_CLI. The path of the node is
- <arg>path</arg> (e.g. editor/grid) and the new value is
- <arg>val</arg> (e.g. 5mm). </value>
- </item>
-</kvlist>
-</options>
diff --git a/doc-rnd/mods/after.png b/doc-rnd/mods/after.png
deleted file mode 100644
index 2bd9b36..0000000
Binary files a/doc-rnd/mods/after.png and /dev/null differ
diff --git a/doc-rnd/mods/gen.sh b/doc-rnd/mods/gen.sh
deleted file mode 100755
index d227922..0000000
--- a/doc-rnd/mods/gen.sh
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/bin/sh
-
-path=../../src_plugins
-
-sloc()
-{
- (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }'
-}
-
-gen_pie()
-{
- local bn=$1 code_size=$2 color=$3
- echo ""
- echo "@slice"
- echo "$code_size"
- echo "@label"
- echo "$bn ($code_size)"
- if test ! -z "$color"
- then
- echo "@color"
- echo "$color"
- fi
-}
-
-echo "#autogenerated by gen.sh" > mods.pie
-echo "#autogenerated by gen.sh" > after.pie
-
-echo HIDs >&2
-code_size=`sloc ../../src/hid`
-gen_pie "HIDs" $code_size "orangered" >> after.pie
-
-echo Core >&2
-tmp=/tmp/pcb-mods-stat
-mkdir $tmp
-cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp
-code_size=`sloc $tmp`
-gen_pie "core" $code_size "#00ff88" >> after.pie
-
-#echo 3rd >&2
-#code_size=`sloc ../../src_3rd`
-#gen_pie "3rd" $code_size >> after.pie
-
-
-(
-cat pre.html
-for n in $path/*
-do
- if test -d "$n"
- then
- echo $n >&2
- bn=`basename $n`
- code_size=`sloc $n`
- total=$(($total + $code_size))
- gen_pie $bn $code_size >> mods.pie
-# case $bn in
-# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;;
-# esac
-
- echo "<tr><th align=left>$bn<td>$code_size"
- awk '
- /^#/ {
- key=$1
- sub("#", "", key)
- sub("[:=]", "", key)
- $1=""
- DB[key]=$0
- next
- }
- { desc = desc " " $0 }
-
- function strip(s) {
- sub("^[ \t]*", "", s)
- sub("[ \t]*$", "", s)
- return s
- }
-
- END {
- st = DB["state"]
- if (st ~ "partial")
- clr = "bgcolor=\"yellow\""
- else if (st ~ "works")
- clr = "bgcolor=\"lightgreen\""
- else if ((st ~ "fail") || (st ~ "disable"))
- clr = "bgcolor=\"red\""
- else
- clr=""
-
- clr2 = clr
- if (clr2 != "") {
- sub("bgcolor=\"", "", clr2)
- sub("\"", "", clr2)
- print "@color" >> "mods.pie"
- print clr2 >> "mods.pie"
- }
-
- print "<td " clr " >" st
- if (DB["lstate"] != "")
- print "<br> (" strip(DB["lstate"]) ")"
-
- dfl = DB["default"]
- if (dfl ~ "buildin")
- clr = "bgcolor=\"lightgreen\""
- else if (dfl ~ "plugin")
- clr = "bgcolor=\"yellow\""
- else if ((dfl ~ "fail") || (dfl ~ "disable"))
- clr = "bgcolor=\"red\""
- else
- clr=""
-
- print "<td " clr ">" dfl
- if (DB["ldefault"] != "")
- print "<br> (" strip(DB["ldefault"]) ")"
- print "<td>" desc
- }
- ' < $n/README
- fi
-done
-cat post.html
-gen_pie "plugins" "$total" "#0088ff" >> after.pie
-) > index.html
-
-for n in mods after
-do
- animpie < $n.pie | animator -H -d $n
- pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png
- rm ${n}0000.png
-done
-
diff --git a/doc-rnd/mods/index.html b/doc-rnd/mods/index.html
deleted file mode 100644
index fcba2f7..0000000
--- a/doc-rnd/mods/index.html
+++ /dev/null
@@ -1,136 +0,0 @@
-<html>
-<body>
-<H1> pcb-rnd modularization </H1>
-<H2> Why bother... </H2>
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-<p>
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-<p>
-As of version 1.0.8 a cosiderable chunk of core code has been moved into
-<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-<ul>
- <li> to compile it as a buildin (static-link it into the pcb executable)
- <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
- <li> to disable the plugin, so it is not compiled at all
-</ul>
-<p>
-I believe such modularization has benefits on multiple levels:
-<ul>
- <li> it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
- <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
- <li> such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-</ul>
-
-<H2> Progress in charts </H2>
-<h3> Before-after </h3>
-All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-<table border=1 cellspacing=0> <tr><td>
- <table border=0>
- <tr><td><img src="before.png"><td> <td><img src="after.png">
- <tr><td>Before modularization: pcb-rnd version 1.0.7
- <br>Note: gpmi was already a plugin
- <td>
- <td> After modularization: pcb-rnd version 1.0.8
- <br>Note: gpmi is part of the "plugins" slice
- </table>
-</table>
-<h3>Zooming on to the plugins</h3>
-<p>
-<img src="mods.png">
-<p>
-(Red means the plugin doesn't really work).
-
-<H2> Progress in numbers </H2>
-Below is a table with the summary of core plugins.
-<table border=1 cellspacing=0>
-<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> description
-
-
-<tr><th align=left>autoplace<td>608
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Automatically place elements.
-<tr><th align=left>autoroute<td>4177
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Automatically route selected or all rats. This is the original autorouter.
-<tr><th align=left>dbus<td>438
-<td bgcolor="red" > disabled
-<br> (TODO: needs scconfig support)
-<td bgcolor="red"> disabled
-<td> Remote control PCB using DBUS.
-<tr><th align=left>djopt<td>2315
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Various board optimization algorithms.
-<tr><th align=left>export_gcode<td>2450
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to gcode
-<tr><th align=left>export_lpr<td>96
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to lpr (using export_ps to generate postscript)
-<tr><th align=left>export_nelma<td>683
-<tr><th align=left>export_ps<td>1608
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export postscript or embedded postscript.
-<tr><th align=left>gpmi<td>2992
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<br> (if gpmi is installed)
-<td> Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
-<tr><th align=left>import_edif<td>3578
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Import code for netlists in the EDIF format.
-<tr><th align=left>import_sch<td>255
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Imports element and netlist data from the schematics (or some other source).
-<tr><th align=left>mincut<td>886
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
-<tr><th align=left>oldactions<td>53
-<td bgcolor="lightgreen" > works
-<td bgcolor="red"> disabled
-<td> Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout
-<tr><th align=left>puller<td>1878
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Pull traces to minimize their length.
-<tr><th align=left>renumber<td>218
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Renumber elements (renaming them) and generate a text file for back annotation.
-<tr><th align=left>stroke<td>124
-<td bgcolor="yellow" > partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
-<td bgcolor="red"> disabled
-<br> (requires libstroke installed)
-<td> Gesture recognition with libstroke.
-<tr><th align=left>toporouter<td>6161
-<td bgcolor="red" > fails
-<br> (infinite loop in gts)
-<td bgcolor="red"> disabled
-<td> Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
-<tr><th align=left>vendordrill<td>567
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Vendor drill mapping.
-</table>
-</body>
-</html>
diff --git a/doc-rnd/mods/mods.png b/doc-rnd/mods/mods.png
deleted file mode 100644
index 538e3e3..0000000
Binary files a/doc-rnd/mods/mods.png and /dev/null differ
diff --git a/doc-rnd/mods/post.html b/doc-rnd/mods/post.html
deleted file mode 100644
index 81d8c88..0000000
--- a/doc-rnd/mods/post.html
+++ /dev/null
@@ -1,3 +0,0 @@
-</table>
-</body>
-</html>
diff --git a/doc-rnd/mods/pre.html b/doc-rnd/mods/pre.html
deleted file mode 100644
index 3822520..0000000
--- a/doc-rnd/mods/pre.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<html>
-<body>
-<H1> pcb-rnd modularization </H1>
-<H2> Why bother... </H2>
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-<p>
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-<p>
-As of version 1.0.8 a cosiderable chunk of core code has been moved into
-<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-<ul>
- <li> to compile it as a buildin (static-link it into the pcb executable)
- <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
- <li> to disable the plugin, so it is not compiled at all
-</ul>
-<p>
-I believe such modularization has benefits on multiple levels:
-<ul>
- <li> it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
- <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
- <li> such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-</ul>
-
-<H2> Progress in charts </H2>
-<h3> Before-after </h3>
-All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-<table border=1 cellspacing=0> <tr><td>
- <table border=0>
- <tr><td><img src="before.png"><td> <td><img src="after.png">
- <tr><td>Before modularization: pcb-rnd version 1.0.7
- <br>Note: gpmi was already a plugin
- <td>
- <td> After modularization: pcb-rnd version 1.0.8
- <br>Note: gpmi is part of the "plugins" slice
- </table>
-</table>
-<h3>Zooming on to the plugins</h3>
-<p>
-<img src="mods.png">
-<p>
-(Red means the plugin doesn't really work).
-
-<H2> Progress in numbers </H2>
-Below is a table with the summary of core plugins.
-<table border=1 cellspacing=0>
-<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> description
-
-
diff --git a/doc-rnd/mods2/after.png b/doc-rnd/mods2/after.png
deleted file mode 100644
index 96d7297..0000000
Binary files a/doc-rnd/mods2/after.png and /dev/null differ
diff --git a/doc-rnd/mods2/before.png b/doc-rnd/mods2/before.png
deleted file mode 100644
index dcec960..0000000
Binary files a/doc-rnd/mods2/before.png and /dev/null differ
diff --git a/doc-rnd/mods2/gen.sh b/doc-rnd/mods2/gen.sh
deleted file mode 100755
index d227922..0000000
--- a/doc-rnd/mods2/gen.sh
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/bin/sh
-
-path=../../src_plugins
-
-sloc()
-{
- (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }'
-}
-
-gen_pie()
-{
- local bn=$1 code_size=$2 color=$3
- echo ""
- echo "@slice"
- echo "$code_size"
- echo "@label"
- echo "$bn ($code_size)"
- if test ! -z "$color"
- then
- echo "@color"
- echo "$color"
- fi
-}
-
-echo "#autogenerated by gen.sh" > mods.pie
-echo "#autogenerated by gen.sh" > after.pie
-
-echo HIDs >&2
-code_size=`sloc ../../src/hid`
-gen_pie "HIDs" $code_size "orangered" >> after.pie
-
-echo Core >&2
-tmp=/tmp/pcb-mods-stat
-mkdir $tmp
-cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp
-code_size=`sloc $tmp`
-gen_pie "core" $code_size "#00ff88" >> after.pie
-
-#echo 3rd >&2
-#code_size=`sloc ../../src_3rd`
-#gen_pie "3rd" $code_size >> after.pie
-
-
-(
-cat pre.html
-for n in $path/*
-do
- if test -d "$n"
- then
- echo $n >&2
- bn=`basename $n`
- code_size=`sloc $n`
- total=$(($total + $code_size))
- gen_pie $bn $code_size >> mods.pie
-# case $bn in
-# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;;
-# esac
-
- echo "<tr><th align=left>$bn<td>$code_size"
- awk '
- /^#/ {
- key=$1
- sub("#", "", key)
- sub("[:=]", "", key)
- $1=""
- DB[key]=$0
- next
- }
- { desc = desc " " $0 }
-
- function strip(s) {
- sub("^[ \t]*", "", s)
- sub("[ \t]*$", "", s)
- return s
- }
-
- END {
- st = DB["state"]
- if (st ~ "partial")
- clr = "bgcolor=\"yellow\""
- else if (st ~ "works")
- clr = "bgcolor=\"lightgreen\""
- else if ((st ~ "fail") || (st ~ "disable"))
- clr = "bgcolor=\"red\""
- else
- clr=""
-
- clr2 = clr
- if (clr2 != "") {
- sub("bgcolor=\"", "", clr2)
- sub("\"", "", clr2)
- print "@color" >> "mods.pie"
- print clr2 >> "mods.pie"
- }
-
- print "<td " clr " >" st
- if (DB["lstate"] != "")
- print "<br> (" strip(DB["lstate"]) ")"
-
- dfl = DB["default"]
- if (dfl ~ "buildin")
- clr = "bgcolor=\"lightgreen\""
- else if (dfl ~ "plugin")
- clr = "bgcolor=\"yellow\""
- else if ((dfl ~ "fail") || (dfl ~ "disable"))
- clr = "bgcolor=\"red\""
- else
- clr=""
-
- print "<td " clr ">" dfl
- if (DB["ldefault"] != "")
- print "<br> (" strip(DB["ldefault"]) ")"
- print "<td>" desc
- }
- ' < $n/README
- fi
-done
-cat post.html
-gen_pie "plugins" "$total" "#0088ff" >> after.pie
-) > index.html
-
-for n in mods after
-do
- animpie < $n.pie | animator -H -d $n
- pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png
- rm ${n}0000.png
-done
-
diff --git a/doc-rnd/mods2/index.html b/doc-rnd/mods2/index.html
deleted file mode 100644
index aabe26b..0000000
--- a/doc-rnd/mods2/index.html
+++ /dev/null
@@ -1,159 +0,0 @@
-<html>
-<body>
-<H1> pcb-rnd modularization </H1>
-<H2> Why bother... </H2>
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-<p>
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-<p>
-In version 1.0.8 and 1.0.9 a cosiderable chunk of core code has been moved into
-<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-<ul>
- <li> to compile it as a buildin (static-link it into the pcb executable)
- <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
- <li> to disable the plugin, so it is not compiled at all
-</ul>
-<p>
-I believe such modularization has benefits on multiple levels:
-<ul>
- <li> it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
- <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
- <li> such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-</ul>
-
-<H2> Progress in charts </H2>
-<h3> Before-after </h3>
-All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-<table border=1 cellspacing=0> <tr><td>
- <table border=0>
- <tr><td><img src="before.png"><td> <td><img src="after.png">
- <tr><td>Before modularization: pcb-rnd version 1.0.7
- <br>Note: gpmi was already a plugin
- <td>
- <td> After modularization: pcb-rnd version 1.0.9
- <br>Note: gpmi is part of the "plugins" slice
- </table>
-</table>
-<h3>Zooming on to the plugins</h3>
-<p>
-<img src="mods.png">
-<p>
-(Red means the plugin doesn't really work).
-
-<H2> Progress in numbers </H2>
-Below is a table with the summary of core plugins.
-<table border=1 cellspacing=0>
-<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> description
-
-
-<tr><th align=left>autoplace<td>612
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Automatically place elements.
-<tr><th align=left>autoroute<td>4337
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Automatically route selected or all rats. This is the original autorouter.
-<tr><th align=left>dbus<td>438
-<td bgcolor="red" > disabled
-<br> (TODO: needs scconfig support)
-<td bgcolor="red"> disabled
-<td> Remote control PCB using DBUS.
-<tr><th align=left>djopt<td>2320
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Various board optimization algorithms.
-<tr><th align=left>export_bom<td>374
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export bom (Bill of Materials)
-<tr><th align=left>export_gcode<td>2452
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to gcode
-<tr><th align=left>export_gerber<td>972
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to gerber
-<tr><th align=left>export_lpr<td>96
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to lpr (using export_ps to generate postscript)
-<tr><th align=left>export_nelma<td>685
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to nelma (Numerical capacitance calculator)
-<tr><th align=left>export_png<td>1107
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export to png, gif and jpeg
-<tr><th align=left>export_ps<td>1613
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Export postscript or embedded postscript.
-<tr><th align=left>fontmode<td>163
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Font editing actions.
-<tr><th align=left>gpmi<td>3003
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<br> (if gpmi is installed)
-<td> Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
-<tr><th align=left>import_edif<td>3578
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Import code for netlists in the EDIF format.
-<tr><th align=left>import_sch<td>259
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Imports element and netlist data from the schematics (or some other source).
-<tr><th align=left>legacy_func<td>72
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Random collection of old/obsolete (legacy) functions. 3rd party plugins may depend on them. This module implements C functions and variables and does not register actions or flags.
-<tr><th align=left>mincut<td>886
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
-<tr><th align=left>oldactions<td>57
-<td bgcolor="lightgreen" > works
-<td bgcolor="red"> disabled
-<td> Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout
-<tr><th align=left>puller<td>1884
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Pull traces to minimize their length.
-<tr><th align=left>renumber<td>222
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Renumber elements (renaming them) and generate a text file for back annotation.
-<tr><th align=left>stroke<td>124
-<td bgcolor="yellow" > partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
-<td bgcolor="red"> disabled
-<br> (requires libstroke installed)
-<td> Gesture recognition with libstroke.
-<tr><th align=left>toporouter<td>6165
-<td bgcolor="red" > fails
-<br> (infinite loop in gts)
-<td bgcolor="red"> disabled
-<td> Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
-<tr><th align=left>vendordrill<td>572
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> Vendor drill mapping.
-</table>
-</body>
-</html>
diff --git a/doc-rnd/mods2/mods.png b/doc-rnd/mods2/mods.png
deleted file mode 100644
index 089d550..0000000
Binary files a/doc-rnd/mods2/mods.png and /dev/null differ
diff --git a/doc-rnd/mods2/post.html b/doc-rnd/mods2/post.html
deleted file mode 100644
index 81d8c88..0000000
--- a/doc-rnd/mods2/post.html
+++ /dev/null
@@ -1,3 +0,0 @@
-</table>
-</body>
-</html>
diff --git a/doc-rnd/mods2/pre.html b/doc-rnd/mods2/pre.html
deleted file mode 100644
index 2e9e198..0000000
--- a/doc-rnd/mods2/pre.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<html>
-<body>
-<H1> pcb-rnd modularization </H1>
-<H2> Why bother... </H2>
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-<p>
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-<p>
-In version 1.0.8 and 1.0.9 a cosiderable chunk of core code has been moved into
-<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-<ul>
- <li> to compile it as a buildin (static-link it into the pcb executable)
- <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
- <li> to disable the plugin, so it is not compiled at all
-</ul>
-<p>
-I believe such modularization has benefits on multiple levels:
-<ul>
- <li> it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
- <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
- <li> such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-</ul>
-
-<H2> Progress in charts </H2>
-<h3> Before-after </h3>
-All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-<table border=1 cellspacing=0> <tr><td>
- <table border=0>
- <tr><td><img src="before.png"><td> <td><img src="after.png">
- <tr><td>Before modularization: pcb-rnd version 1.0.7
- <br>Note: gpmi was already a plugin
- <td>
- <td> After modularization: pcb-rnd version 1.0.9
- <br>Note: gpmi is part of the "plugins" slice
- </table>
-</table>
-<h3>Zooming on to the plugins</h3>
-<p>
-<img src="mods.png">
-<p>
-(Red means the plugin doesn't really work).
-
-<H2> Progress in numbers </H2>
-Below is a table with the summary of core plugins.
-<table border=1 cellspacing=0>
-<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> description
-
-
diff --git a/doc-rnd/mods3/after.png b/doc-rnd/mods3/after.png
deleted file mode 100644
index 89efbe8..0000000
Binary files a/doc-rnd/mods3/after.png and /dev/null differ
diff --git a/doc-rnd/mods3/before.png b/doc-rnd/mods3/before.png
deleted file mode 100644
index dcec960..0000000
Binary files a/doc-rnd/mods3/before.png and /dev/null differ
diff --git a/doc-rnd/mods3/gen.sh b/doc-rnd/mods3/gen.sh
deleted file mode 100755
index d41df83..0000000
--- a/doc-rnd/mods3/gen.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/sh
-
-path=../../src_plugins
-
-sloc()
-{
- (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }'
-}
-
-gen_pie()
-{
- local bn=$1 code_size=$2 color=$3
- echo ""
- echo "@slice"
- echo "$code_size"
- echo "@label"
- echo "$bn ($code_size)"
- if test ! -z "$color"
- then
- echo "@color"
- echo "$color"
- fi
-}
-
-echo "#autogenerated by gen.sh" > mods.pie
-echo "#autogenerated by gen.sh" > after.pie
-
-echo Core >&2
-tmp=/tmp/pcb-mods-stat
-mkdir $tmp
-cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp
-code_size=`sloc $tmp`
-gen_pie "core" $code_size "#00ff88" >> after.pie
-
-#echo 3rd >&2
-#code_size=`sloc ../../src_3rd`
-#gen_pie "3rd" $code_size >> after.pie
-
-
-(
-cat pre.html
-for n in $path/*
-do
- if test -d "$n"
- then
- echo $n >&2
- bn=`basename $n`
- code_size=`sloc $n`
- total=$(($total + $code_size))
- gen_pie $bn $code_size >> mods.pie
-# case $bn in
-# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;;
-# esac
-
- echo "<tr><th align=left>$bn<td>$code_size"
- awk '
- /^#/ {
- key=$1
- sub("#", "", key)
- sub("[:=]", "", key)
- $1=""
- DB[key]=$0
- next
- }
- { desc = desc " " $0 }
-
- function strip(s) {
- sub("^[ \t]*", "", s)
- sub("[ \t]*$", "", s)
- return s
- }
-
- END {
- st = DB["state"]
- if (st ~ "partial")
- clr = "bgcolor=\"yellow\""
- else if (st ~ "works")
- clr = "bgcolor=\"lightgreen\""
- else if ((st ~ "fail") || (st ~ "disable"))
- clr = "bgcolor=\"red\""
- else
- clr=""
-
- clr2 = clr
- if (clr2 != "") {
- sub("bgcolor=\"", "", clr2)
- sub("\"", "", clr2)
- print "@color" >> "mods.pie"
- print clr2 >> "mods.pie"
- }
-
- print "<td " clr " >" st
- if (DB["lstate"] != "")
- print "<br> (" strip(DB["lstate"]) ")"
-
- dfl = DB["default"]
- if (dfl ~ "buildin")
- clr = "bgcolor=\"lightgreen\""
- else if (dfl ~ "plugin")
- clr = "bgcolor=\"yellow\""
- else if ((dfl ~ "fail") || (dfl ~ "disable"))
- clr = "bgcolor=\"red\""
- else
- clr=""
-
- print "<td " clr ">" dfl
- if (DB["ldefault"] != "")
- print "<br> (" strip(DB["ldefault"]) ")"
- print "<td>" DB["implements"]
- print "<td>" desc
- }
- ' < $n/README
- fi
-done
-cat post.html
-gen_pie "plugins" "$total" "#0088ff" >> after.pie
-) > index.html
-
-for n in mods after
-do
- animpie < $n.pie | animator -H -d $n
- pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png
- rm ${n}0000.png
-done
-
diff --git a/doc-rnd/mods3/index.html b/doc-rnd/mods3/index.html
deleted file mode 100644
index 14ad27d..0000000
--- a/doc-rnd/mods3/index.html
+++ /dev/null
@@ -1,373 +0,0 @@
-<html>
-<body>
-<H1> pcb-rnd modularization </H1>
-<H2> Why bother... </H2>
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-<p>
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-<p>
-In version 1.0.8 to 1.1.0 a cosiderable chunk of core code has been moved into
-<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-<ul>
- <li> to compile it as a buildin (static-link it into the pcb executable)
- <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
- <li> to disable the plugin, so it is not compiled at all
-</ul>
-<p>
-I believe such modularization has benefits on multiple levels:
-<ul>
- <li> it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
- <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
- <li> such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-</ul>
-
-<H2> Progress in charts </H2>
-<h3> Before-after </h3>
-All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-<table border=1 cellspacing=0> <tr><td>
- <table border=0>
- <tr><td><img src="before.png"><td> <td><img src="after.png">
- <tr><td>Before modularization: pcb-rnd version 1.0.7
- <br>Note: gpmi was already a plugin
- <td>
- <td> After modularization: pcb-rnd version 1.1.0
- <br>Note: gpmi is part of the "plugins" slice
- </table>
-</table>
-<h3>Zooming on to the plugins</h3>
-<p>
-<img src="mods.png">
-<p>
-(Red means the plugin doesn't really work).
-
-<H2> Progress in numbers </H2>
-Below is a table with the summary of core plugins.
-<table border=1 cellspacing=0>
-<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> class <th> description
-
-
-<tr><th align=left>autocrop<td>158
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Reduce the board dimensions to just enclose the elements.
-<tr><th align=left>autoplace<td>614
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Automatically place elements.
-<tr><th align=left>autoroute<td>4343
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Automatically route selected or all rats. This is the original autorouter.
-<tr><th align=left>boardflip<td>131
-<td > WIP
-<br> (doesn't update rtrees)
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> All objects on the board are up-down flipped.
-<tr><th align=left>dbus<td>483
-<td > WIP
-<br> (needs to install the xml?)
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Remote control PCB using DBUS.
-<tr><th align=left>diag<td>162
-<td bgcolor="lightgreen" > works
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Actions for pcb-rnd core diagnostics, intended for developers. These are not in core because end users normally don't need these. As a plugin, due to dynamic loading, it can be dropped on an existing pcb-rnd installation with minimal risk of scaring away a reproducible bug.
-<tr><th align=left>distalign<td>428
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Introducing Align() and Distribute(), which work much like the similarly named functions in Visio. Given that PCB does not have the concept of "first selected object" to draw on, the reference points can be selected by arguments.
-<tr><th align=left>distaligntext<td>466
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Same as distalign, operates on text objects.
-<tr><th align=left>djopt<td>2320
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Various board optimization algorithms.
-<tr><th align=left>export_bboard<td>426
-<td > WIP
-<td bgcolor="red"> disabled
-<td> export
-<td> Export breadboard
-<tr><th align=left>export_bom<td>230
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export bom (Bill of Materials)
-<tr><th align=left>export_dsn<td>443
-<td > Work-in-progress
-<td bgcolor="red"> disable
-<td> export
-<td> Export specctra .dsn files
-<tr><th align=left>export_dxf<td>3992
-<td > WIP
-<td bgcolor="red"> disabled
-<td> export
-<td> Export dxf
-<tr><th align=left>export_gcode<td>2466
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export to gcode
-<tr><th align=left>export_gerber<td>971
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export to gerber
-<tr><th align=left>export_ipcd356<td>468
-<td > Work-in-progress
-<td bgcolor="red"> disable
-<td> export
-<td> IPC-D-356 Netlist export.
-<tr><th align=left>export_lpr<td>106
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export to lpr (using export_ps to generate postscript)
-<tr><th align=left>export_nelma<td>679
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export to nelma (Numerical capacitance calculator)
-<tr><th align=left>export_openscad<td>1394
-<td > WIP
-<td bgcolor="red"> disabled
-<td> export
-<td> Export openscad
-<tr><th align=left>export_png<td>1120
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export to png, gif and jpeg
-<tr><th align=left>export_ps<td>1638
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export postscript or embedded postscript.
-<tr><th align=left>export_test<td>257
-<td bgcolor="red" > disabled
-<br> (work in progress)
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> A thin layer of code to dump exporter calls for testing the HID exporter API.
-<tr><th align=left>export_xy<td>270
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> export
-<td> Export XY centroid element data for pick & place.
-<tr><th align=left>fontmode<td>165
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Font editing actions.
-<tr><th align=left>fp_fs<td>379
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> fp
-<td> Footprint: file system based implementation. Used to be called Newlib: load footprints from directories. Run external processes for the parametric footprints.
-<tr><th align=left>fp_wget<td>302
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> fp
-<td> Footprint: get static (file) footprints from the web, e.g. from http://gedasymbols.org
-<tr><th align=left>gl<td>590
-<td bgcolor="red" > disabled
-<br> (pcb-rnd has no support for opengl.)
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Common gl functions for hids.
-<tr><th align=left>gpmi<td>3046
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<br> (if gpmi is installed)
-<td> (feature)
-<td> Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
-<tr><th align=left>hid_batch<td>333
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> hid
-<td> HID without GUI; read actions from stdin.
-<tr><th align=left>hid_gtk<td>15972
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> hid
-<td> GUI: the GTK HID.
-<tr><th align=left>hid_lesstif<td>6923
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> hid
-<td> GUI: the lesstif HID.
-<tr><th align=left>import_dsn<td>114
-<td > Work-in-progress
-<td bgcolor="red"> disable
-<td> import
-<td> Import specctra .dsn files
-<tr><th align=left>import_edif<td>3621
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> import
-<td> Import plugin for netlists in the EDIF format.
-<tr><th align=left>import_netlist<td>131
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> import
-<td> Import plugin for netlists in the classic pcb netlist format.
-<tr><th align=left>import_sch<td>301
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> import
-<td> Imports element and netlist data from the schematics (or some other source).
-<tr><th align=left>io_kicad<td>998
-<td > work-in-progress
-<td bgcolor="red"> disabled
-<td> io
-<td> Load and save the design and elements in Kicad's s-expression format - this is the new, currently preferred format in Kicad.
-<tr><th align=left>io_kicad_legacy<td>941
-<td > work-in-progress
-<td bgcolor="lightgreen"> buildin
-<td> io
-<td> Load and save the design and elements in Kicad's legacy format.
-<tr><th align=left>io_lihata<td>1042
-<td > WIP
-<td bgcolor="red"> disabled
-<td> io
-<td> Load and save the design and elements in the lihata board format.
-<tr><th align=left>io_pcb<td>2174
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> io
-<td> Load and save the design and elements in the original pcb text format.
-<tr><th align=left>jostle<td>446
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Pushes lines out of the way.
-<tr><th align=left>lib_gensexpr<td>6
-<td bgcolor="lightgreen" > works
-<td bgcolor="red"> disabled
-<td> (lib)
-<td> S-expression parser lib
-<tr><th align=left>lib_legacy_func<td>74
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (lib)
-<td> Random collection of old/obsolete (legacy) functions. 3rd party plugins may depend on them. This module implements C functions and variables and does not register actions or flags.
-<tr><th align=left>loghid<td>273
-<td > WIP
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Sits between a HID (or exporter) and the core and logs all core->plugin calls made through the HID structure.
-<tr><th align=left>mincut<td>909
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
-<tr><th align=left>oldactions<td>155
-<td bgcolor="lightgreen" > works
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout; a set of debug actions useful for writing pcb scripts: Debug(), DebugXY(), Return(). Old plugin actions to toggle or set settings that are now accessible via the unified config system (vendordrill, djopt)
-<tr><th align=left>polycombine<td>208
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> The selected polygons are combined together according to the ordering of their points.
-<tr><th align=left>polystitch<td>185
-<td > segfaults
-<td bgcolor="red"> disable
-<td> (feature)
-<td> The polygon under the cursor (based on closest-corner) is stitched together with the polygon surrounding it on the same layer. Use with pstoedit conversions where there's a "hole" in the shape - select the hole.
-<tr><th align=left>propedit<td>766
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> List and edit properties of a group of objects.
-<tr><th align=left>puller<td>1888
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Pull traces to minimize their length.
-<tr><th align=left>query<td>1823
-<td > WIP
-<td bgcolor="red"> disable
-<td> (feature)
-<td> pcb-rnd query language: execute expressions on objects and rules for the programmed drc.
-<tr><th align=left>renumber<td>310
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Renumber elements (renaming them) and generate a text file for back annotation.
-<tr><th align=left>report<td>749
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Report() and ReportObject() actions - print a report about design objects.
-<tr><th align=left>shand_cmd<td>212
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> vi-like command shorthands (1..3 character long commands)
-<tr><th align=left>smartdisperse<td>173
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Improve the initial dispersion of elements by choosing an order based on the netlist, rather than the arbitrary element order. This isn't the same as a global autoplace, it's more of a linear autoplace. It might make some useful local groupings. For example, you should not have to chase all over the board to find the resistor that goes with a given LED.
-<tr><th align=left>stroke<td>135
-<td bgcolor="yellow" > partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Gesture recognition with libstroke.
-<tr><th align=left>teardrops<td>226
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Draw teardrops on pins.
-<tr><th align=left>toporouter<td>6162
-<td bgcolor="red" > fails
-<br> (infinite loop in gts)
-<td bgcolor="red"> disabled
-<td> (feature)
-<td> Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
-<tr><th align=left>vendordrill<td>513
-<td bgcolor="lightgreen" > works
-<td bgcolor="lightgreen"> buildin
-<td> (feature)
-<td> Vendor drill mapping.
-</table>
-
-<H3> Classes </H3>
-Each plugin implements a class (rarely a set of classes). Classes are:
-<table border=1 cellspacing=0>
- <tr><th>name <th> description
- <tr><td>(feature) <td> random features directly accessible for the user, usually actions
- <tr><td>(lib) <td> support code library for other plugins (core doesn't depend on these); functionality not directly accessible for the user but other plugins may depend on it
- <tr><td>hid <td> Human Interface Device: interactive user interface, usually GUI
- <tr><td>import <td> load alien formats into the design space
- <tr><td>export <td> save (parts of) the design space in alien formats
- <tr><td>fp <td> footprint (element) library implementation
- <tr><td>io <td> native file format (save & load) implementation
-</table>
-
-</body>
-</html>
diff --git a/doc-rnd/mods3/mods.png b/doc-rnd/mods3/mods.png
deleted file mode 100644
index def8f72..0000000
Binary files a/doc-rnd/mods3/mods.png and /dev/null differ
diff --git a/doc-rnd/mods3/pre.html b/doc-rnd/mods3/pre.html
deleted file mode 100644
index e6e2d7c..0000000
--- a/doc-rnd/mods3/pre.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<html>
-<body>
-<H1> pcb-rnd modularization </H1>
-<H2> Why bother... </H2>
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-<p>
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-<p>
-In version 1.0.8 to 1.1.0 a cosiderable chunk of core code has been moved into
-<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-<ul>
- <li> to compile it as a buildin (static-link it into the pcb executable)
- <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
- <li> to disable the plugin, so it is not compiled at all
-</ul>
-<p>
-I believe such modularization has benefits on multiple levels:
-<ul>
- <li> it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
- <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
- <li> such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-</ul>
-
-<H2> Progress in charts </H2>
-<h3> Before-after </h3>
-All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-<table border=1 cellspacing=0> <tr><td>
- <table border=0>
- <tr><td><img src="before.png"><td> <td><img src="after.png">
- <tr><td>Before modularization: pcb-rnd version 1.0.7
- <br>Note: gpmi was already a plugin
- <td>
- <td> After modularization: pcb-rnd version 1.1.0
- <br>Note: gpmi is part of the "plugins" slice
- </table>
-</table>
-<h3>Zooming on to the plugins</h3>
-<p>
-<img src="mods.png">
-<p>
-(Red means the plugin doesn't really work).
-
-<H2> Progress in numbers </H2>
-Below is a table with the summary of core plugins.
-<table border=1 cellspacing=0>
-<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> class <th> description
-
-
diff --git a/doc-rnd/motivation.html b/doc-rnd/motivation.html
deleted file mode 100644
index 1663b6d..0000000
--- a/doc-rnd/motivation.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - motivation </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<H1> pcb-rnd motivation </H1>
-<H2> Phase 1: At the beginning... (2013..2014)</H2>
-I use PCB a lot on various computers. I used to try to join the mainstream
-development with small contribution (minor patches) and was active on
-IRC and the mailing lists for a while. However, it didn't work out well,
-and:
-<ul>
- <li> PCB already knew 95% of everything I'd ever need years ago
- <li> the remaining 5% was not on the TODO list of developers and generally no one shown much interest in getting patches for those
- <li> meanwhile a lot of new features have been added, from which most I find totally useless:
- <ul>
- <li> dbus
- <li> gl - transparency makes even simple 2 sided boards unusable; slower than the classic version sw render on all my computers
- <li> preparation for a C++ transition
- <li> 3d support in core (I believe communication to 3d cad programs should be via exporter plugins)
- </ul>
- <li> the official Debian package enables (requires, depends on) both dbus and gl
- <li> DVCS - it almost always results in chaos, and has no benefit for such a small group of developers; there are posts from time to time on the mailing list about how to handle the chaos; my choice is to stick with a simple, centralized version control system
- <li> DVCS <b>always</b> results in increased administration, which I hate to spend my time on - I'd rather invest the time in bugfixing, documentation or implementing new features
- <li> it's nearly impossible to get small patches applied^1:
- <ul>
- <li> often no one has the time to revise and commit them
- <li> communication requires web2.0 (lp)
- <li> there are too many cycles of "please fix this and change that first"
- <li> with the chaos VCS, it's too likely that new feature patches would require ongoing maintenance while sitting in a "feature branch", to avoid that a large scale merge (or rebase, whatever) breaks it when it finally hits the official branch
- <li> there are too much pondering and too less prototyping; there are features that are being considered for years (for example back annotation, internal connections) with multiple concurrent ideas, but no code. Instead, I'd like to implement some code from the early phase of the idea, test it, and deprecate it if it didn't work out well.
- <li> I wouldn't even dream about getting larger patches in the official release
- </ul>
- <li> no stable release for years; maintaining a set of patches (like pcb-gpmi) and porting them to new releases is too much hassle
-</ul>
-I was pondering a fork for years. The trigger was that one day I've upgraded
-Debian on my lab computer and the new version of PCB came with gl enabled; this
-made PCB absolutely unusable (had to wait like 10 seconds for a scroll) while
-all the transparent polys over traces made the whole screen a mess. I should
-have recompiled everything and built a new Debian package with gl disabled or
-install from source (but I have too many computers for that). My decision
-was to set up my own .deb but then build it from a fork (it's not much of
-an extra effort), so I can add some of the features I miss in daily use.
-My plans with this fork:
-<ul>
- <li> I stick with my fork and will use it on all my computers for all my designs
- <li> Because of that, there's no emphasis on keeping the file formats compatible - breaking compatibility is not a goal either; as long as mainline doesn't change the format, pcb-rnd is about 98% compatible (the 2% is where pcb-rnd features are not supported by mainline)
- <li> I won't actively seek ways to get my changes into the mainstream; I will keep on using my svn repo in a manner that (as a side effect) makes such merges easier, tho. If PCB developers decide to pick them up from svn and merge them in the official repo, it's fine (but I personally will keep using my fork anyway).
- <li> Most probably I won't merge anything back from the mainstream to my fork - the past few years showed that it's unlikely there would be new features I'd need
- <li> My plans for new features were:
- <ul>
- <li> pin shapes (a <a href="features/square.html">preliminary version</a> is already implemented)
- <li> 1206 jumpers without having to add them on the schematics/netlist (done: <a href="features/intconn.html">[intconn]</a> and <a href="features/nonetlist.html"> [nonetlist] </a> are the PCB-side features for this)
- <li> merge pcb-gpmi; GPMI would be an optional addon, it'd probably stay a plugin, but there should not be a separate repo (<a href="gpmi"> done </a>)
- </ul>
-</ul>
-<p>
-Footnotes:
-<ul>
- <li> ^1: this may have changed lately and pcb developers are more open to newcomers; there seems to be a shortage of developers tho, which still makes it slow to get bigger patches through
-</ul>
-
-<H2> Phase 2: major cleanups (2015..2016) </H2>
-In the first phase I was mostly implementing a set of small features and fixes.
-As I got more familiar with the code base, I decided to bite the bullet and
-do some refactoring:
-<ul>
- <li> replaced the <a href="features/pcb-fp.html">footprint mapping/loading code</a>; instead of a hardwired m4 dependency, parametric (generated-on-the-fly) footprints can be written in any language
- <li> replaced the default footprint library shipped with the software; the <a href="features/pcblib.html"> new library </a> ships a small, well organized collection of essentials, omitting special/rarely used footprints
- <li> got the code much more modular - <a href="mods3"> a lot of core code got converted into plugins </a>
- <li> threw out the resource parser and file format (manu.res and friends) <a href="features/res.html"> in favor of lihata;</a> this removed a lot of code duplication and a strangely designed resource tree data structure I really hated; as a side effect the gtk hid has multi-stroke hotkeys
- <li> <a href="features/unglib.html">replaced glib</a> with a set of <a href="http://repo.hu/projects/articles/minilibs"> mini libs </a> in core and most of the plugins; at the end only the gtk hid should depend on glib; this made the code easier to maintain and debug; a lot of checks are now compile-time (through the C type system) instead of runtime (glib lists)
- <li> replaced the settings/rc/preferences system with a central, <a href="conf/"> lihata based configuration system </a> - long term hid attributes will be converted too
-</ul>
-<p>
-Plans for the future includes:
-<ul>
- <li> turning most of the core code into a library for external tools to reuse
- <li> extending the core to provide an infrastructure for composite objects handled by plugins
- <li> support for saving and loading pcb and footprint files in the lihata format
- <li> plans for a set of smallish features that can be implemented in a weekend or two each.
-</ul>
-
-<H2> Phase 3: community requested features (from 2016 onward) </H2>
-Overlapping phase 2 there is an ongoing
-<a href="http://igor2.repo.hu/cgi-bin/pcb-rnd-poll.cgi"> feature poll </a>. If there
-are enough <b>active</b> users/testers for a feature, it gets implemented in
-phase 3.
-<p>
-There is a small, active, constructive community forming around pcb-rnd. Future
-directions will be mainly set by their need.
-</html>
-</body>
-
diff --git a/doc-rnd/myfeature.html b/doc-rnd/myfeature.html
deleted file mode 100644
index 7efd2f1..0000000
--- a/doc-rnd/myfeature.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - my feature </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<h1> pcb-rnd - how to get my favorite feature implemented </h1>
-
-The list below is sorted: top items have higher priority, but you
-are free to choose any.
-
-<H3> 1. If you are a programmer with free time to spend </H3>
-Read the <a href="contrib.html"> contribution howto</a> and join the project.
-You are welcome to work only on the feature you are interested in. You get
-all the support (e.g. for understending the API, to get a blank plugin
-set up so you need to fill in only the feature-specific parts, etc.). Success
-rate shoudl be near to 100%.
-
-<H3> 2. If you are not a programmer and have free time </H3>
-You can join and work on things you don't need that much, but others do.
-This will build your reputation in the community which in turns encourages
-others to implement your favorite feature even if they wouldn't do it for
-themselves. The success rate is somewhat more random, obviously.
-
-<H3> 3. If you don't have free time </H3>
-Consider donation: buy someone else's time. To do so, contact me
-(see the <a href="contrib.html"> contribution howto</a> page). Since
-you don't need to cover all costs and the hourly rates are much lower
-on a pet project, and your feature may be simpler than it looks, and
-someone who already knows the code also saves the learning cureve, it may
-all be cheaper than you think. The success rate should be close to 100%.
-<p>
-However, this is a last resort solution, the above ones are clearly preferred.
-
-
-<H3> 4. If you don't have anything to contribute with </H3>
-[DEL:Vote for it in the <a href="http://igor2.repo.hu/cgi-bin/pcb-rnd-poll.cgi">
-feature poll</a>. If your feature is not there, ask on the mailing list.
-Chance for success: if it's a popular demand on the feature poll, chances
-are somewhat good. Else chances are very low, but not zero.:DEL]
-<p>
-Because of 100% passivity of the geda community, I decided not to spend more
-time on community-related tasks. The poll is there, you can use it,
-but you will have to orgnaize at least 5 active, capable users who are
-commited enough to spend significant time on testing/supporting development.
-I will consider implementing your feature only if you can bring and keep
-those people motivated and active.
-
-<H3> 5. If you tried everything, even point 4. and all failed... </H3>
-Complain loudly on the mailing list, advertise your opinion, try pushing
-the thing - a.k.a. go trolling. <b>Success rate is exactly 0%</b>,
-you make a lot of good <del>friends</del> enemies that will make it harder
-to ask or contribute later for another feature, but it may make you feel
-better. </irony>.
-
diff --git a/doc-rnd/news.html b/doc-rnd/news.html
deleted file mode 100644
index 254aa78..0000000
--- a/doc-rnd/news.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<html>
-<head>
- <title> pcb-rnd - news </title>
-<!--AUTO head begin-->
- <link rel="icon" href="http://repo.hu/projects/pcb-rnd/logo16.png">
-<!--AUTO head end-->
-</head>
-<body>
-
-<!--AUTO navbar begin-->
-<table border=0 cellspacing=2 cellpadding=10 bgcolor=#eeeeee width=100%>
-<tr>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
-<th align=center bgcolor=#ccc0cc> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
-<td align=right width=60%> <font size=+2><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/logo32.png">
-</table>
-<!--AUTO navbar end-->
-
-<br>
-<!--content-->
-<h1> News </h1>
-<table border=0 cellpadding=20 width=100%>
-<tr><td align=right valign=top bgcolor=#eeeeee>
- <table border=0 width=100% cellpadding=15 cellspacing=15>
- <tr>
- <th align=right valign=top bgcolor=#ccccff width=20%>
- 2016-09-04
- <br>
- Rebranding
- <td bgcolor=#ddddff>
- We have a new main page reflecting the transition how we regard pcb-rnd:
- it is not much of just a fork of geda/pcb by now, but a separate PCB
- editor with its own team and own course. File save/load compatibility is
- maintained.
-
- <tr>
- <th align=right valign=top bgcolor=#ccccff width=20%>
- 2016-08-24
- <br>
- Release 1.1.1
- <td bgcolor=#ddddff>
- Available at <a href="releases/"> the download page </a>.
- <br>
- The next development cycle will focus on editable/searchable attributes
- and a new native file format.
-
- </table>
-</table>
-
-</body>
-</html>
diff --git a/doc-rnd/packaging.txt b/doc-rnd/packaging.txt
deleted file mode 100644
index 3df60c3..0000000
--- a/doc-rnd/packaging.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-Packaging pcb-rnd for a distribution
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-1. program, libs, desktop integration
-
-Pcb-rnd is an interactive printed circuit board editor program. A typical
-user is an electric engineer. This sort of programs are often called EDA,
-Electronics Design Automation.
-
-Pcb-rnd has different frontends: graphical and stdio/text based batch
-processing. There are different graphical frontends - pcb-rnd does not
-depend on gtk or motif, the specific frontend modules may depend on them.
-
-Pcb-rnd is scriptable if libgpmi is available. Since libgpmi is not
-a mainstream library for the scripting feature it should also be packaged.
-
-Pcb-rnd is intended for UNIX-fans. It is heavily keyboard-oriented and it
-doesn't assume its users don't want to understand or learn how it works.
-Many typical user workflows include Makefiles and it's a common thing to
-start pcb-rnd from a shell. Thus desktop integration is not in focus
-at the moment. If you fixed things for this while packaging, please let
-us know, we may merge your patches (see below).
-
-2. options, plugins, dependencies
-
-Pcb-rnd is a modular software with a lot of options. Majority of these options
-are selected by the state of a module. A module has three states:
- - disable: (not compiled at all)
- - buildin: enabled and static linked
- - plugin: enabled and dynamic loaded (from a .so)
-
-The configure script takes --disable-*, --building-* and --plugin-*
-arguments with * substituted with the name of the module. The configure
-script also determines the dependencies according to the selection. Special
-arguments --all=plugin and --all=buildin are provided in configure to select
-all working modules to be plugins or buildins.
-
-For binary distributions it's strongly recommended to have most of the
-modules compiled as plugins and have them in separate packages. This
-would let the user to install a core pcb-rnd package and then the GTK
-or the lesstif plugin (or both) from separate packages. This also reduces
-package dependencies.
-
-This is less relevant for source distributions, if the user has full control
-over the configuration.
-
-If non-critical dependencies are not met, modules are automatically disabled
-by ./configure.
-
-3. typical ./configure options - scconfig vs. auto*
-
-./configurfe --prefix works as expected. DESTDIR is called install_root.
-
-Typical commands for configuring pcb-rnd for packaging would be:
-
- ./configure --all=plugin --prefix=/usr
- make all
- install_root=/tmp/pkg_tmp make install
-
-We are happy with scconfig. Please don't write about how much better
-autoconf or cmake would be, we won't switch.
-
-4. release cycles, tarballs, svn trunk - what to package
-
-Development happens in svn trunk/, there are usually no branches. While
-we try to keep trunk/ compilable any time, it's not guaranteed that it
-would work out-of-the-box between releases. It is not recommended to
-package trunk/ - please package stable releases instead.
-
-We follow the "release early, release often" rule. Source release tarballs
-are always considered stable. Beside the project web page, releases are
-also accessible as svn tags: svn://repo.hu/pcb-rnd/tags .
-
-Sometimes we have minor releases with 1..2 month period, sometimes a
-longer period passes between releases.
-
-There's no automated release notification at the moment; if you want to
-get notified about new releases, please contact me (email
-pcb-rnd (at) igor2.repo.hu)
-
-5. bug reporting and fixes for packaging
-
-There's no special method for reporting packaging related bugs and
-feature requests, please follow the normal bug report instructions or just
-drop me a mail. Please mention that the issue is related to packaging, this
-usually gives it a higher priority.
-
-We are willing to make minor changes to make packaging easier - if you bump
-into something you'd need to work around while packaging, please let us know,
-we may just fix it "upstream".
-
diff --git a/doc-rnd/query/tutor_cli.html b/doc-rnd/query/tutor_cli.html
deleted file mode 100644
index e6aff0a..0000000
--- a/doc-rnd/query/tutor_cli.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<html>
-<body>
-
-<H1> advanced searc, command line tutorial: query language </H1>
-
-<h2> scope </h2>
-
-pcb-rnd from version 1.1.3 features a flexible advnced search that helps
-the user selecting/unselecting objects that match a given logical expression.
-The core of the feature is the pcb-rnd query language. The same language
-is used in the programmable DRC (see also: <a href="../ddrc/proposal1.txt">
-a more formal description of the language</a>).
-<p>
-The current document is a walk through of the practical aspects of the
-language. It starts with the simplest examples while working towards more
-complex cases.
-<p>
-A limited version of the functionality is accessible through a GUI
-wizard when using the GTK HID. A <a href="tutor_gtk.html">separate
-tutorial</a> is dealing with that feature.
-
-<h2> Actions </h2>
-The query(act, expr) action creates the list called "@", which contains all
-objects of the design. Then it iterates over this list (if needed) and
-evaluates the query expression on each object. For each evaluation "act"
-is performed; "act" is one of:
-<ul>
- <li> select - add the matching object to the selections if expr evaluated to true
- <li> unselect - remove the matching object from the selections if expr evaluated to true
- <li> eval - print the result of the expression to stdout
- <li> dump - this inhibits evaluating; it compiles the expression and dumps the parse tree (useful for debugging)
-</ul>
-<p>
-The symbol @ in the query represents the iterator, or in other words,
-the <i>current object</i> we are checking. The engine iterates over all
-copper objects, silk objects, pins, holes, layers and nets. A simple query
-that selects all objects looks like this:
-<pre>
-query(select, '@')
-</pre>
-The actual query experssion was a single @ in this case. This made
-the iteration happen, got the expression evaluated one each object. The
-result of each evaluation was the given object. Since these objects
-were all existing, valid objects, they were taken as logical value TRUE,
-thus for each the add-to-selection was performed.
-<p>
-Note: it's usually a good idea to write the expression in single quotes, because
-it may contain commas, double quotes and parenthesis that pcb-rnd's action parser may
-take as action syntax.
-<p>
-The same expression can ran with eval would print the result of each
-evaluation:
-<pre>
-query(eval, '@')
-</pre>
-This is visible on the terminal pcb-rnd was started from - on X, it's a good
-idea to start a terminal and run pcb-rnd from that instead from a menu or
-icon. The rest of this tutorial will use the eval query because it's easier
-to include the result of an eval than of a selection. Most examples will
-specify the query expression only, without quotes - the reader should
-add the <i>query(eval, ' ')</i> part.
-
-<H2> iteration vs. evaluate once </h2>
-If an expression does not reference the @ object, no iteration is performed
-and the expression is ran only once:
-<pre>
-query(eval, '1')
-</pre>
-This will calculate the value of 1 and prints it to the standard output. Since
-theres no iteration, this can not result in changes in selection. However,
-it makes it easy to demonstrate some basic concepts of the query language.
-<p>
-Note: if @ is present multiple times in the expression, it's still only
-one loop over all objects. When evaluating the expression for a given object,
-all instances of @ are substituted with the same object in that iteration.
-
-
-<H2> grammar: arithmetics and logics </h2>
-For example the integer and floating point numbers and the usual
-arithmetic and logical operators work as expected:
-
-<table border=1>
- <tr><th>expression <th> result <th> explanation
- <tr><td>42 <td> 42 <td> the integer value 42
- <tr><td>3.14 <td> 3.14 <td> the floating point value 3.14
- <tr><td>10 mil <td> 254000 <td> a number with a unit suffix is converted to pcb-rnd's internal coordinate unit (nanometers)
- <tr><td>1+2 <td> 3 <td> sum of 1 and 2
- <tr><td>2*4 <td> 8 <td> multiplication
- <tr><td>47/4 <td> 11 <td> <i>integer</i> division (because both operands were integers)
- <tr><td>47/4.0 <td> 11.75 <td> <i>floating point</i> division (because at least one of the operands was a float)
- <tr><td>(1+2)*5 <td> 15 <td> parenthesis works as usual
- <tr><td>1 && 0<td> 0 <td> logical AND - the result is 1 if both operands were TRUE, 0 else
- <tr><td>1 || 0 <td> 1 <td> logical OR - the result is 1 if either operand was TRUE, 0 else
- <tr><td>!2 <td> 0 <td> logical NOT - 2 is non-zero, so it is TRUE, negate this to get the result (FALSE, which is 0)
- <tr><td>4 > 2 <td> 1 <td> because four is greater than two; all the usual relational operats work: == is equal, != is not-equal, <, <=, > and >=.
-</table>
-
-<H2> grammar: object properties </h2>
-Object have named properties, e.g. the thickness of a line (or arc, or
-trace in general) is called <i>".thickness"</i>, so the thickness of
-the current object is:
-<pre>
- @.thickness
-</pre>
-<p>
-Next, we can already select all traces thicker than 10 mil:
-<pre>
- query(select, '@.thickness > 10 mil')
-</pre>
-<p>
-Because logical expressions are available, it's easy to select all medium-thick
-lines:
-<pre>
- (@.thickness >= 10 mil) && (@.thickness <= 30 mil)
-</pre>
-<p>
-or any trace that's too thin or too thick:
-<pre>
- (@.thickness < 10 mil) || (@.thickness > 30 mil)
-</pre>
-<p>
-or traces that don't match our preferred 8, 10 and 15 mil thicnkess values:
-<pre>
- (@.thickness != 8 mil) && (@.thickness != 10 mil) && (@.thickness != 15 mil)
-</pre>
-
-<H2> grammar: invalid value </h2>
-But how comes an expression like '@.thickness > 10 mil' works while
-@ iterates over non-trace objects, like layers, nets or elements that
-clearly have no thickness?
-<p>
-The answer is the <i>invalid value</i>, which is neither true nor false. If
-a property does not exist in a given object, the result is the <i>invalid value</i>
-or <i>invalid</i> for short. The invalid is treated specially:
-<ul>
- <li> in arithmetic operations it propagates: if either operand is invalid, the result is invalid, e.g. 1+invalid = invalid; this affects +, -, *, / and all the relational operators
- <li> in binary logic operations (&& and ||), it is ignored: it is assumed to be true in a && and false in a || so the outcome depends on the other operand
- <li> in logical NOT (!), TODO
-</ul>
-When @ refers to a non-trace object, @.thickness is invalid and
-'@.thickness > 10 mil' is evaluated t invalid. If the result is not TRUE,
-the requested action is not performed.
-<p>
-The invalid value is generated only when the expression is valid but the
-actual object doesn't have the feature needed. If the expression is wrong,
-an error is generated and the expression stops evaluating immediately.
-
-<H2> grammar: more properties </h2>
-Some properties are a single numeric value, like thickness, or the
-<i>.name</i> of a layer (which is a string) but others are objects. For
-example the <i>.layer</i> property of a line or arc refers to the layer
-object the given line or arc is drawn on. These in turn can be combined,
-and the "name of the layer the current object is on":
-<pre>
- @.layer.name
-</pre>
-<p>
-Referencing non-existing properties yields an error, e.g. @.thickness.layer
-is an error - in contrast with @.layer, which may evaluate to the
-<i>invalid value</i> (e.g. for vias or nets, because they don't have layers).
-The difference is that tickness can not have a layer ever (thus is an error)
-while @.layer is either applicable or not, but potentially could work, this
-when it doesn't, it's only an invalid value.
-<p>
-Further useful property combinatons:
-TODO
-<p>
-There is a <a href="props.html">full list of all properties</a>.
diff --git a/doc-rnd/wishlist.txt b/doc-rnd/wishlist.txt
deleted file mode 100644
index ce6d399..0000000
--- a/doc-rnd/wishlist.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-Active user wishes:
- W1: cschem [Chris]
- W2: proper primitives [Chris]
- W3: more generic footprints [Chris, Evan]
- W4: user doc [Miloh]
- W5: 3d modeller export [Miloh, Evan]
- W6: GUI access to object attributes: gtk editor, find/select by attrib [James]
- W7: programmable drc (star grounding) [James]
- W8: gl support [Erich, Evan]
- W9: push & shove [Erich, Evan]
-
-Plan (parallel threads of development):
-
- A. file format and model
- Steps:
- 1. lihata persistency
- 2. native lihata file format
- 3. extend the file format
- - everything should have an attribute hash -> W6
- - footprints should have optional attachments (e.g. 3d models) -> W5
- This helps us testing out the persistent-lihata idea that'd be
- later used in chscem from the start -> W1
- This is also needed for more generic footprint implementation -> W3
-
- B. visible attribute support
- Steps:
- 1. GTK dialog box for attribute edition
- 2. search & select should work by attribute
- 3. extend the routing style system to auto-add attributes
- (this needs A., the new file format)
- Allows the user to manage properties like "50 ohm net" in attributes,
- to group objects by property, and to select them by property. -> W6
diff --git a/doc/Autostyle.html b/doc/Autostyle.html
new file mode 100644
index 0000000..1f5897d
--- /dev/null
+++ b/doc/Autostyle.html
@@ -0,0 +1,15 @@
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
diff --git a/doc-rnd/Autostyle.sh b/doc/Autostyle.sh
similarity index 100%
rename from doc-rnd/Autostyle.sh
rename to doc/Autostyle.sh
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..3f61fd5
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,28 @@
+MENU_RES=../src/pcb-menu-gtk.lht ../src/pcb-menu-lesstif.lht
+MENU_RES_MKEY=../src/pcb-menu-mkey.lht
+KEYLIST=../util/keylist.sh
+DEBLIST=../util/devhelpers/deblist.sh
+
+all: keys.html keys_mkey.html features/debian_list.html
+ ./Autostyle.sh *.html features/*.html
+
+keys.html: $(MENU_RES) $(KEYLIST)
+ $(KEYLIST) $(MENU_RES) > keys.html
+
+keys_mkey.html: $(MENU_RES_MKEY) $(KEYLIST)
+ $(KEYLIST) $(MENU_RES_MKEY) > keys_mkey.html
+
+install:
+ cd man && $(MAKE) install
+
+linstall:
+ cd man && $(MAKE) linstall
+
+uninstall:
+ cd man && $(MAKE) uninstall
+
+clean:
+ cd man && $(MAKE) clean
+
+distclean:
+ cd man && $(MAKE) distclean
diff --git a/doc/README b/doc/README
new file mode 100644
index 0000000..cd8efa7
--- /dev/null
+++ b/doc/README
@@ -0,0 +1,12 @@
+pcb-rnd "diff" documentation: this directory contains documentation
+on the features that differ from the original pcb version it was forked from.
+
+Most notable subdirectories:
+ developer/ documentation for developers
+ user/ user reference manual
+ features/ details of pcb-rnd features
+ conf/ documentation of the configuration system
+ devlog/ random thoughts and articles
+ man/ UNIX manual pages
+ resources/ logos, screenshots, artwork
+
diff --git a/doc/TODO b/doc/TODO
new file mode 100644
index 0000000..9417130
--- /dev/null
+++ b/doc/TODO
@@ -0,0 +1,196 @@
+- BUGS
+ + gerber top layer doesn't have pads on A.pcb (layer cleanup) [report:James]
+ + gerber layer group name [report:James]
+ ? all route styles deleted when using 'File>load layout data to paste buffer'
+ + in the 45-deg line mode, while DRC enforce settings toggled 'on' can cause isolated trace crossing, violating DRC
+ ? `--dump-actions` and `--show-actions` ends with segmentation fault (compile without debug) Can't reproduce [report:miloh]
+ ? GTK: redraws the board after tab-flip but it doesn't hit the screen on mac [report:James]
+
+
+- Lihata persistent save:
+ - flag compatibility: save unknown, string-flags as loaded by io_pcb
+ - ind: space in ha:layer name
+ - ind: symbol height is not in-line on the output
+ - ind: indentation bug in via and netlists
+ - ind: indentation bug in inline struct therm: closing } is preceded by indentation whitespace for some reason
+ - ind: style attribute members in a fresh save
+ - keep numeric format: test all
+ - keep unknown subtrees
+
+- unravel:
+ - replace "outline" and "route" layer name checks with a central layer call
+
+- replace settings with lihata (conf_*)
+ - TEST:
+ - vendor drill mapping (all functionality, including regex based refdes ignore)
+ - route style in gtk and lesstif, save, load, 0, 1 or a lot of styles
+ - route style vs. autorouter
+
+- query & advanced search
+ - search expr wizard should pick up the expression from the button when clicked
+ - field accessors:
+ - pad area
+ - pin area
+ - line (and pad) length and length^2
+ - make a run on a large board, speed test, with -O0 and -O3:
+ - iteration speed (a simple @)
+ - eval speed (a simple @ with a lot of constants in an expr)
+ - geo speed
+ - regex and string cmp match speed vs. select by name
+
+- gsch2pcb-rnd migration
+ - remove old project file support
+ - remove -m pcb
+
+CLEANUP #5
+- del on arc endpoint should remove the arc, just like del on line endpoint remvoes the line [report:Evan]
+- BUG: arcbug1.lht: draw a polygon over the rightmost ^ arc andit will calculate a self-intersecting clearance [report:Evan]
+- draw code: pin numbers/names are drawn under the silk [report:Evan]
+- lihata board:
+ - move generates much more diff than reasonable: does it renumber IDs?
+- BUG: liblihata shouldn't compile genht (different cflags)
+- BUG: recompile scconfig's str.c for gsch2pcb-rnd (or consider removing it) because of the different compiler flags; fix: use pcb_concat instead [report:debian's QA page for kfreebsd]
+- BUG: redraw after pin renumber in gtk with shift+ctrl+n
+- save buffer element to file - preferred format is hardwired and file name guess is crude (function Save() in gtkhid-main.c)
+- import hackvana gerber naming scheme from mainline [report:Erich]
+- gsch2pcb-rnd: plugin_register() should be in glue.c
+- pcb_act_Attributes -> this could be handled by the property editor maybe? but what about layout attributes and the lesstif hid?
+- unravel the undo code
+ - grid size change should be undoable? [report:Evan]
+ - maybe other conf settings too?
+- src/check_icon.data - is it used?
+- search for move.dst_layer - don't compare pointer to -1!
+- make uninstall doesn't remove an scm
+- rework the gpmi plugin to make it more standard in regard of the build system and to remove a few directories
+- dir rename trunk/pcblib/tru-hole should handle make correctly and not walk on existing web services or user installs
+- grid status line label doesn't update when using setvalue(grid,delta) add another hook to update this value [miloh]
+- Erich's select undo bug: place an element, select, save & load, unselect, undo 2 times: bad serial
+- Erich's gtk lag report: press 's' a lot then move the mouse - 's' ends up in the new loc!
+- conf: throw an error if user config can not be written
+- the TAB bug: (over ssh -X) press tab for a good 15 seconds; release; it won't work again for a fraction of a second
+- mark bug - ortho shouldn't use it, it should use last point (crosshair.X2); make sure nothing else abuses it [James]
+- improve locking:
+ - consider a move-only lock
+ - when thermal and some other operations are applied on a locked element, indicate it
+- conf:
+ - remove CFN_INCREMENTS, test if saving increments from preferences works
+ - config pov: change prio
+ - gtk preferences: check what takes 131 megs of VIRT ram (on top); destroy the dialog structures when closed
+ - gtk preferences: poly isle area widget missing from the sizes tab
+ - debug why default layer names from the user config are ignored
+ - fp_fs_search: kill anything that gets ':' separated string as path list, get a config list instead
+ - switch the lesstif HID over from attribs to conf
+ - remove redundancy: don't store values in the PCB struct that are in the design conf
+ - increments are not really implemented
+ - if font file is not found:
+ - embedded version?
+ - warn when try to write text on pcb?
+- action bug: gui_act.c shouldn't reference Crosshair.X directly; check d-fix.patch about how to fix it
+- next_gui: keep them open, hide
+- look for #warnings
+- fix librarychanged: disable update of gedasymbols on-start, make it an explicit refresh button
+- libstroke: zoom
+- cleanup/rewrite resources:
+ - load/swap menus (TODO#1)
+ - gpmi:
+ - hid: hid_destroy (pair of hid_create)
+ - cleanup on unload: remove menus
+- check whether local copy of gts is needed, bisect when toporouter broke
+- check gpmi when pcb-rnd is fully linstalled - broken symlinks?
+- multi-key: display state on the gui
+- implement loglevels and log style tags in the lesstif HID
+- TODO#3: works only on US keyboard
+- gsch2pcb: generalize plugin/buildin loading for external tools, check if gsch2pcb can work from plugins
+- gtk hid: display element numbers; flip board with tab: numbers get mirrored [report:Evan]
+
+CLEANUP #6:
+- lihata board/fp format:
+ - pads should be polygons (0 long line can't be rotated!)
+ - footprint orientation with a vector (just a second point)
+- layer groups from config (e.g. CLI) is ignored
+- res:
+ - search for vendor in the hid plugins, there should be no trace of it (vendor should register its in submenus with anchors)
+ - re-add dynamic menus after a gui change:
+ - either remember dynamic menus in a separate list so they can be rebuilt
+ - or provide hooks and let plugins deal with it
+ - gpmi: auto-remove menus by cookie (TODO#2)
+ - load new res on the fly (replace the menu system):
+ - low level reload code (re-add the dynamic menus too!)
+ - action to reload if file name is known
+ - gui load dialog with tags listed
+- decide about exporter policy:
+ - png exports selection (even in not-as-shown), others don't
+ - extend png hid attribs with a flag for this, maybe do the same for others
+ - document the decision in "hacking"
+- reduce
+ - export_bom: rewrite the string list code using htsp and/or lists
+ - hash in hid_attrib.c?
+ - nelma and gcode both invent .png name locally
+ - get rid of gcode/lists.h, and vector.[ch] (autorouter)
+ - vendordrill
+ - search for /units, replace it with pcb-printf something
+ - add round down
+ - replace ignore_refdes, ignore_value and ignore_descr with genvector
+ - mods:
+ - gpmi (and other buildins/plugins) not showing up in the about box
+- self contained
+ - files
+ - default font
+ - action (--show-paths!) and dialog box to print where the actual files are coming from
+ - project specific menus from extra lihata files - maybe from project.lht
+- main.c:
+ - SIGPIPE - detect it (needed for popen)
+
+CLEANUP #7: the big object split
+- remove pcb_obj_type_t from const.h - use obj_any.h instead
+
+
+
+
+FEATURES
+- BUILD: menuconfig and a config file for scconfig
+
+Low prio:
+- bug: redrawbug1: grap c1, the diagonal trace gets dran over U1's silk - it's redrawn because of the overlapping bounding box with C1, while U1 has no overlap [report:Evan]
+- bug: draw overlapping lines, a short fully under a long; click on the short, it gets selected but it's not visible because the long hides it [report:Evan]
+- GTK "save as" dialog: there should be an "auto" or "guess by extension" option in the save dialog format
+- insert drag&drop strangeness (mainline too):
+ insert should just insert a new point and stop there, not starting a drag&drop
+ move; the new point should be marked somehow (e.g. green-find one half of the
+ object, like arc split does) lines can be inserted mostly only in all-dir-line
+ which is strange
+- missing rotate polygon (mainline too)
+- zoom in too deep onto board edge and the implicit outline rectangle behaves strangely [report:Evan]
+- scconfig: check if it picks up settings from env vars (for a gentoo build)
+- replace mkdtemp() with something safer
+- display net names on pins, vias (and maybe tracks?) when zoomed in enough
+- DRC should warn for thin poly hair
+- rotate shaped vias don't rotate the shape (is via rotated at all?)
+- new examples
+ - blinking led with parametric footprints
+ - example of nonetlist: 1206 jumpers and logos
+- decide what to do with old doc - texi doesn't seem to work at all
+- rethink/rewrite the action/change infrastructure - too many void *ptr1
+ pointers, too many code duplication
+- double sided board, poly on both layers; grab existing lines on one layer and
+ move then around. If all layers are visible, redraw of the far side layer
+ is slow and causes flickering elements from that layer until the front is
+ redrawn. Maybe we should have less flushes?
+- gpmi:
+ - dialog: attribute dialog: mini parser from text
+ - fix debug draw in the gtk hid
+ - ACTE_action(): coords should not be int but Coord
+ - get timers to work
+- dmalloc: #include from the bottom from each file. Is this a good idea?!
+- win32 port {large}
+ - clean up central Makefile.in rules:
+ - remove cat, sed, grep where possible, use scconfig instead
+- arc bug: draw an arc with one end out of the drawing area; it will be jumpy and can not be placed properly
+ -> AttachForCopy() calls SetCrosshairRange() that then sets corsshair max* which
+ limits the arc to move freely. Problem: this is not arc-specific, this happens with any buffer copy! going for no-design-limit is probably better
+- while drawing a line, the temporary outline should reflect the layer color
+- push&shove
+ - keep 45-deg knee when grabbing a point for drag&drop in non-all-dir
+- examine current handling of long options [miloh]
+- --dump-actions shows gpmi paths ( is this related? it looks unexpected to me)
+- unify gui invocation options: why do pcb --help gtk & pcb --help lesstif show differerent input methods [report:miloh]
diff --git a/doc-rnd/UNIX.txt b/doc/UNIX.txt
similarity index 100%
rename from doc-rnd/UNIX.txt
rename to doc/UNIX.txt
diff --git a/doc-rnd/conf/groups.html b/doc/conf/groups.html
similarity index 100%
rename from doc-rnd/conf/groups.html
rename to doc/conf/groups.html
diff --git a/doc/conf/index.html b/doc/conf/index.html
new file mode 100644
index 0000000..d8c5aa4
--- /dev/null
+++ b/doc/conf/index.html
@@ -0,0 +1,92 @@
+<html>
+<body>
+<H1> The new config system in pcb-rnd </H1>
+<H2> Why, what was wrong with the old one? </H2>
+The old config system had several limitations that would have been
+hard to fix keeping the original design:
+<ul>
+ <li> config settings were specified in a flat list - no <a href="groups.html"> grouping </a>
+ <li> the core had a rather static system - HIDs or plugins couldn't extend it, thus they had <a href="noextend.html"> to invent their own </a> config files
+ <li> ... this led to a variety of configuration formats; using one format not always because it was better suited for the task, but for historical reasons
+ <li> ... this also led to a collection of config files - again not always split by boundaries of settings, but often by arbitrary boundaries of code
+ <li> the old system didn't support lists or arrays well
+ <li> it didn't have a coherent concept of how settings from different <a href="sources.html"> sources </a> would override each other
+ <li> ... this resulted in the rigid structure that most of the settings could come from only one place (e.g. if it's an user setting, the design won't be able to override it)
+</ul>
+
+<H2> What the new system offers </H2>
+<ul>
+ <li> unified format: <a href="http://repo.hu/projects/lihata"> lihata </a> ...
+ <li> ... more future proof: generic markup language - easier to extend without having to worry about breaking the syntax
+ <li> ... the configuration is represented in a tree, grouped by the nature of settings
+ <li> ... there are <a href="lists.html">arrays and lists</a>
+ <li> ... a config file can overwrite a list or <a href="lists.html">prepend/append</a> to it (e.g. design-level config prepending an extra library path keeping system set paths as well)
+ <li> there are different <a href="sources.html"> sources </a> of configuration, e.g. system-wise, user-wise, project-wise, etc.
+ <li> the user has the power to change default config <a href="prio.html">priority per setting</a>; e.g. normally design config overrides user config, but it's possible to mark a setting from user config so strong that it overrides even the setting read from the .pcb file
+ <li> the way settings are stored is flexible and extensible so that a plugin can define their subtree of settings
+ <li> ... since the API even makes it easier to access such settings (vs. parsing your own config file), plugins will tend to use the unified config format/system instead of inventing their own
+ <li> ... the GUI (gtk's preferences dialog) thus can automatically handle the new settings
+ <li> ... plugins don't have to implement actions to set/toggle/query their settings for the menu system, there are generic config set/toggle/query actions the menu config can use
+ <li> ... plugins also get the multi-source, <a href="prio.html">priority-based config mechanism</a>
+ <li> ... which also means plugin settings can be automatically saved as user setting, project setting or even design setting
+ <li> all these are true for all kind of settings, be them GUI preferences, paths, layer colors, grid settings; there should be no exception
+</ul>
+
+<H2> How to get started </H2>
+<ul>
+ <li> If you are an user, read the <a href="index_user.html">user documentation</a>
+ <li> If you are an programmer, read the <a href="index_user.html">user documentation</a> and the <a href="index_prog.html">programmer documentation</a>
+ <li> If you are a plugin programmer, there's a <a href="plugin_chk.html"> plugin programmer's conf checklist </a> that summarizes what to do
+ <li> In any case, these links may help: <a href="syntax.html">syntax</a>, <a href="sources.html">config files</a>, <a href="prio.html">priority handling</a>
+</ul>
+
+
+<H2> But isn't this more complicated for the user? </H2>
+Hopefully not much. There are a few extra features, like
+multiple <a href="sources.html"> sources </a> with levels that did not
+exist in pcb and <a href="lists.html">lists with prepend/append</a>. Some of these
+features present in other software so users should be comfortable with the ideas.
+The learning curve is probably compensated by the more orthogonal system.
+The syntax is also geared for simplicity and easy use with text editors.
+Finally, the new preferences dialog in the GTK HID and config actions help
+the user to explore how settings got used from all the config sources. There's
+an intended layering in complexity: simple things can be done easily without
+having to understand the whole system.
+<p>
+All in all, the extra features the user needs to learn is comparable with
+the old customs that he/she can forget.
+
+<H2> And did it make the code more complicated? </H2>
+The size of the code did not change much after the initial config rewrite.
+The new system has new features, some of which brought in a few hundred lines of
+code, but a similar amount of old code could be removed. What came in is
+infrastructure, what had to go was a bunch of repetitive config parsing,
+boolean-setting-accessor-action code. This means on the long run, the more
+settings are added, the more the new system pays back.
+<p>
+Read access, which is far the most common way to use the config in the
+code (e.g. if (setting == true) { }) is very similar to the old Settings
+system. Write access needs to go through a function call API, but this
+is usually a single call per setting (instead of directly modifying a
+variable).
+<p>
+For plugin programmers, the new system makes life much easier as they can
+plug their settings in.
+
+
+<H2> Compatibility with mainline </H2>
+
+None. The new configuration system uses a new logical structure, new file
+format, new locations on the file system. Most setting names are the same
+or very similar to the old ones. Some settings are renamed for clarity:
+clearance is always called clearance, on the UI, in the code and in
+config files as well (mainline pcb sometimes call it keepaway).The new,
+tree-based logics adds a twist too: full names of settings are paths.
+
+<p>
+
+Since configuration is stored in new files, pcb-rnd settings do not interfere
+with pcb settings on any level.
+
+</body>
+</html>
diff --git a/doc-rnd/conf/index_prog.html b/doc/conf/index_prog.html
similarity index 100%
rename from doc-rnd/conf/index_prog.html
rename to doc/conf/index_prog.html
diff --git a/doc/conf/index_user.html b/doc/conf/index_user.html
new file mode 100644
index 0000000..4bda299
--- /dev/null
+++ b/doc/conf/index_user.html
@@ -0,0 +1,92 @@
+<html>
+<body>
+<H1> The new config system in pcb-rnd </H1>
+<H2> User documentation </H2>
+As of 1.1.0, pcb-rnd switched to a <a href="syntax.html">lihata</a> based configuration system.
+The purpose of this document is to describes the basic system design going into
+enough details to provide the user with full control over the configuration.
+The other side, how the system is implemented is described in the
+<a href="index_prog.html"> programmer's manual </a> and there is also a
+<a href="plugin_chk.html">checklist</a> to assist plugin programmers.
+
+<h2> Architecture: data flows, merging, dispatching </h2>
+The final configuration is a collection of values for
+<a href="groups.html"> all known settings, arranged in a tree</a>. The <i>config
+tree</i> is a theoretical concept; different representations of the tree are
+actually built runtime, in-memory. Pcb-rnd code, plugins and utilities
+are constantly reading these in-memory representations to decide how to
+carry out their tasks.
+<p>
+Config settings are imported from multiple sources: from different files,
+from environment variables, from command line arguments, from the .pcb
+files on load. Any source can define any part of the <i>config tree</i>.
+When the configuration is processed, each source is read into a temporary
+tree and then all the temporary trees are merged into the final
+<i>config tree</i>. The following diagram demonstrates all configuration
+related data flows.
+<p>
+<img src="merging.png">
+</p>
+The leftmost column of nodes are the sources. (Note: paths mentioned there are
+the default paths, for reference, it is possible to change them compile-time.)
+Along the black arrows, from left to right, each source is imported into a
+tree representing a <i>role</i>: the role or
+<a href="sources.html">purpose of the source</a>. The next
+step is following the red arrows in two steps:
+<ul>
+ <li> first merge all the role trees into a flat list; this determines the value of each setting;
+ <li> then dispatch the values to the right component of the code.
+</ul>
+Some components may change some of the settings run-time. The trivial example
+is the GUI (hid_gtk on this diagram) that provides menus and dialog boxes for
+the user to change settings. Such a change is always fed back (blue arrow)
+to the design role tree directly, from where the new value is again merged
+and dispatched along the red arrows. Changes in the design role are saved
+with the .pcb file (thus the bidirectional black arrow between the source and
+the in-memory tree for the design role). Occasionally the user wants to
+save parts of the setting as a <a href="sources.html"> project setting or
+as an user setting</a> - in this case, along the dashed blue lines, the
+corresponding project or user roles are modified. This again results in updating
+the hash and the binary representation; these roles also have
+bidirectional black arrows and their changes are also saved in the original
+source.
+
+<h2> Merge details </h2>
+In the new system it is up to the user to decide what settings are
+system-level and what settings are user- or project-level. This is possible
+because any source can define any setting. In the merging step (red arrows
+between roles and the hash) it may turn out that there are overlaps (multiple
+sources defining value for the same setting) or blind spots (no source
+sets a given item).
+
+<h3> overlaps </h3>
+Each setting in each source has a <a href="prio.html">priority.</a> The
+priority can be defined in the source, or if it is not defined, each source
+inherits a fallback default priority. The fallback is designed to provide
+the intuitive order: cli > design > project > user > system.
+<p>
+When multiple sources are describing a value for the same setting,
+priority decides the final value. Most settings are scalar:
+a single integer, string or a single "yes/no" or "on/off" value (e.g.
+the background color or whether polygons are thin-drawn). For scalars
+the rule is simple: the higher priority value wins and all lower priority
+values are discarded when putting the values into the hash. More
+details: <a href="scalars.html"> how different roles and priorities
+can be used with scalars.</a>
+
+<p>
+There are some settings that are represented as an array or list of
+values. They are described in a lihata list item ("li:") in the config
+files and are generally called lists in this document. How lists
+are merged is controlled by the merging <i>policy</i>, which can be
+in each source, just like the priority is set. Check out the
+<a href="lists.html">list merging section</a> for more details.
+
+<h3> blind spots </h3>
+At the end the code does need a value for each setting, so in the final
+render (after the hash) every setting must have a value. To avoid blind spots,
+values not initialized, there is a built-in configuration file, compiled into
+the executable. This file is loaded into role <i>CFR_INTERNAL</i>, and has
+the lowest priority. This configuration file contains the default value for
+all settings.
+
diff --git a/doc-rnd/conf/lists.html b/doc/conf/lists.html
similarity index 100%
rename from doc-rnd/conf/lists.html
rename to doc/conf/lists.html
diff --git a/doc-rnd/conf/merging.png b/doc/conf/merging.png
similarity index 100%
rename from doc-rnd/conf/merging.png
rename to doc/conf/merging.png
diff --git a/doc-rnd/conf/noextend.html b/doc/conf/noextend.html
similarity index 100%
rename from doc-rnd/conf/noextend.html
rename to doc/conf/noextend.html
diff --git a/doc-rnd/conf/plugin_chk.html b/doc/conf/plugin_chk.html
similarity index 100%
rename from doc-rnd/conf/plugin_chk.html
rename to doc/conf/plugin_chk.html
diff --git a/doc/conf/prio.html b/doc/conf/prio.html
new file mode 100644
index 0000000..25becf1
--- /dev/null
+++ b/doc/conf/prio.html
@@ -0,0 +1,22 @@
+<html>
+<body>
+<H1> The new config system in pcb-rnd </H1>
+<H2> Priorities </H2>
+
+Priority is an integer property of each config root.
+<a href="syntax.html">Syntax-wise</a> it is part of the name of the config
+root. In the lihata config file it is either specified or omitted. When
+omitted, <a href="sources.html"> a role dependent default value</a> is
+used. The default values are chosen in an intuitive way, thus most
+commonly the priority value is omitted.
+<p>
+For <a href="scalars.html">scalar</a> settings, the highest priority
+value determines the final value of a setting after the merge. If there
+is a tie, role decides: the role closer to the CLI is stronger.
+<p>
+For <a href="lists.html">lists</a> and arrays, priority determines the
+order of merge, which changes the order of items in the final list as
+config roots prepend and append items.
+
+
+
diff --git a/doc/conf/scalars.html b/doc/conf/scalars.html
new file mode 100644
index 0000000..eb2f254
--- /dev/null
+++ b/doc/conf/scalars.html
@@ -0,0 +1,56 @@
+<html>
+<body>
+<H1> The new config system in pcb-rnd </H1>
+<H2> Scalars </H2>
+
+Scalar settings have only one value after the merge. The only <i>policy</i>
+available is <i>overwrite</i> - this policy is applied regardless of the
+current policy setting.
+
+<h2> examples </h2>
+
+<h3> simple overwrite </h3>
+Config sources:
+<table border=1>
+ <tr><th> role <th> priority <th> policy <th> content
+ <tr><td> system <td> 200 <td> overwrite <th> A
+ <tr><td> user <td> 400 <td> overwrite <th> (not defined)
+ <tr><td> project <td> 600 <td> overwrite <th> Q
+</table>
+<p>
+Merge iterations:
+<table border=1>
+ <tr><th> step <th> description <th> output list after executing this step <th> remarks
+ <tr><td> 0. <td> reset the output <td> (empty) <td>
+ <tr><td> 1. <td> apply <i>system</i> <td> A <td>
+ <tr><td> 2. <td> apply <i>user</i> <td> A <td> "not defined" doesn't mean "empty", so the list is not deleted - no change
+ <tr><td> 3. <td> apply <i>project</i><td> Q <td> replace the original output because of the overwrite policy
+</table>
+<p>Example scenario: system default overridden by a project setting.
+
+<h3> user-forced value </h3>
+Config sources append:
+<table border=1>
+ <tr><th> role <th> priority <th> policy <th> content
+ <tr><td> system <td> 200 <td> overwrite <th> A
+ <tr><td> user <td> 650 <td> overwrite <th> E
+ <tr><td> project <td> 600 <td> overwrite <th> Q
+</table>
+<p>
+Merge iterations:
+<table border=1>
+ <tr><th> step <th> description <th> output list after executing this step <th> remarks
+ <tr><td> 0. <td> reset the output <td> (empty) <td>
+ <tr><td> 1. <td> apply <i>system</i> <td> A <td>
+ <tr><td> 2. <td> apply <i>project</i><td> Q <td>
+ <tr><td> 3. <td> apply <i>user</i> <td> E <td>
+</table>
+<p>Example scenario: user preference enforced: even if the project file would use
+'Q' for the given setting, the user prefers 'E'. This affects runtime
+(the value of the setting after the merge, in other words how pcb-rnd works),
+but does not change the project configuration. This allows the given user to
+always use 'E' for the given setting while lets other users working on the
+same project use the value set in the project file.
+
+
+
diff --git a/doc/conf/sources.html b/doc/conf/sources.html
new file mode 100644
index 0000000..153a683
--- /dev/null
+++ b/doc/conf/sources.html
@@ -0,0 +1,72 @@
+<html>
+<body>
+<H1> The new config system in pcb-rnd </H1>
+<H2> Sources </H2>
+There are different sources of configuration settings. These are
+different configuration files, sometimes located on the file system.
+The full list of config sources is:
+
+<table border=1>
+<tr><th> role <th> default<br>setting<br>prio <th> location <th> presence <th> remarks
+<tr><td> internal
+ <td> 100
+ <td> (compiled into the executable)
+ <td> always
+ <td> the ultimate fallback; allows pcb-rnd even if no other configuration file is found
+
+
+<tr><td> system
+ <td> 200
+ <td> /usr/share/pcb-rnd/pcb-conf.lht
+ <td> recommended
+ <td> should hold system and installation specific settings, e.g. path to the system-wise installed footprint library
+
+<tr><td> default.pcb
+ <td> 300
+ <td> /usr/share/pcb-rnd/default.pcb
+ <td> deprecated
+ <td> pcb editable defaults
+
+<tr><td> user
+ <td> 400
+ <td> ~/.pcb-rnd/pcb-conf.lht
+ <td> recommended
+ <td> store user preferences, user's common footprint lib path, etc; this is the first file the user can modify (even from the GUI)
+
+<tr><td> environment
+ <td> 500
+ <td> environment variables (TODO)
+ <td> occasional
+ <td> inject the same (temporary) settings in multiple pcb-rnd sessions without having to change config files
+
+<tr><td> project
+ <td> 600
+ <td> project.lht in the project directory
+ <td> optional
+ <td> local project settings - useful for large projects with multiple design (.pcb) files
+
+<tr><td> design
+ <td> 700
+ <td> saved in the design (.pcb) file
+ <td> optional, common
+ <td> per design deviation from the user+system config
+
+<tr><td> cli
+ <td> 800
+ <td> command line argument
+ <td> occasional
+ <td> inject/change a setting for a single session; useful in batch/automated processing
+</table>
+
+<p>
+Pcb-rnd reads them all, then merges all settings into a master binary
+representation. If a setting is specified in multiple sources, the one
+with the higher priority wins, except for lists where it is also possible
+to prepend/append items. Default priorities are designed to result
+precedence in an intuitive way (e.g. design settings overwrite user settings).
+However, <a href="prio.html">priority can be changed</a> per setting, resulting
+in weak settings ("use this value if it was not already set") or strong settings
+("I always want to use mincut, so I enable it from my user's config with high
+priority and a version controlled project setting can not turn it off")
+
+
diff --git a/doc-rnd/conf/src/Makefile b/doc/conf/src/Makefile
similarity index 100%
rename from doc-rnd/conf/src/Makefile
rename to doc/conf/src/Makefile
diff --git a/doc-rnd/conf/src/merging.dot b/doc/conf/src/merging.dot
similarity index 100%
rename from doc-rnd/conf/src/merging.dot
rename to doc/conf/src/merging.dot
diff --git a/doc/conf/syntax.html b/doc/conf/syntax.html
new file mode 100644
index 0000000..5b82ac8
--- /dev/null
+++ b/doc/conf/syntax.html
@@ -0,0 +1,45 @@
+<html>
+<body>
+<H1> The new config system in pcb-rnd </H1>
+<H2> Config file syntax </H2>
+
+The config file syntax is <a href="http://repo.hu/projects/lihata">lihata</a>.
+Most users don't need to understand most of the syntax, just follow the
+patterns seen in the examples. A few thumb of rules:
+<ul>
+ <li> structural nodes usually start with a ha: or li: prefix; which one needs to be used is pretty much tied to the node name; thus casual users don't need to care about what they are for, just remember them as part of the name
+ <li> non-structural nodes are usually given in the form of name = value; use braces around the value if it contains any non-alphanumeric, non-whitespace character
+ <li> list and array members should better be braced
+ <li> list and array separator should be semicolon (not comma)
+</ul>
+
+<H3> config root syntax </H3>
+<p>
+A pcb-rnd config file, (or <i>document</i> for short) has a single root
+node whose name must be li:pcb-rnd-conf-v1 - this is the signature of the
+document. It is a flat list of one or more <i>config root/</i> subtrees.
+TODO: is this really a list or a hash?
+<p>
+Each config root is a partial description of the
+<a href=index_user.html"> config tree </a> (which is the logical
+configuration of all possible settings). Config roots have a policy and
+a <a href="prio.html">priority</a> attached. This is done in the name
+of the config root, which must be of the form of <i>policy-priority</i>,
+e.g. "overwrite-300" or "append-125". The priority part (with the dash)
+can be omitted (and then the per role default priority is used), e.g.
+"overwrite" or "append" are valid config root names.
+<p>
+Under the config root, a tree of sections (hashes) and setting values
+(text nodes) are built. These structures and values are in 1:1
+correspondence with <a href="groups.html">the config tree</a>. Excess
+(unknown) keys are considered a warning (except in the plugin/ and
+utils/ subtrees). Missing keys or missing subtrees is normal because a config
+root can be partial.
+<p>
+TODO: examples
+
+<H3> list syntax </h3>
+TODO: list syntax
+
+<H3> in project files </H3>
+TODO
diff --git a/doc-rnd/conf/tree/CFN_BOOLEAN.html b/doc/conf/tree/CFN_BOOLEAN.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_BOOLEAN.html
rename to doc/conf/tree/CFN_BOOLEAN.html
diff --git a/doc-rnd/conf/tree/CFN_COLOR.html b/doc/conf/tree/CFN_COLOR.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_COLOR.html
rename to doc/conf/tree/CFN_COLOR.html
diff --git a/doc-rnd/conf/tree/CFN_COORD.html b/doc/conf/tree/CFN_COORD.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_COORD.html
rename to doc/conf/tree/CFN_COORD.html
diff --git a/doc-rnd/conf/tree/CFN_INCREMENTS.html b/doc/conf/tree/CFN_INCREMENTS.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_INCREMENTS.html
rename to doc/conf/tree/CFN_INCREMENTS.html
diff --git a/doc-rnd/conf/tree/CFN_INTEGER.html b/doc/conf/tree/CFN_INTEGER.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_INTEGER.html
rename to doc/conf/tree/CFN_INTEGER.html
diff --git a/doc-rnd/conf/tree/CFN_LIST.html b/doc/conf/tree/CFN_LIST.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_LIST.html
rename to doc/conf/tree/CFN_LIST.html
diff --git a/doc-rnd/conf/tree/CFN_REAL.html b/doc/conf/tree/CFN_REAL.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_REAL.html
rename to doc/conf/tree/CFN_REAL.html
diff --git a/doc-rnd/conf/tree/CFN_STRING.html b/doc/conf/tree/CFN_STRING.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_STRING.html
rename to doc/conf/tree/CFN_STRING.html
diff --git a/doc-rnd/conf/tree/CFN_UNIT.html b/doc/conf/tree/CFN_UNIT.html
similarity index 100%
rename from doc-rnd/conf/tree/CFN_UNIT.html
rename to doc/conf/tree/CFN_UNIT.html
diff --git a/doc-rnd/conf/tree/appearance.html b/doc/conf/tree/appearance.html
similarity index 100%
rename from doc-rnd/conf/tree/appearance.html
rename to doc/conf/tree/appearance.html
diff --git a/doc-rnd/conf/tree/appearance_color.html b/doc/conf/tree/appearance_color.html
similarity index 100%
rename from doc-rnd/conf/tree/appearance_color.html
rename to doc/conf/tree/appearance_color.html
diff --git a/doc/conf/tree/appearance_loglevels.html b/doc/conf/tree/appearance_loglevels.html
new file mode 100644
index 0000000..651cb4b
--- /dev/null
+++ b/doc/conf/tree/appearance_loglevels.html
@@ -0,0 +1,14 @@
+<html><body>
+<h1>pcb-rnd conf tree</h1>
+<h2>subtree: appearance/loglevels</h2>
+<table border=1>
+<tr><th>node name <th> type <td> flags <td> description
+<tr><td> debug_tag <td><a href="CFN_STRING.html"> string </a><td> 0 <td> log style tag of debug messages
+<tr><td> debug_popup <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> whether a debug line should pop up the log window
+<tr><td> info_tag <td><a href="CFN_STRING.html"> string </a><td> 0 <td> log style tag of info messages
+<tr><td> info_popup <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> whether an info line should pop up the log window
+<tr><td> warning_tag <td><a href="CFN_STRING.html"> string </a><td> 0 <td> log style tag of warnings
+<tr><td> warning_popup <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> whether a warning should pop up the log window
+<tr><td> error_tag <td><a href="CFN_STRING.html"> string </a><td> 0 <td> log style tag of errors
+<tr><td> error_popup <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> whether an error should pop up the log window
+</table></body></html>
diff --git a/doc-rnd/conf/tree/appearance_messages.html b/doc/conf/tree/appearance_messages.html
similarity index 100%
rename from doc-rnd/conf/tree/appearance_messages.html
rename to doc/conf/tree/appearance_messages.html
diff --git a/doc-rnd/conf/tree/appearance_misc.html b/doc/conf/tree/appearance_misc.html
similarity index 100%
rename from doc-rnd/conf/tree/appearance_misc.html
rename to doc/conf/tree/appearance_misc.html
diff --git a/doc-rnd/conf/tree/appearance_pinout.html b/doc/conf/tree/appearance_pinout.html
similarity index 100%
rename from doc-rnd/conf/tree/appearance_pinout.html
rename to doc/conf/tree/appearance_pinout.html
diff --git a/doc-rnd/conf/tree/design.html b/doc/conf/tree/design.html
similarity index 100%
rename from doc-rnd/conf/tree/design.html
rename to doc/conf/tree/design.html
diff --git a/doc-rnd/conf/tree/editor.html b/doc/conf/tree/editor.html
similarity index 100%
rename from doc-rnd/conf/tree/editor.html
rename to doc/conf/tree/editor.html
diff --git a/doc/conf/tree/editor_selection.html b/doc/conf/tree/editor_selection.html
new file mode 100644
index 0000000..5b70117
--- /dev/null
+++ b/doc/conf/tree/editor_selection.html
@@ -0,0 +1,8 @@
+<html><body>
+<h1>pcb-rnd conf tree</h1>
+<h2>subtree: editor/selection</h2>
+<table border=1>
+<tr><th>node name <th> type <td> flags <td> description
+<tr><td> disable_negative <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> selection box behaviour: disable the negative-direction selection - any selection box will select only what's fully within the box
+<tr><td> symmetric_negative <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> selection box behaviour: when set, the selection direction is considered negative only if the box has negative size in the X direction
+</table></body></html>
diff --git a/doc-rnd/conf/tree/editor_view.html b/doc/conf/tree/editor_view.html
similarity index 100%
rename from doc-rnd/conf/tree/editor_view.html
rename to doc/conf/tree/editor_view.html
diff --git a/doc/conf/tree/rc.html b/doc/conf/tree/rc.html
new file mode 100644
index 0000000..0748ec1
--- /dev/null
+++ b/doc/conf/tree/rc.html
@@ -0,0 +1,27 @@
+<html><body>
+<h1>pcb-rnd conf tree</h1>
+<h2>subtree: rc</h2>
+<table border=1>
+<tr><th>node name <th> type <td> flags <td> description
+<tr><td> verbose <td><a href="CFN_INTEGER.html"> integer </a><td> 0 <td> <verbose>
+<tr><td> quiet <td><a href="CFN_INTEGER.html"> integer </a><td> 0 <td> print only errors on stderr
+<tr><td> backup_interval <td><a href="CFN_INTEGER.html"> integer </a><td> 0 <td> time between two backups in seconds
+<tr><td> font_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template; if not empty, run this command and read its output for loading the font; %f is the file name
+<tr><td> file_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template; if not empty, run this command and read its output for loading a pcb file; %f is the file name, %p is the conf setting rc.file_path
+<tr><td> file_path <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <file_path>
+<tr><td> library_shell <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <library_shell>
+<tr><td> library_search_paths <td><a href="CFN_LIST.html"> list </a><td> 0 <td> <library_search_paths>
+<tr><td> emergency_name <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template for emergency save anonymous .pcb files (when pcb-rnd crashes); optional field: %ld --> pid; must be shorter than 240 characters. Don't do emergency save if this item is empty.
+<tr><td> backup_name <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template for periodic backup anonymous .pcb files; optional fields: %P --> pid
+<tr><td> save_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> command to pipe the pcb, footprint or buffer file into, when saving (makes lihata persist impossible)
+<tr><td> keep_save_backups <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> a copy is made before a save operation overwrites an existing file; if this setting is true, keep the copy even after a successful save
+<tr><td> default_font_file <td><a href="CFN_LIST.html"> list </a><td> 0 <td> name of default font file (list of names to search)
+<tr><td> default_pcb_file <td><a href="CFN_LIST.html"> list </a><td> 0 <td> <default_pcb_file>
+<tr><td> script_filename <td><a href="CFN_STRING.html"> string </a><td> 0 <td> PCB Actions script to execute on startup
+<tr><td> action_string <td><a href="CFN_STRING.html"> string </a><td> 0 <td> PCB Actions string to execute on startup
+<tr><td> rat_path <td><a href="CFN_STRING.html"> string </a><td> 0 <td> <rat_path>
+<tr><td> rat_command <td><a href="CFN_STRING.html"> string </a><td> 0 <td> file name template; if not empty, run this command and read its output for loading a rats; %f is the file name, %p is the rc.rat_path conf setting
+<tr><td> preferred_gui <td><a href="CFN_LIST.html"> list </a><td> 0 <td> if set, try GUI HIDs in this order when no GUI is explicitly selected
+<tr><td> save_final_fallback_fmt <td><a href="CFN_STRING.html"> string </a><td> 0 <td> when a new file is created (by running pcb-rnd with the file name) there won't be a known format; pcb-rnd will guess from the file name (extension) but eventhat may fail. This format is the final fallback that'll be used if no other guessing mechanism worked. The user can override this by save as.
+<tr><td> have_regex <td><a href="CFN_BOOLEAN.html"> boolean </a><td> 0 <td> whether we have regex compiled in
+</table></body></html>
diff --git a/doc-rnd/conf/tree/rc_path.html b/doc/conf/tree/rc_path.html
similarity index 100%
rename from doc-rnd/conf/tree/rc_path.html
rename to doc/conf/tree/rc_path.html
diff --git a/doc-rnd/conf/tree/temp.html b/doc/conf/tree/temp.html
similarity index 100%
rename from doc-rnd/conf/tree/temp.html
rename to doc/conf/tree/temp.html
diff --git a/doc/contrib.html b/doc/contrib.html
new file mode 100644
index 0000000..00fba94
--- /dev/null
+++ b/doc/contrib.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+ <title> pcb-rnd - contribution </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - contribution </h1>
+
+If you are interested to help out, please contact me using
+<a href="irc.html"> the live chat (CET daytime)</a> or mail to:
+pcb-rnd (at) igor2.repo.hu.
+
+<H2> Contributing as a user </h2>
+Using pcb-rnd in production and just reporting bugs is already a huge contribution.
+<p>
+More dedicated users can join in scheduled, systematic testing. Such testing
+is split up into independent chunks that each can be done in an hour.
+<p>
+Even more dedicated users can join developing the documentation.
+<p>
+None of the above requires or assumes any programming skill.
+
+<H2> Contributing as a developer </h2>
+
+The project is lead in an autocratic way by Igor2.
+
+Developer freedom taken away:
+<ul>
+ <li> the basic concept of pcb-rnd is set and won't change
+ <li> the toolchain is chosen, and won't change; the usual hot topics: svn, scconfig, <a href="developer/c89.html">C</a>.
+ <li> don't add code that restricts usability for others; add code that increases usability for some; thus prefer to add code in plugins!
+</ul>
+<p>
+Developer freedom promptly granted:
+<ul>
+ <li> svn commit access from day 0
+ <li> work together in trunk/, not alone in a branch
+ <li> pcb-rnd has a strong plugin support; want to implement a strange/controversial feature? In a plugin, almost anything goes
+ <li> especially in plugins, work on whatever you want, even if noone else needs that feature
+</ul>
+<p>
+Coding style/indentation: there's an <a href="developer/indent.html">unified style</a>
+in core and core plugins. If you work on those parts, try to stick to it. If you
+are working on a new plugin, it's still the preferred style but you can use
+a different style. However, the rule is that if someone else starts hacking
+that part too, he is allowed to convert the code to the unified format; but
+unified format can not be converted to anything else. So it's a one way
+process which long term grants unified style while not demotivates a plugin
+developer by forcing a style on him in the early, "when the bulk of the code
+is written" phase.
+</body>
+</html>
diff --git a/doc/developer/c89.html b/doc/developer/c89.html
new file mode 100644
index 0000000..e208157
--- /dev/null
+++ b/doc/developer/c89.html
@@ -0,0 +1,14 @@
+<html>
+<body>
+<h1> pcb-rnd - C89 </h1>
+
+The code is written in C, namely C89 for most parts with a few exceptions
+written in C99. It's not yet decided whether the code will be C89 or C99
+long term. If it'll be C89, the C99 parts will be rewritten. If it'll be
+C99, new code can use C99 features freely. Until the decision, keep
+new code C89. Especially watch out for these:
+<ul>
+ <li> comment: always use /* */, never //
+ <li> don't mix variable declaration with code - open a new {} block, which will also scope your new variables, or better yet, split up the function into smaller, static functions, the compiler will inline them anyway
+ <li> try to avoid vararg macros, use vararg functions instead
+</ul>
diff --git a/doc/developer/data.html b/doc/developer/data.html
new file mode 100644
index 0000000..36ddb55
--- /dev/null
+++ b/doc/developer/data.html
@@ -0,0 +1,103 @@
+<html>
+<body>
+
+<h1> pcb-rnd internals </h1>
+
+<h2> concepts </h2>
+
+Convention: typedef'd types are called pcb_*_t - the corresponding struct
+is pcb_*_s.
+
+<h3> board </h3>
+There is only one board being edited. A board is the model of the whole world
+for pcb-rnd - any other, auxiliary data is only a partial description of a board.
+The data struct for board is <i>pcb_board_t</i>. As of now, pcb-rnd edits only one
+board at a time, and it is stored in a global variable called <i>PCB</i>.
+The code is single threaded and is not reentrant.
+<p>
+Half of the board structure describes global board properties:
+<ul>
+ <li> layer stack
+ <li> netlist
+ <li> editor settings (e.g. routing styles, which layers are visible)
+ <li> metadata (such as name of the author, size of the board).
+</ul>
+The other half is the actual board data, stored in a <i>pcb_data_t</i> field.
+<p>
+Relevant structs, variables and functions are in board.[ch].
+
+<h3> data </h3>
+A <i>pcb_data_t</i> contains everything to describe a "subcircuit" related
+to an existing board:
+<ul>
+ <li> per-layer objects (e.g. lines, arcs, polygons)
+ <li> global objects (e.g. elements, vias)
+ <li> temporary logical connections (rat lines)
+</ul>
+<p>
+Relevant structs, variables and functions are in data.[ch].
+
+<h3> buffers </h3>
+Paste buffers are <i>pcb_buffer_t</i>; the main field is <i>pcb_data_t</i>.
+<p>
+Relevant structs, variables and functions are in buffer.[ch].
+
+<h3> terminology: layers and layer groups</h3>
+<i>Layers</i> are abstract canvases also serving as a logical grouping
+of drawing primitives. Every <i>layer</i> is part of exactly one <i>layer
+group</i>. A <i>layer group</i> is close to what a physical layer is on
+the FR4.
+<p>
+Limitations:
+<ul>
+ <li> as of now pcb-rnd does not have Z-coordinate: layers have no thickness;
+ <li> substrate is not represented at all in the layers stack.
+</ul>
+<p>
+The location of a <i>layer group</i> on of:
+<ul>
+ <li> top (component) side
+ <li> bottom (solder) side
+ <li> inner (signal)
+ <li> global (affects all locations, e.g. the outline layer for routing)
+</ul>
+<p>
+In pcb-rnd only copper layers and the outline layer are fully explicit.
+There are two hardwired silk layers, one for the top and one for the bottom side.
+The silk layers are semi-explicit: they are existing layers in all structs
+but:
+<ul>
+ <li> they are not part of the <i>layer group</i> system
+ <li> unlike explicit layers they have fixed index (+1 and +2 beyond the last explicit layer)
+ <li> created an moved by the core automatically
+ <li> can not be removed
+</ul>
+<p>
+The <i>outline layer</i> is a hack: it's really an internal copper layer. If
+the code detects the name of the layer is "outline" anywhere, it branches.
+<p>
+There are a few virtual layers:
+<ul>
+ <li> solder mask - no layer struct, calculated on-the-fly from pad data
+ <li> paste - no layer struct, calculated on-the-fly from pad data
+ <li> fab - no layer struct, calculated on-the-fly from drill/hole data
+</ul>
+
+<h3> pcb_data_t: global data </h3>
+Global data affect all layers. The most trivial example is <i>via</i>:
+it has a hole and the same copper ring on all layers. The other global
+object pcb_data_t holds is an element. An element can have pads
+on two copper layers and pins that affect all layers the same way as vias.
+
+<h3> pcb_data_t: layer-local data </h3>
+The data struct has a <i>pcb_layer_t</i> for each logical layer, to host
+the per layer objects (drawing primitives).
+
+<h3> the layer struct </h3>
+Layer data is stored in struct <i>pcb_layer_t</i>. A layer has a list
+for each object type (drawing primitive type): arcs, lines, polygons, etc.
+<p>
+Relevant structs, variables and functions are in layer.[ch].
+
+<h2> map </h2>
+<img src="data1.png">
diff --git a/doc/developer/data1.png b/doc/developer/data1.png
new file mode 100644
index 0000000..5aadcb6
Binary files /dev/null and b/doc/developer/data1.png differ
diff --git a/doc-rnd/ddrc/examples1.txt b/doc/developer/ddrc/examples1.txt
similarity index 100%
rename from doc-rnd/ddrc/examples1.txt
rename to doc/developer/ddrc/examples1.txt
diff --git a/doc/developer/ddrc/proposal1.txt b/doc/developer/ddrc/proposal1.txt
new file mode 100644
index 0000000..78dd579
--- /dev/null
+++ b/doc/developer/ddrc/proposal1.txt
@@ -0,0 +1,242 @@
+Dynamic DRC proposal 1: a Declarative DRC language.
+
+P0 A DRC program is an unordered list of rules. Rules are evaluated and
+ violations reported. The advantage of a declarative language is that
+ intermediate results can be cached and reused.
+
+P1 The language is intended to be human readable and human writable, but
+ the main goal is to let programs and scripts (e.g. netlisters) to
+ generate it.
+
+P2 A rule consists of three parts:
+ - the rule keyword; syntax: rule NAME
+ - build variables (lists) using search statements
+ - state assertions about those lists.
+ - comments, empty lines
+
+P3 Variables are named by the user and are local to the rule (TODO)
+
+P4 Lists are ordered.
+
+P5 A list is consists of zero or more objects. An object is:
+P6 - the board
+P7 - a layer
+P8 - a board drawing primitive (line, arc, polygon, via, text)
+P9 - an element primitive (element line, element arc(?), pin, pad, element name)
+P10 - an element as a whole
+P11 - a net
+P61 - a 2D coordinate with or without layer information
+
+P12 Objects have named properties (or fields):
+P13 - core attributes: for each object type a predefined set of key=value
+ pairs that always exist (e.g. thickness of a line, start angle of
+ an arc); these field names starts with "p."
+P14 - user attributes: free-form key=value pairs optionally assigned by
+ the user; these field names start with "a."
+
+P15 Note: the language is case sensitive with keywords and builtins using
+ lowercase only. For better readability, in syntax description in this
+ document uppercase words are user chosen identifiers or fields. Whitespace
+ character sequences are usually treated as a single whitespace. (This
+ does not mean identifiers have to be uppercase in a program.)
+
+ The syntax of a search statement is:
+
+P16 let LISTNAME EXPR
+
+P17 It creates a list called LISTNAME and evaluates expression EXPR to all
+ available objects and adds the objects that match EXPR to the list. Each
+ matching object is added only once. The particular order of objects on
+ the list is random. Object "matches EXPR" when the EXPR evaluated on
+ the object yields true.
+
+P18 The current object used in the iteration during the search is called
+ @.
+
+P19 An expression returns a value. A value can be:
+P20 - an object
+P21 - a list
+P22 - scalar: a number or string (might be suffixed, like "42 mm")
+P23 - void (empty, also known as false)
+
+P23 A value is considered true if:
+P24 - it is an existing object
+P25 - it is a non-empty list
+P26 - it is a non-zero number or non-empty string
+P69 - it is a valid coordinate
+
+ An expression is one of:
+
+ syntax meaning
+ ----------------------------------------------------------------
+P27 (EXPR) change precedence
+P28 EXPR || EXPR logical OR (result: number)
+P29 EXPR && EXPR logical AND (result: number)
+P30 EXPR + EXPR add (number only)
+P31 EXPR - EXPR subtract (number only)
+P32 EXPR * EXPR multiply or ... (number only)
+P32 EXPR / EXPR multiply or ... (number only)
+P32 EXPR == EXPR the two values are equal
+P33 EXPR != EXPR the two values are not equal
+P71 EXPR ~ string regex match left EXPR using pattern right string
+P34 EXPR > EXPR left EXPR is greater than right EXPR (number only)
+P35 EXPR >= EXPR left EXPR is greater than or equal to right EXPR (number only)
+P36 EXPR < EXPR left EXPR is less than right EXPR (number only)
+P37 EXPR <= EXPR left EXPR is less than or equal to right EXPR (number only)
+P38 !EXPR logical NOT (result: number, 0 or 1)
+P39 FUNC(EXPR, EXPR, ...) call a function with 0 or more arguments
+P40 EXPR.field evaluated to the value of an object field (see P45, P46)
+
+ The syntax of an assertion is:
+
+P41 assert EXPR
+
+P42 If the EXPR in an assert evaluates to false, a DRC violation is generated.
+
+P43 If an assert EXPR is a list anywhere else than in a function argument, it is
+ evaluated for all valid members of the list (see P45, P46). For example
+ if there is a variable called FOO, which is a list of objects
+ (built using a search statement), expression
+
+ FOO.p.thickness
+
+ is evaluated as many times as many objects are on the list, and the
+ full assert is checked each case. If there is another similar list
+ called BAR, an expression:
+
+ (FOO.p.thickness < BAR.p.thickness)
+
+ will compare each possible pair of FOO and BAR objects. That is, if
+ FOO has 4 objects and BAR has 15 objects, that is 4*15 = 60 comparisons.
+
+P44 However, each list is iterated only once, even if it is referenced multiple
+ times in the same expression. For example, with the above lists:
+
+ (FOO.p.clearance > 10 mil) && (FOO.p.thickness < BAR.p.thickness)
+
+ the potential number of iterations is still 4*15, and not 4*4*15. In
+ practice the engine leverages lazy evaluation so if FOO.p.clearance
+ is smaller than 10 mil, the right size is not evaluated. See also: P45, P46.
+
+P45 A field reference is valid if the field exists. For example a line object
+ has a thickness attribute, thus the .p.thickness is valid, but a polygon
+ object does not have a thickness and .p.thickness on a polygon is invalid.
+ An user attribute reference (e.g. field .a.baz) is valid if the attribute
+ key exists in the given object.
+
+P46 Invalid fields are skipped in iterations. Thus if variable BLOBB is a list
+ that consists of 3 line, 2 arc and a layer objects, the following assert
+ will result in 2 comparisons only:
+
+ (BLOBB.p.width >= 10 mm)
+
+ (because only arc objects have valid .p.width field).
+
+P47. An invalid field in an expression is never considered an
+ error. In an assert statement it causes skipping an iteration. In a
+ search statement it evaluates to void.
+
+P48. A void value is never equal to anything. A void value is not equal
+ even to another void value.
+
+P49. Comments are lines starting with #
+
+
+ BUILTIN FUNCTIONS
+
+P70 list(LISTNAME)
+ Within an expression, a reference to a list may become an iterator and
+ refer to a single object. In case the expression needs the list, the
+ list() function protects LISTNAME from becoming an iterator. For
+ example llen(list(@)) is the number of all objects the design consists.
+
+P50 llen(EXPR)
+ Returns to the number of items of a list (an integer number >= 0).
+
+P51 lvalid(EXPR, field)
+ Returns a list of items on the list for which field is valid.
+ EXPR can be a list or an object.
+
+P52 lunion(EXPR1, EXPR2)
+ A new list is created; items of EXPR1 are copied to the new list in order.
+ Those items from EXPR2 that are not on the list already are appended,
+ keeping their order. The new list is returned.
+
+ Both EXPR1 and EXPR2 can be either a list or an object.
+
+ Note: order of arguments does matter (affects order of objects on the
+ resulting list).
+
+P53 lintersect(EXPR1, EXPR2)
+ A new list is created; items that are present on both EXPR1 and EXPR2
+ are copied onto the new list. The new list is returned.
+
+ Both EXPR1 and EXPR2 can be either a list or an object.
+
+ Note 1: this function can be used as "is this object on the list" query:
+ list_intersection(LIST, OBJ) will result an empty list (which means false)
+ if OBJ is not on the list.
+
+ Note 2: similarly, if both argument are objects, the result is false
+ if the two arguments are not the same object.
+
+P54 lcomplement(EXPR1, EXPR2)
+ Creates a new list with all items that are present in EXPR1 but not in
+ EXPR2. The new list is returned.
+
+ Both EXPR1 and EXPR2 can be either a list or an object.
+
+
+P55 ldiff(EXPR1, EXPR2)
+ Creates a new list with all items that are present either in EXPR1 or in
+ EXPR2 but not in both. The new list is returned.
+
+
+P56 distance(EXPR1, EXPR2)
+ Calculates the shortest distance between two objects. Returns a number.
+
+ Note: if any expression is a layer, the stack distance is calculated
+ (which will be 0 for now, as pcb-rnd doesn't yet know about layer thickness).
+ If the expression is a net, the whole shape of the net is used
+ (expensive! use is_closer() instead)
+ If the expression is the board, the operation is invalid (see P46).
+
+P57 is_closer(EXPR1, EXPR2, NUMBER)
+ Checks if EXPR1 and EXPR2 are closer to each-other than NUMBER. It uses
+ the classic bloat-and-find algorithm originally used by the classic DRC,
+ thus it is much cheaper than distance(EXPR1, EXPR2) < NUMBER.
+
+P58 netlen(EXPR)
+ Network length of EXRP1: sum of all non-overlapping trace/arc lengths that
+ make up a network; polygons are approximated with their average diameter
+ (TODO). If EXPR is an object, its length is returned.
+
+P59 netobjs(EXPR)
+ Creates and returns a list of objects consists of a net.
+
+P60 type(EXPR, TYPENAME)
+ EXPR is an object. Returns the object if it's type matches TYPENAME, else
+ returns void (a.k.a. false). This call is useful to decide whether an
+ object is of a specific type. TYPENAME is one of:
+ - drawing primitive type: arc, line, polygon, text, via, element
+ - element primitive type: element_line, element_name, pin, pad
+ - misc type: layer, net
+ - meta-type, or a group:
+ - copper: primitive that results in copper (arc, line, polygon, text (on copper), via, pin, pad)
+ - drilled: anything that drills the board (via, pin)
+
+P62 gridup(EXPR, NUM1, NUM2)
+ If expression is an object, return a list of coordinates that are on
+ the object, evenly spaced:
+P63 - for lines and arcs, the points are evenly spaced on the centerlane with
+ a gap of NUM1, starting from both endpoints, having the corner case in
+ the middle; if NUM2 is 0, the gap at the middle may be larger than NUM1,
+ else it may be smaller than NUM1.
+P64 - for polygons take a grid of NUM1*NUM2 spacing (NUM1 is always axis
+ aligned to X, NUM2 to Y). The offset of the grid is unspecified
+P65 - element and text are ignored
+P66 - a pad or pin is approximated with a polygon
+P67 - for networks, iterate over all objects and append unique coordinates on
+ the resulting list
+P68 There's no guarantee on the particular order of the list.
+
diff --git a/doc/developer/ddrc/requirements.txt b/doc/developer/ddrc/requirements.txt
new file mode 100644
index 0000000..83205fb
--- /dev/null
+++ b/doc/developer/ddrc/requirements.txt
@@ -0,0 +1,23 @@
+The Dynamic DRC should be able to solve at least these tasks:
+ - check start grounding
+ - require element placement on same layer
+ - specify element proximity to each other on same layer
+ - specify element proximity to the edge
+ - specify element proximity to network or other copper feature
+ on the same layer
+ - perform copper vs. copper checks
+ - minimal gap between an object or network and anything else
+ - minimal gap between high voltage and low voltage networks
+ - perform copper geometry checks
+ - detect minimal width (high current)
+ - detect poly hairpin
+ - number and length of stubs (hight freq)
+ - "via cage": a given network needs to be surrounded by a set of gnd vias
+ - network related copper checks
+ - matched length lines (e.g. fast dram bus)
+ - balanced transmission line (distance between the tracks)
+ - match and/or limit number of vias
+ - limit layer usage
+ - require layer stackup properties, e.g. microstrip, stripline
+ - e.g. require ground poly on the next layer
+ - e.g. number of gaps in the ground poly the line jumps
diff --git a/doc-rnd/distros.txt b/doc/developer/distros.txt
similarity index 100%
rename from doc-rnd/distros.txt
rename to doc/developer/distros.txt
diff --git a/doc/developer/hid_remote/Makefile b/doc/developer/hid_remote/Makefile
new file mode 100644
index 0000000..1038657
--- /dev/null
+++ b/doc/developer/hid_remote/Makefile
@@ -0,0 +1,9 @@
+proto_parse.svg: proto_parse.dot fixlab.sh
+ ./fixlab.sh < proto_parse.dot > .proto_parse.dot
+ dot -Tsvg .proto_parse.dot > proto_parse.svg
+
+
+proto_parse.png: proto_parse.dot fixlab.sh
+ ./fixlab.sh < proto_parse.dot > .proto_parse.dot
+ dot -Tpng .proto_parse.dot > proto_parse.png
+
diff --git a/doc/developer/hid_remote/fixlab.sh b/doc/developer/hid_remote/fixlab.sh
new file mode 100755
index 0000000..276a4c7
--- /dev/null
+++ b/doc/developer/hid_remote/fixlab.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+awk '
+($2 == "->") {
+
+ if (NF > 3) {
+ attr=$0
+ if (!(attr ~ "[[]"))
+ attr = attr "[]"
+ }
+ else
+ attr = "[]"
+
+ tmp = "lbl" (++lbl)
+ if (attr ~ "label")
+ extra_label=""
+ else
+ extra_label="label=\"\""
+
+ tmp_attr = attr
+ attr1=attr
+ attr2=attr
+
+ if (extra_label == "")
+ sub("^[^[]*[[]", "[style=filled fillcolor=\"#fefefe\" shape=plaintext ", tmp_attr)
+ else {
+# tmp_attr = "[fixedsize=true width=0 shape=plaintext " extra_label "]"
+ print $0
+ next
+ }
+
+ sub("^[^[]*[[]", "[", attr1)
+ sub("^[^[]*[[]", "[", attr2)
+ sub("label=\".*\"", "", attr1)
+ sub("label=\".*\"", "", attr2)
+ sub("[[]", "[arrowhead=none ", attr1)
+
+ print tmp, tmp_attr
+ print $1, "->", tmp, attr1
+ print tmp, "->", $3, attr2
+ next
+}
+{ print $0 }
+'
\ No newline at end of file
diff --git a/doc/developer/hid_remote/proto_high.html b/doc/developer/hid_remote/proto_high.html
new file mode 100644
index 0000000..02cfe46
--- /dev/null
+++ b/doc/developer/hid_remote/proto_high.html
@@ -0,0 +1,224 @@
+<html>
+<body>
+<H1> remote HID protocol, high level </H1>
+
+<H2> reference </H2>
+
+<h3> ver(protver) </h3>
+Sends the protocol version the server will speak. If the client doesn't
+support that version, it should break the connection.
+<p>
+Arguments:
+<ul>
+ <li> protver: an integer value; 1 for the current version
+</ul>
+
+<h3> unit(abbrev) </h3>
+Sends the coordinate unit used in subsequent communication. This is not
+necessarily the unit used for displaying values on the user interface,
+but the unit used to interpret numeric coordinate values sent in commands.
+<p>
+Arguments:
+<ul>
+ <li> abbrev: unit name abbreviation; e.g. mm or nm or mil
+</ul>
+
+<h3> ready() </h3>
+Informs the client that the server is ready to start the session. The
+client needs to answer with a Ready() message before the server proceeds.
+<p>
+Arguments: none.
+
+
+<h3> brddim(w h) </h3>
+Announce board dimensions. Some layers may extend beyond the board.
+<p>
+Arguments:
+<ul>
+ <li> w: width (x size) in coordinate units
+ <li> h: height (y size) in coordinate units
+</ul>
+
+<h3> inval(x1 x2 y1 y2) </h3>
+Invalidate a rectangular section of the screen; the client should redraw
+this area. Clients implementing their own mechanism to keep track on
+drawing are free to ignore these requests
+<p>
+Arguments:
+<ul>
+ <li> x1: left coordinate
+ <li> x2: right coordinate
+ <li> y1: top coordinate
+ <li> y2: bottom coordinate
+</ul>
+
+<h3> inval() </h3>
+Same as inval(x1 x2 y1 y2) but invalidates the whole screen.
+<p>
+Arguments: none
+
+<h3> newly(name id flags groups) </h3>
+Inform the client that the next set of drawing commands are for a specific
+layer.
+<p>
+Arguments:
+<ul>
+ <li> name: name of the layer (can be empty)
+ <li> id: unique group ID (decimal integer)
+ <li> flags: a list of 3 items: location, purpose and properties. Each item is a list of values (or an empty list).
+ <li> group: group ID; layers in the same group are turned on/off together and are considered to be on the same physical layer; -1 means not part of any group
+</ul>
+<p>
+Example:
+<pre>
+newly(bottomassembly 16777226 ((bottom) (assy) (virtual)) -1)
+</pre>
+Creates the bottom assembly virtual layer with ID 16777226. It is not part of
+any layer group and is called "bottomassembly".
+
+<h3> setlg(group_id group_flags is_empty) </h3>
+Inform the client that the next set of drawing commands are for a specific
+layer group.
+<p>
+Arguments:
+<ul>
+ <li> group_id: unique ID of the layer group
+ <li> flags: TODO
+ <li> is_empty: 1 if the layer group may be empty, 0 if the layer is not empty
+</ul>
+
+<h3> makeGC() </h3>
+Request the client to make a new graphical context. The client should
+allocate a GC and return an integer ID using the MadeGC(ID) message.
+The ID uniquely identifies the GC; it should be small positive integer
+(between 0 and 31 for now).
+<p>
+Arguments: none
+
+
+
+
+<h3> delGC(ID) </h3>
+Inform the client that a given GC is not needed anymore. The server
+will not reference the GC again and the GC can be destroyed (but graphics
+drawn on the screen should not be affected). The ID may be reused by the
+client in a subsequent madeGC() message).
+<p>
+Arguments:
+<ul>
+ <li> ID: integer ID of the GC
+</ul>
+
+<h3> clr(gci colorstring) </h3>
+Change the color subsequent drawing commands of a given GC will use.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> colorstring: name of the color, specified in the usual "web" format: #rrggbb (with 3 hex numbers)
+</ul>
+
+<h3> cap(gci style) </h3>
+Set the line ending cap style. Note: the cap extends half-line-width beyond
+the end coordinates, e.g. the end point of a line is the center of the round-cap
+circle.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> style: r for round cap (circle), s for square cap, b for beveled (octagon)
+</ul>
+
+
+<h3> linwid(gci width) </h3>
+Sets line width (pen tip diameter).
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> width: diameter of the circular aperture of the pen in coord units
+</ul>
+
+<h3> setxor(gci state) </h3>
+Sets whether to perform "xor-drawing" for subsequent drawing commands in
+the selected GC.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> xor: 0 means normal drawing, 1 means xor drawing
+</ul>
+
+
+<h3> line(gci x1 y1 x2 y2) </h3>
+Draw a line using the current GC. The line inherits line width, color
+and cap style from the GC.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> x1: 1st endpoint's X coord (in coord units)
+ <li> y1: 1st endpoint's Y coord (in coord units)
+ <li> x2: 2nd endpoint's X coord (in coord units)
+ <li> y2: 2nd endpoint's Y coord (in coord units)
+</ul>
+
+<h3> rect(gci x1 y1 x2 y2 filled) </h3>
+Draw a rectangle. The rectangle inherits only color from the GC.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> x1: 1st corner X coord (in coord units); x1 <= x2
+ <li> y1: 1st corner Y coord (in coord units); y1 <= y2
+ <li> x2: 2nd corner X coord (in coord units)
+ <li> y2: 2nd corner Y coord (in coord units)
+ <li> filled: 1 if the rectangle should be filled; a non-filled rectangle is a frame of 1 pixel wide lines
+</ul>
+
+
+<h3> fcirc(gci cx cy r) </h3>
+Draw a filled circle. The circle inherits only color from the GC.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> cx1: center X coord (in coord units)
+ <li> cy1: center Y coord (in coord units)
+ <li> r: radius (in coord units)
+</ul>
+
+<h3> poly(gci len ptlist) </h3>
+Draw a filled polygon. The polygon inherits only color from the GC.
+<p>
+Arguments:
+<ul>
+ <li> gci: ID of the GC
+ <li> len: number of contour points
+ <li> ptlist: an ordered list of (x y) coordinates (all in coord units)
+</ul>
+
+<h3> umask(m) </h3>
+"use mask" m. The server uses this message to make an announcement before it
+starts drawing certain things.
+<p>
+Arguments:
+<ul>
+ <li> m: mask name:
+ <ul>
+ <li> off: flush the buffer and return to non-mask operation.
+ <li> before: Polygons being drawn before clears.
+ <li> clear: Clearances being drawn.
+ <li> after: Polygons being drawn after clears.
+ </ul>
+</ul>
+
+
+<!--
+<h3> () </h3>
+<p>
+Arguments:
+<ul>
+ <li>
+</ul>
+-->
diff --git a/doc/developer/hid_remote/proto_low.html b/doc/developer/hid_remote/proto_low.html
new file mode 100644
index 0000000..3592a74
--- /dev/null
+++ b/doc/developer/hid_remote/proto_low.html
@@ -0,0 +1,146 @@
+<html>
+<body>
+<H1> remote HID protocol, low level </H1>
+
+In this document <b>bold</b> words are tokens and <i>italic</i> words
+are grammatic constructs.
+<p>
+The protocol is designed with the following goals in mind:
+<ul>
+ <li> for simple/text data: compact, text format
+ <li> for simple/text data: easy to read/write manually
+ <li> for text with special characters: avoid quoting and escaping
+ <li> be able to embed binary data without having to recode it (e.g. in base64)
+ <li> to some extent be able to mix simple text and binary fields even within a single message
+ <li> predictable parsing: always know how much memory to allocate in advance
+ <li> minimalism - keep things as simple as possible
+</ul>
+
+
+<H2> Tokens </H2>
+<table border=1>
+ <tr><th> token <th> description
+ <tr><td> <b>(</b> <td> start a generic list
+ <tr><td> <b>)</b> <td> end a generic list
+ <tr><td> <b>{</b> <td> start a binary list
+ <tr><td> <b>}</b> <td> end a binary list
+ <tr><td> <b>space</b> <td> element separator: space (ASCII dec 32)
+ <tr><td> <b>\n</b> <td> message separator: newline (ASCII dec 10)
+ <tr><td> <b>text-string</b> <td> short, alphanumeric string
+ <tr><td> <b>binary-string</b> <td> long and/or non-alnum string
+</table>
+
+<H2> Grammar </H2>
+The communication is a pair of asynchronous message stream. The message
+format is:
+<pre>
+<b>text-string</b> <i>generic-list</i> <b>\n</b>
+or
+<b>text-string</b> <i>binary-list</i> <b>\n</b>
+or
+# comment <b>\n</b>
+</pre>
+<p>
+where text-string is a command and <i>generic-list</i> is a list and holds
+the arguments of. The command name can not start with a hash mark ('#') and
+can not be empty. The list is the argument tree of the command.
+<p>
+As a special exception, a line may start with a hash mark ('#') to indicate
+a comment. Characters up to the first newline are ignored.
+<p>
+Optional: a tolerant parser also accepts empty lines and whitespace before
+a message.
+<p>
+The language has two type of lists: generic and binary.
+A generic list is wrapped in parenthesis <b>()</b> and its children are:
+<ul>
+ <li> <b>text-string</b>,
+ <li> <i>generic-list</i>,
+ <li> <i>binary-list</i>.
+</ul>
+A binary-list is wrapped in braces <b>{}</b> and its children are:
+<ul>
+ <li> <b>binary-string</b>,
+ <li> <i>binary-list</i>.
+</ul>
+<p>
+Any list can be empty. There's no whitespace after the opening token and
+before the closing token, so the empty generic-list and the empty binary-list
+are written as, respectively:
+<pre>
+()
+{}
+</pre>
+Subsequent fields of a list has a single <b>space</b> in between, for
+separation (this is an intentional redundancy for a <i>binary-list</i>).
+<p>
+Note: a <i>generic-list</i> can host text and binary children, but a
+</i>binary list</i> can not host only binary children. This means if a node
+of the parse tree is a binary list, the subtree will contain only binary nodes.
+<p>
+A <b>text-string</b> contains only English alphanumeric characters (A..Z, a..z,
+0..9), underscores (_), plus and minus signs (+, -) periods (.) and
+the hash mark ('#') and is at most 16 characters long.
+<p>
+A binary string encodes the length of the payload in base64 (A..Z, a..z, +, /),
+has a '=' for separator then the payload in binary format. For example
+<pre>
+F=hello
+</pre>
+means the 5 characters long string "hello". The maximum size of the base64
+encoded length field is 5, thus the longest binary data that can be
+packed in a single field is 1 gigabyte.
+
+<H2> Examples </H2>
+
+<H3> empty-argument messages </H3>
+<pre>
+hello()\n
+foo{}\n
+</pre>
+
+<H3> single-argument messages </H3>
+Text and binary alternative for the same content:
+<pre>
+hello(world)\n
+hello{F=world}\n
+</pre>
+
+<H3> multi-argument messages </H3>
+Text and binary alternative for the same content:
+<pre>
+print(hello world !)\n
+print{E=hello F=world B=!}\n
+</pre>
+
+Note: using <b>space</b> between list items; don't space
+before the first or after the last argument. Always emit one space between
+any two list items.
+
+<H3> lists in list </H3>
+Text and binary alternatives for the same content:
+<pre>
+line((14.55 3.1) (44.2 0) 5)\n
+line({F=14.55 D=3.1} (44.2 0) 5)\n
+line((14.55 3.1) {E=44.2 B=0} 5)\n
+line({F=14.55 D=3.1} {E=44.2 B=0} 5)\n
+line{{F=14.55 D=3.1} {E=44.2 B=0} B=5}\n
+</pre>
+The subtree assumed in this fictional message is two x;y coordinate pairs
+and a line width. In other words the arguments of line is a list (start
+point), another list (end point) and a scalar (width).
+<p>
+Since all data comply to the <b>text-string</b> token format,
+the first, simplest format is recommended. The other 4 lines demonstrate all
+other valid variants.
+<p>
+It is important to note that there are constraints (derived from
+the grammar) on choosing which list items can be encoded in binary:
+<ul>
+ <li> a <b>binary-string</b> can be only on a <i>binary-list</i>
+ <li> a <b>text-string</b> can be only on a <i>generic-list</i>
+ <li> a <b>generic-list</b> can not be only under a <i>binary-list</i>
+</ul>
+Thus if the 3rd argument, (width in this example), must be encoded as a
+<b>binary-string</b>, it will turn it's parent, line's argument list
+binary too, which in turn enforces all arguments to be binary.
diff --git a/doc/developer/hid_remote/proto_parse.dot b/doc/developer/hid_remote/proto_parse.dot
new file mode 100644
index 0000000..1ee87e0
--- /dev/null
+++ b/doc/developer/hid_remote/proto_parse.dot
@@ -0,0 +1,84 @@
+digraph parse_state_macine {
+
+
+MSG [label="MSG:\nmessage lead-in\nor\nbetween\nmessages" shape=box style=filled fillcolor=yellow]
+COMMENT [label="COMMENT:\nskipping comment" shape=box style=filled fillcolor=yellow]
+CMD [label="CMD:\nparsing command name" shape=box style=filled fillcolor=yellow]
+TSTR [label="TSTR:\nparsing test string" shape=box style=filled fillcolor=yellow]
+BSTR [label="BSTR:\nparsing bin string" shape=box style=filled fillcolor=yellow]
+LIST [label="LIST:\nin list" shape=box style=filled fillcolor=yellow]
+ERROR [label="ERROR:\nbad input" shape=box style=filled fillcolor=red]
+
+######## MSG
+
+init [shape="diamond" style=filled fillcolor=yellow]
+init -> MSG
+
+msg_append [label="store 1st\ncommand char"]
+
+MSG -> COMMENT [label="input==#" color=blue]
+MSG -> MSG [label="input==\\r\\n\\t\nspace" color=blue]
+MSG -> ERROR [label="input==binary"]
+MSG -> msg_append [label="input==text"]
+msg_append -> CMD
+
+######## COMMENT
+
+COMMENT -> MSG [label="input==\\n" color=blue]
+COMMENT -> COMMENT [color=blue]
+
+
+######## CMD
+cmd_list_new [label="create new list\nmake it arg tree\nroot and current"]
+cmd_list_new -> LIST
+cmd_append [label="append a character\nto command name"]
+cmd_append -> CMD [label="command name length\nis less than 16"]
+cmd_append -> ERROR [label="command name length\nis more than 16"]
+CMD -> cmd_list_new [label="input==({"]
+CMD -> ERROR [label="input==binary"]
+CMD -> cmd_append [label="input==text"]
+
+######## LIST
+got_msg [label="message fully parsed\nexecute message" style=filled fillcolor=cyan]
+got_msg -> MSG
+pop [label="pop:\ncurrent_list = current_list->parent"]
+pop -> got_msg [label="input=\\n\nand\ncurrent_list == NULL\n(arg root closed)"]
+pop -> ERROR [label="input!=\\n\nand\ncurrent_list == NULL\n(unbalanced parenthesis)"]
+pop -> LIST
+push [label="push:\create new list\nappend it as current's sibling\nmake it current"]
+push->LIST
+new_str [label="create a new bin or text string\nnode and append it to\nthe current list"]
+new_str -> tstr_append [label="current is generic list"]
+new_str -> bstr_append [label="current is binary list"]
+
+LIST -> pop [label="input==)}"]
+LIST -> push [label="input==({"]
+LIST -> LIST [label="input==space\n(ignore)"]
+LIST -> ERROR [label="input!=\\n and current == NULL\n(unbalanced parenthesis)"]
+LIST -> new_str [label="input==text"]
+
+######## TSTR
+str_fin [label="finish current string\n"]
+str_fin -> LIST
+str_fin_pop [label="finish current string\n"]
+str_fin_pop -> pop
+tstr_append [label="append to current string\n"]
+tstr_append -> ERROR [label="string length > 16"]
+tstr_append -> TSTR
+TSTR -> str_fin [label="input==space"]
+TSTR -> str_fin_pop [label="input==)}"]
+TSTR -> ERROR [label="input==binary"]
+TSTR -> tstr_append [label="input==text"]
+
+######## BSTR
+read_base64 [label="store next digit\nof string length"]
+read_base64 -> BSTR
+bstr_append -> BSTR
+BSTR -> read_base64 [label="before the ="]
+BSTR -> bstr_append [label="after the ="]
+BSTR -> str_fin_pop [label="last char of the string"]
+
+######## ERR
+ERROR -> ERROR [label="can't recover"]
+
+}
diff --git a/doc/developer/hid_remote/proto_parse.html b/doc/developer/hid_remote/proto_parse.html
new file mode 100644
index 0000000..d0e3e2b
--- /dev/null
+++ b/doc/developer/hid_remote/proto_parse.html
@@ -0,0 +1,38 @@
+<html>
+<body>
+Protocol parser state machine of the reference implementation:
+<img src="proto_parse.svg">
+Legend:
+<ul>
+ <li> yellow boxes are states
+ <li> blue arrows are optional features for a more tolerant parser
+ <li> round nodes are actions that shall be taken
+ <li> arrow with text: execute action or switch state if condition is true
+ <li> arrow without text: do this if no other condition is met
+</ul>
+<h3>Notes on the reference implementation </H3>
+The reference implementation builds a <b>tree of nodes</b> for the arguments.
+Each node is either a list or a text. A node has a pointer to its parent, its
+first child and its next sibling. While parsing list-of-lists, the parser
+keeps a <i>current node</i>. A new node is either added as the last sibling of
+the <i>current node</i> (new argument on a list) or as the first
+child of the <i>current node</i> (first argument of a new list when the list is
+open).
+<p>
+When a list is closed, the parent of the <i>current node</i> becomes the
+new <i>current node</i>.
+<p>
+When parsing a new message, the current node is NULL until the argument list
+is open; the new <i>current node</i> also becomes the argument tree root.
+If the argument tree root is closed, a newline shall follow, because that's
+how a message is terminated.
+<p>
+The <b>binary string</b> part of the state machine has 2 more internal
+states:
+<ul>
+ <li> a boolean indicating whether we are parsing the length or the string (before or after the '=')
+ <li> an integer string length
+</ul>
+
+</body>
+</html>
diff --git a/doc/developer/hid_remote/proto_parse.svg b/doc/developer/hid_remote/proto_parse.svg
new file mode 100644
index 0000000..d720ca6
--- /dev/null
+++ b/doc/developer/hid_remote/proto_parse.svg
@@ -0,0 +1,597 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.26.3 (20100126.1600)
+ -->
+<!-- Title: parse_state_macine Pages: 1 -->
+<svg width="1900pt" height="1666pt"
+ viewBox="0.00 0.00 1900.00 1666.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 1662)">
+<title>parse_state_macine</title>
+<polygon fill="white" stroke="white" points="-4,5 -4,-1662 1897,-1662 1897,5 -4,5"/>
+<!-- MSG -->
+<g id="node1" class="node"><title>MSG</title>
+<polygon fill="yellow" stroke="black" points="261,-1585.5 135,-1585.5 135,-1492.5 261,-1492.5 261,-1585.5"/>
+<text text-anchor="middle" x="198" y="-1568.9" font-family="Times Roman,serif" font-size="14.00">MSG:</text>
+<text text-anchor="middle" x="198" y="-1551.9" font-family="Times Roman,serif" font-size="14.00">message lead-in</text>
+<text text-anchor="middle" x="198" y="-1534.9" font-family="Times Roman,serif" font-size="14.00">or</text>
+<text text-anchor="middle" x="198" y="-1517.9" font-family="Times Roman,serif" font-size="14.00">between</text>
+<text text-anchor="middle" x="198" y="-1500.9" font-family="Times Roman,serif" font-size="14.00">messages</text>
+</g>
+<!-- lbl2 -->
+<g id="node11" class="node"><title>lbl2</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="125,-1453 37,-1453 37,-1417 125,-1417 125,-1453"/>
+<text text-anchor="middle" x="81" y="-1430.9" font-family="Times Roman,serif" font-size="14.00">input==#</text>
+</g>
+<!-- MSG->lbl2 -->
+<g id="edge4" class="edge"><title>MSG->lbl2</title>
+<path fill="none" stroke="blue" d="M145.66,-1492.48C129.962,-1478.52 113.666,-1464.04 101.361,-1453.1"/>
+</g>
+<!-- lbl3 -->
+<g id="node14" class="node"><title>lbl3</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="253,-1456 143,-1456 143,-1414 253,-1414 253,-1456"/>
+<text text-anchor="middle" x="198" y="-1439.4" font-family="Times Roman,serif" font-size="14.00">input==\r\n\t</text>
+<text text-anchor="middle" x="198" y="-1422.4" font-family="Times Roman,serif" font-size="14.00">space</text>
+</g>
+<!-- MSG->lbl3 -->
+<g id="edge8" class="edge"><title>MSG->lbl3</title>
+<path fill="none" stroke="blue" d="M191.283,-1492.48C191.129,-1479.82 191.512,-1466.73 192.434,-1456.24"/>
+</g>
+<!-- lbl4 -->
+<g id="node17" class="node"><title>lbl4</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="332,-328 212,-328 212,-292 332,-292 332,-328"/>
+<text text-anchor="middle" x="272" y="-305.9" font-family="Times Roman,serif" font-size="14.00">input==binary</text>
+</g>
+<!-- MSG->lbl4 -->
+<g id="edge12" class="edge"><title>MSG->lbl4</title>
+<path fill="none" stroke="black" d="M240.148,-1492.37C248.51,-1481.11 256.418,-1468.65 262,-1456 281.673,-1411.41 281,-1396.74 281,-1348 281,-1348 281,-1348 281,-490 281,-430.707 276.068,-360.565 273.506,-328.125"/>
+</g>
+<!-- lbl5 -->
+<g id="node20" class="node"><title>lbl5</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="445,-1453 341,-1453 341,-1417 445,-1417 445,-1453"/>
+<text text-anchor="middle" x="393" y="-1430.9" font-family="Times Roman,serif" font-size="14.00">input==text</text>
+</g>
+<!-- MSG->lbl5 -->
+<g id="edge16" class="edge"><title>MSG->lbl5</title>
+<path fill="none" stroke="black" d="M261.042,-1505.38C293.645,-1487.99 332.147,-1467.45 359.12,-1453.07"/>
+</g>
+<!-- COMMENT -->
+<g id="node2" class="node"><title>COMMENT</title>
+<polygon fill="yellow" stroke="black" points="164,-1369 24,-1369 24,-1327 164,-1327 164,-1369"/>
+<text text-anchor="middle" x="94" y="-1352.4" font-family="Times Roman,serif" font-size="14.00">COMMENT:</text>
+<text text-anchor="middle" x="94" y="-1335.4" font-family="Times Roman,serif" font-size="14.00">skipping comment</text>
+</g>
+<!-- COMMENT->COMMENT -->
+<g id="edge26" class="edge"><title>COMMENT->COMMENT</title>
+<path fill="none" stroke="blue" d="M164.071,-1362.7C174.749,-1360.46 182,-1355.56 182,-1348 182,-1343.04 178.877,-1339.22 173.712,-1336.55"/>
+<polygon fill="blue" stroke="blue" points="174.665,-1333.18 164.071,-1333.3 172.425,-1339.81 174.665,-1333.18"/>
+</g>
+<!-- lbl7 -->
+<g id="node24" class="node"><title>lbl7</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="90,-1279 1.42109e-14,-1279 0,-1243 90,-1243 90,-1279"/>
+<text text-anchor="middle" x="45" y="-1256.9" font-family="Times Roman,serif" font-size="14.00">input==\n</text>
+</g>
+<!-- COMMENT->lbl7 -->
+<g id="edge22" class="edge"><title>COMMENT->lbl7</title>
+<path fill="none" stroke="blue" d="M82.1385,-1326.94C73.9246,-1312.36 63.1009,-1293.14 55.2589,-1279.21"/>
+</g>
+<!-- CMD -->
+<g id="node3" class="node"><title>CMD</title>
+<polygon fill="yellow" stroke="black" points="547,-1282 367,-1282 367,-1240 547,-1240 547,-1282"/>
+<text text-anchor="middle" x="457" y="-1265.4" font-family="Times Roman,serif" font-size="14.00">CMD:</text>
+<text text-anchor="middle" x="457" y="-1248.4" font-family="Times Roman,serif" font-size="14.00">parsing command name</text>
+</g>
+<!-- lbl12 -->
+<g id="node37" class="node"><title>lbl12</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1105,-1204 1015,-1204 1015,-1168 1105,-1168 1105,-1204"/>
+<text text-anchor="middle" x="1060" y="-1181.9" font-family="Times Roman,serif" font-size="14.00">input==({</text>
+</g>
+<!-- CMD->lbl12 -->
+<g id="edge38" class="edge"><title>CMD->lbl12</title>
+<path fill="none" stroke="black" d="M547.275,-1249.77C678.202,-1233.49 915.922,-1203.92 1014.88,-1191.61"/>
+</g>
+<!-- lbl13 -->
+<g id="node40" class="node"><title>lbl13</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="429,-1108 309,-1108 309,-1072 429,-1072 429,-1108"/>
+<text text-anchor="middle" x="369" y="-1085.9" font-family="Times Roman,serif" font-size="14.00">input==binary</text>
+</g>
+<!-- CMD->lbl13 -->
+<g id="edge42" class="edge"><title>CMD->lbl13</title>
+<path fill="none" stroke="black" d="M446.033,-1239.69C428.571,-1205.76 394.751,-1140.04 378.359,-1108.19"/>
+</g>
+<!-- lbl14 -->
+<g id="node43" class="node"><title>lbl14</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="615,-1204 511,-1204 511,-1168 615,-1168 615,-1204"/>
+<text text-anchor="middle" x="563" y="-1181.9" font-family="Times Roman,serif" font-size="14.00">input==text</text>
+</g>
+<!-- CMD->lbl14 -->
+<g id="edge46" class="edge"><title>CMD->lbl14</title>
+<path fill="none" stroke="black" d="M486.809,-1239.91C502.73,-1228.64 522.129,-1214.92 537.368,-1204.14"/>
+</g>
+<!-- TSTR -->
+<g id="node4" class="node"><title>TSTR</title>
+<polygon fill="yellow" stroke="black" points="930,-586 788,-586 788,-544 930,-544 930,-586"/>
+<text text-anchor="middle" x="859" y="-569.4" font-family="Times Roman,serif" font-size="14.00">TSTR:</text>
+<text text-anchor="middle" x="859" y="-552.4" font-family="Times Roman,serif" font-size="14.00">parsing test string</text>
+</g>
+<!-- lbl30 -->
+<g id="node90" class="node"><title>lbl30</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="758,-508 644,-508 644,-472 758,-472 758,-508"/>
+<text text-anchor="middle" x="701" y="-485.9" font-family="Times Roman,serif" font-size="14.00">input==space</text>
+</g>
+<!-- TSTR->lbl30 -->
+<g id="edge102" class="edge"><title>TSTR->lbl30</title>
+<path fill="none" stroke="black" d="M814.568,-543.909C790.745,-532.601 761.699,-518.813 738.945,-508.012"/>
+</g>
+<!-- lbl31 -->
+<g id="node93" class="node"><title>lbl31</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="904,-508 814,-508 814,-472 904,-472 904,-508"/>
+<text text-anchor="middle" x="859" y="-485.9" font-family="Times Roman,serif" font-size="14.00">input==)}</text>
+</g>
+<!-- TSTR->lbl31 -->
+<g id="edge106" class="edge"><title>TSTR->lbl31</title>
+<path fill="none" stroke="black" d="M859,-543.709C859,-532.449 859,-518.775 859,-508.042"/>
+</g>
+<!-- lbl32 -->
+<g id="node96" class="node"><title>lbl32</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="842,-328 722,-328 722,-292 842,-292 842,-328"/>
+<text text-anchor="middle" x="782" y="-305.9" font-family="Times Roman,serif" font-size="14.00">input==binary</text>
+</g>
+<!-- TSTR->lbl32 -->
+<g id="edge110" class="edge"><title>TSTR->lbl32</title>
+<path fill="none" stroke="black" d="M832.535,-543.784C822.209,-534.02 811.346,-521.585 805,-508 776.513,-447.017 778.036,-364.405 780.412,-328.232"/>
+</g>
+<!-- lbl33 -->
+<g id="node99" class="node"><title>lbl33</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1026,-508 922,-508 922,-472 1026,-472 1026,-508"/>
+<text text-anchor="middle" x="974" y="-485.9" font-family="Times Roman,serif" font-size="14.00">input==text</text>
+</g>
+<!-- TSTR->lbl33 -->
+<g id="edge114" class="edge"><title>TSTR->lbl33</title>
+<path fill="none" stroke="black" d="M891.34,-543.909C908.613,-532.644 929.659,-518.918 946.192,-508.136"/>
+</g>
+<!-- BSTR -->
+<g id="node5" class="node"><title>BSTR</title>
+<polygon fill="yellow" stroke="black" points="1306,-586 1170,-586 1170,-544 1306,-544 1306,-586"/>
+<text text-anchor="middle" x="1238" y="-569.4" font-family="Times Roman,serif" font-size="14.00">BSTR:</text>
+<text text-anchor="middle" x="1238" y="-552.4" font-family="Times Roman,serif" font-size="14.00">parsing bin string</text>
+</g>
+<!-- lbl36 -->
+<g id="node105" class="node"><title>lbl36</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1442,-508 1338,-508 1338,-472 1442,-472 1442,-508"/>
+<text text-anchor="middle" x="1390" y="-485.9" font-family="Times Roman,serif" font-size="14.00">before the =</text>
+</g>
+<!-- BSTR->lbl36 -->
+<g id="edge122" class="edge"><title>BSTR->lbl36</title>
+<path fill="none" stroke="black" d="M1280.74,-543.909C1303.66,-532.601 1331.61,-518.813 1353.5,-508.012"/>
+</g>
+<!-- lbl37 -->
+<g id="node108" class="node"><title>lbl37</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1138,-508 1044,-508 1044,-472 1138,-472 1138,-508"/>
+<text text-anchor="middle" x="1091" y="-485.9" font-family="Times Roman,serif" font-size="14.00">after the =</text>
+</g>
+<!-- BSTR->lbl37 -->
+<g id="edge126" class="edge"><title>BSTR->lbl37</title>
+<path fill="none" stroke="black" d="M1196.66,-543.909C1174.58,-532.644 1147.68,-518.918 1126.55,-508.136"/>
+</g>
+<!-- lbl38 -->
+<g id="node111" class="node"><title>lbl38</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1320,-508 1156,-508 1156,-472 1320,-472 1320,-508"/>
+<text text-anchor="middle" x="1238" y="-485.9" font-family="Times Roman,serif" font-size="14.00">last char of the string</text>
+</g>
+<!-- BSTR->lbl38 -->
+<g id="edge130" class="edge"><title>BSTR->lbl38</title>
+<path fill="none" stroke="black" d="M1238,-543.709C1238,-532.449 1238,-518.775 1238,-508.042"/>
+</g>
+<!-- LIST -->
+<g id="node6" class="node"><title>LIST</title>
+<polygon fill="yellow" stroke="black" points="1499,-1012 1445,-1012 1445,-970 1499,-970 1499,-1012"/>
+<text text-anchor="middle" x="1472" y="-995.4" font-family="Times Roman,serif" font-size="14.00">LIST:</text>
+<text text-anchor="middle" x="1472" y="-978.4" font-family="Times Roman,serif" font-size="14.00">in list</text>
+</g>
+<!-- lbl21 -->
+<g id="node67" class="node"><title>lbl21</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1702,-736 1612,-736 1612,-700 1702,-700 1702,-736"/>
+<text text-anchor="middle" x="1657" y="-713.9" font-family="Times Roman,serif" font-size="14.00">input==)}</text>
+</g>
+<!-- LIST->lbl21 -->
+<g id="edge72" class="edge"><title>LIST->lbl21</title>
+<path fill="none" stroke="black" d="M1499.13,-987.966C1558.19,-980.909 1696.06,-961.849 1733,-934 1792.4,-889.227 1815.19,-834.588 1775,-772 1758.99,-747.071 1728.3,-733.504 1702.22,-726.204"/>
+</g>
+<!-- lbl22 -->
+<g id="node70" class="node"><title>lbl22</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1554,-931 1464,-931 1464,-895 1554,-895 1554,-931"/>
+<text text-anchor="middle" x="1509" y="-908.9" font-family="Times Roman,serif" font-size="14.00">input==({</text>
+</g>
+<!-- LIST->lbl22 -->
+<g id="edge76" class="edge"><title>LIST->lbl22</title>
+<path fill="none" stroke="black" d="M1482.11,-969.686C1487.84,-957.598 1494.94,-942.633 1500.41,-931.115"/>
+</g>
+<!-- lbl23 -->
+<g id="node73" class="node"><title>lbl23</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1724,-934 1610,-934 1610,-892 1724,-892 1724,-934"/>
+<text text-anchor="middle" x="1667" y="-917.4" font-family="Times Roman,serif" font-size="14.00">input==space</text>
+<text text-anchor="middle" x="1667" y="-900.4" font-family="Times Roman,serif" font-size="14.00">(ignore)</text>
+</g>
+<!-- LIST->lbl23 -->
+<g id="edge80" class="edge"><title>LIST->lbl23</title>
+<path fill="none" stroke="black" d="M1499.03,-978.12C1527.55,-966.004 1573.12,-947.665 1609.64,-933.532"/>
+</g>
+<!-- lbl24 -->
+<g id="node76" class="node"><title>lbl24</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1518,-664 1278,-664 1278,-622 1518,-622 1518,-664"/>
+<text text-anchor="middle" x="1398" y="-647.4" font-family="Times Roman,serif" font-size="14.00">input!=\n and current == NULL</text>
+<text text-anchor="middle" x="1398" y="-630.4" font-family="Times Roman,serif" font-size="14.00">(unbalanced parenthesis)</text>
+</g>
+<!-- LIST->lbl24 -->
+<g id="edge84" class="edge"><title>LIST->lbl24</title>
+<path fill="none" stroke="black" d="M1447.54,-969.802C1437.86,-959.954 1427.71,-947.451 1422,-934 1382.11,-839.965 1390.15,-713.675 1395.38,-664.165"/>
+</g>
+<!-- lbl25 -->
+<g id="node79" class="node"><title>lbl25</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1330,-931 1226,-931 1226,-895 1330,-895 1330,-931"/>
+<text text-anchor="middle" x="1278" y="-908.9" font-family="Times Roman,serif" font-size="14.00">input==text</text>
+</g>
+<!-- LIST->lbl25 -->
+<g id="edge88" class="edge"><title>LIST->lbl25</title>
+<path fill="none" stroke="black" d="M1444.62,-979.99C1412.97,-967.266 1360.43,-946.14 1322.8,-931.014"/>
+</g>
+<!-- ERROR -->
+<g id="node7" class="node"><title>ERROR</title>
+<polygon fill="red" stroke="black" points="720,-123 638,-123 638,-81 720,-81 720,-123"/>
+<text text-anchor="middle" x="679" y="-106.4" font-family="Times Roman,serif" font-size="14.00">ERROR:</text>
+<text text-anchor="middle" x="679" y="-89.4" font-family="Times Roman,serif" font-size="14.00">bad input</text>
+</g>
+<!-- lbl39 -->
+<g id="node114" class="node"><title>lbl39</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="732,-36 626,-36 626,-1.06581e-14 732,-0 732,-36"/>
+<text text-anchor="middle" x="679" y="-13.9" font-family="Times Roman,serif" font-size="14.00">can't recover</text>
+</g>
+<!-- ERROR->lbl39 -->
+<g id="edge134" class="edge"><title>ERROR->lbl39</title>
+<path fill="none" stroke="black" d="M673.048,-80.8033C671.895,-67.0002 671.992,-49.1868 673.339,-36.0588"/>
+</g>
+<!-- init -->
+<g id="node8" class="node"><title>init</title>
+<polygon fill="yellow" stroke="black" points="198,-1658 160.172,-1640 198,-1622 235.828,-1640 198,-1658"/>
+<text text-anchor="middle" x="198" y="-1635.9" font-family="Times Roman,serif" font-size="14.00">init</text>
+</g>
+<!-- init->MSG -->
+<g id="edge2" class="edge"><title>init->MSG</title>
+<path fill="none" stroke="black" d="M198,-1621.94C198,-1614.36 198,-1605.09 198,-1595.53"/>
+<polygon fill="black" stroke="black" points="201.5,-1595.51 198,-1585.51 194.5,-1595.51 201.5,-1595.51"/>
+</g>
+<!-- msg_append -->
+<g id="node10" class="node"><title>msg_append</title>
+<ellipse fill="none" stroke="black" cx="424" cy="-1348" rx="82.2301" ry="29.6985"/>
+<text text-anchor="middle" x="424" y="-1352.4" font-family="Times Roman,serif" font-size="14.00">store 1st</text>
+<text text-anchor="middle" x="424" y="-1335.4" font-family="Times Roman,serif" font-size="14.00">command char</text>
+</g>
+<!-- msg_append->CMD -->
+<g id="edge20" class="edge"><title>msg_append->CMD</title>
+<path fill="none" stroke="black" d="M435.172,-1318.55C438.46,-1309.88 442.064,-1300.38 445.379,-1291.64"/>
+<polygon fill="black" stroke="black" points="448.693,-1292.77 448.967,-1282.18 442.148,-1290.29 448.693,-1292.77"/>
+</g>
+<!-- lbl2->COMMENT -->
+<g id="edge6" class="edge"><title>lbl2->COMMENT</title>
+<path fill="none" stroke="blue" d="M83.6936,-1416.97C85.3205,-1406.09 87.4385,-1391.91 89.3311,-1379.25"/>
+<polygon fill="blue" stroke="blue" points="92.8357,-1379.47 90.852,-1369.07 85.9125,-1378.44 92.8357,-1379.47"/>
+</g>
+<!-- lbl3->MSG -->
+<g id="edge10" class="edge"><title>lbl3->MSG</title>
+<path fill="none" stroke="blue" d="M203.566,-1456.24C204.243,-1463.94 204.63,-1473.05 204.726,-1482.35"/>
+<polygon fill="blue" stroke="blue" points="201.226,-1482.47 204.717,-1492.48 208.226,-1482.48 201.226,-1482.47"/>
+</g>
+<!-- lbl4->ERROR -->
+<g id="edge14" class="edge"><title>lbl4->ERROR</title>
+<path fill="none" stroke="black" d="M276.037,-291.899C283.872,-261.23 304.175,-199.338 346,-168 389.875,-135.126 545.849,-115.176 627.819,-106.728"/>
+<polygon fill="black" stroke="black" points="628.318,-110.195 637.915,-105.707 627.614,-103.23 628.318,-110.195"/>
+</g>
+<!-- lbl5->msg_append -->
+<g id="edge18" class="edge"><title>lbl5->msg_append</title>
+<path fill="none" stroke="black" d="M399.423,-1416.97C402.546,-1408.21 406.428,-1397.31 410.178,-1386.79"/>
+<polygon fill="black" stroke="black" points="413.499,-1387.9 413.558,-1377.3 406.905,-1385.55 413.499,-1387.9"/>
+</g>
+<!-- lbl7->MSG -->
+<g id="edge24" class="edge"><title>lbl7->MSG</title>
+<path fill="none" stroke="blue" d="M32.5752,-1279.08C25.9336,-1289.85 18.4336,-1304.1 15,-1318 0.222419,-1377.81 -8.83346,-1406.62 28,-1456 51.6038,-1487.64 90.5199,-1507.87 125.166,-1520.43"/>
+<polygon fill="blue" stroke="blue" points="124.213,-1523.8 134.808,-1523.77 126.505,-1517.18 124.213,-1523.8"/>
+</g>
+<!-- cmd_list_new -->
+<g id="node28" class="node"><title>cmd_list_new</title>
+<ellipse fill="none" stroke="black" cx="1294" cy="-1090" rx="92.1303" ry="41.7193"/>
+<text text-anchor="middle" x="1294" y="-1102.9" font-family="Times Roman,serif" font-size="14.00">create new list</text>
+<text text-anchor="middle" x="1294" y="-1085.9" font-family="Times Roman,serif" font-size="14.00">make it arg tree</text>
+<text text-anchor="middle" x="1294" y="-1068.9" font-family="Times Roman,serif" font-size="14.00">root and current</text>
+</g>
+<!-- cmd_list_new->LIST -->
+<g id="edge28" class="edge"><title>cmd_list_new->LIST</title>
+<path fill="none" stroke="black" d="M1352.28,-1057.58C1379.79,-1042.28 1411.77,-1024.5 1435.75,-1011.16"/>
+<polygon fill="black" stroke="black" points="1437.48,-1014.2 1444.52,-1006.28 1434.08,-1008.08 1437.48,-1014.2"/>
+</g>
+<!-- cmd_append -->
+<g id="node30" class="node"><title>cmd_append</title>
+<ellipse fill="none" stroke="black" cx="590" cy="-1090" rx="104.86" ry="29.6985"/>
+<text text-anchor="middle" x="590" y="-1094.4" font-family="Times Roman,serif" font-size="14.00">append a character</text>
+<text text-anchor="middle" x="590" y="-1077.4" font-family="Times Roman,serif" font-size="14.00">to command name</text>
+</g>
+<!-- lbl10 -->
+<g id="node31" class="node"><title>lbl10</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="562,-1012 388,-1012 388,-970 562,-970 562,-1012"/>
+<text text-anchor="middle" x="475" y="-995.4" font-family="Times Roman,serif" font-size="14.00">command name length</text>
+<text text-anchor="middle" x="475" y="-978.4" font-family="Times Roman,serif" font-size="14.00">is less than 16</text>
+</g>
+<!-- cmd_append->lbl10 -->
+<g id="edge30" class="edge"><title>cmd_append->lbl10</title>
+<path fill="none" stroke="black" d="M557.353,-1061.9C539.026,-1046.12 516.527,-1026.75 499.679,-1012.25"/>
+</g>
+<!-- lbl11 -->
+<g id="node34" class="node"><title>lbl11</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="571,-835 397,-835 397,-793 571,-793 571,-835"/>
+<text text-anchor="middle" x="484" y="-818.4" font-family="Times Roman,serif" font-size="14.00">command name length</text>
+<text text-anchor="middle" x="484" y="-801.4" font-family="Times Roman,serif" font-size="14.00">is more than 16</text>
+</g>
+<!-- cmd_append->lbl11 -->
+<g id="edge34" class="edge"><title>cmd_append->lbl11</title>
+<path fill="none" stroke="black" d="M588.199,-1060.2C586.021,-1035.48 581.27,-999.703 571,-970 553.166,-918.418 518.732,-864.027 498.953,-835.07"/>
+</g>
+<!-- lbl10->CMD -->
+<g id="edge32" class="edge"><title>lbl10->CMD</title>
+<path fill="none" stroke="black" d="M473.594,-1012.09C470.446,-1059.31 462.815,-1173.78 459.101,-1229.49"/>
+<polygon fill="black" stroke="black" points="455.585,-1229.6 458.412,-1239.81 462.57,-1230.07 455.585,-1229.6"/>
+</g>
+<!-- lbl11->ERROR -->
+<g id="edge36" class="edge"><title>lbl11->ERROR</title>
+<path fill="none" stroke="black" d="M468.34,-792.839C446.89,-761.7 411,-700.942 411,-643 411,-643 411,-643 411,-310 411,-201.274 550.36,-141.195 628.092,-116.14"/>
+<polygon fill="black" stroke="black" points="629.222,-119.454 637.712,-113.117 627.123,-112.776 629.222,-119.454"/>
+</g>
+<!-- lbl12->cmd_list_new -->
+<g id="edge40" class="edge"><title>lbl12->cmd_list_new</title>
+<path fill="none" stroke="black" d="M1104.01,-1167.94C1135.62,-1154.97 1179.07,-1137.15 1216.44,-1121.82"/>
+<polygon fill="black" stroke="black" points="1217.87,-1125.02 1225.79,-1117.98 1215.21,-1118.54 1217.87,-1125.02"/>
+</g>
+<!-- lbl13->ERROR -->
+<g id="edge44" class="edge"><title>lbl13->ERROR</title>
+<path fill="none" stroke="black" d="M367.473,-1071.92C364.906,-1039.92 360,-971.153 360,-913 360,-913 360,-913 360,-310 360,-239.833 374.808,-212.572 429,-168 459.194,-143.166 564.035,-121.572 627.966,-110.306"/>
+<polygon fill="black" stroke="black" points="628.604,-113.747 637.858,-108.587 627.406,-106.85 628.604,-113.747"/>
+</g>
+<!-- lbl14->cmd_append -->
+<g id="edge48" class="edge"><title>lbl14->cmd_append</title>
+<path fill="none" stroke="black" d="M568.078,-1167.94C571.122,-1157.12 575.116,-1142.92 578.86,-1129.61"/>
+<polygon fill="black" stroke="black" points="582.316,-1130.25 581.654,-1119.67 575.577,-1128.35 582.316,-1130.25"/>
+</g>
+<!-- got_msg -->
+<g id="node46" class="node"><title>got_msg</title>
+<ellipse fill="cyan" stroke="black" cx="1779" cy="-102" rx="113.137" ry="29.6985"/>
+<text text-anchor="middle" x="1779" y="-106.4" font-family="Times Roman,serif" font-size="14.00">message fully parsed</text>
+<text text-anchor="middle" x="1779" y="-89.4" font-family="Times Roman,serif" font-size="14.00">execute message</text>
+</g>
+<!-- got_msg->MSG -->
+<g id="edge50" class="edge"><title>got_msg->MSG</title>
+<path fill="none" stroke="black" d="M1798.46,-131.118C1805.02,-142.23 1811.76,-155.29 1816,-168 1836.15,-228.401 1835,-246.326 1835,-310 1835,-1348 1835,-1348 1835,-1348 1835,-1507.75 589.215,-1534.13 271.198,-1538.27"/>
+<polygon fill="black" stroke="black" points="271.124,-1534.77 261.169,-1538.39 271.213,-1541.77 271.124,-1534.77"/>
+</g>
+<!-- pop -->
+<g id="node48" class="node"><title>pop</title>
+<ellipse fill="none" stroke="black" cx="1615" cy="-310" rx="181.934" ry="29.6985"/>
+<text text-anchor="middle" x="1615" y="-314.4" font-family="Times Roman,serif" font-size="14.00">pop:</text>
+<text text-anchor="middle" x="1615" y="-297.4" font-family="Times Roman,serif" font-size="14.00">current_list = current_list->parent</text>
+</g>
+<!-- pop->LIST -->
+<g id="edge60" class="edge"><title>pop->LIST</title>
+<path fill="none" stroke="black" d="M1595.96,-339.564C1575.54,-374.182 1546,-433.942 1546,-490 1546,-565 1546,-565 1546,-565 1546,-609.803 1543.98,-622.541 1527,-664 1505.13,-717.383 1471.72,-716.786 1455,-772 1434.14,-840.911 1444.6,-862.755 1455,-934 1456.26,-942.645 1458.55,-951.801 1461.04,-960.187"/>
+<polygon fill="black" stroke="black" points="1457.77,-961.47 1464.13,-969.947 1464.45,-959.356 1457.77,-961.47"/>
+</g>
+<!-- lbl16 -->
+<g id="node49" class="node"><title>lbl16</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1807,-244 1641,-244 1641,-168 1807,-168 1807,-244"/>
+<text text-anchor="middle" x="1724" y="-227.4" font-family="Times Roman,serif" font-size="14.00">input=\n</text>
+<text text-anchor="middle" x="1724" y="-210.4" font-family="Times Roman,serif" font-size="14.00">and</text>
+<text text-anchor="middle" x="1724" y="-193.4" font-family="Times Roman,serif" font-size="14.00">current_list == NULL</text>
+<text text-anchor="middle" x="1724" y="-176.4" font-family="Times Roman,serif" font-size="14.00">(arg root closed)</text>
+</g>
+<!-- pop->lbl16 -->
+<g id="edge52" class="edge"><title>pop->lbl16</title>
+<path fill="none" stroke="black" d="M1645.65,-280.753C1657.49,-269.459 1671.2,-256.38 1683.81,-244.35"/>
+</g>
+<!-- lbl17 -->
+<g id="node52" class="node"><title>lbl17</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1623,-244 1433,-244 1433,-168 1623,-168 1623,-244"/>
+<text text-anchor="middle" x="1528" y="-227.4" font-family="Times Roman,serif" font-size="14.00">input!=\n</text>
+<text text-anchor="middle" x="1528" y="-210.4" font-family="Times Roman,serif" font-size="14.00">and</text>
+<text text-anchor="middle" x="1528" y="-193.4" font-family="Times Roman,serif" font-size="14.00">current_list == NULL</text>
+<text text-anchor="middle" x="1528" y="-176.4" font-family="Times Roman,serif" font-size="14.00">(unbalanced parenthesis)</text>
+</g>
+<!-- pop->lbl17 -->
+<g id="edge56" class="edge"><title>pop->lbl17</title>
+<path fill="none" stroke="black" d="M1590.53,-280.753C1581.09,-269.459 1570.14,-256.38 1560.08,-244.35"/>
+</g>
+<!-- lbl16->got_msg -->
+<g id="edge54" class="edge"><title>lbl16->got_msg</title>
+<path fill="none" stroke="black" d="M1744.17,-167.865C1748.9,-158.915 1753.95,-149.375 1758.69,-140.413"/>
+<polygon fill="black" stroke="black" points="1761.91,-141.809 1763.49,-131.333 1755.72,-138.537 1761.91,-141.809"/>
+</g>
+<!-- lbl17->ERROR -->
+<g id="edge58" class="edge"><title>lbl17->ERROR</title>
+<path fill="none" stroke="black" d="M1432.98,-171.356C1428.28,-170.122 1423.6,-168.992 1419,-168 1286.94,-139.548 875.539,-113.468 730.359,-104.928"/>
+<polygon fill="black" stroke="black" points="730.561,-101.434 720.374,-104.344 730.152,-108.422 730.561,-101.434"/>
+</g>
+<!-- push -->
+<g id="node56" class="node"><title>push</title>
+<ellipse fill="none" stroke="black" cx="1615" cy="-814" rx="150.821" ry="41.7193"/>
+<text text-anchor="middle" x="1615" y="-826.9" font-family="Times Roman,serif" font-size="14.00">push:create new list</text>
+<text text-anchor="middle" x="1615" y="-809.9" font-family="Times Roman,serif" font-size="14.00">append it as current's sibling</text>
+<text text-anchor="middle" x="1615" y="-792.9" font-family="Times Roman,serif" font-size="14.00">make it current</text>
+</g>
+<!-- push->LIST -->
+<g id="edge62" class="edge"><title>push->LIST</title>
+<path fill="none" stroke="black" d="M1603.88,-855.474C1595.65,-880.314 1582.46,-911.358 1563,-934 1548.13,-951.294 1526.7,-965.075 1508.36,-974.753"/>
+<polygon fill="black" stroke="black" points="1506.72,-971.661 1499.38,-979.303 1509.88,-977.905 1506.72,-971.661"/>
+</g>
+<!-- new_str -->
+<g id="node58" class="node"><title>new_str</title>
+<ellipse fill="none" stroke="black" cx="1165" cy="-814" rx="161.927" ry="41.7193"/>
+<text text-anchor="middle" x="1165" y="-826.9" font-family="Times Roman,serif" font-size="14.00">create a new bin or text string</text>
+<text text-anchor="middle" x="1165" y="-809.9" font-family="Times Roman,serif" font-size="14.00">node and append it to</text>
+<text text-anchor="middle" x="1165" y="-792.9" font-family="Times Roman,serif" font-size="14.00">the current list</text>
+</g>
+<!-- lbl19 -->
+<g id="node59" class="node"><title>lbl19</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="972,-736 810,-736 810,-700 972,-700 972,-736"/>
+<text text-anchor="middle" x="891" y="-713.9" font-family="Times Roman,serif" font-size="14.00">current is generic list</text>
+</g>
+<!-- new_str->lbl19 -->
+<g id="edge64" class="edge"><title>new_str->lbl19</title>
+<path fill="none" stroke="black" d="M1069.17,-780.424C1026.57,-765.501 978.129,-748.527 942.517,-736.05"/>
+</g>
+<!-- lbl20 -->
+<g id="node63" class="node"><title>lbl20</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="1242,-736 1088,-736 1088,-700 1242,-700 1242,-736"/>
+<text text-anchor="middle" x="1165" y="-713.9" font-family="Times Roman,serif" font-size="14.00">current is binary list</text>
+</g>
+<!-- new_str->lbl20 -->
+<g id="edge68" class="edge"><title>new_str->lbl20</title>
+<path fill="none" stroke="black" d="M1165,-772.451C1165,-759.884 1165,-746.716 1165,-736.478"/>
+</g>
+<!-- tstr_append -->
+<g id="node62" class="node"><title>tstr_append</title>
+<ellipse fill="none" stroke="black" cx="867" cy="-643" rx="128.053" ry="18"/>
+<text text-anchor="middle" x="867" y="-638.9" font-family="Times Roman,serif" font-size="14.00">append to current string</text>
+</g>
+<!-- lbl19->tstr_append -->
+<g id="edge66" class="edge"><title>lbl19->tstr_append</title>
+<path fill="none" stroke="black" d="M885.19,-699.845C882.39,-691.093 878.97,-680.405 875.854,-670.669"/>
+<polygon fill="black" stroke="black" points="879.138,-669.446 872.756,-660.988 872.471,-671.579 879.138,-669.446"/>
+</g>
+<!-- tstr_append->TSTR -->
+<g id="edge100" class="edge"><title>tstr_append->TSTR</title>
+<path fill="none" stroke="black" d="M865.145,-624.909C864.27,-616.382 863.201,-605.962 862.202,-596.218"/>
+<polygon fill="black" stroke="black" points="865.659,-595.622 861.157,-586.031 858.696,-596.336 865.659,-595.622"/>
+</g>
+<!-- lbl28 -->
+<g id="node86" class="node"><title>lbl28</title>
+<polygon fill="#fefefe" stroke="#fefefe" points="751,-224 607,-224 607,-188 751,-188 751,-224"/>
+<text text-anchor="middle" x="679" y="-201.9" font-family="Times Roman,serif" font-size="14.00">string length > 16</text>
+</g>
+<!-- tstr_append->lbl28 -->
+<g id="edge96" class="edge"><title>tstr_append->lbl28</title>
+<path fill="none" stroke="black" d="M807.7,-627.032C751.982,-608.522 671.822,-572.029 635,-508 627.024,-494.13 630.218,-487.269 635,-472 640.822,-453.411 653.417,-454.334 660,-436 686.875,-361.146 683.496,-264.091 680.623,-224.269"/>
+</g>
+<!-- bstr_append -->
+<g id="node66" class="node"><title>bstr_append</title>
+<ellipse fill="none" stroke="black" cx="1165" cy="-643" rx="70.1831" ry="18"/>
+<text text-anchor="middle" x="1165" y="-638.9" font-family="Times Roman,serif" font-size="14.00">bstr_append</text>
+</g>
+<!-- lbl20->bstr_append -->
+<g id="edge70" class="edge"><title>lbl20->bstr_append</title>
+<path fill="none" stroke="black" d="M1165,-699.845C1165,-691.34 1165,-681.008 1165,-671.496"/>
+<polygon fill="black" stroke="black" points="1168.5,-671.248 1165,-661.248 1161.5,-671.248 1168.5,-671.248"/>
+</g>
+<!-- bstr_append->BSTR -->
+<g id="edge120" class="edge"><title>bstr_append->BSTR</title>
+<path fill="none" stroke="black" d="M1181.56,-625.301C1190.3,-615.969 1201.23,-604.29 1211.14,-593.703"/>
+<polygon fill="black" stroke="black" points="1213.85,-595.928 1218.13,-586.235 1208.74,-591.145 1213.85,-595.928"/>
+</g>
+<!-- lbl21->pop -->
+<g id="edge74" class="edge"><title>lbl21->pop</title>
+<path fill="none" stroke="black" d="M1651.47,-699.827C1643.31,-671.366 1629,-614.417 1629,-565 1629,-565 1629,-565 1629,-490 1629,-441.645 1623.92,-386.202 1619.88,-349.774"/>
+<polygon fill="black" stroke="black" points="1623.32,-349.108 1618.71,-339.567 1616.37,-349.898 1623.32,-349.108"/>
+</g>
+<!-- lbl22->push -->
+<g id="edge78" class="edge"><title>lbl22->push</title>
+<path fill="none" stroke="black" d="M1528.44,-894.842C1538.63,-885.323 1551.64,-873.176 1564.45,-861.209"/>
+<polygon fill="black" stroke="black" points="1567.03,-863.588 1571.95,-854.205 1562.26,-858.472 1567.03,-863.588"/>
+</g>
+<!-- lbl23->LIST -->
+<g id="edge82" class="edge"><title>lbl23->LIST</title>
+<path fill="none" stroke="black" d="M1620.43,-934.054C1586.31,-948.162 1540.72,-966.278 1509.04,-978.244"/>
+<polygon fill="black" stroke="black" points="1507.41,-975.115 1499.27,-981.9 1509.87,-981.671 1507.41,-975.115"/>
+</g>
+<!-- lbl24->ERROR -->
+<g id="edge86" class="edge"><title>lbl24->ERROR</title>
+<path fill="none" stroke="black" d="M1417.35,-621.685C1458.44,-573.782 1546.09,-455.584 1489,-376 1465.6,-343.386 903.485,-170.276 729.707,-117.371"/>
+<polygon fill="black" stroke="black" points="730.618,-113.99 720.033,-114.428 728.581,-120.687 730.618,-113.99"/>
+</g>
+<!-- lbl25->new_str -->
+<g id="edge90" class="edge"><title>lbl25->new_str</title>
+<path fill="none" stroke="black" d="M1257.27,-894.842C1246.31,-885.234 1232.29,-872.949 1218.5,-860.873"/>
+<polygon fill="black" stroke="black" points="1220.72,-858.162 1210.89,-854.205 1216.11,-863.427 1220.72,-858.162"/>
+</g>
+<!-- str_fin -->
+<g id="node82" class="node"><title>str_fin</title>
+<ellipse fill="none" stroke="black" cx="545" cy="-406" rx="105.818" ry="18"/>
+<text text-anchor="middle" x="545" y="-401.9" font-family="Times Roman,serif" font-size="14.00">finish current string</text>
+</g>
+<!-- str_fin->LIST -->
+<g id="edge92" class="edge"><title>str_fin->LIST</title>
+<path fill="none" stroke="black" d="M554.874,-424.094C573.354,-457.377 615.181,-530.025 658,-586 713.962,-659.157 729.053,-678.491 801,-736 960.946,-863.849 1020.11,-877.768 1217,-934 1293.56,-955.865 1385,-974.542 1434.94,-984.124"/>
+<polygon fill="black" stroke="black" points="1434.46,-987.597 1444.94,-986.029 1435.77,-980.72 1434.46,-987.597"/>
+</g>
+<!-- str_fin_pop -->
+<g id="node84" class="node"><title>str_fin_pop</title>
+<ellipse fill="none" stroke="black" cx="1184" cy="-406" rx="105.818" ry="18"/>
+<text text-anchor="middle" x="1184" y="-401.9" font-family="Times Roman,serif" font-size="14.00">finish current string</text>
+</g>
+<!-- str_fin_pop->pop -->
+<g id="edge94" class="edge"><title>str_fin_pop->pop</title>
+<path fill="none" stroke="black" d="M1240.31,-390.719C1258.94,-385.821 1279.82,-380.503 1299,-376 1361.41,-361.352 1431.13,-346.617 1489.18,-334.798"/>
+<polygon fill="black" stroke="black" points="1490.03,-338.197 1499.13,-332.776 1488.63,-331.337 1490.03,-338.197"/>
+</g>
+<!-- lbl28->ERROR -->
+<g id="edge98" class="edge"><title>lbl28->ERROR</title>
+<path fill="none" stroke="black" d="M679,-187.885C679,-172.874 679,-151.191 679,-133.368"/>
+<polygon fill="black" stroke="black" points="682.5,-133.132 679,-123.132 675.5,-133.132 682.5,-133.132"/>
+</g>
+<!-- lbl30->str_fin -->
+<g id="edge104" class="edge"><title>lbl30->str_fin</title>
+<path fill="none" stroke="black" d="M667.534,-471.98C643.693,-459.143 611.505,-441.81 586.101,-428.132"/>
+<polygon fill="black" stroke="black" points="587.541,-424.932 577.077,-423.272 584.223,-431.095 587.541,-424.932"/>
+</g>
+<!-- lbl31->str_fin_pop -->
+<g id="edge108" class="edge"><title>lbl31->str_fin_pop</title>
+<path fill="none" stroke="black" d="M904.288,-474.601C907.228,-473.695 910.151,-472.82 913,-472 978.711,-453.082 1054.39,-434.953 1109.04,-422.498"/>
+<polygon fill="black" stroke="black" points="1110.01,-425.866 1118.99,-420.24 1108.46,-419.039 1110.01,-425.866"/>
+</g>
+<!-- lbl32->ERROR -->
+<g id="edge112" class="edge"><title>lbl32->ERROR</title>
+<path fill="none" stroke="black" d="M783.191,-291.608C784.188,-263.152 782.7,-207.609 760,-168 751.336,-152.881 737.768,-139.816 724.198,-129.391"/>
+<polygon fill="black" stroke="black" points="725.93,-126.322 715.791,-123.247 721.799,-131.974 725.93,-126.322"/>
+</g>
+<!-- lbl33->tstr_append -->
+<g id="edge116" class="edge"><title>lbl33->tstr_append</title>
+<path fill="none" stroke="black" d="M970.539,-508.032C965.953,-528.447 956.343,-561.981 939,-586 929.749,-598.812 916.867,-610.249 904.553,-619.454"/>
+<polygon fill="black" stroke="black" points="902.261,-616.79 896.17,-625.459 906.338,-622.48 902.261,-616.79"/>
+</g>
+<!-- read_base64 -->
+<g id="node102" class="node"><title>read_base64</title>
+<ellipse fill="none" stroke="black" cx="1394" cy="-406" rx="85.7684" ry="29.6985"/>
+<text text-anchor="middle" x="1394" y="-410.4" font-family="Times Roman,serif" font-size="14.00">store next digit</text>
+<text text-anchor="middle" x="1394" y="-393.4" font-family="Times Roman,serif" font-size="14.00">of string length</text>
+</g>
+<!-- read_base64->BSTR -->
+<g id="edge118" class="edge"><title>read_base64->BSTR</title>
+<path fill="none" stroke="black" d="M1426.96,-433.739C1448.24,-455.043 1468.91,-484.667 1451,-508 1434.32,-529.726 1369.74,-544.973 1316.02,-554.196"/>
+<polygon fill="black" stroke="black" points="1315.41,-550.748 1306.13,-555.848 1316.57,-557.653 1315.41,-550.748"/>
+</g>
+<!-- lbl36->read_base64 -->
+<g id="edge124" class="edge"><title>lbl36->read_base64</title>
+<path fill="none" stroke="black" d="M1390.87,-471.773C1391.23,-464.131 1391.67,-454.922 1392.1,-445.848"/>
+<polygon fill="black" stroke="black" points="1395.6,-445.905 1392.58,-435.75 1388.61,-445.572 1395.6,-445.905"/>
+</g>
+<!-- lbl37->bstr_append -->
+<g id="edge128" class="edge"><title>lbl37->bstr_append</title>
+<path fill="none" stroke="black" d="M1099.77,-508.128C1112.61,-534.685 1136.65,-584.375 1151.68,-615.462"/>
+<polygon fill="black" stroke="black" points="1148.72,-617.37 1156.22,-624.848 1155.02,-614.322 1148.72,-617.37"/>
+</g>
+<!-- lbl38->str_fin_pop -->
+<g id="edge132" class="edge"><title>lbl38->str_fin_pop</title>
+<path fill="none" stroke="black" d="M1226.28,-471.773C1218.87,-460.247 1209.17,-445.159 1200.93,-432.342"/>
+<polygon fill="black" stroke="black" points="1203.86,-430.422 1195.51,-423.903 1197.97,-434.207 1203.86,-430.422"/>
+</g>
+<!-- lbl39->ERROR -->
+<g id="edge136" class="edge"><title>lbl39->ERROR</title>
+<path fill="none" stroke="black" d="M684.661,-36.0588C685.693,-46.1099 685.991,-58.9075 685.557,-70.5491"/>
+<polygon fill="black" stroke="black" points="682.047,-70.6145 684.952,-80.8033 689.035,-71.0267 682.047,-70.6145"/>
+</g>
+</g>
+</svg>
diff --git a/doc-rnd/hacking/import.html b/doc/developer/import.html
similarity index 100%
rename from doc-rnd/hacking/import.html
rename to doc/developer/import.html
diff --git a/doc/developer/indent.html b/doc/developer/indent.html
new file mode 100644
index 0000000..c1e4152
--- /dev/null
+++ b/doc/developer/indent.html
@@ -0,0 +1,15 @@
+<html>
+<body>
+<h1> pcb-rnd - indentation </h1>
+
+As of r1022 all old code is converted using indent(1) with the following
+command line:
+
+<pre>
+indent --line-length128 -brs -br -nce --tab-size2 -ut -npsl -npcs -hnl $*
+</pre>
+<p>
+Contributors are kindly asked to follow this style or run the above commandline
+on their code before sending a patch or committing to svn.
+</body>
+</html>
diff --git a/doc/developer/mods3/README b/doc/developer/mods3/README
new file mode 100644
index 0000000..90c589d
--- /dev/null
+++ b/doc/developer/mods3/README
@@ -0,0 +1,10 @@
+Run ./gne.sh to regenerate index.html.
+
+It depends on the following tools to be installed:
+
+- shell, awk
+- sloccount
+- netpbm
+- animator (svn://repo.hu/animator/trunk)
+- animpie - needs to be symlinked or copied to path from animator/test (sorry)
+
diff --git a/doc/developer/mods3/after.png b/doc/developer/mods3/after.png
new file mode 100644
index 0000000..e69de29
diff --git a/doc-rnd/mods/before.png b/doc/developer/mods3/before.png
similarity index 100%
rename from doc-rnd/mods/before.png
rename to doc/developer/mods3/before.png
diff --git a/doc/developer/mods3/export.png b/doc/developer/mods3/export.png
new file mode 100644
index 0000000..57f0cb1
Binary files /dev/null and b/doc/developer/mods3/export.png differ
diff --git a/doc/developer/mods3/feature.png b/doc/developer/mods3/feature.png
new file mode 100644
index 0000000..3b6c9a1
Binary files /dev/null and b/doc/developer/mods3/feature.png differ
diff --git a/doc/developer/mods3/fp.png b/doc/developer/mods3/fp.png
new file mode 100644
index 0000000..fb28402
Binary files /dev/null and b/doc/developer/mods3/fp.png differ
diff --git a/doc/developer/mods3/gen.sh b/doc/developer/mods3/gen.sh
new file mode 100755
index 0000000..a3a59d9
--- /dev/null
+++ b/doc/developer/mods3/gen.sh
@@ -0,0 +1,152 @@
+#!/bin/sh
+
+path=../../../src_plugins
+
+sloc()
+{
+ (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }'
+}
+
+gen_pie()
+{
+ local bn=$1 code_size=$2 color=$3
+ echo ""
+ echo "@slice"
+ echo "$code_size"
+ echo "@label"
+ echo "$bn ($code_size)"
+ if test ! -z "$color"
+ then
+ echo "@color"
+ echo "$color"
+ fi
+}
+
+rm -f *.pie *.lines
+
+echo "#autogenerated by gen.sh" > mods.pie
+echo "#autogenerated by gen.sh" > after.pie
+
+echo Core >&2
+tmp=/tmp/pcb-mods-stat
+mkdir $tmp
+cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp
+code_size=`sloc $tmp`
+gen_pie "core" $code_size "#00ff88" >> after.pie
+
+#echo 3rd >&2
+#code_size=`sloc ../../src_3rd`
+#gen_pie "3rd" $code_size >> after.pie
+
+echo "" > classes
+
+(
+cat pre.html
+for n in $path/*
+do
+ if test -d "$n"
+ then
+ echo $n >&2
+ bn=`basename $n`
+ code_size=`sloc $n`
+ total=$(($total + $code_size))
+ class=`sed '
+ /^#implements:/ {
+ s/#implements: *//
+ s/[()]//g
+ p
+ }
+ { d }
+ ' < $n/README`
+ echo "$class" >> classes
+
+ echo "$code_size" >> $class.lines
+ gen_pie $bn $code_size >> $class.pie
+
+# case $bn in
+# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;;
+# esac
+
+ echo "<tr><th align=left>$bn<td>$code_size"
+ awk '
+ /^#/ {
+ key=$1
+ sub("#", "", key)
+ sub("[:=]", "", key)
+ $1=""
+ DB[key]=$0
+ next
+ }
+ { desc = desc " " $0 }
+
+ function strip(s) {
+ sub("^[ \t]*", "", s)
+ sub("[ \t]*$", "", s)
+ return s
+ }
+
+ END {
+ st = DB["state"]
+ if (st ~ "partial")
+ clr = "bgcolor=\"yellow\""
+ else if (st ~ "works")
+ clr = "bgcolor=\"lightgreen\""
+ else if ((st ~ "fail") || (st ~ "disable"))
+ clr = "bgcolor=\"red\""
+ else
+ clr=""
+
+ clr2 = clr
+ if (clr2 != "") {
+ sub("bgcolor=\"", "", clr2)
+ sub("\"", "", clr2)
+ print "@color" >> "mods.pie"
+ print clr2 >> "mods.pie"
+ }
+
+ print "<td " clr " >" st
+ if (DB["lstate"] != "")
+ print "<br> (" strip(DB["lstate"]) ")"
+
+ dfl = DB["default"]
+ if (dfl ~ "buildin")
+ clr = "bgcolor=\"lightgreen\""
+ else if (dfl ~ "plugin")
+ clr = "bgcolor=\"yellow\""
+ else if ((dfl ~ "fail") || (dfl ~ "disable"))
+ clr = "bgcolor=\"red\""
+ else
+ clr=""
+
+ print "<td " clr ">" dfl
+ if (DB["ldefault"] != "")
+ print "<br> (" strip(DB["ldefault"]) ")"
+ print "<td>" DB["implements"]
+ print "<td>" desc
+ }
+ ' < $n/README
+ fi
+done
+cat post.html
+gen_pie "plugins" "$total" "#0088ff" >> after.pie
+) > index.html
+
+for n in *.lines
+do
+ lines=`awk '{ sum += $1 } END { print sum }' < $n`
+ bn=${n%%.lines}
+ gen_pie $bn $lines >> mods.pie
+done
+
+
+classes=`sort < classes | uniq`
+
+for n in $classes after mods
+do
+ animpie < $n.pie | animator -H -d $n
+ pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png
+ rm ${n}0000.png
+done
+
+
+rm classes
diff --git a/doc/developer/mods3/hid.png b/doc/developer/mods3/hid.png
new file mode 100644
index 0000000..5438001
Binary files /dev/null and b/doc/developer/mods3/hid.png differ
diff --git a/doc/developer/mods3/import.png b/doc/developer/mods3/import.png
new file mode 100644
index 0000000..09f9943
Binary files /dev/null and b/doc/developer/mods3/import.png differ
diff --git a/doc/developer/mods3/index.html b/doc/developer/mods3/index.html
new file mode 100644
index 0000000..937967f
--- /dev/null
+++ b/doc/developer/mods3/index.html
@@ -0,0 +1,436 @@
+<html>
+<head>
+ <title> pcb-rnd modularization </title>
+</head>
+<body>
+<H1> pcb-rnd modularization </H1>
+<H2> Why bother... </H2>
+I believe good software should be modular. This is especially important in
+the context of large software, such as CAD applications. There should be
+a thin core that can model the world and provide the basic operations defined
+on it but anything else should go in separate modules.
+<p>
+Fortunately PCB already had a strong infrastructure supporting this idea.
+It has dynamic loadable plugins and the GUI and exporters are in separate
+HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
+gpmi module as a separate plugin.
+<p>
+In version 1.0.8 to 1.1.0 a considerable chunk of core code has been moved into
+<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
+maintained together with the core, in the same repository, still the code is
+somewhat detached from the core. More importantly, the user can choose, for
+each plugin, separately:
+<ul>
+ <li> to compile it as a buildin (static-link it into the pcb executable)
+ <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
+ <li> to disable the plugin, so it is not compiled at all
+</ul>
+<p>
+I believe such modularization has benefits on multiple levels:
+<ul>
+ <li> it is possible to compile smaller, potentially faster executables by omitting features the specific user would never use anyway
+ <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
+ <li> such plugins have to have some sort of APIs if they want to reference each other or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
+</ul>
+
+<H2> Progress in charts </H2>
+<h3> Before-after </h3>
+All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
+and are acquired running sloccount on the given directory. While lines of
+code alone is not a true measure of complexity, it's a good estimation. The
+slices of pie charts are the major components of the pcb-rnd executable.
+<table border=1 cellspacing=0> <tr><td>
+ <table border=0>
+ <tr><td><img src="before.png"><td> <td><img src="after.png">
+ <tr><td>Before modularization: pcb-rnd version 1.0.7
+ <br>Note: gpmi was already a plugin
+ <td>
+ <td> After modularization: pcb-rnd version 1.1.3
+ <br>Note: gpmi is part of the "plugins" slice
+ </table>
+</table>
+<h3>Zooming on to the plugins</h3>
+<p>
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="mods.png"><tr><td><b>total size per class</b></table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="io.png"><tr><td>IO plugins</table>
+</table>
+
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="feature.png"><tr><td>feature plugins </table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="export.png"><tr><td>export plugins</table>
+</table>
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="hid.png"><tr><td>HID plugins</table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="import.png"><tr><td>import plugins</table>
+</table>
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="lib.png"><tr><td>library plugins </table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="fp.png"><tr><td>footprint plugins</table>
+</table>
+
+<p>
+(Red means the plugin doesn't really work).
+
+<H2> Progress in numbers </H2>
+Below is a table with the summary of core plugins.
+<table border=1 cellspacing=0>
+<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> class <th> description
+
+
+<tr><th align=left>acompnet<td>74
+<td > WIP
+<td bgcolor="red"> disable
+<td> (feature)
+<td> Auto-complete the current network. A very limited autorouter/assistant.
+<tr><th align=left>autocrop<td>157
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Reduce the board dimensions to just enclose the elements.
+<tr><th align=left>autoplace<td>617
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Automatically place elements.
+<tr><th align=left>autoroute<td>4341
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Automatically route selected or all rats. This is the original autorouter.
+<tr><th align=left>boardflip<td>133
+<td > WIP
+<br> (doesn't update rtrees)
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> All objects on the board are up-down flipped.
+<tr><th align=left>dbus<td>486
+<td > WIP
+<br> (needs to install the xml?)
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Remote control PCB using DBUS.
+<tr><th align=left>diag<td>167
+<td bgcolor="lightgreen" > works
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Actions for pcb-rnd core diagnostics, intended for developers. These are not in core because end users normally don't need these. As a plugin, due to dynamic loading, it can be dropped on an existing pcb-rnd installation with minimal risk of scaring away a reproducible bug.
+<tr><th align=left>distalign<td>427
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Introducing Align() and Distribute(), which work much like the similarly named functions in Visio. Given that PCB does not have the concept of "first selected object" to draw on, the reference points can be selected by arguments.
+<tr><th align=left>distaligntext<td>466
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Same as distalign, operates on text objects.
+<tr><th align=left>djopt<td>2320
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Various board optimization algorithms.
+<tr><th align=left>draw_fab<td>257
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Draw the fab layer (for various exporters).
+<tr><th align=left>export_bboard<td>410
+<td > WIP
+<td bgcolor="red"> disabled
+<td> export
+<td> Export breadboard
+<tr><th align=left>export_bom<td>230
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export bom (Bill of Materials)
+<tr><th align=left>export_dsn<td>447
+<td > Work-in-progress
+<td bgcolor="red"> disable
+<td> export
+<td> Export specctra .dsn files
+<tr><th align=left>export_dxf<td>3987
+<td > WIP
+<td bgcolor="red"> disabled
+<td> export
+<td> Export dxf
+<tr><th align=left>export_gcode<td>2470
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export to gcode
+<tr><th align=left>export_gerber<td>939
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export to gerber
+<tr><th align=left>export_ipcd356<td>467
+<td > Work-in-progress
+<td bgcolor="red"> disable
+<td> export
+<td> IPC-D-356 Netlist export.
+<tr><th align=left>export_lpr<td>104
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export to lpr (using export_ps to generate postscript)
+<tr><th align=left>export_nelma<td>668
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export to nelma (Numerical capacitance calculator)
+<tr><th align=left>export_openscad<td>1373
+<td > WIP
+<td bgcolor="red"> disabled
+<td> export
+<td> Export openscad
+<tr><th align=left>export_png<td>1090
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export to png, gif and jpeg
+<tr><th align=left>export_ps<td>1623
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export postscript or embedded postscript.
+<tr><th align=left>export_stat<td>259
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export various board statistics in lihata format
+<tr><th align=left>export_svg<td>562
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Scalable Vector Graphics (SVG) exporter
+<tr><th align=left>export_test<td>257
+<td bgcolor="red" > disabled
+<br> (work in progress)
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> A thin layer of code to dump exporter calls for testing the HID exporter API.
+<tr><th align=left>export_xy<td>272
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> export
+<td> Export XY centroid element data for pick & place.
+<tr><th align=left>fontmode<td>165
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Font editing actions.
+<tr><th align=left>fp_fs<td>380
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> fp
+<td> Footprint: file system based implementation. Used to be called Newlib: load footprints from directories. Run external processes for the parametric footprints.
+<tr><th align=left>fp_wget<td>303
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> fp
+<td> Footprint: get static (file) footprints from the web, e.g. from http://gedasymbols.org
+<tr><th align=left>gl<td>588
+<td bgcolor="red" > disabled
+<br> (pcb-rnd has no support for opengl.)
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Common gl functions for hids.
+<tr><th align=left>gpmi<td>3221
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<br> (if gpmi is installed)
+<td> (feature)
+<td> Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
+<tr><th align=left>hid_batch<td>317
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> hid
+<td> HID without GUI; read actions from stdin.
+<tr><th align=left>hid_gtk<td>16287
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> hid
+<td> GUI: the GTK HID.
+<tr><th align=left>hid_lesstif<td>6919
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> hid
+<td> GUI: the lesstif HID.
+<tr><th align=left>hid_remote<td>1116
+<td > WIP
+<td bgcolor="red"> disable
+<td> hid
+<td> Remote access HID: implement a protocol and use it to relay between a core and a remote HID implementation.
+<tr><th align=left>import_dsn<td>115
+<td > Work-in-progress
+<td bgcolor="red"> disable
+<td> import
+<td> Import specctra .dsn files
+<tr><th align=left>import_edif<td>3624
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> import
+<td> Import plugin for netlists in the EDIF format.
+<tr><th align=left>import_hyp<td>1547
+<td > WIP
+<td bgcolor="red"> disable
+<td> import
+<td> Import plugin for hyperlynx geometry.
+<tr><th align=left>import_netlist<td>136
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> import
+<td> Import plugin for netlists in the classic pcb netlist format.
+<tr><th align=left>import_sch<td>305
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> import
+<td> Imports element and netlist data from the schematics (or some other source).
+<tr><th align=left>io_kicad<td>2987
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> io
+<td> Load and save the design and elements in Kicad's s-expression format - this is the new, currently preferred format in Kicad.
+<tr><th align=left>io_kicad_legacy<td>944
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> io
+<td> Export the design and elements in Kicad's legacy format.
+<tr><th align=left>io_lihata<td>1973
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> io
+<td> Load and save the design and elements in the lihata board format.
+<tr><th align=left>io_pcb<td>2200
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> io
+<td> Load and save the design and elements in the original pcb text format.
+<tr><th align=left>jostle<td>445
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Pushes lines out of the way.
+<tr><th align=left>lib_gensexpr<td>6
+<td bgcolor="lightgreen" > works
+<td bgcolor="red"> disabled
+<td> (lib)
+<td> S-expression parser lib
+<tr><th align=left>lib_legacy_func<td>87
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (lib)
+<td> Random collection of old/obsolete (legacy) functions. 3rd party plugins may depend on them. This module implements C functions and variables and does not register actions or flags.
+<tr><th align=left>loghid<td>272
+<td > WIP
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Sits between a HID (or exporter) and the core and logs all core->plugin calls made through the HID structure.
+<tr><th align=left>mincut<td>904
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
+<tr><th align=left>oldactions<td>154
+<td bgcolor="lightgreen" > works
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout; a set of debug actions useful for writing pcb scripts: Debug(), DebugXY(), Return(). Old plugin actions to toggle or set settings that are now accessible via the unified config system (vendordrill, djopt)
+<tr><th align=left>polycombine<td>207
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> The selected polygons are combined together according to the ordering of their points.
+<tr><th align=left>polystitch<td>184
+<td > segfaults
+<td bgcolor="red"> disable
+<td> (feature)
+<td> The polygon under the cursor (based on closest-corner) is stitched together with the polygon surrounding it on the same layer. Use with pstoedit conversions where there's a "hole" in the shape - select the hole.
+<tr><th align=left>propedit<td>772
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> List and edit properties of a group of objects.
+<tr><th align=left>puller<td>1888
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Pull traces to minimize their length.
+<tr><th align=left>query<td>1834
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> pcb-rnd query language: execute expressions on objects and rules for the programmed drc.
+<tr><th align=left>renumber<td>308
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Renumber elements (renaming them) and generate a text file for back annotation.
+<tr><th align=left>report<td>1019
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Report() and ReportObject() actions - print a report about design objects.
+<tr><th align=left>rubberband_orig<td>599
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> The original rubberband code.
+<tr><th align=left>shand_cmd<td>211
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> vi-like command shorthands (1..3 character long commands)
+<tr><th align=left>smartdisperse<td>172
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Improve the initial dispersion of elements by choosing an order based on the netlist, rather than the arbitrary element order. This isn't the same as a global autoplace, it's more of a linear autoplace. It might make some useful local groupings. For example, you should not have to chase all over the board to find the resistor that goes with a given LED.
+<tr><th align=left>stroke<td>135
+<td bgcolor="yellow" > partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Gesture recognition with libstroke.
+<tr><th align=left>teardrops<td>226
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Draw teardrops on pins.
+<tr><th align=left>toporouter<td>6161
+<td bgcolor="red" > fails
+<br> (infinite loop in gts)
+<td bgcolor="red"> disabled
+<td> (feature)
+<td> Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
+<tr><th align=left>vendordrill<td>516
+<td bgcolor="lightgreen" > works
+<td bgcolor="lightgreen"> buildin
+<td> (feature)
+<td> Vendor drill mapping.
+</table>
+
+<H3> Classes </H3>
+Each plugin implements a class (rarely a set of classes). Classes are:
+<table border=1 cellspacing=0>
+ <tr><th>name <th> description
+ <tr><td>(feature) <td> random features directly accessible for the user, usually actions
+ <tr><td>(lib) <td> support code library for other plugins (core doesn't depend on these); functionality not directly accessible for the user but other plugins may depend on it
+ <tr><td>hid <td> Human Interface Device: interactive user interface, usually GUI
+ <tr><td>import <td> load alien formats into the design space
+ <tr><td>export <td> save (parts of) the design space in alien formats
+ <tr><td>fp <td> footprint (element) library implementation
+ <tr><td>io <td> native file format (save & load) implementation
+</table>
+
+</body>
+</html>
diff --git a/doc/developer/mods3/io.png b/doc/developer/mods3/io.png
new file mode 100644
index 0000000..8da3757
Binary files /dev/null and b/doc/developer/mods3/io.png differ
diff --git a/doc/developer/mods3/lib.png b/doc/developer/mods3/lib.png
new file mode 100644
index 0000000..ea68b9a
Binary files /dev/null and b/doc/developer/mods3/lib.png differ
diff --git a/doc/developer/mods3/mods.png b/doc/developer/mods3/mods.png
new file mode 100644
index 0000000..7a14b28
Binary files /dev/null and b/doc/developer/mods3/mods.png differ
diff --git a/doc-rnd/mods3/post.html b/doc/developer/mods3/post.html
similarity index 100%
rename from doc-rnd/mods3/post.html
rename to doc/developer/mods3/post.html
diff --git a/doc/developer/mods3/pre.html b/doc/developer/mods3/pre.html
new file mode 100644
index 0000000..fe447fe
--- /dev/null
+++ b/doc/developer/mods3/pre.html
@@ -0,0 +1,88 @@
+<html>
+<head>
+ <title> pcb-rnd modularization </title>
+</head>
+<body>
+<H1> pcb-rnd modularization </H1>
+<H2> Why bother... </H2>
+I believe good software should be modular. This is especially important in
+the context of large software, such as CAD applications. There should be
+a thin core that can model the world and provide the basic operations defined
+on it but anything else should go in separate modules.
+<p>
+Fortunately PCB already had a strong infrastructure supporting this idea.
+It has dynamic loadable plugins and the GUI and exporters are in separate
+HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
+gpmi module as a separate plugin.
+<p>
+In version 1.0.8 to 1.1.0 a considerable chunk of core code has been moved into
+<i>core plugins</i>. A <i>core plugin</i> is just a plugin that is
+maintained together with the core, in the same repository, still the code is
+somewhat detached from the core. More importantly, the user can choose, for
+each plugin, separately:
+<ul>
+ <li> to compile it as a buildin (static-link it into the pcb executable)
+ <li> to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
+ <li> to disable the plugin, so it is not compiled at all
+</ul>
+<p>
+I believe such modularization has benefits on multiple levels:
+<ul>
+ <li> it is possible to compile smaller, potentially faster executables by omitting features the specific user would never use anyway
+ <li> in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
+ <li> such plugins have to have some sort of APIs if they want to reference each other or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
+</ul>
+
+<H2> Progress in charts </H2>
+<h3> Before-after </h3>
+All numbers are in <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">SLOC</a>
+and are acquired running sloccount on the given directory. While lines of
+code alone is not a true measure of complexity, it's a good estimation. The
+slices of pie charts are the major components of the pcb-rnd executable.
+<table border=1 cellspacing=0> <tr><td>
+ <table border=0>
+ <tr><td><img src="before.png"><td> <td><img src="after.png">
+ <tr><td>Before modularization: pcb-rnd version 1.0.7
+ <br>Note: gpmi was already a plugin
+ <td>
+ <td> After modularization: pcb-rnd version 1.1.3
+ <br>Note: gpmi is part of the "plugins" slice
+ </table>
+</table>
+<h3>Zooming on to the plugins</h3>
+<p>
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="mods.png"><tr><td><b>total size per class</b></table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="io.png"><tr><td>IO plugins</table>
+</table>
+
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="feature.png"><tr><td>feature plugins </table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="export.png"><tr><td>export plugins</table>
+</table>
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="hid.png"><tr><td>HID plugins</table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="import.png"><tr><td>import plugins</table>
+</table>
+
+<table border=0 width="100%">
+<tr>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="lib.png"><tr><td>library plugins </table>
+ <td width="50%"><table border=1 cellspacing=0><tr><td><img src="fp.png"><tr><td>footprint plugins</table>
+</table>
+
+<p>
+(Red means the plugin doesn't really work).
+
+<H2> Progress in numbers </H2>
+Below is a table with the summary of core plugins.
+<table border=1 cellspacing=0>
+<tr><th>module <th>size [sloc] <th> status <th> configure<br>default <th> class <th> description
+
+
diff --git a/doc/developer/obj_func_naming.txt b/doc/developer/obj_func_naming.txt
new file mode 100644
index 0000000..c3cfdae
--- /dev/null
+++ b/doc/developer/obj_func_naming.txt
@@ -0,0 +1,83 @@
+obj_* function naming conventions
+
+
+High level (new/destroy):
+
+ This is the recommended way of creating new objects.
+
+ pcb_*_new():
+ Calls pcb_*_alloc(), fills in fields from parameters and calls the post
+ processing (pcb_add_*_on_layer()) function as needed. Makes sanity checks
+ on the parameters and may fail upon that.
+
+ pcb_*_new_*():
+ Same as pcb_*_new(), but may do clever things so the object created may
+ not be 1:1 what was requested or may not even be a new object (e.g.
+ overlapping line merging)
+
+ pcb_element_*_new():
+ same as pcb_*_new(), parent being an element
+
+ pcb_*_destroy()
+ free all fields of an object and properly remove it from the parent
+ (including rtree removal)
+
+Low level (alloc/free):
+
+ Use this in some special cases (like loading a file) when the extra checks
+ of a _new may interfere.
+
+ pcb_*_alloc():
+ allocate a new objects within a parent (as of now: layer). Allocates
+ the struct of a new objects with all fields clean and links the object
+ in the parent list. Returns a pointer to the object. NOTE: some post
+ processing may be needed after filling in the fields
+ (see also: pcb_add_*_on_layer())
+
+ pcb_element_*_alloc():
+ same, but parent is an element - will be removed once elements are
+ generalized.
+
+ pcb_*_free():
+ free the struct memory (but not the fields!) of an object and remove
+ it from the parent list.
+
+ pcb_add_*_on_layer():
+ Postprocessing: call this after a new object is allocated and fields are
+ filled in. It mainly updates the rtree.
+
+ pcb_*_copy():
+ copy fields of a complex obj to a pre-allocated target obj
+
+
+Accessors:
+ pcb_*_get_*():
+ Return data that are not directly accessible as object struct fields but
+ require some sort of calculation
+
+ pcb_*_set_*():
+ Set object fields that require postprocessing because of side effects.
+ Use these instead of direct writes to the fields to get side effects
+ properly executed.
+
+ pcb_*_change_*():
+ Similar to pcb_*_set_*(), but instead of setting a field to a value
+ specified as a parameter, change the field to comply with some global
+ state, e.g. "change side" would move the object to the currently viewed
+ side.
+
+Transformations:
+ pcb_*_move():
+ move the object within its parent (x;y); it's often implemented as a
+ macro
+
+ pcb_*_mirror():
+ mirror the object within its parent (x;y)
+
+
+Misc:
+ pcb_*_bbox():
+ calculate and update the bounding box of an object
+
+ pcb_*_rotate90()
+ Rotate the object by n*90 degrees
diff --git a/doc/developer/packaging.txt b/doc/developer/packaging.txt
new file mode 100644
index 0000000..b6bc345
--- /dev/null
+++ b/doc/developer/packaging.txt
@@ -0,0 +1,90 @@
+Packaging pcb-rnd for a distribution
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. program, libs, desktop integration
+
+Pcb-rnd is an interactive printed circuit board editor program. A typical
+user is an electric engineer. This sort of programs are often called EDA,
+Electronics Design Automation.
+
+Pcb-rnd has different frontends: graphical and stdio/text based batch
+processing. There are different graphical frontends - pcb-rnd does not
+depend on gtk or motif, the specific frontend modules may depend on them.
+
+Pcb-rnd is scriptable if libgpmi is available. Since libgpmi is not
+a mainstream library for the scripting feature it should also be packaged.
+
+Pcb-rnd is intended for UNIX-fans. It is heavily keyboard-oriented and it
+doesn't assume its users don't want to understand or learn how it works.
+Many typical user workflows include Makefiles and it's a common thing to
+start pcb-rnd from a shell. Thus desktop integration is not in focus
+at the moment. If you fixed things for this while packaging, please let
+us know, we may merge your patches (see below).
+
+2. options, plugins, dependencies
+
+Pcb-rnd is a modular software with a lot of options. Majority of these options
+are selected by the state of a module. A module has three states:
+ - disable: (not compiled at all)
+ - buildin: enabled and static linked
+ - plugin: enabled and dynamic loaded (from a .so)
+
+The configure script takes --disable-*, --building-* and --plugin-*
+arguments with * substituted with the name of the module. The configure
+script also determines the dependencies according to the selection. Special
+arguments --all=plugin and --all=buildin are provided in configure to select
+all working modules to be plugins or buildins.
+
+For binary distributions it's strongly recommended to have most of the
+modules compiled as plugins and have them in separate packages. This
+would let the user to install a core pcb-rnd package and then the GTK
+or the lesstif plugin (or both) from separate packages. This also reduces
+package dependencies.
+
+This is less relevant for source distributions, if the user has full control
+over the configuration.
+
+If non-critical dependencies are not met, modules are automatically disabled
+by ./configure.
+
+3. typical ./configure options - scconfig vs. auto*
+
+./configure --prefix works as expected. DESTDIR works as expected.
+
+Typical commands for configuring pcb-rnd for packaging would be:
+
+ ./configure --all=plugin --prefix=/usr
+ make all
+ DESTDIR=/tmp/pkg_tmp make install
+
+We are happy with scconfig. Please don't write about how much better
+autoconf or cmake would be, we won't switch.
+
+4. release cycles, tarballs, svn trunk - what to package
+
+Development happens in svn trunk/, there are usually no branches. While
+we try to keep trunk/ compilable any time, it's not guaranteed that it
+would work out-of-the-box between releases. It is not recommended to
+package trunk/ - please package stable releases instead.
+
+We follow the "release early, release often" rule. Source release tarballs
+are always considered stable. Beside the project web page, releases are
+also accessible as svn tags: svn://repo.hu/pcb-rnd/tags .
+
+Sometimes we have minor releases with 1..2 month period, sometimes a
+longer period passes between releases.
+
+There's no automated release notification at the moment; if you want to
+get notified about new releases, please contact me (email
+pcb-rnd (at) igor2.repo.hu)
+
+5. bug reporting and fixes for packaging
+
+There's no special method for reporting packaging related bugs and
+feature requests, please follow the normal bug report instructions or just
+drop me a mail. Please mention that the issue is related to packaging, this
+usually gives it a higher priority.
+
+We are willing to make minor changes to make packaging easier - if you bump
+into something you'd need to work around while packaging, please let us know,
+we may just fix it "upstream".
+
diff --git a/doc-rnd/hacking/plugin_core_simple.html b/doc/developer/plugin_core_simple.html
similarity index 100%
rename from doc-rnd/hacking/plugin_core_simple.html
rename to doc/developer/plugin_core_simple.html
diff --git a/doc-rnd/hacking/plugin_naming.html b/doc/developer/plugin_naming.html
similarity index 100%
rename from doc-rnd/hacking/plugin_naming.html
rename to doc/developer/plugin_naming.html
diff --git a/doc/developer/releasing.txt b/doc/developer/releasing.txt
new file mode 100644
index 0000000..c46e8ee
--- /dev/null
+++ b/doc/developer/releasing.txt
@@ -0,0 +1,11 @@
+release check list
+
+0. test compile and test run a clean checkout on a clean system
+ configure with --debug --all=buildin, then without
+1. check next version number and previous revision in tags/
+2. update the changelog
+3. rewrite the release notes
+4. modify version number in scconfig
+5. commit trunk
+6. svn tag using URLs
+7. update the timeline, events and doc/news.html
diff --git a/doc/developer/renames b/doc/developer/renames
new file mode 100644
index 0000000..1301dc7
--- /dev/null
+++ b/doc/developer/renames
@@ -0,0 +1,1516 @@
+Name differences between mainline -> pcb_rnd
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#types:
+
+PCBTypePtr -> pcb_board_t *
+PCBType -> pcb_board_t
+DataTypePtr -> pcb_data_t *
+DataType -> pcb_data_t
+LayerGroupTypePtr -> pcb_layer_group_t *
+LayerGroupType -> pcb_layer_group_t
+LayerTypePtr -> pcb_layer_t *
+LayerType -> pcb_layer_t
+BufferTypePtr -> pcb_buffer_t *
+BufferType -> pcb_buffer_t
+NetTypePtr -> pcb_net_t *
+NetType -> pcb_net_t
+ConnectionTypePtr -> pcb_connection_t *
+ConnectionType -> pcb_connection_t
+BoxTypePtr -> pcb_box_t *
+BoxType -> pcb_box_t
+BoxListTypePtr -> pcb_box_list_t *
+BoxListType -> pcb_box_list_t
+FontTypePtr -> pcb_font_t *
+FontType -> pcb_font_t
+LineTypePtr -> pcb_line_t *
+LineType -> pcb_line_t
+AttachedObjectTypePtr -> pcb_attached_obj_t *
+AttachedObjectType -> pcb_attached_obj_t
+AttachedLineTypePtr -> pcb_attached_line_t *
+AttachedLineType -> pcb_attached_line_t
+CrosshairTypePtr -> pcb_crosshair_t *
+CrosshairType -> pcb_crosshair_t
+MarkTypePtr -> pcb_mark_t *
+MarkType -> pcb_mark_t
+ArcTypePtr -> pcb_arc_t *
+ArcType -> pcb_arc_t
+PointTypePtr -> pcb_point_t *
+PointType -> pcb_point_t
+RatTypePtr -> pcb_rat_t *
+RatType -> pcb_rat_t
+PolygonTypePtr -> pcb_polygon_t *
+PolygonType -> pcb_polygon_t
+PadTypePtr -> pcb_pad_t *
+PadType -> pcb_pad_t
+PinTypeType -> pcb_pin_t *
+PinType -> pcb_pin_t
+ElementTypeHandle -> pcb_element_t **
+ElementTypePtr -> pcb_element_t *
+ElementType -> pcb_element_t
+TextTypePtr -> pcb_text_t *
+TextType -> pcb_text_t
+AttributeListTypePtr -> pcb_attribute_list_t *
+AttributeListType -> pcb_attribute_list_t
+AttributeTypePtr -> pcb_attribute_t *
+AttributeType -> pcb_attribute_t
+OutputTypePtr -> pcb_output_t *
+OutputType -> pcb_output_t
+DrcViolationTypePtr -> pcb_drc_violation_t *
+DrcViolationType -> pcb_drc_violation_t
+FlagBitsTypePtr -> pcb_flag_bits_t *
+FlagBitsType -> pcb_flag_bits_t
+FlagTypePtr -> pcb_flag_t *
+FlagType -> pcb_flag_t
+SymbolTypePtr -> pcb_symbol_t *
+SymbolType -> pcb_symbol_t
+FunctionID -> pcb_function_id_t
+EndCapStyle -> pcb_cap_style_t
+hidval -> pcb_hidval_t
+HID_Action -> pcb_hid_action_t
+PCBWatchFlags -> pcb_watch_flags_t
+HID_DRC_GUI -> pcb_hid_drc_gui_t
+HID -> pcb_hid_t
+hid_gc_struct -> hid_gc_s
+hidGC -> pcb_hid_gc_t
+HID_Attr_Val -> pcb_hid_attr_val_t
+HID_Attribute -> pcb_hid_attribute_t
+HID_AttrNode -> pcb_hid_attr_node_t
+LibraryEntryTypePtr -> pcb_lib_entry_t *
+LibraryEntryType -> pcb_lib_entry_t
+LibraryMenuTypePtr -> pcb_lib_menu_t *
+LibraryMenuType -> pcb_lib_menu_t
+LibraryTypePtr -> pcb_lib_t *
+LibraryType -> pcb_lib_t
+UnitList -> pcb_unit_list_t
+unitflags -> pcb_unit_flags_e
+UnitList -> pcb_unit_list_t
+NetListTypePtr -> pcb_netlist_t *
+NetListType -> pcb_netlist_t
+NetListListTypePtr -> pcb_netlist_list_t *
+NetListListType -> pcb_netlist_list_t
+AnyObjectTypePtr -> pcb_any_obj_t *
+AnyObjectType -> pcb_any_obj_t
+AnyLineObjectTypePtr -> pcb_any_line_t *
+AnyLineObjectType -> pcb_any_line_t
+AttachedLineTypePtr -> pcb_attached_line_t
+AttachedLineType -> pcb_attached_line_t *
+Vector -> pcb_vector_t
+vertex -> pcb_vertex_t
+CVCList -> pcb_cvc_list_t
+VNODE -> pcb_vnode_t
+PLINE -> pcb_pline_t
+POLYAREA -> pcb_polyarea_t
+PolygonBooleanOperation -> pcb_poly_bool_op_e
+RubberbandType -> pcb_rubberband_t
+Unit -> pcb_unit_t
+Increments -> pcb_increments_t
+Angle -> pcb_angle_t
+Coord -> pcb_coord_t
+RouteStyleTypePtr -> pcb_route_style_t *
+RouteStyleType -> pcb_route_style_t
+heap_t -> pcb_heap_t
+cost_t -> pcb_cost_t
+
+# functions:
+EventMoveCrosshair -> pcb_event_move_crosshair
+AdjustAttachedObjects -> pcb_adjust_attached_objects
+
+warpNoWhere -> pcb_warp_nowhere
+get_style_size -> pcb_get_style_size
+NotifyLine -> pcb_notify_line
+NotifyBlock -> pcb_notify_block
+NotifyMode -> pcb_notify_mode
+ClearWarnings -> pcb_clear_warnings
+ReleaseMode -> pcb_release_mode
+AFAIL -> PCB_AFAIL
+ACTION_ARG -> PCB_ACTION_ARG
+AttributeGetFromList -> pcb_attribute_get
+AttributePutToList -> pcb_attribute_put
+AttributeRemoveFromList -> pcb_attribute_remove
+FreeAttributeListMemory -> pcb_attribute_free
+AttributeGet -> pcb_attrib_get
+AttributePut -> pcb_attrib_put
+AttributeRemove -> pcb_attrib_remove
+FreePCBMemory -> pcb_board_free
+CreateNewPCB_ -> pcb_board_new_
+CreateNewPCB -> pcb_board_new
+CreateNewPCBPost -> pcb_board_new_postproc
+CountHoles -> pcb_board_count_holes
+SWAP_X -> PCB_SWAP_X
+SWAP_Y -> PCB_SWAP_Y
+ROTATEBOX_CW -> PCB_BOX_ROTATE_CW
+ROTATEBOX_TO_NORTH -> PCB_BOX_ROTATE_TO_NORTH
+ROTATEBOX_FROM_NORTH -> PCB_BOX_ROTATE_FROM_NORTH
+CENTER_X -> PCB_BOX_CENTER_X
+CENTER_Y -> PCB_BOX_CENTER_Y
+MOVE_BOX_LOWLEVEL -> PCB_BOX_MOVE_LOWLEVEL
+point_in_box -> pcb_point_in_box
+point_in_closed_box -> pcb_point_in_closed_box
+box_is_good -> pcb_box_is_good
+box_intersect -> pcb_box_intersect
+closest_pcb_point_in_box -> pcb_closest_pcb_point_in_box
+box_in_box -> pcb_box_in_box
+clip_box -> pcb_clip_box
+shrink_box -> pcb_shrink_box
+bloat_box -> pcb_bloat_box
+box_center -> pcb_box_center
+box_corner -> pcb_box_corner
+point_box -> pcb_point_box
+close_box -> pcb_close_box
+dist2_to_box -> pcb_dist2_to_box
+GetBoxMemory -> pcb_box_new
+FreeBoxListMemory -> pcb_box_free
+SetPointBoundingBox -> pcb_set_point_bounding_box
+SwapBuffer -> pcb_swap_buffer
+SetBufferBoundingBox -> pcb_set_buffer_bbox
+ClearBuffer -> pcb_buffer_clear
+pcb_swap_buffer -> pcb_buffer_swap
+pcb_buffer_set_bbox ->
+AddSelectedToBuffer -> pcb_buffer_add_selected
+LoadLayoutToBuffer -> pcb_buffer_load_layout
+RotateBuffer -> pcb_buffer_rotate
+SelectPasteBuffer -> pcb_buffer_select_paste
+MirrorBuffer -> pcb_buffer_mirror
+InitBuffers -> pcb_init_buffers
+UninitBuffers -> pcb_uninit_buffers
+MoveObjectToBuffer -> pcb_move_obj_to_buffer
+CopyObjectToBuffer -> pcb_copy_obj_to_buffer
+LoadFootprint -> pcb_load_footprint
+CreateNewBuffer -> pcb_buffer_new
+PASTEBUFFER -> PCB_PASTEBUFFER
+QuitApplication -> pcb_quit_app
+GetInfoString -> pcb_get_infostr
+ChangeLayoutName -> pcb_board_change_name
+ChangeLayerName -> pcb_layer_change_name
+ChangeSelectedSize -> pcb_chg_selected_size
+ChangeSelectedClearSize -> pcb_chg_selected_clear_size
+ChangeSelected2ndSize -> pcb_chg_selected_2nd_size
+ChangeSelectedMaskSize -> pcb_chg_selected_mask_size
+ChangeSelectedJoin -> pcb_chg_selected_join
+SetSelectedJoin -> pcb_set_selected_join
+ClrSelectedJoin -> pcb_clr_selected_join
+ChangeSelectedNonetlist -> pcb_chg_selected_nonetlist
+ChangeSelectedSquare -> pcb_chg_selected_square
+SetSelectedSquare -> pcb_set_selected_square
+ClrSelectedSquare -> pcb_clr_selected_square
+ChangeSelectedThermals -> pcb_chg_selected_thermals
+ChangeSelectedHole -> pcb_chg_selected_hole
+ChangeSelectedPaste -> pcb_chg_selected_paste
+ChangeSelectedOctagon -> pcb_chg_selected_octagon
+SetSelectedOctagon -> pcb_set_selected_octagon
+ClrSelectedOctagon -> pcb_clr_selected_octagon
+ChangeObjectSize -> pcb_chg_obj_size
+ChangeObject1stSize -> pcb_chg_obj_1st_size
+ChangeObjectThermal -> pcb_chg_obj_thermal
+ChangeObjectClearSize -> pcb_chg_obj_clear_size
+ChangeObject2ndSize -> pcb_chg_obj_2nd_size
+ChangeObjectMaskSize -> pcb_chg_obj_mask_size
+ChangeObjectJoin -> pcb_chg_obj_join
+SetObjectJoin -> pcb_set_obj_join
+ClrObjectJoin -> pcb_clr_obj_join
+ChangeObjectNonetlist -> pcb_chg_obj_nonetlist
+ChangeObjectSquare -> pcb_chg_obj_square
+SetObjectSquare -> pcb_set_obj_square
+ClrObjectSquare -> pcb_clr_obj_square
+ChangeObjectOctagon -> pcb_chg_obj_octagon
+SetObjectOctagon -> pcb_set_obj_octagon
+ClrObjectOctagon -> pcb_clr_obj_octagon
+ChangeObjectName -> pcb_chg_obj_name
+QueryInputAndChangeObjectName -> pcb_chg_obj_name_query
+ChangeObjectPinnum -> pcb_chg_obj_pinnum
+ChangeObjectRadius -> pcb_chg_obj_radius
+ChangeObjectAngle -> pcb_chg_obj_angle
+ChangeSelectedAngle -> pcb_chg_selected_angle
+ChangeSelectedRadius -> pcb_chg_selected_radius
+QueryInputAndpcb_chg_obj_name -> pcb_chg_obj_name_query
+ChangePCBSize -> pcb_board_resize
+ClipLine -> pcb_line_clip
+GetWorkingDirectory -> pcb_get_wd
+tempfile_name_new -> pcb_tempfile_name_new
+tempfile_unlink -> pcb_tempfile_unlink
+lrealpath -> pcb_lrealpath
+get_user_name -> pcb_get_user_name
+CopyPastebufferToLayout -> pcb_buffer_copy_to_layout
+CopyObject -> pcb_copy_obj
+GridFit -> pcb_grid_fit
+notify_crosshair_change -> pcb_notify_crosshair_change
+notify_mark_change -> pcb_notify_mark_change
+HideCrosshair -> pcb_crosshair_hide
+RestoreCrosshair -> pcb_crosshair_restore
+DrawAttached -> pcb_draw_attached
+DrawMark -> pcb_draw_mark
+MoveCrosshairRelative -> pcb_crosshair_move_relative
+MoveCrosshairAbsolute -> pcb_crosshair_move_absolute
+SetCrosshairRange -> pcb_crosshair_set_range
+InitCrosshair -> pcb_crosshair_init
+DestroyCrosshair -> pcb_crosshair_uninit
+FitCrosshairIntoGrid -> pcb_crosshair_grid_fit
+CenterDisplay -> pcb_center_display
+FreeDataMemory -> pcb_data_free
+IsDataEmpty -> pcb_data_is_empty
+GetDataBoundingBox -> pcb_data_bbox
+Draw -> pcb_draw
+Redraw -> pcb_redraw
+DrawObject -> pcb_draw_obj
+DrawLayer -> pcb_draw_layer
+EraseObject -> pcb_erase_obj
+LightenColor -> pcb_lighten_color
+Message -> pcb_message
+OpenErrorpcb_messag -> pcb_open_error_message
+PopenErrorpcb_message -> pcb_popen_error_message
+OpendirErrorpcb_message -> pcb_opendir_error_message
+ChdirErrorpcb_message -> ocb_chdir_error_message
+OpenErrorpcb_message -> pcb_open_error_message
+CatchSignal -> pcb_catch_signal
+events_init -> pcb_events_init
+events_uninit -> pcb_events_uninit
+event_bind -> pcb_event_bind
+event_unbind -> pcb_event_unbind
+event_unbind_cookie -> pcb_event_unbind_cookie
+event_unbind_allcookie -> pcb_event_unbind_allcookie
+event -> pcb_event
+LineLineIntersect -> pcb_intersect_line_line
+LineArcIntersect -> pcb_intersect_line_arc
+PinLineIntersect -> pcb_intersect_line_pin
+LinePadIntersect -> pcb_intersect_line_pad
+ArcPadIntersect -> pcb_intersect_arc_pad
+IsPolygonInPolygon -> pcb_is_poly_in_poly
+LookupElementConnections -> pcb_lookup_element_conns
+LookupConnectionsToAllElements -> pcb_lookup_conns_to_all_elements
+LookupConnection -> pcb_lookup_conn
+LookupConnectionByPin -> pcb_lookup_conn_by_pin
+LookupUnusedPins -> pcb_lookup_unused_pins
+ResetFoundLinesAndPolygons -> pcb_reset_found_lines_polys
+ResetFoundPinsViasAndPads -> pcb_reset_found_pins_vias_pads
+ResetConnections -> pcb_reset_conns
+InitConnectionLookup -> pcb_conn_lookup_init
+InitComponentLookup -> pcb_component_lookup_init
+InitLayoutLookup -> pcb_layout_lookup_init
+FreeConnectionLookupMemory -> pcb_conn_lookup_uninit
+FreeComponentLookupMemory -> pcb_component_lookup_uninit
+FreeLayoutLookupMemory -> pcb_layout_lookup_uninit
+RatFindHook -> pcb_rat_find_hook
+SaveFindFlag -> pcb_save_find_flag
+RestoreFindFlag -> pcb_restore_find_flag
+DRCAll -> pcb_drc_all
+IsLineInPolygon -> pcb_is_line_in_poly
+IsArcInPolygon -> pcb_is_arc_in_poly
+IsPadInPolygon -> pcb_is_pad_in_poly
+ClearFlagOnPinsViasAndPads -> pcb_clear_flag_on_pins_vias_pads
+ClearFlagOnLinesAndPolygons -> pcb_clear_flag_on_lines_polys
+ClearFlagOnAllObjects -> pcb_clear_flag_on_all_objs
+MakeFlags -> pcb_flag_make
+OldFlags -> pcb_flag_old
+AddFlags -> pcb_flag_add
+MaskFlags -> pcb_flag_mask
+EraseFlags -> pcb_flag_erase
+NoFlags -> pcb_no_flags
+mem_any_set -> pcb_mem_any_set
+SET_FLAG -> PCB_FLAG_SET
+CLEAR_FLAG -> PCB_FLAG_CLEAR
+TEST_FLAG -> PCB_FLAG_TEST
+TOGGLE_FLAG -> PCB_FLAG_TOGGLE
+ASSIGN_FLAG -> PCB_FLAG_ASSIGN
+TEST_FLAGS -> PCB_FLAGS_TEST
+CHANGE_FLAG -> PCB_FLAG_CHANGE
+FLAGS_EQUAL -> PCB_FLAG_EQ
+THERMFLAG -> PCB_FLAG_THERM
+TEST_THERM -> PCB_FLAG_THERM_TEST
+GET_THERM -> PCB_FLAG_THERM_GET
+CLEAR_THERM -> PCB_FLAG_THERM_CLEAR
+ASSIGN_THERM -> PCB_FLAG_THERM_ASSIGN
+GET_SQUARE -> PCB_FLAG_SQUARE_GET
+CLEAR_SQUARE -> PCB_FLAG_SQUARE_CLEAR
+ASSIGN_SQUARE -> PCB_FLAG_SQUARE_ASSIGN
+GET_INTCONN -> PCB_FLAG_INTCONN_GET
+TEST_ANY_THERMS -> PCB_FLAG_THERM_TEST_ANY
+common_string_to_flags -> pcb_strflg_common_s2f
+common_flags_to_string -> pcb_strflg_common_f2s
+uninit_strflags_buf -> pcb_strflg_uninit_buf
+uninit_strflags_layerlist -> pcb_strflg_uninit_layerlist
+pcbflags_to_string -> pcb_strflg_board_f2s
+string_to_pcbflags -> pcb_strflg_board_s2f
+string_to_flags -> pcb_strflg_s2f
+flags_to_string -> pcb_strflg_f2s
+CreateDefaultFont -> pcb_font_create_default
+SetFontInfo -> pcb_font_set_info
+CreateNewLineInSymbol -> pcb_font_new_line_in_sym
+leaky_init -> pcb_leaky_init
+leaky_uninit -> pcb_leaky_uninit
+leaky_malloc -> pcb_leaky_malloc
+leaky_calloc -> pcb_leaky_calloc
+leaky_realloc -> pcb_leaky_realloc
+leaky_strdup -> pcb_leaky_strdup
+funchash_get -> pcb_funchash_get
+funchash_set -> pcb_funchash_set
+funchash_set_table -> pcb_funchash_set_table
+funchash_remove_cookie -> pcb_funchash_remove_cookie
+funchash_init -> pcb_funchash_init
+funchash_uninit -> pcb_funchash_uninit
+heap_create -> pcb_heap_create
+heap_destroy -> pcb_heap_destroy
+heap_free -> pcb_heap_free
+heap_insert -> pcb_heap_insert
+heap_remove_smallest -> pcb_heap_remove_smallest
+heap_replace -> pcb_heap_replace
+heap_is_empty -> pcb_heap_is_empty
+heap_size -> pcb_heap_size
+hid_register_action -> pcb_hid_register_action
+hid_register_actions -> pcb_hid_register_actions
+REGISTER_ACTIONS -> PCB_REGISTER_ACTIONS
+HIDCONCAT -> PCB_HIDCONCAT
+hid_expose_callback -> pcb_hid_expose_callback
+hid_actions_init -> pcb_hid_actions_init
+hid_actions_uninit -> pcb_hid_actions_uninit
+REGISTER_ATTRIBUTES -> PCB_REGISTER_ATTRIBUTES
+print_actions -> pcb_print_actions
+dump_actions -> pcb_dump_actions
+hid_find_action -> pcb_hid_find_action
+hid_remove_actions -> pcb_hid_remove_actions
+hid_remove_action -> pcb_hid_remove_action
+hid_remove_actions_by_cookie -> pcb_hid_remove_actions_by_cookie
+hid_action -> pcb_hid_action
+hid_actionl -> pcb_hid_actionl
+hid_actionv -> pcb_hid_actionv
+hid_actionv_ -> pcb_hid_actionv_
+hid_parse_command -> pcb_hid_parse_command
+hid_parse_actions -> pcb_hid_parse_actions
+hid_register_attributes -> pcb_hid_register_attributes
+hid_remove_attributes_by_cookie -> pcb_hid_remove_attributes_by_cookie
+hid_attributes_uninit -> pcb_hid_attributes_uninit
+hid_usage -> pcb_hid_usage
+hid_usage_option -> pcb_hid_usage_option
+hid_cfg_create_menu -> pcb_hid_cfg_create_menu
+hid_cfg_remove_menu -> pcb_hid_cfg_remove_menu
+hid_cfg_load -> pcb_hid_cfg_load
+hid_cfg_load_lht -> pcb_hid_cfg_load_lht
+hid_cfg_load_str -> pcb_hid_cfg_load_str
+hid_cfg_get_menu -> pcb_hid_cfg_get_menu
+hid_cfg_get_menu_at -> pcb_hid_cfg_get_menu_at
+hid_cfg_menu_field_path -> pcb_hid_cfg_menu_field_path
+hid_cfg_menu_field_str -> pcb_hid_cfg_menu_field_str
+hid_cfg_menu_field -> pcb_hid_cfg_menu_field
+hid_cfg_has_submenus -> pcb_hid_cfg_has_submenus
+hid_cfg_create_hash_node -> pcb_hid_cfg_create_hash_node
+hid_cfg_extend_hash_nodev -> pcb_hid_cfg_extend_hash_nodev
+hid_cfg_extend_hash_node -> pcb_hid_cfg_extend_hash_node
+hid_cfg_dfs -> pcb_hid_cfg_dfs
+hid_cfg_error -> pcb_hid_cfg_error
+hid_cfg_action -> pcb_hid_cfg_action
+hid_cfg_keys_init -> pcb_hid_cfg_keys_init
+hid_cfg_keys_uninit -> pcb_hid_cfg_keys_uninit
+hid_cfg_keys_add_under -> pcb_hid_cfg_keys_add_under
+hid_cfg_keys_add_by_desc -> pcb_hid_cfg_keys_add_by_desc
+hid_cfg_keys_add_by_strdesc -> pcb_hid_cfg_keys_add_by_strdesc
+hid_cfg_keys_gen_accel -> pcb_hid_cfg_keys_gen_accel
+hid_cfg_keys_input -> pcb_hid_cfg_keys_input
+hid_cfg_keys_action -> pcb_hid_cfg_keys_action
+hid_cache_color -> pcb_hid_cache_color
+common_fill_pcb_polygon -> pcb_dhlp_fill_pcb_polygon
+common_thindraw_pcb_polygon -> pcb_dhlp_thindraw_pcb_polygon
+common_fill_pcb_pad -> pcb_dhlp_fill_pcb_pad
+common_thindraw_pcb_pad -> pcb_dhlp_thindraw_pcb_pad
+common_fill_pcb_pv -> pcb_dhlp_fill_pcb_pv
+common_thindraw_pcb_pv -> pcb_dhlp_thindraw_pcb_pv
+common_draw_helpers_init -> pcb_dhlp_draw_helpers_init
+hid_get_extents -> pcb_hid_get_extents
+hid_save_and_show_layer_ons -> pcb_hid_save_and_show_layer_ons
+hid_restore_layer_ons -> pcb_hid_restore_layer_ons
+hid_get_flag -> pcb_hid_get_flag
+derive_default_filename -> pcb_derive_default_filename
+layer_type_to_file_name -> pcb_layer_type_to_file_name
+hid_init -> pcb_hid_init
+hid_uninit -> pcb_hid_uninit
+hid_find_gui -> pcb_hid_find_gui
+hid_find_printer -> pcb_hid_find_printer
+hid_find_exporter -> pcb_hid_find_exporter
+hid_enumerate -> pcb_hid_enumerate
+hid_parse_command_line -> pcb_hid_parse_command_line
+hid_register_hid -> pcb_hid_register_hid
+hid_remove_hid -> pcb_hid_remove_hid
+common_nogui_init -> pcb_hid_nogui_init
+hid_nogui_get_hid -> pcb_hid_nogui_get_hid
+InsertPointIntoObject -> pcb_insert_point_in_object
+AdjustInsertPoint -> pcb_adjust_insert_point
+ComputeIntersectionArea -> pcb_intersect_box_box
+ComputeUnionArea -> pcb_union_box_box
+GetLibraryMenuMemory -> pcb_lib_menu_new
+GetLibraryEntryMemory -> pcb_lib_entry_new
+FreeLibraryMemory -> pcb_lib_free
+DeleteLibraryMenuMemory -> pcb_lib_menu_free
+CreateNewNet -> pcb_lib_net_new
+CreateNewConnection -> pcb_lib_conn_new
+ENTRIES -> PCB_ENTRIES
+UNKNOWN -> PCB_UNKNOWN
+NSTRCMP -> PCB_NSTRCMP
+EMPTY -> PCB_EMPTY
+EMPTY_STRING_P -> PCB_EMPTY_STRING_P
+XOR -> PCB_XOR
+SQUARE -> PCB_SQUARE
+OBJECT_ID -> PCB_OBJECT_ID
+FRONT -> PCB_FRONT
+ON_SIDE -> PCB_ON_SIDE
+TO_RADIANS -> PCB_TO_RADIANS
+MAKEMIN -> PCB_MAKE_MIN
+MAKEMAX -> PCB_MAKE_MAX
+SGNZ -> PCB_SGNZ
+SWAP_SIGN_X -> PCB_SWAP_SIGN_X
+SWAP_SIGN_Y -> PCB_SWAP_SIGN_Y
+Distance2 -> pcb_distance2
+Distance -> pcb_distance
+GetValue -> pcb_get_value
+GetValueEx -> pcb_get_value_ex
+GetNum -> pcb_get_num
+Concat -> pcb_concat
+StripWhiteSpaceAndDup -> pcb_strdup_strip_wspace
+MoveLayer -> pcb_layer_move
+MOVE -> PCB_MOVE
+MoveObject -> pcb_move_obj
+MoveObjectToLayer -> pcb_move_obj_to_layer
+MoveObjectAndRubberband -> pcb_move_obj_and_rubberband
+MoveSelectedObjectsToLayer -> pcb_move_selected_objs_to_layer
+GetNetMemory -> pcb_net_new
+GetNetListMemory -> pcb_netlist_new
+FreeNetListListMemory -> pcb_netlist_list_free
+FreeNetListMemory -> pcb_netlist_free
+FreeNetMemory -> pcb_net_free
+NETLIST_LOOP -> PCB_NETLIST_LOOP
+NET_LOOP -> PCB_NET_LOOP
+GetArcMemory -> pcb_arc_new
+GetElementArcMemory -> pcb_element_arc_new
+RemoveFreeArc -> pcb_arc_free
+GetElementMemory -> pcb_element_new
+RemoveFreeElement -> pcb_element_free
+FreeElementMemory -> pcb_element_free_fields
+GetElementLineMemory -> pcb_element_line_new
+GetLineMemory -> pcb_line_new
+RemoveFreeLine -> pcb_line_free
+CreateNewLineOnLayer -> pcb_line_new_on_layer
+CreateDrawnLineOnLayer -> pcb_line_new_on_layer_merge
+GetPadMemory -> pcb_pad_new
+RemoveFreePad -> pcb_pad_free
+CreateNewPad -> pcb_pad_new_in_element
+SetPadBoundingBox -> pcb_pad_bbox
+GetViaMemory -> pcb_via_new
+RemoveFreeVia -> pcb_via_free
+GetPinMemory -> pcb_pin_new
+RemoveFreePin -> pcb_pin_free
+CreateNewVia -> pcb_via_new_on_board
+CreateNewPin -> pcb_pin_new_in_element
+SetPinBoundingBox -> pcb_pin_bbox
+GetPolygonMemory -> pcb_poly_alloc
+RemoveFreePolygon -> pcb_poly_free
+GetPointMemoryInPolygon -> pcb_poly_point_alloc
+GetHoleIndexMemoryInPolygon -> pcb_poly_holeidx_new
+FreePolygonMemory -> pcb_poly_free_fields
+SetPolygonBoundingBox -> pcb_poly_bbox
+CreateNewPolygonFromRectangle -> pcb_poly_new_from_rectangle
+CreateNewPolygon -> pcb_poly_new
+CreateNewPointInPolygon -> pcb_poly_point_new
+CreateNewHoleInPolygon -> pcb_poly_hole_new
+RemovePolygon -> pcb_poly_remove
+GetRatMemory -> pcb_rat_alloc
+RemoveFreeRat -> pcb_rat_free
+CreateNewRat -> pcb_rat_new
+DeleteRats -> pcb_rats_delete
+GetTextMemory -> pcb_text_alloc
+RemoveFreeText -> pcb_text_free
+CreateNewText -> pcb_text_new
+pcb_arc_new -> pcb_arc_alloc
+CreateNewArcOnLayer -> pcb_arc_new
+RemoveArc -> pcb_arc_destroy
+pcb_element_arc_new -> pcb_element_arc_alloc
+pcb_element_new -> pcb_element_alloc
+pcb_element_free_fields -> pcb_element_destroy
+pcb_line_new -> pcb_line_alloc
+pcb_line_new_on_layer_merge -> pcb_line_new_merge
+pcb_line_new_on_layer -> pcb_line_new
+RemoveLine -> pcb_line_destroy
+pcb_pad_new -> pcb_pad_alloc
+pcb_pad_new_in_element -> pcb_element_pad_new
+pcb_via_new -> pcb_via_alloc
+pcb_pin_new -> pcb_pin_alloc
+pcb_via_new_on_board -> pcb_via_new
+pcb_pin_new_in_element -> pcb_element_pin_new
+pcb_rats_delete -> pcb_rats_destroy
+RemoveText -> pcb_text_destroy
+SetArcBoundingBox -> pcb_arc_bbox
+SetElementBoundingBox -> pcb_element_bbox
+SetLineBoundingBox -> pcb_line_bbox
+SetTextBoundingBox -> pcb_text_bbox
+RotateArcLowLevel -> pcb_arc_rotate90
+RotateElementLowLevel -> pcb_element_rotate90
+RotateLineLowLevel -> pcb_line_rotate90
+RotatePolygonLowLevel -> pcb_poly_rotate90
+RotateTextLowLevel -> pcb_text_rotate90
+Freepcb_element_rotate90 -> pcb_element_rotate
+Freepcb_element_rotate90 -> pcb_element_rotate
+Freepcb_buffer_rotate -> pcb_buffer_free_rotate
+GetArcEnds -> pcb_arc_get_ends
+ChangeArcAngles -> pcb_arc_set_angles
+ChangeArcRadii -> pcb_arc_set_radii
+ChangeElementSide -> pcb_element_change_side
+ChangeSelectedElementSide -> pcb_selected_element_change_side
+ElementOrientation -> pcb_element_get_orientation
+ChangePaste -> pcb_pad_change_paste
+ChangeHole -> pcb_pin_change_hole
+CreateNewElement -> pcb_element_new
+CreateNewArcInElement -> pcb_element_arc_new
+CreateNewLineInElement -> pcb_element_line_new
+RemoveElement -> pcb_element_remove
+MoveElementLowLevel -> pcb_element_move
+MirrorElementCoordinates -> pcb_element_mirror
+MovePolygonLowLevel -> pcb_poly_move
+CopyPolygonLowLevel -> pcb_poly_copy
+MOVE_TEXT_LOWLEVEL -> pcb_text_move
+TEXT_IS_VISIBLE -> pcb_text_is_visible
+MOVE_ARC_LOWLEVEL -> pcb_arc_move
+MOVE_LINE_LOWLEVEL -> pcb_line_move
+MOVE_PAD_LOWLEVEL -> pcb_pad_move
+MOVE_PIN_LOWLEVEL -> pcb_pin_move
+MOVE_VIA_LOWLEVEL -> pcb_via_move
+ALLARC_LOOP -> PCB_ARC_ALL_LOOP
+COPPERARC_LOOP -> PCB_ARC_COPPER_LOOP
+SILKARC_LOOP -> PCB_ARC_SILK_LOOP
+VISIBLEARC_LOOP -> PCB_ARC_VISIBLE_LOOP
+ARC_LOOP -> PCB_ARC_LOOP
+ELEMENTTEXT_LOOP -> PCB_ELEMENT_TEXT_LOOP
+ELEMENTNAME_LOOP -> PCB_ELEMENT_NAME_LOOP
+ELEMENTLINE_LOOP -> PCB_ELEMENT_LINE_LOOP
+ELEMENTPCB_ARC_LOOP -> PCB_ELEMENT_ARC_LOOP
+ELEMENT_LOOP -> PCB_ELEMENT_LOOP
+ALLLINE_LOOP -> PCB_LINE_ALL_LOOP
+COPPERLINE_LOOP -> PCB_LINE_COPPER_LOOP
+SILKLINE_LOOP -> PCB_LINE_SILK_LOOP
+VISIBLELINE_LOOP -> PCB_LINE_VISIBLE_LOOP
+LINE_LOOP -> PCB_LINE_LOOP
+ALLPAD_LOOP -> PCB_PAD_ALL_LOOP
+PAD_LOOP -> PCB_PAD_LOOP
+ALLPIN_LOOP -> PCB_PIN_ALL_LOOP
+VIA_LOOP -> PCB_VIA_LOOP
+PIN_LOOP -> PCB_PIN_LOOP
+POLYGONPOINT_LOOP -> PCB_POLY_POINT_LOOP
+ALLPOLYGON_LOOP -> PCB_POLY_ALL_LOOP
+COPPERPOLYGON_LOOP -> PCB_POLY_COPPER_LOOP
+SILKPOLYGON_LOOP -> PCB_POLY_SILK_LOOP
+VISIBLEPOLYGON_LOOP -> PCB_POLY_VISIBLE_LOOP
+POLYGON_LOOP -> PCB_POLY_LOOP
+ALLTEXT_LOOP -> PCB_TEXT_ALL_LOOP
+VISIBLETEXT_LOOP -> PCB_TEXT_VISIBLE_LOOP
+TEXT_LOOP -> PCB_TEXT_LOOP
+LoadElementToBuffer -> pcb_element_load_to_buffer
+LoadFootprintByName -> pcb_element_load_footprint_by_name
+SmashBufferElement -> pcb_element_smash_buffer
+ConvertBufferToElement -> pcb_element_convert_from_buffer
+CopyElementLowLevel -> pcb_element_copy
+UniqueElementName -> pcb_element_uniq_name
+AddTextToElement -> pcb_element_text_set
+ChangeElementText -> pcb_element_text_change
+resolve_path -> pcb_path_resolve
+resolve_path_inplace -> pcb_path_resolve_inplace
+resolve_paths -> pcb_paths_resolve
+resolve_all_paths -> pcb_paths_resolve_all
+fp_fopen -> pcb_fp_fopen
+fp_fclose -> pcb_fp_fclose
+fp_dupname -> pcb_fp_dupname
+fp_tagname -> pcb_fp_tagname
+fp_uninit -> pcb_fp_uninit
+fp_tag -> pcb_fp_tag
+fp_init -> pcb_fp_init
+get_library_memory -> pcb_get_library_memory
+fp_free_children -> pcb_fp_free_children
+fp_sort_children -> pcb_fp_sort_children
+fp_rmdir -> pcb_fp_rmdir
+fp_mkdir_p -> pcb_fp_mkdir_p
+fp_mkdir_len -> pcb_fp_mkdir_len
+fp_lib_search -> pcb_fp_lib_search
+fp_append_entry -> pcb_fp_append_entry
+fp_read_lib_all -> pcb_fp_read_lib_all
+fp_default_search_path -> pcb_fp_default_search_path
+fp_host_uninit -> pcb_fp_host_uninit
+fp_rehash -> pcb_fp_rehash
+ImportNetlist -> pcb_import_netlist
+ParsePCB -> pcb_parse_pcb
+ParseElement -> pcb_parse_element
+ParseFont -> pcb_parse_font
+WriteBuffer -> pcb_write_buffer
+WriteElementData -> pcb_write_element_data
+CheckAndOpenFile -> pcb_check_and_open_file
+OpenConnectionDataFile -> pcb_open_connection_file
+SavePCB -> pcb_save_pcb
+LoadPCB -> pcb_load_pcb
+EnableAutosave -> pcb_enable_autosave
+Backup -> pcb_backup
+SaveInTMP -> pcb_save_in_tmp
+EmergencySave -> pcb_emergency_save
+DisableEmergencySave -> pcb_disable_emergency_save
+RevertPCB -> pcb_revert_pcb
+SaveBufferElements -> pcb_save_buffer_elements
+PrintQuotedString -> pcb_print_quoted_string
+sort_library -> pcb_library_sort
+set_some_route_style -> pcb_set_some_route_style
+WritePCBFile -> pcb_write_pcb_file
+WritePipe -> pcb_write_pipe
+SaveTMPData -> pcb_tmp_data_save
+RemoveTMPData -> pcb_tmp_data_remove
+plugins_init -> pcb_plugins_init
+plugins_uninit -> pcb_plugins_uninit
+plugin_register -> pcb_plugin_register
+HOOK_CALL_DO -> PCB_HOOK_CALL_DO
+HOOK_CALL_ALL -> PCB_HOOK_CALL_ALL
+HOOK_UNREGISTER -> PCB_HOOK_UNREGISTER
+HOOK_CALL -> PCB_HOOK_CALL
+HOOK_REGISTER -> PCB_HOOK_REGISTER
+poly_NewContour -> pcb_poly_contour_new
+poly_IniContour -> pcb_poly_contour_init
+poly_ClrContour -> pcb_poly_contour_clear
+poly_DelContour -> pcb_poly_contour_del
+poly_CopyContour -> pcb_poly_contour_copy
+poly_PreContour -> pcb_poly_contour_pre
+poly_InvContour -> pcb_poly_contour_inv
+poly_CreateNode -> pcb_poly_node_create
+poly_InclVertex -> pcb_poly_vertex_include
+poly_ExclVertex -> pcb_poly_vertex_exclude
+poly_M_Copy0 -> pcb_poly_m_copy0
+poly_M_Incl -> pcb_poly_m_include
+poly_Copy0 -> pcb_poly_copy0
+poly_Copy1 -> pcb_poly_copy1
+poly_InclContour -> pcb_poly_contour_include
+poly_ExclContour -> pcb_poly_contour_exclide
+poly_ChkContour -> pcb_poly_contour_check
+poly_CheckInside -> pcb_poly_contour_inside
+Touching -> pcb_poly_touching
+pcb_poly_m_copy0 -> pcb_polyarea_m_copy0
+pcb_poly_m_include -> pcb_polyarea_m_include
+pcb_poly_copy0 -> pcb_polyarea_copy0
+pcb_poly_copy1 -> pcb_polyarea_copy1
+pcb_poly_contour_include -> pcb_polyarea_contour_include
+pcb_poly_contour_exclide -> pcb_polyarea_contour_exclide
+pcb_poly_contour_check -> pcb_polyarea_contour_check
+pcb_poly_contour_inside -> pcb_polyarea_contour_inside
+pcb_poly_touching -> pcb_polyarea_touching
+poly_InsideContour -> pcb_poly_contour_inside
+poly_ContourInContour -> pcb_poly_contour_in_contour
+poly_Create -> pcb_polyarea_create
+poly_Free -> pcb_polyarea_free
+poly_Init -> pcb_polyarea_init
+poly_FreeContours -> pcb_poly_contours_free
+poly_Valid -> pcb_poly_valid
+vect_dist2 -> pcb_vect_dist2
+vect_det2 -> pcb_vect_det2
+vect_len2 -> pcb_vect_len2
+vect_inters2 -> pcb_vect_inters2
+poly_Boolean -> pcb_polyarea_boolean
+poly_Boolean_free -> pcb_polyarea_boolean_free
+poly_AndSubtract_free -> pcb_polyarea_and_subtract_free
+poly_bbox -> pcb_polyarea_bbox
+Savepcb_polyarea_t -> pcb_polyarea_save
+polygon_init -> pcb_polygon_init
+polygon_point_idx -> pcb_poly_point_idx
+polygon_point_contour -> pcb_poly_contour_point
+prev_contour_point -> pcb_poly_contour_prev_point
+next_contour_point -> pcb_poly_contour_next_point
+GetLowestDistancePolygonPoint -> pcb_poly_get_lowest_distance_point
+RemoveExcessPolygonPoints -> pcb_poly_remove_excess_points
+GoToPreviousPoint -> pcb_polygon_go_to_prev_point
+ClosePolygon -> pcb_polygon_close_poly
+CopyAttachedPolygonToLayer -> pcb_polygon_copy_attached_to_layer
+PolygonHoles -> pcb_poly_holes
+PlowsPolygon -> pcb_poly_plows
+ComputeNoHoles -> pcb_poly_compute_no_holes
+ContourToPoly -> pcb_poly_from_contour
+PolygonToPoly -> pcb_poly_from_poly
+RectPoly -> pcb_poly_from_rect
+CirclePoly -> pcb_poly_from_circle
+OctagonPoly -> pcb_poly_from_octagon
+LinePoly -> pcb_poly_from_line
+ArcPoly -> pcb_poly_from_arc
+PinPoly -> pcb_poly_from_pin
+BoxPolyBloated -> pcb_poly_from_box_bloated
+ContourToPoly -> pcb_poly_from_contour
+PolygonToPoly -> pcb_poly_from_poly
+RectPoly -> pcb_poly_from_rect
+CirclePoly -> pcb_poly_from_circle
+OctagonPoly -> pcb_poly_from_octagon
+LinePoly -> pcb_poly_from_line
+ArcPoly -> pcb_poly_from_arc
+PinPoly -> pcb_poly_from_pin
+BoxPolyBloated -> pcb_poly_from_box_bloated
+frac_circle -> pcb_poly_frac_cicle
+InitClip -> pcb_poly_init_clip
+RestoreToPolygon -> pcb_poly_restore_to_poly
+ClearFromPolygon -> pcb_poly_clear_from_poly
+IsPointInPolygon -> pcb_poly_is_point_in_p
+IsPointInPolygonIgnoreHoles -> pcb_poly_is_point_in_p_ignore_holes
+IsRectangleInPolygon -> pcb_poly_is_rect_in_p
+isects -> pcb_poly_isects_poly
+MorphPolygon -> pcb_poly_morph
+NoHolesPolygonDicer -> pcb_poly_no_holes_dicer
+PolyToPolygonsOnLayer -> pcb_poly_to_polygons_on_layer
+square_pin_factors -> pcb_poly_square_pin_factors
+AddNet -> pcb_rat_add_net
+ConnectionName -> pcb_connection_name
+AddAllRats -> pcb_rat_add_all
+SeekPad -> pcb_rat_seek_pad
+ProcNetlist -> pcb_rat_proc_netlist
+CollectSubnets -> pcb_rat_collect_subnets
+GetConnectionMemory -> pcb_rat_connection_alloc
+CONNECTION_LOOP -> PCB_CONNECTION_LOOP
+RAT_LOOP -> PCB_RAT_LOOP
+rats_patch_append -> pcb_ratspatch_append
+rats_patch_destroy -> pcb_ratspatch_destroy
+rats_patch_append_optimize -> pcb_ratspatch_append_optimize
+rats_patch_make_edited -> pcb_ratspatch_make_edited
+rats_patch_apply -> pcb_ratspatch_apply
+rats_patch_fexport -> pcb_ratspatch_fexport
+RemovePCB -> pcb_board_remove
+RemoveSelected -> pcb_remove_selected
+RemoveObject -> pcb_remove_object
+DestroyObject -> pcb_destroy_object
+ROTATE -> PCB_ROTATE90
+PIN_ROTATE -> PCB_PIN_ROTATE_SHAPE
+ROTATE_VIA_LOWLEVEL -> PCB_VIA_ROTATE90
+ROTATE_PIN_LOWLEVEL -> PCB_PIN_ROTATE90
+ROTATE_PAD_LOWLEVEL -> PCB_PAD_ROTATE90
+RotateBoxLowLevel -> pcb_box_rotate90
+RotateObject -> pcb_obj_rotate90
+RotateScreenObject -> pcb_screen_obj_rotate90
+RotatePointLowLevel -> pcb_point_rotate90
+free_rotate -> pcb_rotate
+PCB_ROTATE90 -> PCB_COORD_ROTATE90
+ParseRoutingString1 -> pcb_route_string_parse1
+ParseRouteString -> pcb_route_string_parse
+make_route_string -> pcb_route_string_make
+r_create_tree -> pcb_r_create_tree
+r_destroy_tree -> pcb_r_destroy_tree
+r_delete_entry -> pcb_r_delete_entry
+r_insert_entry -> pcb_r_insert_entry
+r_search -> pcb_r_search
+r_region_is_empty -> pcb_r_region_is_empty
+__r_dump_tree -> pcb_r_dump_tree
+LookupRubberbandLines -> pcb_rubber_band_lookup_lines
+LookupRatLines -> pcb_rubber_band_lookup_rat_lines
+GetRubberbandMemory -> pcb_rubber_band_alloc
+CreateNewRubberbandEntry -> pcb_rubber_band_create
+IsPointOnLine -> pcb_is_point_on_line
+IsPointOnPin -> pcb_is_point_in_pin
+IsPointOnArc -> pcb_is_point_on_arc
+IsPointOnLineEnd -> pcb_is_point_on_line_end
+IsLineInRectangle -> pcb_is_line_in_rectangle
+IsLineInQuadrangle -> pcb_is_line_in_quadrangle
+IsArcInRectangle -> pcb_is_arc_in_rectangle
+IsPointInPad -> pcb_is_point_in_pad
+IsPointInBox -> pcb_is_point_in_box
+lines_intersect -> pcb_lines_intersect
+POINT_IN_BOX -> PCB_POINT_IN_BOX
+VIA_OR_PIN_IN_BOX -> PCB_VIA_OR_PIN_IN_BOX
+LINE_IN_BOX -> PCB_LINE_IN_BOX
+PAD_IN_BOX -> PCB_PAD_IN_BOX
+BOX_IN_BOX -> PCB_BOX_IN_BOX
+TEXT_IN_BOX -> PCB_TEXT_IN_BOX
+POLYGON_IN_BOX -> PCB_POLYGON_IN_BOX
+ELEMENT_IN_BOX -> PCB_ELEMENT_IN_BOX
+ARC_IN_BOX -> PCB_ARC_IN_BOX
+POINT_IN_CIRCLE -> PCB_POINT_IN_CIRCLE
+CIRCLE_TOUCHES_BOX -> PCB_CIRCLE_TOUCHES_BOX
+VIA_OR_PIN_TOUCHES_BOX -> PCB_VIA_OR_PIN_TOUCHES_BOX
+LINE_TOUCHES_BOX -> PCB_LINE_TOUCHES_BOX
+PAD_TOUCHES_BOX -> PCB_PAD_TOUCHES_BOX
+BOX_TOUCHES_BOX -> PCB_BOX_TOUCHES_BOX
+TEXT_TOUCHES_BOX -> PCB_TEXT_TOUCHES_BOX
+POLYGON_TOUCHES_BOX -> PCB_POLYGON_TOUCHES_BOX
+ELEMENT_TOUCHES_BOX -> PCB_ELEMENT_TOUCHES_BOX
+ARC_TOUCHES_BOX -> PCB_ARC_TOUCHES_BOX
+IS_BOX_NEGATIVE -> PCB_IS_BOX_NEGATIVE
+BOX_NEAR_BOX -> PCB_BOX_NEAR_BOX
+VIA_OR_PIN_NEAR_BOX -> PCB_VIA_OR_PIN_NEAR_BOX
+LINE_NEAR_BOX -> PCB_LINE_NEAR_BOX
+PAD_NEAR_BOX -> PCB_PAD_NEAR_BOX
+TEXT_NEAR_BOX -> PCB_TEXT_NEAR_BOX
+POLYGON_NEAR_BOX -> PCB_POLYGON_NEAR_BOX
+ELEMENT_NEAR_BOX -> PCB_ELEMENT_NEAR_BOX
+ARC_NEAR_BOX -> PCB_ARC_NEAR_BOX
+SearchObjectByLocation -> pcb_search_obj_by_location
+SearchScreen -> pcb_search_screen
+SearchScreenGridSlop -> pcb_search_grid_slop
+SearchObjectByID -> pcb_search_obj_by_id
+SearchElementByName -> pcb_search_elem_by_name
+SelectObject -> pcb_select_object
+SelectBlock -> pcb_select_block
+ListBlock -> pcb_list_block
+ObjectOperation -> pcb_object_operation
+SelectedOperation -> pcb_selected_operation
+SelectConnection -> pcb_select_connection
+SelectObjectByName -> pcb_select_object_by_name
+SetTextScale -> pcb_text_set_scale
+SetGrid -> pcb_board_set_grid
+SetLineSize -> pcb_line_set_size
+SetViaSize -> pcb_via_set_size
+SetViaDrillingHole -> pcb_via_set_drilling_hole
+SetClearanceWidth -> pcb_conf_set_clearance_width
+SetChangedFlag -> pcb_board_set_changed_flag
+SetBufferNumber -> pcb_buffer_set_number
+SetMode -> pcb_crosshair_set_mode
+SetCrosshairRangeToBuffer -> pcb_crosshair_range_to_buffer
+SetLocalRef -> pcb_crosshair_set_local_ref
+SaveMode -> pcb_crosshair_save_mode
+RestoreMode -> pcb_crosshair_restore_mode
+pcb_text_set_scale -> pcb_board_set_text_scale
+pcb_line_set_size -> pcb_board_set_line_width
+pcb_via_set_size -> pcb_board_set_via_size
+pcb_via_set_drilling_hole -> pcb_board_set_via_drilling_hole
+pcb_conf_set_clearance_width -> pcb_board_set_clearance
+stub_DrawFab_overhang -> pcb_stub_draw_fab_overhang
+stub_DrawFab -> pcb_stub_draw_fab
+stub_rat_found_short -> pcb_stub_rat_found_short
+stub_rat_proc_shorts -> pcb_stub_rat_proc_shorts
+Undo -> pcb_undo
+Redo -> pcb_redo
+IncrementUndoSerialNumber -> pcb_undo_inc_serial
+SaveUndoSerialNumber -> pcb_undo_save_serial
+RestoreUndoSerialNumber -> pcb_undo_restore_serial
+ClearUndoList -> pcb_undo_clear_list
+LockUndo -> pcb_undo_lock
+UnlockUndo -> pcb_undo_unlock
+Undoing -> pcb_undoing
+MoveObjectToRemoveUndoList -> pcb_undo_move_obj_to_remove
+AddObjectToRemovePointUndoList -> pcb_undo_add_obj_to_remove_point
+AddObjectToInsertPointUndoList -> pcb_undo_add_obj_to_insert_point
+AddObjectToRemoveContourUndoList -> pcb_undo_add_obj_to_remove_contour
+AddObjectToInsertContourUndoList -> pcb_undo_add_obj_to_insert_contour
+AddObjectToMoveUndoList -> pcb_undo_add_obj_to_move
+AddObjectToChangeNameUndoList -> pcb_undo_add_obj_to_change_name
+AddObjectToChangePinnumUndoList -> pcb_undo_add_obj_to_change_pinnum
+AddObjectToRotateUndoList -> pcb_undo_add_obj_to_rotate
+AddObjectToCreateUndoList -> pcb_undo_add_obj_to_create
+AddObjectToMirrorUndoList -> pcb_undo_add_obj_to_mirror
+AddObjectToMoveToLayerUndoList -> pcb_undo_add_obj_to_move_to_layer
+AddObjectToFlagUndoList -> pcb_undo_add_obj_to_flag
+AddObjectToSizeUndoList -> pcb_undo_add_obj_to_size
+AddObjectTo2ndSizeUndoList -> pcb_undo_add_obj_to_2nd_size
+AddObjectToClearSizeUndoList -> pcb_undo_add_obj_to_clear_size
+AddObjectToMaskSizeUndoList -> pcb_undo_add_obj_to_mask_size
+AddObjectToChangeAnglesUndoList -> pcb_undo_add_obj_to_change_angles
+AddObjectToChangeRadiiUndoList -> pcb_undo_add_obj_to_change_radii
+AddObjectToClearPolyUndoList -> pcb_undo_add_obj_to_clear_poly
+AddLayerChangeToUndoList -> pcb_undo_add_layer_change
+AddNetlistLibToUndoList -> pcb_undo_add_netlist_lib
+get_n_units -> pcb_get_n_units
+coord_to_unit -> pcb_coord_to_unit
+unit_to_factor -> pcb_unit_to_factor
+unit_to_coord -> pcb_unit_to_coord
+get_increments_struct -> pcb_get_increments_struct
+NormalizeAngle -> pcb_normalize_angle
+initialize_units -> pcb_units_init
+UNDO_CHANGENAME -> PCB_UNDO_CHANGENAME
+UNDO_MOVE -> PCB_UNDO_MOVE
+UNDO_REMOVE -> PCB_UNDO_REMOVE
+UNDO_REMOVE_POINT -> PCB_UNDO_REMOVE_POINT
+UNDO_INSERT_POINT -> PCB_UNDO_INSERT_POINT
+UNDO_REMOVE_CONTOUR -> PCB_UNDO_REMOVE_CONTOUR
+UNDO_INSERT_CONTOUR -> PCB_UNDO_INSERT_CONTOUR
+UNDO_ROTATE -> PCB_UNDO_ROTATE
+UNDO_CREATE -> PCB_UNDO_CREATE
+UNDO_MOVETOLAYER -> PCB_UNDO_MOVETOLAYER
+UNDO_FLAG -> PCB_UNDO_FLAG
+UNDO_CHANGESIZE -> PCB_UNDO_CHANGESIZE
+UNDO_CHANGE2NDSIZE -> PCB_UNDO_CHANGE2NDSIZE
+UNDO_MIRROR -> PCB_UNDO_MIRROR
+UNDO_CHANGECLEARSIZE -> PCB_UNDO_CHANGECLEARSIZE
+UNDO_CHANGEMASKSIZE -> PCB_UNDO_CHANGEMASKSIZE
+UNDO_CHANGEANGLES -> PCB_UNDO_CHANGEANGLES
+UNDO_LAYERCHANGE -> PCB_UNDO_LAYERCHANGE
+UNDO_CLEAR -> PCB_UNDO_CLEAR
+UNDO_NETLISTCHANGE -> PCB_UNDO_NETLISTCHANGE
+UNDO_CHANGEPINNUM -> PCB_UNDO_CHANGEPINNUM
+UNDO_CHANGERADII -> PCB_UNDO_CHANGERADII
+ROTATE_TYPES -> PCB_ROTATE_TYPES
+CHANGENAME_TYPES -> PCB_CHANGENAME_TYPES
+CHANGESIZE_TYPES -> PCB_CHANGESIZE_TYPES
+CHANGE2NDSIZE_TYPES -> PCB_CHANGE2NDSIZE_TYPES
+CHANGECLEARSIZE_TYPES -> PCB_CHANGECLEARSIZE_TYPES
+CHANGENONETLIST_TYPES -> PCB_CHANGENONETLIST_TYPES
+CHANGESQUARE_TYPES -> PCB_CHANGESQUARE_TYPES
+CHANGEOCTAGON_TYPES -> PCB_CHANGEOCTAGON_TYPES
+CHANGEJOIN_TYPES -> PCB_CHANGEJOIN_TYPES
+CHANGETHERMAL_TYPES -> PCB_CHANGETHERMAL_TYPES
+CHANGEMASKSIZE_TYPES -> PCB_CHANGEMASKSIZE_TYPES
+SELECT_TYPES -> PCB_SELECT_TYPES
+MOVE_TYPES -> PCB_MOVE_TYPES
+MOVETOLAYER_TYPES -> PCB_MOVETOLAYER_TYPES
+INSERT_TYPES -> PCB_INSERT_TYPES
+COPY_TYPES -> PCB_COPY_TYPES
+REMOVE_TYPES -> PCB_REMOVE_TYPES
+NETLIST_INPUT -> PCB_NETLIST_INPUT
+NETLIST_EDITED -> PCB_NETLIST_EDITED
+NUM_NETLISTS -> PCB_NUM_NETLISTS
+ATTRIBUTE_UNUSED -> PCB_ATTRIBUTE_UNUSED
+UNLIKELY -> PCB_UNLIKELY
+LIKELY -> PCB_LIKELY
+STATE_FIRST -> PCB_CH_STATE_FIRST
+STATE_SECOND -> PCB_CH_STATE_SECOND
+STATE_THIRD -> PCB_CH_STATE_THIRD
+Basic_Crosshair_Shape -> pcb_ch_shape_basic
+Union_Jack_Crosshair_Shape -> pcb_ch_shape_union_jack
+Dozen_Crosshair_Shape -> pcb_ch_shape_dozen
+Crosshair_Shapes_Number -> pcb_ch_shape_NUM
+Crosshair -> pcb_crosshair
+Marked -> pcb_marked
+max_group -> pcb_max_group
+max_copper_layer -> pcb_max_copper_layer
+solder_silk_layer -> pcb_solder_silk_layer
+component_silk_layer -> pcb_component_silk_layer
+Buffers -> pcb_buffers
+addedLines -> pcb_added_lines
+LayerStack -> pcb_layer_stack
+Bumped -> pcb_bumped
+STATUS_OK -> 0
+STATUS_ERROR -> -1
+EVENT_GUI_INIT -> PCB_EVENT_GUI_INIT
+EVENT_CLI_ENTER -> PCB_EVENT_CLI_ENTER
+EVENT_SAVE_PRE -> PCB_EVENT_SAVE_PRE
+EVENT_SAVE_POST -> PCB_EVENT_SAVE_POST
+EVENT_LOAD_PRE -> PCB_EVENT_LOAD_PRE
+EVENT_LOAD_POST -> PCB_EVENT_LOAD_POST
+EVENT_last -> PCB_EVENT_last
+ARG_INT -> PCB_EVARG_INT
+ARG_DOUBLE -> PCB_EVARG_DOUBLE
+ARG_STR -> PCB_EVARG_STR
+LOOKUP_FIRST -> PCB_LOOKUP_FIRST
+LOOKUP_MORE -> PCB_LOOKUP_MORE
+SILK_TYPE -> PCB_SILK_TYPE
+FCT_COPPER -> PCB_FCT_COPPER
+FCT_INTERNAL -> PCB_FCT_INTERNAL
+FCT_RAT -> PCB_FCT_RAT
+FCT_ELEMENT -> PCB_FCT_ELEMENT
+FCT_START -> PCB_FCT_START
+find_callback_t -> pcb_find_callback_t
+find_callback -> pcb_find_callback
+SHOWNUMBERFLAG -> PCB_SHOWNUMBERFLAG
+LOCALREFFLAG -> PCB_LOCALREFFLAG
+CHECKPLANESFLAG -> PCB_CHECKPLANESFLAG
+SHOWPCB_FLAG_DRC -> PCB_SHOWPCB_FLAG_DRC
+RUBBERBANDFLAG -> PCB_RUBBERBANDFLAG
+DESCRIPTIONFLAG -> PCB_DESCRIPTIONFLAG
+NAMEONPCBFLAG -> PCB_NAMEONPCBFLAG
+AUTOPCB_FLAG_DRC -> PCB_AUTOPCB_FLAG_DRC
+ALLDIRECTIONFLAG -> PCB_ALLDIRECTIONFLAG
+SWAPSTARTDIRFLAG -> PCB_SWAPSTARTDIRFLAG
+UNIQUENAMEFLAG -> PCB_UNIQUENAMEFLAG
+CLEARNEWFLAG -> PCB_CLEARNEWFLAG
+SNAPPCB_FLAG_PIN -> PCB_SNAPPCB_FLAG_PIN
+SHOWMASKFLAG -> PCB_SHOWMASKFLAG
+THINDRAWFLAG -> PCB_THINDRAWFLAG
+ORTHOMOVEFLAG -> PCB_ORTHOMOVEFLAG
+LIVEROUTEFLAG -> PCB_LIVEROUTEFLAG
+THINDRAWPOLYFLAG -> PCB_THINDRAWPOLYFLAG
+LOCKNAMESFLAG -> PCB_LOCKNAMESFLAG
+ONLYNAMESFLAG -> PCB_ONLYNAMESFLAG
+NEWPCB_FLAG_FULLPOLY -> PCB_NEWPCB_FLAG_FULLPOLY
+HIDENAMESFLAG -> PCB_HIDENAMESFLAG
+ENABLEPCB_FLAG_MINCUT -> PCB_ENABLEPCB_FLAG_MINCUT
+GROUNDPLANEFRAME -> PCB_GROUNDPLANEFRAME
+MASKFRAME -> PCB_MASKFRAME
+LARGE_VALUE -> PCB_LARGE_VALUE
+MAX_LAYER -> PCB_MAX_LAYER
+MIN_LINESIZE -> PCB_MIN_LINESIZE
+MAX_LINESIZE -> PCB_MAX_LINESIZE
+MIN_ARCSIZE -> PCB_MIN_ARCSIZE
+MAX_ARCSIZE -> PCB_MAX_ARCSIZE
+MIN_TEXTSCALE -> PCB_MIN_TEXTSCALE
+MAX_TEXTSCALE -> PCB_MAX_TEXTSCALE
+MIN_PINORVIASIZE -> PCB_MIN_PINORVIASIZE
+MIN_PINORVIAHOLE -> PCB_MIN_PINORVIAHOLE
+MAX_PINORVIASIZE -> PCB_MAX_PINORVIASIZE
+MIN_PINORVIACOPPER -> PCB_MIN_PINORVIACOPPER
+MIN_PADSIZE -> PCB_MIN_PADSIZE
+MAX_PADSIZE -> PCB_MAX_PADSIZE
+MIN_DRC_VALUE -> PCB_MIN_DRC_VALUE
+MAX_DRC_VALUE -> PCB_MAX_DRC_VALUE
+MIN_DRC_SILK -> PCB_MIN_DRC_SILK
+MAX_DRC_SILK -> PCB_MAX_DRC_SILK
+MIN_DRC_DRILL -> PCB_MIN_DRC_DRILL
+MAX_DRC_DRILL -> PCB_MAX_DRC_DRILL
+MIN_DRC_RING -> PCB_MIN_DRC_RING
+MAX_DRC_RING -> PCB_MAX_DRC_RING
+MIN_GRID -> PCB_MIN_GRID
+MAX_GRID -> PCB_MAX_GRID
+MAX_FONTPOSITION -> PCB_MAX_FONTPOSITION
+MAX_COORD -> PCB_MAX_COORD
+MIN_SIZE -> PCB_MIN_SIZE
+MAX_SIZE -> PCB_MAX_SIZE
+MAX_BUFFER -> PCB_MAX_BUFFER
+DEFAULT_DRILLINGHOLE -> PCB_DEFAULT_DRILLINGHOLE
+MAXPATHLEN -> PCB_PATH_MAX
+MAX_LINE_POINT_DISTANCE -> PCB_MAX_LINE_POINT_DISTANCE
+MAX_POLYGON_POINT_DISTANCE -> PCB_MAX_POLYGON_POINT_DISTANCE
+MAX_ELEMENTNAMES -> PCB_MAX_ELEMENTNAMES
+MAX_NETLIST_LINE_LENGTH -> PCB_MAX_NETLIST_LINE_LENGTH
+MAX_MODESTACK_DEPTH -> PCB_MAX_MODESTACK_DEPTH
+MIN_GRID_DISTANCE -> PCB_MIN_GRID_DISTANCE
+EMARK_SIZE -> PCB_EMARK_SIZE
+FONT_CAPHEIGHT -> PCB_FONT_CAPHEIGHT
+DEFAULT_CELLSIZE -> PCB_DEFAULT_CELLSIZE
+next_gui -> pcb_next_gui
+current_action -> pcb_current_action
+pixel_slop -> pcb_pixel_slop
+MF_ACCELERATOR -> PCB_MF_ACCELERATOR
+MF_MNEMONIC -> PCB_MF_MNEMONIC
+MF_SUBMENU -> PCB_MF_SUBMENU
+MF_CHECKED -> PCB_MF_CHECKED
+MF_UPDATE_ON -> PCB_MF_UPDATE_ON
+MF_SENSITIVE -> PCB_MF_SENSITIVE
+MF_TIP -> PCB_MF_TIP
+MF_ACTIVE -> PCB_MF_ACTIVE
+MF_ACTION -> PCB_MF_ACTION
+MF_FOREGROUND -> PCB_MF_FOREGROUND
+MF_BACKGROUND -> PCB_MF_BACKGROUND
+MF_FONT -> PCB_MF_FONT
+M_Shift -> PCB_M_Shift
+M_Ctrl -> PCB_M_Ctrl
+M_Alt -> PCB_M_Alt
+M_Mod1 -> PCB_M_Mod1
+M_Release -> PCB_M_Release
+MB_LEFT -> PCB_MB_LEFT
+MB_MIDDLE -> PCB_MB_MIDDLE
+MB_RIGHT -> PCB_MB_RIGHT
+MB_SCROLL_UP -> PCB_MB_SCROLL_UP
+MB_SCROLL_DOWN -> PCB_MB_SCROLL_DOWN
+MB_SCROLL_LEFT -> PCB_MB_SCROLL_LEFT
+MB_SCROLL_RIGHT -> PCB_MB_SCROLL_RIGHT
+MB_ANY -> PCB_MB_ANY
+M_ANY -> PCB_M_ANY
+hid_list -> pcb_hid_list
+hid_num_hids -> pcb_hid_num_hids
+MENU_LOOP -> PCB_MENU_LOOP
+ENTRY_LOOP -> PCB_ENTRY_LOOP
+SWAP_IDENT -> PCB_SWAP_IDENT
+END_LOOP -> PCB_END_LOOP
+ENDALL_LOOP -> PCB_ENDALL_LOOP
+pcb_create_be_lenient -> pcb_create_being_lenient
+CreateBeLenient -> pcb_create_be_lenient
+CreateIDBump -> pcb_create_ID_bump
+CreateIDReset -> pcb_create_ID_reset
+CreateIDGet -> pcb_create_ID_get
+DESCRIPTION_INDEX -> PCB_ELEMNAME_IDX_DESCRIPTION
+NAMEONPCB_INDEX -> PCB_ELEMNAME_IDX_REFDES
+VALUE_INDEX -> PCB_ELEMNAME_IDX_VALUE
+NAME_INDEX -> PCB_ELEMNAME_IDX_VISIBLE
+ELEMENT_NAME -> PCB_ELEM_NAME_VISIBLE
+DESCRIPTION_NAME -> PCB_ELEM_NAME_DESCRIPTION
+NAMEONPCB_NAME -> PCB_ELEM_NAME_REFDES
+VALUE_NAME -> PCB_ELEM_NAME_VALUE
+ELEMENT_TEXT -> PCB_ELEM_TEXT_VISIBLE
+DESCRIPTION_TEXT -> PCB_ELEM_TEXT_DESCRIPTION
+NAMEONPCB_TEXT -> PCB_ELEM_TEXT_REFDES
+VALUE_TEXT -> PCB_ELEM_TEXT_VALUE
+AdjustAttachedLine -> pcb_line_adjust_attached
+AdjustTwoLine -> pcb_line_adjust_attached_2lines
+FortyFiveLine -> pcb_line_45
+EnforceLineDRC -> pcb_line_enforce_drc
+library -> pcb_library
+gui -> pcb_gui
+exporter -> pcb_exporter
+plug_fp_chain -> pcb_plug_fp_chain
+plug_import_chain -> pcb_plug_import_chain
+plug_io_chain -> pcb_plug_io_chain
+PLF_DIR -> PCB_PLF_DIR
+PLF_INV -> PCB_PLF_INV
+PLF_MARK -> PCB_PLF_MARK
+VertexEqu -> pcb_vertex_equ
+VertexCpy -> pcb_vertex_cpy
+err_no_memory -> pcb_err_no_memory
+err_bad_parm -> pcb_err_bad_parm
+err_ok -> pcb_err_ok
+PBO_UNITE -> PCB_PBO_UNITE
+PBO_ISECT -> PCB_PBO_ISECT
+PBO_SUB -> PCB_PBO_SUB
+PBO_XOR -> PCB_PBO_XOR
+POLY_CIRC_SEGS -> PCB_POLY_CIRC_SEGS
+POLY_CIRC_SEGS_F -> PCB_POLY_CIRC_SEGS_F
+POLY_CIRC_RADIUS_ADJ -> PCB_POLY_CIRC_RADIUS_ADJ
+POLY_ARC_MAX_DEVIATION -> PCB_POLY_ARC_MAX_DEVIATION
+R_DIR_NOT_FOUND -> PCB_R_DIR_NOT_FOUND
+R_DIR_FOUND_CONTINUE -> PCB_R_DIR_FOUND_CONTINUE
+R_DIR_CANCEL -> PCB_R_DIR_CANCEL
+SLOP -> PCB_SLOP
+SM_REGEX -> PCB_SM_REGEX
+SM_LIST -> PCB_SM_LIST
+SWAP_ANGLE -> PCB_SWAP_ANGLE
+SWAP_DELTA -> PCB_SWAP_DELTA
+METRIC -> PCB_UNIT_METRIC
+IMPERIAL -> PCB_UNIT_IMPERIAL
+NO_SUFFIX -> PCB_UNIT_NO_SUFFIX
+SUFFIX -> PCB_UNIT_SUFFIX
+FILE_MODE -> PCB_UNIT_FILE_MODE
+NO_PRINT -> PCB_UNIT_NO_PRINT
+ALLOW_NM -> PCB_UNIT_ALLOW_NM
+ALLOW_UM -> PCB_UNIT_ALLOW_UM
+ALLOW_MM -> PCB_UNIT_ALLOW_MM
+ALLOW_CM -> PCB_UNIT_ALLOW_CM
+ALLOW_M -> PCB_UNIT_ALLOW_M
+ALLOW_KM -> PCB_UNIT_ALLOW_KM
+ALLOW_CMIL -> PCB_UNIT_ALLOW_CMIL
+ALLOW_MIL -> PCB_UNIT_ALLOW_MIL
+ALLOW_IN -> PCB_UNIT_ALLOW_IN
+ALLOW_DMIL -> PCB_UNIT_ALLOW_DMIL
+ALLOW_METRIC -> PCB_UNIT_ALLOW_METRIC
+ALLOW_IMPERIAL -> PCB_UNIT_ALLOW_IMPERIAL
+ALLOW_READABLE -> PCB_UNIT_ALLOW_READABLE
+ALLOW_NATURAL -> PCB_UNIT_ALLOW_NATURAL
+ALLOW_ALL -> PCB_UNIT_ALLOW_ALL
+ActionExecuteFile -> pcb_act_ExecuteFile
+executefile_help -> pcb_acth_ExecuteFile
+executefile_syntax -> pcb_acts_ExecuteFile
+ActionChangeAngle -> pcb_act_ChangeAngle
+changeangle_help -> pcb_acth_ChangeAngle
+changeangle_syntax -> pcb_acts_ChangeAngle
+ActionChangeClearSize -> pcb_act_ChangeClearSize
+changeclearsize_help -> pcb_acth_ChangeClearSize
+changeclearsize_syntax -> pcb_acts_ChangeClearSize
+ActionChange2ndSize -> pcb_act_Change2ndSize
+change2ndsize_help -> pcb_acth_Change2ndSize
+change2ndsize_syntax -> pcb_acts_Change2ndSize
+ActionChangeHole -> pcb_act_ChangeHole
+changehole_help -> pcb_acth_ChangeHole
+changehole_syntax -> pcb_acts_ChangeHole
+ActionChangeJoin -> pcb_act_ChangeJoin
+changejoin_help -> pcb_acth_ChangeJoin
+changejoin_syntax -> pcb_acts_ChangeJoin
+ActionChangeName -> pcb_act_ChangeName
+changename_help -> pcb_acth_ChangeName
+changename_syntax -> pcb_acts_ChangeName
+ActionChangePaste -> pcb_act_ChangePaste
+changepaste_help -> pcb_acth_ChangePaste
+changepaste_syntax -> pcb_acts_ChangePaste
+ActionChangePinName -> pcb_act_ChangePinName
+changepinname_help -> pcb_acth_ChangePinName
+changepinname_syntax -> pcb_acts_ChangePinName
+ActionChangeRadius -> pcb_act_ChangeRadius
+changeradius_help -> pcb_acth_ChangeRadius
+changeradius_syntax -> pcb_acts_ChangeRadius
+ActionChangeSize -> pcb_act_ChangeSize
+changesize_help -> pcb_acth_ChangeSize
+changesize_syntax -> pcb_acts_ChangeSize
+ActionChangeSizes -> pcb_act_ChangeSizes
+changesizes_help -> pcb_acth_ChangeSizes
+changesizes_syntax -> pcb_acts_ChangeSizes
+ActionChangeNonetlist -> pcb_act_ChangeNonetlist
+changenonetlist_help -> pcb_acth_ChangeNonetlist
+changenonetlist_syntax -> pcb_acts_ChangeNonetlist
+ActionChangeSquare -> pcb_act_ChangeSquare
+changesquare_help -> pcb_acth_ChangeSquare
+changesquare_syntax -> pcb_acts_ChangeSquare
+ActionChangeOctagon -> pcb_act_ChangeOctagon
+changeoctagon_help -> pcb_acth_ChangeOctagon
+changeoctagon_syntax -> pcb_acts_ChangeOctagon
+ActionChangeFlag -> pcb_act_ChangeFlag
+changeflag_help -> pcb_acth_ChangeFlag
+changeflag_syntax -> pcb_acts_ChangeFlag
+ActionClearSquare -> pcb_act_ClearSquare
+clearsquare_help -> pcb_acth_ClearSquare
+clearsquare_syntax -> pcb_acts_ClearSquare
+ActionClearOctagon -> pcb_act_ClearOctagon
+clearoctagon_help -> pcb_acth_ClearOctagon
+clearoctagon_syntax -> pcb_acts_ClearOctagon
+ActionSetSquare -> pcb_act_SetSquare
+setsquare_help -> pcb_acth_SetSquare
+setsquare_syntax -> pcb_acts_SetSquare
+ActionSetOctagon -> pcb_act_SetOctagon
+setoctagon_help -> pcb_acth_SetOctagon
+setoctagon_syntax -> pcb_acts_SetOctagon
+ActionSetThermal -> pcb_act_SetThermal
+setthermal_help -> pcb_acth_SetThermal
+setthermal_syntax -> pcb_acts_SetThermal
+ActionSetValue -> pcb_act_SetValue
+setvalue_help -> pcb_acth_SetValue
+setvalue_syntax -> pcb_acts_SetValue
+ActionSetFlag -> pcb_act_SetFlag
+setflag_help -> pcb_acth_SetFlag
+setflag_syntax -> pcb_acts_SetFlag
+ActionClrFlag -> pcb_act_ClrFlag
+clrflag_help -> pcb_acth_ClrFlag
+clrflag_syntax -> pcb_acts_ClrFlag
+ActionExecCommand -> pcb_act_ExecCommand
+execcommand_help -> pcb_acth_ExecCommand
+execcommand_syntax -> pcb_acts_ExecCommand
+ActionLoadFrom -> pcb_act_LoadFrom
+loadfrom_help -> pcb_acth_LoadFrom
+loadfrom_syntax -> pcb_acts_LoadFrom
+ActionNew -> pcb_act_New
+new_help -> pcb_acth_New
+new_syntax -> pcb_acts_New
+ActionSaveTo -> pcb_act_SaveTo
+saveto_help -> pcb_acth_SaveTo
+saveto_syntax -> pcb_acts_SaveTo
+ActionQuit -> pcb_act_Quit
+quit_help -> pcb_acth_Quit
+quit_syntax -> pcb_acts_Quit
+ActionDRCheck -> pcb_act_DRCheck
+drcheck_help -> pcb_acth_DRCheck
+drcheck_syntax -> pcb_acts_DRCheck
+ActionDisplay -> pcb_act_Display
+display_help -> pcb_acth_Display
+display_syntax -> pcb_acts_Display
+ActionCycleDrag -> pcb_act_CycleDrag
+cycledrag_help -> pcb_acth_CycleDrag
+cycledrag_syntax -> pcb_acts_CycleDrag
+FullScreen -> pcb_act_FullScreen
+fullscreen_help -> pcb_acth_FullScreen
+fullscreen_syntax -> pcb_acts_FullScreen
+ActionMarkCrosshair -> pcb_act_MarkCrosshair
+markcrosshair_help -> pcb_acth_MarkCrosshair
+markcrosshair_syntax -> pcb_acts_MarkCrosshair
+ActionMessage -> pcb_act_Message
+message_help -> pcb_acth_Message
+message_syntax -> pcb_acts_Message
+ActionMode -> pcb_act_Mode
+mode_help -> pcb_acth_Mode
+mode_syntax -> pcb_acts_Mode
+ActionToggleHideName -> pcb_act_ToggleHideName
+togglehidename_help -> pcb_acth_ToggleHideName
+togglehidename_syntax -> pcb_acts_ToggleHideName
+ActionSetSame -> pcb_act_SetSame
+setsame_help -> pcb_acth_SetSame
+setsame_syntax -> pcb_acts_SetSame
+ActionRouteStyle -> pcb_act_RouteStyle
+routestyle_help -> pcb_acth_RouteStyle
+routestyle_syntax -> pcb_acts_RouteStyle
+ActionCreateMenu -> pcb_act_CreateMenu
+createmenu_help -> pcb_acth_CreateMenu
+createmenu_syntax -> pcb_acts_CreateMenu
+ActionRemoveMenu -> pcb_act_RemoveMenu
+removemenu_help -> pcb_acth_RemoveMenu
+removemenu_syntax -> pcb_acts_RemoveMenu
+ActionSwitchHID -> pcb_act_SwitchHID
+switchhid_help -> pcb_acth_SwitchHID
+switchhid_syntax -> pcb_acts_SwitchHID
+ActionPrintActions -> pcb_act_PrintActions
+printactions_help -> pcb_acth_PrintActions
+printactions_syntax -> pcb_acts_PrintActions
+ActionDumpActions -> pcb_act_DumpActions
+dumpactions_help -> pcb_acth_DumpActions
+dumpactions_syntax -> pcb_acts_DumpActions
+ActionPrintUsage -> pcb_act_PrintUsage
+printusage_help -> pcb_acth_PrintUsage
+printusage_syntax -> pcb_acts_PrintUsage
+ActionPrintVersion -> pcb_act_PrintVersion
+printversion_help -> pcb_acth_PrintVersion
+printversion_syntax -> pcb_acts_PrintVersion
+ActionPrintCopyright -> pcb_act_PrintCopyright
+printcopyright_help -> pcb_acth_PrintCopyright
+printcopyright_syntax -> pcb_acts_PrintCopyright
+ActionPrintPaths -> pcb_act_PrintPaths
+printpaths_help -> pcb_acth_PrintPaths
+printpaths_syntax -> pcb_acts_PrintPaths
+ActionNetlist -> pcb_act_Netlist
+netlist_help -> pcb_acth_Netlist
+netlist_syntax -> pcb_acts_Netlist
+ActionNetlist -> pcb_act_Netlist
+netlist_help -> pcb_acth_Netlist
+netlist_syntax -> pcb_acts_Netlist
+ActionAttributes -> pcb_act_Attributes
+attributes_help -> pcb_acth_Attributes
+attributes_syntax -> pcb_acts_Attributes
+ActionDisperseElements -> pcb_act_DisperseElements
+disperseelements_help -> pcb_acth_DisperseElements
+disperseelements_syntax -> pcb_acts_DisperseElements
+ActionFlip -> pcb_act_Flip
+flip_help -> pcb_acth_Flip
+flip_syntax -> pcb_acts_Flip
+ActionListRotations -> pcb_act_ListRotations
+listrotations_help -> pcb_acth_ListRotations
+listrotations_syntax -> pcb_acts_ListRotations
+ActionMoveObject -> pcb_act_MoveObject
+moveobject_help -> pcb_acth_MoveObject
+moveobject_syntax -> pcb_acts_MoveObject
+ActionMoveToCurrentLayer -> pcb_act_MoveToCurrentLayer
+movetocurrentlayer_help -> pcb_acth_MoveToCurrentLayer
+movetocurrentlayer_syntax -> pcb_acts_MoveToCurrentLayer
+ActionElementList -> pcb_act_ElementList
+elementlist_help -> pcb_acth_ElementList
+elementlist_syntax -> pcb_acts_ElementList
+ActionElementSetAttr -> pcb_act_ElementSetAttr
+elementsetattr_help -> pcb_acth_ElementSetAttr
+elementsetattr_syntax -> pcb_acts_ElementSetAttr
+ActionRipUp -> pcb_act_RipUp
+ripup_help -> pcb_acth_RipUp
+ripup_syntax -> pcb_acts_RipUp
+ActionMinMaskGap -> pcb_act_MinMaskGap
+minmaskgap_help -> pcb_acth_MinMaskGap
+minmaskgap_syntax -> pcb_acts_MinMaskGap
+ActionMinClearGap -> pcb_act_MinClearGap
+mincleargap_help -> pcb_acth_MinClearGap
+mincleargap_syntax -> pcb_acts_MinClearGap
+MoveLayerAction -> pcb_act_MoveLayerAction
+movelayeraction_help -> pcb_acth_MoveLayerAction
+movelayeraction_syntax -> pcb_acts_MoveLayerAction
+Action_fp_rehash -> pcb_act__fp_rehash
+_fp_rehash_help -> pcb_acth__fp_rehash
+_fp_rehash_syntax -> pcb_acts__fp_rehash
+ActionMorphPolygon -> pcb_act_MorphPolygon
+morphpolygon_help -> pcb_acth_MorphPolygon
+morphpolygon_syntax -> pcb_acts_MorphPolygon
+ActionPolygon -> pcb_act_Polygon
+polygon_help -> pcb_acth_Polygon
+polygon_syntax -> pcb_acts_Polygon
+ActionAddRats -> pcb_act_AddRats
+addrats_help -> pcb_acth_AddRats
+addrats_syntax -> pcb_acts_AddRats
+ActionConnection -> pcb_act_Connection
+connection_help -> pcb_acth_Connection
+connection_syntax -> pcb_acts_Connection
+ActionDeleteRats -> pcb_act_DeleteRats
+deleterats_help -> pcb_acth_DeleteRats
+deleterats_syntax -> pcb_acts_DeleteRats
+ActionDelete -> pcb_act_Delete
+delete_help -> pcb_acth_Delete
+delete_syntax -> pcb_acts_Delete
+ActionRemoveSelected -> pcb_act_RemoveSelected
+removeselected_help -> pcb_acth_RemoveSelected
+removeselected_syntax -> pcb_acts_RemoveSelected
+ActionSelect -> pcb_act_Select
+select_help -> pcb_acth_Select
+select_syntax -> pcb_acts_Select
+ActionUnselect -> pcb_act_Unselect
+unselect_help -> pcb_acth_Unselect
+unselect_syntax -> pcb_acts_Unselect
+ActionAtomic -> pcb_act_Atomic
+atomic_help -> pcb_acth_Atomic
+atomic_syntax -> pcb_acts_Atomic
+ActionUndo -> pcb_act_Undo
+undo_help -> pcb_acth_Undo
+undo_syntax -> pcb_acts_Undo
+ActionRedo -> pcb_act_Redo
+redo_help -> pcb_acth_Redo
+redo_syntax -> pcb_acts_Redo
+ActionReplaceFootprint -> pcb_act_ReplaceFootprint
+replacefootprint_help -> pcb_acth_ReplaceFootprint
+replacefootprint_syntax -> pcb_acts_ReplaceFootprint
+ActionSavePatch -> pcb_act_SavePatch
+savepatch_help -> pcb_acth_SavePatch
+savepatch_syntax -> pcb_acts_SavePatch
+ActionManagePlugins -> pcb_act_ManagePlugins
+manageplugins_help -> pcb_acth_ManagePlugins
+manageplugins_syntax -> pcb_acts_ManagePlugins
+ActionConf -> pcb_act_Conf
+conf_help -> pcb_acth_Conf
+conf_syntax -> pcb_acts_Conf
+ActionGetStyle -> pcb_act_GetStyle
+getstyle_help -> pcb_acth_GetStyle
+getstyle_syntax -> pcb_acts_GetStyle
+ActionChkMode -> pcb_act_ChkMode
+chkmode_help -> pcb_acth_ChkMode
+chkmode_syntax -> pcb_acts_ChkMode
+ActionChkGridSize -> pcb_act_ChkGridSize
+chkgridsize_help -> pcb_acth_ChkGridSize
+chkgridsize_syntax -> pcb_acts_ChkGridSize
+ActionChkElementName -> pcb_act_ChkElementName
+chkelementname_help -> pcb_acth_ChkElementName
+chkelementname_syntax -> pcb_acts_ChkElementName
+ActionChkGridUnits -> pcb_act_ChkGridUnits
+chkgridunits_help -> pcb_acth_ChkGridUnits
+chkgridunits_syntax -> pcb_acts_ChkGridUnits
+ActionChkBuffer -> pcb_act_ChkBuffer
+chkbuffer_help -> pcb_acth_ChkBuffer
+chkbuffer_syntax -> pcb_acts_ChkBuffer
+ActionFreeRotateBuffer -> pcb_act_FreeRotateBuffer
+freerotatebuffer_help -> pcb_acth_FreeRotateBuffer
+freerotatebuffer_syntax -> pcb_acts_FreeRotateBuffer
+ActionPasteBuffer -> pcb_act_PasteBuffer
+pastebuffer_help -> pcb_acth_PasteBuffer
+pastebuffer_syntax -> pcb_acts_PasteBuffer
+ActionDumpLibrary -> pcb_act_DumpLibrary
+dumplibrary_help -> pcb_acth_DumpLibrary
+dumplibrary_syntax -> pcb_acts_DumpLibrary
+ActionBell -> pcb_act_Bell
+bell_help -> pcb_acth_Bell
+bell_syntax -> pcb_acts_Bell
+ActionToggleVendor -> pcb_act_ToggleVendor
+togglevendor_help -> pcb_acth_ToggleVendor
+togglevendor_syntax -> pcb_acts_ToggleVendor
+ActionEnableVendor -> pcb_act_EnableVendor
+enablevendor_help -> pcb_acth_EnableVendor
+enablevendor_syntax -> pcb_acts_EnableVendor
+ActionDisableVendor -> pcb_act_DisableVendor
+disablevendor_help -> pcb_acth_DisableVendor
+disablevendor_syntax -> pcb_acts_DisableVendor
+ActionImport -> pcb_act_Import
+import_help -> pcb_acth_Import
+import_syntax -> pcb_acts_Import
+ActionLoadhypFrom -> pcb_act_LoadhypFrom
+loadhypfrom_help -> pcb_acth_LoadhypFrom
+loadhypfrom_syntax -> pcb_acts_LoadhypFrom
+ActionRenumber -> pcb_act_Renumber
+renumber_help -> pcb_acth_Renumber
+renumber_syntax -> pcb_acts_Renumber
+ActionRenumberBlock -> pcb_act_RenumberBlock
+renumberblock_help -> pcb_acth_RenumberBlock
+renumberblock_syntax -> pcb_acts_RenumberBlock
+ActionRenumberBuffer -> pcb_act_RenumberBuffer
+renumberbuffer_help -> pcb_acth_RenumberBuffer
+renumberbuffer_syntax -> pcb_acts_RenumberBuffer
+ActionLoadDsnFrom -> pcb_act_LoadDsnFrom
+loaddsnfrom_help -> pcb_acth_LoadDsnFrom
+loaddsnfrom_syntax -> pcb_acts_LoadDsnFrom
+ActionDumpConf -> pcb_act_DumpConf
+dumpconf_help -> pcb_acth_DumpConf
+dumpconf_syntax -> pcb_acts_DumpConf
+ActionDumpLayers -> pcb_act_DumpLayers
+dumplayers_help -> pcb_acth_DumpLayers
+dumplayers_syntax -> pcb_acts_DumpLayers
+ActionEvalConf -> pcb_act_EvalConf
+evalconf_help -> pcb_acth_EvalConf
+evalconf_syntax -> pcb_acts_EvalConf
+ActionPSCalib -> pcb_act_PSCalib
+pscalib_help -> pcb_acth_PSCalib
+pscalib_syntax -> pcb_acts_PSCalib
+ActionApplyVendor -> pcb_act_ApplyVendor
+applyvendor_help -> pcb_acth_ApplyVendor
+applyvendor_syntax -> pcb_acts_ApplyVendor
+ActionUnloadVendor -> pcb_act_UnloadVendor
+unloadvendor_help -> pcb_acth_UnloadVendor
+unloadvendor_syntax -> pcb_acts_UnloadVendor
+ActionLoadVendorFrom -> pcb_act_LoadVendorFrom
+loadvendorfrom_help -> pcb_acth_LoadVendorFrom
+loadvendorfrom_syntax -> pcb_acts_LoadVendorFrom
+ActionAutoRoute -> pcb_act_AutoRoute
+autoroute_help -> pcb_acth_AutoRoute
+autoroute_syntax -> pcb_acts_AutoRoute
+GlobalPuller -> pcb_act_GlobalPuller
+globalpuller_help -> pcb_acth_GlobalPuller
+globalpuller_syntax -> pcb_acts_GlobalPuller
+Puller -> pcb_act_Puller
+puller_help -> pcb_acth_Puller
+puller_syntax -> pcb_acts_Puller
+ActionAutoPlaceSelected -> pcb_act_AutoPlaceSelected
+autoplaceselected_help -> pcb_acth_AutoPlaceSelected
+autoplaceselected_syntax -> pcb_acts_AutoPlaceSelected
+ActionDJopt -> pcb_act_DJopt
+djopt_help -> pcb_acth_DJopt
+djopt_syntax -> pcb_acts_DJopt
+h_str -> pcb_hash_str
+h_coordox -> pcb_hash_element_ox
+h_coordoy -> pcb_hash_element_oy
+h_coord -> pcb_hash_coord
+pcb_buffer_swap -> pcb_buffer_flip_side
+pcb_swap_buffers -> pcb_buffers_flip_side
+LAYER_IS_PCB_EMPTY -> PCB_LAYER_IS_EMPTY
+LAYER_IS_PCB_EMPTY -> PCB_LAYER_IS_EMPTY
+IsLayerEmpty -> pcb_layer_is_empty_
+IsLayerNumEmpty -> pcb_layer_is_empty
+IsLayerGroupEmpty -> pcb_is_layergrp_empty
+ParseGroupString -> pcb_layer_parse_group_string
+GetLayerNumber -> pcb_layer_id
+GetGroupOfLayer -> pcb_layer_get_group
+GetLayerGroupNumberByPointer -> pcb_layer_get_group_
+GetLayerGroupNumberByNumber -> pcb_layer_get_group
+IsPasteEmpty -> pcb_layer_is_paste_empty
+SOLDER_LAYER -> PCB_SOLDER_SIDE
+COMPONENT_LAYER -> PCB_COMPONENT_SIDE
+LayerStringToLayerStack -> pcb_layervis_parse_string
+ChangeGroupVisibility -> pcb_layervis_change_group_vis
+ResetStackAndVisibility -> pcb_layervis_reset_stack
+SaveStackAndVisibility -> pcb_layervis_save_stack
+RestoreStackAndVisibility -> pcb_layervis_restore_stack
diff --git a/doc-rnd/hacking/src/Makefile b/doc/developer/src/Makefile
similarity index 100%
rename from doc-rnd/hacking/src/Makefile
rename to doc/developer/src/Makefile
diff --git a/doc/developer/src/data1.dot b/doc/developer/src/data1.dot
new file mode 100644
index 0000000..4ff99e9
--- /dev/null
+++ b/doc/developer/src/data1.dot
@@ -0,0 +1,59 @@
+digraph pcb_data {
+ PCBType_misc [label="misc fields:\nID\nName\nFileName\ncolors\ndrc settings\ncursor coords\ngrid\nlayergroups\nroute styles\n..."]
+ PCBType_flags [label="flags:\nChanged\nViaOn (vias drawn?)\n..."]
+ pcb_board_t -> PCBType_misc
+ pcb_board_t -> PCBType_flags
+ pcb_board_t -> pcb_data_t
+ pcb_board_t [shape=box]
+
+ PCB [label="extern pcb_board_t PCB\nglobal variable\nholding the current\nboard" shape=diamond]
+ PCB -> pcb_board_t
+
+ Buffers [label="extern pcb_buffer_t Buffers[]\nglobal variable holding\nall paste buffers" shape=diamond]
+ Buffers -> pcb_buffer_t
+
+ BufferType_misc [label="misc fields:\nbounding box\noffset"]
+ pcb_buffer_t -> BufferType_misc
+ pcb_buffer_t -> pcb_data_t
+ pcb_buffer_t [shape=box]
+
+ DataType_lists [label="layer-independent lists:\nrats\nvias\nelements"]
+ DataType_rtrees [label="layer-independent rtrees"]
+ DataType_LayerN [label="LayerN: number of\nlayers in use"]
+ DataType_layers [label="an array of layers"]
+ DataType_misc [label="misc fields"]
+
+ pcb_data_t -> DataType_misc
+ pcb_data_t -> DataType_LayerN
+ pcb_data_t -> DataType_layers
+ pcb_data_t -> DataType_lists
+ pcb_data_t -> DataType_rtrees
+ pcb_data_t [shape=box]
+
+ DataType_layers -> pcb_layer_t
+
+
+ LayerType_lines [label="list and rtree of lines"]
+ LayerType_arcs [label="list and rtree of arcs"]
+ LayerType_texts [label="list and rtree of text objects"]
+ LayerType_polygons [label="list and rtree of polygons"]
+ LayerType_misc [label="misc fields:\nflags\ncolors"]
+
+ pcb_layer_t -> LayerType_misc
+ pcb_layer_t -> LayerType_lines
+ pcb_layer_t -> LayerType_arcs
+ pcb_layer_t -> LayerType_texts
+ pcb_layer_t -> LayerType_polygons
+ pcb_layer_t [shape=box]
+
+ subgraph "cluster_1" {
+ label="LEGEND"
+ style=filled
+ bgcolor=grey
+ round [label="round:\nstruct field"]
+ struct [label="box:\nstruct" shape=box]
+ diamond [label="diamond:\nglobal variable" shape=diamond]
+ }
+
+ LayerType_misc -> struct [style=invis]
+}
diff --git a/doc-rnd/devlog/20150731a_menu.html b/doc/devlog/20150731a_menu.html
similarity index 100%
rename from doc-rnd/devlog/20150731a_menu.html
rename to doc/devlog/20150731a_menu.html
diff --git a/doc-rnd/devlog/20150731b_gtk.html b/doc/devlog/20150731b_gtk.html
similarity index 100%
rename from doc-rnd/devlog/20150731b_gtk.html
rename to doc/devlog/20150731b_gtk.html
diff --git a/doc-rnd/devlog/20150801a_events.html b/doc/devlog/20150801a_events.html
similarity index 100%
rename from doc-rnd/devlog/20150801a_events.html
rename to doc/devlog/20150801a_events.html
diff --git a/doc-rnd/devlog/20150803a_scriptig.html b/doc/devlog/20150803a_scriptig.html
similarity index 100%
rename from doc-rnd/devlog/20150803a_scriptig.html
rename to doc/devlog/20150803a_scriptig.html
diff --git a/doc/devlog/20150816a_scriptig.html b/doc/devlog/20150816a_scriptig.html
new file mode 100644
index 0000000..8c7a695
--- /dev/null
+++ b/doc/devlog/20150816a_scriptig.html
@@ -0,0 +1,28 @@
+<HTML>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+<h2> scripting, 2 </h2>
+I've been working on the documentation for pcb-rnd scripting lately.
+Proof reading and comments would be appreciated. The documents are
+work-in-progress.
+<p>
+I have a <a href="http://repo.hu/projects/pcb-rnd/user/06_feature/gpmi/rosetta/index.html">Rosetta stone</a>
+of examples demonstrating how to write simple scripts.
+It doesn't explain how the system works, but shows easy-to-understand
+practical examples. Useful for those who like learn by doing and look up
+the "theoretical" background only after seeing things in practice.
+<p>
+Another document, the <a href="http://repo.hu/projects/pcb-rnd/user/06_feature/gpmi/scripting_intro.html">
+scripting intro</a> focuses on explaining how things are built up. This
+one is useful for those who first want to understand the design and then
+look at how to do things in practice.
+<p>
+As a next step I plan to reorganize the package documentation and split
+them all into a high level "what's the concept" doc and a low level
+reference manual.
+<p>
+I also plan to improve the links between the docs and write more rosetta
+examples. I plan to have a few more all-language examples on the most
+basic things. The more complex examples would be written in awk, lua and
+maybe ruby.
+
diff --git a/doc-rnd/devlog/20150820a_dimensions.html b/doc/devlog/20150820a_dimensions.html
similarity index 100%
rename from doc-rnd/devlog/20150820a_dimensions.html
rename to doc/devlog/20150820a_dimensions.html
diff --git a/doc-rnd/devlog/20150820b_qf.html b/doc/devlog/20150820b_qf.html
similarity index 100%
rename from doc-rnd/devlog/20150820b_qf.html
rename to doc/devlog/20150820b_qf.html
diff --git a/doc/devlog/20150821a_parametric_requirements.html b/doc/devlog/20150821a_parametric_requirements.html
new file mode 100644
index 0000000..0da4996
--- /dev/null
+++ b/doc/devlog/20150821a_parametric_requirements.html
@@ -0,0 +1,32 @@
+<html>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+<h2> requirements for parametric footprint generation </h2>
+
+It's appealing to write parametric footprint generators for new footprint
+families: invest some time once, and have a tool that can spit out
+dozens of footprints. However, it is not always worth having a generator
+instead of static footprints. The minimal requirements for a generator are:
+
+<ul>
+
+<li> the footprint family is a series of footprints that can be generated
+using the same code, with changing some base properties (e.g. number of
+pins)
+
+<li> dimensions and other properties can be calculated from the base
+properties with reasonable formulas and conditional code; e.g. sot* is not
+a good candidate for generation, as sot23 or sot89 can not be generated
+from some common ancestor by varying one or two parameters, but would need
+a large table that translates package name to a pattern - easier to keep
+those in static footprint files
+
+<li> has a reasonable amount of existing variations; e.g. it is not worth
+writing a generator for the dsub family because there are only a few of
+them in common use (db9, db15, db25, and maybe db37).
+
+<li> preferably a link to a datasheet that shows at least 3 members of the
+family; if that's not possible, separate datasheets describing at least 3
+members of the family.
+
+</ul>
diff --git a/doc/devlog/20150830a_fork_faq.html b/doc/devlog/20150830a_fork_faq.html
new file mode 100644
index 0000000..8604c8e
--- /dev/null
+++ b/doc/devlog/20150830a_fork_faq.html
@@ -0,0 +1,257 @@
+<html>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+
+<H2> Fork FAQ </H2>
+
+This document contains my short answers to questions commonly popping up
+in endless flamewars on the geda mailing list. <b>The purpose of this
+document is not to convince anyone about any of the questions</b>, only
+to save me some time typing the same answers when someone asks me
+one these questions for the 100th time. As I don't want to convince you
+that my answers are the best ones, please don't try to convince me that
+they are bad. Been there, done that, never worked in either way: e.g.
+I never convinced any git fanboy to switch to svn, and they never
+convince me to switch to git.
+
+<H3> 1. Why did you fork? </H3>
+<a id="1"><a id="fork">
+<H4> 1.1. Fragmentation is bad, your fork is harmful! </H4>
+I agree that fragmentation is bad. I believe the same aspects of
+the current project management and especially the choice of VCS inevitably
+leads to forks (just look at how many git forks are out there!). Such
+fragmentation of developer and user resources may be bad for a project.
+However, these decisions are not mine: the project is set up like
+that, I can't change it
+<p>
+My fork is just a fork, just like any of the other forks. My fork happens to
+be in an svn repository. I don't think it changes anything important from the
+mainline's point of view.
+
+<H4> 1.2. ... but how will you get all these merged with mainline? </H4>
+I won't. I haven't really used the official, current mainline since like
+2011. I don't really care in what directions it evolves or whether it
+takes features, code or ideas from pcb-rnd or not.
+
+<H4> 1.3. ... but you are in the best position for a merge! </H4>
+I don't think so. I know my changes, but I don't know the changes happened
+in the mainline since ages. I am also not efficient with git. It wouldn't
+take me any less time than for mainline developers. Also please read point 1.2.:
+I have no motivation in spending any time on a merge.
+
+<H4> 1.4. Ok then, but you won't have too many users. </H4>
+Fine. My main intention was to produce a pcb editor for my own use. I am
+happy if it's also useful for others, so I publish it. Having users
+may increase code quality - but other than that, I don't get paid for having
+more users, the project doesn't die if I code it alone, so I am not worried
+about this.
+<p>
+<b>Update (Aug 2016):</b> an active user/contributor community is forming
+around pcb-rnd. It is not a one-man-show anymore.
+
+<H4> 1.5. I'd like to merge something from pcb-rnd to mainline </H4>
+Go ahead. I can help you by explaining my code. I won't generate
+patches, make changes to get my code compatible with the mainline or
+test how it performs in mainline versions.
+
+<H4> 1.6. I'd like to merge something from mainline to pcb-rnd </H4>
+If the feature is in line with the goals of pcb-rnd, fine, I'll give
+you svn commit access from day 0.
+
+<h4> 1.7. Would you abandon the development of pcb-rnd and join the mainline, if... </H4>
+Unlikely. There are many things I have in pcb-rnd which I believe won't ever
+happen in mainline. There are a few which I find critical: if I'd need to
+give up any single item from this list, that would be a deal-breaker for me:
+<ul>
+ <li> simple, centralized VCS (not just the UI, the whole thing)
+ <li> VCS based, zero-administration release and publish interface
+ <li> a sane build system instead of autotools
+ <li> the code won't switch to C++
+</ul>
+
+
+<h4> 1.8. Would you join the development of gschem? </h4>
+Unlikely. See point 1.7. Gschem is not aiming to a C++ transition AFAIK,
+but has a lot of scheme. I don't consider joining or contributing to
+gschem until those points listed in 1.7. are fixed and a new scheme
+policy is introduced. The new policy should be: "from now on
+do not write new code in scheme, use C; while making changes and fixes,
+convert affected scheme code to C. Long term, explicit plan: convert all
+scheme code to C and remove the guile dependency."
+<p>
+I don't expect any of this to happen.
+<p>
+<b>Update (Aug 2016):</b> Instead, I'll launch <a href="20160101_cschem.html"> cschem </a>.
+
+
+<H3> 2. git: did you know... </H3>
+<a id="2"><a id="git">
+Preface: I don't try to convince you not to use git in your project; in
+return, please don't try to convince me I should use git in mine.
+
+<H4> 2.1. ... that there was an svn frontend to git? </H4>
+Yes. 2/3 of my problems with git and DVCS in general are not of technical
+nature. I know the <b>concepts</b> of DVCS and I find them suboptimal in
+case of small teams. A different UI or a good document won't help in that.
+
+<H4> 2.2. ... that there was this great document about git? </H4>
+See 2.1.
+
+<H4> 2.3. ... that DVCS is the future, anything centralized is bad, svn is obsolete? </H4>
+These are not facts, but slogans I don't believe in.
+
+<H4> 2.4. What if someone has to develop offline for long? </H4>
+In the 21th century, when we have cheap mobile internet even in eastern
+Europe?
+
+<H4> 2.5. But feature X is harder with svn! </H4>
+Almost all those features are bad for team work in my experience. They
+are not even needed. Yes, some aspects of the development have to be
+done differently without those - but this is good for the project.
+
+<H4> 2.6. But there are no local repositories and you have to commit unfinished stuff and worry if anything breaks! And branching is hard </H4>
+This is the point. I do not branch. I do not attempt to work offline for long,
+whatever technical support the VCS may provide for that. I try to work in
+a team, on a common code base.
+<p>
+I commit small things. I make sure I do a big transition using
+these small commits in a way that the code stays compilable in between any
+two commits. It rarely breaks trunk/ for longer than a few minutes. I
+need a real branch once a decade.
+
+<H4> 2.7. But that's extra effort and makes life harder! </H4>
+Yes and no. It's certainly harder to design and carry out a big
+reorganization in small steps. This is an extra cost. However, the
+benefits outweigh this: everyone working in the same repo,
+other developers see and comment what you are working on, if done right,
+merging is nearly never needed and conflicts are as rare as bugfree
+release of a multi-million line proprietary software.
+
+<h4> 2.8. I don't agree with any of this, git is better! </H4>
+Cool, so go on using git. I didn't try to convince you not to, I just
+explained why I won't.
+
+<H3> 3. opengl </H3>
+<a id="3"><a id="opengl">
+<H4> 3.1. But I need opengl! </H4>
+Use the mainline then. Or contribute the code for sane opengl support
+in pcb-rnd.
+<p>
+<b>Update (Aug 2016):</b> GUI HIDs are plugins now, multiple GUIs can
+be compiled and chosen run-time. Default GUI is a runtime configuration too.
+All we need to have an opengl GUI HID now is a gl-capable volunteer.
+
+<H4> 3.2. ... good, then please make that opengl hid!</H4>
+No, thanks. I don't need it, I wouldn't use it, there's no point in spending
+my time on it. If you need it, I invite you to do it.
+<p>
+<b>Update (Aug 2016):</b> I can do the build system and plugin administration
+part for you.
+
+<H4> 3.3. Did you know that opengl can be turned off in mainline? </H4>
+Yes. If I have a fork, I want its defaults to reflect my preferences.
+
+<H4> 3.4. But transparent renders are so good on a board with many layers! </H4>
+Not for me: transparency made even a 2 layer board cryptic when I tried. See
+3.1.
+
+
+<H3> 4. programming languages, file formats </H3>
+<a id="4"><a id="c">
+<H4> 4.1. switch to C++, it is so much better </H4>
+Nope. I prefer C.
+
+<H4> 4.2. but pcb-rnd doesn't compile with a C++ compiled </H4>
+Correct: pcb-rnd is written in C. It also doesn't compile with a Pascal
+compiler.
+
+<H4> 4.3. but mainline already invested in preparing a C++ transition </H4>
+Good for them. If I didn't have a fork, I'd fork the day when the first
+C++ class is committed.
+
+<H4> 4.4. we need SQL for the file format </H4>
+No, we don't. I prefer human readable text formats. No, converters won't
+solve that. No, I don't care if python has support for loading SQL files.
+<p>
+<b>Update (Aug 2016):</b> the file format is a replaceable plugin now;
+it's even possible to have multiple alternative formats active in the same
+time. It's up to you to implement your format in a plugin.
+
+<H4> 4.3. we need to switch to xml/json (or python or perl arrays) </H4>
+No, we don't need to.
+<p>
+<b>Update (Aug 2016):</b> ... unless you implement it in a plugin, see point 4.4.
+
+<h4> 4.4. ... but they are easier to parse because of existing libs </h4>
+Yup, but in any real life task that part of the parsing is like 5%. The
+rest 95% needs to be programmed anyway. The costs of such a file format change
+is not justified by this minor gain.
+
+<h4> 4.5. ... but the current file format doesn't support feature X </h4>
+<small>
+True. And that's because the internal model (the in-core representation
+and <b>all the code handling that</b>) doesn't support the feature either.
+Changing the file format won't help that. It's similar to point 4.4.: 95%
+of the effort is needed to get the code to support the feature, and by that
+time the cost of getting it into the file format is very small. Costs
+are not justified.
+</small>
+<p>
+<b>Update (Aug 2016):</b> long term the new primary file format will be
+lihata to overcome the above limitations. Later on the internal representation
+may change too.
+
+<H4> 4.6. ... but I can't build a database of the current lib </h4>
+Too bad. Either figure how to do it, or just don't do it. pcb-rnd
+offers scripting, even in languages that have SQL support. In theory
+it wouldn't be that hard to write scripts running in PCB manipulating
+the buffer or even the in-core footprints on one end and connecting
+an SQL database on the other end.
+
+
+<H3> 5. scconfig, autotools, build systems </H3>
+<a id="5"><a id="scconfig">
+<h4> 5.1. scconfig doesn't support feature X that autotools does </h4>
+Are you sure? Maybe it does, just uses a different syntax. If not, did
+you try to send me a feature request?
+
+<h4> 5.2. scconfig's syntax is different </h4>
+Yes. Scconfig has a totally different internal model thus the UI differs
+too. Same as vim has a different UI than emacs, while they are both text
+editors and the two communities are not trying too hard to unify the UIs.
+
+<h4> 5.3. But ./configure has to have the same UI as autotools </h4>
+False.
+
+<h4> 5.4. Most people know autotools, there are merits in supporting the same features or UI </h4>
+I do realize that. I've been working on scconfig since 2008. I've invested
+a lot of time in it. Believe me, I did think it over before I decided that
+the benefits would overweight the drawbacks of developing/using a custom
+config/build system.
+
+<h4> 5.5. But autotools is so much better! </H4>
+No, it isn't. My experience is that with random open source projects
+on anything different from Linux, modern BSD, and sometimes windows, it
+just breaks at least 8 times out of 10. Try it once on IRIX or minix.
+
+<h4> 5.6. So why don't you rather fix autotools? </H4>
+I believe there are multiple design problems in autotools and most of
+the practical problems I faced when using it were directly caused by those.
+In a sense, I did fix these design problems by using a different design.
+The different design is called scconfig and it was much easier to
+write it from scratch.
+
+<h4> 5.7. But scconfig doesn't do cross compilation! </H4>
+False. It does. It's been supported since May 2008. It's been added
+about 1.5 months after the very first file.
+<p>
+<b>Update (Aug 2016):</b> as a practical example, windows .exe has
+been cross-compiled on a Linux box.
+
+<h4> 5.8. I just don't like scconfig. </H4>
+If you have something particular that makes you dislike scconfig,
+a missing feature for example, please let me know.
+<p>
+Else maybe you don't like using anything else than autotools. It's your
+choice; mine is that I do keep on using scconfig in my projects.
+
diff --git a/doc/devlog/20150830b_back_ann.html b/doc/devlog/20150830b_back_ann.html
new file mode 100644
index 0000000..fcdb90d
--- /dev/null
+++ b/doc/devlog/20150830b_back_ann.html
@@ -0,0 +1,304 @@
+<html>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+
+<H2> back annotation </H2>
+
+<H3> netlists, annotations </H3>
+
+Pcb-rnd (and mainline pcb) maintains a netlist as part of the design. Pcb
+doesn't modify the netlist. The netlist is imported from an external source,
+typically from gschem. This process is called forward annotation.
+<p>
+Sometimes there are a set of connections which contain pin pairs that could
+be swapped. For example the data lines of an external parallel SRAM interface
+to an MCU: it doesn't matter if data bit 1 at the MCU is wired to data bit
+1 or 5 of the SRAM, as there is an 1:1 mapping and no one else is using the
+same bus wires. In this case connections should be swapped during pcb routing
+and annotated back to gschem so that the schematics can be updated. Both
+paths are illustrated below.
+<p>
+<img src="res/20150830b_annot.png" alt="annotation paths">
+<p>
+Forward annotation passes on complete netlists along arrows forward1 and
+forward2. Back annotation would pass back netlists, changes or modification
+requests on the back1, back2 path. Gnetlist takes sch files to extract
+and build a netlist in whatever format the receiver needs. There should be a
+glue layer, called <i>foo</i> on the drawing, that does the reverse: receives
+whatever format the sender has and generates something that gschem will
+understand.
+
+<H3> Support in pcb-rnd: core </H3>
+Pcb-rnd gets a complete netlist. If the user could change the netlist directly,
+there should be some sort of diff tool in <i>foo</i> that can explain the
+changes to gschem, or a diff tool in gschem. What is worse, forward annotation
+happens much more often than back annotation and pcb-rnd would need to be able
+to merge a new netlist with local changes. The simple "gsch2pcb overwrites the
+netlist in pcb from whatever gnetlist produced" approach would not work.
+<p>
+An alternative is to keep the netlist as-is, and maintain a separate list of
+changes. The form proposed hereby is a table of "operation,pinID,net" or
+"operation,args...". Netlist operation is one of "del_conn", "add_conn" <!--, "del_net",
+"add_net"--> and "net_info". The table is called the <i>netlist patch</i>.
+<p>
+For example assume two components with pins A1, A2 and B1, B2, with connections
+n1=A1-B1 and n2=A2-B2. While routing the designer decides changing them to
+n1=A1-B2 and n2=A2-B1 would be easier and is acceptable by the design. The
+table of changes would contain this:
+<table border=1>
+ <tr><th>op <th> pinID <th> net
+ <tr><td>del_conn <td> B1 <td> n1
+ <tr><td>del_conn <td> B2 <td> n2
+ <tr><td>add_conn <td> B2 <td> n1
+ <tr><td>add_conn <td> B1 <td> n2
+</table>
+The first two lines would remove pins B1 and B2 from n1 and n2. The last
+two would put them back, swapped. New nets could be created or unused nets
+could be removed using the add_net and del_net commands that have empty pinID.
+The table is ordered, rows are strictly executed from top to bottom.
+<p>
+Pcb-rnd would store this table in memory. When some code calls the netlist
+code to find out the members of a net, or which net a given pin is connected to,
+after running the original netlist code, the result would be adjusted by the table.
+<p>
+The table would be normalized after operations. For example:
+<table border=1>
+ <tr><th>op <th> pinID <th> net
+ <tr><td>del_conn <td> B1 <td> n1
+ <tr><td>add_conn <td> B1 <td> n2
+ <tr><td>add_conn <td> B1 <td> n3
+ <tr><td>del_conn <td> B1 <td> n2
+</table>
+would be reduced to
+<table border=1>
+ <tr><th>op <th> pinID <th> net
+ <tr><td>del_conn <td> B1 <td> n1
+ <tr><td>add_conn <td> B1 <td> n3
+</table>
+Simple linear crawls on the table seems sufficient: it is expected that
+pcb designers will make netlist modifications rarely and they will back
+annotate them ASAP. In extreme cases there may be 64 bit wide bus systems that
+need total reordering; even a 4 such reorders will introduce about 1024 items
+on the list which seems not too big for O(1) algorithms. See section TODO
+for better approaches.
+<p>
+Pcb-rnd would save the normalized table in the pcb file in a new section.
+Upon a netlist change in pcb (import/load netlist or load the pcb), pcb-rnd
+would check each row of the table: it is easy to decide whether that row
+has been implemented in the netlist or not. Obsolete rows of the table would
+be deleted.
+<p>
+A corner case is when B1 is removed from n1 and then added to n2 by the table,
+while a new forward annotation removes B1 from n1 and adds it to n3. In this
+case the first row of the table is deleted, as B1 is already removed from n1,
+but pcb-rnd has no chance to decide if netlist adding B1 to n3 should affect
+the table adding B1 to n2, so that rule is kept.
+<p>
+<b>net_info</b> is used to describe the <b>original</b> members of a net, in
+the state they were before any change on the netlist occurred.
+
+<H3> Support in pcb-rnd: GUI </H3>
+A trivial idea is to extend the netlist window so that pins can be moved in
+between nets or deleted or assigned to nets. Changes should be marked. This
+is not the preferred way of editing the netlist, tho: not much more convenient
+than making changes in gschem and doing forward annotation.
+<p>
+There should be a separate dialog box or a separate region of the netlist box
+showing the <i>netlist patch</i> with edit capabilities.
+<p>
+Finally, the most important feature would be new actions resolving shorts.
+Using the above example (n1=A1-B1 and n2=A2-B2 changed to n1=A1-B2 and n2=A2-B1),
+I believe the user would:
+<table border=1>
+ <tr><th> action <th> screenshot <th> patch list after the actions
+ <tr><td><ul><li> look at initial rats</ul><td> <img src="res/20150830b_s0.png" width="50%"> <td> (empty)
+ <tr><td><ul><li> first connect A1 to B1</ul> <td> <img src="res/20150830b_s1.png" width="50%"> <td> (empty)
+
+ <tr><td><ul>
+ <li> then realize it's very hard to connect A2 to B2 while the previous connection is there
+ <li> he would then revert the first connection
+ <li> and connect A1 to B2
+ <li> which would cause shorts
+ </ul><td> <img src="res/20150830b_s2.png" width="50%">
+ <td>(empty)
+
+ <tr><td><ul>
+ <li> then he would use the "approve netlist change" hotkey/action on the network;
+ this would add <i>netlist patch</i> commands for the A1-B2 connection,
+ but would also keep the A1-B1 connection, which remains a rat; because
+ of the new connection there'd be a rat between A1 and A2 or B1 and B2 too
+ (all 4 pins connected together on the patched netlist at the moment!)
+ </ul><td> <img src="res/20150830b_s3.png" width="50%">
+ <td>
+<pre>
+net_info n1 A1 B1
+net_info n2 A2 B2
+del_conn B1 n1
+add_conn B1 n2
+</pre>
+
+ <tr><td><ul>
+ <li> the user would then use an action (maybe the same one?) on the rat line
+ so that pcb-rnd would understand that rat is not needed anymore and
+ would add a patch to remove the A1-B1 connection
+ <li> the same thing would need to happen to the A2-B2 rat
+ </ul><td> <img src="res/20150830b_s4.png" width="50%">
+<td>
+<pre>
+net_info n1 A1 B1
+net_info n2 A2 B2
+del_conn B1 n1
+add_conn B1 n2
+del_conn B2 n2
+</pre>
+
+
+ <tr><td><ul><li> the user then would connect A2 to B1, which again is a short</ul><td><img src="res/20150830b_s5.png" width="50%">
+ <tr><td><ul>
+ <li> the user would approve it as a new connection
+ <li> we have exactly 2 del_conn and 2 add_conn patches.
+ </ul><td><img src="res/20150830b_s6.png" width="50%">
+<td>
+<pre>
+net_info n1 A1 B1
+net_info n2 A2 B2
+del_conn B1 n1
+add_conn B1 n2
+del_conn B2 n2
+add_conn B2 n1
+</pre>
+
+</table>
+An experienced user may think a few steps in advance and
+chose to first remove the A1-B1 and A2-B2 rats and then create the A1-B2
+and A2-B1 connections and then approve the two new connections.
+<p>
+An alternative is drag&drop ratline endpoint onto snap points; it may
+be tricky to convert that to net/pin relations if a rat line is between two
+line segments, tho.
+<p>
+These changes would live immediately, leaving the board free of shorts and
+rats. There should be, however, some warning in the "congratulation" message
+that tells the user a back annotation is still required.
+
+<H3> Support in gschem </H3>
+Ideally there should be a very small change in gschem and an optional
+plugin script could do the rest. The plugin script would be in contant
+with foo.
+<p>
+There are multiple ways pins can be connected to a net in gschem. It's
+probably not a good idea to have too much automatism in the gschem's side,
+trying to actually removing connections and adding new ones using the patch
+(or whatever info <i>foo</i> converted the patch into).
+<p>
+However, gschem should support four things natively:
+<ul>
+ <li> it should have a concept of an unwanted pin-network connection; a connection
+ becomes unwanted only when the back annotation says so
+ <li> it should be able to mark unwanted connections on the active schematic page
+ <li> it should be able to tell the user if there are unwanted connections on
+ any of the pages open
+ <li> it should be able to refresh its idea of unwanted connections while
+ schematic pages are open
+</ul>
+<p>
+Displaying unwanted connections happen at:
+<ul>
+ <li> a pin of a component is connected to a net using a "blue line" net: mark the pin-net connection point
+ <li> a pin is directly connected to another pin, no net line in between: mark the connection point
+ <li> a pin is connected to a net using a pin attribute: mark the pin
+ <li> TODO: are there more?
+</ul>
+<p>
+TODO: there are a lot to think over about special cases related to
+multipage schematics, hierarchies, slots, split symbols.
+
+<H3> What <i>foo</i> does exactly </H3>
+... is not clear yet. It depends on what sort of support gschem would provide.
+
+<H3> Amendment 1: other parameters (1st sep)</H3>
+I originally forgot to mention my other intentions in the above document:
+back annotate non-netlist properties. It probably happened because netlist
+related stuff are the hardest to solve.
+<p>
+There are other parameters that sometimes change during routing. A common case
+for my 1 or 2 layer boards is when I originally intend to use 0603 parts but
+during routing I figure I need to pass a trace between the pads. I need to
+change the part to 0805 or 1206 (for two traces). I'd like to be able to
+do this <b>in-place</b> in pcb with an action that replaces the footprint
+but keeps the origin in place. This obviously still requires some manual
+fiddling afterwards, but would remove the long, tedious chain I have now:
+<ul>
+ <li>1. remember or note down which parts to change footprints for
+ <li>2. go back to gschem and change them
+ <li>3. get the changes in pcb (I use gsch2pcb and Makefiles, one step; the import menu is one step too, just another one)
+ <li>4. disperse the new elements
+ <li>5. find where they used to be
+ <li>6. and then do the fiddling to fit them in
+</ul>
+<p>
+The new process would be:
+<ul>
+ <li> 1. get the footprint replaced, in-place; this would already approve the
+ change and there'd be a command for it in the patch table
+ <li> 2. do the fiddling to fit the new part in
+ <li> 3. do a back annotation
+ <li> (4. optionally, if we go for non-automatic change of attributes in gschem,
+ change them manually in gschem, cycling through the affected
+ items using some UI feature)
+</ul>
+<p>
+The same thing could work for values, which is the other attribute PCB also
+sees. The same mechanism could work from other programs as well, e.g. tuning
+the values of some parts in a simulator and then back annotating the changes
+to the schematics. The patch table format <i>foo</i> handles would be in the
+simplest plain text form.
+
+<a id="a2">
+<H3> Amendment 2: examples from gschem's point of view (3rd Sep)</H3>
+<h4> netlist change </h4>
+<ul>
+ <li> The user creates the schematics and imports it in pcb; the original
+ netlist contains a line "netname1 U1-1 CONN1-2"
+ <li> The user, as part of some pin swapping, decides that U1-1 should be
+ connected to net "netname2" instead of "netname1". Changes are
+ done in pcb-rnd as described above.
+ <li> The netlist patch generated for this single change by pcb-rnd would be:
+ <pre>
+del_conn netname1 U1-1
+add_conn netname2 U1-1
+ </pre>
+ <li> the user may need to load the netlist patch in gschem
+ <li> In gschem there would be an indication that highlights any U1-1 pin or
+ U1 symbol that makes a connection to netname 1, graphically or using
+ attributes. When asked, gschem UI would also tell the user that U1-1 is
+ now connected to netname1 but should be connected to netname2 instead.
+ <li> The user would find this indication and would resolve the situation
+ by whatever changes he finds appropriate
+ <li> gschem would rerun the patch commands and would figure that the del_conn
+ fails to run because U1-1 is no longer connected to netname1 and the add_conn
+ fails too because U1-1 is connected to netname2. This leaves U1-1 without
+ any known issue, so the indication on U1-1 would be gone.
+</ul>
+
+<h4> attribute change: footprint change </h4>
+<ul>
+ <li> The user creates the schematics and imports it in pcb; originally
+ U1 has an attribute footprint=DIP(8).
+ <li> during the layout the user figures using the footprint SO(8) is
+ more appropriate. He does the change in pcb-rnd.
+ <li> pcb-rnd emits the following netlist patch for this:
+ <pre>
+change_attrib U1 footprint=DIP(8) footprint=SO(8)
+ </pre>
+ <p>
+ (or it could be a del_attrib and add_attrib pair, like with connections)
+ <li> the user may need to load the netlist patch in gschem
+ <li> In gschem there would be an indication that highlights any U1 instances
+ that has footprint=DIP(8)
+ <li> The user would find this indication and would resolve the situation
+ by whatever changes he finds appropriate (e.g. change the attribute)
+ <li> gschem would rerun the patch commands and would figure the change is
+ no longer required and would remove the indication
+</ul>
+
diff --git a/doc-rnd/devlog/20150901a_back_ann.html b/doc/devlog/20150901a_back_ann.html
similarity index 100%
rename from doc-rnd/devlog/20150901a_back_ann.html
rename to doc/devlog/20150901a_back_ann.html
diff --git a/doc/devlog/20151028_glib.html b/doc/devlog/20151028_glib.html
new file mode 100644
index 0000000..76c5d98
--- /dev/null
+++ b/doc/devlog/20151028_glib.html
@@ -0,0 +1,65 @@
+<html>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+
+<H2> why glib is a bad idea </H2>
+
+Levente tried to compile pcb-rnd on bsd and used a different c compiler
+than gcc. For this in the first step I fixed the build system so that it
+doesn't have gcc --std=gnu99 but gcc --std=c99.
+<p>
+And then everything broke. A minilib I use for hashing,
+<a href="http://repo.hu/projects/genht">genht</a>, failed to
+link against hid/common/action.c. I first thought it was a bug in genht:
+genht was compiled without --std while the rest of the code compiled with
+--std=gnu99 or --std=c99. Genht heavily depends on static inline
+functions for performance, maybe that's why.
+<p>
+So I tried to reproduce the situation in a hello-world like program and
+tried all combination of --std, -DNDEBUG, -rdynamic and all build flags
+used in pcb-rnd for the genht lib and the test program, but all combination
+worked. It looked like it broke only in pcb-rnd.
+<p>
+I gave up on the minimal test case and went back to pcb-rnd. I realized if
+the build is the same, the only way it may break is that some header
+included before genht's headers change some global state. I started to
+shuffle the #includes. Long story short, it turned out if <glib.h> is
+included before genht's headers, it breaks.
+<p>
+Some more tracing showed it was because glib over-#defines the keyword
+<i>inline</i> in a public header that gets included from glib.h. It's all wrapped
+in a complicated tree of #ifdefs, so it behaves differently depending on
+the --std setting.
+<p>
+The morale of the story is... Well, I have multiple conclusions.
+<ul>
+<li> glib is not a lib that tries to solve something, it is a proggamming
+environment that tries to supersede C.
+
+<li> As such, it feels free to mess with the environment, redefine C
+keywords as it sees fit, because once you use glib, why would you use
+anything else? And once you use glib, you are programming in glib, not in
+"plain C".
+
+<li> Grepping through the pcb-rnd code, I see that pcb-rnd does not try to
+use glib as a programming environment, but needs only 2 and a half
+features: hash, list and rarely dynamic strings. Any other glib call is
+just a must that had to be done that way to get hashes and lists working.
+
+<li> genht is 510 sloc. I have a generic list implementation (which, by the
+way, is more efficient than glib's) It costs 256 sloc. So having
+type-independent hashes and lists in C89 costs less than 800 lines of code
+if you pick the right libs. Glib's <b>include/ alone is over 24000 sloc!</b>
+And in return glib breaks inline...
+</ul>
+
+<p>
+In a nutshell this is why I don't believe in glib-like solve-all megalibs. I
+don't say size alone determines this, but size is a good indication of
+potential problems.
+<p>
+If I need hash and lists and the offer is longer than 5k sloc, I know it
+will bring a lot of unneeded bloat that likely to break things.
+
+</body>
+</html>
diff --git a/doc/devlog/20160101_cschem.html b/doc/devlog/20160101_cschem.html
new file mode 100644
index 0000000..d72423e
--- /dev/null
+++ b/doc/devlog/20160101_cschem.html
@@ -0,0 +1,68 @@
+<html>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+
+<H2> cschem </H2>
+
+Cschem is a project I plan to start within the next few years. It's goals
+and some design concepts are similar to gschem's and geda's, while it
+also breaks some traditions to fix shortcomings in the design of geda. It's
+named after gschem, not after geda, to emphasize that the editor needs to
+be connected more to the rest of the system (see details later).
+<p>
+Some concepts cschem will try to follow (marking with * where there's major
+difference to geda):
+<ul>
+ <li> 1. design
+ <ul>
+ <li> 1.1. modularity, aka. toolkit approach
+ <li> 1.2. flexibility (trough attributes)
+ <li> 1.3. one schematics file is one sheet
+ <li> 1.4. multi page projects (hierarchic, flat)
+ <li> 1.5. data is in structured text files (no builtin sql support in core)
+ <li> 1.6. * the concept of a "project"; it's optional, tools can work on a set of schematics files _or_ on a complete project
+ <li> 1.7. * nets and components are uniquely identifiable using the same identifiers by all projects
+ <li> 1.8. * no excess "smartness" in the GUI editor: no slotting, no pin numbering, no auto renumbering, etc; these all should be done in the netlist layer and results fed back to the editor
+ <li> 1.9. * direct, bidirectional communication between the editor (GUI) and the netlist layer <b>without</b> any integration of the two, through simple and clean API, keeping both parts replaceable; attributes cschem got back from the netlister are "volatile": not saved, do not override attributes provided by the user
+ <li> 1.10. * less format-specific tricks built into the GUI code, more generic approaches (e.g. a search is a search, not a search-for-text-attribute and results on the result lists are any object of the design)
+ <li> 1.11. * slotting, pin mapping, device mapping are in backends
+ <li> 1.12. * back annotation should not be any harder than forward annotation
+ <li> 1.13. * since a lot of info is invented in backends, not in the GUI (e.g. pin numbers, when slotting), the GUI needs to be able to switch between "views": what (combination of) backend(s) to get these info from; Note: this would also provide an interactive DRC on the GUI with the DRC still implemented in the netlister!
+ <li> 1.14. * the scriptable plugin system is based on GPMI from the start to guarantee the tool is not tied to any one specific scripting engine or scripting language
+ </ul>
+ <li> 2. implementation
+ <ul>
+ <li> 2.1. a core library that does common things like figuring what objects are connected with net lines
+ <li> 2.2. the simple GUI editor should provide the frame; exotic functions should come from user plugins
+ <li> 2.3. a simple netlister that provides only generic (* absolutely no backend specific) queries; actual backends are implemented as plugins
+ <li> 2.4. * the core library and the netlister and the GUI core are all implemented in plain C:
+ <ul>
+ <li> 2.4.1. * no dependency on any specific scripting engine or scripting language; no core functionality implemented in anything else but C
+ <li> 2.4.2. * no dependency on big "solves-everything" libraries (e.g. no glib or cairo dependency)
+ <li> 2.4.3. * the actual GUI is behind the plugin system (like PCB's HIDs)
+ <li> 2.4.4. * the first gui, in accordance with the no big libraries, will not be gtk or qt but sdl2 based; this would guarantee to have a front end that doesn't need to be rewritten every 5 years just for the sake of the rewrite
+ <li> 2.4.5. * scconfig instead of autotools: smaller, easier to maintain, works better outside of the gnu-win32 world
+ </ul>
+ </ul>
+ <li> 3. project management
+ <ul>
+ <li> 3.1. automatic tests wherever possible, as early as possible
+ <li> 3.2. * VCS: simple, centralized svn with straight linear development, actively trying to avoid branching
+ <li> 3.3. * near-zero-administration releases with svn commits
+ <li> 3.4. * users should be able to submit bug reports anonymously, without having to register, without having to run javascript, java applet, flash, etc.
+ </ul>
+ </ul>
+</ul>
+
+<p>
+There are a lot of open questions:
+<ul>
+ <li> q1. how buses should work
+ <li> q2. how slotting should work (but at least we can have alternatives here)
+ <li> q3. how hierarchical design should work
+ <li> q4. * how the GUI should display large amount of attributes without making the whole page an unreadable mess
+ <li> q5. flat vs. non-flat netlists - if turns out it's not just an implementation detail in a netlister backend
+ <li> q6. * whether project file format is a custom format or just a top sch page referencing other sch pages - pcb-rnd is leading here, there is an optional project file format already defined, so this is more or less decided
+ <li> q7. attribute conventions
+</ul>
+
diff --git a/doc-rnd/devlog/20160126.html b/doc/devlog/20160126.html
similarity index 100%
rename from doc-rnd/devlog/20160126.html
rename to doc/devlog/20160126.html
diff --git a/doc-rnd/devlog/20160313_unglib.html b/doc/devlog/20160313_unglib.html
similarity index 100%
rename from doc-rnd/devlog/20160313_unglib.html
rename to doc/devlog/20160313_unglib.html
diff --git a/doc-rnd/devlog/20160314_valgrind_flex.html b/doc/devlog/20160314_valgrind_flex.html
similarity index 100%
rename from doc-rnd/devlog/20160314_valgrind_flex.html
rename to doc/devlog/20160314_valgrind_flex.html
diff --git a/doc-rnd/devlog/20160409.html b/doc/devlog/20160409.html
similarity index 100%
rename from doc-rnd/devlog/20160409.html
rename to doc/devlog/20160409.html
diff --git a/doc/devlog/20160409/header b/doc/devlog/20160409/header
new file mode 100644
index 0000000..90fe185
--- /dev/null
+++ b/doc/devlog/20160409/header
@@ -0,0 +1,7 @@
+1. Do you use the lesstif HID?
+2. If there were different menu resources files distributed with PCB, would you try them?
+3. Do you customize your menu resource file?
+4. If you do not customize your menu resource file, it's because
+5. Do you miss multi-key sequences from the GTK hid?
+6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?
+7. Vendor (drill) mapping also uses a resource file.
diff --git a/doc/devlog/20160409/header.csv b/doc/devlog/20160409/header.csv
new file mode 100644
index 0000000..5fc47fa
--- /dev/null
+++ b/doc/devlog/20160409/header.csv
@@ -0,0 +1 @@
+1. Do you use the lesstif HID?,2. If there were different menu resources files distributed with PCB, would you try them?,3. Do you customize your menu resource file?,4. If you do not customize your menu resource file, it's because,5. Do you miss multi-key sequences from the GTK hid?,6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?,7. Vendor (drill) mapping also uses a resource file.,
diff --git a/doc/devlog/20160409/legend.txt b/doc/devlog/20160409/legend.txt
new file mode 100644
index 0000000..9822fd6
--- /dev/null
+++ b/doc/devlog/20160409/legend.txt
@@ -0,0 +1,60 @@
+1. Do you use the lesstif HID? (select one)
+a. yes, exclusively
+b. yes, often
+c. sometimes, rarely
+d. never
+
+
+2. If there were different menu resources files distributed with PCB,
+would you try them? (select one)
+a. yes, I'd give each variant a try before deciding which one to use
+b. no, I'm fine with the default
+c. I don't know what a menu resource file is
+
+
+3. Do you customize your menu resource file? (select one)
+a. yes, always (e.g. I have an own variant I use with all installation of
+PCB)
+b. yes, sometimes, rarely (e.g. I once had to do something repeatedly and
+added a key binding for that)
+c. never, I know where I'd perform the changes if I ever needed
+them but defaults are good enough for now
+d. never, I don't know what a menu resource file is
+
+
+4. If you do not customize your menu resource file, it's because (select
+zero or more):
+a. I don't need to
+b. the file is too long
+c. too many keys are taken, it's hard to find a free one
+d. I don't like the format of the file
+e. I don't like the idea of editing text config files, I want a GUI for
+this
+f. I don't want to diverge from the default settings (e.g. because of
+potential hassle at a later upgrade)
+
+
+5. Do you miss multi-key sequences from the GTK hid? (select one)
+a. yes, I'd prefer to use them over modifiers (ctrl, alt, shift)
+b. yes, I'd use them together with the modifiers
+c. maybe I'd use some
+d. no, I prefer modifiers
+e. I hate the idea so much that I'd even disable it compile time if that
+was possible
+f. N/A, don't know
+
+
+6. If the GTK hid supported multi-key sequences, would that change any of
+your previous answers? (fill in zero or more with a letter)
+a. my new choice for 2. would be:
+b. my new choice for 3. would be:
+
+7. slightly off-topic: vendor (drill) mapping also uses a resource file.
+Do you use this feature? (select one)
+a. yes, often, many of my boards rely on vendor mapping and I maintain
+my own resource files per vendor
+b. yes, sometimes, rarely (e.g. I needed it once...)
+c. no, I know how to use it but never needed it
+d. no, I know the feature exists and I know where to look it up but I
+don't really know what exactly it can do or why I should bother
+e. no, I never heard about this feature
diff --git a/doc-rnd/devlog/20160409/pie_col_1.png b/doc/devlog/20160409/pie_col_1.png
similarity index 100%
rename from doc-rnd/devlog/20160409/pie_col_1.png
rename to doc/devlog/20160409/pie_col_1.png
diff --git a/doc-rnd/devlog/20160409/pie_col_2.png b/doc/devlog/20160409/pie_col_2.png
similarity index 100%
rename from doc-rnd/devlog/20160409/pie_col_2.png
rename to doc/devlog/20160409/pie_col_2.png
diff --git a/doc-rnd/devlog/20160409/pie_col_3.png b/doc/devlog/20160409/pie_col_3.png
similarity index 100%
rename from doc-rnd/devlog/20160409/pie_col_3.png
rename to doc/devlog/20160409/pie_col_3.png
diff --git a/doc-rnd/devlog/20160409/pie_col_4.png b/doc/devlog/20160409/pie_col_4.png
similarity index 100%
rename from doc-rnd/devlog/20160409/pie_col_4.png
rename to doc/devlog/20160409/pie_col_4.png
diff --git a/doc-rnd/devlog/20160409/pie_col_5.png b/doc/devlog/20160409/pie_col_5.png
similarity index 100%
rename from doc-rnd/devlog/20160409/pie_col_5.png
rename to doc/devlog/20160409/pie_col_5.png
diff --git a/doc-rnd/devlog/20160409/pie_col_7.png b/doc/devlog/20160409/pie_col_7.png
similarity index 100%
rename from doc-rnd/devlog/20160409/pie_col_7.png
rename to doc/devlog/20160409/pie_col_7.png
diff --git a/doc-rnd/devlog/20160409/poll.csv b/doc/devlog/20160409/poll.csv
similarity index 100%
rename from doc-rnd/devlog/20160409/poll.csv
rename to doc/devlog/20160409/poll.csv
diff --git a/doc/devlog/20160409/poll.html b/doc/devlog/20160409/poll.html
new file mode 100644
index 0000000..1203531
--- /dev/null
+++ b/doc/devlog/20160409/poll.html
@@ -0,0 +1,98 @@
+<html><body><table border=1>
+<tr>
+<th>1. Do you use the lesstif HID?
+<th>2. If there were different menu resources files distributed with PCB, would you try them?
+<th>3. Do you customize your menu resource file?
+<th>4. If you do not customize your menu resource file, it's because
+<th>5. Do you miss multi-key sequences from the GTK hid?
+<th>6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?
+<th>7. Vendor (drill) mapping also uses a resource file.
+<tr><td>a<td>a<td>a<td>-<td>-<td>-<td>c
+<tr><td>d<td>a<td>c<td>f<td>a<td>-<td>d
+<tr><td>b<td>a<td>b<td>-<td>c<td>-<td>c
+<tr><td>d<td>c<td>d<td>a+f<td>c<td>-<td>e
+<tr><td>d<td>b<td>c<td>a+f<td>b<td>-<td>b
+<tr><td>d<td>a<td>a<td>a<td>d<td>-<td>c
+<tr><td>-<td>a<td>c<td>-<td>a<td>-<td>-
+<tr><td>c<td>a<td>b<td>f<td>a<td>-<td>c
+<tr><td>c<td>a<td>c<td>-<td>a<td>-<td>-
+<tr>
+<td><img src="pie_col_1.png">
+<td><img src="pie_col_2.png">
+<td><img src="pie_col_3.png">
+<td><img src="pie_col_4.png">
+<td><img src="pie_col_5.png">
+<td>
+<td><img src="pie_col_7.png">
+</table>
+<p>
+<h3> Legend </h3>
+<pre>
+1. Do you use the lesstif HID? (select one)
+a. yes, exclusively
+b. yes, often
+c. sometimes, rarely
+d. never
+
+
+2. If there were different menu resources files distributed with PCB,
+would you try them? (select one)
+a. yes, I'd give each variant a try before deciding which one to use
+b. no, I'm fine with the default
+c. I don't know what a menu resource file is
+
+
+3. Do you customize your menu resource file? (select one)
+a. yes, always (e.g. I have an own variant I use with all installation of
+PCB)
+b. yes, sometimes, rarely (e.g. I once had to do something repeatedly and
+added a key binding for that)
+c. never, I know where I'd perform the changes if I ever needed
+them but defaults are good enough for now
+d. never, I don't know what a menu resource file is
+
+
+4. If you do not customize your menu resource file, it's because (select
+zero or more):
+a. I don't need to
+b. the file is too long
+c. too many keys are taken, it's hard to find a free one
+d. I don't like the format of the file
+e. I don't like the idea of editing text config files, I want a GUI for
+this
+f. I don't want to diverge from the default settings (e.g. because of
+potential hassle at a later upgrade)
+
+
+5. Do you miss multi-key sequences from the GTK hid? (select one)
+a. yes, I'd prefer to use them over modifiers (ctrl, alt, shift)
+b. yes, I'd use them together with the modifiers
+c. maybe I'd use some
+d. no, I prefer modifiers
+e. I hate the idea so much that I'd even disable it compile time if that
+was possible
+f. N/A, don't know
+
+
+6. If the GTK hid supported multi-key sequences, would that change any of
+your previous answers? (fill in zero or more with a letter)
+a. my new choice for 2. would be:
+b. my new choice for 3. would be:
+
+7. slightly off-topic: vendor (drill) mapping also uses a resource file.
+Do you use this feature? (select one)
+a. yes, often, many of my boards rely on vendor mapping and I maintain
+my own resource files per vendor
+b. yes, sometimes, rarely (e.g. I needed it once...)
+c. no, I know how to use it but never needed it
+d. no, I know the feature exists and I know where to look it up but I
+don't really know what exactly it can do or why I should bother
+e. no, I never heard about this feature
+</pre>
+<h3> Downloads </h3>
+<ul>
+ <li><a href="poll.csv"> csv data </a> | <a href="header.csv"> csv header </a>
+ <li><a href="poll.tsv"> tsv data </a> (raw, no header)
+ <li><a href="legend.txt"> legend </a>
+<ul>
+</body></html>
diff --git a/doc-rnd/devlog/20160409/poll.tsv b/doc/devlog/20160409/poll.tsv
similarity index 100%
rename from doc-rnd/devlog/20160409/poll.tsv
rename to doc/devlog/20160409/poll.tsv
diff --git a/doc-rnd/devlog/20160716_sprint.html b/doc/devlog/20160716_sprint.html
similarity index 100%
rename from doc-rnd/devlog/20160716_sprint.html
rename to doc/devlog/20160716_sprint.html
diff --git a/doc-rnd/devlog/20160802.html b/doc/devlog/20160802.html
similarity index 100%
rename from doc-rnd/devlog/20160802.html
rename to doc/devlog/20160802.html
diff --git a/doc-rnd/devlog/20160808_model.html b/doc/devlog/20160808_model.html
similarity index 100%
rename from doc-rnd/devlog/20160808_model.html
rename to doc/devlog/20160808_model.html
diff --git a/doc-rnd/devlog/20160823_lhtpers.html b/doc/devlog/20160823_lhtpers.html
similarity index 100%
rename from doc-rnd/devlog/20160823_lhtpers.html
rename to doc/devlog/20160823_lhtpers.html
diff --git a/doc/devlog/20160826_virtusers.html b/doc/devlog/20160826_virtusers.html
new file mode 100644
index 0000000..557fe29
--- /dev/null
+++ b/doc/devlog/20160826_virtusers.html
@@ -0,0 +1,65 @@
+<html>
+<body>
+<h1> pcb-rnd <a href="http://repo.hu/projects/pcb-rnd/devlog">devlog</a> </h1>
+
+<H2> Offer vs. pull (virtual users vs. active users) </H2>
+Pcb-rnd has an pulled-by-users policy on deciding what features to implement.
+Below I try to explain how we ended up using this policy.
+
+<h3> Past: offer, virtual users </H3>
+
+When I started pcb-rnd, although I published it, I didn't think anyone else
+would use it. It was just about having mainline with different default
+settings.
+<p>
+Later on I added a few features, and pcb-rnd slowly became much more than
+just different defaults. I felt other users may find the new features useful,
+so I had <i>put</i> it on offer: advertised the repository. I thought users
+would download and try the software. Judging from the feedback, they didn't. I
+didn't mind, because I was working on features I needed, to get pcb-rnd do what
+I wanted: I was my own target audience and anyone else trying pcb-rnd could
+only be a side effect. Until when I ran out of features because it already
+had everything I needed.
+<p>
+The next step was to implement features for other users. Between summer
+of 2015 and summer of 2016, I tried to be a bit more proactive: made
+public polls to map what users needed and tried to focus implementing
+those features. This did not bring too many users either.
+<p>
+This was when I realized what was really happening: I was <i>offering</i>
+features for <i>virtual</i> users, addressing my communication to the wide
+audience. Noone really felt it was for him. Even if he was complaining about
+a missing feature in pcb and a few days later I announced the fix in pcb-rnd, it
+was not specifically for him, but for the Greater Good.
+<p>
+Virtual users nearly never became real users. My conclusion was that there
+was no point in implementing features for virtual users as noone ever would
+use those features.
+
+<h3> Present: pull, active users </H3>
+Mid summer 2016, I switched strategy. Instead of polling the crowd, I picked
+a few users with known feature requests and asked them if they were willing to
+test pcb-rnd if I implemented their feature. More than half of them said yes
+and many of them got hooked up. They all became productive, active members
+of the pcb-rnd community.
+<p>
+Learning from this experience, the new strategy of pcb-rnd is as follows:
+<ul>
+ <li> pull instead of offer: do not hope a new feature would attract users,
+ rather arrange active users who then pull the project with their
+ feature requests;
+ <li> do not invest too much time in anything that is not currently pulled
+ by actual, existing, active users; rather invest that time in fulfilling
+ the needs of already existing users
+ <li> reaching 100 users with an average of 0.1% activity will result in
+ 0 active users whereas reaching only 10 users with 30% activity
+ will result in 3 active users; thus a small active community around
+ pcb-rnd is more efficient than the much larger geda community;
+ <li> users really appreciate fast response on bugreports and feature requests.
+ Instead of trying to impress virtual users, rather keep already interested
+ users happy.
+</ul>
+
+
+
+
diff --git a/doc-rnd/devlog/20160921_gl.html b/doc/devlog/20160921_gl.html
similarity index 100%
rename from doc-rnd/devlog/20160921_gl.html
rename to doc/devlog/20160921_gl.html
diff --git a/doc-rnd/devlog/20161014_cleanup.html b/doc/devlog/20161014_cleanup.html
similarity index 100%
rename from doc-rnd/devlog/20161014_cleanup.html
rename to doc/devlog/20161014_cleanup.html
diff --git a/doc-rnd/devlog/20162601/header b/doc/devlog/20162601/header
similarity index 100%
rename from doc-rnd/devlog/20162601/header
rename to doc/devlog/20162601/header
diff --git a/doc-rnd/devlog/20162601/header.csv b/doc/devlog/20162601/header.csv
similarity index 100%
rename from doc-rnd/devlog/20162601/header.csv
rename to doc/devlog/20162601/header.csv
diff --git a/doc-rnd/devlog/20162601/poll.csv b/doc/devlog/20162601/poll.csv
similarity index 100%
rename from doc-rnd/devlog/20162601/poll.csv
rename to doc/devlog/20162601/poll.csv
diff --git a/doc-rnd/devlog/20162601/poll.html b/doc/devlog/20162601/poll.html
similarity index 100%
rename from doc-rnd/devlog/20162601/poll.html
rename to doc/devlog/20162601/poll.html
diff --git a/doc-rnd/devlog/20162601/poll.tsv b/doc/devlog/20162601/poll.tsv
similarity index 100%
rename from doc-rnd/devlog/20162601/poll.tsv
rename to doc/devlog/20162601/poll.tsv
diff --git a/doc-rnd/devlog/poll_common/gencsv.sh b/doc/devlog/poll_common/gencsv.sh
similarity index 100%
rename from doc-rnd/devlog/poll_common/gencsv.sh
rename to doc/devlog/poll_common/gencsv.sh
diff --git a/doc-rnd/devlog/poll_common/genhtml.sh b/doc/devlog/poll_common/genhtml.sh
similarity index 100%
rename from doc-rnd/devlog/poll_common/genhtml.sh
rename to doc/devlog/poll_common/genhtml.sh
diff --git a/doc-rnd/devlog/poll_common/genpie.sh b/doc/devlog/poll_common/genpie.sh
similarity index 100%
rename from doc-rnd/devlog/poll_common/genpie.sh
rename to doc/devlog/poll_common/genpie.sh
diff --git a/doc-rnd/devlog/res/20150830b_annot.dot b/doc/devlog/res/20150830b_annot.dot
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_annot.dot
rename to doc/devlog/res/20150830b_annot.dot
diff --git a/doc-rnd/devlog/res/20150830b_annot.png b/doc/devlog/res/20150830b_annot.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_annot.png
rename to doc/devlog/res/20150830b_annot.png
diff --git a/doc-rnd/devlog/res/20150830b_s0.png b/doc/devlog/res/20150830b_s0.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s0.png
rename to doc/devlog/res/20150830b_s0.png
diff --git a/doc-rnd/devlog/res/20150830b_s1.png b/doc/devlog/res/20150830b_s1.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s1.png
rename to doc/devlog/res/20150830b_s1.png
diff --git a/doc-rnd/devlog/res/20150830b_s2.png b/doc/devlog/res/20150830b_s2.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s2.png
rename to doc/devlog/res/20150830b_s2.png
diff --git a/doc-rnd/devlog/res/20150830b_s3.png b/doc/devlog/res/20150830b_s3.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s3.png
rename to doc/devlog/res/20150830b_s3.png
diff --git a/doc-rnd/devlog/res/20150830b_s4.png b/doc/devlog/res/20150830b_s4.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s4.png
rename to doc/devlog/res/20150830b_s4.png
diff --git a/doc-rnd/devlog/res/20150830b_s5.png b/doc/devlog/res/20150830b_s5.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s5.png
rename to doc/devlog/res/20150830b_s5.png
diff --git a/doc-rnd/devlog/res/20150830b_s6.png b/doc/devlog/res/20150830b_s6.png
similarity index 100%
rename from doc-rnd/devlog/res/20150830b_s6.png
rename to doc/devlog/res/20150830b_s6.png
diff --git a/doc-rnd/devlog/res/Makefile b/doc/devlog/res/Makefile
similarity index 100%
rename from doc-rnd/devlog/res/Makefile
rename to doc/devlog/res/Makefile
diff --git a/doc/doc.html b/doc/doc.html
new file mode 100644
index 0000000..c1cc027
--- /dev/null
+++ b/doc/doc.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - news </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<br>
+<!--content-->
+<h1> pcb-rnd documentation </h1>
+
+<ul>
+ <li> <a href="user/index.html"> user manual (work in progress) </a>
+ <li> <a href="developer/"> developer's corner </a>
+ <li> <a href="features/index.html"> feature summary (comparison to gEDA/PCB) </a>
+ <li> <a href="devlog/"> developer's log </a>
+</ul>
+
+</body>
+</html>
diff --git a/doc/features/ba.html b/doc/features/ba.html
new file mode 100644
index 0000000..b2edff5
--- /dev/null
+++ b/doc/features/ba.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - back annotation </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [ba] patches </h1>
+Back annotation was a long standing missing functionality. There has been
+different suggestions, including:
+<ul>
+ <li> back annotation is not needed at all, the user can do it manually
+ <li> pcb should generate a new netlist, the user should run diff on the netlists and manually edit the schematics
+ <li> gschem should be able to load netlists emitted by PCB; or gnetlist could reverse-process such a netlist
+</ul>
+<p>
+The current implementation allows pcb-rnd users to make deliberate pin
+swapping and footprint replacement. The changes can be saved in a
+"netlist patch" format. A modified gschem can load these and present them
+as search results pointing to parts of the schematics that need to be changed.
+There is a <a href="https://archive.org/details/pcb-rnd-back-annotation">
+demo video </a> about how this happens in practice.
+<p>
+The modified gschem can be checked out from svn://repo.hu/geda-gaf-ba/trunk
+<p>
+The underlying mechanism is versatile and potentially allows more changes
+to be back annotated. These are not yet accessible due to the lack of PCB
+actions and GUI.
+
+<h2> Design decisions </h2>
+This <a href="../devlog/20150830b_back_ann.html"> devlog </a> entry functions
+as a design decision document.
+<a href="../devlog/20150901a_back_ann.html"> Another entry </a> is a summary
+on how the feature ended up in a private feature-fork of gschem.
+
+<h2> save/load and compatibility </h2>
+Deliberate changes are tracked so that a new forward annotation from
+the old schematics won't break them. To do this, pcb-rnd saves a
+NetListPatch() section in the file. Mainline PCB can not handle this section.
+Compatibility, by use case:
+<ul>
+ <li> 1. No back annotation is made in pcb-rnd: the file <b>stays compatible</b>
+ <li> 2. Back annotation is made in pcb-rnd, then the changes are done on the schematics and a forward annotation is also done: the netlist patch in pcb-rnd becomes empty so the pcb file is <b>again compatible</b> with mainline pcb; this is called resolution of netlist patches
+ <li> 3. There are unresolved netlist patches saved in pcb-rnd and the user attempts to load the pcb file in mainline pcb: <b>syntax error</b> (but no data loss); solution: resolve the netlist patch as described in point 2.
+ <li> 4. Cheat for situation 3.: manually remove the NetListPatch() section from the save file. This way the back annotation info is lost, but mainline pcb can load the file again. This action is sort of "revert back annotation".
+ <li> 5. Any file saved by mainline PCB can be opened by pcb-rnd, back annotation does not affect that.
+
+</ul>
+
+
+<h2> plans </h2>
+Back annotation for further changes, e.g. value change, naming/renaming nets,
+etc.
+</body>
+</html>
diff --git a/doc/features/cycdrag.html b/doc/features/cycdrag.html
new file mode 100644
index 0000000..353881e
--- /dev/null
+++ b/doc/features/cycdrag.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [cycdrag] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [cycdrag] patches </h1>
+
+A long standing misfeature of pcb (and pcb-rnd) has been that when dragging the
+end of connected traces, pcb chosen one of the traces "randomly". It often
+didn't pick the one the user wanted to move. The workaround was to move the
+one that pcb picked and then return and move the target trace then
+move the other trace back. This gets even more annoying if there are more than
+two objects connected in the given point: 3 traces and a via for example.
+<p>
+The cycdrag patch addresses this issue by defining an action that can cycle
+through objects that could be dragged in the given point while the left mouse
+button is pressed. This lets the user explicitly select the one object to
+work on.
+<p>
+This <a href="https://archive.org/details/pcb-rnd-cycdrag"> demo video </a>
+demonstrates how it works with three lines and a via.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+It does not work with the lesstif HID. It does not work with the rubber band
+mode.
+
+</body>
+</html>
diff --git a/doc/features/debian.html b/doc/features/debian.html
new file mode 100644
index 0000000..20d9e74
--- /dev/null
+++ b/doc/features/debian.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [debian] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [debian] patch </h1>
+
+Our new goal is to get official Debian packages in Debian testing. The old,
+home grown packaging is already removed to ease the official packaging, but
+the official packages are not yet available. Please be patient.
+<p>
+The previous, obsolete packaging was:
+<p>
+<font size="-4">
+Our current Debian packaging reflects the modularity of pcb-rnd: it has
+most plugins in separate packages. The main package is called
+<b>pcb-rnd-core</b>: this provides the executable and the footprint library
+and the batch HID. The GUI HIDs are in <b>pcb-rnd-gtk</b> and
+<b>pcb-rnd-lesstif</b> - it's possible to install neither, either or both.
+When there are multiple HIDs installed, the user can select one by the
+--gui command line parameter or by changing the GUI preference in the
+configuration (the default preference is gtk > lesstif > batch).
+<p>
+The rest of the packages are features, importers and exporters, e.g.
+<b>pcb-rnd-svg</b> is the SVG exporter, <b>pcb-rnd-query</b> is the object
+query language needed for the advanced search.
+<p>
+A metapackage called <b>pcb-rnd</b> is provided for convenience: it installs
+the packages for the most common, yet small setup, with the GTK HID.
+<p>
+How to get the packages:
+<ul>
+ <li> decide which packages you need; this <a href="debian_list.html"> package list </a> may help
+ <li> use <i>apt-get install</i> after configuring <a href="http://repo.hu/debian"> repo.hu's debian repository </a> as source in your /etc/apt/sources.list
+ <li> use <i>dpkg -i</i> after manually downloading the packages from repo.hu's <a href="http://repo.hu/debian/list.html"> flat package list </a> or from <a href="http://repo.hu/debian/pool/main/p/pcb-rnd"> the package pool </a>
+ <li> build them on your Debian box: use svn trunk, install debhelper and all the build dependencies of pcb-rnd and run "fakeroot debian/rules binary" in trunk (shorthand: "make deb")
+</ul>
+</font>
+
+<h2> plans </h2>
+No plans - this feature is fully implemented.
+</body>
+</html>
diff --git a/doc/features/debian_list.html b/doc/features/debian_list.html
new file mode 100644
index 0000000..3c41741
--- /dev/null
+++ b/doc/features/debian_list.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<!-- THIS FILE IS GENERATED BY deblist.sh, DO NOT EDIT -->
+<head>
+ <title> pcb-rnd - Debian package list </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - Debian package list </h1>
+<table border=1 cellspacing=0>
+<tr><th>name <th> internal dependencies <th> description
+
+<tr><td><b>pcb-rnd</b><td> pcb-rnd-core, pcb-rnd-gtk, pcb-rnd-gerber, pcb-rnd-lpr, pcb-rnd-png, pcb-rnd-propedit, pcb-rnd-query, pcb-rnd-report, pcb-rnd-svg, pcb-rnd-xy<td> pcb-rnd is load/save compatible with gEDA/PCB and kicad and offers various auxiliary import/export formats.<p> This metapackage installs the core and the most commonly used set of plugins.
+<tr><td><b>pcb-rnd-core</b><td> <td> This package contains the core program. Most functionality, including the GUI frontend, is in the corresponding plugin package.
+<tr><td><b>pcb-rnd-gtk</b><td> pcb-rnd-core<td> This package contains the GTK+ user-interface for pcb-rnd.
+<tr><td><b>pcb-rnd-lesstif</b><td> pcb-rnd-core<td> This package contains the Lesstif/Motif user-interface for pcb-rnd.
+<tr><td><b>pcb-rnd-autocrop</b><td> pcb-rnd-core<td> This package provides the autocrop feature that can resize the board to minimum around all the existing objects.
+<tr><td><b>pcb-rnd-autoplace</b><td> pcb-rnd-core<td> This package provides the autoplace feature used to place elements automatically and offers two different algorithms to do so.
+<tr><td><b>pcb-rnd-autoroute</b><td> pcb-rnd-core<td> This package provides the classic gEDA/pcb autorouter.
+<tr><td><b>pcb-rnd-diag</b><td> pcb-rnd-core<td> This package provides actions for debugging/diagnostic purposes. This feature may be needed for reporting bugs.
+<tr><td><b>pcb-rnd-distalign</b><td> pcb-rnd-core<td> This package provides actions for arranging elements in an array.
+<tr><td><b>pcb-rnd-distaligntext</b><td> pcb-rnd-core<td> This package provides actions for arranging text objects in an array.
+<tr><td><b>pcb-rnd-djopt</b><td> pcb-rnd-core<td> This package provides actions to clean up (optimize) tracks. It is especially useful after autorouting.
+<tr><td><b>pcb-rnd-gcode</b><td> pcb-rnd-core<td> This package allows exporting the design to gcode, useful for CNC milling.
+<tr><td><b>pcb-rnd-gerber</b><td> pcb-rnd-core<td> This package allows exporting the design to gerber, accepted by most PCB fab houses.
+<tr><td><b>pcb-rnd-lpr</b><td> pcb-rnd-core<td> This package allows printing directly from the GUI, using lpr.
+<tr><td><b>pcb-rnd-nelma</b><td> pcb-rnd-core<td> This package allows exporting the design to nelma, for numerical capacitance calculation (via external tool)
+<tr><td><b>pcb-rnd-png</b><td> pcb-rnd-core<td> This package allows exporting the design in various bitmap formats, including png and jpeg.
+<tr><td><b>pcb-rnd-svg</b><td> pcb-rnd-core<td> This package allows exporting the design in SVG, the Scalable Vector Graphics format. It is useful for publishing the design on the web.
+<tr><td><b>pcb-rnd-xy</b><td> pcb-rnd-core<td> This package allows exporting the design in XY, suitable for pick∧place machines.
+<tr><td><b>pcb-rnd-fontmode</b><td> pcb-rnd-core<td> This package lets the user to turn the GUI into a PCB font editor.
+<tr><td><b>pcb-rnd-fp-wget</b><td> pcb-rnd-core<td> This package provides a wget based footprint accessor, which allows integrating web directories of footprints in the library. The only currently supported site is gedasymbols.org.
+<tr><td><b>pcb-rnd-edif</b><td> pcb-rnd-core<td> This package allows pcb-rnd to import netlists in the EDIF format.
+<tr><td><b>pcb-rnd-mincut</b><td> pcb-rnd-core<td> This package upgrades the indication of short circuits: instead of highlighting two random pins/pads, it tries to determine the minimal-cut that would resolve the short. In practice this means it makes a suggestion where to cut the networks to remove the short circuit.
+<tr><td><b>pcb-rnd-oldactions</b><td> pcb-rnd-core<td> This package provides some old user actions. These are not used daily anymore, but some old actions scripts may still depend on them.
+<tr><td><b>pcb-rnd-polycombine</b><td> pcb-rnd-core<td> This package provides actions to combine (merge) multiple polygons into a single, more complex polygon.
+<tr><td><b>pcb-rnd-propedit</b><td> pcb-rnd-core<td> This package provides the property editor function for the GUI. The property editor collects all properties and attributes of all selected objects in a table and allows the user to change them.
+<tr><td><b>pcb-rnd-puller</b><td> pcb-rnd-core<td> This package provides actions to "pull" tracks, minimizing their length.
+<tr><td><b>pcb-rnd-query</b><td> pcb-rnd-core<td> This package provides the query language used in the advanced search on the GUI.
+<tr><td><b>pcb-rnd-renumber</b><td> pcb-rnd-core<td> This package provides various actions to automatically renumber elements on the design. These actions change the refdes of some (or all) elements.
+<tr><td><b>pcb-rnd-report</b><td> pcb-rnd-core<td> This package used to provide the report action that displays basic information about design objects. Unlike propedit, report does not allow the user to manipulate any of the data reported.<p> At the moment report is compiled into the core, this package is kept for compatibility and placeholder.
+<tr><td><b>pcb-rnd-shand-cmd</b><td> pcb-rnd-core<td> This package provides 1..2 character long shorthands for the most commonly used core commands.
+<tr><td><b>pcb-rnd-smartdisperse</b><td> pcb-rnd-core<td> This package implements a smart algorithm to disperse elements. It is useful after importing a new design from the schematics. It is an alternative to autoplace.
+<tr><td><b>pcb-rnd-stroke</b><td> pcb-rnd-core, pcb-rnd-gtk<td> This package implements mouse gestures using libstroke.
+<tr><td><b>pcb-rnd-teardrops</b><td> pcb-rnd-core<td> This package embeds each pin in a teardrop drawn from multiple arcs. May be useful for toner-transfer boards.
+<tr><td><b>pcb-rnd-vendordrill</b><td> pcb-rnd-core<td> This package provides vendor drill mapping and vendor specific design rule application.
+<tr><td><b>pcb-rnd-kicad</b><td> pcb-rnd-core<td> This package allows pcb-rnd to load and save in kicad's s-expression based (new) file format.
+<tr><td><b>pcb-rnd-gsch2pcb</b><td> <td> This package provides the external tool gsch2pcb-rnd that can convert a gschem schematics to files that can be imported in pcb-rnd.
+
+</table>
+
diff --git a/doc/features/dynstyle.html b/doc/features/dynstyle.html
new file mode 100644
index 0000000..bc8a8c4
--- /dev/null
+++ b/doc/features/dynstyle.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [dynstyle] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [dynstyle] patch </h1>
+
+Pcb-rnd doesn't have a hardwired limit on number of routing styles
+anymore. Routing styles can be created on the fly and are saved to and loaded
+from .pcb files.
+<p>
+There's no theoretical maximum explicitly set either. An implicit maximum
+exists and is sizeof(int) - should be at least 2^31 on most systems.
+
+<h2> save/load and compatibility </h2>
+The first 4 styles are loaded and preserved by mainline. Styles above
+4 would probably be deleted in a mainline load-save cycle. The number 4
+is a constant value that can be changed if mainline is recompiled.
+
+<h2> plans </h2>
+GUI HID representation of styles (especially in menus) need more testing.
+</body>
+</html>
diff --git a/doc/features/flagcomp.html b/doc/features/flagcomp.html
new file mode 100644
index 0000000..f2cb84b
--- /dev/null
+++ b/doc/features/flagcomp.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [flagcomp] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [flagcomp] patch </h1>
+
+Many of the patches in this fork, and in possible future branches/forks
+may introduce new pin, pad or element flags. PCB loads and saves flags
+by converting the text representation to an in-memory binary format. Any
+flag not understood is lost.
+<p>
+This patch adds a linked list of string flags, filled in with the unknown
+flags while loading a PCB. On save, these flags are appended to the normal
+flag list. This preserves all unknown flags (but not order of flags) in
+a load/save cycle.
+
+<h2> save/load and compatibility </h2>
+This patch ensures compatibility in save/load cycles with flags introduced
+by later versions of mainline PCB or different branches/forks of PCB by
+not removing flags they introduced.
+
+<h2> plans </h2>
+No plans - this feature is fully implemented.
+</body>
+</html>
diff --git a/doc/features/fp_wget.html b/doc/features/fp_wget.html
new file mode 100644
index 0000000..c7badae
--- /dev/null
+++ b/doc/features/fp_wget.html
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [fp_wget] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [fp_wget] patch </h1>
+
+Since version 1.0.10, pcb-rnd implements a new footprint mechanism (see
+<a href="pcblib.html">[fp_fs]</a> and <a href="library_t.html">[library_t]</a>).
+The new code allows footprint backend plugins to get library from anywhere.
+The [fp_wget] plugin is an implementation that:
+<ul>
+ <li> downloads a library list from the web on startup into a local cache
+ <li> downloads footprints from the web on-demand into a local cache
+</ul>
+<p>
+This is all transparent, the user experience is that the remote library is
+like a read-only local library reachable from the library window.
+<p>
+A web site used as a library should be able to:
+<ul>
+ <li> generate a plain text list of all footprints available
+ <li> return the raw footprint file by name
+</ul>
+<p>
+The plugin uses external program <i>wget</i> to communicate on the web.
+
+
+<h3> How to configure for gedasymbols.org </h3>
+Add wget at gedasymbols in the library search path (e.g. in preferences as library-newlib).
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Better feedback on progress, explicit user requested refresh, refresh in
+the background.
+
+</body>
+</html>
diff --git a/doc/features/fullscreen.html b/doc/features/fullscreen.html
new file mode 100644
index 0000000..d0dfb59
--- /dev/null
+++ b/doc/features/fullscreen.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - full screen gtk </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - full screen gtk </h1>
+On small screen the overhead of the menu line, bottom status line and left
+layer selection bar is just too expensive. Since 1.1.2, the gtk hid can
+be switched between the usual setup and a so called "full screen mode"
+where most widgets are hidden, leaving much more screen space to the
+editor widget. There's a FullScreen() action that can set or toggle
+the state and a default key binding in gtk on the backslash ('\') to
+toggle it.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Make hiding various parts of the GUI configurable. No plans to implement
+it for the lesstif HID.
+
+</body>
+</html>
diff --git a/doc/features/gpmi.html b/doc/features/gpmi.html
new file mode 100644
index 0000000..a4ff3f9
--- /dev/null
+++ b/doc/features/gpmi.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [gpmi] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [gpmi] patch </h1>
+
+Thanks to gpmi, pcb-rnd is scriptable in about 10 scripting languages (e.g.
+lua, awk, ruby, python, scheme, tcl). Scripts are integrated in pcb-rnd and
+have access to most of the internals. Scripts
+are able to:
+ <ul>
+ <li> register new actions
+ <li> create new menus and submenus
+ <li> execute existing actions
+ <li> pop up simple dialog boxes (message, report, progress bar, file selection) -- <a href="https://archive.org/details/Pcb-rndCarcScript"> check out the video </a>
+ <li> build and pop up custom dialog boxes (so called <i>attribute dialogs</i>)
+ <li> search for objects (lines, arc, polys, vias, etc.) on the layout
+ <li> change and move existing objects on the layout
+ <li> create new objects on the layout
+ <li> change "page" properties (dimensions of the board)
+ <li> debug draw on the gui (slightly broken on gtk due to some gtk hid bugs)
+ </ul>
+<p>
+This feature has three options:
+<ul>
+ <li> <i>disabled</i>: not compiled at all - when gpmi is not installed (no gpmi scripting in PCB)
+ <li> <i>buildin</i>: compiled and linked in the executable - pcb-rnd always can load and run scripts
+ <li> <i>plugin</i>: compiled as a loadable plugin - pcb-rnd can load and run scripts if the plugin is installed
+</ul>
+
+<h3> Example </h3>
+Check out <a href="../user/06_feature/gpmi/rosetta/index.html">the Rosetta stone </a> of
+pcb-rnd.
+
+<h2> save/load and compatibility </h2>
+Save/load files are not affected.
+
+<h2> plans </h2>
+Expose more internals, write more example scripts and documentation.
+
+</body>
+</html>
diff --git a/doc/features/grid.html b/doc/features/grid.html
new file mode 100644
index 0000000..5266d94
--- /dev/null
+++ b/doc/features/grid.html
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - gtk grid fixes </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - gtk grid fixes </h1>
+
+<h2> Problem with the original gtk grid </h2>
+
+The original code draws every grid point on screen, even the ones that are
+off the board. When the user zooms out with a dense grid, it can become too
+dense - the original code turns the grid off in this case.
+<p>
+If the grid is very dense, on a large screen the software render may slow down.
+This is noticeable in pan and zoom mostly. The bottleneck is the gtk call
+that draws the grid points: if there are too many of them, it's slow.
+
+
+<h2> New grid </h2>
+
+To overcome this problem, pcb-rnd offers configuration settings to limit
+the number of dots to be drawn. There are mainly two parallel approaches:
+using a <i>local grid</i> or draw less dots in a <i>global grid</i>. The
+old code defined only a global grid and did not have runtime settings for
+the properties of the grid.
+<p>
+There's a new "Grid properties" submenu in the view menu in the default
+gtk hid menu file. Screenshots were taken with this menu teared-down to
+demonstrate the settings.
+
+<h3> Global grid improvements </h3>
+
+The most trivial optimization is that grid points off the board are simply
+not drawn:
+<p>
+<img src="grid_edge.png" alt="[screenshot showing of grid]">
+<p>
+Next, the compile-time configurable "minimum distance between grid points
+before it is too dense" setting is user configurable now. The default value
+can be changed in any of the usual
+<a href="../conf/sources.html">configuration sources</a>. However,
+when the configured density is reached while zooming out, there are two options.
+<p>
+The first, default option is to do the same that the original code did: just
+hide the grid:
+<p>
+<img src="grid_global_nosparse.png" alt="[screenshot with grid option menu]">
+<p>
+An alternative is to use <i>sparse global grid</i> which means only
+every 2nd, 3rd, 4th, ... Nth grid point is drawn. The cursor still snaps
+to every real grid point, so the grid got sparse only on the display. Note
+how the line is drawn on invisible grid points:
+<p>
+<img src="grid_global_sparse.png" alt="[screenshot with grid option menu]">
+
+<h3> Introduction of the local grid </h3>
+Another approach is to use a local grid. The grid helps finding whether
+existing objects are aligned or where the next move/click would end up.
+These are usually interesting only in a small range around the crosshair and
+less interesting on the other end of the board. Local grid draws the grid
+points only near the crosshair. Such local grid follows the crosshair
+everywhere:
+<p>
+<img src="grid_local_4.png" alt="[screenshot with grid option menu]">
+<p>
+The user can configure or interactively set the radius in which the grid
+points are drawn:
+<p>
+<img src="grid_local_16.png" alt="[screenshot with grid option menu]">
+<p>
+The radius is given in "number of grid points", thus the local grid yields
+a constant number of points that is independent of the actual grid size. When
+a local grid gets too dense, it is hidden - there's no sparse option, since
+local grids usually have too few points to make reasonable skips.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+This feature is gtk-specific and is complete. There are no plans to
+implement this in the lesstif HID at the moment.
+
+</body>
+</html>
diff --git a/doc-rnd/features/grid_edge.png b/doc/features/grid_edge.png
similarity index 100%
rename from doc-rnd/features/grid_edge.png
rename to doc/features/grid_edge.png
diff --git a/doc-rnd/features/grid_global_nosparse.png b/doc/features/grid_global_nosparse.png
similarity index 100%
rename from doc-rnd/features/grid_global_nosparse.png
rename to doc/features/grid_global_nosparse.png
diff --git a/doc-rnd/features/grid_global_sparse.png b/doc/features/grid_global_sparse.png
similarity index 100%
rename from doc-rnd/features/grid_global_sparse.png
rename to doc/features/grid_global_sparse.png
diff --git a/doc-rnd/features/grid_local_16.png b/doc/features/grid_local_16.png
similarity index 100%
rename from doc-rnd/features/grid_local_16.png
rename to doc/features/grid_local_16.png
diff --git a/doc-rnd/features/grid_local_4.png b/doc/features/grid_local_4.png
similarity index 100%
rename from doc-rnd/features/grid_local_4.png
rename to doc/features/grid_local_4.png
diff --git a/doc/features/index.html b/doc/features/index.html
new file mode 100644
index 0000000..e910a39
--- /dev/null
+++ b/doc/features/index.html
@@ -0,0 +1,63 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - features </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd </h1>
+<h2> Change summary, per topic </H2>
+<table border=1 cellspacing=0 cellpadding=5>
+<tr><th bgcolor="#eeeeee">commit message tag and doc<th bgcolor="#eeeeee">description
+<tr><td bgcolor="#ccccff"><a href="gpmi.html">[gpmi]</a> <td bgcolor="#ddddff"> scripting PCB (including GUI dialogs, actions, menus, changing the layout)
+<tr><td bgcolor="#ccccff"><a href="intconn.html">[intconn]</a> <td bgcolor="#ddddff"> component internal connections
+<tr><td bgcolor="#ccccff"><a href="nonetlist.html">[nonetlist]</a> <td bgcolor="#ddddff"> components that are not part of the netlist and should not cause shorts
+<tr><td bgcolor="#ccccff"><a href="tostyle.html">[tostyle]</a> <td bgcolor="#ddddff"> actions, menu and hotkey to change ring dia, line width, drill dia and clearance sizes to match the values defined for the current routing style
+<tr><td bgcolor="#ccccff"><a href="mincut.html">[mincut]</a> <td bgcolor="#ddddff"> minimal cut based warnings on shorts
+<tr><td bgcolor="#ccccff"><a href="square.html">[square]</a> <td bgcolor="#ddddff"> change square pad to a generic shaped-pin based on the octagon pin code - this is an alternative to teardrops
+<tr><td bgcolor="#ccccff"><a href="flagcomp.html">[flagcomp]</a> <td bgcolor="#ddddff"> unknown flag compatibility
+<tr><td bgcolor="#ccccff"><a href="scconfig.html">[scconfig]</a> <td bgcolor="#ddddff"> use scconfig instead of autotools
+<tr><td bgcolor="#ccccff"><a href="pcb-fp.html">[pcb-fp]</a> <td bgcolor="#ddddff"> generic parametric footprints; on-the-fly footprint generation by external tools written in any language (remove m4 hardwirings)
+<tr><td bgcolor="#ccccff"><a href="pcblib.html">[pcblib], [fp_fs],
+ [pcblib-param]</a> <td bgcolor="#ddddff"> clean up the footprint library shipped
+<tr><td bgcolor="#ccccff"><a href="library_t.html">[library_t]</a> <td bgcolor="#ddddff"> footprint library is an arbitrary tree instead of a special, 2 level tree
+<tr><td bgcolor="#ccccff"><a href="fp_wget.html">[fp_wget]</a> <td bgcolor="#ddddff"> web based footprint libraries, integration of gedasymbols.org
+<tr><td bgcolor="#ccccff"><a href="res.html">[res]</a> <td bgcolor="#ddddff"> replace resource files with lihata and enable multi-key hotkeys in both gtk and lesstif hids
+<tr><td bgcolor="#ccccff"><a href="debian.html">[debian]</a> <td bgcolor="#ddddff"> Debian packaging the binaries configured to my own taste
+<tr><td bgcolor="#ccccff"><a href="ba.html">[ba]</a> <td bgcolor="#ddddff"> back annotation
+<tr><td bgcolor="#ccccff"><a href="onpoint.html">[onpoint]</a> <td bgcolor="#ddddff"> on-point by Robert Drehmel
+<tr><td bgcolor="#ccccff"><a href="cycdrag.html">[cycdrag]</a> <td bgcolor="#ddddff"> cycle drag; with additional feature: <a href="negselect.html"> negative box select </a>
+<tr><td bgcolor="#ccccff"><a href="../developer/mods3/">[mods]</a> <td bgcolor="#ddddff"> modularize the code to reduce core size - for comparison
+<tr><td bgcolor="#ccccff"><a href="unglib.html">[unglib]</a> <td bgcolor="#ddddff"> remove glib dependency from core
+<tr><td bgcolor="#ccccff"><a href="io.html">[io_*]</a> <td bgcolor="#ddddff"> .pcb and .fp file format plugins
+<tr><td bgcolor="#ccccff"><a href="dynstyle.html">[dynstyle]</a> <td bgcolor="#ddddff"> dynamic routing style: support more than 4 of them - with no limit
+<tr><td bgcolor="#ccccff"><a href="../conf/index.html">[conf]</a> <td bgcolor="#ddddff"> new, unified, config file system
+<tr><td bgcolor="#ccccff"><a href="propedit.html">[propedit]</a> <td bgcolor="#ddddff"> property/attribute editor (gtk)
+<tr><td bgcolor="#ccccff"><a href="oldplugins.html">[oldplugins]</a> <td bgcolor="#ddddff"> import old PCB plugins
+<tr><td bgcolor="#ccccff"><a href="query.html">[query]</a> <td bgcolor="#ddddff"> query language
+<tr><td bgcolor="#ccccff"><a href="routings.html">routing styles</a> <td bgcolor="#ddddff"> routing style fixes
+<tr><td bgcolor="#ccccff"><a href="grid.html">(gtk grid)</a> <td bgcolor="#ddddff"> gtk grid improvements: sparse global grids, local grids
+<tr><td bgcolor="#ccccff"><a href="fullscreen.html">(full screen)</a><td bgcolor="#ddddff"> gtk full screen edit mode
+<tr><td bgcolor="#ccccff"><a href="settings.html">(settings)</a> <td bgcolor="#ddddff"> minor changes in default settings
+
+
+<!--<tr><td><a href="polygrid.html">[polygrid]</a> <td> ps output: an option to draw grids in polygons instead of filling them -->
+</table>
+
+</body>
+</html>
diff --git a/doc/features/intconn.html b/doc/features/intconn.html
new file mode 100644
index 0000000..d06be8b
--- /dev/null
+++ b/doc/features/intconn.html
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [intconn] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [intconn] patch </h1>
+
+There are parts with internal connections (e.g. pin 2 and 4 of a SO8
+package are internally connected). Mainline PCB can not handle this,
+leaving the following options:
+<ul>
+ <li> connect both pins to the net from the schematics - this works if all the internally connected pins are required to connect to copper (common with GND or power pins) but is very inconvenient for signal pins where only one of them needs to be connected
+ <li> back-annotate which pin is connected - there's no easy back annotation
+ <li> one pin connected, the other is closer to the next target; PCB doesn't understand that they are already connected internally; normally one shouldn't use the internal connection of a component instead of copper; except for the common practice to use 0 ohm SMD resistors for jumping wires
+</ul>
+<p>
+The patch introduces a new pin flag <i>intconn(g)</i> which marks the pin
+to have internal connections in group <i>g</i>. If there
+are multiple pins using the same <i>g</i> value within a single element, they
+are internally connected. In other words, <i>g</i> is a group (or net name)
+within the element and pins can join to one of the numbered groups (or internal
+nets). The value of <i>g</i> shall be between 1 and 255, 0 means no internal
+connection (equivalent to the case when intconn(0) is omitted).
+<p>
+When pin numbers are displayed (key 'd'), internal connection groups are
+written in square brackets, e.g. "2 [9]" means "pin 2, internally connected
+to group 9".
+<p>
+Combined with the [<a href="nonetlist.html">nonetlist</a>] patch, this
+solves the "0-ohm 1206 jumper" problem: the element should be marked
+as nonetlist, with both pins set intconn(1) - this will result in a 2
+pad element, pads internally connected, that can be part of any one network
+without causing short.
+<h2> Example </h2>
+The first image depicts crossing traces, a common problem encountered when rats
+nesting a new layout from a netlist. One method to resolve such issues is to
+use a zero ohm jumper resistor that allows one signal trace to 'jump' across
+another.
+<p>
+The second image shows the layout routing the nonconflicting rats and a open
+unrouted point where the rat would require one trace to cross another.
+<p>
+In the third image a 1206 SMD footprint for a 0 Ohm 1206 resistor called J1 is
+placed with an intconn between the two pads which resolves the final rat line.
+<p>
+<img src="intconn1.png" alt="[Layout with resistors and rat lines]">
+<p>
+<img src="intconn2.png" alt="[Layout with one remaining rat line]">
+<p>
+<img src="intconn3.png" alt="[Layout with jumper completing net]">
+<p>
+
+
+
+<h2> save/load and compatibility </h2>
+This patch introduces a new pin flag. In the following example
+pin 2 and 4 are connected internally as group 9, while pin 3
+does not have any internal connections:
+<pre>
+Pin[40000 60000 6000 3000 6600 2800 "2" "2" "square,intconn(9)"]
+Pin[40000 50000 6000 3000 6600 2800 "3" "3" "square"]
+Pin[40000 40000 6000 3000 6600 2800 "4" "4" "square,intconn(9)"]
+</pre>
+Mainline PCB will load the design ignoring internal connections -
+this may introduce new rats.
+<p>
+Mainline PCB doesn't save intconn() and elements are embedded in the file -
+once the design is loaded and saved with mainline PCB, internal connection
+info is lost.
+
+<h2> plans </h2>
+No plans - this feature is fully implemented. There is no plan for implementing
+a GUI, internal connections should be hand-edited into the element.
+</body>
+</html>
diff --git a/doc-rnd/features/intconn1.png b/doc/features/intconn1.png
similarity index 100%
rename from doc-rnd/features/intconn1.png
rename to doc/features/intconn1.png
diff --git a/doc-rnd/features/intconn2.png b/doc/features/intconn2.png
similarity index 100%
rename from doc-rnd/features/intconn2.png
rename to doc/features/intconn2.png
diff --git a/doc-rnd/features/intconn3.png b/doc/features/intconn3.png
similarity index 100%
rename from doc-rnd/features/intconn3.png
rename to doc/features/intconn3.png
diff --git a/doc/features/io.html b/doc/features/io.html
new file mode 100644
index 0000000..41565bd
--- /dev/null
+++ b/doc/features/io.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [io_*] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [io_*] patches </h1>
+
+Mainline PCB core was coupled with the file format; the [io] patch set is
+an effort to decouple any file design I/O from core. The original file format
+(plain text .pcb and .fp) lives on as plugin called io_pcb.
+
+<p>
+TODO
+
+<h2> save/load and compatibility </h2>
+Not affected when io_pcb is used and .pcb or .fp files are loaded or saved.
+<p>
+Using other io_* implementations will obviously result in files that are
+incompatible with mainline pcb (unless mainline pcb learns how to load those
+formats).
+
+<h2> plans </h2>
+The project is still in an early phase.
+
+</body>
+</html>
diff --git a/doc-rnd/features/jumper_1206.fp b/doc/features/jumper_1206.fp
similarity index 100%
rename from doc-rnd/features/jumper_1206.fp
rename to doc/features/jumper_1206.fp
diff --git a/doc/features/library_t.html b/doc/features/library_t.html
new file mode 100644
index 0000000..5f1538c
--- /dev/null
+++ b/doc/features/library_t.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [library_t] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [library_t] patch </h1>
+
+The original code has a special setup for representing trees, C structures
+called LibraryMenu and LibraryEntry. This system can represent only a subset
+of trees: there is a root, a level consist of directories only and a next level,
+each directory consist of data nodes only. This has been enough for newlib,
+which strictly follows this model in the file system hierarchy. The lesstif
+HID also hardwired this model in the GUI.
+<p>
+In pcb-rnd this has been replaced with a new struct type called library_t
+that can represent an arbitrary tree: directories and files within directories
+down to many levels.
+<p>
+Both the gtk and the lesstif had has been modified accordingly and can
+properly display the tree. This in turn enables alternative footprint backend
+implementations such as <a href="fp_wget.html"> fp_wget </a> to import
+more complex libraries, e.g. the one on gedasymbols.org.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Finished, no plans.
+
+</body>
+</html>
diff --git a/doc/features/mincut.html b/doc/features/mincut.html
new file mode 100644
index 0000000..12ad580
--- /dev/null
+++ b/doc/features/mincut.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [mincut] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [mincut] patch </h1>
+
+The original code was highlighting pins/pads only when a short came around
+after rats nest optimization. This was not very helpful on a complex board.
+There had been a long discussion on the mailing list about the best solutions.
+There were a few very good ideas, including:
+<ul>
+ <li> manual tagging of objects (lines, polys, arcs, vias) with net and warn
+ where two differently tagged net connects
+ <li> automatic tagging based on "where it was connected first", then the same
+ warning mechanism as above
+ <li> trace history (using the undo buffer?) and go back until when it was
+ not broken, check what exactly broke it
+ <li> history combined with tagging
+ <li> calculate minimal cut
+</ul>
+<p>
+I choose minimal cut for my patch because it doesn't require tracing the
+full history or any manual administration of nets vs. objects (which I
+would find inevitable even with manual tagging - directly or indirectly
+the user needs to be able to change net tags).
+<p>
+The minimal cut is the least amount of object whose removal would resolve
+the short. It is best demonstrated on an example:
+<p>
+<img src="mincut.png" alt="[Six simple layouts, one correct and five with shorted nets]">
+<p>
+Removing all the marked lines/polys/vias would surely resolve the short
+(sometimes leaving rat lines behind). Minimal cut is better than randomly
+removing objects, tho: it guarantees that the minimal amount of objects
+are to be removed. On a complex board, this place is likely to be close
+to the place where the problem really is - much closer than the pins/pads.
+<p>
+Since mincut can be expensive on large boards, the feature can be enabled
+per board (a new PCB flag) and can be disabled globally (--enable-mincut 0
+when starting PCB).
+
+<h2> save/load and compatibility </h2>
+New PCB flag enablemincut. Mainline pcb ignores this flag but does not
+preserve it.
+
+<h2> plans </h2>
+Finished, no plans.
+</body>
+</html>
diff --git a/doc-rnd/features/mincut.png b/doc/features/mincut.png
similarity index 100%
rename from doc-rnd/features/mincut.png
rename to doc/features/mincut.png
diff --git a/doc/features/negselect.html b/doc/features/negselect.html
new file mode 100644
index 0000000..fe7b583
--- /dev/null
+++ b/doc/features/negselect.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - negative box select </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [cycdrag] patches, negative box select </h1>
+
+When a selection is made using drag&drop (box selection), depending
+on the direction the rule for object selection differ:
+<ul>
+ <li> drag from top-left towards bottom-right (positive sized box):
+ select objects that are fully contained in the box (original behaviour)
+ <li> drag in any other direction (e.g. bottom-left to top-right, or
+ bottom-right to top-left; negative sized box):
+ select objects that are even partially within the box or merely touch
+ the edge of the box
+</ul>
+
+The feature can be disabled using the editor/selection/disable_negative conf
+setting.
+<p>
+It's possible to limit the feature so that only horizontal-negative is
+considered negative size (i.e. only right-to-left dragging), using the
+editor/selection/symmetric_negative conf setting.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Work more on some rough corners of the negative direction: e.g. pads are
+handled as 0 width lines so the selection has to hit the center.
+
+</body>
+</html>
diff --git a/doc/features/nonetlist.html b/doc/features/nonetlist.html
new file mode 100644
index 0000000..bafcc7b
--- /dev/null
+++ b/doc/features/nonetlist.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [nonetlist] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [nonetlist] patch </h1>
+
+The [nonetlist] patch adds an element flag that makes PCB ignore the marked
+element when dealing with netlists. This means connecting a net to a pin of
+a nonetlist element will not cause a short. The refdes of a nonetlist
+part is drawn with color element-color-nonetlist (ElementColor_nonetlist
+in the source; default value #777777, grey).
+<p>
+Uses of the nonetlist feature:
+<ul>
+ <li> smd jumper: Combined with the [<a href="intconn.html">intconn</a>] patch, this
+ solves the "0-ohm 1206 jumper" problem: the element should be marked
+ as nonetlist, with both pins set intconn(1) - this will result in a 2
+ pad element, pads internally connected, that can be part of any one network
+ without causing short and passing the DRC.
+ <li> mechanical parts that should not show up on the schematics:
+ <ul>
+ <li> mounting hole elements: single pin holes with silk marking the head of the screw
+ <li> chassis (often with mounting holes or keep-out areas)
+ <li> logos in footprints (no poly support in footprint - yet?)
+ <li> mechanical parts which do not have solderable pins (plastic spacers, extra connector shields)
+ <li> "spare connectors", e.g. unused/disconnected DIP sockets, pin grids, or connectors in the corner of the PCB for prototyping (dev-board style)
+ </ul>
+</ul>
+<p>
+Preservation: gsch2pcb-rnd leaves nonetlist elements in the PCB.
+<h2> save/load and compatibility </h2>
+This patch introduces a new element flag. The following example demonstrates
+a <a href="jumper_1206.fp">1206 jumper footprint</a>:
+<pre>
+Element["nonetlist" "1206 jumper, 0 ohm" "" "1206" 0 0 -3150 -3150 0 100 ""]
+(
+ Pad[-5905 -1181 -5905 1181 5118 2000 5718 "1" "1" "square,intconn(1)"]
+ Pad[5905 -1181 5905 1181 5118 2000 5718 "2" "2" "square,intconn(1)"]
+ ElementLine[-2362 -3740 2362 -3740 800]
+ ElementLine[-2362 3740 2362 3740 800]
+)
+</pre>
+Mainline PCB will load the design ignoring internal connections and nonetlist
+flag - this will cause shorts on all connected pins/pads and will break
+the connection.
+<p>
+Mainline PCB doesn't save nonetlist and elements are embedded in the file -
+once the design is loaded and saved with mainline PCB, the flag is lost.
+After reloading the file in pcb-rnd, the element causes the same shorts
+as in mainline PCB.
+
+<h2> plans </h2>
+No plans, the feature is complete.
+</body>
+</html>
diff --git a/doc/features/oldplugins.html b/doc/features/oldplugins.html
new file mode 100644
index 0000000..be53c70
--- /dev/null
+++ b/doc/features/oldplugins.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [oldplugins] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [oldplugins] </h1>
+
+In this effort I imported a set of old PCB plugins to be core plugins of
+pcb-rnd. This will make it easier to keep them up to date, to defeat
+the bitrot effect. The feature plugins that got imported so far:
+<ul>
+ <li> autocrop
+ <li> boardflip
+ <li> distalign
+ <li> distaligntext
+ <li> jostle - doesn't work properly
+ <li> polycombine
+ <li> polystich - segfaults
+ <li> teardrops
+ <li> renumberblock - as part of the renumber plugin
+ <li> smaprtdisperse
+</ul>
+<p>
+The import/export plugins imported over the default set of the last official
+mainline release:
+<ul>
+ <li> import_dsn - specctra importer - compiles, parser needs a full rewrite, it tries to read an s-expression line by line with fgets()
+ <li> export_dsn - specctra exporter - compiles, produces valid-looking output - <b>need tester</b> to validate the output
+ <li> export_bboard - breadboard exporter - compiles, produces valid-looking output - <b>need tester</b>
+ <li> export_dxf - mechanical cad export - compiles, missing header data renders exported files unusable
+ <li> export_ipcd356 - electrical test output - compiles, produces valid-looking output - <b>need tester</b>
+ <li> export_openscad - 3d modeling - compiles, output sort of works, models not yet imported, <b>need tester</b>
+</ul>
+
+Plugins that won't be imported:
+<ul>
+ <li> findelement - <a href="query.html">[query]</a> takes care of that
+ <li> findrat - <a href="query.html">[query]</a> will take care of that
+ <li> join-found - not clear what it would do
+ <li> lockelements - <a href="query.html">[query]</a> can select elements then SetFlag() should be able to lock them
+ <li> sedrename - <a href="query.html">[query]</a> will take care of that
+ <li> upth2pth - <a href="query.html">[query]</a> will take care of that
+ <li> ratsel - written in C++
+ <li> stipple - written in C++
+</ul>
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Any interesting plugin is subject to be imported.
+
+</body>
+</html>
diff --git a/doc/features/onpoint.html b/doc/features/onpoint.html
new file mode 100644
index 0000000..4e61c42
--- /dev/null
+++ b/doc/features/onpoint.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [onpoint] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [onpoint] patches </h1>
+
+Robert Drehmel writes:
+<pre>
+When (e.g.) routing 5mm power traces on a small grid, it's not always easy to hit the
+point where the trace ended (which is the center of the semicircle at the end of the
+line) to start the next line. If you have selected the line tool, finding the end of
+the line can become guesswork as the cursor doesn't change shape like it does with the
+select tool.
+I want my traces to consist of lines and arcs that are perfectly connected and I want
+to work as fast as possible.
+
+Attached is a small patch that
+
+ - makes it possible to deactivate snapping to "some sensible point along a line".
+ (that's what a comment in the code says). This snapping algorithm gets in the way
+ sometimes so you have to slowly go over a line to find out where it really ends,
+ bouncing back and forth between the points of the small grid, the end of the line
+ and these "sensible points", which is wasting time. The command is
+ "Display(ToggleSnapOffGridLine)". It is still activated by default to avoid
+ violating POLA.
+
+ - more importantly, introduces a new command called "Display(ToggleHighlightOnPoint)"
+ that highlights all lines and arcs which have (end)points exactly on the position
+ where the cross hair is currently snapped to. It therefore helps finding the end
+ points of lines and arcs, but sometimes also shows redundant traces, traces that
+ aren't perfectly connected to each other, traces that don't end directly on the
+ center of a via but should, etc. It works with thin draw too and I tested it with
+ gtk and lesstif.
+
+I use the second option mostly in conjunction with deactivating the first. Both commands
+have been added to the menu by means of (g)pcb-menu.res.in and are available as command
+line options as well.
+Caveats:
+ - The HID API expects all HIDs to make a copy of the color string when setting a color.
+ - The function that lightens up a color could be improved.
+ - I used it for a while, but after porting it from my local fork, it probably needs
+ more testing.
+</pre>
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+The feature is complete.
+
+</body>
+</html>
diff --git a/doc/features/pcb-fp.html b/doc/features/pcb-fp.html
new file mode 100644
index 0000000..38ac5b1
--- /dev/null
+++ b/doc/features/pcb-fp.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [pcb-fp] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [pcb-fp] patch </h1>
+
+Pcb-fp is an effort to clean up the footprint situation:
+<ul>
+ <li> replace lib and newlib with pcblib, a library that tries to provide common footprints only
+ <li> clear the syntax: if a footprint name contains parenthesis, it's generated (parametric footprint), else it's the name of a static footprint file
+ <li> parametric footprints: replace m4 with a generic, language-independent footprint generator framework
+ <ul>
+ <li> implement libpcb_fp, which centralizes searching and loading footprints
+ <li> fork gsch2pcb to gsch2pcb-rnd that uses libpcb_fp (and does not have any m4 references hardwired)
+ <li> fork gnet_gsch2pcb.scm (the gnetlist backend) to remove m4 heuristics
+ </ul>
+</ul>
+
+<h3> Example </h3>
+Interactive parametric footprint selection in pcb-rnd:
+<p>
+<img src="pcb-fp.png" alt="[screenshot of footprint select menu, with preview]">
+<p>
+An <a href="http://igor2.repo.hu/cgi-bin/pcblib-param.cgi"> online footprint generator web1.0 version</a> is also available.
+
+<h2> save/load and compatibility </h2>
+Save/load files are not affected. If a schematics is written for the new
+library and depends on parametric footprints:
+<ul>
+ <li> mainline gsch2pcb won't find those footprints
+ <li> mainline pcb won't show those footprints in the footprint selection dialog
+</ul>
+
+<h2> plans </h2>
+No plans - this feature is fully implemented.
+
+</body>
+</html>
diff --git a/doc-rnd/features/pcb-fp.png b/doc/features/pcb-fp.png
similarity index 100%
rename from doc-rnd/features/pcb-fp.png
rename to doc/features/pcb-fp.png
diff --git a/doc/features/pcblib.html b/doc/features/pcblib.html
new file mode 100644
index 0000000..9ac6321
--- /dev/null
+++ b/doc/features/pcblib.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [pcblib] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [pcblib] and [pcblib-param] and [fp_fs] patches </h1>
+<table border=0>
+<tr><td valign=top>
+The footprint library shipped with mainline pcb is cluttered with
+special purpose parts. I believe PCB encourages the user from
+an early stage to build his own library. Thus the purpose of
+the library shipped with PCB should be
+to provide a minimal collection of real essential footprints ...
+<ul>
+ <li> ... for the very beginning of the learning curve;
+ <li> ... and to be the core of the user's own library later.
+</ul>
+<p>
+[pcblib] is a replacement of newlib/ and lib/ and the m4 macros with
+such an essential core library of static footprints ("file elements")
+and easier-to-use parametric footprints.
+<p>
+There is an <a href="http://igor2.repo.hu/tmp/pcblib"> online map</a> of
+the library and <a href="http://igor2.repo.hu/cgi-bin/pcblib-param.cgi">
+an online interface to the parametric footprint generators. </a>
+
+<h2> Design decisions </h2>
+Parts are sorted only in a few directories: smd, thru-hole, connector and
+parametric. I believe there are so many orthogonal properties of footprints
+that there's no obvious hierarchy. Also, pcblib contains much fewer footprints
+than newlib so it should be still easy to navigate.
+<p>
+Parametric footprints are in a separate directory for now, even tho they
+would fit under smd, thru-hole or connector. The reason is purely historical
+and the layout may change in the future.
+
+<h2> Example </h2>
+To the right: Footprint selection dialog on pcblib, with the smd directory
+open. Note how few smd parts are there. Still, smd/ is the most crowded
+subdirectory!
+
+<h2> [fp_fs] </h2>
+As of version 1.0.10, the footprint list/search/load of footprints is a plugin.
+The original code that handles local file system footprint libraries (e.g.
+pcblib or newlib) is now a plugin. Alternative plugins can be provided that work
+from databases or <a href="fp_wget.html"> from the web</a>. In extreme
+situations the file system based footprint plugin can even be disabled.
+
+<h2> save/load and compatibility </h2>
+Not affected: elements are embedded in the PCB.
+
+<h2> plans </h2>
+None, the feature is complete.
+<td>
+<td>
+<img src="pcblib.png" alt="[screenshot of footprint select menu, with preview]">
+</table>
+</body>
+</html>
diff --git a/doc-rnd/features/pcblib.png b/doc/features/pcblib.png
similarity index 100%
rename from doc-rnd/features/pcblib.png
rename to doc/features/pcblib.png
diff --git a/doc/features/polygrid.html b/doc/features/polygrid.html
new file mode 100644
index 0000000..e68cea3
--- /dev/null
+++ b/doc/features/polygrid.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [polygrid] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [polygrid] patch </h1>
+
+Polygrid adds an option to the ps exporter to fill polygons with a grid
+of horizontal and vertical lines instead of full fill. When toner transfer
+is used or test prints are produced, the grid may save some toner.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Fix bugs.
+<p>
+No (feature) plans - this feature is fully implemented.
+</body>
+</html>
diff --git a/doc/features/propedit.html b/doc/features/propedit.html
new file mode 100644
index 0000000..e616c5d
--- /dev/null
+++ b/doc/features/propedit.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [propedit] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - [propedit] </h1>
+Since 1.1.2, pcb-rnd core is able to attach user defined <i>attributes</i>
+(arbitrary textual key=value pairs) to any object. The original mainline
+pcb-rnd was forked from already supported attributes on some objects (e.g.
+board attributes, net attributes) but not on all. However, the user had
+very little access to the attributes - no GUI or action would handle them.
+<p>
+Propedit introduces a property editor window in gtk that is able to
+edit attributes and core properties of all selected objects. Core properties
+include all hardwired properties of objects, such as geometry (e.g.
+trace width, hole diameter, clearance) or textual data (e.g. string of
+a text).
+<p>
+<img src="propedit.png" alt="[screenshot of Edit Properties menu]">
+<p>
+Properties and attributes of the selected objects are collected in a
+sorted list - each row of the list is a property (starting with p/) or
+an attribute (starting with a/). For each row all values seen in the selection
+are also collected so that the following values can be presented on the list,
+per row:
+<ul>
+ <li> the most common value
+ <li> minimum value (for numeric value types)
+ <li> maximum value (for numeric value types)
+ <li> average value (for numeric value types)
+</ul>
+<p>
+When the user clicks on a row, an edit box is activated and the value can
+be changed. A combo box lists all existing values for the given row, so
+it is easy to unify the value of a property or attribute among all selected
+objects to one of the existing values, but the user is also free to enter
+a new value.
+<p>
+It is also possible to remove existing attributes or to add new attributes.
+
+<h2> save/load and compatibility </h2>
+Attributes of most objects can not be saved in the original .pcb format.
+The propedit feature is most useful when used with the lihata board format.
+
+<h2> plans </h2>
+Various improvements. Currently there's no plan to make this function available
+in the lesstif HID.
+
+</body>
+</html>
diff --git a/doc-rnd/features/propedit.png b/doc/features/propedit.png
similarity index 100%
rename from doc-rnd/features/propedit.png
rename to doc/features/propedit.png
diff --git a/doc/features/query.html b/doc/features/query.html
new file mode 100644
index 0000000..4e98908
--- /dev/null
+++ b/doc/features/query.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [query] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - [query] </h1>
+Pcb-rnd features a flexible query language that can list (or select or find, etc.)
+objects matching an expression. The language handles different data types,
+including lists, provides means to iterate over objects and lists, supports
+the common logical and arithmetic operators.
+<p>
+The query language is the engine behind the advanced search & select
+functionality. It is also the foundation of the programmable DRC.
+<p>
+The query language is implemented as a core plugin.
+<p>
+TODO: more details will come later, when the specification and implementation
+stabilizes.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Next stage will be a programmable DRC.
+
+</body>
+</html>
diff --git a/doc/features/res.html b/doc/features/res.html
new file mode 100644
index 0000000..d4ca56e
--- /dev/null
+++ b/doc/features/res.html
@@ -0,0 +1,149 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [res] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [res] patch </h1>
+
+PCB used to have an own file format for describing resources (menu structure
+and hotkey bindings, vendor drill mapping). The resource format was generic
+enough to describe these things, but the syntax was somewhat weird: mixed
+positional and named fields. More precisely, composite nodes could contain
+named and anonymous subnodes, and the meaning of anonymous subnodes depended
+on their position in the anon-subnode-list.
+<p>
+The code that dealt with the in-memory representation of the resource tree
+was weird and big chunks duplicated in the HIDs and vendor drill module. It
+was also hard to parse a resource file with external tools.
+<p>
+Since version 1.0.10, pcb-rnd replaces resource files with
+<a href="http://repo.hu/projects/lihata">lihata</a>. Lihata is a small, generic
+purpose container format that can describe arbitrary trees. Just like resource
+file syntax, lihata is optimized for hand-editing: no need to use excess
+quoting or long boilerplate blocks.
+<p>
+Liblihata also provides a lot of helper functions that made the code
+dealing with the menus and vendor drill resources much simpler and less
+redundant. Since the parser is small and external, and since there are
+external converter tools available, it is also easier to deal with the
+files outside of the pcb executable.
+
+<h2> menu files </h2>
+There are pcb-menu-gtk.lht and pcb-menu-lesstif.lht. They are in trunk/src
+in the source tree and are installed in the SHAREDIR. Currently each GUI
+HID (lesstif, gtk) loads the corresponding menu file.
+
+<h2> menu resource lihata structure </h2>
+The root of a menu resource file should be a <i>ha:</i> with the following
+children:
+<ul>
+ <li> <i>li:mouse</i> for mouse button bindings
+ <li> <i>li:main_menu</i> for describing the main menu
+ <li> <i>li:popups</i> for describing the popup menus
+</ul>
+All children are optional, but recommended. Thus the file structure, zoomed
+out, is:
+<pre>
+ha:{
+ li:mouse { ... }
+ li:main_menu { ... }
+ li:popups { ... }
+}
+</pre>
+
+<h3> li:mouse </h3>
+The mouse subtree may contain a <i>li:</i> for each mouse button action;
+the children of the list are further <i>li:</i> nodes for key modifiers, whose
+children are text nodes: actions executed in order.
+<p>
+Buttons supported are: left, right, middle, up, down - the last two
+are for the scroll wheel. Modifier name should start with "press" or "release"
+optionally followed by modifier key suffixes separated with dashes, e.g.
+"press-alt-shift" means the given button is pressed while alt and shift
+were also pressed.
+<p>
+Example structure:
+<pre>
+ li:mouse {
+ li:left {
+ li:press = { Mode(Notify) }
+ li:press-ctrl = { Mode(Save); Mode(None); }
+ }
+ }
+</pre>
+
+<h3> li:main_menu </h3>
+The main menu is a list of menubar items that may host submenu items
+recursively. Each normal item is a hash with the following children:
+<ul>
+ <li> <i>li:submenu</i> an ordered list of submenu nodes (should not have accel key or action)
+ <li> <i>tip</i> tooltip text
+ <li> <i>action</i> text or list of actions to execute when menu is selected
+ <li> <i>a</i> a key description for an accelerator key (hotkey)
+ <li> <i>li:a</i> a list of key descriptions for an accelerator keys (hotkeys); all keys will be bound to the menu and the first key is shown in the menu
+</ul>
+Special menu items are text nodes instead of hashes; they are:
+<ul>
+ <li> starting with @, are dynamic, auto-generated items (e.g. layers; might be HID-dependent)
+ <li> a single dash: separator
+</ul>
+<p>
+A key description is a text in the form of:
+<ul>
+ <li> the name of the node is the visible name of the menu item
+ <li> <key>keyname, e.g. "<key>k" for key K, or "<key>F10" for F10
+ <li> modifier<key>keyname, e.g. "Alt-<key>K" for Alt+K
+ <li> modifier-modifier<key>keyname, e.g. "Shift-Alt-<key>K" for Shift+Alt+K; modifiers are Alt, Shift and Ctrl; order does not matter, all three can be used together.
+ <li> multikey sequence: multiple of the above, separated by semicolons (protected with {} for lihata, as the text contains semicolon); e.g. "{<key>f;<key>o}" means the user presses "f" then "o". Sequences can be a dozen stroke long and any segment may use modifiers
+</ul>
+
+An example menu item with submenus (can be a main menu or a submenu of
+another menu item):
+<pre>
+ha:example menu item {
+ li:submenu {
+ ha:menu item {
+ action=Save(ElementConnections)
+ tip=example menu
+ }
+ -
+ ha:another menu item {
+ a={Shift-Alt<key>r}
+ action={Action1(); Action2();}
+ }
+ }
+}
+</pre>
+
+<h3> li:popups </h3>
+Each children is a hash that describes a popup menu. A popup menu behaves
+exactly like a menu item, it should have a submenu list. Popup windows will
+be popped up by executing an action with the name of the popup menu.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+The resource file format conversion is done. There are other parts of the code
+that will probably get lihata instead of the current custom parsers, e.g.
+the preferences/settings file.
+
+</body>
+</html>
diff --git a/doc/features/routings.html b/doc/features/routings.html
new file mode 100644
index 0000000..8a80832
--- /dev/null
+++ b/doc/features/routings.html
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - routing style fixes </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - routing style fixes </h1>
+
+<h2> Number of styles </h2>
+In the original code there are a compile-time fixed number (4) of routing
+styles. This is often not enough for more complex designs. While in theory
+this limit can be raised, the resulting .pcb files will be incompatible with
+pcb compilations using a different number of styles.
+<p>
+Pcb-rnd uses a dynamic vector for storing styles and allows any number
+of styles from 0 up to a very large value (2^31-1). There is no compile-time
+configurable limit. The number of default styles (and the actual style
+configuration) is coming from the template pcb file.
+<p>
+Creating a new style in the Route Styles dialog is not "for this session only"
+anymore - styles are saved with the design.
+
+<h2> Explicit custom style </h2>
+Pcb had 4 explicit styles and a hidden, implicit style. All drawing
+action uses the hidden style. When the user selects one of the explicit
+styles, its properties are copied into the implicit style. Any drawing
+action uses the implicit style, this it's sort of the "pen style".
+<p>
+In mainline PCB the implicit (or pen) style is hidden. As long as it always
+matches one of the existing styles, the user doesn't even know about it.
+However, if there are objects that do not conform to any of the existing
+styles, it is possible to bump into this. For example:
+<ul>
+ <li> draw a line using one of the existing styles
+ <li> increase the width (with the 's' key) a few times - now the style of the line does not match any of the existing styles
+ <li> use the SetSame() action over the line (hover the pointer over the line and press 'a') - it will try to set the style that corresponds to the line
+ <li> since no style matches the line's, the radio button gets deselected - that's good
+ <li> now click on the Route Style button - it will show the properties of the last selected route style, even tho it is not selected at the moment
+</ul>
+<p>
+In contrast, pcb-rnd offers an explicit routing style called <i><custom></i>.
+If SetSame() is invoked on an object that doesn't match any of the existing styles,
+the <i><custom></i> style is selected:
+<ul>
+ <li> no style marked on the radio button (just like in mainline)
+ <li> the Route Style button opens with the <i><custom></i> style, with the values picked up from the object by SetSame
+ <li> the user can change the values, which will affect the implicit pen style
+ <li> this means the user can draw with the new settings, without having to create a permanent style
+</ul>
+<p>
+In other words, it is now possible to use the implicit pen style as temporal
+style, to explicitly set a line width, via diameter before placing a few
+unusual lines or vias, without having to create a new style. It is also
+possible to pick up the style of such an unusual object later, without the
+GUI confusing it with any of the existing styles.
+
+<h2> SetSame() bugs fixed </h2>
+A line does not have drill parameters. When mainline tries to pick up
+object properties for a line, it will pick thickness and clearance but
+will leave hole and ring diameters unchanged. This very often results in
+a mixed style: e.g. "signal" line properties picked up from a line while
+"power" hole/ring properties left over from the current style selection.
+Such a mixed pickup will result in the GUI get confused and not selecting any
+of the styles. The expected behaviour is to select the "signal" style if the
+line width/clearance matches the parameters of that style, and ignore the
+drill/ring parameters.
+<p>
+The same mixup happens for picking up arc parameters, and a similar mixup
+for via parameters (a via doesn't have a line width).
+<p>
+Pcb-rnd fixes this by searching for the matching style using only the parameters
+that the given object really had. This results in valid style selection
+the way the user may expect.
+
+<h2> save/load and compatibility </h2>
+Saving a design with number of styles not equal to 4 may cause problems
+when loading with mainline. The rest of these features do not affect
+compatibility.
+
+<h2> plans </h2>
+No plans - these features are fully implemented.
+</body>
+</html>
diff --git a/doc/features/scconfig.html b/doc/features/scconfig.html
new file mode 100644
index 0000000..1747bd9
--- /dev/null
+++ b/doc/features/scconfig.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [scconfig] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [scconfig] patch </h1>
+
+Pcb-rnd uses <a href="http://repo.hu/projects/scconfig">scconfig</a>
+for ./configure instead of autotools. Scconfig is smaller and easier
+to maintain.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+No plans - this feature is fully implemented by now.
+</body>
+</html>
diff --git a/doc/features/settings.html b/doc/features/settings.html
new file mode 100644
index 0000000..11ab290
--- /dev/null
+++ b/doc/features/settings.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - different default settings </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - settings </h1>
+
+There are a few minor changes in default settings compared to mainline
+pcb.
+<table border=1>
+<tr>
+ <th> name
+ <th> description
+ <th> where to change
+
+<tr>
+ <td> layers
+ <td> the default layer stack is optimized for two sided boards with 3 layers on both sides
+ <td> edit or replace /usr/share/pcb-rnd/default.pcb
+
+<tr>
+ <td> styles & DRC
+ <td> default styles and DRC settings are optimized for toner transfer
+ <td> edit or replace /usr/share/pcb-rnd/default.pcb
+
+<tr>
+ <td> grid
+ <td> on startup "enable visible grid" is on and grid is set to 25 mil
+ <td> change editor/draw_grid in pcb-conf.lht (in system install dir, in user dir) or in project.lht
+
+</table>
+
+</body>
+</html>
diff --git a/doc/features/square.html b/doc/features/square.html
new file mode 100644
index 0000000..7efc0ac
--- /dev/null
+++ b/doc/features/square.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [square] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [square] patch </h1>
+Most of my PCBs end up in <i>toner transfer</i>. There are a lot
+of tricks around prototyping at home. One of the problems I often
+face is small rings peeling off during rework (and rework tend to
+happen on the first prototypes). The solution for this is increasing
+ring size - which is not suitable if traces are passing between pins.
+Another solution is to increase the area of the pin:
+<ul>
+ <li> square pin: while it makes the pin slightly larger still letting traces pass between pins, it's too symmetrical and can not use up extra room
+ <li> DJ's teardrop plugin: this increases the area only toward the trace, whereas very often there's more room on the opposite side
+ <li> manually add an extra poly around the pin; with multiple pins it's hard to get the polys separate
+ <li> manually add a short extra track on the pin, width matching the size of the pin; this is very close, but increases workload when components are moved, layers are changed
+</ul>
+<img src="square.png" alt="[demo showing DIP with different pin shapes]">
+<p>
+The patch takes an octagon pin and stretches points in various directions.
+There are 4 bits (for left, right, up and down) to indicate in which directions
+the stretch applies. Pressing 'q' on a pin cycles thru round pin, square pin,
+16 stretched octagons and the original octagon.
+<p>
+The code is also patched to handle clearances, shorts and connections (find.c).
+<p>
+Thermals are not fully working for funny shaped pins, but it has low priority:
+they still work fine for rounded and square pins and if there is a poly around
+the pin, I wouldn't use shaped pins anyway.
+
+<h2> save/load and compatibility </h2>
+This patch introduces a new pin flag called shape(n), where n is an integer
+selecting the shape of the pin when the square flag is also set:
+<pre>
+Pin[40000 60000 6000 3000 6600 2800 "8" "8" "square,shape(3)"]
+</pre>
+Mainline PCB will load the design ignoring the custom shape and will use a
+square pin. As long a traces end in the center point of the pin, this
+should not break connections.
+<p>
+Mainline PCB doesn't save shape() - once the design is loaded and saved with
+mainline PCB pin shape info is lost.
+
+<h2> plans </h2>
+In the original code there are separate code paths for round, octagonal and
+square pins. The separation repeats for at least:
+<ul>
+ <li> drawing the pin shape
+ <li> calculating the clearance
+ <li> checking whether things overlap or connect (pin vs pin, pin vs line, etc.)
+ <li> autorouter
+</ul>
+In most cases a set of hardwired constants are written in the C code. A notable
+exception was the octagon pin draw function, that had x and y offsets in a const
+table for 8 points and a loop to create the poly (or line segments in thin draw).
+<p>
+The [square] feature is a good base for cleaning up the code a bit and for
+moving toward a generic pin shape patch:
+<ul>
+ <li> hardwired octagon calculations should be replaced to use the same x;y const offset table
+ <li> the table should be replaced by a struct that describes length (number of points) - alternatively use POLYAREA
+ <li> square pin should be renamed to polygon pin
+ <li> octagon flag shall be removed - it should be a configuration of the x;y const table
+ <li> square flag shall be removed - it should be a configuration
+ <li> the only flag remaining should be shape(); if a pin is not shaped, it's round
+ <li> the pin shape struct should have a field for compatibility - to mark the entry corresponding to the original square and octagon pins so PCB-rnd format can be converted to and from the mainline PCB format.
+ <li> there should be a set of pin shapes in a default configuration table, including square and octagonal; these should be static
+ <li> the PCB file format should be extended with an option to expand the pin shape table with custom shapes
+ <li> UI: shapes could be imported (converted) from polys around vias
+ <li> UI: since there may be a lot of pin shapes, a GUI selector alternative shall be offered while also keeping the cycle-thru 'q' key
+</ul>
+</body>
+</html>
diff --git a/doc-rnd/features/square.pcb b/doc/features/square.pcb
similarity index 100%
rename from doc-rnd/features/square.pcb
rename to doc/features/square.pcb
diff --git a/doc-rnd/features/square.png b/doc/features/square.png
similarity index 100%
rename from doc-rnd/features/square.png
rename to doc/features/square.png
diff --git a/doc/features/tostyle.html b/doc/features/tostyle.html
new file mode 100644
index 0000000..d493b19
--- /dev/null
+++ b/doc/features/tostyle.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [tostyle] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [tostyle] patch </h1>
+
+Footprints bring their own hole sizes, copper ring sizes and clearances.
+These parameters often depend on the manufacturing process, and such a value
+coming from a footprint may differ much from the values used on the board already.
+<p>
+PCB has actions (and menus and hotkeys) to change sizes manually. In my practice,
+I try to stick to the sizes defined in my routing styles and try to avoid
+manually changing clearances or ring sizes. Still, the random values coming
+from various footprints should be changed.
+<p>
+After many years of struggling with this, I realized the feature I need is
+a way to change object sizes to not a relative or absolute <i>number</i> but
+to the current <i>routing style</i>. The [tostyle] patch does exactly this.
+It implements the following new features:
+<ul>
+ <li> change clearance size now works on elements: it changes the clearance of all pins/pads; this is the same as change drill has been working for a long time
+ <li> size change actions normally take a value and a unit; if the value is not a number but text <b>style</b>, the value is copied from the currently active routing style
+ <li> a new ChangeSizes() action that attempts to execute the other three change size actions with the same arguments and fails only if all of them failed; the three sizes are: main size, drill size, clearance size
+ <li> a menu item and hotkey binding to key 'Shift+Y' (for routing stYle) that calls ChangeSizes() of the selected or current object(s) to resize them to the current routing style
+</ul>
+<p>
+The new route style set works on:
+<ul>
+ <li> lines and arcs: sets their line width and clearance
+ <li> vias and individual pins: sets their ring dia, drill dia and clearance
+ <li> individual pads: sets their clearance
+ <li> elements: set all their pins and pads
+</ul>
+
+<h2> Example </h2>
+GUI: select a routing style; hover above a line, a via, a pin/pad of an element
+or the silk of an element; press Shift+Y; undo if necessary.
+<p>
+CLI: select objects, execute action ChangeSizes(selected, style)
+<p>
+CLI: to adjust drill sizes only: select objects, execute action ChangeDrillSize(selected, style)
+
+
+<h2> save/load and compatibility </h2>
+Not affected, since the patch introduces actions and UI changes, no change
+related to the data model.
+
+<h2> plans </h2>
+No plans, the feature is complete.
+
+</body>
+</html>
diff --git a/doc/features/unglib.html b/doc/features/unglib.html
new file mode 100644
index 0000000..a9069a3
--- /dev/null
+++ b/doc/features/unglib.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - [unglib] </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - the [unglib] patch </h1>
+
+Removes glib dependency from core, in favor of
+<a href="http://repo.hu/projects/articles/minilibs">minilibs</a> to help
+keeping the code <a href="../devlog/20160313_unglib.html">small, modular
+and easier to fix</a>.
+
+<h2> save/load and compatibility </h2>
+Not affected.
+
+<h2> plans </h2>
+Remove glib dependency from the puller plugin.
+
+</body>
+</html>
diff --git a/doc-rnd/gpmi_temp_inst.txt b/doc/gpmi_temp_inst.txt
similarity index 100%
rename from doc-rnd/gpmi_temp_inst.txt
rename to doc/gpmi_temp_inst.txt
diff --git a/doc/help.html b/doc/help.html
new file mode 100644
index 0000000..4c0d470
--- /dev/null
+++ b/doc/help.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - help wanted </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - help wanted </h1>
+The project is looking for volunteers for the features listed below. If
+you want to contribute, you will need to have an svn client and an email
+client. Furthermore an IRC client is strongly recommended.
+<p>
+You will become part of the team and get svn commit right immediately
+when you start working.
+<p>
+<b>Don't have much free time?</b> Don't worry: the tasks below are split up in
+very small (1..2 hours) chunks. Coordination is granted, the administrative
+overhead is almost zero - you can focus on the task, and finish it whenever
+you have a free hour.
+<p>
+Worrying about your <b>contribution to go in /dev/null?</b> Don't: pcb-rnd
+has very short loops; you start contributing and get immediate feedback. Your
+work is part of the official thing immediately and revised and accepted (or
+rarely refused) within hours or at most days.
+<b>There are no bitrotting branches.</b>
+<p>
+You are not confident enough with your skills? pcb-rnd is an optimal
+project for learning. If you start contributing, you get support. There
+are small and simple entry level tasks. Most of the tasks don't require
+any programming skills.
+<p>
+Sign up: mail to pcb-rnd (at) igor2.repo.hu .
+If you want to work on a feature not listed below, feel free to drop me
+a mail.
+<p>
+<table border=1 cellspacing=0 cellpadding=0>
+<tr><th> ID <th> skill required <th> description
+<tr><td> tutorial <td> geda user <td> tutorial projects
+<tr><td> windows <td> geda user <td> generic testing on windows
+<tr><td> mtest <td> geda user <td> systematic manual testing
+<tr><td> doc <td> geda user, html<td> write sections of user documentation
+<tr><td> logo <td> designer <td> the official pcb-rnd logo
+<tr><td> banner <td> designer <td> pcb-rnd banner for the homepage
+<tr><td> icons <td> designer <td> icons, other graphical elements for the GTK HID
+<tr><td> css <td> designer <td> CSS for the homepage (only design/style, no content).
+<tr><td> atest <td> C/beginner <td> program automated test cases
+</table>
+</body>
+</html>
diff --git a/doc/index.html b/doc/index.html
new file mode 100644
index 0000000..510cf05
--- /dev/null
+++ b/doc/index.html
@@ -0,0 +1,133 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - main </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<br>
+<!--content-->
+<table border=0 cellpadding=10> <tr>
+<td valign=top bgcolor="#f2f2f2">
+ <h2> Summary </h2>
+ <table border=0 cellpadding=20>
+ <tr><th align=right valign=top bgcolor="#ccccff">
+ <table border=0 width="100%" cellpadding=0 cellspacing=0><tr><td align=left><img src="resources/logo128.png" alt="[pcb-rnd logo]"><th align=right>pcb-rnd</table>
+ <td bgcolor="#ddddff">
+ <b>is a flexible, modular Printed Circuit Board editor</b>
+ <p><a href="motivation.html">historically</a> is a fork of <a href="http://pcb.geda-project.org">PCB</a>
+ <p>is an informal part of the geda project
+ <p>features a lot of small and large <a href="features/index.html">improvements and bugfixes</a>
+
+
+ <tr><th align=right valign=top bgcolor="#ccccff"> Version Control <td bgcolor="#ddddff"> <a href="http://igor2.repo.hu/cgi-bin/minisvn.cgi?cmd=browse&repo=pcb-rnd&path=trunk"> svn://repo.hu/pcb-rnd/trunk </a>
+ <tr><th align=right valign=top bgcolor="#ccccff"> Download <td bgcolor="#ddddff"> <a href="releases/"> source releases </a>
+ <tr><th align=right valign=top bgcolor="#ccccff"> Comments, feedback, patches <td bgcolor="#ddddff"> <a href="irc.html"> live chat with the developer </a><br>or mail to: pcb-rnd (at) igor2.repo.hu<br>Mailing list: pcb-rnd (at) list.repo.hu (send a mail with subject: subscribe)
+ <tr><th align=right valign=top bgcolor="#ccccff"> Contribution and support <td bgcolor="#ddddff">
+ How to <a href="contrib.html"> join or contribute </a>
+ <br>We are looking for <a href="help.html"> help</a>.
+ <br>Do you have a <a href="myfeature.html">feature request</a>?
+
+ <tr><th align=right valign=top bgcolor="#ccccff"> Key features <td bgcolor="#ddddff">
+ editor for multilayer Printed Circuit Boards
+ <br> <a href="features/gpmi.html"> scriptable </a> in 10+ different scripting languages
+ <br> <a href="features/pcblib.html">parametric footprint</a> generation, <a href="features/fp_wget.html"> web footprints </a>
+ <br> <a href="developer/mods3/">modular code</a> with a flexible plugin system
+ <br> fits well in a UNIXy workflow
+ <br> supports CLI and server applications
+ <br> active development, frequent releases
+ <br> friendly and efficient developer and user community
+ <br> <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> predictable development cycles </a>
+ <br> compatible with <b>KiCad</b> and <b>gEDA/PCB</b>
+
+ <tr><th align=right valign=top bgcolor="#ccccff"> Supported platforms <td bgcolor="#ddddff">
+ <table border=0 width="100%">
+ <tr><td>
+ Linux desktop (various distributions, from source)
+ <br> <a href="mac.txt"> Mac OS X </a>
+ <br> <a href="https://aur.archlinux.org/packages/pcb-rnd-svn/"> Arch Linux (user package) </a>
+<!-- <br> <a href="windows.txt"> Windows </a> -->
+ <br> <a href="UNIX.txt"> IRIX 5.3 </a>
+ <br> (Likely: any 90's UNIX system with motif)
+ <br> Screen resolution as small as 800x600
+ <br> GUI options: motif/lesstif, gtk
+ <td width="10px">
+ <td valign="bottom" align="right">
+ <img src="resources/screenshot.jpg" alt="screenshot of pcb-rnd running on Debian GNU/Linux">
+ </table>
+</table>
+
+<!-- spacer -->
+ <td width=0>
+
+<!-- rnd -->
+ <td width="20%" bgcolor="#f2f2f2">
+ <h2> What is -rnd? </h2>
+ <br>
+ <table border=0 cellspacing=10 cellpadding=0 bgcolor="#ccffcc">
+ <tr><td><font size="+2"><b>R</b>a<b>ND</b>om</font> <td>
+ When it started, it used to be a <a href="motivation.html">random collection of small fixes and improvements.</a> We got much further than that by now.
+ </table>
+
+ <p>
+
+ <table border=0 cellspacing=10 cellpadding=0 bgcolor="#ccffcc">
+ <tr>
+ <td><font size="+2"><b>R</b>espo<b>N</b>sive <b>D</b>evelopers</font>
+ <td> Developers try to respond on user needs, adding features that are actually needed by current users.
+ </table>
+
+ <p>
+
+ <table border=0 cellspacing=10 cellpadding=0 bgcolor="#ccffcc">
+ <tr><td>
+ <font size="+2"><b>R</b>esponse <b>N</b>ot <b>D</b>elayed</font>
+ <td> Bugreports, user requests and patches submitted are answered ASAP. There are no patches bitrotting for months. There are no forgotten bugreports.
+ </table>
+
+ <p>
+
+ <table border=0 cellspacing=10 cellpadding=0 bgcolor="#ccffcc" width=400>
+ <tr>
+ <td><font size="+2"><b>R</b>esearch <br><b>&</b> <br><b>D</b>evelopment</font>
+ <br>
+ <br>
+ <b>R</b>ázós, <br><b>N</b>ehéz <br><b>D</b>öntések <br><small>(Brave, hard decisions)</small>
+ <td> There is a constant experimentation with new features and directions. We are willing to try strange/unusual ideas without risking the stability of the daily workflow.
+ </table>
+
+ <p>
+
+ <table border=0 cellspacing=10 cellpadding=0 bgcolor="#ccffcc">
+ <tr>
+ <td><font size="+2"><b>R</b>ants <br><b>N</b>ow <br><b>D</b>issipating</font>
+ <td> Instead of talking and ranting a lot about what could work better, we just sit down and make it work better.
+ </table>
+
+ <p>
+
+ <table border=0 cellspacing=10 cellpadding=0 bgcolor="#ccffcc">
+ <tr>
+ <td><font size="+2"><b>R</b>ather <br><b>N</b>icely <br><b>D</b>ecentralized</font>
+ <td> <a href="developer/mods3/"> Slim, generic core</a>; most of the code organized in replacable plugins. Most plugins depend only on the core.
+ </table>
+</table>
+
+</body>
+</html>
diff --git a/doc/irc.html b/doc/irc.html
new file mode 100644
index 0000000..95b7e0b
--- /dev/null
+++ b/doc/irc.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - IRC </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<H1> Live support via IRC (chat) </H1>
+<br>Irc <b>server</b>: repo.hu <b>Port</b>: 6667 <b>Channel</b>: #pcb-rnd
+<br>
+<p>I'm normally online as Igor2 between 5:00 CET and 19:00 CET; on Sunday there's an AFK-window between 11:00 CET and 16:00 CET. If I don't answer in a few minutes I'm probably away doing something, please be patient; say hi before you type your long question so you see if I'm available.
+<hr>
+<p>
+Below is an iframe of <a href="https://kiwiirc.com/client/repo.hu/?nick=pcbuser|?#pcb-rnd">
+kiwiirc </a> irc client configured with the above settings. If it doesn't
+work, please visit their <a href="https://kiwiirc.com"> page </a> and
+try to manually configure it, it's just 4 fields.
+<p>
+Using the web client: you may change your nickname; there's no password
+or registration or channel key or ssl of any form. Your real IP won't be
+shown on the IRC network (check kiwiirc's page about their privacy
+policy).
+<p>
+Connecting with the web client may take some time, give it a minute.
+<hr>
+
+<iframe src="https://kiwiirc.com/client/repo.hu/?nick=pcbuser|?#pcb-rnd" style="border:0; width:100%; height:450px;"></iframe>
+
+</body>
+</html>
diff --git a/doc/keys.html b/doc/keys.html
new file mode 100644
index 0000000..c816b3d
--- /dev/null
+++ b/doc/keys.html
@@ -0,0 +1,694 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- This file is generated by util/keylist.sh. DO NOT EDIT. -->
+<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+ <title> Key to action bindings </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+<h1> Key to action bindings </h1>
+<table border=1 cellspacing=0>
+<tr><th> key <th>pcb-menu-lesstif.lht <th>pcb-menu-gtk.lht
+<tr bgcolor="#DDFFFF">
+ <th align=left>.
+ <td> <I>'All-direction' lines</I><br>conf(toggle, editor/all_direction_lines, design)
+ <td> <I>'All-direction' lines</I><br>conf(toggle, editor/all_direction_lines, design)
+<tr bgcolor="#FFFFFF">
+ <th align=left>/
+ <td> <I>Cycle Clip</I><br>Display(CycleClip)
+ <td> <I>Cycle Clip</I><br>Display(CycleClip)
+<tr bgcolor="#DDFFFF">
+ <th align=left>0
+ <td> <I>Select Layer 10</I><br>SelectLayer(10)
+ <td> <I>Select Layer 10</I><br>SelectLayer(10)
+<tr bgcolor="#FFFFFF">
+ <th align=left>0-alt
+ <td> <I>Select Layer 20</I><br>SelectLayer(20)
+ <td> <I>Select Layer 20</I><br>SelectLayer(20)
+<tr bgcolor="#DDFFFF">
+ <th align=left>0-alt-ctrl
+ <td> <I>Toggle Layer 20</I><br>ToggleView(20)
+ <td> <I>Toggle Layer 20</I><br>ToggleView(20)
+<tr bgcolor="#FFFFFF">
+ <th align=left>0-ctrl
+ <td> <I>Toggle Layer 10</I><br>ToggleView(10)
+ <td> <I>Toggle Layer 10</I><br>ToggleView(10)
+<tr bgcolor="#DDFFFF">
+ <th align=left>1
+ <td> <I>Select Layer 1</I><br>SelectLayer(1)
+ <td> <I>Select Layer 1</I><br>SelectLayer(1)
+<tr bgcolor="#FFFFFF">
+ <th align=left>1-alt
+ <td> <I>Select Layer 11</I><br>SelectLayer(11)
+ <td> <I>Select Layer 11</I><br>SelectLayer(11)
+<tr bgcolor="#DDFFFF">
+ <th align=left>1-alt-ctrl
+ <td> <I>Toggle Layer 11</I><br>ToggleView(11)
+ <td> <I>Toggle Layer 11</I><br>ToggleView(11)
+<tr bgcolor="#FFFFFF">
+ <th align=left>1-ctrl
+ <td> <I>Toggle Layer 1</I><br>ToggleView(1)
+ <td> <I>Toggle Layer 1</I><br>ToggleView(1)
+<tr bgcolor="#DDFFFF">
+ <th align=left>1-shift
+ <td> <I>#1</I><br>PasteBuffer(1)
+ <td> <I>Select Buffer #1</I><br>PasteBuffer(1)
+<tr bgcolor="#FFFFFF">
+ <th align=left>2
+ <td> <I>Select Layer 2</I><br>SelectLayer(2)
+ <td> <I>Select Layer 2</I><br>SelectLayer(2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>2-alt
+ <td> <I>Select Layer 12</I><br>SelectLayer(12)
+ <td> <I>Select Layer 12</I><br>SelectLayer(12)
+<tr bgcolor="#FFFFFF">
+ <th align=left>2-alt-ctrl
+ <td> <I>Toggle Layer 12</I><br>ToggleView(12)
+ <td> <I>Toggle Layer 12</I><br>ToggleView(12)
+<tr bgcolor="#DDFFFF">
+ <th align=left>2-ctrl
+ <td> <I>Toggle Layer 2</I><br>ToggleView(2)
+ <td> <I>Toggle Layer 2</I><br>ToggleView(2)
+<tr bgcolor="#FFFFFF">
+ <th align=left>2-shift
+ <td> <I>#2</I><br>PasteBuffer(2)
+ <td> <I>Select Buffer #2</I><br>PasteBuffer(2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>3
+ <td> <I>Select Layer 3</I><br>SelectLayer(3)
+ <td> <I>Select Layer 3</I><br>SelectLayer(3)
+<tr bgcolor="#FFFFFF">
+ <th align=left>3-alt
+ <td> <I>Select Layer 13</I><br>SelectLayer(13)
+ <td> <I>Select Layer 13</I><br>SelectLayer(13)
+<tr bgcolor="#DDFFFF">
+ <th align=left>3-alt-ctrl
+ <td> <I>Toggle Layer 13</I><br>ToggleView(13)
+ <td> <I>Toggle Layer 13</I><br>ToggleView(13)
+<tr bgcolor="#FFFFFF">
+ <th align=left>3-ctrl
+ <td> <I>Toggle Layer 3</I><br>ToggleView(3)
+ <td> <I>Toggle Layer 3</I><br>ToggleView(3)
+<tr bgcolor="#DDFFFF">
+ <th align=left>3-shift
+ <td> <I>#3</I><br>PasteBuffer(3)
+ <td> <I>Select Buffer #3</I><br>PasteBuffer(3)
+<tr bgcolor="#FFFFFF">
+ <th align=left>4
+ <td> <I>Select Layer 4</I><br>SelectLayer(4)
+ <td> <I>Select Layer 4</I><br>SelectLayer(4)
+<tr bgcolor="#DDFFFF">
+ <th align=left>4-alt
+ <td> <I>Select Layer 14</I><br>SelectLayer(14)
+ <td> <I>Select Layer 14</I><br>SelectLayer(14)
+<tr bgcolor="#FFFFFF">
+ <th align=left>4-alt-ctrl
+ <td> <I>Toggle Layer 14</I><br>ToggleView(14)
+ <td> <I>Toggle Layer 14</I><br>ToggleView(14)
+<tr bgcolor="#DDFFFF">
+ <th align=left>4-ctrl
+ <td> <I>Toggle Layer 4</I><br>ToggleView(4)
+ <td> <I>Toggle Layer 4</I><br>ToggleView(4)
+<tr bgcolor="#FFFFFF">
+ <th align=left>4-shift
+ <td> <I>#4</I><br>PasteBuffer(4)
+ <td> <I>Select Buffer #4</I><br>PasteBuffer(4)
+<tr bgcolor="#DDFFFF">
+ <th align=left>5
+ <td> <I>Select Layer 5</I><br>SelectLayer(5)
+ <td> <I>Select Layer 5</I><br>SelectLayer(5)
+<tr bgcolor="#FFFFFF">
+ <th align=left>5-alt
+ <td> <I>Select Layer 15</I><br>SelectLayer(15)
+ <td> <I>Select Layer 15</I><br>SelectLayer(15)
+<tr bgcolor="#DDFFFF">
+ <th align=left>5-alt-ctrl
+ <td> <I>Toggle Layer 15</I><br>ToggleView(15)
+ <td> <I>Toggle Layer 15</I><br>ToggleView(15)
+<tr bgcolor="#FFFFFF">
+ <th align=left>5-ctrl
+ <td> <I>Toggle Layer 5</I><br>ToggleView(5)
+ <td> <I>Toggle Layer 5</I><br>ToggleView(5)
+<tr bgcolor="#DDFFFF">
+ <th align=left>5-shift
+ <td> <I>#5</I><br>PasteBuffer(5)
+ <td> <I>Select Buffer #5</I><br>PasteBuffer(5)
+<tr bgcolor="#FFFFFF">
+ <th align=left>6
+ <td> <I>Select Layer 6</I><br>SelectLayer(6)
+ <td> <I>Select Layer 6</I><br>SelectLayer(6)
+<tr bgcolor="#DDFFFF">
+ <th align=left>6-alt
+ <td> <I>Select Layer 16</I><br>SelectLayer(16)
+ <td> <I>Select Layer 16</I><br>SelectLayer(16)
+<tr bgcolor="#FFFFFF">
+ <th align=left>6-alt-ctrl
+ <td> <I>Toggle Layer 16</I><br>ToggleView(16)
+ <td> <I>Toggle Layer 16</I><br>ToggleView(16)
+<tr bgcolor="#DDFFFF">
+ <th align=left>6-ctrl
+ <td> <I>Toggle Layer 6</I><br>ToggleView(6)
+ <td> <I>Toggle Layer 6</I><br>ToggleView(6)
+<tr bgcolor="#FFFFFF">
+ <th align=left>7
+ <td> <I>Select Layer 7</I><br>SelectLayer(7)
+ <td> <I>Select Layer 7</I><br>SelectLayer(7)
+<tr bgcolor="#DDFFFF">
+ <th align=left>7-alt
+ <td> <I>Select Layer 17</I><br>SelectLayer(17)
+ <td> <I>Select Layer 17</I><br>SelectLayer(17)
+<tr bgcolor="#FFFFFF">
+ <th align=left>7-alt-ctrl
+ <td> <I>Toggle Layer 17</I><br>ToggleView(17)
+ <td> <I>Toggle Layer 17</I><br>ToggleView(17)
+<tr bgcolor="#DDFFFF">
+ <th align=left>7-ctrl
+ <td> <I>Toggle Layer 7</I><br>ToggleView(7)
+ <td> <I>Toggle Layer 7</I><br>ToggleView(7)
+<tr bgcolor="#FFFFFF">
+ <th align=left>8
+ <td> <I>Select Layer 8</I><br>SelectLayer(8)
+ <td> <I>Select Layer 8</I><br>SelectLayer(8)
+<tr bgcolor="#DDFFFF">
+ <th align=left>8-alt
+ <td> <I>Select Layer 18</I><br>SelectLayer(18)
+ <td> <I>Select Layer 18</I><br>SelectLayer(18)
+<tr bgcolor="#FFFFFF">
+ <th align=left>8-alt-ctrl
+ <td> <I>Toggle Layer 18</I><br>ToggleView(18)
+ <td> <I>Toggle Layer 18</I><br>ToggleView(18)
+<tr bgcolor="#DDFFFF">
+ <th align=left>8-ctrl
+ <td> <I>Toggle Layer 8</I><br>ToggleView(8)
+ <td> <I>Toggle Layer 8</I><br>ToggleView(8)
+<tr bgcolor="#FFFFFF">
+ <th align=left>9
+ <td> <I>Select Layer 9</I><br>SelectLayer(9)
+ <td> <I>Select Layer 9</I><br>SelectLayer(9)
+<tr bgcolor="#DDFFFF">
+ <th align=left>9-alt
+ <td> <I>Select Layer 19</I><br>SelectLayer(19)
+ <td> <I>Select Layer 19</I><br>SelectLayer(19)
+<tr bgcolor="#FFFFFF">
+ <th align=left>9-alt-ctrl
+ <td> <I>Toggle Layer 19</I><br>ToggleView(19)
+ <td> <I>Toggle Layer 19</I><br>ToggleView(19)
+<tr bgcolor="#DDFFFF">
+ <th align=left>9-ctrl
+ <td> <I>Toggle Layer 9</I><br>ToggleView(9)
+ <td> <I>Toggle Layer 9</I><br>ToggleView(9)
+<tr bgcolor="#FFFFFF">
+ <th align=left>:
+ <td> <I>Command</I><br>Command()
+ <td> <I>Command Entry</I><br>Command()
+<tr bgcolor="#DDFFFF">
+ <th align=left>=
+ <td> <I>SimpleOpts</I><br>djopt(simple)
+ <td> <I>Simple optimization</I><br>djopt(simple)
+<tr bgcolor="#FFFFFF">
+ <th align=left>=-shift
+ <td> <I>Auto-Optimize</I><br>djopt(auto)
+ <td> <I>Auto-Optimize</I><br>djopt(auto)
+<tr bgcolor="#DDFFFF">
+ <th align=left>[
+ <td> <I>Temp Arrow ON</I><br>Mode(Save); Mode(Arrow); Mode(Notify)
+ <td> <I>Temp Arrow ON</I><br>Mode(Save); Mode(Arrow); Mode(Notify)
+<tr bgcolor="#FFFFFF">
+ <th align=left>\
+ <td>
+ <td> <I>Full screen</I><br>fullscreen(toggle)
+<tr bgcolor="#DDFFFF">
+ <th align=left>]
+ <td> <I>Temp Arrow OFF</I><br>Mode(Release); Mode(Restore)
+ <td> <I>Temp Arrow OFF</I><br>Mode(Release); Mode(Restore)
+<tr bgcolor="#FFFFFF">
+ <th align=left>`
+ <td> <I>Zoom Toggle</I><br>Zoom(Toggle)
+ <td>
+<tr bgcolor="#DDFFFF">
+ <th align=left>a
+ <td> <I>Set Same</I><br>SetSame()
+ <td> <I>Set Same</I><br>SetSame()
+<tr bgcolor="#FFFFFF">
+ <th align=left>a-alt
+ <td> <I>Select all visible</I><br>Select(All)
+ <td> <I>Select all visible</I><br>Select(All)
+<tr bgcolor="#DDFFFF">
+ <th align=left>a-alt-shift
+ <td> <I>Unselect all</I><br>Unselect(All)
+ <td> <I>Unselect all</I><br>Unselect(All)
+<tr bgcolor="#FFFFFF">
+ <th align=left>b
+ <td> <I>Flip Object</I><br>Flip(Object)
+ <td> <I>Flip Object</I><br>Flip(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>b-alt-ctrl
+ <td>
+ <td> <I>netlist patch for back annotation</I><br>SavePatch()
+<tr bgcolor="#FFFFFF">
+ <th align=left>b-shift
+ <td> <I>Move selected elements to other side</I><br>Flip(SelectedElements)
+ <td> <I>Move selected elements to other side</I><br>Flip(SelectedElements)
+<tr bgcolor="#DDFFFF">
+ <th align=left>backspace
+ <td> <I>Remove</I><br>Delete(Selected)
+ <td> <I>Remove Selected</I><br>RemoveSelected()
+<tr bgcolor="#FFFFFF">
+ <th align=left>backspace-shift
+ <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
+ <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
+<tr bgcolor="#DDFFFF">
+ <th align=left>c
+ <td> <I>Center cursor</I><br>Center()
+ <td> <I>Center cursor</I><br>Center()
+<tr bgcolor="#FFFFFF">
+ <th align=left>c-ctrl
+ <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Mode(PasteBuffer)
+ <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
+<tr bgcolor="#DDFFFF">
+ <th align=left>d
+ <td> <I>Pins/Via show Name/Number</I><br>Display(PinOrPadName)
+ <td> <I>Pins/Via show Name/Number</I><br>Display(PinOrPadName)
+<tr bgcolor="#FFFFFF">
+ <th align=left>d-shift
+ <td> <I>Pinout</I><br>Display(Pinout)
+<br> <b>Error: key prefix collision</b>
+ <td> <I>Pinout</I><br>Display(Pinout)
+<tr bgcolor="#DDFFFF">
+ <th align=left>delete
+ <td> <I>Delete selected objects</I><br>Delete(Selected)
+ <td> <I>Remove</I><br>Mode(Save); Mode(Remove); Mode(Notify); Mode(Restore)
+<tr bgcolor="#FFFFFF">
+ <th align=left>delete-shift
+ <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
+ <td> <I>Remove selected objects</I><br>RemoveSelected()
+<tr bgcolor="#DDFFFF">
+ <th align=left>down
+ <td> <I>Step Down</I><br>Cursor(Warp,0,-1,grid)
+ <td> <I>Step Down</I><br>Cursor(Warp,0,-1,grid)
+<tr bgcolor="#FFFFFF">
+ <th align=left>down-shift
+ <td> <I>Step +Down</I><br>Cursor(Pan,0,-50,view)
+ <td> <I>Step +Down</I><br>Cursor(Pan,0,-50,view)
+<tr bgcolor="#DDFFFF">
+ <th align=left>e
+ <td> <I>Erase rats-nest</I><br>DeleteRats(AllRats)
+ <td> <I>Erase rats nest</I><br>DeleteRats(AllRats)
+<tr bgcolor="#FFFFFF">
+ <th align=left>e-ctrl
+ <td>
+ <td> <I>Edit properties of selected...</I><br>PropEdit(Selected)
+<tr bgcolor="#DDFFFF">
+ <th align=left>e-shift
+ <td> <I>Erase selected rats</I><br>DeleteRats(SelectedRats)
+ <td> <I>Erase selected rats</I><br>DeleteRats(SelectedRats)
+<tr bgcolor="#FFFFFF">
+ <th align=left>enter
+ <td> <I>"Click"</I><br>Mode(Notify); Mode(Release)
+ <td> <I>Click</I><br>Mode(Notify); Mode(Release)
+<tr bgcolor="#DDFFFF">
+ <th align=left>escape
+ <td> <I>Cancel</I><br>Mode(Cancel)
+ <td> <I>Cancel</I><br>Mode(Escape)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f
+ <td> <I>Find Connections</I><br>Connection(Reset); Connection(Find)
+ <td> <I>Find Connections</I><br>Connection(Reset); Connection(Find)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f-alt-shift
+ <td>
+ <td> <I>Replace footprint</I><br>ReplaceFootprint()
+<tr bgcolor="#FFFFFF">
+ <th align=left>f-ctrl
+ <td> <I>Lookup connection to object</I><br>GetXY(Click on the object); Connection(Find)
+ <td> <I>Lookup connection to object</I><br>GetXY(Click on the object); Connection(Find)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f-shift
+ <td> <I>Reset all connections</I><br>Connection(Reset); Display(Redraw)
+ <td> <I>Reset all connections</I><br>Connection(Reset); Display(Redraw)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f1
+ <td> <I>Via</I><br>Mode(Via)
+ <td> <I>Via</I><br>Mode(Via)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f10
+ <td> <I>Thermal</I><br>Mode(Thermal)
+ <td> <I>Thermal</I><br>Mode(Thermal)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f11
+ <td> <I>Arrow</I><br>Mode(Arrow)
+ <td> <I>Arrow</I><br>Mode(Arrow)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f12
+ <td> <I>Lock</I><br>Mode(Lock)
+ <td> <I>Lock</I><br>Mode(Lock)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f2
+ <td> <I>Line</I><br>Mode(Line)
+ <td> <I>Line</I><br>Mode(Line)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f3
+ <td> <I>Arc</I><br>Mode(Arc)
+ <td> <I>Arc</I><br>Mode(Arc)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f4
+ <td> <I>Text</I><br>Mode(Text)
+ <td> <I>Text</I><br>Mode(Text)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f5
+ <td> <I>Rectangle</I><br>Mode(Rectangle)
+ <td> <I>Rectangle</I><br>Mode(Rectangle)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f6
+ <td> <I>Polygon</I><br>Mode(Polygon)
+ <td> <I>Polygon</I><br>Mode(Polygon)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f7
+ <td> <I>Buffer</I><br>Mode(PasteBuffer)
+ <td> <I>Buffer</I><br>Mode(PasteBuffer)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f7-shift
+ <td> <I>Rotate buffer 90 deg CCW</I><br>Mode(PasteBuffer); PasteBuffer(Rotate,1)
+ <td> <I>Rotate buffer 90 deg CCW</I><br>Mode(PasteBuffer); PasteBuffer(Rotate,1)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f8
+ <td> <I>Remove</I><br>Mode(Remove)
+ <td> <I>Remove</I><br>Mode(Remove)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f9
+ <td> <I>Rotate</I><br>Mode(Rotate)
+ <td> <I>Rotate</I><br>Mode(Rotate)
+<tr bgcolor="#DDFFFF">
+ <th align=left>g
+ <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
+ <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>g-ctrl
+ <td> <I>Grid +0.05mm</I><br>SetValue(Grid,+0.05,mm)
+ <td> <I>Grid +0.05mm</I><br>SetValue(Grid,+0.05,mm)
+<tr bgcolor="#DDFFFF">
+ <th align=left>g-ctrl-shift
+ <td> <I>Grid -0.05mm</I><br>SetValue(Grid,-0.05,mm)
+ <td> <I>Grid -0.05mm</I><br>SetValue(Grid,-0.05,mm)
+<tr bgcolor="#FFFFFF">
+ <th align=left>g-shift
+ <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
+ <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>h
+ <td> <I>ToggleHideName Object</I><br>ToggleHideName(Object)
+ <td> <I>ToggleHideName Object</I><br>ToggleHideName(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>h-ctrl
+ <td> <I>ChangeHole Object</I><br>ChangeHole(Object)
+ <td> <I>ChangeHole Object</I><br>ChangeHole(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>h-shift
+ <td> <I>ToggleHideName SelectedElement</I><br>ToggleHideName(SelectedElements)
+ <td> <I>ToggleHideName SelectedElement</I><br>ToggleHideName(SelectedElements)
+<tr bgcolor="#FFFFFF">
+ <th align=left>i
+ <td>
+ <td> <I>Library</I><br>DoWindows(Library)
+<tr bgcolor="#DDFFFF">
+ <th align=left>insert
+ <td> <I>Insert Point</I><br>Mode(InsertPoint)
+ <td> <I>Insert Point</I><br>Mode(InsertPoint)
+<tr bgcolor="#FFFFFF">
+ <th align=left>j
+ <td> <I>ChangeJoin Object</I><br>ChangeJoin(Object)
+ <td> <I>ChangeJoin Object</I><br>ChangeJoin(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>j-shift
+ <td> <I>ChangeJoin SelectedObject</I><br>ChangeJoin(SelectedObjects)
+ <td> <I>ChangeJoin SelectedObject</I><br>ChangeJoin(SelectedObjects)
+<tr bgcolor="#FFFFFF">
+ <th align=left>k
+ <td> <I>Clear Object +2 mil</I><br>ChangeClearSize(Object,+2,mil)
+ <td> <I>Clear Object +2 mil</I><br>ChangeClearSize(Object,+2,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>k-ctrl
+ <td> <I>Clear Selected +2 mil</I><br>ChangeClearSize(SelectedObjects,+2,mil)
+ <td> <I>Clear Selected +2 mil</I><br>ChangeClearSize(SelectedObjects,+2,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>k-ctrl-shift
+ <td> <I>Clear Selected -2 mil</I><br>ChangeClearSize(SelectedObjects,-2,mil)
+ <td> <I>Clear Selected -2 mil</I><br>ChangeClearSize(SelectedObjects,-2,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>k-shift
+ <td> <I>Clear Object -2 mil</I><br>ChangeClearSize(Object,-2,mil)
+ <td> <I>Clear Object -2 mil</I><br>ChangeClearSize(Object,-2,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>l
+ <td> <I>Line Tool size +5 mil</I><br>SetValue(LineSize,+5,mil)
+ <td> <I>Line Tool size +5 mil</I><br>SetValue(LineSize,+5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>l-shift
+ <td> <I>Line Tool size -5 mil</I><br>SetValue(LineSize,-5,mil)
+ <td> <I>Line Tool size -5 mil</I><br>SetValue(LineSize,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>left
+ <td> <I>Step Left</I><br>Cursor(Warp,-1,0,grid)
+ <td> <I>Step Left</I><br>Cursor(Warp,-1,0,grid)
+<tr bgcolor="#DDFFFF">
+ <th align=left>left-shift
+ <td> <I>Step +Left</I><br>Cursor(Pan,-50,0,view)
+ <td> <I>Step +Left</I><br>Cursor(Pan,-50,0,view)
+<tr bgcolor="#FFFFFF">
+ <th align=left>m
+ <td> <I>Move Object to current layer</I><br>MoveToCurrentLayer(Object)
+ <td> <I>Move Object to current layer</I><br>MoveToCurrentLayer(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>m-ctrl
+ <td> <I>MarkCrosshair</I><br>MarkCrosshair()
+ <td> <I>MarkCrosshair</I><br>MarkCrosshair()
+<tr bgcolor="#FFFFFF">
+ <th align=left>m-shift
+ <td> <I>Move selected to current layer</I><br>MoveToCurrentLayer(Selected)
+ <td> <I>Move selected to current layer</I><br>MoveToCurrentLayer(Selected)
+<tr bgcolor="#DDFFFF">
+ <th align=left>n
+ <td> <I>Change text on layout</I><br>ChangeName(Object)
+ <td> <I>text on layout</I><br>ChangeName(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>n-alt
+ <td>
+ <td> <I>Nonetlist</I><br>ChangeNonetlist(Element)
+<tr bgcolor="#DDFFFF">
+ <th align=left>n-ctrl
+ <td> <I>Start new layout</I><br>New()
+ <td> <I>Start New Layout</I><br>New()
+<tr bgcolor="#FFFFFF">
+ <th align=left>n-ctrl-shift
+ <td> <I>Change text on layout</I><br>ChangeName(Object, Number)
+ <td> <I>pin on layout</I><br>ChangeName(Object, Number)
+<tr bgcolor="#DDFFFF">
+ <th align=left>n-shift
+ <td> <I>Select shortest rat</I><br>AddRats(Close)
+ <td> <I>Select shortest rat</I><br>AddRats(Close)
+<tr bgcolor="#FFFFFF">
+ <th align=left>o
+ <td> <I>Optimize rats-nest</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)
+ <td> <I>Optimize rats nest</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)
+<tr bgcolor="#DDFFFF">
+ <th align=left>o-ctrl
+ <td> <I>ChangeOctagon Object</I><br>ChangeOctagon(Object)
+ <td> <I>ChangeOctagon Object</I><br>ChangeOctagon(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>o-shift
+ <td> <I>AddRats to selected pins</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)
+ <td> <I>AddRats to selected pins</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)
+<tr bgcolor="#DDFFFF">
+ <th align=left>p
+ <td> <I>Polygon PreviousPoint</I><br>Polygon(PreviousPoint)
+ <td> <I>Polygon PreviousPoint</I><br>Polygon(PreviousPoint)
+<tr bgcolor="#FFFFFF">
+ <th align=left>p-alt
+ <td> <I>Manage plugins...</I><br>ManagePlugins()
+ <td> <I>Manage plugins...</I><br>ManagePlugins()
+<tr bgcolor="#DDFFFF">
+ <th align=left>p-ctrl
+ <td> <I>Auto-place selected elements</I><br>AutoPlaceSelected()
+ <td> <I>Auto-place selected elements</I><br>AutoPlaceSelected()
+<tr bgcolor="#FFFFFF">
+ <th align=left>p-ctrl-shift
+ <td> <I>Thin draw poly</I><br>conf(toggle, editor/thin_draw_poly, design)
+ <td> <I>Thin draw poly</I><br>conf(toggle, editor/thin_draw_poly, design)
+<tr bgcolor="#DDFFFF">
+ <th align=left>p-shift
+ <td> <I>Polygon Close</I><br>Polygon(Close)
+ <td> <I>Polygon Close</I><br>Polygon(Close)
+<tr bgcolor="#FFFFFF">
+ <th align=left>q
+ <td> <I>ChangeSquare Object</I><br>ChangeSquare(Object)
+ <td> <I>ChangeSquare Object</I><br>ChangeSquare(ToggleObject)
+<tr bgcolor="#DDFFFF">
+ <th align=left>q-ctrl
+ <td> <I>Quit Program</I><br>Quit()
+ <td> <I>Quit Program</I><br>Quit()
+<tr bgcolor="#FFFFFF">
+ <th align=left>r
+ <td> <I>Report net length</I><br>Report(NetLength)
+ <td>
+<tr bgcolor="#DDFFFF">
+ <th align=left>r-alt
+ <td> <I>Auto-route selected rats</I><br>AutoRoute(SelectedRats)
+ <td> <I>Auto-route selected rats</I><br>AutoRoute(SelectedRats)
+<tr bgcolor="#FFFFFF">
+ <th align=left>r-ctrl
+ <td> <I>Generate object report</I><br>ReportObject()
+ <td> <I>Generate object report</I><br>ReportObject()
+<tr bgcolor="#DDFFFF">
+ <th align=left>r-shift
+ <td> <I>Redo last undone operation</I><br>Redo()
+ <td> <I>Redo last undone operation</I><br>Redo()
+<tr bgcolor="#FFFFFF">
+ <th align=left>right
+ <td> <I>Step Right</I><br>Cursor(Warp,1,0,grid)
+ <td> <I>Step Right</I><br>Cursor(Warp,1,0,grid)
+<tr bgcolor="#DDFFFF">
+ <th align=left>right-shift
+ <td> <I>Step +Right</I><br>Cursor(Pan,50,0,view)
+ <td> <I>Step +Right</I><br>Cursor(Pan,50,0,view)
+<tr bgcolor="#FFFFFF">
+ <th align=left>s
+ <td> <I>ChangeSize +5 mil</I><br>ChangeSize(Object,+5,mil)
+ <td> <I>ChangeSize +5 mil</I><br>ChangeSize(Object,+5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>s-alt
+ <td> <I>ChangeDrill +5 mil</I><br>ChangeDrillSize(Object,+5,mil)
+ <td> <I>ChangeDrill +5 mil</I><br>ChangeDrillSize(Object,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>s-alt-shift
+ <td> <I>ChangeDrill -5 mil</I><br>ChangeDrillSize(Object,-5,mil)
+ <td> <I>ChangeDrill -5 mil</I><br>ChangeDrillSize(Object,-5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>s-ctrl
+ <td> <I>Save layout</I><br>Save(Layout)
+ <td> <I>Save Layout</I><br>Save(Layout)
+<tr bgcolor="#FFFFFF">
+ <th align=left>s-ctrl-shift
+ <td> <I>Save layout as...</I><br>Save(LayoutAs)
+ <td> <I>Save Layout As...</I><br>Save(LayoutAs)
+<tr bgcolor="#DDFFFF">
+ <th align=left>s-shift
+ <td> <I>ChangeSize -5 mil</I><br>ChangeSize(Object,-5,mil)
+ <td> <I>ChangeSize -5 mil</I><br>ChangeSize(Object,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>space
+ <td> <I>Arrow</I><br>Mode(Arrow)
+ <td> <I>Arrow Mode</I><br>Mode(Arrow)
+<tr bgcolor="#DDFFFF">
+ <th align=left>t
+ <td> <I>Text Tool scale +10 mil</I><br>SetValue(TextScale,+10,mil)
+ <td> <I>Text Tool scale +10 mil</I><br>SetValue(TextScale,+10,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>t-shift
+ <td> <I>Text Tool scale -10 mil</I><br>SetValue(TextScale,-10,mil)
+ <td> <I>Text Tool scale -10 mil</I><br>SetValue(TextScale,-10,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>tab
+ <td> <I>Flip up/down</I><br>SwapSides(V)
+ <td> <I>Flip up/down</I><br>SwapSides(V)
+<tr bgcolor="#FFFFFF">
+ <th align=left>tab-ctrl
+ <td> <I>Spin 180°</I><br>SwapSides(R)
+ <td> <I>Spin 180 degrees</I><br>SwapSides(R)
+<tr bgcolor="#DDFFFF">
+ <th align=left>tab-ctrl-shift
+ <td> <I>Swap Sides</I><br>SwapSides()
+ <td> <I>Swap Sides</I><br>SwapSides()
+<tr bgcolor="#FFFFFF">
+ <th align=left>tab-shift
+ <td> <I>Flip left/right</I><br>SwapSides(H)
+ <td> <I>Flip left/right</I><br>SwapSides(H)
+<tr bgcolor="#DDFFFF">
+ <th align=left>u
+ <td> <I>Undo last operation</I><br>Undo()
+ <td> <I>Undo last operation</I><br>Undo()
+<tr bgcolor="#FFFFFF">
+ <th align=left>u-ctrl-shift
+ <td> <I>Clear undo-buffer</I><br>Undo(ClearList)
+ <td> <I>Clear undo-buffer</I><br>Undo(ClearList)
+<tr bgcolor="#DDFFFF">
+ <th align=left>up
+ <td> <I>Step Up</I><br>Cursor(Warp,0,1,grid)
+ <td> <I>Step Up</I><br>Cursor(Warp,0,1,grid)
+<tr bgcolor="#FFFFFF">
+ <th align=left>up-shift
+ <td> <I>Step +Up</I><br>Cursor(Pan,0,50,view)
+ <td> <I>Step +Up</I><br>Cursor(Pan,0,50,view)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v
+ <td> <I>Zoom Max</I><br>Zoom()
+ <td> <I>Zoom Max</I><br>Zoom()
+<tr bgcolor="#FFFFFF">
+ <th align=left>v-alt
+ <td> <I>Via Tool drill +5 mil</I><br>SetValue(ViaDrillingHole,+5,mil)
+ <td> <I>Via Tool drill +5 mil</I><br>SetValue(ViaDrillingHole,+5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v-alt-shift
+ <td> <I>Via Tool drill -5 mil</I><br>SetValue(ViaDrillingHole,-5,mil)
+ <td> <I>Via Tool drill -5 mil</I><br>SetValue(ViaDrillingHole,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>v-ctrl
+ <td> <I>Paste buffer to layout</I><br>Mode(PasteBuffer)
+ <td> <I>Paste buffer to layout</I><br>Mode(PasteBuffer)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v-ctrl-shift
+ <td> <I>Via Tool size -5 mil</I><br>SetValue(ViaSize,-5,mil)
+ <td> <I>Via Tool size -5 mil</I><br>SetValue(ViaSize,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>v-shift
+ <td> <I>Via Tool size +5 mil</I><br>SetValue(ViaSize,+5,mil)
+ <td> <I>Via Tool size +5 mil</I><br>SetValue(ViaSize,+5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>w
+ <td> <I>Add All Rats</I><br>AddRats(AllRats)
+ <td> <I>Add All Rats</I><br>AddRats(AllRats)
+<tr bgcolor="#FFFFFF">
+ <th align=left>w-shift
+ <td> <I>AddRats Selected</I><br>AddRats(SelectedRats)
+ <td> <I>AddRats Selected</I><br>AddRats(SelectedRats)
+<tr bgcolor="#DDFFFF">
+ <th align=left>x
+ <td>
+ <td> <I>Cycle object being dragged</I><br>CycleDrag()
+<tr bgcolor="#FFFFFF">
+ <th align=left>x-ctrl
+ <td> <I>Cut selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
+ <td> <I>Cut selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
+<tr bgcolor="#DDFFFF">
+ <th align=left>x-shift
+ <td>
+ <td> <I>Swap nets on two selected pins</I><br>net(swap)
+<tr bgcolor="#FFFFFF">
+ <th align=left>y
+ <td> <I>Puller</I><br>Puller()
+ <td> <I>Puller</I><br>Puller()
+<tr bgcolor="#DDFFFF">
+ <th align=left>y-shift
+ <td> <I>ChangeSizes to Route style</I><br>ChangeSizes(Object,style,mil)
+ <td> <I>ChangeSizes to Route style</I><br>ChangeSizes(Object,style,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>z
+ <td> <I>Zoom In 20%</I><br>Zoom(-1.2)
+ <td> <I>Zoom In 20%</I><br>Zoom(-1.2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>z-alt
+ <td> <I>Undo</I><br>Undo()
+ <td>
+<tr bgcolor="#FFFFFF">
+ <th align=left>z-shift
+ <td> <I>Zoom Out 20%</I><br>Zoom(+1.2)
+ <td> <I>Zoom Out 20%</I><br>Zoom(+1.2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>|
+ <td> <I>Thin draw</I><br>conf(toggle, editor/thin_draw, design)
+ <td> <I>Thin draw</I><br>conf(toggle, editor/thin_draw, design)
+</table>
+<br>pcb-menu-lesstif.lht: d-shift vs. d-shift;
+</body></html>
diff --git a/doc/keys_mkey.html b/doc/keys_mkey.html
new file mode 100644
index 0000000..079dd48
--- /dev/null
+++ b/doc/keys_mkey.html
@@ -0,0 +1,518 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- This file is generated by util/keylist.sh. DO NOT EDIT. -->
+<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+ <title> Key to action bindings </title>
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+<h1> Key to action bindings </h1>
+<table border=1 cellspacing=0>
+<tr><th> key <th>pcb-menu-mkey.lht
+<tr bgcolor="#DDFFFF">
+ <th align=left>.
+ <td> <I>'All-direction' lines</I><br>conf(toggle, editor/all_direction_lines, design)
+<tr bgcolor="#FFFFFF">
+ <th align=left>/
+ <td> <I>Cycle Clip</I><br>Display(CycleClip)
+<tr bgcolor="#DDFFFF">
+ <th align=left>0
+ <td> <I>Select Layer 10</I><br>SelectLayer(10)
+<tr bgcolor="#FFFFFF">
+ <th align=left>0-alt
+ <td> <I>Select Layer 20</I><br>SelectLayer(20)
+<tr bgcolor="#DDFFFF">
+ <th align=left>0-alt-ctrl
+ <td> <I>Toggle Layer 20</I><br>ToggleView(20)
+<tr bgcolor="#FFFFFF">
+ <th align=left>0-ctrl
+ <td> <I>Toggle Layer 10</I><br>ToggleView(10)
+<tr bgcolor="#DDFFFF">
+ <th align=left>1
+ <td> <I>Select Layer 1</I><br>SelectLayer(1)
+<tr bgcolor="#FFFFFF">
+ <th align=left>1-alt
+ <td> <I>Select Layer 11</I><br>SelectLayer(11)
+<tr bgcolor="#DDFFFF">
+ <th align=left>1-alt-ctrl
+ <td> <I>Toggle Layer 11</I><br>ToggleView(11)
+<tr bgcolor="#FFFFFF">
+ <th align=left>1-ctrl
+ <td> <I>Toggle Layer 1</I><br>ToggleView(1)
+<tr bgcolor="#DDFFFF">
+ <th align=left>1-shift
+ <td> <I>Buffer/Select Buffer #1</I><br>PasteBuffer(1)
+<tr bgcolor="#FFFFFF">
+ <th align=left>2
+ <td> <I>Select Layer 2</I><br>SelectLayer(2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>2-alt
+ <td> <I>Select Layer 12</I><br>SelectLayer(12)
+<tr bgcolor="#FFFFFF">
+ <th align=left>2-alt-ctrl
+ <td> <I>Toggle Layer 12</I><br>ToggleView(12)
+<tr bgcolor="#DDFFFF">
+ <th align=left>2-ctrl
+ <td> <I>Toggle Layer 2</I><br>ToggleView(2)
+<tr bgcolor="#FFFFFF">
+ <th align=left>2-shift
+ <td> <I>Buffer/Select Buffer #2</I><br>PasteBuffer(2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>3
+ <td> <I>Select Layer 3</I><br>SelectLayer(3)
+<tr bgcolor="#FFFFFF">
+ <th align=left>3-alt
+ <td> <I>Select Layer 13</I><br>SelectLayer(13)
+<tr bgcolor="#DDFFFF">
+ <th align=left>3-alt-ctrl
+ <td> <I>Toggle Layer 13</I><br>ToggleView(13)
+<tr bgcolor="#FFFFFF">
+ <th align=left>3-ctrl
+ <td> <I>Toggle Layer 3</I><br>ToggleView(3)
+<tr bgcolor="#DDFFFF">
+ <th align=left>3-shift
+ <td> <I>Buffer/Select Buffer #3</I><br>PasteBuffer(3)
+<tr bgcolor="#FFFFFF">
+ <th align=left>4
+ <td> <I>Select Layer 4</I><br>SelectLayer(4)
+<tr bgcolor="#DDFFFF">
+ <th align=left>4-alt
+ <td> <I>Select Layer 14</I><br>SelectLayer(14)
+<tr bgcolor="#FFFFFF">
+ <th align=left>4-alt-ctrl
+ <td> <I>Toggle Layer 14</I><br>ToggleView(14)
+<tr bgcolor="#DDFFFF">
+ <th align=left>4-ctrl
+ <td> <I>Toggle Layer 4</I><br>ToggleView(4)
+<tr bgcolor="#FFFFFF">
+ <th align=left>4-shift
+ <td> <I>Buffer/Select Buffer #4</I><br>PasteBuffer(4)
+<tr bgcolor="#DDFFFF">
+ <th align=left>5
+ <td> <I>Select Layer 5</I><br>SelectLayer(5)
+<tr bgcolor="#FFFFFF">
+ <th align=left>5-alt
+ <td> <I>Select Layer 15</I><br>SelectLayer(15)
+<tr bgcolor="#DDFFFF">
+ <th align=left>5-alt-ctrl
+ <td> <I>Toggle Layer 15</I><br>ToggleView(15)
+<tr bgcolor="#FFFFFF">
+ <th align=left>5-ctrl
+ <td> <I>Toggle Layer 5</I><br>ToggleView(5)
+<tr bgcolor="#DDFFFF">
+ <th align=left>5-shift
+ <td> <I>Buffer/Select Buffer #5</I><br>PasteBuffer(5)
+<tr bgcolor="#FFFFFF">
+ <th align=left>6
+ <td> <I>Select Layer 6</I><br>SelectLayer(6)
+<tr bgcolor="#DDFFFF">
+ <th align=left>6-alt
+ <td> <I>Select Layer 16</I><br>SelectLayer(16)
+<tr bgcolor="#FFFFFF">
+ <th align=left>6-alt-ctrl
+ <td> <I>Toggle Layer 16</I><br>ToggleView(16)
+<tr bgcolor="#DDFFFF">
+ <th align=left>6-ctrl
+ <td> <I>Toggle Layer 6</I><br>ToggleView(6)
+<tr bgcolor="#FFFFFF">
+ <th align=left>7
+ <td> <I>Select Layer 7</I><br>SelectLayer(7)
+<tr bgcolor="#DDFFFF">
+ <th align=left>7-alt
+ <td> <I>Select Layer 17</I><br>SelectLayer(17)
+<tr bgcolor="#FFFFFF">
+ <th align=left>7-alt-ctrl
+ <td> <I>Toggle Layer 17</I><br>ToggleView(17)
+<tr bgcolor="#DDFFFF">
+ <th align=left>7-ctrl
+ <td> <I>Toggle Layer 7</I><br>ToggleView(7)
+<tr bgcolor="#FFFFFF">
+ <th align=left>8
+ <td> <I>Select Layer 8</I><br>SelectLayer(8)
+<tr bgcolor="#DDFFFF">
+ <th align=left>8-alt
+ <td> <I>Select Layer 18</I><br>SelectLayer(18)
+<tr bgcolor="#FFFFFF">
+ <th align=left>8-alt-ctrl
+ <td> <I>Toggle Layer 18</I><br>ToggleView(18)
+<tr bgcolor="#DDFFFF">
+ <th align=left>8-ctrl
+ <td> <I>Toggle Layer 8</I><br>ToggleView(8)
+<tr bgcolor="#FFFFFF">
+ <th align=left>9
+ <td> <I>Select Layer 9</I><br>SelectLayer(9)
+<tr bgcolor="#DDFFFF">
+ <th align=left>9-alt
+ <td> <I>Select Layer 19</I><br>SelectLayer(19)
+<tr bgcolor="#FFFFFF">
+ <th align=left>9-alt-ctrl
+ <td> <I>Toggle Layer 19</I><br>ToggleView(19)
+<tr bgcolor="#DDFFFF">
+ <th align=left>9-ctrl
+ <td> <I>Toggle Layer 9</I><br>ToggleView(9)
+<tr bgcolor="#FFFFFF">
+ <th align=left>:
+ <td> <I>Command Entry</I><br>Command()
+<tr bgcolor="#DDFFFF">
+ <th align=left>=
+ <td> <I>Simple optimization</I><br>djopt(simple)
+<tr bgcolor="#FFFFFF">
+ <th align=left>=-shift
+ <td> <I>Auto-Optimize</I><br>djopt(auto)
+<tr bgcolor="#DDFFFF">
+ <th align=left>[
+ <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>\
+ <td> <I>Full screen</I><br>fullscreen(toggle)
+<tr bgcolor="#DDFFFF">
+ <th align=left>]
+ <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>a-alt
+ <td> <I>Select all visible</I><br>Select(All)
+<tr bgcolor="#DDFFFF">
+ <th align=left>a-alt-shift
+ <td> <I>Unselect all</I><br>Unselect(All)
+<tr bgcolor="#FFFFFF">
+ <th align=left>a<br> c
+ <td> <I>Library</I><br>DoWindows(Library)
+<tr bgcolor="#DDFFFF">
+ <th align=left>b
+ <td> <I>Flip Object</I><br>Flip(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>b-alt-ctrl
+ <td> <I>netlist patch for back annotation</I><br>SavePatch()
+<tr bgcolor="#DDFFFF">
+ <th align=left>b-shift
+ <td> <I>Move selected elements to other side</I><br>Flip(SelectedElements)
+<tr bgcolor="#FFFFFF">
+ <th align=left>backspace
+ <td> <I>Remove Selected</I><br>RemoveSelected()
+<tr bgcolor="#DDFFFF">
+ <th align=left>backspace-shift
+ <td> <I>Remove Connected</I><br>Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)
+<tr bgcolor="#FFFFFF">
+ <th align=left>c
+ <td> <I>Center cursor</I><br>Center()
+<tr bgcolor="#DDFFFF">
+ <th align=left>c-ctrl<br>
+ <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
+<tr bgcolor="#FFFFFF">
+ <th align=left>d
+ <td> <I>Pins/Via show Name/Number</I><br>Display(PinOrPadName)
+<tr bgcolor="#DDFFFF">
+ <th align=left>d-shift
+ <td> <I>Pinout</I><br>Display(Pinout)
+<tr bgcolor="#FFFFFF">
+ <th align=left>delete
+ <td> <I>Remove</I><br>Mode(Save); Mode(Remove); Mode(Notify); Mode(Restore)
+<tr bgcolor="#DDFFFF">
+ <th align=left>delete-shift
+ <td> <I>Remove selected objects</I><br>RemoveSelected()
+<tr bgcolor="#FFFFFF">
+ <th align=left>down
+ <td> <I>Step Down</I><br>Cursor(Warp,0,-1,grid)
+<tr bgcolor="#DDFFFF">
+ <th align=left>down-shift
+ <td> <I>Step +Down</I><br>Cursor(Pan,0,-50,view)
+<tr bgcolor="#FFFFFF">
+ <th align=left>e-shift
+ <td> <I>Erase selected rats</I><br>DeleteRats(SelectedRats)
+<tr bgcolor="#DDFFFF">
+ <th align=left>e<br> c
+ <td> <I>Copy selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
+<tr bgcolor="#FFFFFF">
+ <th align=left>e<br> d
+ <td> <I>Remove</I><br>Mode(Save); Mode(Remove); Mode(Notify); Mode(Restore)
+<tr bgcolor="#DDFFFF">
+ <th align=left>e<br> i
+ <td> <I>Buffer/Mirror buffer (up/down)</I><br>Mode(PasteBuffer); PasteBuffer(Mirror)
+<tr bgcolor="#FFFFFF">
+ <th align=left>e<br> r
+ <td> <I>Rotate buffer 90 deg CCW</I><br>
+<tr bgcolor="#DDFFFF">
+ <th align=left>e<br> r-shift
+ <td> <I>Redo last undone operation</I><br>Redo()
+<tr bgcolor="#FFFFFF">
+ <th align=left>e<br> u-shift
+ <td> <I>Undo last operation</I><br>Undo()
+<tr bgcolor="#DDFFFF">
+ <th align=left>e<br> x
+ <td> <I>text on layout</I><br>ChangeName(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>enter
+ <td> <I>Click</I><br>Mode(Notify); Mode(Release)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f-alt-shift
+ <td> <I>Replace footprint</I><br>ReplaceFootprint()
+<tr bgcolor="#FFFFFF">
+ <th align=left>f-ctrl
+ <td> <I>Lookup connection to object</I><br>GetXY(Click on the object); Connection(Find)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f-shift
+ <td> <I>Reset all connections</I><br>Connection(Reset); Display(Redraw)
+<tr bgcolor="#FFFFFF">
+ <th align=left>f<br> a
+ <td> <I>Save Layout As...</I><br>Save(LayoutAs)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f<br> c
+ <td> <I>Quit Program</I><br>Quit()
+<tr bgcolor="#FFFFFF">
+ <th align=left>f<br> i
+ <td> <I>Export layout...</I><br>ExportGUI()
+<tr bgcolor="#DDFFFF">
+ <th align=left>f<br> n
+ <td> <I>Start New Layout</I><br>New()
+<tr bgcolor="#FFFFFF">
+ <th align=left>f<br> o
+ <td> <I>Load layout</I><br>Load(Layout)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f<br> p
+ <td> <I>Print layout...</I><br>Print()
+<tr bgcolor="#FFFFFF">
+ <th align=left>f<br> r
+ <td> <I>Revert</I><br>Load(Revert,none)
+<tr bgcolor="#DDFFFF">
+ <th align=left>f<br> s
+ <td> <I>Save Layout</I><br>Save(Layout)
+<tr bgcolor="#FFFFFF">
+ <th align=left>g
+ <td> <I>Grid +5mil</I><br>SetValue(Grid,+5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>g-ctrl
+ <td> <I>Grid +0.05mm</I><br>SetValue(Grid,+0.05,mm)
+<tr bgcolor="#FFFFFF">
+ <th align=left>g-ctrl-shift
+ <td> <I>Grid -0.05mm</I><br>SetValue(Grid,-0.05,mm)
+<tr bgcolor="#DDFFFF">
+ <th align=left>g-shift
+ <td> <I>Grid -5mil</I><br>SetValue(Grid,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>h-ctrl
+ <td> <I>ChangeHole Object</I><br>ChangeHole(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>h-shift
+ <td> <I>ToggleHideName SelectedElement</I><br>ToggleHideName(SelectedElements)
+<tr bgcolor="#FFFFFF">
+ <th align=left>h<br> a
+ <td> <I>About...</I><br>About()
+<tr bgcolor="#DDFFFF">
+ <th align=left>j
+ <td> <I>ChangeJoin Object</I><br>ChangeJoin(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>j-shift
+ <td> <I>ChangeJoin SelectedObject</I><br>ChangeJoin(SelectedObjects)
+<tr bgcolor="#DDFFFF">
+ <th align=left>k
+ <td> <I>Clear Object +2 mil</I><br>ChangeClearSize(Object,+2,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>k-ctrl
+ <td> <I>Clear Selected +2 mil</I><br>ChangeClearSize(SelectedObjects,+2,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>k-ctrl-shift
+ <td> <I>Clear Selected -2 mil</I><br>ChangeClearSize(SelectedObjects,-2,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>k-shift
+ <td> <I>Clear Object -2 mil</I><br>ChangeClearSize(Object,-2,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>l
+ <td> <I>Line Tool size +5 mil</I><br>SetValue(LineSize,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>l-shift
+ <td> <I>Line Tool size -5 mil</I><br>SetValue(LineSize,-5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>left
+ <td> <I>Step Left</I><br>Cursor(Warp,-1,0,grid)
+<tr bgcolor="#FFFFFF">
+ <th align=left>left-shift
+ <td> <I>Step +Left</I><br>Cursor(Pan,-50,0,view)
+<tr bgcolor="#DDFFFF">
+ <th align=left>m
+ <td> <I>Move Object to current layer</I><br>MoveToCurrentLayer(Object)
+<tr bgcolor="#FFFFFF">
+ <th align=left>m-ctrl
+ <td> <I>MarkCrosshair</I><br>MarkCrosshair()
+<tr bgcolor="#DDFFFF">
+ <th align=left>m-shift
+ <td> <I>Move selected to current layer</I><br>MoveToCurrentLayer(Selected)
+<tr bgcolor="#FFFFFF">
+ <th align=left>n
+ <td> <I>text on layout</I><br>ChangeName(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>n-alt
+ <td> <I>Nonetlist</I><br>ChangeNonetlist(Element)
+<tr bgcolor="#FFFFFF">
+ <th align=left>n-ctrl
+ <td> <I>Start New Layout</I><br>New()
+<tr bgcolor="#DDFFFF">
+ <th align=left>n-ctrl-shift
+ <td> <I>pin on layout</I><br>ChangeName(Object, Number)
+<tr bgcolor="#FFFFFF">
+ <th align=left>n-shift
+ <td> <I>Select shortest rat</I><br>AddRats(Close)
+<tr bgcolor="#DDFFFF">
+ <th align=left>o
+ <td> <I>Optimize rats nest</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)
+<tr bgcolor="#FFFFFF">
+ <th align=left>o-ctrl
+ <td> <I>ChangeOctagon Object</I><br>ChangeOctagon(Object)
+<tr bgcolor="#DDFFFF">
+ <th align=left>o-shift
+ <td> <I>AddRats to selected pins</I><br>Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)
+<tr bgcolor="#FFFFFF">
+ <th align=left>p
+ <td> <I>Polygon PreviousPoint</I><br>Polygon(PreviousPoint)
+<tr bgcolor="#DDFFFF">
+ <th align=left>p-alt
+ <td> <I>Manage plugins...</I><br>ManagePlugins()
+<tr bgcolor="#FFFFFF">
+ <th align=left>p-ctrl
+ <td> <I>Auto-place selected elements</I><br>AutoPlaceSelected()
+<tr bgcolor="#DDFFFF">
+ <th align=left>p-ctrl-shift
+ <td> <I>Thin draw poly</I><br>conf(toggle, editor/thin_draw_poly, design)
+<tr bgcolor="#FFFFFF">
+ <th align=left>p-shift
+ <td> <I>Polygon Close</I><br>Polygon(Close)
+<tr bgcolor="#DDFFFF">
+ <th align=left>q
+ <td> <I>ChangeSquare Object</I><br>ChangeSquare(ToggleObject)
+<tr bgcolor="#FFFFFF">
+ <th align=left>q-ctrl
+ <td> <I>Quit Program</I><br>Quit()
+<tr bgcolor="#DDFFFF">
+ <th align=left>r-alt
+ <td> <I>Auto-route selected rats</I><br>AutoRoute(SelectedRats)
+<tr bgcolor="#FFFFFF">
+ <th align=left>r-ctrl
+ <td> <I>Generate object report</I><br>ReportObject()
+<tr bgcolor="#DDFFFF">
+ <th align=left>r-shift
+ <td> <I>Redo last undone operation</I><br>Redo()
+<tr bgcolor="#FFFFFF">
+ <th align=left>right
+ <td> <I>Step Right</I><br>Cursor(Warp,1,0,grid)
+<tr bgcolor="#DDFFFF">
+ <th align=left>right-shift
+ <td> <I>Step +Right</I><br>Cursor(Pan,50,0,view)
+<tr bgcolor="#FFFFFF">
+ <th align=left>s
+ <td> <I>ChangeSize +5 mil</I><br>ChangeSize(Object,+5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>s-alt
+ <td> <I>ChangeDrill +5 mil</I><br>ChangeDrillSize(Object,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>s-alt-shift
+ <td> <I>ChangeDrill -5 mil</I><br>ChangeDrillSize(Object,-5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>s-ctrl
+ <td> <I>Save Layout</I><br>Save(Layout)
+<tr bgcolor="#FFFFFF">
+ <th align=left>s-ctrl-shift
+ <td> <I>Save Layout As...</I><br>Save(LayoutAs)
+<tr bgcolor="#DDFFFF">
+ <th align=left>s-shift
+ <td> <I>ChangeSize -5 mil</I><br>ChangeSize(Object,-5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>space
+ <td> <I>Arrow Mode</I><br>Mode(Arrow)
+<tr bgcolor="#DDFFFF">
+ <th align=left>t
+ <td> <I>Text Tool scale +10 mil</I><br>SetValue(TextScale,+10,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>t-shift
+ <td> <I>Text Tool scale -10 mil</I><br>SetValue(TextScale,-10,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>tab
+ <td> <I>Flip up/down</I><br>SwapSides(V)
+<tr bgcolor="#FFFFFF">
+ <th align=left>tab-ctrl
+ <td> <I>Spin 180 degrees</I><br>SwapSides(R)
+<tr bgcolor="#DDFFFF">
+ <th align=left>tab-ctrl-shift
+ <td> <I>Swap Sides</I><br>SwapSides()
+<tr bgcolor="#FFFFFF">
+ <th align=left>tab-shift
+ <td> <I>Flip left/right</I><br>SwapSides(H)
+<tr bgcolor="#DDFFFF">
+ <th align=left>u
+ <td> <I>Undo last operation</I><br>Undo()
+<tr bgcolor="#FFFFFF">
+ <th align=left>u-ctrl-shift
+ <td> <I>Clear undo-buffer</I><br>Undo(ClearList)
+<tr bgcolor="#DDFFFF">
+ <th align=left>up
+ <td> <I>Step Up</I><br>Cursor(Warp,0,1,grid)
+<tr bgcolor="#FFFFFF">
+ <th align=left>up-shift
+ <td> <I>Step +Up</I><br>Cursor(Pan,0,50,view)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v-alt
+ <td> <I>Via Tool drill +5 mil</I><br>SetValue(ViaDrillingHole,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>v-alt-shift
+ <td> <I>Via Tool drill -5 mil</I><br>SetValue(ViaDrillingHole,-5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v-ctrl
+ <td> <I>Paste buffer to layout</I><br>Mode(PasteBuffer)
+<tr bgcolor="#FFFFFF">
+ <th align=left>v-ctrl-shift
+ <td> <I>Via Tool size -5 mil</I><br>SetValue(ViaSize,-5,mil)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v-shift
+ <td> <I>Via Tool size +5 mil</I><br>SetValue(ViaSize,+5,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>v<br> e
+ <td> <I>Zoom Max</I><br>Zoom()
+<tr bgcolor="#DDFFFF">
+ <th align=left>v<br> f
+ <td> <I>Zoom Max</I><br>Zoom()
+<tr bgcolor="#FFFFFF">
+ <th align=left>v<br> i
+ <td> <I>Zoom In 2X</I><br>Zoom(-2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>v<br> o
+ <td> <I>Zoom Out 2X</I><br>Zoom(+2)
+<tr bgcolor="#FFFFFF">
+ <th align=left>w
+ <td> <I>Add All Rats</I><br>AddRats(AllRats)
+<tr bgcolor="#DDFFFF">
+ <th align=left>w-shift
+ <td> <I>AddRats Selected</I><br>AddRats(SelectedRats)
+<tr bgcolor="#FFFFFF">
+ <th align=left>x
+ <td> <I>Cycle object being dragged</I><br>CycleDrag()
+<tr bgcolor="#DDFFFF">
+ <th align=left>x-ctrl
+ <td> <I>Cut selection to buffer</I><br>GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
+<tr bgcolor="#FFFFFF">
+ <th align=left>x-shift
+ <td> <I>Swap nets on two selected pins</I><br>net(swap)
+<tr bgcolor="#DDFFFF">
+ <th align=left>y
+ <td> <I>Puller</I><br>Puller()
+<tr bgcolor="#FFFFFF">
+ <th align=left>y-ctrl
+ <td> <I>Redo last undone operation</I><br>Redo()
+<tr bgcolor="#DDFFFF">
+ <th align=left>y-shift
+ <td> <I>ChangeSizes to Route style</I><br>ChangeSizes(Object,style,mil)
+<tr bgcolor="#FFFFFF">
+ <th align=left>z
+ <td> <I>Zoom In 20%</I><br>Zoom(-1.2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>z-ctrl
+ <td> <I>Undo last operation</I><br>Undo()
+<tr bgcolor="#FFFFFF">
+ <th align=left>z-shift
+ <td> <I>Zoom Out 20%</I><br>Zoom(+1.2)
+<tr bgcolor="#DDFFFF">
+ <th align=left>|
+ <td> <I>Thin draw</I><br>conf(toggle, editor/thin_draw, design)
+</table>
+
+</body></html>
diff --git a/doc-rnd/mac.txt b/doc/mac.txt
similarity index 100%
rename from doc-rnd/mac.txt
rename to doc/mac.txt
diff --git a/doc/man/Makefile b/doc/man/Makefile
new file mode 100644
index 0000000..db75680
--- /dev/null
+++ b/doc/man/Makefile
@@ -0,0 +1,64 @@
+# This Makefile is a plain old hand written one; all configuration settings
+# are included from ../../Makefile.conf which is scconfig generated
+
+IN=pcb-rnd.1.mml pcb-strip.1.mml pcb-prj2lht.1.mml fp2anim.1.mml
+OUT_HTML = pcb-rnd.1.html pcb-strip.1.html pcb-prj2lht.1.html fp2anim.1.html
+OUT_MAN1 = pcb-rnd.1 pcb-strip.1 pcb-prj2lht.1 fp2anim.1
+OUT_LINT = pcb-rnd.1.lint pcb-strip.1.lint pcb-prj2lht.1.lint fp2anim.1.lint
+
+OUTPUT = $(OUT_HTML) $(OUT_MAN1) index.html
+MML = /usr/bin/mml
+
+all: $(OUTPUT)
+
+lint: $(OUT_LINT)
+
+.SUFFIXES: .html .mml .lint
+
+.mml.html: .mml_linkmap
+ $(MML) -i copyright.mml -f html $< > $@
+
+.mml:
+ $(MML) -i copyright.mml -f man $< > $@
+
+.mml_linkmap:
+ $(MML) -i copyright.mml -f linkmap $(IN) > $@
+
+index.html: $(IN)
+ @echo "<HTML><BODY>" > $@
+ $(MML) -i copyright.mml -f indexhtml $(IN) >> $@
+ @echo "</BODY></HTML>" >> $@
+
+clean:
+
+distclean:
+
+genclean:
+ rm $(OUTPUT) 2>/dev/null ; true
+
+.mml.lint:
+ $(MML) -i copyright.mml -f lint $<
+
+install_:
+ $(MKDIR) "$(MAN1DIR)"
+ $(CPC) "`pwd`/pcb-rnd.1" "$(MAN1DIR)/pcb-rnd.1"
+ $(CPC) "`pwd`/pcb-strip.1" "$(MAN1DIR)/pcb-strip.1"
+ $(CPC) "`pwd`/pcb-prj2lht.1" "$(MAN1DIR)/pcb-prj2lht.1"
+ $(CPC) "`pwd`/gsch2pcb-rnd.1" "$(MAN1DIR)/gsch2pcb-rnd.1"
+ $(CPC) "`pwd`/fp2anim.1" "$(MAN1DIR)/fp2anim.1"
+
+uninstall:
+ $(RM) "$(MAN1DIR)/pcb-rnd.1"
+ $(RM) "$(MAN1DIR)/pcb-strip.1"
+ $(RM) "$(MAN1DIR)/pcb-prj2lht.1"
+ $(RM) "$(MAN1DIR)/gsch2pcb-rnd.1"
+ $(RM) "$(MAN1DIR)/fp2anim.1"
+
+install:
+ $(MAKE) install_ CPC="$(CP)"
+
+linstall:
+ $(MAKE) install_ CPC="$(LN)"
+
+include ../../Makefile.conf
+
diff --git a/doc-rnd/man/README b/doc/man/README
similarity index 100%
rename from doc-rnd/man/README
rename to doc/man/README
diff --git a/doc-rnd/man/copyright.mml b/doc/man/copyright.mml
similarity index 100%
rename from doc-rnd/man/copyright.mml
rename to doc/man/copyright.mml
diff --git a/doc/man/fp2anim.1 b/doc/man/fp2anim.1
new file mode 100644
index 0000000..9e1e6d7
--- /dev/null
+++ b/doc/man/fp2anim.1
@@ -0,0 +1,67 @@
+.\" pcb-rnd - manual
+.\" Copyright (C) 2016 Tibor 'Igor2' Palinkas
+.\"
+.\" 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: pcb-rnd[removethis]@igor2.repo.hu
+.TH fp2anim 1 2016-12-27 "" "pcb-rnd manual"
+.SH NAME
+fp2anim - convert a gEDA/PCB footprint to animator script
+.SH SYNPOSIS
+.nf
+.sp
+\fBfp2anim [\fIoptions\fB] [\fIinputfile\fB]
+.fi
+.SH DECSRIPTION
+
+.BR fp2anim
+converts a footprint to a script that can be run through animator(1). It's main use is to have a automated, light-weight footprint preview generator on hosts where installing pcb-rnd would be too expensive (e.g. on web servers).
+.PP
+If \fIinputfile\fR is not specified,
+.BR fp2anim
+reads its STDIN for the footprint.
+.SH OPTIONS
+
+
+.TP
+
+.B --photo
+draw the footprint in "photo realistic mode"
+.TP
+
+.B -p
+same as --photo
+.TP
+
+.B --grid unit
+set grid unit e.g. to mm or mil
+.TP
+
+.B -g unit
+same as --grid
+.TP
+
+.B --mm
+use an mm grid instead of a mil grid; shorthand for -g mm
+.TP
+
+.B --diamond
+draw a small diamond to mark at footprint origin
+.TP
+
+.B --annotation types
+turn on annotation types; types is a string that may consist "pins" for pin numbers, "dimname" and "dimvalue" for dimension names and values and "background" for drawing a background under annotation text
+.PP
+
diff --git a/doc/man/fp2anim.1.html b/doc/man/fp2anim.1.html
new file mode 100644
index 0000000..8759167
--- /dev/null
+++ b/doc/man/fp2anim.1.html
@@ -0,0 +1,98 @@
+<HTML><BODY>
+<!--
+pcb-rnd - manual
+Copyright (C) 2016 Tibor 'Igor2' Palinkas
+
+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: pcb-rnd[removethis]@igor2.repo.hu
+-->
+<table width=100%>
+<TR>
+ <TH align=left> fp2anim 1
+ <TH align=middle> 2016-12-27
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+
+<H3>NAME</H3>
+<blockquote>
+fp2anim - convert a gEDA/PCB footprint to animator script
+</blockquote>
+
+<H3>SYNPOSIS</H3>
+<blockquote>
+<P>
+<tt><B>fp2anim</B> [<I>options</I>] [<I>inputfile</I>]</tt>
+
+
+
+</blockquote>
+
+<H3>DESCRIPTION</H3>
+<blockquote>
+<B>fp2anim</B> converts a footprint to a script that can be run through animator(1). It's main use is to have a automated, light-weight footprint preview generator on hosts where installing pcb-rnd would be too expensive (e.g. on web servers).
+<P>
+If <I>inputfile</I> is not specified, <B>fp2anim</B> reads its STDIN for the footprint.
+
+</blockquote>
+
+
+<H3>OPTIONS</H3>
+<blockquote>
+
+<table border=1>
+
+ <TR>
+
+ <TD> --photo
+ <TD> draw the footprint in "photo realistic mode"
+ <TR>
+
+ <TD> -p
+ <TD> same as --photo
+ <TR>
+
+ <TD> --grid unit
+ <TD> set grid unit e.g. to mm or mil
+ <TR>
+
+ <TD> -g unit
+ <TD> same as --grid
+ <TR>
+
+ <TD> --mm
+ <TD> use an mm grid instead of a mil grid; shorthand for -g mm
+ <TR>
+
+ <TD> --diamond
+ <TD> draw a small diamond to mark at footprint origin
+ <TR>
+
+ <TD> --annotation types
+ <TD> turn on annotation types; types is a string that may consist "pins" for pin numbers, "dimname" and "dimvalue" for dimension names and values and "background" for drawing a background under annotation text
+</table>
+</blockquote>
+<P>
+<table width=100%>
+<TR>
+ <TH align=left> fp2anim 1
+ <TH align=middle> 2016-12-27
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+</BODY></HTML>
diff --git a/doc/man/fp2anim.1.mml b/doc/man/fp2anim.1.mml
new file mode 100644
index 0000000..b35e457
--- /dev/null
+++ b/doc/man/fp2anim.1.mml
@@ -0,0 +1,58 @@
+<title>fp2anim</title>
+<sect>1</sect>
+<date>2016-12-27</date>
+
+<name> fp2anim - convert a gEDA/PCB footprint to animator script </name>
+<syn> <call>fp2anim</call> [<arg>options</arg>] [<arg>inputfile</arg>] </syn>
+
+<description>
+<call>fp2anim</call> converts a footprint to a script that can be run through
+animator(1). It's main use is to have a automated, light-weight footprint
+preview generator on hosts where installing pcb-rnd would be too expensive
+(e.g. on web servers).
+<p>
+If <arg>inputfile</arg> is not specified, <call>fp2anim</call> reads its
+STDIN for the footprint.
+</description>
+
+<options>
+<kvlist>
+
+ <item>
+ <key> --photo </key>
+ <value> draw the footprint in "photo realistic mode" </value>
+ </item>
+ <item>
+ <key> -p </key>
+ <value> same as --photo
+ </item>
+
+ <item>
+ <key> --grid unit </key>
+ <value> set grid unit e.g. to mm or mil </value>
+ </item>
+ <item>
+ <key> -g unit </key>
+ <value> same as --grid
+ </item>
+
+ <item>
+ <key> --mm </key>
+ <value> use an mm grid instead of a mil grid; shorthand for -g mm</value>
+ </item>
+
+ <item>
+ <key> --diamond </key>
+ <value> draw a small diamond to mark at footprint origin</value>
+ </item>
+
+ <item>
+ <key> --annotation types </key>
+ <value> turn on annotation types; types is a string that may consist
+ "pins" for pin numbers, "dimname" and "dimvalue" for dimension
+ names and values and "background" for drawing a background under
+ annotation text </value>
+ </item>
+
+</kvlist>
+</options>
diff --git a/doc-rnd/man/gsch2pcb-rnd.1 b/doc/man/gsch2pcb-rnd.1
similarity index 100%
rename from doc-rnd/man/gsch2pcb-rnd.1
rename to doc/man/gsch2pcb-rnd.1
diff --git a/doc/man/index.html b/doc/man/index.html
new file mode 100644
index 0000000..a7bf77b
--- /dev/null
+++ b/doc/man/index.html
@@ -0,0 +1,6 @@
+<HTML><BODY>
+ <LI> <a href="pcb-rnd.1.html">pcb-rnd</a> <I>(1)</I> -- pcb-rnd - Printed Circuit Board editor
+ <LI> <a href="pcb-strip.1.html">pcb-strip</a> <I>(1)</I> -- pcb-strip - remove sections of a pcb file
+ <LI> <a href="pcb-prj2lht.1.html">pcb-prj2lht</a> <I>(1)</I> -- pcb-prj2lht - convert old gsch2pcb project file to pcb-rnd project
+ <LI> <a href="fp2anim.1.html">fp2anim</a> <I>(1)</I> -- fp2anim - convert a gEDA/PCB footprint to animator script
+</BODY></HTML>
diff --git a/doc/man/pcb-prj2lht.1 b/doc/man/pcb-prj2lht.1
new file mode 100644
index 0000000..ec1b700
--- /dev/null
+++ b/doc/man/pcb-prj2lht.1
@@ -0,0 +1,32 @@
+.\" pcb-rnd - manual
+.\" Copyright (C) 2016 Tibor 'Igor2' Palinkas
+.\"
+.\" 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: pcb-rnd[removethis]@igor2.repo.hu
+.TH pcb-prj2lht 1 2016-12-27 "" "pcb-rnd manual"
+.SH NAME
+pcb-prj2lht - convert old gsch2pcb project file to pcb-rnd project
+.SH SYNPOSIS
+.nf
+.sp
+\fBpcb-prj2lht [\fIinputfile\fB]
+.fi
+.SH DECSRIPTION
+
+.BR pcb-prj2lht
+converts the old gsch2pcb project file to the new, lihata project file format that is usable with pcb-rnd and gsch2pcb-rnd. If \fIinputfile\fR is specified, the file is modified in-place, else
+.BR pcb-prj2lht
+reads from STDIN and writes the result to STDOUT.
diff --git a/doc/man/pcb-prj2lht.1.html b/doc/man/pcb-prj2lht.1.html
new file mode 100644
index 0000000..7a157fe
--- /dev/null
+++ b/doc/man/pcb-prj2lht.1.html
@@ -0,0 +1,58 @@
+<HTML><BODY>
+<!--
+pcb-rnd - manual
+Copyright (C) 2016 Tibor 'Igor2' Palinkas
+
+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: pcb-rnd[removethis]@igor2.repo.hu
+-->
+<table width=100%>
+<TR>
+ <TH align=left> pcb-prj2lht 1
+ <TH align=middle> 2016-12-27
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+
+<H3>NAME</H3>
+<blockquote>
+pcb-prj2lht - convert old gsch2pcb project file to pcb-rnd project
+</blockquote>
+
+<H3>SYNPOSIS</H3>
+<blockquote>
+<P>
+<tt><B>pcb-prj2lht</B> [<I>inputfile</I>]</tt>
+
+
+
+</blockquote>
+
+<H3>DESCRIPTION</H3>
+<blockquote>
+<B>pcb-prj2lht</B> converts the old gsch2pcb project file to the new, lihata project file format that is usable with pcb-rnd and gsch2pcb-rnd. If <I>inputfile</I> is specified, the file is modified in-place, else <B>pcb-prj2lht</B> reads from STDIN and writes the result to STDOUT.
+</blockquote>
+<P>
+<table width=100%>
+<TR>
+ <TH align=left> pcb-prj2lht 1
+ <TH align=middle> 2016-12-27
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+</BODY></HTML>
diff --git a/doc/man/pcb-prj2lht.1.mml b/doc/man/pcb-prj2lht.1.mml
new file mode 100644
index 0000000..87d11e3
--- /dev/null
+++ b/doc/man/pcb-prj2lht.1.mml
@@ -0,0 +1,14 @@
+<title>pcb-prj2lht</title>
+<sect>1</sect>
+<date>2016-12-27</date>
+
+<name> pcb-prj2lht - convert old gsch2pcb project file to pcb-rnd project </name>
+<syn> <call>pcb-prj2lht</call> [<arg>inputfile</arg>] </syn>
+
+<description>
+<call>pcb-prj2lht</call> converts the old gsch2pcb project file to the
+new, lihata project file format that is usable with pcb-rnd and
+gsch2pcb-rnd. If <arg>inputfile</arg> is specified, the file is modified
+in-place, else <call>pcb-prj2lht</call> reads from STDIN and writes the
+result to STDOUT.
+</description>
diff --git a/doc/man/pcb-rnd.1 b/doc/man/pcb-rnd.1
new file mode 100644
index 0000000..0ccbff2
--- /dev/null
+++ b/doc/man/pcb-rnd.1
@@ -0,0 +1,47 @@
+.\" pcb-rnd - manual
+.\" Copyright (C) 2016 Tibor 'Igor2' Palinkas
+.\"
+.\" 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: pcb-rnd[removethis]@igor2.repo.hu
+.TH pcb-rnd 1 2016-10-29 "" "pcb-rnd manual"
+.SH NAME
+pcb-rnd - Printed Circuit Board editor
+.SH SYNPOSIS
+.nf
+.sp
+\fBpcb-rnd [\fIoptions\fB] [\fIinputfile\fB]
+.fi
+.SH DECSRIPTION
+
+.BR pcb-rnd
+is a modular PCB editor. The main use is interactive editing. If no \fI-x\fR is specified on the command line, the graphical editor mode is initiated. Automated, headless processing is also possible with \fI-x\fR or \fI--gui batch\fR.
+.SH OPTIONS
+
+
+.TP
+
+.B -x \fIexporter\fR [\fIexportflags] \fIinputfile\fR\fR
+Instead of interactive editing, export the design (loaded from \fIinputfile\fR) to a file using the specified \fIexporter\fR plugin. A list of exporter-specific parameters may follow to control the details of the process.
+.TP
+
+.B --gui \fIhid\fR
+Use the \fIhid\fR plugin for the "gui" frontend. Common choices are "gtk" or "lesstif" for graphical user interfaces and "batch" for a headless command-line interface (or automated batch processing).
+.TP
+
+.B -c \fIpath=val\fR
+Set a config node in role CFR_CLI. The path of the node is \fIpath\fR (e.g. editor/grid) and the new value is \fIval\fR (e.g. 5mm).
+.PP
+
diff --git a/doc/man/pcb-rnd.1.html b/doc/man/pcb-rnd.1.html
new file mode 100644
index 0000000..fee997f
--- /dev/null
+++ b/doc/man/pcb-rnd.1.html
@@ -0,0 +1,79 @@
+<HTML><BODY>
+<!--
+pcb-rnd - manual
+Copyright (C) 2016 Tibor 'Igor2' Palinkas
+
+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: pcb-rnd[removethis]@igor2.repo.hu
+-->
+<table width=100%>
+<TR>
+ <TH align=left> pcb-rnd 1
+ <TH align=middle> 2016-10-29
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+
+<H3>NAME</H3>
+<blockquote>
+pcb-rnd - Printed Circuit Board editor
+</blockquote>
+
+<H3>SYNPOSIS</H3>
+<blockquote>
+<P>
+<tt><B>pcb-rnd</B> [<I>options</I>] [<I>inputfile</I>]</tt>
+
+
+
+</blockquote>
+
+<H3>DESCRIPTION</H3>
+<blockquote>
+<B>pcb-rnd</B> is a modular PCB editor. The main use is interactive editing. If no <I>-x</I> is specified on the command line, the graphical editor mode is initiated. Automated, headless processing is also possible with <I>-x</I> or <I>--gui batch</I>.
+</blockquote>
+
+
+<H3>OPTIONS</H3>
+<blockquote>
+
+<table border=1>
+
+ <TR>
+
+ <TD> -x <I>exporter</I> [<I>exportflags] <I>inputfile</I></I>
+ <TD> Instead of interactive editing, export the design (loaded from <I>inputfile</I>) to a file using the specified <I>exporter</I> plugin. A list of exporter-specific parameters may follow to control the details of the process.
+ <TR>
+
+ <TD> --gui <I>hid</I>
+ <TD> Use the <I>hid</I> plugin for the "gui" frontend. Common choices are "gtk" or "lesstif" for graphical user interfaces and "batch" for a headless command-line interface (or automated batch processing).
+ <TR>
+
+ <TD> -c <I>path=val</I>
+ <TD> Set a config node in role CFR_CLI. The path of the node is <I>path</I> (e.g. editor/grid) and the new value is <I>val</I> (e.g. 5mm).
+</table>
+</blockquote>
+<P>
+<table width=100%>
+<TR>
+ <TH align=left> pcb-rnd 1
+ <TH align=middle> 2016-10-29
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+</BODY></HTML>
diff --git a/doc/man/pcb-rnd.1.mml b/doc/man/pcb-rnd.1.mml
new file mode 100644
index 0000000..b47b6bc
--- /dev/null
+++ b/doc/man/pcb-rnd.1.mml
@@ -0,0 +1,38 @@
+<title>pcb-rnd</title>
+<sect>1</sect>
+<date>2016-10-29</date>
+
+<name> pcb-rnd - Printed Circuit Board editor </name>
+<syn> <call>pcb-rnd</call> [<arg>options</arg>] [<arg>inputfile</arg>] </syn>
+
+<description>
+<call>pcb-rnd</call> is a modular PCB editor. The main use is interactive
+editing. If no <arg>-x</arg> is specified on the command line, the
+graphical editor mode is initiated. Automated, headless processing
+is also possible with <arg>-x</arg> or <arg>--gui batch</arg>.
+</description>
+
+<options>
+<kvlist>
+ <item>
+ <key> -x <arg>exporter</arg> [<arg>exportflags] <arg>inputfile</arg> </key>
+ <value> Instead of interactive editing, export the design (loaded from
+ <arg>inputfile</arg>) to a file using the specified
+ <arg>exporter</arg> plugin. A list of exporter-specific parameters
+ may follow to control the details of the process. </value>
+ </item>
+ <item>
+ <key> --gui <arg>hid</arg> </key>
+ <value> Use the <arg>hid</arg> plugin for the "gui" frontend. Common
+ choices are "gtk" or "lesstif" for graphical user interfaces
+ and "batch" for a headless command-line interface (or automated
+ batch processing). </value>
+ </item>
+ <item>
+ <key> -c <arg>path=val</arg> </key>
+ <value> Set a config node in role CFR_CLI. The path of the node is
+ <arg>path</arg> (e.g. editor/grid) and the new value is
+ <arg>val</arg> (e.g. 5mm). </value>
+ </item>
+</kvlist>
+</options>
diff --git a/doc/man/pcb-strip.1 b/doc/man/pcb-strip.1
new file mode 100644
index 0000000..5bcdf08
--- /dev/null
+++ b/doc/man/pcb-strip.1
@@ -0,0 +1,45 @@
+.\" pcb-rnd - manual
+.\" Copyright (C) 2016 Tibor 'Igor2' Palinkas
+.\"
+.\" 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: pcb-rnd[removethis]@igor2.repo.hu
+.TH pcb-strip 1 2016-12-27 "" "pcb-rnd manual"
+.SH NAME
+pcb-strip - remove sections of a pcb file
+.SH SYNPOSIS
+.nf
+.sp
+\fBpcb-strip [\fIoptions\fB] [\fIinputfile\fB]
+.fi
+.SH DECSRIPTION
+
+.BR pcb-strip
+removes sections of a pcb file. If \fIinputfile\fR is specified, the file is modified in-place, else
+.BR pcb-strip
+reads from STDIN and writes the result to STDOUT.
+.SH OPTIONS
+
+
+.TP
+
+.B -s
+Remove symbols (the font). The pcb file stops being self-containing, pcb-rnd (or pcb) will load and apply the default font when the file is loaded. Useful for reducing the file size for test input and example files where font correctness is not required.
+.TP
+
+.B -a
+Remove board attributes. Useful for deleting local configuration
+.PP
+
diff --git a/doc/man/pcb-strip.1.html b/doc/man/pcb-strip.1.html
new file mode 100644
index 0000000..221ad90
--- /dev/null
+++ b/doc/man/pcb-strip.1.html
@@ -0,0 +1,75 @@
+<HTML><BODY>
+<!--
+pcb-rnd - manual
+Copyright (C) 2016 Tibor 'Igor2' Palinkas
+
+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: pcb-rnd[removethis]@igor2.repo.hu
+-->
+<table width=100%>
+<TR>
+ <TH align=left> pcb-strip 1
+ <TH align=middle> 2016-12-27
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+
+<H3>NAME</H3>
+<blockquote>
+pcb-strip - remove sections of a pcb file
+</blockquote>
+
+<H3>SYNPOSIS</H3>
+<blockquote>
+<P>
+<tt><B>pcb-strip</B> [<I>options</I>] [<I>inputfile</I>]</tt>
+
+
+
+</blockquote>
+
+<H3>DESCRIPTION</H3>
+<blockquote>
+<B>pcb-strip</B> removes sections of a pcb file. If <I>inputfile</I> is specified, the file is modified in-place, else <B>pcb-strip</B> reads from STDIN and writes the result to STDOUT.
+</blockquote>
+
+
+<H3>OPTIONS</H3>
+<blockquote>
+
+<table border=1>
+
+ <TR>
+
+ <TD> -s
+ <TD> Remove symbols (the font). The pcb file stops being self-containing, pcb-rnd (or pcb) will load and apply the default font when the file is loaded. Useful for reducing the file size for test input and example files where font correctness is not required.
+ <TR>
+
+ <TD> -a
+ <TD> Remove board attributes. Useful for deleting local configuration
+</table>
+</blockquote>
+<P>
+<table width=100%>
+<TR>
+ <TH align=left> pcb-strip 1
+ <TH align=middle> 2016-12-27
+ <TH align=right> pcb-rnd manual
+</table>
+
+
+</BODY></HTML>
diff --git a/doc/man/pcb-strip.1.mml b/doc/man/pcb-strip.1.mml
new file mode 100644
index 0000000..34d306b
--- /dev/null
+++ b/doc/man/pcb-strip.1.mml
@@ -0,0 +1,30 @@
+<title>pcb-strip</title>
+<sect>1</sect>
+<date>2016-12-27</date>
+
+<name> pcb-strip - remove sections of a pcb file </name>
+<syn> <call>pcb-strip</call> [<arg>options</arg>] [<arg>inputfile</arg>] </syn>
+
+<description>
+<call>pcb-strip</call> removes sections of a pcb file. If <arg>inputfile</arg>
+is specified, the file is modified in-place, else <call>pcb-strip</call>
+reads from STDIN and writes the result to STDOUT.
+</description>
+
+<options>
+<kvlist>
+ <item>
+ <key> -s </key>
+ <value> Remove symbols (the font). The pcb file stops being self-containing,
+ pcb-rnd (or pcb) will load and apply the default font when the file
+ is loaded. Useful for reducing the file size for test input and
+ example files where font correctness is not required.
+ </value>
+ </item>
+ <item>
+ <key> -a </key>
+ <value> Remove board attributes. Useful for deleting local configuration
+ </value>
+ </item>
+</kvlist>
+</options>
diff --git a/doc/motivation.html b/doc/motivation.html
new file mode 100644
index 0000000..879be89
--- /dev/null
+++ b/doc/motivation.html
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - motivation </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<H1> pcb-rnd motivation </H1>
+<H2> Phase 1: At the beginning... (2013..2014)</H2>
+I use PCB a lot on various computers. I used to try to join the mainstream
+development with small contribution (minor patches) and was active on
+IRC and the mailing lists for a while. However, it didn't work out well,
+and:
+<ul>
+ <li> PCB already knew 95% of everything I'd ever need years ago
+ <li> the remaining 5% was not on the TODO list of developers and generally no one shown much interest in getting patches for those
+ <li> meanwhile a lot of new features have been added, from which most I find totally useless:
+ <ul>
+ <li> dbus
+ <li> gl - transparency makes even simple 2 sided boards unusable; slower than the classic version sw render on all my computers
+ <li> preparation for a C++ transition
+ <li> 3d support in core (I believe communication to 3d cad programs should be via exporter plugins)
+ </ul>
+ <li> the official Debian package enables (requires, depends on) both dbus and gl
+ <li> DVCS - it almost always results in chaos, and has no benefit for such a small group of developers; there are posts from time to time on the mailing list about how to handle the chaos; my choice is to stick with a simple, centralized version control system
+ <li> DVCS <b>always</b> results in increased administration, which I hate to spend my time on - I'd rather invest the time in bugfixing, documentation or implementing new features
+ <li> it's nearly impossible to get small patches applied^1:
+ <ul>
+ <li> often no one has the time to revise and commit them
+ <li> communication requires web2.0 (lp)
+ <li> there are too many cycles of "please fix this and change that first"
+ <li> with the chaos VCS, it's too likely that new feature patches would require ongoing maintenance while sitting in a "feature branch", to avoid that a large scale merge (or rebase, whatever) breaks it when it finally hits the official branch
+ <li> there are too much pondering and too less prototyping; there are features that are being considered for years (for example back annotation, internal connections) with multiple concurrent ideas, but no code. Instead, I'd like to implement some code from the early phase of the idea, test it, and deprecate it if it didn't work out well.
+ <li> I wouldn't even dream about getting larger patches in the official release
+ </ul>
+ <li> no stable release for years; maintaining a set of patches (like pcb-gpmi) and porting them to new releases is too much hassle
+</ul>
+I was pondering a fork for years. The trigger was that one day I've upgraded
+Debian on my lab computer and the new version of PCB came with gl enabled; this
+made PCB absolutely unusable (had to wait like 10 seconds for a scroll) while
+all the transparent polys over traces made the whole screen a mess. I should
+have recompiled everything and built a new Debian package with gl disabled or
+install from source (but I have too many computers for that). My decision
+was to set up my own .deb but then build it from a fork (it's not much of
+an extra effort), so I can add some of the features I miss in daily use.
+My plans with this fork:
+<ul>
+ <li> I stick with my fork and will use it on all my computers for all my designs
+ <li> Because of that, there's no emphasis on keeping the file formats compatible - breaking compatibility is not a goal either; as long as mainline doesn't change the format, pcb-rnd is about 98% compatible (the 2% is where pcb-rnd features are not supported by mainline)
+ <li> I won't actively seek ways to get my changes into the mainstream; I will keep on using my svn repo in a manner that (as a side effect) makes such merges easier, tho. If PCB developers decide to pick them up from svn and merge them in the official repo, it's fine (but I personally will keep using my fork anyway).
+ <li> Most probably I won't merge anything back from the mainstream to my fork - the past few years showed that it's unlikely there would be new features I'd need
+ <li> My plans for new features were:
+ <ul>
+ <li> pin shapes (a <a href="features/square.html">preliminary version</a> is already implemented)
+ <li> 1206 jumpers without having to add them on the schematics/netlist (done: <a href="features/intconn.html">[intconn]</a> and <a href="features/nonetlist.html"> [nonetlist] </a> are the PCB-side features for this)
+ <li> merge pcb-gpmi; GPMI would be an optional addon, it'd probably stay a plugin, but there should not be a separate repo (<a href="user/06_feature/gpmi/index.html"> done </a>)
+ </ul>
+</ul>
+<p>
+Footnotes:
+<ul>
+ <li> ^1: this may have changed lately and pcb developers are more open to newcomers; there seems to be a shortage of developers tho, which still makes it slow to get bigger patches through
+</ul>
+
+<H2> Phase 2: major cleanups (2015..2016) </H2>
+In the first phase I was mostly implementing a set of small features and fixes.
+As I got more familiar with the code base, I decided to bite the bullet and
+do some refactoring:
+<ul>
+ <li> replaced the <a href="features/pcb-fp.html">footprint mapping/loading code</a>; instead of a hardwired m4 dependency, parametric (generated-on-the-fly) footprints can be written in any language
+ <li> replaced the default footprint library shipped with the software; the <a href="features/pcblib.html"> new library </a> ships a small, well organized collection of essentials, omitting special/rarely used footprints
+ <li> got the code much more modular - <a href="developer/mods3"> a lot of core code got converted into plugins </a>
+ <li> threw out the resource parser and file format (manu.res and friends) <a href="features/res.html"> in favor of lihata;</a> this removed a lot of code duplication and a strangely designed resource tree data structure I really hated; as a side effect the gtk hid has multi-stroke hotkeys
+ <li> <a href="features/unglib.html">replaced glib</a> with a set of <a href="http://repo.hu/projects/articles/minilibs"> mini libs </a> in core and most of the plugins; at the end only the gtk hid should depend on glib; this made the code easier to maintain and debug; a lot of checks are now compile-time (through the C type system) instead of runtime (glib lists)
+ <li> replaced the settings/rc/preferences system with a central, <a href="conf/"> lihata based configuration system </a> - long term hid attributes will be converted too
+</ul>
+<p>
+Plans for the future includes:
+<ul>
+ <li> turning most of the core code into a library for external tools to reuse
+ <li> extending the core to provide an infrastructure for composite objects handled by plugins
+ <li> support for saving and loading pcb and footprint files in the lihata format
+ <li> plans for a set of smallish features that can be implemented in a weekend or two each.
+</ul>
+
+<H2> Phase 3: community requested features (from 2016 onward) </H2>
+Overlapping phase 2 there is an ongoing
+<a href="http://igor2.repo.hu/cgi-bin/pcb-rnd-poll.cgi"> feature poll </a>. If there
+are enough <b>active</b> users/testers for a feature, it gets implemented in
+phase 3.
+<p>
+There is a small, active, constructive community forming around pcb-rnd. Future
+directions will be mainly set by their need.
+</body>
+</html>
diff --git a/doc/myfeature.html b/doc/myfeature.html
new file mode 100644
index 0000000..1cbb8d8
--- /dev/null
+++ b/doc/myfeature.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - my feature </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<h1> pcb-rnd - how to get my favorite feature implemented </h1>
+
+The list below is sorted: top items have higher priority, but you
+are free to choose any.
+
+<H3> 1. If you are a programmer with free time to spend </H3>
+Read the <a href="contrib.html"> contribution howto</a> and join the project.
+You are welcome to work only on the feature you are interested in. You get
+all the support (e.g. for understanding the API, to get a blank plugin
+set up so you need to fill in only the feature-specific parts, etc.). Success
+rate should be near to 100%.
+
+<H3> 2. If you are not a programmer and have free time </H3>
+You can join and work on things you don't need that much, but others do.
+This will build your reputation in the community which in turns encourages
+others to implement your favorite feature even if they wouldn't do it for
+themselves. The success rate is somewhat more random, obviously.
+
+<H3> 3. If you don't have free time </H3>
+Consider donation: buy someone else's time. To do so, contact me
+(see the <a href="contrib.html"> contribution howto</a> page). Since
+you don't need to cover all costs and the hourly rates are much lower
+on a pet project, and your feature may be simpler than it looks, and
+someone who already knows the code also saves the learning curve, it may
+all be cheaper than you think. The success rate should be close to 100%.
+<p>
+However, this is a last resort solution, the above ones are clearly preferred.
+
+
+<H3> 4. If you don't have anything to contribute with </H3>
+[DEL:Vote for it in the <a href="http://igor2.repo.hu/cgi-bin/pcb-rnd-poll.cgi">
+feature poll</a>. If your feature is not there, ask on the mailing list.
+Chance for success: if it's a popular demand on the feature poll, chances
+are somewhat good. Else chances are very low, but not zero.:DEL]
+<p>
+Because of 100% passivity of the geda community, I decided not to spend more
+time on community-related tasks. The poll is there, you can use it,
+but you will have to organize at least 5 active, capable users who are
+committed enough to spend significant time on testing/supporting development.
+I will consider implementing your feature only if you can bring and keep
+those people motivated and active.
+
+<H3> 5. If you tried everything, even point 4. and all failed... </H3>
+Complain loudly on the mailing list, advertise your opinion, try pushing
+the thing - a.k.a. go trolling. <b>Success rate is exactly 0%</b>,
+you make a lot of good <del>friends</del> enemies that will make it harder
+to ask or contribute later for another feature, but it may make you feel
+better. </irony>.
+
diff --git a/doc/news.html b/doc/news.html
new file mode 100644
index 0000000..e110cda
--- /dev/null
+++ b/doc/news.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd - news </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+<!--AUTO head begin-->
+ <link rel="icon" href="http://repo.hu/projects/pcb-rnd/resources/logo16.png">
+<!--AUTO head end-->
+</head>
+<body>
+
+<!--AUTO navbar begin-->
+<table border=0 cellspacing=2 cellpadding=10 bgcolor="#eeeeee" width="100%">
+<tr>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/"> Main </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/news.html"> News </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/projects/pcb-rnd/doc.html"> Doc </a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi">People</a>
+<th align=center bgcolor="#ccc0cc"> <a href="http://repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=events">Events</a> & <a href="http://www.repo.hu/cgi-bin/pcb-rnd-people.cgi?cmd=timeline"> timeline </a>
+<td align=right width="60%"> <font size="+2"><i>pcb-rnd</i></font> <img src="http://repo.hu/projects/pcb-rnd/resources/logo32.png" alt="[pcb-rnd logo]">
+</table>
+<!--AUTO navbar end-->
+
+<br>
+<!--content-->
+<h1> News </h1>
+<table border=0 cellpadding=20 width="100%">
+<tr><td align=right valign=top bgcolor="#eeeeee">
+ <table border=0 width="100%" cellpadding=15 cellspacing=15>
+ <tr>
+ <th align=right valign=top bgcolor="#ccccff" width="20%">
+ 2016-12-20
+ <br>
+ Official Debian packaging
+ <td bgcolor="#ddddff">
+ Dima Kogan volunteered to do the packaging for Debian. We may get in
+ testing, or if we are lucky, in the next stable. To ease packaging
+ an unscheduled intermediate version 1.1.4 was released. Thank you Dima!
+
+ <tr>
+ <th align=right valign=top bgcolor="#ccccff" width="20%">
+ 2016-11-02
+ <br>
+ Release: 1.1.3
+ <td bgcolor="#ddddff">
+ Available at <a href="releases/"> the download page </a>.
+ <br>
+ Features kicad compatibility, advanced search and the
+ lihata board format.
+
+ <tr>
+ <th align=right valign=top bgcolor="#ccccff" width="20%">
+ 2016-09-04
+ <br>
+ Rebranding
+ <td bgcolor="#ddddff">
+ We have a new main page reflecting the transition how we regard pcb-rnd:
+ it is not much of just a fork of geda/pcb by now, but a separate PCB
+ editor with its own team and own course. File save/load compatibility is
+ maintained.
+
+ <tr>
+ <th align=right valign=top bgcolor="#ccccff" width="20%">
+ 2016-08-24
+ <br>
+ Release 1.1.1
+ <td bgcolor="#ddddff">
+ Available at <a href="releases/"> the download page </a>.
+ <br>
+ The next development cycle will focus on editable/searchable attributes
+ and a new native file format.
+
+ </table>
+</table>
+
+</body>
+</html>
diff --git a/doc/plan.txt b/doc/plan.txt
new file mode 100644
index 0000000..dc4513e
--- /dev/null
+++ b/doc/plan.txt
@@ -0,0 +1,76 @@
+user manual
+ 1. intro: what is pcb-rnd; place in the generic workflow
+ 2. model of the world
+ intro
+ real boards (terminology)
+ pcb-rnd terminology
+ limitations
+ board, global properties
+ layer groups and layers
+ atomic objects
+ lines
+ arcs
+ vias
+ polygons
+ composite objects
+ elements
+ 3. where data is
+ board
+ paste buffers
+ footprint libraries
+ pcblib
+ static footprints
+ generated footprints
+ file formats
+ board
+ lihata
+ pcb
+ kicadl
+ kicad
+ footprint
+ import
+ export
+ 4. user interface (hid plugins)
+ under the hood: actions
+ gtk
+ main window
+ menu + keys
+ misc dialogs
+ log window
+ cli
+ library dialog
+ propedit dialog
+ preferences dialog
+ batch
+ (lesstif: low prio)
+ (remote: not finished yet)
+ (sdl: not even started yet)
+ 5. invocation
+ TODO
+ 6. feature plugins
+ autoplace
+ autoroute
+ ... (TODO)
+ 7. io plugins
+ lihata
+ kicadl
+ kicad s expr
+ 8. utilities
+ 9. appendix
+ glossary
+ full index/catalog of actions (generated)
+ full index/catalog of all plugins
+ how to build
+
+
+_styleguide notes:_
+urls all lowercased (eg. GTK becomes gtk)
+pronouns: write to avoid pronouns, use user/developer, use she
+organization: hierarchical with lots of links for people who have tunneled deep?
+navigation: don't add navigation in page, rely on browser navs
+html strict: use standard html 1.0
+css: use css for looks without content modification
+assets: generate assets (use dot, etc), assume make and same system is able to build pcb-rnd
+tables: use zebra styling for ease of reading
+deps/requirements for pcb-rnd itself (we need an appendix table to live create the actions list)
+naming sections: despite lowercasing urls, keep naming concise so links have names that lead to sections with same names
diff --git a/doc/resources/logo.pcb b/doc/resources/logo.pcb
new file mode 100644
index 0000000..b050380
--- /dev/null
+++ b/doc/resources/logo.pcb
@@ -0,0 +1,91 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["" 15240000nm 15240000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[13335000nm 8890000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,4,c:2,5,6,s:7:8")
+Styles["Signal,254000nm,1999996nm,800100nm,508000nm:Power,508000nm,2199894nm,999998nm,508000nm:Fat,2032000nm,3500120nm,1199896nm,635000nm:Sig-tight,254000nm,1625600nm,800100nm,304800nm"]
+
+Symbol['r' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['n' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['d' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+)
+
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/buffer_number" "0")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Attribute("PCB::conf::editor/show_solder_side" "0")
+Attribute("PCB::conf::editor/view/flip_x" "0")
+Attribute("PCB::conf::editor/view/flip_y" "0")
+
+Element["" "dip(2)" "rnd" "2*300" 0 6985000nm 6350000nm 635000nm 0 115 ""]
+(
+ Pin[7620000nm 0 2540000nm 1270000nm 2692400nm 999998nm "" "2" "thermal(0X,1X)"]
+
+ )
+Layer(1 "component")
+(
+ Polygon("clearpoly")
+ (
+ [635000nm 635000nm] [14605000nm 635000nm] [14605000nm 14605000nm] [635000nm 14605000nm]
+ )
+)
+Layer(2 "solder")
+(
+)
+Layer(3 "comp-GND")
+(
+)
+Layer(4 "comp-power")
+(
+)
+Layer(5 "sold-GND")
+(
+)
+Layer(6 "sold-power")
+(
+)
+Layer(7 "signal3")
+(
+)
+Layer(8 "outline")
+(
+)
+Layer(9 "silk")
+(
+)
+Layer(10 "silk")
+(
+)
diff --git a/doc-rnd/logo128.png b/doc/resources/logo128.png
similarity index 100%
rename from doc-rnd/logo128.png
rename to doc/resources/logo128.png
diff --git a/doc-rnd/logo16.png b/doc/resources/logo16.png
similarity index 100%
rename from doc-rnd/logo16.png
rename to doc/resources/logo16.png
diff --git a/doc-rnd/logo256.png b/doc/resources/logo256.png
similarity index 100%
rename from doc-rnd/logo256.png
rename to doc/resources/logo256.png
diff --git a/doc-rnd/logo32.png b/doc/resources/logo32.png
similarity index 100%
rename from doc-rnd/logo32.png
rename to doc/resources/logo32.png
diff --git a/doc-rnd/logo64.png b/doc/resources/logo64.png
similarity index 100%
rename from doc-rnd/logo64.png
rename to doc/resources/logo64.png
diff --git a/doc/resources/logo_made_with.pcb b/doc/resources/logo_made_with.pcb
new file mode 100644
index 0000000..0b65d0a
--- /dev/null
+++ b/doc/resources/logo_made_with.pcb
@@ -0,0 +1,82 @@
+# release: pcb 20140316
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20091103]
+
+PCB["" 6000.00mil 5000.00mil]
+
+Grid[1000.000000 0.0000 0.0000 0]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[10.00mil 10.00mil 10.00mil 10.00mil 15.00mil 10.00mil]
+Flags("nameonpcb,uniquename,clearnew,snappin")
+Groups("1,c:2:3:4:5:6,s:7:8")
+Styles["Signal,10.00mil,36.00mil,20.00mil,10.00mil:Power,25.00mil,60.00mil,35.00mil,10.00mil:Fat,40.00mil,60.00mil,35.00mil,10.00mil:Skinny,6.00mil,24.02mil,11.81mil,6.00mil"]
+
+Attribute("PCB::grid::unit" "mil")
+Layer(1 "top")
+(
+)
+Layer(2 "ground")
+(
+)
+Layer(3 "signal2")
+(
+)
+Layer(4 "signal3")
+(
+)
+Layer(5 "power")
+(
+)
+Layer(6 "bottom")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "spare")
+(
+)
+Layer(9 "silk")
+(
+)
+Layer(10 "silk")
+(
+ Line[2110.00mil 1950.00mil 2150.00mil 1950.00mil 10.00mil 20.00mil "clearline"]
+ Line[2180.00mil 1930.00mil 2180.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2180.00mil 1940.00mil 2190.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[2190.00mil 1930.00mil 2220.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[1920.00mil 1930.00mil 1950.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[1950.00mil 1970.00mil 1920.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[1960.00mil 1940.00mil 1960.00mil 1960.00mil 10.00mil 20.00mil "clearline"]
+ Line[1990.00mil 1930.00mil 2020.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[1980.00mil 1940.00mil 1980.00mil 1960.00mil 10.00mil 20.00mil "clearline"]
+ Line[1990.00mil 1970.00mil 2020.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2040.00mil 1880.00mil 2040.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2040.00mil 1970.00mil 2070.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2080.00mil 1960.00mil 2080.00mil 1940.00mil 10.00mil 20.00mil "clearline"]
+ Line[2070.00mil 1930.00mil 2040.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[1920.00mil 1930.00mil 1920.00mil 2010.00mil 10.00mil 20.00mil "clearline"]
+ Line[1980.00mil 1940.00mil 1990.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[1980.00mil 1960.00mil 1990.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2070.00mil 1930.00mil 2080.00mil 1940.00mil 10.00mil 20.00mil "clearline"]
+ Line[2080.00mil 1960.00mil 2070.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[1950.00mil 1930.00mil 1960.00mil 1940.00mil 10.00mil 20.00mil "clearline"]
+ Line[1950.00mil 1970.00mil 1960.00mil 1960.00mil 10.00mil 20.00mil "clearline"]
+ Line[2240.00mil 1930.00mil 2240.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2240.00mil 1940.00mil 2250.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[2250.00mil 1930.00mil 2270.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[2280.00mil 1940.00mil 2280.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2280.00mil 1940.00mil 2270.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[2300.00mil 1940.00mil 2300.00mil 1960.00mil 10.00mil 20.00mil "clearline"]
+ Line[2310.00mil 1970.00mil 2340.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Line[2340.00mil 1970.00mil 2340.00mil 1880.00mil 10.00mil 20.00mil "clearline"]
+ Line[2340.00mil 1930.00mil 2310.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[2300.00mil 1940.00mil 2310.00mil 1930.00mil 10.00mil 20.00mil "clearline"]
+ Line[2300.00mil 1960.00mil 2310.00mil 1970.00mil 10.00mil 20.00mil "clearline"]
+ Arc[1920.00mil 2020.00mil 10.00mil 10.00mil 10.00mil 20.00mil 0 360 "clearline"]
+ Arc[2040.00mil 1870.00mil 10.00mil 10.00mil 10.00mil 20.00mil 0 360 "clearline"]
+ Arc[2340.00mil 1870.00mil 10.00mil 10.00mil 10.00mil 20.00mil 0 360 "clearline"]
+ Text[2060.00mil 1860.00mil 0 100 "made with" "clearline"]
+)
diff --git a/doc-rnd/screenshot.jpg b/doc/resources/screenshot.jpg
similarity index 100%
rename from doc-rnd/screenshot.jpg
rename to doc/resources/screenshot.jpg
diff --git a/doc/tutorials/7805/7805.lht b/doc/tutorials/7805/7805.lht
new file mode 100644
index 0000000..9c6bde9
--- /dev/null
+++ b/doc/tutorials/7805/7805.lht
@@ -0,0 +1,994 @@
+# release: pcb-rnd 1.1.3
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["" 30480000nm 30480000nm]
+
+Grid[2540000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,4,c:2,5,6,s:7:8")
+Styles["Signal,254000nm,1999996nm,800100nm,508000nm:Power,508000nm,2199894nm,999998nm,508000nm:Fat,2032000nm,3500120nm,1199896nm,635000nm:Sig-tight,254000nm,1625600nm,800100nm,304800nm"]
+
+Symbol[' ' 457200nm]
+(
+)
+Symbol['!' 304800nm]
+(
+ SymbolLine[0 1143000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 0 889000nm 203200nm]
+)
+Symbol['"' 304800nm]
+(
+ SymbolLine[0 254000nm 0 508000nm 203200nm]
+ SymbolLine[254000nm 254000nm 254000nm 508000nm 203200nm]
+)
+Symbol['#' 304800nm]
+(
+ SymbolLine[0 889000nm 508000nm 889000nm 203200nm]
+ SymbolLine[0 635000nm 508000nm 635000nm 203200nm]
+ SymbolLine[381000nm 508000nm 381000nm 1016000nm 203200nm]
+ SymbolLine[127000nm 508000nm 127000nm 1016000nm 203200nm]
+)
+Symbol['$' 304800nm]
+(
+ SymbolLine[381000nm 381000nm 508000nm 508000nm 203200nm]
+ SymbolLine[127000nm 381000nm 381000nm 381000nm 203200nm]
+ SymbolLine[0 508000nm 127000nm 381000nm 203200nm]
+ SymbolLine[0 508000nm 0 635000nm 203200nm]
+ SymbolLine[0 635000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[381000nm 1143000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[0 1016000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[254000nm 254000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['%' 304800nm]
+(
+ SymbolLine[0 381000nm 0 508000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 254000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 381000nm 381000nm 203200nm]
+ SymbolLine[381000nm 381000nm 381000nm 508000nm 203200nm]
+ SymbolLine[254000nm 635000nm 381000nm 508000nm 203200nm]
+ SymbolLine[127000nm 635000nm 254000nm 635000nm 203200nm]
+ SymbolLine[0 508000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 1016000nm 254000nm 203200nm]
+ SymbolLine[889000nm 1270000nm 1016000nm 1143000nm 203200nm]
+ SymbolLine[1016000nm 1016000nm 1016000nm 1143000nm 203200nm]
+ SymbolLine[889000nm 889000nm 1016000nm 1016000nm 203200nm]
+ SymbolLine[762000nm 889000nm 889000nm 889000nm 203200nm]
+ SymbolLine[635000nm 1016000nm 762000nm 889000nm 203200nm]
+ SymbolLine[635000nm 1016000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[635000nm 1143000nm 762000nm 1270000nm 203200nm]
+ SymbolLine[762000nm 1270000nm 889000nm 1270000nm 203200nm]
+)
+Symbol['&' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 0 635000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 889000nm 381000nm 508000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[0 635000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 254000nm 254000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 381000nm 381000nm 203200nm]
+ SymbolLine[381000nm 381000nm 381000nm 508000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+)
+Symbol[''' 304800nm]
+(
+ SymbolLine[0 508000nm 254000nm 254000nm 203200nm]
+)
+Symbol['(' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+)
+Symbol[')' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 381000nm 203200nm]
+ SymbolLine[127000nm 381000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1143000nm 203200nm]
+)
+Symbol['*' 304800nm]
+(
+ SymbolLine[0 508000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[0 1016000nm 508000nm 508000nm 203200nm]
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[254000nm 508000nm 254000nm 1016000nm 203200nm]
+)
+Symbol['+' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[254000nm 508000nm 254000nm 1016000nm 203200nm]
+)
+Symbol[',' 304800nm]
+(
+ SymbolLine[0 1524000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['-' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol['.' 304800nm]
+(
+ SymbolLine[0 1270000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['/' 304800nm]
+(
+ SymbolLine[0 1143000nm 762000nm 381000nm 203200nm]
+)
+Symbol['0' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1016000nm 508000nm 508000nm 203200nm]
+)
+Symbol['1' 304800nm]
+(
+ SymbolLine[0 457200nm 203200nm 254000nm 203200nm]
+ SymbolLine[203200nm 254000nm 203200nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 381000nm 1270000nm 203200nm]
+)
+Symbol['2' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['3' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 584200nm 203200nm]
+ SymbolLine[508000nm 838200nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 838200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 584200nm 381000nm 711200nm 203200nm]
+)
+Symbol['4' 304800nm]
+(
+ SymbolLine[0 889000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 889000nm 635000nm 889000nm 203200nm]
+ SymbolLine[508000nm 254000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['5' 304800nm]
+(
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 0 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 635000nm 203200nm]
+ SymbolLine[127000nm 635000nm 381000nm 635000nm 203200nm]
+ SymbolLine[381000nm 635000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['6' 304800nm]
+(
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 711200nm 508000nm 838200nm 203200nm]
+ SymbolLine[0 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 838200nm 508000nm 1143000nm 203200nm]
+)
+Symbol['7' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 635000nm 254000nm 203200nm]
+)
+Symbol['8' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 939800nm 0 1143000nm 203200nm]
+ SymbolLine[0 939800nm 177800nm 762000nm 203200nm]
+ SymbolLine[177800nm 762000nm 330200nm 762000nm 203200nm]
+ SymbolLine[330200nm 762000nm 508000nm 939800nm 203200nm]
+ SymbolLine[508000nm 939800nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 584200nm 177800nm 762000nm 203200nm]
+ SymbolLine[0 381000nm 0 584200nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 584200nm 203200nm]
+ SymbolLine[330200nm 762000nm 508000nm 584200nm 203200nm]
+)
+Symbol['9' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 762000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 635000nm 203200nm]
+ SymbolLine[0 635000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol[':' 304800nm]
+(
+ SymbolLine[0 635000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 889000nm 203200nm]
+)
+Symbol[';' 304800nm]
+(
+ SymbolLine[0 1270000nm 254000nm 1016000nm 203200nm]
+ SymbolLine[254000nm 635000nm 254000nm 762000nm 203200nm]
+)
+Symbol['<' 304800nm]
+(
+ SymbolLine[0 762000nm 254000nm 508000nm 203200nm]
+ SymbolLine[0 762000nm 254000nm 1016000nm 203200nm]
+)
+Symbol['=' 304800nm]
+(
+ SymbolLine[0 635000nm 508000nm 635000nm 203200nm]
+ SymbolLine[0 889000nm 508000nm 889000nm 203200nm]
+)
+Symbol['>' 304800nm]
+(
+ SymbolLine[0 508000nm 254000nm 762000nm 203200nm]
+ SymbolLine[0 1016000nm 254000nm 762000nm 203200nm]
+)
+Symbol['?' 304800nm]
+(
+ SymbolLine[254000nm 762000nm 254000nm 889000nm 203200nm]
+ SymbolLine[254000nm 1143000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 0 508000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 508000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 508000nm 203200nm]
+)
+Symbol['@' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1016000nm 203200nm]
+ SymbolLine[0 1016000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 1016000nm 1270000nm 203200nm]
+ SymbolLine[1270000nm 889000nm 1270000nm 254000nm 203200nm]
+ SymbolLine[1270000nm 254000nm 1016000nm 0 203200nm]
+ SymbolLine[1016000nm 0 254000nm 0 203200nm]
+ SymbolLine[254000nm 0 0 254000nm 203200nm]
+ SymbolLine[381000nm 508000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 762000nm 889000nm 203200nm]
+ SymbolLine[762000nm 889000nm 889000nm 762000nm 203200nm]
+ SymbolLine[889000nm 762000nm 1016000nm 889000nm 203200nm]
+ SymbolLine[889000nm 762000nm 889000nm 381000nm 203200nm]
+ SymbolLine[889000nm 508000nm 762000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 762000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 381000nm 508000nm 203200nm]
+ SymbolLine[1016000nm 889000nm 1270000nm 889000nm 203200nm]
+)
+Symbol['A' 304800nm]
+(
+ SymbolLine[0 508000nm 0 1270000nm 203200nm]
+ SymbolLine[0 508000nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 457200nm 254000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 508000nm 203200nm]
+ SymbolLine[635000nm 508000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['B' 304800nm]
+(
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[635000nm 838200nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 711200nm 635000nm 838200nm 203200nm]
+ SymbolLine[127000nm 711200nm 508000nm 711200nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 584200nm 203200nm]
+ SymbolLine[508000nm 711200nm 635000nm 584200nm 203200nm]
+)
+Symbol['C' 304800nm]
+(
+ SymbolLine[177800nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1092200nm 177800nm 1270000nm 203200nm]
+ SymbolLine[0 431800nm 0 1092200nm 203200nm]
+ SymbolLine[0 431800nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 508000nm 254000nm 203200nm]
+)
+Symbol['D' 304800nm]
+(
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 431800nm 203200nm]
+ SymbolLine[635000nm 431800nm 635000nm 1092200nm 203200nm]
+ SymbolLine[457200nm 1270000nm 635000nm 1092200nm 203200nm]
+ SymbolLine[0 1270000nm 457200nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 457200nm 254000nm 203200nm]
+)
+Symbol['E' 304800nm]
+(
+ SymbolLine[0 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+)
+Symbol['F' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 711200nm 381000nm 711200nm 203200nm]
+)
+Symbol['G' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[635000nm 889000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol['H' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[635000nm 254000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['I' 304800nm]
+(
+ SymbolLine[0 254000nm 254000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['J' 304800nm]
+(
+ SymbolLine[177800nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 0 1016000nm 203200nm]
+)
+Symbol['K' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 762000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 762000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['L' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['M' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 762000nm 254000nm 203200nm]
+ SymbolLine[762000nm 254000nm 762000nm 1270000nm 203200nm]
+)
+Symbol['N' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[635000nm 254000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['O' 304800nm]
+(
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['P' 304800nm]
+(
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 635000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol['Q' 304800nm]
+(
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 889000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['R' 304800nm]
+(
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 635000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[330200nm 762000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['S' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 635000nm 203200nm]
+ SymbolLine[0 635000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[635000nm 889000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['T' 304800nm]
+(
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['U' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 254000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['V' 304800nm]
+(
+ SymbolLine[0 254000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 254000nm 203200nm]
+)
+Symbol['W' 304800nm]
+(
+ SymbolLine[0 254000nm 0 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[635000nm 1270000nm 762000nm 762000nm 203200nm]
+ SymbolLine[762000nm 762000nm 762000nm 254000nm 203200nm]
+)
+Symbol['X' 304800nm]
+(
+ SymbolLine[0 1270000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['Y' 304800nm]
+(
+ SymbolLine[0 254000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 254000nm 203200nm]
+ SymbolLine[254000nm 762000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['Z' 304800nm]
+(
+ SymbolLine[0 254000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['[' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['\' 304800nm]
+(
+ SymbolLine[0 381000nm 762000nm 1143000nm 203200nm]
+)
+Symbol[']' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['^' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 254000nm 381000nm 203200nm]
+)
+Symbol['_' 304800nm]
+(
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['a' 304800nm]
+(
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1143000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['b' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+)
+Symbol['c' 304800nm]
+(
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['d' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+)
+Symbol['e' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[0 1016000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[508000nm 1016000nm 508000nm 889000nm 203200nm]
+)
+Symbol['f' 254000nm]
+(
+ SymbolLine[127000nm 381000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 381000nm 254000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[0 762000nm 254000nm 762000nm 203200nm]
+)
+Symbol['g' 304800nm]
+(
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[0 1524000nm 127000nm 1651000nm 203200nm]
+ SymbolLine[127000nm 1651000nm 381000nm 1651000nm 203200nm]
+ SymbolLine[381000nm 1651000nm 508000nm 1524000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1524000nm 203200nm]
+)
+Symbol['h' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['i' 254000nm]
+(
+ SymbolLine[0 508000nm 0 533400nm 254000nm]
+ SymbolLine[0 889000nm 0 1270000nm 203200nm]
+)
+Symbol['j' 254000nm]
+(
+ SymbolLine[127000nm 508000nm 127000nm 533400nm 254000nm]
+ SymbolLine[127000nm 889000nm 127000nm 1524000nm 203200nm]
+ SymbolLine[0 1651000nm 127000nm 1524000nm 203200nm]
+)
+Symbol['k' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 889000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 254000nm 635000nm 203200nm]
+)
+Symbol['l' 254000nm]
+(
+ SymbolLine[0 254000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['m' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 889000nm 635000nm 762000nm 203200nm]
+ SymbolLine[635000nm 762000nm 762000nm 762000nm 203200nm]
+ SymbolLine[762000nm 762000nm 889000nm 889000nm 203200nm]
+ SymbolLine[889000nm 889000nm 889000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['n' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['o' 304800nm]
+(
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['p' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1651000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[635000nm 889000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['q' 304800nm]
+(
+ SymbolLine[508000nm 889000nm 508000nm 1651000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['r' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['s' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1016000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1016000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 1016000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['t' 254000nm]
+(
+ SymbolLine[127000nm 254000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 635000nm 254000nm 635000nm 203200nm]
+)
+Symbol['u' 304800nm]
+(
+ SymbolLine[0 762000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['v' 304800nm]
+(
+ SymbolLine[0 762000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 762000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['w' 304800nm]
+(
+ SymbolLine[0 762000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 762000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1143000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[635000nm 1270000nm 762000nm 1143000nm 203200nm]
+ SymbolLine[762000nm 762000nm 762000nm 1143000nm 203200nm]
+)
+Symbol['x' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 762000nm 203200nm]
+)
+Symbol['y' 304800nm]
+(
+ SymbolLine[0 762000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1524000nm 203200nm]
+ SymbolLine[381000nm 1651000nm 508000nm 1524000nm 203200nm]
+ SymbolLine[127000nm 1651000nm 381000nm 1651000nm 203200nm]
+ SymbolLine[0 1524000nm 127000nm 1651000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['z' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['{' 304800nm]
+(
+ SymbolLine[127000nm 381000nm 254000nm 254000nm 203200nm]
+ SymbolLine[127000nm 381000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+ SymbolLine[127000nm 889000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['|' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+)
+Symbol['}' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 381000nm 203200nm]
+ SymbolLine[127000nm 381000nm 127000nm 635000nm 203200nm]
+ SymbolLine[127000nm 635000nm 254000nm 762000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[127000nm 889000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1143000nm 203200nm]
+)
+Symbol['~' 304800nm]
+(
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 889000nm 203200nm]
+ SymbolLine[381000nm 889000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 635000nm 762000nm 203200nm]
+)
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::loader" "geda/pcb - nanometer")
+Attribute("PCB::conf::editor/grid" "100.00 mil")
+Attribute("PCB::conf::editor/view/flip_x" "0")
+Attribute("PCB::conf::editor/view/flip_y" "0")
+Attribute("PCB::conf::editor/show_solder_side" "0")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Attribute("PCB::conf::editor/buffer_number" "0")
+
+Element["onsolder" "0805" "C3" "100nF" 25400000nm 20320000nm 800100nm -800100nm 2 100 "auto"]
+(
+ Attribute("vendor_part_number" "unknown")
+ Attribute("vendor" "unknown")
+ Attribute("manufacturer_part_number" "unknown")
+ Attribute("device" "CAPACITOR")
+ Attribute("manufacturer" "unknown")
+ Pad[899922nm -99822nm 899922nm 99822nm 1299972nm 508000nm 1452372nm "1" "1" "onsolder,square"]
+ Pad[-899922nm -99822nm -899922nm 99822nm 1299972nm 508000nm 1452372nm "2" "2" "onsolder,square"]
+ ElementLine [-99822nm -699770nm 99822nm -699770nm 203200nm]
+ ElementLine [-99822nm 699770nm 99822nm 699770nm 203200nm]
+
+ )
+
+Element["onsolder" "0805" "C2" "100nF" 20320000nm 20320000nm -800100nm 800100nm 0 100 "auto"]
+(
+ Attribute("vendor_part_number" "unknown")
+ Attribute("vendor" "unknown")
+ Attribute("manufacturer_part_number" "unknown")
+ Attribute("device" "CAPACITOR")
+ Attribute("manufacturer" "unknown")
+ Pad[-899922nm -99822nm -899922nm 99822nm 1299972nm 508000nm 1452372nm "1" "1" "onsolder,square"]
+ Pad[899922nm -99822nm 899922nm 99822nm 1299972nm 508000nm 1452372nm "2" "2" "onsolder,square"]
+ ElementLine [-99822nm 699770nm 99822nm 699770nm 203200nm]
+ ElementLine [-99822nm -699770nm 99822nm -699770nm 203200nm]
+
+ )
+
+Element["" "rcy(200)" "C1" "47uF" 12700000nm 10160000nm -1016000nm 5207000nm 0 100 ""]
+(
+ Attribute("vendor_part_number" "unknown")
+ Attribute("vendor" "unknown")
+ Attribute("manufacturer_part_number" "unknown")
+ Attribute("device" "POLARIZED_CAPACITOR")
+ Attribute("manufacturer" "unknown")
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "+" "1" "square,edge2"]
+ Pin[-5080000nm 0 2032000nm 1270000nm 2184400nm 999998nm "-" "2" "edge2,thermal(4X)"]
+ ElementLine [-9144000nm 0 -8128000nm 0 254000nm]
+ ElementLine [3048000nm 0 4064000nm 0 254000nm]
+ ElementLine [3556000nm -508000nm 3556000nm 508000nm 254000nm]
+ ElementArc [-2540000nm 0 5080000nm 5080000nm 180 360 254000nm]
+
+ )
+
+Element["" "connector(2,1)" "CONN2" "unknown" 6350000nm 20320000nm -3175000nm 635000nm 1 100 ""]
+(
+ Attribute("vendor_part_number" "unknown")
+ Attribute("vendor" "unknown")
+ Attribute("manufacturer_part_number" "unknown")
+ Attribute("device" "CONNECTOR_2")
+ Attribute("manufacturer" "unknown")
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "1" "1" "square"]
+ Pin[0 -2540000nm 2032000nm 1270000nm 2184400nm 999998nm "2" "2" "thermal(4X)"]
+ ElementLine [-1270000nm 1270000nm 1270000nm 1270000nm 254000nm]
+ ElementLine [-1270000nm -3810000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [1270000nm -3810000nm 1270000nm 1270000nm 254000nm]
+ ElementLine [-1270000nm -3810000nm 1270000nm -3810000nm 254000nm]
+ ElementLine [1270000nm -1270000nm 1270000nm 1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 1270000nm -1270000nm 254000nm]
+
+ )
+
+Element["" "connector(3,1)" "CONN1" "unknown" 14605000nm 23495000nm -3810000nm 1270000nm 0 100 ""]
+(
+ Attribute("vendor_part_number" "unknown")
+ Attribute("vendor" "unknown")
+ Attribute("manufacturer_part_number" "unknown")
+ Attribute("device" "CONNECTOR_3")
+ Attribute("manufacturer" "unknown")
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "1" "1" "square,edge2"]
+ Pin[-2540000nm 0 2032000nm 1270000nm 2184400nm 999998nm "2" "2" "edge2,thermal(4X)"]
+ Pin[-5080000nm 0 2032000nm 1270000nm 2184400nm 999998nm "3" "3" "edge2"]
+ ElementLine [1270000nm -1270000nm 1270000nm 1270000nm 254000nm]
+ ElementLine [-6350000nm 1270000nm 1270000nm 1270000nm 254000nm]
+ ElementLine [-6350000nm -1270000nm 1270000nm -1270000nm 254000nm]
+ ElementLine [-6350000nm -1270000nm -6350000nm 1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 1270000nm -1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm -1270000nm 1270000nm 254000nm]
+
+ )
+
+Element["" "TO220" "U1" "unknown" 22860000nm 23495000nm -6985000nm -19177000nm 1 100 ""]
+(
+ Attribute("vendor_part_number" "unknown")
+ Attribute("vendor" "unknown")
+ Attribute("manufacturer_part_number" "unknown")
+ Attribute("device" "7805")
+ Attribute("manufacturer" "unknown")
+ Pin[-2540000nm 0 2286000nm 762000nm 2438400nm 1524000nm "1" "1" "square"]
+ Pin[0 0 2286000nm 762000nm 2438400nm 1524000nm "2" "2" "thermal(4X)"]
+ Pin[2540000nm 0 2286000nm 762000nm 2438400nm 1524000nm "3" "3" ""]
+ Pin[0 -17018000nm 3810000nm 762000nm 3962400nm 3302000nm "4" "4" ""]
+ ElementLine [-2540000nm 0 -2540000nm -4572000nm 762000nm]
+ ElementLine [0 0 0 -4572000nm 762000nm]
+ ElementLine [2540000nm 0 2540000nm -4572000nm 762000nm]
+ ElementLine [-5080000nm -4572000nm 5080000nm -4572000nm 508000nm]
+ ElementLine [5080000nm -4572000nm 5080000nm -14097000nm 508000nm]
+ ElementLine [5080000nm -14097000nm -5080000nm -14097000nm 508000nm]
+ ElementLine [-5080000nm -14097000nm -5080000nm -4572000nm 508000nm]
+ ElementLine [-5080000nm -14097000nm 5080000nm -14097000nm 508000nm]
+ ElementLine [5080000nm -14097000nm 5080000nm -17272000nm 508000nm]
+ ElementLine [5080000nm -17272000nm 4699000nm -17272000nm 508000nm]
+ ElementLine [4699000nm -17272000nm 4699000nm -19050000nm 508000nm]
+ ElementLine [4699000nm -19050000nm 5080000nm -19050000nm 508000nm]
+ ElementLine [5080000nm -19050000nm 5080000nm -20066000nm 508000nm]
+ ElementLine [5080000nm -20066000nm -5080000nm -20066000nm 508000nm]
+ ElementLine [-5080000nm -20066000nm -5080000nm -19050000nm 508000nm]
+ ElementLine [-5080000nm -19050000nm -4699000nm -19050000nm 508000nm]
+ ElementLine [-4699000nm -19050000nm -4699000nm -17272000nm 508000nm]
+ ElementLine [-4699000nm -17272000nm -5080000nm -17272000nm 508000nm]
+ ElementLine [-5080000nm -17272000nm -5080000nm -14097000nm 508000nm]
+
+ )
+Layer(1 "component")
+(
+)
+Layer(2 "solder")
+(
+ Line[6350000nm 20320000nm 4445000nm 20320000nm 2032000nm 1270000nm "clearline"]
+ Line[6350000nm 20320000nm 3810000nm 20320000nm 2032000nm 1270000nm "clearline"]
+ Line[3810000nm 20320000nm 3810000nm 3810000nm 2032000nm 1270000nm "clearline"]
+ Line[27305000nm 3810000nm 27305000nm 23495000nm 2032000nm 1270000nm "clearline"]
+ Line[27305000nm 23495000nm 25400000nm 23495000nm 2032000nm 1270000nm "clearline"]
+ Line[3810000nm 3810000nm 20320000nm 3810000nm 2032000nm 1270000nm "clearline"]
+ Line[27305000nm 3810000nm 25400000nm 3810000nm 2032000nm 1270000nm "clearline"]
+ Line[20320000nm 3810000nm 25400000nm 3810000nm 762000nm 1016000nm "clearline"]
+ Line[20320000nm 3175000nm 26035000nm 3175000nm 635000nm 1016000nm "clearline"]
+ Line[12700000nm 10160000nm 15240000nm 10160000nm 2032000nm 1270000nm "clearline"]
+ Line[15240000nm 10160000nm 17145000nm 12065000nm 2032000nm 1270000nm "clearline"]
+ Line[17145000nm 12065000nm 17145000nm 23495000nm 2032000nm 1270000nm "clearline"]
+ Line[20320000nm 23495000nm 14605000nm 23495000nm 2032000nm 1270000nm "clearline"]
+ Line[19420078nm 20320000nm 17145000nm 20320000nm 508000nm 1016000nm "clearline"]
+)
+Layer(3 "comp-GND")
+(
+)
+Layer(4 "comp-power")
+(
+)
+Layer(5 "sold-GND")
+(
+ Line[21219922nm 20320000nm 24500078nm 20320000nm 508000nm 1016000nm ""]
+ Polygon("clearpoly")
+ (
+ [2540000nm 26035000nm] [28575000nm 26035000nm] [28575000nm 2540000nm] [2540000nm 2540000nm]
+ )
+)
+Layer(6 "sold-power")
+(
+)
+Layer(7 "signal3")
+(
+)
+Layer(8 "outline")
+(
+ Line[2540000nm 2540000nm 2540000nm 26035000nm 254000nm 1016000nm "clearline"]
+ Line[2540000nm 2540000nm 28575000nm 2540000nm 254000nm 1016000nm "clearline"]
+ Line[2540000nm 26035000nm 28575000nm 26035000nm 254000nm 1016000nm "clearline"]
+ Line[28575000nm 26035000nm 28575000nm 2540000nm 254000nm 1016000nm "clearline"]
+)
+Layer(9 "silk")
+(
+)
+Layer(10 "silk")
+(
+ Text[8255000nm 15875000nm 0 195 "-" "clearline"]
+ Text[8255000nm 18415000nm 0 195 "+" "clearline"]
+ Text[13970000nm 19685000nm 0 195 "+" "clearline"]
+ Text[11430000nm 19685000nm 0 195 "-" "clearline"]
+ Text[6985000nm 22860000nm 0 100 "in" "clearline"]
+ Text[2921000nm 14859000nm 0 100 "out: +5V" "clearline"]
+)
+NetList()
+(
+ Net("GND" "(unknown)")
+ (
+ Connect("C1-2")
+ Connect("C2-2")
+ Connect("C3-2")
+ Connect("CONN1-2")
+ Connect("CONN2-2")
+ Connect("U1-2")
+ )
+ Net("unnamed_net1" "(unknown)")
+ (
+ Connect("C1-1")
+ Connect("C2-1")
+ Connect("CONN1-1")
+ Connect("U1-1")
+ )
+ Net("unnamed_net2" "(unknown)")
+ (
+ Connect("C3-1")
+ Connect("CONN2-1")
+ Connect("U1-3")
+ )
+)
diff --git a/doc/tutorials/7805/7805.sch b/doc/tutorials/7805/7805.sch
new file mode 100644
index 0000000..45de51f
--- /dev/null
+++ b/doc/tutorials/7805/7805.sch
@@ -0,0 +1,88 @@
+v 20130925 2
+C 23100 57800 1 0 0 lm7805-1.sym
+{
+T 24700 59100 5 10 0 0 0 0 1
+device=7805
+T 24500 58800 5 10 1 1 0 6 1
+refdes=U1
+T 23400 58800 5 10 1 1 0 0 1
+footprint=TO220
+}
+C 21100 57200 1 0 1 connector3-2.sym
+{
+T 20400 58900 5 10 1 1 0 0 1
+refdes=CONN1
+T 20800 58850 5 10 0 0 0 6 1
+device=CONNECTOR_3
+T 20800 59050 5 10 0 0 0 6 1
+footprint=connector(3,1)
+}
+N 21100 58400 23100 58400 4
+N 21100 58000 21700 58000 4
+N 21700 58000 21700 56700 4
+C 21600 56400 1 0 0 gnd-1.sym
+T 21200 57500 9 10 1 0 0 0 1
+key
+C 23800 56400 1 0 0 gnd-1.sym
+N 23900 56700 23900 57800 4
+C 25900 57600 1 0 0 connector2-2.sym
+{
+T 26600 58900 5 10 1 1 0 6 1
+refdes=CONN2
+T 26200 58850 5 10 0 0 0 0 1
+device=CONNECTOR_2
+T 26200 59050 5 10 0 0 0 0 1
+footprint=connector(2,1)
+}
+N 25900 58400 24700 58400 4
+N 25700 58000 25700 56700 4
+C 25600 56400 1 0 0 gnd-1.sym
+N 25900 58000 25700 58000 4
+C 22000 58000 1 270 0 capacitor-2.sym
+{
+T 22700 57800 5 10 0 0 270 0 1
+device=POLARIZED_CAPACITOR
+T 22000 57400 5 10 1 1 270 0 1
+refdes=C1
+T 22900 57800 5 10 0 0 270 0 1
+symversion=0.1
+T 22000 58000 5 10 0 0 270 0 1
+footprint=rcy(200)
+T 22000 58100 5 10 1 1 270 0 1
+value=47uF
+}
+C 22100 56400 1 0 0 gnd-1.sym
+N 22200 57100 22200 56700 4
+N 22200 58000 22200 58400 4
+C 22700 58000 1 270 0 capacitor-1.sym
+{
+T 23400 57800 5 10 0 0 270 0 1
+device=CAPACITOR
+T 23200 57800 5 10 1 1 270 0 1
+refdes=C2
+T 23600 57800 5 10 0 0 270 0 1
+symversion=0.1
+T 22700 58200 5 10 1 1 270 0 1
+value=100nF
+T 22700 58000 5 10 0 0 0 0 1
+footprint=0805
+}
+N 22900 58000 22900 58400 4
+C 22800 56400 1 0 0 gnd-1.sym
+N 22900 56700 22900 57100 4
+C 24800 58000 1 270 0 capacitor-1.sym
+{
+T 25500 57800 5 10 0 0 270 0 1
+device=CAPACITOR
+T 25300 57800 5 10 1 1 270 0 1
+refdes=C3
+T 25700 57800 5 10 0 0 270 0 1
+symversion=0.1
+T 24800 58200 5 10 1 1 270 0 1
+value=100nF
+T 24800 58000 5 10 0 0 0 0 1
+footprint=0805
+}
+N 25000 58000 25000 58400 4
+C 24900 56400 1 0 0 gnd-1.sym
+N 25000 56700 25000 57100 4
diff --git a/doc/tutorials/7805/Info.lht b/doc/tutorials/7805/Info.lht
new file mode 100644
index 0000000..668156d
--- /dev/null
+++ b/doc/tutorials/7805/Info.lht
@@ -0,0 +1,13 @@
+ha:pcb-rnd-tutorial {
+ level=10
+ li:demonstrates {
+ gschem
+ gsch2pcb-rnd
+ make
+ }
+ short = 7805 module with connectors
+ long {
+ A 7805 based voltage source module to demonstrate a simple
+ gschem -> gsch2pcb-rnd -> pcb-rnd forward annotation chain.
+ }
+}
diff --git a/doc/tutorials/7805/Makefile b/doc/tutorials/7805/Makefile
new file mode 100644
index 0000000..3975b7d
--- /dev/null
+++ b/doc/tutorials/7805/Makefile
@@ -0,0 +1,5 @@
+7805.lht: 7805.sch
+ gsch2pcb-rnd -m import 7805.sch
+
+clean:
+ rm -f 7805.cmd
diff --git a/doc/tutorials/7805/index.html b/doc/tutorials/7805/index.html
new file mode 100644
index 0000000..00a6b4f
--- /dev/null
+++ b/doc/tutorials/7805/index.html
@@ -0,0 +1,96 @@
+ <H3> Step 1: schematics </H3>
+ <p>
+ <i>The schematics is usually the single source of all logical information:
+ footprints, element refdes and values and connections (networks or nets).
+ A project is just a directory that holds at least the schematics, but
+ usually also the pcb layout file and scripts.</i>
+ <p>
+ Start the new project by creating an empty directory. Start
+ gschem with an empty design and save it in the project directory.
+ Place the following symbols and edit/add these attributes:
+ <ul>
+ <li> 7805, footprint=TO220, refdes=U1
+ <li> connector-3-2, footprint=connector(3,1), refdes=CONN1
+ <li> connector-2-2, footprint=connector(2,1), refdes=CONN2
+ <li> capacitor-2, fooptrint=rcy(200), value=47uF, refdes=C1
+ <li> capacitor-1, fooptrint=0805, value=100nF, refdes=C2
+ <li> capacitor-2, fooptrint=0805, value=100nF, refdes=C2
+ <li> gnd-1
+ </ul>
+ <p>
+ Arrange and connect the pins as shown below.
+ <p>
+ <img src="sch.png" alt="schematics">
+ <p>
+ Save the design as 7805.sch.
+ <H3> Step 2: build script </H3>
+ <p>
+ <i>We are going to use a Makefile in this example to demonstrate
+ how to automate certain steps. In a fully automated project all
+ data exchange between the various tools (schematics editor, pcb-rnd,
+ simulators, etc.) is done by scripts. Generating the documentation
+ and exporting various other output like gerbers are usually automated
+ the same way. (As an alternative, all these can be done manually, from
+ the GUI as well.)</i>
+ <p>
+ Create a new file called Makefile and edit it using your favorite text
+ editor to the following:
+ <pre>
+7805.lht: 7805.sch
+ gsch2pcb-rnd -m import 7805.sch
+
+clean:
+ rm -f 7805.cmd
+ </pre>
+ <p>
+ The first rule calls the forward annotation utility, gsch2pcb-rnd to
+ create a forward annotation command file called 7805.cmd when the
+ schematics file is newer than the layout file (7805.lht). The second
+ rule removes such a command file to make the directory clean of
+ auto-generated temporary files.
+
+ <H3> Step 3: Create the initial board </H3>
+ <p>
+ <i>The layout process usually starts when there's at least a partially
+ finished schematics is available. The most common workflow is that
+ changes and improvements in the schematics are forward annotated to
+ the layout.</i>
+ <p>
+ Start pcb-rnd. This will load the system-installed template board
+ as a new, empty design. Save it in the project directory as 7805.lht.
+ <p>
+ Start a shell (but don't close pcb-rnd); in the project directory,
+ type <tt>make</tt>. This will create 7805.cmd that contains a pcb-rnd
+ action script that can sync a board to the information extracted from
+ the schematics.
+ <p>
+ Back in pcb-rnd, type ":ExecuteFile(7805.cmd)" and press enter. The colon
+ will open the CLI entry where the ExecuteFile(filename) is an action that
+ will load the file named and execute each line as an action.
+ <p>
+ At the end of the process, the layout should have all footprints. Press
+ 'o' and the logical connections will show up as a "rats nest".
+
+ <H3> Step 4: Lay out the board </H3>
+ <p>
+ Move the elements around. Pressing 'o' after some moves will re-optimize
+ the rats. As rats nest gets simpler and simpler, this can help choosing
+ the best placement. All components started out on the component (top) side.
+ Hover the mouse over the 0805 capacitors and press 'b' - this will send
+ them to the solder side.
+ <p>
+ After the placement, pick the solder layer to draw on and use the line tool
+ to draw the traces. Change the style to 'Power' or 'Fat' to get wider
+ traces. Press 'o' after drawing a few connections. When only the ground
+ network is left, use the rectangle tool to draw a large polygon on the
+ solder-gnd layer. Use the thermal tool to connect pins to the ground polygon.
+ The thermal tool does not work on SMD pads, they need to be connected using
+ lines.
+ <p>
+ When everything is connected, pressing 'o' will remove the last rat line.
+ The message log window also shows how many rats are remaining when 'o'
+ is pressed. The message log can be opened using the
+ <i>Window/Message Log</i> menu.
+
+ <H3> Step 5: updates </H3>
+ <p>
diff --git a/doc/user/01_intro/Makefile b/doc/user/01_intro/Makefile
new file mode 100644
index 0000000..ead838f
--- /dev/null
+++ b/doc/user/01_intro/Makefile
@@ -0,0 +1,2 @@
+flow.svg: src/flow.dot
+ dot -Tsvg src/flow.dot > flow.svg
diff --git a/doc/user/01_intro/flow.svg b/doc/user/01_intro/flow.svg
new file mode 100644
index 0000000..7072ebb
--- /dev/null
+++ b/doc/user/01_intro/flow.svg
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.26.3 (20100126.1600)
+ -->
+<!-- Title: flow Pages: 1 -->
+<svg width="994pt" height="508pt"
+ viewBox="0.00 0.00 994.00 508.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 504)">
+<title>flow</title>
+<polygon fill="white" stroke="white" points="-4,5 -4,-504 991,-504 991,5 -4,5"/>
+<!-- sch -->
+<g id="node2" class="node"><title>sch</title>
+<ellipse fill="none" stroke="black" cx="97" cy="-258" rx="96.8736" ry="29.6985"/>
+<text text-anchor="middle" x="97" y="-262.4" font-family="Times Roman,serif" font-size="14.00">schematics editor</text>
+<text text-anchor="middle" x="97" y="-245.4" font-family="Times Roman,serif" font-size="14.00">e.g. gschem</text>
+</g>
+<!-- pcb -->
+<g id="node4" class="node"><title>pcb</title>
+<polygon fill="none" stroke="black" points="552,-228.177 552,-287.823 509.823,-330 450.177,-330 408,-287.823 408,-228.177 450.177,-186 509.823,-186 552,-228.177"/>
+<text text-anchor="middle" x="480" y="-253.9" font-family="Times Roman,serif" font-size="14.00">pcb-rnd</text>
+</g>
+<!-- sch->pcb -->
+<g id="edge5" class="edge"><title>sch->pcb</title>
+<path fill="none" stroke="black" d="M194.142,-258C256.991,-258 337.918,-258 397.614,-258"/>
+<polygon fill="black" stroke="black" points="397.753,-261.5 407.753,-258 397.753,-254.5 397.753,-261.5"/>
+<text text-anchor="middle" x="268" y="-262.4" font-family="Times Roman,serif" font-size="14.00">fwd annotation</text>
+</g>
+<!-- pcb->sch -->
+<g id="edge7" class="edge"><title>pcb->sch</title>
+<path fill="none" stroke="grey" d="M407.731,-245.74C353.771,-238.188 278.234,-231.002 212,-237 203.792,-237.743 195.294,-238.779 186.805,-239.996"/>
+<polygon fill="grey" stroke="grey" points="186.225,-236.544 176.861,-241.501 187.272,-243.465 186.225,-236.544"/>
+<text text-anchor="middle" x="268" y="-241.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">back annotation</text>
+</g>
+<!-- fab -->
+<g id="node8" class="node"><title>fab</title>
+<ellipse fill="none" stroke="black" cx="891" cy="-355" rx="57.1737" ry="18"/>
+<text text-anchor="middle" x="891" y="-350.9" font-family="Times Roman,serif" font-size="14.00">fab house</text>
+</g>
+<!-- pcb->fab -->
+<g id="edge9" class="edge"><title>pcb->fab</title>
+<path fill="none" stroke="black" d="M552.343,-279.542C578.585,-287.055 608.529,-295.28 636,-302 702.5,-318.268 779.537,-333.832 831.385,-343.834"/>
+<polygon fill="black" stroke="black" points="830.928,-347.311 841.408,-345.759 832.248,-340.436 830.928,-347.311"/>
+<text text-anchor="middle" x="707" y="-337.4" font-family="Times Roman,serif" font-size="14.00">e.g. gerber, bom, xy</text>
+</g>
+<!-- tt -->
+<g id="node9" class="node"><title>tt</title>
+<ellipse fill="none" stroke="black" cx="891" cy="-290" rx="94.7523" ry="29.6985"/>
+<text text-anchor="middle" x="891" y="-294.4" font-family="Times Roman,serif" font-size="14.00">etching at home:</text>
+<text text-anchor="middle" x="891" y="-277.4" font-family="Times Roman,serif" font-size="14.00">toner transfer</text>
+</g>
+<!-- pcb->tt -->
+<g id="edge11" class="edge"><title>pcb->tt</title>
+<path fill="none" stroke="black" d="M552.061,-263.611C617.585,-268.712 714.996,-276.297 788.596,-282.027"/>
+<polygon fill="black" stroke="black" points="788.576,-285.536 798.818,-282.823 789.119,-278.557 788.576,-285.536"/>
+<text text-anchor="middle" x="707" y="-285.4" font-family="Times Roman,serif" font-size="14.00">e.g. ps or png</text>
+</g>
+<!-- web -->
+<g id="node10" class="node"><title>web</title>
+<ellipse fill="none" stroke="black" cx="891" cy="-225" rx="57.1737" ry="18"/>
+<text text-anchor="middle" x="891" y="-220.9" font-family="Times Roman,serif" font-size="14.00">web page</text>
+</g>
+<!-- pcb->web -->
+<g id="edge13" class="edge"><title>pcb->web</title>
+<path fill="none" stroke="black" d="M552.061,-252.214C629.129,-246.026 750.309,-236.296 824.974,-230.301"/>
+<polygon fill="black" stroke="black" points="825.503,-233.77 835.191,-229.481 824.943,-226.793 825.503,-233.77"/>
+<text text-anchor="middle" x="707" y="-250.4" font-family="Times Roman,serif" font-size="14.00">e.g. svg</text>
+</g>
+<!-- doc -->
+<g id="node11" class="node"><title>doc</title>
+<ellipse fill="none" stroke="black" cx="891" cy="-160" rx="84.8528" ry="29.6985"/>
+<text text-anchor="middle" x="891" y="-164.4" font-family="Times Roman,serif" font-size="14.00">printed</text>
+<text text-anchor="middle" x="891" y="-147.4" font-family="Times Roman,serif" font-size="14.00">documentation</text>
+</g>
+<!-- pcb->doc -->
+<g id="edge15" class="edge"><title>pcb->doc</title>
+<path fill="none" stroke="black" d="M552.357,-236.515C578.6,-229.008 608.542,-220.772 636,-214 692.724,-200.011 757.09,-186.397 806.963,-176.339"/>
+<polygon fill="black" stroke="black" points="807.942,-179.712 817.057,-174.311 806.564,-172.849 807.942,-179.712"/>
+<text text-anchor="middle" x="707" y="-218.4" font-family="Times Roman,serif" font-size="14.00">e.g. ps, eps, png, jpg</text>
+</g>
+<!-- kicad -->
+<g id="node12" class="node"><title>kicad</title>
+<ellipse fill="none" stroke="grey" cx="480" cy="-29" rx="111.93" ry="29.6985"/>
+<text text-anchor="middle" x="480" y="-33.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">collaboration with</text>
+<text text-anchor="middle" x="480" y="-16.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">someone using kicad</text>
+</g>
+<!-- pcb->kicad -->
+<g id="edge21" class="edge"><title>pcb->kicad</title>
+<path fill="none" stroke="grey" d="M398.139,-238.135C318.036,-214.48 213.761,-169.842 256,-105 279.449,-69.003 321.139,-49.7347 362.247,-39.5341"/>
+<polygon fill="grey" stroke="grey" points="397.198,-241.506 407.777,-240.916 399.139,-234.781 397.198,-241.506"/>
+<polygon fill="grey" stroke="grey" points="363.159,-42.9156 372.112,-37.2517 361.581,-36.0958 363.159,-42.9156"/>
+<text text-anchor="middle" x="268" y="-126.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">kicad's</text>
+<text text-anchor="middle" x="268" y="-109.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">native format</text>
+</g>
+<!-- gpcb -->
+<g id="node13" class="node"><title>gpcb</title>
+<ellipse fill="none" stroke="grey" cx="480" cy="-105" rx="137.886" ry="29.6985"/>
+<text text-anchor="middle" x="480" y="-109.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">collaboration with</text>
+<text text-anchor="middle" x="480" y="-92.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">someone using gEDA/PCB</text>
+</g>
+<!-- pcb->gpcb -->
+<g id="edge23" class="edge"><title>pcb->gpcb</title>
+<path fill="none" stroke="grey" d="M480,-144.667C480,-154.301 480,-164.959 480,-175.77"/>
+<polygon fill="grey" stroke="grey" points="476.5,-175.98 480,-185.98 483.5,-175.98 476.5,-175.98"/>
+<polygon fill="grey" stroke="grey" points="483.5,-144.656 480,-134.656 476.5,-144.656 483.5,-144.656"/>
+<text text-anchor="middle" x="527" y="-164.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">gEDA</text>
+<text text-anchor="middle" x="527" y="-147.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">native format</text>
+</g>
+<!-- lib -->
+<g id="node5" class="node"><title>lib</title>
+<ellipse fill="none" stroke="black" cx="480" cy="-471" rx="79.196" ry="29.6985"/>
+<text text-anchor="middle" x="480" y="-475.4" font-family="Times Roman,serif" font-size="14.00">local footprint</text>
+<text text-anchor="middle" x="480" y="-458.4" font-family="Times Roman,serif" font-size="14.00">library</text>
+</g>
+<!-- lib->pcb -->
+<g id="edge17" class="edge"><title>lib->pcb</title>
+<path fill="none" stroke="black" d="M393.486,-461.115C354.019,-451.396 312.103,-432.226 294,-394.5 267.888,-340.083 336.962,-302.434 398.212,-280.667"/>
+<polygon fill="black" stroke="black" points="392.923,-464.576 403.451,-463.387 394.479,-457.751 392.923,-464.576"/>
+<polygon fill="black" stroke="black" points="399.644,-283.876 407.959,-277.31 397.364,-277.257 399.644,-283.876"/>
+<text text-anchor="middle" x="268" y="-381.9" font-family="Times Roman,serif" font-size="14.00">.fp</text>
+</g>
+<!-- wlib -->
+<g id="node6" class="node"><title>wlib</title>
+<ellipse fill="none" stroke="grey" cx="480" cy="-395" rx="130.815" ry="29.6985"/>
+<text text-anchor="middle" x="480" y="-399.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">remote footprint</text>
+<text text-anchor="middle" x="480" y="-382.4" font-family="Times Roman,serif" font-size="14.00" fill="grey">library (e.g. on the web)</text>
+</g>
+<!-- wlib->pcb -->
+<g id="edge19" class="edge"><title>wlib->pcb</title>
+<path fill="none" stroke="grey" d="M480,-340.237C480,-349.113 480,-357.668 480,-365.273"/>
+<polygon fill="grey" stroke="grey" points="483.5,-340.112 480,-330.112 476.5,-340.112 483.5,-340.112"/>
+<text text-anchor="middle" x="535" y="-343.9" font-family="Times Roman,serif" font-size="14.00" fill="grey">import footprint</text>
+</g>
+</g>
+</svg>
diff --git a/doc/user/01_intro/history.html b/doc/user/01_intro/history.html
new file mode 100644
index 0000000..dfbb89c
--- /dev/null
+++ b/doc/user/01_intro/history.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h2> pcb-rnd History </h2>
+<p>pcb-rnd is a rapid moving independent project that originated as a fork of the
+Pcb codebase.
+
+<pre>
+ From the pcb.html documentation:
+<i>
+<p> <code>Pcb</code> was first written by Thomas Nau for an
+ Atari ST in 1990 and ported to <code>UNIX</code> and <code>X11</code> in
+ 1994. It was not intended as a professional layout system, but as a tool
+ which supports people who do some home-developing of hardware.
+
+<p> Release history and credits for <code>Pcb</code> can be found in
+ the documentation files in mainline <code>Pcb</code>, and currently as of this writing at
+ <a href="http://pcb.geda-project.org/manual.html">http://pcb.geda-project.org/manual.html</a>
+</i>
+</pre>
+
+<p>In Fall 2013, Tibor Palinkas started an unofficial fork of Pcb to make and
+share changes and improvements, and over the following years the fork was
+officially announced, adopted additional users, and reached various <a href="milestones.html">milestones</a>
+<pre>
+<i>
+ 15:39 < Igor2> $ svn log -r 1 svn://repo.hu/pcb-rnd
+ 15:39 < Igor2>
+ ------------------------------------------------------------------------
+ 15:39 < Igor2> r1 | igor2 | 2013-08-30 17:33:06 +0200 (Fri, 30 Aug 2013) | 2
+ lines
+ 15:39 < Igor2> -Add: trunk
+</i>
+</pre>
+</body>
diff --git a/doc/user/01_intro/index.html b/doc/user/01_intro/index.html
new file mode 100644
index 0000000..48fec38
--- /dev/null
+++ b/doc/user/01_intro/index.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 1. Introduction </h2>
+<p>
+pcb-rnd is a highly modular, interactive <i>Printed Circuit Board</i> editor
+with a <a href="history.html"> very long history </a>.
+
+
+<h3> 1.1. Place in the workflow </h3>
+<p>
+The main purpose of pcb-rnd is to edit the geometry of the board. This
+includes board shape, copper shape, layer stackup, holes drilled, slots
+routed.
+<p>
+The <b>input</b> of the layout process is usually a netlist derived from
+schematics, and occasionally layouts drawn from scratch or created from
+schematic without importable netlist. Pcb-rnd can read different netlist
+formats and it can help the user to realize the given netlist in copper or to
+change the netlist and back annotate the changes. Pcb-rnd, however, does not
+display or edit schematics directly.
+<p>
+The <b>output</b> of pcb-rnd is most often a vector format (e.g. gerber
+RS274D), that is sent to a pcb fab house for manufacturing or is utilized for
+auto-fabrication. Pcb-rnd supports a variety of vector and raster output
+formats making it easy to print boards, publish them on web pages, and include
+them in documentation.
+<p>
+The typical workflows are:
+<b>
+<img src="flow.svg">
+<p>
+Black flows are the most commonly used; grey flows are possible, fully
+supported but less often used in practice.
diff --git a/doc/user/01_intro/src/flow.dot b/doc/user/01_intro/src/flow.dot
new file mode 100644
index 0000000..4e49df1
--- /dev/null
+++ b/doc/user/01_intro/src/flow.dot
@@ -0,0 +1,45 @@
+digraph flow {
+ rankdir=LR
+
+ subgraph in {
+ rank=same
+ sch [label="schematics editor\ne.g. gschem"]
+ }
+
+ subgraph edit {
+ rank=same
+ pcb [label="pcb-rnd" shape=octagon width=2 height=2]
+ lib [label="local footprint\nlibrary"]
+ wlib [label="remote footprint\nlibrary (e.g. on the web)" color=grey fontcolor=grey]
+ }
+
+
+ subgraph out {
+ rank=same
+ fab [label="fab house"]
+ tt [label="etching at home:\ntoner transfer"]
+ web [label="web page"]
+ doc [label="printed\ndocumentation"]
+ }
+
+ subgraph edit {
+ rank=same
+ kicad [label="collaboration with\nsomeone using kicad" color=grey fontcolor=grey]
+ gpcb [label="collaboration with\nsomeone using gEDA/PCB" color=grey fontcolor=grey]
+ }
+
+
+ sch -> pcb [label="fwd annotation"]
+ pcb -> sch [label="back annotation" color=grey fontcolor=grey]
+ pcb -> fab [label="e.g. gerber, bom, xy"]
+ pcb -> tt [label="e.g. ps or png"]
+ pcb -> web [label="e.g. svg"]
+ pcb -> doc [label="e.g. ps, eps, png, jpg"]
+
+ lib -> pcb [label=".fp" dir=both weight=1000]
+
+ wlib -> pcb [label="import footprint" dir=back color=grey fontcolor=grey]
+
+ pcb -> kicad [label="kicad's\nnative format" dir=both color=grey fontcolor=grey]
+ pcb -> gpcb [label="gEDA\nnative format" dir=both color=grey fontcolor=grey]
+}
diff --git a/doc/user/02_model/index.html b/doc/user/02_model/index.html
new file mode 100644
index 0000000..b32b6b2
--- /dev/null
+++ b/doc/user/02_model/index.html
@@ -0,0 +1,419 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 2. Model of the world </h2>
+<p>
+Pcb-rnd is designed to handle geometric data of a PCB. This section describes
+how pcb-rnd represents reality (e.g. copper shapes) in memory.
+
+<h3> 2.1. board </h3>
+<p>
+Each design pcb-rnd handles is a board. The has global properties and hosts
+layers. Most drawing primitives (objects) are on layers. This section describes
+the most important global properties.
+<p>
+<b>Board size</b> is given as a width and a height. For rectangular boards
+this can be the real board size, but more commonly it is used to simply
+determine the on-screen drawing area and the final board dimensions are
+specified using the outline layer. If the board is not rectangular, the
+contour must be specified on the outline layer and the board size must be
+large enough that the outline fits in it.
+<p>
+<b>Netlist</b> is the list of logical connections to be realized in copper.
+A netlist is a list of named <i>nets</i>. Each net consists of a list of
+<i>terminals</i> (pins or pads) to connect. A terminal is given as
+elementname-pinname, e.g. U4-7 means "pin number 7 in element called U4".
+<p>
+<b>Font</b>, which is always embedded in the design file to guarantee
+that the file can be ported and will look the same on different hosts.
+<p>
+Misc editor settings, such as grid size and offset.
+
+<h3> 2.2. layers </h3>
+<p>
+Unlike a <i>physical layer</i>, a pcb-rnd layer has no thickness. It is a
+2 dimensional, logical canvas, similar to layers in image manipulation software
+like gimp. There are <i>explicit</i> and <i>virtual</i> layers. An explicit
+layer contains drawing primitives (objects) placed by the user. The user has
+full control over an explicit layer: objects can be added or removed or
+changed any time. A virtual layer has no such flexibility: pcb-rnd computes
+its content from explicit layers and there's no way to change the result
+directly. A layer has a type and a location.
+<p>
+Layer types are:
+<ul>
+ <li> copper for signal layers
+ <li> silk for silkscreen layers
+ <li> outline for the contour of the board and slots and cutouts
+ <li> (mask for solder masks - this is a virtual layer)
+ <li> (paste for solder paste - this is a virtual layer)
+</ul>
+<p>
+Note: pcb-rnd does not model substrate layers.
+<p>
+Layer locations are:
+<ul>
+ <li> top (used to be the "component side" in the age of thru-hole components)
+ <li> bottom (used to be the "solder side" in the age of thru-hole components)
+ <li> internal (sandwiched between other layers)
+ <li> global (affects all physical layers, thus has no specific location)
+</ul>
+<p>
+Not all combination of type and location are supported, for example an internal
+silk layer does not make much sense. The table below lists whether a
+combination is supported or not.
+<p>
+<table border=1>
+ <tr><th> <th> top <th> bottom <th> intern <th> global
+ <tr><th> copper <td> yes <td> yes <td> yes <td> no
+ <tr><th> silk <td> yes <td> yes <td> no <td> no
+ <tr><th> outline<td> no <td> no <td> no <td> yes
+ <tr><th> mask <td> yes <td> yes <td> no <td> no
+ <tr><th> paste <td> yes <td> yes <td> no <td> no
+</table>
+
+<h3> 2.3. layer groups </h3>
+<p>
+One or more explicit layers form a <i>layer group</i>. All pcb-rnd layers
+of a layer group will end up on the same physical layer. The visibility of
+layers in a layer group are toggled together. The main use of layer groups
+is to exploit that layers have different drawing color on screen: there
+can be a signal and a gnd layers with different color in the same layer group,
+on the same physical layer.
+
+<h3> 2.4. Basic drawing objects </h3>
+<p>
+Pcb-rnd supports a small number of basic drawing objects, from which complex
+objects can be build. The following figure demonstrates all basic objects:
+<p>
+<img src="objects_basic.png">
+<p>
+Objects have flags that control their behavior. The following flags are common
+to all objects:
+<p>
+<table>
+ <tr><th>name <th> description
+ <tr><td>selected <td> selected by the user ("cyan")
+ <tr><td>found <td> found as a galvanic connection in the last connection lookup ("green")
+ <tr><td>warn <td> offending object e.g. in a short circuit ("orange")
+ <tr><td>lock <td> locked by the user: can't be selected, moved or changed
+</table>
+
+
+<h4> 2.4.1. Line objects </h4>
+<p>
+Lines are round ended straight line segments with a width and
+a clearance. The above image shows 3 lines connected. Lines are mainly
+used to construct traces. A line is always on a specific layer. The user
+interface allows drawing lines aligned to 90 or 45 degree axes or
+lines with random angle.
+<p>
+A line is specified by its two endpoints, width and clearance:
+<p>
+<img src="obj_line.png">
+<p>
+A <i>clearance</i> is the gap between a line and the sorrounding polygon
+in the same layer group. The gap is made only if the sorrounding polygon has
+the "clearpoly" flag set and the line has the "clearline" flag set. If either
+of these flags is not set, no gap is made - or in pcb-rnd terminology,
+the line is joined to the polygon.
+<p>
+Extra object flags:
+<p>
+<table>
+ <tr><th>name <th> description
+ <tr><td>clearline <td> clears polygons with the "clearpoly" flag in the same layer group
+</table>
+
+<h4> 2.4.2. Arc objects </h4>
+<p>
+Arcs are round ended circular arcs with trace width and clearance. They
+behave like lines in all respects.
+<p>
+<img src="obj_arc.png">
+<p>
+Although the arc is described with it's center, radius, start and end
+angles, the user interface may offer drawing arcs by endpoints.
+<p>
+Extra object flags:
+<p>
+<table>
+ <tr><th>name <th> description
+ <tr><td>clearline <td> clears polygons with the "clearpoly" flag in the same layer group
+</table>
+
+<h4> 2.4.3. Polygon objects </h4>
+<p>
+Polygons are solid, filled copper areas with optional holes in them. Polygon
+contour consists of lines - when they look curvy, it's really high resolution
+line approximation. There are two type of holes in a polygon: <i>explicit</i>,
+user drawn holes and <i>clearance</i> cutouts. User drawn holes are "negative"
+polygons drawn manually. To keep polygons simple, if an user drawn hole
+touches the contour of a polygon, the hole is removed and the contour is
+modified; if two holes touch, they are merged into one hole.
+<p>
+If the polygon has the "clearpoly" flag set (default), clearance cutouts are
+automatically inserted around objects on the same layer group:
+<ul>
+ <li> lines and arcs, if they have the "clearline" flag set (default)
+ <li> vias and pins, if they are not connected to the polygon by thermals
+ <li> pads
+</ul>
+<p>
+Overlapping or touching polygons are not automatically merged. An object
+with the "clearline" flag set will clear all "clearpolys" it is over -
+if there are multiple such polygons overlapping under the objects (on
+the same layer group), all such polygons get the clearance cutout.
+<p>
+If a polygyn is cut into multiple islands, the behaviour depends on the
+"fullpoly" flag of the polygon. If it is not set (default), only the largest
+island is kept, else all islands are kept. In the "fullpoly" mode islands
+will have no galvanic connection (unless the user adds vias and connect them
+on another layer), still the program will handle all islands as a single
+polygon. This is risky: the program will indicate connection between polygon
+islands that are not really connected, only because they are part of the same
+polygon!
+<p>
+Extra object flags:
+<p>
+<table border=1>
+ <tr><th>name <th> description
+ <tr><td>clearpoly <td> should have clearance around objects, if the objects have the appropriate flags too
+ <tr><td>fullpoly <td> keep all islands, not only the largest
+</table>
+
+<h4> 2.4.4. text objects </h4>
+<p>
+A text object is string and a series of symbols (pcb-rnd's terminology for
+glyph). Symbols are built of lines and are stored in the font. Each board
+can have its own font, but there can be only one font per board. When
+the string of the text is edited, the object is rendered again so that the
+new string appears.
+<p>
+Text objects can be placed on copper and silk layers. Text can be rotated
+only in 90 degree steps. Each text object has a scale parameter that
+determines its size in percentage. A scale of 100% means symbols are
+rendered in 1:1 size.
+<p>
+The clearance around text is rendered as a round corner rectangular cutout.
+Bug: copper text can not participate in short circuits, the galvanic connection
+checker code skips texts.
+
+<h4> 2.4.5. via objects </h4>
+<p>
+A via is a galvanized hole that connects copper rings on multiple layers.
+Pcb-rnd currently has two limitations: there are no blind or buried vias -
+a hole always punches all layers; there's no pad stack support, the copper
+ring around the hole on each layer have the same sizes.
+<p>
+A copper ring also has a per layer property whether or how it connects to
+the sorrounding polygon on the given layer; this is called the thermal style
+of the via. The following options are available:
+<table border=1>
+ <tr><th>thermal style <th> appearance
+ <tr><td>no connection <td> <img src=TODO>
+ <tr><td>solid <td> <img src=TODO>
+ <tr><td>round x 90 <td> <img src=TODO>
+ <tr><td>round x 45 <td> <img src=TODO>
+ <tr><td>sharp x 90 <td> <img src=TODO>
+ <tr><td>sharp x 45 <td> <img src=TODO>
+</table>
+<p>
+The shape of the copper annulus (the ring) is also selectable from a predefined
+set of symmetrical and asymmetrical set:
+<table border=1>
+ <tr><th>shape <th> appearance
+ <tr><td>ring (default) <td> <img src=TODO>
+ <tr><td>square <td> <img src=TODO>
+ <tr><td>octagon <td> <img src=TODO>
+ <tr><td>asymmetrical <td> <img src=TODO>
+</table>
+
+<h4> 2.4.6. element objects and footprints </h4>
+
+<p>
+An element is an instance of a footprint that is already placed on the
+board or loaded into a paste buffer.
+
+<p>
+In the footprint form the construct is small and flexible. It describes
+all the physical parts, like pins, pads, silk lines. In the same time a
+footprint leaves many details blank, e.g. it doesn't specify exact layers,
+it doesn't a have font and the refdes is random.
+
+<p>
+When the footprint is loaded, it becomes an element. The element inherits all
+the physical properties and the blank details are filled in with the data taken
+from the current board: the layer binding is done, all parts of the element
+lands on a specific board layer; the refdes is rendered using the font in
+the current board.
+
+<p>
+The footprint -> element instantiation is also a copy. Once the element
+is created from a footprint, the element is a self-containing object and
+does not have any direct reference to the footprint it was once derived from.
+Changes to the original footprint will <b>not</b> affect the elements.
+
+<p>
+In other words, a footprint is an abstract recipe, part of a
+library, while an element is a land pattern already embedded in a
+specific design and describes actual copper and silk.
+
+<p>
+Currently an element or footprint can contain the following objects:
+<ul>
+ <li> pins - same as vias, but also have a pin number and pin name within the element; they affect all layers
+ <li> pads - short lines, usually with rectangle end cap; pads also have number and name; they affect the top or bottom copper layer only
+ <li> silk lines - on top or bottom silk layer
+ <li> silk arcs - on top or bottom silk layer
+ <li> silk text - limited: only one of refdes, element name and element value is displayed at the time
+</ul>
+<p>
+An element has the following properties:
+<p>
+<table border=1>
+ <tr><th>element property <th> description
+ <tr><td> name: refdes <td> unique identifier, e.g. "C42"
+ <tr><td> name: value <td> informal value, e.g. "15 pF"
+ <tr><td> name: description <td> informal element or footprint description, e.g. "1206"
+</table>
+<p>
+Extra object flags:
+<p>
+<table border=1>
+ <tr><th>name <th> description
+ <tr><td>ONSOLDER <td> when set, the element is on the bottom side, else it's on the top side
+ <tr><td>NONETLIST <td> when set, the element is not intended to be on the netlist; useful for elements that are not present on the schematics and are placed during the layout design
+ <tr><td>HIDENAME <td> when set the name of the element is hidden
+ <tr><td>DISPLAYNAME <td> when set the names of pins are shown
+</table>
+
+<h4> 2.4.7. pins of elements </h4>
+
+A pin of an element is really a via, plus some metadata and capabilities:
+<ul>
+ <li> pin name
+ <li> pin number
+ <li> the capability to act as a netlist terminal
+</ul>
+
+Each element has its own list of pins. Pin rings can overlap (which will
+make galvanic connection). There may be duplicate pin numbers and pin names.
+Pin numbers are in the same namespace as pad numbers.
+
+A pin has the following properties:
+<p>
+<table border=1>
+ <tr><th>name <th> description
+ <tr><td>name <td> pin name, e.g. "base"
+ <tr><td>number <td> pin name, e.g. 2
+ <tr><td>intconn <td> internal element connections (see section TODO)
+</table>
+
+Extra object flags:
+<p>
+<table border=1>
+ <tr><th>name <th> description
+ <tr><td>via flags <td> (extra flags listed for vias are applicable to pins too)
+ <tr><td>WARN <td> the pin contributes to a short circuit ("orange mark")
+</table>
+
+<h4> 2.4.8. pads of elements </h4>
+<p>
+A pad is an smd pad of an element. It is modelled as a line segment, usually
+with square cap - this makes the pad look like a rectangle. A pad has
+the same metadata and capabilities as pins. Overlapping pads are supported.
+A pad is always on either the top or the bottom copper layer group.
+<p>
+A pad has the following properties:
+<p>
+<table border=1>
+ <tr><th>name <th> description
+ <tr><td>name <td> pin name, e.g. "base"
+ <tr><td>number <td> pin name, e.g. 2
+ <tr><td>intconn <td> internal element connections (see section TODO)
+</table>
+
+Extra object flags:
+<p>
+<table border=1>
+ <tr><th>name <th> description
+ <tr><td>via flags <td> (extra flags listed for vias are applicable to pins too)
+ <tr><td>WARN <td> the pin contributes to a short circuit ("orange mark")
+ <tr><td>EDGE2 <td> indicates that the second point is closer to the edge. For pins, indicates that the pin is closer to a horizontal edge and thus pinout text should be vertical. (Padr.Point2 is closer to outside edge also pinout text for pins is vertical)
+</table>
+
+<h4> 2.4.9. rat line objects </h4>
+<p>
+A rat line represents a logical connection that is not yet realized in copper.
+It connects two drawing primitives.
+
+<h4> 2.4.10. netlists </h4>
+<p>
+A netlist is a list of named logical networks. Each network is a list of
+netlist terminals that should be connected. A netlist terminal is a pair
+of element-refdes and pin-number (or pad-number). Thus a typical netlist
+looks like the following:
+<ul>
+ <li> net: GND
+ <ul>
+ <li> U1-2
+ <li> U2-7
+ <li> U3-7
+ <li> C1-1
+ </ul>
+ <li> net: Vcc
+ <ul>
+ <li> U1-3
+ <li> U2-14
+ <li> U3-14
+ <li> C1-2
+ </ul>
+ <li> net: strobe
+ <ul>
+ <li> U2-2
+ <li> U3-5
+ </ul>
+</ul>
+<p>
+The netlist assumes element refdes are unique. If an element has multiple
+instances of the same pin (or pad) number, the engine picks one randomly and
+assumes there's an invisible, internal connection within the element.
+<p>
+Rat lines can be regenerated from the current netlist for missing connections.
+Connections that are realized in copper but not present on the netlist, pcb-rnd
+gives a "short circuit" warning. Both happens when the net is "optimized"
+(upon user request).
+<p>
+The netlist is typically derived from a schematics by external tools
+(such as gnetlist). The netlist can be imported (updated) any time. This
+process is called "forward annotation".
+<p>
+It is also possible to make changes to the netlist from within pcb-rnd:
+pins can be swapped, element packages replaced using <i>back annotation
+actions</b>. Such actions will keep a list of intended netlist and element
+changes, called the netlist patch. Pcb-rnd will keep these changes even
+if a new version of the netlist is imported. It is possible to export the
+netlist patch that can be imported in the schematics editor to change the
+schematics - this process is called "back annotation". A new forward
+annotation from the schematics editor to pcb-rnd will then cancel
+the netlist/element changes as the new netlist import netlist matches
+the intended (changed) netlist.
+
+<h3> 2.5. comparison of terms </h3>
+<p>
+<table border=1>
+ <tr><th> physical board term <th> pcb-rnd term
+ <tr><td> layer <td> layer group
+ <tr><td> copper layer <td> layer group with copper layers
+ <tr><td> substrate <td> N/A
+ <tr><td> contour of the board <td> outline layer
+ <tr><td> outline routing path <td> outline layer
+ <tr><td> polygon pour <td> polygon
+ <tr><td> plane <td> polygon
+</table>
diff --git a/doc/user/02_model/obj_arc.png b/doc/user/02_model/obj_arc.png
new file mode 100644
index 0000000..ca252d1
Binary files /dev/null and b/doc/user/02_model/obj_arc.png differ
diff --git a/doc/user/02_model/obj_line.png b/doc/user/02_model/obj_line.png
new file mode 100644
index 0000000..5bf8240
Binary files /dev/null and b/doc/user/02_model/obj_line.png differ
diff --git a/doc/user/02_model/objects_basic.png b/doc/user/02_model/objects_basic.png
new file mode 100644
index 0000000..285c603
Binary files /dev/null and b/doc/user/02_model/objects_basic.png differ
diff --git a/doc/user/02_model/objects_complex.png b/doc/user/02_model/objects_complex.png
new file mode 100644
index 0000000..b4c231c
Binary files /dev/null and b/doc/user/02_model/objects_complex.png differ
diff --git a/doc/user/02_model/src/Makefile b/doc/user/02_model/src/Makefile
new file mode 100644
index 0000000..78da3a1
--- /dev/null
+++ b/doc/user/02_model/src/Makefile
@@ -0,0 +1,24 @@
+PCBRND=pcb-rnd
+CLEANFILES= ../*.png
+
+all: ../objects_basic.png ../objects_complex.png ../obj_line.png \
+ ../obj_arc.png
+
+../objects_basic.png: objects_basic.lht
+ $(PCBRND) -x png --dpi 450 objects_basic.lht
+ mv objects_basic.lht.png ../objects_basic.png
+
+../objects_complex.png: objects_complex.lht
+ $(PCBRND) -x png --dpi 450 objects_complex.lht
+ mv objects_complex.lht.png ../objects_complex.png
+
+../obj_line.png: obj_line.lht
+ $(PCBRND) -x png --dpi 450 obj_line.lht
+ mv obj_line.lht.png ../obj_line.png
+
+../obj_arc.png: obj_arc.lht
+ $(PCBRND) -x png --dpi 450 obj_arc.lht
+ mv obj_arc.lht.png ../obj_arc.png
+
+clean: $(CLEANRULES)
+ -rm $(CLEANFILES)
diff --git a/doc/user/02_model/src/obj_arc.lht b/doc/user/02_model/src/obj_arc.lht
new file mode 100644
index 0000000..670b498
--- /dev/null
+++ b/doc/user/02_model/src/obj_arc.lht
@@ -0,0 +1,2424 @@
+ha:pcb-rnd-board-v1 {
+
+ ha:attributes {
+ {PCB::loader}=geda/pcb - nanometer
+ {PCB::grid::unit}=mil
+ {PCB::conf::editor/grid}=25.00 mil
+ {PCB::conf::editor/draw_grid}=true
+ {PCB::conf::editor/buffer_number}=0
+ }
+
+ li:styles {
+ ha:Signal {
+ diameter = 1.999996mm
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 20.0mil
+ }
+ ha:Power {
+ diameter = 2.199894mm
+ thickness = 20.0mil
+ hole = 0.999998mm
+ clearance = 20.0mil
+ }
+ ha:Fat {
+ diameter = 137.8mil
+ thickness = 80.0mil
+ hole = 47.24mil
+ clearance = 25.0mil
+ }
+ ha:Sig-tight {
+ diameter = 64.0mil
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 12.0mil
+ }
+ }
+
+ ha:meta {
+ ha:size {
+ thermal_scale = 0.500000
+ x = 1.4in
+ y = 31.75mm
+ isle_area_nm2 = 199999999.999200
+ }
+ ha:cursor {
+ zoom = 0.000000
+ x = 0.0
+ y = 0.0
+ }
+ ha:drc {
+ min_drill = 15.0mil
+ min_ring = 10.0mil
+ bloat = 12.0mil
+ shrink = 9.0mil
+ min_width = 10.0mil
+ min_silk = 7.0mil
+ }
+ ha:grid {
+ spacing = 25.0mil
+ offs_x = 0.0
+ offs_y = 0.0
+ }
+ }
+
+ ha:data {
+ li:objects {
+ }
+ li:layers {
+
+ ha:component {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:arc.3 {
+ x=26.67mm; y=27.305mm; width=400.0mil; height=400.0mil; astart=-90; adelta=90; thickness=75.0mil; clearance=48.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:polygon.4 {
+ li:geometry {
+ ta:contour {
+ { 725.0mil; 550.0mil }
+ { 31.75mm; 550.0mil }
+ { 31.75mm; 900.0mil }
+ { 725.0mil; 900.0mil }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ }
+ }
+
+ ha:solder {
+ visible=1
+ group=1
+ }
+
+ ha:comp-GND {
+ visible=1
+ group=0
+ }
+
+ ha:comp-power {
+ visible=1
+ group=0
+ }
+
+ ha:sold-GND {
+ visible=1
+ group=1
+ }
+
+ ha:sold-power {
+ visible=1
+ group=1
+ }
+
+ ha:signal3 {
+ visible=1
+ group=2
+ }
+
+ ha:outline {
+ visible=1
+ group=3
+ }
+
+ ha:silk {
+ visible=1
+ group=1
+ }
+
+ ha:silk {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:line.9 {
+ x1=26.67mm; y1=26.67mm; x2=26.67mm; y2=1.1in; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.12 {
+ x1=26.035mm; y1=27.305mm; x2=27.305mm; y2=27.305mm; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.15 {
+ x1=29.21mm; y1=1.175in; x2=26.67mm; y2=27.305mm; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.18 {
+ x1=1.35in; y1=1.175in; x2=29.21mm; y2=1.175in; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.21 {
+ x1=26.67mm; y1=27.305mm; x2=675.0mil; y2=950.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.24 {
+ x1=625.0mil; y1=750.0mil; x2=800.0mil; y2=925.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.27 {
+ x1=625.0mil; y1=750.0mil; x2=350.0mil; y2=750.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.30 {
+ x1=875.0mil; y1=825.0mil; x2=650.0mil; y2=600.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.33 {
+ x1=650.0mil; y1=600.0mil; x2=325.0mil; y2=600.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.36 {
+ x1=675.0mil; y1=27.305mm; x2=0.0; y2=27.305mm; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.39 {
+ x1=26.67mm; y1=700.0mil; x2=26.67mm; y2=25.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.42 {
+ x1=150.0mil; y1=27.305mm; x2=150.0mil; y2=1.225in; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.45 {
+ x1=650.0mil; y1=26.67mm; x2=650.0mil; y2=1.1in; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.48 {
+ x1=26.035mm; y1=675.0mil; x2=27.305mm; y2=675.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:arc.51 {
+ x=26.67mm; y=27.305mm; width=1000.0mil; height=1000.0mil; astart=-90; adelta=90; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:polygon.58 {
+ li:geometry {
+ ta:contour {
+ { 17.594013mm; 20.769012mm }
+ { 657.3223622mil; 18.972961mm }
+ { 15.797962mm; 19.870987mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.62 {
+ li:geometry {
+ ta:contour {
+ { 18.600987mm; 21.775988mm }
+ { 19.499012mm; 23.572039mm }
+ { 20.397038mm; 22.674013mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.66 {
+ li:geometry {
+ ta:contour {
+ { 19.753013mm; 18.483012mm }
+ { 742.3223622mil; 16.686961mm }
+ { 17.956962mm; 17.584987mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.70 {
+ li:geometry {
+ ta:contour {
+ { 19.870987mm; 18.600988mm }
+ { 20.769012mm; 20.397039mm }
+ { 21.667038mm; 19.499013mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.74 {
+ li:geometry {
+ ta:contour {
+ { 690.0mil; 955.0mil }
+ { 19.109758mm; 25.491476mm }
+ { 19.533695mm; 24.29432mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.78 {
+ li:geometry {
+ ta:contour {
+ { 3.809999mm; 27.178001mm }
+ { 3.174999mm; 1.145in }
+ { 4.444999mm; 1.145in }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.82 {
+ li:geometry {
+ ta:contour {
+ { 26.796999mm; 1.904999mm }
+ { 980.0mil; 1.269999mm }
+ { 980.0mil; 2.539999mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.86 {
+ li:geometry {
+ ta:contour {
+ { 1.270001mm; 27.431999mm }
+ { 1.905001mm; 25.527mm }
+ { 0.635001mm; 25.527mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:text.52 {
+ string=center; x=1.175in; y=1.1in; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.53 {
+ string=width; x=375.0mil; y=675.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.54 {
+ string=R; x=850.0mil; y=950.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.55 {
+ string=clearance; x=350.0mil; y=525.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.56 {
+ string=delta angle; x=625.0mil; y=0.0; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.57 {
+ string=start angle; x=175.0mil; y=29.21mm; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ha:font {
+ ha:geda_pcb {
+ cell_width=1.270001mm; cell_height=1.651001mm;
+ ha:symbols {
+ ha:] {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&5c {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:b {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:c {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:e {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=40.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:f {
+ width=0.381001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:g {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:h {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:i {
+ width=0.001um; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:j {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=65.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:k {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:l {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:m {
+ width=0.889001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=25.0mil; y1=30.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=30.0mil; y1=30.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=35.0mil; y1=35.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:n {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:o {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:p {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:r {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:s {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:t {
+ width=0.254001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:u {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:v {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:w {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=30.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:x {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:z {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:~ {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&7b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&7d {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:| {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&20 {
+ width=0.0; delta=18.0mil;
+ li:objects {
+ }
+ height = 0.0
+ }
+ ha:&23 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:&26 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:! {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:" {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:$ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=45.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=40.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:% {
+ width=1.016001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=25.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=50.0mil; x2=40.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=35.0mil; y1=50.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=40.0mil; y1=40.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=35.0mil; x2=40.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=25.0mil; y1=40.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=25.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=25.0mil; y1=45.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=30.0mil; y1=50.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:' {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:( {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:) {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:* {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:+ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:, {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=60.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.524001mm
+ }
+ ha:- {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.762001mm
+ }
+ ha:. {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:0 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:1 {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=18.0mil; x2=8.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=8.0mil; y1=10.0mil; x2=8.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:2 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:3 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=23.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:4 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:5 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=25.0mil; x2=15.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=25.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:6 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=28.0mil; x2=20.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:7 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:8 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=37.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=37.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=7.0mil; y1=30.0mil; x2=13.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=37.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=37.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=23.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:9 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:< {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:> {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:? {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:@ {
+ width=1.270001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=40.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=50.0mil; y1=35.0mil; x2=50.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=50.0mil; y1=10.0mil; x2=40.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=40.0mil; y1=0.0; x2=10.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=10.0mil; y1=0.0; x2=0.0; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=35.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=30.0mil; x2=40.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=35.0mil; y1=30.0mil; x2=35.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=35.0mil; y1=20.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=20.0mil; y1=15.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=20.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=40.0mil; y1=35.0mil; x2=50.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:A {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=20.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=7.0mil; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=20.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:B {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=33.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=28.0mil; x2=20.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:C {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=43.0mil; x2=7.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=17.0mil; x2=0.0; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=17.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=7.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:D {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=17.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=17.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=50.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=18.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:E {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:F {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:G {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:H {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:I {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:J {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=10.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:K {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:L {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:M {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=30.0mil; y1=10.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&2f {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:&3a {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&3b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&3d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:O {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:P {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:N {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:R {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=13.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:S {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:U {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:V {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:T {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:X {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:W {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:[ {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:^ {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.381001mm
+ }
+ ha:Z {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:a {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=45.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:_ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ }
+ }
+ }
+ha:netlists {
+
+ li:input {
+ }
+}
+}
diff --git a/doc/user/02_model/src/obj_line.lht b/doc/user/02_model/src/obj_line.lht
new file mode 100644
index 0000000..28ac7c9
--- /dev/null
+++ b/doc/user/02_model/src/obj_line.lht
@@ -0,0 +1,2342 @@
+ha:pcb-rnd-board-v1 {
+
+ ha:attributes {
+ {PCB::loader}=geda/pcb - nanometer
+ {PCB::grid::unit}=mil
+ {PCB::conf::editor/grid}=25.00 mil
+ {PCB::conf::editor/draw_grid}=true
+ {PCB::conf::editor/buffer_number}=0
+ }
+
+ li:styles {
+ ha:Signal {
+ diameter = 1.999996mm
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 20.0mil
+ }
+ ha:Power {
+ diameter = 2.199894mm
+ thickness = 20.0mil
+ hole = 0.999998mm
+ clearance = 20.0mil
+ }
+ ha:Fat {
+ diameter = 137.8mil
+ thickness = 80.0mil
+ hole = 47.24mil
+ clearance = 25.0mil
+ }
+ ha:Sig-tight {
+ diameter = 64.0mil
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 12.0mil
+ }
+ }
+
+ ha:meta {
+ ha:size {
+ thermal_scale = 0.500000
+ x = 30.48mm
+ y = 850.0mil
+ isle_area_nm2 = 199999999.999200
+ }
+ ha:cursor {
+ zoom = 0.000000
+ x = 25.0mil
+ y = 275.0mil
+ }
+ ha:drc {
+ min_drill = 15.0mil
+ min_ring = 10.0mil
+ bloat = 12.0mil
+ shrink = 9.0mil
+ min_width = 10.0mil
+ min_silk = 7.0mil
+ }
+ ha:grid {
+ spacing = 25.0mil
+ offs_x = 0.0
+ offs_y = 0.0
+ }
+ }
+
+ ha:data {
+ li:objects {
+ }
+ li:layers {
+
+ ha:component {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:line.5 {
+ x1=475.0mil; y1=675.0mil; x2=800.0mil; y2=350.0mil; thickness=110.0mil; clearance=50.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:polygon.8 {
+ li:geometry {
+ ta:contour {
+ { 600.0mil; 175.0mil }
+ { 1.125in; 175.0mil }
+ { 1.125in; 525.0mil }
+ { 600.0mil; 525.0mil }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ }
+ }
+
+ ha:solder {
+ visible=1
+ group=1
+ }
+
+ ha:comp-GND {
+ visible=1
+ group=0
+ }
+
+ ha:comp-power {
+ visible=1
+ group=0
+ }
+
+ ha:sold-GND {
+ visible=1
+ group=1
+ }
+
+ ha:sold-power {
+ visible=1
+ group=1
+ }
+
+ ha:signal3 {
+ visible=1
+ group=2
+ }
+
+ ha:outline {
+ visible=1
+ group=3
+ }
+
+ ha:silk {
+ visible=1
+ group=1
+ }
+
+ ha:silk {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:line.13 {
+ x1=525.0mil; y1=425.0mil; x2=750.0mil; y2=650.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.16 {
+ x1=525.0mil; y1=425.0mil; x2=250.0mil; y2=425.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.19 {
+ x1=575.0mil; y1=225.0mil; x2=250.0mil; y2=225.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.22 {
+ x1=800.0mil; y1=450.0mil; x2=575.0mil; y2=225.0mil; thickness=10.0mil; clearance=24.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.25 {
+ x1=475.0mil; y1=650.0mil; x2=475.0mil; y2=700.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.28 {
+ x1=450.0mil; y1=675.0mil; x2=500.0mil; y2=675.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.31 {
+ x1=800.0mil; y1=325.0mil; x2=800.0mil; y2=375.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.34 {
+ x1=775.0mil; y1=350.0mil; x2=825.0mil; y2=350.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.37 {
+ x1=475.0mil; y1=675.0mil; x2=375.0mil; y2=575.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.40 {
+ x1=375.0mil; y1=575.0mil; x2=25.0mil; y2=575.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.43 {
+ x1=800.0mil; y1=350.0mil; x2=550.0mil; y2=100.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.46 {
+ x1=550.0mil; y1=100.0mil; x2=200.0mil; y2=100.0mil; thickness=10.0mil; clearance=40.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:polygon.53 {
+ li:geometry {
+ ta:contour {
+ { 17.965987mm; 9.075988mm }
+ { 18.864012mm; 10.872039mm }
+ { 19.762038mm; 9.974013mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.57 {
+ li:geometry {
+ ta:contour {
+ { 16.695987mm; 14.155988mm }
+ { 17.594012mm; 15.952039mm }
+ { 18.492038mm; 15.054013mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.61 {
+ li:geometry {
+ ta:contour {
+ { 15.054013mm; 12.514012mm }
+ { 14.155988mm; 10.717961mm }
+ { 13.257962mm; 11.615987mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:polygon.65 {
+ li:geometry {
+ ta:contour {
+ { 17.848013mm; 8.958012mm }
+ { 16.949988mm; 281.9669685mil }
+ { 16.051962mm; 8.059987mm }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ ha:text.49 {
+ string=width; x=275.0mil; y=350.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.50 {
+ string=clearance; x=275.0mil; y=150.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.51 {
+ string=1st endpoint; x=25.0mil; y=500.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.52 {
+ string=2nd endpoint; x=200.0mil; y=25.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ha:font {
+ ha:geda_pcb {
+ cell_width=1.270001mm; cell_height=1.651001mm;
+ ha:symbols {
+ ha:] {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&5c {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:b {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:c {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:e {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=40.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:f {
+ width=0.381001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:g {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:h {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:i {
+ width=0.001um; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:j {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=65.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:k {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:l {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:m {
+ width=0.889001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=25.0mil; y1=30.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=30.0mil; y1=30.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=35.0mil; y1=35.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:n {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:o {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:p {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:r {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:s {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:t {
+ width=0.254001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:u {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:v {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:w {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=30.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:x {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:z {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:~ {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&7b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&7d {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:| {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&20 {
+ width=0.0; delta=18.0mil;
+ li:objects {
+ }
+ height = 0.0
+ }
+ ha:&23 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:&26 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:! {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:" {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:$ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=45.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=40.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:% {
+ width=1.016001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=25.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=50.0mil; x2=40.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=35.0mil; y1=50.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=40.0mil; y1=40.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=35.0mil; x2=40.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=25.0mil; y1=40.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=25.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=25.0mil; y1=45.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=30.0mil; y1=50.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:' {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:( {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:) {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:* {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:+ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:, {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=60.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.524001mm
+ }
+ ha:- {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.762001mm
+ }
+ ha:. {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:0 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:1 {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=18.0mil; x2=8.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=8.0mil; y1=10.0mil; x2=8.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:2 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:3 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=23.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:4 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:5 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=25.0mil; x2=15.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=25.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:6 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=28.0mil; x2=20.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:7 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:8 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=37.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=37.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=7.0mil; y1=30.0mil; x2=13.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=37.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=37.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=23.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:9 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:< {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:> {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:? {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:@ {
+ width=1.270001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=40.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=50.0mil; y1=35.0mil; x2=50.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=50.0mil; y1=10.0mil; x2=40.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=40.0mil; y1=0.0; x2=10.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=10.0mil; y1=0.0; x2=0.0; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=35.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=30.0mil; x2=40.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=35.0mil; y1=30.0mil; x2=35.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=35.0mil; y1=20.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=20.0mil; y1=15.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=20.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=40.0mil; y1=35.0mil; x2=50.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:A {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=20.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=7.0mil; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=20.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:B {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=33.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=28.0mil; x2=20.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:C {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=43.0mil; x2=7.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=17.0mil; x2=0.0; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=17.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=7.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:D {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=17.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=17.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=50.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=18.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:E {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:F {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:G {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:H {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:I {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:J {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=10.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:K {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:L {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:M {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=30.0mil; y1=10.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&2f {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:&3a {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&3b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&3d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:O {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:P {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:N {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:R {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=13.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:S {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:U {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:V {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:T {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:X {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:W {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:[ {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:^ {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.381001mm
+ }
+ ha:Z {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:a {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=45.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:_ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ }
+ }
+ }
+ha:netlists {
+
+ li:input {
+ }
+}
+}
diff --git a/doc/user/02_model/src/objects_basic.lht b/doc/user/02_model/src/objects_basic.lht
new file mode 100644
index 0000000..f5a373f
--- /dev/null
+++ b/doc/user/02_model/src/objects_basic.lht
@@ -0,0 +1,2282 @@
+ha:pcb-rnd-board-v1 {
+
+ ha:attributes {
+ {PCB::loader}=geda/pcb - nanometer
+ {PCB::grid::unit}=mil
+ {PCB::conf::editor/buffer_number}=0
+ {PCB::conf::editor/draw_grid}=true
+ }
+
+ li:styles {
+ ha:Signal {
+ diameter = 1.999996mm
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 20.0mil
+ }
+ ha:Power {
+ diameter = 2.199894mm
+ thickness = 20.0mil
+ hole = 0.999998mm
+ clearance = 20.0mil
+ }
+ ha:Fat {
+ diameter = 137.8mil
+ thickness = 80.0mil
+ hole = 47.24mil
+ clearance = 25.0mil
+ }
+ ha:Sig-tight {
+ diameter = 64.0mil
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 12.0mil
+ }
+ }
+
+ ha:meta {
+ ha:size {
+ thermal_scale = 0.500000
+ x = 2.075in
+ y = 500.0mil
+ isle_area_nm2 = 199999999.999200
+ }
+ ha:cursor {
+ zoom = 0.000000
+ x = 225.0mil
+ y = 0.0
+ }
+ ha:drc {
+ min_drill = 15.0mil
+ min_ring = 10.0mil
+ bloat = 12.0mil
+ shrink = 9.0mil
+ min_width = 10.0mil
+ min_silk = 7.0mil
+ }
+ ha:grid {
+ spacing = 25.0mil
+ offs_x = 0.0
+ offs_y = 0.0
+ }
+ }
+
+ ha:data {
+ li:objects {
+ ha:via.3 {
+ x=1.6in; y=125.0mil; hole=47.24mil; mask=0.0; thickness=137.8mil; clearance=50.0mil;
+ ha:flags {
+ via=1
+ }
+ }
+ ha:via.4 {
+ x=1.6in; y=350.0mil; hole=47.24mil; mask=0.0; thickness=137.8mil; clearance=50.0mil;
+ ha:flags {
+ via=1
+ square=1
+ shape=1
+ }
+ }
+ ha:via.5 {
+ x=49.53mm; y=250.0mil; hole=47.24mil; mask=0.0; thickness=137.8mil; clearance=50.0mil;
+ ha:flags {
+ via=1
+ square=1
+ shape=17
+ }
+ }
+ ha:via.6 {
+ x=45.085mm; y=125.0mil; hole=47.24mil; mask=0.0; thickness=137.8mil; clearance=50.0mil;
+ ha:flags {
+ via=1
+ square=1
+ shape=2
+ }
+ }
+ ha:via.7 {
+ x=1.8in; y=350.0mil; hole=47.24mil; mask=0.0; thickness=137.8mil; clearance=50.0mil;
+ ha:flags {
+ via=1
+ square=1
+ shape=9
+ }
+ }
+ }
+ li:layers {
+
+ ha:component {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:line.16 {
+ x1=575.0mil; y1=75.0mil; x2=825.0mil; y2=75.0mil; thickness=80.0mil; clearance=50.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.19 {
+ x1=825.0mil; y1=75.0mil; x2=925.0mil; y2=175.0mil; thickness=80.0mil; clearance=50.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:line.22 {
+ x1=925.0mil; y1=175.0mil; x2=925.0mil; y2=400.0mil; thickness=80.0mil; clearance=50.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:arc.25 {
+ x=425.0mil; y=425.0mil; width=350.0mil; height=350.0mil; astart=0; adelta=-90; thickness=80.0mil; clearance=50.0mil;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:polygon.42 {
+ li:geometry {
+ ta:contour {
+ { 26.67mm; 50.0mil }
+ { 31.75mm; 50.0mil }
+ { 1.375in; 175.0mil }
+ { 1.375in; 425.0mil }
+ { 26.67mm; 425.0mil }
+ }
+ ta:hole {
+ { 29.21mm; 225.0mil }
+ { 29.21mm; 300.0mil }
+ { 31.75mm; 300.0mil }
+ { 31.75mm; 175.0mil }
+ { 1.175in; 175.0mil }
+ { 29.21mm; 200.0mil }
+ }
+ }
+
+ ha:flags {
+ clearpoly=1
+ }
+ }
+ }
+ }
+
+ ha:solder {
+ visible=1
+ group=1
+ }
+
+ ha:comp-GND {
+ visible=1
+ group=0
+ }
+
+ ha:comp-power {
+ visible=1
+ group=0
+ }
+
+ ha:sold-GND {
+ visible=1
+ group=1
+ }
+
+ ha:sold-power {
+ visible=1
+ group=1
+ }
+
+ ha:signal3 {
+ visible=1
+ group=2
+ }
+
+ ha:outline {
+ visible=1
+ group=3
+ }
+
+ ha:silk {
+ visible=1
+ group=1
+ }
+
+ ha:silk {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:text.44 {
+ string=Arc; x=275.0mil; y=425.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.45 {
+ string=Line; x=700.0mil; y=425.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.46 {
+ string=Polygon; x=1.125in; y=425.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.47 {
+ string=Pin, Via; x=1.65in; y=425.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ha:font {
+ ha:geda_pcb {
+ cell_width=1.270001mm; cell_height=1.651001mm;
+ ha:symbols {
+ ha:] {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&5c {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:b {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:c {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:e {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=40.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:f {
+ width=0.381001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:g {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:h {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:i {
+ width=0.001um; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:j {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=65.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:k {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:l {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:m {
+ width=0.889001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=25.0mil; y1=30.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=30.0mil; y1=30.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=35.0mil; y1=35.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:n {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:o {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:p {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:r {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:s {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:t {
+ width=0.254001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:u {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:v {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:w {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=30.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:x {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:z {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:~ {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&7b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&7d {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:| {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&20 {
+ width=0.0; delta=18.0mil;
+ li:objects {
+ }
+ height = 0.0
+ }
+ ha:&23 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:&26 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:! {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:" {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:$ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=45.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=40.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:% {
+ width=1.016001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=25.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=50.0mil; x2=40.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=35.0mil; y1=50.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=40.0mil; y1=40.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=35.0mil; x2=40.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=25.0mil; y1=40.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=25.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=25.0mil; y1=45.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=30.0mil; y1=50.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:' {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:( {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:) {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:* {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:+ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:, {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=60.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.524001mm
+ }
+ ha:- {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.762001mm
+ }
+ ha:. {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:0 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:1 {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=18.0mil; x2=8.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=8.0mil; y1=10.0mil; x2=8.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:2 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:3 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=23.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:4 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:5 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=25.0mil; x2=15.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=25.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:6 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=28.0mil; x2=20.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:7 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:8 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=37.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=37.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=7.0mil; y1=30.0mil; x2=13.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=37.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=37.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=23.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:9 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:< {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:> {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:? {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:@ {
+ width=1.270001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=40.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=50.0mil; y1=35.0mil; x2=50.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=50.0mil; y1=10.0mil; x2=40.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=40.0mil; y1=0.0; x2=10.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=10.0mil; y1=0.0; x2=0.0; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=35.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=30.0mil; x2=40.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=35.0mil; y1=30.0mil; x2=35.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=35.0mil; y1=20.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=20.0mil; y1=15.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=20.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=40.0mil; y1=35.0mil; x2=50.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:A {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=20.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=7.0mil; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=20.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:B {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=33.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=28.0mil; x2=20.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:C {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=43.0mil; x2=7.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=17.0mil; x2=0.0; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=17.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=7.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:D {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=17.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=17.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=50.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=18.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:E {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:F {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:G {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:H {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:I {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:J {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=10.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:K {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:L {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:M {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=30.0mil; y1=10.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&2f {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:&3a {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&3b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&3d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:O {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:P {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:N {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:R {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=13.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:S {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:U {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:V {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:T {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:X {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:W {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:[ {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:^ {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.381001mm
+ }
+ ha:Z {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:a {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=45.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:_ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ }
+ }
+ }
+ha:netlists {
+
+ li:input {
+ }
+}
+}
diff --git a/doc/user/02_model/src/objects_complex.lht b/doc/user/02_model/src/objects_complex.lht
new file mode 100644
index 0000000..9193108
--- /dev/null
+++ b/doc/user/02_model/src/objects_complex.lht
@@ -0,0 +1,2223 @@
+ha:pcb-rnd-board-v1 {
+
+ ha:attributes {
+ {PCB::loader}=geda/pcb - nanometer
+ {PCB::grid::unit}=mil
+ {PCB::conf::editor/buffer_number}=0
+ {PCB::conf::editor/draw_grid}=true
+ }
+
+ li:styles {
+ ha:Signal {
+ diameter = 1.999996mm
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 20.0mil
+ }
+ ha:Power {
+ diameter = 2.199894mm
+ thickness = 20.0mil
+ hole = 0.999998mm
+ clearance = 20.0mil
+ }
+ ha:Fat {
+ diameter = 137.8mil
+ thickness = 80.0mil
+ hole = 47.24mil
+ clearance = 25.0mil
+ }
+ ha:Sig-tight {
+ diameter = 64.0mil
+ thickness = 10.0mil
+ hole = 31.5mil
+ clearance = 12.0mil
+ }
+ }
+
+ ha:meta {
+ ha:size {
+ thermal_scale = 0.500000
+ x = 850.0mil
+ y = 500.0mil
+ isle_area_nm2 = 199999999.999200
+ }
+ ha:cursor {
+ zoom = 0.000000
+ x = 225.0mil
+ y = 0.0
+ }
+ ha:drc {
+ min_drill = 15.0mil
+ min_ring = 10.0mil
+ bloat = 12.0mil
+ shrink = 9.0mil
+ min_width = 10.0mil
+ min_silk = 7.0mil
+ }
+ ha:grid {
+ spacing = 25.0mil
+ offs_x = 0.0
+ offs_y = 0.0
+ }
+ }
+
+ ha:data {
+ li:objects {
+ ha:element.81 {
+ x=600.0mil; y=250.0mil;
+ li:objects {
+ ha:text.78 {
+ string=Standard SMT resistor, capacitor etc; x=568.5mil; y=143.5mil; scale=100; direction=0; role=desc;
+ }
+ ha:text.79 {
+ string=R1; x=568.5mil; y=143.5mil; scale=100; direction=0; role=name;
+ }
+ ha:text.80 {
+ string=1206; x=568.5mil; y=143.5mil; scale=100; direction=0; role=value;
+ }
+ ha:line.82 {
+ x1=-599.948um; y1=-37.4mil; x2=23.62mil; y2=-37.4mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.83 {
+ x1=-599.948um; y1=0.94996mm; x2=23.62mil; y2=0.94996mm; thickness=8.0mil; clearance=0.0;
+ }
+ ha:pad.84 {
+ name=1; number=1; x1=-59.05mil; y1=-299.974um; x2=-59.05mil; y2=11.81mil; mask=1.452372mm; thickness=1.299972mm; clearance=20.0mil;
+ ha:flags {
+ square=1
+ }
+ }
+ ha:pad.85 {
+ name=2; number=2; x1=1.49987mm; y1=-299.974um; x2=1.49987mm; y2=11.81mil; mask=1.452372mm; thickness=1.299972mm; clearance=20.0mil;
+ ha:flags {
+ square=1
+ }
+ }
+ }
+ }
+ }
+ li:layers {
+
+ ha:component {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:text.75 {
+ string=Hello; x=25.0mil; y=150.0mil; scale=245; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ }
+ }
+
+ ha:solder {
+ visible=1
+ group=1
+ }
+
+ ha:comp-GND {
+ visible=1
+ group=0
+ }
+
+ ha:comp-power {
+ visible=1
+ group=0
+ }
+
+ ha:sold-GND {
+ visible=1
+ group=1
+ }
+
+ ha:sold-power {
+ visible=1
+ group=1
+ }
+
+ ha:signal3 {
+ visible=1
+ group=2
+ }
+
+ ha:outline {
+ visible=1
+ group=3
+ }
+
+ ha:silk {
+ visible=1
+ group=1
+ }
+
+ ha:silk {
+ visible=1
+ group=0
+
+ li:objects {
+ ha:text.76 {
+ string=Text; x=100.0mil; y=425.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ ha:text.77 {
+ string=Element, Pad; x=425.0mil; y=425.0mil; scale=100; direction=0;
+ ha:flags {
+ clearline=1
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ha:font {
+ ha:geda_pcb {
+ cell_width=1.270001mm; cell_height=1.651001mm;
+ ha:symbols {
+ ha:] {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&5c {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:b {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:c {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:e {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=40.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:f {
+ width=0.381001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:g {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:h {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:i {
+ width=0.001um; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:j {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=21.0mil; thickness=10.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=65.0mil; x2=5.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:k {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:l {
+ width=0.127001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:m {
+ width=0.889001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=25.0mil; y1=30.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=30.0mil; y1=30.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=35.0mil; y1=35.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:n {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:o {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:p {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:r {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:s {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=40.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:t {
+ width=0.254001mm; delta=10.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:u {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:v {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:w {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=30.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:x {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=65.0mil; x2=20.0mil; y2=60.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=65.0mil; x2=15.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=60.0mil; x2=5.0mil; y2=65.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.651001mm
+ }
+ ha:z {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:~ {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=15.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=35.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&7b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=15.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&7d {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=35.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=35.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:| {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&20 {
+ width=0.0; delta=18.0mil;
+ li:objects {
+ }
+ height = 0.0
+ }
+ ha:&23 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=20.0mil; x2=5.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:&26 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:! {
+ width=0.001um; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:" {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:$ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=35.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=45.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=45.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=40.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:% {
+ width=1.016001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=10.0mil; x2=15.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=25.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=25.0mil; x2=10.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=20.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=50.0mil; x2=40.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=35.0mil; y1=50.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=40.0mil; y1=40.0mil; x2=40.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=35.0mil; x2=40.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=25.0mil; y1=40.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=25.0mil; y1=40.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=25.0mil; y1=45.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=30.0mil; y1=50.0mil; x2=35.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:' {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.508001mm
+ }
+ ha:( {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:) {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=15.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:* {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:+ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=20.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:, {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=60.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.524001mm
+ }
+ ha:- {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.762001mm
+ }
+ ha:. {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:0 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=40.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:1 {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=18.0mil; x2=8.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=8.0mil; y1=10.0mil; x2=8.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:2 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:3 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=20.0mil; y1=23.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:4 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:5 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=25.0mil; x2=15.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=15.0mil; y1=25.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:6 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=28.0mil; x2=20.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=33.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:7 {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:8 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=37.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=37.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=7.0mil; y1=30.0mil; x2=13.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=37.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=37.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=0.0; y1=23.0mil; x2=7.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=13.0mil; y1=30.0mil; x2=20.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:9 {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:< {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:> {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.016001mm
+ }
+ ha:? {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=45.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:@ {
+ width=1.270001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=40.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=40.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=50.0mil; y1=35.0mil; x2=50.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=50.0mil; y1=10.0mil; x2=40.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=40.0mil; y1=0.0; x2=10.0mil; y2=0.0; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=10.0mil; y1=0.0; x2=0.0; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=15.0mil; y1=20.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=35.0mil; x2=30.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=30.0mil; y1=35.0mil; x2=35.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.11 {
+ x1=35.0mil; y1=30.0mil; x2=40.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.12 {
+ x1=35.0mil; y1=30.0mil; x2=35.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.13 {
+ x1=35.0mil; y1=20.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.14 {
+ x1=20.0mil; y1=15.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.15 {
+ x1=20.0mil; y1=15.0mil; x2=15.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.16 {
+ x1=40.0mil; y1=35.0mil; x2=50.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:A {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=20.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=20.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=7.0mil; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=20.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=20.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:B {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=33.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=33.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=28.0mil; x2=20.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=20.0mil; y1=28.0mil; x2=25.0mil; y2=23.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:C {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=43.0mil; x2=7.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=17.0mil; x2=0.0; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=17.0mil; x2=7.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=7.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:D {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=18.0mil; y1=10.0mil; x2=25.0mil; y2=17.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=17.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=18.0mil; y1=50.0mil; x2=25.0mil; y2=43.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=50.0mil; x2=18.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=10.0mil; x2=18.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:E {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:F {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=28.0mil; x2=15.0mil; y2=28.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:G {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:H {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=25.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:I {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:J {
+ width=0.381001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=7.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=15.0mil; y1=10.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=50.0mil; x2=15.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=0.0; y1=45.0mil; x2=0.0; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:K {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=30.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:L {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:M {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=15.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=30.0mil; y1=10.0mil; x2=30.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&2f {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=45.0mil; x2=30.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.143001mm
+ }
+ ha:&3a {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:&3b {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=10.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=25.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:&3d {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=25.0mil; x2=20.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=35.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.889001mm
+ }
+ ha:O {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:P {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:N {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:R {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=25.0mil; y1=15.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=10.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=13.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:S {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=20.0mil; y1=10.0mil; x2=25.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=25.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=25.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=5.0mil; y1=30.0mil; x2=20.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=30.0mil; x2=25.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=25.0mil; y1=35.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=20.0mil; y1=50.0mil; x2=25.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.9 {
+ x1=5.0mil; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.10 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Q {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=10.0mil; x2=15.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=10.0mil; x2=20.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=15.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=40.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=5.0mil; y1=50.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=10.0mil; y1=35.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:U {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=20.0mil; y1=10.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:V {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=50.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:T {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=10.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:X {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:Y {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=10.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=10.0mil; y1=30.0mil; x2=20.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=10.0mil; y1=30.0mil; x2=10.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:W {
+ width=0.762001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=30.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=15.0mil; y1=30.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=25.0mil; y1=50.0mil; x2=30.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=30.0mil; y1=30.0mil; x2=30.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:[ {
+ width=0.127001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=10.0mil; x2=0.0; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:^ {
+ width=0.254001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=15.0mil; x2=5.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=10.0mil; x2=10.0mil; y2=15.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 0.381001mm
+ }
+ ha:Z {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=10.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=10.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=50.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:a {
+ width=0.635001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=15.0mil; y1=30.0mil; x2=20.0mil; y2=35.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.1 {
+ x1=5.0mil; y1=30.0mil; x2=15.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.2 {
+ x1=0.0; y1=35.0mil; x2=5.0mil; y2=30.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.3 {
+ x1=0.0; y1=35.0mil; x2=0.0; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.4 {
+ x1=0.0; y1=45.0mil; x2=5.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.5 {
+ x1=20.0mil; y1=30.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.6 {
+ x1=20.0mil; y1=45.0mil; x2=25.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.7 {
+ x1=5.0mil; y1=50.0mil; x2=15.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ ha:line.8 {
+ x1=15.0mil; y1=50.0mil; x2=20.0mil; y2=45.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ ha:_ {
+ width=0.508001mm; delta=12.0mil;
+ li:objects {
+ ha:line.0 {
+ x1=0.0; y1=50.0mil; x2=20.0mil; y2=50.0mil; thickness=8.0mil; clearance=0.0;
+ }
+ }
+ height = 1.270001mm
+ }
+ }
+ }
+ }
+ha:netlists {
+
+ li:input {
+ }
+}
+}
diff --git a/doc/user/04_invoc/index.html b/doc/user/04_invoc/index.html
new file mode 100644
index 0000000..2b44d83
--- /dev/null
+++ b/doc/user/04_invoc/index.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 5.1 User Invocation (aka running pcb-rnd)</h2>
+<p>
+<ul>
+pcb-rnd is typically run by invoking it from the shell after installation
+<p>
+<code>
+pcb-rnd [main options]
+</code>
+
+<p>
+At invocation, the user can learn about pcb-rnd
+<p>
+<code>
+pcb-rnd --help
+</code>
+<p>
+And at this time, choose alternative guis (Gtk, lesstif, remote)
+
+
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_coordsreadout.png b/doc/user/05_ui/01_gtk/base_window_highlight_coordsreadout.png
new file mode 100644
index 0000000..7898115
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_coordsreadout.png differ
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_layerops.png b/doc/user/05_ui/01_gtk/base_window_highlight_layerops.png
new file mode 100644
index 0000000..9a0f3d5
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_layerops.png differ
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_main.png b/doc/user/05_ui/01_gtk/base_window_highlight_main.png
new file mode 100644
index 0000000..b7b1225
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_main.png differ
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_menus.png b/doc/user/05_ui/01_gtk/base_window_highlight_menus.png
new file mode 100644
index 0000000..7baf684
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_menus.png differ
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_opsreadout.png b/doc/user/05_ui/01_gtk/base_window_highlight_opsreadout.png
new file mode 100644
index 0000000..b24b17f
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_opsreadout.png differ
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_routestyle.png b/doc/user/05_ui/01_gtk/base_window_highlight_routestyle.png
new file mode 100644
index 0000000..0ce0270
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_routestyle.png differ
diff --git a/doc/user/05_ui/01_gtk/base_window_highlight_workops.png b/doc/user/05_ui/01_gtk/base_window_highlight_workops.png
new file mode 100644
index 0000000..c99d7e8
Binary files /dev/null and b/doc/user/05_ui/01_gtk/base_window_highlight_workops.png differ
diff --git a/doc/user/05_ui/01_gtk/index.html b/doc/user/05_ui/01_gtk/index.html
new file mode 100644
index 0000000..5184ba2
--- /dev/null
+++ b/doc/user/05_ui/01_gtk/index.html
@@ -0,0 +1,92 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 5.1 GTK+ </h2>
+<p>
+pcb-rnd comes with a default graphical hid using GTK+
+
+<h3> 5.1.1 Using GTK+ </h3>
+
+<ol>
+ <li><a href="#main_window"> Main Window</a>
+ <li><a href="#menus"> Menus</a>
+ <li><a href="#operations_toolbar">Operations Toolbar</a>
+ <li><a href="#layer_controller">Layer Controller </a>
+ <li><a href="#coordinates_readout">Coordinates Readout</a>
+ <li><a href="#route_styles ">Route Styles</a>
+ <li><a href="#ops_readout">Ops Readout</a>
+ <li><a href="#key_commands">Key Commands</a>
+ <li><a href="#gui_cli">Gui Command Line Interface</a>
+ <li><a href="#dialog-windows">Dialog Windows </a>
+ <ul>
+ <li><a href="#route-styles-dialog"> route styles </a>
+ <li><a href="#log-window"> message log</a>
+ <li><a href="#library-dialog"> library</a>
+ <li><a href="#propedit-dialog"> propedit</a>
+ <li><a href="#preferences-dialog"> preferences</a>
+ </ul>
+</ol>
+<p>
+
+<h3><a name="main_window">Main Window<p></a></h3>
+<br>
+<img src=base_window_highlight_main.png alt="Main layout window highlighted">
+<p>
+The main window in pcb-rnd is a drawing area for your layout.
+</ul>
+<h3><a name="menus">Menus<p></a></h3>
+<br>
+<img src=base_window_highlight_menus.png alt="Menus highlighted">
+<p>
+Menus perform standard file operations commands as well as pcb-rnd layout specific operations
+menus:
+<ul>
+<li>File - Standard file operations -pcb-rnd import/export, and access to the pcb-rnd preferences
+<li>Edit - Undos, buffer ops, selection, edit name and route styles
+<li>View - Main view grid control and attribute visibility
+<li>Settings - Direct control of main window settings that mostly affect drawing
+<li>Select - Selection and edit selection control
+<li>Buffer - edit, select, place, transform buffer contents
+<li>Connects - connection operations and DRC
+<li>Plugins - Manage plugins
+<li>Info - Generate reports and get keybindings
+<li>Window - open a auxiliary window (dialog)
+</ul>
+<h3><a name="operations_toolbar">Operations Toolbar<p></a></h3>
+<br>
+<img src=base_window_highlight_workops.png alt="Operations toolbar highlighted">
+<p>
+Add to and edit your layout
+<h3><a name="layer_controller">Layer Controller<p></a></h3>
+<br>
+<img src=base_window_layerops.png alt="Layer controls highlighted">
+<p>
+Change layer visibility
+<h3><a name="coordinates_readout">Coordinates Readout<p></a></h3>
+<br>
+<img src=base_window_highlight_coordsreadout.png alt="Coordinate readout highlighted">
+<p>
+Readouts give live info for the user:
+Obtain absolute and relative coordinate information
+<h3><a name="route_styles">Route Styles<p></a></h3>
+<br>
+<img src=base_window_highlight_routestyle.png alt="Route styles area highlighted">
+<p>
+Access route style dialog and alter existing route style
+<h3><a name="ops_readout">Ops Readout<p></a></h3>
+<br>
+<img src=base_window_highlight_opsreadout.png alt="Operations readout highlighted">
+<p>
+Readouts provide live info for the user
+Obtain view grid line drawing style reporter, via size, clearance value, text
+size, buffer number
+<h3><a name="key_commands">Key Commands<p></a></h3>
+pcb-rnd key command standard...
+Quick Keys
+<h3><a name="gui_cli">Gui Command Line Interface <p></a></h3>
+Enter the command line interface by typing :
diff --git a/doc/user/05_ui/02_cli/index.html b/doc/user/05_ui/02_cli/index.html
new file mode 100644
index 0000000..46dafbf
--- /dev/null
+++ b/doc/user/05_ui/02_cli/index.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 5.2 Actions and Command Line Interface </h2>
+<p>
+<ul>
+pcb-rnd actions can be listed
+
+<p>
+<code>
+./pcb-rnd --show-actions
+</code>
+
+<p>
+Uses for CLI:
+<li>format translation (with additional plugins active)
+<li>export (with additional plugins)
+<li>agnostic version control (use with git/mercurial/svn)
+</ul>
+<p>
+
diff --git a/doc/user/05_ui/index.html b/doc/user/05_ui/index.html
new file mode 100644
index 0000000..b1aca9c
--- /dev/null
+++ b/doc/user/05_ui/index.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 4. User Interface (UI) </h2>
+<p>
+pcb-rnd offers various user interface plugins. The plugins connect between
+various input methods and the pcb-rnd core to offer different functionality
+matching user tools, experience, or desired workflows.
+<p>
+The following sections describe all the existing pcb-rnd UI plugins. We start
+with the section on GTK+ because it is the most commonly used HID
+<p>
+<ul class="toc">
+ <li><a href="01_gtk/index.html"> 4.1 GTK
+ <li><a href="02_cli/index.html"> 4.2 Actions and Command Line Interface
+ <li><a href="03_lesstif/"> 4.3 lesstif
+ <li><a href="04_remote/"> 4.4 remote
+ <li><a href="05_batch/"> 4.5 batch
+</ul>
+
diff --git a/doc/user/06_feature/djopt/Makefile b/doc/user/06_feature/djopt/Makefile
new file mode 100644
index 0000000..e414f98
--- /dev/null
+++ b/doc/user/06_feature/djopt/Makefile
@@ -0,0 +1,50 @@
+PCB=../../src/pcb-rnd
+HTML=index.html
+CASES = \
+ debumpify.$(TARGET) \
+ miter.$(TARGET) \
+ orthopull.$(TARGET) \
+ unjaggy.$(TARGET) \
+ vianudge.$(TARGET) \
+ viatrim.$(TARGET)
+
+all:
+ $(MAKE) conv TARGET=out.png
+ $(MAKE) conv TARGET=png
+ $(MAKE) index
+
+index:
+ $(MAKE) index.html TARGET=txt
+
+index.html: Pre.html Post.html $(CASES) Makefile
+ cat Pre.html > $(HTML)
+ $(MAKE) conv TARGET=tbl
+ cat Post.html >>$(HTML)
+
+conv: $(CASES)
+
+.SUFFIXES: .pcb .out.pcb .png .out.png .tbl
+.PRECIOUS: %.pcb %.out.pcb %.png %.out.png
+
+.pcb.out.pcb:
+ echo "OptAutoOnly(); djopt($*); SaveTo(LayoutAs, $*.out.pcb.tmp);"| $(PCB) --gui batch $*.pcb
+ awk '/Symbol.. . 1800./,/^Attribute/ { next } { print $$0 }' < $*.out.pcb.tmp > $*.out.pcb
+ rm $*.out.pcb.tmp
+
+.pcb.tbl:
+ echo '<tr><th>$*<td>'>>$(HTML)
+ cat $*.txt >>$(HTML)
+ echo ' <td><a href="$*.pcb"><img src="$*.png"></a> <td><a href="$*.out.pcb"><img src="$*.out.png"></a>'>>$(HTML)
+
+.pcb.png:
+ $(PCB) -x png --dpi 300 $*.pcb
+
+out.pcb.out.png:
+ $(PCB) -x png --dpi 300 $*.out.pcb
+
+clean:
+ rm *.out.pcb *.png index.html 2>/dev/null; true
+
+
+
+
diff --git a/doc-rnd/djopt/Post.html b/doc/user/06_feature/djopt/Post.html
similarity index 100%
rename from doc-rnd/djopt/Post.html
rename to doc/user/06_feature/djopt/Post.html
diff --git a/doc-rnd/djopt/Pre.html b/doc/user/06_feature/djopt/Pre.html
similarity index 100%
rename from doc-rnd/djopt/Pre.html
rename to doc/user/06_feature/djopt/Pre.html
diff --git a/doc-rnd/djopt/debumpify.out.pcb b/doc/user/06_feature/djopt/debumpify.out.pcb
similarity index 100%
rename from doc-rnd/djopt/debumpify.out.pcb
rename to doc/user/06_feature/djopt/debumpify.out.pcb
diff --git a/doc-rnd/djopt/debumpify.out.png b/doc/user/06_feature/djopt/debumpify.out.png
similarity index 100%
rename from doc-rnd/djopt/debumpify.out.png
rename to doc/user/06_feature/djopt/debumpify.out.png
diff --git a/doc-rnd/djopt/debumpify.pcb b/doc/user/06_feature/djopt/debumpify.pcb
similarity index 100%
rename from doc-rnd/djopt/debumpify.pcb
rename to doc/user/06_feature/djopt/debumpify.pcb
diff --git a/doc-rnd/djopt/debumpify.png b/doc/user/06_feature/djopt/debumpify.png
similarity index 100%
rename from doc-rnd/djopt/debumpify.png
rename to doc/user/06_feature/djopt/debumpify.png
diff --git a/doc-rnd/djopt/debumpify.txt b/doc/user/06_feature/djopt/debumpify.txt
similarity index 100%
rename from doc-rnd/djopt/debumpify.txt
rename to doc/user/06_feature/djopt/debumpify.txt
diff --git a/doc-rnd/djopt/index.html b/doc/user/06_feature/djopt/index.html
similarity index 100%
rename from doc-rnd/djopt/index.html
rename to doc/user/06_feature/djopt/index.html
diff --git a/doc-rnd/djopt/miter.out.pcb b/doc/user/06_feature/djopt/miter.out.pcb
similarity index 100%
rename from doc-rnd/djopt/miter.out.pcb
rename to doc/user/06_feature/djopt/miter.out.pcb
diff --git a/doc-rnd/djopt/miter.out.png b/doc/user/06_feature/djopt/miter.out.png
similarity index 100%
rename from doc-rnd/djopt/miter.out.png
rename to doc/user/06_feature/djopt/miter.out.png
diff --git a/doc-rnd/djopt/miter.pcb b/doc/user/06_feature/djopt/miter.pcb
similarity index 100%
rename from doc-rnd/djopt/miter.pcb
rename to doc/user/06_feature/djopt/miter.pcb
diff --git a/doc-rnd/djopt/miter.png b/doc/user/06_feature/djopt/miter.png
similarity index 100%
rename from doc-rnd/djopt/miter.png
rename to doc/user/06_feature/djopt/miter.png
diff --git a/doc-rnd/djopt/miter.txt b/doc/user/06_feature/djopt/miter.txt
similarity index 100%
rename from doc-rnd/djopt/miter.txt
rename to doc/user/06_feature/djopt/miter.txt
diff --git a/doc-rnd/djopt/orthopull.out.pcb b/doc/user/06_feature/djopt/orthopull.out.pcb
similarity index 100%
rename from doc-rnd/djopt/orthopull.out.pcb
rename to doc/user/06_feature/djopt/orthopull.out.pcb
diff --git a/doc-rnd/djopt/orthopull.out.png b/doc/user/06_feature/djopt/orthopull.out.png
similarity index 100%
rename from doc-rnd/djopt/orthopull.out.png
rename to doc/user/06_feature/djopt/orthopull.out.png
diff --git a/doc-rnd/djopt/orthopull.pcb b/doc/user/06_feature/djopt/orthopull.pcb
similarity index 100%
rename from doc-rnd/djopt/orthopull.pcb
rename to doc/user/06_feature/djopt/orthopull.pcb
diff --git a/doc-rnd/djopt/orthopull.png b/doc/user/06_feature/djopt/orthopull.png
similarity index 100%
rename from doc-rnd/djopt/orthopull.png
rename to doc/user/06_feature/djopt/orthopull.png
diff --git a/doc-rnd/djopt/orthopull.txt b/doc/user/06_feature/djopt/orthopull.txt
similarity index 100%
rename from doc-rnd/djopt/orthopull.txt
rename to doc/user/06_feature/djopt/orthopull.txt
diff --git a/doc-rnd/djopt/unjaggy.out.pcb b/doc/user/06_feature/djopt/unjaggy.out.pcb
similarity index 100%
rename from doc-rnd/djopt/unjaggy.out.pcb
rename to doc/user/06_feature/djopt/unjaggy.out.pcb
diff --git a/doc-rnd/djopt/unjaggy.out.png b/doc/user/06_feature/djopt/unjaggy.out.png
similarity index 100%
rename from doc-rnd/djopt/unjaggy.out.png
rename to doc/user/06_feature/djopt/unjaggy.out.png
diff --git a/doc-rnd/djopt/unjaggy.pcb b/doc/user/06_feature/djopt/unjaggy.pcb
similarity index 100%
rename from doc-rnd/djopt/unjaggy.pcb
rename to doc/user/06_feature/djopt/unjaggy.pcb
diff --git a/doc-rnd/djopt/unjaggy.png b/doc/user/06_feature/djopt/unjaggy.png
similarity index 100%
rename from doc-rnd/djopt/unjaggy.png
rename to doc/user/06_feature/djopt/unjaggy.png
diff --git a/doc-rnd/djopt/unjaggy.txt b/doc/user/06_feature/djopt/unjaggy.txt
similarity index 100%
rename from doc-rnd/djopt/unjaggy.txt
rename to doc/user/06_feature/djopt/unjaggy.txt
diff --git a/doc-rnd/djopt/vianudge.out.pcb b/doc/user/06_feature/djopt/vianudge.out.pcb
similarity index 100%
rename from doc-rnd/djopt/vianudge.out.pcb
rename to doc/user/06_feature/djopt/vianudge.out.pcb
diff --git a/doc-rnd/djopt/vianudge.out.png b/doc/user/06_feature/djopt/vianudge.out.png
similarity index 100%
rename from doc-rnd/djopt/vianudge.out.png
rename to doc/user/06_feature/djopt/vianudge.out.png
diff --git a/doc-rnd/djopt/vianudge.pcb b/doc/user/06_feature/djopt/vianudge.pcb
similarity index 100%
rename from doc-rnd/djopt/vianudge.pcb
rename to doc/user/06_feature/djopt/vianudge.pcb
diff --git a/doc-rnd/djopt/vianudge.png b/doc/user/06_feature/djopt/vianudge.png
similarity index 100%
rename from doc-rnd/djopt/vianudge.png
rename to doc/user/06_feature/djopt/vianudge.png
diff --git a/doc-rnd/djopt/vianudge.txt b/doc/user/06_feature/djopt/vianudge.txt
similarity index 100%
rename from doc-rnd/djopt/vianudge.txt
rename to doc/user/06_feature/djopt/vianudge.txt
diff --git a/doc-rnd/djopt/viatrim.out.pcb b/doc/user/06_feature/djopt/viatrim.out.pcb
similarity index 100%
rename from doc-rnd/djopt/viatrim.out.pcb
rename to doc/user/06_feature/djopt/viatrim.out.pcb
diff --git a/doc-rnd/djopt/viatrim.out.png b/doc/user/06_feature/djopt/viatrim.out.png
similarity index 100%
rename from doc-rnd/djopt/viatrim.out.png
rename to doc/user/06_feature/djopt/viatrim.out.png
diff --git a/doc-rnd/djopt/viatrim.pcb b/doc/user/06_feature/djopt/viatrim.pcb
similarity index 100%
rename from doc-rnd/djopt/viatrim.pcb
rename to doc/user/06_feature/djopt/viatrim.pcb
diff --git a/doc-rnd/djopt/viatrim.png b/doc/user/06_feature/djopt/viatrim.png
similarity index 100%
rename from doc-rnd/djopt/viatrim.png
rename to doc/user/06_feature/djopt/viatrim.png
diff --git a/doc-rnd/djopt/viatrim.txt b/doc/user/06_feature/djopt/viatrim.txt
similarity index 100%
rename from doc-rnd/djopt/viatrim.txt
rename to doc/user/06_feature/djopt/viatrim.txt
diff --git a/doc-rnd/gpmi/Credits b/doc/user/06_feature/gpmi/Credits
similarity index 100%
rename from doc-rnd/gpmi/Credits
rename to doc/user/06_feature/gpmi/Credits
diff --git a/doc-rnd/gpmi/History b/doc/user/06_feature/gpmi/History
similarity index 100%
rename from doc-rnd/gpmi/History
rename to doc/user/06_feature/gpmi/History
diff --git a/doc-rnd/gpmi/Makefile b/doc/user/06_feature/gpmi/Makefile
similarity index 100%
rename from doc-rnd/gpmi/Makefile
rename to doc/user/06_feature/gpmi/Makefile
diff --git a/doc-rnd/gpmi/Porting b/doc/user/06_feature/gpmi/Porting
similarity index 100%
rename from doc-rnd/gpmi/Porting
rename to doc/user/06_feature/gpmi/Porting
diff --git a/doc-rnd/gpmi/gpmi_flow.dot b/doc/user/06_feature/gpmi/gpmi_flow.dot
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow.dot
rename to doc/user/06_feature/gpmi/gpmi_flow.dot
diff --git a/doc-rnd/gpmi/gpmi_flow.png b/doc/user/06_feature/gpmi/gpmi_flow.png
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow.png
rename to doc/user/06_feature/gpmi/gpmi_flow.png
diff --git a/doc-rnd/gpmi/gpmi_flow_exp.dot b/doc/user/06_feature/gpmi/gpmi_flow_exp.dot
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_exp.dot
rename to doc/user/06_feature/gpmi/gpmi_flow_exp.dot
diff --git a/doc-rnd/gpmi/gpmi_flow_exp.png b/doc/user/06_feature/gpmi/gpmi_flow_exp.png
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_exp.png
rename to doc/user/06_feature/gpmi/gpmi_flow_exp.png
diff --git a/doc-rnd/gpmi/gpmi_flow_load.dot b/doc/user/06_feature/gpmi/gpmi_flow_load.dot
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_load.dot
rename to doc/user/06_feature/gpmi/gpmi_flow_load.dot
diff --git a/doc-rnd/gpmi/gpmi_flow_load.png b/doc/user/06_feature/gpmi/gpmi_flow_load.png
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_load.png
rename to doc/user/06_feature/gpmi/gpmi_flow_load.png
diff --git a/doc-rnd/gpmi/gpmi_flow_menu.dot b/doc/user/06_feature/gpmi/gpmi_flow_menu.dot
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_menu.dot
rename to doc/user/06_feature/gpmi/gpmi_flow_menu.dot
diff --git a/doc-rnd/gpmi/gpmi_flow_menu.png b/doc/user/06_feature/gpmi/gpmi_flow_menu.png
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_menu.png
rename to doc/user/06_feature/gpmi/gpmi_flow_menu.png
diff --git a/doc-rnd/gpmi/gpmi_flow_reg.dot b/doc/user/06_feature/gpmi/gpmi_flow_reg.dot
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_reg.dot
rename to doc/user/06_feature/gpmi/gpmi_flow_reg.dot
diff --git a/doc-rnd/gpmi/gpmi_flow_reg.png b/doc/user/06_feature/gpmi/gpmi_flow_reg.png
similarity index 100%
rename from doc-rnd/gpmi/gpmi_flow_reg.png
rename to doc/user/06_feature/gpmi/gpmi_flow_reg.png
diff --git a/doc-rnd/gpmi/index.html b/doc/user/06_feature/gpmi/index.html
similarity index 100%
rename from doc-rnd/gpmi/index.html
rename to doc/user/06_feature/gpmi/index.html
diff --git a/doc/user/06_feature/gpmi/packages/Makefile b/doc/user/06_feature/gpmi/packages/Makefile
new file mode 100644
index 0000000..fb1eb16
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/Makefile
@@ -0,0 +1,15 @@
+ROOT=../../../../..
+GPMIDIR=$(ROOT)/src_plugins/gpmi/pcb-gpmi
+ALL= actions dialogs hid layout
+
+all: XREF $(ALL:%=%_ref.html)
+
+include $(GPMIDIR)/Makefile.config
+
+%_ref.html REF.% : $(GPMIDIR)/gpmi_plugin/gpmi_pkg/%.h
+ $(ROOT)/util/genref.sh "$^" "$(ROOT)" "../packages/$*_ref.html" $(PCB_CFLAGS) >$*_ref.html
+
+XREF: $(ALL:%=REF.%)
+ cat $^ > $@
+
+
diff --git a/doc-rnd/gpmi/packages/XREF b/doc/user/06_feature/gpmi/packages/XREF
similarity index 100%
rename from doc-rnd/gpmi/packages/XREF
rename to doc/user/06_feature/gpmi/packages/XREF
diff --git a/doc/user/06_feature/gpmi/packages/actions.html b/doc/user/06_feature/gpmi/packages/actions.html
new file mode 100644
index 0000000..7fd5e56
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/actions.html
@@ -0,0 +1,123 @@
+<HTML>
+<BODY>
+<H1> The actions package </H1>
+
+The action package is used to register actions and menus in PCB and
+to execute existing actions. In PCB actions
+are generated when the user selects a menu, presses a key or issues a
+command on the PCB command line.
+
+<H2> Registration of new actions </H2>
+The script may register new actions
+using arbitrary action names. If any of the registered actions is
+detected, an ACTE_action event is sent to the script. If multiple
+actions are used in a script, argument <I>name</I> of the event handler
+can be used to identify the triggering action. <small>(This may be time consuming
+in scripting languages (a series of string comparison) - those scripts
+binding to frequent actions should not bind to too many different actions.)</small>
+pcb-gpmi guarantees that the event handler of a script is triggered only
+when an action is caught that previously was registered by the same script.
+<P>
+The process of binding an action:
+<OL>
+ <LI> create an event handler for event <I>ACTE_action</I>
+ <LI> register one or more actions using function <I>action_register</I>
+ <LI> optional: when the event handler is triggered, check argument <I>name</I> (for scripts with multiple actions registered)
+ <LI> optional: use argument <I>argc</I> and function <I>action_arg</I> to fetch action arguments
+ <LI> optional: use arguments <I>x, y</I> to learn the cursor position on the layout.
+</OL>
+
+Example (written in lua):
+<PRE>
+-- load the package
+PkgLoad("pcb-gpmi/actions", 0);
+
+-- action callback
+function ev_action(id, name, argc, x, y)
+ if name == "cake" then
+ size = action_arg(1);
+ -- put cake drawing code here
+ else
+ -- must be candy
+ amount = action_arg(1);
+ -- put candy drawing code here
+ end
+end
+
+-- register and bind action
+action_register("cake", "cake center xy?", "cake service", "cake(size)", "");
+action_register("candy", "candy cloud center xy?", "cake service", "candy(amount)", "");
+Bind("ACTE_action", "ev_action");
+</PRE>
+<p>
+When the script is unloaded all actions the script registered
+are removed from pcb-rnd automatically.
+
+<H2> Executing actions </H2>
+An existing action can be executed using the action() call. The only one
+argument is a command line string. The syntax is the same as in pcb
+command line.
+
+Example (written in lua):
+<PRE>
+PkgLoad("pcb-rnd-gpmi/actions", 0);
+
+function ev_action1(id, name, argc, x, y)
+ action("undo()")
+ action("undo()")
+end
+
+-- register and bind action
+action_register("untwo", "", "undo twice", "untwo()", "CONTEXT!");
+</PRE>
+<p>
+The above script registers a new action called untwo(). When untwo() is executed,
+it executes action undo() twice.
+
+
+<H2> Creating menus </H2>
+It is possible to insert menus and submenus runtime, using the call
+create_menu(). The script should do this only after the gui has been initialized.
+The most common way is to create all menus from the ACTE_gui_init event,
+which is called after the gui finished setting up.
+<p>
+The first argument of create_menu() is the menu path. The path is a list
+of visible menu names separated by slashes (e.g. "/main_menu/File/Save as..." means
+"File" menu, "Save as..." submenu).
+<p>
+Paths are interpreted as menu paths, which are a slightly simplified version
+of lihata paths found in menu.lht. Basically there's a main directory directly
+under root that determines the type of the menu:
+<p>
+<ul>
+ <li> /main_menu/ is the menubar
+ <li> /popups/something/ is a popup menu called something; the lesstif HID does
+ not support popups; popups are popped up by actions.
+</ul>
+<p>
+The simplification compared to lihata paths is that only menu and submenu
+names are on the path, so lihata nodes like "li:submenu" should be ignored.
+In other words, the path represents how the menus can be reached from the user
+interface, plus a "main menu type prefix" as discussed above.
+<p>
+By <b>convention</b>, scripts should
+create new menu items under the "/main_menu/Plugins/" menu.
+<p>
+The following example lua script registers a new menu item
+<pre>
+PkgLoad("pcb-rnd-gpmi/actions", 0);
+
+function ev_gui_init(argc, argv)
+ create_menu("/main_menu/Plugins/foo", "undo()", "o", "Ctrl<Key>o", "tooltip for foo");
+end
+
+-- register and bind action
+Bind("ACTE_gui_init", "ev_gui_init");
+</pre>
+<p>
+When the user clicks on the menu, the action script specified in the second argument
+of create_menu() is executed. Thus the script usually registers a new action
+first then registers one or more menu items executing those actions.
+
+</BODY>
+</HTML>
diff --git a/doc/user/06_feature/gpmi/packages/actions_ref.html b/doc/user/06_feature/gpmi/packages/actions_ref.html
new file mode 100644
index 0000000..e9cce5e
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/actions_ref.html
@@ -0,0 +1,82 @@
+<html>
+<body>
+<h1>PCB GPMI</h1>
+<h2>Reference manual for package actions</h2>
+<small>Automatically generated from actions.h</small>
+
+<h3> Events </h3>
+<dl>
+<p>Events do not have return value. The first argument is always <a href="event_id.html">the even id</a>. Event handlers defined in scripts get all event arguments converted to string (types below are informational).
+<a id="ACTE_action">
+<H4> ACTE_action(int event_id, const char* name, int argc, int x, int y) </H4>
+<pre>
+ Generated when an action registered by the script is executed.
+ Arguments:
+ name: name of the action (as registered using function action_register())
+ argc: number of arguments. Arguments can be accessed using function action_arg
+ x, y: optional coords, if need_xy was not empty at action_register
+</pre>
+<a id="ACTE_gui_init">
+<H4> ACTE_gui_init(int event_id, int argc, char** argv) </H4>
+<pre>
+ Generated right after gui initialization, before the gui main loop.
+ Arguments:
+ argc: number of arguments the gui was initialized with.
+ argv[]: arguments the gui was initialized with - unaccessible for the scripts.
+</pre>
+<a id="ACTE_unload">
+<H4> ACTE_unload(int event_id, const char* conffile) </H4>
+<pre>
+ Generated right before unloading a script to give the script a chance
+ to clean up.
+ Arguments:
+ conffile: the name of the config file that originally triggered loading the script, or empty if the script was loaded from the gui.
+</pre>
+</dl>
+<h3> Functions </h3>
+<dl>
+<p>The following functions are registered in script context.
+<a id="action_register">
+<H4> int action_register(const char* name, const char* need_xy, const char* description, const char* syntax) </H4>
+<pre>
+ Register an action in PCB - when the action is executed, event
+ ACTE_action is generated with the action name.
+ Multiple actions can be registered. Any action registered by the script
+ will trigger an ACTE_event sent to the script.
+ Arguments:
+ name: name of the action
+ need_xy: the question the user is asked when he needs to choose a coordinate; if empty, no coordinate is asked
+ description: description of the action (for the help)
+ syntax: syntax of the action (for the help)
+ Returns 0 on success.
+
+</pre>
+<a id="action_arg">
+<H4> const char* action_arg(int argn) </H4>
+<pre>
+ extract the (argn)th event argument for the current action (makes sense only in an ACTE_action event handler
+</pre>
+<a id="action">
+<H4> int action(const char* cmdline) </H4>
+<pre>
+ call an existing action using PCB syntax (e.g. foo(1, 2, 3))
+ Returns non-zero on error; generally returns value of the action
+ (which is also non-zero on error).
+</pre>
+<a id="create_menu">
+<H4> void create_menu(const char* path, const char* action, const char* mnemonic, const char* hotkey, const char* tooltip) </H4>
+<pre>
+ Create a new menu or submenu at path. Missing parents are created
+ automatically with empty action, mnemonic, hotkey and tooltip.
+ Arguments:
+ path: the full path of the new menu
+ action: this action is executed when the user clicks on the menu
+ mnemonic: which letter to underline in the menu text (will be the fast-jump-there key once the menu is open)
+ hotkey: when this key is pressed in the main gui, the action is also triggered; the format is modifiers<Key>letter, where modifiers is Alt, Shift or Ctrl. This is the same syntax that is used in the .res files.
+ tooltip: short help text
+</pre>
+</dl>
+
+</body>
+</html>
+
diff --git a/doc/user/06_feature/gpmi/packages/dialogs.html b/doc/user/06_feature/gpmi/packages/dialogs.html
new file mode 100644
index 0000000..7077a9a
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/dialogs.html
@@ -0,0 +1,47 @@
+<HTML>
+<BODY>
+ <H1> dialogs package </H1>
+ The purpose of this package is to expose the dialog box handling interface
+ of the active GUI hid. Using this package scripts can pop up dialog boxes
+ to inform or ask the user. If there is no active GUI, call logs are dumped
+ on stderr. Note: message arguments usually may contain newline (\n) characters
+ to split the message.
+
+ <H2> Common conventions </H2>
+ Dialog boxes are blocking calls to the GUI HID: when the script
+ calls a dialog box, the script is suspended until the dialog box
+ is closed by the user. In other words, dialog boxes behave
+ as regular function calls from the scripts: when they return,
+ the dialog is over and the result is known.
+ <p>
+ The only exception is <i>dialog_progress()</i>, which opens or
+ updates or closes the already open progress dialog box, and
+ returns immediately (even when the box is left open).
+
+ <H2> Simple dialogs vs. custom dialogs </H2>
+ Most of the calls will pop up a static dialog box. Static means
+ that widgets are predefined by the GUI HID. The script
+ is free to fill in data, but can not change the basic structure of
+ the dialog box. For example <i>dialog_confirm(), dialog_prompt(),
+ dialog_fileselect()</i> are static.
+ <p>
+ When the script needs a custom, dynamic dialog box, it needs to
+ create an <i>attribute dialog</i>. The script sets up a HID
+ structure using the hid package, builds up all the input fields
+ then calls <i>dialog_attribute()</i> with the hid.
+
+ <H2> Progress dialogs </H2>
+
+ The script should call dialog_progress() periodically from a process that
+ runs time consuming calculations and check the return value and break
+ the loop on cancel. The process should have an idea of how long it
+ will take. This is passed on in argument <i>total</i>. As long as
+ argument <i>so_far</i> is less than <i>total</i>, the dialog is
+ open.
+ <p>
+ After the process has finished, a call with <i>so_far=total+1</i> should be
+ made to make sure the window is closed. If the call returns non-zero,
+ the process should be cancelled.
+
+</BODY>
+</HTML>
diff --git a/doc/user/06_feature/gpmi/packages/dialogs_ref.html b/doc/user/06_feature/gpmi/packages/dialogs_ref.html
new file mode 100644
index 0000000..10bf551
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/dialogs_ref.html
@@ -0,0 +1,105 @@
+<html>
+<body>
+<h1>PCB GPMI</h1>
+<h2>Reference manual for package dialogs</h2>
+<small>Automatically generated from dialogs.h</small>
+
+<h3> Enums </h3>
+<dl>
+<p>Enum values should be passed on as strings.
+<a id="dialog_fileselect_e">
+<H4> dialog_fileselect_e</H4>
+<pre>
+ Filter on what files a file select dialog should list
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> FS_NONE <td> none of the below
+<tr><td> FS_READ <td> when the selected file will be read, not written (HID_FILESELECT_READ)
+<tr><td> FS_NOT_EXIST <td> the function calling hid->fileselect will deal with the case when the selected file already exists. If not given, then the gui will prompt with an "overwrite?" prompt. Only used when writing. (HID_FILESELECT_MAY_NOT_EXIST)
+<tr><td> FS_TEMPLATE <td> the call is supposed to return a file template (for gerber output for example) instead of an actual file. Only used when writing. (HID_FILESELECT_IS_TEMPLATE)
+</table>
+</dl>
+<h3> Functions </h3>
+<dl>
+<p>The following functions are registered in script context.
+<a id="dialog_log">
+<H4> void dialog_log(const char* msg) </H4>
+<pre>
+ Append a msg to the log (log window and/or stderr).
+</pre>
+<a id="dialog_confirm">
+<H4> int dialog_confirm(const char* msg, const char* ok, const char* cancel) </H4>
+<pre>
+ Ask the user for confirmation (usually using a popup). Returns 0 for
+ cancel and 1 for ok.
+ Arguments:
+ msg: message to the user
+ ok: label of the OK button
+ cancel: label of the cancel button
+ Arguments "ok" and "cancel" may be empty (or NULL) in which
+ case the GUI will use the default (perhaps localized) labels for
+ those buttons.
+</pre>
+<a id="dialog_report">
+<H4> void dialog_report(const char* title, const char* msg) </H4>
+<pre>
+ Pop up a report dialog.
+ Arguments:
+ title: title of the window
+ msg: message
+</pre>
+<a id="dialog_prompt">
+<H4> char* dialog_prompt(const char* msg, const char* default_) </H4>
+<pre>
+ Ask the user to input a string (usually in a popup).
+ Arguments:
+ msg: message or question text
+ default_: default answer (this may be filled in on start)
+ Returns the answer.
+</pre>
+<a id="dialog_fileselect">
+<H4> char* dialog_fileselect(const char* title, const char* descr, char* default_file_, char* default_ext, const char* history_tag, dialog_fileselect_t flags) </H4>
+<pre>
+ Pops up a file selection dialog.
+ Arguments:
+ title: window title
+ descr: description
+ default_file_
+ default_ext: default file name extension
+ history_tag
+ flags: one or more flags (see below)
+ Returns the selected file or NULL (empty).
+</pre>
+<a id="dialog_beep">
+<H4> void dialog_beep(void) </H4>
+<pre>
+ Audible beep
+</pre>
+<a id="dialog_progress">
+<H4> int dialog_progress(int so_far, int total, const char* message) </H4>
+<pre>
+ Request the GUI hid to draw a progress bar.
+ Arguments:
+ int so_far: achieved state
+ int total: maximum state
+ const char *message: informs the users what they are waiting for
+ If so_far is bigger than total, the progress bar is closed.
+ Returns nonzero if the user wishes to cancel the operation.
+
+</pre>
+<a id="dialog_attribute">
+<H4> int dialog_attribute(hid_t* hid, const char* title, const char* descr) </H4>
+<pre>
+ Pop up an attribute dialog; content (widgets) of the dialog box are coming
+ from hid (see the hid package).
+ Arguments:
+ hid: widgets
+ title: title of the window
+ descr: description printed in the dialog
+</pre>
+</dl>
+
+</body>
+</html>
+
diff --git a/doc-rnd/gpmi/packages/event_id.html b/doc/user/06_feature/gpmi/packages/event_id.html
similarity index 100%
rename from doc-rnd/gpmi/packages/event_id.html
rename to doc/user/06_feature/gpmi/packages/event_id.html
diff --git a/doc/user/06_feature/gpmi/packages/hid.html b/doc/user/06_feature/gpmi/packages/hid.html
new file mode 100644
index 0000000..ce09c81
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/hid.html
@@ -0,0 +1,76 @@
+<HTML>
+<BODY>
+<H1> hid package </H1>
+
+The hid package has two purposes:
+<UL>
+ <LI> it is glue layer for exporter dialog boxes and <i>attribute dialog boxes</i>;
+ <LI> it can register exporter HIDs in PCB
+</UL>
+
+<H2> Building a custom dialog box</H2>
+First hid_create() needs to be called. It returns a new hid_t, which is
+an opaque structure for the package that is used to describe attributes of
+an attribute dialog or an exporter hid. Attributes are added using
+hid_add_attribute(), which returns an unique ID of the attribute. The
+attribute ID can be used later for querying attribute value set by the
+user using hid_get_attribute().
+<p>
+The process of building a dialog box is closed by a call to
+<ul>
+ <li> hid_register(), which registers a new exporter hid using the
+ attributes of the dialog box; or
+ <li> dialog_attribute() (of the dialog package) which pops up a custom
+ dialog box immediately.
+</ul>
+
+<H2> Registering an exporter</H2>
+ Function hid_register() registers the hid as an exporter. Should be
+ called after all attributes have been added using hid_add_attribute().
+ The export is coordinated by pcb core; when the user request an export
+ using the exporter, a series of events are delivered to the script:
+ <ol>
+ <li> envelope events to set up exporting
+ <li> many draw events to actually export the objects
+ <li> an envelope event to finish exporting
+ </ol>
+
+ <H3> Envelope: events generated before or after exporting </H3>
+ <UL>
+ <LI>HIDE_get_export_options(void *hid): Generated before get_exporter_options returns the option list to the GUI hid
+ <LI>HIDE_do_export_start(void *hid): Generated before export redraw starts
+ <LI>HIDE_do_export_finish(void *hid): Generated after export redraw finished
+ </UL>
+
+ <H3> Drawing: events generated during exporting </H3>
+ Note: there may be multiple <I>gc</I>s (graphic contexts), each having its own color, line
+ properties, xor drawing and faded state. Graphic contexts are created
+ and destroyed by the following events:
+ <UL>
+ <LI>HIDE_make_gc(void *hid, void *gc);
+ <LI>HIDE_destroy_gc(void *hid, void *gc);
+ </UL>
+
+ <I>Gc</I> properties are changed by the following events:
+ <UL>
+ <LI>HIDE_set_layer(void *hid, const char *name, int group);
+ <LI>HIDE_set_color(void *hid, void *gc, const char *name);
+ <LI>HIDE_set_line_cap(void *hid, void *gc, EndCapStyle style);
+ <LI>HIDE_set_line_width(void *hid, void *gc, int width);
+ <LI>HIDE_set_draw_xor(void *hid, void *gc, int xor);
+ <LI>HIDE_set_draw_faded(void *hid, void *gc, int faded);
+ </UL>
+
+ Finally, the actual drawing operations:
+ <UL>
+ <LI>HIDE_draw_line(void *hid, void *gc, int x1, int y1, int x2, int y2);
+ <LI>HIDE_draw_arc(void *hid, void *gc, int cx, int cy, int xradius, int yradius, int start_angle, int delta_angle);
+ <LI>HIDE_draw_rect(void *hid, void *gc, int x1, int y1, int x2, int y2);
+ <LI>HIDE_fill_circle(void *hid, void *gc, int cx, int cy, int radius);
+ <LI>HIDE_fill_polygon(void *hid, void *gc, int n_coords, int *x, int *y);
+ <LI>HIDE_fill_rect(void *hid, void *gc, int x1, int y1, int x2, int y2);
+ <LI>HIDE_use_mask(void *hid, int use_it); [TODO]
+ </UL>
+
+</BODY>
+</HTML>
diff --git a/doc/user/06_feature/gpmi/packages/hid_ref.html b/doc/user/06_feature/gpmi/packages/hid_ref.html
new file mode 100644
index 0000000..1f4c43d
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/hid_ref.html
@@ -0,0 +1,205 @@
+<html>
+<body>
+<h1>PCB GPMI</h1>
+<h2>Reference manual for package hid</h2>
+<small>Automatically generated from hid.h</small>
+
+<h3> Enums </h3>
+<dl>
+<p>Enum values should be passed on as strings.
+<a id="hid_attr_type_e">
+<H4> hid_attr_type_e</H4>
+<pre>
+ Type of an HID attribute (usually a widget on an attribute dialog box)
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> HIDA_Label <td> non-editable label displayed on the GUI
+<tr><td> HIDA_Integer <td> a signed integer value
+<tr><td> HIDA_Real <td> a floating point value
+<tr><td> HIDA_String <td> one line textual input
+<tr><td> HIDA_Boolean <td> true/false boolean value
+<tr><td> HIDA_Enum <td> select an item of a predefined list
+<tr><td> HIDA_Mixed <td> TODO
+<tr><td> HIDA_Path <td> path to a file or directory
+<tr><td> HIDA_Unit <td> select a dimension unit
+<tr><td> HIDA_Coord <td> enter a coordinate
+</table>
+<a id="EndCapStyle_e">
+<H4> EndCapStyle_e</H4>
+<pre>
+ Line or arc ending style
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> Trace_Cap <td> filled circle (trace drawing)
+<tr><td> Square_Cap <td> rectangular lines (square pad)
+<tr><td> Round_Cap <td> round pins or round-ended pads, thermals
+<tr><td> Beveled_Cap <td> octagon pins or bevel-cornered pads
+</table>
+</dl>
+<h3> Events </h3>
+<dl>
+<p>Events do not have return value. The first argument is always <a href="event_id.html">the even id</a>. Event handlers defined in scripts get all event arguments converted to string (types below are informational).
+<a id="HIDE_get_export_options">
+<H4> HIDE_get_export_options(int event_id, void* hid) </H4>
+<pre>
+ Called before get_exporter_options returns the option list to the GUI hid
+</pre>
+<a id="HIDE_do_export_start">
+<H4> HIDE_do_export_start(int event_id, void* hid) </H4>
+<pre>
+ Called before export redraw starts
+</pre>
+<a id="HIDE_do_export_finish">
+<H4> HIDE_do_export_finish(int event_id, void* hid) </H4>
+<pre>
+ Called after export redraw finished
+</pre>
+<a id="HIDE_set_layer">
+<H4> HIDE_set_layer(int event_id, void* hid, const char* name, int group, int empty) </H4>
+<pre>
+ PCB callback events for drawing: change layer
+</pre>
+<a id="HIDE_set_color">
+<H4> HIDE_set_color(int event_id, void* hid, void* gc, const char* name) </H4>
+<pre>
+ PCB callback events for drawing: change drawing color
+</pre>
+<a id="HIDE_set_line_cap">
+<H4> HIDE_set_line_cap(int event_id, void* hid, void* gc, EndCapStyle style) </H4>
+<pre>
+ PCB callback events for drawing: change drawing line cap style
+</pre>
+<a id="HIDE_set_line_width">
+<H4> HIDE_set_line_width(int event_id, void* hid, void* gc, int width) </H4>
+<pre>
+ PCB callback events for drawing: change drawing line width
+</pre>
+<a id="HIDE_set_draw_xor">
+<H4> HIDE_set_draw_xor(int event_id, void* hid, void* gc, int xor) </H4>
+<pre>
+ PCB callback events for drawing: toggle xor drawing method
+</pre>
+<a id="HIDE_set_draw_faded">
+<H4> HIDE_set_draw_faded(int event_id, void* hid, void* gc, int faded) </H4>
+<pre>
+ PCB callback events for drawing: toggle faded drawing method
+</pre>
+<a id="HIDE_draw_line">
+<H4> HIDE_draw_line(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2) </H4>
+<pre>
+ PCB callback events for drawing: draw a line
+</pre>
+<a id="HIDE_draw_arc">
+<H4> HIDE_draw_arc(int event_id, void* hid, void* gc, int cx, int cy, int xradius, int yradius, double start_angle, double delta_angle) </H4>
+<pre>
+ PCB callback events for drawing: draw an arc from center cx;cy
+</pre>
+<a id="HIDE_draw_rect">
+<H4> HIDE_draw_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2) </H4>
+<pre>
+ PCB callback events for drawing: draw a rectangle
+</pre>
+<a id="HIDE_fill_circle">
+<H4> HIDE_fill_circle(int event_id, void* hid, void* gc, int cx, int cy, int radius) </H4>
+<pre>
+ PCB callback events for drawing: draw a filled circle
+</pre>
+<a id="HIDE_fill_polygon">
+<H4> HIDE_fill_polygon(int event_id, void* hid, void* gc, int n_coords, int* x, int* y) </H4>
+<pre>
+ PCB callback events for drawing: draw a filled polygon
+</pre>
+<a id="HIDE_fill_rect">
+<H4> HIDE_fill_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2) </H4>
+<pre>
+ PCB callback events for drawing: draw a filled rectangle
+</pre>
+<a id="HIDE_use_mask">
+<H4> HIDE_use_mask(int event_id, void* hid, int use_it) </H4>
+<pre>
+ PCB callback events for drawing: TODO
+</pre>
+<a id="HIDE_make_gc">
+<H4> HIDE_make_gc(int event_id, void* hid, void* gc) </H4>
+<pre>
+ PCB callback events for drawing: create a new graphical context
+</pre>
+<a id="HIDE_destroy_gc">
+<H4> HIDE_destroy_gc(int event_id, void* hid, void* gc) </H4>
+<pre>
+ PCB callback events for drawing: destroy a graphical context
+</pre>
+<a id="HIDE_fill_pcb_pv">
+<H4> HIDE_fill_pcb_pv(int event_id, void* hid, void* fg_gc, void* bg_gc, void* pad, int drawHole, int mask) </H4>
+<pre>
+ PCB callback events for drawing: TODO
+</pre>
+<a id="HIDE_fill_pcb_pad">
+<H4> HIDE_fill_pcb_pad(int event_id, void* hid, void* pad, int clear, int mask) </H4>
+<pre>
+ PCB callback events for drawing: TODO
+</pre>
+</dl>
+<h3> Functions </h3>
+<dl>
+<p>The following functions are registered in script context.
+<a id="hid_create">
+<H4> hid_t* hid_create(char* hid_name, char* description) </H4>
+<pre>
+ Creates a new hid context. Name and description matters only if the hid is
+registered as an exporter later.
+</pre>
+<a id="hid_add_attribute">
+<H4> int hid_add_attribute(hid_t* hid, char* attr_name, char* help, hid_attr_type_t type, int min, int max, char* default_val) </H4>
+<pre>
+ Append an attribute in a hid previously created using hid_create().
+ Arguments:
+ hid: hid_t previously created using hid_create()
+ attr_name: name of the attribute
+ help: help text for the attribute
+ type: type of the attribute (input widget type)
+ min: minimum value of the attribute, if type is integer or real)
+ max: maximum value of the attribute, if type is integer or real)
+ default_val: default value of the attribute
+ Returns an unique ID of the attribute the caller should store for
+ later reference. For example this ID is used when retrieving the
+ value of the attribute after the user finished entering data in
+ the dialog.
+</pre>
+<a id="hid_get_attribute">
+<H4> char* hid_get_attribute(hid_t* hid, int attr_id) </H4>
+<pre>
+ Query an attribute from the hid after dialog_attributes() returned.
+ Arguments:
+ hid: hid_t previously created using hid_create()
+ attr_id: the unique ID of the attribute (returned by hid_add_attribute())
+ Returns the value (converted to string) set by the user.
+</pre>
+<a id="hid_register">
+<H4> int hid_register(hid_t* hid) </H4>
+<pre>
+ Register the hid; call it after a hid is created and its attributes
+ are all set up
+</pre>
+<a id="hid_gpmi_data_set">
+<H4> void hid_gpmi_data_set(hid_t* h, void* data) </H4>
+<pre>
+ For internal use
+</pre>
+<a id="hid_gpmi_data_get">
+<H4> hid_t* hid_gpmi_data_get(HID* h) </H4>
+<pre>
+ For internal use
+</pre>
+<a id="hid_string2val">
+<H4> HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char* str) </H4>
+<pre>
+ For internal use
+</pre>
+</dl>
+
+</body>
+</html>
+
diff --git a/doc/user/06_feature/gpmi/packages/layout.html b/doc/user/06_feature/gpmi/packages/layout.html
new file mode 100644
index 0000000..756ea73
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/layout.html
@@ -0,0 +1,58 @@
+<HTML>
+<BODY>
+<H1> layout package </H1>
+
+Layout package searches and manipulates the current layout. Dimension units
+are in nanometer unless otherwise mentioned.
+
+<H2> Page: board dimensions</H2>
+ Functions used to query or set width and height of the drawing:
+ <UL>
+ <LI>int layout_get_page_width();
+ <LI>int layout_get_page_height();
+ <LI>void layout_set_page_size(int width, int height);
+ </UL>
+
+<H2> Layer manipulation </H2>
+Most functions perform operations similar to user commands affecting
+the current layer.
+The following few calls can change the current layer. Warning: this is the
+same current layer as the user's; the script most probably wants to save
+the current layer before changing it and then restore it after the operation.
+ <UL>
+ <LI>int layout_resolve_layer(const char *name): resolve layer number by name (case sensitive); returns negative number if not found
+ <LI>int layout_get_current_layer(): returns the number of the current layer
+ <LI>void layout_switch_to_layer(int layer): switch to layer (further actions will take place there)
+ </UL>
+<p>
+
+<H2> Object searches </H2>
+ Search results are collected on lists identified by their name (search_ID).
+ If a new search is done with the same name, old search results for that
+ name are discarded.
+ Search functions return the number of objects found (size of the list) that can
+ be then used while querying the results using layout_search_get().
+ Results should be freed using layout_search_free() when they are no
+ longer needed.
+ <p>
+ TODO: validity of a list in time
+ <p>
+Once the search list is ready, the script can iterate over it and resolve
+the object handle of each object found, using layout_search_get(). Having
+an object handle, The layout_obj_*() functions may be used by the script
+to access fields of an object structure.
+
+<H2>Create new objects </H2>
+ The layout_create_*() calls are used to create new objects on the current
+ layer (set by layout_switch_to_layer()).
+
+
+<H2> API reference - page, units and coordinates </H2>
+(angles are in radian)
+TODO
+
+<H2> API reference - debug draw </H2>
+TODO
+
+</BODY>
+</HTML>
diff --git a/doc/user/06_feature/gpmi/packages/layout_ref.html b/doc/user/06_feature/gpmi/packages/layout_ref.html
new file mode 100644
index 0000000..87a6432
--- /dev/null
+++ b/doc/user/06_feature/gpmi/packages/layout_ref.html
@@ -0,0 +1,305 @@
+<html>
+<body>
+<h1>PCB GPMI</h1>
+<h2>Reference manual for package layout</h2>
+<small>Automatically generated from layout.h</small>
+
+<h3> Enums </h3>
+<dl>
+<p>Enum values should be passed on as strings.
+<a id="layout_object_mask_e">
+<H4> layout_object_mask_e</H4>
+<pre>
+ Object type search mask bits
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> OM_LINE <td> lines (traces, silk lines, not font)
+<tr><td> OM_TEXT <td> text written using the font
+<tr><td> OM_POLYGON <td> polygons, including rectangles
+<tr><td> OM_ARC <td> arcs, circles
+<tr><td> OM_VIA <td> vias and holes which are not part of a footprint
+<tr><td> OM_PIN <td> pins/pads of a footprint
+<tr><td> OM_ANY <td> shorthand for "find anything"
+</table>
+<a id="layout_object_coord_e">
+<H4> layout_object_coord_e</H4>
+<pre>
+ Which coordinate of the object is referenced
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> OC_BX1 <td> bounding box X1
+<tr><td> OC_BX2 <td> bounding box X2
+<tr><td> OC_BY1 <td> bounding box Y1
+<tr><td> OC_BY2 <td> bounding box Y2
+<tr><td> OC_P1X <td> point 1 X
+<tr><td> OC_P2X <td> point 2 X
+<tr><td> OC_P1Y <td> point 1 Y
+<tr><td> OC_P2Y <td> point 2 Y
+<tr><td> OC_OBJ <td> the whole object
+<tr><td> OC_P1 <td> point 1 is P1X
+<tr><td> OC_P2 <td> point 2 is P2X
+</table>
+<a id="layout_flag_e">
+<H4> layout_flag_e</H4>
+<pre>
+ of layout_object_coord_t
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> FL_NONE <td> <comment missing in the header>
+<tr><td> FL_SHOWNUMBER <td> <comment missing in the header>
+<tr><td> FL_LOCALREF <td> <comment missing in the header>
+<tr><td> FL_CHECKPLANS <td> <comment missing in the header>
+<tr><td> FL_SHOWDRC <td> <comment missing in the header>
+<tr><td> FL_RUBBERBAND <td> <comment missing in the header>
+<tr><td> FL_DESCRIPTION <td> <comment missing in the header>
+<tr><td> FL_NAMEONPCB <td> <comment missing in the header>
+<tr><td> FL_AUTODRC <td> <comment missing in the header>
+<tr><td> FL_ALLDIRECTION <td> <comment missing in the header>
+<tr><td> FL_SWAPSTARTDIR <td> <comment missing in the header>
+<tr><td> FL_UNIQUENAME <td> <comment missing in the header>
+<tr><td> FL_CLEARNEW <td> <comment missing in the header>
+<tr><td> FL_SNAPPIN <td> <comment missing in the header>
+<tr><td> FL_SHOWMASK <td> <comment missing in the header>
+<tr><td> FL_THINDRAW <td> <comment missing in the header>
+<tr><td> FL_ORTHOMOVE <td> <comment missing in the header>
+<tr><td> FL_LIVEROUTE <td> <comment missing in the header>
+<tr><td> FL_THINDRAWPOLY <td> <comment missing in the header>
+<tr><td> FL_LOCKNAMES <td> <comment missing in the header>
+<tr><td> FL_ONLYNAMES <td> <comment missing in the header>
+<tr><td> FL_NEWFULLPOLY <td> <comment missing in the header>
+<tr><td> FL_HIDENAMES <td> <comment missing in the header>
+<tr><td> FL_THERMALSTYLE1 <td> <comment missing in the header>
+<tr><td> FL_THERMALSTYLE2 <td> <comment missing in the header>
+<tr><td> FL_THERMALSTYLE3 <td> <comment missing in the header>
+<tr><td> FL_THERMALSTYLE4 <td> <comment missing in the header>
+<tr><td> FL_THERMALSTYLE5 <td> <comment missing in the header>
+</table>
+<a id="layer_field_e">
+<H4> layer_field_e</H4>
+<pre>
+ Field name of the layer structure
+</pre>
+<table border=1>
+<tr><th>value <th>meaning
+<tr><td> LFLD_NUM_LINES <td> number of lines on the layer
+<tr><td> LFLD_NUM_TEXTS <td> number of texts on the layer
+<tr><td> LFLD_NUM_POLYS <td> number of polygons on the layer
+<tr><td> LFLD_NUM_ARCS <td> number of arcs on the layer
+<tr><td> LFLD_VISIBLE <td> non-zero if the layer is visible
+<tr><td> LFLD_NODRC <td> non-zero if the layer doesn't use DRC
+</table>
+</dl>
+<h3> Functions </h3>
+<dl>
+<p>The following functions are registered in script context.
+<a id="layout_search_box">
+<H4> int layout_search_box(const char* search_ID, layout_object_mask_t obj_types, int x1, int y1, int x2, int y2) </H4>
+<pre>
+ creates a new search and adds all objects that matches obj_types mask within the given rectangle on the current layer
+ Arguments:
+ search_ID: unique name of the search (overwrites existing search on the same name)
+ obj_types: on or more object types
+ x1, y1, x2, y2: box the search is done within (PCB coords)
+ Returns the number of object on the search list.
+</pre>
+<a id="layout_search_selected">
+<H4> int layout_search_selected(const char* search_ID, layout_object_mask_t obj_types) </H4>
+<pre>
+ creates a new search and adds all selected objects
+ Arguments:
+ search_ID: unique name of the search (overwrites existing search on the same name)
+ obj_types: on or more object types
+ Returns the number of object on the search list.
+</pre>
+<a id="layout_search_found">
+<H4> int layout_search_found(const char* search_ID, layout_object_mask_t obj_types) </H4>
+<pre>
+ creates a new search and adds all found objects (the green highlight)
+ Arguments:
+ search_ID: unique name of the search (overwrites existing search on the same name)
+ obj_types: on or more object types
+ Returns the number of object on the search list.
+</pre>
+<a id="layout_search_get">
+<H4> layout_object_t* layout_search_get(const char* search_ID, int n) </H4>
+<pre>
+ Returns the nth object from a search list (or NULL pointer if n is beyond the list)
+</pre>
+<a id="layout_search_free">
+<H4> int layout_search_free(const char* search_ID) </H4>
+<pre>
+ Frees all memory related to a search. Returns 0 on success.
+ Argument:
+ search_ID: unique name of the search (requires an existing search)
+</pre>
+<a id="layout_obj_coord">
+<H4> int layout_obj_coord(layout_object_t* obj, layout_object_coord_t coord) </H4>
+<pre>
+ Return the requested coord of an object; except for the bounding box
+ coordinates, the meaning of coordinates are object-specific.
+ Point 1 and point 2 are usually endpoints of the object (line, arc),
+ "the whole object" coordinate is a central point.
+</pre>
+<a id="layout_obj_type">
+<H4> layout_object_mask_t layout_obj_type(layout_object_t* obj) </H4>
+<pre>
+ Return the type of an object (always a single bit)
+</pre>
+<a id="layout_obj_move">
+<H4> int layout_obj_move(layout_object_t* obj, layout_object_coord_t coord, int dx, int dy) </H4>
+<pre>
+ Change location of an object or parts of the object (like move endpoint of a line);
+ Arguments:
+ obj: the object
+ coord: which coordinate to drag (e.g. move only the endpoint)
+ dx, dy: relative x and y coordinates the selected coordinate is displaced by
+ Returns 0 on success
+</pre>
+<a id="layout_arc_angles">
+<H4> int layout_arc_angles(layout_object_t* obj, int relative, int start, int delta) </H4>
+<pre>
+ change angles of an arc; start and delta are relative if relative is non-zero; returns 0 on success
+</pre>
+<a id="layout_create_line">
+<H4> int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int clearance, layout_flag_t flags) </H4>
+<pre>
+ create a line
+</pre>
+<a id="layout_create_via">
+<H4> int layout_create_via(int x, int y, int thickness, int clearance, int mask, int hole, const char* name, layout_flag_t flags) </H4>
+<pre>
+ create a named via
+</pre>
+<a id="layout_create_arc">
+<H4> int layout_create_arc(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, layout_flag_t flags) </H4>
+<pre>
+ create a new arc; sa is start angle, dir is delta angle
+</pre>
+<a id="layout_switch_to_layer">
+<H4> void layout_switch_to_layer(int layer) </H4>
+<pre>
+ switch to layer (further layer-specific actions will take place there)
+</pre>
+<a id="layout_get_current_layer">
+<H4> int layout_get_current_layer() </H4>
+<pre>
+ returns the number of the current layer
+</pre>
+<a id="layout_resolve_layer">
+<H4> int layout_resolve_layer(const char* name) </H4>
+<pre>
+ resolve layer number by name (case sensitive); returns negative number if not found
+</pre>
+<a id="layout_get_max_possible_layer">
+<H4> int layout_get_max_possible_layer() </H4>
+<pre>
+ return the theoretical number of layers supported by PCB
+</pre>
+<a id="layout_get_max_copper_layer">
+<H4> int layout_get_max_copper_layer() </H4>
+<pre>
+ return the actual number of copper layers on the current design
+</pre>
+<a id="layout_get_max_layer">
+<H4> int layout_get_max_layer() </H4>
+<pre>
+ return the actual number of layers on the current design
+</pre>
+<a id="layout_layer_name">
+<H4> const char* layout_layer_name(int layer) </H4>
+<pre>
+ return the name of a layer
+</pre>
+<a id="layout_layer_color">
+<H4> const char* layout_layer_color(int layer) </H4>
+<pre>
+ return the color of a layer
+</pre>
+<a id="layout_layer_field">
+<H4> int layout_layer_field(int layer, layer_field_t fld) </H4>
+<pre>
+ return an integer field of a layer
+</pre>
+<a id="layout_get_page_width">
+<H4> int layout_get_page_width() </H4>
+<pre>
+ query or set width and height of the drawing
+</pre>
+<a id="layout_get_page_height">
+<H4> int layout_get_page_height() </H4>
+<pre>
+<comment missing in the header>
+</pre>
+<a id="layout_set_page_size">
+<H4> void layout_set_page_size(int width, int height) </H4>
+<pre>
+<comment missing in the header>
+</pre>
+<a id="mil2pcb_multiplier">
+<H4> double mil2pcb_multiplier() </H4>
+<pre>
+ -- coordinate system -- (coord.c)
+</pre>
+<a id="mm2pcb_multiplier">
+<H4> double mm2pcb_multiplier() </H4>
+<pre>
+<comment missing in the header>
+</pre>
+<a id="current_grid_unit">
+<H4> const char* current_grid_unit() </H4>
+<pre>
+<comment missing in the header>
+</pre>
+<a id="debug_draw_request">
+<H4> int debug_draw_request(void) </H4>
+<pre>
+ Initialize debug drawing; returns 1 if worked, 0 if denied
+</pre>
+<a id="debug_draw_flush">
+<H4> void debug_draw_flush(void) </H4>
+<pre>
+ Flush the drawing
+</pre>
+<a id="debug_draw_finish">
+<H4> void debug_draw_finish(dctx_t* ctx) </H4>
+<pre>
+ Finish (close) drawing
+</pre>
+<a id="debug_draw_dctx">
+<H4> dctx_t* debug_draw_dctx(void) </H4>
+<pre>
+ Get the draw context of debug draw
+</pre>
+<a id="draw_set_color">
+<H4> void draw_set_color(dctx_t* ctx, const char* name) </H4>
+<pre>
+ Debug draw style: set drawing color
+</pre>
+<a id="draw_set_line_width">
+<H4> void draw_set_line_width(dctx_t* ctx, int width) </H4>
+<pre>
+ Debug draw style: set line width
+</pre>
+<a id="draw_set_draw_xor">
+<H4> void draw_set_draw_xor(dctx_t* ctx, int xor) </H4>
+<pre>
+ Debug draw style: set whether drawing should happen in xor
+</pre>
+<a id="draw_set_draw_faded">
+<H4> void draw_set_draw_faded(dctx_t* ctx, int faded) </H4>
+<pre>
+ Debug draw style: set whether drawing should happen in faded mode
+</pre>
+<a id="draw_line">
+<H4> void draw_line(dctx_t* ctx, int x1_, int y1_, int x2_, int y2_) </H4>
+<pre>
+ Debug draw: draw a line using the current style settings
+</pre>
+</dl>
+
+</body>
+</html>
+
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ID.desc b/doc/user/06_feature/gpmi/rosetta/10_hello/ID.desc
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ID.desc
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ID.desc
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ID.name b/doc/user/06_feature/gpmi/rosetta/10_hello/ID.name
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ID.name
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ID.name
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.awk b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.awk
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.awk
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.awk
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.bash b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.bash
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.bash
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.bash
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.html b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.html
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.html
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.lua b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.lua
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.lua
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.lua
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.pl b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.pl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.pl
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.pl
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.py b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.py
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.py
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.py
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.rb b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.rb
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.rb
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.rb
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.scm b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.scm
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.scm
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.scm
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.stt b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.stt
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.stt
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.stt
diff --git a/doc-rnd/gpmi/rosetta/10_hello/ex.tcl b/doc/user/06_feature/gpmi/rosetta/10_hello/ex.tcl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/ex.tcl
rename to doc/user/06_feature/gpmi/rosetta/10_hello/ex.tcl
diff --git a/doc-rnd/gpmi/rosetta/10_hello/index.html b/doc/user/06_feature/gpmi/rosetta/10_hello/index.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello/index.html
rename to doc/user/06_feature/gpmi/rosetta/10_hello/index.html
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ID.desc b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.desc
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ID.desc
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.desc
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ID.name b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.name
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ID.name
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.name
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.awk b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.awk
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.awk
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.awk
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.bash b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.bash
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.bash
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.bash
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.html b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.html
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.html
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.lua b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.lua
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.lua
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.lua
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.pl b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.pl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.pl
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.pl
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.py b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.py
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.py
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.py
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.rb b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.rb
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.rb
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.rb
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.scm b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.scm
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.scm
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.scm
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.stt b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.stt
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.stt
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.stt
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/ex.tcl b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.tcl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/ex.tcl
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.tcl
diff --git a/doc-rnd/gpmi/rosetta/10_hello_gui/index.html b/doc/user/06_feature/gpmi/rosetta/10_hello_gui/index.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/10_hello_gui/index.html
rename to doc/user/06_feature/gpmi/rosetta/10_hello_gui/index.html
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ID.desc b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.desc
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ID.desc
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.desc
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ID.name b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.name
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ID.name
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.name
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.awk b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.awk
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.awk
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.awk
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.bash b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.bash
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.bash
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.bash
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.html
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.html
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.lua b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.lua
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.lua
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.lua
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.pl b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.pl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.pl
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.pl
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.py b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.py
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.py
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.py
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.rb b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.rb
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.rb
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.rb
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.scm b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.scm
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.scm
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.scm
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.stt b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.stt
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.stt
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.stt
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/ex.tcl b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.tcl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/ex.tcl
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.tcl
diff --git a/doc-rnd/gpmi/rosetta/12_hello_menu/index.html b/doc/user/06_feature/gpmi/rosetta/12_hello_menu/index.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/12_hello_menu/index.html
rename to doc/user/06_feature/gpmi/rosetta/12_hello_menu/index.html
diff --git a/doc-rnd/gpmi/rosetta/30_move/ID.desc b/doc/user/06_feature/gpmi/rosetta/30_move/ID.desc
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ID.desc
rename to doc/user/06_feature/gpmi/rosetta/30_move/ID.desc
diff --git a/doc-rnd/gpmi/rosetta/30_move/ID.name b/doc/user/06_feature/gpmi/rosetta/30_move/ID.name
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ID.name
rename to doc/user/06_feature/gpmi/rosetta/30_move/ID.name
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.awk b/doc/user/06_feature/gpmi/rosetta/30_move/ex.awk
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.awk
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.awk
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.bash b/doc/user/06_feature/gpmi/rosetta/30_move/ex.bash
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.bash
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.bash
diff --git a/doc/user/06_feature/gpmi/rosetta/30_move/ex.html b/doc/user/06_feature/gpmi/rosetta/30_move/ex.html
new file mode 100644
index 0000000..0f9c205
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/30_move/ex.html
@@ -0,0 +1,36 @@
+Load packages the script depends on:
+<ul>
+ <li> <ref>actions</ref> for registering the new action;
+ <li> <ref>layout</ref> for searching selected objects and moving objects.
+</ul>
+<p>
+Create a function <i>ev_action</i> that will be called when any of
+the actions registered by the script is executed. The script registers
+only one action, so it does not need to check which action caused
+the function to be called.
+<p>
+When the action event is called, first set up:
+<ul>
+ <li> fetch event argument 0 and 1 using <ref>action_arg</ref>;
+ <li> resolve the conversion rate from mm to PCB's units using <ref>mm2pcb_multiplier</ref>;
+ <li> perform a search for all selected object using <ref>layout_search_selected</ref> (return value is the number of objects found), name the resulting list "mv_search"
+</ul>
+A loop then iterates over the objects on the list:
+<ul>
+ <li> resolve the Nth element of the list using <ref>layout_search_get</ref>, referencing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer;
+ <li> move the object using <ref>layout_obj_move</ref>; specify the object pointer, then which part of the object should be moved ("OC_OBJ" means the whole object) and relative offsets (dx and dy calculated earlier)
+</ul>
+Finally the search list shall be destroyed to reclaim memory, using <ref>layout_search_free</ref>.
+<p>
+
+In the "main" section of the script, bind event <ref>ACTE_action</ref> to
+our local function <i>ev_action</i> - this gets <i>ev_action</i> to
+be called when any of the actions registered by this script is executed.
+<p>
+Finally use <ref>action_register</ref> to register the action:
+<ul>
+ <li> first argument is the name of the action
+ <li> second is the xy query string; it is empty since this action won't need coordinates to operate on
+ <li> third is the description that shows up in dumps and helps
+ <li> fourth is the syntax description (also for helps)
+</ul>
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.lua b/doc/user/06_feature/gpmi/rosetta/30_move/ex.lua
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.lua
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.lua
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.pl b/doc/user/06_feature/gpmi/rosetta/30_move/ex.pl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.pl
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.pl
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.py b/doc/user/06_feature/gpmi/rosetta/30_move/ex.py
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.py
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.py
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.rb b/doc/user/06_feature/gpmi/rosetta/30_move/ex.rb
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.rb
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.rb
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.scm b/doc/user/06_feature/gpmi/rosetta/30_move/ex.scm
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.scm
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.scm
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.stt b/doc/user/06_feature/gpmi/rosetta/30_move/ex.stt
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.stt
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.stt
diff --git a/doc-rnd/gpmi/rosetta/30_move/ex.tcl b/doc/user/06_feature/gpmi/rosetta/30_move/ex.tcl
similarity index 100%
rename from doc-rnd/gpmi/rosetta/30_move/ex.tcl
rename to doc/user/06_feature/gpmi/rosetta/30_move/ex.tcl
diff --git a/doc/user/06_feature/gpmi/rosetta/30_move/index.html b/doc/user/06_feature/gpmi/rosetta/30_move/index.html
new file mode 100644
index 0000000..b80234a
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/30_move/index.html
@@ -0,0 +1,74 @@
+<html><body>
+<!-- ******* DO NOT EDIT THIS FILE, it is generated by rosetta_genpages.sh ******* -->
+<-- back to the <a href="../index.html">index of Rosetta examples</a>
+<h1>action: move selected objects</h1>
+Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm.
+<H2> Example implementations </H2>
+<a href="ex.awk">awk</a>
+ |
+<a href="ex.bash">bash</a>
+ |
+<a href="ex.lua">lua</a>
+ |
+<a href="ex.pl">pl</a>
+ |
+<a href="ex.py">py</a>
+ |
+<a href="ex.rb">rb</a>
+ |
+<a href="ex.scm">scm</a>
+ |
+<a href="ex.stt">stt</a>
+ |
+<a href="ex.tcl">tcl</a>
+<h2> Explanation, step by step </h2>
+Load packages the script depends on:
+<ul>
+<li>
+<i>actions</i>
+ for registering the new action;
+<li>
+<i>layout</i>
+ for searching selected objects and moving objects. </ul>
+
+<p> Create a function
+<i>ev_action</i>
+ that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called.
+<p> When the action event is called, first set up:
+<ul>
+<li> fetch event argument 0 and 1 using
+<i><a href="../../packages/actions_ref.html#action_arg">action_arg</a></i>
+;
+<li> resolve the conversion rate from mm to PCB's units using
+<i><a href="../../packages/layout_ref.html#mm2pcb_multiplier">mm2pcb_multiplier</a></i>
+;
+<li> perform a search for all selected object using
+<i><a href="../../packages/layout_ref.html#layout_search_selected">layout_search_selected</a></i>
+ (return value is the number of objects found), name the resulting list "mv_search" </ul>
+ A loop then iterates over the objects on the list:
+<ul>
+<li> resolve the Nth element of the list using
+<i><a href="../../packages/layout_ref.html#layout_search_get">layout_search_get</a></i>
+, referencing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer;
+<li> move the object using
+<i><a href="../../packages/layout_ref.html#layout_obj_move">layout_obj_move</a></i>
+; specify the object pointer, then which part of the object should be moved ("OC_OBJ" means the whole object) and relative offsets (dx and dy calculated earlier) </ul>
+ Finally the search list shall be destroyed to reclaim memory, using
+<i><a href="../../packages/layout_ref.html#layout_search_free">layout_search_free</a></i>
+.
+<p> In the "main" section of the script, bind event
+<i><a href="../../packages/actions_ref.html#ACTE_action">ACTE_action</a></i>
+ to our local function
+<i>ev_action</i>
+ - this gets
+<i>ev_action</i>
+ to be called when any of the actions registered by this script is executed.
+<p> Finally use
+<i><a href="../../packages/actions_ref.html#action_register">action_register</a></i>
+ to register the action:
+<ul>
+<li> first argument is the name of the action
+<li> second is the xy query string; it is empty since this action won't need coordinates to operate on
+<li> third is the description that shows up in dumps and helps
+<li> fourth is the syntax description (also for helps) </ul>
+
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.desc
similarity index 100%
rename from doc-rnd/gpmi/rosetta/35_export_drill/ID.desc
rename to doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.desc
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/ID.name b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.name
similarity index 100%
rename from doc-rnd/gpmi/rosetta/35_export_drill/ID.name
rename to doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.name
diff --git a/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.awk b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.awk
new file mode 100644
index 0000000..54ae345
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.awk
@@ -0,0 +1,60 @@
+BEGIN {
+ PkgLoad("pcb-rnd-gpmi/hid", 0)
+ PkgLoad("pcb-rnd-gpmi/layout", 0)
+ PkgLoad("pcb-rnd-gpmi/dialogs", 0)
+
+ hid = hid_create("drill", "drill list export")
+ attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt")
+ attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text")
+ hid_register(hid)
+
+ fmt = 0
+ conv = mm2pcb_multiplier()
+ channel = ""
+ green_light = 0
+}
+
+function make_gc(event_id, hid, gc) {
+ if (channel == "") {
+ channel = hid_get_attribute(hid, attr_path)
+# awk: can't check whether the file can be open here
+ fmt = hid_get_attribute(hid, attr_format)
+ }
+}
+
+function destroy_gc(event_id, hid, gc) {
+ if (channel != "") {
+ close(channel)
+ channel = ""
+ }
+}
+
+function set_layer(event_id, hid, group, layer, flags, empty) {
+ if ((layer_flag_is_set(flags, "LYT_ASSY") == "1") && (layer_flag_is_set(flags, "LYT_TOP") == "1"))
+ green_light = 1
+ else
+ green_light = 0
+}
+
+function fill_circle(event_id, hid, gc, cx, cy, r ,dia) {
+ if (green_light) {
+ cx = cx / conv
+ cy = cy / conv
+ dia = r / conv * 2
+
+ if (fmt == "CSV") {
+ print cx "," cy "," dia > channel
+ } else if (fmt == "TSV") {
+ print cx "\t" cy "\t" dia > channel
+ } else if (fmt == "text") {
+ print cx " " cy " " dia > channel
+ }
+ }
+}
+
+BEGIN {
+ Bind("HIDE_make_gc", "make_gc")
+ Bind("HIDE_destroy_gc", "destroy_gc")
+ Bind("HIDE_set_layer_group", "set_layer_group")
+ Bind("HIDE_fill_circle", "fill_circle")
+}
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/ex.html b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/35_export_drill/ex.html
rename to doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.html
diff --git a/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua
new file mode 100644
index 0000000..dd7db31
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua
@@ -0,0 +1,65 @@
+PkgLoad("pcb-rnd-gpmi/hid", 0)
+PkgLoad("pcb-rnd-gpmi/layout", 0)
+PkgLoad("pcb-rnd-gpmi/dialogs", 0)
+
+hid = hid_create("drill", "drill list export")
+attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt")
+attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text")
+hid_register(hid)
+
+fmt = 0
+conv = mm2pcb_multiplier()
+channel = nil
+green_light = 0
+
+function make_gc(event_id, hid, gc)
+ if channel == nil
+ then
+ channel = io.open(hid_get_attribute(hid, attr_path), "w")
+ if channel == nil
+ then
+ dialog_report("Error exporting drill", "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed.")
+ return
+ end
+ fmt = hid_get_attribute(hid, attr_format)
+ end
+end
+
+function destroy_gc(event_id, hid, gc)
+ if channel ~= nil
+ then
+ channel:close()
+ channel = nil
+ end
+end
+
+function set_layer_group(event_id, hid, group, layer, flags, empty)
+ if (layer_flag_is_set(flags, "LYT_ASSY") == "1") and (layer_flag_is_set(flags, "LYT_TOP") == "1")
+ then
+ green_light = 1
+ else
+ green_light = 0
+ end
+end
+
+function fill_circle(event_id, hid, gc, cx, cy, r)
+ if green_light == 1
+ then
+ cx = cx / conv
+ cy = cy / conv
+ local dia = r / conv * 2
+
+ if fmt == "CSV" then
+ channel:write(cx .. "," .. cy .. "," .. dia .. "\n")
+ elseif (fmt == "TSV") then
+ channel:write(cx .. "\t" .. cy .. "\t" .. dia .. "\n")
+ elseif (fmt == "text") then
+ channel:write(cx .. " " .. cy .. " " .. dia .. "\n")
+ end
+ end
+end
+
+Bind("HIDE_make_gc", "make_gc")
+Bind("HIDE_destroy_gc", "destroy_gc")
+Bind("HIDE_set_layer_group", "set_layer_group")
+Bind("HIDE_fill_circle", "fill_circle")
diff --git a/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl
new file mode 100644
index 0000000..cfb779b
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl
@@ -0,0 +1,65 @@
+PkgLoad pcb-rnd-gpmi/hid 0
+PkgLoad pcb-rnd-gpmi/layout 0
+PkgLoad pcb-rnd-gpmi/dialogs 0
+
+set hid [hid_create "drill" "drill list export"]
+set attr_path [hid_add_attribute $hid "filename" "name of the output file" "HIDA_Path" 0 0 "drill.txt"]
+set attr_format [hid_add_attribute $hid "format" "file format" "HIDA_Enum" 0 0 "CSV|TSV|text"]
+hid_register $hid
+
+set fmt 0
+set conv [mm2pcb_multiplier]
+set channel -1
+set green_light 0
+
+proc make_gc {event_id hid gc} {
+ global channel attr_path attr_format fmt
+
+ if {$channel == -1} {
+ if {[catch {open [hid_get_attribute $hid $attr_path] "w"} channel]} {
+ dialog_report "Error exporting drill" "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed."
+ return
+ }
+ set fmt [hid_get_attribute $hid $attr_format]
+ }
+}
+
+proc destroy_gc {event_id hid gc} {
+ global channel
+
+ if {$channel > -1} {
+ close $channel
+ set channel -1
+ }
+}
+
+proc set_layer_group {event_id hid group layer flags empty} {
+ global green_light
+
+ if { [layer_flag_is_set $flags "LYT_ASSY"] && [layer_flag_is_set $flags "LYT_TOP"] } { set green_light 1; puts "!!!!!!!!!!!!!!!"} { set green_light 0 }
+}
+
+proc fill_circle {event_id hid gc cx cy r} {
+ global channel conv fmt green_light
+
+ if {$green_light} {
+ set cx [expr $cx / $conv]
+ set cy [expr $cy / $conv]
+ set dia [expr $r / $conv * 2]
+
+ if {$fmt eq "CSV"} {
+ puts $channel "$cx,$cy,$dia"
+ } elseif {$fmt eq "TSV"} {
+ puts $channel "$cx $cy $dia"
+ } elseif {$fmt eq "text"} {
+ puts $channel "$cx $cy $dia"
+ }
+ }
+}
+
+Bind HIDE_make_gc make_gc
+Bind HIDE_destroy_gc destroy_gc
+Bind HIDE_set_layer_group set_layer_group
+Bind HIDE_fill_circle fill_circle
+
+puts "NA?"
diff --git a/doc-rnd/gpmi/rosetta/35_export_drill/index.html b/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/35_export_drill/index.html
rename to doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html
diff --git a/doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc b/doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc
new file mode 100644
index 0000000..e888188
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc
@@ -0,0 +1 @@
+Create and animate an anlog clock on a dedicated UI layer.
diff --git a/doc/user/06_feature/gpmi/rosetta/90_clock/ID.name b/doc/user/06_feature/gpmi/rosetta/90_clock/ID.name
new file mode 100644
index 0000000..35afb9c
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/90_clock/ID.name
@@ -0,0 +1 @@
+animated clock on an UI layer
diff --git a/doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk b/doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk
new file mode 100644
index 0000000..7295edb
--- /dev/null
+++ b/doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk
@@ -0,0 +1,126 @@
+BEGIN {
+ PkgLoad("pcb-rnd-gpmi/actions", 0);
+ PkgLoad("pcb-rnd-gpmi/dialogs", 0);
+ PkgLoad("pcb-rnd-gpmi/layout", 0);
+ pi=3.141592654
+}
+
+# the clock coordinate system
+function clock_cos(a)
+{
+ return cos((a-15)*6/180*pi)
+}
+function clock_sin(a)
+{
+ return sin((a-15)*6/180*pi)
+}
+
+# draw the labels
+function draw_dial(ui, cx, cy, r ,flg,w,cl,a,l,x1,y1,x2,y2)
+{
+ flg = "FL_NONE"
+ w = int(0.5 * mm)
+ cl = int(1 * mm)
+
+ for(a = 0; a < 60; a++) {
+ tw = w
+ if (a == 0)
+ l = 4*mm
+ else if (a % 5 == 0)
+ l = 2*mm
+ else {
+ l = 1*mm
+ tw = w / 2
+ }
+
+ x1 = int(cx + clock_cos(a) * r)
+ y1 = int(cy + clock_sin(a) * r)
+ x2 = int(cx + clock_cos(a) * (r-l))
+ y2 = int(cy + clock_sin(a) * (r-l))
+ layout_create_line("", ui, x1, y1, x2, y2, tw, cl, flg)
+
+
+ if ((a % 5) == 0) {
+ x2 = int(cx + clock_cos(a) * (r-6*mm)) - 0.25*mm
+ y2 = int(cy + clock_sin(a) * (r-6*mm))
+ layout_create_text("", ui, x2, y2, 0, 100, ((a == 0) ? "12" : a/5), flg)
+ }
+ }
+
+ hlen[0] = 0.95
+ hlen[1] = 0.9
+ hlen[2] = 0.6
+
+ x2 = int(cx + clock_cos(a) * (r * hlen[0]))
+ y2 = int(cy + clock_sin(a) * (r * hlen[0]))
+ hand_sec = layout_create_line("hands", ui, cx, cy, x2, y2, 0.2*mm, cl, flg)
+
+ x2 = int(cx + clock_cos(a) * (r * hlen[1]))
+ y2 = int(cy + clock_sin(a) * (r * hlen[1]))
+ hand_min = layout_create_line("hands", ui, cx, cy, x2, y2, 0.5*mm, cl, flg)
+
+ x2 = int(cx + clock_cos(a) * (r * hlen[2]))
+ y2 = int(cy + clock_sin(a) * (r * hlen[2]))
+ hand_hour = layout_create_line("hands", ui, cx, cy, x2, y2, 2*mm, cl, flg)
+
+ clock_cx = cx
+ clock_cy = cy
+ clock_r = r
+}
+
+
+function ev_action(id, name, argc, x, y)
+{
+ ui = int(uilayer_alloc("clock", "#DD33DD"))
+ mm = mm2pcb_multiplier();
+ AddTimer(0, 10, "ev_second", "");
+ draw_dial(ui, 50*mm, 50*mm, 30*mm)
+
+ clock_sec = 12
+ clock_min = 33
+ clock_hour = 9
+ set_hands()
+}
+
+function set_hand(obj, idx, at ,ox2,oy2,x2,y2)
+{
+ ox2 = layout_obj_coord(obj, "OC_P2X")
+ oy2 = layout_obj_coord(obj, "OC_P2Y")
+
+ x2 = int(clock_cx + clock_cos(at) * (clock_r * hlen[idx]))
+ y2 = int(clock_cy + clock_sin(at) * (clock_r * hlen[idx]))
+
+ layout_obj_move(obj, "OC_P2", x2-ox2, y2-oy2);
+}
+
+function set_hands()
+{
+ set_hand(hand_hour, 2, (clock_hour + clock_min/60 + clock_sec/3600)*5)
+ set_hand(hand_min, 1, clock_min + clock_sec/60)
+ set_hand(hand_sec, 0, clock_sec)
+}
+
+
+function ev_second(timer_data)
+{
+ if (hand_sec != "") {
+ clock_sec++;
+ if (clock_sec >= 60) {
+ clock_sec = 0
+ clock_min++
+ if (clock_min >= 60) {
+ clock_min = 0
+ clock_hour++
+ if (clock_hour >= 12)
+ clock_hour = 0;
+ }
+ }
+ set_hands()
+ }
+}
+
+BEGIN {
+ layout_search_empty("hands")
+ Bind("ACTE_action", "ev_action");
+ action_register("clock", "", "animate an analog clock on a debug layer", "clock()");
+}
diff --git a/doc-rnd/gpmi/rosetta/index.html b/doc/user/06_feature/gpmi/rosetta/index.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/index.html
rename to doc/user/06_feature/gpmi/rosetta/index.html
diff --git a/doc-rnd/gpmi/rosetta/index.templ.html b/doc/user/06_feature/gpmi/rosetta/index.templ.html
similarity index 100%
rename from doc-rnd/gpmi/rosetta/index.templ.html
rename to doc/user/06_feature/gpmi/rosetta/index.templ.html
diff --git a/doc/user/06_feature/gpmi/scripting_intro.html b/doc/user/06_feature/gpmi/scripting_intro.html
new file mode 100644
index 0000000..390adf4
--- /dev/null
+++ b/doc/user/06_feature/gpmi/scripting_intro.html
@@ -0,0 +1,226 @@
+<html>
+<body>
+<H1> Scripting intro </H1>
+This document is an introduction to GPMI for pcb-rnd users. It focuses on
+scripting pcb-rnd and doesn't discusses GPMI deeper than the minimum necessary.
+GPMI is more generic than shown here.
+<p>
+The scope of the document is to describe the relations between pcb-rnd,
+hids, GPMI, glue packages and scripts. Details on how specific glue
+packages access pcb-rnd internals (or how those internals work) are
+described in other documents.
+
+<H2> 1. pcb-rnd internals </H2>
+
+Since scripts are glued to pcb-rnd internals, scripters need to know
+the basic concepts of how pcb-rnd is structured.
+
+<H3> 1.1 pcb-rnd, HIDs, plugins and GPMI </h2>
+pcb-rnd consists of:
+<ul>
+ <li> a <b>core</b> that handles the file format, data structures, UI and exporter logics
+ <li> a <b>hid system</b> that is a layer between core and the HIDs
+ <li> a set of <b>GUI HIDs</b> which are responsible for interactive graphical display of the current design
+ <li> a set of <b>exporter HIDs</b> which are responsible for exporting offline representation of the current design
+ <li> a <b>plugin system</b> that can load HIDs from on the fly, from dynamic loadable libraries (.so or .dll)
+ <li> a <b>buildin system</b> which is the "static link" variant of the plugin system: some plugins can be selected to be statically linked into the pcb-rnd executable so they are "always loaded"
+</ul>
+<p>
+Note 1: at the moment GUI hids can not be plugins or buildins.
+<br>
+Note 2: plugins/buildins are always exporter HIDs technically, but in practice
+they do not have to offer exporting. This means such a HID plugin is loaded
+and registered as an exporter on paper, but it doesn't really create a
+new export facility, just sits there, interacting with pcb-rnd (creating
+menus, actions, etc). Most script plugins do this.
+<p>
+When pcb-rnd executable is compiled, the core, the default GUI and exporter HIDs
+and buildins are compiled into the executable. Later on
+<p>
+The <i>GPMI hid</i> is an <i>optional plugin</i> that, by compile-time choice
+of the user, can be:
+<ul>
+ <li> left out all-together - pcb-rnd does not have scripting
+ <li> compiled as a plugin - when the .so (or .dll) is put in the right directory, pcb-rnd loads it during startup and has scripting
+ <li> compiled as buildin - becomes part of the pcb-rnd executable so that scripting is always available
+</ul>
+
+<H3> 1.2. Actions, menus, exporters </h2>
+The core implements actions. An action is a command with custom arguments,
+e.g. Delete(Selected). These actions are the commands on the default command
+line in pcb-rnd. In batch mode the command language uses these actions as well.
+Remote controlling pcb-rnd using the --listen switch will read these actions
+on the standard input.
+<p>
+GUI menus are configured to execute actions too. This also means it is impossible
+to realize an user-accessible functionality that can be triggered from
+the GUI command line, menu or batch input without making it an action.
+<p>
+The only exception, where new functionality is not behind a new action is
+exporters. An exporter is a structured dialog box of options and a set of
+callback functions implementing a drawing API. Exporting works by the following
+steps:
+<ol>
+ <li> An exporter HID may register one or more exporters.
+ <li> When the user tries to export the design, pcb-rnd lists all
+ registered exporters.
+ <li> The user chooses one, and the preconfigured dialog box
+ with the selected exporter's options are popped up.
+ <li> pcb-rnd core runs the dialog and saves the results if the user
+ clicked on the ok button.
+ <li> pcb-rnd starts the exporting process: it calls the callbacks
+ to draw the design layer by layer, object by object.
+</ol>
+
+<H3> 1.3. How a script can interact with the user </h2>
+<ul>
+ <li> The script may register <i>actions</i> - these actions are instantly accessible from the GUI command line, on stdin with --listen and in batch mode
+ <li> The script may <i>create menus</i> and bind them to actions - when the menu is selected, the action is executed
+ <li> The script may <i>bind to events</i> that will be generated asynchronously by pcb-rnd - when such an event is received, the script executes some code
+ <li> The script may <i>register new exporter(s)</i> - the user will be able to export the design using the script
+ <li> The script may run arbitrary code <i>"on load"</i> (when the script is loaded) - however, that time the design or even the GUI may not be loaded/initialized yet - this is useful for registering actions, bind to events or set up exporters
+</ul>
+
+
+<H2> 2. GPMI intro </H2>
+
+<H3> 2.1. GPMI's place in the pcb-rnd world </H3>
+<table border=0 width="100%"><tr><td valign=top>
+GPMI is a plugin/buildin HID. Instead of doing actual work, it loads scripts
+and provides a glue layer between pcb-rnd and the scripts. The actual work
+is performed by the scripts.
+The glue layer comes in two kinds:
+<ul>
+ <li> gpmi module: dynamic lib written in C, knows how to load and interpret a script and how to deliver events to the script
+ <li> gpmi package: dynamic lib, provides C functions the script can directly call; package functions then know how to deal with PCB internals
+</ul>
+Arrows drawn with dashed line represents a slow, <i>string based communication</i>.
+<td><img src="gpmi_flow.png"></table>
+
+<H3> 2.2. Module, script, script context, packages </H3>
+<table border=0 width="100%"><tr><td valign=top>
+Each time a script needs to be loaded, first a module is loaded and the name
+of the script is passed to the module. During module initialization, the module
+sets up a script interpreter and script context and loads the script into the
+context.
+<p>
+If there are 3 separate lua scripts running in pcb-rnd, there are 3 separate
+lua modules loaded, each dealing with one of the scripts. The process of
+loading a script is illustrated by highlighting the relevant paths with red
+for step 1 and green for step 2.
+<p>
+Step 0: the <b>GPMI HID</b> finds a script has to be loaded. The idea comes
+from the config file (pcb-rnd-gpmi.conf) or from the GUI (manage scripts)
+or as a request from a script already loaded.
+<p>
+Step 1: the <b>GPMI HID</b> loads the corresponding module which in turns
+loads the script. The script has a "main" part that is run on load. For
+most languages this is the global code sections; in some languages it is
+a specific function, usually called main. A few basic glue packages
+are already loaded before the script.
+<p>
+Step 2: the <b>script</b> can load glue packages. This usually happens
+from the on-load main part from the script. The actual mechanism is to
+call PkgLoad() from a glue package that was automatically loaded in
+Step 1. The green arrows represent this path: the script executes PkgLoad()
+which in turns loads other package(s) into the GPMI hid.
+<p>
+Packages are loaded only once and are globally accessible for multiple modules.
+<td><img src="gpmi_flow_load.png"></table>
+
+<H3> 2.3. Binding events, registering actions, creating menus </H3>
+<table border=0 width="100%"><tr><td valign=top>
+Binding an event in a script is done by calling the Bind() function
+(this is implemented in a package automatically loaded). The first
+argument is the name of the event, the second argument is the name of
+the script function that should be called when the event is triggered. Both
+arguments are strings. The event binding mechanism is shown in red in the
+map to the right.
+<p>
+The script can create new actions using the action_register() function
+(the actions package needs to be loaded first). A script may register multiple
+actions. This call is marked with green in the above map.
+If any of the actions registered by the script is called, the event "ACTE_action"
+is generated. This has two implications:
+<ul>
+ <li> a script that registers actions needs to bind the ACTE_action event to serve the action requests
+ <li> if a script registers multiple actions, in the event handler it needs to check which action triggered the event (e.g. with a switch()-like construction on the event name)
+</ul>
+<td><img src="gpmi_flow_reg.png"></table>
+
+<table border=0 width="100%"><tr><td valign=top>
+Menus are created using the create_menu() call. <b>Menus can be
+created only when the GUI is already set up - this may happen only
+after some of the scripts are already loaded</b>. Thus scripts shall
+create menus from an event handler bound to the ACTE_gui_init event.
+This event is triggered right after the GUI has been set up.
+On the map to the right the red arrows represent the path of ACTE_gui_init;
+the green arrows represent the reaction of the script, creating the new
+menu.
+<p>
+<td><img src="gpmi_flow_menu.png"></table>
+
+<H3> 2.4. Exporting </H3>
+<table border=0 width="100%"><tr><td valign=top>
+Exporter scripts first have to set up an exporter hid. This typically
+happens from their on-load main part. Related calls are in the hid
+package. The following map shows this process with red arrows:
+<p>
+When the user chooses to use the exporter, among the green arrows,
+a series of events are triggered and the script can generate output
+directly to a file from event handlers bound to these exporting events.
+<td><img src="gpmi_flow_exp.png"></table>
+
+<H3> 2.5. Making modifications on the design </H3>
+The purpose of a script might be to manipulate the objects in the current design.
+Such a script registers actions, and implements the handler of the actions
+using the layout package. The layout package provides calls to query,
+change and create design objects.
+
+
+<H2> 3. How it works in practice </H2>
+
+<H3> 3.1. Loading the GPMI plugin </H3>
+Check the output of ./configure, it will tell if gpmi is compiled as buildin
+or plugin (or not at all).
+If the gpmi plugin is compiled as a buildin, it is already loaded, no
+further steps are required.
+<p>
+If gpmi is a plugin, gpmi_plugin.so (or gpmi_plugin.dll) needs to be
+copied in one of the plugin directories pcb-rnd is looking into on startup:
+<table border=1>
+ <tr><th> path <th> purpose
+ <tr><td>
+ <tr><td>$prefix/lib/pcb-rnd/plugins/$arch/ <td> system plugins, multihost
+ <tr><td>$prefix/lib/pcb-rnd/plugins/ <td> system plugins
+ <tr><td>~/.pcb/plugins/$arch/ <td> user plugins, multihost
+ <tr><td>~/.pcb/plugins/ <td> user plugins
+ <tr><td>./plugins/$arch/ <td> project plugins, multihost
+ <tr><td>./plugins/ <td> project plugins
+</table>
+In the above table:
+<ul>
+ <li> $prefix is the installation prefix (normally /usr)
+ <li> $arch is the host arch triplet, e.g. i386-unknown-linux; this is useful if multiple architectures share the same NFS mounted plugin dir
+ <li> ~ is the user home directory, if exists, e.g. /home/jdoe
+ <li> ./ is the current working directory pcb has been started from; may be useful for project-local scripts
+</ul>
+
+<H3> 3.2. Loading scripts </H3>
+The gpmi plugin looks for a file called "pcb-rnd-gpmi.conf" in each of the
+plugin directories. Wherever the file is found, it is loaded and parsed.
+The file is plain text, each line describes a script to be loaded. Empty
+lines and lines starting with # are comments and are ignored.
+<p>
+Script load lines contain two words separated by a space: a module name
+and a script name. Relative paths in the the script name are relative to
+the directory the config file is found in.
+<p>
+Example config:
+<pre>
+# load the carc script (written in lua) from next to the config file:
+lua carc.lua
+
+# load foo.awk, which is a mawk script, from its installation path
+mawk /usr/lib/foo/foo.awk
+</pre>
diff --git a/doc-rnd/gpmi/util/Makefile b/doc/user/06_feature/gpmi/util/Makefile
similarity index 100%
rename from doc-rnd/gpmi/util/Makefile
rename to doc/user/06_feature/gpmi/util/Makefile
diff --git a/doc-rnd/gpmi/util/rosetta_genpages.sh b/doc/user/06_feature/gpmi/util/rosetta_genpages.sh
similarity index 100%
rename from doc-rnd/gpmi/util/rosetta_genpages.sh
rename to doc/user/06_feature/gpmi/util/rosetta_genpages.sh
diff --git a/doc-rnd/gpmi/util/tags b/doc/user/06_feature/gpmi/util/tags
similarity index 100%
rename from doc-rnd/gpmi/util/tags
rename to doc/user/06_feature/gpmi/util/tags
diff --git a/doc/user/06_feature/query/tutor_cli.html b/doc/user/06_feature/query/tutor_cli.html
new file mode 100644
index 0000000..8ebb400
--- /dev/null
+++ b/doc/user/06_feature/query/tutor_cli.html
@@ -0,0 +1,168 @@
+<html>
+<body>
+
+<H1> advanced search, command line tutorial: query language </H1>
+
+<h2> scope </h2>
+
+pcb-rnd from version 1.1.3 features a flexible advanced search that helps
+the user selecting/unselecting objects that match a given logical expression.
+The core of the feature is the pcb-rnd query language. The same language
+is used in the programmable DRC (see also: <a href="../../../developer/ddrc/proposal1.txt">
+a more formal description of the language</a>).
+<p>
+The current document is a walk through of the practical aspects of the
+language. It starts with the simplest examples while working towards more
+complex cases.
+<p>
+A limited version of the functionality is accessible through a GUI
+wizard when using the GTK HID. A <a href="tutor_gtk.html">separate
+tutorial</a> is dealing with that feature.
+
+<h2> Actions </h2>
+The query(act, expr) action creates the list called "@", which contains all
+objects of the design. Then it iterates over this list (if needed) and
+evaluates the query expression on each object. For each evaluation "act"
+is performed; "act" is one of:
+<ul>
+ <li> select - add the matching object to the selections if expr evaluated to true
+ <li> unselect - remove the matching object from the selections if expr evaluated to true
+ <li> eval - print the result of the expression to stdout
+ <li> dump - this inhibits evaluating; it compiles the expression and dumps the parse tree (useful for debugging)
+</ul>
+<p>
+The symbol @ in the query represents the iterator, or in other words,
+the <i>current object</i> we are checking. The engine iterates over all
+copper objects, silk objects, pins, holes, layers and nets. A simple query
+that selects all objects looks like this:
+<pre>
+query(select, '@')
+</pre>
+The actual query expression was a single @ in this case. This made
+the iteration happen, got the expression evaluated one each object. The
+result of each evaluation was the given object. Since these objects
+were all existing, valid objects, they were taken as logical value TRUE,
+thus for each the add-to-selection was performed.
+<p>
+Note: it's usually a good idea to write the expression in single quotes, because
+it may contain commas, double quotes and parenthesis that pcb-rnd's action parser may
+take as action syntax.
+<p>
+The same expression can ran with eval would print the result of each
+evaluation:
+<pre>
+query(eval, '@')
+</pre>
+This is visible on the terminal pcb-rnd was started from - on X, it's a good
+idea to start a terminal and run pcb-rnd from that instead from a menu or
+icon. The rest of this tutorial will use the eval query because it's easier
+to include the result of an eval than of a selection. Most examples will
+specify the query expression only, without quotes - the reader should
+add the <i>query(eval, ' ')</i> part.
+
+<H2> iteration vs. evaluate once </h2>
+If an expression does not reference the @ object, no iteration is performed
+and the expression is ran only once:
+<pre>
+query(eval, '1')
+</pre>
+This will calculate the value of 1 and prints it to the standard output. Since
+there's no iteration, this can not result in changes in selection. However,
+it makes it easy to demonstrate some basic concepts of the query language.
+<p>
+Note: if @ is present multiple times in the expression, it's still only
+one loop over all objects. When evaluating the expression for a given object,
+all instances of @ are substituted with the same object in that iteration.
+
+
+<H2> grammar: arithmetics and logics </h2>
+For example the integer and floating point numbers and the usual
+arithmetic and logical operators work as expected:
+
+<table border=1>
+ <tr><th>expression <th> result <th> explanation
+ <tr><td>42 <td> 42 <td> the integer value 42
+ <tr><td>3.14 <td> 3.14 <td> the floating point value 3.14
+ <tr><td>10 mil <td> 254000 <td> a number with a unit suffix is converted to pcb-rnd's internal coordinate unit (nanometers)
+ <tr><td>1+2 <td> 3 <td> sum of 1 and 2
+ <tr><td>2*4 <td> 8 <td> multiplication
+ <tr><td>47/4 <td> 11 <td> <i>integer</i> division (because both operands were integers)
+ <tr><td>47/4.0 <td> 11.75 <td> <i>floating point</i> division (because at least one of the operands was a float)
+ <tr><td>(1+2)*5 <td> 15 <td> parenthesis works as usual
+ <tr><td>1 && 0<td> 0 <td> logical AND - the result is 1 if both operands were TRUE, 0 else
+ <tr><td>1 || 0 <td> 1 <td> logical OR - the result is 1 if either operand was TRUE, 0 else
+ <tr><td>!2 <td> 0 <td> logical NOT - 2 is non-zero, so it is TRUE, negate this to get the result (FALSE, which is 0)
+ <tr><td>4 > 2 <td> 1 <td> because four is greater than two; all the usual relational operators work: == is equal, != is not-equal, <, <=, > and >=.
+</table>
+
+<H2> grammar: object properties </h2>
+Object have named properties, e.g. the thickness of a line (or arc, or
+trace in general) is called <i>".thickness"</i>, so the thickness of
+the current object is:
+<pre>
+ @.thickness
+</pre>
+<p>
+Next, we can already select all traces thicker than 10 mil:
+<pre>
+ query(select, '@.thickness > 10 mil')
+</pre>
+<p>
+Because logical expressions are available, it's easy to select all medium-thick
+lines:
+<pre>
+ (@.thickness >= 10 mil) && (@.thickness <= 30 mil)
+</pre>
+<p>
+or any trace that's too thin or too thick:
+<pre>
+ (@.thickness < 10 mil) || (@.thickness > 30 mil)
+</pre>
+<p>
+or traces that don't match our preferred 8, 10 and 15 mil thickness values:
+<pre>
+ (@.thickness != 8 mil) && (@.thickness != 10 mil) && (@.thickness != 15 mil)
+</pre>
+
+<H2> grammar: invalid value </h2>
+But how comes an expression like '@.thickness > 10 mil' works while
+@ iterates over non-trace objects, like layers, nets or elements that
+clearly have no thickness?
+<p>
+The answer is the <i>invalid value</i>, which is neither true nor false. If
+a property does not exist in a given object, the result is the <i>invalid value</i>
+or <i>invalid</i> for short. The invalid is treated specially:
+<ul>
+ <li> in arithmetic operations it propagates: if either operand is invalid, the result is invalid, e.g. 1+invalid = invalid; this affects +, -, *, / and all the relational operators
+ <li> in binary logic operations (&& and ||), it is ignored: it is assumed to be true in a && and false in a || so the outcome depends on the other operand
+ <li> in logical NOT (!), TODO
+</ul>
+When @ refers to a non-trace object, @.thickness is invalid and
+'@.thickness > 10 mil' is evaluated t invalid. If the result is not TRUE,
+the requested action is not performed.
+<p>
+The invalid value is generated only when the expression is valid but the
+actual object doesn't have the feature needed. If the expression is wrong,
+an error is generated and the expression stops evaluating immediately.
+
+<H2> grammar: more properties </h2>
+Some properties are a single numeric value, like thickness, or the
+<i>.name</i> of a layer (which is a string) but others are objects. For
+example the <i>.layer</i> property of a line or arc refers to the layer
+object the given line or arc is drawn on. These in turn can be combined,
+and the "name of the layer the current object is on":
+<pre>
+ @.layer.name
+</pre>
+<p>
+Referencing non-existing properties yields an error, e.g. @.thickness.layer
+is an error - in contrast with @.layer, which may evaluate to the
+<i>invalid value</i> (e.g. for vias or nets, because they don't have layers).
+The difference is that thickness can not have a layer ever (thus is an error)
+while @.layer is either applicable or not, but potentially could work, this
+when it doesn't, it's only an invalid value.
+<p>
+Further useful property combinations:
+TODO
+<p>
+There is a <a href="props.html">full list of all properties</a>.
diff --git a/doc/user/08_util/01_gsch2pcb-rnd.htm b/doc/user/08_util/01_gsch2pcb-rnd.htm
new file mode 100644
index 0000000..00fb9b6
--- /dev/null
+++ b/doc/user/08_util/01_gsch2pcb-rnd.htm
@@ -0,0 +1,50 @@
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <link rel="stylesheet" type="text/css" href="../default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> 2. Utilities </h2>
+<p>
+<h2> 2.1. gsch2pcb-rnd </h2>
+<p>
+Gsch2pcb-rnd is a standalone utility that can extract netlists and
+element data from a schematics produced by gschem. Thus it is a glue
+between gschem and pcb-rnd, doing <i>forward annotation</i>. It is ideal
+for automating the design process as it can be easily called from
+Makefiles, shell scripts or other programs/scripts, whereas the
+"import schematics" feautre (import_sch plugin) is more geared for the
+GUI user.
+<p>
+Multiple <i>methods</i> of operation are offered - the user can select
+one of these by name, using the -m command line argument (e.g.
+<i>gsch2pcb-rnd -m importsep foo.sch</i>):
+<table border="1">
+ <tr>
+ <td> method name
+ <td> description
+ <tr>
+ <td> pcb
+ <td> The classic approach: load the existing extract elements from
+ the .sch file, load the .pcb file, compare element lists, load
+ footprint libraries and create .new.pcb and .net and .cmd and let
+ the user handle the rest. Does <b>not</b> work with anything else
+ than the .pcb format. This method is <b>deprecated</b> and is
+ provided only for compatibility with some old workflows.
+ <tr>
+ <td> import
+ <td> Runs the same gnetlist backend as the import_sch plugin. A single
+ action command file generated with .cmd suffix. When executed
+ (using action <i>ExcuteFile(foo.cmd)</i>), it syncs (replaces/creates)
+ every element and sets up all nets. Pro: single-command import.
+ Con: can't load netlist only or elements only.
+ <tr>
+ <td> importsep
+ <td> Similar to import, but produces two files: a .cmd file with element
+ updates only (can be appled the same way as import's) and a
+ separate .net netlist file that can be imported the same way as the
+ .net of the pcb method. Pro: the user can update elements-only or
+ nets-only. Con: requires two user actions to get a full impoty.
+</table>
diff --git a/doc-rnd/misc/install_cgi.html b/doc/user/08_util/install_cgi.html
similarity index 100%
rename from doc-rnd/misc/install_cgi.html
rename to doc/user/08_util/install_cgi.html
diff --git a/doc/user/default.css b/doc/user/default.css
new file mode 100644
index 0000000..b17538d
--- /dev/null
+++ b/doc/user/default.css
@@ -0,0 +1,40 @@
+h1 {
+ border-bottom-style: solid;
+ border-bottom-width: 3px;
+}
+
+h2 {
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+}
+
+p {
+ text-align: justify;
+ margin-left: 20px;
+}
+
+table {
+ border-collapse: collapse;
+ border: 2px solid #555555;
+}
+
+td {
+ border: 1px solid #777777;
+ padding: 5px;
+}
+
+th {
+ border: 1px solid #777777;
+ background-color: #e0e0e0;
+ padding: 5px;
+}
+
+ul.toc {
+ list-style-type: none;
+ padding: 20px;
+}
+
+ul.toc li {
+ padding: 5px;
+ font-size: 120%;
+}
diff --git a/doc/user/index.html b/doc/user/index.html
new file mode 100644
index 0000000..a6b30fb
--- /dev/null
+++ b/doc/user/index.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title> pcb-rnd user manual </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
+ <link rel="stylesheet" type="text/css" href="default.css">
+</head>
+<body>
+<h1> pcb-rnd - user manual </h1>
+
+<h2> Table of Contents </h2>
+<p>
+<ul class="toc">
+ <li><a href="01_intro/index.html"> 1. Introduction </a>
+ <li><a href="02_model/index.html"> 2. Model of the world </a>
+ <li><a href="03_data/"> 3. Where data is stored </a>
+ <li><a href="04_invoc/index.html"> 4. Program Invocation </a>
+ <li><a href="05_ui/index.html"> 5. Graphical and Batch User Interfaces </a>
+ <li><a href="06_feature/"> 6. Feature plugins </a>
+ <li><a href="07_io/"> 7. File formats </a>
+ <li><a href="08_util/"> 8. Utilities </a>
+ <li><a href="09_appendix/">9. Appendix </a>
+</ul>
+
diff --git a/doc-rnd/windows.txt b/doc/windows.txt
similarity index 100%
rename from doc-rnd/windows.txt
rename to doc/windows.txt
diff --git a/doc/wishlist.txt b/doc/wishlist.txt
new file mode 100644
index 0000000..94fcf8d
--- /dev/null
+++ b/doc/wishlist.txt
@@ -0,0 +1,34 @@
+Active user wishes:
+ W1: cschem [Chris]
+ W2: (BLOCKED: lihata testing) proper primitives [Chris]
+ W3: (BLOCKED: lihata testing) more generic footprints [Chris, Evan]
+ W4: user doc [Miloh]
+ W5: (BLOCKED: lihata testing) 3d modeller export [Miloh, Evan]
+ W7: (BLOCKED: lihata testing) programmable drc (star grounding) [James]
+ W8: (BLOCKED: need resources) gl support [Erich, Evan]
+ W9: push & shove [Erich, Evan]
+
+User wishes fulfilled:
+ W6: GUI access to object attributes: gtk editor, find/select by attrib [James]
+
+Plan (parallel threads of development):
+
+ A. file format and model
+ Steps:
+ 1. (done) lihata persistency
+ 2. (done) native lihata file format
+ 3. (done) extend the file format
+ - everything should have an attribute hash -> W6
+ - footprints should have optional attachments (e.g. 3d models) -> W5
+ This helps us testing out the persistent-lihata idea that'd be
+ later used in cschem from the start -> W1
+ This is also needed for more generic footprint implementation -> W3
+
+ B. visible attribute support
+ Steps:
+ 1. (done) GTK dialog box for attribute edition
+ 2. (done) search & select should work by attribute
+ 3. (done) extend the routing style system to auto-add attributes
+ (this needs A., the new file format)
+ Allows the user to manage properties like "50 ohm net" in attributes,
+ to group objects by property, and to select them by property. -> W6
diff --git a/pcblib/Makefile b/pcblib/Makefile
index a850c03..eb72121 100644
--- a/pcblib/Makefile
+++ b/pcblib/Makefile
@@ -16,12 +16,12 @@ install_:
$(CPC) "`pwd`/tru-hole"/* "$(DATADIR)/pcblib/tru-hole"
install:
- make install_ CPC="$(CP)"
+ $(MAKE) install_ CPC="$(CP)"
# hack: pcb's chdir() based approach gets fooled on symlinks because of "cd .."
# returns to the wrong dir - rather symlink the whole dir
linstall:
- make uninstall
+ $(MAKE) uninstall
$(MKDIR) "$(DATADIR)"
$(LN) "`pwd`" "$(DATADIR)/pcblib"
diff --git a/pcblib/parametric/common.awk b/pcblib/parametric/common.awk
index 8578a94..5e87a58 100644
--- a/pcblib/parametric/common.awk
+++ b/pcblib/parametric/common.awk
@@ -176,6 +176,15 @@ function element_pad_rectangle(x1, y1, x2, y2, number, flags, clearance, mas
}
}
+# draw a matrix of pads; top-left corner is x1;y1, there are nx*ny pads
+# of w*h size. rows/cols of pads are drawn with ox and oy offset
+function element_pad_matrix(x1, y1, nx, ny, w, h, ox, oy, number, flags, clearance, mask, name, ix,iy)
+{
+ for(iy = 0; iy < ny; iy++)
+ for(ix = 0; ix < nx; ix++)
+ element_pad_rectangle(x1+ix*ox, y1+iy*oy, x1+ix*ox+w, y1+iy*oy+h, number, flags, clearance, mask, name)
+}
+
# draw element pad circle
function element_pad_circle(x1, y1, radius, number, clearance, mask, name)
{
diff --git a/pcblib/parametric/qf b/pcblib/parametric/qf
index d358492..003ff5f 100755
--- a/pcblib/parametric/qf
+++ b/pcblib/parametric/qf
@@ -62,6 +62,33 @@
#@@optional:cpad_height
#@@default:cpad_height false, no central pad
+#@@param:cpm_nx central pad paste matrix, number of paste pads in x direction
+#@@optional:cpm_nx
+#@@default:cpm_nx 2
+
+#@@param:cpm_ny central pad paste matrix, number of paste pads in y direction
+#@@optional:cpm_ny
+#@@default:cpm_ny 2
+
+#@@param:cpm_width central pad paste matrix, paste pad width (dimension of each paste rectangle)
+#@@dim:cpm_width
+#@@optional:cpm_width
+#@@default:cpm_width 1mm
+
+#@@param:cpm_height central pad paste matrix, paste pad height (dimension of each paste rectangle)
+#@@dim:cpm_height
+#@@optional:cpm_height
+#@@default:cpm_height 1mm
+
+#@@param:cpad_mask center pad mask; if not specified, use the same gap as for the rows (pad_mask)
+#@@dim:cpad_mask
+#@@optional:cpad_mask
+
+#@@param:rpad_round when true, row pads are round
+#@@bool:rpad_round
+#@@optional:rpad_round
+#@@default:rpad_round false, row pads are square
+
#@@param:bodysilk how to draw body on the silk layer
#@@enum:bodysilk:none no drawing
#@@enum:bodysilk:corners draw the corners, silkmark is outside of the top-left corner
diff --git a/pcblib/parametric/qf.awk b/pcblib/parametric/qf.awk
index 0382345..a088793 100644
--- a/pcblib/parametric/qf.awk
+++ b/pcblib/parametric/qf.awk
@@ -1,5 +1,7 @@
function qf_globals(pre_args, post_args ,reqs)
{
+ DEFAULT["cpad_mask", "dim"] = 1
+
if (hook_spc_conv == "")
hook_spc_conv = 1.8
if (hook_cpad_mult == "")
@@ -12,6 +14,10 @@ function qf_globals(pre_args, post_args ,reqs)
set_arg(P, "?pad_thickness", "0.3mm")
set_arg(P, "?silkmark", "dot")
set_arg(P, "?line_thickness", "0.1mm")
+ set_arg(P, "?cpm_width", "1mm")
+ set_arg(P, "?cpm_height", "1mm")
+ set_arg(P, "?cpm_nx", "2")
+ set_arg(P, "?cpm_ny", "2")
}
reqs = "nx,ny"
@@ -25,7 +31,7 @@ function qf_globals(pre_args, post_args ,reqs)
if ((pre_args != "") && (!(pre_args ~ ",$")))
pre_args = pre_args ","
- proc_args(P, pre_args "nx,ny,x_spacing,y_spacing,pad_spacing,ext_bloat,int_bloat,width,height,cpad_width,cpad_height,cpad_auto,bodysilk,pinoffs,silkmark" post_args, reqs)
+ proc_args(P, pre_args "nx,ny,x_spacing,y_spacing,pad_spacing,ext_bloat,int_bloat,width,height,cpad_width,cpad_height,cpad_auto,cpm_nx,cpm_ny,cpm_width,cpm_height,cpad_mask,rpad_round,bodysilk,pinoffs,silkmark" post_args, reqs)
nx = int(P["nx"])
ny = int(P["ny"])
@@ -54,6 +60,12 @@ function qf_globals(pre_args, post_args ,reqs)
cpad_width=parse_dim(P["cpad_width"])
cpad_height=parse_dim(P["cpad_height"])
+ if (P["cpad_mask"] == "")
+ cpad_mask = (cpad_width > cpad_height ? cpad_width : cpad_height) + either(parse_dim(P["pad_mask"]), DEFAULT["pad_mask"])
+ else
+ cpad_mask=parse_dim(P["cpad_mask"])
+
+
if (tobool(P["cpad_auto"]) || hook_cpad_auto) {
if (cpad_width == "")
cpad_width = (x_spacing*0.85 - int_bloat*2 - pt) * hook_cpad_mult
@@ -68,6 +80,17 @@ function qf_globals(pre_args, post_args ,reqs)
height = y_spacing
pinmax=(nx+ny)*2
+
+ if (!tobool(P["rpad_round"]))
+ rpad_round = "square"
+ else
+ rpad_round = ""
+
+
+ cpm_width = parse_dim(P["cpm_width"])
+ cpm_height = parse_dim(P["cpm_height"])
+ cpm_nx = int(P["cpm_nx"])
+ cpm_ny = int(P["cpm_ny"])
}
function pinnum(num)
@@ -88,8 +111,8 @@ BEGIN {
y = (-cy + n) * pad_spacing
x1 = -x_spacing/2
x2 = x_spacing/2
- element_pad(x1-ext_bloat, y, x1+int_bloat, y, pad_width, pinnum(n), "square")
- element_pad(x2-int_bloat, y, x2+ext_bloat, y, pad_width, pinnum(nx+2*ny-n+1), "square")
+ element_pad(x1-ext_bloat, y, x1+int_bloat, y, pad_width, pinnum(n), rpad_round)
+ element_pad(x2-int_bloat, y, x2+ext_bloat, y, pad_width, pinnum(nx+2*ny-n+1), rpad_round)
if (n == 1)
y1 = y
if (n == 2)
@@ -102,13 +125,24 @@ BEGIN {
x = (-cx + n) * pad_spacing
y1 = -y_spacing/2
y2 = y_spacing/2
- element_pad(x, y1-ext_bloat, x, y1+int_bloat, pad_width, pinnum(nx*2+ny*2-n+1), "square")
- element_pad(x, y2-int_bloat, x, y2+ext_bloat, pad_width, pinnum(n+ny), "square")
+ element_pad(x, y1-ext_bloat, x, y1+int_bloat, pad_width, pinnum(nx*2+ny*2-n+1), rpad_round)
+ element_pad(x, y2-int_bloat, x, y2+ext_bloat, pad_width, pinnum(n+ny), rpad_round)
}
if ((cpad_width != "") && (cpad_height != "")) {
- element_pad_rectangle(-cpad_width/2, -cpad_height/2, +cpad_width/2, +cpad_height/2, 2*nx+2*ny+1, "square")
+# center pad paste matrix
+ if ((cpm_nx > 0) && (cpm_ny > 0)) {
+ ox = (cpad_width - (cpm_nx*cpm_width)) / (cpm_nx - 1)
+ oy = (cpad_height - (cpm_ny*cpm_height)) / (cpm_ny - 1)
+ element_pad_matrix(-cpad_width/2, -cpad_height/2, cpm_nx,cpm_ny, cpm_width,cpm_height, ox+cpm_width,oy+cpm_height, 2*nx+2*ny+1, "square,nopaste")
+ }
+
+# center pad
+ tmp = DEFAULT["pad_mask"]
+ DEFAULT["pad_mask"] = cpad_mask
+ element_pad_rectangle(-cpad_width/2, -cpad_height/2, +cpad_width/2, +cpad_height/2, 2*nx+2*ny+1, "square,nopaste")
+ DEFAULT["pad_mask"] = tmp
dimension(-cpad_width/2, -cpad_height/2, +cpad_width/2, -cpad_height/2, "@0;" (height * -0.6-ext_bloat), "cpad_width")
dimension(cpad_width/2, -cpad_height/2, cpad_width/2, +cpad_height/2, "@" (width * 0.8+ext_bloat) ";0", "cpad_height")
}
diff --git a/pcblib/parametric/qfn.awk b/pcblib/parametric/qfn.awk
index 48f0b34..6ad1c1d 100644
--- a/pcblib/parametric/qfn.awk
+++ b/pcblib/parametric/qfn.awk
@@ -22,7 +22,7 @@ BEGIN {
pt = PT[pitch]
}
else
- pt = rev_mm(DEFAULT["pad_thickness"])
+ pt = rev_mm(DEFAULT["pad_thickness"]) "mm"
split(P["size"], S, "x")
if (S[2] == "")
diff --git a/pcblib/parametric/qfp.awk b/pcblib/parametric/qfp.awk
index 1ffcfb2..a055456 100644
--- a/pcblib/parametric/qfp.awk
+++ b/pcblib/parametric/qfp.awk
@@ -23,7 +23,7 @@ BEGIN {
pt = PT[pitch]
}
else
- pt = rev_mm(DEFAULT["pad_thickness"])
+ pt = rev_mm(DEFAULT["pad_thickness"]) "mm"
split(P["size"], S, "x")
if (S[2] == "")
diff --git a/scconfig/Makefile b/scconfig/Makefile
index b897d73..2c9c2b7 100644
--- a/scconfig/Makefile
+++ b/scconfig/Makefile
@@ -93,5 +93,8 @@ src/util/arg_auto_set.o: src/util/arg_auto_set.c src/util/arg_auto_set.h
cquote: cquote.c
clean:
- rm $(OBJS) $(DEFAULT_MAIN_OBJS) configure revtest revtest.o
+ -rm $(OBJS) $(DEFAULT_MAIN_OBJS) configure revtest revtest.o cquote core
+distclean:
+ -rm ../config.h ../Makefile.conf ../src/Makefile ../util/gsch2pcb-rnd/Makefile ../src_3rd/gts/Makefile config.cache config.log Rev.stamp
+ -$(MAKE) clean
diff --git a/scconfig/Rev.h b/scconfig/Rev.h
index 62b415a..33dd21f 100644
--- a/scconfig/Rev.h
+++ b/scconfig/Rev.h
@@ -1 +1 @@
-static const int myrev = 4450;
+static const int myrev = 5611;
diff --git a/scconfig/Rev.tab b/scconfig/Rev.tab
index 1d9b81a..92761ca 100644
--- a/scconfig/Rev.tab
+++ b/scconfig/Rev.tab
@@ -1,3 +1,17 @@
+5611 configure new feature: UI layer
+5487 configure layer cleanup: layer visibility in a new source file
+5472 configure draw_fab config subtree
+5278 configure prepare for arc UI extension: blank arc_ui.[ch] to move arc UI logics into
+5256 configure move rubberband code into a plugin
+5199 configure new export plugin: export_stat
+5108 configure cleanup: remove old pointer list and use genvt
+5019 configure unravel - remove set.[ch]
+4616 configure unravel - the big cleanup, moving code
+4904 make clean,configure unravel2 - regenerate action registration because regiestrator function name changed
+4882 configure unravel2 - the big cleanup, renaming types
+4608 configure unravel - the big cleanup, moving code and files
+4588 configure disable bison by default
+4587 configure draw_fab moved to a plugin
4450 configure io_lihata plugin config and 3rd party lib dependency fix
4398 configure io_kicad plugin interdeps and enable io_kicad by default
4375 configure custom output style support in io_lihata
diff --git a/scconfig/gen_core_lists.sh b/scconfig/gen_core_lists.sh
index 3062f3d..85ebd0b 100755
--- a/scconfig/gen_core_lists.sh
+++ b/scconfig/gen_core_lists.sh
@@ -32,7 +32,7 @@ BEGIN {
}
-/^REGISTER/ {
+/^PCB_REGISTER/ {
LIST[basename] = LIST[basename] $0 "\n"
}
@@ -48,7 +48,7 @@ END {
print "if ((gui != NULL) && (strcmp(gui->name, " q hn q ") == 0)) {"
if (TYPE[n] == "plugdir") {
vname = LIST[n]
- sub("REGISTER_ACTIONS.*[(]", "", vname)
+ sub("PCB_REGISTER_ACTIONS.*[(]", "", vname)
sub("[)].*[\\n\\r]*", "", vname)
print "extern HID_Action " vname "[];"
}
diff --git a/scconfig/hooks.c b/scconfig/hooks.c
index 3b739e1..7daa631 100644
--- a/scconfig/hooks.c
+++ b/scconfig/hooks.c
@@ -10,7 +10,7 @@
#include "util/arg_auto_set.h"
#include "Rev.h"
-#define version "1.1.4"
+#define version "1.2.0"
#include "plugin_3state.h"
@@ -20,10 +20,11 @@ const arg_auto_set_t disable_libs[] = { /* list of --disable-LIBs and the subtre
{"disable-xrender", "libs/gui/xrender", arg_lib_nodes, "$do not use xrender for lesstif"},
{"disable-xinerama", "libs/gui/xinerama", arg_lib_nodes, "$do not use xinerama for lesstif"},
{"disable-gd", "libs/gui/gd", arg_lib_nodes, "$do not use gd (many exporters need it)"},
- {"disable-gd-gif", "libs/gui/gd/gdImageGif", arg_lib_nodes, "$no gif support in the png exporter"},
- {"disable-gd-png", "libs/gui/gd/gdImagePng", arg_lib_nodes, "$no png support in the png exporter"},
- {"disable-gd-jpg", "libs/gui/gd/gdImageJpeg", arg_lib_nodes, "$no jpeg support in the png exporter"},
- {"disable-bison", "parsgen/bison", arg_lib_nodes, "$do not regenerate language files"},
+ {"disable-gd-gif", "libs/gui/gd/gdImageGif", arg_lib_nodes, "$no gif support in the png pcb_exporter"},
+ {"disable-gd-png", "libs/gui/gd/gdImagePng", arg_lib_nodes, "$no png support in the png pcb_exporter"},
+ {"disable-gd-jpg", "libs/gui/gd/gdImageJpeg", arg_lib_nodes, "$no jpeg support in the png pcb_exporter"},
+ {"enable-bison", "/local/pcb/want_bison", arg_true, "$enable generating language files"},
+ {"disable-bison", "/local/pcb/want_bison", arg_false, "$disable generating language files"},
{"enable-dmalloc", "/local/pcb/want_dmalloc", arg_true, "$compile with lib dmalloc"},
{"disable-dmalloc", "/local/pcb/want_dmalloc", arg_false, "$compile without lib dmalloc"},
@@ -158,7 +159,7 @@ void plugin_dep1(int require, const char *plugin, const char *deps_on)
if (strcmp(st_deps_on, sbuildin) != 0) {
sprintf(buff, "WARNING: disabling %s because the %s is not enabled as a buildin...\n", plugin, deps_on);
report_repeat(buff);
- sprintf(buff, "disable-%s", plugin);
+ sprintf(buff, "Disable-%s", plugin);
hook_custom_arg(buff, NULL);
}
}
@@ -221,6 +222,7 @@ int hook_postinit()
#define plugin_dep(plg, on)
#include "plugins.h"
+ put("/local/pcb/want_bison", sfalse);
put("/local/pcb/debug", sfalse);
put("/local/pcb/symbols", sfalse);
put("/local/pcb/coord_bits", "32");
@@ -230,6 +232,33 @@ int hook_postinit()
return 0;
}
+static int all_plugin_check_explicit(void)
+{
+ char pwanted[1024], pgot[1024];
+ const char *wanted, *got;
+ int tainted = 0;
+
+#undef plugin_def
+#undef plugin_header
+#undef plugin_dep
+#define plugin_def(name, desc, default_, all_) \
+ sprintf(pwanted, "/local/pcb/%s/explicit", name); \
+ wanted = get(pwanted); \
+ if (wanted != NULL) { \
+ sprintf(pgot, "/local/pcb/%s/controls", name); \
+ got = get(pgot); \
+ if (strcmp(got, wanted) != 0) {\
+ report("ERROR: %s was requested to be %s but I had to %s it\n", name, wanted, got); \
+ tainted = 1; \
+ } \
+ }
+#define plugin_header(sect)
+#define plugin_dep(plg, on)
+#include "plugins.h"
+ return tainted;
+}
+
+
/* Runs after all arguments are read and parsed */
int hook_postarg()
{
@@ -329,7 +358,7 @@ int hook_detect_target()
require("libs/gui/libstroke/presents", 0, 0);
if (!istrue(get("libs/gui/libstroke/presents"))) {
report_repeat("WARNING: Since there's no libstroke found, disabling the stroke plugin...\n");
- hook_custom_arg("disable-stroke", NULL);
+ hook_custom_arg("Disable-stroke", NULL);
}
}
@@ -337,7 +366,7 @@ int hook_detect_target()
require("libs/gui/gtk2/presents", 0, 0);
if (!istrue(get("libs/gui/gtk2/presents"))) {
report_repeat("WARNING: Since there's no libgtk2 found, disabling the gtk hid...\n");
- hook_custom_arg("disable-hid_gtk", NULL);
+ hook_custom_arg("Disable-hid_gtk", NULL);
}
}
@@ -349,14 +378,14 @@ int hook_detect_target()
}
else {
report_repeat("WARNING: Since there's no lesstif2 found, disabling the lesstif HID and xinerama and xrender...\n");
- hook_custom_arg("disable-xinerama", NULL);
- hook_custom_arg("disable-xrender", NULL);
- hook_custom_arg("disable-hid_lesstif", NULL);
+ hook_custom_arg("Disable-xinerama", NULL);
+ hook_custom_arg("Disable-xrender", NULL);
+ hook_custom_arg("Disable-hid_lesstif", NULL);
}
}
else {
- hook_custom_arg("disable-xinerama", NULL);
- hook_custom_arg("disable-xrender", NULL);
+ hook_custom_arg("Disable-xinerama", NULL);
+ hook_custom_arg("Disable-xrender", NULL);
}
@@ -381,19 +410,19 @@ int hook_detect_target()
if (!istrue(get("libs/sul/glib/presents"))) {
if (want_gtk) {
report_repeat("WARNING: Since GLIB is not found, disabling the GTK HID...\n");
- hook_custom_arg("disable-gtk", NULL);
+ hook_custom_arg("Disable-gtk", NULL);
}
if (plug_is_enabled("toporouter")) {
report_repeat("WARNING: Since GLIB is not found, disabling the toporouter...\n");
- hook_custom_arg("disable-toporouter", NULL);
+ hook_custom_arg("Disable-toporouter", NULL);
}
if (plug_is_enabled("puller")) {
report_repeat("WARNING: Since GLIB is not found, disabling the puller...\n");
- hook_custom_arg("disable-puller", NULL);
+ hook_custom_arg("Disable-puller", NULL);
}
if (plug_is_enabled("export_dsn")) {
- report_repeat("WARNING: Since GLIB is not found, disabling the dsn exporter...\n");
- hook_custom_arg("disable-export_dsn", NULL);
+ report_repeat("WARNING: Since GLIB is not found, disabling the dsn pcb_exporter...\n");
+ hook_custom_arg("Disable-export_dsn", NULL);
}
}
}
@@ -414,12 +443,12 @@ int hook_detect_target()
require("libs/gui/gd/presents", 0, 0);
if (!istrue(get("libs/gui/gd/presents"))) {
report_repeat("WARNING: Since there's no libgd, disabling gd based exports (png, nelma, gcode)...\n");
- hook_custom_arg("disable-gd-gif", NULL);
- hook_custom_arg("disable-gd-png", NULL);
- hook_custom_arg("disable-gd-jpg", NULL);
- hook_custom_arg("disable-export_png", NULL);
- hook_custom_arg("disable-export_nelma", NULL);
- hook_custom_arg("disable-export_gcode", NULL);
+ hook_custom_arg("Disable-gd-gif", NULL);
+ hook_custom_arg("Disable-gd-png", NULL);
+ hook_custom_arg("Disable-gd-jpg", NULL);
+ hook_custom_arg("Disable-export_png", NULL);
+ hook_custom_arg("Disable-export_nelma", NULL);
+ hook_custom_arg("Disable-export_gcode", NULL);
want_gd = 0;
goto disable_gd_formats;
}
@@ -463,17 +492,19 @@ int hook_detect_target()
}
/* yacc/lex - are we able to regenerate languages? */
- if (!isfalse(get("parsgen/bison/presents"))) {
+ if (istrue(get("/local/pcb/want_bison"))) {
require("parsgen/flex/*", 0, 0);
require("parsgen/bison/*", 0, 0);
+ if (!istrue(get("parsgen/flex/presents")) || !istrue(get("parsgen/bison/presents")))
+ put("/local/pcb/want_parsgen", sfalse);
+ else
+ put("/local/pcb/want_parsgen", strue);
}
- else
+ else {
report("Bison/flex are disabled, among with parser generation.\n");
-
- if (!istrue(get("parsgen/flex/presents")) || !istrue(get("parsgen/bison/presents")))
put("/local/pcb/want_parsgen", sfalse);
- else
- put("/local/pcb/want_parsgen", strue);
+ }
+
if (get("cc/rdynamic") == NULL)
put("cc/rdynamic", "");
@@ -494,7 +525,7 @@ int hook_detect_target()
require("libs/sul/dbus/presents", 0, 0);
if (!istrue(get("libs/sul/dbus/presents"))) {
report_repeat("WARNING: disabling the DBUS interface plugin because libdbus is not found or not configured...\n");
- hook_custom_arg("disable-dbus", NULL);
+ hook_custom_arg("Disable-dbus", NULL);
}
}
@@ -504,7 +535,7 @@ int hook_detect_target()
require("libs/script/gpmi/presents", 0, 0);
if (!istrue(get("libs/script/gpmi/presents"))) {
report_repeat("WARNING: disabling the gpmi scripting because libgpmi is not found or not configured...\n");
- hook_custom_arg("disable-gpmi", NULL);
+ hook_custom_arg("Disable-gpmi", NULL);
}
}
@@ -657,13 +688,15 @@ static void print_sum_cfg_val(const char *node, const char *desc)
int hook_generate()
{
char *rev = "non-svn", *tmp;
- int manual_config = 0, generr = 0;
+ int generr = 0;
+ int res = 0;
tmp = svn_info(0, "../src", "Revision:");
if (tmp != NULL) {
rev = str_concat("", "svn r", tmp, NULL);
free(tmp);
}
+ logprintf(0, "scconfig generate version info: version='%s' rev='%s'\n", version, rev);
put("/local/revision", rev);
put("/local/version", version);
@@ -710,6 +743,13 @@ int hook_generate()
printf("\n%s\n", repeat);
}
+ if (all_plugin_check_explicit()) {
+ printf("\nNevertheless the configuration is complete, if you accept these differences\nyou can go on compiling.\n\n");
+ res = 1;
+ }
+ else
+ printf("\nConfiguration complete, ready to compile.\n\n");
+
{
FILE *f;
f = fopen("Rev.stamp", "w");
@@ -718,10 +758,12 @@ int hook_generate()
}
}
- else
+ else {
fprintf(stderr, "Error generating some of the files\n");
+ res = 1;
+ }
- return 0;
+ return res;
}
/* Runs before everything is uninitialized */
diff --git a/scconfig/plugin_3state.h b/scconfig/plugin_3state.h
index 50c75ae..21f6eff 100644
--- a/scconfig/plugin_3state.h
+++ b/scconfig/plugin_3state.h
@@ -23,16 +23,24 @@
/* auto-set tables to change control to the desired value */
const arg_auto_set_node_t arg_disable[] = {
{"controls", sdisable},
+ {"explicit", sdisable},
+ {NULL, NULL}
+};
+
+const arg_auto_set_node_t arg_Disable[] = {
+ {"controls", sdisable},
{NULL, NULL}
};
const arg_auto_set_node_t arg_buildin[] = {
{"controls", sbuildin},
+ {"explicit", sbuildin},
{NULL, NULL}
};
const arg_auto_set_node_t arg_plugin[] = {
{"controls", splugin},
+ {"explicit", splugin},
{NULL, NULL}
};
@@ -40,6 +48,7 @@ const arg_auto_set_node_t arg_plugin[] = {
/* plugin_def implementation to create CLI args */
#define plugin3_args(name, desc) \
{"disable-" name, "/local/pcb/" name, arg_disable, "$do not compile " desc}, \
+ {"Disable-" name, "/local/pcb/" name, arg_Disable, NULL }, \
{"buildin-" name, "/local/pcb/" name, arg_buildin, "$static link " desc " into the executable"}, \
{"plugin-" name, "/local/pcb/" name, arg_plugin, "$" desc " is a dynamic loadable plugin"},
diff --git a/scconfig/plugins.h b/scconfig/plugins.h
index a3f30e8..8294393 100644
--- a/scconfig/plugins.h
+++ b/scconfig/plugins.h
@@ -10,6 +10,7 @@ plugin_def("autoroute", "the original autorouter", sbuildin, 1)
plugin_def("boardflip", "flip board objects", sdisable, 0)
plugin_def("distalign", "distribute and align objs", sbuildin, 1)
plugin_def("distaligntext", "distribute and align text", sbuildin, 1)
+plugin_def("draw_fab", "fab layer in some exports", sbuildin, 1)
plugin_def("jostle", "push lines out of the way", sbuildin, 1)
plugin_def("polycombine", "combine selected polygons", sbuildin, 1)
plugin_def("polystitch", "stitch polygon at cursor", sdisable, 0)
@@ -31,6 +32,8 @@ plugin_def("shand_cmd", "command shorthands", sbuildin, 1)
plugin_def("propedit", "object property editor", sbuildin, 1)
plugin_def("loghid", "diagnostics: log HID calls",sdisable, 1)
plugin_def("query", "query language", sbuildin, 1)
+plugin_def("acompnet", "net auto-completion", sdisable, 1)
+plugin_def("rubberband_orig", "the original rubberband", sbuildin, 1)
plugin_header("\nFootprint backends:\n")
plugin_def("fp_fs", "filesystem footprints", sbuildin, 1)
@@ -41,23 +44,25 @@ plugin_def("import_sch", "import sch", sbuildin, 1)
plugin_def("import_edif", "import edif", sbuildin, 1)
plugin_def("import_netlist", "import netlist", sbuildin, 1)
plugin_def("import_dsn", "specctra .dsn importer", sdisable, 0)
+plugin_def("import_hyp", "hyperlynx .hyp importer", sdisable, 0)
plugin_header("\nExport plugins:\n")
-plugin_def("export_gcode", "gcode exporter", sbuildin, 1)
-plugin_def("export_nelma", "nelma exporter", sbuildin, 1)
-plugin_def("export_png", "png/gif/jpg exporter", sbuildin, 1)
-plugin_def("export_bom", "bom exporter", sbuildin, 1)
-plugin_def("export_xy", "xy (centroid) exporter", sbuildin, 1)
-plugin_def("export_gerber", "gerber exporter", sbuildin, 1)
-plugin_def("export_lpr", "lpr exporter (printer)", sbuildin, 1)
-plugin_def("export_ps", "postscript exporter", sbuildin, 1)
-plugin_def("export_dxf", "DXF exporter", sdisable, 0)
-plugin_def("export_test", "dummy test exporter", sdisable, 1)
-plugin_def("export_bboard", "breadboard exporter", sdisable, 0)
-plugin_def("export_openscad", "openscad exporter", sdisable, 0)
-plugin_def("export_dsn", "specctra .dsn exporter", sdisable, 0)
-plugin_def("export_ipcd356", "IPC-D-356 Netlist exporter",sdisable, 0)
-plugin_def("export_svg", "SVG exporter", sbuildin, 1)
+plugin_def("export_gcode", "gcode pcb_exporter", sbuildin, 1)
+plugin_def("export_nelma", "nelma pcb_exporter", sbuildin, 1)
+plugin_def("export_png", "png/gif/jpg pcb_exporter", sbuildin, 1)
+plugin_def("export_bom", "bom pcb_exporter", sbuildin, 1)
+plugin_def("export_xy", "xy (centroid) pcb_exporter", sbuildin, 1)
+plugin_def("export_gerber", "gerber pcb_exporter", sbuildin, 1)
+plugin_def("export_lpr", "lpr pcb_exporter (printer)", sbuildin, 1)
+plugin_def("export_ps", "postscript pcb_exporter", sbuildin, 1)
+plugin_def("export_dxf", "DXF pcb_exporter", sdisable, 0)
+plugin_def("export_test", "dummy test pcb_exporter", sdisable, 1)
+plugin_def("export_bboard", "breadboard pcb_exporter", sdisable, 0)
+plugin_def("export_openscad", "openscad pcb_exporter", sdisable, 0)
+plugin_def("export_dsn", "specctra .dsn pcb_exporter", sdisable, 0)
+plugin_def("export_ipcd356", "IPC-D-356 Netlist pcb_exporter",sdisable, 0)
+plugin_def("export_svg", "SVG pcb_exporter", sbuildin, 1)
+plugin_def("export_stat", "exporter board statistics", sbuildin, 1)
plugin_header("\nIO plugins (file formats):\n")
plugin_def("io_lihata", "lihata board format", sbuildin, 1)
@@ -69,7 +74,7 @@ plugin_header("\nHID plugins:\n")
plugin_def("hid_batch", "batch process (no-gui HID)",sbuildin, 1)
plugin_def("hid_gtk", "the GTK gui", sbuildin, 1)
plugin_def("hid_lesstif", "the lesstif gui", sbuildin, 1)
-
+plugin_def("hid_remote", "remote HID server", sdisable, 1)
plugin_dep("export_lpr", "export_ps")
plugin_dep("export_xy", "export_bom")
@@ -77,3 +82,6 @@ plugin_dep("io_kicad", "lib_gensexpr")
/* for the uniq name lib: */
plugin_dep("io_kicad_legacy", "io_kicad")
+
+/* for drill.[ch] */
+plugin_dep("draw_fab", "report")
diff --git a/scconfig/revtest.c b/scconfig/revtest.c
index 63d37cf..0af07ce 100644
--- a/scconfig/revtest.c
+++ b/scconfig/revtest.c
@@ -23,9 +23,11 @@ int main(int argc, char *argv[])
{
char line[8192];
int res = 0, stamp = 0, banner = 0;
- FILE *f;
+ FILE *f = NULL;
- f = fopen(argv[1], "r");
+ if (argc > 1) {
+ f = fopen(argv[1], "r");
+ }
if (f != NULL) {
fscanf(f, "%d", &stamp);
fclose(f);
diff --git a/scconfig/src/default/arg.c b/scconfig/src/default/arg.c
index 7e42f56..82d830f 100644
--- a/scconfig/src/default/arg.c
+++ b/scconfig/src/default/arg.c
@@ -61,8 +61,10 @@ void process_args(int argc, char *argv[])
db_mkdir("/arg");
+ logprintf(0, "CLI arg 0: '%s'\n", argv[0]);
for(n = 1; n < argc; n++) {
key = argv[n];
+ logprintf(0, "CLI arg %d: '%s'\n", n, key);
while(*key == '-') key++;
value = str_chr(key, '=');
found = 0;
diff --git a/scconfig/src/default/find_cc.c b/scconfig/src/default/find_cc.c
index eda2991..2ae1e89 100644
--- a/scconfig/src/default/find_cc.c
+++ b/scconfig/src/default/find_cc.c
@@ -145,6 +145,7 @@ int find_cc(int logdepth, int fatal)
}
else {
logprintf(logdepth+1, "using user supplied cflags '%s' (will test later)\n", cflags);
+ put("cc/cflags", cflags);
}
if (get("cc/cflags") == NULL)
put("cc/cflags", "");
diff --git a/scconfig/src/default/find_fscalls.c b/scconfig/src/default/find_fscalls.c
index 1c3408b..9d129b4 100644
--- a/scconfig/src/default/find_fscalls.c
+++ b/scconfig/src/default/find_fscalls.c
@@ -367,7 +367,7 @@ int find_fs_mkdtemp(int logdepth, int fatal)
NL " strcpy(fn, \"scc.XXXXXX\");"
NL " o = mkdtemp(fn);"
NL " if (o != NULL) {"
- NL " unlink(fn);"
+ NL " remove(o);"
NL " puts(\"OK\");"
NL " }"
NL " return 0;"
diff --git a/scconfig/src/util/arg_auto_set.c b/scconfig/src/util/arg_auto_set.c
index df68a53..0f7825e 100644
--- a/scconfig/src/util/arg_auto_set.c
+++ b/scconfig/src/util/arg_auto_set.c
@@ -83,6 +83,8 @@ void arg_auto_print_options(FILE *fout, const char *line_prefix, const char *pad
pl = strlen(padding);
for(t = table; t->arg_key != NULL; t++) {
+ if (t->help_txt == NULL)
+ continue;
if (*t->help_txt == '$') {
int kl = strlen(t->arg_key);
if (kl > pl)
diff --git a/src/Makefile.dep b/src/Makefile.dep
index 073e045..d050268 100644
--- a/src/Makefile.dep
+++ b/src/Makefile.dep
@@ -1,302 +1,395 @@
### Generated file, do not edit, run make dep ###
+../src_plugins/acompnet/acompnet.o: ../src_plugins/acompnet/acompnet.c \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h layer.h layer_ui.h action_helper.h hid_actions.h plugins.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 conf.h conf_core.h compat_misc.h \
+ error.h obj_all.h dolists.h
../src_plugins/autocrop/autocrop.o: ../src_plugins/autocrop/autocrop.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h move.h \
- draw.h set.h polygon.h rtree.h plugins.h hid_actions.h dolists.h
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h hid.h rtree.h undo.h move.h draw.h polygon.h rtree.h plugins.h \
+ obj_all.h box.h hid_actions.h dolists.h
../src_plugins/autoplace/action.o: ../src_plugins/autoplace/action.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/autoplace/autoplace.h \
- plugins.h set.h global.h hid_actions.h dolists.h
+ ../config.h ../src_plugins/autoplace/autoplace.h global_typedefs.h \
+ pcb_bool.h unit.h plugins.h hid_actions.h hid.h error.h drc.h \
+ global_typedefs.h attrib.h layer.h globalconst.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h compat_nls.h board.h \
+ const.h macro.h vtroutestyle.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h event.h dolists.h
../src_plugins/autoplace/autoplace.o: \
- ../src_plugins/autoplace/autoplace.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/autoplace/autoplace.h \
- box.h global.h misc_util.h compat_misc.h data.h draw.h error.h layer.h \
- intersect.h rtree.h macro.h mirror.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h move.h mymem.h rats.h remove.h \
- rotate.h
+ ../src_plugins/autoplace/autoplace.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h ../src_plugins/autoplace/autoplace.h \
+ global_typedefs.h box.h compat_misc.h compat_nls.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h draw.h error.h layer.h \
+ intersect.h rtree.h macro.h move.h rats.h netlist.h route_style.h \
+ remove.h rotate.h obj_pinvia.h obj_rat.h vtptr.h
../src_plugins/autoroute/action.o: ../src_plugins/autoroute/action.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/autoroute/autoroute.h \
- action_helper.h global.h plugins.h set.h hid_actions.h dolists.h
+ ../config.h ../src_plugins/autoroute/autoroute.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h action_helper.h plugins.h hid_actions.h hid.h error.h \
+ drc.h event.h dolists.h
../src_plugins/autoroute/autoroute.o: \
../src_plugins/autoroute/autoroute.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h macro.h ../src_plugins/autoroute/autoroute.h box.h \
- misc_util.h create.h draw.h error.h find.h heap.h rtree.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h data.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h macro.h \
+ ../src_plugins/autoroute/autoroute.h board.h const.h macro.h \
+ vtroutestyle.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h box.h draw.h error.h find.h heap.h rtree.h \
../src_plugins/autoroute/mtspace.h ../src_plugins/autoroute/vector.h \
- mymem.h polygon.h rtree.h rats.h remove.h thermal.h undo.h pcb-printf.h \
- set.h layer.h
+ polygon.h rtree.h rats.h netlist.h route_style.h remove.h \
+ obj_pinvia_therm.h undo.h pcb-printf.h layer.h compat_nls.h vtptr.h \
+ obj_all.h obj_line_draw.h obj_pinvia_draw.h
../src_plugins/autoroute/mtspace.o: ../src_plugins/autoroute/mtspace.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h box.h global.h misc_util.h heap.h \
- rtree.h ../src_plugins/autoroute/mtspace.h \
+ ../config.h box.h math_helper.h global_typedefs.h pcb_bool.h unit.h \
+ macro.h move.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h globalconst.h attrib.h misc_util.h \
+ heap.h rtree.h ../src_plugins/autoroute/mtspace.h \
../src_plugins/autoroute/vector.h
../src_plugins/autoroute/vector.o: ../src_plugins/autoroute/vector.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/autoroute/vector.h
+ ../config.h math_helper.h ../src_plugins/autoroute/vector.h macro.h
../src_plugins/boardflip/boardflip.o: \
- ../src_plugins/boardflip/boardflip.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h \
- plugins.h hid_actions.h dolists.h
+ ../src_plugins/boardflip/boardflip.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h rats.h netlist.h route_style.h polygon.h rtree.h \
+ data.h crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h hid.h \
+ rtree.h undo.h plugins.h obj_all.h hid_actions.h compat_misc.h dolists.h
../src_plugins/dbus/dbus-pcbmain.o: ../src_plugins/dbus/dbus-pcbmain.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../config.h ../src_plugins/dbus/dbus-pcbmain.h hid.h error.h drc.h \
+ unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/dbus/dbus-pcbmain.h
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h
../src_plugins/dbus/dbus.o: ../src_plugins/dbus/dbus.c \
../src_plugins/dbus/dbus-pcbmain.h ../src_plugins/dbus/dbus-introspect.h \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h plugins.h \
- hid_actions.h event.h compat_misc.h compat_lrealpath.h dolists.h
+ board.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h plugins.h hid_actions.h event.h compat_misc.h hid.h \
+ compat_lrealpath.h dolists.h
../src_plugins/diag/diag.o: ../src_plugins/diag/diag.c ../config.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h layer.h \
- ../src_plugins/diag/diag_conf.h action_helper.h hid_actions.h plugins.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 conf.h error.h dolists.h
-../src_plugins/diag/diag_conf.o: ../src_plugins/diag/diag_conf.c conf.h \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h layer.h ../src_plugins/diag/diag_conf.h action_helper.h \
+ hid_actions.h plugins.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 \
- conf.h
-../src_plugins/distalign/distalign.o: \
- ../src_plugins/distalign/distalign.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ conf.h error.h dolists.h
+../src_plugins/diag/diag_conf.o: ../src_plugins/diag/diag_conf.c \
+ ../config.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h rats.h \
- error.h move.h draw.h set.h plugins.h hid_actions.h dolists.h
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h
+../src_plugins/distalign/distalign.o: \
+ ../src_plugins/distalign/distalign.c board.h ../config.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h hid.h rtree.h undo.h rats.h netlist.h route_style.h error.h \
+ move.h draw.h plugins.h action_helper.h hid_actions.h compat_misc.h \
+ dolists.h
../src_plugins/distaligntext/distaligntext.o: \
- ../src_plugins/distaligntext/distaligntext.c ../config.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h rats.h \
- error.h move.h draw.h set.h plugins.h hid_actions.h conf_core.h conf.h \
- pcb-printf.h ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/dom.h \
+ ../src_plugins/distaligntext/distaligntext.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h hid.h rtree.h undo.h rats.h netlist.h route_style.h error.h \
+ move.h draw.h plugins.h action_helper.h hid_actions.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 dolists.h
+ ../src_3rd/genvector/vtp0.h list_conf.h box.h compat_misc.h dolists.h
../src_plugins/djopt/djopt.o: ../src_plugins/djopt/djopt.c ../config.h \
- conf_core.h conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h \
- unit.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h remove.h move.h draw.h undo.h \
+ flag_str.h find.h layer.h pcb-printf.h compat_misc.h plugins.h \
+ hid_flags.h hid_actions.h ../src_plugins/djopt/djopt_conf.h conf.h \
+ obj_line.h obj_pinvia.h event.h dolists.h \
+ ../src_plugins/djopt/djopt_conf_fields.h
+../src_plugins/draw_fab/draw_fab.o: ../src_plugins/draw_fab/draw_fab.c \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h build_run.h data.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h draw.h ../src_plugins/draw_fab/../report/drill.h \
+ obj_all.h plugins.h stub_draw_fab.h \
+ ../src_plugins/draw_fab/draw_fab_conf.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 \
- global.h data.h create.h remove.h move.h draw.h undo.h strflags.h find.h \
- layer.h pcb-printf.h plugins.h hid_flags.h hid_actions.h \
- ../src_plugins/djopt/djopt_conf.h conf.h dolists.h \
- ../src_plugins/djopt/djopt_conf_fields.h
+ conf.h obj_text_draw.h ../src_plugins/draw_fab/draw_fab_conf_fields.h
../src_plugins/export_bboard/bboard.o: \
- ../src_plugins/export_bboard/bboard.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h error.h buffer.h create.h \
- layer.h plugins.h compat_misc.h misc_util.h hid.h hid_attrib.h \
- hid_nogui.h hid_draw_helpers.h hid_init.h hid_helper.h
+ ../src_plugins/export_bboard/bboard.c ../config.h math_helper.h board.h \
+ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \
+ attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h buffer.h layer.h plugins.h compat_misc.h compat_fs.h \
+ misc_util.h obj_all.h hid.h hid_attrib.h hid_nogui.h hid_draw_helpers.h \
+ hid_init.h hid_helper.h
../src_plugins/export_bom/bom.o: ../src_plugins/export_bom/bom.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h error.h misc.h mymem.h pcb-printf.h plugins.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h build_run.h board.h const.h \
+ macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h pcb-printf.h plugins.h \
compat_misc.h hid.h hid_nogui.h hid_attrib.h hid_helper.h hid_init.h
+../src_plugins/export_dsn/dsn.o: ../src_plugins/export_dsn/dsn.c \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h rats.h netlist.h route_style.h buffer.h change.h draw.h \
+ undo.h pcb-printf.h ../src_3rd/genvector/gds_char.h polygon.h rtree.h \
+ compat_misc.h layer.h hid.h hid_draw_helpers.h hid_nogui.h hid_actions.h \
+ hid_init.h hid_attrib.h hid_helper.h plugins.h obj_line.h obj_pinvia.h \
+ dolists.h
../src_plugins/export_dxf/dxf.o: ../src_plugins/export_dxf/dxf.c \
- ../config.h macro.h global.h const.h macro.h global_typedefs.h \
- pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h \
- globalconst.h polyarea.h list_common.h list_line.h \
- ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
- ../src_3rd/genlist/gentdlist_undef.h list_arc.h list_text.h list_poly.h \
- list_pad.h list_pin.h list_rat.h vtonpoint.h \
+ ../config.h math_helper.h macro.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h error.h draw.h \
- hid_draw_helpers.h pcb-printf.h compat_misc.h layer.h hid_attrib.h \
- hid_flags.h hid_helper.h hid.h hid_init.h plugins.h
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h draw.h hid_draw_helpers.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h compat_misc.h layer.h hid_attrib.h \
+ hid_flags.h hid_helper.h hid.h hid_init.h plugins.h obj_pinvia.h
../src_plugins/export_gcode/curve.o: ../src_plugins/export_gcode/curve.c \
- ../src_plugins/export_gcode/potracelib.h \
+ ../config.h ../src_plugins/export_gcode/potracelib.h \
../src_plugins/export_gcode/lists.h ../src_plugins/export_gcode/curve.h \
- ../src_plugins/export_gcode/auxiliary.h ../config.h
+ ../src_plugins/export_gcode/auxiliary.h
../src_plugins/export_gcode/decompose.o: \
- ../src_plugins/export_gcode/decompose.c \
+ ../src_plugins/export_gcode/decompose.c ../config.h \
../src_plugins/export_gcode/potracelib.h \
../src_plugins/export_gcode/curve.h \
- ../src_plugins/export_gcode/auxiliary.h ../config.h \
+ ../src_plugins/export_gcode/auxiliary.h \
../src_plugins/export_gcode/lists.h ../src_plugins/export_gcode/bitmap.h \
../src_plugins/export_gcode/decompose.h
../src_plugins/export_gcode/gcode.o: ../src_plugins/export_gcode/gcode.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- plugins.h global.h error.h data.h misc.h mymem.h rats.h hid_helper.h \
- layer.h compat_misc.h hid.h hid_nogui.h hid_draw_helpers.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h plugins.h board.h const.h \
+ macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h error.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h rats.h netlist.h route_style.h \
+ hid_helper.h layer.h compat_misc.h hid.h hid_nogui.h hid_draw_helpers.h \
../src_plugins/export_gcode/gcode.h ../src_plugins/export_gcode/bitmap.h \
../src_plugins/export_gcode/potracelib.h \
../src_plugins/export_gcode/curve.h \
@@ -305,354 +398,454 @@
../src_plugins/export_gcode/decompose.h pcb-printf.h hid_init.h \
hid_attrib.h hid_flags.h hid_color.h dolists.h
../src_plugins/export_gcode/trace.o: ../src_plugins/export_gcode/trace.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h \
- ../src_plugins/export_gcode/potracelib.h \
+ ../config.h ../src_plugins/export_gcode/potracelib.h \
../src_plugins/export_gcode/curve.h \
../src_plugins/export_gcode/auxiliary.h \
- ../src_plugins/export_gcode/lists.h ../src_plugins/export_gcode/trace.h
+ ../src_plugins/export_gcode/lists.h ../src_plugins/export_gcode/trace.h \
+ compat_cc.h
../src_plugins/export_gerber/gerber.o: \
- ../src_plugins/export_gerber/gerber.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h error.h draw.h layer.h \
- pcb-printf.h plugins.h hid_helper.h compat_misc.h hid.h hid_nogui.h \
- hid_draw_helpers.h hid_init.h hid_attrib.h hid_flags.h conf_core.h \
- conf.h pcb-printf.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/export_gerber/gerber.c ../config.h math_helper.h board.h \
+ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \
+ attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h draw.h layer.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h plugins.h hid_helper.h compat_misc.h \
+ hid.h hid_nogui.h hid_draw_helpers.h hid_init.h hid_attrib.h hid_flags.h \
+ conf_core.h conf.h pcb-printf.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
../src_plugins/export_ipcd356/ipcd356.o: \
- ../src_plugins/export_ipcd356/ipcd356.c ../config.h data.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h global.h rats.h error.h find.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h pcb-printf.h netlist.h \
- conf_core.h conf.h pcb-printf.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 \
- hid.h hid_nogui.h hid_helper.h hid_attrib.h hid_init.h plugins.h
+ ../src_plugins/export_ipcd356/ipcd356.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h rats.h netlist.h route_style.h error.h find.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h netlist.h conf_core.h conf.h \
+ pcb-printf.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_pinvia.h hid.h hid_nogui.h \
+ hid_helper.h hid_attrib.h hid_init.h plugins.h
../src_plugins/export_lpr/lpr.o: ../src_plugins/export_lpr/lpr.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h plugins.h compat_misc.h hid.h \
+ ../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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ plugins.h compat_misc.h hid.h \
../src_plugins/export_lpr/../export_ps/ps.h hid_nogui.h hid_init.h \
hid_attrib.h hid_actions.h
../src_plugins/export_nelma/nelma.o: ../src_plugins/export_nelma/nelma.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h error.h data.h global.h layer.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h rats.h plugins.h hid_helper.h \
- hid.h hid_nogui.h hid_draw_helpers.h hid_init.h hid_attrib.h hid_flags.h \
- hid_color.h dolists.h
-../src_plugins/export_png/png.o: ../src_plugins/export_png/png.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h error.h data.h crosshair.h vtonpoint.h hid.h error.h \
+ drc.h buffer.h layer.h rats.h netlist.h route_style.h plugins.h \
+ hid_helper.h hid.h hid_nogui.h hid_draw_helpers.h hid_init.h \
+ hid_attrib.h hid_flags.h hid_color.h dolists.h
+../src_plugins/export_openscad/scad.o: \
+ ../src_plugins/export_openscad/scad.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h math_helper.h data.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h error.h buffer.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 \
- global.h data.h error.h misc.h mymem.h layer.h misc_util.h compat_misc.h \
- plugins.h hid.h hid_nogui.h hid_draw_helpers.h \
+ layer.h plugins.h hid.h hid_draw_helpers.h hid_nogui.h hid_init.h \
+ hid_attrib.h hid_helper.h ../src_plugins/export_openscad/scad.h
+../src_plugins/export_openscad/scadcomp.o: \
+ ../src_plugins/export_openscad/scadcomp.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h buffer.h misc_util.h hid.h hid_nogui.h \
+ hid_draw_helpers.h hid_init.h ../src_plugins/export_openscad/scad.h
+../src_plugins/export_openscad/scadproto.o: \
+ ../src_plugins/export_openscad/scadproto.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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ error.h buffer.h hid.h hid_nogui.h hid_draw_helpers.h hid_init.h \
+ ../src_plugins/export_openscad/scad.h
+../src_plugins/export_png/png.o: ../src_plugins/export_png/png.c \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h layer.h misc_util.h \
+ compat_misc.h plugins.h hid.h hid_nogui.h hid_draw_helpers.h \
../src_plugins/export_png/png.h hid_init.h hid_attrib.h hid_color.h \
hid_helper.h hid_flags.h dolists.h
../src_plugins/export_ps/eps.o: ../src_plugins/export_ps/eps.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h layer.h misc.h mymem.h pcb-printf.h hid.h hid_nogui.h \
- hid_draw_helpers.h ../src_plugins/export_ps/ps.h hid_init.h hid_attrib.h \
- hid_helper.h hid_flags.h hid_color.h
-../src_plugins/export_ps/ps.o: ../src_plugins/export_ps/ps.c ../config.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h layer.h error.h draw.h \
- pcb-printf.h plugins.h hid_helper.h hid.h hid_nogui.h hid_draw_helpers.h \
- ../src_plugins/export_ps/ps.h draw_fab.h hid_init.h hid_attrib.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h layer.h pcb-printf.h hid.h \
+ hid_nogui.h hid_draw_helpers.h ../src_plugins/export_ps/ps.h hid_init.h \
+ hid_attrib.h hid_helper.h hid_flags.h hid_color.h
+../src_plugins/export_ps/ps.o: ../src_plugins/export_ps/ps.c ../config.h \
+ math_helper.h board.h const.h macro.h global_typedefs.h pcb_bool.h \
+ unit.h vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h layer.h error.h draw.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h plugins.h hid_helper.h hid.h hid_nogui.h \
+ hid_draw_helpers.h ../src_plugins/export_ps/ps.h hid_init.h hid_attrib.h \
hid_flags.h hid_actions.h conf_core.h conf.h pcb-printf.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 compat_misc.h dolists.h
-../src_plugins/export_svg/svg.o: ../src_plugins/export_svg/svg.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h compat_misc.h compat_nls.h \
+ stub_draw_fab.h dolists.h
+../src_plugins/export_stat/stat.o: ../src_plugins/export_stat/stat.c \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h plugins.h pcb-printf.h \
+ compat_misc.h plug_io.h hid.h hid_nogui.h hid_draw_helpers.h hid_init.h \
+ hid_attrib.h hid_color.h hid_helper.h hid_flags.h dolists.h
+../src_plugins/export_svg/svg.o: ../src_plugins/export_svg/svg.c \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h error.h misc.h mymem.h layer.h misc_util.h compat_misc.h \
- plugins.h hid.h hid_nogui.h hid_draw_helpers.h hid_init.h hid_attrib.h \
- hid_color.h hid_helper.h hid_flags.h dolists.h
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h layer.h misc_util.h \
+ compat_misc.h plugins.h hid.h hid_nogui.h hid_draw_helpers.h hid_init.h \
+ hid_attrib.h hid_color.h hid_helper.h hid_flags.h dolists.h
../src_plugins/export_test/export_test.o: \
../src_plugins/export_test/export_test.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h error.h misc.h mymem.h pcb-printf.h plugins.h hid.h \
- hid_nogui.h hid_attrib.h hid_helper.h hid_init.h
-../src_plugins/export_xy/xy.o: ../src_plugins/export_xy/xy.c ../config.h \
- conf_core.h conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h \
- unit.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h build_run.h board.h const.h \
+ macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h pcb-printf.h plugins.h \
+ hid.h hid_nogui.h hid_attrib.h hid_helper.h hid_init.h
+../src_plugins/export_xy/xy.o: ../src_plugins/export_xy/xy.c ../config.h \
+ conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h error.h misc.h mymem.h pcb-printf.h plugins.h \
- compat_misc.h hid.h hid_nogui.h hid_attrib.h hid_helper.h hid_init.h
-../src_plugins/fontmode/fontmode.o: ../src_plugins/fontmode/fontmode.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h build_run.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h pcb-printf.h plugins.h \
+ compat_misc.h obj_pinvia.h hid.h hid_nogui.h hid_attrib.h hid_helper.h \
+ hid_init.h
+../src_plugins/fontmode/fontmode.o: ../src_plugins/fontmode/fontmode.c \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h create.h data.h draw.h layer.h misc.h mymem.h move.h remove.h \
- rtree.h strflags.h undo.h pcb-printf.h plugins.h hid_actions.h \
- compat_misc.h dolists.h
-../src_plugins/fp_fs/fp_fs.o: ../src_plugins/fp_fs/fp_fs.c ../config.h \
- mymem.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h paths.h plugins.h \
- plug_footprint.h vtlibrary.h compat_fs.h compat_misc.h error.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h draw.h flag.h layer.h move.h \
+ remove.h rtree.h flag_str.h undo.h pcb-printf.h plugins.h hid_actions.h \
+ compat_misc.h event.h dolists.h
+../src_plugins/fp_fs/fp_fs.o: ../src_plugins/fp_fs/fp_fs.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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ paths.h ../src_3rd/genvector/gds_char.h plugins.h plug_footprint.h \
+ vtlibrary.h compat_fs.h compat_misc.h error.h conf.h pcb-printf.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 conf.h conf_core.h compat_inc.h
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h conf_core.h compat_nls.h \
+ macro.h compat_inc.h
../src_plugins/fp_wget/fp_wget.o: ../src_plugins/fp_wget/fp_wget.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/fp_wget/gedasymbols.h \
- plug_footprint.h vtlibrary.h plugins.h
+ ../config.h ../src_plugins/fp_wget/gedasymbols.h plug_footprint.h \
+ vtlibrary.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h plugins.h
../src_plugins/fp_wget/gedasymbols.o: \
../src_plugins/fp_wget/gedasymbols.c ../src_3rd/genvector/gds_char.h \
../src_3rd/genvector/genvector_impl.h \
../src_3rd/genvector/genvector_undef.h ../src_3rd/liblihata/genht/htsp.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h hid.h error.h vtroutestyle.h global_element.h list_element.h \
- ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/hash.h ../config.h \
../src_plugins/fp_wget/wget_common.h \
../src_plugins/fp_wget/gedasymbols.h plug_footprint.h vtlibrary.h \
plugins.h compat_misc.h
../src_plugins/fp_wget/wget_common.o: \
- ../src_plugins/fp_wget/wget_common.c \
+ ../src_plugins/fp_wget/wget_common.c ../config.h \
../src_plugins/fp_wget/wget_common.h
../src_plugins/hid_batch/batch.o: ../src_plugins/hid_batch/batch.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h layer.h pcb-printf.h plugins.h \
- compat_misc.h hid_draw_helpers.h hid_nogui.h hid_actions.h hid_init.h \
- dolists.h
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h hid.h error.h drc.h data.h crosshair.h vtonpoint.h \
+ hid.h buffer.h layer.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ plugins.h compat_misc.h event.h hid_draw_helpers.h hid_nogui.h \
+ hid_actions.h hid_init.h dolists.h
../src_plugins/hid_gtk/ghid-cell-renderer-visibility.o: \
- ../src_plugins/hid_gtk/ghid-cell-renderer-visibility.c \
- ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/hid_gtk/ghid-cell-renderer-visibility.c ../config.h \
+ ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h error.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h event.h compat_misc.h \
- ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h compat_nls.h \
../src_plugins/hid_gtk/ghid-cell-renderer-visibility.h
../src_plugins/hid_gtk/ghid-coord-entry.o: \
- ../src_plugins/hid_gtk/ghid-coord-entry.c \
- ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/hid_gtk/ghid-coord-entry.c ../config.h \
+ ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h error.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h event.h compat_misc.h \
- ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h compat_nls.h
../src_plugins/hid_gtk/ghid-layer-selector.o: \
- ../src_plugins/hid_gtk/ghid-layer-selector.c \
- ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/hid_gtk/ghid-layer-selector.c ../config.h \
+ ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h error.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h \
@@ -662,959 +855,1180 @@
../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/liblihata/genht/ht_inlines.h \
- ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/hash.h \
- pcb-printf.h ../src_3rd/genvector/gds_char.h \
- ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../config.h ../src_plugins/hid_gtk/gtkhid.h conf_hid.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h error.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h misc_util.h \
error.h ../src_plugins/hid_gtk/gschem_accel_label.h
../src_plugins/hid_gtk/ghid-propedit.o: \
- ../src_plugins/hid_gtk/ghid-propedit.c ../src_plugins/hid_gtk/gui.h \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_plugins/hid_gtk/ghid-propedit.c ../config.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid.h hid_cfg.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h hid.h error.h drc.h hid_cfg.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 hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h \
- ../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
- ../src_plugins/hid_gtk/ghid-main-menu.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h \
+ vtonpoint.h hid.h buffer.h ../src_plugins/hid_gtk/ghid-coord-entry.h \
+ unit.h ../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h conf.h pcb-printf.h \
- ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
- event.h compat_misc.h ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
- create.h polygon.h rtree.h
+ ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h event.h compat_misc.h \
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h compat_nls.h polygon.h \
+ rtree.h obj_all.h
../src_plugins/hid_gtk/ghid-route-style-selector.o: \
- ../src_plugins/hid_gtk/ghid-route-style-selector.c global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.c ../config.h \
+ conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf_core.h conf.h global.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 ../src_plugins/hid_gtk/gtkhid.h \
- conf_hid.h ../src_plugins/hid_gtk/gui.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
+ ../src_plugins/hid_gtk/gtkhid.h conf_hid.h error.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h vtroutestyle.h \
+ attrib.h layer.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
- ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h route_style.h \
- set.h
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h compat_nls.h
../src_plugins/hid_gtk/ghid-search.o: \
../src_plugins/hid_gtk/ghid-search.c ../src_3rd/genlist/gendlist.h \
- ../src_plugins/hid_gtk/gui.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid.h hid_cfg.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 hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h \
+ ../config.h ../src_plugins/hid_gtk/gui.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ error.h drc.h hid_cfg.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 \
+ hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h \
+ crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h conf.h pcb-printf.h \
- ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
- event.h compat_misc.h ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
- create.h ../src_plugins/hid_gtk/ghid-search.h \
- ../src_plugins/hid_gtk/win_place.h hid_actions.h misc_util.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h event.h compat_misc.h \
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
+ ../src_plugins/hid_gtk/ghid-search.h ../src_plugins/hid_gtk/win_place.h \
+ hid_actions.h compat_nls.h misc_util.h \
../src_plugins/hid_gtk/ghid-search-tab.h
../src_plugins/hid_gtk/gschem_accel_label.o: \
- ../src_plugins/hid_gtk/gschem_accel_label.c \
- ../src_plugins/hid_gtk/gschem_accel_label.h
+ ../src_plugins/hid_gtk/gschem_accel_label.c ../config.h \
+ ../src_plugins/hid_gtk/gschem_accel_label.h compat_nls.h
../src_plugins/hid_gtk/gtk_conf_list.o: \
- ../src_plugins/hid_gtk/gtk_conf_list.c \
- ../src_plugins/hid_gtk/gtk_conf_list.h conf.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/hid_gtk/gtk_conf_list.c ../config.h \
+ ../src_plugins/hid_gtk/gtk_conf_list.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- conf.h compat_misc.h
-../src_plugins/hid_gtk/gtkhid-gdk.o: ../src_plugins/hid_gtk/gtkhid-gdk.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf_core.h conf.h global.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h compat_misc.h
+../src_plugins/hid_gtk/gtkhid-gdk.o: ../src_plugins/hid_gtk/gtkhid-gdk.c \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.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 crosshair.h clip.h layer.h \
- ../src_plugins/hid_gtk/gui.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h crosshair.h vtonpoint.h \
+ hid.h error.h drc.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h clip.h layer.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h vtroutestyle.h \
+ library.h rats_patch.h board.h font.h box.h math_helper.h move.h \
+ misc_util.h hid.h hid_cfg.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h hid_draw_helpers.h \
hid_attrib.h hid_helper.h hid_color.h
../src_plugins/hid_gtk/gtkhid-main.o: \
../src_plugins/hid_gtk/gtkhid-main.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- action_helper.h crosshair.h error.h ../src_plugins/hid_gtk/gui.h \
- global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h action_helper.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h error.h draw.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h vtroutestyle.h \
+ library.h rats_patch.h board.h font.h box.h math_helper.h move.h \
+ misc_util.h hid.h hid_cfg.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h hid_nogui.h \
hid_draw_helpers.h pcb-printf.h plugins.h hid_attrib.h hid_init.h \
hid_flags.h hid_actions.h plug_footprint.h vtlibrary.h plug_io.h \
- misc_util.h layer.h ../src_plugins/hid_gtk/ghid-search.h \
- ../src_plugins/hid_gtk/gtkhid.h conf_hid.h dolists.h \
+ misc_util.h layer.h ../src_plugins/hid_gtk/ghid-search.h compat_nls.h \
+ layer_vis.h ../src_plugins/hid_gtk/gtkhid.h conf_hid.h dolists.h \
../src_plugins/hid_gtk/hid_gtk_conf_fields.h
../src_plugins/hid_gtk/gui-command-window.o: \
../src_plugins/hid_gtk/gui-command-window.c ../config.h conf_core.h \
- conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
- ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h crosshair.h hid_actions.h
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h crosshair.h hid_actions.h \
+ compat_nls.h
../src_plugins/hid_gtk/gui-config.o: ../src_plugins/hid_gtk/gui-config.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
- ../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
- ../src_plugins/hid_gtk/ghid-main-menu.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_plugins/hid_gtk/gui.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ error.h drc.h hid_cfg.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h \
+ vtonpoint.h hid.h buffer.h ../src_plugins/hid_gtk/ghid-coord-entry.h \
+ unit.h ../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
../src_plugins/hid_gtk/win_place.h ../src_plugins/hid_gtk/gtkhid.h \
conf_hid.h action_helper.h change.h plug_io.h error.h draw.h \
- pcb-printf.h set.h hid_attrib.h misc_util.h \
+ pcb-printf.h hid_attrib.h misc_util.h \
../src_plugins/hid_gtk/gtk_conf_list.h paths.h plug_footprint.h \
- vtlibrary.h fptr_cast.h ../src_3rd/liblihata/tree.h
+ vtlibrary.h compat_nls.h fptr_cast.h ../src_3rd/liblihata/tree.h
../src_plugins/hid_gtk/gui-dialog-print.o: \
../src_plugins/hid_gtk/gui-dialog-print.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h pcb-printf.h hid_attrib.h \
- hid_init.h misc_util.h
+ hid_init.h misc_util.h compat_nls.h
../src_plugins/hid_gtk/gui-dialog.o: ../src_plugins/hid_gtk/gui-dialog.c \
- ../config.h compat_misc.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/hid_gtk/gui.h global.h \
- hid.h hid_cfg.h ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \
+ ../config.h compat_misc.h compat_nls.h build_run.h plug_io.h library.h \
+ global_typedefs.h pcb_bool.h unit.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h data.h globalconst.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h rats_patch.h board.h font.h box.h \
+ math_helper.h move.h misc_util.h hid.h hid_cfg.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
- ../src_plugins/hid_gtk/ghid-propedit.h conf_core.h conf.h pcb-printf.h \
- ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
- event.h ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h
+ ../src_plugins/hid_gtk/ghid-propedit.h conf_core.h event.h \
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h
../src_plugins/hid_gtk/gui-drc-window.o: \
../src_plugins/hid_gtk/gui-drc-window.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- error.h search.h misc_util.h draw.h layer.h pcb-printf.h undo.h set.h \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h error.h search.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h attrib.h rats.h netlist.h library.h \
+ route_style.h vtroutestyle.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h misc_util.h draw.h \
+ hid.h error.h drc.h layer.h pcb-printf.h undo.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h rats_patch.h \
+ board.h font.h box.h math_helper.h move.h hid.h hid_cfg.h \
+ hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h \
+ crosshair.h vtonpoint.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
../src_plugins/hid_gtk/win_place.h \
- ../src_plugins/hid_gtk/gui-drc-window.h hid_actions.h
+ ../src_plugins/hid_gtk/gui-drc-window.h hid_actions.h compat_nls.h \
+ obj_all.h obj_pinvia_draw.h obj_pad_draw.h obj_rat_draw.h \
+ obj_line_draw.h obj_arc_draw.h obj_poly_draw.h layer_vis.h
../src_plugins/hid_gtk/gui-keyref-window.o: \
../src_plugins/hid_gtk/gui-keyref-window.c ../config.h \
- ../src_plugins/hid_gtk/gui.h global.h const.h macro.h global_typedefs.h \
- pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h \
- globalconst.h polyarea.h list_common.h list_line.h \
- ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
- ../src_3rd/genlist/gentdlist_undef.h list_arc.h list_text.h list_poly.h \
- list_pad.h list_pin.h list_rat.h vtonpoint.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid.h hid_cfg.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h hid.h error.h drc.h hid_cfg.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 hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h \
- ../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
- ../src_plugins/hid_gtk/ghid-main-menu.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h \
+ vtonpoint.h hid.h buffer.h ../src_plugins/hid_gtk/ghid-coord-entry.h \
+ unit.h ../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h conf.h pcb-printf.h \
- ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
- event.h compat_misc.h ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
- ../src_plugins/hid_gtk/win_place.h
+ ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h event.h compat_misc.h \
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
+ ../src_plugins/hid_gtk/win_place.h compat_nls.h
../src_plugins/hid_gtk/gui-library-window.o: \
../src_plugins/hid_gtk/gui-library-window.c ../config.h conf_core.h \
- conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
- ../src_plugins/hid_gtk/win_place.h buffer.h set.h plug_footprint.h \
- vtlibrary.h ../src_plugins/hid_gtk/gui-library-window.h
+ ../src_plugins/hid_gtk/win_place.h buffer.h plug_footprint.h vtlibrary.h \
+ compat_nls.h ../src_plugins/hid_gtk/gui-library-window.h
../src_plugins/hid_gtk/gui-log-window.o: \
../src_plugins/hid_gtk/gui-log-window.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- conf_hid.h ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h \
- hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h \
- misc.h mymem.h ../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h conf_hid.h error.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h vtroutestyle.h \
+ attrib.h layer.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
+ ../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
- ../src_plugins/hid_gtk/win_place.h pcb-printf.h hid_actions.h
+ ../src_plugins/hid_gtk/win_place.h pcb-printf.h hid_actions.h \
+ compat_nls.h
../src_plugins/hid_gtk/gui-misc.o: ../src_plugins/hid_gtk/gui-misc.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h crosshair.h data.h misc.h mymem.h action_helper.h set.h \
- pcb-printf.h misc_util.h ../src_plugins/hid_gtk/gui.h hid.h hid_cfg.h \
- hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h data.h crosshair.h buffer.h \
+ action_helper.h pcb-printf.h misc_util.h compat_nls.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h vtroutestyle.h \
+ library.h rats_patch.h board.h font.h box.h math_helper.h move.h \
+ misc_util.h hid.h hid_cfg.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h
../src_plugins/hid_gtk/gui-netlist-window.o: \
../src_plugins/hid_gtk/gui-netlist-window.c ../config.h conf_core.h \
- conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h ../src_plugins/hid_gtk/win_place.h ../src_plugins/hid_gtk/gui.h \
- hid.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
- hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
+ ../src_plugins/hid_gtk/win_place.h ../src_plugins/hid_gtk/gui.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
- ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h create.h draw.h error.h \
- find.h mymem.h rats.h remove.h search.h misc_util.h select.h set.h \
- undo.h hid_actions.h
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h draw.h error.h find.h \
+ rats.h netlist.h route_style.h remove.h search.h rats.h select.h \
+ operation.h undo.h hid_actions.h compat_nls.h obj_all.h
../src_plugins/hid_gtk/gui-output-events.o: \
../src_plugins/hid_gtk/gui-output-events.c ../config.h conf_core.h \
- conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
../src_plugins/hid_gtk/gtkhid.h conf_hid.h action_helper.h crosshair.h \
- draw.h error.h layer.h set.h find.h search.h misc_util.h rats.h
+ draw.h error.h layer.h find.h search.h rats.h netlist.h route_style.h \
+ rats.h
../src_plugins/hid_gtk/gui-pinout-preview.o: \
../src_plugins/hid_gtk/gui-pinout-preview.c ../config.h conf_core.h \
- conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h ../src_plugins/hid_gtk/gui.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
- ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h copy.h draw.h mymem.h \
- move.h rotate.h
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h copy.h draw.h move.h \
+ rotate.h obj_all.h
../src_plugins/hid_gtk/gui-pinout-window.o: \
../src_plugins/hid_gtk/gui-pinout-window.c ../config.h conf_core.h \
- conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h ../src_plugins/hid_gtk/gui.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h \
- ../src_plugins/hid_gtk/win_place.h copy.h draw.h mymem.h move.h rotate.h
+ ../src_plugins/hid_gtk/win_place.h copy.h draw.h move.h rotate.h
../src_plugins/hid_gtk/gui-top-window.o: \
../src_plugins/hid_gtk/gui-top-window.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h global.h \
- ../src_plugins/hid_gtk/gtkhid.h conf_hid.h ../src_plugins/hid_gtk/gui.h \
- hid.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
- hid_cfg.h data.h misc.h mymem.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
+ vtroutestyle.h attrib.h ../src_plugins/hid_gtk/gtkhid.h conf_hid.h \
+ error.h ../src_plugins/hid_gtk/gui.h board.h const.h macro.h layer.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h hid.h \
+ drc.h hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h \
+ hid_cfg.h data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h hid_cfg_action.h \
- action_helper.h buffer.h change.h copy.h create.h crosshair.h draw.h \
- error.h plug_io.h find.h insert.h line.h mymem.h layer.h move.h \
- pcb-printf.h polygon.h rtree.h rats.h remove.h rotate.h rubberband.h \
- search.h misc_util.h select.h set.h undo.h free_atexit.h paths.h \
+ action_helper.h buffer.h change.h copy.h crosshair.h draw.h error.h \
+ plug_io.h find.h insert.h layer.h move.h pcb-printf.h polygon.h rtree.h \
+ rats.h netlist.h route_style.h remove.h rotate.h search.h rats.h \
+ select.h operation.h undo.h free_atexit.h paths.h \
../src_plugins/hid_gtk/gui-icons-mode-buttons.data \
../src_plugins/hid_gtk/gui-icons-misc.data \
../src_plugins/hid_gtk/win_place.h hid_attrib.h hid_actions.h \
- hid_flags.h route_style.h
+ hid_flags.h compat_nls.h obj_line.h layer_vis.h
../src_plugins/hid_gtk/gui-utils.o: ../src_plugins/hid_gtk/gui-utils.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/hid_gtk/gui.h global.h hid.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h ../src_plugins/hid_gtk/gui.h \
+ board.h const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid.h error.h drc.h \
+ hid_cfg.h hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
+ data.h crosshair.h vtonpoint.h hid.h buffer.h \
../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h event.h compat_misc.h \
../src_plugins/hid_gtk/hid_gtk_conf.h conf.h
../src_plugins/hid_gtk/menu_lht.o: ../src_plugins/hid_gtk/menu_lht.c
../src_plugins/hid_gtk/win_place.o: ../src_plugins/hid_gtk/win_place.c \
- ../src_plugins/hid_gtk/win_place.h ../src_plugins/hid_gtk/gui.h global.h \
- ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../config.h ../src_plugins/hid_gtk/win_place.h \
+ ../src_plugins/hid_gtk/gui.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid.h hid_cfg.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h hid.h error.h drc.h hid_cfg.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 hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h global.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h \
- ../src_plugins/hid_gtk/ghid-coord-entry.h unit.h \
- ../src_plugins/hid_gtk/ghid-main-menu.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h \
+ vtonpoint.h hid.h buffer.h ../src_plugins/hid_gtk/ghid-coord-entry.h \
+ unit.h ../src_plugins/hid_gtk/ghid-main-menu.h \
../src_plugins/hid_gtk/ghid-layer-selector.h \
- ../src_plugins/hid_gtk/ghid-route-style-selector.h \
+ ../src_plugins/hid_gtk/ghid-route-style-selector.h route_style.h \
../src_plugins/hid_gtk/gui-pinout-preview.h \
../src_plugins/hid_gtk/ghid-propedit.h conf_core.h conf.h pcb-printf.h \
- ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
- event.h compat_misc.h ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h
+ ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h event.h compat_misc.h \
+ ../src_plugins/hid_gtk/hid_gtk_conf.h conf.h
../src_plugins/hid_lesstif/dialogs.o: \
../src_plugins/hid_lesstif/dialogs.c \
../src_plugins/hid_lesstif/xincludes.h ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- compat_misc.h global.h data.h crosshair.h layer.h misc.h mymem.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h compat_misc.h data.h layer.h \
+ attrib.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h build_run.h crosshair.h layer.h \
pcb-printf.h hid.h ../src_plugins/hid_lesstif/lesstif.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h hid_attrib.h hid_actions.h \
- hid_init.h ../src_plugins/hid_lesstif/stdarg.h misc_util.h
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h compat_nls.h board.h const.h \
+ macro.h vtroutestyle.h library.h rats_patch.h board.h font.h box.h \
+ math_helper.h move.h misc_util.h hid_attrib.h hid_actions.h hid_init.h \
+ ../src_plugins/hid_lesstif/stdarg.h misc_util.h
../src_plugins/hid_lesstif/library.o: \
../src_plugins/hid_lesstif/library.c \
../src_plugins/hid_lesstif/xincludes.h ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- compat_misc.h global.h data.h misc.h mymem.h set.h buffer.h vtptr.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h compat_misc.h data.h layer.h \
+ attrib.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h buffer.h vtptr.h \
plug_footprint.h vtlibrary.h hid.h ../src_plugins/hid_lesstif/lesstif.h \
- hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h \
- ../src_plugins/hid_lesstif/stdarg.h
+ hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h compat_nls.h \
+ board.h const.h macro.h vtroutestyle.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h \
+ ../src_plugins/hid_lesstif/stdarg.h event.h
../src_plugins/hid_lesstif/main.o: ../src_plugins/hid_lesstif/main.c \
- ../src_plugins/hid_lesstif/xincludes.h ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/hid_lesstif/xincludes.h ../config.h math_helper.h \
+ conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h action_helper.h crosshair.h layer.h mymem.h misc.h \
- mymem.h pcb-printf.h clip.h event.h error.h plugins.h hid.h hid_nogui.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h data.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h action_helper.h crosshair.h \
+ layer.h pcb-printf.h clip.h event.h error.h plugins.h hid.h hid_nogui.h \
hid_draw_helpers.h hid_cfg.h ../src_plugins/hid_lesstif/lesstif.h \
- hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h hid_attrib.h \
- hid_helper.h hid_init.h hid_color.h hid_extents.h hid_flags.h \
- hid_actions.h ../src_plugins/hid_lesstif/stdarg.h misc_util.h \
- compat_misc.h dolists.h
+ hid_cfg_input.h ../src_3rd/liblihata/genht/htip.h hid_cfg.h compat_nls.h \
+ board.h const.h macro.h vtroutestyle.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h hid_attrib.h hid_helper.h \
+ hid_init.h hid_color.h hid_extents.h hid_flags.h hid_actions.h \
+ ../src_plugins/hid_lesstif/stdarg.h misc_util.h compat_misc.h \
+ layer_vis.h dolists.h
../src_plugins/hid_lesstif/menu.o: ../src_plugins/hid_lesstif/menu.c \
../src_plugins/hid_lesstif/xincludes.h ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h data.h error.h misc.h mymem.h pcb-printf.h layer.h hid.h \
- hid_cfg.h hid_cfg_action.h hid_cfg.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h data.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h pcb-printf.h layer.h \
+ hid.h hid_cfg.h hid_cfg_action.h hid_cfg.h hid_cfg_input.h \
../src_3rd/liblihata/genht/htip.h ../src_plugins/hid_lesstif/lesstif.h \
- mymem.h paths.h hid_actions.h hid_flags.h \
- ../src_plugins/hid_lesstif/stdarg.h compat_misc.h
+ compat_nls.h board.h const.h macro.h vtroutestyle.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.h \
+ paths.h hid_actions.h hid_flags.h ../src_plugins/hid_lesstif/stdarg.h \
+ event.h compat_misc.h layer_vis.h
../src_plugins/hid_lesstif/menu_lht.o: \
../src_plugins/hid_lesstif/menu_lht.c
../src_plugins/hid_lesstif/netlist.o: \
../src_plugins/hid_lesstif/netlist.c ../config.h \
- ../src_plugins/hid_lesstif/xincludes.h compat_misc.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h find.h rats.h select.h \
- undo.h remove.h crosshair.h draw.h hid.h hid_actions.h \
- ../src_plugins/hid_lesstif/lesstif.h hid_cfg_input.h \
+ ../src_plugins/hid_lesstif/xincludes.h compat_misc.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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ find.h rats.h netlist.h library.h route_style.h vtroutestyle.h select.h \
+ operation.h undo.h remove.h crosshair.h draw.h obj_all.h event.h hid.h \
+ hid_actions.h ../src_plugins/hid_lesstif/lesstif.h hid_cfg_input.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/liblihata/genht/htip.h \
- hid_cfg.h ../src_plugins/hid_lesstif/stdarg.h
+ hid_cfg.h compat_nls.h board.h const.h macro.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h \
+ ../src_plugins/hid_lesstif/stdarg.h
../src_plugins/hid_lesstif/stdarg.o: ../src_plugins/hid_lesstif/stdarg.c \
../src_plugins/hid_lesstif/stdarg.h \
../src_plugins/hid_lesstif/xincludes.h
../src_plugins/hid_lesstif/styles.o: ../src_plugins/hid_lesstif/styles.c \
../src_plugins/hid_lesstif/xincludes.h ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- compat_misc.h global.h data.h set.h misc.h mymem.h mymem.h pcb-printf.h \
- hid.h ../src_plugins/hid_lesstif/lesstif.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_cfg.h hid_flags.h \
- ../src_plugins/hid_lesstif/stdarg.h misc_util.h
-../src_plugins/import_dsn/dsn.o: ../src_plugins/import_dsn/dsn.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h error.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h rats.h buffer.h change.h draw.h \
- set.h undo.h pcb-printf.h create.h polygon.h rtree.h compat_misc.h hid.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h compat_misc.h data.h layer.h \
+ attrib.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h pcb-printf.h hid.h \
+ ../src_plugins/hid_lesstif/lesstif.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h compat_nls.h board.h const.h \
+ macro.h vtroutestyle.h library.h rats_patch.h board.h font.h box.h \
+ math_helper.h move.h misc_util.h hid_flags.h \
+ ../src_plugins/hid_lesstif/stdarg.h misc_util.h event.h
+../src_plugins/hid_remote/base64.o: ../src_plugins/hid_remote/base64.c \
+ ../src_plugins/hid_remote/base64.h
+../src_plugins/hid_remote/proto.o: ../src_plugins/hid_remote/proto.c \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h unit.h ../config.h \
+ ../src_plugins/hid_remote/proto_lowcommon.h \
+ ../src_plugins/hid_remote/proto_lowsend.h \
+ ../src_plugins/hid_remote/base64.h \
+ ../src_plugins/hid_remote/proto_lowparse.h layer.h globalconst.h \
+ global_typedefs.h pcb_bool.h attrib.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h
+../src_plugins/hid_remote/remote.o: ../src_plugins/hid_remote/remote.c \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h hid.h error.h drc.h data.h crosshair.h vtonpoint.h \
+ hid.h buffer.h layer.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ plugins.h compat_misc.h event.h ../src_plugins/hid_remote/proto.h \
+ hid_draw_helpers.h hid_nogui.h hid_actions.h hid_init.h dolists.h
+../src_plugins/import_dsn/dsn.o: ../src_plugins/import_dsn/dsn.c \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h rats.h netlist.h route_style.h buffer.h change.h draw.h \
+ undo.h pcb-printf.h ../src_3rd/genvector/gds_char.h polygon.h rtree.h \
+ compat_misc.h compat_nls.h obj_pinvia.h obj_rat.h action_helper.h hid.h \
hid_draw_helpers.h hid_nogui.h hid_actions.h hid_init.h hid_attrib.h \
hid_helper.h plugins.h dolists.h
../src_plugins/import_edif/edif.o: ../src_plugins/import_edif/edif.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h error.h plugins.h \
- compat_misc.h
+ math_helper.h board.h ../config.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h library.h error.h plugins.h compat_misc.h compat_nls.h
../src_plugins/import_edif/import_edif.o: \
- ../src_plugins/import_edif/import_edif.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h plugins.h \
- plug_import.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 netlist.h rats_patch.h plug_io.h
+ ../src_plugins/import_edif/import_edif.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h plugins.h plug_import.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 \
+ netlist.h route_style.h rats_patch.h plug_io.h
+../src_plugins/import_hyp/hyp_l.o: ../src_plugins/import_hyp/hyp_l.c \
+ ../src_plugins/import_hyp/hyp_y.h ../src_plugins/import_hyp/parser.h \
+ pcb_bool.h board.h ../config.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h
+../src_plugins/import_hyp/hyp_y.o: ../src_plugins/import_hyp/hyp_y.c \
+ ../src_plugins/import_hyp/parser.h pcb_bool.h board.h ../config.h \
+ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \
+ attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h
+../src_plugins/import_hyp/import_hyp.o: \
+ ../src_plugins/import_hyp/import_hyp.c ../config.h action_helper.h \
+ global_typedefs.h pcb_bool.h unit.h compat_nls.h hid.h error.h drc.h \
+ attrib.h layer.h globalconst.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h hid_draw_helpers.h \
+ hid_nogui.h hid_actions.h hid.h hid_init.h hid_attrib.h hid_helper.h \
+ plugins.h ../src_plugins/import_hyp/parser.h pcb_bool.h board.h const.h \
+ macro.h vtroutestyle.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h dolists.h
+../src_plugins/import_hyp/parser.o: ../src_plugins/import_hyp/parser.c \
+ ../src_plugins/import_hyp/parser.h pcb_bool.h board.h ../config.h \
+ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \
+ attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h ../src_plugins/import_hyp/hyp_l.h \
+ ../src_plugins/import_hyp/hyp_y.h error.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h obj_all.h flag_str.h layer.h data.h \
+ crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h
../src_plugins/import_netlist/import_netlist.o: \
- ../src_plugins/import_netlist/import_netlist.c ../config.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h plugins.h plug_io.h global.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 plug_import.h conf_core.h \
- error.h misc.h mymem.h data.h rats_patch.h compat_misc.h
-../src_plugins/import_sch/import_sch.o: \
- ../src_plugins/import_sch/import_sch.c ../config.h conf_core.h conf.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../src_plugins/import_netlist/import_netlist.c ../config.h board.h \
+ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \
+ attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h plugins.h plug_io.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 \
- global.h data.h action_helper.h change.h error.h undo.h plugins.h misc.h \
- mymem.h compat_fs.h pcb-printf.h remove.h rats.h hid_actions.h \
- ../src_plugins/import_sch/import_sch_conf.h conf.h misc_util.h dolists.h \
+ plug_import.h conf_core.h error.h data.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h rats_patch.h compat_misc.h compat_nls.h paths.h
+../src_plugins/import_sch/import_sch.o: \
+ ../src_plugins/import_sch/import_sch.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h action_helper.h change.h \
+ error.h undo.h plugins.h compat_fs.h pcb-printf.h remove.h rats.h \
+ netlist.h route_style.h hid_actions.h \
+ ../src_plugins/import_sch/import_sch_conf.h conf.h misc_util.h \
+ compat_nls.h compat_misc.h obj_rat.h dolists.h \
../src_plugins/import_sch/import_sch_conf_fields.h
../src_plugins/io_kicad/io_kicad.o: ../src_plugins/io_kicad/io_kicad.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../config.h plugins.h plug_io.h library.h global_typedefs.h pcb_bool.h \
+ unit.h conf.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h plugins.h plug_io.h global.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 ../src_plugins/io_kicad/write.h \
- data.h ../src_plugins/io_kicad/read.h
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_plugins/io_kicad/write.h data.h \
+ globalconst.h layer.h attrib.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h ../src_plugins/io_kicad/read.h
../src_plugins/io_kicad/read.o: ../src_plugins/io_kicad/read.c \
../src_3rd/gensexpr/gsxl.h ../src_3rd/gensexpr/gensexpr_impl.h \
../src_3rd/gensexpr/gsx_parse.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- compat_misc.h ../config.h plug_io.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/hash.h conf.h \
+ compat_misc.h ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h plug_io.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/genvector/vtp0.h \
- list_conf.h error.h data.h ../src_plugins/io_kicad/read.h global.h \
- layer.h const.h netlist.h create.h polygon.h rtree.h misc.h mymem.h \
- misc_util.h conf_core.h move.h macro.h
+ list_conf.h error.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h ../src_plugins/io_kicad/read.h layer.h const.h netlist.h \
+ route_style.h polygon.h rtree.h misc_util.h conf_core.h move.h macro.h \
+ obj_all.h
../src_plugins/io_kicad/uniq_name.o: ../src_plugins/io_kicad/uniq_name.c \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/io_kicad/uniq_name.h \
- ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \
- ../src_3rd/liblihata/genht/ht_inlines.h compat_misc.h ../config.h
-../src_plugins/io_kicad/write.o: ../src_plugins/io_kicad/write.c \
- plug_io.h global.h ../config.h const.h macro.h global_typedefs.h \
- pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h \
- globalconst.h polyarea.h list_common.h list_line.h \
- ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
- ../src_3rd/genlist/gentdlist_undef.h list_arc.h list_text.h list_poly.h \
- list_pad.h list_pin.h list_rat.h vtonpoint.h \
- ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/liblihata/genht/hash.h ../config.h \
+ ../src_plugins/io_kicad/uniq_name.h ../src_3rd/liblihata/genht/htsp.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf.h pcb-printf.h \
+ compat_misc.h
+../src_plugins/io_kicad/write.o: ../src_plugins/io_kicad/write.c \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h plug_io.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 \
error.h ../src_plugins/io_kicad/uniq_name.h \
- ../src_3rd/liblihata/genht/htsp.h data.h ../src_plugins/io_kicad/write.h \
- global.h layer.h const.h netlist.h misc.h mymem.h
+ ../src_3rd/liblihata/genht/htsp.h data.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h ../src_plugins/io_kicad/write.h layer.h const.h \
+ netlist.h route_style.h obj_all.h
../src_plugins/io_kicad_legacy/io_kicad_legacy.o: \
- ../src_plugins/io_kicad_legacy/io_kicad_legacy.c ../config.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h plugins.h plug_io.h global.h conf.h \
+ ../src_plugins/io_kicad_legacy/io_kicad_legacy.c ../config.h plugins.h \
+ plug_io.h library.h global_typedefs.h pcb_bool.h unit.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/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
../src_3rd/genvector/vtp0.h list_conf.h \
- ../src_plugins/io_kicad_legacy/write.h data.h
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_plugins/io_kicad_legacy/write.h \
+ data.h globalconst.h layer.h attrib.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h
../src_plugins/io_kicad_legacy/write.o: \
- ../src_plugins/io_kicad_legacy/write.c plug_io.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_plugins/io_kicad_legacy/write.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h plug_io.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 \
error.h ../src_plugins/io_kicad_legacy/../io_kicad/uniq_name.h \
- ../src_3rd/liblihata/genht/htsp.h data.h \
- ../src_plugins/io_kicad_legacy/write.h global.h layer.h const.h \
- netlist.h misc.h mymem.h
+ ../src_3rd/liblihata/genht/htsp.h data.h crosshair.h vtonpoint.h hid.h \
+ error.h drc.h buffer.h ../src_plugins/io_kicad_legacy/write.h layer.h \
+ const.h netlist.h route_style.h obj_all.h
../src_plugins/io_lihata/common.o: ../src_plugins/io_lihata/common.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h macro.h \
- ../src_plugins/io_lihata/common.h
+ ../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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ macro.h ../src_plugins/io_lihata/common.h
../src_plugins/io_lihata/io_lihata.o: \
- ../src_plugins/io_lihata/io_lihata.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_plugins/io_lihata/io_lihata.c ../config.h plugins.h plug_io.h \
+ library.h global_typedefs.h pcb_bool.h unit.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h plugins.h plug_io.h global.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 ../src_plugins/io_lihata/read.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_plugins/io_lihata/read.h \
../src_plugins/io_lihata/write.h ../src_plugins/io_lihata/io_lihata.h \
conf.h ../src_plugins/io_lihata/lht_conf.h \
../src_plugins/io_lihata/lht_conf_fields.h
@@ -1622,199 +2036,222 @@
../src_3rd/liblihata/tree.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/liblihata/genht/ht_inlines.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/hash.h data.h \
- global.h plugins.h plug_io.h conf.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
- ../src_3rd/genvector/vtp0.h list_conf.h strflags.h compat_misc.h macro.h \
- error.h misc.h mymem.h misc_util.h layer.h create.h vtptr.h \
- ../src_plugins/io_lihata/common.h polygon.h rtree.h conf_core.h
+ ../src_3rd/liblihata/genht/ht_inlines.h ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h plugins.h plug_io.h conf.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
+ flag_str.h compat_misc.h macro.h error.h misc_util.h layer.h vtptr.h \
+ ../src_plugins/io_lihata/common.h polygon.h rtree.h conf_core.h \
+ obj_all.h
../src_plugins/io_lihata/write.o: ../src_plugins/io_lihata/write.c \
../src_3rd/liblihata/tree.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/liblihata/genht/ht_inlines.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/hash.h data.h \
- global.h plugins.h plug_io.h conf.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
- ../src_3rd/genvector/vtp0.h list_conf.h strflags.h compat_misc.h \
- rats_patch.h hid_actions.h misc_util.h macro.h layer.h \
- ../src_plugins/io_lihata/common.h ../src_plugins/io_lihata/write_style.h \
- ../src_3rd/liblhtpers/lhtpers.h ../src_plugins/io_lihata/io_lihata.h \
- conf.h ../src_plugins/io_lihata/lht_conf.h
+ ../src_3rd/liblihata/genht/ht_inlines.h ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h plugins.h plug_io.h conf.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \
+ flag_str.h compat_misc.h rats_patch.h hid_actions.h misc_util.h macro.h \
+ layer.h ../src_plugins/io_lihata/common.h \
+ ../src_plugins/io_lihata/write_style.h ../src_3rd/liblhtpers/lhtpers.h \
+ ../src_plugins/io_lihata/io_lihata.h conf.h \
+ ../src_plugins/io_lihata/lht_conf.h paths.h
../src_plugins/io_lihata/write_style.o: \
- ../src_plugins/io_lihata/write_style.c \
+ ../src_plugins/io_lihata/write_style.c ../config.h \
../src_plugins/io_lihata/write_style.h ../src_3rd/liblhtpers/lhtpers.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/liblihata/genht/ht_inlines.h
-../src_plugins/io_pcb/attribs.o: ../src_plugins/io_pcb/attribs.c conf.h \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+../src_plugins/io_pcb/attribs.o: ../src_plugins/io_pcb/attribs.c \
+ ../config.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- conf.h misc.h mymem.h compat_misc.h
-../src_plugins/io_pcb/file.o: ../src_plugins/io_pcb/file.c ../config.h \
- conf_core.h conf.h global.h const.h macro.h global_typedefs.h pcb_bool.h \
- unit.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h board.h const.h macro.h vtroutestyle.h \
+ attrib.h layer.h globalconst.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h compat_misc.h
+../src_plugins/io_pcb/file.o: ../src_plugins/io_pcb/file.c ../config.h \
+ conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h buffer.h change.h create.h crosshair.h data.h error.h \
- ../src_plugins/io_pcb/file.h plug_io.h hid.h layer.h misc.h mymem.h \
- move.h mymem.h ../src_plugins/io_pcb/parse_common.h pcb-printf.h \
- polygon.h rtree.h rats.h remove.h set.h strflags.h compat_fs.h paths.h \
- rats_patch.h hid_actions.h hid_flags.h ../src_plugins/io_pcb/flags.h \
- ../src_plugins/io_pcb/attribs.h route_style.h
-../src_plugins/io_pcb/flags.o: ../src_plugins/io_pcb/flags.c strflags.h \
- global_objs.h ../src_3rd/genlist/gendlist.h ../config.h globalconst.h \
- global_typedefs.h pcb_bool.h unit.h polyarea.h \
- ../src_plugins/io_pcb/flags.h const.h macro.h
-../src_plugins/io_pcb/io_pcb.o: ../src_plugins/io_pcb/io_pcb.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h plugins.h \
- ../src_plugins/io_pcb/parse_common.h plug_io.h global.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 ../src_plugins/io_pcb/file.h
-../src_plugins/io_pcb/parse_l.o: ../src_plugins/io_pcb/parse_l.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h buffer.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ attrib.h change.h crosshair.h vtonpoint.h hid.h error.h drc.h layer.h \
+ obj_all_list.h obj_arc_list.h obj_arc.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h data.h crosshair.h buffer.h error.h \
+ ../src_plugins/io_pcb/file.h board.h const.h macro.h vtroutestyle.h \
+ library.h rats_patch.h board.h font.h box.h math_helper.h move.h \
+ misc_util.h plug_io.h hid.h layer.h move.h \
+ ../src_plugins/io_pcb/parse_common.h pcb-printf.h polygon.h rtree.h \
+ rats.h netlist.h route_style.h remove.h flag_str.h compat_fs.h paths.h \
+ rats_patch.h hid_actions.h hid_flags.h ../src_plugins/io_pcb/attribs.h \
+ route_style.h obj_poly.h
+../src_plugins/io_pcb/io_pcb.o: ../src_plugins/io_pcb/io_pcb.c \
+ ../config.h plugins.h ../src_plugins/io_pcb/parse_common.h plug_io.h \
+ library.h global_typedefs.h pcb_bool.h unit.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h ../src_plugins/io_pcb/flags.h crosshair.h data.h error.h \
- ../src_plugins/io_pcb/file.h plug_io.h mymem.h misc.h mymem.h strflags.h \
- ../src_plugins/io_pcb/parse_common.h ../src_plugins/io_pcb/parse_y.h \
- create.h plug_footprint.h vtlibrary.h ../src_plugins/io_pcb/attribs.h \
- compat_misc.h
-../src_plugins/io_pcb/parse_y.o: ../src_plugins/io_pcb/parse_y.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_plugins/io_pcb/file.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h
+../src_plugins/io_pcb/parse_l.o: ../src_plugins/io_pcb/parse_l.c \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h layer.h create.h data.h error.h ../src_plugins/io_pcb/file.h \
- plug_io.h mymem.h misc.h mymem.h ../src_plugins/io_pcb/parse_l.h \
- polygon.h rtree.h remove.h rtree.h strflags.h thermal.h rats_patch.h \
- ../src_plugins/io_pcb/flags.h route_style.h compat_misc.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h flag_str.h flag.h \
+ crosshair.h vtonpoint.h hid.h error.h drc.h attrib.h layer.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h data.h crosshair.h \
+ buffer.h error.h ../src_plugins/io_pcb/file.h board.h const.h macro.h \
+ vtroutestyle.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h plug_io.h ../src_plugins/io_pcb/parse_common.h \
+ ../src_plugins/io_pcb/parse_y.h plug_footprint.h vtlibrary.h \
+ ../src_plugins/io_pcb/attribs.h compat_misc.h compat_cc.h obj_common.h \
+ paths.h
+../src_plugins/io_pcb/parse_y.o: ../src_plugins/io_pcb/parse_y.c \
+ ../config.h flag.h globalconst.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h library.h \
+ rats_patch.h board.h font.h box.h math_helper.h move.h misc_util.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 layer.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h error.h \
+ ../src_plugins/io_pcb/file.h plug_io.h ../src_plugins/io_pcb/parse_l.h \
+ polygon.h rtree.h remove.h rtree.h flag_str.h obj_pinvia_therm.h \
+ rats_patch.h route_style.h compat_misc.h obj_all.h \
../src_plugins/io_pcb/parse_y.h
../src_plugins/jostle/jostle.o: ../src_plugins/jostle/jostle.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h rats.h \
- polygon.h rtree.h remove.h error.h set.h pcb-printf.h plugins.h \
- hid_actions.h layer.h conf_core.h conf.h pcb-printf.h \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h hid.h rtree.h undo.h rats.h netlist.h route_style.h polygon.h \
+ rtree.h remove.h error.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ plugins.h hid_actions.h layer.h conf_core.h conf.h pcb-printf.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 misc_util.h dolists.h
+ ../src_3rd/genvector/vtp0.h list_conf.h misc_util.h obj_line.h event.h \
+ dolists.h
../src_plugins/lib_gensexpr/lib_gensexpr.o: \
../src_plugins/lib_gensexpr/lib_gensexpr.c plugins.h
../src_plugins/lib_legacy_func/lib_legacy_func.o: \
../src_plugins/lib_legacy_func/lib_legacy_func.c \
../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h hid.h error.h vtroutestyle.h global_element.h list_element.h \
- ht_element.h ../src_3rd/liblihata/genht/ht.h \
- ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h action_helper.h \
- change.h error.h undo.h plugins.h
+ ../src_3rd/genvector/genvector_undef.h ../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/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h action_helper.h change.h \
+ error.h undo.h library.h plugins.h
../src_plugins/loghid/loghid.o: ../src_plugins/loghid/loghid.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf.h global.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- conf.h data.h action_helper.h change.h error.h undo.h plugins.h \
- hid_init.h hid_attrib.h dolists.h
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h data.h globalconst.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h action_helper.h change.h \
+ error.h undo.h library.h plugins.h hid_init.h hid_attrib.h dolists.h
../src_plugins/mincut/pcb-mincut/graph.o: \
../src_plugins/mincut/pcb-mincut/graph.c \
../src_plugins/mincut/pcb-mincut/graph.h \
@@ -1826,151 +2263,167 @@
../src_plugins/mincut/pcb-mincut/../../../config.h compat_misc.h \
../config.h
../src_plugins/mincut/rats_mincut.o: ../src_plugins/mincut/rats_mincut.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h create.h global.h data.h draw.h \
- error.h plug_io.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 find.h misc.h mymem.h mymem.h \
- polygon.h rtree.h rats.h search.h misc_util.h set.h undo.h plugins.h \
- compat_misc.h ../src_plugins/mincut/pcb-mincut/graph.h \
+ ../config.h const.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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ draw.h error.h plug_io.h library.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 \
+ find.h polygon.h rtree.h math_helper.h search.h rats.h netlist.h \
+ route_style.h vtroutestyle.h misc_util.h undo.h plugins.h compat_misc.h \
+ rats.h ../src_plugins/mincut/pcb-mincut/graph.h \
../src_plugins/mincut/pcb-mincut/../../../config.h \
../src_plugins/mincut/pcb-mincut/solve.h \
../src_plugins/mincut/pcb-mincut/graph.h conf.h \
../src_plugins/mincut/rats_mincut_conf.h stub_mincut.h \
../src_plugins/mincut/rats_mincut_conf_fields.h
../src_plugins/oldactions/oldactions.o: \
- ../src_plugins/oldactions/oldactions.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf.h global.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_plugins/oldactions/oldactions.c ../config.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- conf.h data.h action_helper.h change.h error.h undo.h plugins.h \
- hid_actions.h plug_footprint.h vtlibrary.h dolists.h
-../src_plugins/polycombine/polycombine.o: \
- ../src_plugins/polycombine/polycombine.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h macro.h create.h \
- remove.h hid.h error.h rtree.h polygon.h rtree.h polyarea.h strflags.h \
- find.h misc.h ../src_3rd/genvector/gds_char.h mymem.h draw.h undo.h \
- plugins.h hid_actions.h dolists.h
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h data.h globalconst.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h action_helper.h change.h \
+ error.h undo.h library.h plugins.h hid_actions.h plug_footprint.h \
+ vtlibrary.h dolists.h
+../src_plugins/polycombine/polycombine.o: \
+ ../src_plugins/polycombine/polycombine.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h macro.h remove.h hid.h error.h rtree.h polygon.h rtree.h \
+ polyarea.h flag_str.h find.h draw.h undo.h plugins.h hid_actions.h \
+ obj_poly.h dolists.h
../src_plugins/polystitch/polystitch.o: \
- ../src_plugins/polystitch/polystitch.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h macro.h create.h \
- remove.h hid.h error.h rtree.h draw.h set.h polygon.h rtree.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h plugins.h hid_actions.h \
- dolists.h
+ ../src_plugins/polystitch/polystitch.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h macro.h remove.h hid.h error.h rtree.h draw.h polygon.h rtree.h \
+ plugins.h hid_actions.h obj_poly.h obj_poly_draw.h dolists.h
../src_plugins/propedit/propedit.o: ../src_plugins/propedit/propedit.c \
- plugins.h ../src_plugins/propedit/props.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ plugins.h ../config.h ../src_plugins/propedit/props.h global_typedefs.h \
+ pcb_bool.h unit.h ../src_3rd/liblihata/genht/htsp.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/liblihata/genht/htsp.h \
../src_3rd/liblihata/genht/ht.h ../src_plugins/propedit/propsel.h \
- hid_actions.h pcb-printf.h ../src_3rd/genvector/gds_char.h error.h \
- dolists.h
+ hid_actions.h hid.h error.h drc.h global_typedefs.h attrib.h layer.h \
+ globalconst.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h error.h dolists.h
../src_plugins/propedit/props.o: ../src_plugins/propedit/props.c \
- ../src_plugins/propedit/props.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/liblihata/genht/htsp.h \
- ../src_3rd/liblihata/genht/ht.h ../src_plugins/propedit/propsel.h \
- compat_misc.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../config.h ../src_plugins/propedit/props.h global_typedefs.h pcb_bool.h \
+ unit.h ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_plugins/propedit/propsel.h compat_misc.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h \
+ global_typedefs.h attrib.h layer.h globalconst.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h \
../src_3rd/liblihata/genht/ht.c
../src_plugins/propedit/propsel.o: ../src_plugins/propedit/propsel.c \
- data.h global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h \
- unit.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/propedit/props.h \
- global.h ../src_3rd/liblihata/genht/htsp.h \
- ../src_3rd/liblihata/genht/ht.h ../src_plugins/propedit/propsel.h \
- change.h misc.h ../src_3rd/genvector/gds_char.h mymem.h misc_util.h \
- compat_misc.h undo.h rotate.h
+ ../config.h const.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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ ../src_plugins/propedit/props.h global_typedefs.h \
+ ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_plugins/propedit/propsel.h change.h misc_util.h compat_misc.h \
+ undo.h library.h rotate.h
../src_plugins/puller/puller.o: ../src_plugins/puller/puller.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h create.h data.h draw.h misc.h mymem.h move.h pcb-printf.h \
- remove.h rtree.h strflags.h undo.h layer.h plugins.h hid_actions.h \
- misc_util.h dolists.h
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h draw.h move.h pcb-printf.h \
+ remove.h rtree.h flag_str.h undo.h layer.h plugins.h hid_actions.h \
+ misc_util.h obj_all.h compat_misc.h dolists.h
../src_plugins/query/basic_fnc.o: ../src_plugins/query/basic_fnc.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
../src_plugins/query/query_access.h ../src_plugins/query/query.h \
obj_any.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/genregex/regex_se.h \
@@ -1979,269 +2432,316 @@
../src_plugins/query/fields_sphash.o: \
../src_plugins/query/fields_sphash.c
../src_plugins/query/query.o: ../src_plugins/query/query.c ../config.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
../src_3rd/liblihata/genht/hash.h ../src_3rd/liblihata/genht/htsi.h \
- ../src_3rd/liblihata/genht/ht.h conf.h global.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ conf.h global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/genvector/vtp0.h list_conf.h conf.h data.h action_helper.h \
- change.h error.h undo.h plugins.h hid_init.h hid_actions.h compat_misc.h \
- ../src_plugins/query/query.h obj_any.h ../src_3rd/genregex/regex_se.h \
- ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
- ../src_plugins/query/fields_sphash.h fptr_cast.h
+ ../src_3rd/genvector/vtp0.h list_conf.h conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h data.h globalconst.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 obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h action_helper.h change.h \
+ error.h undo.h library.h plugins.h hid_init.h hid_actions.h \
+ compat_misc.h ../src_plugins/query/query.h obj_any.h \
+ ../src_3rd/genregex/regex_se.h ../src_3rd/genregex/regex_templ.h \
+ ../src_3rd/genregex/regex.h ../src_plugins/query/fields_sphash.h \
+ fptr_cast.h
../src_plugins/query/query_access.o: ../src_plugins/query/query_access.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h \
- ../src_plugins/query/query_access.h ../src_plugins/query/query.h \
- obj_any.h ../src_3rd/liblihata/genht/htsi.h \
+ ../config.h math_helper.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h ../src_plugins/query/query_access.h \
+ ../src_plugins/query/query.h obj_any.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/genregex/regex_se.h \
../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
../src_plugins/query/fields_sphash.h ../src_plugins/query/query_exec.h \
- misc.h ../src_3rd/genvector/gds_char.h mymem.h layer.h
+ layer.h
../src_plugins/query/query_act.o: ../src_plugins/query/query_act.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../config.h ../src_plugins/query/query.h obj_any.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_plugins/query/query.h obj_any.h \
- ../src_3rd/liblihata/genht/htsi.h ../src_3rd/liblihata/genht/ht.h \
../src_3rd/genregex/regex_se.h ../src_3rd/genregex/regex_templ.h \
../src_3rd/genregex/regex.h ../src_plugins/query/fields_sphash.h \
- ../src_plugins/query/query_y.h ../src_plugins/query/query_exec.h set.h \
- global.h draw.h select.h macro.h dolists.h
+ ../src_plugins/query/query_y.h ../src_plugins/query/query_exec.h const.h \
+ draw.h hid.h error.h drc.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h select.h operation.h \
+ board.h const.h macro.h vtroutestyle.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h macro.h dolists.h
../src_plugins/query/query_exec.o: ../src_plugins/query/query_exec.c \
- global.h ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
../src_plugins/query/query.h obj_any.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/genregex/regex_se.h \
../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
../src_plugins/query/fields_sphash.h ../src_plugins/query/query_exec.h \
- ../src_plugins/query/query_access.h
-../src_plugins/query/query_l.o: ../src_plugins/query/query_l.c global.h \
- ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_plugins/query/query_access.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h
+../src_plugins/query/query_l.o: ../src_plugins/query/query_l.c unit.h \
+ ../config.h ../src_plugins/query/query.h obj_any.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h unit.h ../src_plugins/query/query.h \
- obj_any.h ../src_3rd/liblihata/genht/htsi.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/genregex/regex_se.h \
- ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
- ../src_plugins/query/fields_sphash.h ../src_plugins/query/query_y.h \
- compat_misc.h layer.h
-../src_plugins/query/query_y.o: ../src_plugins/query/query_y.c global.h \
- ../config.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genregex/regex_se.h ../src_3rd/genregex/regex_templ.h \
+ ../src_3rd/genregex/regex.h ../src_plugins/query/fields_sphash.h \
+ ../src_plugins/query/query_y.h compat_misc.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h \
+ obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h \
+ obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h \
+ obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h
+../src_plugins/query/query_y.o: ../src_plugins/query/query_y.c const.h \
+ unit.h ../config.h ../src_plugins/query/query.h obj_any.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/liblihata/genht/htsi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h unit.h ../src_plugins/query/query.h \
- obj_any.h ../src_3rd/liblihata/genht/htsi.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/genregex/regex_se.h \
- ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
- ../src_plugins/query/fields_sphash.h ../src_plugins/query/query_l.h \
- compat_misc.h
+ ../src_3rd/genregex/regex_se.h ../src_3rd/genregex/regex_templ.h \
+ ../src_3rd/genregex/regex.h ../src_plugins/query/fields_sphash.h \
+ ../src_plugins/query/query_l.h compat_misc.h
../src_plugins/renumber/renumber.o: ../src_plugins/renumber/renumber.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h action_helper.h \
- change.h error.h undo.h misc.h ../src_3rd/genvector/gds_char.h mymem.h \
- set.h plugins.h hid_actions.h conf_core.h conf.h pcb-printf.h \
+ ../config.h board.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
+ vtroutestyle.h attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h action_helper.h change.h error.h undo.h plugins.h hid_actions.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 compat_misc.h pcb-printf.h \
- dolists.h
+ ../src_3rd/genvector/vtp0.h list_conf.h compat_misc.h compat_nls.h \
+ netlist.h route_style.h pcb-printf.h dolists.h
../src_plugins/renumber/renumberblock.o: \
- ../src_plugins/renumber/renumberblock.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h error.h \
- change.h conf_core.h conf.h pcb-printf.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
+ ../src_plugins/renumber/renumberblock.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h hid.h rtree.h undo.h error.h change.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
+../src_plugins/report/drill.o: ../src_plugins/report/drill.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/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ ../src_plugins/report/drill.h macro.h obj_pinvia.h
../src_plugins/report/report.o: ../src_plugins/report/report.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_plugins/report/report.h global.h crosshair.h data.h drill.h \
- error.h search.h misc_util.h misc.h mymem.h mymem.h rats.h rtree.h \
- strflags.h macro.h undo.h find.h draw.h pcb-printf.h plugins.h \
- hid_actions.h misc_util.h ../src_plugins/report/report_conf.h conf.h \
- compat_misc.h layer.h ../src_3rd/genregex/regex_sei.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
+ ../src_plugins/report/report.h math_helper.h crosshair.h vtonpoint.h \
+ hid.h error.h drc.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h board.h const.h macro.h \
+ vtroutestyle.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h buffer.h \
+ ../src_plugins/report/drill.h error.h search.h rats.h netlist.h \
+ route_style.h rats.h rtree.h flag_str.h macro.h undo.h find.h draw.h \
+ pcb-printf.h plugins.h action_helper.h hid_actions.h misc_util.h \
+ ../src_plugins/report/report_conf.h conf.h compat_misc.h compat_nls.h \
+ layer.h obj_all.h ../src_3rd/genregex/regex_sei.h \
../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h dolists.h \
../src_plugins/report/report_conf_fields.h
+../src_plugins/rubberband_orig/rubberband.o: \
+ ../src_plugins/rubberband_orig/rubberband.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h error.h event.h undo.h operation.h rotate.h draw.h \
+ obj_rat_draw.h obj_line_op.h operation.h obj_line_draw.h plugins.h \
+ polygon.h rtree.h
../src_plugins/shand_cmd/command.o: ../src_plugins/shand_cmd/command.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- global.h action_helper.h buffer.h ../src_plugins/shand_cmd/command.h \
- data.h error.h plug_io.h mymem.h misc.h mymem.h rats.h set.h plugins.h \
- hid_actions.h compat_misc.h dolists.h
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h build_run.h \
+ action_helper.h buffer.h ../src_plugins/shand_cmd/command.h data.h \
+ crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h error.h plug_io.h \
+ rats.h netlist.h route_style.h plugins.h hid_actions.h compat_misc.h \
+ misc_util.h dolists.h
../src_plugins/smartdisperse/smartdisperse.o: \
../src_plugins/smartdisperse/smartdisperse.c \
../src_3rd/liblihata/genht/htpi.h ../src_3rd/liblihata/genht/ht.h \
- ../src_3rd/liblihata/genht/ht_inlines.h ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/hash.h data.h \
- global.h hid.h misc.h ../src_3rd/genvector/gds_char.h mymem.h create.h \
- rtree.h undo.h rats.h error.h move.h draw.h set.h plugins.h \
- hid_actions.h dolists.h
+ ../src_3rd/liblihata/genht/ht_inlines.h ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h hid.h rtree.h undo.h rats.h \
+ netlist.h route_style.h error.h move.h draw.h plugins.h action_helper.h \
+ hid_actions.h compat_nls.h dolists.h
../src_plugins/stroke/stroke.o: ../src_plugins/stroke/stroke.c \
- ../config.h global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../config.h math_helper.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf.h global.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 \
- conf.h conf_core.h data.h crosshair.h stub_stroke.h rotate.h undo.h \
- set.h error.h misc.h mymem.h plugins.h
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.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 conf.h conf_core.h data.h \
+ crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h crosshair.h \
+ stub_stroke.h rotate.h undo.h error.h plugins.h compat_nls.h
../src_plugins/teardrops/teardrops.o: \
- ../src_plugins/teardrops/teardrops.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h global.h hid.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h create.h rtree.h undo.h \
- plugins.h hid_actions.h dolists.h
-../src_plugins/toporouter/toporouter.o: \
- ../src_plugins/toporouter/toporouter.c \
- ../src_plugins/toporouter/toporouter.h data.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h macro.h \
- ../src_plugins/toporouter/../autoroute/autoroute.h global.h box.h \
- misc_util.h create.h draw.h error.h find.h heap.h rtree.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h mymem.h polygon.h rtree.h rats.h \
- remove.h thermal.h undo.h ../src_3rd/gts/gts.h pcb-printf.h
+ ../src_plugins/teardrops/teardrops.c ../config.h math_helper.h board.h \
+ const.h macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h \
+ attrib.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.h board.h font.h box.h math_helper.h \
+ move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h hid.h rtree.h undo.h plugins.h hid_actions.h obj_all.h \
+ dolists.h
../src_plugins/vendordrill/vendor.o: ../src_plugins/vendordrill/vendor.c \
- ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h unit.h \
+ pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
../src_3rd/genregex/regex_sei.h ../src_3rd/genregex/regex_templ.h \
- ../src_3rd/genregex/regex.h change.h data.h draw.h error.h global.h \
- set.h undo.h ../src_plugins/vendordrill/vendor.h stub_vendor.h plugins.h \
- hid_flags.h hid_actions.h hid_cfg.h \
+ ../src_3rd/genregex/regex.h change.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h board.h \
+ font.h box.h math_helper.h move.h misc_util.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h draw.h error.h undo.h \
+ ../src_plugins/vendordrill/vendor.h stub_vendor.h plugins.h \
+ action_helper.h hid_flags.h hid_actions.h hid_cfg.h \
../src_plugins/vendordrill/vendor_conf.h conf.h compat_misc.h \
- ../src_3rd/liblihata/tree.h dolists.h \
+ compat_nls.h obj_pinvia.h event.h ../src_3rd/liblihata/tree.h dolists.h \
../src_plugins/vendordrill/vendor_conf_fields.h
../src_3rd/gensexpr/gsx_parse.o: ../src_3rd/gensexpr/gsx_parse.c \
../src_3rd/gensexpr/gsx_parse.h
@@ -2348,474 +2848,485 @@
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
../src_3rd/liblihata/dom_internal.h ../src_3rd/liblihata/tree.h \
../src_3rd/liblihata/dom.h
-action_act.o: action_act.c ../config.h error.h action_helper.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid_actions.h undo.h
-action_helper.o: action_helper.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+action_act.o: action_act.c ../config.h action_helper.h global_typedefs.h \
+ pcb_bool.h unit.h hid_actions.h hid.h error.h drc.h attrib.h layer.h \
+ globalconst.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h undo.h library.h compat_nls.h
+action_helper.o: action_helper.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- action_helper.h buffer.h change.h copy.h create.h crosshair.h data.h \
- draw.h find.h insert.h line.h misc.h mymem.h move.h polygon.h rtree.h \
- rats.h remove.h rotate.h rubberband.h search.h misc_util.h select.h \
- set.h undo.h stub_stroke.h funchash_core.h funchash.h \
- funchash_core_list.h hid_actions.h compat_misc.h layer.h
-buffer.o: buffer.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h action_helper.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 change.h copy.h data.h \
+ crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h draw.h find.h \
+ insert.h polygon.h rtree.h remove.h rotate.h search.h rats.h netlist.h \
+ route_style.h select.h operation.h undo.h stub_stroke.h funchash_core.h \
+ funchash.h funchash_core_list.h hid_actions.h compat_misc.h compat_nls.h \
+ event.h obj_pinvia_draw.h obj_pad_draw.h obj_line_draw.h obj_arc_draw.h \
+ obj_elem_draw.h obj_text_draw.h obj_rat_draw.h obj_poly_draw.h
+attrib.o: attrib.c ../config.h compat_misc.h attrib.h
+board.o: board.c ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.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 plug_io.h compat_misc.h \
+ hid_actions.h paths.h rtree.h undo.h draw.h event.h
+box.o: box.c ../config.h rotate.h global_typedefs.h pcb_bool.h unit.h \
+ box.h math_helper.h macro.h move.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h misc_util.h
+buffer.o: buffer.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- action_helper.h buffer.h copy.h create.h crosshair.h data.h plug_io.h \
- mirror.h misc.h mymem.h misc_util.h polygon.h rtree.h rotate.h remove.h \
- select.h set.h funchash_core.h funchash.h funchash_core_list.h \
- compat_misc.h layer.h
-buildin.o: buildin.c plugins.h buildin.h
-change.o: change.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h action_helper.h buffer.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h attrib.h board.h const.h macro.h \
+ vtroutestyle.h layer.h obj_all_list.h obj_arc_list.h obj_arc.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 copy.h data.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h plug_io.h polygon.h rtree.h rotate.h \
+ remove.h select.h operation.h draw.h undo.h funchash_core.h funchash.h \
+ funchash_core_list.h compat_misc.h compat_nls.h obj_all_op.h \
+ obj_arc_op.h obj_elem_op.h obj_line_op.h obj_pad_op.h obj_pinvia_op.h \
+ obj_poly_op.h obj_text_op.h obj_rat_op.h
+build_run.o: build_run.c ../config.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.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/liblihata/genht/ht_inlines.h ../src_3rd/genvector/vtp0.h \
+ list_conf.h ../src_3rd/genlist/gentdlist_undef.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ globalconst.h board.h const.h macro.h vtroutestyle.h attrib.h layer.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h 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 build_run.h \
+ hid_init.h hid.h error.h drc.h plug_io.h compat_misc.h
+buildin.o: buildin.c plugins.h buildin.h
+change.o: change.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- crosshair.h data.h draw.h misc.h mymem.h mirror.h polygon.h rtree.h \
- select.h undo.h hid_actions.h layer.h
-change_act.o: change_act.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h draw.h select.h operation.h undo.h \
+ hid_actions.h compat_nls.h obj_all_op.h obj_arc_op.h obj_elem_op.h \
+ obj_line_op.h obj_pad_op.h obj_pinvia_op.h obj_poly_op.h obj_text_op.h \
+ obj_rat_op.h
+change_act.o: change_act.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h funchash_core.h funchash.h funchash_core_list.h action_helper.h \
- hid_actions.h change.h draw.h search.h misc_util.h misc.h mymem.h set.h \
- undo.h rubberband.h compat_misc.h layer.h
-clip.o: clip.c ../config.h clip.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-compat_dl.o: compat_dl.c ../config.h compat_dl.h compat_inc.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h data.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h funchash_core.h funchash.h \
+ funchash_core_list.h board.h const.h macro.h vtroutestyle.h library.h \
+ rats_patch.h font.h box.h math_helper.h move.h misc_util.h \
+ action_helper.h hid_actions.h change.h draw.h search.h rats.h netlist.h \
+ route_style.h undo.h event.h compat_misc.h compat_nls.h obj_rat_draw.h
+clip.o: clip.c ../config.h clip.h global_typedefs.h pcb_bool.h unit.h
+compat_dl.o: compat_dl.c ../config.h compat_dl.h compat_inc.h
compat_fs.o: compat_fs.c ../config.h compat_inc.h compat_fs.h \
- compat_misc.h ../src_3rd/genvector/gds_char.h \
+ compat_misc.h compat_nls.h globalconst.h ../src_3rd/genvector/gds_char.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h hid.h error.h vtroutestyle.h global_element.h list_element.h \
- ht_element.h ../src_3rd/liblihata/genht/ht.h \
- ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h mymem.h
+ ../src_3rd/genvector/genvector_undef.h error.h
compat_lrealpath.o: compat_lrealpath.c ../config.h compat_lrealpath.h \
compat_misc.h
-compat_misc.o: compat_misc.c ../config.h compat_misc.h compat_inc.h \
- global.h const.h macro.h global_typedefs.h pcb_bool.h unit.h \
- global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h \
- list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
+compat_misc.o: compat_misc.c ../config.h compat_misc.h compat_inc.h
conf.o: conf.c ../src_3rd/liblihata/genht/hash.h \
../src_3rd/liblihata/tree.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/liblihata/genht/ht_inlines.h conf.h global.h ../config.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
- ../src_3rd/genvector/vtp0.h list_conf.h conf_core.h conf_hid.h hid_cfg.h \
- hid_init.h hid_attrib.h misc_util.h paths.h compat_fs.h compat_misc.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h ../config.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h conf_core.h globalconst.h conf_hid.h \
+ error.h hid_cfg.h misc_util.h paths.h compat_fs.h compat_misc.h \
../src_3rd/genvector/genvector_impl.c
-conf_act.o: conf_act.c global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.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 \
- conf_core.h misc.h mymem.h misc_util.h route_style.h
-conf_core.o: conf_core.c conf.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+conf_act.o: conf_act.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 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 \
- conf_core.h conf_core_fields.h
-conf_hid.o: conf_hid.c conf_hid.h conf.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ route_style.h error.h hid.h drc.h
+conf_core.o: conf_core.c ../config.h conf.h global_typedefs.h pcb_bool.h \
+ unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_3rd/liblihata/genht/htpp.h conf_core.h
-conf_internal.o: conf_internal.c
-copy.o: copy.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h conf_core.h globalconst.h \
+ conf_core_fields.h
+conf_hid.o: conf_hid.c ../config.h conf_hid.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- create.h data.h draw.h misc.h mymem.h layer.h move.h polygon.h rtree.h \
- select.h undo.h compat_misc.h
-create.o: create.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h error.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/liblihata/genht/htpp.h conf_core.h globalconst.h
+conf_internal.o: conf_internal.c
+copy.o: copy.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- create.h data.h misc.h mymem.h layer.h rtree.h search.h misc_util.h \
- undo.h plug_io.h stub_vendor.h hid_actions.h paths.h compat_misc.h
-crosshair.o: crosshair.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h draw.h select.h operation.h undo.h \
+ obj_all_op.h obj_arc_op.h obj_elem_op.h obj_line_op.h obj_pad_op.h \
+ obj_pinvia_op.h obj_poly_op.h obj_text_op.h obj_rat_op.h
+crosshair.o: crosshair.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- box.h misc_util.h crosshair.h data.h draw.h line.h rtree.h search.h \
- polygon.h misc.h mymem.h hid_actions.h layer.h compat_misc.h
-data.o: data.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-draw.o: draw.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 crosshair.h vtonpoint.h hid.h \
+ error.h drc.h data.h buffer.h draw.h search.h rats.h netlist.h \
+ route_style.h polygon.h rtree.h hid_actions.h compat_misc.h compat_nls.h \
+ find.h undo.h event.h action_helper.h obj_line_draw.h obj_arc_draw.h \
+ obj_arc_ui.h
+data.o: data.c ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ rtree.h list_common.h obj_all.h
+draw.o: draw.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h draw.h misc.h mymem.h rotate.h rtree.h draw_fab.h hid_helper.h \
- layer.h
-draw_fab.o: draw_fab.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h draw.h drill.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h draw_fab.h polygon.h rtree.h \
- layer.h
-drill.o: drill.c ../config.h mymem.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-error.o: error.c ../config.h global.h const.h macro.h global_typedefs.h \
- pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h \
- globalconst.h polyarea.h list_common.h list_line.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h hid.h error.h \
+ drc.h buffer.h draw.h rotate.h rtree.h stub_draw_fab.h obj_all.h \
+ layer_ui.h obj_pad_draw.h obj_pinvia_draw.h obj_elem_draw.h \
+ obj_line_draw.h obj_arc_draw.h obj_rat_draw.h obj_poly_draw.h \
+ obj_text_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/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
- ../src_3rd/genlist/gentdlist_undef.h list_arc.h list_text.h list_poly.h \
- list_pad.h list_pin.h list_rat.h vtonpoint.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ plug_io.h library.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 compat_misc.h compat_nls.h \
+ conf_core.h
+event.o: event.c ../config.h event.h unit.h error.h fptr_cast.h
+file_act.o: file_act.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h plug_io.h conf.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 build_run.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 \
- compat_misc.h
-event.o: event.c event.h error.h fptr_cast.h
-file_act.o: file_act.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ data.h crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h \
+ action_helper.h plug_io.h plug_import.h remove.h draw.h find.h search.h \
+ rats.h netlist.h route_style.h hid_actions.h compat_misc.h compat_nls.h \
+ hid_init.h layer_vis.h
+find.o: find.c ../config.h const.h math_helper.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h action_helper.h crosshair.h set.h plug_io.h plug_import.h \
- buffer.h misc.h mymem.h remove.h create.h draw.h find.h search.h \
- misc_util.h hid_actions.h hid_attrib.h compat_misc.h
-find.o: find.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h data.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h draw.h find.h rtree.h polygon.h \
+ search.h rats.h netlist.h library.h route_style.h vtroutestyle.h \
+ misc_util.h undo.h plug_io.h hid_actions.h compat_misc.h event.h \
+ layer_vis.h obj_all.h find_geo.c macro.h find_lookup.c compat_nls.h \
+ board.h rats_patch.h font.h box.h move.h find_drc.c obj_arc_draw.h \
+ obj_pad_draw.h obj_rat_draw.h obj_line_draw.h obj_elem_draw.h \
+ obj_poly_draw.h obj_pinvia_draw.h find_misc.c find_clear.c find_debug.c \
+ find_print.c
+find_act.o: find_act.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 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 \
- data.h draw.h find.h misc.h mymem.h rtree.h polygon.h search.h \
- misc_util.h set.h undo.h rats.h plug_io.h hid_actions.h compat_misc.h \
- layer.h find_geo.c find_lookup.c find_drc.c find_misc.c find_clear.c \
- find_debug.c find_print.c
-find_act.o: find_act.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ data.h crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h find.h \
+ compat_nls.h
+flag.o: flag.c ../config.h flag.h globalconst.h
+flag_str.o: flag_str.c ../config.h const.h flag_str.h flag.h \
+ globalconst.h compat_misc.h macro.h
+font.o: font.c ../config.h font.h global_typedefs.h pcb_bool.h unit.h \
+ box.h math_helper.h macro.h move.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h misc_util.h board.h const.h vtroutestyle.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h rats_patch.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 \
- data.h find.h
-fptr_cast.o: fptr_cast.c fptr_cast.h
-free_atexit.o: free_atexit.c
+ error.h plug_io.h paths.h compat_nls.h
+fptr_cast.o: fptr_cast.c ../config.h fptr_cast.h
+free_atexit.o: free_atexit.c ../config.h
funchash.o: funchash.c ../src_3rd/liblihata/genht/htpi.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
../src_3rd/liblihata/genht/hash.h funchash_core.h funchash.h \
- funchash_core_list.h macro.h
-gui_act.o: gui_act.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ funchash_core_list.h ../config.h macro.h compat_misc.h
+gui_act.o: gui_act.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 build_run.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 \
- data.h action_helper.h undo.h funchash_core.h funchash.h \
- funchash_core_list.h draw.h search.h misc_util.h crosshair.h find.h \
- set.h misc.h mymem.h stub_stroke.h hid_actions.h hid_init.h \
- route_style.h layer.h
-heap.o: heap.c ../config.h heap.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-hid_actions.o: hid_actions.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ data.h crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h \
+ action_helper.h undo.h funchash_core.h funchash.h funchash_core_list.h \
+ draw.h search.h rats.h netlist.h route_style.h find.h stub_stroke.h \
+ hid_actions.h hid_init.h compat_nls.h compat_misc.h event.h layer_vis.h \
+ obj_elem_draw.h obj_pinvia_draw.h obj_pad_draw.h
+heap.o: heap.c ../config.h heap.h
+hid_actions.o: hid_actions.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_3rd/liblihata/genht/htsp.h event.h hid_actions.h compat_misc.h
-hid_attrib.o: hid_attrib.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid_attrib.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h misc_util.h pcb-printf.h \
- compat_fs.h
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/liblihata/genht/htsp.h \
+ error.h event.h hid_actions.h hid.h drc.h attrib.h layer.h \
+ obj_all_list.h obj_arc_list.h obj_common.h ../src_3rd/genlist/gendlist.h \
+ flag.h obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h compat_misc.h \
+ compat_nls.h
+hid_attrib.o: hid_attrib.c ../config.h hid_attrib.h hid.h error.h drc.h \
+ unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h misc_util.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h
hid_cfg.o: hid_cfg.c ../src_3rd/liblihata/lihata.h \
../src_3rd/liblihata/tree.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/liblihata/genht/ht_inlines.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/hash.h \
- hid_cfg.h paths.h compat_misc.h
-hid_cfg_action.o: hid_cfg_action.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid_cfg_action.h hid_cfg.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h ../config.h hid_cfg.h error.h \
+ paths.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h compat_misc.h
+hid_cfg_action.o: hid_cfg_action.c ../config.h hid_cfg_action.h hid_cfg.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 hid_actions.h
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ hid_actions.h hid.h error.h drc.h unit.h global_typedefs.h pcb_bool.h \
+ attrib.h layer.h globalconst.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h
hid_cfg_input.o: hid_cfg_input.c ../src_3rd/liblihata/lihata.h \
../src_3rd/liblihata/tree.h ../src_3rd/liblihata/dom.h \
../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \
@@ -2823,857 +3334,1034 @@ hid_cfg_input.o: hid_cfg_input.c ../src_3rd/liblihata/lihata.h \
../src_3rd/liblihata/genht/ht_inlines.h \
../src_3rd/liblihata/genht/hash.h ../src_3rd/genvector/gds_char.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h hid.h error.h vtroutestyle.h global_element.h list_element.h \
- ht_element.h ../src_3rd/liblihata/genht/ht.h hid_cfg.h hid_cfg_input.h \
- ../src_3rd/liblihata/genht/htip.h hid_actions.h hid_cfg_action.h
-hid_color.o: hid_color.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid_color.h compat_misc.h \
- ../src_3rd/liblihata/genht/ht.c
-hid_draw_helpers.o: hid_draw_helpers.c global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h polygon.h rtree.h
-hid_extents.o: hid_extents.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h layer.h hid_draw_helpers.h \
- hid_helper.h
-hid_flags.o: hid_flags.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h misc.h ../src_3rd/genvector/gds_char.h \
- mymem.h conf.h pcb-printf.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 \
- hid_flags.h ../src_3rd/liblihata/genht/htsp.h hid_actions.h
-hid_helper.o: hid_helper.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h misc.h ../src_3rd/genvector/gds_char.h \
- mymem.h layer.h hid_helper.h hid_attrib.h compat_misc.h
-hid_init.o: hid_init.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid_nogui.h compat_dl.h compat_inc.h \
- misc.h ../src_3rd/genvector/gds_char.h mymem.h plugins.h hid_attrib.h \
- hid_flags.h misc_util.h conf_core.h conf.h pcb-printf.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 compat_misc.h fptr_cast.h
-hid_nogui.o: hid_nogui.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h compat_misc.h
-ht_element.o: ht_element.c global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/liblihata/genht/ht.c
-insert.o: insert.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.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 \
- create.h crosshair.h data.h draw.h line.h misc.h mymem.h polygon.h \
- rtree.h search.h misc_util.h select.h set.h undo.h layer.h
-intersect.o: intersect.c ../config.h intersect.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-layer.o: layer.c global.h ../config.h const.h macro.h global_typedefs.h \
- pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h \
- globalconst.h polyarea.h list_common.h list_line.h \
- ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
- ../src_3rd/genlist/gentdlist_undef.h list_arc.h list_text.h list_poly.h \
- list_pad.h list_pin.h list_rat.h vtonpoint.h \
+ ../src_3rd/genvector/genvector_undef.h ../config.h hid_cfg_input.h \
+ ../src_3rd/liblihata/genht/htip.h hid_cfg.h hid_cfg_action.h error.h \
+ compat_misc.h
+hid_color.o: hid_color.c ../config.h hid_color.h hid.h error.h drc.h \
+ unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h compat_misc.h ../src_3rd/liblihata/genht/ht.c
+hid_draw_helpers.o: hid_draw_helpers.c ../config.h hid.h error.h drc.h \
+ unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h polygon.h rtree.h math_helper.h macro.h
+hid_extents.o: hid_extents.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h conf_core.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ hid_draw_helpers.h hid_extents.h
+hid_flags.o: hid_flags.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/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ board.h const.h macro.h vtroutestyle.h library.h rats_patch.h font.h \
+ box.h math_helper.h move.h misc_util.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 \
- layer.h hid_actions.h compat_misc.h
-line.o: line.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ hid_flags.h ../src_3rd/liblihata/genht/htsp.h hid_actions.h
+hid_helper.o: hid_helper.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ hid_helper.h hid_attrib.h compat_misc.h
+hid_init.o: hid_init.c ../config.h hid.h error.h drc.h unit.h \
+ global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h hid_nogui.h compat_dl.h compat_inc.h plugins.h hid_attrib.h \
+ hid_init.h misc_util.h conf_core.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h crosshair.h find.h line.h misc.h mymem.h rtree.h layer.h
-list_arc.o: list_arc.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_arc.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-list_conf.o: list_conf.c conf.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ compat_misc.h fptr_cast.h
+hid_nogui.o: hid_nogui.c ../config.h hid.h error.h drc.h unit.h \
+ global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h compat_misc.h compat_nls.h conf_core.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- ../src_3rd/genlist/gentdlist_impl.c
-list_element.o: list_element.c global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gentdlist_impl.c
-list_line.o: list_line.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-list_pad.o: list_pad.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_pad.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-list_pin.o: list_pin.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_pin.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-list_poly.o: list_poly.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_poly.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-list_rat.o: list_rat.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_rat.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-list_text.o: list_text.c global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- list_text.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- ../src_3rd/genlist/gentdlist_impl.c
-main.o: main.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/genvector/vtp0.h list_conf.h
+ht_element.o: ht_element.c ../config.h obj_elem_list.h obj_elem.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.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 \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h ../src_3rd/liblihata/genht/ht.c
+insert.o: insert.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h buffer.h create.h crosshair.h plug_io.h set.h layer.h misc.h \
- mymem.h compat_lrealpath.h free_atexit.h polygon.h rtree.h buildin.h \
- paths.h strflags.h plugins.h plug_footprint.h vtlibrary.h event.h \
- funchash.h hid_actions.h hid_attrib.h hid_init.h compat_misc.h dolists.h \
- generated_lists.h
-main_act.o: main_act.c ../config.h action_helper.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h hid_actions.h hid_attrib.h hid_init.h \
- data.h conf_core.h conf.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h select.h operation.h undo.h obj_line_op.h \
+ obj_arc_op.h obj_rat_op.h obj_poly_op.h
+intersect.o: intersect.c ../config.h intersect.h global_typedefs.h \
+ pcb_bool.h unit.h box.h math_helper.h macro.h move.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h misc_util.h
+layer.o: layer.c ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.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
-mirror.o: mirror.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h hid_actions.h compat_misc.h \
+ undo.h event.h layer_ui.h
+layer_ui.o: layer_ui.c ../config.h layer_ui.h layer.h globalconst.h \
+ global_typedefs.h pcb_bool.h unit.h attrib.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h event.h \
+ ../src_3rd/genvector/genvector_impl.c
+layer_vis.o: layer_vis.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.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 layer_ui.h layer_vis.h event.h \
+ compat_misc.h
+library.o: library.c ../config.h library.h global_typedefs.h pcb_bool.h \
+ unit.h macro.h compat_misc.h
+list_conf.o: list_conf.c conf.h ../config.h global_typedefs.h pcb_bool.h \
+ unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h mirror.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h polygon.h rtree.h
-misc.o: misc.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.c
+main.o: main.c ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 error.h plug_io.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 \
- box.h misc_util.h crosshair.h data.h plug_io.h misc.h mymem.h move.h \
- polygon.h rtree.h rotate.h rubberband.h set.h undo.h compat_misc.h \
- hid_actions.h hid_init.h
-misc_util.o: misc_util.c ../config.h misc_util.h pcb_bool.h unit.h
-move.o: move.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ buffer.h crosshair.h vtonpoint.h hid.h drc.h compat_lrealpath.h \
+ free_atexit.h polygon.h rtree.h buildin.h build_run.h flag_str.h \
+ plugins.h plug_footprint.h vtlibrary.h event.h funchash.h conf_core.h \
+ vtptr.h layer_vis.h hid_actions.h hid_init.h compat_misc.h compat_nls.h \
+ dolists.h generated_lists.h
+main_act.o: main_act.c ../config.h hid_actions.h hid.h error.h drc.h \
+ unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h hid_init.h conf_core.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- create.h data.h draw.h misc.h mymem.h move.h polygon.h rtree.h search.h \
- misc_util.h select.h undo.h hid_actions.h compat_misc.h layer.h
-mymem.o: mymem.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ plugins.h
+misc_util.o: misc_util.c ../config.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h misc_util.h unit.h pcb_bool.h
+move.o: move.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h mymem.h rtree.h rats_patch.h
-netlist.o: netlist.c ../config.h ../src_3rd/genregex/regex_sei.h \
- ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
- action_helper.h global.h const.h macro.h global_typedefs.h pcb_bool.h \
- unit.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h draw.h select.h operation.h undo.h event.h \
+ hid_actions.h compat_misc.h obj_all_op.h obj_arc_op.h obj_elem_op.h \
+ obj_line_op.h obj_pad_op.h obj_pinvia_op.h obj_poly_op.h obj_text_op.h \
+ obj_rat_op.h
+netlist.o: netlist.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h plug_io.h conf.h pcb-printf.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 error.h plug_io.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 \
- find.h mymem.h rats.h create.h rats_patch.h hid_actions.h compat_misc.h \
- netlist.h
+ find.h rats.h netlist.h route_style.h hid_actions.h hid.h drc.h \
+ compat_misc.h event.h
netlist_act.o: netlist_act.c ../config.h ../src_3rd/genregex/regex_sei.h \
../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \
- action_helper.h global.h const.h macro.h global_typedefs.h pcb_bool.h \
- unit.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- polyarea.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h plug_io.h conf.h pcb-printf.h \
+ action_helper.h global_typedefs.h pcb_bool.h unit.h data.h globalconst.h \
+ layer.h attrib.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h crosshair.h vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ board.h const.h macro.h vtroutestyle.h library.h rats_patch.h font.h \
+ box.h math_helper.h move.h misc_util.h plug_io.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 \
- find.h mymem.h rats.h create.h rats_patch.h hid_actions.h compat_misc.h \
- netlist.h
-obj_any.o: obj_any.c obj_any.h global_objs.h \
- ../src_3rd/genlist/gendlist.h ../config.h globalconst.h \
- global_typedefs.h pcb_bool.h unit.h polyarea.h \
+ hid_actions.h compat_nls.h compat_misc.h netlist.h route_style.h
+obj_any.o: obj_any.c ../config.h obj_any.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h global_typedefs.h pcb_bool.h unit.h \
../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.c
-object_act.o: object_act.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+obj_arc.o: obj_arc.c ../config.h compat_nls.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ polygon.h rtree.h undo.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 \
- data.h action_helper.h change.h undo.h funchash_core.h funchash.h \
- funchash_core_list.h search.h misc_util.h move.h draw.h mirror.h \
- rotate.h set.h copy.h misc.h mymem.h rubberband.h buffer.h remove.h \
- create.h compat_misc.h layer.h
-paths.o: paths.c ../config.h paths.h error.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ compat_misc.h obj_arc_op.h operation.h draw.h obj_arc_draw.h
+obj_arc_list.o: obj_arc_list.c obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.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 ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ ../src_3rd/genlist/gentdlist_impl.c
+obj_arc_ui.o: obj_arc_ui.c ../config.h obj_arc_ui.h crosshair.h \
+ vtonpoint.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h attrib.h \
+ layer.h globalconst.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h box.h math_helper.h macro.h move.h misc_util.h
+obj_common.o: obj_common.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h const.h error.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ attrib.h obj_arc_ui.h crosshair.h vtonpoint.h hid.h drc.h layer.h \
+ obj_all_list.h obj_arc_list.h obj_arc.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h
+obj_elem.o: obj_elem.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ list_common.h plug_io.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 \
- conf_core.h
-pcb-printf.o: pcb-printf.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.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_arc_draw.h \
+ obj_elem_op.h draw.h obj_text_draw.h obj_elem_draw.h
+obj_elem_list.o: obj_elem_list.c ../config.h obj_elem.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.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 ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h obj_elem_list.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h
-plug_footprint.o: plug_footprint.c ../config.h plug_footprint.h \
- vtlibrary.h global_objs.h ../src_3rd/genlist/gendlist.h globalconst.h \
- global_typedefs.h pcb_bool.h unit.h polyarea.h \
+ ../src_3rd/genlist/gentdlist_impl.c
+obj_line.o: obj_line.c ../config.h undo.h library.h global_typedefs.h \
+ pcb_bool.h unit.h board.h const.h macro.h vtroutestyle.h attrib.h \
../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h plugins.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h rats_patch.h font.h box.h math_helper.h move.h misc_util.h \
+ data.h crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h search.h \
+ rats.h netlist.h route_style.h polygon.h rtree.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h conf_core.h conf.h global.h const.h \
- macro.h list_common.h list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h hid.h error.h vtroutestyle.h global_element.h list_element.h \
- ht_element.h ../src_3rd/liblihata/genht/ht.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h compat_nls.h compat_misc.h \
+ rotate.h obj_line_op.h operation.h draw.h obj_line_draw.h obj_rat_draw.h \
+ obj_pinvia_draw.h
+obj_line_drcenf.o: obj_line_drcenf.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/genvector/vtp0.h list_conf.h compat_misc.h
-plug_footprint_act.o: plug_footprint_act.c ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h plug_footprint.h vtlibrary.h
-plug_import.o: plug_import.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h math_helper.h board.h \
+ const.h macro.h vtroutestyle.h attrib.h layer.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h hid.h error.h \
+ drc.h buffer.h find.h rtree.h
+obj_line_list.o: obj_line_list.c obj_line_list.h obj_line.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h ../config.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.c
+obj_pad.o: obj_pad.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ undo.h polygon.h rtree.h compat_misc.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 \
- plugins.h plug_import.h
-plug_io.o: plug_io.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ obj_pad_op.h operation.h draw.h obj_text_draw.h obj_pad_draw.h
+obj_pad_list.o: obj_pad_list.c obj_pad_list.h obj_pad.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h ../config.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.c
+obj_pinvia.o: obj_pinvia.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ undo.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 polygon.h rtree.h compat_nls.h \
+ compat_misc.h stub_vendor.h rotate.h obj_pinvia_op.h operation.h draw.h \
+ obj_text_draw.h obj_pinvia_draw.h
+obj_pinvia_list.o: obj_pinvia_list.c obj_pinvia_list.h obj_pinvia.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h globalconst.h ../config.h attrib.h \
+ global_typedefs.h pcb_bool.h unit.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
+ ../src_3rd/genlist/gentdlist_impl.c
+obj_pinvia_therm.o: obj_pinvia_therm.c ../config.h board.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 polygon.h rtree.h obj_pinvia_therm.h
+obj_poly.o: obj_poly.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ compat_nls.h undo.h polygon.h rtree.h rotate.h search.h rats.h netlist.h \
+ route_style.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 \
- buffer.h change.h create.h data.h plug_io.h misc.h mymem.h remove.h \
- set.h paths.h rats_patch.h hid_actions.h hid_flags.h plugins.h event.h \
- compat_misc.h route_style.h compat_fs.h compat_inc.h
-plugins.o: plugins.c plugins.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/genvector/gds_char.h \
- compat_misc.h
-polygon.o: polygon.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
+ obj_poly_op.h operation.h obj_poly_draw.h draw.h
+obj_poly_list.o: obj_poly_list.c obj_poly_list.h obj_poly.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h ../config.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ polyarea.h ../src_3rd/genlist/gentdlist_impl.h \
../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genlist/gentdlist_impl.c
+obj_rat.o: obj_rat.c ../config.h board.h const.h macro.h \
+ global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.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 undo.h rtree.h obj_line_draw.h \
+ obj_rat_op.h operation.h draw.h obj_rat_draw.h rats.h netlist.h \
+ route_style.h
+obj_rat_list.o: obj_rat_list.c obj_rat_list.h obj_rat.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h ../config.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.c
+obj_text.o: obj_text.c ../config.h rotate.h global_typedefs.h pcb_bool.h \
+ unit.h board.h const.h macro.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ compat_misc.h compat_nls.h undo.h polygon.h rtree.h obj_text_op.h \
+ operation.h draw.h obj_line_draw.h obj_text_draw.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_text_list.o: obj_text_list.c obj_text_list.h obj_text.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h ../config.h attrib.h global_typedefs.h pcb_bool.h unit.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.c
+object_act.o: object_act.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- box.h misc_util.h create.h crosshair.h data.h draw.h polygon.h rtree.h \
- remove.h search.h set.h thermal.h mymem.h undo.h misc.h layer.h
-polygon1.o: polygon1.c rtree.h global.h ../config.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h heap.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h
-polygon_act.o: polygon_act.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h data.h layer.h attrib.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h board.h const.h macro.h \
+ vtroutestyle.h library.h rats_patch.h font.h box.h math_helper.h move.h \
+ misc_util.h action_helper.h change.h undo.h event.h funchash_core.h \
+ funchash.h funchash_core_list.h search.h rats.h netlist.h route_style.h \
+ draw.h copy.h remove.h compat_misc.h compat_nls.h layer_vis.h
+paths.o: paths.c ../config.h paths.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h error.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.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/liblihata/genht/ht_inlines.h ../src_3rd/genvector/vtp0.h \
+ list_conf.h ../src_3rd/genlist/gentdlist_undef.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ globalconst.h
+pcb-printf.o: pcb-printf.c ../config.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h unit.h
+plug_footprint.o: plug_footprint.c ../config.h plug_footprint.h \
+ vtlibrary.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h plugins.h \
+ ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h \
+ ../src_3rd/liblihata/genht/hash.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.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/genvector/vtp0.h \
+ list_conf.h ../src_3rd/genlist/gentdlist_undef.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ globalconst.h error.h compat_misc.h
+plug_footprint_act.o: plug_footprint_act.c ../config.h hid.h error.h \
+ drc.h unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h plug_footprint.h vtlibrary.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h
+plug_import.o: plug_import.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h action_helper.h undo.h funchash_core.h funchash.h \
- funchash_core_list.h polygon.h rtree.h draw.h search.h misc_util.h \
- crosshair.h
-rats.o: rats.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h plugins.h plug_import.h \
+ error.h
+plug_io.o: plug_io.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- create.h data.h draw.h find.h misc.h mymem.h layer.h polygon.h rtree.h \
- rats.h search.h misc_util.h undo.h stub_mincut.h route_style.h \
- compat_misc.h netlist.h
-rats_act.o: rats_act.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h change.h data.h layer.h \
+ attrib.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h \
+ obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \
+ ht_element.h ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h hid.h error.h drc.h buffer.h plug_io.h library.h remove.h \
+ paths.h rats_patch.h board.h const.h macro.h vtroutestyle.h font.h box.h \
+ math_helper.h move.h misc_util.h hid_actions.h hid_flags.h plugins.h \
+ event.h compat_misc.h route_style.h compat_fs.h compat_nls.h layer_vis.h \
+ compat_inc.h
+plugins.o: plugins.c plugins.h ../config.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h compat_misc.h hid.h error.h drc.h \
+ unit.h global_typedefs.h pcb_bool.h attrib.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h
+polygon.o: polygon.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h action_helper.h undo.h set.h misc.h mymem.h find.h remove.h \
- funchash_core.h funchash.h funchash_core_list.h rats.h draw.h
-rats_patch.o: rats_patch.c rats_patch.h global.h ../config.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/liblihata/genht/htsp.h \
- ../src_3rd/liblihata/genht/ht.h create.h data.h buffer.h remove.h copy.h \
- compat_misc.h
-remove.o: remove.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h draw.h polygon.h rtree.h remove.h search.h \
+ rats.h netlist.h route_style.h obj_pinvia_therm.h undo.h compat_nls.h \
+ obj_all.h obj_poly_draw.h
+polygon1.o: polygon1.c ../config.h rtree.h global_typedefs.h pcb_bool.h \
+ unit.h math_helper.h heap.h compat_cc.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h polyarea.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h macro.h
+polygon_act.o: polygon_act.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h action_helper.h undo.h funchash_core.h \
+ funchash.h funchash_core_list.h polygon.h rtree.h draw.h search.h rats.h \
+ netlist.h route_style.h compat_nls.h
+rats.o: rats.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h draw.h misc.h mymem.h move.h polygon.h rtree.h remove.h select.h \
- undo.h
-remove_act.o: remove_act.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h action_helper.h set.h remove.h \
- funchash_core.h funchash.h funchash_core_list.h
-rotate.o: rotate.c ../config.h data.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h draw.h find.h polygon.h rtree.h rats.h \
+ netlist.h route_style.h search.h undo.h stub_mincut.h compat_misc.h \
+ compat_nls.h vtptr.h obj_rat_draw.h
+rats_act.o: rats_act.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h draw.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h polygon.h rtree.h rotate.h \
- rubberband.h search.h misc_util.h select.h set.h undo.h conf_core.h \
- conf.h pcb-printf.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h action_helper.h undo.h find.h remove.h \
+ funchash_core.h funchash.h funchash_core_list.h compat_nls.h rats.h \
+ netlist.h route_style.h draw.h obj_rat_draw.h
+rats_patch.o: rats_patch.c rats_patch.h board.h ../config.h const.h \
+ macro.h global_typedefs.h pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h library.h font.h box.h math_helper.h move.h misc_util.h \
+ ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h data.h \
+ crosshair.h vtonpoint.h hid.h error.h drc.h buffer.h copy.h \
+ compat_misc.h compat_nls.h
+remove.o: remove.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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
-route_style.o: route_style.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h route_style.h misc.h mymem.h conf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 draw.h hid.h error.h drc.h \
+ remove.h select.h operation.h undo.h obj_all_op.h obj_arc_op.h \
+ obj_elem_op.h obj_line_op.h obj_pad_op.h obj_pinvia_op.h obj_poly_op.h \
+ obj_text_op.h obj_rat_op.h
+remove_act.o: remove_act.c const.h ../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/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ ../src_3rd/genlist/gentdlist_undef.h obj_elem_list.h obj_elem.h \
+ obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \
+ obj_pinvia.h obj_text.h ht_element.h ../src_3rd/liblihata/genht/ht.h \
+ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_poly.h \
+ polyarea.h obj_text_list.h obj_rat_list.h obj_rat.h crosshair.h \
+ vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h hid.h error.h drc.h buffer.h \
+ action_helper.h remove.h board.h macro.h vtroutestyle.h library.h \
+ rats_patch.h font.h box.h math_helper.h move.h misc_util.h \
+ funchash_core.h funchash.h funchash_core_list.h
+rotate.o: rotate.c ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 vtonpoint.h hid.h error.h drc.h buffer.h \
+ draw.h polygon.h rtree.h rotate.h search.h rats.h netlist.h \
+ route_style.h select.h operation.h undo.h event.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
-rtree.o: rtree.c ../config.h rtree.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-rubberband.o: rubberband.c ../config.h create.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h data.h misc.h \
- ../src_3rd/genvector/gds_char.h mymem.h layer.h polygon.h rtree.h
-search.o: search.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.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 \
- box.h misc_util.h data.h find.h polygon.h rtree.h search.h misc.h \
- mymem.h layer.h
-select.o: select.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h compat_nls.h obj_all_op.h \
+ obj_arc_op.h obj_elem_op.h obj_line_op.h obj_pad_op.h obj_pinvia_op.h \
+ obj_poly_op.h obj_text_op.h obj_rat_op.h obj_line_draw.h obj_rat_draw.h
+route_style.o: route_style.c ../config.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h unit.h route_style.h \
+ vtroutestyle.h attrib.h error.h conf.h global_typedefs.h pcb_bool.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/liblihata/genht/ht_inlines.h ../src_3rd/genvector/vtp0.h \
+ list_conf.h ../src_3rd/genlist/gentdlist_undef.h \
+ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
+ misc_util.h board.h const.h macro.h layer.h globalconst.h obj_all_list.h \
+ obj_arc_list.h obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 funchash_core.h funchash.h \
+ funchash_core_list.h conf_core.h compat_nls.h
+rtree.o: rtree.c ../config.h math_helper.h compat_cc.h rtree.h \
+ global_typedefs.h pcb_bool.h unit.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h macro.h
+search.o: search.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h draw.h search.h misc_util.h select.h undo.h rats.h misc.h mymem.h \
- find.h layer.h compat_misc.h ../src_3rd/genregex/regex_sei.h \
- ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h
-select_act.o: select_act.c ../config.h conf_core.h conf.h global.h \
- const.h macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h find.h polygon.h rtree.h search.h rats.h \
+ netlist.h route_style.h
+select.o: select.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h action_helper.h undo.h funchash_core.h funchash.h \
- funchash_core_list.h select.h crosshair.h set.h buffer.h draw.h remove.h \
- copy.h hid_attrib.h compat_misc.h
-set.o: set.c ../config.h conf_core.h conf.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h draw.h search.h rats.h netlist.h \
+ route_style.h select.h operation.h undo.h find.h compat_misc.h \
+ compat_nls.h obj_elem_draw.h obj_pad_draw.h obj_arc_draw.h \
+ obj_pinvia_draw.h obj_line_draw.h obj_poly_draw.h obj_text_draw.h \
+ obj_rat_draw.h ../src_3rd/genregex/regex_sei.h \
+ ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h
+select_act.o: select_act.c ../config.h conf_core.h conf.h \
+ global_typedefs.h pcb_bool.h unit.h pcb-printf.h \
+ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- action_helper.h buffer.h crosshair.h data.h draw.h find.h set.h undo.h \
- hid_actions.h route_style.h
-strflags.o: strflags.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h strflags.h compat_misc.h
-stub_mincut.o: stub_mincut.c ../config.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h stub_mincut.h
-stub_stroke.o: stub_stroke.c error.h pcb_bool.h
-stub_vendor.o: stub_vendor.c stub_vendor.h ../config.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h
-thermal.o: thermal.c ../config.h misc.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h ../src_3rd/genvector/gds_char.h \
- mymem.h polygon.h rtree.h thermal.h
-undo.o: undo.c ../config.h buffer.h global.h const.h macro.h \
- global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h change.h create.h data.h draw.h \
- insert.h layer.h misc.h ../src_3rd/genvector/gds_char.h mymem.h mirror.h \
- move.h polygon.h rtree.h remove.h rotate.h search.h misc_util.h set.h \
- undo.h strflags.h conf_core.h conf.h pcb-printf.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h action_helper.h undo.h funchash_core.h \
+ funchash.h funchash_core_list.h select.h operation.h draw.h remove.h \
+ copy.h hid_attrib.h compat_misc.h compat_nls.h
+stub_draw_fab.o: stub_draw_fab.c ../config.h stub_draw_fab.h hid.h \
+ error.h drc.h unit.h global_typedefs.h pcb_bool.h attrib.h layer.h \
+ globalconst.h obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_rat_list.h \
+ obj_rat.h obj_text_draw.h
+stub_mincut.o: stub_mincut.c ../config.h stub_mincut.h global_typedefs.h \
+ pcb_bool.h unit.h obj_pinvia.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ globalconst.h attrib.h obj_pad.h
+stub_stroke.o: stub_stroke.c error.h ../config.h pcb_bool.h
+stub_vendor.o: stub_vendor.c ../config.h stub_vendor.h global_typedefs.h \
+ pcb_bool.h unit.h
+undo.o: undo.c ../config.h board.h const.h macro.h global_typedefs.h \
+ pcb_bool.h unit.h vtroutestyle.h attrib.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.h layer.h globalconst.h \
+ obj_all_list.h obj_arc_list.h obj_common.h \
+ ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h flag.h \
+ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
+ obj_elem_list.h obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h \
+ obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
+ obj_poly_list.h obj_poly.h polyarea.h 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 change.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \
+ buffer.h draw.h insert.h polygon.h rtree.h remove.h rotate.h search.h \
+ rats.h netlist.h route_style.h undo.h flag_str.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 compat_misc.h netlist.h
-undo_act.o: undo_act.c ../config.h conf_core.h conf.h global.h const.h \
- macro.h global_typedefs.h pcb_bool.h unit.h global_objs.h \
- ../src_3rd/genlist/gendlist.h globalconst.h polyarea.h list_common.h \
- list_line.h ../src_3rd/genlist/gentdlist_impl.h \
- ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \
- list_arc.h list_text.h list_poly.h list_pad.h list_pin.h list_rat.h \
- vtonpoint.h ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
- ../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h pcb-printf.h \
- ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h compat_misc.h compat_nls.h \
+ obj_elem_draw.h obj_poly_draw.h
+undo_act.o: undo_act.c ../config.h conf_core.h conf.h global_typedefs.h \
+ pcb_bool.h unit.h pcb-printf.h ../src_3rd/genvector/gds_char.h \
+ ../src_3rd/genvector/genvector_impl.h \
+ ../src_3rd/genvector/genvector_undef.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 \
- data.h action_helper.h funchash_core.h funchash.h funchash_core_list.h \
- crosshair.h undo.h polygon.h rtree.h set.h search.h misc_util.h draw.h \
- misc.h mymem.h layer.h
-unit.o: unit.c ../config.h global.h const.h macro.h global_typedefs.h \
- pcb_bool.h unit.h global_objs.h ../src_3rd/genlist/gendlist.h \
- globalconst.h polyarea.h list_common.h list_line.h \
- ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \
- ../src_3rd/genlist/gentdlist_undef.h list_arc.h list_text.h list_poly.h \
- list_pad.h list_pin.h list_rat.h vtonpoint.h \
- ../src_3rd/genvector/genvector_impl.h \
- ../src_3rd/genvector/genvector_undef.h hid.h error.h vtroutestyle.h \
- global_element.h list_element.h ht_element.h \
../src_3rd/liblihata/genht/ht.h ../src_3rd/liblihata/genht/ht_inlines.h \
- ../src_3rd/liblihata/genht/hash.h compat_misc.h
-vtlibrary.o: vtlibrary.c vtlibrary.h global_objs.h \
- ../src_3rd/genlist/gendlist.h ../config.h globalconst.h \
- global_typedefs.h pcb_bool.h unit.h polyarea.h \
+ ../src_3rd/genvector/vtp0.h list_conf.h \
+ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \
+ ../src_3rd/genlist/gendlist.h globalconst.h board.h const.h macro.h \
+ vtroutestyle.h attrib.h layer.h obj_all_list.h obj_arc_list.h \
+ obj_common.h ../src_3rd/liblihata/genht/hash.h \
+ ../src_3rd/genlist/gendlist.h flag.h obj_arc.h obj_elem_list.h \
+ obj_elem.h obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h \
+ obj_pinvia_list.h obj_pinvia.h obj_text.h ht_element.h \
+ ../src_3rd/liblihata/genht/ht.h obj_poly_list.h obj_poly.h polyarea.h \
+ 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 vtonpoint.h \
+ hid.h error.h drc.h buffer.h action_helper.h funchash_core.h funchash.h \
+ funchash_core_list.h undo.h polygon.h rtree.h search.h rats.h netlist.h \
+ route_style.h obj_line_draw.h
+unit.o: unit.c ../config.h compat_misc.h compat_nls.h unit.h
+vtlibrary.o: vtlibrary.c vtlibrary.h \
../src_3rd/genvector/genvector_impl.h \
../src_3rd/genvector/genvector_undef.h \
../src_3rd/genvector/genvector_impl.c
-vtonpoint.o: vtonpoint.c vtonpoint.h global_objs.h \
- ../src_3rd/genlist/gendlist.h ../config.h globalconst.h \
- global_typedefs.h pcb_bool.h unit.h polyarea.h \
- ../src_3rd/genvector/genvector_impl.h \
+vtonpoint.o: vtonpoint.c vtonpoint.h global_typedefs.h ../config.h \
+ pcb_bool.h unit.h ../src_3rd/genvector/genvector_impl.h \
../src_3rd/genvector/genvector_undef.h \
../src_3rd/genvector/genvector_impl.c
-vtptr.o: vtptr.c vtptr.h global_objs.h ../src_3rd/genlist/gendlist.h \
- ../config.h globalconst.h global_typedefs.h pcb_bool.h unit.h polyarea.h \
- ../src_3rd/genvector/genvector_impl.h \
+vtptr.o: vtptr.c vtptr.h ../src_3rd/genvector/genvector_impl.h \
../src_3rd/genvector/genvector_undef.h \
../src_3rd/genvector/genvector_impl.c
-vtroutestyle.o: vtroutestyle.c vtroutestyle.h unit.h ../config.h \
+vtroutestyle.o: vtroutestyle.c vtroutestyle.h unit.h ../config.h attrib.h \
../src_3rd/genvector/genvector_impl.h \
../src_3rd/genvector/genvector_undef.h \
../src_3rd/genvector/genvector_impl.c
diff --git a/src/Makefile.in b/src/Makefile.in
index 4857a2b..130002e 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -5,6 +5,7 @@ append /local/pcb/CFLAGS {-I. -I.. -I../src_3rd -I../src_3rd/liblihata -Iicons -
append /local/pcb/LDFLAGS cc/ldflags
append /local/pcb/LDFLAGS cc/rdynamic
put /local/pcb/DEPCFLAGS {}
+put /tmpasm/OFS { }
include {../scconfig/template/debug.tmpasm}
@@ -19,7 +20,11 @@ put /local/pcb/OBJS_C99 [@
put /local/pcb/OBJS [@
action_helper.o
action_act.o
+ attrib.o
+ board.o
+ box.o
buffer.o
+ build_run.o
change.o
change_act.o
conf.o
@@ -33,17 +38,17 @@ put /local/pcb/OBJS [@
compat_lrealpath.o
compat_misc.o
copy.o
- create.o
crosshair.o
data.o
draw.o
- draw_fab.o
- drill.o
error.o
event.o
+ font.o
file_act.o
find.o
find_act.o
+ flag.o
+ flag_str.o
free_atexit.o
funchash.o
gui_act.o
@@ -64,27 +69,38 @@ put /local/pcb/OBJS [@
insert.o
intersect.o
layer.o
- line.o
- list_arc.o
+ layer_ui.o
+ layer_vis.o
+ library.o
list_conf.o
- list_element.o
- list_line.o
- list_text.o
- list_pad.o
- list_pin.o
- list_poly.o
- list_rat.o
main.o
main_act.o
- mirror.o
- misc.o
misc_util.o
move.o
- mymem.o
netlist.o
netlist_act.o
object_act.o
+ obj_common.o
obj_any.o
+ obj_arc.o
+ obj_arc_list.o
+ obj_arc_ui.o
+ obj_elem.o
+ obj_elem_list.o
+ obj_line.o
+ obj_line_drcenf.o
+ obj_line_list.o
+ obj_pad.o
+ obj_pad_list.o
+ obj_pinvia.o
+ obj_pinvia_therm.o
+ obj_pinvia_list.o
+ obj_poly.o
+ obj_poly_list.o
+ obj_rat.o
+ obj_rat_list.o
+ obj_text.o
+ obj_text_list.o
paths.o
pcb-printf.o
plugins.o
@@ -103,16 +119,13 @@ put /local/pcb/OBJS [@
rotate.o
route_style.o
rtree.o
- rubberband.o
search.o
select.o
select_act.o
- set.o
- strflags.o
+ stub_draw_fab.o
stub_mincut.o
stub_stroke.o
stub_vendor.o
- thermal.o
undo.o
undo_act.o
unit.o
@@ -151,7 +164,7 @@ put /local/pcb/OBJS [@
# main: action registrations
put /local/pcb/ACTION_REG_SRC {
action_act.c buffer.c change_act.c conf_act.c file_act.c find_act.c
- gui_act.c main_act.c misc.c move.c netlist_act.c
+ gui_act.c main_act.c netlist_act.c
object_act.c plugins.c polygon_act.c plug_footprint_act.c rats_act.c
rats_patch.c remove_act.c select_act.c undo_act.c
}
@@ -191,7 +204,6 @@ append /local/pcb/LIBS /target/libs/sul/dmalloc/ldflags
# ---- logic ----
# Clean up variables
-put /tmpasm/OFS { }
uniq /local/pcb/OBJS
uniq /local/pcb/OBJS_C99
uniq /local/pcb/CFLAGS
@@ -200,7 +212,9 @@ uniq /local/pcb/LIBS
uniq /local/pcb/ACTION_REG_SRC
uniq /local/pcb/EXEDEPS
uniq /local/pcb/CLEANFILES
+uniq /local/pcb/DISTCLEANFILES
uniq /local/pcb/CLEANRULES
+uniq /local/pcb/all
put /local/pcb/SRCS /local/pcb/OBJS
append /local/pcb/SRCS ?/local/pcb/OBJS_C99
gsub /local/pcb/SRCS {.o } {.c }
@@ -237,8 +251,8 @@ SPHASH_PATH=../src_3rd/sphash
SPHASH=$(SPHASH_PATH)/sphash
all:
- make revcheck
- make all_exe
+ $(MAKE) revcheck
+ $(MAKE) all_exe
include ../Makefile.conf
@@ -282,7 +296,7 @@ generated_lists.h: @/local/pcb/ACTION_REG_SRC@ Makefile
AWK=@/host/fstools/awk@ ../scconfig/gen_core_lists.sh @/local/pcb/ACTION_REG_SRC@ > generated_lists.h
conf_core_fields.h: conf_core.h
- AWK=@/host/fstools/awk@ ../scconfig/gen_conf.sh ../doc-rnd/conf/tree < conf_core.h > conf_core_fields.h
+ AWK=@/host/fstools/awk@ ../scconfig/gen_conf.sh ../doc/conf/tree < conf_core.h > conf_core_fields.h
conf_internal.c: pcb-conf.lht
$(CQUOTE) -n conf_internal < pcb-conf.lht > conf_internal.c
@@ -290,11 +304,13 @@ conf_internal.c: pcb-conf.lht
FORCE:
-DISTCLEANFILES= core_lists.h
+DISTCLEANFILES = core_lists.h buildin.c compat_inc.h conf_core_fields.h conf_internal.c generated_lists.h @/local/pcb/DISTCLEANFILES@
clean: $(CLEANRULES)
-rm pcb-rnd $(OBJS) $(OBJS_C99) $(CLEANFILES)
+distclean: FORCE
+ -rm $(DISTCLEANFILES)
install_:
$(MKDIR) $(BINDIR) $(DATADIR) $(LIBDIR) $(LIBDIR)/plugins
@@ -307,10 +323,10 @@ install_:
install:
- make install_ CPC="$(CP)"@/local/pcb/rules/install@
+ $(MAKE) install_ CPC="$(CP)"@/local/pcb/rules/install@
linstall:
- make install_ CPC="$(LN)"@/local/pcb/rules/linstall@
+ $(MAKE) install_ CPC="$(LN)"@/local/pcb/rules/linstall@
uninstall:
diff --git a/src/action_act.c b/src/action_act.c
index 08f021e..ac7ba90 100644
--- a/src/action_act.c
+++ b/src/action_act.c
@@ -25,20 +25,21 @@
*
*/
+#include <stdio.h>
#include "config.h"
-#include "error.h"
#include "action_helper.h"
#include "hid_actions.h"
#include "undo.h"
+#include "compat_nls.h"
/* actions about actions
*/
/* --------------------------------------------------------------------------- */
-static const char executefile_syntax[] = "ExecuteFile(filename)";
+static const char pcb_acts_ExecuteFile[] = "ExecuteFile(filename)";
-static const char executefile_help[] = "Run actions from the given file.";
+static const char pcb_acth_ExecuteFile[] = "Run actions from the given file.";
/* %start-doc actions ExecuteFile
@@ -46,7 +47,7 @@ Lines starting with @code{#} are ignored.
%end-doc */
-int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_ExecuteFile(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
FILE *fp;
const char *fname;
@@ -55,7 +56,7 @@ int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y)
char *sp;
if (argc != 1)
- AFAIL(executefile);
+ PCB_ACT_FAIL(ExecuteFile);
fname = argv[0];
@@ -86,15 +87,15 @@ int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y)
*/
if (*sp && *sp != '#') {
- /*Message ("%s : line %-3d : \"%s\"\n", fname, n, sp); */
- hid_parse_actions(sp);
+ /*pcb_message("%s : line %-3d : \"%s\"\n", fname, n, sp); */
+ pcb_hid_parse_actions(sp);
}
}
defer_updates = 0;
if (defer_needs_update) {
- IncrementUndoSerialNumber();
- gui->invalidate_all();
+ pcb_undo_inc_serial();
+ pcb_gui->invalidate_all();
}
fclose(fp);
return 0;
@@ -102,9 +103,9 @@ int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-HID_Action action_action_list[] = {
- {"ExecuteFile", 0, ActionExecuteFile,
- executefile_help, executefile_syntax}
+pcb_hid_action_t action_action_list[] = {
+ {"ExecuteFile", 0, pcb_act_ExecuteFile,
+ pcb_acth_ExecuteFile, pcb_acts_ExecuteFile}
};
-REGISTER_ACTIONS(action_action_list, NULL)
+PCB_REGISTER_ACTIONS(action_action_list, NULL)
diff --git a/src/action_helper.c b/src/action_helper.c
index bb754d9..804bb60 100644
--- a/src/action_helper.c
+++ b/src/action_helper.c
@@ -25,42 +25,122 @@
*
*/
-/* action routines for output window
- */
+/* action routines for output window */
#include "config.h"
#include "conf_core.h"
#include "action_helper.h"
-#include "buffer.h"
+#include "board.h"
#include "change.h"
#include "copy.h"
-#include "create.h"
-#include "crosshair.h"
#include "data.h"
#include "draw.h"
-#include "error.h"
#include "find.h"
#include "insert.h"
-#include "line.h"
-#include "misc.h"
-#include "move.h"
#include "polygon.h"
-#include "rats.h"
#include "remove.h"
#include "rotate.h"
-#include "rubberband.h"
#include "search.h"
#include "select.h"
-#include "set.h"
#include "undo.h"
-#include "rtree.h"
#include "stub_stroke.h"
#include "funchash_core.h"
#include "hid_actions.h"
#include "compat_misc.h"
-#include "layer.h"
+#include "compat_nls.h"
+#include "event.h"
+
+#include "obj_pinvia_draw.h"
+#include "obj_pad_draw.h"
+#include "obj_line_draw.h"
+#include "obj_arc_draw.h"
+#include "obj_elem_draw.h"
+#include "obj_text_draw.h"
+#include "obj_rat_draw.h"
+#include "obj_poly_draw.h"
+
+
+static void GetGridLockCoordinates(int type, void *ptr1, void *ptr2, void *ptr3, pcb_coord_t * x, pcb_coord_t * y)
+{
+ switch (type) {
+ case PCB_TYPE_VIA:
+ *x = ((pcb_pin_t *) ptr2)->X;
+ *y = ((pcb_pin_t *) ptr2)->Y;
+ break;
+ case PCB_TYPE_LINE:
+ *x = ((pcb_line_t *) ptr2)->Point1.X;
+ *y = ((pcb_line_t *) ptr2)->Point1.Y;
+ break;
+ case PCB_TYPE_TEXT:
+ case PCB_TYPE_ELEMENT_NAME:
+ *x = ((pcb_text_t *) ptr2)->X;
+ *y = ((pcb_text_t *) ptr2)->Y;
+ break;
+ case PCB_TYPE_ELEMENT:
+ *x = ((pcb_element_t *) ptr2)->MarkX;
+ *y = ((pcb_element_t *) ptr2)->MarkY;
+ break;
+ case PCB_TYPE_POLYGON:
+ *x = ((pcb_polygon_t *) ptr2)->Points[0].X;
+ *y = ((pcb_polygon_t *) ptr2)->Points[0].Y;
+ break;
+
+ case PCB_TYPE_LINE_POINT:
+ case PCB_TYPE_POLYGON_POINT:
+ *x = ((pcb_point_t *) ptr3)->X;
+ *y = ((pcb_point_t *) ptr3)->Y;
+ break;
+ case PCB_TYPE_ARC:
+ pcb_arc_get_end((pcb_arc_t *) ptr2, 0, x, y);
+ break;
+ case PCB_TYPE_ARC_POINT:
+ if (ptr3 != NULL) /* need to check because: if snap off, there's no known endpoint (leave x;y as is, then) */
+ pcb_arc_get_end((pcb_arc_t *) ptr2, ((*(int **)ptr3) != pcb_arc_start_ptr), x, y);
+ break;
+ }
+}
+
+static void AttachForCopy(pcb_coord_t PlaceX, pcb_coord_t PlaceY)
+{
+ pcb_box_t box;
+ pcb_coord_t mx = 0, my = 0;
+
+ pcb_event(PCB_EVENT_RUBBER_RESET, NULL);
+ if (!conf_core.editor.snap_pin) {
+ /* dither the grab point so that the mark, center, etc
+ * will end up on a grid coordinate
+ */
+ GetGridLockCoordinates(pcb_crosshair.AttachedObject.Type,
+ pcb_crosshair.AttachedObject.Ptr1,
+ pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3, &mx, &my);
+ mx = pcb_grid_fit(mx, PCB->Grid, PCB->GridOffsetX) - mx;
+ my = pcb_grid_fit(my, PCB->Grid, PCB->GridOffsetY) - my;
+ }
+ pcb_crosshair.AttachedObject.X = PlaceX - mx;
+ pcb_crosshair.AttachedObject.Y = PlaceY - my;
+ if (!pcb_marked.status || conf_core.editor.local_ref)
+ pcb_crosshair_set_local_ref(PlaceX - mx, PlaceY - my, pcb_true);
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_SECOND;
+
+ /* get boundingbox of object and set cursor range */
+ GetObjectBoundingBox(pcb_crosshair.AttachedObject.Type, pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3, &box);
+ pcb_crosshair_set_range(pcb_crosshair.AttachedObject.X - box.X1,
+ pcb_crosshair.AttachedObject.Y - box.Y1,
+ PCB->MaxWidth - (box.X2 - pcb_crosshair.AttachedObject.X),
+ PCB->MaxHeight - (box.Y2 - pcb_crosshair.AttachedObject.Y));
+
+ /* get all attached objects if necessary */
+ if ((conf_core.editor.mode != PCB_MODE_COPY) && conf_core.editor.rubber_band_mode)
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_LINES, "ippp", pcb_crosshair.AttachedObject.Type, pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3);
+ if (conf_core.editor.mode != PCB_MODE_COPY &&
+ (pcb_crosshair.AttachedObject.Type == PCB_TYPE_ELEMENT ||
+ pcb_crosshair.AttachedObject.Type == PCB_TYPE_VIA ||
+ pcb_crosshair.AttachedObject.Type == PCB_TYPE_LINE || pcb_crosshair.AttachedObject.Type == PCB_TYPE_LINE_POINT))
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_RATS, "ippp", pcb_crosshair.AttachedObject.Type, pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3);
+}
+
/* --------------------------------------------------------------------------- */
@@ -138,14 +218,14 @@ either round or, if the octagon flag is set, octagonal.
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static PointType InsertedPoint;
-LayerTypePtr lastLayer;
+static pcb_point_t InsertedPoint;
+pcb_layer_t *lastLayer;
static struct {
- PolygonTypePtr poly;
- LineType line;
+ pcb_polygon_t *poly;
+ pcb_line_t line;
} fake;
-action_note_t Note;
+pcb_action_note_t Note;
int defer_updates = 0;
int defer_needs_update = 0;
@@ -153,148 +233,146 @@ int defer_needs_update = 0;
static pcb_cardinal_t polyIndex = 0;
pcb_bool saved_mode = pcb_false;
-/* ---------------------------------------------------------------------------
- * some local routines
- */
static void AdjustAttachedBox(void);
-/* ---------------------------------------------------------------------------
- * Clear warning color from pins/pads
- */
-void ClearWarnings()
+
+void pcb_clear_warnings()
{
conf_core.temp.rat_warn = pcb_false;
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_WARN, pin)) {
- CLEAR_FLAG(PCB_FLAG_WARN, pin);
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, pin)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, pin);
DrawPin(pin);
}
}
- ENDALL_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_WARN, via)) {
- CLEAR_FLAG(PCB_FLAG_WARN, via);
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, via)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, via);
DrawVia(via);
}
}
- END_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_WARN, pad)) {
- CLEAR_FLAG(PCB_FLAG_WARN, pad);
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, pad)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, pad);
DrawPad(pad);
}
}
- ENDALL_LOOP;
- ALLLINE_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_LINE_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_WARN, line)) {
- CLEAR_FLAG(PCB_FLAG_WARN, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, line)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, line);
DrawLine(layer, line);
}
}
- ENDALL_LOOP;
- ALLARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_WARN, arc)) {
- CLEAR_FLAG(PCB_FLAG_WARN, arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, arc)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, arc);
DrawArc(layer, arc);
}
}
- ENDALL_LOOP;
- ALLPOLYGON_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_WARN, polygon)) {
- CLEAR_FLAG(PCB_FLAG_WARN, polygon);
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, polygon)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, polygon);
DrawPolygon(layer, polygon);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- Draw();
+ pcb_draw();
}
-static void click_cb(hidval hv)
+/* Called some time after the click if there was a release but no second click
+ a.k.a. finalize single click (some things are already done in pcb_notify_mode
+ at the initial click event) */
+static void click_timer_cb(pcb_hidval_t hv)
{
if (Note.Click) {
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
Note.Click = pcb_false;
- if (Note.Moving && !gui->shift_is_pressed()) {
+ if (Note.Moving && !pcb_gui->shift_is_pressed()) {
Note.Buffer = conf_core.editor.buffer_number;
- SetBufferNumber(MAX_BUFFER - 1);
- ClearBuffer(PASTEBUFFER);
- AddSelectedToBuffer(PASTEBUFFER, Note.X, Note.Y, pcb_true);
- SaveUndoSerialNumber();
- RemoveSelected();
- SaveMode();
+ pcb_buffer_set_number(PCB_MAX_BUFFER - 1);
+ pcb_buffer_clear(PCB_PASTEBUFFER);
+ pcb_buffer_add_selected(PCB_PASTEBUFFER, Note.X, Note.Y, pcb_true);
+ pcb_undo_save_serial();
+ pcb_remove_selected();
+ pcb_crosshair_save_mode();
saved_mode = pcb_true;
- SetMode(PCB_MODE_PASTE_BUFFER);
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
}
- else if (Note.Hit && !gui->shift_is_pressed()) {
- BoxType box;
+ else if (Note.Hit && !pcb_gui->shift_is_pressed()) {
+ pcb_box_t box;
- SaveMode();
+ pcb_crosshair_save_mode();
saved_mode = pcb_true;
- SetMode(gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE);
- Crosshair.AttachedObject.Ptr1 = Note.ptr1;
- Crosshair.AttachedObject.Ptr2 = Note.ptr2;
- Crosshair.AttachedObject.Ptr3 = Note.ptr3;
- Crosshair.AttachedObject.Type = Note.Hit;
-
- if (Crosshair.drags != NULL) {
- free(Crosshair.drags);
- Crosshair.drags = NULL;
+ pcb_crosshair_set_mode(pcb_gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE);
+ pcb_crosshair.AttachedObject.Ptr1 = Note.ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = Note.ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = Note.ptr3;
+ pcb_crosshair.AttachedObject.Type = Note.Hit;
+
+ if (pcb_crosshair.drags != NULL) {
+ free(pcb_crosshair.drags);
+ pcb_crosshair.drags = NULL;
}
- Crosshair.dragx = Note.X;
- Crosshair.dragy = Note.Y;
- box.X1 = Note.X + SLOP * pixel_slop;
- box.X2 = Note.X - SLOP * pixel_slop;
- box.Y1 = Note.Y + SLOP * pixel_slop;
- box.Y2 = Note.Y - SLOP * pixel_slop;
- Crosshair.drags = ListBlock(&box, &Crosshair.drags_len);
- Crosshair.drags_current = 0;
+ pcb_crosshair.dragx = Note.X;
+ pcb_crosshair.dragy = Note.Y;
+ box.X1 = Note.X + PCB_SLOP * pcb_pixel_slop;
+ box.X2 = Note.X - PCB_SLOP * pcb_pixel_slop;
+ box.Y1 = Note.Y + PCB_SLOP * pcb_pixel_slop;
+ box.Y2 = Note.Y - PCB_SLOP * pcb_pixel_slop;
+ pcb_crosshair.drags = pcb_list_block(&box, &pcb_crosshair.drags_len);
+ pcb_crosshair.drags_current = 0;
AttachForCopy(Note.X, Note.Y);
}
else {
- BoxType box;
+ pcb_box_t box;
Note.Hit = 0;
Note.Moving = pcb_false;
- SaveUndoSerialNumber();
- box.X1 = -MAX_COORD;
- box.Y1 = -MAX_COORD;
- box.X2 = MAX_COORD;
- box.Y2 = MAX_COORD;
+ pcb_undo_save_serial();
+ box.X1 = -PCB_MAX_COORD;
+ box.Y1 = -PCB_MAX_COORD;
+ box.X2 = PCB_MAX_COORD;
+ box.Y2 = PCB_MAX_COORD;
/* unselect first if shift key not down */
- if (!gui->shift_is_pressed() && SelectBlock(&box, pcb_false))
- SetChangedFlag(pcb_true);
- NotifyBlock();
- Crosshair.AttachedBox.Point1.X = Note.X;
- Crosshair.AttachedBox.Point1.Y = Note.Y;
+ if (!pcb_gui->shift_is_pressed() && pcb_select_block(&box, pcb_false))
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_notify_block();
+ pcb_crosshair.AttachedBox.Point1.X = Note.X;
+ pcb_crosshair.AttachedBox.Point1.Y = Note.Y;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
}
}
-void ReleaseMode(void)
+void pcb_release_mode(void)
{
- BoxType box;
+ pcb_box_t box;
if (Note.Click) {
- BoxType box;
+ pcb_box_t box;
- box.X1 = -MAX_COORD;
- box.Y1 = -MAX_COORD;
- box.X2 = MAX_COORD;
- box.Y2 = MAX_COORD;
+ box.X1 = -PCB_MAX_COORD;
+ box.Y1 = -PCB_MAX_COORD;
+ box.X2 = PCB_MAX_COORD;
+ box.Y2 = PCB_MAX_COORD;
Note.Click = pcb_false; /* inhibit timer action */
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
/* unselect first if shift key not down */
- if (!gui->shift_is_pressed()) {
- if (SelectBlock(&box, pcb_false))
- SetChangedFlag(pcb_true);
+ if (!pcb_gui->shift_is_pressed()) {
+ if (pcb_select_block(&box, pcb_false))
+ pcb_board_set_changed_flag(pcb_true);
if (Note.Moving) {
Note.Moving = 0;
Note.Hit = 0;
@@ -303,41 +381,41 @@ void ReleaseMode(void)
}
/* Restore the SN so that if we select something the deselect/select combo
gets the same SN. */
- RestoreUndoSerialNumber();
- if (SelectObject())
- SetChangedFlag(pcb_true);
+ pcb_undo_restore_serial();
+ if (pcb_select_object())
+ pcb_board_set_changed_flag(pcb_true);
else
- IncrementUndoSerialNumber(); /* We didn't select anything new, so, the deselection should get its own SN. */
+ pcb_undo_inc_serial(); /* We didn't select anything new, so, the deselection should get its own SN. */
Note.Hit = 0;
Note.Moving = 0;
}
else if (Note.Moving) {
- RestoreUndoSerialNumber();
- NotifyMode();
- ClearBuffer(PASTEBUFFER);
- SetBufferNumber(Note.Buffer);
+ pcb_undo_restore_serial();
+ pcb_notify_mode();
+ pcb_buffer_clear(PCB_PASTEBUFFER);
+ pcb_buffer_set_number(Note.Buffer);
Note.Moving = pcb_false;
Note.Hit = 0;
}
else if (Note.Hit) {
- NotifyMode();
+ pcb_notify_mode();
Note.Hit = 0;
}
else if (conf_core.editor.mode == PCB_MODE_ARROW) {
- box.X1 = Crosshair.AttachedBox.Point1.X;
- box.Y1 = Crosshair.AttachedBox.Point1.Y;
- box.X2 = Crosshair.AttachedBox.Point2.X;
- box.Y2 = Crosshair.AttachedBox.Point2.Y;
-
- RestoreUndoSerialNumber();
- if (SelectBlock(&box, pcb_true))
- SetChangedFlag(pcb_true);
- else if (Bumped)
- IncrementUndoSerialNumber();
- Crosshair.AttachedBox.State = STATE_FIRST;
+ box.X1 = pcb_crosshair.AttachedBox.Point1.X;
+ box.Y1 = pcb_crosshair.AttachedBox.Point1.Y;
+ box.X2 = pcb_crosshair.AttachedBox.Point2.X;
+ box.Y2 = pcb_crosshair.AttachedBox.Point2.Y;
+
+ pcb_undo_restore_serial();
+ if (pcb_select_block(&box, pcb_true))
+ pcb_board_set_changed_flag(pcb_true);
+ else if (pcb_bumped)
+ pcb_undo_inc_serial();
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
}
if (saved_mode)
- RestoreMode();
+ pcb_crosshair_restore_mode();
saved_mode = pcb_false;
}
@@ -348,33 +426,30 @@ void ReleaseMode(void)
static void AdjustAttachedBox(void)
{
if (conf_core.editor.mode == PCB_MODE_ARC) {
- Crosshair.AttachedBox.otherway = gui->shift_is_pressed();
+ pcb_crosshair.AttachedBox.otherway = pcb_gui->shift_is_pressed();
return;
}
- switch (Crosshair.AttachedBox.State) {
- case STATE_SECOND: /* one corner is selected */
+ switch (pcb_crosshair.AttachedBox.State) {
+ case PCB_CH_STATE_SECOND: /* one corner is selected */
{
/* update coordinates */
- Crosshair.AttachedBox.Point2.X = Crosshair.X;
- Crosshair.AttachedBox.Point2.Y = Crosshair.Y;
+ pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.X;
+ pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.Y;
break;
}
}
}
-/* ---------------------------------------------------------------------------
- * adjusts the objects which are to be created like attached lines...
- */
-void AdjustAttachedObjects(void)
+void pcb_adjust_attached_objects(void)
{
- PointTypePtr pnt;
+ pcb_point_t *pnt;
switch (conf_core.editor.mode) {
/* update at least an attached block (selection) */
case PCB_MODE_NO:
case PCB_MODE_ARROW:
- if (Crosshair.AttachedBox.State) {
- Crosshair.AttachedBox.Point2.X = Crosshair.X;
- Crosshair.AttachedBox.Point2.Y = Crosshair.Y;
+ if (pcb_crosshair.AttachedBox.State) {
+ pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.X;
+ pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.Y;
}
break;
@@ -387,18 +462,18 @@ void AdjustAttachedObjects(void)
/* polygon creation mode */
case PCB_MODE_POLYGON:
case PCB_MODE_POLYGON_HOLE:
- AdjustAttachedLine();
+ pcb_line_adjust_attached();
break;
/* line creation mode */
case PCB_MODE_LINE:
if (PCB->RatDraw || conf_core.editor.line_refraction == 0)
- AdjustAttachedLine();
+ pcb_line_adjust_attached();
else
- AdjustTwoLine(conf_core.editor.line_refraction - 1);
+ pcb_line_adjust_attached_2lines(conf_core.editor.line_refraction - 1);
break;
/* point insertion mode */
case PCB_MODE_INSERT_POINT:
- pnt = AdjustInsertPoint();
+ pnt = pcb_adjust_insert_point();
if (pnt)
InsertedPoint = *pnt;
break;
@@ -407,120 +482,106 @@ void AdjustAttachedObjects(void)
}
}
-/* ---------------------------------------------------------------------------
- * creates points of a line
- */
-void NotifyLine(void)
+void pcb_notify_line(void)
{
int type = PCB_TYPE_NONE;
void *ptr1, *ptr2, *ptr3;
- if (!Marked.status || conf_core.editor.local_ref)
- SetLocalRef(Crosshair.X, Crosshair.Y, pcb_true);
- switch (Crosshair.AttachedLine.State) {
- case STATE_FIRST: /* first point */
- if (PCB->RatDraw && SearchScreen(Crosshair.X, Crosshair.Y, PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr1, &ptr1) == PCB_TYPE_NONE) {
- gui->beep();
+ if (!pcb_marked.status || conf_core.editor.local_ref)
+ pcb_crosshair_set_local_ref(pcb_crosshair.X, pcb_crosshair.Y, pcb_true);
+ switch (pcb_crosshair.AttachedLine.State) {
+ case PCB_CH_STATE_FIRST: /* first point */
+ if (PCB->RatDraw && pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr1, &ptr1) == PCB_TYPE_NONE) {
+ pcb_gui->beep();
break;
}
if (conf_core.editor.auto_drc && conf_core.editor.mode == PCB_MODE_LINE) {
- type = SearchScreen(Crosshair.X, Crosshair.Y, PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3);
- LookupConnection(Crosshair.X, Crosshair.Y, pcb_true, 1, PCB_FLAG_FOUND);
+ type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3);
+ pcb_lookup_conn(pcb_crosshair.X, pcb_crosshair.Y, pcb_true, 1, PCB_FLAG_FOUND);
}
if (type == PCB_TYPE_PIN || type == PCB_TYPE_VIA) {
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = ((PinTypePtr) ptr2)->X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = ((PinTypePtr) ptr2)->Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = ((pcb_pin_t *) ptr2)->X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = ((pcb_pin_t *) ptr2)->Y;
}
else if (type == PCB_TYPE_PAD) {
- PadTypePtr pad = (PadTypePtr) ptr2;
- double d1 = Distance(Crosshair.X, Crosshair.Y, pad->Point1.X, pad->Point1.Y);
- double d2 = Distance(Crosshair.X, Crosshair.Y, pad->Point2.X, pad->Point2.Y);
- double dm = Distance(Crosshair.X, Crosshair.Y, (pad->Point1.X + pad->Point2.X) / 2, (pad->Point1.Y + pad->Point2.Y)/2);
+ pcb_pad_t *pad = (pcb_pad_t *) ptr2;
+ double d1 = pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, pad->Point1.X, pad->Point1.Y);
+ double d2 = pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, pad->Point2.X, pad->Point2.Y);
+ double dm = pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, (pad->Point1.X + pad->Point2.X) / 2, (pad->Point1.Y + pad->Point2.Y)/2);
if ((dm <= d1) && (dm <= d2)) { /* prefer to snap to the middle of a pin if that's the closest */
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = Crosshair.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = Crosshair.Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = pcb_crosshair.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = pcb_crosshair.Y;
}
else if (d2 < d1) { /* else select the closest endpoint */
- Crosshair.AttachedLine.Point1 = Crosshair.AttachedLine.Point2 = pad->Point2;
+ pcb_crosshair.AttachedLine.Point1 = pcb_crosshair.AttachedLine.Point2 = pad->Point2;
}
else {
- Crosshair.AttachedLine.Point1 = Crosshair.AttachedLine.Point2 = pad->Point1;
+ pcb_crosshair.AttachedLine.Point1 = pcb_crosshair.AttachedLine.Point2 = pad->Point1;
}
}
else {
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = Crosshair.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = Crosshair.Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = pcb_crosshair.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = pcb_crosshair.Y;
}
- Crosshair.AttachedLine.State = STATE_SECOND;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_SECOND;
break;
- case STATE_SECOND:
+ case PCB_CH_STATE_SECOND:
/* fall through to third state too */
lastLayer = CURRENT;
default: /* all following points */
- Crosshair.AttachedLine.State = STATE_THIRD;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_THIRD;
break;
}
}
-/* ---------------------------------------------------------------------------
- * create first or second corner of a marked block
- */
-void NotifyBlock(void)
+void pcb_notify_block(void)
{
- notify_crosshair_change(pcb_false);
- switch (Crosshair.AttachedBox.State) {
- case STATE_FIRST: /* setup first point */
- Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = Crosshair.X;
- Crosshair.AttachedBox.Point1.Y = Crosshair.AttachedBox.Point2.Y = Crosshair.Y;
- Crosshair.AttachedBox.State = STATE_SECOND;
+ pcb_notify_crosshair_change(pcb_false);
+ switch (pcb_crosshair.AttachedBox.State) {
+ case PCB_CH_STATE_FIRST: /* setup first point */
+ pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.X;
+ pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.Y;
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_SECOND;
break;
- case STATE_SECOND: /* setup second point */
- Crosshair.AttachedBox.State = STATE_THIRD;
+ case PCB_CH_STATE_SECOND: /* setup second point */
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_THIRD;
break;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
}
-
-/* ---------------------------------------------------------------------------
- *
- * does what's appropriate for the current mode setting. This normally
- * means creation of an object at the current crosshair location.
- *
- * new created objects are added to the create undo list of course
- */
-void NotifyMode(void)
+void pcb_notify_mode(void)
{
void *ptr1, *ptr2, *ptr3;
int type;
if (conf_core.temp.rat_warn)
- ClearWarnings();
+ pcb_clear_warnings();
switch (conf_core.editor.mode) {
case PCB_MODE_ARROW:
{
int test;
- hidval hv;
+ pcb_hidval_t hv;
Note.Click = pcb_true;
/* do something after click time */
- gui->add_timer(click_cb, conf_core.editor.click_time, hv);
+ pcb_gui->add_timer(click_timer_cb, conf_core.editor.click_time, hv);
/* see if we clicked on something already selected
* (Note.Moving) or clicked on a MOVE_TYPE
* (Note.Hit)
*/
- for (test = (SELECT_TYPES | MOVE_TYPES) & ~PCB_TYPE_RATLINE; test; test &= ~type) {
- type = SearchScreen(Note.X, Note.Y, test, &ptr1, &ptr2, &ptr3);
- if (!Note.Hit && (type & MOVE_TYPES) && !TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2)) {
+ for (test = (PCB_SELECT_TYPES | PCB_MOVE_TYPES) & ~PCB_TYPE_RATLINE; test; test &= ~type) {
+ type = pcb_search_screen(Note.X, Note.Y, test, &ptr1, &ptr2, &ptr3);
+ if (!Note.Hit && (type & PCB_MOVE_TYPES) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *) ptr2)) {
Note.Hit = type;
Note.ptr1 = ptr1;
Note.ptr2 = ptr2;
Note.ptr3 = ptr3;
}
- if (!Note.Moving && (type & SELECT_TYPES) && TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) ptr2))
+ if (!Note.Moving && (type & PCB_SELECT_TYPES) && PCB_FLAG_TEST(PCB_FLAG_SELECTED, (pcb_pin_t *) ptr2))
Note.Moving = pcb_true;
if ((Note.Hit && Note.Moving) || type == PCB_TYPE_NONE)
break;
@@ -530,85 +591,75 @@ void NotifyMode(void)
case PCB_MODE_VIA:
{
- PinTypePtr via;
+ pcb_pin_t *via;
if (!PCB->ViaOn) {
- Message(PCB_MSG_DEFAULT, _("You must turn via visibility on before\n" "you can place vias\n"));
+ pcb_message(PCB_MSG_WARNING, _("You must turn via visibility on before\n" "you can place vias\n"));
break;
}
- if ((via = CreateNewVia(PCB->Data, Note.X, Note.Y,
+ if ((via = pcb_via_new(PCB->Data, Note.X, Note.Y,
conf_core.design.via_thickness, 2 * conf_core.design.clearance,
- 0, conf_core.design.via_drilling_hole, NULL, NoFlags())) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via);
- if (gui->shift_is_pressed())
- ChangeObjectThermal(PCB_TYPE_VIA, via, via, via, PCB->ThermStyle);
- IncrementUndoSerialNumber();
+ 0, conf_core.design.via_drilling_hole, NULL, pcb_no_flags())) != NULL) {
+ pcb_obj_add_attribs(via, PCB->pen_attr);
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, via, via, via);
+ if (pcb_gui->shift_is_pressed())
+ pcb_chg_obj_thermal(PCB_TYPE_VIA, via, via, via, PCB->ThermStyle);
+ pcb_undo_inc_serial();
DrawVia(via);
- Draw();
+ pcb_draw();
}
break;
}
case PCB_MODE_ARC:
{
- switch (Crosshair.AttachedBox.State) {
- case STATE_FIRST:
- Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = Note.X;
- Crosshair.AttachedBox.Point1.Y = Crosshair.AttachedBox.Point2.Y = Note.Y;
- Crosshair.AttachedBox.State = STATE_SECOND;
+ switch (pcb_crosshair.AttachedBox.State) {
+ case PCB_CH_STATE_FIRST:
+ pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X = Note.X;
+ pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y = Note.Y;
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_SECOND;
break;
- case STATE_SECOND:
- case STATE_THIRD:
+ case PCB_CH_STATE_SECOND:
+ case PCB_CH_STATE_THIRD:
{
- ArcTypePtr arc;
- Coord wx, wy;
- Angle sa, dir;
-
- wx = Note.X - Crosshair.AttachedBox.Point1.X;
- wy = Note.Y - Crosshair.AttachedBox.Point1.Y;
- if (XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) {
- Crosshair.AttachedBox.Point2.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * SGNZ(wx);
+ pcb_arc_t *arc;
+ pcb_coord_t wx, wy;
+ pcb_angle_t sa, dir;
+
+ wx = Note.X - pcb_crosshair.AttachedBox.Point1.X;
+ wy = Note.Y - pcb_crosshair.AttachedBox.Point1.Y;
+ if (PCB_XOR(pcb_crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) {
+ pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.AttachedBox.Point1.X + coord_abs(wy) * PCB_SGNZ(wx);
sa = (wx >= 0) ? 0 : 180;
-#ifdef ARC45
- if (abs(wy) / 2 >= abs(wx))
- dir = (SGNZ(wx) == SGNZ(wy)) ? 45 : -45;
- else
-#endif
- dir = (SGNZ(wx) == SGNZ(wy)) ? 90 : -90;
+ dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 90 : -90;
}
else {
- Crosshair.AttachedBox.Point2.Y = Crosshair.AttachedBox.Point1.Y + coord_abs(wx) * SGNZ(wy);
+ pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.AttachedBox.Point1.Y + coord_abs(wx) * PCB_SGNZ(wy);
sa = (wy >= 0) ? -90 : 90;
-#ifdef ARC45
- if (abs(wx) / 2 >= abs(wy))
- dir = (SGNZ(wx) == SGNZ(wy)) ? -45 : 45;
- else
-#endif
- dir = (SGNZ(wx) == SGNZ(wy)) ? -90 : 90;
+ dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -90 : 90;
wy = wx;
}
- if (coord_abs(wy) > 0 && (arc = CreateNewArcOnLayer(CURRENT,
- Crosshair.AttachedBox.Point2.X,
- Crosshair.AttachedBox.Point2.Y,
+ if (coord_abs(wy) > 0 && (arc = pcb_arc_new(CURRENT,
+ pcb_crosshair.AttachedBox.Point2.X,
+ pcb_crosshair.AttachedBox.Point2.Y,
coord_abs(wy),
coord_abs(wy),
sa,
dir,
conf_core.design.line_thickness,
2 * conf_core.design.clearance,
- MakeFlags(conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) {
- BoxTypePtr bx;
-
- bx = GetArcEnds(arc);
- Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = bx->X2;
- Crosshair.AttachedBox.Point1.Y = Crosshair.AttachedBox.Point2.Y = bx->Y2;
- AddObjectToCreateUndoList(PCB_TYPE_ARC, CURRENT, arc, arc);
- IncrementUndoSerialNumber();
- addedLines++;
+ pcb_flag_make(conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) {
+ pcb_obj_add_attribs(arc, PCB->pen_attr);
+ pcb_arc_get_end(arc, 1, &pcb_crosshair.AttachedBox.Point2.X, &pcb_crosshair.AttachedBox.Point2.Y);
+ pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X;
+ pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y;
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, CURRENT, arc, arc);
+ pcb_undo_inc_serial();
+ pcb_added_lines++;
DrawArc(CURRENT, arc);
- Draw();
- Crosshair.AttachedBox.State = STATE_THIRD;
+ pcb_draw();
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_THIRD;
}
break;
}
@@ -617,68 +668,68 @@ void NotifyMode(void)
}
case PCB_MODE_LOCK:
{
- type = SearchScreen(Note.X, Note.Y, PCB_TYPEMASK_LOCK, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(Note.X, Note.Y, PCB_TYPEMASK_LOCK, &ptr1, &ptr2, &ptr3);
if (type == PCB_TYPE_ELEMENT) {
- ElementTypePtr element = (ElementTypePtr) ptr2;
+ pcb_element_t *element = (pcb_element_t *) ptr2;
- TOGGLE_FLAG(PCB_FLAG_LOCK, element);
- PIN_LOOP(element);
+ PCB_FLAG_TOGGLE(PCB_FLAG_LOCK, element);
+ PCB_PIN_LOOP(element);
{
- TOGGLE_FLAG(PCB_FLAG_LOCK, pin);
- CLEAR_FLAG(PCB_FLAG_SELECTED, pin);
+ PCB_FLAG_TOGGLE(PCB_FLAG_LOCK, pin);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, pin);
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- TOGGLE_FLAG(PCB_FLAG_LOCK, pad);
- CLEAR_FLAG(PCB_FLAG_SELECTED, pad);
+ PCB_FLAG_TOGGLE(PCB_FLAG_LOCK, pad);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, pad);
}
- END_LOOP;
- CLEAR_FLAG(PCB_FLAG_SELECTED, element);
+ PCB_END_LOOP;
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, element);
/* always re-draw it since I'm too lazy
* to tell if a selected flag changed
*/
DrawElement(element);
- Draw();
- hid_actionl("Report", "Object", NULL);
+ pcb_draw();
+ pcb_hid_actionl("Report", "Object", NULL);
}
else if (type != PCB_TYPE_NONE) {
- TextTypePtr thing = (TextTypePtr) ptr3;
- TOGGLE_FLAG(PCB_FLAG_LOCK, thing);
- if (TEST_FLAG(PCB_FLAG_LOCK, thing)
- && TEST_FLAG(PCB_FLAG_SELECTED, thing)) {
+ pcb_text_t *thing = (pcb_text_t *) ptr3;
+ PCB_FLAG_TOGGLE(PCB_FLAG_LOCK, thing);
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, thing)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, thing)) {
/* this is not un-doable since LOCK isn't */
- CLEAR_FLAG(PCB_FLAG_SELECTED, thing);
- DrawObject(type, ptr1, ptr2);
- Draw();
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, thing);
+ pcb_draw_obj(type, ptr1, ptr2);
+ pcb_draw();
}
- hid_actionl("Report", "Object", NULL);
+ pcb_hid_actionl("Report", "Object", NULL);
}
break;
}
case PCB_MODE_THERMAL:
{
- if (((type = SearchScreen(Note.X, Note.Y, PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- && !TEST_FLAG(PCB_FLAG_HOLE, (PinTypePtr) ptr3)) {
- if (gui->shift_is_pressed()) {
- int tstyle = GET_THERM(INDEXOFCURRENT, (PinTypePtr) ptr3);
+ if (((type = pcb_search_screen(Note.X, Note.Y, PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ && !PCB_FLAG_TEST(PCB_FLAG_HOLE, (pcb_pin_t *) ptr3)) {
+ if (pcb_gui->shift_is_pressed()) {
+ int tstyle = PCB_FLAG_THERM_GET(INDEXOFCURRENT, (pcb_pin_t *) ptr3);
tstyle++;
if (tstyle > 5)
tstyle = 1;
- ChangeObjectThermal(type, ptr1, ptr2, ptr3, tstyle);
+ pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, tstyle);
}
- else if (GET_THERM(INDEXOFCURRENT, (PinTypePtr) ptr3))
- ChangeObjectThermal(type, ptr1, ptr2, ptr3, 0);
+ else if (PCB_FLAG_THERM_GET(INDEXOFCURRENT, (pcb_pin_t *) ptr3))
+ pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, 0);
else
- ChangeObjectThermal(type, ptr1, ptr2, ptr3, PCB->ThermStyle);
+ pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, PCB->ThermStyle);
}
break;
}
case PCB_MODE_LINE:
/* do update of position */
- NotifyLine();
- if (Crosshair.AttachedLine.State != STATE_THIRD)
+ pcb_notify_line();
+ if (pcb_crosshair.AttachedLine.State != PCB_CH_STATE_THIRD)
break;
/* Remove anchor if clicking on start point;
@@ -687,41 +738,41 @@ void NotifyMode(void)
* Instead use a very small delta, or change
* the file after saving.
*/
- if (Crosshair.X == Crosshair.AttachedLine.Point1.X && Crosshair.Y == Crosshair.AttachedLine.Point1.Y) {
- SetMode(PCB_MODE_LINE);
+ if (pcb_crosshair.X == pcb_crosshair.AttachedLine.Point1.X && pcb_crosshair.Y == pcb_crosshair.AttachedLine.Point1.Y) {
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
break;
}
if (PCB->RatDraw) {
- RatTypePtr line;
- if ((line = AddNet())) {
- addedLines++;
- AddObjectToCreateUndoList(PCB_TYPE_RATLINE, line, line, line);
- IncrementUndoSerialNumber();
+ pcb_rat_t *line;
+ if ((line = pcb_rat_add_net())) {
+ pcb_added_lines++;
+ pcb_undo_add_obj_to_create(PCB_TYPE_RATLINE, line, line, line);
+ pcb_undo_inc_serial();
DrawRat(line);
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y;
- Draw();
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y;
+ pcb_draw();
}
break;
}
else
/* create line if both ends are determined && length != 0 */
{
- LineTypePtr line;
+ pcb_line_t *line;
int maybe_found_flag;
if (conf_core.editor.line_refraction
- && Crosshair.AttachedLine.Point1.X ==
- Crosshair.AttachedLine.Point2.X
- && Crosshair.AttachedLine.Point1.Y ==
- Crosshair.AttachedLine.Point2.Y
- && (Crosshair.AttachedLine.Point2.X != Note.X || Crosshair.AttachedLine.Point2.Y != Note.Y)) {
+ && pcb_crosshair.AttachedLine.Point1.X ==
+ pcb_crosshair.AttachedLine.Point2.X
+ && pcb_crosshair.AttachedLine.Point1.Y ==
+ pcb_crosshair.AttachedLine.Point2.Y
+ && (pcb_crosshair.AttachedLine.Point2.X != Note.X || pcb_crosshair.AttachedLine.Point2.Y != Note.Y)) {
/* We will only need to paint the second line segment.
Since we only check for vias on the first segment,
swap them so the non-empty segment is the first segment. */
- Crosshair.AttachedLine.Point2.X = Note.X;
- Crosshair.AttachedLine.Point2.Y = Note.Y;
+ pcb_crosshair.AttachedLine.Point2.X = Note.X;
+ pcb_crosshair.AttachedLine.Point2.Y = Note.Y;
}
if (conf_core.editor.auto_drc
@@ -730,67 +781,70 @@ void NotifyMode(void)
else
maybe_found_flag = 0;
- if ((Crosshair.AttachedLine.Point1.X !=
- Crosshair.AttachedLine.Point2.X || Crosshair.AttachedLine.Point1.Y != Crosshair.AttachedLine.Point2.Y)
+ if ((pcb_crosshair.AttachedLine.Point1.X !=
+ pcb_crosshair.AttachedLine.Point2.X || pcb_crosshair.AttachedLine.Point1.Y != pcb_crosshair.AttachedLine.Point2.Y)
&& (line =
- CreateDrawnLineOnLayer(CURRENT,
- Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
- Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y,
+ pcb_line_new_merge(CURRENT,
+ pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y,
+ pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y,
conf_core.design.line_thickness,
2 * conf_core.design.clearance,
- MakeFlags(maybe_found_flag |
+ pcb_flag_make(maybe_found_flag |
(conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) != NULL) {
- PinTypePtr via;
+ pcb_pin_t *via;
- addedLines++;
- AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, line, line);
+ pcb_added_lines++;
+ pcb_obj_add_attribs(line, PCB->pen_attr);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, CURRENT, line, line);
DrawLine(CURRENT, line);
/* place a via if vias are visible, the layer is
in a new group since the last line and there
isn't a pin already here */
- if (PCB->ViaOn && GetLayerGroupNumberByPointer(CURRENT) !=
- GetLayerGroupNumberByPointer(lastLayer) &&
- SearchObjectByLocation(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
- Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
+ if (PCB->ViaOn && pcb_layer_get_group_(CURRENT) !=
+ pcb_layer_get_group_(lastLayer) &&
+ pcb_search_obj_by_location(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
+ pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y,
conf_core.design.via_thickness / 2) ==
PCB_TYPE_NONE
&& (via =
- CreateNewVia(PCB->Data,
- Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
+ pcb_via_new(PCB->Data,
+ pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y,
conf_core.design.via_thickness,
- 2 * conf_core.design.clearance, 0, conf_core.design.via_drilling_hole, NULL, NoFlags())) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via);
+ 2 * conf_core.design.clearance, 0, conf_core.design.via_drilling_hole, NULL, pcb_no_flags())) != NULL) {
+ pcb_obj_add_attribs(via, PCB->pen_attr);
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, via, via, via);
DrawVia(via);
}
/* copy the coordinates */
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y;
- IncrementUndoSerialNumber();
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y;
+ pcb_undo_inc_serial();
lastLayer = CURRENT;
}
- if (conf_core.editor.line_refraction && (Note.X != Crosshair.AttachedLine.Point2.X || Note.Y != Crosshair.AttachedLine.Point2.Y)
+ if (conf_core.editor.line_refraction && (Note.X != pcb_crosshair.AttachedLine.Point2.X || Note.Y != pcb_crosshair.AttachedLine.Point2.Y)
&& (line =
- CreateDrawnLineOnLayer(CURRENT,
- Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y,
+ pcb_line_new_merge(CURRENT,
+ pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y,
Note.X, Note.Y,
conf_core.design.line_thickness,
2 * conf_core.design.clearance,
- MakeFlags((conf_core.editor.auto_drc ? PCB_FLAG_FOUND : 0) |
+ pcb_flag_make((conf_core.editor.auto_drc ? PCB_FLAG_FOUND : 0) |
(conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) != NULL) {
- addedLines++;
- AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, line, line);
- IncrementUndoSerialNumber();
+ pcb_added_lines++;
+ pcb_obj_add_attribs(line, PCB->pen_attr);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, CURRENT, line, line);
+ pcb_undo_inc_serial();
DrawLine(CURRENT, line);
/* move to new start point */
- Crosshair.AttachedLine.Point1.X = Note.X;
- Crosshair.AttachedLine.Point1.Y = Note.Y;
- Crosshair.AttachedLine.Point2.X = Note.X;
- Crosshair.AttachedLine.Point2.Y = Note.Y;
+ pcb_crosshair.AttachedLine.Point1.X = Note.X;
+ pcb_crosshair.AttachedLine.Point1.Y = Note.Y;
+ pcb_crosshair.AttachedLine.Point2.X = Note.X;
+ pcb_crosshair.AttachedLine.Point2.Y = Note.Y;
if (conf_core.editor.swap_start_direction) {
@@ -799,41 +853,42 @@ void NotifyMode(void)
}
if (conf_core.editor.orthogonal_moves) {
/* set the mark to the new starting point so ortho works as expected and we can draw a perpendicular line from here */
- Marked.X = Note.X;
- Marked.Y = Note.Y;
+ pcb_marked.X = Note.X;
+ pcb_marked.Y = Note.Y;
}
- Draw();
+ pcb_draw();
}
break;
case PCB_MODE_RECTANGLE:
/* do update of position */
- NotifyBlock();
+ pcb_notify_block();
/* create rectangle if both corners are determined
* and width, height are != 0
*/
- if (Crosshair.AttachedBox.State == STATE_THIRD &&
- Crosshair.AttachedBox.Point1.X != Crosshair.AttachedBox.Point2.X &&
- Crosshair.AttachedBox.Point1.Y != Crosshair.AttachedBox.Point2.Y) {
- PolygonTypePtr polygon;
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_THIRD &&
+ pcb_crosshair.AttachedBox.Point1.X != pcb_crosshair.AttachedBox.Point2.X &&
+ pcb_crosshair.AttachedBox.Point1.Y != pcb_crosshair.AttachedBox.Point2.Y) {
+ pcb_polygon_t *polygon;
int flags = PCB_FLAG_CLEARPOLY;
if (conf_core.editor.full_poly)
flags |= PCB_FLAG_FULLPOLY;
- if ((polygon = CreateNewPolygonFromRectangle(CURRENT,
- Crosshair.AttachedBox.Point1.X,
- Crosshair.AttachedBox.Point1.Y,
- Crosshair.AttachedBox.Point2.X,
- Crosshair.AttachedBox.Point2.Y, MakeFlags(flags))) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_POLYGON, CURRENT, polygon, polygon);
- IncrementUndoSerialNumber();
+ if ((polygon = pcb_poly_new_from_rectangle(CURRENT,
+ pcb_crosshair.AttachedBox.Point1.X,
+ pcb_crosshair.AttachedBox.Point1.Y,
+ pcb_crosshair.AttachedBox.Point2.X,
+ pcb_crosshair.AttachedBox.Point2.Y, pcb_flag_make(flags))) != NULL) {
+ pcb_obj_add_attribs(polygon, PCB->pen_attr);
+ pcb_undo_add_obj_to_create(PCB_TYPE_POLYGON, CURRENT, polygon, polygon);
+ pcb_undo_inc_serial();
DrawPolygon(CURRENT, polygon);
- Draw();
+ pcb_draw();
}
/* reset state to 'first corner' */
- Crosshair.AttachedBox.State = STATE_FIRST;
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
}
break;
@@ -841,19 +896,19 @@ void NotifyMode(void)
{
char *string;
- if ((string = gui->prompt_for(_("Enter text:"), "")) != NULL) {
+ if ((string = pcb_gui->prompt_for(_("Enter text:"), "")) != NULL) {
if (strlen(string) > 0) {
- TextTypePtr text;
+ pcb_text_t *text;
int flag = PCB_FLAG_CLEARLINE;
- if (GetLayerGroupNumberByNumber(INDEXOFCURRENT) == GetLayerGroupNumberByNumber(solder_silk_layer))
+ if (pcb_layer_get_group(INDEXOFCURRENT) == pcb_layer_get_group(pcb_solder_silk_layer))
flag |= PCB_FLAG_ONSOLDER;
- if ((text = CreateNewText(CURRENT, &PCB->Font, Note.X,
- Note.Y, 0, conf_core.design.text_scale, string, MakeFlags(flag))) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_TEXT, CURRENT, text, text);
- IncrementUndoSerialNumber();
+ if ((text = pcb_text_new(CURRENT, &PCB->Font, Note.X,
+ Note.Y, 0, conf_core.design.text_scale, string, pcb_flag_make(flag))) != NULL) {
+ pcb_undo_add_obj_to_create(PCB_TYPE_TEXT, CURRENT, text, text);
+ pcb_undo_inc_serial();
DrawText(CURRENT, text);
- Draw();
+ pcb_draw();
}
}
free(string);
@@ -863,40 +918,39 @@ void NotifyMode(void)
case PCB_MODE_POLYGON:
{
- PointTypePtr points = Crosshair.AttachedPolygon.Points;
- pcb_cardinal_t n = Crosshair.AttachedPolygon.PointN;
+ pcb_point_t *points = pcb_crosshair.AttachedPolygon.Points;
+ pcb_cardinal_t n = pcb_crosshair.AttachedPolygon.PointN;
/* do update of position; use the 'PCB_MODE_LINE' mechanism */
- NotifyLine();
+ pcb_notify_line();
/* check if this is the last point of a polygon */
- if (n >= 3 && points[0].X == Crosshair.AttachedLine.Point2.X && points[0].Y == Crosshair.AttachedLine.Point2.Y) {
- hid_actionl("Polygon", "Close", NULL);
- ClosePolygon();
+ if (n >= 3 && points[0].X == pcb_crosshair.AttachedLine.Point2.X && points[0].Y == pcb_crosshair.AttachedLine.Point2.Y) {
+ pcb_hid_actionl("Polygon", "Close", NULL);
break;
}
/* Someone clicking twice on the same point ('doubleclick'): close polygon */
- if (n >= 3 && points[n - 1].X == Crosshair.AttachedLine.Point2.X && points[n - 1].Y == Crosshair.AttachedLine.Point2.Y) {
- hid_actionl("Polygon", "Close", NULL);
+ if (n >= 3 && points[n - 1].X == pcb_crosshair.AttachedLine.Point2.X && points[n - 1].Y == pcb_crosshair.AttachedLine.Point2.Y) {
+ pcb_hid_actionl("Polygon", "Close", NULL);
break;
}
/* create new point if it's the first one or if it's
* different to the last one
*/
- if (!n || points[n - 1].X != Crosshair.AttachedLine.Point2.X || points[n - 1].Y != Crosshair.AttachedLine.Point2.Y) {
- CreateNewPointInPolygon(&Crosshair.AttachedPolygon, Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y);
+ if (!n || points[n - 1].X != pcb_crosshair.AttachedLine.Point2.X || points[n - 1].Y != pcb_crosshair.AttachedLine.Point2.Y) {
+ pcb_poly_point_new(&pcb_crosshair.AttachedPolygon, pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y);
/* copy the coordinates */
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y;
}
if (conf_core.editor.orthogonal_moves) {
/* set the mark to the new starting point so ortho works */
- Marked.X = Note.X;
- Marked.Y = Note.Y;
+ pcb_marked.X = Note.X;
+ pcb_marked.Y = Note.Y;
}
break;
@@ -904,72 +958,72 @@ void NotifyMode(void)
case PCB_MODE_POLYGON_HOLE:
{
- switch (Crosshair.AttachedObject.State) {
+ switch (pcb_crosshair.AttachedObject.State) {
/* first notify, lookup object */
- case STATE_FIRST:
- Crosshair.AttachedObject.Type =
- SearchScreen(Note.X, Note.Y, PCB_TYPE_POLYGON,
- &Crosshair.AttachedObject.Ptr1, &Crosshair.AttachedObject.Ptr2, &Crosshair.AttachedObject.Ptr3);
+ case PCB_CH_STATE_FIRST:
+ pcb_crosshair.AttachedObject.Type =
+ pcb_search_screen(Note.X, Note.Y, PCB_TYPE_POLYGON,
+ &pcb_crosshair.AttachedObject.Ptr1, &pcb_crosshair.AttachedObject.Ptr2, &pcb_crosshair.AttachedObject.Ptr3);
- if (Crosshair.AttachedObject.Type == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, "The first point of a polygon hole must be on a polygon.\n");
+ if (pcb_crosshair.AttachedObject.Type == PCB_TYPE_NONE) {
+ pcb_message(PCB_MSG_WARNING, "The first point of a polygon hole must be on a polygon.\n");
break; /* don't start doing anything if clicket out of polys */
}
- if (TEST_FLAG(PCB_FLAG_LOCK, (PolygonTypePtr)
- Crosshair.AttachedObject.Ptr2)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- Crosshair.AttachedObject.Type = PCB_TYPE_NONE;
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_polygon_t *)
+ pcb_crosshair.AttachedObject.Ptr2)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_NONE;
break;
}
else
- Crosshair.AttachedObject.State = STATE_SECOND;
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_SECOND;
/* fall thru: first click is also the first point of the poly hole */
/* second notify, insert new point into object */
- case STATE_SECOND:
+ case PCB_CH_STATE_SECOND:
{
- PointTypePtr points = Crosshair.AttachedPolygon.Points;
- pcb_cardinal_t n = Crosshair.AttachedPolygon.PointN;
- POLYAREA *original, *new_hole, *result;
- FlagType Flags;
+ pcb_point_t *points = pcb_crosshair.AttachedPolygon.Points;
+ pcb_cardinal_t n = pcb_crosshair.AttachedPolygon.PointN;
+ pcb_polyarea_t *original, *new_hole, *result;
+ pcb_flag_t Flags;
/* do update of position; use the 'PCB_MODE_LINE' mechanism */
- NotifyLine();
+ pcb_notify_line();
if (conf_core.editor.orthogonal_moves) {
/* set the mark to the new starting point so ortho works */
- Marked.X = Note.X;
- Marked.Y = Note.Y;
+ pcb_marked.X = Note.X;
+ pcb_marked.Y = Note.Y;
}
/* check if this is the last point of a polygon */
- if (n >= 3 && points[0].X == Crosshair.AttachedLine.Point2.X && points[0].Y == Crosshair.AttachedLine.Point2.Y) {
- /* Create POLYAREAs from the original polygon
+ if (n >= 3 && points[0].X == pcb_crosshair.AttachedLine.Point2.X && points[0].Y == pcb_crosshair.AttachedLine.Point2.Y) {
+ /* Create pcb_polyarea_ts from the original polygon
* and the new hole polygon */
- original = PolygonToPoly((PolygonType *) Crosshair.AttachedObject.Ptr2);
- new_hole = PolygonToPoly(&Crosshair.AttachedPolygon);
+ original = pcb_poly_from_poly((pcb_polygon_t *) pcb_crosshair.AttachedObject.Ptr2);
+ new_hole = pcb_poly_from_poly(&pcb_crosshair.AttachedPolygon);
/* Subtract the hole from the original polygon shape */
- poly_Boolean_free(original, new_hole, &result, PBO_SUB);
+ pcb_polyarea_boolean_free(original, new_hole, &result, PCB_PBO_SUB);
/* Convert the resulting polygon(s) into a new set of nodes
* and place them on the page. Delete the original polygon.
*/
- SaveUndoSerialNumber();
- Flags = ((PolygonType *) Crosshair.AttachedObject.Ptr2)->Flags;
- PolyToPolygonsOnLayer(PCB->Data, (LayerType *) Crosshair.AttachedObject.Ptr1, result, Flags);
- RemoveObject(PCB_TYPE_POLYGON,
- Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3);
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
- Draw();
+ pcb_undo_save_serial();
+ Flags = ((pcb_polygon_t *) pcb_crosshair.AttachedObject.Ptr2)->Flags;
+ pcb_poly_to_polygons_on_layer(PCB->Data, (pcb_layer_t *) pcb_crosshair.AttachedObject.Ptr1, result, Flags);
+ pcb_remove_object(PCB_TYPE_POLYGON,
+ pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3);
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
+ pcb_draw();
/* reset state of attached line */
- memset(&Crosshair.AttachedPolygon, 0, sizeof(PolygonType));
- Crosshair.AttachedLine.State = STATE_FIRST;
- Crosshair.AttachedObject.State = STATE_FIRST;
- addedLines = 0;
+ memset(&pcb_crosshair.AttachedPolygon, 0, sizeof(pcb_polygon_t));
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_FIRST;
+ pcb_added_lines = 0;
break;
}
@@ -977,13 +1031,13 @@ void NotifyMode(void)
/* create new point if it's the first one or if it's
* different to the last one
*/
- if (!n || points[n - 1].X != Crosshair.AttachedLine.Point2.X || points[n - 1].Y != Crosshair.AttachedLine.Point2.Y) {
- CreateNewPointInPolygon(&Crosshair.AttachedPolygon,
- Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y);
+ if (!n || points[n - 1].X != pcb_crosshair.AttachedLine.Point2.X || points[n - 1].Y != pcb_crosshair.AttachedLine.Point2.Y) {
+ pcb_poly_point_new(&pcb_crosshair.AttachedPolygon,
+ pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y);
/* copy the coordinates */
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y;
}
break;
}
@@ -993,43 +1047,43 @@ void NotifyMode(void)
case PCB_MODE_PASTE_BUFFER:
{
- TextType estr[MAX_ELEMENTNAMES];
- ElementTypePtr e = 0;
+ pcb_text_t estr[PCB_MAX_ELEMENTNAMES];
+ pcb_element_t *e = 0;
- if (gui->shift_is_pressed()) {
- int type = SearchScreen(Note.X, Note.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2,
+ if (pcb_gui->shift_is_pressed()) {
+ int type = pcb_search_screen(Note.X, Note.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2,
&ptr3);
if (type == PCB_TYPE_ELEMENT) {
- e = (ElementTypePtr) ptr1;
+ e = (pcb_element_t *) ptr1;
if (e) {
int i;
- memcpy(estr, e->Name, MAX_ELEMENTNAMES * sizeof(TextType));
- for (i = 0; i < MAX_ELEMENTNAMES; ++i)
+ memcpy(estr, e->Name, PCB_MAX_ELEMENTNAMES * sizeof(pcb_text_t));
+ for (i = 0; i < PCB_MAX_ELEMENTNAMES; ++i)
estr[i].TextString = estr[i].TextString ? pcb_strdup(estr[i].TextString) : NULL;
- RemoveElement(e);
+ pcb_element_remove(e);
}
}
}
- if (CopyPastebufferToLayout(Note.X, Note.Y))
- SetChangedFlag(pcb_true);
+ if (pcb_buffer_copy_to_layout(Note.X, Note.Y))
+ pcb_board_set_changed_flag(pcb_true);
if (e) {
- int type = SearchScreen(Note.X, Note.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2,
+ int type = pcb_search_screen(Note.X, Note.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2,
&ptr3);
if (type == PCB_TYPE_ELEMENT && ptr1) {
int i, save_n;
- e = (ElementTypePtr) ptr1;
+ e = (pcb_element_t *) ptr1;
- save_n = NAME_INDEX();
+ save_n = PCB_ELEMNAME_IDX_VISIBLE();
- for (i = 0; i < MAX_ELEMENTNAMES; i++) {
+ for (i = 0; i < PCB_MAX_ELEMENTNAMES; i++) {
if (i == save_n)
EraseElementName(e);
- r_delete_entry(PCB->Data->name_tree[i], (BoxType *) & (e->Name[i]));
- memcpy(&(e->Name[i]), &(estr[i]), sizeof(TextType));
+ pcb_r_delete_entry(PCB->Data->name_tree[i], (pcb_box_t *) & (e->Name[i]));
+ memcpy(&(e->Name[i]), &(estr[i]), sizeof(pcb_text_t));
e->Name[i].Element = e;
- SetTextBoundingBox(&PCB->Font, &(e->Name[i]));
- r_insert_entry(PCB->Data->name_tree[i], (BoxType *) & (e->Name[i]), 0);
+ pcb_text_bbox(&PCB->Font, &(e->Name[i]));
+ pcb_r_insert_entry(PCB->Data->name_tree[i], (pcb_box_t *) & (e->Name[i]), 0);
if (i == save_n)
DrawElementName(e);
}
@@ -1039,56 +1093,41 @@ void NotifyMode(void)
}
case PCB_MODE_REMOVE:
- if ((type = SearchScreen(Note.X, Note.Y, REMOVE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
- if (TEST_FLAG(PCB_FLAG_LOCK, (LineTypePtr) ptr2)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
+ if ((type = pcb_search_screen(Note.X, Note.Y, PCB_REMOVE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_line_t *) ptr2)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
break;
}
- if (type == PCB_TYPE_ELEMENT) {
- RubberbandTypePtr ptr;
- int i;
-
- Crosshair.AttachedObject.RubberbandN = 0;
- LookupRatLines(type, ptr1, ptr2, ptr3);
- ptr = Crosshair.AttachedObject.Rubberband;
- for (i = 0; i < Crosshair.AttachedObject.RubberbandN; i++) {
- if (PCB->RatOn)
- EraseRat((RatTypePtr) ptr->Line);
- if (TEST_FLAG(PCB_FLAG_RUBBEREND, ptr->Line))
- MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, ptr->Line, ptr->Line, ptr->Line);
- else
- TOGGLE_FLAG(PCB_FLAG_RUBBEREND, ptr->Line); /* only remove line once */
- ptr++;
- }
- }
- RemoveObject(type, ptr1, ptr2, ptr3);
- IncrementUndoSerialNumber();
- SetChangedFlag(pcb_true);
+ if (type == PCB_TYPE_ELEMENT)
+ pcb_event(PCB_EVENT_RUBBER_REMOVE_ELEMENT, "ppp", ptr1, ptr2, ptr3);
+ pcb_remove_object(type, ptr1, ptr2, ptr3);
+ pcb_undo_inc_serial();
+ pcb_board_set_changed_flag(pcb_true);
}
break;
case PCB_MODE_ROTATE:
- RotateScreenObject(Note.X, Note.Y, gui->shift_is_pressed()? (SWAP_IDENT ? 1 : 3)
- : (SWAP_IDENT ? 3 : 1));
+ pcb_screen_obj_rotate90(Note.X, Note.Y, pcb_gui->shift_is_pressed()? (PCB_SWAP_IDENT ? 1 : 3)
+ : (PCB_SWAP_IDENT ? 3 : 1));
break;
/* both are almost the same */
case PCB_MODE_COPY:
case PCB_MODE_MOVE:
- switch (Crosshair.AttachedObject.State) {
+ switch (pcb_crosshair.AttachedObject.State) {
/* first notify, lookup object */
- case STATE_FIRST:
+ case PCB_CH_STATE_FIRST:
{
- int types = (conf_core.editor.mode == PCB_MODE_COPY) ? COPY_TYPES : MOVE_TYPES;
-
- Crosshair.AttachedObject.Type =
- SearchScreen(Note.X, Note.Y, types,
- &Crosshair.AttachedObject.Ptr1, &Crosshair.AttachedObject.Ptr2, &Crosshair.AttachedObject.Ptr3);
- if (Crosshair.AttachedObject.Type != PCB_TYPE_NONE) {
- if (conf_core.editor.mode == PCB_MODE_MOVE && TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr)
- Crosshair.AttachedObject.Ptr2)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- Crosshair.AttachedObject.Type = PCB_TYPE_NONE;
+ int types = (conf_core.editor.mode == PCB_MODE_COPY) ? PCB_COPY_TYPES : PCB_MOVE_TYPES;
+
+ pcb_crosshair.AttachedObject.Type =
+ pcb_search_screen(Note.X, Note.Y, types,
+ &pcb_crosshair.AttachedObject.Ptr1, &pcb_crosshair.AttachedObject.Ptr2, &pcb_crosshair.AttachedObject.Ptr3);
+ if (pcb_crosshair.AttachedObject.Type != PCB_TYPE_NONE) {
+ if (conf_core.editor.mode == PCB_MODE_MOVE && PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *)
+ pcb_crosshair.AttachedObject.Ptr2)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_NONE;
}
else
AttachForCopy(Note.X, Note.Y);
@@ -1097,146 +1136,89 @@ void NotifyMode(void)
}
/* second notify, move or copy object */
- case STATE_SECOND:
+ case PCB_CH_STATE_SECOND:
if (conf_core.editor.mode == PCB_MODE_COPY)
- CopyObject(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1,
- Crosshair.AttachedObject.Ptr2,
- Crosshair.AttachedObject.Ptr3, Note.X - Crosshair.AttachedObject.X, Note.Y - Crosshair.AttachedObject.Y);
+ pcb_copy_obj(pcb_crosshair.AttachedObject.Type,
+ pcb_crosshair.AttachedObject.Ptr1,
+ pcb_crosshair.AttachedObject.Ptr2,
+ pcb_crosshair.AttachedObject.Ptr3, Note.X - pcb_crosshair.AttachedObject.X, Note.Y - pcb_crosshair.AttachedObject.Y);
else {
- MoveObjectAndRubberband(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1,
- Crosshair.AttachedObject.Ptr2,
- Crosshair.AttachedObject.Ptr3,
- Note.X - Crosshair.AttachedObject.X, Note.Y - Crosshair.AttachedObject.Y);
- SetLocalRef(0, 0, pcb_false);
+ pcb_move_obj_and_rubberband(pcb_crosshair.AttachedObject.Type,
+ pcb_crosshair.AttachedObject.Ptr1,
+ pcb_crosshair.AttachedObject.Ptr2,
+ pcb_crosshair.AttachedObject.Ptr3,
+ Note.X - pcb_crosshair.AttachedObject.X, Note.Y - pcb_crosshair.AttachedObject.Y);
+ pcb_crosshair_set_local_ref(0, 0, pcb_false);
}
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
/* reset identifiers */
- Crosshair.AttachedObject.Type = PCB_TYPE_NONE;
- Crosshair.AttachedObject.State = STATE_FIRST;
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_NONE;
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_FIRST;
break;
}
break;
/* insert a point into a polygon/line/... */
case PCB_MODE_INSERT_POINT:
- switch (Crosshair.AttachedObject.State) {
+ switch (pcb_crosshair.AttachedObject.State) {
/* first notify, lookup object */
- case STATE_FIRST:
- Crosshair.AttachedObject.Type =
- SearchScreen(Note.X, Note.Y, INSERT_TYPES,
- &Crosshair.AttachedObject.Ptr1, &Crosshair.AttachedObject.Ptr2, &Crosshair.AttachedObject.Ptr3);
-
- if (Crosshair.AttachedObject.Type != PCB_TYPE_NONE) {
- if (TEST_FLAG(PCB_FLAG_LOCK, (PolygonTypePtr)
- Crosshair.AttachedObject.Ptr2)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- Crosshair.AttachedObject.Type = PCB_TYPE_NONE;
+ case PCB_CH_STATE_FIRST:
+ pcb_crosshair.AttachedObject.Type =
+ pcb_search_screen(Note.X, Note.Y, PCB_INSERT_TYPES,
+ &pcb_crosshair.AttachedObject.Ptr1, &pcb_crosshair.AttachedObject.Ptr2, &pcb_crosshair.AttachedObject.Ptr3);
+
+ if (pcb_crosshair.AttachedObject.Type != PCB_TYPE_NONE) {
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_polygon_t *)
+ pcb_crosshair.AttachedObject.Ptr2)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_NONE;
break;
}
else {
/* get starting point of nearest segment */
- if (Crosshair.AttachedObject.Type == PCB_TYPE_POLYGON) {
- fake.poly = (PolygonTypePtr) Crosshair.AttachedObject.Ptr2;
- polyIndex = GetLowestDistancePolygonPoint(fake.poly, Note.X, Note.Y);
+ if (pcb_crosshair.AttachedObject.Type == PCB_TYPE_POLYGON) {
+ fake.poly = (pcb_polygon_t *) pcb_crosshair.AttachedObject.Ptr2;
+ polyIndex = pcb_poly_get_lowest_distance_point(fake.poly, Note.X, Note.Y);
fake.line.Point1 = fake.poly->Points[polyIndex];
- fake.line.Point2 = fake.poly->Points[prev_contour_point(fake.poly, polyIndex)];
- Crosshair.AttachedObject.Ptr2 = &fake.line;
+ fake.line.Point2 = fake.poly->Points[pcb_poly_contour_prev_point(fake.poly, polyIndex)];
+ pcb_crosshair.AttachedObject.Ptr2 = &fake.line;
}
- Crosshair.AttachedObject.State = STATE_SECOND;
- InsertedPoint = *AdjustInsertPoint();
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_SECOND;
+ InsertedPoint = *pcb_adjust_insert_point();
}
}
break;
/* second notify, insert new point into object */
- case STATE_SECOND:
- if (Crosshair.AttachedObject.Type == PCB_TYPE_POLYGON)
- InsertPointIntoObject(PCB_TYPE_POLYGON,
- Crosshair.AttachedObject.Ptr1, fake.poly,
+ case PCB_CH_STATE_SECOND:
+ if (pcb_crosshair.AttachedObject.Type == PCB_TYPE_POLYGON)
+ pcb_insert_point_in_object(PCB_TYPE_POLYGON,
+ pcb_crosshair.AttachedObject.Ptr1, fake.poly,
&polyIndex, InsertedPoint.X, InsertedPoint.Y, pcb_false, pcb_false);
else
- InsertPointIntoObject(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1,
- Crosshair.AttachedObject.Ptr2, &polyIndex, InsertedPoint.X, InsertedPoint.Y, pcb_false, pcb_false);
- SetChangedFlag(pcb_true);
+ pcb_insert_point_in_object(pcb_crosshair.AttachedObject.Type,
+ pcb_crosshair.AttachedObject.Ptr1,
+ pcb_crosshair.AttachedObject.Ptr2, &polyIndex, InsertedPoint.X, InsertedPoint.Y, pcb_false, pcb_false);
+ pcb_board_set_changed_flag(pcb_true);
/* reset identifiers */
- Crosshair.AttachedObject.Type = PCB_TYPE_NONE;
- Crosshair.AttachedObject.State = STATE_FIRST;
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_NONE;
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_FIRST;
break;
}
break;
}
}
-/* ---------------------------------------------------------------------------
- * !!! no action routine !!!
- *
- * event handler to set the cursor according to the X pointer position
- * called from inside main.c
- */
-void EventMoveCrosshair(int ev_x, int ev_y)
+void pcb_event_move_crosshair(int ev_x, int ev_y)
{
- if (mid_stroke)
- stub_stroke_record(ev_x, ev_y);
- if (MoveCrosshairAbsolute(ev_x, ev_y)) {
+ if (pcb_mid_stroke)
+ pcb_stub_stroke_record(ev_x, ev_y);
+ if (pcb_crosshair_move_absolute(ev_x, ev_y)) {
/* update object position and cursor location */
- AdjustAttachedObjects();
- notify_crosshair_change(pcb_true);
- }
-}
-
-/* --------------------------------------------------------------------------- */
-/* helper: get route style size for a function and selected object type.
- size_id: 0=main size; 1=2nd size (drill); 2=clearance */
-int get_style_size(int funcid, Coord * out, int type, int size_id)
-{
- switch (funcid) {
- case F_Object:
- switch (type) {
- case PCB_TYPE_ELEMENT: /* we'd set pin/pad properties, so fall thru */
- case PCB_TYPE_VIA:
- case PCB_TYPE_PIN:
- return get_style_size(F_SelectedVias, out, 0, size_id);
- case PCB_TYPE_PAD:
- return get_style_size(F_SelectedPads, out, 0, size_id);
- case PCB_TYPE_LINE:
- return get_style_size(F_SelectedLines, out, 0, size_id);
- case PCB_TYPE_ARC:
- return get_style_size(F_SelectedArcs, out, 0, size_id);
- }
- Message(PCB_MSG_DEFAULT, _("Sorry, can't fetch the style of that object type (%x)\n"), type);
- return -1;
- case F_SelectedPads:
- if (size_id != 2) /* don't mess with pad size */
- return -1;
- case F_SelectedVias:
- case F_SelectedPins:
- case F_SelectedObjects:
- case F_Selected:
- case F_SelectedElements:
- if (size_id == 0)
- *out = conf_core.design.via_thickness;
- else if (size_id == 1)
- *out = conf_core.design.via_drilling_hole;
- else
- *out = conf_core.design.clearance;
- break;
- case F_SelectedArcs:
- case F_SelectedLines:
- if (size_id == 2)
- *out = conf_core.design.clearance;
- else
- *out = conf_core.design.line_thickness;
- return 0;
- case F_SelectedTexts:
- case F_SelectedNames:
- Message(PCB_MSG_DEFAULT, _("Sorry, can't change style of every selected object\n"));
- return -1;
+ pcb_adjust_attached_objects();
+ pcb_notify_crosshair_change(pcb_true);
}
- return 0;
}
diff --git a/src/action_helper.h b/src/action_helper.h
index f0c42d5..683e7d0 100644
--- a/src/action_helper.h
+++ b/src/action_helper.h
@@ -29,36 +29,36 @@
#ifndef PCB_ACTION_HELPER_H
#define PCB_ACTION_HELPER_H
-#include "global.h"
+#include "global_typedefs.h"
-#define CLONE_TYPES PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_VIA | PCB_TYPE_POLYGON
+/* Event handler to set the cursor according to the X pointer position
+ called from inside main.c */
+void pcb_event_move_crosshair(int ev_x, int ev_y);
-void ActionAdjustStyle(char *);
-void EventMoveCrosshair(int, int);
+/* adjusts the objects which are to be created like attached lines... */
+void pcb_adjust_attached_objects(void);
-void AdjustAttachedObjects(void);
+#define PCB_ACTION_ARG(n) (argc > (n) ? argv[n] : NULL)
-void warpNoWhere(void);
-/* In gui-misc.c */
-pcb_bool ActionGetLocation(char *);
-void ActionGetXY(char *);
+extern int defer_updates;
+extern int defer_needs_update;
+extern pcb_layer_t *lastLayer;
-#define ACTION_ARG(n) (argc > (n) ? argv[n] : NULL)
-int get_style_size(int funcid, Coord * out, int type, int size_id);
+void pcb_notify_line(void); /* creates points of a line (when clicked) */
+void pcb_notify_block(void); /* create first or second corner of a marked block (when clicked) */
-extern int defer_updates;
-extern int defer_needs_update;
-extern LayerTypePtr lastLayer;
+/* does what's appropriate for the current mode setting (when clicked). This
+ normally means creation of an object at the current crosshair location.
+ new created objects are added to the create undo list of course */
+void pcb_notify_mode(void);
-void NotifyLine(void);
-void NotifyBlock(void);
-void NotifyMode(void);
-void ClearWarnings(void);
+/* Clear warning color from pins/pads */
+void pcb_clear_warnings(void);
typedef struct {
- Coord X, Y;
+ pcb_coord_t X, Y;
pcb_cardinal_t Buffer;
pcb_bool Click;
pcb_bool Moving; /* selected type clicked on */
@@ -66,11 +66,19 @@ typedef struct {
void *ptr1;
void *ptr2;
void *ptr3;
-} action_note_t;
+} pcb_action_note_t;
-extern action_note_t Note;
+extern pcb_action_note_t Note;
extern pcb_bool saved_mode;
-void ReleaseMode(void);
+void pcb_release_mode(void);
+
+/* ---------------------------------------------------------------------------
+ * Macros called by various action routines to show usage or to report
+ * a syntax error and fail
+ */
+#define PCB_AFAIL(x) { pcb_message(PCB_MSG_ERROR, "Syntax error. Usage:\n%s\n", (x##_syntax)); return 1; }
+
+#define PCB_ACT_FAIL(x) { pcb_message(PCB_MSG_ERROR, "Syntax error. Usage:\n%s\n", (pcb_acts_ ## x)); return 1; }
#endif
diff --git a/src/attrib.c b/src/attrib.c
new file mode 100644
index 0000000..8acf151
--- /dev/null
+++ b/src/attrib.c
@@ -0,0 +1,115 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2004,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+/* attribute lists */
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "compat_misc.h"
+#include "attrib.h"
+
+char *pcb_attribute_get(pcb_attribute_list_t * list, const char *name)
+{
+ int i;
+ for (i = 0; i < list->Number; i++)
+ if (strcmp(name, list->List[i].name) == 0)
+ return list->List[i].value;
+ return NULL;
+}
+
+int pcb_attribute_put(pcb_attribute_list_t * list, const char *name, const char *value, int replace)
+{
+ int i;
+
+ /* If we're allowed to replace an existing attribute, see if we
+ can. */
+ if (replace) {
+ for (i = 0; i < list->Number; i++)
+ if (strcmp(name, list->List[i].name) == 0) {
+ free(list->List[i].value);
+ list->List[i].value = pcb_strdup_null(value);
+ return 1;
+ }
+ }
+
+ /* At this point, we're going to need to add a new attribute to the
+ list. See if there's room. */
+ if (list->Number >= list->Max) {
+ list->Max += 10;
+ list->List = (pcb_attribute_t *) realloc(list->List, list->Max * sizeof(pcb_attribute_t));
+ }
+
+ /* Now add the new attribute. */
+ i = list->Number;
+ list->List[i].name = pcb_strdup_null(name);
+ list->List[i].value = pcb_strdup_null(value);
+ list->Number++;
+ return 0;
+}
+
+int pcb_attribute_remove_idx(pcb_attribute_list_t * list, int idx)
+{
+ int j;
+ free(list->List[idx].name);
+ free(list->List[idx].value);
+ for (j = idx; j < list->Number-1; j++)
+ list->List[j] = list->List[j + 1];
+ list->Number--;
+ return 0;
+}
+
+int pcb_attribute_remove(pcb_attribute_list_t * list, const char *name)
+{
+ int i, found = 0;
+ for (i = 0; i < list->Number; i++)
+ if (strcmp(name, list->List[i].name) == 0) {
+ found++;
+ pcb_attribute_remove_idx(list, i);
+ }
+ return found;
+}
+
+void pcb_attribute_free(pcb_attribute_list_t *list)
+{
+ int i;
+
+ for (i = 0; i < list->Number; i++) {
+ free(list->List[i].name);
+ free(list->List[i].value);
+ }
+ free(list->List);
+ list->List = NULL;
+ list->Max = 0;
+}
+
+void pcb_attribute_copy_all(pcb_attribute_list_t *dest, const pcb_attribute_list_t *src, int replace)
+{
+ int i;
+
+ for (i = 0; i < src->Number; i++)
+ pcb_attribute_put(dest, src->List[i].name, src->List[i].value, replace);
+}
+
diff --git a/src/attrib.h b/src/attrib.h
new file mode 100644
index 0000000..0431879
--- /dev/null
+++ b/src/attrib.h
@@ -0,0 +1,69 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+/* attribute lists */
+
+#ifndef PCB_ATTRIB_H
+#define PCB_ATTRIB_H
+
+typedef struct pcb_attribute_list_s pcb_attribute_list_t;
+
+typedef struct pcb_attribute_s {
+ char *name;
+ char *value;
+} pcb_attribute_t;
+
+struct pcb_attribute_list_s {
+ int Number, Max;
+ pcb_attribute_t *List;
+};
+
+/* Returns NULL if the name isn't found, else the value for that named
+ attribute. */
+char *pcb_attribute_get(pcb_attribute_list_t * list, const char *name);
+/* Adds an attribute to the list. If the attribute already exists,
+ whether it's replaced or a second copy added depends on
+ REPLACE. Returns non-zero if an existing attribute was replaced. */
+int pcb_attribute_put(pcb_attribute_list_t * list, const char *name, const char *value, int replace);
+/* Simplistic version: Takes a pointer to an object, looks up attributes in it. */
+#define pcb_attrib_get(OBJ,name) pcb_attribute_get(&(OBJ->Attributes), name)
+/* Simplistic version: Takes a pointer to an object, sets attributes in it. */
+#define pcb_attrib_put(OBJ,name,value) pcb_attribute_put(&(OBJ->Attributes), name, value, 1)
+/* Remove an attribute by name; returns number of items removed */
+int pcb_attribute_remove(pcb_attribute_list_t * list, const char *name);
+/* Simplistic version of Remove. */
+#define pcb_attrib_remove(OBJ, name) pcb_attribute_remove(&(OBJ->Attributes), name)
+
+/* remove item by index - WARNING: no checks are made, idx has to be valid! */
+int pcb_attribute_remove_idx(pcb_attribute_list_t * list, int idx);
+
+/* Frees memory used by an attribute list */
+void pcb_attribute_free(pcb_attribute_list_t *list);
+
+/* Copy eacg attribute from src to dest */
+void pcb_attribute_copy_all(pcb_attribute_list_t *dest, const pcb_attribute_list_t *src, int replace);
+
+#endif
diff --git a/src/board.c b/src/board.c
new file mode 100644
index 0000000..af2969e
--- /dev/null
+++ b/src/board.c
@@ -0,0 +1,324 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+#include "config.h"
+#include "board.h"
+#include "data.h"
+#include "conf_core.h"
+#include "plug_io.h"
+#include "compat_misc.h"
+#include "hid_actions.h"
+#include "paths.h"
+#include "rtree.h"
+#include "undo.h"
+#include "draw.h"
+#include "event.h"
+
+pcb_board_t *PCB;
+
+void pcb_board_free(pcb_board_t * pcb)
+{
+ int i;
+
+ if (pcb == NULL)
+ return;
+
+ free(pcb->Name);
+ free(pcb->Filename);
+ free(pcb->PrintFilename);
+ pcb_ratspatch_destroy(pcb);
+ pcb_data_free(pcb->Data);
+ free(pcb->Data);
+ /* release font symbols */
+ for (i = 0; i <= PCB_MAX_FONTPOSITION; i++)
+ free(pcb->Font.Symbol[i].Line);
+ for (i = 0; i < PCB_NUM_NETLISTS; i++)
+ pcb_lib_free(&(pcb->NetlistLib[i]));
+ vtroutestyle_uninit(&pcb->RouteStyle);
+ pcb_attribute_free(&pcb->Attributes);
+ /* clear struct */
+ memset(pcb, 0, sizeof(pcb_board_t));
+}
+
+/* creates a new PCB */
+pcb_board_t *pcb_board_new_(pcb_bool SetDefaultNames)
+{
+ pcb_board_t *ptr, *save;
+ int i;
+
+ /* allocate memory, switch all layers on and copy resources */
+ ptr = calloc(1, sizeof(pcb_board_t));
+ ptr->Data = pcb_buffer_new();
+ ptr->Data->pcb = ptr;
+
+ ptr->ThermStyle = 4;
+ ptr->IsleArea = 2.e8;
+ ptr->SilkActive = pcb_false;
+ ptr->RatDraw = pcb_false;
+
+ /* NOTE: we used to set all the pcb flags on ptr here, but we don't need to do that anymore due to the new conf system */
+ /* this is the most useful starting point for now */
+
+ ptr->Grid = conf_core.editor.grid;
+ pcb_layer_parse_group_string(conf_core.design.groups, &ptr->LayerGroups, PCB_MAX_LAYER, 0);
+ save = PCB;
+ PCB = ptr;
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
+ PCB = save;
+
+ ptr->Zoom = conf_core.editor.zoom;
+ ptr->MaxWidth = conf_core.design.max_width;
+ ptr->MaxHeight = conf_core.design.max_height;
+ ptr->ID = pcb_create_ID_get();
+ ptr->ThermScale = 0.5;
+
+ ptr->Bloat = conf_core.design.bloat;
+ ptr->Shrink = conf_core.design.shrink;
+ ptr->minWid = conf_core.design.min_wid;
+ ptr->minSlk = conf_core.design.min_slk;
+ ptr->minDrill = conf_core.design.min_drill;
+ ptr->minRing = conf_core.design.min_ring;
+
+ for (i = 0; i < PCB_MAX_LAYER; i++)
+ ptr->Data->Layer[i].Name = pcb_strdup(conf_core.design.default_layer_name[i]);
+
+ pcb_font_create_default(ptr);
+
+ return (ptr);
+}
+
+pcb_board_t *pcb_board_new(void)
+{
+ pcb_board_t *old, *nw;
+ int dpcb;
+
+ old = PCB;
+
+ PCB = NULL;
+
+ dpcb = -1;
+ pcb_io_err_inhibit_inc();
+ conf_list_foreach_path_first(dpcb, &conf_core.rc.default_pcb_file, pcb_load_pcb(__path__, NULL, pcb_false, 1 | 0x10));
+ pcb_io_err_inhibit_dec();
+
+ if (dpcb == 0) {
+ nw = PCB;
+ if (nw->Filename != NULL) {
+ /* make sure the new PCB doesn't inherit the name and loader of the default pcb */
+ free(nw->Filename);
+ nw->Filename = NULL;
+ nw->Data->loader = NULL;
+ }
+ }
+ else {
+ nw = NULL;
+ }
+
+ PCB = old;
+ return nw;
+}
+
+int pcb_board_new_postproc(pcb_board_t *pcb, int use_defaults)
+{
+ /* copy default settings */
+ pcb_colors_from_settings(pcb);
+
+ return 0;
+}
+
+#warning TODO: indeed, remove this and all the board *color fields
+void pcb_colors_from_settings(pcb_board_t *ptr)
+{
+ int i;
+
+ /* copy default settings */
+ ptr->ConnectedColor = conf_core.appearance.color.connected;
+ ptr->ElementColor = conf_core.appearance.color.element;
+ ptr->ElementColor_nonetlist = conf_core.appearance.color.element_nonetlist;
+ ptr->RatColor = conf_core.appearance.color.rat;
+ ptr->InvisibleObjectsColor = conf_core.appearance.color.invisible_objects;
+ ptr->InvisibleMarkColor = conf_core.appearance.color.invisible_mark;
+ ptr->ElementSelectedColor = conf_core.appearance.color.element_selected;
+ ptr->RatSelectedColor = conf_core.appearance.color.rat_selected;
+ ptr->PinColor = conf_core.appearance.color.pin;
+ ptr->PinSelectedColor = conf_core.appearance.color.pin_selected;
+ ptr->PinNameColor = conf_core.appearance.color.pin_name;
+ ptr->ViaColor = conf_core.appearance.color.via;
+ ptr->ViaSelectedColor = conf_core.appearance.color.via_selected;
+ ptr->WarnColor = conf_core.appearance.color.warn;
+ ptr->MaskColor = conf_core.appearance.color.mask;
+ for (i = 0; i < PCB_MAX_LAYER; i++) {
+ ptr->Data->Layer[i].Color = conf_core.appearance.color.layer[i];
+ ptr->Data->Layer[i].SelectedColor = conf_core.appearance.color.layer_selected[i];
+ }
+ ptr->Data->Layer[pcb_component_silk_layer].Color =
+ conf_core.editor.show_solder_side ? conf_core.appearance.color.invisible_objects : conf_core.appearance.color.element;
+ ptr->Data->Layer[pcb_component_silk_layer].SelectedColor = conf_core.appearance.color.element_selected;
+ ptr->Data->Layer[pcb_solder_silk_layer].Color = conf_core.editor.show_solder_side ? conf_core.appearance.color.element : conf_core.appearance.color.invisible_objects;
+ ptr->Data->Layer[pcb_solder_silk_layer].SelectedColor = conf_core.appearance.color.element_selected;
+}
+
+typedef struct {
+ int nplated;
+ int nunplated;
+} HoleCountStruct;
+
+static pcb_r_dir_t hole_counting_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pin_t *pin = (pcb_pin_t *) b;
+ HoleCountStruct *hcs = (HoleCountStruct *) cl;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin))
+ hcs->nunplated++;
+ else
+ hcs->nplated++;
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+void pcb_board_count_holes(int *plated, int *unplated, const pcb_box_t * within_area)
+{
+ HoleCountStruct hcs = { 0, 0 };
+
+ pcb_r_search(PCB->Data->pin_tree, within_area, NULL, hole_counting_callback, &hcs, NULL);
+ pcb_r_search(PCB->Data->via_tree, within_area, NULL, hole_counting_callback, &hcs, NULL);
+
+ if (plated != NULL)
+ *plated = hcs.nplated;
+ if (unplated != NULL)
+ *unplated = hcs.nunplated;
+}
+
+const char *pcb_board_get_filename(void)
+{
+ return PCB->Filename;
+}
+
+const char *pcb_board_get_name(void)
+{
+ return PCB->Name;
+}
+
+pcb_bool pcb_board_change_name(char *Name)
+{
+ free(PCB->Name);
+ PCB->Name = Name;
+ pcb_board_changed(0);
+ return (pcb_true);
+}
+
+void pcb_board_resize(pcb_coord_t Width, pcb_coord_t Height)
+{
+ PCB->MaxWidth = Width;
+ PCB->MaxHeight = Height;
+
+ /* crosshair range is different if pastebuffer-mode
+ * is enabled
+ */
+ if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER)
+ pcb_crosshair_set_range(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->BoundingBox.X1,
+ PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->BoundingBox.Y1,
+ MAX(0,
+ Width - (PCB_PASTEBUFFER->BoundingBox.X2 -
+ PCB_PASTEBUFFER->X)), MAX(0, Height - (PCB_PASTEBUFFER->BoundingBox.Y2 - PCB_PASTEBUFFER->Y)));
+ else
+ pcb_crosshair_set_range(0, 0, Width, Height);
+
+ pcb_board_changed(0);
+}
+
+void pcb_board_remove(pcb_board_t *Ptr)
+{
+ pcb_undo_clear_list(pcb_true);
+ pcb_board_free(Ptr);
+ free(Ptr);
+}
+
+/* sets cursor grid with respect to grid offset values */
+void pcb_board_set_grid(pcb_coord_t Grid, pcb_bool align)
+{
+ if (Grid >= 1 && Grid <= PCB_MAX_GRID) {
+ if (align) {
+ PCB->GridOffsetX = pcb_crosshair.X % Grid;
+ PCB->GridOffsetY = pcb_crosshair.Y % Grid;
+ }
+ PCB->Grid = Grid;
+ conf_set_design("editor/grid", "%$mS", Grid);
+ if (conf_core.editor.draw_grid)
+ pcb_redraw();
+ }
+}
+
+/* sets a new line thickness */
+void pcb_board_set_line_width(pcb_coord_t Size)
+{
+ if (Size >= PCB_MIN_LINESIZE && Size <= PCB_MAX_LINESIZE) {
+ conf_set_design("design/line_thickness", "%$mS", Size);
+ if (conf_core.editor.auto_drc)
+ pcb_crosshair_grid_fit(pcb_crosshair.X, pcb_crosshair.Y);
+ }
+}
+
+/* sets a new via thickness */
+void pcb_board_set_via_size(pcb_coord_t Size, pcb_bool Force)
+{
+ if (Force || (Size <= PCB_MAX_PINORVIASIZE && Size >= PCB_MIN_PINORVIASIZE && Size >= conf_core.design.via_drilling_hole + PCB_MIN_PINORVIACOPPER)) {
+ conf_set_design("design/via_thickness", "%$mS", Size);
+ }
+}
+
+/* sets a new via drilling hole */
+void pcb_board_set_via_drilling_hole(pcb_coord_t Size, pcb_bool Force)
+{
+ if (Force || (Size <= PCB_MAX_PINORVIASIZE && Size >= PCB_MIN_PINORVIAHOLE && Size <= conf_core.design.via_thickness - PCB_MIN_PINORVIACOPPER)) {
+ conf_set_design("design/via_drilling_hole", "%$mS", Size);
+ }
+}
+
+/* sets a clearance width */
+void pcb_board_set_clearance(pcb_coord_t Width)
+{
+ if (Width <= PCB_MAX_LINESIZE) {
+ conf_set_design("design/clearance", "%$mS", Width);
+ }
+}
+
+/* sets a text scaling */
+void pcb_board_set_text_scale(int Scale)
+{
+ if (Scale <= PCB_MAX_TEXTSCALE && Scale >= PCB_MIN_TEXTSCALE) {
+ conf_set_design("design/text_scale", "%d", Scale);
+ }
+}
+
+/* sets or resets changed flag and redraws status */
+void pcb_board_set_changed_flag(pcb_bool New)
+{
+ PCB->Changed = New;
+}
+
+
+void pcb_board_changed(int reverted)
+{
+ pcb_event(PCB_EVENT_BOARD_CHANGED, "i", reverted);
+}
diff --git a/src/board.h b/src/board.h
new file mode 100644
index 0000000..04c40e3
--- /dev/null
+++ b/src/board.h
@@ -0,0 +1,177 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
+ * 15 Oct 2008 Ineiev: add different crosshair shapes
+ *
+ * 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 addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+/* definition of types */
+#ifndef PCB_BOARD_H
+#define PCB_BOARD_H
+
+#include "config.h"
+
+enum {
+ PCB_NETLIST_INPUT = 0, /* index of the original netlist as imported */
+ PCB_NETLIST_EDITED = 1, /* index of the netlist produced by applying netlist patches on [PCB_NETLIST_INPUT] */
+ PCB_NUM_NETLISTS /* so that we know how many netlists we are dealing with */
+};
+
+#include "const.h"
+#include "macro.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <math.h>
+#include <ctype.h>
+
+#include "global_typedefs.h"
+#include "vtroutestyle.h"
+#include "layer.h"
+#include "library.h"
+#include "attrib.h"
+#include "rats_patch.h"
+#include "font.h"
+
+ /* The pcb_board_t struct holds information about board layout most of which is
+ | saved with the layout. A new PCB layout struct is first initialized
+ | with values from the user configurable Settings struct and then reset
+ | to the saved layout values when a layout is loaded.
+ | This struct is also used for the remove list and for buffer handling
+ */
+struct pcb_board_s {
+ long ID; /* see macro.h */
+ char *Name, /* name of board */
+ *Filename, /* name of file (from load) */
+ *PrintFilename, /* from print dialog */
+ *Netlistname, /* name of netlist file */
+ ThermStyle; /* type of thermal to place with thermal tool */
+ pcb_bool Changed, /* layout has been changed */
+ ViaOn, /* visibility flags */
+ ElementOn, RatOn, InvisibleObjectsOn, PinOn, SilkActive, /* active layer is actually silk */
+ RatDraw; /* we're drawing rats */
+ char *ViaColor, /* some colors */
+ *ViaSelectedColor,
+ *PinColor,
+ *PinSelectedColor,
+ *PinNameColor,
+ *ElementColor,
+ *ElementColor_nonetlist,
+ *RatColor,
+ *InvisibleObjectsColor,
+ *InvisibleMarkColor, *ElementSelectedColor, *RatSelectedColor, *ConnectedColor, *WarnColor, *MaskColor;
+ pcb_coord_t CursorX, /* cursor position as saved with layout */
+ CursorY;
+ pcb_coord_t Bloat, /* drc sizes saved with layout */
+ Shrink, minWid, minSlk, minDrill, minRing;
+ pcb_coord_t GridOffsetX, /* as saved with layout */
+ GridOffsetY, MaxWidth, /* allowed size */
+ MaxHeight;
+
+ pcb_coord_t Grid; /* used grid with offsets */
+ double Zoom, /* zoom factor */
+ IsleArea, /* minimum poly island to retain */
+ ThermScale; /* scale factor used with thermals */
+ pcb_font_t Font;
+ pcb_layer_group_t LayerGroups;
+ vtroutestyle_t RouteStyle;
+ pcb_lib_t NetlistLib[PCB_NUM_NETLISTS];
+ pcb_ratspatch_line_t *NetlistPatches, *NetlistPatchLast;
+ pcb_attribute_list_t Attributes;
+ pcb_data_t *Data; /* entire database */
+
+ pcb_bool is_footprint; /* If set, the user has loaded a footprint, not a pcb. */
+
+ const pcb_attribute_list_t *pen_attr;
+
+
+/* netlist states */
+ int netlist_frozen; /* counter */
+ unsigned netlist_needs_update:1;
+};
+
+extern pcb_board_t *PCB; /* the board being edited */
+
+/* free memory used by a board */
+void pcb_board_free(pcb_board_t *pcb);
+
+/* creates a new PCB - low level */
+pcb_board_t *pcb_board_new_(pcb_bool SetDefaultNames);
+
+/* creates a new PCB - high level (uses a template board) */
+pcb_board_t *pcb_board_new(void);
+
+/* Called after PCB->Data->LayerN is set. Returns non-zero on error */
+int pcb_board_new_postproc(pcb_board_t *pcb, int use_defaults);
+
+/* Perhaps PCB should internally just use the Settings colors? For now,
+ * use this to set PCB colors so the config can reassign PCB colors. */
+void pcb_colors_from_settings(pcb_board_t *);
+
+/* counts the number of plated and unplated holes in the design within
+ a given area of the board. To count for the whole board, pass NULL
+ within_area. */
+void pcb_board_count_holes(int *plated, int *unplated, const pcb_box_t * within_area);
+
+#define PCB_SWAP_X(x) (PCB_SWAP_SIGN_X(x))
+#define PCB_SWAP_Y(y) (PCB->MaxHeight +PCB_SWAP_SIGN_Y(y))
+
+const char *pcb_board_get_filename(void);
+const char *pcb_board_get_name(void);
+
+/* changes the name of a layout; Name is allocated by the caller (no strdup() is made) */
+pcb_bool pcb_board_change_name(char *Name);
+
+/* changes the maximum size of a layout, notifies the GUI
+ * and adjusts the cursor confinement box */
+void pcb_board_resize(pcb_coord_t Width, pcb_coord_t Height);
+
+
+/* free the board and remove its undo list */
+void pcb_board_remove(pcb_board_t *Ptr);
+
+/* sets cursor grid with respect to grid offset values */
+void pcb_board_set_grid(pcb_coord_t Grid, pcb_bool align);
+
+/* sets a new line thickness */
+void pcb_board_set_line_width(pcb_coord_t Size);
+
+/* sets a new via thickness */
+void pcb_board_set_via_size(pcb_coord_t Size, pcb_bool Force);
+
+/* sets a new via drilling hole */
+void pcb_board_set_via_drilling_hole(pcb_coord_t Size, pcb_bool Force);
+
+/* sets a clearance width */
+void pcb_board_set_clearance(pcb_coord_t Width);
+
+/* sets a text scaling */
+void pcb_board_set_text_scale(int Scale);
+
+/* sets or resets changed flag and redraws status */
+void pcb_board_set_changed_flag(pcb_bool New);
+
+void pcb_board_changed(int reverted);
+
+#endif
diff --git a/src/box.c b/src/box.c
new file mode 100644
index 0000000..9ce4751
--- /dev/null
+++ b/src/box.c
@@ -0,0 +1,85 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+#warning TODO: remove this and use genvect
+
+#define STEP_POINT 100
+#include <string.h>
+#include "config.h"
+#include "rotate.h"
+#include "box.h"
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a box, allocates memory if necessary
+ */
+pcb_box_t *pcb_box_new(pcb_box_list_t *Boxes)
+{
+ pcb_box_t *box = Boxes->Box;
+
+ /* realloc new memory if necessary and clear it */
+ if (Boxes->BoxN >= Boxes->BoxMax) {
+ Boxes->BoxMax = STEP_POINT + (2 * Boxes->BoxMax);
+ box = (pcb_box_t *) realloc(box, Boxes->BoxMax * sizeof(pcb_box_t));
+ Boxes->Box = box;
+ memset(box + Boxes->BoxN, 0, (Boxes->BoxMax - Boxes->BoxN) * sizeof(pcb_box_t));
+ }
+ return (box + Boxes->BoxN++);
+}
+
+/* ---------------------------------------------------------------------------
+ * frees memory used by a box list
+ */
+void pcb_box_free(pcb_box_list_t *Boxlist)
+{
+ if (Boxlist) {
+ free(Boxlist->Box);
+ memset(Boxlist, 0, sizeof(pcb_box_list_t));
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * sets the bounding box of a point (which is silly)
+ */
+void pcb_set_point_bounding_box(pcb_point_t *Pnt)
+{
+ Pnt->X2 = Pnt->X + 1;
+ Pnt->Y2 = Pnt->Y + 1;
+}
+
+/* ---------------------------------------------------------------------------
+ * rotates a box in 90 degree steps
+ */
+void pcb_box_rotate90(pcb_box_t *Box, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
+{
+ pcb_coord_t x1 = Box->X1, y1 = Box->Y1, x2 = Box->X2, y2 = Box->Y2;
+
+ PCB_COORD_ROTATE90(x1, y1, X, Y, Number);
+ PCB_COORD_ROTATE90(x2, y2, X, Y, Number);
+ Box->X1 = MIN(x1, x2);
+ Box->Y1 = MIN(y1, y2);
+ Box->X2 = MAX(x1, x2);
+ Box->Y2 = MAX(y1, y2);
+}
diff --git a/src/box.h b/src/box.h
index 30b315b..cca29aa 100644
--- a/src/box.h
+++ b/src/box.h
@@ -35,113 +35,134 @@
#define PCB_BOX_H
#include <assert.h>
-#include "global.h"
+#include "math_helper.h"
+#include "global_typedefs.h"
+#include "config.h"
+#include "macro.h"
+#include "move.h"
+#include "obj_common.h"
+
+struct pcb_box_list_s {
+ pcb_cardinal_t BoxN, /* the number of boxes contained */
+ BoxMax; /* max boxes from malloc */
+ pcb_box_t *Box;
+};
#include "misc_util.h"
-typedef enum { NORTH = 0, EAST = 1, SOUTH = 2, WEST = 3, NE = 4, SE = 5, SW = 6, NW = 7, ALL = 8
-} direction_t;
+typedef enum {
+ PCB_NORTH = 0, PCB_EAST = 1, PCB_SOUTH = 2, PCB_WEST = 3,
+ PCB_NE = 4, PCB_SE = 5, PCB_SW = 6, PCB_NW = 7,
+ PCB_ANY_DIR = 8
+} pcb_direction_t;
/* rotates box 90-degrees cw */
/* that's a strange rotation! */
-#define ROTATEBOX_CW(box) { Coord t;\
+#define PCB_BOX_ROTATE_CW(box) { pcb_coord_t t;\
t = (box).X1; (box).X1 = -(box).Y2; (box).Y2 = (box).X2;\
(box).X2 = -(box).Y1; (box).Y1 = t;\
}
-#define ROTATEBOX_TO_NORTH(box, dir) do { Coord t;\
+#define PCB_BOX_ROTATE_TO_NORTH(box, dir) do { pcb_coord_t t;\
switch(dir) {\
- case EAST: \
+ case PCB_EAST: \
t = (box).X1; (box).X1 = (box).Y1; (box).Y1 = -(box).X2;\
(box).X2 = (box).Y2; (box).Y2 = -t; break;\
- case SOUTH: \
+ case PCB_SOUTH: \
t = (box).X1; (box).X1 = -(box).X2; (box).X2 = -t;\
t = (box).Y1; (box).Y1 = -(box).Y2; (box).Y2 = -t; break;\
- case WEST: \
+ case PCB_WEST: \
t = (box).X1; (box).X1 = -(box).Y2; (box).Y2 = (box).X2;\
(box).X2 = -(box).Y1; (box).Y1 = t; break;\
- case NORTH: break;\
+ case PCB_NORTH: break;\
default: assert(0);\
}\
} while (0)
-#define ROTATEBOX_FROM_NORTH(box, dir) do { Coord t;\
+#define PCB_BOX_ROTATE_FROM_NORTH(box, dir) do { pcb_coord_t t;\
switch(dir) {\
- case WEST: \
+ case PCB_WEST: \
t = (box).X1; (box).X1 = (box).Y1; (box).Y1 = -(box).X2;\
(box).X2 = (box).Y2; (box).Y2 = -t; break;\
- case SOUTH: \
+ case PCB_SOUTH: \
t = (box).X1; (box).X1 = -(box).X2; (box).X2 = -t;\
t = (box).Y1; (box).Y1 = -(box).Y2; (box).Y2 = -t; break;\
- case EAST: \
+ case PCB_EAST: \
t = (box).X1; (box).X1 = -(box).Y2; (box).Y2 = (box).X2;\
(box).X2 = -(box).Y1; (box).Y1 = t; break;\
- case NORTH: break;\
+ case PCB_NORTH: break;\
default: assert(0);\
}\
} while (0)
/* to avoid overflow, we calculate centers this way */
-#define CENTER_X(b) ((b).X1 + ((b).X2 - (b).X1)/2)
-#define CENTER_Y(b) ((b).Y1 + ((b).Y2 - (b).Y1)/2)
+#define PCB_BOX_CENTER_X(b) ((b).X1 + ((b).X2 - (b).X1)/2)
+#define PCB_BOX_CENTER_Y(b) ((b).Y1 + ((b).Y2 - (b).Y1)/2)
/* some useful box utilities. */
-typedef struct cheap_point {
- Coord X, Y;
-} CheapPointType;
+#define PCB_BOX_MOVE_LOWLEVEL(b,dx,dy) \
+ { \
+ PCB_MOVE((b)->X1,(b)->Y1,(dx),(dy)) \
+ PCB_MOVE((b)->X2,(b)->Y2,(dx),(dy)) \
+ }
+
+
+typedef struct pcb_cheap_point_s {
+ pcb_coord_t X, Y;
+} pcb_cheap_point_t;
/* note that boxes are closed on top and left and open on bottom and right. */
/* this means that top-left corner is in box, *but bottom-right corner is
* not*. */
-static inline PCB_FUNC_UNUSED pcb_bool point_in_box(const BoxType * box, Coord X, Coord Y)
+static inline PCB_FUNC_UNUSED pcb_bool pcb_point_in_box(const pcb_box_t * box, pcb_coord_t X, pcb_coord_t Y)
{
return (X >= box->X1) && (Y >= box->Y1) && (X < box->X2) && (Y < box->Y2);
}
-static inline PCB_FUNC_UNUSED pcb_bool point_in_closed_box(const BoxType * box, Coord X, Coord Y)
+static inline PCB_FUNC_UNUSED pcb_bool pcb_point_in_closed_box(const pcb_box_t * box, pcb_coord_t X, pcb_coord_t Y)
{
return (X >= box->X1) && (Y >= box->Y1) && (X <= box->X2) && (Y <= box->Y2);
}
-static inline PCB_FUNC_UNUSED pcb_bool box_is_good(const BoxType * b)
+static inline PCB_FUNC_UNUSED pcb_bool pcb_box_is_good(const pcb_box_t * b)
{
return (b->X1 < b->X2) && (b->Y1 < b->Y2);
}
-static inline PCB_FUNC_UNUSED pcb_bool box_intersect(const BoxType * a, const BoxType * b)
+static inline PCB_FUNC_UNUSED pcb_bool pcb_box_intersect(const pcb_box_t * a, const pcb_box_t * b)
{
return (a->X1 < b->X2) && (b->X1 < a->X2) && (a->Y1 < b->Y2) && (b->Y1 < a->Y2);
}
-static inline PCB_FUNC_UNUSED CheapPointType closest_point_in_box(const CheapPointType * from, const BoxType * box)
+static inline PCB_FUNC_UNUSED pcb_cheap_point_t pcb_closest_pcb_point_in_box(const pcb_cheap_point_t * from, const pcb_box_t * box)
{
- CheapPointType r;
+ pcb_cheap_point_t r;
assert(box->X1 < box->X2 && box->Y1 < box->Y2);
r.X = (from->X < box->X1) ? box->X1 : (from->X > box->X2 - 1) ? box->X2 - 1 : from->X;
r.Y = (from->Y < box->Y1) ? box->Y1 : (from->Y > box->Y2 - 1) ? box->Y2 - 1 : from->Y;
- assert(point_in_box(box, r.X, r.Y));
+ assert(pcb_point_in_box(box, r.X, r.Y));
return r;
}
-static inline PCB_FUNC_UNUSED pcb_bool box_in_box(const BoxType * outer, const BoxType * inner)
+static inline PCB_FUNC_UNUSED pcb_bool pcb_box_in_box(const pcb_box_t * outer, const pcb_box_t * inner)
{
return (outer->X1 <= inner->X1) && (inner->X2 <= outer->X2) && (outer->Y1 <= inner->Y1) && (inner->Y2 <= outer->Y2);
}
-static inline PCB_FUNC_UNUSED BoxType clip_box(const BoxType * box, const BoxType * clipbox)
+static inline PCB_FUNC_UNUSED pcb_box_t pcb_clip_box(const pcb_box_t * box, const pcb_box_t * clipbox)
{
- BoxType r;
- assert(box_intersect(box, clipbox));
+ pcb_box_t r;
+ assert(pcb_box_intersect(box, clipbox));
r.X1 = MAX(box->X1, clipbox->X1);
r.X2 = MIN(box->X2, clipbox->X2);
r.Y1 = MAX(box->Y1, clipbox->Y1);
r.Y2 = MIN(box->Y2, clipbox->Y2);
- assert(box_in_box(clipbox, &r));
+ assert(pcb_box_in_box(clipbox, &r));
return r;
}
-static inline PCB_FUNC_UNUSED BoxType shrink_box(const BoxType * box, Coord amount)
+static inline PCB_FUNC_UNUSED pcb_box_t pcb_shrink_box(const pcb_box_t * box, pcb_coord_t amount)
{
- BoxType r = *box;
+ pcb_box_t r = *box;
r.X1 += amount;
r.Y1 += amount;
r.X2 -= amount;
@@ -149,15 +170,15 @@ static inline PCB_FUNC_UNUSED BoxType shrink_box(const BoxType * box, Coord amou
return r;
}
-static inline PCB_FUNC_UNUSED BoxType bloat_box(const BoxType * box, Coord amount)
+static inline PCB_FUNC_UNUSED pcb_box_t pcb_bloat_box(const pcb_box_t * box, pcb_coord_t amount)
{
- return shrink_box(box, -amount);
+ return pcb_shrink_box(box, -amount);
}
/* construct a minimum box that touches the input box at the center */
-static inline PCB_FUNC_UNUSED BoxType box_center(const BoxType * box)
+static inline PCB_FUNC_UNUSED pcb_box_t pcb_box_center(const pcb_box_t * box)
{
- BoxType r;
+ pcb_box_t r;
r.X1 = box->X1 + (box->X2 - box->X1) / 2;
r.X2 = r.X1 + 1;
r.Y1 = box->Y1 + (box->Y2 - box->Y1) / 2;
@@ -166,9 +187,9 @@ static inline PCB_FUNC_UNUSED BoxType box_center(const BoxType * box)
}
/* construct a minimum box that touches the input box at the corner */
-static inline PCB_FUNC_UNUSED BoxType box_corner(const BoxType * box)
+static inline PCB_FUNC_UNUSED pcb_box_t pcb_box_corner(const pcb_box_t * box)
{
- BoxType r;
+ pcb_box_t r;
r.X1 = box->X1;
r.X2 = r.X1 + 1;
r.Y1 = box->Y1;
@@ -177,9 +198,9 @@ static inline PCB_FUNC_UNUSED BoxType box_corner(const BoxType * box)
}
/* construct a box that holds a single point */
-static inline PCB_FUNC_UNUSED BoxType point_box(Coord X, Coord Y)
+static inline PCB_FUNC_UNUSED pcb_box_t pcb_point_box(pcb_coord_t X, pcb_coord_t Y)
{
- BoxType r;
+ pcb_box_t r;
r.X1 = X;
r.X2 = X + 1;
r.Y1 = Y;
@@ -188,7 +209,7 @@ static inline PCB_FUNC_UNUSED BoxType point_box(Coord X, Coord Y)
}
/* close a bounding box by pushing its upper right corner */
-static inline PCB_FUNC_UNUSED void close_box(BoxType * r)
+static inline PCB_FUNC_UNUSED void pcb_close_box(pcb_box_t * r)
{
r->X2++;
r->Y2++;
@@ -197,10 +218,15 @@ static inline PCB_FUNC_UNUSED void close_box(BoxType * r)
/* return the square of the minimum distance from a point to some point
* inside a box. The box is half-closed! That is, the top-left corner
* is considered in the box, but the bottom-right corner is not. */
-static inline PCB_FUNC_UNUSED double dist2_to_box(const CheapPointType * p, const BoxType * b)
+static inline PCB_FUNC_UNUSED double pcb_dist2_to_box(const pcb_cheap_point_t * p, const pcb_box_t * b)
{
- CheapPointType r = closest_point_in_box(p, b);
- return Distance(r.X, r.Y, p->X, p->Y);
+ pcb_cheap_point_t r = pcb_closest_pcb_point_in_box(p, b);
+ return pcb_distance(r.X, r.Y, p->X, p->Y);
}
+pcb_box_t *pcb_box_new(pcb_box_list_t *);
+void pcb_box_free(pcb_box_list_t *);
+void pcb_set_point_bounding_box(pcb_point_t *Pnt);
+void pcb_box_rotate90(pcb_box_t *Box, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
+
#endif /* __BOX_H_INCLUDED__ */
diff --git a/src/buffer.c b/src/buffer.c
index 0d2d0a1..074c250 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -26,59 +26,30 @@
/* functions used by paste- and move/copy buffer
*/
-
#include "config.h"
#include "conf_core.h"
-#include <stdlib.h>
-#include <math.h>
-
#include "action_helper.h"
#include "buffer.h"
+#include "board.h"
#include "copy.h"
-#include "create.h"
-#include "crosshair.h"
#include "data.h"
-#include "error.h"
#include "plug_io.h"
-#include "mirror.h"
-#include "misc.h"
-#include "misc_util.h"
#include "polygon.h"
#include "rotate.h"
#include "remove.h"
-#include "rtree.h"
#include "select.h"
-#include "set.h"
+#include "draw.h"
+#include "undo.h"
#include "funchash_core.h"
#include "compat_misc.h"
-#include "layer.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *AddViaToBuffer(PinTypePtr);
-static void *AddLineToBuffer(LayerTypePtr, LineTypePtr);
-static void *AddArcToBuffer(LayerTypePtr, ArcTypePtr);
-static void *AddRatToBuffer(RatTypePtr);
-static void *AddTextToBuffer(LayerTypePtr, TextTypePtr);
-static void *AddPolygonToBuffer(LayerTypePtr, PolygonTypePtr);
-static void *AddElementToBuffer(ElementTypePtr);
-static void *MoveViaToBuffer(PinTypePtr);
-static void *MoveLineToBuffer(LayerTypePtr, LineTypePtr);
-static void *MoveArcToBuffer(LayerTypePtr, ArcTypePtr);
-static void *MoveRatToBuffer(RatTypePtr);
-static void *MoveTextToBuffer(LayerTypePtr, TextTypePtr);
-static void *MovePolygonToBuffer(LayerTypePtr, PolygonTypePtr);
-static void *MoveElementToBuffer(ElementTypePtr);
-static void SwapBuffer(BufferTypePtr);
+#include "compat_nls.h"
+#include "obj_all_op.h"
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static DataTypePtr Dest, Source;
-
-static ObjectFunctionType AddBufferFunctions = {
+static pcb_opfunc_t AddBufferFunctions = {
AddLineToBuffer,
AddTextToBuffer,
AddPolygonToBuffer,
@@ -90,309 +61,47 @@ static ObjectFunctionType AddBufferFunctions = {
NULL,
NULL,
AddArcToBuffer,
- AddRatToBuffer
-}, MoveBufferFunctions = {
-MoveLineToBuffer,
- MoveTextToBuffer,
- MovePolygonToBuffer, MoveViaToBuffer, MoveElementToBuffer, NULL, NULL, NULL, NULL, NULL, MoveArcToBuffer, MoveRatToBuffer};
-
-static int ExtraFlag = 0;
-
-/* ---------------------------------------------------------------------------
- * copies a via to paste buffer
- */
-static void *AddViaToBuffer(PinTypePtr Via)
-{
- return (CreateNewVia(Dest, Via->X, Via->Y, Via->Thickness, Via->Clearance,
- Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, PCB_FLAG_FOUND | ExtraFlag)));
-}
-
-/* ---------------------------------------------------------------------------
- * copies a rat-line to paste buffer
- */
-static void *AddRatToBuffer(RatTypePtr Rat)
-{
- return (CreateNewRat(Dest, Rat->Point1.X, Rat->Point1.Y,
- Rat->Point2.X, Rat->Point2.Y, Rat->group1,
- Rat->group2, Rat->Thickness, MaskFlags(Rat->Flags, PCB_FLAG_FOUND | ExtraFlag)));
-}
-
-/* ---------------------------------------------------------------------------
- * copies a line to buffer
- */
-static void *AddLineToBuffer(LayerTypePtr Layer, LineTypePtr Line)
-{
- LineTypePtr line;
- LayerTypePtr layer = &Dest->Layer[GetLayerNumber(Source, Layer)];
-
- line = CreateNewLineOnLayer(layer, Line->Point1.X, Line->Point1.Y,
- Line->Point2.X, Line->Point2.Y,
- Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, PCB_FLAG_FOUND | ExtraFlag));
- if (line && Line->Number)
- line->Number = pcb_strdup(Line->Number);
- return (line);
-}
-
-/* ---------------------------------------------------------------------------
- * copies an arc to buffer
- */
-static void *AddArcToBuffer(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- LayerTypePtr layer = &Dest->Layer[GetLayerNumber(Source, Layer)];
-
- return (CreateNewArcOnLayer(layer, Arc->X, Arc->Y,
- Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta,
- Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, PCB_FLAG_FOUND | ExtraFlag)));
-}
-
-/* ---------------------------------------------------------------------------
- * copies a text to buffer
- */
-static void *AddTextToBuffer(LayerTypePtr Layer, TextTypePtr Text)
-{
- LayerTypePtr layer = &Dest->Layer[GetLayerNumber(Source, Layer)];
-
- return (CreateNewText(layer, &PCB->Font, Text->X, Text->Y,
- Text->Direction, Text->Scale, Text->TextString, MaskFlags(Text->Flags, ExtraFlag)));
-}
-
-/* ---------------------------------------------------------------------------
- * copies a polygon to buffer
- */
-static void *AddPolygonToBuffer(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- LayerTypePtr layer = &Dest->Layer[GetLayerNumber(Source, Layer)];
- PolygonTypePtr polygon;
-
- polygon = CreateNewPolygon(layer, Polygon->Flags);
- CopyPolygonLowLevel(polygon, Polygon);
-
- /* Update the polygon r-tree. Unlike similarly named functions for
- * other objects, CreateNewPolygon does not do this as it creates a
- * skeleton polygon object, which won't have correct bounds.
- */
- if (!layer->polygon_tree)
- layer->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(layer->polygon_tree, (BoxType *) polygon, 0);
-
- CLEAR_FLAG(PCB_FLAG_FOUND | ExtraFlag, polygon);
- return (polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * copies a element to buffer
- */
-static void *AddElementToBuffer(ElementTypePtr Element)
-{
- ElementTypePtr element;
-
- element = GetElementMemory(Dest);
- CopyElementLowLevel(Dest, element, Element, pcb_false, 0, 0);
- CLEAR_FLAG(ExtraFlag, element);
- if (ExtraFlag) {
- ELEMENTTEXT_LOOP(element);
- {
- CLEAR_FLAG(ExtraFlag, text);
- }
- END_LOOP;
- PIN_LOOP(element);
- {
- CLEAR_FLAG(PCB_FLAG_FOUND | ExtraFlag, pin);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- CLEAR_FLAG(PCB_FLAG_FOUND | ExtraFlag, pad);
- }
- END_LOOP;
- }
- return (element);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a via to paste buffer without allocating memory for the name
- */
-static void *MoveViaToBuffer(PinType * via)
-{
- RestoreToPolygon(Source, PCB_TYPE_VIA, via, via);
-
- r_delete_entry(Source->via_tree, (BoxType *) via);
- pinlist_remove(via);
- pinlist_append(&Dest->Via, via);
-
- CLEAR_FLAG(PCB_FLAG_WARN | PCB_FLAG_FOUND, via);
-
- if (!Dest->via_tree)
- Dest->via_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Dest->via_tree, (BoxType *) via, 0);
- ClearFromPolygon(Dest, PCB_TYPE_VIA, via, via);
- return via;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a rat-line to paste buffer
- */
-static void *MoveRatToBuffer(RatType * rat)
-{
- r_delete_entry(Source->rat_tree, (BoxType *) rat);
-
- ratlist_remove(rat);
- ratlist_append(&Dest->Rat, rat);
-
- CLEAR_FLAG(PCB_FLAG_FOUND, rat);
-
- if (!Dest->rat_tree)
- Dest->rat_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Dest->rat_tree, (BoxType *) rat, 0);
- return rat;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line to buffer
- */
-static void *MoveLineToBuffer(LayerType * layer, LineType * line)
-{
- LayerTypePtr lay = &Dest->Layer[GetLayerNumber(Source, layer)];
-
- RestoreToPolygon(Source, PCB_TYPE_LINE, layer, line);
- r_delete_entry(layer->line_tree, (BoxType *) line);
-
- linelist_remove(line);
- linelist_append(&(lay->Line), line);
-
- CLEAR_FLAG(PCB_FLAG_FOUND, line);
-
- if (!lay->line_tree)
- lay->line_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(lay->line_tree, (BoxType *) line, 0);
- ClearFromPolygon(Dest, PCB_TYPE_LINE, lay, line);
- return (line);
-}
-
-/* ---------------------------------------------------------------------------
- * moves an arc to buffer
- */
-static void *MoveArcToBuffer(LayerType * layer, ArcType * arc)
-{
- LayerType *lay = &Dest->Layer[GetLayerNumber(Source, layer)];
-
- RestoreToPolygon(Source, PCB_TYPE_ARC, layer, arc);
- r_delete_entry(layer->arc_tree, (BoxType *) arc);
-
- arclist_remove(arc);
- arclist_append(&lay->Arc, arc);
-
- CLEAR_FLAG(PCB_FLAG_FOUND, arc);
-
- if (!lay->arc_tree)
- lay->arc_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(lay->arc_tree, (BoxType *) arc, 0);
- ClearFromPolygon(Dest, PCB_TYPE_ARC, lay, arc);
- return (arc);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text to buffer without allocating memory for the name
- */
-static void *MoveTextToBuffer(LayerType * layer, TextType * text)
-{
- LayerType *lay = &Dest->Layer[GetLayerNumber(Source, layer)];
-
- r_delete_entry(layer->text_tree, (BoxType *) text);
- RestoreToPolygon(Source, PCB_TYPE_TEXT, layer, text);
-
- textlist_remove(text);
- textlist_append(&lay->Text, text);
-
- if (!lay->text_tree)
- lay->text_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(lay->text_tree, (BoxType *) text, 0);
- ClearFromPolygon(Dest, PCB_TYPE_TEXT, lay, text);
- return (text);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon to buffer. Doesn't allocate memory for the points
- */
-static void *MovePolygonToBuffer(LayerType * layer, PolygonType * polygon)
-{
- LayerType *lay = &Dest->Layer[GetLayerNumber(Source, layer)];
-
- r_delete_entry(layer->polygon_tree, (BoxType *) polygon);
-
- polylist_remove(polygon);
- polylist_append(&lay->Polygon, polygon);
-
- CLEAR_FLAG(PCB_FLAG_FOUND, polygon);
-
- if (!lay->polygon_tree)
- lay->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(lay->polygon_tree, (BoxType *) polygon, 0);
- return (polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a element to buffer without allocating memory for pins/names
- */
-static void *MoveElementToBuffer(ElementType * element)
-{
- /*
- * Delete the element from the source (remove it from trees,
- * restore to polygons)
- */
- r_delete_element(Source, element);
-
- elementlist_remove(element);
- elementlist_append(&Dest->Element, element);
-
- PIN_LOOP(element);
- {
- RestoreToPolygon(Source, PCB_TYPE_PIN, element, pin);
- CLEAR_FLAG(PCB_FLAG_WARN | PCB_FLAG_FOUND, pin);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- RestoreToPolygon(Source, PCB_TYPE_PAD, element, pad);
- CLEAR_FLAG(PCB_FLAG_WARN | PCB_FLAG_FOUND, pad);
- }
- END_LOOP;
- SetElementBoundingBox(Dest, element, &PCB->Font);
- /*
- * Now clear the from the polygons in the destination
- */
- PIN_LOOP(element);
- {
- ClearFromPolygon(Dest, PCB_TYPE_PIN, element, pin);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- ClearFromPolygon(Dest, PCB_TYPE_PAD, element, pad);
- }
- END_LOOP;
+ AddRatToBuffer,
+ NULL
+};
- return element;
-}
+static pcb_opfunc_t MoveBufferFunctions = {
+ MoveLineToBuffer,
+ MoveTextToBuffer,
+ MovePolygonToBuffer,
+ MoveViaToBuffer,
+ MoveElementToBuffer,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ MoveArcToBuffer,
+ MoveRatToBuffer,
+ NULL
+};
/* ---------------------------------------------------------------------------
* calculates the bounding box of the buffer
*/
-void SetBufferBoundingBox(BufferTypePtr Buffer)
+int pcb_set_buffer_bbox(pcb_buffer_t *Buffer)
{
- BoxTypePtr box = GetDataBoundingBox(Buffer->Data);
+ pcb_box_t tmp, *box = pcb_data_bbox(&tmp, Buffer->Data);
- if (box)
+ if (box) {
Buffer->BoundingBox = *box;
+ return 0;
+ }
+ return -1;
}
/* ---------------------------------------------------------------------------
* clears the contents of the paste buffer
*/
-void ClearBuffer(BufferTypePtr Buffer)
+void pcb_buffer_clear(pcb_buffer_t *Buffer)
{
if (Buffer && Buffer->Data) {
- FreeDataMemory(Buffer->Data);
+ pcb_data_free(Buffer->Data);
Buffer->Data->pcb = PCB;
}
}
@@ -401,17 +110,24 @@ void ClearBuffer(BufferTypePtr Buffer)
* copies all selected and visible objects to the paste buffer
* returns true if any objects have been removed
*/
-void AddSelectedToBuffer(BufferTypePtr Buffer, Coord X, Coord Y, pcb_bool LeaveSelected)
+void pcb_buffer_add_selected(pcb_buffer_t *Buffer, pcb_coord_t X, pcb_coord_t Y, pcb_bool LeaveSelected)
{
+ pcb_opctx_t ctx;
+
+ ctx.buffer.pcb = PCB;
+
/* switch crosshair off because adding objects to the pastebuffer
* may change the 'valid' area for the cursor
*/
if (!LeaveSelected)
- ExtraFlag = PCB_FLAG_SELECTED;
- notify_crosshair_change(pcb_false);
- Source = PCB->Data;
- Dest = Buffer->Data;
- SelectedOperation(&AddBufferFunctions, pcb_false, PCB_TYPEMASK_ALL);
+ ctx.buffer.extraflg = PCB_FLAG_SELECTED;
+ else
+ ctx.buffer.extraflg = 0;
+
+ pcb_notify_crosshair_change(pcb_false);
+ ctx.buffer.src = PCB->Data;
+ ctx.buffer.dst = Buffer->Data;
+ pcb_selected_operation(&AddBufferFunctions, &ctx, pcb_false, PCB_TYPEMASK_ALL);
/* set origin to passed or current position */
if (X || Y) {
@@ -419,61 +135,17 @@ void AddSelectedToBuffer(BufferTypePtr Buffer, Coord X, Coord Y, pcb_bool LeaveS
Buffer->Y = Y;
}
else {
- Buffer->X = Crosshair.X;
- Buffer->Y = Crosshair.Y;
- }
- notify_crosshair_change(pcb_true);
- ExtraFlag = 0;
-}
-
-/* ---------------------------------------------------------------------------
- * loads element data from file/library into buffer
- * parse the file with disabled 'PCB mode' (see parser)
- * returns pcb_false on error
- * if successful, update some other stuff and reposition the pastebuffer
- */
-pcb_bool LoadElementToBuffer(BufferTypePtr Buffer, const char *Name)
-{
- ElementTypePtr element;
-
- ClearBuffer(Buffer);
- if (!ParseElement(Buffer->Data, Name)) {
- if (conf_core.editor.show_solder_side)
- SwapBuffer(Buffer);
- SetBufferBoundingBox(Buffer);
- if (elementlist_length(&Buffer->Data->Element)) {
- element = elementlist_first(&Buffer->Data->Element);
- Buffer->X = element->MarkX;
- Buffer->Y = element->MarkY;
- }
- else {
- Buffer->X = 0;
- Buffer->Y = 0;
- }
- return (pcb_true);
+ Buffer->X = pcb_crosshair.X;
+ Buffer->Y = pcb_crosshair.Y;
}
-
- /* release memory which might have been acquired */
- ClearBuffer(Buffer);
- return (pcb_false);
-}
-
-
-/*---------------------------------------------------------------------------
- * Searches for the given element by "footprint" name, and loads it
- * into the buffer.
- */
-
-/* Returns zero on success, non-zero on error. */
-int LoadFootprintByName(BufferTypePtr Buffer, const char *Footprint)
-{
- return !LoadElementToBuffer(Buffer, Footprint);
+ pcb_notify_crosshair_change(pcb_true);
}
+/*---------------------------------------------------------------------------*/
-static const char loadfootprint_syntax[] = "LoadFootprint(filename[,refdes,value])";
+static const char pcb_acts_LoadFootprint[] = "pcb_load_footprint(filename[,refdes,value])";
-static const char loadfootprint_help[] = "Loads a single footprint by name.";
+static const char pcb_acth_LoadFootprint[] = "Loads a single footprint by name.";
/* %start-doc actions LoadFootprint
@@ -483,29 +155,29 @@ into the footprint as well. The footprint remains in the paste buffer.
%end-doc */
-int LoadFootprint(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_LoadFootprint(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *name = ACTION_ARG(0);
- const char *refdes = ACTION_ARG(1);
- const char *value = ACTION_ARG(2);
- ElementTypePtr e;
+ const char *name = PCB_ACTION_ARG(0);
+ const char *refdes = PCB_ACTION_ARG(1);
+ const char *value = PCB_ACTION_ARG(2);
+ pcb_element_t *e;
if (!name)
- AFAIL(loadfootprint);
+ PCB_ACT_FAIL(LoadFootprint);
- if (LoadFootprintByName(PASTEBUFFER, name))
+ if (pcb_element_load_footprint_by_name(PCB_PASTEBUFFER, name))
return 1;
- if (elementlist_length(&PASTEBUFFER->Data->Element) == 0) {
- Message(PCB_MSG_DEFAULT, "Footprint %s contains no elements", name);
+ if (elementlist_length(&PCB_PASTEBUFFER->Data->Element) == 0) {
+ pcb_message(PCB_MSG_ERROR, "Footprint %s contains no elements", name);
return 1;
}
- if (elementlist_length(&PASTEBUFFER->Data->Element) > 1) {
- Message(PCB_MSG_DEFAULT, "Footprint %s contains multiple elements", name);
+ if (elementlist_length(&PCB_PASTEBUFFER->Data->Element) > 1) {
+ pcb_message(PCB_MSG_ERROR, "Footprint %s contains multiple elements", name);
return 1;
}
- e = elementlist_first(&PASTEBUFFER->Data->Element);
+ e = elementlist_first(&PCB_PASTEBUFFER->Data->Element);
if (e->Name[0].TextString)
free(e->Name[0].TextString);
@@ -522,275 +194,31 @@ int LoadFootprint(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-/*---------------------------------------------------------------------------
- *
- * break buffer element into pieces
- */
-pcb_bool SmashBufferElement(BufferTypePtr Buffer)
-{
- ElementTypePtr element;
- pcb_cardinal_t group;
- LayerTypePtr clayer, slayer;
-
- if (elementlist_length(&Buffer->Data->Element) != 1) {
- Message(PCB_MSG_DEFAULT, _("Error! Buffer doesn't contain a single element\n"));
- return (pcb_false);
- }
- /*
- * At this point the buffer should contain just a single element.
- * Now we detach the single element from the buffer and then clear the
- * buffer, ready to receive the smashed elements. As a result of detaching
- * it the single element is orphaned from the buffer and thus will not be
- * free()'d by FreeDataMemory (called via ClearBuffer). This leaves it
- * around for us to smash bits off it. It then becomes our responsibility,
- * however, to free the single element when we're finished with it.
- */
- element = elementlist_first(&Buffer->Data->Element);
- elementlist_remove(element);
- ClearBuffer(Buffer);
- ELEMENTLINE_LOOP(element);
- {
- CreateNewLineOnLayer(&Buffer->Data->SILKLAYER,
- line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y, line->Thickness, 0, NoFlags());
- if (line)
- line->Number = pcb_strdup_null(NAMEONPCB_NAME(element));
- }
- END_LOOP;
- ARC_LOOP(element);
- {
- CreateNewArcOnLayer(&Buffer->Data->SILKLAYER,
- arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness, 0, NoFlags());
- }
- END_LOOP;
- PIN_LOOP(element);
- {
- FlagType f = NoFlags();
- AddFlags(f, PCB_FLAG_VIA);
- if (TEST_FLAG(PCB_FLAG_HOLE, pin))
- AddFlags(f, PCB_FLAG_HOLE);
-
- CreateNewVia(Buffer->Data, pin->X, pin->Y, pin->Thickness, pin->Clearance, pin->Mask, pin->DrillingHole, pin->Number, f);
- }
- END_LOOP;
- group = GetLayerGroupNumberByNumber(SWAP_IDENT ? solder_silk_layer : component_silk_layer);
- clayer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
- group = GetLayerGroupNumberByNumber(SWAP_IDENT ? component_silk_layer : solder_silk_layer);
- slayer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
- PAD_LOOP(element);
- {
- LineTypePtr line;
- line = CreateNewLineOnLayer(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? slayer : clayer,
- pad->Point1.X, pad->Point1.Y,
- pad->Point2.X, pad->Point2.Y, pad->Thickness, pad->Clearance, NoFlags());
- if (line)
- line->Number = pcb_strdup_null(pad->Number);
- }
- END_LOOP;
- FreeElementMemory(element);
- RemoveFreeElement(element);
- return (pcb_true);
-}
-
-/*---------------------------------------------------------------------------
- *
- * see if a polygon is a rectangle. If so, canonicalize it.
- */
-
-static int polygon_is_rectangle(PolygonTypePtr poly)
-{
- int i, best;
- PointType temp[4];
- if (poly->PointN != 4 || poly->HoleIndexN != 0)
- return 0;
- best = 0;
- for (i = 1; i < 4; i++)
- if (poly->Points[i].X < poly->Points[best].X || poly->Points[i].Y < poly->Points[best].Y)
- best = i;
- for (i = 0; i < 4; i++)
- temp[i] = poly->Points[(i + best) % 4];
- if (temp[0].X == temp[1].X)
- memcpy(poly->Points, temp, sizeof(temp));
- else {
- /* reverse them */
- poly->Points[0] = temp[0];
- poly->Points[1] = temp[3];
- poly->Points[2] = temp[2];
- poly->Points[3] = temp[1];
- }
- if (poly->Points[0].X == poly->Points[1].X
- && poly->Points[1].Y == poly->Points[2].Y
- && poly->Points[2].X == poly->Points[3].X && poly->Points[3].Y == poly->Points[0].Y)
- return 1;
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- *
- * convert buffer contents into an element
- */
-pcb_bool ConvertBufferToElement(BufferTypePtr Buffer)
-{
- ElementTypePtr Element;
- pcb_cardinal_t group;
- pcb_cardinal_t pin_n = 1;
- pcb_bool hasParts = pcb_false, crooked = pcb_false;
- int onsolder;
- pcb_bool warned = pcb_false;
-
- if (Buffer->Data->pcb == 0)
- Buffer->Data->pcb = PCB;
-
- Element = CreateNewElement(PCB->Data, NULL, &PCB->Font, NoFlags(),
- NULL, NULL, NULL, PASTEBUFFER->X,
- PASTEBUFFER->Y, 0, 100, MakeFlags(SWAP_IDENT ? PCB_FLAG_ONSOLDER : PCB_FLAG_NO), pcb_false);
- if (!Element)
- return (pcb_false);
- VIA_LOOP(Buffer->Data);
- {
- char num[8];
- if (via->Mask < via->Thickness)
- via->Mask = via->Thickness + 2 * MASKFRAME;
- if (via->Name)
- CreateNewPin(Element, via->X, via->Y, via->Thickness,
- via->Clearance, via->Mask, via->DrillingHole,
- NULL, via->Name, MaskFlags(via->Flags, PCB_FLAG_VIA | PCB_FLAG_FOUND | PCB_FLAG_SELECTED | PCB_FLAG_WARN));
- else {
- sprintf(num, "%d", pin_n++);
- CreateNewPin(Element, via->X, via->Y, via->Thickness,
- via->Clearance, via->Mask, via->DrillingHole,
- NULL, num, MaskFlags(via->Flags, PCB_FLAG_VIA | PCB_FLAG_FOUND | PCB_FLAG_SELECTED | PCB_FLAG_WARN));
- }
- hasParts = pcb_true;
- }
- END_LOOP;
-
- for (onsolder = 0; onsolder < 2; onsolder++) {
- int silk_layer;
- int onsolderflag;
-
- if ((!onsolder) == (!SWAP_IDENT)) {
- silk_layer = component_silk_layer;
- onsolderflag = PCB_FLAG_NO;
- }
- else {
- silk_layer = solder_silk_layer;
- onsolderflag = PCB_FLAG_ONSOLDER;
- }
-
-#define MAYBE_WARN() \
- if (onsolder && !hasParts && !warned) \
- { \
- warned = pcb_true; \
- Message \
- (PCB_MSG_WARNING, _("Warning: All of the pads are on the opposite\n" \
- "side from the component - that's probably not what\n" \
- "you wanted\n")); \
- } \
-
- /* get the component-side SM pads */
- group = GetLayerGroupNumberByNumber(silk_layer);
- GROUP_LOOP(Buffer->Data, group);
- {
- char num[8];
- LINE_LOOP(layer);
- {
- sprintf(num, "%d", pin_n++);
- CreateNewPad(Element, line->Point1.X,
- line->Point1.Y, line->Point2.X,
- line->Point2.Y, line->Thickness,
- line->Clearance,
- line->Thickness + line->Clearance, NULL, line->Number ? line->Number : num, MakeFlags(onsolderflag));
- MAYBE_WARN();
- hasParts = pcb_true;
- }
- END_LOOP;
- POLYGON_LOOP(layer);
- {
- Coord x1, y1, x2, y2, w, h, t;
-
- if (!polygon_is_rectangle(polygon)) {
- crooked = pcb_true;
- continue;
- }
-
- w = polygon->Points[2].X - polygon->Points[0].X;
- h = polygon->Points[1].Y - polygon->Points[0].Y;
- t = (w < h) ? w : h;
- x1 = polygon->Points[0].X + t / 2;
- y1 = polygon->Points[0].Y + t / 2;
- x2 = x1 + (w - t);
- y2 = y1 + (h - t);
-
- sprintf(num, "%d", pin_n++);
- CreateNewPad(Element,
- x1, y1, x2, y2, t,
- 2 * conf_core.design.clearance, t + conf_core.design.clearance, NULL, num, MakeFlags(PCB_FLAG_SQUARE | onsolderflag));
- MAYBE_WARN();
- hasParts = pcb_true;
- }
- END_LOOP;
- }
- END_LOOP;
- }
-
- /* now add the silkscreen. NOTE: elements must have pads or pins too */
- LINE_LOOP(&Buffer->Data->SILKLAYER);
- {
- if (line->Number && !NAMEONPCB_NAME(Element))
- NAMEONPCB_NAME(Element) = pcb_strdup(line->Number);
- CreateNewLineInElement(Element, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y, line->Thickness);
- hasParts = pcb_true;
- }
- END_LOOP;
- ARC_LOOP(&Buffer->Data->SILKLAYER);
- {
- CreateNewArcInElement(Element, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness);
- hasParts = pcb_true;
- }
- END_LOOP;
- if (!hasParts) {
- DestroyObject(PCB->Data, PCB_TYPE_ELEMENT, Element, Element, Element);
- Message(PCB_MSG_DEFAULT, _("There was nothing to convert!\n" "Elements must have some silk, pads or pins.\n"));
- return (pcb_false);
- }
- if (crooked)
- Message(PCB_MSG_DEFAULT, _("There were polygons that can't be made into pins!\n" "So they were not included in the element\n"));
- Element->MarkX = Buffer->X;
- Element->MarkY = Buffer->Y;
- if (SWAP_IDENT)
- SET_FLAG(PCB_FLAG_ONSOLDER, Element);
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- ClearBuffer(Buffer);
- MoveObjectToBuffer(Buffer->Data, PCB->Data, PCB_TYPE_ELEMENT, Element, Element, Element);
- SetBufferBoundingBox(Buffer);
- return (pcb_true);
-}
-
/* ---------------------------------------------------------------------------
* load PCB into buffer
* parse the file with enabled 'PCB mode' (see parser)
* if successful, update some other stuff
*/
-pcb_bool LoadLayoutToBuffer(BufferTypePtr Buffer, const char *Filename, const char *fmt)
+pcb_bool pcb_buffer_load_layout(pcb_buffer_t *Buffer, const char *Filename, const char *fmt)
{
- PCBTypePtr newPCB = CreateNewPCB();
+ pcb_board_t *newPCB = pcb_board_new();
/* new data isn't added to the undo list */
- if (!ParsePCB(newPCB, Filename, fmt, CFR_invalid)) {
+ if (!pcb_parse_pcb(newPCB, Filename, fmt, CFR_invalid, 0)) {
/* clear data area and replace pointer */
- ClearBuffer(Buffer);
+ pcb_buffer_clear(Buffer);
free(Buffer->Data);
Buffer->Data = newPCB->Data;
newPCB->Data = NULL;
Buffer->X = newPCB->CursorX;
Buffer->Y = newPCB->CursorY;
- RemovePCB(newPCB);
+ pcb_board_remove(newPCB);
Buffer->Data->pcb = PCB;
return (pcb_true);
}
/* release unused memory */
- RemovePCB(newPCB);
+ pcb_board_remove(newPCB);
Buffer->Data->pcb = PCB;
return (pcb_false);
}
@@ -798,131 +226,61 @@ pcb_bool LoadLayoutToBuffer(BufferTypePtr Buffer, const char *Filename, const ch
/* ---------------------------------------------------------------------------
* rotates the contents of the pastebuffer
*/
-void RotateBuffer(BufferTypePtr Buffer, pcb_uint8_t Number)
+void pcb_buffer_rotate(pcb_buffer_t *Buffer, pcb_uint8_t Number)
{
/* rotate vias */
- VIA_LOOP(Buffer->Data);
+ PCB_VIA_LOOP(Buffer->Data);
{
- r_delete_entry(Buffer->Data->via_tree, (BoxType *) via);
- ROTATE_VIA_LOWLEVEL(via, Buffer->X, Buffer->Y, Number);
- SetPinBoundingBox(via);
- r_insert_entry(Buffer->Data->via_tree, (BoxType *) via, 0);
+ pcb_r_delete_entry(Buffer->Data->via_tree, (pcb_box_t *) via);
+ PCB_VIA_ROTATE90(via, Buffer->X, Buffer->Y, Number);
+ pcb_pin_bbox(via);
+ pcb_r_insert_entry(Buffer->Data->via_tree, (pcb_box_t *) via, 0);
}
- END_LOOP;
+ PCB_END_LOOP;
/* elements */
- ELEMENT_LOOP(Buffer->Data);
+ PCB_ELEMENT_LOOP(Buffer->Data);
{
- RotateElementLowLevel(Buffer->Data, element, Buffer->X, Buffer->Y, Number);
+ pcb_element_rotate90(Buffer->Data, element, Buffer->X, Buffer->Y, Number);
}
- END_LOOP;
+ PCB_END_LOOP;
/* all layer related objects */
- ALLLINE_LOOP(Buffer->Data);
+ PCB_LINE_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->line_tree, (BoxType *) line);
- RotateLineLowLevel(line, Buffer->X, Buffer->Y, Number);
- r_insert_entry(layer->line_tree, (BoxType *) line, 0);
+ pcb_r_delete_entry(layer->line_tree, (pcb_box_t *) line);
+ pcb_line_rotate90(line, Buffer->X, Buffer->Y, Number);
+ pcb_r_insert_entry(layer->line_tree, (pcb_box_t *) line, 0);
}
- ENDALL_LOOP;
- ALLARC_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->arc_tree, (BoxType *) arc);
- RotateArcLowLevel(arc, Buffer->X, Buffer->Y, Number);
- r_insert_entry(layer->arc_tree, (BoxType *) arc, 0);
+ pcb_r_delete_entry(layer->arc_tree, (pcb_box_t *) arc);
+ pcb_arc_rotate90(arc, Buffer->X, Buffer->Y, Number);
+ pcb_r_insert_entry(layer->arc_tree, (pcb_box_t *) arc, 0);
}
- ENDALL_LOOP;
- ALLTEXT_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_TEXT_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->text_tree, (BoxType *) text);
- RotateTextLowLevel(text, Buffer->X, Buffer->Y, Number);
- r_insert_entry(layer->text_tree, (BoxType *) text, 0);
+ pcb_r_delete_entry(layer->text_tree, (pcb_box_t *) text);
+ pcb_text_rotate90(text, Buffer->X, Buffer->Y, Number);
+ pcb_r_insert_entry(layer->text_tree, (pcb_box_t *) text, 0);
}
- ENDALL_LOOP;
- ALLPOLYGON_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->polygon_tree, (BoxType *) polygon);
- RotatePolygonLowLevel(polygon, Buffer->X, Buffer->Y, Number);
- r_insert_entry(layer->polygon_tree, (BoxType *) polygon, 0);
+ pcb_r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon);
+ pcb_poly_rotate90(polygon, Buffer->X, Buffer->Y, Number);
+ pcb_r_insert_entry(layer->polygon_tree, (pcb_box_t *) polygon, 0);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* finally the origin and the bounding box */
- ROTATE(Buffer->X, Buffer->Y, Buffer->X, Buffer->Y, Number);
- RotateBoxLowLevel(&Buffer->BoundingBox, Buffer->X, Buffer->Y, Number);
-}
-
-static void free_rotate(Coord * x, Coord * y, Coord cx, Coord cy, double cosa, double sina)
-{
- double nx, ny;
- Coord px = *x - cx;
- Coord py = *y - cy;
-
- nx = px * cosa + py * sina;
- ny = py * cosa - px * sina;
-
- *x = nx + cx;
- *y = ny + cy;
+ PCB_COORD_ROTATE90(Buffer->X, Buffer->Y, Buffer->X, Buffer->Y, Number);
+ pcb_box_rotate90(&Buffer->BoundingBox, Buffer->X, Buffer->Y, Number);
}
-void
-FreeRotateElementLowLevel(DataTypePtr Data, ElementTypePtr Element, Coord X, Coord Y, double cosa, double sina, Angle angle)
-{
- /* solder side objects need a different orientation */
-
- /* the text subroutine decides by itself if the direction
- * is to be corrected
- */
-#if 0
- ELEMENTTEXT_LOOP(Element);
- {
- if (Data && Data->name_tree[n])
- r_delete_entry(Data->name_tree[n], (BoxType *) text);
- RotateTextLowLevel(text, X, Y, Number);
- }
- END_LOOP;
-#endif
- ELEMENTLINE_LOOP(Element);
- {
- free_rotate(&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina);
- free_rotate(&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina);
- SetLineBoundingBox(line);
- }
- END_LOOP;
- PIN_LOOP(Element);
- {
- /* pre-delete the pins from the pin-tree before their coordinates change */
- if (Data)
- r_delete_entry(Data->pin_tree, (BoxType *) pin);
- RestoreToPolygon(Data, PCB_TYPE_PIN, Element, pin);
- free_rotate(&pin->X, &pin->Y, X, Y, cosa, sina);
- SetPinBoundingBox(pin);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- /* pre-delete the pads before their coordinates change */
- if (Data)
- r_delete_entry(Data->pad_tree, (BoxType *) pad);
- RestoreToPolygon(Data, PCB_TYPE_PAD, Element, pad);
- free_rotate(&pad->Point1.X, &pad->Point1.Y, X, Y, cosa, sina);
- free_rotate(&pad->Point2.X, &pad->Point2.Y, X, Y, cosa, sina);
- SetLineBoundingBox((LineType *) pad);
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- free_rotate(&arc->X, &arc->Y, X, Y, cosa, sina);
- arc->StartAngle = NormalizeAngle(arc->StartAngle + angle);
- }
- END_LOOP;
-
- free_rotate(&Element->MarkX, &Element->MarkY, X, Y, cosa, sina);
- SetElementBoundingBox(Data, Element, &PCB->Font);
- ClearFromPolygon(Data, PCB_TYPE_ELEMENT, Element, Element);
-}
-
-void FreeRotateBuffer(BufferTypePtr Buffer, Angle angle)
+void pcb_buffer_free_rotate(pcb_buffer_t *Buffer, pcb_angle_t angle)
{
double cosa, sina;
@@ -930,63 +288,57 @@ void FreeRotateBuffer(BufferTypePtr Buffer, Angle angle)
sina = sin(angle * M_PI / 180.0);
/* rotate vias */
- VIA_LOOP(Buffer->Data);
+ PCB_VIA_LOOP(Buffer->Data);
{
- r_delete_entry(Buffer->Data->via_tree, (BoxType *) via);
- free_rotate(&via->X, &via->Y, Buffer->X, Buffer->Y, cosa, sina);
- SetPinBoundingBox(via);
- r_insert_entry(Buffer->Data->via_tree, (BoxType *) via, 0);
+ pcb_via_rotate(Buffer->Data, via, Buffer->X, Buffer->Y, cosa, sina);
}
- END_LOOP;
+ PCB_END_LOOP;
/* elements */
- ELEMENT_LOOP(Buffer->Data);
+ PCB_ELEMENT_LOOP(Buffer->Data);
{
- FreeRotateElementLowLevel(Buffer->Data, element, Buffer->X, Buffer->Y, cosa, sina, angle);
+ pcb_element_rotate(Buffer->Data, element, Buffer->X, Buffer->Y, cosa, sina, angle);
}
- END_LOOP;
+ PCB_END_LOOP;
/* all layer related objects */
- ALLLINE_LOOP(Buffer->Data);
+ PCB_LINE_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->line_tree, (BoxType *) line);
- free_rotate(&line->Point1.X, &line->Point1.Y, Buffer->X, Buffer->Y, cosa, sina);
- free_rotate(&line->Point2.X, &line->Point2.Y, Buffer->X, Buffer->Y, cosa, sina);
- SetLineBoundingBox(line);
- r_insert_entry(layer->line_tree, (BoxType *) line, 0);
+ pcb_line_rotate(layer, line, Buffer->X, Buffer->Y, cosa, sina);
}
- ENDALL_LOOP;
- ALLARC_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->arc_tree, (BoxType *) arc);
- free_rotate(&arc->X, &arc->Y, Buffer->X, Buffer->Y, cosa, sina);
- arc->StartAngle = NormalizeAngle(arc->StartAngle + angle);
- r_insert_entry(layer->arc_tree, (BoxType *) arc, 0);
+ pcb_arc_rotate(layer, arc, Buffer->X, Buffer->Y, cosa, sina, angle);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* FIXME: rotate text */
- ALLPOLYGON_LOOP(Buffer->Data);
+ PCB_POLY_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->polygon_tree, (BoxType *) polygon);
- POLYGONPOINT_LOOP(polygon);
- {
- free_rotate(&point->X, &point->Y, Buffer->X, Buffer->Y, cosa, sina);
- }
- END_LOOP;
- SetPolygonBoundingBox(polygon);
- r_insert_entry(layer->polygon_tree, (BoxType *) polygon, 0);
+ pcb_poly_rotate(layer, polygon, Buffer->X, Buffer->Y, cosa, sina);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- SetBufferBoundingBox(Buffer);
+ pcb_set_buffer_bbox(Buffer);
+}
+
+/* ---------------------------------------------------------------------------
+ * creates a new paste buffer
+ */
+pcb_data_t *pcb_buffer_new(void)
+{
+ pcb_data_t *data;
+ data = (pcb_data_t *) calloc(1, sizeof(pcb_data_t));
+ data->pcb = (pcb_board_t *) PCB;
+ return data;
}
/* -------------------------------------------------------------------------- */
-static const char freerotatebuffer_syntax[] = "FreeRotateBuffer([Angle])";
+static const char pcb_acts_FreeRotateBuffer[] = "pcb_buffer_free_rotate([Angle])";
-static const char freerotatebuffer_help[] =
+static const char pcb_acth_FreeRotateBuffer[] =
"Rotates the current paste buffer contents by the specified angle. The\n"
"angle is given in degrees. If no angle is given, the user is prompted\n" "for one.\n";
@@ -997,199 +349,147 @@ angle is given, the user is prompted for one.
%end-doc */
-int ActionFreeRotateBuffer(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_FreeRotateBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *angle_s;
if (argc < 1)
- angle_s = gui->prompt_for("Enter Rotation (degrees, CCW):", "0");
+ angle_s = pcb_gui->prompt_for("Enter Rotation (degrees, CCW):", "0");
else
angle_s = argv[0];
- notify_crosshair_change(pcb_false);
- FreeRotateBuffer(PASTEBUFFER, strtod(angle_s, 0));
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_buffer_free_rotate(PCB_PASTEBUFFER, strtod(angle_s, 0));
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
/* ---------------------------------------------------------------------------
* initializes the buffers by allocating memory
*/
-void InitBuffers(void)
+void pcb_init_buffers(void)
{
int i;
- for (i = 0; i < MAX_BUFFER; i++)
- Buffers[i].Data = CreateNewBuffer();
+ for (i = 0; i < PCB_MAX_BUFFER; i++)
+ pcb_buffers[i].Data = pcb_buffer_new();
}
-void UninitBuffers(void)
+void pcb_uninit_buffers(void)
{
int i;
- for (i = 0; i < MAX_BUFFER; i++) {
- ClearBuffer(Buffers+i);
- free(Buffers[i].Data);
+ for (i = 0; i < PCB_MAX_BUFFER; i++) {
+ pcb_buffer_clear(pcb_buffers+i);
+ free(pcb_buffers[i].Data);
}
}
-void pcb_swap_buffers(void)
-{
- int i;
-
- for (i = 0; i < MAX_BUFFER; i++)
- SwapBuffer(&Buffers[i]);
- SetCrosshairRangeToBuffer();
-}
-void MirrorBuffer(BufferTypePtr Buffer)
+void pcb_buffer_mirror(pcb_buffer_t *Buffer)
{
int i;
if (elementlist_length(&Buffer->Data->Element)) {
- Message(PCB_MSG_DEFAULT, _("You can't mirror a buffer that has elements!\n"));
+ pcb_message(PCB_MSG_ERROR, _("You can't mirror a buffer that has elements!\n"));
return;
}
- for (i = 0; i < max_copper_layer + 2; i++) {
- LayerTypePtr layer = Buffer->Data->Layer + i;
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
+ pcb_layer_t *layer = Buffer->Data->Layer + i;
if (textlist_length(&layer->Text)) {
- Message(PCB_MSG_DEFAULT, _("You can't mirror a buffer that has text!\n"));
+ pcb_message(PCB_MSG_ERROR, _("You can't mirror a buffer that has text!\n"));
return;
}
}
/* set buffer offset to 'mark' position */
- Buffer->X = SWAP_X(Buffer->X);
- Buffer->Y = SWAP_Y(Buffer->Y);
- VIA_LOOP(Buffer->Data);
+ Buffer->X = PCB_SWAP_X(Buffer->X);
+ Buffer->Y = PCB_SWAP_Y(Buffer->Y);
+ PCB_VIA_LOOP(Buffer->Data);
{
- via->X = SWAP_X(via->X);
- via->Y = SWAP_Y(via->Y);
+ pcb_via_mirror(Buffer->Data, via);
}
- END_LOOP;
- ALLLINE_LOOP(Buffer->Data);
+ PCB_END_LOOP;
+ PCB_LINE_ALL_LOOP(Buffer->Data);
{
- line->Point1.X = SWAP_X(line->Point1.X);
- line->Point1.Y = SWAP_Y(line->Point1.Y);
- line->Point2.X = SWAP_X(line->Point2.X);
- line->Point2.Y = SWAP_Y(line->Point2.Y);
+ pcb_line_mirror(layer, line);
}
- ENDALL_LOOP;
- ALLARC_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(Buffer->Data);
{
- arc->X = SWAP_X(arc->X);
- arc->Y = SWAP_Y(arc->Y);
- arc->StartAngle = SWAP_ANGLE(arc->StartAngle);
- arc->Delta = SWAP_DELTA(arc->Delta);
- SetArcBoundingBox(arc);
+ pcb_arc_mirror(layer, arc);
}
- ENDALL_LOOP;
- ALLPOLYGON_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_ALL_LOOP(Buffer->Data);
{
- POLYGONPOINT_LOOP(polygon);
- {
- point->X = SWAP_X(point->X);
- point->Y = SWAP_Y(point->Y);
- }
- END_LOOP;
- SetPolygonBoundingBox(polygon);
+ pcb_poly_mirror(layer, polygon);
}
- ENDALL_LOOP;
- SetBufferBoundingBox(Buffer);
+ PCB_ENDALL_LOOP;
+ pcb_set_buffer_bbox(Buffer);
}
/* ---------------------------------------------------------------------------
* flip components/tracks from one side to the other
*/
-static void SwapBuffer(BufferTypePtr Buffer)
+void pcb_buffer_flip_side(pcb_buffer_t *Buffer)
{
int j, k;
- pcb_cardinal_t sgroup, cgroup;
- LayerType swap;
+ pcb_layergrp_id_t sgroup, cgroup;
+ pcb_layer_t swap;
- ELEMENT_LOOP(Buffer->Data);
+ PCB_ELEMENT_LOOP(Buffer->Data);
{
r_delete_element(Buffer->Data, element);
- MirrorElementCoordinates(Buffer->Data, element, 0);
+ pcb_element_mirror(Buffer->Data, element, 0);
}
- END_LOOP;
+ PCB_END_LOOP;
/* set buffer offset to 'mark' position */
- Buffer->X = SWAP_X(Buffer->X);
- Buffer->Y = SWAP_Y(Buffer->Y);
- VIA_LOOP(Buffer->Data);
+ Buffer->X = PCB_SWAP_X(Buffer->X);
+ Buffer->Y = PCB_SWAP_Y(Buffer->Y);
+ PCB_VIA_LOOP(Buffer->Data);
{
- r_delete_entry(Buffer->Data->via_tree, (BoxType *) via);
- via->X = SWAP_X(via->X);
- via->Y = SWAP_Y(via->Y);
- SetPinBoundingBox(via);
- r_insert_entry(Buffer->Data->via_tree, (BoxType *) via, 0);
+ pcb_via_flip_side(Buffer->Data, via);
}
- END_LOOP;
- ALLLINE_LOOP(Buffer->Data);
+ PCB_END_LOOP;
+ PCB_LINE_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->line_tree, (BoxType *) line);
- line->Point1.X = SWAP_X(line->Point1.X);
- line->Point1.Y = SWAP_Y(line->Point1.Y);
- line->Point2.X = SWAP_X(line->Point2.X);
- line->Point2.Y = SWAP_Y(line->Point2.Y);
- SetLineBoundingBox(line);
- r_insert_entry(layer->line_tree, (BoxType *) line, 0);
+ pcb_line_flip_side(layer, line);
}
- ENDALL_LOOP;
- ALLARC_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->arc_tree, (BoxType *) arc);
- arc->X = SWAP_X(arc->X);
- arc->Y = SWAP_Y(arc->Y);
- arc->StartAngle = SWAP_ANGLE(arc->StartAngle);
- arc->Delta = SWAP_DELTA(arc->Delta);
- SetArcBoundingBox(arc);
- r_insert_entry(layer->arc_tree, (BoxType *) arc, 0);
+ pcb_arc_flip_side(layer, arc);
}
- ENDALL_LOOP;
- ALLPOLYGON_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->polygon_tree, (BoxType *) polygon);
- POLYGONPOINT_LOOP(polygon);
- {
- point->X = SWAP_X(point->X);
- point->Y = SWAP_Y(point->Y);
- }
- END_LOOP;
- SetPolygonBoundingBox(polygon);
- r_insert_entry(layer->polygon_tree, (BoxType *) polygon, 0);
- /* hmmm, how to handle clip */
+ pcb_poly_flip_side(layer, polygon);
}
- ENDALL_LOOP;
- ALLTEXT_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_TEXT_ALL_LOOP(Buffer->Data);
{
- r_delete_entry(layer->text_tree, (BoxType *) text);
- text->X = SWAP_X(text->X);
- text->Y = SWAP_Y(text->Y);
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, text);
- SetTextBoundingBox(&PCB->Font, text);
- r_insert_entry(layer->text_tree, (BoxType *) text, 0);
+ pcb_text_flip_side(layer, text);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* swap silkscreen layers */
- swap = Buffer->Data->Layer[solder_silk_layer];
- Buffer->Data->Layer[solder_silk_layer] = Buffer->Data->Layer[component_silk_layer];
- Buffer->Data->Layer[component_silk_layer] = swap;
+ swap = Buffer->Data->Layer[pcb_solder_silk_layer];
+ Buffer->Data->Layer[pcb_solder_silk_layer] = Buffer->Data->Layer[pcb_component_silk_layer];
+ Buffer->Data->Layer[pcb_component_silk_layer] = swap;
/* swap layer groups when balanced */
- sgroup = GetLayerGroupNumberByNumber(solder_silk_layer);
- cgroup = GetLayerGroupNumberByNumber(component_silk_layer);
+ sgroup = pcb_layer_get_group(pcb_solder_silk_layer);
+ cgroup = pcb_layer_get_group(pcb_component_silk_layer);
if (PCB->LayerGroups.Number[cgroup] == PCB->LayerGroups.Number[sgroup]) {
for (j = k = 0; j < PCB->LayerGroups.Number[sgroup]; j++) {
int t1, t2;
pcb_cardinal_t cnumber = PCB->LayerGroups.Entries[cgroup][k];
pcb_cardinal_t snumber = PCB->LayerGroups.Entries[sgroup][j];
- if (snumber >= max_copper_layer)
+ if (snumber >= pcb_max_copper_layer)
continue;
swap = Buffer->Data->Layer[snumber];
- while (cnumber >= max_copper_layer) {
+ while (cnumber >= pcb_max_copper_layer) {
k++;
cnumber = PCB->LayerGroups.Entries[cgroup][k];
}
@@ -1197,62 +497,172 @@ static void SwapBuffer(BufferTypePtr Buffer)
Buffer->Data->Layer[cnumber] = swap;
k++;
/* move the thermal flags with the layers */
- ALLPIN_LOOP(Buffer->Data);
+ PCB_PIN_ALL_LOOP(Buffer->Data);
{
- t1 = TEST_THERM(snumber, pin);
- t2 = TEST_THERM(cnumber, pin);
- ASSIGN_THERM(snumber, t2, pin);
- ASSIGN_THERM(cnumber, t1, pin);
+ t1 = PCB_FLAG_THERM_TEST(snumber, pin);
+ t2 = PCB_FLAG_THERM_TEST(cnumber, pin);
+ PCB_FLAG_THERM_ASSIGN(snumber, t2, pin);
+ PCB_FLAG_THERM_ASSIGN(cnumber, t1, pin);
}
- ENDALL_LOOP;
- VIA_LOOP(Buffer->Data);
+ PCB_ENDALL_LOOP;
+ PCB_VIA_LOOP(Buffer->Data);
{
- t1 = TEST_THERM(snumber, via);
- t2 = TEST_THERM(cnumber, via);
- ASSIGN_THERM(snumber, t2, via);
- ASSIGN_THERM(cnumber, t1, via);
+ t1 = PCB_FLAG_THERM_TEST(snumber, via);
+ t2 = PCB_FLAG_THERM_TEST(cnumber, via);
+ PCB_FLAG_THERM_ASSIGN(snumber, t2, via);
+ PCB_FLAG_THERM_ASSIGN(cnumber, t1, via);
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- SetBufferBoundingBox(Buffer);
+ pcb_set_buffer_bbox(Buffer);
+}
+
+void pcb_buffers_flip_side(void)
+{
+ int i;
+
+ for (i = 0; i < PCB_MAX_BUFFER; i++)
+ pcb_buffer_flip_side(&pcb_buffers[i]);
+ pcb_crosshair_range_to_buffer();
}
/* ----------------------------------------------------------------------
* moves the passed object to the passed buffer and removes it
* from its original place
*/
-void *MoveObjectToBuffer(DataTypePtr Destination, DataTypePtr Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void *pcb_move_obj_to_buffer(pcb_data_t *Destination, pcb_data_t *Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
+ pcb_opctx_t ctx;
+
/* setup local identifiers used by move operations */
- Dest = Destination;
- Source = Src;
- return (ObjectOperation(&MoveBufferFunctions, Type, Ptr1, Ptr2, Ptr3));
+ ctx.buffer.pcb = PCB;
+ ctx.buffer.dst = Destination;
+ ctx.buffer.src = Src;
+ return (pcb_object_operation(&MoveBufferFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3));
}
/* ----------------------------------------------------------------------
* Adds the passed object to the passed buffer
*/
-void *CopyObjectToBuffer(DataTypePtr Destination, DataTypePtr Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void *pcb_copy_obj_to_buffer(pcb_data_t *Destination, pcb_data_t *Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+{
+ pcb_opctx_t ctx;
+
+ ctx.buffer.pcb = PCB;
+ ctx.buffer.dst = Destination;
+ ctx.buffer.src = Src;
+ return (pcb_object_operation(&AddBufferFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3));
+}
+
+/* ---------------------------------------------------------------------------
+ * pastes the contents of the buffer to the layout. Only visible objects
+ * are handled by the routine.
+ */
+pcb_bool pcb_buffer_copy_to_layout(pcb_coord_t X, pcb_coord_t Y)
{
- /* setup local identifiers used by Add operations */
- Dest = Destination;
- Source = Src;
- return (ObjectOperation(&AddBufferFunctions, Type, Ptr1, Ptr2, Ptr3));
+ pcb_cardinal_t i;
+ pcb_bool changed = pcb_false;
+ pcb_opctx_t ctx;
+
+#ifdef DEBUG
+ printf("Entering CopyPastebufferToLayout.....\n");
+#endif
+
+ /* set movement vector */
+ ctx.copy.pcb = PCB;
+ ctx.copy.DeltaX = X - PCB_PASTEBUFFER->X;
+ ctx.copy.DeltaY = Y - PCB_PASTEBUFFER->Y;
+
+ /* paste all layers */
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
+ pcb_layer_t *sourcelayer = &PCB_PASTEBUFFER->Data->Layer[i], *destlayer = LAYER_PTR(i);
+
+ if (destlayer->On) {
+ changed = changed || (!PCB_LAYER_IS_EMPTY(sourcelayer));
+ PCB_LINE_LOOP(sourcelayer);
+ {
+ CopyLine(&ctx, destlayer, line);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(sourcelayer);
+ {
+ CopyArc(&ctx, destlayer, arc);
+ }
+ PCB_END_LOOP;
+ PCB_TEXT_LOOP(sourcelayer);
+ {
+ CopyText(&ctx, destlayer, text);
+ }
+ PCB_END_LOOP;
+ PCB_POLY_LOOP(sourcelayer);
+ {
+ CopyPolygon(&ctx, destlayer, polygon);
+ }
+ PCB_END_LOOP;
+ }
+ }
+
+ /* paste elements */
+ if (PCB->PinOn && PCB->ElementOn) {
+ PCB_ELEMENT_LOOP(PCB_PASTEBUFFER->Data);
+ {
+#ifdef DEBUG
+ printf("In CopyPastebufferToLayout, pasting element %s\n", element->Name[1].TextString);
+#endif
+ if (PCB_FRONT(element) || PCB->InvisibleObjectsOn) {
+ CopyElement(&ctx, element);
+ changed = pcb_true;
+ }
+ }
+ PCB_END_LOOP;
+ }
+
+ /* finally the vias */
+ if (PCB->ViaOn) {
+ changed |= (pinlist_length(&(PCB_PASTEBUFFER->Data->Via)) != 0);
+ PCB_VIA_LOOP(PCB_PASTEBUFFER->Data);
+ {
+ CopyVia(&ctx, via);
+ }
+ PCB_END_LOOP;
+ }
+
+ if (changed) {
+ pcb_draw();
+ pcb_undo_inc_serial();
+ }
+
+#ifdef DEBUG
+ printf(" .... Leaving CopyPastebufferToLayout.\n");
+#endif
+
+ return (changed);
}
+void pcb_buffer_set_number(int Number)
+{
+ if (Number >= 0 && Number < PCB_MAX_BUFFER) {
+ conf_set_design("editor/buffer_number", "%d", Number);
+
+ /* do an update on the crosshair range */
+ pcb_crosshair_range_to_buffer();
+ }
+}
+
+
/* ---------------------------------------------------------------------- */
-static const char pastebuffer_syntax[] =
- "PasteBuffer(AddSelected|Clear|1..MAX_BUFFER)\n"
+static const char pcb_acts_PasteBuffer[] =
+ "PasteBuffer(AddSelected|Clear|1..PCB_MAX_BUFFER)\n"
"PasteBuffer(Rotate, 1..3)\n" "PasteBuffer(Convert|Restore|Mirror)\n" "PasteBuffer(ToLayout, X, Y, units)\n" "PasteBuffer(Save, Filename, [format], [force])";
-static const char pastebuffer_help[] = "Various operations on the paste buffer.";
+static const char pcb_acth_PasteBuffer[] = "Various operations on the paste buffer.";
/* %start-doc actions PasteBuffer
There are a number of paste buffers; the actual limit is a
-compile-time constant @code{MAX_BUFFER} in @file{globalconst.h}. It
+compile-time constant @code{PCB_MAX_BUFFER} in @file{globalconst.h}. It
is currently @code{5}. One of these is the ``current'' paste buffer,
often referred to as ``the'' paste buffer.
@@ -1295,14 +705,14 @@ location. Otherwise, it's absolute. Units can be
units, currently 1/100 mil.
- at item 1..MAX_BUFFER
+ at item 1..PCB_MAX_BUFFER
Selects the given buffer to be the current paste buffer.
@end table
%end-doc */
-static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_PasteBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function = argc ? argv[0] : "";
const char *sbufnum = argc > 1 ? argv[1] : "";
@@ -1313,49 +723,49 @@ static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y)
pcb_bool free_name = pcb_false;
int force = (forces != NULL) && ((*forces == '1') || (*forces == 'y') || (*forces == 'Y'));
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
/* clear contents of paste buffer */
case F_Clear:
- ClearBuffer(PASTEBUFFER);
+ pcb_buffer_clear(PCB_PASTEBUFFER);
break;
/* copies objects to paste buffer */
case F_AddSelected:
- AddSelectedToBuffer(PASTEBUFFER, 0, 0, pcb_false);
+ pcb_buffer_add_selected(PCB_PASTEBUFFER, 0, 0, pcb_false);
break;
/* converts buffer contents into an element */
case F_Convert:
- ConvertBufferToElement(PASTEBUFFER);
+ pcb_element_convert_from_buffer(PCB_PASTEBUFFER);
break;
/* break up element for editing */
case F_Restore:
- SmashBufferElement(PASTEBUFFER);
+ pcb_element_smash_buffer(PCB_PASTEBUFFER);
break;
/* Mirror buffer */
case F_Mirror:
- MirrorBuffer(PASTEBUFFER);
+ pcb_buffer_mirror(PCB_PASTEBUFFER);
break;
case F_Rotate:
if (sbufnum) {
- RotateBuffer(PASTEBUFFER, (pcb_uint8_t) atoi(sbufnum));
- SetCrosshairRangeToBuffer();
+ pcb_buffer_rotate(PCB_PASTEBUFFER, (pcb_uint8_t) atoi(sbufnum));
+ pcb_crosshair_range_to_buffer();
}
break;
case F_Save:
- if (elementlist_length(&PASTEBUFFER->Data->Element) == 0) {
- Message(PCB_MSG_DEFAULT, _("Buffer has no elements!\n"));
+ if (elementlist_length(&PCB_PASTEBUFFER->Data->Element) == 0) {
+ pcb_message(PCB_MSG_ERROR, _("Buffer has no elements!\n"));
break;
}
free_name = pcb_false;
if (argc <= 1) {
- name = gui->fileselect(_("Save Paste Buffer As ..."),
+ name = pcb_gui->fileselect(_("Save Paste Buffer As ..."),
_("Choose a file to save the contents of the\n"
"paste buffer to.\n"), default_file, ".fp", "footprint", 0);
@@ -1377,11 +787,11 @@ static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y)
if ((!force) && ((exist = fopen(name, "r")))) {
fclose(exist);
- if (gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0))
- SaveBufferElements(name, fmt);
+ if (pcb_gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0))
+ pcb_save_buffer_elements(name, fmt);
}
else
- SaveBufferElements(name, fmt);
+ pcb_save_buffer_elements(name, fmt);
if (free_name && name)
free((char*)name);
@@ -1390,30 +800,30 @@ static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y)
case F_ToLayout:
{
- static Coord oldx = 0, oldy = 0;
- Coord x, y;
+ static pcb_coord_t oldx = 0, oldy = 0;
+ pcb_coord_t x, y;
pcb_bool absolute;
if (argc == 1) {
x = y = 0;
}
else if (argc == 3 || argc == 4) {
- x = GetValue(ACTION_ARG(1), ACTION_ARG(3), &absolute, NULL);
+ x = pcb_get_value(PCB_ACTION_ARG(1), PCB_ACTION_ARG(3), &absolute, NULL);
if (!absolute)
x += oldx;
- y = GetValue(ACTION_ARG(2), ACTION_ARG(3), &absolute, NULL);
+ y = pcb_get_value(PCB_ACTION_ARG(2), PCB_ACTION_ARG(3), &absolute, NULL);
if (!absolute)
y += oldy;
}
else {
- notify_crosshair_change(pcb_true);
- AFAIL(pastebuffer);
+ pcb_notify_crosshair_change(pcb_true);
+ PCB_ACT_FAIL(PasteBuffer);
}
oldx = x;
oldy = y;
- if (CopyPastebufferToLayout(x, y))
- SetChangedFlag(pcb_true);
+ if (pcb_buffer_copy_to_layout(x, y))
+ pcb_board_set_changed_flag(pcb_true);
}
break;
@@ -1424,26 +834,26 @@ static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y)
/* correct number */
if (number)
- SetBufferNumber(number - 1);
+ pcb_buffer_set_number(number - 1);
}
}
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
/* --------------------------------------------------------------------------- */
-HID_Action buffer_action_list[] = {
- {"FreeRotateBuffer", 0, ActionFreeRotateBuffer,
- freerotatebuffer_help, freerotatebuffer_syntax}
+pcb_hid_action_t buffer_action_list[] = {
+ {"FreeRotateBuffer", 0, pcb_act_FreeRotateBuffer,
+ pcb_acth_FreeRotateBuffer, pcb_acts_FreeRotateBuffer}
,
- {"LoadFootprint", 0, LoadFootprint,
- loadfootprint_help, loadfootprint_syntax}
+ {"LoadFootprint", 0, pcb_act_LoadFootprint,
+ pcb_acth_LoadFootprint, pcb_acts_LoadFootprint}
,
- {"PasteBuffer", 0, ActionPasteBuffer,
- pastebuffer_help, pastebuffer_syntax}
+ {"PasteBuffer", 0, pcb_act_PasteBuffer,
+ pcb_acth_PasteBuffer, pcb_acts_PasteBuffer}
};
-REGISTER_ACTIONS(buffer_action_list, NULL)
+PCB_REGISTER_ACTIONS(buffer_action_list, NULL)
diff --git a/src/buffer.h b/src/buffer.h
index 1a0d422..db42a83 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -26,31 +26,55 @@
/* prototypes for buffer handling routines */
-#ifndef PCB_BUFFER_H
-#define PCB_BUFFER_H
+#ifndef PCB_BUFFER_H
+#define PCB_BUFFER_H
-#include "global.h"
+#include "obj_common.h"
+
+struct pcb_buffer_s { /* information about the paste buffer */
+ pcb_coord_t X, Y; /* offset */
+ pcb_box_t BoundingBox;
+ pcb_data_t *Data; /* data; not all members of pcb_board_t */
+ /* are used */
+};
/* ---------------------------------------------------------------------------
* prototypes
*/
-void SetBufferBoundingBox(BufferTypePtr);
-void ClearBuffer(BufferTypePtr);
-void AddSelectedToBuffer(BufferTypePtr, Coord, Coord, pcb_bool);
-pcb_bool LoadElementToBuffer(BufferTypePtr, const char *);
-pcb_bool ConvertBufferToElement(BufferTypePtr);
-pcb_bool SmashBufferElement(BufferTypePtr);
-pcb_bool LoadLayoutToBuffer(BufferTypePtr Buffer, const char *Filename, const char *fmt);
-void RotateBuffer(BufferTypePtr, pcb_uint8_t);
-void SelectPasteBuffer(int);
-void pcb_swap_buffers(void);
-void MirrorBuffer(BufferTypePtr);
-void InitBuffers(void);
-void UninitBuffers(void);
-void *MoveObjectToBuffer(DataTypePtr, DataTypePtr, int, void *, void *, void *);
-void *CopyObjectToBuffer(DataTypePtr, DataTypePtr, int, void *, void *, void *);
+void pcb_buffer_flip_side(pcb_buffer_t *Buffer);
+
+/* returns 0 on success */
+int pcb_set_buffer_bbox(pcb_buffer_t *);
+
+void pcb_buffer_clear(pcb_buffer_t *);
+void pcb_buffer_add_selected(pcb_buffer_t *, pcb_coord_t, pcb_coord_t, pcb_bool);
+pcb_bool pcb_buffer_load_layout(pcb_buffer_t *Buffer, const char *Filename, const char *fmt);
+void pcb_buffer_rotate(pcb_buffer_t *, pcb_uint8_t);
+void pcb_buffer_select_paste(int);
+void pcb_buffers_flip_side(void);
+void pcb_buffer_mirror(pcb_buffer_t *);
+void pcb_init_buffers(void);
+void pcb_uninit_buffers(void);
+void *pcb_move_obj_to_buffer(pcb_data_t *, pcb_data_t *, int, void *, void *, void *);
+void *pcb_copy_obj_to_buffer(pcb_data_t *, pcb_data_t *, int, void *, void *, void *);
/* This action is called from ActionElementAddIf() */
-int LoadFootprint(int argc, const char **argv, Coord x, Coord y);
+int pcb_act_LoadFootprint(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
+
+/* pastes the contents of the buffer to the layout. Only visible objects
+ are handled by the routine. */
+pcb_bool pcb_buffer_copy_to_layout(pcb_coord_t X, pcb_coord_t Y);
+
+
+pcb_data_t *pcb_buffer_new(void);
+
+/* sets currently active buffer */
+void pcb_buffer_set_number(int Number);
+
+
+/* ---------------------------------------------------------------------------
+ * access macro for current buffer
+ */
+#define PCB_PASTEBUFFER (&pcb_buffers[conf_core.editor.buffer_number])
#endif
diff --git a/src/build_run.c b/src/build_run.c
new file mode 100644
index 0000000..fa9fda2
--- /dev/null
+++ b/src/build_run.c
@@ -0,0 +1,180 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+#include "config.h"
+#include <signal.h>
+#include <genvector/gds_char.h>
+#include "conf_core.h"
+#include "board.h"
+#include "build_run.h"
+#include "hid_init.h"
+#include "plug_io.h"
+#include "compat_misc.h"
+
+/* ---------------------------------------------------------------------------
+ * quits application
+ */
+extern void pcb_main_uninit(void);
+void pcb_quit_app(void)
+{
+ /*
+ * save data if necessary. It not needed, then don't trigger EmergencySave
+ * via our atexit() registering of pcb_emergency_save(). We presumably wanted to
+ * exit here and thus it is not an emergency.
+ */
+ if (PCB->Changed && conf_core.editor.save_in_tmp)
+ pcb_emergency_save();
+ else
+ pcb_disable_emergency_save();
+
+ if (pcb_gui->do_exit == NULL) {
+ pcb_main_uninit();
+ exit(0);
+ }
+ else
+ pcb_gui->do_exit(pcb_gui);
+}
+
+/* ---------------------------------------------------------------------------
+ * Returns a string that has a bunch of information about the program.
+ * Can be used for things like "about" dialog boxes.
+ */
+
+char *pcb_get_infostr(void)
+{
+ pcb_hid_t **hids;
+ int i;
+ static gds_t info;
+ static int first_time = 1;
+
+#define TAB " "
+
+ if (first_time) {
+ first_time = 0;
+ gds_init(&info);
+ gds_append_str(&info, "This is PCB-rnd " VERSION " (" REVISION ")" "\n an interactive\n");
+ gds_append_str(&info, "printed circuit board editor\n");
+ gds_append_str(&info, "PCB-rnd forked from gEDA/PCB.");
+ gds_append_str(&info, "\n\n" "PCB is by harry eaton and others\n\n");
+ gds_append_str(&info, "\nPCB-rnd adds a collection of\n");
+ gds_append_str(&info, "useful-looking random patches.\n");
+ gds_append_str(&info, "\n");
+ gds_append_str(&info, "Copyright (C) Thomas Nau 1994, 1995, 1996, 1997\n");
+ gds_append_str(&info, "Copyright (C) harry eaton 1998-2007\n");
+ gds_append_str(&info, "Copyright (C) C. Scott Ananian 2001\n");
+ gds_append_str(&info, "Copyright (C) DJ Delorie 2003, 2004, 2005, 2006, 2007, 2008\n");
+ gds_append_str(&info, "Copyright (C) Dan McMahill 2003, 2004, 2005, 2006, 2007, 2008\n\n");
+ gds_append_str(&info, "Copyright (C) Tibor Palinkas 2013-2016 (pcb-rnd patches)\n\n");
+ gds_append_str(&info, "It is licensed under the terms of the GNU\n");
+ gds_append_str(&info, "General Public License version 2\n");
+ gds_append_str(&info, "See the LICENSE file for more information\n\n");
+ gds_append_str(&info, "For more information see:\n\n");
+ gds_append_str(&info, "PCB-rnd homepage: http://repo.hu/projects/pcb-rnd\n");
+ gds_append_str(&info, "PCB homepage: http://pcb.geda-project.org\n");
+ gds_append_str(&info, "gEDA homepage: http://www.geda-project.org\n");
+ gds_append_str(&info, "gEDA Wiki: http://wiki.geda-project.org\n\n");
+
+ gds_append_str(&info, "----- Compile Time Options -----\n");
+ hids = pcb_hid_enumerate();
+ gds_append_str(&info, "GUI:\n");
+ for (i = 0; hids[i]; i++) {
+ if (hids[i]->gui) {
+ gds_append_str(&info, TAB);
+ gds_append_str(&info, hids[i]->name);
+ gds_append_str(&info, " : ");
+ gds_append_str(&info, hids[i]->description);
+ gds_append_str(&info, "\n");
+ }
+ }
+
+ gds_append_str(&info, "Exporters:\n");
+ for (i = 0; hids[i]; i++) {
+ if (hids[i]->exporter) {
+ gds_append_str(&info, TAB);
+ gds_append_str(&info, hids[i]->name);
+ gds_append_str(&info, " : ");
+ gds_append_str(&info, hids[i]->description);
+ gds_append_str(&info, "\n");
+ }
+ }
+
+ gds_append_str(&info, "Printers:\n");
+ for (i = 0; hids[i]; i++) {
+ if (hids[i]->printer) {
+ gds_append_str(&info, TAB);
+ gds_append_str(&info, hids[i]->name);
+ gds_append_str(&info, " : ");
+ gds_append_str(&info, hids[i]->description);
+ gds_append_str(&info, "\n");
+ }
+ }
+ }
+#undef TAB
+ return info.array;
+}
+
+const char *pcb_author(void)
+{
+ if (conf_core.design.fab_author && conf_core.design.fab_author[0])
+ return conf_core.design.fab_author;
+ else
+ return pcb_get_user_name();
+}
+
+void pcb_catch_signal(int Signal)
+{
+ const char *s;
+
+ switch (Signal) {
+#ifdef SIGHUP
+ case SIGHUP:
+ s = "SIGHUP";
+ break;
+#endif
+ case SIGINT:
+ s = "SIGINT";
+ break;
+#ifdef SIGQUIT
+ case SIGQUIT:
+ s = "SIGQUIT";
+ break;
+#endif
+ case SIGABRT:
+ s = "SIGABRT";
+ break;
+ case SIGTERM:
+ s = "SIGTERM";
+ break;
+ case SIGSEGV:
+ s = "SIGSEGV";
+ break;
+ default:
+ s = "unknown";
+ break;
+ }
+ pcb_message(PCB_MSG_ERROR, "aborted by %s signal\n", s);
+ exit(1);
+}
diff --git a/src/build_run.h b/src/build_run.h
new file mode 100644
index 0000000..6c8b8e0
--- /dev/null
+++ b/src/build_run.h
@@ -0,0 +1,37 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+/* build info and run control */
+
+void pcb_quit_app(void);
+
+/* Returns a string with info about this copy of pcb. */
+char *pcb_get_infostr(void);
+
+const char *pcb_author(void);
+
+/* catches signals which abort the program */
+void pcb_catch_signal(int Signal);
diff --git a/src/buildin.c.in b/src/buildin.c.in
index 37ebbcf..ba218a1 100644
--- a/src/buildin.c.in
+++ b/src/buildin.c.in
@@ -6,7 +6,7 @@ print [@
@?/local/pcb/buildin_init_extern@
-void buildin_init(void)
+void pcb_buildin_init(void)
{
pcb_uninit_t uninit_func;
@?/local/pcb/buildin_init_code@
diff --git a/src/buildin.h b/src/buildin.h
index 16315c4..f524e6a 100644
--- a/src/buildin.h
+++ b/src/buildin.h
@@ -1,2 +1,2 @@
/* Run the init code of all buildins. */
-void buildin_init(void);
+void pcb_buildin_init(void);
diff --git a/src/change.c b/src/change.c
index 654e5c8..4af1a3e 100644
--- a/src/change.c
+++ b/src/change.c
@@ -30,104 +30,21 @@
#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <setjmp.h>
-
#include "conf_core.h"
-#include "crosshair.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
-#include "error.h"
-#include "misc.h"
-#include "mirror.h"
-#include "polygon.h"
-#include "rtree.h"
#include "select.h"
#include "undo.h"
#include "hid_actions.h"
-#include "layer.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *ChangePinSize(ElementTypePtr, PinTypePtr);
-static void *ChangePinClearSize(ElementTypePtr, PinTypePtr);
-static void *ChangePinMaskSize(ElementTypePtr, PinTypePtr);
-static void *ChangePadSize(ElementTypePtr, PadTypePtr);
-static void *ChangePadClearSize(ElementTypePtr, PadTypePtr);
-static void *ChangePadMaskSize(ElementTypePtr, PadTypePtr);
-static void *ChangePin2ndSize(ElementTypePtr, PinTypePtr);
-static void *ChangeElement1stSize(ElementTypePtr);
-static void *ChangeElement2ndSize(ElementTypePtr);
-static void *ChangeViaSize(PinTypePtr);
-static void *ChangeVia2ndSize(PinTypePtr);
-static void *ChangeViaClearSize(PinTypePtr);
-static void *ChangeViaMaskSize(PinTypePtr);
-static void *ChangeLineSize(LayerTypePtr, LineTypePtr);
-static void *ChangeLineClearSize(LayerTypePtr, LineTypePtr);
-static void *ChangePolygonClearSize(LayerTypePtr, PolygonTypePtr);
-static void *ChangeArcSize(LayerTypePtr, ArcTypePtr);
-static void *ChangeArcClearSize(LayerTypePtr, ArcTypePtr);
-static void *ChangeTextSize(LayerTypePtr, TextTypePtr);
-static void *ChangeElementSize(ElementTypePtr);
-static void *ChangeElementNameSize(ElementTypePtr);
-static void *ChangeElementClearSize(ElementTypePtr);
-static void *ChangePinName(ElementTypePtr, PinTypePtr);
-static void *ChangePadName(ElementTypePtr, PadTypePtr);
-static void *ChangePinNum(ElementTypePtr, PinTypePtr);
-static void *ChangePadNum(ElementTypePtr, PadTypePtr);
-static void *ChangeViaName(PinTypePtr);
-static void *ChangeLineName(LayerTypePtr, LineTypePtr);
-static void *ChangeElementName(ElementTypePtr);
-static void *ChangeElementNonetlist(ElementTypePtr);
-static void *ChangeTextName(LayerTypePtr, TextTypePtr);
-static void *ChangeElementSquare(ElementTypePtr);
-static void *SetElementSquare(ElementTypePtr);
-static void *ClrElementSquare(ElementTypePtr);
-static void *ChangeElementOctagon(ElementTypePtr);
-static void *SetElementOctagon(ElementTypePtr);
-static void *ClrElementOctagon(ElementTypePtr);
-static void *ChangeViaSquare(PinTypePtr);
-static void *ChangePinSquare(ElementTypePtr, PinTypePtr);
-static void *SetPinSquare(ElementTypePtr, PinTypePtr);
-static void *ClrPinSquare(ElementTypePtr, PinTypePtr);
-static void *ChangePinOctagon(ElementTypePtr, PinTypePtr);
-static void *SetPinOctagon(ElementTypePtr, PinTypePtr);
-static void *ClrPinOctagon(ElementTypePtr, PinTypePtr);
-static void *ChangeViaOctagon(PinTypePtr);
-static void *SetViaOctagon(PinTypePtr);
-static void *ClrViaOctagon(PinTypePtr);
-static void *ChangePadSquare(ElementTypePtr, PadTypePtr);
-static void *SetPadSquare(ElementTypePtr, PadTypePtr);
-static void *ClrPadSquare(ElementTypePtr, PadTypePtr);
-static void *ChangeViaThermal(PinTypePtr);
-static void *ChangePinThermal(ElementTypePtr, PinTypePtr);
-static void *ChangeLineJoin(LayerTypePtr, LineTypePtr);
-static void *SetLineJoin(LayerTypePtr, LineTypePtr);
-static void *ClrLineJoin(LayerTypePtr, LineTypePtr);
-static void *ChangeArcJoin(LayerTypePtr, ArcTypePtr);
-static void *SetArcJoin(LayerTypePtr, ArcTypePtr);
-static void *ClrArcJoin(LayerTypePtr, ArcTypePtr);
-static void *ChangeTextJoin(LayerTypePtr, TextTypePtr);
-static void *SetTextJoin(LayerTypePtr, TextTypePtr);
-static void *ClrTextJoin(LayerTypePtr, TextTypePtr);
-static void *ChangePolyClear(LayerTypePtr, PolygonTypePtr);
-static void *ChangeArcRadius(LayerTypePtr, ArcTypePtr);
-static void *ChangeArcAngle(LayerTypePtr, ArcTypePtr);
+#include "compat_nls.h"
+#include "obj_all_op.h"
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord Delta; /* change of size */
-static Coord Absolute; /* Absolute size */
-static int is_primary; /* whether the primary parameter should be changed */
-static char *NewName; /* new name */
-
-static Angle ADelta, AAbsolute; /* same as above, but for angles */
-
-static ObjectFunctionType ChangeSizeFunctions = {
+static pcb_opfunc_t ChangeSizeFunctions = {
ChangeLineSize,
ChangeTextSize,
ChangePolyClear,
@@ -139,10 +56,11 @@ static ObjectFunctionType ChangeSizeFunctions = {
NULL,
NULL,
ChangeArcSize,
+ NULL,
NULL
};
-static ObjectFunctionType Change1stSizeFunctions = {
+static pcb_opfunc_t Change1stSizeFunctions = {
ChangeLineSize,
ChangeTextSize,
ChangePolyClear,
@@ -154,10 +72,11 @@ static ObjectFunctionType Change1stSizeFunctions = {
NULL,
NULL,
ChangeArcSize,
+ NULL,
NULL
};
-static ObjectFunctionType Change2ndSizeFunctions = {
+static pcb_opfunc_t Change2ndSizeFunctions = {
NULL,
NULL,
NULL,
@@ -169,10 +88,11 @@ static ObjectFunctionType Change2ndSizeFunctions = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
-static ObjectFunctionType ChangeThermalFunctions = {
+static pcb_opfunc_t ChangeThermalFunctions = {
NULL,
NULL,
NULL,
@@ -184,10 +104,11 @@ static ObjectFunctionType ChangeThermalFunctions = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
-static ObjectFunctionType ChangeClearSizeFunctions = {
+static pcb_opfunc_t ChangeClearSizeFunctions = {
ChangeLineClearSize,
NULL,
ChangePolygonClearSize, /* just to tell the user not to :-) */
@@ -199,10 +120,11 @@ static ObjectFunctionType ChangeClearSizeFunctions = {
NULL,
NULL,
ChangeArcClearSize,
+ NULL,
NULL
};
-static ObjectFunctionType ChangeNameFunctions = {
+static pcb_opfunc_t ChangeNameFunctions = {
ChangeLineName,
ChangeTextName,
NULL,
@@ -214,10 +136,11 @@ static ObjectFunctionType ChangeNameFunctions = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
-static ObjectFunctionType ChangePinnumFunctions = {
+static pcb_opfunc_t ChangePinnumFunctions = {
NULL,
NULL,
NULL,
@@ -229,10 +152,11 @@ static ObjectFunctionType ChangePinnumFunctions = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
-static ObjectFunctionType ChangeSquareFunctions = {
+static pcb_opfunc_t ChangeSquareFunctions = {
NULL,
NULL,
NULL,
@@ -244,10 +168,11 @@ static ObjectFunctionType ChangeSquareFunctions = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
-static ObjectFunctionType ChangeNonetlistFunctions = {
+static pcb_opfunc_t ChangeNonetlistFunctions = {
NULL,
NULL,
NULL,
@@ -259,10 +184,11 @@ static ObjectFunctionType ChangeNonetlistFunctions = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
-static ObjectFunctionType ChangeJoinFunctions = {
+static pcb_opfunc_t ChangeJoinFunctions = {
ChangeLineJoin,
ChangeTextJoin,
NULL,
@@ -274,1631 +200,190 @@ static ObjectFunctionType ChangeJoinFunctions = {
NULL,
NULL,
ChangeArcJoin,
- NULL
-};
-
-static ObjectFunctionType ChangeOctagonFunctions = {
- NULL,
- NULL,
- NULL,
- ChangeViaOctagon,
- ChangeElementOctagon,
- NULL,
- ChangePinOctagon,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static ObjectFunctionType ChangeMaskSizeFunctions = {
- NULL,
- NULL,
- NULL,
- ChangeViaMaskSize,
-#if 0
- ChangeElementMaskSize,
-#else
- NULL,
-#endif
- NULL,
- ChangePinMaskSize,
- ChangePadMaskSize,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static ObjectFunctionType SetSquareFunctions = {
- NULL,
- NULL,
- NULL,
- NULL,
- SetElementSquare,
- NULL,
- SetPinSquare,
- SetPadSquare,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static ObjectFunctionType SetJoinFunctions = {
- SetLineJoin,
- SetTextJoin,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- SetArcJoin,
- NULL
-};
-
-static ObjectFunctionType SetOctagonFunctions = {
- NULL,
- NULL,
- NULL,
- SetViaOctagon,
- SetElementOctagon,
- NULL,
- SetPinOctagon,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static ObjectFunctionType ClrSquareFunctions = {
- NULL,
- NULL,
- NULL,
- NULL,
- ClrElementSquare,
- NULL,
- ClrPinSquare,
- ClrPadSquare,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static ObjectFunctionType ClrJoinFunctions = {
- ClrLineJoin,
- ClrTextJoin,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ClrArcJoin,
- NULL
-};
-
-static ObjectFunctionType ClrOctagonFunctions = {
- NULL,
- NULL,
- NULL,
- ClrViaOctagon,
- ClrElementOctagon,
- NULL,
- ClrPinOctagon,
- NULL,
NULL,
- NULL,
- NULL,
- NULL
-};
-
-static ObjectFunctionType ChangeRadiusFunctions = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ChangeArcRadius,
NULL
-};
-
-static ObjectFunctionType ChangeAngleFunctions = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ChangeArcAngle,
- NULL
-};
-
-
-/* ---------------------------------------------------------------------------
- * changes the thermal on a via
- * returns TRUE if changed
- */
-static void *ChangeViaThermal(PinTypePtr Via)
-{
- AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Via);
- AddObjectToFlagUndoList(PCB_TYPE_VIA, Via, Via, Via);
- if (!Delta) /* remove the thermals */
- CLEAR_THERM(INDEXOFCURRENT, Via);
- else
- ASSIGN_THERM(INDEXOFCURRENT, Delta, Via);
- AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Via);
- DrawVia(Via);
- return Via;
-}
-
-/* ---------------------------------------------------------------------------
- * changes the thermal on a pin
- * returns TRUE if changed
- */
-static void *ChangePinThermal(ElementTypePtr element, PinTypePtr Pin)
-{
- AddObjectToClearPolyUndoList(PCB_TYPE_PIN, element, Pin, Pin, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin);
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, Pin, Pin);
- if (!Delta) /* remove the thermals */
- CLEAR_THERM(INDEXOFCURRENT, Pin);
- else
- ASSIGN_THERM(INDEXOFCURRENT, Delta, Pin);
- AddObjectToClearPolyUndoList(PCB_TYPE_PIN, element, Pin, Pin, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin);
- DrawPin(Pin);
- return Pin;
-}
-
-/* ---------------------------------------------------------------------------
- * changes the size of a via
- * returns TRUE if changed
- */
-static void *ChangeViaSize(PinTypePtr Via)
-{
- Coord value = Absolute ? Absolute : Via->Thickness + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Via))
- return (NULL);
- if (!TEST_FLAG(PCB_FLAG_HOLE, Via) && value <= MAX_PINORVIASIZE &&
- value >= MIN_PINORVIASIZE && value >= Via->DrillingHole + MIN_PINORVIACOPPER && value != Via->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- EraseVia(Via);
- r_delete_entry(PCB->Data->via_tree, (BoxType *) Via);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Via, Via);
- if (Via->Mask) {
- AddObjectToMaskSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- Via->Mask += value - Via->Thickness;
- }
- Via->Thickness = value;
- SetPinBoundingBox(Via);
- r_insert_entry(PCB->Data->via_tree, (BoxType *) Via, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- DrawVia(Via);
- return (Via);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the drilling hole of a via
- * returns TRUE if changed
- */
-static void *ChangeVia2ndSize(PinTypePtr Via)
-{
- Coord value = (Absolute) ? Absolute : Via->DrillingHole + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Via))
- return (NULL);
- if (value <= MAX_PINORVIASIZE &&
- value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, Via) || value <= Via->Thickness - MIN_PINORVIACOPPER)
- && value != Via->DrillingHole) {
- AddObjectTo2ndSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- EraseVia(Via);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- Via->DrillingHole = value;
- if (TEST_FLAG(PCB_FLAG_HOLE, Via)) {
- AddObjectToSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- Via->Thickness = value;
- }
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- DrawVia(Via);
- return (Via);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance size of a via
- * returns TRUE if changed
- */
-static void *ChangeViaClearSize(PinTypePtr Via)
-{
- Coord value = (Absolute) ? Absolute : Via->Clearance + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Via))
- return (NULL);
- value = MIN(MAX_LINESIZE, value);
- if (value < 0)
- value = 0;
- if (Delta < 0 && value < PCB->Bloat * 2)
- value = 0;
- if ((Delta > 0 || Absolute) && value < PCB->Bloat * 2)
- value = PCB->Bloat * 2 + 2;
- if (Via->Clearance == value)
- return NULL;
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- AddObjectToClearSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- EraseVia(Via);
- r_delete_entry(PCB->Data->via_tree, (BoxType *) Via);
- Via->Clearance = value;
- SetPinBoundingBox(Via);
- r_insert_entry(PCB->Data->via_tree, (BoxType *) Via, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- DrawVia(Via);
- Via->Element = NULL;
- return (Via);
-}
-
-
-/* ---------------------------------------------------------------------------
- * changes the size of a pin
- * returns TRUE if changed
- */
-static void *ChangePinSize(ElementTypePtr Element, PinTypePtr Pin)
-{
- Coord value = (Absolute) ? Absolute : Pin->Thickness + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin))
- return (NULL);
- if (!TEST_FLAG(PCB_FLAG_HOLE, Pin) && value <= MAX_PINORVIASIZE &&
- value >= MIN_PINORVIASIZE && value >= Pin->DrillingHole + MIN_PINORVIACOPPER && value != Pin->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- AddObjectToMaskSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- ErasePin(Pin);
- r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- Pin->Mask += value - Pin->Thickness;
- Pin->Thickness = value;
- /* SetElementBB updates all associated rtrees */
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- DrawPin(Pin);
- return (Pin);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance size of a pin
- * returns TRUE if changed
- */
-static void *ChangePinClearSize(ElementTypePtr Element, PinTypePtr Pin)
-{
- Coord value = (Absolute) ? Absolute : Pin->Clearance + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin))
- return (NULL);
- value = MIN(MAX_LINESIZE, value);
- if (value < 0)
- value = 0;
- if (Delta < 0 && value < PCB->Bloat * 2)
- value = 0;
- if ((Delta > 0 || Absolute) && value < PCB->Bloat * 2)
- value = PCB->Bloat * 2 + 2;
- if (Pin->Clearance == value)
- return NULL;
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- AddObjectToClearSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- ErasePin(Pin);
- r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox);
- Pin->Clearance = value;
- /* SetElementBB updates all associated rtrees */
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- DrawPin(Pin);
- return (Pin);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the size of a pad
- * returns TRUE if changed
- */
-static void *ChangePadSize(ElementTypePtr Element, PadTypePtr Pad)
-{
- Coord value = (Absolute) ? Absolute : Pad->Thickness + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pad))
- return (NULL);
- if (value <= MAX_PADSIZE && value >= MIN_PADSIZE && value != Pad->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_PAD, Element, Pad, Pad);
- AddObjectToMaskSizeUndoList(PCB_TYPE_PAD, Element, Pad, Pad);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad);
- ErasePad(Pad);
- r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox);
- Pad->Mask += value - Pad->Thickness;
- Pad->Thickness = value;
- /* SetElementBB updates all associated rtrees */
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad);
- DrawPad(Pad);
- return (Pad);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance size of a pad
- * returns TRUE if changed
- */
-static void *ChangePadClearSize(ElementTypePtr Element, PadTypePtr Pad)
-{
- Coord value = (Absolute) ? Absolute : Pad->Clearance + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pad))
- return (NULL);
- value = MIN(MAX_LINESIZE, value);
- if (value < 0)
- value = 0;
- if (Delta < 0 && value < PCB->Bloat * 2)
- value = 0;
- if ((Delta > 0 || Absolute) && value < PCB->Bloat * 2)
- value = PCB->Bloat * 2 + 2;
- if (value == Pad->Clearance)
- return NULL;
- AddObjectToClearSizeUndoList(PCB_TYPE_PAD, Element, Pad, Pad);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad);
- ErasePad(Pad);
- r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox);
- Pad->Clearance = value;
- /* SetElementBB updates all associated rtrees */
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad);
- DrawPad(Pad);
- return Pad;
-}
-
-/* ---------------------------------------------------------------------------
- * changes the drilling hole of all pins of an element
- * returns TRUE if changed
- */
-static void *ChangeElement2ndSize(ElementTypePtr Element)
-{
- pcb_bool changed = pcb_false;
- Coord value;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- value = (Absolute) ? Absolute : pin->DrillingHole + Delta;
- if (value <= MAX_PINORVIASIZE &&
- value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, pin) || value <= pin->Thickness - MIN_PINORVIACOPPER)
- && value != pin->DrillingHole) {
- changed = pcb_true;
- AddObjectTo2ndSizeUndoList(PCB_TYPE_PIN, Element, pin, pin);
- ErasePin(pin);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin);
- pin->DrillingHole = value;
- if (TEST_FLAG(PCB_FLAG_HOLE, pin)) {
- AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin);
- pin->Thickness = value;
- }
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin);
- DrawPin(pin);
- }
- }
- END_LOOP;
- if (changed)
- return (Element);
- else
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes ring dia of all pins of an element
- * returns TRUE if changed
- */
-static void *ChangeElement1stSize(ElementTypePtr Element)
-{
- pcb_bool changed = pcb_false;
- Coord value;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- value = (Absolute) ? Absolute : pin->DrillingHole + Delta;
- if (value <= MAX_PINORVIASIZE && value >= pin->DrillingHole + MIN_PINORVIACOPPER && value != pin->Thickness) {
- changed = pcb_true;
- AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin);
- ErasePin(pin);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin);
- pin->Thickness = value;
- if (TEST_FLAG(PCB_FLAG_HOLE, pin)) {
- AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin);
- pin->Thickness = value;
- }
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin);
- DrawPin(pin);
- }
- }
- END_LOOP;
- if (changed)
- return (Element);
- else
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance of all pins of an element
- * returns TRUE if changed
- */
-static void *ChangeElementClearSize(ElementTypePtr Element)
-{
- pcb_bool changed = pcb_false;
- Coord value;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- value = (Absolute) ? Absolute : pin->Clearance + Delta;
- if (value <= MAX_PINORVIASIZE &&
- value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, pin) || value <= pin->Thickness - MIN_PINORVIACOPPER)
- && value != pin->Clearance) {
- changed = pcb_true;
- AddObjectToClearSizeUndoList(PCB_TYPE_PIN, Element, pin, pin);
- ErasePin(pin);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin);
- pin->Clearance = value;
- if (TEST_FLAG(PCB_FLAG_HOLE, pin)) {
- AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin);
- pin->Thickness = value;
- }
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin);
- DrawPin(pin);
- }
- }
- END_LOOP;
-
- PAD_LOOP(Element);
- {
- value = (Absolute) ? Absolute : pad->Clearance + Delta;
- if (value <= MAX_PINORVIASIZE && value >= MIN_PINORVIAHOLE && value != pad->Clearance) {
- changed = pcb_true;
- AddObjectToClearSizeUndoList(PCB_TYPE_PAD, Element, pad, pad);
- ErasePad(pad);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PAD, Element, pad);
- r_delete_entry(PCB->Data->pad_tree, &pad->BoundingBox);
- pad->Clearance = value;
- if (TEST_FLAG(PCB_FLAG_HOLE, pad)) {
- AddObjectToSizeUndoList(PCB_TYPE_PAD, Element, pad, pad);
- pad->Thickness = value;
- }
- /* SetElementBB updates all associated rtrees */
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
-
- ClearFromPolygon(PCB->Data, PCB_TYPE_PAD, Element, pad);
- DrawPad(pad);
- }
- }
- END_LOOP;
-
- if (changed)
- return (Element);
- else
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the drilling hole of a pin
- * returns TRUE if changed
- */
-static void *ChangePin2ndSize(ElementTypePtr Element, PinTypePtr Pin)
-{
- Coord value = (Absolute) ? Absolute : Pin->DrillingHole + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin))
- return (NULL);
- if (value <= MAX_PINORVIASIZE &&
- value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, Pin) || value <= Pin->Thickness - MIN_PINORVIACOPPER)
- && value != Pin->DrillingHole) {
- AddObjectTo2ndSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- ErasePin(Pin);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- Pin->DrillingHole = value;
- if (TEST_FLAG(PCB_FLAG_HOLE, Pin)) {
- AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- Pin->Thickness = value;
- }
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- DrawPin(Pin);
- return (Pin);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the size of a line
- * returns TRUE if changed
- */
-static void *ChangeLineSize(LayerTypePtr Layer, LineTypePtr Line)
-{
- Coord value = (Absolute) ? Absolute : Line->Thickness + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Line))
- return (NULL);
- if (value <= MAX_LINESIZE && value >= MIN_LINESIZE && value != Line->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_LINE, Layer, Line, Line);
- EraseLine(Line);
- r_delete_entry(Layer->line_tree, (BoxTypePtr) Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- Line->Thickness = value;
- SetLineBoundingBox(Line);
- r_insert_entry(Layer->line_tree, (BoxTypePtr) Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- DrawLine(Layer, Line);
- return (Line);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance size of a line
- * returns TRUE if changed
- */
-static void *ChangeLineClearSize(LayerTypePtr Layer, LineTypePtr Line)
-{
- Coord value = (Absolute) ? Absolute : Line->Clearance + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Line) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Line))
- return (NULL);
- value = MIN(MAX_LINESIZE, MAX(value, PCB->Bloat * 2 + 2));
- if (value != Line->Clearance) {
- AddObjectToClearSizeUndoList(PCB_TYPE_LINE, Layer, Line, Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- EraseLine(Line);
- r_delete_entry(Layer->line_tree, (BoxTypePtr) Line);
- Line->Clearance = value;
- if (Line->Clearance == 0) {
- CLEAR_FLAG(PCB_FLAG_CLEARLINE, Line);
- Line->Clearance = PCB_MIL_TO_COORD(10);
- }
- SetLineBoundingBox(Line);
- r_insert_entry(Layer->line_tree, (BoxTypePtr) Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- DrawLine(Layer, Line);
- return (Line);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * Handle attempts to change the clearance of a polygon.
- */
-static void *ChangePolygonClearSize(LayerTypePtr Layer, PolygonTypePtr poly)
-{
- static int shown_this_message = 0;
- if (!shown_this_message) {
- gui->confirm_dialog(_("To change the clearance of objects in a polygon, "
- "change the objects, not the polygon.\n"
- "Hint: To set a minimum clearance for a group of objects, "
- "select them all then :MinClearGap(Selected,=10,mil)"), "Ok", NULL);
- shown_this_message = 1;
- }
-
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the size of an arc
- * returns TRUE if changed
- */
-static void *ChangeArcSize(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- Coord value = (Absolute) ? Absolute : Arc->Thickness + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc))
- return (NULL);
- if (value <= MAX_LINESIZE && value >= MIN_LINESIZE && value != Arc->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- EraseArc(Arc);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) Arc);
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- Arc->Thickness = value;
- SetArcBoundingBox(Arc);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) Arc, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- DrawArc(Layer, Arc);
- return (Arc);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance size of an arc
- * returns TRUE if changed
- */
-static void *ChangeArcClearSize(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- Coord value = (Absolute) ? Absolute : Arc->Clearance + Delta;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Arc))
- return (NULL);
- value = MIN(MAX_LINESIZE, MAX(value, PCB->Bloat * 2 + 2));
- if (value != Arc->Clearance) {
- AddObjectToClearSizeUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- EraseArc(Arc);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) Arc);
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- Arc->Clearance = value;
- if (Arc->Clearance == 0) {
- CLEAR_FLAG(PCB_FLAG_CLEARLINE, Arc);
- Arc->Clearance = PCB_MIL_TO_COORD(10);
- }
- SetArcBoundingBox(Arc);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) Arc, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- DrawArc(Layer, Arc);
- return (Arc);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the radius of an arc (is_primary 0=width or 1=height or 2=both)
- * returns TRUE if changed
- */
-static void *ChangeArcRadius(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- Coord value, *dst;
- void *a0, *a1;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc))
- return (NULL);
-
- switch(is_primary) {
- case 0: dst = &Arc->Width; break;
- case 1: dst = &Arc->Height; break;
- case 2:
- is_primary = 0; a0 = ChangeArcRadius(Layer, Arc);
- is_primary = 1; a1 = ChangeArcRadius(Layer, Arc);
- if ((a0 != NULL) || (a1 != NULL))
- return Arc;
- return NULL;
- }
-
- value = (Absolute) ? Absolute : (*dst) + Delta;
- value = MIN(MAX_ARCSIZE, MAX(value, MIN_ARCSIZE));
- if (value != *dst) {
- AddObjectToChangeRadiiUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- EraseArc(Arc);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) Arc);
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- *dst = value;
- SetArcBoundingBox(Arc);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) Arc, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- DrawArc(Layer, Arc);
- return (Arc);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the angle of an arc (is_primary 0=start or 1=end)
- * returns TRUE if changed
- */
-static void *ChangeArcAngle(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- Angle value, *dst;
- void *a0, *a1;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc))
- return (NULL);
-
- switch(is_primary) {
- case 0: dst = &Arc->StartAngle; break;
- case 1: dst = &Arc->Delta; break;
- case 2:
- is_primary = 0; a0 = ChangeArcAngle(Layer, Arc);
- is_primary = 1; a1 = ChangeArcAngle(Layer, Arc);
- if ((a0 != NULL) || (a1 != NULL))
- return Arc;
- return NULL;
- }
-
- value = (AAbsolute) ? AAbsolute : (*dst) + ADelta;
- value = fmod(value, 360.0);
- if (value < 0)
- value += 360;
-
- if (value != *dst) {
- AddObjectToChangeAnglesUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- EraseArc(Arc);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) Arc);
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- *dst = value;
- SetArcBoundingBox(Arc);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) Arc, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- DrawArc(Layer, Arc);
- return (Arc);
- }
- return (NULL);
-}
-
-
-/* ---------------------------------------------------------------------------
- * changes the scaling factor of a text object
- * returns TRUE if changed
- */
-static void *ChangeTextSize(LayerTypePtr Layer, TextTypePtr Text)
-{
- int value = Absolute ? PCB_COORD_TO_MIL(Absolute)
- : Text->Scale + PCB_COORD_TO_MIL(Delta);
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Text))
- return (NULL);
- if (value <= MAX_TEXTSCALE && value >= MIN_TEXTSCALE && value != Text->Scale) {
- AddObjectToSizeUndoList(PCB_TYPE_TEXT, Layer, Text, Text);
- EraseText(Layer, Text);
- r_delete_entry(Layer->text_tree, (BoxTypePtr) Text);
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- Text->Scale = value;
- SetTextBoundingBox(&PCB->Font, Text);
- r_insert_entry(Layer->text_tree, (BoxTypePtr) Text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- DrawText(Layer, Text);
- return (Text);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the scaling factor of an element's outline
- * returns TRUE if changed
- */
-static void *ChangeElementSize(ElementTypePtr Element)
-{
- Coord value;
- pcb_bool changed = pcb_false;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- if (PCB->ElementOn)
- EraseElement(Element);
- ELEMENTLINE_LOOP(Element);
- {
- value = (Absolute) ? Absolute : line->Thickness + Delta;
- if (value <= MAX_LINESIZE && value >= MIN_LINESIZE && value != line->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_ELEMENT_LINE, Element, line, line);
- line->Thickness = value;
- changed = pcb_true;
- }
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- value = (Absolute) ? Absolute : arc->Thickness + Delta;
- if (value <= MAX_LINESIZE && value >= MIN_LINESIZE && value != arc->Thickness) {
- AddObjectToSizeUndoList(PCB_TYPE_ELEMENT_ARC, Element, arc, arc);
- arc->Thickness = value;
- changed = pcb_true;
- }
- }
- END_LOOP;
- if (PCB->ElementOn) {
- DrawElement(Element);
- }
- if (changed)
- return (Element);
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the scaling factor of a elementname object
- * returns TRUE if changed
- */
-static void *ChangeElementNameSize(ElementTypePtr Element)
-{
- int value = Absolute ? PCB_COORD_TO_MIL(Absolute)
- : DESCRIPTION_TEXT(Element).Scale + PCB_COORD_TO_MIL(Delta);
-
- if (TEST_FLAG(PCB_FLAG_LOCK, &Element->Name[0]))
- return (NULL);
- if (value <= MAX_TEXTSCALE && value >= MIN_TEXTSCALE) {
- EraseElementName(Element);
- ELEMENTTEXT_LOOP(Element);
- {
- AddObjectToSizeUndoList(PCB_TYPE_ELEMENT_NAME, Element, text, text);
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- text->Scale = value;
- SetTextBoundingBox(&PCB->Font, text);
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- DrawElementName(Element);
- return (Element);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the name of a via
- */
-static void *ChangeViaName(PinTypePtr Via)
-{
- char *old = Via->Name;
-
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Via)) {
- ErasePinName(Via);
- Via->Name = NewName;
- DrawPinName(Via);
- }
- else
- Via->Name = NewName;
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the name of a pin
- */
-static void *ChangePinName(ElementTypePtr Element, PinTypePtr Pin)
-{
- char *old = Pin->Name;
-
- Element = Element; /* get rid of 'unused...' warnings */
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin)) {
- ErasePinName(Pin);
- Pin->Name = NewName;
- DrawPinName(Pin);
- }
- else
- Pin->Name = NewName;
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the name of a pad
- */
-static void *ChangePadName(ElementTypePtr Element, PadTypePtr Pad)
-{
- char *old = Pad->Name;
-
- Element = Element; /* get rid of 'unused...' warnings */
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad)) {
- ErasePadName(Pad);
- Pad->Name = NewName;
- DrawPadName(Pad);
- }
- else
- Pad->Name = NewName;
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the number of a pin
- */
-static void *ChangePinNum(ElementTypePtr Element, PinTypePtr Pin)
-{
- char *old = Pin->Number;
-
- Element = Element; /* get rid of 'unused...' warnings */
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin)) {
- ErasePinName(Pin);
- Pin->Number = NewName;
- DrawPinName(Pin);
- }
- else
- Pin->Number = NewName;
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the number of a pad
- */
-static void *ChangePadNum(ElementTypePtr Element, PadTypePtr Pad)
-{
- char *old = Pad->Number;
-
- Element = Element; /* get rid of 'unused...' warnings */
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad)) {
- ErasePadName(Pad);
- Pad->Number = NewName;
- DrawPadName(Pad);
- }
- else
- Pad->Number = NewName;
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the name of a line
- */
-static void *ChangeLineName(LayerTypePtr Layer, LineTypePtr Line)
-{
- char *old = Line->Number;
-
- Layer = Layer;
- Line->Number = NewName;
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the layout-name of an element
- */
-
-char *ChangeElementText(PCBType * pcb, DataType * data, ElementTypePtr Element, int which, char *new_name)
-{
- char *old = Element->Name[which].TextString;
-
-#ifdef DEBUG
- printf("In ChangeElementText, updating old TextString %s to %s\n", old, new_name);
-#endif
-
- if (pcb && which == NAME_INDEX())
- EraseElementName(Element);
-
- r_delete_entry(data->name_tree[which], &Element->Name[which].BoundingBox);
-
- Element->Name[which].TextString = new_name;
- SetTextBoundingBox(&PCB->Font, &Element->Name[which]);
-
- r_insert_entry(data->name_tree[which], &Element->Name[which].BoundingBox, 0);
-
- if (pcb && which == NAME_INDEX())
- DrawElementName(Element);
-
- return old;
-}
-
-static void *ChangeElementName(ElementTypePtr Element)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, &Element->Name[0]))
- return (NULL);
- if (NAME_INDEX() == NAMEONPCB_INDEX) {
- if (conf_core.editor.unique_names && UniqueElementName(PCB->Data, NewName) != NewName) {
- Message(PCB_MSG_DEFAULT, _("Error: The name \"%s\" is not unique!\n"), NewName);
- return ((char *) -1);
- }
- }
-
- return ChangeElementText(PCB, PCB->Data, Element, NAME_INDEX(), NewName);
-}
-
-static void *ChangeElementNonetlist(ElementTypePtr Element)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- TOGGLE_FLAG(PCB_FLAG_NONETLIST, Element);
- return Element;
-}
-
-/* ---------------------------------------------------------------------------
- * sets data of a text object and calculates bounding box
- * memory must have already been allocated
- * the one for the new string is allocated
- * returns pcb_true if the string has been changed
- */
-static void *ChangeTextName(LayerTypePtr Layer, TextTypePtr Text)
-{
- char *old = Text->TextString;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Text))
- return (NULL);
- EraseText(Layer, Text);
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- Text->TextString = NewName;
-
- /* calculate size of the bounding box */
- SetTextBoundingBox(&PCB->Font, Text);
- r_insert_entry(Layer->text_tree, (BoxTypePtr) Text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- DrawText(Layer, Text);
- return (old);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the name of a layout; memory has to be already allocated
- */
-pcb_bool ChangeLayoutName(char *Name)
-{
- free(PCB->Name);
- PCB->Name = Name;
- if (gui != NULL)
- hid_action("PCBChanged");
- return (pcb_true);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the side of the board an element is on
- * returns TRUE if done
- */
-pcb_bool ChangeElementSide(ElementTypePtr Element, Coord yoff)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (pcb_false);
- EraseElement(Element);
- AddObjectToMirrorUndoList(PCB_TYPE_ELEMENT, Element, Element, Element, yoff);
- MirrorElementCoordinates(PCB->Data, Element, yoff);
- DrawElement(Element);
- return (pcb_true);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the name of a layer; memory has to be already allocated
- */
-pcb_bool ChangeLayerName(LayerTypePtr Layer, char *Name)
-{
- free((char*)CURRENT->Name);
- CURRENT->Name = Name;
- hid_action("LayersChanged");
- return (pcb_true);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance flag of a line
- */
-static void *ChangeLineJoin(LayerTypePtr Layer, LineTypePtr Line)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Line))
- return (NULL);
- EraseLine(Line);
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) {
- AddObjectToClearPolyUndoList(PCB_TYPE_LINE, Layer, Line, Line, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- }
- AddObjectToFlagUndoList(PCB_TYPE_LINE, Layer, Line, Line);
- TOGGLE_FLAG(PCB_FLAG_CLEARLINE, Line);
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) {
- AddObjectToClearPolyUndoList(PCB_TYPE_LINE, Layer, Line, Line, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- }
- DrawLine(Layer, Line);
- return (Line);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the clearance flag of a line
- */
-static void *SetLineJoin(LayerTypePtr Layer, LineTypePtr Line)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Line) || TEST_FLAG(PCB_FLAG_CLEARLINE, Line))
- return (NULL);
- return ChangeLineJoin(Layer, Line);
-}
-
-/* ---------------------------------------------------------------------------
- * clears the clearance flag of a line
- */
-static void *ClrLineJoin(LayerTypePtr Layer, LineTypePtr Line)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Line) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Line))
- return (NULL);
- return ChangeLineJoin(Layer, Line);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance flag of an arc
- */
-static void *ChangeArcJoin(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc))
- return (NULL);
- EraseArc(Arc);
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) {
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- AddObjectToClearPolyUndoList(PCB_TYPE_ARC, Layer, Arc, Arc, pcb_false);
- }
- AddObjectToFlagUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- TOGGLE_FLAG(PCB_FLAG_CLEARLINE, Arc);
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) {
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- AddObjectToClearPolyUndoList(PCB_TYPE_ARC, Layer, Arc, Arc, pcb_true);
- }
- DrawArc(Layer, Arc);
- return (Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the clearance flag of an arc
- */
-static void *SetArcJoin(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || TEST_FLAG(PCB_FLAG_CLEARLINE, Arc))
- return (NULL);
- return ChangeArcJoin(Layer, Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * clears the clearance flag of an arc
- */
-static void *ClrArcJoin(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Arc))
- return (NULL);
- return ChangeArcJoin(Layer, Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the clearance flag of a text
- */
-static void *ChangeTextJoin(LayerTypePtr Layer, TextTypePtr Text)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Text))
- return (NULL);
- EraseText(Layer, Text);
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, Text)) {
- AddObjectToClearPolyUndoList(PCB_TYPE_TEXT, Layer, Text, Text, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- }
- AddObjectToFlagUndoList(PCB_TYPE_LINE, Layer, Text, Text);
- TOGGLE_FLAG(PCB_FLAG_CLEARLINE, Text);
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, Text)) {
- AddObjectToClearPolyUndoList(PCB_TYPE_TEXT, Layer, Text, Text, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- }
- DrawText(Layer, Text);
- return (Text);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the clearance flag of a text
- */
-static void *SetTextJoin(LayerTypePtr Layer, TextTypePtr Text)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Text) || TEST_FLAG(PCB_FLAG_CLEARLINE, Text))
- return (NULL);
- return ChangeTextJoin(Layer, Text);
-}
-
-/* ---------------------------------------------------------------------------
- * clears the clearance flag of a text
- */
-static void *ClrTextJoin(LayerTypePtr Layer, TextTypePtr Text)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Text) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Text))
- return (NULL);
- return ChangeTextJoin(Layer, Text);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the square flag of all pins on an element
- */
-static void *ChangeElementSquare(ElementTypePtr Element)
-{
- void *ans = NULL;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- ans = ChangePinSquare(Element, pin);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- ans = ChangePadSquare(Element, pad);
- }
- END_LOOP;
- return (ans);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the square flag of all pins on an element
- */
-static void *SetElementSquare(ElementTypePtr Element)
-{
- void *ans = NULL;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- ans = SetPinSquare(Element, pin);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- ans = SetPadSquare(Element, pad);
- }
- END_LOOP;
- return (ans);
-}
-
-/* ---------------------------------------------------------------------------
- * clears the square flag of all pins on an element
- */
-static void *ClrElementSquare(ElementTypePtr Element)
-{
- void *ans = NULL;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- ans = ClrPinSquare(Element, pin);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- ans = ClrPadSquare(Element, pad);
- }
- END_LOOP;
- return (ans);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the octagon flags of all pins of an element
- */
-static void *ChangeElementOctagon(ElementTypePtr Element)
-{
- void *result = NULL;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- ChangePinOctagon(Element, pin);
- result = Element;
- }
- END_LOOP;
- return (result);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the octagon flags of all pins of an element
- */
-static void *SetElementOctagon(ElementTypePtr Element)
-{
- void *result = NULL;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- SetPinOctagon(Element, pin);
- result = Element;
- }
- END_LOOP;
- return (result);
-}
-
-/* ---------------------------------------------------------------------------
- * clears the octagon flags of all pins of an element
- */
-static void *ClrElementOctagon(ElementTypePtr Element)
-{
- void *result = NULL;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Element))
- return (NULL);
- PIN_LOOP(Element);
- {
- ClrPinOctagon(Element, pin);
- result = Element;
- }
- END_LOOP;
- return (result);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the square flag of a pad
- */
-static void *ChangePadSquare(ElementTypePtr Element, PadTypePtr Pad)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pad))
- return (NULL);
- ErasePad(Pad);
- AddObjectToClearPolyUndoList(PCB_TYPE_PAD, Element, Pad, Pad, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad);
- AddObjectToFlagUndoList(PCB_TYPE_PAD, Element, Pad, Pad);
- TOGGLE_FLAG(PCB_FLAG_SQUARE, Pad);
- AddObjectToClearPolyUndoList(PCB_TYPE_PAD, Element, Pad, Pad, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad);
- DrawPad(Pad);
- return (Pad);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the square flag of a pad
- */
-static void *SetPadSquare(ElementTypePtr Element, PadTypePtr Pad)
-{
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pad) || TEST_FLAG(PCB_FLAG_SQUARE, Pad))
- return (NULL);
-
- return (ChangePadSquare(Element, Pad));
-}
-
-
-/* ---------------------------------------------------------------------------
- * clears the square flag of a pad
- */
-static void *ClrPadSquare(ElementTypePtr Element, PadTypePtr Pad)
-{
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Pad) || !TEST_FLAG(PCB_FLAG_SQUARE, Pad))
- return (NULL);
-
- return (ChangePadSquare(Element, Pad));
-}
-
-
-/* ---------------------------------------------------------------------------
- * changes the square flag of a via
- */
-static void *ChangeViaSquare(PinTypePtr Via)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Via))
- return (NULL);
- EraseVia(Via);
- AddObjectToClearPolyUndoList(PCB_TYPE_VIA, NULL, Via, Via, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, NULL, Via);
- AddObjectToFlagUndoList(PCB_TYPE_VIA, NULL, Via, Via);
- ASSIGN_SQUARE(Absolute, Via);
- if (Absolute == 0)
- CLEAR_FLAG(PCB_FLAG_SQUARE, Via);
- else
- SET_FLAG(PCB_FLAG_SQUARE, Via);
- SetPinBoundingBox(Via);
- AddObjectToClearPolyUndoList(PCB_TYPE_VIA, NULL, Via, Via, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, NULL, Via);
- DrawVia(Via);
- return (Via);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the square flag of a pin
- */
-static void *ChangePinSquare(ElementTypePtr Element, PinTypePtr Pin)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin))
- return (NULL);
- ErasePin(Pin);
- AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- AddObjectToFlagUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- ASSIGN_SQUARE(Absolute, Pin);
- if (Absolute == 0)
- CLEAR_FLAG(PCB_FLAG_SQUARE, Pin);
- else
- SET_FLAG(PCB_FLAG_SQUARE, Pin);
- SetPinBoundingBox(Pin);
- AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- DrawPin(Pin);
- return (Pin);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the square flag of a pin
- */
-static void *SetPinSquare(ElementTypePtr Element, PinTypePtr Pin)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || TEST_FLAG(PCB_FLAG_SQUARE, Pin))
- return (NULL);
-
- return (ChangePinSquare(Element, Pin));
-}
-
-/* ---------------------------------------------------------------------------
- * clears the square flag of a pin
- */
-static void *ClrPinSquare(ElementTypePtr Element, PinTypePtr Pin)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || !TEST_FLAG(PCB_FLAG_SQUARE, Pin))
- return (NULL);
-
- return (ChangePinSquare(Element, Pin));
-}
-
-/* ---------------------------------------------------------------------------
- * changes the octagon flag of a via
- */
-static void *ChangeViaOctagon(PinTypePtr Via)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Via))
- return (NULL);
- EraseVia(Via);
- AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- AddObjectToFlagUndoList(PCB_TYPE_VIA, Via, Via, Via);
- TOGGLE_FLAG(PCB_FLAG_OCTAGON, Via);
- AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- DrawVia(Via);
- return (Via);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the octagon flag of a via
- */
-static void *SetViaOctagon(PinTypePtr Via)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Via) || TEST_FLAG(PCB_FLAG_OCTAGON, Via))
- return (NULL);
-
- return (ChangeViaOctagon(Via));
-}
-
-/* ---------------------------------------------------------------------------
- * clears the octagon flag of a via
- */
-static void *ClrViaOctagon(PinTypePtr Via)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Via) || !TEST_FLAG(PCB_FLAG_OCTAGON, Via))
- return (NULL);
-
- return (ChangeViaOctagon(Via));
-}
-
-/* ---------------------------------------------------------------------------
- * changes the octagon flag of a pin
- */
-static void *ChangePinOctagon(ElementTypePtr Element, PinTypePtr Pin)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin))
- return (NULL);
- ErasePin(Pin);
- AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- AddObjectToFlagUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- TOGGLE_FLAG(PCB_FLAG_OCTAGON, Pin);
- AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin);
- DrawPin(Pin);
- return (Pin);
-}
+};
-/* ---------------------------------------------------------------------------
- * sets the octagon flag of a pin
- */
-static void *SetPinOctagon(ElementTypePtr Element, PinTypePtr Pin)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || TEST_FLAG(PCB_FLAG_OCTAGON, Pin))
- return (NULL);
+static pcb_opfunc_t ChangeOctagonFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ ChangeViaOctagon,
+ ChangeElementOctagon,
+ NULL,
+ ChangePinOctagon,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
- return (ChangePinOctagon(Element, Pin));
-}
+static pcb_opfunc_t ChangeMaskSizeFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ ChangeViaMaskSize,
+#if 0
+ ChangeElementMaskSize,
+#else
+ NULL,
+#endif
+ NULL,
+ ChangePinMaskSize,
+ ChangePadMaskSize,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
-/* ---------------------------------------------------------------------------
- * clears the octagon flag of a pin
- */
-static void *ClrPinOctagon(ElementTypePtr Element, PinTypePtr Pin)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || !TEST_FLAG(PCB_FLAG_OCTAGON, Pin))
- return (NULL);
+static pcb_opfunc_t SetSquareFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ SetElementSquare,
+ NULL,
+ SetPinSquare,
+ SetPadSquare,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
- return (ChangePinOctagon(Element, Pin));
-}
+static pcb_opfunc_t SetJoinFunctions = {
+ SetLineJoin,
+ SetTextJoin,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ SetArcJoin,
+ NULL,
+ NULL
+};
-/* ---------------------------------------------------------------------------
- * changes the hole flag of a via
- */
-pcb_bool ChangeHole(PinTypePtr Via)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Via))
- return (pcb_false);
- EraseVia(Via);
- AddObjectToFlagUndoList(PCB_TYPE_VIA, Via, Via, Via);
- AddObjectToMaskSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- r_delete_entry(PCB->Data->via_tree, (BoxType *) Via);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- TOGGLE_FLAG(PCB_FLAG_HOLE, Via);
-
- if (TEST_FLAG(PCB_FLAG_HOLE, Via)) {
- /* A tented via becomes an minimally untented hole. An untented
- via retains its mask clearance. */
- if (Via->Mask > Via->Thickness) {
- Via->Mask = (Via->DrillingHole + (Via->Mask - Via->Thickness));
- }
- else if (Via->Mask < Via->DrillingHole) {
- Via->Mask = Via->DrillingHole + 2 * MASKFRAME;
- }
- }
- else {
- Via->Mask = (Via->Thickness + (Via->Mask - Via->DrillingHole));
- }
+static pcb_opfunc_t SetOctagonFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ SetViaOctagon,
+ SetElementOctagon,
+ NULL,
+ SetPinOctagon,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
- SetPinBoundingBox(Via);
- r_insert_entry(PCB->Data->via_tree, (BoxType *) Via, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- DrawVia(Via);
- Draw();
- return (pcb_true);
-}
+static pcb_opfunc_t ClrSquareFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ClrElementSquare,
+ NULL,
+ ClrPinSquare,
+ ClrPadSquare,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
-/* ---------------------------------------------------------------------------
- * changes the nopaste flag of a pad
- */
-pcb_bool ChangePaste(PadTypePtr Pad)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Pad))
- return (pcb_false);
- ErasePad(Pad);
- AddObjectToFlagUndoList(PCB_TYPE_PAD, Pad, Pad, Pad);
- TOGGLE_FLAG(PCB_FLAG_NOPASTE, Pad);
- DrawPad(Pad);
- Draw();
- return (pcb_true);
-}
+static pcb_opfunc_t ClrJoinFunctions = {
+ ClrLineJoin,
+ ClrTextJoin,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ClrArcJoin,
+ NULL,
+ NULL
+};
-/* ---------------------------------------------------------------------------
- * changes the CLEARPOLY flag of a polygon
- */
-static void *ChangePolyClear(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, Polygon))
- return (NULL);
- AddObjectToClearPolyUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon, pcb_true);
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
- TOGGLE_FLAG(PCB_FLAG_CLEARPOLY, Polygon);
- InitClip(PCB->Data, Layer, Polygon);
- DrawPolygon(Layer, Polygon);
- return (Polygon);
-}
+static pcb_opfunc_t ClrOctagonFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ ClrViaOctagon,
+ ClrElementOctagon,
+ NULL,
+ ClrPinOctagon,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
-/* ----------------------------------------------------------------------
- * changes the side of all selected and visible elements
- * returns pcb_true if anything has changed
- */
-pcb_bool ChangeSelectedElementSide(void)
-{
- pcb_bool change = pcb_false;
+static pcb_opfunc_t ChangeRadiusFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ChangeArcRadius,
+ NULL,
+ NULL
+};
- /* setup identifiers */
- if (PCB->PinOn && PCB->ElementOn)
- ELEMENT_LOOP(PCB->Data);
- {
- if (TEST_FLAG(PCB_FLAG_SELECTED, element)) {
- change |= ChangeElementSide(element, 0);
- }
- }
- END_LOOP;
- if (change) {
- Draw();
- IncrementUndoSerialNumber();
- }
- return (change);
-}
+static pcb_opfunc_t ChangeAngleFunctions = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ChangeArcAngle,
+ NULL,
+ NULL
+};
/* ----------------------------------------------------------------------
* changes the thermals on all selected and visible pins
* and/or vias. Returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedThermals(int types, int therm_style)
+pcb_bool pcb_chg_selected_thermals(int types, int therm_style)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgtherm.pcb = PCB;
+ ctx.chgtherm.style = therm_style;
- Delta = therm_style;
- change = SelectedOperation(&ChangeThermalFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeThermalFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -1907,18 +392,20 @@ pcb_bool ChangeSelectedThermals(int types, int therm_style)
* changes the size of all selected and visible object types
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedSize(int types, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_selected_size(int types, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- /* setup identifiers */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- change = SelectedOperation(&ChangeSizeFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeSizeFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -1927,20 +414,23 @@ pcb_bool ChangeSelectedSize(int types, Coord Difference, pcb_bool fixIt)
* changes the clearance size of all selected and visible objects
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedClearSize(int types, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_selected_clear_size(int types, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- /* setup identifiers */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
if (conf_core.editor.show_mask)
- change = SelectedOperation(&ChangeMaskSizeFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeMaskSizeFunctions, &ctx, pcb_false, types);
else
- change = SelectedOperation(&ChangeClearSizeFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeClearSizeFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -1949,17 +439,20 @@ pcb_bool ChangeSelectedClearSize(int types, Coord Difference, pcb_bool fixIt)
* changes the 2nd size (drilling hole) of all selected and visible objects
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelected2ndSize(int types, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_selected_2nd_size(int types, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- /* setup identifiers */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
- change = SelectedOperation(&Change2ndSizeFunctions, pcb_false, types);
+ change = pcb_selected_operation(&Change2ndSizeFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -1968,14 +461,17 @@ pcb_bool ChangeSelected2ndSize(int types, Coord Difference, pcb_bool fixIt)
* changes the clearance flag (join) of all selected and visible lines
* and/or arcs. Returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedJoin(int types)
+pcb_bool pcb_chg_selected_join(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- change = SelectedOperation(&ChangeJoinFunctions, pcb_false, types);
+ ctx.chgsize.pcb = PCB;
+
+ change = pcb_selected_operation(&ChangeJoinFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -1984,14 +480,17 @@ pcb_bool ChangeSelectedJoin(int types)
* changes the clearance flag (join) of all selected and visible lines
* and/or arcs. Returns pcb_true if anything has changed
*/
-pcb_bool SetSelectedJoin(int types)
+pcb_bool pcb_set_selected_join(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
- change = SelectedOperation(&SetJoinFunctions, pcb_false, types);
+ change = pcb_selected_operation(&SetJoinFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2000,14 +499,17 @@ pcb_bool SetSelectedJoin(int types)
* changes the clearance flag (join) of all selected and visible lines
* and/or arcs. Returns pcb_true if anything has changed
*/
-pcb_bool ClrSelectedJoin(int types)
+pcb_bool pcb_clr_selected_join(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- change = SelectedOperation(&ClrJoinFunctions, pcb_false, types);
+ ctx.chgsize.pcb = PCB;
+
+ change = pcb_selected_operation(&ClrJoinFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2016,14 +518,17 @@ pcb_bool ClrSelectedJoin(int types)
* changes the nonetlist-flag of all selected and visible elements
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedNonetlist(int types)
+pcb_bool pcb_chg_selected_nonetlist(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
- change = SelectedOperation(&ChangeNonetlistFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeNonetlistFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2036,11 +541,14 @@ pcb_bool ChangeSelectedNonetlist(int types)
pcb_bool SetSelectedNonetlist(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- change = SelectedOperation(&SetNonetlistFunctions, pcb_false, types);
+ ctx.chgsize.pcb = PCB;
+
+ change = pcb_selected_operation(&SetNonetlistFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2052,11 +560,14 @@ pcb_bool SetSelectedNonetlist(int types)
pcb_bool ClrSelectedNonetlist(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
- change = SelectedOperation(&ClrNonetlistFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ClrNonetlistFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2066,14 +577,17 @@ pcb_bool ClrSelectedNonetlist(int types)
* changes the square-flag of all selected and visible pins or pads
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedSquare(int types)
+pcb_bool pcb_chg_selected_square(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- change = SelectedOperation(&ChangeSquareFunctions, pcb_false, types);
+ ctx.chgsize.pcb = PCB;
+
+ change = pcb_selected_operation(&ChangeSquareFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2082,19 +596,20 @@ pcb_bool ChangeSelectedSquare(int types)
* changes the angle of all selected and visible object types
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedAngle(int types, int is_start, Angle Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_selected_angle(int types, int is_start, pcb_angle_t Difference, pcb_bool fixIt)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- /* setup identifiers */
- AAbsolute = (fixIt) ? Difference : 0;
- ADelta = Difference;
- is_primary = is_start;
+ ctx.chgangle.pcb = PCB;
+ ctx.chgangle.is_primary = is_start;
+ ctx.chgangle.absolute = (fixIt) ? Difference : 0;
+ ctx.chgangle.delta = Difference;
- change = SelectedOperation(&ChangeAngleFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeAngleFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2103,19 +618,20 @@ pcb_bool ChangeSelectedAngle(int types, int is_start, Angle Difference, pcb_bool
* changes the radius of all selected and visible object types
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedRadius(int types, int is_start, Angle Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_selected_radius(int types, int is_start, pcb_angle_t Difference, pcb_bool fixIt)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- /* setup identifiers */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
- is_primary = is_start;
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = is_start;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- change = SelectedOperation(&ChangeRadiusFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeRadiusFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2125,14 +641,17 @@ pcb_bool ChangeSelectedRadius(int types, int is_start, Angle Difference, pcb_boo
* sets the square-flag of all selected and visible pins or pads
* returns pcb_true if anything has changed
*/
-pcb_bool SetSelectedSquare(int types)
+pcb_bool pcb_set_selected_square(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
- change = SelectedOperation(&SetSquareFunctions, pcb_false, types);
+ change = pcb_selected_operation(&SetSquareFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2141,14 +660,17 @@ pcb_bool SetSelectedSquare(int types)
* clears the square-flag of all selected and visible pins or pads
* returns pcb_true if anything has changed
*/
-pcb_bool ClrSelectedSquare(int types)
+pcb_bool pcb_clr_selected_square(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- change = SelectedOperation(&ClrSquareFunctions, pcb_false, types);
+ ctx.chgsize.pcb = PCB;
+
+ change = pcb_selected_operation(&ClrSquareFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2157,14 +679,17 @@ pcb_bool ClrSelectedSquare(int types)
* changes the octagon-flag of all selected and visible pins and vias
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedOctagon(int types)
+pcb_bool pcb_chg_selected_octagon(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
- change = SelectedOperation(&ChangeOctagonFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ChangeOctagonFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2173,14 +698,17 @@ pcb_bool ChangeSelectedOctagon(int types)
* sets the octagon-flag of all selected and visible pins and vias
* returns pcb_true if anything has changed
*/
-pcb_bool SetSelectedOctagon(int types)
+pcb_bool pcb_set_selected_octagon(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
- change = SelectedOperation(&SetOctagonFunctions, pcb_false, types);
+ ctx.chgsize.pcb = PCB;
+
+ change = pcb_selected_operation(&SetOctagonFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2189,14 +717,17 @@ pcb_bool SetSelectedOctagon(int types)
* clears the octagon-flag of all selected and visible pins and vias
* returns pcb_true if anything has changed
*/
-pcb_bool ClrSelectedOctagon(int types)
+pcb_bool pcb_clr_selected_octagon(int types)
{
pcb_bool change = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
- change = SelectedOperation(&ClrOctagonFunctions, pcb_false, types);
+ change = pcb_selected_operation(&ClrOctagonFunctions, &ctx, pcb_false, types);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2205,20 +736,20 @@ pcb_bool ClrSelectedOctagon(int types)
* changes the hole-flag of all selected and visible vias
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedHole(void)
+pcb_bool pcb_chg_selected_hole(void)
{
pcb_bool change = pcb_false;
if (PCB->ViaOn)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, via))
- change |= ChangeHole(via);
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, via))
+ change |= pcb_pin_change_hole(via);
}
- END_LOOP;
+ PCB_END_LOOP;
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2227,19 +758,19 @@ pcb_bool ChangeSelectedHole(void)
* changes the no paste-flag of all selected and visible pads
* returns pcb_true if anything has changed
*/
-pcb_bool ChangeSelectedPaste(void)
+pcb_bool pcb_chg_selected_paste(void)
{
pcb_bool change = pcb_false;
- ALLPAD_LOOP(PCB->Data);
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pad))
- change |= ChangePaste(pad);
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad))
+ change |= pcb_pad_change_paste(pad);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2249,17 +780,20 @@ pcb_bool ChangeSelectedPaste(void)
* changes the size of the passed object; element size is silk size
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_obj_size(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change;
+ pcb_opctx_t ctx;
- /* setup identifier */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
- change = (ObjectOperation(&ChangeSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
+
+ change = (pcb_object_operation(&ChangeSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2268,17 +802,20 @@ pcb_bool ChangeObjectSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Di
* changes the size of the passed object; element size is pin ring sizes
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObject1stSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_obj_1st_size(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- /* setup identifier */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
- change = (ObjectOperation(&Change1stSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ change = (pcb_object_operation(&Change1stSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2287,38 +824,42 @@ pcb_bool ChangeObject1stSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord
* changes the radius of the passed object (e.g. arc width/height)
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectRadius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, Coord r, pcb_bool fixIt)
+pcb_bool pcb_chg_obj_radius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, pcb_coord_t r, pcb_bool fixIt)
{
pcb_bool change;
+ pcb_opctx_t ctx;
- /* setup identifier */
- Absolute = (fixIt) ? r : 0;
- Delta = r;
- is_primary = is_x;
- change = (ObjectOperation(&ChangeRadiusFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = is_x;
+ ctx.chgsize.absolute = (fixIt) ? r : 0;
+ ctx.chgsize.delta = r;
+
+ change = (pcb_object_operation(&ChangeRadiusFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
/* ---------------------------------------------------------------------------
- * changes the angles of the passed object (e.g. arc start/delta)
+ * changes the angles of the passed object (e.g. arc start/ctx->chgsize.delta)
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectAngle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_start, Angle a, pcb_bool fixIt)
+pcb_bool pcb_chg_obj_angle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_start, pcb_angle_t a, pcb_bool fixIt)
{
pcb_bool change;
+ pcb_opctx_t ctx;
+
+ ctx.chgangle.pcb = PCB;
+ ctx.chgangle.is_primary = is_start;
+ ctx.chgangle.absolute = (fixIt) ? a : 0;
+ ctx.chgangle.delta = a;
- /* setup identifier */
- AAbsolute = (fixIt) ? a : 0;
- ADelta = a;
- is_primary = is_start;
- change = (ObjectOperation(&ChangeAngleFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ change = (pcb_object_operation(&ChangeAngleFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2328,20 +869,23 @@ pcb_bool ChangeObjectAngle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_
* changes the clearance size of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectClearSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_obj_clear_size(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- /* setup identifier */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
if (conf_core.editor.show_mask)
- change = (ObjectOperation(&ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ change = (pcb_object_operation(&ChangeMaskSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
else
- change = (ObjectOperation(&ChangeClearSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ change = (pcb_object_operation(&ChangeClearSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2351,15 +895,18 @@ pcb_bool ChangeObjectClearSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coo
* Returns pcb_true if anything is changed
*
*/
-pcb_bool ChangeObjectThermal(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int therm_type)
+pcb_bool pcb_chg_obj_thermal(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int therm_type)
{
pcb_bool change;
+ pcb_opctx_t ctx;
+
+ ctx.chgtherm.pcb = PCB;
+ ctx.chgtherm.style = therm_type;
- Delta = Absolute = therm_type;
- change = (ObjectOperation(&ChangeThermalFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ change = (pcb_object_operation(&ChangeThermalFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2368,18 +915,21 @@ pcb_bool ChangeObjectThermal(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int t
* changes the 2nd size of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObject2ndSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt, pcb_bool incundo)
+pcb_bool pcb_chg_obj_2nd_size(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt, pcb_bool incundo)
{
pcb_bool change;
+ pcb_opctx_t ctx;
- /* setup identifier */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
- change = (ObjectOperation(&Change2ndSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
+
+ change = (pcb_object_operation(&Change2ndSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
+ pcb_draw();
if (incundo)
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2388,17 +938,20 @@ pcb_bool ChangeObject2ndSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord
* changes the mask size of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectMaskSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt)
+pcb_bool pcb_chg_obj_mask_size(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt)
{
pcb_bool change;
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.is_primary = 1;
+ ctx.chgsize.absolute = (fixIt) ? Difference : 0;
+ ctx.chgsize.delta = Difference;
- /* setup identifier */
- Absolute = (fixIt) ? Difference : 0;
- Delta = Difference;
- change = (ObjectOperation(&ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL);
+ change = (pcb_object_operation(&ChangeMaskSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL);
if (change) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (change);
}
@@ -2410,13 +963,16 @@ pcb_bool ChangeObjectMaskSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coor
* The allocated memory isn't freed because the old string is used
* by the undo module.
*/
-void *ChangeObjectName(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name)
+void *pcb_chg_obj_name(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name)
{
void *result;
- /* setup identifier */
- NewName = Name;
- result = ObjectOperation(&ChangeNameFunctions, Type, Ptr1, Ptr2, Ptr3);
- Draw();
+ pcb_opctx_t ctx;
+
+ ctx.chgname.pcb = PCB;
+ ctx.chgname.new_name = Name;
+
+ result = pcb_object_operation(&ChangeNameFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
+ pcb_draw();
return (result);
}
@@ -2427,13 +983,16 @@ void *ChangeObjectName(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name)
* The allocated memory isn't freed because the old string is used
* by the undo module.
*/
-void *ChangeObjectPinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name)
+void *pcb_chg_obj_pinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name)
{
void *result;
- /* setup identifier */
- NewName = Name;
- result = ObjectOperation(&ChangePinnumFunctions, Type, Ptr1, Ptr2, Ptr3);
- Draw();
+ pcb_opctx_t ctx;
+
+ ctx.chgname.pcb = PCB;
+ ctx.chgname.new_name = Name;
+
+ result = pcb_object_operation(&ChangePinnumFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
+ pcb_draw();
return (result);
}
@@ -2441,11 +1000,15 @@ void *ChangeObjectPinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Nam
* changes the clearance-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectJoin(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_chg_obj_join(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&ChangeJoinFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&ChangeJoinFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2455,11 +1018,15 @@ pcb_bool ChangeObjectJoin(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* sets the clearance-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool SetObjectJoin(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_set_obj_join(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&SetJoinFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&SetJoinFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2469,11 +1036,15 @@ pcb_bool SetObjectJoin(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* clears the clearance-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ClrObjectJoin(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_clr_obj_join(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&ClrJoinFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&ClrJoinFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2483,11 +1054,15 @@ pcb_bool ClrObjectJoin(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* changes the square-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectNonetlist(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_chg_obj_nonetlist(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&ChangeNonetlistFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&ChangeNonetlistFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2497,12 +1072,16 @@ pcb_bool ChangeObjectNonetlist(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* changes the square-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectSquare(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int style)
+pcb_bool pcb_chg_obj_square(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int style)
{
- Absolute = style;
- if (ObjectOperation(&ChangeSquareFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+ ctx.chgsize.absolute = style;
+
+ if (pcb_object_operation(&ChangeSquareFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2512,11 +1091,15 @@ pcb_bool ChangeObjectSquare(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int st
* sets the square-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool SetObjectSquare(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_set_obj_square(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&SetSquareFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&SetSquareFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2526,11 +1109,15 @@ pcb_bool SetObjectSquare(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* clears the square-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ClrObjectSquare(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_clr_obj_square(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&ClrSquareFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&ClrSquareFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2540,11 +1127,15 @@ pcb_bool ClrObjectSquare(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* changes the octagon-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ChangeObjectOctagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_chg_obj_octagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&ChangeOctagonFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&ChangeOctagonFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2554,11 +1145,15 @@ pcb_bool ChangeObjectOctagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* sets the octagon-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool SetObjectOctagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_set_obj_octagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&SetOctagonFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&SetOctagonFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2568,11 +1163,15 @@ pcb_bool SetObjectOctagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* clears the octagon-flag of the passed object
* Returns pcb_true if anything is changed
*/
-pcb_bool ClrObjectOctagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+pcb_bool pcb_clr_obj_octagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- if (ObjectOperation(&ClrOctagonFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_opctx_t ctx;
+
+ ctx.chgsize.pcb = PCB;
+
+ if (pcb_object_operation(&ClrOctagonFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) {
+ pcb_draw();
+ pcb_undo_inc_serial();
return (pcb_true);
}
return (pcb_false);
@@ -2584,7 +1183,7 @@ pcb_bool ClrObjectOctagon(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
* The allocated memory isn't freed because the old string is used
* by the undo module.
*/
-void *QueryInputAndChangeObjectName(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int pinnum)
+void *pcb_chg_obj_name_query(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int pinnum)
{
char *name = NULL;
char msg[513];
@@ -2597,150 +1196,54 @@ void *QueryInputAndChangeObjectName(int Type, void *Ptr1, void *Ptr2, void *Ptr3
}
switch (Type) {
case PCB_TYPE_LINE:
- name = gui->prompt_for(_("Linename:"), EMPTY(((LineTypePtr) Ptr2)->Number));
+ name = pcb_gui->prompt_for(_("Linename:"), PCB_EMPTY(((pcb_line_t *) Ptr2)->Number));
break;
case PCB_TYPE_VIA:
- name = gui->prompt_for(_("Vianame:"), EMPTY(((PinTypePtr) Ptr2)->Name));
+ name = pcb_gui->prompt_for(_("Vianame:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name));
break;
case PCB_TYPE_PIN:
if (pinnum)
- sprintf(msg, _("%s Pin Number:"), EMPTY(((PinTypePtr) Ptr2)->Number));
+ sprintf(msg, _("%s Pin Number:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Number));
else
- sprintf(msg, _("%s Pin Name:"), EMPTY(((PinTypePtr) Ptr2)->Number));
- name = gui->prompt_for(msg, EMPTY(((PinTypePtr) Ptr2)->Name));
+ sprintf(msg, _("%s Pin Name:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Number));
+ name = pcb_gui->prompt_for(msg, PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name));
break;
case PCB_TYPE_PAD:
if (pinnum)
- sprintf(msg, _("%s Pad Number:"), EMPTY(((PadTypePtr) Ptr2)->Number));
+ sprintf(msg, _("%s Pad Number:"), PCB_EMPTY(((pcb_pad_t *) Ptr2)->Number));
else
- sprintf(msg, _("%s Pad Name:"), EMPTY(((PadTypePtr) Ptr2)->Number));
- name = gui->prompt_for(msg, EMPTY(((PadTypePtr) Ptr2)->Name));
+ sprintf(msg, _("%s Pad Name:"), PCB_EMPTY(((pcb_pad_t *) Ptr2)->Number));
+ name = pcb_gui->prompt_for(msg, PCB_EMPTY(((pcb_pad_t *) Ptr2)->Name));
break;
case PCB_TYPE_TEXT:
- name = gui->prompt_for(_("Enter text:"), EMPTY(((TextTypePtr) Ptr2)->TextString));
+ name = pcb_gui->prompt_for(_("Enter text:"), PCB_EMPTY(((pcb_text_t *) Ptr2)->TextString));
break;
case PCB_TYPE_ELEMENT:
- name = gui->prompt_for(_("Elementname:"), EMPTY(ELEMENT_NAME(PCB, (ElementTypePtr) Ptr2)));
+ name = pcb_gui->prompt_for(_("Elementname:"), PCB_EMPTY(PCB_ELEM_NAME_VISIBLE(PCB, (pcb_element_t *) Ptr2)));
break;
}
if (name) {
/* NB: ChangeObjectName takes ownership of the passed memory */
char *old;
if (pinnum)
- old = (char *) ChangeObjectPinnum(Type, Ptr1, Ptr2, Ptr3, name);
+ old = (char *) pcb_chg_obj_pinnum(Type, Ptr1, Ptr2, Ptr3, name);
else
- old = (char *) ChangeObjectName(Type, Ptr1, Ptr2, Ptr3, name);
+ old = (char *) pcb_chg_obj_name(Type, Ptr1, Ptr2, Ptr3, name);
if (old != (char *) -1) {
if (pinnum)
- AddObjectToChangePinnumUndoList(Type, Ptr1, Ptr2, Ptr3, old);
+ pcb_undo_add_obj_to_change_pinnum(Type, Ptr1, Ptr2, Ptr3, old);
else
- AddObjectToChangeNameUndoList(Type, Ptr1, Ptr2, Ptr3, old);
- IncrementUndoSerialNumber();
+ pcb_undo_add_obj_to_change_name(Type, Ptr1, Ptr2, Ptr3, old);
+ pcb_undo_inc_serial();
}
- Draw();
+ pcb_draw();
return (Ptr3);
}
return (NULL);
}
-
-/* ---------------------------------------------------------------------------
- * changes the maximum size of a layout
- * adjusts the scrollbars
- * releases the saved pixmap if necessary
- * and adjusts the cursor confinement box
- */
-void ChangePCBSize(Coord Width, Coord Height)
-{
- PCB->MaxWidth = Width;
- PCB->MaxHeight = Height;
-
- /* crosshair range is different if pastebuffer-mode
- * is enabled
- */
- if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER)
- SetCrosshairRange(PASTEBUFFER->X - PASTEBUFFER->BoundingBox.X1,
- PASTEBUFFER->Y - PASTEBUFFER->BoundingBox.Y1,
- MAX(0,
- Width - (PASTEBUFFER->BoundingBox.X2 -
- PASTEBUFFER->X)), MAX(0, Height - (PASTEBUFFER->BoundingBox.Y2 - PASTEBUFFER->Y)));
- else
- SetCrosshairRange(0, 0, Width, Height);
-
- if (gui != NULL)
- hid_action("PCBChanged");
-}
-
-/* ---------------------------------------------------------------------------
- * changes the mask size of a pad
- * returns TRUE if changed
- */
-static void *ChangePadMaskSize(ElementTypePtr Element, PadTypePtr Pad)
-{
- Coord value = (Absolute) ? Absolute : Pad->Mask + Delta;
-
- value = MAX(value, 0);
- if (value == Pad->Mask && Absolute == 0)
- value = Pad->Thickness;
- if (value != Pad->Mask) {
- AddObjectToMaskSizeUndoList(PCB_TYPE_PAD, Element, Pad, Pad);
- ErasePad(Pad);
- r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox);
- Pad->Mask = value;
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- DrawPad(Pad);
- return (Pad);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the mask size of a pin
- * returns TRUE if changed
- */
-static void *ChangePinMaskSize(ElementTypePtr Element, PinTypePtr Pin)
-{
- Coord value = (Absolute) ? Absolute : Pin->Mask + Delta;
-
- value = MAX(value, 0);
- if (value == Pin->Mask && Absolute == 0)
- value = Pin->Thickness;
- if (value != Pin->Mask) {
- AddObjectToMaskSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin);
- ErasePin(Pin);
- r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox);
- Pin->Mask = value;
- SetElementBoundingBox(PCB->Data, Element, &PCB->Font);
- DrawPin(Pin);
- return (Pin);
- }
- return (NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * changes the mask size of a via
- * returns TRUE if changed
- */
-static void *ChangeViaMaskSize(PinTypePtr Via)
-{
- Coord value;
-
- value = (Absolute) ? Absolute : Via->Mask + Delta;
- value = MAX(value, 0);
- if (value != Via->Mask) {
- AddObjectToMaskSizeUndoList(PCB_TYPE_VIA, Via, Via, Via);
- EraseVia(Via);
- r_delete_entry(PCB->Data->via_tree, &Via->BoundingBox);
- Via->Mask = value;
- SetPinBoundingBox(Via);
- r_insert_entry(PCB->Data->via_tree, &Via->BoundingBox, 0);
- DrawVia(Via);
- return (Via);
- }
- return (NULL);
-}
diff --git a/src/change.h b/src/change.h
index bd65be1..058ccbf 100644
--- a/src/change.h
+++ b/src/change.h
@@ -29,94 +29,82 @@
#ifndef PCB_CHANGE_H
#define PCB_CHANGE_H
-#include "global.h"
+#include "config.h"
/* ---------------------------------------------------------------------------
* some defines
*/
-#define CHANGENAME_TYPES \
+#define PCB_CHANGENAME_TYPES \
(PCB_TYPE_VIA | PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_LINE)
-#define CHANGESIZE_TYPES \
+#define PCB_CHANGESIZE_TYPES \
(PCB_TYPE_POLYGON | PCB_TYPE_VIA | PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_LINE | \
PCB_TYPE_ARC | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ELEMENT)
-#define CHANGE2NDSIZE_TYPES \
+#define PCB_CHANGE2NDSIZE_TYPES \
(PCB_TYPE_VIA | PCB_TYPE_PIN | PCB_TYPE_ELEMENT)
/* We include polygons here only to inform the user not to do it that way. */
-#define CHANGECLEARSIZE_TYPES \
+#define PCB_CHANGECLEARSIZE_TYPES \
(PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_POLYGON)
-#define CHANGENONETLIST_TYPES \
+#define PCB_CHANGENONETLIST_TYPES \
(PCB_TYPE_ELEMENT)
-#define CHANGESQUARE_TYPES \
+#define PCB_CHANGESQUARE_TYPES \
(PCB_TYPE_ELEMENT | PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_VIA)
-#define CHANGEOCTAGON_TYPES \
+#define PCB_CHANGEOCTAGON_TYPES \
(PCB_TYPE_ELEMENT | PCB_TYPE_PIN | PCB_TYPE_VIA)
-#define CHANGEJOIN_TYPES \
+#define PCB_CHANGEJOIN_TYPES \
(PCB_TYPE_ARC | PCB_TYPE_LINE | PCB_TYPE_TEXT)
-#define CHANGETHERMAL_TYPES \
+#define PCB_CHANGETHERMAL_TYPES \
(PCB_TYPE_PIN | PCB_TYPE_VIA)
-#define CHANGEMASKSIZE_TYPES \
+#define PCB_CHANGEMASKSIZE_TYPES \
(PCB_TYPE_PIN | PCB_TYPE_VIA | PCB_TYPE_PAD)
-pcb_bool ChangeLayoutName(char *);
-pcb_bool ChangeLayerName(LayerTypePtr, char *);
-pcb_bool ChangeSelectedSize(int, Coord, pcb_bool);
-pcb_bool ChangeSelectedClearSize(int, Coord, pcb_bool);
-pcb_bool ChangeSelected2ndSize(int, Coord, pcb_bool);
-pcb_bool ChangeSelectedMaskSize(int, Coord, pcb_bool);
-pcb_bool ChangeSelectedJoin(int);
-pcb_bool SetSelectedJoin(int);
-pcb_bool ClrSelectedJoin(int);
-pcb_bool ChangeSelectedNonetlist(int);
-pcb_bool ChangeSelectedSquare(int);
-pcb_bool SetSelectedSquare(int);
-pcb_bool ClrSelectedSquare(int);
-pcb_bool ChangeSelectedThermals(int, int);
-pcb_bool ChangeSelectedHole(void);
-pcb_bool ChangeSelectedPaste(void);
-pcb_bool ChangeSelectedOctagon(int);
-pcb_bool SetSelectedOctagon(int);
-pcb_bool ClrSelectedOctagon(int);
-pcb_bool ChangeSelectedElementSide(void);
-pcb_bool ChangeElementSide(ElementTypePtr, Coord);
-pcb_bool ChangeHole(PinTypePtr);
-pcb_bool ChangePaste(PadTypePtr);
-pcb_bool ChangeObjectSize(int, void *, void *, void *, Coord, pcb_bool);
-pcb_bool ChangeObject1stSize(int, void *, void *, void *, Coord, pcb_bool);
-pcb_bool ChangeObjectThermal(int, void *, void *, void *, int);
-pcb_bool ChangeObjectClearSize(int, void *, void *, void *, Coord, pcb_bool);
-pcb_bool ChangeObject2ndSize(int, void *, void *, void *, Coord, pcb_bool, pcb_bool);
-pcb_bool ChangeObjectMaskSize(int, void *, void *, void *, Coord, pcb_bool);
-pcb_bool ChangeObjectJoin(int, void *, void *, void *);
-pcb_bool SetObjectJoin(int, void *, void *, void *);
-pcb_bool ClrObjectJoin(int, void *, void *, void *);
-pcb_bool ChangeObjectNonetlist(int Type, void *Ptr1, void *Ptr2, void *Ptr3);
-pcb_bool ChangeObjectSquare(int, void *, void *, void *, int);
-pcb_bool SetObjectSquare(int, void *, void *, void *);
-pcb_bool ClrObjectSquare(int, void *, void *, void *);
-pcb_bool ChangeObjectOctagon(int, void *, void *, void *);
-pcb_bool SetObjectOctagon(int, void *, void *, void *);
-pcb_bool ClrObjectOctagon(int, void *, void *, void *);
-void *ChangeObjectName(int, void *, void *, void *, char *);
-void *QueryInputAndChangeObjectName(int, void *, void *, void *, int);
-void ChangePCBSize(Coord, Coord);
-void *ChangeObjectPinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name);
-pcb_bool ChangeObjectRadius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, Coord r, pcb_bool absolute);
-pcb_bool ChangeObjectAngle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_start, Angle a, pcb_bool absolute);
-pcb_bool ChangeSelectedAngle(int types, int is_start, Angle Difference, pcb_bool fixIt);
-pcb_bool ChangeSelectedRadius(int types, int is_start, Angle Difference, pcb_bool fixIt);
-
-/* Change the specified text on an element, either on the board (give
- PCB, PCB->Data) or in a buffer (give NULL, Buffer->Data). The old
- string is returned, and must be properly freed by the caller. */
-char *ChangeElementText(PCBType * pcb, DataType * data, ElementTypePtr Element, int which, char *new_name);
+pcb_bool pcb_chg_selected_size(int, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_selected_clear_size(int, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_selected_2nd_size(int, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_selected_mask_size(int, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_selected_join(int);
+pcb_bool pcb_set_selected_join(int);
+pcb_bool pcb_clr_selected_join(int);
+pcb_bool pcb_chg_selected_nonetlist(int);
+pcb_bool pcb_chg_selected_square(int);
+pcb_bool pcb_set_selected_square(int);
+pcb_bool pcb_clr_selected_square(int);
+pcb_bool pcb_chg_selected_thermals(int, int);
+pcb_bool pcb_chg_selected_hole(void);
+pcb_bool pcb_chg_selected_paste(void);
+pcb_bool pcb_chg_selected_octagon(int);
+pcb_bool pcb_set_selected_octagon(int);
+pcb_bool pcb_clr_selected_octagon(int);
+pcb_bool pcb_chg_obj_size(int, void *, void *, void *, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_obj_1st_size(int, void *, void *, void *, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_obj_thermal(int, void *, void *, void *, int);
+pcb_bool pcb_chg_obj_clear_size(int, void *, void *, void *, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_obj_2nd_size(int, void *, void *, void *, pcb_coord_t, pcb_bool, pcb_bool);
+pcb_bool pcb_chg_obj_mask_size(int, void *, void *, void *, pcb_coord_t, pcb_bool);
+pcb_bool pcb_chg_obj_join(int, void *, void *, void *);
+pcb_bool pcb_set_obj_join(int, void *, void *, void *);
+pcb_bool pcb_clr_obj_join(int, void *, void *, void *);
+pcb_bool pcb_chg_obj_nonetlist(int Type, void *Ptr1, void *Ptr2, void *Ptr3);
+pcb_bool pcb_chg_obj_square(int, void *, void *, void *, int);
+pcb_bool pcb_set_obj_square(int, void *, void *, void *);
+pcb_bool pcb_clr_obj_square(int, void *, void *, void *);
+pcb_bool pcb_chg_obj_octagon(int, void *, void *, void *);
+pcb_bool pcb_set_obj_octagon(int, void *, void *, void *);
+pcb_bool pcb_clr_obj_octagon(int, void *, void *, void *);
+void *pcb_chg_obj_name(int, void *, void *, void *, char *);
+void *pcb_chg_obj_name_query(int, void *, void *, void *, int);
+void *pcb_chg_obj_pinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name);
+pcb_bool pcb_chg_obj_radius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, pcb_coord_t r, pcb_bool absolute);
+pcb_bool pcb_chg_obj_angle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_start, pcb_angle_t a, pcb_bool absolute);
+pcb_bool pcb_chg_selected_angle(int types, int is_start, pcb_angle_t Difference, pcb_bool fixIt);
+pcb_bool pcb_chg_selected_radius(int types, int is_start, pcb_angle_t Difference, pcb_bool fixIt);
#endif
diff --git a/src/change_act.c b/src/change_act.c
index f80df39..f191e16 100644
--- a/src/change_act.c
+++ b/src/change_act.c
@@ -28,40 +28,36 @@
/* action routines for output window
*/
-#include <assert.h>
-
#include "config.h"
#include "conf_core.h"
#include "data.h"
#include "funchash_core.h"
+#include "board.h"
#include "action_helper.h"
#include "hid_actions.h"
#include "change.h"
#include "draw.h"
#include "search.h"
-#include "misc.h"
-#include "set.h"
-#include "error.h"
#include "undo.h"
-#include "rubberband.h"
-#include "misc_util.h"
+#include "event.h"
#include "compat_misc.h"
-#include "layer.h"
+#include "compat_nls.h"
+#include "obj_rat_draw.h"
static void ChangeFlag(const char *, const char *, int, const char *);
-static int ActionChangeSize(int argc, const char **argv, Coord x, Coord y);
-static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y);
+static int pcb_act_ChangeSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
+static int pcb_act_Change2ndSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
/* --------------------------------------------------------------------------- */
-static const char changeclearsize_syntax[] =
+static const char pcb_acts_ChangeClearSize[] =
"ChangeClearSize(Object, delta|style)\n"
"ChangeClearSize(SelectedPins|SelectedPads|SelectedVias, delta|style)\n"
"ChangeClearSize(SelectedLines|SelectedArcs, delta|style)\n" "ChangeClearSize(Selected|SelectedObjects, delta|style)";
-static const char changeclearsize_help[] = "Changes the clearance size of objects.";
+static const char pcb_acth_ChangeClearSize[] = "Changes the clearance size of objects.";
/* %start-doc actions ChangeClearSize
@@ -71,66 +67,66 @@ changes the polygon clearance.
%end-doc */
-static int ActionChangeClearSize(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeClearSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *delta = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *delta = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
pcb_bool absolute;
- Coord value;
+ pcb_coord_t value;
int type = PCB_TYPE_NONE;
void *ptr1, *ptr2, *ptr3;
if (function && delta) {
- int funcid = funchash_get(function, NULL);
+ int funcid = pcb_funchash_get(function, NULL);
if (funcid == F_Object) {
- gui->get_coords(_("Select an Object"), &x, &y);
- type = SearchScreen(x, y, CHANGECLEARSIZE_TYPES, &ptr1, &ptr2, &ptr3);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ type = pcb_search_screen(x, y, PCB_CHANGECLEARSIZE_TYPES, &ptr1, &ptr2, &ptr3);
}
if (strcmp(argv[1], "style") == 0) {
- if ((type == PCB_TYPE_NONE) || (type == PCB_TYPE_POLYGON)) /* workaround: SearchScreen(CHANGECLEARSIZE_TYPES) wouldn't return elements */
- type = SearchScreen(x, y, CHANGE2NDSIZE_TYPES, &ptr1, &ptr2, &ptr3);
- if (get_style_size(funcid, &value, type, 2) != 0)
+ if ((type == PCB_TYPE_NONE) || (type == PCB_TYPE_POLYGON)) /* workaround: pcb_search_screen(PCB_CHANGECLEARSIZE_TYPES) wouldn't return elements */
+ type = pcb_search_screen(x, y, PCB_CHANGE2NDSIZE_TYPES, &ptr1, &ptr2, &ptr3);
+ if (pcb_get_style_size(funcid, &value, type, 2) != 0)
return 1;
absolute = 1;
value *= 2;
}
else
- value = 2 * GetValue(delta, units, &absolute, NULL);
- switch (funchash_get(function, NULL)) {
+ value = 2 * pcb_get_value(delta, units, &absolute, NULL);
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
{
if (type != PCB_TYPE_NONE)
- if (ChangeObjectClearSize(type, ptr1, ptr2, ptr3, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_clear_size(type, ptr1, ptr2, ptr3, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedVias:
- if (ChangeSelectedClearSize(PCB_TYPE_VIA, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_clear_size(PCB_TYPE_VIA, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPads:
- if (ChangeSelectedClearSize(PCB_TYPE_PAD, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_clear_size(PCB_TYPE_PAD, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ChangeSelectedClearSize(PCB_TYPE_PIN, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_clear_size(PCB_TYPE_PIN, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedLines:
- if (ChangeSelectedClearSize(PCB_TYPE_LINE, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_clear_size(PCB_TYPE_LINE, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedArcs:
- if (ChangeSelectedClearSize(PCB_TYPE_ARC, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_clear_size(PCB_TYPE_ARC, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedClearSize(CHANGECLEARSIZE_TYPES, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_clear_size(PCB_CHANGECLEARSIZE_TYPES, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -139,13 +135,13 @@ static int ActionChangeClearSize(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changeflag_syntax[] =
+static const char pcb_acts_ChangeFlag[] =
"ChangeFlag(Object|Selected|SelectedObjects, flag, value)\n"
"ChangeFlag(SelectedLines|SelectedPins|SelectedVias, flag, value)\n"
"ChangeFlag(SelectedPads|SelectedTexts|SelectedNames, flag, value)\n"
"ChangeFlag(SelectedElements, flag, value)\n" "flag = square | octagon | thermal | join\n" "value = 0 | 1";
-static const char changeflag_help[] = "Sets or clears flags on objects.";
+static const char pcb_acth_ChangeFlag[] = "Sets or clears flags on objects.";
/* %start-doc actions ChangeFlag
@@ -156,13 +152,13 @@ cleared. If the value is 1, the flag is set.
%end-doc */
-static int ActionChangeFlag(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeFlag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *flag = ACTION_ARG(1);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *flag = PCB_ACTION_ARG(1);
int value = argc > 2 ? atoi(argv[2]) : -1;
if (value != 0 && value != 1)
- AFAIL(changeflag);
+ PCB_ACT_FAIL(ChangeFlag);
ChangeFlag(function, flag, value, "ChangeFlag");
return 0;
@@ -175,78 +171,78 @@ static void ChangeFlag(const char *what, const char *flag_name, int value,
pcb_bool(*set_object) (int, void *, void *, void *);
pcb_bool(*set_selected) (int);
- if (NSTRCMP(flag_name, "square") == 0) {
- set_object = value ? SetObjectSquare : ClrObjectSquare;
- set_selected = value ? SetSelectedSquare : ClrSelectedSquare;
+ if (PCB_NSTRCMP(flag_name, "square") == 0) {
+ set_object = value ? pcb_set_obj_square : pcb_clr_obj_square;
+ set_selected = value ? pcb_set_selected_square : pcb_clr_selected_square;
}
- else if (NSTRCMP(flag_name, "octagon") == 0) {
- set_object = value ? SetObjectOctagon : ClrObjectOctagon;
- set_selected = value ? SetSelectedOctagon : ClrSelectedOctagon;
+ else if (PCB_NSTRCMP(flag_name, "octagon") == 0) {
+ set_object = value ? pcb_set_obj_octagon : pcb_clr_obj_octagon;
+ set_selected = value ? pcb_set_selected_octagon : pcb_clr_selected_octagon;
}
- else if (NSTRCMP(flag_name, "join") == 0) {
+ else if (PCB_NSTRCMP(flag_name, "join") == 0) {
/* Note: these are backwards, because the flag is "clear" but
the command is "join". */
- set_object = value ? ClrObjectJoin : SetObjectJoin;
- set_selected = value ? ClrSelectedJoin : SetSelectedJoin;
+ set_object = value ? pcb_clr_obj_join : pcb_set_obj_join;
+ set_selected = value ? pcb_clr_selected_join : pcb_set_selected_join;
}
else {
- Message(PCB_MSG_DEFAULT, _("%s(): Flag \"%s\" is not valid\n"), cmd_name, flag_name);
+ pcb_message(PCB_MSG_ERROR, _("%s(): Flag \"%s\" is not valid\n"), cmd_name, flag_name);
return;
}
- switch (funchash_get(what, NULL)) {
+ switch (pcb_funchash_get(what, NULL)) {
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- if ((type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2))
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
+ if ((type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *) ptr2))
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
if (set_object(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedVias:
if (set_selected(PCB_TYPE_VIA))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
if (set_selected(PCB_TYPE_PIN))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPads:
if (set_selected(PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedLines:
if (set_selected(PCB_TYPE_LINE))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedTexts:
if (set_selected(PCB_TYPE_TEXT))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedNames:
if (set_selected(PCB_TYPE_ELEMENT_NAME))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedElements:
if (set_selected(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (set_selected(CHANGESIZE_TYPES))
- SetChangedFlag(pcb_true);
+ if (set_selected(PCB_CHANGESIZE_TYPES))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -264,27 +260,27 @@ plated-through hole (not set), or an unplated hole (set).
%end-doc */
-static int ActionChangeHole(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeHole(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && ChangeHole((PinTypePtr) ptr3))
- IncrementUndoSerialNumber();
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && pcb_pin_change_hole((pcb_pin_t *) ptr3))
+ pcb_undo_inc_serial();
break;
}
case F_SelectedVias:
case F_Selected:
- if (ChangeSelectedHole())
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_hole())
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -293,9 +289,9 @@ static int ActionChangeHole(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changepaste_syntax[] = "ChangePaste(ToggleObject|Object|SelectedPads|Selected)";
+static const char pcb_acts_ChangePaste[] = "ChangePaste(ToggleObject|Object|SelectedPads|Selected)";
-static const char changepaste_help[] = "Changes the no paste flag of objects.";
+static const char pcb_acth_ChangePaste[] = "Changes the no paste flag of objects.";
/* %start-doc actions ChangePaste
@@ -306,27 +302,27 @@ The "no paste flag" of a pad determines whether the solderpaste
%end-doc */
-static int ActionChangePaste(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangePaste(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && ChangePaste((PadTypePtr) ptr3))
- IncrementUndoSerialNumber();
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && pcb_pad_change_paste((pcb_pad_t *) ptr3))
+ pcb_undo_inc_serial();
break;
}
case F_SelectedPads:
case F_Selected:
- if (ChangeSelectedPaste())
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_paste())
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -336,43 +332,43 @@ static int ActionChangePaste(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changesizes_syntax[] =
+static const char pcb_acts_ChangeSizes[] =
"ChangeSizes(Object, delta|style)\n"
"ChangeSizes(SelectedObjects|Selected, delta|style)\n"
"ChangeSizes(SelectedLines|SelectedPins|SelectedVias, delta|style)\n"
"ChangeSizes(SelectedPads|SelectedTexts|SelectedNames, delta|style)\n" "ChangeSizes(SelectedElements, delta|style)";
-static const char changesizes_help[] = "Changes all sizes of objects.";
+static const char pcb_acth_ChangeSizes[] = "Changes all sizes of objects.";
/* %start-doc actions ChangeSize
-Call ActionChangeSize, ActionChangeDrillSize and ActionChangeClearSize
+Call pcb_act_ChangeSize, ActionChangeDrillSize and pcb_act_ChangeClearSize
with the same arguments. If any of them did not fail, return success.
%end-doc */
-static int ActionChangeSizes(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeSizes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int a, b, c;
- SaveUndoSerialNumber();
- a = ActionChangeSize(argc, argv, x, y);
- RestoreUndoSerialNumber();
- b = ActionChange2ndSize(argc, argv, x, y);
- RestoreUndoSerialNumber();
- c = ActionChangeClearSize(argc, argv, x, y);
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
+ pcb_undo_save_serial();
+ a = pcb_act_ChangeSize(argc, argv, x, y);
+ pcb_undo_restore_serial();
+ b = pcb_act_Change2ndSize(argc, argv, x, y);
+ pcb_undo_restore_serial();
+ c = pcb_act_ChangeClearSize(argc, argv, x, y);
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
return !(!a || !b || !c);
}
/* --------------------------------------------------------------------------- */
-static const char changesize_syntax[] =
+static const char pcb_acts_ChangeSize[] =
"ChangeSize(Object, delta|style)\n"
"ChangeSize(SelectedObjects|Selected, delta|style)\n"
"ChangeSize(SelectedLines|SelectedPins|SelectedVias, delta|style)\n"
"ChangeSize(SelectedPads|SelectedTexts|SelectedNames, delta|style)\n" "ChangeSize(SelectedElements, delta|style)";
-static const char changesize_help[] = "Changes the size of objects.";
+static const char pcb_acth_ChangeSize[] = "Changes the size of objects.";
/* %start-doc actions ChangeSize
@@ -384,91 +380,91 @@ of the silk layer lines and arcs for this element.
%end-doc */
-static int ActionChangeSize(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *delta = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *delta = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
pcb_bool absolute; /* indicates if absolute size is given */
- Coord value;
+ pcb_coord_t value;
int type = PCB_TYPE_NONE, tostyle = 0;
void *ptr1, *ptr2, *ptr3;
if (function && delta) {
- int funcid = funchash_get(function, NULL);
+ int funcid = pcb_funchash_get(function, NULL);
if (funcid == F_Object)
- type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3);
if (strcmp(argv[1], "style") == 0) {
- if (get_style_size(funcid, &value, type, 0) != 0)
+ if (pcb_get_style_size(funcid, &value, type, 0) != 0)
return 1;
absolute = 1;
tostyle = 1;
}
else
- value = GetValue(delta, units, &absolute, NULL);
+ value = pcb_get_value(delta, units, &absolute, NULL);
switch (funcid) {
case F_Object:
{
if (type != PCB_TYPE_NONE)
- if (TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2))
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *) ptr2))
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
if (tostyle) {
- if (ChangeObject1stSize(type, ptr1, ptr2, ptr3, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_1st_size(type, ptr1, ptr2, ptr3, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
}
else {
- if (ChangeObjectSize(type, ptr1, ptr2, ptr3, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_size(type, ptr1, ptr2, ptr3, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
}
break;
}
case F_SelectedVias:
- if (ChangeSelectedSize(PCB_TYPE_VIA, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_VIA, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ChangeSelectedSize(PCB_TYPE_PIN, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_PIN, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPads:
- if (ChangeSelectedSize(PCB_TYPE_PAD, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_PAD, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedArcs:
- if (ChangeSelectedSize(PCB_TYPE_ARC, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_ARC, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedLines:
- if (ChangeSelectedSize(PCB_TYPE_LINE, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_LINE, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedTexts:
- if (ChangeSelectedSize(PCB_TYPE_TEXT, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_TEXT, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedNames:
- if (ChangeSelectedSize(PCB_TYPE_ELEMENT_NAME, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_ELEMENT_NAME, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedElements:
- if (ChangeSelectedSize(PCB_TYPE_ELEMENT, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_TYPE_ELEMENT, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedSize(CHANGESIZE_TYPES, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_size(PCB_CHANGESIZE_TYPES, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -486,56 +482,56 @@ static const char changedrillsize_help[] = "Changes the drilling hole size of ob
%end-doc */
-static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Change2ndSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *delta = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *delta = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
int type = PCB_TYPE_NONE;
void *ptr1, *ptr2, *ptr3;
pcb_bool absolute;
- Coord value;
+ pcb_coord_t value;
if (function && delta) {
- int funcid = funchash_get(function, NULL);
+ int funcid = pcb_funchash_get(function, NULL);
if (funcid == F_Object) {
- gui->get_coords(_("Select an Object"), &x, &y);
- type = SearchScreen(x, y, CHANGE2NDSIZE_TYPES, &ptr1, &ptr2, &ptr3);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ type = pcb_search_screen(x, y, PCB_CHANGE2NDSIZE_TYPES, &ptr1, &ptr2, &ptr3);
}
if (strcmp(argv[1], "style") == 0) {
- if (get_style_size(funcid, &value, type, 1) != 0)
+ if (pcb_get_style_size(funcid, &value, type, 1) != 0)
return 1;
absolute = 1;
}
else
- value = GetValue(delta, units, &absolute, NULL);
+ value = pcb_get_value(delta, units, &absolute, NULL);
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
{
if (type != PCB_TYPE_NONE)
- if (ChangeObject2ndSize(type, ptr1, ptr2, ptr3, value, absolute, pcb_true))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_2nd_size(type, ptr1, ptr2, ptr3, value, absolute, pcb_true))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedVias:
- if (ChangeSelected2ndSize(PCB_TYPE_VIA, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_2nd_size(PCB_TYPE_VIA, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ChangeSelected2ndSize(PCB_TYPE_PIN, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_2nd_size(PCB_TYPE_PIN, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelected2ndSize(PCB_TYPEMASK_PIN, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_2nd_size(PCB_TYPEMASK_PIN, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -544,9 +540,9 @@ static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changepinname_syntax[] = "ChangePinName(ElementName,PinNumber,PinName)";
+static const char pcb_acts_ChangePinName[] = "ChangePinName(ElementName,PinNumber,PinName)";
-static const char changepinname_help[] = "Sets the name of a specific pin on a specific element.";
+static const char pcb_acth_ChangePinName[] = "Sets the name of a specific pin on a specific element.";
/* %start-doc actions ChangePinName
@@ -560,54 +556,54 @@ ChangePinName(U3, 7, VCC)
%end-doc */
-static int ActionChangePinName(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangePinName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int changed = 0;
const char *refdes, *pinnum, *pinname;
if (argc != 3) {
- AFAIL(changepinname);
+ PCB_ACT_FAIL(ChangePinName);
}
refdes = argv[0];
pinnum = argv[1];
pinname = argv[2];
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (NSTRCMP(refdes, NAMEONPCB_NAME(element)) == 0) {
- PIN_LOOP(element);
+ if (PCB_NSTRCMP(refdes, PCB_ELEM_NAME_REFDES(element)) == 0) {
+ PCB_PIN_LOOP(element);
{
- if (NSTRCMP(pinnum, pin->Number) == 0) {
- AddObjectToChangeNameUndoList(PCB_TYPE_PIN, NULL, NULL, pin, pin->Name);
+ if (PCB_NSTRCMP(pinnum, pin->Number) == 0) {
+ pcb_undo_add_obj_to_change_name(PCB_TYPE_PIN, NULL, NULL, pin, pin->Name);
/*
* Note: we can't free() pin->Name first because
* it is used in the undo list
*/
pin->Name = pcb_strdup(pinname);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
changed = 1;
}
}
- END_LOOP;
+ PCB_END_LOOP;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
- if (NSTRCMP(pinnum, pad->Number) == 0) {
- AddObjectToChangeNameUndoList(PCB_TYPE_PAD, NULL, NULL, pad, pad->Name);
+ if (PCB_NSTRCMP(pinnum, pad->Number) == 0) {
+ pcb_undo_add_obj_to_change_name(PCB_TYPE_PAD, NULL, NULL, pad, pad->Name);
/*
* Note: we can't free() pad->Name first because
* it is used in the undo list
*/
pad->Name = pcb_strdup(pinname);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
changed = 1;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- END_LOOP;
+ PCB_END_LOOP;
/*
* done with our action so increment the undo # if we actually
* changed anything
@@ -616,8 +612,8 @@ static int ActionChangePinName(int argc, const char **argv, Coord x, Coord y)
if (defer_updates)
defer_needs_update = 1;
else {
- IncrementUndoSerialNumber();
- gui->invalidate_all();
+ pcb_undo_inc_serial();
+ pcb_gui->invalidate_all();
}
}
@@ -626,9 +622,9 @@ static int ActionChangePinName(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changename_syntax[] = "ChangeName(Object)\n" "ChangeName(Object|\"Number\")\n" "ChangeName(Layout|Layer)";
+static const char pcb_acts_ChangeName[] = "ChangeName(Object)\n" "ChangeName(Object|\"Number\")\n" "ChangeName(Layout|Layer)";
-static const char changename_help[] = "Sets the name (or pin number) of objects.";
+static const char pcb_acth_ChangeName[] = "Sets the name (or pin number) of objects.";
/* %start-doc actions ChangeName
@@ -647,46 +643,31 @@ Changes the name of the currently active layer.
%end-doc */
-int ActionChangeName(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_ChangeName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *pinnums = ACTION_ARG(1);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *pinnums = PCB_ACTION_ARG(1);
char *name;
int pinnum;
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
/* change the name of an object */
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, CHANGENAME_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
- SaveUndoSerialNumber();
- if ((pinnums != NULL) && (strcasecmp(pinnums, "Number") == 0))
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_CHANGENAME_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
+ pcb_undo_save_serial();
+ if ((pinnums != NULL) && (pcb_strcasecmp(pinnums, "Number") == 0))
pinnum = 1;
else
pinnum = 0;
- if (QueryInputAndChangeObjectName(type, ptr1, ptr2, ptr3, pinnum)) {
- SetChangedFlag(pcb_true);
- if (type == PCB_TYPE_ELEMENT) {
- RubberbandTypePtr ptr;
- int i;
-
- RestoreUndoSerialNumber();
- Crosshair.AttachedObject.RubberbandN = 0;
- LookupRatLines(type, ptr1, ptr2, ptr3);
- ptr = Crosshair.AttachedObject.Rubberband;
- for (i = 0; i < Crosshair.AttachedObject.RubberbandN; i++, ptr++) {
- if (PCB->RatOn)
- EraseRat((RatTypePtr) ptr->Line);
- MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, ptr->Line, ptr->Line, ptr->Line);
- }
- IncrementUndoSerialNumber();
- Draw();
- }
+ if (pcb_chg_obj_name_query(type, ptr1, ptr2, ptr3, pinnum)) {
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_event(PCB_EVENT_RUBBER_RENAME, "ipppi", type, ptr1, ptr2, ptr3, pinnum);
}
}
break;
@@ -694,18 +675,20 @@ int ActionChangeName(int argc, const char **argv, Coord x, Coord y)
/* change the layout's name */
case F_Layout:
- name = gui->prompt_for(_("Enter the layout name:"), EMPTY(PCB->Name));
+ name = pcb_gui->prompt_for(_("Enter the layout name:"), PCB_EMPTY(PCB->Name));
/* NB: ChangeLayoutName takes ownership of the passed memory */
- if (name && ChangeLayoutName(name))
- SetChangedFlag(pcb_true);
+ if (name && pcb_board_change_name(name))
+ pcb_board_set_changed_flag(pcb_true);
break;
/* change the name of the active layer */
case F_Layer:
- name = gui->prompt_for(_("Enter the layer name:"), EMPTY(CURRENT->Name));
- /* NB: ChangeLayerName takes ownership of the passed memory */
- if (name && ChangeLayerName(CURRENT, name))
- SetChangedFlag(pcb_true);
+ name = pcb_gui->prompt_for(_("Enter the layer name:"), PCB_EMPTY(CURRENT->Name));
+ /* NB: pcb_layer_rename_ takes ownership of the passed memory */
+ if (name && (pcb_layer_rename_(CURRENT, name) == 0))
+ pcb_board_set_changed_flag(pcb_true);
+ else
+ free(name);
break;
}
}
@@ -714,9 +697,9 @@ int ActionChangeName(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changejoin_syntax[] = "ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected)";
+static const char pcb_acts_ChangeJoin[] = "ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected)";
-static const char changejoin_help[] = "Changes the join (clearance through polygons) of objects.";
+static const char pcb_acth_ChangeJoin[] = "Changes the join (clearance through polygons) of objects.";
/* %start-doc actions ChangeJoin
@@ -728,38 +711,38 @@ polygon, insulating them from each other.
%end-doc */
-static int ActionChangeJoin(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeJoin(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, CHANGEJOIN_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (ChangeObjectJoin(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_CHANGEJOIN_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_chg_obj_join(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedLines:
- if (ChangeSelectedJoin(PCB_TYPE_LINE))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_join(PCB_TYPE_LINE))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedArcs:
- if (ChangeSelectedJoin(PCB_TYPE_ARC))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_join(PCB_TYPE_ARC))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedJoin(CHANGEJOIN_TYPES))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_join(PCB_CHANGEJOIN_TYPES))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -768,10 +751,10 @@ static int ActionChangeJoin(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changenonetlist_syntax[] =
+static const char pcb_acts_ChangeNonetlist[] =
"ChangeNonetlist(ToggleObject)\n" "ChangeNonetlist(SelectedElements)\n" "ChangeNonetlist(Selected|SelectedObjects)";
-static const char changenonetlist_help[] = "Changes the nonetlist flag of elements.";
+static const char pcb_acth_ChangeNonetlist[] = "Changes the nonetlist flag of elements.";
/* %start-doc actions ChangeNonetlist
@@ -781,30 +764,30 @@ Note that @code{Pins} means both pins and pads.
%end-doc */
-static int ActionChangeNonetlist(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeNonetlist(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
case F_Element:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Element"), &x, &y);
+ pcb_gui->get_coords(_("Select an Element"), &x, &y);
ptr3 = NULL;
- type = SearchScreen(x, y, CHANGENONETLIST_TYPES, &ptr1, &ptr2, &ptr3);
- if (ChangeObjectNonetlist(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ type = pcb_search_screen(x, y, PCB_CHANGENONETLIST_TYPES, &ptr1, &ptr2, &ptr3);
+ if (pcb_chg_obj_nonetlist(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedElements:
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedNonetlist(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_nonetlist(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -814,10 +797,10 @@ static int ActionChangeNonetlist(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changesquare_syntax[] =
+static const char pcb_acts_ChangeSquare[] =
"ChangeSquare(ToggleObject)\n" "ChangeSquare(SelectedElements|SelectedPins)\n" "ChangeSquare(Selected|SelectedObjects)";
-static const char changesquare_help[] = "Changes the square flag of pins and pads.";
+static const char pcb_acth_ChangeSquare[] = "Changes the square flag of pins and pads.";
/* %start-doc actions ChangeSquare
@@ -827,48 +810,48 @@ Note that @code{Pins} means both pins and pads.
%end-doc */
-static int ActionChangeSquare(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeSquare(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
ptr3 = NULL;
- type = SearchScreen(x, y, CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(x, y, PCB_CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3);
if (ptr3 != NULL) {
- int qstyle = GET_SQUARE((PinTypePtr) ptr3);
+ int qstyle = PCB_FLAG_SQUARE_GET((pcb_pin_t *) ptr3);
qstyle++;
if (qstyle > 17)
qstyle = 0;
if (type != PCB_TYPE_NONE)
- if (ChangeObjectSquare(type, ptr1, ptr2, ptr3, qstyle))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_square(type, ptr1, ptr2, ptr3, qstyle))
+ pcb_board_set_changed_flag(pcb_true);
}
break;
}
case F_SelectedElements:
- if (ChangeSelectedSquare(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_square(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ChangeSelectedSquare(PCB_TYPE_PIN | PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_square(PCB_TYPE_PIN | PCB_TYPE_PAD))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedSquare(PCB_TYPE_PIN | PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_square(PCB_TYPE_PIN | PCB_TYPE_PAD))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -877,9 +860,9 @@ static int ActionChangeSquare(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char setsquare_syntax[] = "SetSquare(ToggleObject|SelectedElements|SelectedPins)";
+static const char pcb_acts_SetSquare[] = "SetSquare(ToggleObject|SelectedElements|SelectedPins)";
-static const char setsquare_help[] = "sets the square-flag of objects.";
+static const char pcb_acth_SetSquare[] = "sets the square-flag of objects.";
/* %start-doc actions SetSquare
@@ -889,38 +872,38 @@ Note that @code{Pins} means pins and pads.
%end-doc */
-static int ActionSetSquare(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SetSquare(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function && *function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (SetObjectSquare(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_set_obj_square(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedElements:
- if (SetSelectedSquare(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_square(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (SetSelectedSquare(PCB_TYPE_PIN | PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_square(PCB_TYPE_PIN | PCB_TYPE_PAD))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (SetSelectedSquare(PCB_TYPE_PIN | PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_square(PCB_TYPE_PIN | PCB_TYPE_PAD))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -929,9 +912,9 @@ static int ActionSetSquare(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char clearsquare_syntax[] = "ClearSquare(ToggleObject|SelectedElements|SelectedPins)";
+static const char pcb_acts_ClearSquare[] = "ClearSquare(ToggleObject|SelectedElements|SelectedPins)";
-static const char clearsquare_help[] = "Clears the square-flag of pins and pads.";
+static const char pcb_acth_ClearSquare[] = "Clears the square-flag of pins and pads.";
/* %start-doc actions ClearSquare
@@ -941,38 +924,38 @@ Note that @code{Pins} means pins and pads.
%end-doc */
-static int ActionClearSquare(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ClearSquare(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function && *function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (ClrObjectSquare(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_clr_obj_square(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedElements:
- if (ClrSelectedSquare(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_square(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ClrSelectedSquare(PCB_TYPE_PIN | PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_square(PCB_TYPE_PIN | PCB_TYPE_PAD))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ClrSelectedSquare(PCB_TYPE_PIN | PCB_TYPE_PAD))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_square(PCB_TYPE_PIN | PCB_TYPE_PAD))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -981,10 +964,10 @@ static int ActionClearSquare(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changeoctagon_syntax[] =
+static const char pcb_acts_ChangeOctagon[] =
"ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected)\n" "ChangeOctagon(SelectedElements|SelectedPins|SelectedVias)";
-static const char changeoctagon_help[] = "Changes the octagon-flag of pins and vias.";
+static const char pcb_acth_ChangeOctagon[] = "Changes the octagon-flag of pins and vias.";
/* %start-doc actions ChangeOctagon
@@ -992,43 +975,43 @@ static const char changeoctagon_help[] = "Changes the octagon-flag of pins and v
%end-doc */
-static int ActionChangeOctagon(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChangeOctagon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (ChangeObjectOctagon(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_chg_obj_octagon(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedElements:
- if (ChangeSelectedOctagon(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_octagon(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ChangeSelectedOctagon(PCB_TYPE_PIN))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_octagon(PCB_TYPE_PIN))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedVias:
- if (ChangeSelectedOctagon(PCB_TYPE_VIA))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_octagon(PCB_TYPE_VIA))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedOctagon(PCB_TYPEMASK_PIN))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_octagon(PCB_TYPEMASK_PIN))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -1037,9 +1020,9 @@ static int ActionChangeOctagon(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char setoctagon_syntax[] = "SetOctagon(Object|ToggleObject|SelectedElements|Selected)";
+static const char pcb_acts_SetOctagon[] = "SetOctagon(Object|ToggleObject|SelectedElements|Selected)";
-static const char setoctagon_help[] = "Sets the octagon-flag of objects.";
+static const char pcb_acth_SetOctagon[] = "Sets the octagon-flag of objects.";
/* %start-doc actions SetOctagon
@@ -1047,43 +1030,43 @@ static const char setoctagon_help[] = "Sets the octagon-flag of objects.";
%end-doc */
-static int ActionSetOctagon(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SetOctagon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (SetObjectOctagon(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_set_obj_octagon(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedElements:
- if (SetSelectedOctagon(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_octagon(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (SetSelectedOctagon(PCB_TYPE_PIN))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_octagon(PCB_TYPE_PIN))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedVias:
- if (SetSelectedOctagon(PCB_TYPE_VIA))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_octagon(PCB_TYPE_VIA))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (SetSelectedOctagon(PCB_TYPEMASK_PIN))
- SetChangedFlag(pcb_true);
+ if (pcb_set_selected_octagon(PCB_TYPEMASK_PIN))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -1092,10 +1075,10 @@ static int ActionSetOctagon(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char clearoctagon_syntax[] =
+static const char pcb_acts_ClearOctagon[] =
"ClearOctagon(ToggleObject|Object|SelectedObjects|Selected)\n" "ClearOctagon(SelectedElements|SelectedPins|SelectedVias)";
-static const char clearoctagon_help[] = "Clears the octagon-flag of pins and vias.";
+static const char pcb_acth_ClearOctagon[] = "Clears the octagon-flag of pins and vias.";
/* %start-doc actions ClearOctagon
@@ -1103,43 +1086,43 @@ static const char clearoctagon_help[] = "Clears the octagon-flag of pins and via
%end-doc */
-static int ActionClearOctagon(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ClearOctagon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleObject:
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (ClrObjectOctagon(type, ptr1, ptr2, ptr3))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_clr_obj_octagon(type, ptr1, ptr2, ptr3))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedElements:
- if (ClrSelectedOctagon(PCB_TYPE_ELEMENT))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_octagon(PCB_TYPE_ELEMENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedPins:
- if (ClrSelectedOctagon(PCB_TYPE_PIN))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_octagon(PCB_TYPE_PIN))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedVias:
- if (ClrSelectedOctagon(PCB_TYPE_VIA))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_octagon(PCB_TYPE_VIA))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ClrSelectedOctagon(PCB_TYPEMASK_PIN))
- SetChangedFlag(pcb_true);
+ if (pcb_clr_selected_octagon(PCB_TYPEMASK_PIN))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -1148,9 +1131,9 @@ static int ActionClearOctagon(int argc, const char **argv, Coord x, Coord y)
/* -------------------------------------------------------------------------- */
-static const char setthermal_syntax[] = "SetThermal(Object|SelectedPins|SelectedVias|Selected, Style)";
+static const char pcb_acts_SetThermal[] = "SetThermal(Object|SelectedPins|SelectedVias|Selected, Style)";
-static const char setthermal_help[] =
+static const char pcb_acth_SetThermal[] =
"Set the thermal (on the current layer) of pins or vias to the given style.\n"
"Style = 0 means no thermal.\n"
"Style = 1 has diagonal fingers with sharp edges.\n"
@@ -1176,10 +1159,10 @@ Pins and Vias may have thermals whether or not there is a polygon available
to connect with. However, they will have no effect without the polygon.
%end-doc */
-static int ActionSetThermal(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SetThermal(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *style = ACTION_ARG(1);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *style = PCB_ACTION_ARG(1);
void *ptr1, *ptr2, *ptr3;
int type, kind;
int err = 0;
@@ -1187,25 +1170,25 @@ static int ActionSetThermal(int argc, const char **argv, Coord x, Coord y)
if (function && *function && style && *style) {
pcb_bool absolute;
- kind = GetValue(style, NULL, &absolute, NULL);
+ kind = pcb_get_value(style, NULL, &absolute, NULL);
if (absolute)
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
- if ((type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGETHERMAL_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
- ChangeObjectThermal(type, ptr1, ptr2, ptr3, kind);
- IncrementUndoSerialNumber();
- Draw();
+ if ((type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGETHERMAL_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
+ pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, kind);
+ pcb_undo_inc_serial();
+ pcb_draw();
}
break;
case F_SelectedPins:
- ChangeSelectedThermals(PCB_TYPE_PIN, kind);
+ pcb_chg_selected_thermals(PCB_TYPE_PIN, kind);
break;
case F_SelectedVias:
- ChangeSelectedThermals(PCB_TYPE_VIA, kind);
+ pcb_chg_selected_thermals(PCB_TYPE_VIA, kind);
break;
case F_Selected:
case F_SelectedElements:
- ChangeSelectedThermals(CHANGETHERMAL_TYPES, kind);
+ pcb_chg_selected_thermals(PCB_CHANGETHERMAL_TYPES, kind);
break;
default:
err = 1;
@@ -1217,19 +1200,19 @@ static int ActionSetThermal(int argc, const char **argv, Coord x, Coord y)
return 0;
}
- AFAIL(setthermal);
+ PCB_ACT_FAIL(SetThermal);
}
/* --------------------------------------------------------------------------- */
-static const char setflag_syntax[] =
+static const char pcb_acts_SetFlag[] =
"SetFlag(Object|Selected|SelectedObjects, flag)\n"
"SetFlag(SelectedLines|SelectedPins|SelectedVias, flag)\n"
"SetFlag(SelectedPads|SelectedTexts|SelectedNames, flag)\n"
"SetFlag(SelectedElements, flag)\n" "flag = square | octagon | thermal | join";
-static const char setflag_help[] = "Sets flags on objects.";
+static const char pcb_acth_SetFlag[] = "Sets flags on objects.";
/* %start-doc actions SetFlag
@@ -1242,23 +1225,23 @@ SetFlag(SelectedPins,thermal)
%end-doc */
-static int ActionSetFlag(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SetFlag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *flag = ACTION_ARG(1);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *flag = PCB_ACTION_ARG(1);
ChangeFlag(function, flag, 1, "SetFlag");
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char clrflag_syntax[] =
+static const char pcb_acts_ClrFlag[] =
"ClrFlag(Object|Selected|SelectedObjects, flag)\n"
"ClrFlag(SelectedLines|SelectedPins|SelectedVias, flag)\n"
"ClrFlag(SelectedPads|SelectedTexts|SelectedNames, flag)\n"
"ClrFlag(SelectedElements, flag)\n" "flag = square | octagon | thermal | join";
-static const char clrflag_help[] = "Clears flags on objects.";
+static const char pcb_acth_ClrFlag[] = "Clears flags on objects.";
/* %start-doc actions ClrFlag
@@ -1271,19 +1254,19 @@ ClrFlag(SelectedLines,join)
%end-doc */
-static int ActionClrFlag(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ClrFlag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *flag = ACTION_ARG(1);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *flag = PCB_ACTION_ARG(1);
ChangeFlag(function, flag, 0, "ClrFlag");
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char setvalue_syntax[] = "SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, delta)";
+static const char pcb_acts_SetValue[] = "SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, delta)";
-static const char setvalue_help[] = "Change various board-wide values and sizes.";
+static const char pcb_acth_SetValue[] = "Change various board-wide values and sizes.";
/* %start-doc actions SetValue
@@ -1311,54 +1294,54 @@ Changes the size of new text.
%end-doc */
-static int ActionSetValue(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SetValue(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *val = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *val = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
pcb_bool absolute; /* flag for 'absolute' value */
double value;
int err = 0;
if (function && val) {
- value = GetValue(val, units, &absolute, NULL);
- switch (funchash_get(function, NULL)) {
+ value = pcb_get_value(val, units, &absolute, NULL);
+ switch (pcb_funchash_get(function, NULL)) {
case F_ViaDrillingHole:
- SetViaDrillingHole(absolute ? value : value + conf_core.design.via_drilling_hole, pcb_false);
- hid_action("RouteStylesChanged");
+ pcb_board_set_via_drilling_hole(absolute ? value : value + conf_core.design.via_drilling_hole, pcb_false);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
break;
case F_Grid:
if (absolute)
- SetGrid(value, pcb_false);
+ pcb_board_set_grid(value, pcb_false);
else {
/* On the way down, short against the minimum
* PCB drawing unit */
if ((value + PCB->Grid) < 1)
- SetGrid(1, pcb_false);
+ pcb_board_set_grid(1, pcb_false);
else if (PCB->Grid == 1)
- SetGrid(value, pcb_false);
+ pcb_board_set_grid(value, pcb_false);
else
- SetGrid(value + PCB->Grid, pcb_false);
+ pcb_board_set_grid(value + PCB->Grid, pcb_false);
}
break;
case F_LineSize:
case F_Line:
- SetLineSize(absolute ? value : value + conf_core.design.line_thickness);
- hid_action("RouteStylesChanged");
+ pcb_board_set_line_width(absolute ? value : value + conf_core.design.line_thickness);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
break;
case F_Via:
case F_ViaSize:
- SetViaSize(absolute ? value : value + conf_core.design.via_thickness, pcb_false);
- hid_action("RouteStylesChanged");
+ pcb_board_set_via_size(absolute ? value : value + conf_core.design.via_thickness, pcb_false);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
break;
case F_Text:
case F_TextScale:
value /= 45;
- SetTextScale(absolute ? value : value + conf_core.design.text_scale);
+ pcb_board_set_text_scale(absolute ? value : value + conf_core.design.text_scale);
break;
default:
err = 1;
@@ -1368,46 +1351,46 @@ static int ActionSetValue(int argc, const char **argv, Coord x, Coord y)
return 0;
}
- AFAIL(setvalue);
+ PCB_ACT_FAIL(SetValue);
}
/* --------------------------------------------------------------------------- */
-static const char changeangle_syntax[] =
+static const char pcb_acts_ChangeAngle[] =
"ChangeAngle(Object, start|delta|both, delta)\n"
"ChangeAngle(SelectedObjects|Selected, start|delta|both, delta)\n"
"ChangeAngle(SelectedArcs, start|delta|both, delta)\n";
-static const char changeangle_help[] = "Changes the start angle, delta angle or both angles of an arc.";
-static int ActionChangeAngle(int argc, const char **argv, Coord x, Coord y)
+static const char pcb_acth_ChangeAngle[] = "Changes the start angle, delta angle or both angles of an arc.";
+static int pcb_act_ChangeAngle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *prim = ACTION_ARG(1);
- const char *delta = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *prim = PCB_ACTION_ARG(1);
+ const char *delta = PCB_ACTION_ARG(2);
pcb_bool absolute; /* indicates if absolute size is given */
double value;
int type = PCB_TYPE_NONE, which;
void *ptr1, *ptr2, *ptr3;
- if (strcasecmp(prim, "start") == 0) which = 0;
- else if (strcasecmp(prim, "delta") == 0) which = 1;
- else if (strcasecmp(prim, "both") == 0) which = 2;
+ if (pcb_strcasecmp(prim, "start") == 0) which = 0;
+ else if (pcb_strcasecmp(prim, "delta") == 0) which = 1;
+ else if (pcb_strcasecmp(prim, "both") == 0) which = 2;
else {
- Message(PCB_MSG_ERROR, "Second argument of ChangeAngle must be start, delta or both\n");
+ pcb_message(PCB_MSG_ERROR, "Second argument of ChangeAngle must be start, delta or both\n");
return -1;
}
if (function && delta) {
- int funcid = funchash_get(function, NULL);
+ int funcid = pcb_funchash_get(function, NULL);
if (funcid == F_Object)
- type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3);
{ /* convert angle from string */
char *end;
while(isspace(*delta)) delta++;
value = strtod(delta, &end);
if (*end != '\0') {
- Message(PCB_MSG_ERROR, "Invalid numeric (in angle)\n");
+ pcb_message(PCB_MSG_ERROR, "Invalid numeric (in angle)\n");
return -1;
}
absolute = ((*delta != '-') && (*delta != '+'));
@@ -1417,25 +1400,25 @@ static int ActionChangeAngle(int argc, const char **argv, Coord x, Coord y)
case F_Object:
{
if (type != PCB_TYPE_NONE) {
- if (TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2))
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *) ptr2))
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
else {
- if (ChangeObjectAngle(type, ptr1, ptr2, ptr3, which, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_angle(type, ptr1, ptr2, ptr3, which, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
}
}
break;
}
case F_SelectedArcs:
- if (ChangeSelectedAngle(PCB_TYPE_ARC, which, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_angle(PCB_TYPE_ARC, which, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedAngle(CHANGESIZE_TYPES, which, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_angle(PCB_CHANGESIZE_TYPES, which, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -1444,61 +1427,61 @@ static int ActionChangeAngle(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char changeradius_syntax[] =
+static const char pcb_acts_ChangeRadius[] =
"ChangeRadius(Object, width|x|height|y|both, delta)\n"
"ChangeRadius(SelectedObjects|Selected, width|x|height|y|both, delta)\n"
"ChangeRadius(SelectedArcs, width|x|height|y|both, delta)\n";
-static const char changeradius_help[] = "Changes the width or height (radius) of an arc.";
-static int ActionChangeRadius(int argc, const char **argv, Coord x, Coord y)
+static const char pcb_acth_ChangeRadius[] = "Changes the width or height (radius) of an arc.";
+static int pcb_act_ChangeRadius(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *prim = ACTION_ARG(1);
- const char *delta = ACTION_ARG(2);
- const char *units = ACTION_ARG(3);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *prim = PCB_ACTION_ARG(1);
+ const char *delta = PCB_ACTION_ARG(2);
+ const char *units = PCB_ACTION_ARG(3);
pcb_bool absolute; /* indicates if absolute size is given */
double value;
int type = PCB_TYPE_NONE, which;
void *ptr1, *ptr2, *ptr3;
- if ((strcasecmp(prim, "width") == 0) || (strcasecmp(prim, "x") == 0)) which = 0;
- else if ((strcasecmp(prim, "height") == 0) || (strcasecmp(prim, "y") == 0)) which = 1;
- else if (strcasecmp(prim, "both") == 0) which = 2;
+ if ((pcb_strcasecmp(prim, "width") == 0) || (pcb_strcasecmp(prim, "x") == 0)) which = 0;
+ else if ((pcb_strcasecmp(prim, "height") == 0) || (pcb_strcasecmp(prim, "y") == 0)) which = 1;
+ else if (pcb_strcasecmp(prim, "both") == 0) which = 2;
else {
- Message(PCB_MSG_ERROR, "Second argument of ChangeRadius must be width, x, height, y or both\n");
+ pcb_message(PCB_MSG_ERROR, "Second argument of ChangeRadius must be width, x, height, y or both\n");
return -1;
}
if (function && delta) {
- int funcid = funchash_get(function, NULL);
+ int funcid = pcb_funchash_get(function, NULL);
if (funcid == F_Object)
- type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3);
- value = GetValue(delta, units, &absolute, NULL);
+ value = pcb_get_value(delta, units, &absolute, NULL);
switch (funcid) {
case F_Object:
{
if (type != PCB_TYPE_NONE) {
- if (TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2))
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *) ptr2))
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
else {
- if (ChangeObjectRadius(type, ptr1, ptr2, ptr3, which, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_obj_radius(type, ptr1, ptr2, ptr3, which, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
}
}
break;
}
case F_SelectedArcs:
- if (ChangeSelectedRadius(PCB_TYPE_ARC, which, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_radius(PCB_TYPE_ARC, which, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedRadius(CHANGESIZE_TYPES, which, value, absolute))
- SetChangedFlag(pcb_true);
+ if (pcb_chg_selected_radius(PCB_CHANGESIZE_TYPES, which, value, absolute))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -1508,75 +1491,75 @@ static int ActionChangeRadius(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-HID_Action change_action_list[] = {
- {"ChangeAngle", 0, ActionChangeAngle,
- changeangle_help, changeangle_syntax}
+pcb_hid_action_t change_action_list[] = {
+ {"ChangeAngle", 0, pcb_act_ChangeAngle,
+ pcb_acth_ChangeAngle, pcb_acts_ChangeAngle}
,
- {"ChangeClearSize", 0, ActionChangeClearSize,
- changeclearsize_help, changeclearsize_syntax}
+ {"ChangeClearSize", 0, pcb_act_ChangeClearSize,
+ pcb_acth_ChangeClearSize, pcb_acts_ChangeClearSize}
,
- {"ChangeDrillSize", 0, ActionChange2ndSize,
+ {"ChangeDrillSize", 0, pcb_act_Change2ndSize,
changedrillsize_help, changedrillsize_syntax}
,
- {"ChangeHole", 0, ActionChangeHole,
+ {"ChangeHole", 0, pcb_act_ChangeHole,
changehold_help, changehold_syntax}
,
- {"ChangeJoin", 0, ActionChangeJoin,
- changejoin_help, changejoin_syntax}
+ {"ChangeJoin", 0, pcb_act_ChangeJoin,
+ pcb_acth_ChangeJoin, pcb_acts_ChangeJoin}
,
- {"ChangeName", 0, ActionChangeName,
- changename_help, changename_syntax}
+ {"ChangeName", 0, pcb_act_ChangeName,
+ pcb_acth_ChangeName, pcb_acts_ChangeName}
,
- {"ChangePaste", 0, ActionChangePaste,
- changepaste_help, changepaste_syntax}
+ {"ChangePaste", 0, pcb_act_ChangePaste,
+ pcb_acth_ChangePaste, pcb_acts_ChangePaste}
,
- {"ChangePinName", 0, ActionChangePinName,
- changepinname_help, changepinname_syntax}
+ {"ChangePinName", 0, pcb_act_ChangePinName,
+ pcb_acth_ChangePinName, pcb_acts_ChangePinName}
,
- {"ChangeRadius", 0, ActionChangeRadius,
- changeradius_help, changeradius_syntax}
+ {"ChangeRadius", 0, pcb_act_ChangeRadius,
+ pcb_acth_ChangeRadius, pcb_acts_ChangeRadius}
,
- {"ChangeSize", 0, ActionChangeSize,
- changesize_help, changesize_syntax}
+ {"ChangeSize", 0, pcb_act_ChangeSize,
+ pcb_acth_ChangeSize, pcb_acts_ChangeSize}
,
- {"ChangeSizes", 0, ActionChangeSizes,
- changesizes_help, changesizes_syntax}
+ {"ChangeSizes", 0, pcb_act_ChangeSizes,
+ pcb_acth_ChangeSizes, pcb_acts_ChangeSizes}
,
- {"ChangeNonetlist", 0, ActionChangeNonetlist,
- changenonetlist_help, changenonetlist_syntax}
+ {"ChangeNonetlist", 0, pcb_act_ChangeNonetlist,
+ pcb_acth_ChangeNonetlist, pcb_acts_ChangeNonetlist}
,
- {"ChangeSquare", 0, ActionChangeSquare,
- changesquare_help, changesquare_syntax}
+ {"ChangeSquare", 0, pcb_act_ChangeSquare,
+ pcb_acth_ChangeSquare, pcb_acts_ChangeSquare}
,
- {"ChangeOctagon", 0, ActionChangeOctagon,
- changeoctagon_help, changeoctagon_syntax}
+ {"ChangeOctagon", 0, pcb_act_ChangeOctagon,
+ pcb_acth_ChangeOctagon, pcb_acts_ChangeOctagon}
,
- {"ChangeFlag", 0, ActionChangeFlag,
- changeflag_help, changeflag_syntax}
+ {"ChangeFlag", 0, pcb_act_ChangeFlag,
+ pcb_acth_ChangeFlag, pcb_acts_ChangeFlag}
,
- {"ClearSquare", 0, ActionClearSquare,
- clearsquare_help, clearsquare_syntax}
+ {"ClearSquare", 0, pcb_act_ClearSquare,
+ pcb_acth_ClearSquare, pcb_acts_ClearSquare}
,
- {"ClearOctagon", 0, ActionClearOctagon,
- clearoctagon_help, clearoctagon_syntax}
+ {"ClearOctagon", 0, pcb_act_ClearOctagon,
+ pcb_acth_ClearOctagon, pcb_acts_ClearOctagon}
,
- {"SetSquare", 0, ActionSetSquare,
- setsquare_help, setsquare_syntax}
+ {"SetSquare", 0, pcb_act_SetSquare,
+ pcb_acth_SetSquare, pcb_acts_SetSquare}
,
- {"SetOctagon", 0, ActionSetOctagon,
- setoctagon_help, setoctagon_syntax}
+ {"SetOctagon", 0, pcb_act_SetOctagon,
+ pcb_acth_SetOctagon, pcb_acts_SetOctagon}
,
- {"SetThermal", 0, ActionSetThermal,
- setthermal_help, setthermal_syntax}
+ {"SetThermal", 0, pcb_act_SetThermal,
+ pcb_acth_SetThermal, pcb_acts_SetThermal}
,
- {"SetValue", 0, ActionSetValue,
- setvalue_help, setvalue_syntax}
+ {"SetValue", 0, pcb_act_SetValue,
+ pcb_acth_SetValue, pcb_acts_SetValue}
,
- {"SetFlag", 0, ActionSetFlag,
- setflag_help, setflag_syntax}
+ {"SetFlag", 0, pcb_act_SetFlag,
+ pcb_acth_SetFlag, pcb_acts_SetFlag}
,
- {"ClrFlag", 0, ActionClrFlag,
- clrflag_help, clrflag_syntax}
+ {"ClrFlag", 0, pcb_act_ClrFlag,
+ pcb_acth_ClrFlag, pcb_acts_ClrFlag}
};
-REGISTER_ACTIONS(change_action_list, NULL)
+PCB_REGISTER_ACTIONS(change_action_list, NULL)
diff --git a/src/clip.c b/src/clip.c
index ffb60e5..0b8652d 100644
--- a/src/clip.c
+++ b/src/clip.c
@@ -27,13 +27,12 @@
#include "config.h"
#include "clip.h"
-#include <math.h>
/* Clip the line to the clipBox
* return pcb_true if something to be drawn
* pcb_false if the whole thing is clipped
*/
-pcb_bool ClipLine(double minx, double miny, double maxx, double maxy, double *x1, double *y1, double *x2, double *y2, double margin)
+pcb_bool pcb_line_clip(double minx, double miny, double maxx, double maxy, double *x1, double *y1, double *x2, double *y2, double margin)
{
double d, r;
diff --git a/src/clip.h b/src/clip.h
index b9a3b4b..b52db18 100644
--- a/src/clip.h
+++ b/src/clip.h
@@ -30,15 +30,15 @@
#ifndef PCB_CLIP_H
#define PCB_CLIP_H
-#include "global.h"
+#include "global_typedefs.h"
/* ---------------------------------------------------------------------------
* prototypes
*/
-/* Clip X,Y to the given bounding box, plus a margin. Returns TRUE if
+/* Clip X,Y to the given bounding box, plus a margin. Returns pcb_true if
there is something left to be drawn. */
-pcb_bool ClipLine(double minx, double miny, double maxx, double maxy,
+pcb_bool pcb_line_clip(double minx, double miny, double maxx, double maxy,
double *x1, double *y1, double *x2, double *y2, double margin);
#endif
diff --git a/src/compat_cc.h b/src/compat_cc.h
new file mode 100644
index 0000000..72f50fa
--- /dev/null
+++ b/src/compat_cc.h
@@ -0,0 +1,71 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
+ * 15 Oct 2008 Ineiev: add different crosshair shapes
+ *
+ * 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 addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_COMPAT_CC_H
+#define PCB_COMPAT_CC_H
+
+/* ---------------------------------------------------------------------------
+ * Macros to annotate branch-prediction information.
+ * Taken from GLib 2.16.3 (LGPL 2).G_ / g_ prefixes have
+ * been removed to avoid namespace clashes.
+ */
+
+/* The LIKELY and UNLIKELY macros let the programmer give hints to
+ * the compiler about the expected result of an expression. Some compilers
+ * can use this information for optimizations.
+ *
+ * The PCB_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
+ * putting assignments inside the test.
+ */
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+# define PCB_BOOLEAN_EXPR(expr) \
+ __extension__ ({ \
+ int _boolean_var_; \
+ if (expr) \
+ _boolean_var_ = 1; \
+ else \
+ _boolean_var_ = 0; \
+ _boolean_var_; \
+})
+# define PCB_LIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 1))
+# define PCB_UNLIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 0))
+#else
+# define PCB_LIKELY(expr) (expr)
+# define PCB_UNLIKELY(expr) (expr)
+#endif
+
+#ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+#endif /* GCC_VERSION */
+
+#if GCC_VERSION > 2007
+# define PCB_ATTRIBUTE_UNUSED __attribute__((unused))
+#else
+# define PCB_ATTRIBUTE_UNUSED
+#endif
+
+#endif
diff --git a/src/compat_dl.c b/src/compat_dl.c
index b50f2d7..1e4aed6 100644
--- a/src/compat_dl.c
+++ b/src/compat_dl.c
@@ -23,12 +23,11 @@
#include "config.h"
#include "compat_dl.h"
-#include "global.h"
#ifdef USE_LOADLIBRARY
#include <windows.h>
-void *dlopen(const char *f, int ATTRIBUTE_UNUSED flag)
+void *dlopen(const char *f, int PCB_ATTRIBUTE_UNUSED flag)
{
return LoadLibrary(f);
}
@@ -51,7 +50,7 @@ char *dlerror()
dw = GetLastError();
/* get the corresponding error message */
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ Formatpcb_message(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) & lpMsgBuf, 0, NULL);
diff --git a/src/compat_fs.c b/src/compat_fs.c
index d625de2..c93fdeb 100644
--- a/src/compat_fs.c
+++ b/src/compat_fs.c
@@ -32,6 +32,7 @@
#include "compat_inc.h"
#include <stdlib.h>
+#include <stdio.h>
#include <stdarg.h>
#include <math.h>
#include <string.h>
@@ -40,29 +41,27 @@
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <math.h>
#include <assert.h>
#include "compat_fs.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "globalconst.h"
#include <genvector/gds_char.h>
-#include "global.h"
-
#include "error.h"
-#include "mymem.h"
/* ----------------------------------------------------------------------
* returns pointer to current working directory. If 'path' is not
* NULL, then the current working directory is copied to the array
* pointed to by 'path'
*/
-char *GetWorkingDirectory(char *path)
+char *pcb_get_wd(char *path)
{
#if defined(HAVE_GETCWD)
- return getcwd(path, MAXPATHLEN);
+ return getcwd(path, PCB_PATH_MAX);
#elif defined(HAVE__GETCWD)
- return _getcwd(path, MAXPATHLEN);
+ return _getcwd(path, PCB_PATH_MAX);
#else
/* seems that some BSD releases lack of a prototype for getwd() */
return getwd(path);
@@ -112,7 +111,7 @@ int pcb_spawnvp(const char **argv)
pid = fork();
if (pid < 0) {
/* error */
- Message(PCB_MSG_DEFAULT, _("Cannot fork!"));
+ pcb_message(PCB_MSG_ERROR, _("Cannot fork!"));
return 1;
}
else if (pid == 0) {
@@ -139,17 +138,17 @@ int pcb_spawnvp(const char **argv)
* the returned string is made up of the directory plus the name
* variable. For example:
*
- * tempfile_name_new ("myfile") might return
+ * pcb_tempfile_name_new("myfile") might return
* "/var/tmp/pcb.123456/myfile".
*
* If mkdtemp() is not available then 'name' is ignored and the
* insecure tmpnam() function is used.
*
- * Files/names created with tempfile_name_new() should be unlinked
+ * Files/names created with pcb_tempfile_name_new() should be unlinked
* with tempfile_unlink to make sure the temporary directory is also
* removed when mkdtemp() is used.
*/
-char *tempfile_name_new(const char *name)
+char *pcb_tempfile_name_new(const char *name)
{
char *tmpfile = NULL;
#ifdef HAVE_MKDTEMP
@@ -179,7 +178,7 @@ char *tempfile_name_new(const char *name)
mytmpdir = (char *) malloc(sizeof(char) * (strlen(tmpdir) + 1 + strlen(TEMPLATE) + 1));
if (mytmpdir == NULL) {
- fprintf(stderr, "tempfile_name_new(): malloc failed()\n");
+ fprintf(stderr, "pcb_tempfile_name_new(): malloc failed()\n");
exit(1);
}
@@ -234,7 +233,7 @@ char *tempfile_name_new(const char *name)
* lives in a temporary directory and we need to remove that directory
* too.
*/
-int tempfile_unlink(char *name)
+int pcb_tempfile_unlink(char *name)
{
#ifdef DEBUG
/* SDB says: Want to keep old temp files for examination when debugging */
@@ -270,8 +269,8 @@ int tempfile_unlink(char *name)
}
else {
- fprintf(stderr, _("tempfile_unlink(): Unable to determine temp directory name from the temp file\n"));
- fprintf(stderr, "tempfile_unlink(): \"%s\"\n", name);
+ fprintf(stderr, _("pcb_tempfile_unlink(): Unable to determine temp directory name from the temp file\n"));
+ fprintf(stderr, "pcb_tempfile_unlink(): \"%s\"\n", name);
rc2 = -1;
}
diff --git a/src/compat_fs.h b/src/compat_fs.h
index b917d15..94469a4 100644
--- a/src/compat_fs.h
+++ b/src/compat_fs.h
@@ -1,4 +1,4 @@
-char *GetWorkingDirectory(char *);
+char *pcb_get_wd(char *);
int pcb_mkdir(const char *path, int mode);
int pcb_spawnvp(const char **argv);
@@ -6,9 +6,9 @@ int pcb_spawnvp(const char **argv);
/* Return 1 if path is a file that can be opened for read */
int pcb_file_readable(const char *path);
-char *tempfile_name_new(const char *name);
+char *pcb_tempfile_name_new(const char *name);
/* remove temporary file and _also_ free the memory for name
* (this fact is a little confusing)
*/
-int tempfile_unlink(char *name);
+int pcb_tempfile_unlink(char *name);
diff --git a/src/compat_lrealpath.c b/src/compat_lrealpath.c
index eec8bfa..b444c1d 100644
--- a/src/compat_lrealpath.c
+++ b/src/compat_lrealpath.c
@@ -22,7 +22,7 @@
/*
- at deftypefn Replacement {const char*} lrealpath (const char *@var{name})
+ at deftypefn Replacement {const char*} pcb_lrealpath(const char *@var{name})
Given a pointer to a string containing a pathname, returns a canonical
version of the filename. Symlinks will be resolved, and ``.'' and ``..''
@@ -53,8 +53,8 @@ extern char *canonicalize_file_name(const char *);
#if defined (PATH_MAX)
#define REALPATH_LIMIT PATH_MAX
#else
-#if defined (MAXPATHLEN)
-#define REALPATH_LIMIT MAXPATHLEN
+#if defined (PCB_PATH_MAX)
+#define REALPATH_LIMIT PCB_PATH_MAX
#endif
#endif
#else
@@ -65,7 +65,7 @@ extern char *canonicalize_file_name(const char *);
#endif
#endif
-char *lrealpath(const char *filename)
+char *pcb_lrealpath(const char *filename)
{
/* Method 1: The system has a compile time upper bound on a filename
path. Use that and realpath() to canonicalize the name. This is
diff --git a/src/compat_lrealpath.h b/src/compat_lrealpath.h
index 17f611f..42fb7f4 100644
--- a/src/compat_lrealpath.h
+++ b/src/compat_lrealpath.h
@@ -2,6 +2,6 @@
#define PCB_LREALPATH_H
/* A well-defined realpath () that is always compiled in. */
-char *lrealpath(const char *);
+char *pcb_lrealpath(const char *);
#endif /* PCB_LREALPATH_H */
diff --git a/src/compat_misc.c b/src/compat_misc.c
index 239610f..e3a570b 100644
--- a/src/compat_misc.c
+++ b/src/compat_misc.c
@@ -22,11 +22,13 @@
#include "config.h"
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
#include <sys/types.h>
#include <math.h>
#include "compat_misc.h"
#include "compat_inc.h"
-#include "global.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -47,7 +49,7 @@ long pcb_rand(void)
}
#endif
-const char *get_user_name(void)
+const char *pcb_get_user_name(void)
{
#ifdef HAVE_GETPWUID
static struct passwd *pwentry;
@@ -132,3 +134,31 @@ double pcb_round(double x)
return -t;
}
#endif
+
+int pcb_strcasecmp(const char *s1, const char *s2)
+{
+ while(tolower(*s1) == tolower(*s2)) {
+ if (*s1 == '\0')
+ return 0;
+ s1++;
+ s2++;
+ }
+ return tolower(*s1) - tolower(*s2);
+}
+
+int pcb_strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ if (n == 0)
+ return 0;
+
+ while(tolower(*s1) == tolower(*s2)) {
+ n--;
+ if (n == 0)
+ return 0;
+ if (*s1 == '\0')
+ return 0;
+ s1++;
+ s2++;
+ }
+ return tolower(*s1) - tolower(*s2);
+}
diff --git a/src/compat_misc.h b/src/compat_misc.h
index c2d4622..7d432a5 100644
--- a/src/compat_misc.h
+++ b/src/compat_misc.h
@@ -25,11 +25,12 @@
#include "config.h"
+#include <stdlib.h>
#include <math.h>
long pcb_rand(void);
-const char *get_user_name(void);
+const char *pcb_get_user_name(void);
int pcb_getpid(void);
char *pcb_strndup(const char *s, int len);
@@ -39,4 +40,7 @@ char *pcb_strdup(const char *s);
double pcb_round(double x);
+int pcb_strcasecmp(const char *s1, const char *s2);
+int pcb_strncasecmp(const char *s1, const char *s2, size_t n);
+
#endif /* PCB_COMPAT_MISC_H */
diff --git a/src/compat_nls.h b/src/compat_nls.h
new file mode 100644
index 0000000..9ed5506
--- /dev/null
+++ b/src/compat_nls.h
@@ -0,0 +1,50 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
+ * 15 Oct 2008 Ineiev: add different crosshair shapes
+ *
+ * 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 addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_COMPAT_NLS
+#define PCB_COMPAT_NLS
+
+/* Internationalization support. */
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# define _(S) gettext(S)
+# if defined(gettext_noop)
+# define N_(S) gettext_noop(S)
+# else
+# define N_(S) (S)
+# endif
+#else
+# define _(S) (S)
+# define N_(S) (S)
+# define textdomain(S) (S)
+# define gettext(S) (S)
+# define dgettext(D, S) (S)
+# define dcgettext(D, S, T) (S)
+# define bindtextdomain(D, Dir) (D)
+#endif /* ENABLE_NLS */
+
+#endif
diff --git a/src/conf.c b/src/conf.c
index 1bd67bf..79720d3 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -21,21 +21,21 @@
*/
#include <assert.h>
+#include <string.h>
+#include <ctype.h>
#include <genht/hash.h>
#include <liblihata/tree.h>
#include <stdarg.h>
+#include "config.h"
#include "conf.h"
#include "conf_core.h"
#include "conf_hid.h"
#include "hid_cfg.h"
-#include "hid_init.h"
-#include "hid_attrib.h"
#include "misc_util.h"
#include "error.h"
#include "paths.h"
#include "compat_fs.h"
#include "compat_misc.h"
-#include "error.h"
/* conf list node's name */
const char *conf_list_name = "pcb-rnd-conf-v1";
@@ -78,6 +78,25 @@ static lht_node_t *conf_lht_get_confroot(lht_node_t *cwd)
return lht_dom_hash_get(cwd, conf_list_name);
}
+int conf_insert_tree_as(conf_role_t role, lht_node_t *root)
+{
+ lht_doc_t *d;
+
+ if ((root->type != LHT_LIST) || (strcmp(root->name, "pcb-rnd-conf-v1") != 0))
+ return -1;
+
+ if (conf_root[role] != NULL) {
+ lht_dom_uninit(conf_root[role]);
+ conf_root[role] = NULL;
+ }
+
+ d = lht_dom_init();
+ d->root = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1");
+ d->root->doc = d;
+ lht_tree_merge(d->root, root);
+ conf_root[role] = d;
+ return 0;
+}
int conf_load_as(conf_role_t role, const char *fn, int fn_is_text)
{
@@ -89,22 +108,34 @@ int conf_load_as(conf_role_t role, const char *fn, int fn_is_text)
conf_root[role] = NULL;
}
if (fn_is_text)
- d = hid_cfg_load_str(fn);
+ d = pcb_hid_cfg_load_str(fn);
else
- d = hid_cfg_load_lht(fn);
+ d = pcb_hid_cfg_load_lht(fn);
if (d == NULL) {
FILE *f;
char *efn;
- resolve_path(fn, &efn, 0);
+ pcb_path_resolve(fn, &efn, 0);
f = fopen(efn, "r");
if (f != NULL) { /* warn only if the file is there - missing file is normal */
- Message(PCB_MSG_DEFAULT, "error: failed to load lht config: %s\n", efn);
+ pcb_message(PCB_MSG_ERROR, "error: failed to load lht config: %s\n", efn);
fclose(f);
}
free(efn);
return -1;
}
+ if (d->root == NULL) {
+ lht_node_t *prjroot, *confroot;
+ prjroot = lht_dom_node_alloc(LHT_HASH, "geda-project-v1");
+ confroot = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1");
+ lht_dom_hash_put(prjroot, confroot);
+ prjroot->doc = d;
+ confroot->doc = d;
+ d->root = prjroot;
+ conf_root[role] = d;
+ return 0;
+ }
+
if ((d->root->type == LHT_LIST) && (strcmp(d->root->name, "pcb-rnd-conf-v1") == 0)) {
conf_root[role] = d;
return 0;
@@ -125,7 +156,7 @@ int conf_load_as(conf_role_t role, const char *fn, int fn_is_text)
return 0;
}
- hid_cfg_error(d->root, "Root node must be either li:pcb-rnd-conf-v1 or ha:geda-project-v1\n");
+ pcb_hid_cfg_error(d->root, "Root node must be either li:pcb-rnd-conf-v1 or ha:geda-project-v1\n");
if (d != NULL)
lht_dom_uninit(d);
@@ -134,10 +165,10 @@ int conf_load_as(conf_role_t role, const char *fn, int fn_is_text)
conf_policy_t conf_policy_parse(const char *s)
{
- if (strcasecmp(s, "overwrite") == 0) return POL_OVERWRITE;
- if (strcasecmp(s, "prepend") == 0) return POL_PREPEND;
- if (strcasecmp(s, "append") == 0) return POL_APPEND;
- if (strcasecmp(s, "disable") == 0) return POL_DISABLE;
+ if (pcb_strcasecmp(s, "overwrite") == 0) return POL_OVERWRITE;
+ if (pcb_strcasecmp(s, "prepend") == 0) return POL_PREPEND;
+ if (pcb_strcasecmp(s, "append") == 0) return POL_APPEND;
+ if (pcb_strcasecmp(s, "disable") == 0) return POL_DISABLE;
return POL_invalid;
}
@@ -155,14 +186,14 @@ const char *conf_policy_name(conf_policy_t p)
conf_role_t conf_role_parse(const char *s)
{
- if (strcasecmp(s, "internal") == 0) return CFR_INTERNAL;
- if (strcasecmp(s, "system") == 0) return CFR_SYSTEM;
- if (strcasecmp(s, "defaultpcb") == 0) return CFR_DEFAULTPCB;
- if (strcasecmp(s, "user") == 0) return CFR_USER;
- if (strcasecmp(s, "env") == 0) return CFR_ENV;
- if (strcasecmp(s, "project") == 0) return CFR_PROJECT;
- if (strcasecmp(s, "design") == 0) return CFR_DESIGN;
- if (strcasecmp(s, "cli") == 0) return CFR_CLI;
+ if (pcb_strcasecmp(s, "internal") == 0) return CFR_INTERNAL;
+ if (pcb_strcasecmp(s, "system") == 0) return CFR_SYSTEM;
+ if (pcb_strcasecmp(s, "defaultpcb") == 0) return CFR_DEFAULTPCB;
+ if (pcb_strcasecmp(s, "user") == 0) return CFR_USER;
+ if (pcb_strcasecmp(s, "env") == 0) return CFR_ENV;
+ if (pcb_strcasecmp(s, "project") == 0) return CFR_PROJECT;
+ if (pcb_strcasecmp(s, "design") == 0) return CFR_DESIGN;
+ if (pcb_strcasecmp(s, "cli") == 0) return CFR_CLI;
return CFR_invalid;
}
@@ -196,7 +227,7 @@ void conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio
conf_policy_t pol;
if (len >= sizeof(tmp)) {
- hid_cfg_error(root, "Invalid policy-prio '%s', subtree is ignored\n", root->name);
+ pcb_hid_cfg_error(root, "Invalid policy-prio '%s', subtree is ignored\n", root->name);
return;
}
@@ -209,7 +240,7 @@ void conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio
sprio++;
p = strtol(sprio, &end, 10);
if ((*end != '\0') || (p < 0)) {
- hid_cfg_error(root, "Invalid prio in '%s', subtree is ignored\n", root->name);
+ pcb_hid_cfg_error(root, "Invalid prio in '%s', subtree is ignored\n", root->name);
return;
}
}
@@ -217,7 +248,7 @@ void conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio
/* convert policy */
pol = conf_policy_parse(tmp);
if (pol == POL_invalid) {
- hid_cfg_error(root, "Invalid policy in '%s', subtree is ignored\n", root->name);
+ pcb_hid_cfg_error(root, "Invalid policy in '%s', subtree is ignored\n", root->name);
return;
}
@@ -240,12 +271,12 @@ int conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio)
}
}
-static int conf_parse_increments(Increments *inc, lht_node_t *node)
+static int conf_parse_increments(pcb_increments_t *inc, lht_node_t *node)
{
lht_node_t *val;
if (node->type != LHT_HASH) {
- hid_cfg_error(node, "Increments need to be a hash\n");
+ pcb_hid_cfg_error(node, "Increments need to be a hash\n");
return -1;
}
@@ -254,12 +285,12 @@ static int conf_parse_increments(Increments *inc, lht_node_t *node)
if (val != NULL) {\
if (val->type == LHT_TEXT) {\
pcb_bool succ; \
- inc->field = GetValue(val->data.text.value, NULL, NULL, &succ); \
+ inc->field = pcb_get_value(val->data.text.value, NULL, NULL, &succ); \
if (!succ) \
- hid_cfg_error(node, "invalid numeric value in increment field " #field ": %s\n", val->data.text.value); \
+ pcb_hid_cfg_error(node, "invalid numeric value in increment field " #field ": %s\n", val->data.text.value); \
} \
else\
- hid_cfg_error(node, "increment field " #field " needs to be a text node\n"); \
+ pcb_hid_cfg_error(node, "increment field " #field " needs to be a text node\n"); \
}
incload(grid);
@@ -281,7 +312,7 @@ static int conf_parse_increments(Increments *inc, lht_node_t *node)
const char *conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **try)
{
- static char res[MAXPATHLEN];
+ static char res[PCB_PATH_MAX];
static const char *project_name = "project.lht";
FILE *f;
@@ -332,7 +363,7 @@ int conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const cha
long l;
int base = 10;
double d;
- const Unit *u;
+ const pcb_unit_t *u;
switch(type) {
case CFN_STRING:
@@ -341,16 +372,16 @@ int conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const cha
case CFN_BOOLEAN:
while(isspace(*text)) text++;
for(s = strue; *s != NULL; s++)
- if (strncasecmp(*s, text, strlen(*s)) == 0) {
+ if (pcb_strncasecmp(*s, text, strlen(*s)) == 0) {
dst->boolean[idx] = 1;
return 0;
}
for(s = sfalse; *s != NULL; s++)
- if (strncasecmp(*s, text, strlen(*s)) == 0) {
+ if (pcb_strncasecmp(*s, text, strlen(*s)) == 0) {
dst->boolean[idx] = 0;
return 0;
}
- hid_cfg_error(err_node, "Invalid boolean value: %s\n", text);
+ pcb_hid_cfg_error(err_node, "Invalid boolean value: %s\n", text);
return -1;
case CFN_INTEGER:
if ((text[0] == '0') && (text[1] == 'x')) {
@@ -364,7 +395,7 @@ int conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const cha
dst->integer[idx] = l;
return 0;
}
- hid_cfg_error(err_node, "Invalid integer value: %s\n", text);
+ pcb_hid_cfg_error(err_node, "Invalid integer value: %s\n", text);
return -1;
case CFN_REAL:
d = strtod(text, &end);
@@ -372,20 +403,20 @@ int conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const cha
dst->real[idx] = d;
return 0;
}
- hid_cfg_error(err_node, "Invalid numeric value: %s\n", text);
+ pcb_hid_cfg_error(err_node, "Invalid numeric value: %s\n", text);
return -1;
case CFN_COORD:
{
pcb_bool succ;
- dst->coord[idx] = GetValue(text, NULL, NULL, &succ);
+ dst->coord[idx] = pcb_get_value(text, NULL, NULL, &succ);
if (!succ)
- hid_cfg_error(err_node, "Invalid numeric value (coordinate): %s\n", text);
+ pcb_hid_cfg_error(err_node, "Invalid numeric value (coordinate): %s\n", text);
}
break;
case CFN_UNIT:
u = get_unit_struct(text);
if (u == NULL)
- hid_cfg_error(err_node, "Invalid unit: %s\n", text);
+ pcb_hid_cfg_error(err_node, "Invalid unit: %s\n", text);
else
dst->unit[idx] = u;
break;
@@ -407,7 +438,7 @@ int conf_merge_patch_text(conf_native_t *dest, lht_node_t *src, int prio, conf_p
return 0;
if (dest->random_flags.read_only) {
- hid_cfg_error(src, "WARNING: not going to overwrite read-only value %s from a config file\n", dest->hash_path);
+ pcb_hid_cfg_error(src, "WARNING: not going to overwrite read-only value %s from a config file\n", dest->hash_path);
return 0;
}
@@ -422,21 +453,21 @@ int conf_merge_patch_text(conf_native_t *dest, lht_node_t *src, int prio, conf_p
static void conf_insert_arr(conf_native_t *dest, int offs)
{
-#define CASE_MOVE(typ, fld) \
+#define CASE_PCB_MOVE(typ, fld) \
case typ: memmove(dest->val.fld+offs, dest->val.fld, dest->used * sizeof(dest->val.fld[0])); return
memmove(dest->prop+offs, dest->prop, dest->used * sizeof(dest->prop[0]));
if (dest->used > 0) {
switch(dest->type) {
- CASE_MOVE(CFN_STRING, string);
- CASE_MOVE(CFN_BOOLEAN, boolean);
- CASE_MOVE(CFN_INTEGER, integer);
- CASE_MOVE(CFN_REAL, real);
- CASE_MOVE(CFN_COORD, coord);
- CASE_MOVE(CFN_UNIT, unit);
- CASE_MOVE(CFN_COLOR, color);
- CASE_MOVE(CFN_LIST, list);
- CASE_MOVE(CFN_INCREMENTS, increments);
+ CASE_PCB_MOVE(CFN_STRING, string);
+ CASE_PCB_MOVE(CFN_BOOLEAN, boolean);
+ CASE_PCB_MOVE(CFN_INTEGER, integer);
+ CASE_PCB_MOVE(CFN_REAL, real);
+ CASE_PCB_MOVE(CFN_COORD, coord);
+ CASE_PCB_MOVE(CFN_UNIT, unit);
+ CASE_PCB_MOVE(CFN_COLOR, color);
+ CASE_PCB_MOVE(CFN_LIST, list);
+ CASE_PCB_MOVE(CFN_INCREMENTS, increments);
}
}
#undef CASE_MOVE
@@ -480,7 +511,7 @@ int conf_merge_patch_array(conf_native_t *dest, lht_node_t *src_lst, int prio, c
}
/*printf(" didx: %d / %d '%s'\n", didx, dest->array_size, s->data.text.value);*/
if (didx >= dest->array_size) {
- hid_cfg_error(s, "Array is already full [%d] of [%d] ignored value: '%s' policy=%d\n", dest->used, dest->array_size, s->data.text.value, pol);
+ pcb_hid_cfg_error(s, "Array is already full [%d] of [%d] ignored value: '%s' policy=%d\n", dest->used, dest->array_size, s->data.text.value, pol);
res = -1;
break;
}
@@ -493,7 +524,7 @@ int conf_merge_patch_array(conf_native_t *dest, lht_node_t *src_lst, int prio, c
}
}
else {
- hid_cfg_error(s, "List item must be text\n");
+ pcb_hid_cfg_error(s, "List item must be text\n");
res = -1;
}
}
@@ -541,7 +572,7 @@ int conf_merge_patch_list(conf_native_t *dest, lht_node_t *src_lst, int prio, co
}
}
else {
- hid_cfg_error(s, "List item must be text\n");
+ pcb_hid_cfg_error(s, "List item must be text\n");
res = -1;
}
}
@@ -558,7 +589,7 @@ int conf_merge_patch_item(const char *path, lht_node_t *n, int default_prio, con
case LHT_TEXT:
if (target == NULL) {
if ((strncmp(path, "plugins/", 8) != 0) && (strncmp(path, "utils/", 6) != 0))/* it is normal to have configuration for plugins and utils not loaded - ignore these */
- hid_cfg_error(n, "conf error: lht->bin conversion: can't find path '%s' - check your lht!\n", path);
+ pcb_hid_cfg_error(n, "conf error: lht->bin conversion: can't find path '%s' - check your lht!\n", path);
break;
}
conf_merge_patch_text(target, n, default_prio, default_policy);
@@ -570,14 +601,16 @@ int conf_merge_patch_item(const char *path, lht_node_t *n, int default_prio, con
conf_merge_patch_text(target, n, default_prio, default_policy);
break;
case LHT_LIST:
- if (target == NULL)
- hid_cfg_error(n, "conf error: lht->bin conversion: can't find path '%s' - check your lht; may it be that it should be a hash instead of a list?\n", path);
+ if (target == NULL) {
+ if ((strncmp(path, "plugins/", 8) != 0) && (strncmp(path, "utils/", 6) != 0))/* it is normal to have configuration for plugins and utils not loaded - ignore these */
+ pcb_hid_cfg_error(n, "conf error: lht->bin conversion: can't find path '%s' - check your lht; may it be that it should be a hash instead of a list?\n", path);
+ }
else if (target->type == CFN_LIST)
res |= conf_merge_patch_list(target, n, default_prio, default_policy);
else if (target->array_size > 1)
res |= conf_merge_patch_array(target, n, default_prio, default_policy);
else
- hid_cfg_error(n, "Attempt to initialize a scalar with a list - this node should be a text node\n");
+ pcb_hid_cfg_error(n, "Attempt to initialize a scalar with a list - this node should be a text node\n");
break;
case LHT_SYMLINK:
#warning TODO
@@ -621,7 +654,7 @@ int conf_merge_patch(lht_node_t *root, long gprio)
lht_dom_iterator_t it;
if (root->type != LHT_HASH) {
- hid_cfg_error(root, "patch root should be a hash\n");
+ pcb_hid_cfg_error(root, "patch root should be a hash\n");
return -1;
}
@@ -812,32 +845,43 @@ void conf_update(const char *path)
conf_rev++;
}
-static lht_node_t *conf_lht_get_first_(lht_node_t *cwd)
+static lht_node_t *conf_lht_get_first_(lht_node_t *cwd, int create)
{
+ lht_node_t *ov; /* normally the "overwrite" node */
+
/* assume root is a li and add to the first hash */
cwd = conf_lht_get_confroot(cwd);
if (cwd == NULL)
return NULL;
- cwd = cwd->data.list.first;
- if ((cwd == NULL) || (cwd->type != LHT_HASH))
+ ov = cwd->data.list.first;
+ if (ov == NULL) {
+ lht_node_t *new_ov;
+ if (!create)
+ return NULL;
+ new_ov = lht_dom_node_alloc(LHT_HASH, "overwrite");
+ lht_dom_list_append(cwd, new_ov);
+ ov = new_ov;
+ }
+ else if (ov->type != LHT_HASH)
return NULL;
- return cwd;
+
+ return ov;
}
-lht_node_t *conf_lht_get_first(conf_role_t target)
+lht_node_t *conf_lht_get_first(conf_role_t target, int create)
{
assert(target != CFR_invalid);
assert(target >= 0);
assert(target < CFR_max_alloc);
if (conf_root[target] == NULL)
return NULL;
- return conf_lht_get_first_(conf_root[target]->root);
+ return conf_lht_get_first_(conf_root[target]->root, create);
}
static lht_node_t *conf_lht_get_at_(conf_role_t target, const char *conf_path, const char *lht_path, int create)
{
- lht_node_t *n, *r;
- n = conf_lht_get_first(target);
+ lht_node_t *n, *r = NULL;
+ n = conf_lht_get_first(target, create);
if (n == NULL)
return NULL;
r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL);
@@ -889,7 +933,7 @@ void conf_load_all(const char *project_fn, const char *pcb_fn)
dln = dln->data.list.first;
/* Set up default layer names - make sure there are enough layers (over the hardwired ones, if any) */
- for (i = 0; i < MAX_LAYER; i++) {
+ for (i = 0; i < PCB_MAX_LAYER; i++) {
char buf[20];
if (dln == NULL) {
sprintf(buf, "signal%d", i + 1);
@@ -1053,14 +1097,14 @@ int conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char
return -1;
}
- cwd = conf_lht_get_first(target);
+ cwd = conf_lht_get_first(target, 0);
if (cwd == NULL) {
free(path);
return -1;
}
if (idx >= nat->array_size) {
- Message(PCB_MSG_DEFAULT, "Error: can't conf_set() %s[%d]: %d is beyond the end of the array (%d)\n", path, idx, idx, nat->array_size);
+ pcb_message(PCB_MSG_ERROR, "Error: can't conf_set() %s[%d]: %d is beyond the end of the array (%d)\n", path, idx, idx, nat->array_size);
free(path);
return -1;
}
@@ -1087,7 +1131,7 @@ int conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char
return 0;
}
if (conf_root_lock[target]) {
- Message(PCB_MSG_DEFAULT, "WARNING: can't set config item %s because target in-memory lihata does not have the node and is tree-locked\n", path_);
+ pcb_message(PCB_MSG_WARNING, "WARNING: can't set config item %s because target in-memory lihata does not have the node and is tree-locked\n", path_);
free(path);
return -1;
}
@@ -1473,7 +1517,7 @@ int conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t
int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn)
{
int fail = 1;
- lht_node_t *r = conf_lht_get_first(role);
+ lht_node_t *r = conf_lht_get_first(role, 0);
const char *try;
char *efn;
@@ -1489,7 +1533,7 @@ int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role,
case CFR_PROJECT:
fn = conf_get_project_conf_name(project_fn, pcb_fn, &try);
if (fn == NULL) {
- Message(PCB_MSG_DEFAULT, "Error: can not save config to project file: %s does not exist - please create an empty file there first\n", try);
+ pcb_message(PCB_MSG_ERROR, "Error: can not save config to project file: %s does not exist - please create an empty file there first\n", try);
return -1;
}
break;
@@ -1497,7 +1541,7 @@ int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role,
}
}
- resolve_path(fn, &efn, 0);
+ pcb_path_resolve(fn, &efn, 0);
if (r != NULL) {
FILE *f;
@@ -1510,11 +1554,11 @@ int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role,
if (end != NULL) {
*end = '\0';
if (pcb_mkdir(path, 0755) == 0) {
- Message(PCB_MSG_DEFAULT, "Created directory %s for saving %s\n", path, fn);
+ pcb_message(PCB_MSG_INFO, "Created directory %s for saving %s\n", path, fn);
f = fopen(efn, "w");
}
else
- Message(PCB_MSG_DEFAULT, "Error: failed to create directory %s for saving %s\n", path, efn);
+ pcb_message(PCB_MSG_ERROR, "Error: failed to create directory %s for saving %s\n", path, efn);
}
free(path);
}
@@ -1527,7 +1571,7 @@ int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role,
fclose(f);
}
else
- Message(PCB_MSG_DEFAULT, "Error: can't save config to %s - can't open the file for write\n", fn);
+ pcb_message(PCB_MSG_ERROR, "Error: can't save config to %s - can't open the file for write\n", fn);
}
free(efn);
@@ -1689,7 +1733,7 @@ int conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, confitem_t *va
case CFN_COLOR: print_str_or_null(pfn, ctx, verbose, val->color[idx], val->color[idx]); break;
case CFN_INCREMENTS:
{
- Increments *i = &val->increments[idx];
+ pcb_increments_t *i = &val->increments[idx];
ret += pfn(ctx, "{ grid=%$mS/%$mS/%$mS size=%$mS/%$mS/%$mS line=%$mS/%$mS/%$mS clear=%$mS/%$mS/%$mS}",
i->grid, i->grid_min, i->grid_max,
i->size, i->size_min, i->size_max,
@@ -1780,7 +1824,7 @@ void conf_uninit(void)
int n;
htsp_entry_t *e;
- conf_hid_uninit();
+ conf_pcb_hid_uninit();
for(n = 0; n < CFR_max_alloc; n++)
if (conf_root[n] != NULL)
diff --git a/src/conf.h b/src/conf.h
index 9a33545..92b1c40 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -22,7 +22,7 @@
#ifndef PCB_CONF_H
#define PCB_CONF_H
-#include "global.h"
+#include "config.h"
#include "global_typedefs.h"
#include "pcb-printf.h"
#include <liblihata/lihata.h>
@@ -54,11 +54,11 @@ typedef const char * CFT_STRING;
typedef int CFT_BOOLEAN;
typedef long CFT_INTEGER;
typedef double CFT_REAL;
-typedef Coord CFT_COORD;
-typedef Unit * CFT_UNIT;
+typedef pcb_coord_t CFT_COORD;
+typedef pcb_unit_t * CFT_UNIT;
typedef char * CFT_COLOR;
typedef conflist_t CFT_LIST;
-typedef Increments CFT_INCREMENTS;
+typedef pcb_increments_t CFT_INCREMENTS;
typedef enum {
CFN_STRING,
@@ -77,11 +77,11 @@ union confitem_u {
int *boolean;
long *integer;
double *real;
- Coord *coord;
- const Unit **unit;
+ pcb_coord_t *coord;
+ const pcb_unit_t **unit;
const char **color;
conflist_t *list;
- Increments *increments;
+ pcb_increments_t *increments;
void *any;
};
@@ -153,6 +153,10 @@ void conf_load_all(const char *project_fn, const char *pcb_fn);
/* Load a file or a string as a role */
int conf_load_as(conf_role_t role, const char *fn, int fn_is_text);
+/* copy root to be the new config of role; root must be a li:pcb-rnd-conf-v1
+ return 0 on success and removes/invalidates root */
+int conf_insert_tree_as(conf_role_t role, lht_node_t *root);
+
/* Load a project file into CFR_PROJECT. Both project_fn and pcb_fn can't be NULL.
Leaves an initialized but empty CFR_PROJECT root if no project file was
found. Runs conf_update(NULL); */
@@ -278,7 +282,7 @@ do { \
const char **__in__ = __n__->val.string; \
if (__in__ == NULL) \
continue; \
- resolve_path(*__in__, &__path__, 0); \
+ pcb_path_resolve(*__in__, &__path__, 0); \
res = call; \
free(__path__); \
if (res == 0) \
@@ -300,19 +304,23 @@ do { \
#define conf_set_editor(field, val) \
conf_set(CFR_DESIGN, "editor/" #field, -1, val ? "1" : "0", POL_OVERWRITE)
+#define conf_set_editor_(sfield, val) \
+ conf_set(CFR_DESIGN, sfield, -1, val ? "1" : "0", POL_OVERWRITE)
+
#define conf_toggle_editor(field) \
conf_set_editor(field, !conf_core.editor.field)
#define conf_toggle_editor_(sfield, field) \
- conf_set_editor(sfield, !conf_core.editor.field)
+ conf_set_editor_("editor/" sfield, !conf_core.editor.field)
/* For temporary modification/restoration of variables (hack) */
#define conf_force_set_bool(var, val) *((CFT_BOOLEAN *)(&var)) = val
#define conf_force_set_str(var, val) *((CFT_STRING *)(&var)) = val
/* get the first config subtree node (it's a hash and its children
- are "design", "rc", ...) */
-lht_node_t *conf_lht_get_first(conf_role_t target);
+ are "design", "rc", ...); if create is 1, and the subtree doesn't
+ exist, create an "overwrite". */
+lht_node_t *conf_lht_get_first(conf_role_t target, int create);
/* loop helper */
conf_listitem_t *conf_list_first_str(conflist_t *list, const char **item_str, int *idx);
diff --git a/src/conf_act.c b/src/conf_act.c
index 6a28aca..ccdd3e8 100644
--- a/src/conf_act.c
+++ b/src/conf_act.c
@@ -23,23 +23,20 @@
*
*/
-#include "global.h"
-#include "data.h"
#include "config.h"
-#include "conf.h"
+#include "board.h"
#include "conf_core.h"
-#include "error.h"
-#include "misc.h"
-#include "misc_util.h"
#include "route_style.h"
+#include "error.h"
+#include "hid.h"
-static const char conf_syntax[] =
+static const char pcb_acts_Conf[] =
"conf(set, path, value, [role], [policy]) - change a config setting\n"
"conf(toggle, path, [role]) - invert boolean value of a flag; if no role given, overwrite the highest prio config\n"
"conf(reset, role) - reset the in-memory lihata of a role\n"
"conf(iseq, path, value) - returns whether the value of a conf item matches value (for menu checked's)\n"
;
-static const char conf_help[] = "Perform various operations on the configuration tree.";
+static const char pcb_acth_Conf[] = "Perform various operations on the configuration tree.";
extern lht_doc_t *conf_root[];
static inline int conf_iseq_pf(void *ctx, const char *fmt, ...)
@@ -52,31 +49,31 @@ static inline int conf_iseq_pf(void *ctx, const char *fmt, ...)
return res;
}
-static int ActionConf(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Conf(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *cmd = argc > 0 ? argv[0] : 0;
- if (NSTRCMP(cmd, "set") == 0) {
+ if (PCB_NSTRCMP(cmd, "set") == 0) {
const char *path, *val;
conf_policy_t pol = POL_OVERWRITE;
conf_role_t role = CFR_invalid;
int res;
if (argc < 3) {
- Message(PCB_MSG_DEFAULT, "conf(set) needs at least two arguments");
+ pcb_message(PCB_MSG_ERROR, "conf(set) needs at least two arguments");
return 1;
}
if (argc > 3) {
role = conf_role_parse(argv[3]);
if (role == CFR_invalid) {
- Message(PCB_MSG_DEFAULT, "Invalid role: '%s'", argv[3]);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", argv[3]);
return 1;
}
}
if (argc > 4) {
pol = conf_policy_parse(argv[4]);
if (pol == POL_invalid) {
- Message(PCB_MSG_DEFAULT, "Invalid policy: '%s'", argv[4]);
+ pcb_message(PCB_MSG_ERROR, "Invalid policy: '%s'", argv[4]);
return 1;
}
}
@@ -86,7 +83,7 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
if (role == CFR_invalid) {
conf_native_t *n = conf_get_field(argv[1]);
if (n == NULL) {
- Message(PCB_MSG_DEFAULT, "Invalid conf field '%s': no such path\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Invalid conf field '%s': no such path\n", argv[1]);
return 1;
}
res = conf_set_native(n, 0, val);
@@ -94,19 +91,19 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
else
res = conf_set(role, path, -1, val, pol);
if (res != 0) {
- Message(PCB_MSG_DEFAULT, "conf(set) failed.\n");
+ pcb_message(PCB_MSG_ERROR, "conf(set) failed.\n");
return 1;
}
}
- else if (NSTRCMP(cmd, "iseq") == 0) {
+ else if (PCB_NSTRCMP(cmd, "iseq") == 0) {
const char *path, *val;
int res;
gds_t nval;
conf_native_t *n;
if (argc != 3) {
- Message(PCB_MSG_ERROR, "conf(iseq) needs two arguments");
+ pcb_message(PCB_MSG_ERROR, "conf(iseq) needs two arguments");
return -1;
}
path = argv[1];
@@ -114,7 +111,7 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
n = conf_get_field(argv[1]);
if (n == NULL) {
- Message(PCB_MSG_ERROR, "Invalid conf field '%s' in iseq: no such path\n", path);
+ pcb_message(PCB_MSG_ERROR, "Invalid conf field '%s' in iseq: no such path\n", path);
return -1;
}
@@ -127,28 +124,28 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
return res;
}
- else if (NSTRCMP(cmd, "toggle") == 0) {
+ else if (PCB_NSTRCMP(cmd, "toggle") == 0) {
conf_native_t *n = conf_get_field(argv[1]);
const char *new_value;
conf_role_t role = CFR_invalid;
int res;
if (n == NULL) {
- Message(PCB_MSG_DEFAULT, "Invalid conf field '%s': no such path\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Invalid conf field '%s': no such path\n", argv[1]);
return 1;
}
if (n->type != CFN_BOOLEAN) {
- Message(PCB_MSG_DEFAULT, "Can not toggle '%s': not a boolean\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Can not toggle '%s': not a boolean\n", argv[1]);
return 1;
}
if (n->used != 1) {
- Message(PCB_MSG_DEFAULT, "Can not toggle '%s': array size should be 1, not %d\n", argv[1], n->used);
+ pcb_message(PCB_MSG_ERROR, "Can not toggle '%s': array size should be 1, not %d\n", argv[1], n->used);
return 1;
}
if (argc > 2) {
role = conf_role_parse(argv[2]);
if (role == CFR_invalid) {
- Message(PCB_MSG_DEFAULT, "Invalid role: '%s'", argv[2]);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", argv[2]);
return 1;
}
}
@@ -162,17 +159,17 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
res = conf_set(role, argv[1], -1, new_value, POL_OVERWRITE);
if (res != 0) {
- Message(PCB_MSG_DEFAULT, "Can not toggle '%s': failed to set new value\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Can not toggle '%s': failed to set new value\n", argv[1]);
return 1;
}
conf_update(argv[1]);
}
- else if (NSTRCMP(cmd, "reset") == 0) {
+ else if (PCB_NSTRCMP(cmd, "reset") == 0) {
conf_role_t role;
role = conf_role_parse(argv[1]);
if (role == CFR_invalid) {
- Message(PCB_MSG_DEFAULT, "Invalid role: '%s'", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", argv[1]);
return 1;
}
conf_reset(role, "<action>");
@@ -180,7 +177,7 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
}
else {
- Message(PCB_MSG_DEFAULT, "Invalid conf command '%s'\n", argv[0]);
+ pcb_message(PCB_MSG_ERROR, "Invalid conf command '%s'\n", argv[0]);
return 1;
}
return 0;
@@ -189,14 +186,14 @@ static int ActionConf(int argc, const char **argv, Coord x, Coord y)
/*------------ get/chk (check flag actions for menus) ------------------*/
static const char GetStyle_syntax[] = "GetStyle()" ;
static const char GetStyle_help[] = "Return integer index (>=0) of the currently active style or -1 if no style is selected (== custom style)";
-static int ActionGetStyle(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_GetStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
return pcb_route_style_lookup(&PCB->RouteStyle, conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, conf_core.design.clearance, NULL);
}
static const char ChkMode_syntax[] = "ChkMode(expected_mode)" ;
static const char ChkMode_help[] = "Return 1 if the currently selected mode is the expected_mode";
-static int ActionChkMode(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChkMode(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
#warning TODO: convert this to a compile-time hash
struct {
@@ -228,7 +225,7 @@ static int ActionChkMode(int argc, const char **argv, Coord x, Coord y)
if (strcmp(m->name, argv[0]) == 0)
return conf_core.editor.mode == m->mode;
}
- Message(PCB_MSG_DEFAULT, "Unknown mode in ChkMode(): %s\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Unknown mode in ChkMode(): %s\n", argv[1]);
abort();
return -1;
}
@@ -239,13 +236,13 @@ static const char ChkGridSize_syntax[] =
"ChkGridSize(none)\n"
;
static const char ChkGridSize_help[] = "Return 1 if the currently selected grid matches the expected_size. If argument is \"none\" return 1 if there is no grid.";
-static int ActionChkGridSize(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChkGridSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
assert(argc == 1);
if (strcmp(argv[0], "none") == 0)
return PCB->Grid <= 300;
- return (PCB->Grid == GetValueEx(argv[0], NULL, NULL, NULL, NULL, NULL));
+ return (PCB->Grid == pcb_get_value_ex(argv[0], NULL, NULL, NULL, NULL, NULL));
}
static const char ChkElementName_syntax[] =
@@ -254,7 +251,7 @@ static const char ChkElementName_syntax[] =
"ChkElementName(3) - expect value\n"
;
static const char ChkElementName_help[] = "Return 1 if currently shown element label (name) type matches the expected";
-static int ActionChkElementName(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChkElementName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int have, expected = argv[0][0] - '0';
@@ -268,7 +265,7 @@ static int ActionChkElementName(int argc, const char **argv, Coord x, Coord y)
static const char ChkGridUnits_syntax[] = "ChkGridUnits(expected)";
static const char ChkGridUnits_help[] = "Return 1 if currently selected grid unit matches the expected (normally mm or mil)";
-static int ActionChkGridUnits(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChkGridUnits(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
assert(argc == 1);
return strcmp(conf_core.editor.grid_unit->suffix, argv[0]) == 0;
@@ -276,7 +273,7 @@ static int ActionChkGridUnits(int argc, const char **argv, Coord x, Coord y)
static const char ChkBuffer_syntax[] = "ChkBuffer(idx)";
static const char ChkBuffer_help[] = "Return 1 if currently selected buffer's index matches idx";
-static int ActionChkBuffer(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ChkBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int expected = argv[0][0] - '0';
assert(argc == 1);
@@ -284,27 +281,27 @@ static int ActionChkBuffer(int argc, const char **argv, Coord x, Coord y)
return (conf_core.editor.buffer_number + 1) == expected;
}
-HID_Action conf_action_list[] = {
- {"conf", 0, ActionConf,
- conf_help, conf_syntax}
+pcb_hid_action_t conf_action_list[] = {
+ {"conf", 0, pcb_act_Conf,
+ pcb_acth_Conf, pcb_acts_Conf}
,
- {"GetStyle", 0, ActionGetStyle,
+ {"GetStyle", 0, pcb_act_GetStyle,
GetStyle_help, GetStyle_syntax}
,
- {"ChkMode", 0, ActionChkMode,
+ {"ChkMode", 0, pcb_act_ChkMode,
ChkMode_help, ChkMode_syntax}
,
- {"ChkGridSize", 0, ActionChkGridSize,
+ {"ChkGridSize", 0, pcb_act_ChkGridSize,
ChkGridSize_help, ChkGridSize_syntax}
,
- {"ChkElementName", 0, ActionChkElementName,
+ {"ChkElementName", 0, pcb_act_ChkElementName,
ChkElementName_help, ChkElementName_syntax}
,
- {"ChkGridUnits", 0, ActionChkGridUnits,
+ {"ChkGridUnits", 0, pcb_act_ChkGridUnits,
ChkGridUnits_help, ChkGridUnits_syntax}
,
- {"ChkBuffer", 0, ActionChkBuffer,
+ {"ChkBuffer", 0, pcb_act_ChkBuffer,
ChkBuffer_help, ChkBuffer_syntax}
};
-REGISTER_ACTIONS(conf_action_list, NULL)
+PCB_REGISTER_ACTIONS(conf_action_list, NULL)
diff --git a/src/conf_core.c b/src/conf_core.c
index 6a85b0b..2484bb3 100644
--- a/src/conf_core.c
+++ b/src/conf_core.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "conf.h"
#include "conf_core.h"
conf_core_t conf_core;
@@ -42,11 +43,11 @@ static void conf_ro(const char *path)
void conf_core_postproc()
{
- conf_clamp_to(CFT_COORD, conf_core.design.line_thickness, MIN_LINESIZE, MAX_LINESIZE, PCB_MIL_TO_COORD(10));
- conf_clamp_to(CFT_COORD, conf_core.design.via_thickness, MIN_PINORVIASIZE, MAX_PINORVIASIZE, PCB_MIL_TO_COORD(40));
- conf_clamp_to(CFT_COORD, conf_core.design.via_drilling_hole, 0, MAX_COORD, DEFAULT_DRILLINGHOLE * conf_core.design.via_thickness / 100);
- conf_clamp(CFT_COORD, conf_core.design.max_width, MIN_SIZE, MAX_COORD);
- conf_clamp(CFT_COORD, conf_core.design.max_height, MIN_SIZE, MAX_COORD);
+ conf_clamp_to(CFT_COORD, conf_core.design.line_thickness, PCB_MIN_LINESIZE, PCB_MAX_LINESIZE, PCB_MIL_TO_COORD(10));
+ conf_clamp_to(CFT_COORD, conf_core.design.via_thickness, PCB_MIN_PINORVIASIZE, PCB_MAX_PINORVIASIZE, PCB_MIL_TO_COORD(40));
+ conf_clamp_to(CFT_COORD, conf_core.design.via_drilling_hole, 0, PCB_MAX_COORD, PCB_DEFAULT_DRILLINGHOLE * conf_core.design.via_thickness / 100);
+ conf_clamp(CFT_COORD, conf_core.design.max_width, PCB_MIN_SIZE, PCB_MAX_COORD);
+ conf_clamp(CFT_COORD, conf_core.design.max_height, PCB_MIN_SIZE, PCB_MAX_COORD);
conf_force_set_bool(conf_core.rc.have_regex, 1);
conf_ro("rc/have_regex");
diff --git a/src/conf_core.h b/src/conf_core.h
index f2eab5d..0dd3ed8 100644
--- a/src/conf_core.h
+++ b/src/conf_core.h
@@ -2,6 +2,7 @@
#define PCB_CONF_CORE_H
#include "conf.h"
+#include "globalconst.h"
/* NOTE: this struct has a strict format because a code generator needs to
read it. Please always keep the format (preferably even whitespace style).
@@ -61,6 +62,11 @@ typedef struct {
CFT_BOOLEAN flip_y; /* view: flip the board along the Y (vertical) axis */
} view;
+ struct selection {
+ CFT_BOOLEAN disable_negative; /* selection box behaviour: disable the negative-direction selection - any selection box will select only what's fully within the box */
+ CFT_BOOLEAN symmetric_negative; /* selection box behaviour: when set, the selection direction is considered negative only if the box has negative size in the X direction */
+ } selection;
+
/* these two would need to be moved in the router plugin.... There are two
reasons to keep them here:
- the original pcb and pcb-rnd file formats already have named/numbered flags for these, so io_pcb needs these
@@ -76,9 +82,10 @@ typedef struct {
const struct rc {
CFT_INTEGER verbose;
+ CFT_INTEGER quiet; /* print only errors on stderr */
CFT_INTEGER backup_interval; /* time between two backups in seconds */
- CFT_STRING font_command; /* commands for file loading... */
- CFT_STRING file_command;
+ CFT_STRING font_command; /* file name template; if not empty, run this command and read its output for loading the font; %f is the file name */
+ CFT_STRING file_command; /* file name template; if not empty, run this command and read its output for loading a pcb file; %f is the file name, %p is the conf setting rc.file_path */
CFT_STRING file_path;
CFT_STRING library_shell;
CFT_LIST library_search_paths;
@@ -94,10 +101,12 @@ typedef struct {
CFT_STRING script_filename; /* PCB Actions script to execute on startup */
CFT_STRING action_string; /* PCB Actions string to execute on startup */
CFT_STRING rat_path;
- CFT_STRING rat_command;
+ CFT_STRING rat_command; /* file name template; if not empty, run this command and read its output for loading a rats; %f is the file name, %p is the rc.rat_path conf setting */
CFT_LIST preferred_gui; /* if set, try GUI HIDs in this order when no GUI is explicitly selected */
+ CFT_STRING save_final_fallback_fmt;/* when a new file is created (by running pcb-rnd with the file name) there won't be a known format; pcb-rnd will guess from the file name (extension) but eventhat may fail. This format is the final fallback that'll be used if no other guessing mechanism worked. The user can override this by save as. */
+
/***** automatically set (in postproc) *****/
CFT_BOOLEAN have_regex; /* whether we have regex compiled in */
struct path {
@@ -128,7 +137,7 @@ typedef struct {
CFT_COORD min_ring;
CFT_INTEGER text_scale; /* text scaling in % */
CFT_REAL poly_isle_area; /* polygon min area */
- CFT_STRING default_layer_name[MAX_LAYER];
+ CFT_STRING default_layer_name[PCB_MAX_LAYER];
CFT_STRING fab_author; /* Full name of author for FAB drawings */
CFT_STRING initial_layer_stack; /* If set, the initial layer stack is set to this */
@@ -171,8 +180,8 @@ typedef struct {
CFT_COLOR connected;
CFT_COLOR off_limit;
CFT_COLOR grid;
- CFT_COLOR layer[MAX_LAYER];
- CFT_COLOR layer_selected[MAX_LAYER];
+ CFT_COLOR layer[PCB_MAX_LAYER];
+ CFT_COLOR layer_selected[PCB_MAX_LAYER];
CFT_COLOR warn;
CFT_COLOR mask;
} color;
diff --git a/src/conf_hid.c b/src/conf_hid.c
index 665f83f..fb5081b 100644
--- a/src/conf_hid.c
+++ b/src/conf_hid.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "conf_hid.h"
#include <genht/hash.h>
#include <genht/htpp.h>
@@ -33,13 +34,13 @@ const conf_hid_callbacks_t *conf_hid_set_cb(conf_native_t *cfg, conf_hid_id_t id
static int conf_hid_id_next = 0;
static htpp_t *conf_hid_ids = NULL;
-static void conf_hid_init(void)
+static void conf_pcb_hid_init(void)
{
if (conf_hid_ids == NULL)
conf_hid_ids = htpp_alloc(ptrhash, ptrkeyeq);
}
-void conf_hid_uninit(void)
+void conf_pcb_hid_uninit(void)
{
if (conf_hid_ids != NULL) {
htpp_free(conf_hid_ids);
@@ -54,7 +55,7 @@ conf_hid_id_t conf_hid_reg(const char *cookie, const conf_hid_callbacks_t *cb)
if (cookie == NULL)
return -1;
- conf_hid_init();
+ conf_pcb_hid_init();
if (htpp_getentry(conf_hid_ids, (void *)cookie) != NULL)
return -1; /* already registered */
diff --git a/src/conf_hid.h b/src/conf_hid.h
index ed4d84e..53ecc26 100644
--- a/src/conf_hid.h
+++ b/src/conf_hid.h
@@ -2,6 +2,7 @@
#define PCB_CONF_HID_H
#include "conf.h"
+#include "error.h"
typedef struct conf_hid_callbacks_s {
/* Called before/after a value of a config item is updated - this doesn't necessarily mean the value actually changes */
@@ -40,13 +41,13 @@ conf_hid_id_t conf_hid_reg(const char *cookie, const conf_hid_callbacks_t *cb);
/* Unregister a hid; if unreg_item cb is specified, call it on each config item */
void conf_hid_unreg(const char *cookie);
-void conf_hid_uninit(void);
+void conf_pcb_hid_uninit(void);
/* Call the local callback of a native item */
#define conf_hid_local_cb(native, cb) \
do { \
- int __n__; \
+ unsigned int __n__; \
for(__n__ = 0; __n__ < vtp0_len(&((native)->hid_callbacks)); __n__++) { \
const conf_hid_callbacks_t *cbs = (native)->hid_callbacks.array[__n__]; \
if ((cbs != NULL) && (cbs->cb != NULL)) \
diff --git a/src/const.h b/src/const.h
index 41d33a4..23d0d10 100644
--- a/src/const.h
+++ b/src/const.h
@@ -29,53 +29,16 @@
#ifndef PCB_CONST_H
#define PCB_CONST_H
-#include <limits.h>
-#include <math.h>
-
-/* ---------------------------------------------------------------------------
- * the layer-numbers of the two additional special layers
- * 'component' and 'solder'. The offset of MAX_LAYER is not added
- */
-#define SOLDER_LAYER 0
-#define COMPONENT_LAYER 1
-
-/* ---------------------------------------------------------------------------
- * some math constants
- */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_SQRT1_2
-#define M_SQRT1_2 0.707106781 /* 1/sqrt(2) */
-#endif
-#define PCB_M180 (M_PI/180.0)
-#define PCB_RAD_TO_DEG (180.0/M_PI)
-#define PCB_TAN_22_5_DEGREE_2 0.207106781 /* 0.5*tan(22.5) */
-#define PCB_COS_22_5_DEGREE 0.923879533 /* cos(22.5) */
-#define PCB_TAN_30_DEGREE 0.577350269 /* tan(30) */
-#define PCB_TAN_60_DEGREE 1.732050808 /* tan(60) */
-#define PCB_LN_2_OVER_2 0.346573590
-
-/* PCB/physical unit conversions */
-#define PCB_COORD_TO_MIL(n) ((n) / 25400.0)
-#define PCB_MIL_TO_COORD(n) ((n) * 25400.0)
-#define PCB_COORD_TO_MM(n) ((n) / 1000000.0)
-#define PCB_MM_TO_COORD(n) ((n) * 1000000.0)
-#define PCB_COORD_TO_INCH(n) (PCB_COORD_TO_MIL(n) / 1000.0)
-#define PCB_INCH_TO_COORD(n) (PCB_MIL_TO_COORD(n) * 1000.0)
-#define PCB_COORD_TO_DECIMIL(n) (PCB_COORD_TO_MIL(n) * 10.0)
-#define PCB_DECIMIL_TO_COORD(n) (PCB_MIL_TO_COORD(n) / 10.0)
-
/* These need to be carefully written to avoid overflows, and return
a Coord type. */
-#define PCB_SCALE_TEXT(COORD,TEXTSCALE) ((Coord)((COORD) * ((double)(TEXTSCALE) / 100.0)))
-#define PCB_UNPCB_SCALE_TEXT(COORD,TEXTSCALE) ((Coord)((COORD) * (100.0 / (double)(TEXTSCALE))))
+#define PCB_SCALE_TEXT(COORD,TEXTSCALE) ((pcb_coord_t)((COORD) * ((double)(TEXTSCALE) / 100.0)))
+#define PCB_UNPCB_SCALE_TEXT(COORD,TEXTSCALE) ((pcb_coord_t)((COORD) * (100.0 / (double)(TEXTSCALE))))
/* ---------------------------------------------------------------------------
* modes
*/
typedef enum {
- PCB_MODE_NO = 0, /* no mode selected */
+ PCB_MODE_NO = 0, /* no mode selected - panning */
PCB_MODE_VIA = 1, /* draw vias */
PCB_MODE_LINE = 2, /* draw lines */
PCB_MODE_RECTANGLE = 3, /* create rectangles */
@@ -91,58 +54,11 @@ typedef enum {
PCB_MODE_THERMAL = 108, /* toggle thermal layer flag */
PCB_MODE_ARC = 109, /* draw arcs */
PCB_MODE_ARROW = 110, /* selection with arrow mode */
- PCB_MODE_PAN = 0, /* same as no mode */
PCB_MODE_LOCK = 111, /* lock/unlock objects */
PCB_MODE_POLYGON_HOLE = 112 /* cut holes in filled polygons */
} pcb_mode_t;
/* ---------------------------------------------------------------------------
- * object flags
- */
-
-/* %start-doc pcbfile ~objectflags
- at node Object Flags
- at section Object Flags
-
-Note that object flags can be given numerically (like @code{0x0147})
-or symbolically (like @code{"found,showname,square"}. Some numeric
-values are reused for different object types. The table below lists
-the numeric value followed by the symbolic name.
-%end-doc */
-typedef enum {
- PCB_FLAG_NO = 0x00000,
- PCB_FLAG_PIN = 0x00001, /*!< If set, this object is a pin. This flag is for internal use only. */
- PCB_FLAG_VIA = 0x00002, /*!< Likewise, for vias. */
- PCB_FLAG_FOUND = 0x00004, /*!< If set, this object has been found by @code{FindConnection()}. */
- PCB_FLAG_HOLE = 0x00008, /*!< For pins and vias, this flag means that the pin or via is a hole without a copper annulus. */
- PCB_FLAG_NOPASTE = 0x00008, /*!< Pad should not receive solderpaste. This is to support fiducials */
- PCB_FLAG_RAT = 0x00010, /*!< If set for a line, indicates that this line is a rat line instead of a copper trace. */
- PCB_FLAG_PININPOLY = 0x00010, /*!< For pins and pads, this flag is used internally to indicate that the pin or pad overlaps a polygon on some layer.*/
- PCB_FLAG_CLEARPOLY = 0x00010, /*!< For polygons, this flag means that pins and vias will normally clear these polygons (thus, thermals are required for electrical connection). When clear, polygons will solidly connect to pins and vias. */
- PCB_FLAG_HIDENAME = 0x00010, /*!< For elements, when set the name of the element is hidden. */
- PCB_FLAG_DISPLAYNAME = 0x00020, /*!< For elements, when set the names of pins are shown. */
- PCB_FLAG_CLEARLINE = 0x00020, /*!< For lines and arcs, the line/arc will clear polygons instead of connecting to them. */
- PCB_FLAG_FULLPOLY = 0x00020, /*!< For polygons, the full polygon is drawn (i.e. all parts instead of only the biggest one). */
- PCB_FLAG_SELECTED = 0x00040, /*!< Set when the object is selected. */
- PCB_FLAG_ONSOLDER = 0x00080, /*!< For elements and pads, indicates that they are on the solder side. */
- PCB_FLAG_AUTO = 0x00080, /*!< For lines and vias, indicates that these were created by the autorouter. */
- PCB_FLAG_SQUARE = 0x00100, /*!< For pins and pads, indicates a square (vs round) pin/pad. */
- PCB_FLAG_RUBBEREND = 0x00200, /*!< For lines, used internally for rubber band moves: indicates one end already rubber banding. */
- PCB_FLAG_WARN = 0x00200, /*!< For pins, vias, and pads, set to indicate a warning. */
- PCB_FLAG_USETHERMAL = 0x00400, /*!< Obsolete, indicates that pins/vias should be drawn with thermal fingers. */
- PCB_FLAG_ONSILK = 0x00400, /*!< Obsolete, old files used this to indicate lines drawn on silk. (Used by io_pcb for compatibility.) */
- PCB_FLAG_OCTAGON = 0x00800, /*!< Draw pins and vias as octagons. */
- PCB_FLAG_DRC = 0x01000, /*!< Set for objects that fail DRC: flag like FOUND flag for DRC checking. */
- PCB_FLAG_LOCK = 0x02000, /*!< Set for locked objects. */
- PCB_FLAG_EDGE2 = 0x04000, /*!< For pads, indicates that the second point is closer to the edge. For pins, indicates that the pin is closer to a horizontal edge and thus pinout text should be vertical. (Padr.Point2 is closer to outside edge also pinout text for pins is vertical) */
- PCB_FLAG_VISIT = 0x08000, /*!< marker to avoid re-visiting an object */
- PCB_FLAG_NONETLIST = 0x10000, /* element is not on the netlist and should not interfere with the netlist */
- PCB_FLAG_MINCUT = 0x20000, /* used by the mincut short find code */
- PCB_FLAG_ONPOINT = 0x40000 /*!< crosshair is on line point or arc point */
-/* PCB_FLAG_NOCOPY = (PCB_FLAG_FOUND | CONNECTEDFLAG | PCB_FLAG_ONPOINT)*/
-} pcb_flag_t;
-
-/* ---------------------------------------------------------------------------
* object types (bitfield)
*/
typedef enum {
@@ -166,6 +82,8 @@ typedef enum {
PCB_TYPE_LOCKED = 0x10000, /* used to tell search to include locked items. */
PCB_TYPE_NET = 0x20000, /* used to select whole net. */
+ PCB_TYPE_ARC_POINT = 0x40000,
+
/* groups/properties */
PCB_TYPEMASK_PIN = (PCB_TYPE_VIA | PCB_TYPE_PIN),
PCB_TYPEMASK_LOCK = (PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_POLYGON | PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_LOCKED),
diff --git a/src/copy.c b/src/copy.c
index d1dddd0..273aa5d 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -32,36 +32,17 @@
#include "config.h"
#include "conf_core.h"
-#include <stdlib.h>
-
-
-#include "create.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
-#include "misc.h"
-#include "layer.h"
-#include "move.h"
-#include "polygon.h"
-#include "rtree.h"
#include "select.h"
#include "undo.h"
-#include "compat_misc.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *CopyVia(PinTypePtr);
-static void *CopyLine(LayerTypePtr, LineTypePtr);
-static void *CopyArc(LayerTypePtr, ArcTypePtr);
-static void *CopyText(LayerTypePtr, TextTypePtr);
-static void *CopyPolygon(LayerTypePtr, PolygonTypePtr);
-static void *CopyElement(ElementTypePtr);
+#include "obj_all_op.h"
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord DeltaX, DeltaY; /* movement vector */
-static ObjectFunctionType CopyFunctions = {
+static pcb_opfunc_t CopyFunctions = {
CopyLine,
CopyText,
CopyPolygon,
@@ -73,304 +54,26 @@ static ObjectFunctionType CopyFunctions = {
NULL,
NULL,
CopyArc,
+ NULL,
NULL
};
/* ---------------------------------------------------------------------------
- * copies data from one polygon to another
- * 'Dest' has to exist
- */
-PolygonTypePtr CopyPolygonLowLevel(PolygonTypePtr Dest, PolygonTypePtr Src)
-{
- pcb_cardinal_t hole = 0;
- pcb_cardinal_t n;
-
- for (n = 0; n < Src->PointN; n++) {
- if (hole < Src->HoleIndexN && n == Src->HoleIndex[hole]) {
- CreateNewHoleInPolygon(Dest);
- hole++;
- }
- CreateNewPointInPolygon(Dest, Src->Points[n].X, Src->Points[n].Y);
- }
- SetPolygonBoundingBox(Dest);
- Dest->Flags = Src->Flags;
- CLEAR_FLAG(PCB_FLAG_FOUND, Dest);
- return (Dest);
-}
-
-/* ---------------------------------------------------------------------------
- * copies data from one element to another and creates the destination
- * if necessary
- */
-ElementTypePtr
-CopyElementLowLevel(DataTypePtr Data, ElementTypePtr Dest, ElementTypePtr Src, pcb_bool uniqueName, Coord dx, Coord dy)
-{
- int i;
- /* release old memory if necessary */
- if (Dest)
- FreeElementMemory(Dest);
-
- /* both coordinates and flags are the same */
- Dest = CreateNewElement(Data, Dest, &PCB->Font,
- MaskFlags(Src->Flags, PCB_FLAG_FOUND),
- DESCRIPTION_NAME(Src), NAMEONPCB_NAME(Src),
- VALUE_NAME(Src), DESCRIPTION_TEXT(Src).X + dx,
- DESCRIPTION_TEXT(Src).Y + dy,
- DESCRIPTION_TEXT(Src).Direction,
- DESCRIPTION_TEXT(Src).Scale, MaskFlags(DESCRIPTION_TEXT(Src).Flags, PCB_FLAG_FOUND), uniqueName);
-
- /* abort on error */
- if (!Dest)
- return (Dest);
-
- ELEMENTLINE_LOOP(Src);
- {
- CreateNewLineInElement(Dest, line->Point1.X + dx,
- line->Point1.Y + dy, line->Point2.X + dx, line->Point2.Y + dy, line->Thickness);
- }
- END_LOOP;
- PIN_LOOP(Src);
- {
- CreateNewPin(Dest, pin->X + dx, pin->Y + dy, pin->Thickness,
- pin->Clearance, pin->Mask, pin->DrillingHole, pin->Name, pin->Number, MaskFlags(pin->Flags, PCB_FLAG_FOUND));
- }
- END_LOOP;
- PAD_LOOP(Src);
- {
- CreateNewPad(Dest, pad->Point1.X + dx, pad->Point1.Y + dy,
- pad->Point2.X + dx, pad->Point2.Y + dy, pad->Thickness,
- pad->Clearance, pad->Mask, pad->Name, pad->Number, MaskFlags(pad->Flags, PCB_FLAG_FOUND));
- }
- END_LOOP;
- ARC_LOOP(Src);
- {
- CreateNewArcInElement(Dest, arc->X + dx, arc->Y + dy, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness);
- }
- END_LOOP;
-
- for (i = 0; i < Src->Attributes.Number; i++)
- CreateNewAttribute(&Dest->Attributes, Src->Attributes.List[i].name, Src->Attributes.List[i].value);
-
- Dest->MarkX = Src->MarkX + dx;
- Dest->MarkY = Src->MarkY + dy;
-
- SetElementBoundingBox(Data, Dest, &PCB->Font);
- return (Dest);
-}
-
-/* ---------------------------------------------------------------------------
- * copies a via
- */
-static void *CopyVia(PinTypePtr Via)
-{
- PinTypePtr via;
-
- via = CreateNewVia(PCB->Data, Via->X + DeltaX, Via->Y + DeltaY,
- Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, PCB_FLAG_FOUND));
- if (!via)
- return (via);
- DrawVia(via);
- AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via);
- return (via);
-}
-
-/* ---------------------------------------------------------------------------
- * copies a line
- */
-static void *CopyLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- LineTypePtr line;
-
- line = CreateDrawnLineOnLayer(Layer, Line->Point1.X + DeltaX,
- Line->Point1.Y + DeltaY,
- Line->Point2.X + DeltaX,
- Line->Point2.Y + DeltaY, Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, PCB_FLAG_FOUND));
- if (!line)
- return (line);
- if (Line->Number)
- line->Number = pcb_strdup(Line->Number);
- DrawLine(Layer, line);
- AddObjectToCreateUndoList(PCB_TYPE_LINE, Layer, line, line);
- return (line);
-}
-
-/* ---------------------------------------------------------------------------
- * copies an arc
- */
-static void *CopyArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- ArcTypePtr arc;
-
- arc = CreateNewArcOnLayer(Layer, Arc->X + DeltaX,
- Arc->Y + DeltaY, Arc->Width, Arc->Height, Arc->StartAngle,
- Arc->Delta, Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, PCB_FLAG_FOUND));
- if (!arc)
- return (arc);
- DrawArc(Layer, arc);
- AddObjectToCreateUndoList(PCB_TYPE_ARC, Layer, arc, arc);
- return (arc);
-}
-
-/* ---------------------------------------------------------------------------
- * copies a text
- */
-static void *CopyText(LayerTypePtr Layer, TextTypePtr Text)
-{
- TextTypePtr text;
-
- text = CreateNewText(Layer, &PCB->Font, Text->X + DeltaX,
- Text->Y + DeltaY, Text->Direction, Text->Scale, Text->TextString, MaskFlags(Text->Flags, PCB_FLAG_FOUND));
- DrawText(Layer, text);
- AddObjectToCreateUndoList(PCB_TYPE_TEXT, Layer, text, text);
- return (text);
-}
-
-/* ---------------------------------------------------------------------------
- * copies a polygon
- */
-static void *CopyPolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- PolygonTypePtr polygon;
-
- polygon = CreateNewPolygon(Layer, NoFlags());
- CopyPolygonLowLevel(polygon, Polygon);
- MovePolygonLowLevel(polygon, DeltaX, DeltaY);
- if (!Layer->polygon_tree)
- Layer->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Layer->polygon_tree, (BoxTypePtr) polygon, 0);
- InitClip(PCB->Data, Layer, polygon);
- DrawPolygon(Layer, polygon);
- AddObjectToCreateUndoList(PCB_TYPE_POLYGON, Layer, polygon, polygon);
- return (polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * copies an element onto the PCB. Then does a draw.
- */
-static void *CopyElement(ElementTypePtr Element)
-{
-
-#ifdef DEBUG
- printf("Entered CopyElement, trying to copy element %s\n", Element->Name[1].TextString);
-#endif
-
- ElementTypePtr element = CopyElementLowLevel(PCB->Data,
- NULL, Element,
- conf_core.editor.unique_names, DeltaX,
- DeltaY);
-
- /* this call clears the polygons */
- AddObjectToCreateUndoList(PCB_TYPE_ELEMENT, element, element, element);
- if (PCB->ElementOn && (FRONT(element) || PCB->InvisibleObjectsOn)) {
- DrawElementName(element);
- DrawElementPackage(element);
- }
- if (PCB->PinOn) {
- DrawElementPinsAndPads(element);
- }
-#ifdef DEBUG
- printf(" ... Leaving CopyElement.\n");
-#endif
- return (element);
-}
-
-/* ---------------------------------------------------------------------------
- * pastes the contents of the buffer to the layout. Only visible objects
- * are handled by the routine.
- */
-pcb_bool CopyPastebufferToLayout(Coord X, Coord Y)
-{
- pcb_cardinal_t i;
- pcb_bool changed = pcb_false;
-
-#ifdef DEBUG
- printf("Entering CopyPastebufferToLayout.....\n");
-#endif
-
- /* set movement vector */
- DeltaX = X - PASTEBUFFER->X, DeltaY = Y - PASTEBUFFER->Y;
-
- /* paste all layers */
- for (i = 0; i < max_copper_layer + 2; i++) {
- LayerTypePtr sourcelayer = &PASTEBUFFER->Data->Layer[i], destlayer = LAYER_PTR(i);
-
- if (destlayer->On) {
- changed = changed || (!LAYER_IS_EMPTY(sourcelayer));
- LINE_LOOP(sourcelayer);
- {
- CopyLine(destlayer, line);
- }
- END_LOOP;
- ARC_LOOP(sourcelayer);
- {
- CopyArc(destlayer, arc);
- }
- END_LOOP;
- TEXT_LOOP(sourcelayer);
- {
- CopyText(destlayer, text);
- }
- END_LOOP;
- POLYGON_LOOP(sourcelayer);
- {
- CopyPolygon(destlayer, polygon);
- }
- END_LOOP;
- }
- }
-
- /* paste elements */
- if (PCB->PinOn && PCB->ElementOn) {
- ELEMENT_LOOP(PASTEBUFFER->Data);
- {
-#ifdef DEBUG
- printf("In CopyPastebufferToLayout, pasting element %s\n", element->Name[1].TextString);
-#endif
- if (FRONT(element) || PCB->InvisibleObjectsOn) {
- CopyElement(element);
- changed = pcb_true;
- }
- }
- END_LOOP;
- }
-
- /* finally the vias */
- if (PCB->ViaOn) {
- changed |= (pinlist_length(&(PASTEBUFFER->Data->Via)) != 0);
- VIA_LOOP(PASTEBUFFER->Data);
- {
- CopyVia(via);
- }
- END_LOOP;
- }
-
- if (changed) {
- Draw();
- IncrementUndoSerialNumber();
- }
-
-#ifdef DEBUG
- printf(" .... Leaving CopyPastebufferToLayout.\n");
-#endif
-
- return (changed);
-}
-
-/* ---------------------------------------------------------------------------
* copies the object identified by its data pointers and the type
* the new objects is moved by DX,DY
* I assume that the appropriate layer ... is switched on
*/
-void *CopyObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
+void *pcb_copy_obj(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY)
{
void *ptr;
+ pcb_opctx_t ctx;
- /* setup movement vector */
- DeltaX = DX;
- DeltaY = DY;
+ ctx.copy.pcb = PCB;
+ ctx.copy.DeltaX = DX;
+ ctx.copy.DeltaY = DY;
/* the subroutines add the objects to the undo-list */
- ptr = ObjectOperation(&CopyFunctions, Type, Ptr1, Ptr2, Ptr3);
- IncrementUndoSerialNumber();
+ ptr = pcb_object_operation(&CopyFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
+ pcb_undo_inc_serial();
return (ptr);
}
diff --git a/src/copy.h b/src/copy.h
index 09aa7b1..8ccac7c 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -29,19 +29,15 @@
#ifndef PCB_COPY_H
#define PCB_COPY_H
-#include "global.h"
+#include "config.h"
/* ---------------------------------------------------------------------------
* some defines
*/
-#define COPY_TYPES \
+#define PCB_COPY_TYPES \
(PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_TEXT | \
PCB_TYPE_ELEMENT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_POLYGON | PCB_TYPE_ARC)
-
-PolygonTypePtr CopyPolygonLowLevel(PolygonTypePtr, PolygonTypePtr);
-ElementTypePtr CopyElementLowLevel(DataTypePtr, ElementTypePtr, ElementTypePtr, pcb_bool, Coord, Coord);
-pcb_bool CopyPastebufferToLayout(Coord, Coord);
-void *CopyObject(int, void *, void *, void *, Coord, Coord);
+void *pcb_copy_obj(int, void *, void *, void *, pcb_coord_t, pcb_coord_t);
#endif
diff --git a/src/create.c b/src/create.c
deleted file mode 100644
index 87f6300..0000000
--- a/src/create.c
+++ /dev/null
@@ -1,952 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996, 2005 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 at rz.uni-ulm.de
- *
- */
-
-/* functions used to create vias, pins ... */
-
-#include "config.h"
-
-#include <assert.h>
-#include <memory.h>
-#include <setjmp.h>
-#include <stdlib.h>
-
-#include "conf_core.h"
-
-#include "create.h"
-#include "data.h"
-#include "error.h"
-#include "misc.h"
-#include "layer.h"
-#include "rtree.h"
-#include "search.h"
-#include "undo.h"
-#include "plug_io.h"
-#include "stub_vendor.h"
-#include "hid_actions.h"
-#include "paths.h"
-#include "misc_util.h"
-#include "compat_misc.h"
-
-/* ---------------------------------------------------------------------------
- * some local identifiers
- */
-
-/* current object ID; incremented after each creation of an object */
-static long int ID = 1;
-
-static pcb_bool be_lenient = pcb_false;
-
-/* ----------------------------------------------------------------------
- * some local prototypes
- */
-static void AddTextToElement(TextTypePtr, FontTypePtr, Coord, Coord, unsigned, char *, int, FlagType);
-
-/* ---------------------------------------------------------------------------
- * Set the lenience mode.
- */
-
-void CreateBeLenient(pcb_bool v)
-{
- be_lenient = v;
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new paste buffer
- */
-DataTypePtr CreateNewBuffer(void)
-{
- DataTypePtr data;
- data = (DataTypePtr) calloc(1, sizeof(DataType));
- data->pcb = (PCBTypePtr) PCB;
- return data;
-}
-
-/* ---------------------------------------------------------------------------
- * Perhaps PCB should internally just use the Settings colors? For now,
- * use this to set PCB colors so the config can reassign PCB colors.
- */
-void pcb_colors_from_settings(PCBTypePtr ptr)
-{
- int i;
-
- /* copy default settings */
- ptr->ConnectedColor = conf_core.appearance.color.connected;
- ptr->ElementColor = conf_core.appearance.color.element;
- ptr->ElementColor_nonetlist = conf_core.appearance.color.element_nonetlist;
- ptr->RatColor = conf_core.appearance.color.rat;
- ptr->InvisibleObjectsColor = conf_core.appearance.color.invisible_objects;
- ptr->InvisibleMarkColor = conf_core.appearance.color.invisible_mark;
- ptr->ElementSelectedColor = conf_core.appearance.color.element_selected;
- ptr->RatSelectedColor = conf_core.appearance.color.rat_selected;
- ptr->PinColor = conf_core.appearance.color.pin;
- ptr->PinSelectedColor = conf_core.appearance.color.pin_selected;
- ptr->PinNameColor = conf_core.appearance.color.pin_name;
- ptr->ViaColor = conf_core.appearance.color.via;
- ptr->ViaSelectedColor = conf_core.appearance.color.via_selected;
- ptr->WarnColor = conf_core.appearance.color.warn;
- ptr->MaskColor = conf_core.appearance.color.mask;
- for (i = 0; i < MAX_LAYER; i++) {
- ptr->Data->Layer[i].Color = conf_core.appearance.color.layer[i];
- ptr->Data->Layer[i].SelectedColor = conf_core.appearance.color.layer_selected[i];
- }
- ptr->Data->Layer[component_silk_layer].Color =
- conf_core.editor.show_solder_side ? conf_core.appearance.color.invisible_objects : conf_core.appearance.color.element;
- ptr->Data->Layer[component_silk_layer].SelectedColor = conf_core.appearance.color.element_selected;
- ptr->Data->Layer[solder_silk_layer].Color = conf_core.editor.show_solder_side ? conf_core.appearance.color.element : conf_core.appearance.color.invisible_objects;
- ptr->Data->Layer[solder_silk_layer].SelectedColor = conf_core.appearance.color.element_selected;
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new PCB
- */
-PCBTypePtr CreateNewPCB_(pcb_bool SetDefaultNames)
-{
- PCBTypePtr ptr, save;
- int i;
-
- /* allocate memory, switch all layers on and copy resources */
- ptr = (PCBTypePtr) calloc(1, sizeof(PCBType));
- ptr->Data = CreateNewBuffer();
- ptr->Data->pcb = (PCBTypePtr) ptr;
-
- ptr->ThermStyle = 4;
- ptr->IsleArea = 2.e8;
- ptr->SilkActive = pcb_false;
- ptr->RatDraw = pcb_false;
-
- /* NOTE: we used to set all the pcb flags on ptr here, but we don't need to do that anymore due to the new conf system */
- /* this is the most useful starting point for now */
-
- ptr->Grid = conf_core.editor.grid;
- ParseGroupString(conf_core.design.groups, &ptr->LayerGroups, MAX_LAYER);
- save = PCB;
- PCB = ptr;
- hid_action("RouteStylesChanged");
- PCB = save;
- ptr->Zoom = conf_core.editor.zoom;
- ptr->MaxWidth = conf_core.design.max_width;
- ptr->MaxHeight = conf_core.design.max_height;
- ptr->ID = ID++;
- ptr->ThermScale = 0.5;
-
- ptr->Bloat = conf_core.design.bloat;
- ptr->Shrink = conf_core.design.shrink;
- ptr->minWid = conf_core.design.min_wid;
- ptr->minSlk = conf_core.design.min_slk;
- ptr->minDrill = conf_core.design.min_drill;
- ptr->minRing = conf_core.design.min_ring;
-
- for (i = 0; i < MAX_LAYER; i++)
- ptr->Data->Layer[i].Name = pcb_strdup(conf_core.design.default_layer_name[i]);
-
- CreateDefaultFont(ptr);
-
- return (ptr);
-}
-
-PCBTypePtr CreateNewPCB()
-{
- PCBTypePtr old, nw;
- int dpcb;
-
- old = PCB;
-
- PCB = NULL;
-
- dpcb = -1;
- pcb_io_err_inhibit_inc();
- conf_list_foreach_path_first(dpcb, &conf_core.rc.default_pcb_file, LoadPCB(__path__, NULL, pcb_false, 1));
- pcb_io_err_inhibit_dec();
-
- if (dpcb == 0) {
- nw = PCB;
- if (nw->Filename != NULL) {
- /* make sure the new PCB doesn't inherit the name of the default pcb */
- free(nw->Filename);
- nw->Filename = NULL;
- }
- }
- else {
- nw = NULL;
- }
-
- PCB = old;
- return nw;
-}
-
-
-/* This post-processing step adds the top and bottom silk layers to a
- * pre-existing PCB.
- */
-int CreateNewPCBPost(PCBTypePtr pcb, int use_defaults)
-{
- /* copy default settings */
- pcb_colors_from_settings(pcb);
-
- return 0;
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new via
- */
-PinTypePtr
-CreateNewVia(DataTypePtr Data,
- Coord X, Coord Y,
- Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, const char *Name, FlagType Flags)
-{
- PinTypePtr Via;
-
- if (!be_lenient) {
- VIA_LOOP(Data);
- {
- if (Distance(X, Y, via->X, via->Y) <= via->DrillingHole / 2 + DrillingHole / 2) {
- Message(PCB_MSG_DEFAULT, _("%m+Dropping via at %$mD because it's hole would overlap with the via "
- "at %$mD\n"), conf_core.editor.grid_unit->allow, X, Y, via->X, via->Y);
- return (NULL); /* don't allow via stacking */
- }
- }
- END_LOOP;
- }
-
- Via = GetViaMemory(Data);
-
- if (!Via)
- return (Via);
- /* copy values */
- Via->X = X;
- Via->Y = Y;
- Via->Thickness = Thickness;
- Via->Clearance = Clearance;
- Via->Mask = Mask;
- Via->DrillingHole = stub_vendorDrillMap(DrillingHole);
- if (Via->DrillingHole != DrillingHole) {
- Message(PCB_MSG_DEFAULT, _("%m+Mapped via drill hole to %$mS from %$mS per vendor table\n"),
- conf_core.editor.grid_unit->allow, Via->DrillingHole, DrillingHole);
- }
-
- Via->Name = pcb_strdup_null(Name);
- Via->Flags = Flags;
- CLEAR_FLAG(PCB_FLAG_WARN, Via);
- SET_FLAG(PCB_FLAG_VIA, Via);
- Via->ID = ID++;
-
- /*
- * don't complain about MIN_PINORVIACOPPER on a mounting hole (pure
- * hole)
- */
- if (!TEST_FLAG(PCB_FLAG_HOLE, Via) && (Via->Thickness < Via->DrillingHole + MIN_PINORVIACOPPER)) {
- Via->Thickness = Via->DrillingHole + MIN_PINORVIACOPPER;
- Message(PCB_MSG_DEFAULT, _("%m+Increased via thickness to %$mS to allow enough copper"
- " at %$mD.\n"), conf_core.editor.grid_unit->allow, Via->Thickness, Via->X, Via->Y);
- }
-
- pcb_add_via(Data, Via);
- return (Via);
-}
-
-void pcb_add_via(DataType *Data, PinType *Via)
-{
- SetPinBoundingBox(Via);
- if (!Data->via_tree)
- Data->via_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Data->via_tree, (BoxTypePtr) Via, 0);
-}
-
-struct line_info {
- Coord X1, X2, Y1, Y2;
- Coord Thickness;
- FlagType Flags;
- LineType test, *ans;
- jmp_buf env;
-};
-
-static r_dir_t line_callback(const BoxType * b, void *cl)
-{
- LineTypePtr line = (LineTypePtr) b;
- struct line_info *i = (struct line_info *) cl;
-
- if (line->Point1.X == i->X1 && line->Point2.X == i->X2 && line->Point1.Y == i->Y1 && line->Point2.Y == i->Y2) {
- i->ans = (LineTypePtr) (-1);
- longjmp(i->env, 1);
- }
- /* check the other point order */
- if (line->Point1.X == i->X1 && line->Point2.X == i->X2 && line->Point1.Y == i->Y1 && line->Point2.Y == i->Y2) {
- i->ans = (LineTypePtr) (-1);
- longjmp(i->env, 1);
- }
- if (line->Point2.X == i->X1 && line->Point1.X == i->X2 && line->Point2.Y == i->Y1 && line->Point1.Y == i->Y2) {
- i->ans = (LineTypePtr) - 1;
- longjmp(i->env, 1);
- }
- /* remove unnecessary line points */
- if (line->Thickness == i->Thickness
- /* don't merge lines if the clear flags differ */
- && TEST_FLAG(PCB_FLAG_CLEARLINE, line) == TEST_FLAG(PCB_FLAG_CLEARLINE, i)) {
- if (line->Point1.X == i->X1 && line->Point1.Y == i->Y1) {
- i->test.Point1.X = line->Point2.X;
- i->test.Point1.Y = line->Point2.Y;
- i->test.Point2.X = i->X2;
- i->test.Point2.Y = i->Y2;
- if (IsPointOnLine(i->X1, i->Y1, 0.0, &i->test)) {
- i->ans = line;
- longjmp(i->env, 1);
- }
- }
- else if (line->Point2.X == i->X1 && line->Point2.Y == i->Y1) {
- i->test.Point1.X = line->Point1.X;
- i->test.Point1.Y = line->Point1.Y;
- i->test.Point2.X = i->X2;
- i->test.Point2.Y = i->Y2;
- if (IsPointOnLine(i->X1, i->Y1, 0.0, &i->test)) {
- i->ans = line;
- longjmp(i->env, 1);
- }
- }
- else if (line->Point1.X == i->X2 && line->Point1.Y == i->Y2) {
- i->test.Point1.X = line->Point2.X;
- i->test.Point1.Y = line->Point2.Y;
- i->test.Point2.X = i->X1;
- i->test.Point2.Y = i->Y1;
- if (IsPointOnLine(i->X2, i->Y2, 0.0, &i->test)) {
- i->ans = line;
- longjmp(i->env, 1);
- }
- }
- else if (line->Point2.X == i->X2 && line->Point2.Y == i->Y2) {
- i->test.Point1.X = line->Point1.X;
- i->test.Point1.Y = line->Point1.Y;
- i->test.Point2.X = i->X1;
- i->test.Point2.Y = i->Y1;
- if (IsPointOnLine(i->X2, i->Y2, 0.0, &i->test)) {
- i->ans = line;
- longjmp(i->env, 1);
- }
- }
- }
- return R_DIR_NOT_FOUND;
-}
-
-
-/* ---------------------------------------------------------------------------
- * creates a new line on a layer and checks for overlap and extension
- */
-LineTypePtr
-CreateDrawnLineOnLayer(LayerTypePtr Layer,
- Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, FlagType Flags)
-{
- struct line_info info;
- BoxType search;
-
- search.X1 = MIN(X1, X2);
- search.X2 = MAX(X1, X2);
- search.Y1 = MIN(Y1, Y2);
- search.Y2 = MAX(Y1, Y2);
- if (search.Y2 == search.Y1)
- search.Y2++;
- if (search.X2 == search.X1)
- search.X2++;
- info.X1 = X1;
- info.X2 = X2;
- info.Y1 = Y1;
- info.Y2 = Y2;
- info.Thickness = Thickness;
- info.Flags = Flags;
- info.test.Thickness = 0;
- info.test.Flags = NoFlags();
- info.ans = NULL;
- /* prevent stacking of duplicate lines
- * and remove needless intermediate points
- * verify that the layer is on the board first!
- */
- if (setjmp(info.env) == 0) {
- r_search(Layer->line_tree, &search, NULL, line_callback, &info, NULL);
- return CreateNewLineOnLayer(Layer, X1, Y1, X2, Y2, Thickness, Clearance, Flags);
- }
-
- if ((void *) info.ans == (void *) (-1))
- return NULL; /* stacked line */
- /* remove unnecessary points */
- if (info.ans) {
- /* must do this BEFORE getting new line memory */
- MoveObjectToRemoveUndoList(PCB_TYPE_LINE, Layer, info.ans, info.ans);
- X1 = info.test.Point1.X;
- X2 = info.test.Point2.X;
- Y1 = info.test.Point1.Y;
- Y2 = info.test.Point2.Y;
- }
- return CreateNewLineOnLayer(Layer, X1, Y1, X2, Y2, Thickness, Clearance, Flags);
-}
-
-LineTypePtr
-CreateNewLineOnLayer(LayerTypePtr Layer,
- Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, FlagType Flags)
-{
- LineTypePtr Line;
-
- Line = GetLineMemory(Layer);
- if (!Line)
- return (Line);
- Line->ID = ID++;
- Line->Flags = Flags;
- CLEAR_FLAG(PCB_FLAG_RAT, Line);
- Line->Thickness = Thickness;
- Line->Clearance = Clearance;
- Line->Point1.X = X1;
- Line->Point1.Y = Y1;
- Line->Point1.ID = ID++;
- Line->Point2.X = X2;
- Line->Point2.Y = Y2;
- Line->Point2.ID = ID++;
- pcb_add_line_on_layer(Layer, Line);
- return (Line);
-}
-
-void pcb_add_line_on_layer(LayerType *Layer, LineType *Line)
-{
- SetLineBoundingBox(Line);
- if (!Layer->line_tree)
- Layer->line_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Layer->line_tree, (BoxTypePtr) Line, 0);
-}
-
-
-/* ---------------------------------------------------------------------------
- * creates a new rat-line
- */
-RatTypePtr
-CreateNewRat(DataTypePtr Data, Coord X1, Coord Y1,
- Coord X2, Coord Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, Coord Thickness, FlagType Flags)
-{
- RatTypePtr Line = GetRatMemory(Data);
-
- if (!Line)
- return (Line);
-
- Line->ID = ID++;
- Line->Flags = Flags;
- SET_FLAG(PCB_FLAG_RAT, Line);
- Line->Thickness = Thickness;
- Line->Point1.X = X1;
- Line->Point1.Y = Y1;
- Line->Point1.ID = ID++;
- Line->Point2.X = X2;
- Line->Point2.Y = Y2;
- Line->Point2.ID = ID++;
- Line->group1 = group1;
- Line->group2 = group2;
- SetLineBoundingBox((LineTypePtr) Line);
- if (!Data->rat_tree)
- Data->rat_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Data->rat_tree, &Line->BoundingBox, 0);
- return (Line);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new arc on a layer
- */
-ArcTypePtr
-CreateNewArcOnLayer(LayerTypePtr Layer,
- Coord X1, Coord Y1,
- Coord width, Coord height, Angle sa, Angle dir, Coord Thickness, Coord Clearance, FlagType Flags)
-{
- ArcTypePtr Arc;
-
- ARC_LOOP(Layer);
- {
- if (arc->X == X1 && arc->Y == Y1 && arc->Width == width &&
- NormalizeAngle(arc->StartAngle) == NormalizeAngle(sa) && arc->Delta == dir)
- return (NULL); /* prevent stacked arcs */
- }
- END_LOOP;
- Arc = GetArcMemory(Layer);
- if (!Arc)
- return (Arc);
-
- Arc->ID = ID++;
- Arc->Flags = Flags;
- Arc->Thickness = Thickness;
- Arc->Clearance = Clearance;
- Arc->X = X1;
- Arc->Y = Y1;
- Arc->Width = width;
- Arc->Height = height;
- Arc->StartAngle = sa;
- Arc->Delta = dir;
- pcb_add_arc_on_layer(Layer, Arc);
- return (Arc);
-}
-
-void pcb_add_arc_on_layer(LayerType *Layer, ArcType *Arc)
-{
- SetArcBoundingBox(Arc);
- if (!Layer->arc_tree)
- Layer->arc_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) Arc, 0);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new polygon from the old formats rectangle data
- */
-PolygonTypePtr CreateNewPolygonFromRectangle(LayerTypePtr Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, FlagType Flags)
-{
- PolygonTypePtr polygon = CreateNewPolygon(Layer, Flags);
- if (!polygon)
- return (polygon);
-
- CreateNewPointInPolygon(polygon, X1, Y1);
- CreateNewPointInPolygon(polygon, X2, Y1);
- CreateNewPointInPolygon(polygon, X2, Y2);
- CreateNewPointInPolygon(polygon, X1, Y2);
-
- pcb_add_polygon_on_layer(Layer, polygon);
- return (polygon);
-}
-
-void pcb_add_polygon_on_layer(LayerType *Layer, PolygonType *polygon)
-{
- SetPolygonBoundingBox(polygon);
- if (!Layer->polygon_tree)
- Layer->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Layer->polygon_tree, (BoxTypePtr) polygon, 0);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new text on a layer
- */
-TextTypePtr
-CreateNewText(LayerTypePtr Layer, FontTypePtr PCBFont,
- Coord X, Coord Y, unsigned Direction, int Scale, char *TextString, FlagType Flags)
-{
- TextType *text;
-
- if (TextString == NULL)
- return NULL;
-
- text = GetTextMemory(Layer);
- if (text == NULL)
- return NULL;
-
- /* copy values, width and height are set by drawing routine
- * because at this point we don't know which symbols are available
- */
- text->X = X;
- text->Y = Y;
- text->Direction = Direction;
- text->Flags = Flags;
- text->Scale = Scale;
- text->TextString = pcb_strdup(TextString);
-
- pcb_add_text_on_layer(Layer, text, PCBFont);
-
- return (text);
-}
-
-void pcb_add_text_on_layer(LayerType *Layer, TextType *text, FontType *PCBFont)
-{
- /* calculate size of the bounding box */
- SetTextBoundingBox(PCBFont, text);
- text->ID = ID++;
- if (!Layer->text_tree)
- Layer->text_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Layer->text_tree, (BoxTypePtr) text, 0);
-}
-
-
-
-/* ---------------------------------------------------------------------------
- * creates a new polygon on a layer
- */
-PolygonTypePtr CreateNewPolygon(LayerTypePtr Layer, FlagType Flags)
-{
- PolygonTypePtr polygon = GetPolygonMemory(Layer);
-
- /* copy values */
- polygon->Flags = Flags;
- polygon->ID = ID++;
- polygon->Clipped = NULL;
- polygon->NoHoles = NULL;
- polygon->NoHolesValid = 0;
- return (polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new point in a polygon
- */
-PointTypePtr CreateNewPointInPolygon(PolygonTypePtr Polygon, Coord X, Coord Y)
-{
- PointTypePtr point = GetPointMemoryInPolygon(Polygon);
-
- /* copy values */
- point->X = X;
- point->Y = Y;
- point->ID = ID++;
- return (point);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new hole in a polygon
- */
-PolygonType *CreateNewHoleInPolygon(PolygonType * Polygon)
-{
- pcb_cardinal_t *holeindex = GetHoleIndexMemoryInPolygon(Polygon);
- *holeindex = Polygon->PointN;
- return Polygon;
-}
-
-/* ---------------------------------------------------------------------------
- * creates an new element
- * memory is allocated if needed
- */
-ElementTypePtr
-CreateNewElement(DataTypePtr Data, ElementTypePtr Element,
- FontTypePtr PCBFont,
- FlagType Flags,
- char *Description, char *NameOnPCB, char *Value,
- Coord TextX, Coord TextY, pcb_uint8_t Direction, int TextScale, FlagType TextFlags, pcb_bool uniqueName)
-{
-#ifdef DEBUG
- printf("Entered CreateNewElement.....\n");
-#endif
-
- if (!Element)
- Element = GetElementMemory(Data);
-
- /* copy values and set additional information */
- TextScale = MAX(MIN_TEXTSCALE, TextScale);
- AddTextToElement(&DESCRIPTION_TEXT(Element), PCBFont, TextX, TextY, Direction, Description, TextScale, TextFlags);
- if (uniqueName)
- NameOnPCB = UniqueElementName(Data, NameOnPCB);
- AddTextToElement(&NAMEONPCB_TEXT(Element), PCBFont, TextX, TextY, Direction, NameOnPCB, TextScale, TextFlags);
- AddTextToElement(&VALUE_TEXT(Element), PCBFont, TextX, TextY, Direction, Value, TextScale, TextFlags);
- DESCRIPTION_TEXT(Element).Element = Element;
- NAMEONPCB_TEXT(Element).Element = Element;
- VALUE_TEXT(Element).Element = Element;
- Element->Flags = Flags;
- Element->ID = ID++;
-
-#ifdef DEBUG
- printf(" .... Leaving CreateNewElement.\n");
-#endif
-
- return (Element);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new arc in an element
- */
-ArcTypePtr
-CreateNewArcInElement(ElementTypePtr Element,
- Coord X, Coord Y, Coord Width, Coord Height, Angle angle, Angle delta, Coord Thickness)
-{
- ArcType *arc = GetElementArcMemory(Element);
-
- /* set Delta (0,360], StartAngle in [0,360) */
- if (delta < 0) {
- delta = -delta;
- angle -= delta;
- }
- angle = NormalizeAngle(angle);
- delta = NormalizeAngle(delta);
- if (delta == 0)
- delta = 360;
-
- /* copy values */
- arc->X = X;
- arc->Y = Y;
- arc->Width = Width;
- arc->Height = Height;
- arc->StartAngle = angle;
- arc->Delta = delta;
- arc->Thickness = Thickness;
- arc->ID = ID++;
- return arc;
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new line for an element
- */
-LineTypePtr CreateNewLineInElement(ElementTypePtr Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness)
-{
- LineType *line;
-
- if (Thickness == 0)
- return NULL;
-
- line = GetElementLineMemory(Element);
-
- /* copy values */
- line->Point1.X = X1;
- line->Point1.Y = Y1;
- line->Point2.X = X2;
- line->Point2.Y = Y2;
- line->Thickness = Thickness;
- line->Flags = NoFlags();
- line->ID = ID++;
- return line;
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new pin in an element
- */
-PinTypePtr
-CreateNewPin(ElementTypePtr Element,
- Coord X, Coord Y,
- Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, FlagType Flags)
-{
- PinTypePtr pin = GetPinMemory(Element);
-
- /* copy values */
- pin->X = X;
- pin->Y = Y;
- pin->Thickness = Thickness;
- pin->Clearance = Clearance;
- pin->Mask = Mask;
- pin->Name = pcb_strdup_null(Name);
- pin->Number = pcb_strdup_null(Number);
- pin->Flags = Flags;
- CLEAR_FLAG(PCB_FLAG_WARN, pin);
- SET_FLAG(PCB_FLAG_PIN, pin);
- pin->ID = ID++;
- pin->Element = Element;
-
- /*
- * If there is no vendor drill map installed, this will simply
- * return DrillingHole.
- */
- pin->DrillingHole = stub_vendorDrillMap(DrillingHole);
-
- /* Unless we should not map drills on this element, map them! */
- if (stub_vendorIsElementMappable(Element)) {
- if (pin->DrillingHole < MIN_PINORVIASIZE) {
- Message(PCB_MSG_DEFAULT, _("%m+Did not map pin #%s (%s) drill hole because %$mS is below the minimum allowed size\n"),
- conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole);
- pin->DrillingHole = DrillingHole;
- }
- else if (pin->DrillingHole > MAX_PINORVIASIZE) {
- Message(PCB_MSG_DEFAULT, _("%m+Did not map pin #%s (%s) drill hole because %$mS is above the maximum allowed size\n"),
- conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole);
- pin->DrillingHole = DrillingHole;
- }
- else if (!TEST_FLAG(PCB_FLAG_HOLE, pin)
- && (pin->DrillingHole > pin->Thickness - MIN_PINORVIACOPPER)) {
- Message(PCB_MSG_DEFAULT, _("%m+Did not map pin #%s (%s) drill hole because %$mS does not leave enough copper\n"),
- conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole);
- pin->DrillingHole = DrillingHole;
- }
- }
- else {
- pin->DrillingHole = DrillingHole;
- }
-
- if (pin->DrillingHole != DrillingHole) {
- Message(PCB_MSG_DEFAULT, _("%m+Mapped pin drill hole to %$mS from %$mS per vendor table\n"),
- conf_core.editor.grid_unit->allow, pin->DrillingHole, DrillingHole);
- }
-
- return (pin);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new pad in an element
- */
-PadTypePtr
-CreateNewPad(ElementTypePtr Element,
- Coord X1, Coord Y1, Coord X2,
- Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, FlagType Flags)
-{
- PadTypePtr pad = GetPadMemory(Element);
-
- /* copy values */
- if (X1 > X2 || (X1 == X2 && Y1 > Y2)) {
- pad->Point1.X = X2;
- pad->Point1.Y = Y2;
- pad->Point2.X = X1;
- pad->Point2.Y = Y1;
- }
- else {
- pad->Point1.X = X1;
- pad->Point1.Y = Y1;
- pad->Point2.X = X2;
- pad->Point2.Y = Y2;
- }
- pad->Thickness = Thickness;
- pad->Clearance = Clearance;
- pad->Mask = Mask;
- pad->Name = pcb_strdup_null(Name);
- pad->Number = pcb_strdup_null(Number);
- pad->Flags = Flags;
- CLEAR_FLAG(PCB_FLAG_WARN, pad);
- pad->ID = ID++;
- pad->Element = Element;
- return (pad);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new textobject as part of an element
- * copies the values to the appropriate text object
- */
-static void
-AddTextToElement(TextTypePtr Text, FontTypePtr PCBFont,
- Coord X, Coord Y, unsigned Direction, char *TextString, int Scale, FlagType Flags)
-{
- free(Text->TextString);
- Text->TextString = (TextString && *TextString) ? pcb_strdup(TextString) : NULL;
- Text->X = X;
- Text->Y = Y;
- Text->Direction = Direction;
- Text->Flags = Flags;
- Text->Scale = Scale;
-
- /* calculate size of the bounding box */
- SetTextBoundingBox(PCBFont, Text);
- Text->ID = ID++;
-}
-
-/* ---------------------------------------------------------------------------
- * creates a new line in a symbol
- */
-LineTypePtr CreateNewLineInSymbol(SymbolTypePtr Symbol, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness)
-{
- LineTypePtr line = Symbol->Line;
-
- /* realloc new memory if necessary and clear it */
- if (Symbol->LineN >= Symbol->LineMax) {
- Symbol->LineMax += STEP_SYMBOLLINE;
- line = (LineTypePtr) realloc(line, Symbol->LineMax * sizeof(LineType));
- Symbol->Line = line;
- memset(line + Symbol->LineN, 0, STEP_SYMBOLLINE * sizeof(LineType));
- }
-
- /* copy values */
- line = line + Symbol->LineN++;
- line->Point1.X = X1;
- line->Point1.Y = Y1;
- line->Point2.X = X2;
- line->Point2.Y = Y2;
- line->Thickness = Thickness;
- return (line);
-}
-
-/* ---------------------------------------------------------------------------
- * parses a file with font information and installs it into the provided PCB
- * checks directories given as colon separated list by resource fontPath
- * if the fonts filename doesn't contain a directory component
- */
-void CreateDefaultFont(PCBTypePtr pcb)
-{
- int res = -1;
- pcb_io_err_inhibit_inc();
- conf_list_foreach_path_first(res, &conf_core.rc.default_font_file, ParseFont(&pcb->Font, __path__));
- pcb_io_err_inhibit_dec();
-
- if (res != 0) {
- const char *s;
- gds_t buff;
- s = conf_concat_strlist(&conf_core.rc.default_font_file, &buff, NULL, ':');
- Message(PCB_MSG_ERROR, _("Can't find font-symbol-file - there won't be font in this design. Searched: '%s'\n"), s);
- gds_uninit(&buff);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * adds a new line to the rubberband list of 'Crosshair.AttachedObject'
- * if Layer == 0 it is a rat line
- */
-RubberbandTypePtr CreateNewRubberbandEntry(LayerTypePtr Layer, LineTypePtr Line, PointTypePtr MovedPoint)
-{
- RubberbandTypePtr ptr = GetRubberbandMemory();
-
- /* we toggle the PCB_FLAG_RUBBEREND of the line to determine if */
- /* both points are being moved. */
- TOGGLE_FLAG(PCB_FLAG_RUBBEREND, Line);
- ptr->Layer = Layer;
- ptr->Line = Line;
- ptr->MovedPoint = MovedPoint;
- return (ptr);
-}
-
-/* ---------------------------------------------------------------------------
- * Add a new net to the netlist menu
- */
-LibraryMenuTypePtr CreateNewNet(LibraryTypePtr lib, char *name, const char *style)
-{
- LibraryMenuTypePtr menu;
- char temp[64];
-
- sprintf(temp, " %s", name);
- menu = GetLibraryMenuMemory(lib, NULL);
- menu->Name = pcb_strdup(temp);
- menu->flag = 1; /* net is enabled by default */
- if (style == NULL || NSTRCMP("(unknown)", style) == 0)
- menu->Style = NULL;
- else
- menu->Style = pcb_strdup(style);
- return (menu);
-}
-
-/* ---------------------------------------------------------------------------
- * Add a connection to the net
- */
-LibraryEntryTypePtr CreateNewConnection(LibraryMenuTypePtr net, char *conn)
-{
- LibraryEntryTypePtr entry = GetLibraryEntryMemory(net);
-
- entry->ListEntry = pcb_strdup_null(conn);
- entry->ListEntry_dontfree = 0;
-
- return (entry);
-}
-
-/* ---------------------------------------------------------------------------
- * Add an attribute to a list.
- */
-AttributeTypePtr CreateNewAttribute(AttributeListTypePtr list, const char *name, const char *value)
-{
- if (list->Number >= list->Max) {
- list->Max += 10;
- list->List = (AttributeType *) realloc(list->List, list->Max * sizeof(AttributeType));
- }
- list->List[list->Number].name = pcb_strdup_null(name);
- list->List[list->Number].value = pcb_strdup_null(value);
- list->Number++;
- return &list->List[list->Number - 1];
-}
-
-void CreateIDBump(int min_id)
-{
- if (ID < min_id)
- ID = min_id;
-}
-
-void CreateIDReset(void)
-{
- ID = 1;
-}
-
-long int CreateIDGet(void)
-{
- return ID++;
-}
diff --git a/src/create.h b/src/create.h
deleted file mode 100644
index 634da18..0000000
--- a/src/create.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for create routines */
-
-#ifndef PCB_CREATE_H
-#define PCB_CREATE_H
-
-#include "global.h"
-
-/* TRUE during file loads, for example to allow overlapping vias.
- FALSE otherwise, to stop the user from doing normally dangerous
- things. */
-void CreateBeLenient(pcb_bool);
-
-DataTypePtr CreateNewBuffer(void);
-void pcb_colors_from_settings(PCBTypePtr);
-PCBTypePtr CreateNewPCB_(pcb_bool);
-PCBTypePtr CreateNewPCB();
-/* Called after PCB->Data->LayerN is set. Returns zero if no errors,
- else nonzero. */
-int CreateNewPCBPost(PCBTypePtr, int /* set defaults */ );
-PinTypePtr CreateNewVia(DataTypePtr, Coord, Coord, Coord, Coord, Coord, Coord, const char *, FlagType);
-LineTypePtr CreateDrawnLineOnLayer(LayerTypePtr, Coord, Coord, Coord, Coord, Coord, Coord, FlagType);
-LineTypePtr CreateNewLineOnLayer(LayerTypePtr, Coord, Coord, Coord, Coord, Coord, Coord, FlagType);
-RatTypePtr CreateNewRat(DataTypePtr, Coord, Coord, Coord, Coord, pcb_cardinal_t, pcb_cardinal_t, Coord, FlagType);
-ArcTypePtr CreateNewArcOnLayer(LayerTypePtr, Coord, Coord, Coord, Coord, Angle, Angle, Coord, Coord, FlagType);
-PolygonTypePtr CreateNewPolygonFromRectangle(LayerTypePtr, Coord, Coord, Coord, Coord, FlagType);
-TextTypePtr CreateNewText(LayerTypePtr, FontTypePtr, Coord, Coord, unsigned, int, char *, FlagType);
-PolygonTypePtr CreateNewPolygon(LayerTypePtr, FlagType);
-PointTypePtr CreateNewPointInPolygon(PolygonTypePtr, Coord, Coord);
-PolygonType *CreateNewHoleInPolygon(PolygonType * polygon);
-ElementTypePtr CreateNewElement(DataTypePtr, ElementTypePtr,
- FontTypePtr, FlagType, char *, char *, char *, Coord, Coord, pcb_uint8_t, int, FlagType, pcb_bool);
-LineTypePtr CreateNewLineInElement(ElementTypePtr, Coord, Coord, Coord, Coord, Coord);
-ArcTypePtr CreateNewArcInElement(ElementTypePtr, Coord, Coord, Coord, Coord, Angle, Angle, Coord);
-PinTypePtr CreateNewPin(ElementTypePtr, Coord, Coord, Coord, Coord, Coord, Coord, char *, char *, FlagType);
-PadTypePtr CreateNewPad(ElementTypePtr, Coord, Coord, Coord, Coord, Coord, Coord, Coord, char *, char *, FlagType);
-LineTypePtr CreateNewLineInSymbol(SymbolTypePtr, Coord, Coord, Coord, Coord, Coord);
-void CreateDefaultFont(PCBTypePtr);
-RubberbandTypePtr CreateNewRubberbandEntry(LayerTypePtr, LineTypePtr, PointTypePtr);
-LibraryMenuTypePtr CreateNewNet(LibraryTypePtr, char *, const char *);
-LibraryEntryTypePtr CreateNewConnection(LibraryMenuTypePtr, char *);
-
-AttributeTypePtr CreateNewAttribute(AttributeListTypePtr list, const char *name, const char *value);
-
-void CreateIDBump(int min_id);
-void CreateIDReset(void);
-long int CreateIDGet(void);
-
-/* Add objects without creating them or making any "sanity modifications" to them */
-void pcb_add_via(DataType *Data, PinType *Via);
-void pcb_add_line_on_layer(LayerType *Layer, LineType *Line);
-void pcb_add_arc_on_layer(LayerType *Layer, ArcType *Arc);
-void pcb_add_polygon_on_layer(LayerType *Layer, PolygonType *polygon);
-void pcb_add_text_on_layer(LayerType *ly, TextType *text, FontType *PCBFont);
-
-#endif
diff --git a/src/crosshair.c b/src/crosshair.c
index e2c6f85..ac089c3 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -28,53 +28,55 @@
/* crosshair stuff */
#include "config.h"
-
-#include <memory.h>
-#include <math.h>
-
#include "conf_core.h"
-#include "box.h"
+#include "board.h"
#include "crosshair.h"
#include "data.h"
#include "draw.h"
-#include "error.h"
-#include "line.h"
-#include "rtree.h"
#include "search.h"
#include "polygon.h"
-#include "misc.h"
-#include "misc_util.h"
#include "hid_actions.h"
-#include "layer.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "vtonpoint.h"
+#include "find.h"
+#include "undo.h"
+#include "event.h"
+#include "action_helper.h"
+
+#include "obj_line_draw.h"
+#include "obj_arc_draw.h"
+#include "obj_arc_ui.h"
typedef struct {
int x, y;
} point;
+pcb_crosshair_t pcb_crosshair; /* information about cursor settings */
+pcb_mark_t pcb_marked; /* a cross-hair mark */
+
+
/* ---------------------------------------------------------------------------
* some local prototypes
*/
-static void XORPolygon(PolygonTypePtr, Coord, Coord, int);
-static void XORDrawElement(ElementTypePtr, Coord, Coord);
-static void XORDrawBuffer(BufferTypePtr);
+static void XORPolygon(pcb_polygon_t *, pcb_coord_t, pcb_coord_t, int);
+static void XORDrawElement(pcb_element_t *, pcb_coord_t, pcb_coord_t);
+static void XORDrawBuffer(pcb_buffer_t *);
static void XORDrawInsertPointObject(void);
-static void XORDrawMoveOrCopyObject(void);
-static void XORDrawAttachedLine(Coord, Coord, Coord, Coord, Coord);
-static void XORDrawAttachedArc(Coord);
+static void XORDrawAttachedArc(pcb_coord_t);
-static void thindraw_moved_pv(PinType * pv, Coord x, Coord y)
+static void thindraw_moved_pv(pcb_pin_t * pv, pcb_coord_t x, pcb_coord_t y)
{
/* Make a copy of the pin structure, moved to the correct position */
- PinType moved_pv = *pv;
+ pcb_pin_t moved_pv = *pv;
moved_pv.X += x;
moved_pv.Y += y;
- gui->thindraw_pcb_pv(Crosshair.GC, Crosshair.GC, &moved_pv, pcb_true, pcb_false);
+ pcb_gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &moved_pv, pcb_true, pcb_false);
}
-static void draw_dashed_line(hidGC GC, Coord x1, Coord y1, Coord x2, Coord y2)
+static void draw_dashed_line(pcb_hid_gc_t GC, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
/* TODO: we need a real geo lib... using double here is plain wrong */
double dx = x2-x1, dy = y2-y1;
@@ -84,20 +86,20 @@ static void draw_dashed_line(hidGC GC, Coord x1, Coord y1, Coord x2, Coord y2)
if (len_squared < 1000000) {
/* line too short, just draw it - TODO: magic value; with a proper geo lib this would be gone anyway */
- gui->draw_line(Crosshair.GC, x1, y1, x2, y2);
+ pcb_gui->draw_line(pcb_crosshair.GC, x1, y1, x2, y2);
return;
}
/* first seg is drawn from x1, y1 with no rounding error due to n-1 == 0 */
for(n = 1; n < segs; n+=2)
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
x1 + (dx * (double)(n-1) / (double)segs), y1 + (dy * (double)(n-1) / (double)segs),
x1 + (dx * (double)n / (double)segs), y1 + (dy * (double)n / (double)segs));
/* make sure the last segment is drawn properly to x2 and y2, don't leave
room for rounding errors */
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
x2 - (dx / (double)segs), y2 - (dy / (double)segs),
x2, y2);
}
@@ -105,18 +107,18 @@ static void draw_dashed_line(hidGC GC, Coord x1, Coord y1, Coord x2, Coord y2)
/* ---------------------------------------------------------------------------
* creates a tmp polygon with coordinates converted to screen system
*/
-static void XORPolygon(PolygonTypePtr polygon, Coord dx, Coord dy, int dash_last)
+static void XORPolygon(pcb_polygon_t *polygon, pcb_coord_t dx, pcb_coord_t dy, int dash_last)
{
pcb_cardinal_t i;
for (i = 0; i < polygon->PointN; i++) {
- pcb_cardinal_t next = next_contour_point(polygon, i);
+ pcb_cardinal_t next = pcb_poly_contour_next_point(polygon, i);
if (next == 0) { /* last line: sometimes the implicit closing line */
if (i == 1) /* corner case: don't draw two lines on top of each other - with XOR it looks bad */
continue;
if (dash_last) {
- draw_dashed_line(Crosshair.GC,
+ draw_dashed_line(pcb_crosshair.GC,
polygon->Points[i].X + dx,
polygon->Points[i].Y + dy, polygon->Points[next].X + dx, polygon->Points[next].Y + dy);
break; /* skip normal line draw below */
@@ -124,7 +126,7 @@ static void XORPolygon(PolygonTypePtr polygon, Coord dx, Coord dy, int dash_last
}
/* normal contour line */
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
polygon->Points[i].X + dx,
polygon->Points[i].Y + dy, polygon->Points[next].X + dx, polygon->Points[next].Y + dy);
}
@@ -133,211 +135,204 @@ static void XORPolygon(PolygonTypePtr polygon, Coord dx, Coord dy, int dash_last
/*-----------------------------------------------------------
* Draws the outline of an arc
*/
-static void XORDrawAttachedArc(Coord thick)
+static void XORDrawAttachedArc(pcb_coord_t thick)
{
- ArcType arc;
- BoxTypePtr bx;
- Coord wx, wy;
- Angle sa, dir;
- Coord wid = thick / 2;
-
- wx = Crosshair.X - Crosshair.AttachedBox.Point1.X;
- wy = Crosshair.Y - Crosshair.AttachedBox.Point1.Y;
+ pcb_arc_t arc;
+ pcb_box_t bx;
+ pcb_coord_t wx, wy;
+ pcb_angle_t sa, dir;
+ pcb_coord_t wid = thick / 2;
+
+ wx = pcb_crosshair.X - pcb_crosshair.AttachedBox.Point1.X;
+ wy = pcb_crosshair.Y - pcb_crosshair.AttachedBox.Point1.Y;
if (wx == 0 && wy == 0)
return;
- arc.X = Crosshair.AttachedBox.Point1.X;
- arc.Y = Crosshair.AttachedBox.Point1.Y;
- if (XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) {
- arc.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * SGNZ(wx);
+ arc.X = pcb_crosshair.AttachedBox.Point1.X;
+ arc.Y = pcb_crosshair.AttachedBox.Point1.Y;
+ if (PCB_XOR(pcb_crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) {
+ arc.X = pcb_crosshair.AttachedBox.Point1.X + coord_abs(wy) * PCB_SGNZ(wx);
sa = (wx >= 0) ? 0 : 180;
-#ifdef ARC45
- if (coord_abs(wy) >= 2 * coord_abs(wx))
- dir = (SGNZ(wx) == SGNZ(wy)) ? 45 : -45;
- else
-#endif
- dir = (SGNZ(wx) == SGNZ(wy)) ? 90 : -90;
+ dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 90 : -90;
}
else {
- arc.Y = Crosshair.AttachedBox.Point1.Y + coord_abs(wx) * SGNZ(wy);
+ arc.Y = pcb_crosshair.AttachedBox.Point1.Y + coord_abs(wx) * PCB_SGNZ(wy);
sa = (wy >= 0) ? -90 : 90;
-#ifdef ARC45
- if (coord_abs(wx) >= 2 * coord_abs(wy))
- dir = (SGNZ(wx) == SGNZ(wy)) ? -45 : 45;
- else
-#endif
- dir = (SGNZ(wx) == SGNZ(wy)) ? -90 : 90;
+ dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -90 : 90;
wy = wx;
}
wy = coord_abs(wy);
arc.StartAngle = sa;
arc.Delta = dir;
arc.Width = arc.Height = wy;
- bx = GetArcEnds(&arc);
+
+ pcb_arc_get_end(&arc, 0, &bx.X1, &bx.Y1);
+ pcb_arc_get_end(&arc, 1, &bx.X2, &bx.Y2);
+
/* sa = sa - 180; */
- gui->draw_arc(Crosshair.GC, arc.X, arc.Y, wy + wid, wy + wid, sa, dir);
- if (wid > pixel_slop) {
- gui->draw_arc(Crosshair.GC, arc.X, arc.Y, wy - wid, wy - wid, sa, dir);
- gui->draw_arc(Crosshair.GC, bx->X1, bx->Y1, wid, wid, sa, -180 * SGN(dir));
- gui->draw_arc(Crosshair.GC, bx->X2, bx->Y2, wid, wid, sa + dir, 180 * SGN(dir));
+ pcb_gui->draw_arc(pcb_crosshair.GC, arc.X, arc.Y, wy + wid, wy + wid, sa, dir);
+ if (wid > pcb_pixel_slop) {
+ pcb_gui->draw_arc(pcb_crosshair.GC, arc.X, arc.Y, wy - wid, wy - wid, sa, dir);
+ pcb_gui->draw_arc(pcb_crosshair.GC, bx.X1, bx.Y1, wid, wid, sa, -180 * SGN(dir));
+ pcb_gui->draw_arc(pcb_crosshair.GC, bx.X2, bx.Y2, wid, wid, sa + dir, 180 * SGN(dir));
}
}
/*-----------------------------------------------------------
* Draws the outline of a line
*/
-static void XORDrawAttachedLine(Coord x1, Coord y1, Coord x2, Coord y2, Coord thick)
+void XORDrawAttachedLine(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick)
{
- Coord dx, dy, ox, oy;
+ pcb_coord_t dx, dy, ox, oy;
double h;
dx = x2 - x1;
dy = y2 - y1;
if (dx != 0 || dy != 0)
- h = 0.5 * thick / sqrt(SQUARE(dx) + SQUARE(dy));
+ h = 0.5 * thick / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy));
else
h = 0.0;
ox = dy * h + 0.5 * SGN(dy);
oy = -(dx * h + 0.5 * SGN(dx));
- gui->draw_line(Crosshair.GC, x1 + ox, y1 + oy, x2 + ox, y2 + oy);
- if (coord_abs(ox) >= pixel_slop || coord_abs(oy) >= pixel_slop) {
- Angle angle = atan2(dx, dy) * 57.295779;
- gui->draw_line(Crosshair.GC, x1 - ox, y1 - oy, x2 - ox, y2 - oy);
- gui->draw_arc(Crosshair.GC, x1, y1, thick / 2, thick / 2, angle - 180, 180);
- gui->draw_arc(Crosshair.GC, x2, y2, thick / 2, thick / 2, angle, 180);
+ pcb_gui->draw_line(pcb_crosshair.GC, x1 + ox, y1 + oy, x2 + ox, y2 + oy);
+ if (coord_abs(ox) >= pcb_pixel_slop || coord_abs(oy) >= pcb_pixel_slop) {
+ pcb_angle_t angle = atan2(dx, dy) * 57.295779;
+ pcb_gui->draw_line(pcb_crosshair.GC, x1 - ox, y1 - oy, x2 - ox, y2 - oy);
+ pcb_gui->draw_arc(pcb_crosshair.GC, x1, y1, thick / 2, thick / 2, angle - 180, 180);
+ pcb_gui->draw_arc(pcb_crosshair.GC, x2, y2, thick / 2, thick / 2, angle, 180);
}
}
/* ---------------------------------------------------------------------------
* draws the elements of a loaded circuit which is to be merged in
*/
-static void XORDrawElement(ElementTypePtr Element, Coord DX, Coord DY)
+static void XORDrawElement(pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY)
{
/* if no silkscreen, draw the bounding box */
if (arclist_length(&Element->Arc) == 0 && linelist_length(&Element->Line) == 0) {
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
DX + Element->BoundingBox.X1,
DY + Element->BoundingBox.Y1, DX + Element->BoundingBox.X1, DY + Element->BoundingBox.Y2);
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
DX + Element->BoundingBox.X1,
DY + Element->BoundingBox.Y2, DX + Element->BoundingBox.X2, DY + Element->BoundingBox.Y2);
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
DX + Element->BoundingBox.X2,
DY + Element->BoundingBox.Y2, DX + Element->BoundingBox.X2, DY + Element->BoundingBox.Y1);
- gui->draw_line(Crosshair.GC,
+ pcb_gui->draw_line(pcb_crosshair.GC,
DX + Element->BoundingBox.X2,
DY + Element->BoundingBox.Y1, DX + Element->BoundingBox.X1, DY + Element->BoundingBox.Y1);
}
else {
- ELEMENTLINE_LOOP(Element);
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
{
- gui->draw_line(Crosshair.GC, DX + line->Point1.X, DY + line->Point1.Y, DX + line->Point2.X, DY + line->Point2.Y);
+ pcb_gui->draw_line(pcb_crosshair.GC, DX + line->Point1.X, DY + line->Point1.Y, DX + line->Point2.X, DY + line->Point2.Y);
}
- END_LOOP;
+ PCB_END_LOOP;
/* arc coordinates and angles have to be converted to X11 notation */
- ARC_LOOP(Element);
+ PCB_ARC_LOOP(Element);
{
- gui->draw_arc(Crosshair.GC, DX + arc->X, DY + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
+ pcb_gui->draw_arc(pcb_crosshair.GC, DX + arc->X, DY + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* pin coordinates and angles have to be converted to X11 notation */
- PIN_LOOP(Element);
+ PCB_PIN_LOOP(Element);
{
thindraw_moved_pv(pin, DX, DY);
}
- END_LOOP;
+ PCB_END_LOOP;
/* pads */
- PAD_LOOP(Element);
+ PCB_PAD_LOOP(Element);
{
- if (PCB->InvisibleObjectsOn || (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) != 0) == conf_core.editor.show_solder_side) {
+ if (PCB->InvisibleObjectsOn || (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) != 0) == conf_core.editor.show_solder_side) {
/* Make a copy of the pad structure, moved to the correct position */
- PadType moved_pad = *pad;
+ pcb_pad_t moved_pad = *pad;
moved_pad.Point1.X += DX;
moved_pad.Point1.Y += DY;
moved_pad.Point2.X += DX;
moved_pad.Point2.Y += DY;
- gui->thindraw_pcb_pad(Crosshair.GC, &moved_pad, pcb_false, pcb_false);
+ pcb_gui->thindraw_pcb_pad(pcb_crosshair.GC, &moved_pad, pcb_false, pcb_false);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* mark */
- gui->draw_line(Crosshair.GC,
- Element->MarkX + DX - EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY - EMARK_SIZE);
- gui->draw_line(Crosshair.GC,
- Element->MarkX + DX + EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY - EMARK_SIZE);
- gui->draw_line(Crosshair.GC,
- Element->MarkX + DX - EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY + EMARK_SIZE);
- gui->draw_line(Crosshair.GC,
- Element->MarkX + DX + EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY + EMARK_SIZE);
+ pcb_gui->draw_line(pcb_crosshair.GC,
+ Element->MarkX + DX - PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY - PCB_EMARK_SIZE);
+ pcb_gui->draw_line(pcb_crosshair.GC,
+ Element->MarkX + DX + PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY - PCB_EMARK_SIZE);
+ pcb_gui->draw_line(pcb_crosshair.GC,
+ Element->MarkX + DX - PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY + PCB_EMARK_SIZE);
+ pcb_gui->draw_line(pcb_crosshair.GC,
+ Element->MarkX + DX + PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY + PCB_EMARK_SIZE);
}
/* ---------------------------------------------------------------------------
* draws all visible and attached objects of the pastebuffer
*/
-static void XORDrawBuffer(BufferTypePtr Buffer)
+static void XORDrawBuffer(pcb_buffer_t *Buffer)
{
pcb_cardinal_t i;
- Coord x, y;
+ pcb_coord_t x, y;
/* set offset */
- x = Crosshair.X - Buffer->X;
- y = Crosshair.Y - Buffer->Y;
+ x = pcb_crosshair.X - Buffer->X;
+ y = pcb_crosshair.Y - Buffer->Y;
/* draw all visible layers */
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
if (PCB->Data->Layer[i].On) {
- LayerTypePtr layer = &Buffer->Data->Layer[i];
+ pcb_layer_t *layer = &Buffer->Data->Layer[i];
- LINE_LOOP(layer);
+ PCB_LINE_LOOP(layer);
{
/*
XORDrawAttachedLine(x +line->Point1.X,
y +line->Point1.Y, x +line->Point2.X,
y +line->Point2.Y, line->Thickness);
*/
- gui->draw_line(Crosshair.GC, x + line->Point1.X, y + line->Point1.Y, x + line->Point2.X, y + line->Point2.Y);
+ pcb_gui->draw_line(pcb_crosshair.GC, x + line->Point1.X, y + line->Point1.Y, x + line->Point2.X, y + line->Point2.Y);
}
- END_LOOP;
- ARC_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(layer);
{
- gui->draw_arc(Crosshair.GC, x + arc->X, y + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
+ pcb_gui->draw_arc(pcb_crosshair.GC, x + arc->X, y + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
}
- END_LOOP;
- TEXT_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_TEXT_LOOP(layer);
{
- BoxTypePtr box = &text->BoundingBox;
- gui->draw_rect(Crosshair.GC, x + box->X1, y + box->Y1, x + box->X2, y + box->Y2);
+ pcb_box_t *box = &text->BoundingBox;
+ pcb_gui->draw_rect(pcb_crosshair.GC, x + box->X1, y + box->Y1, x + box->X2, y + box->Y2);
}
- END_LOOP;
+ PCB_END_LOOP;
/* the tmp polygon has n+1 points because the first
* and the last one are set to the same coordinates
*/
- POLYGON_LOOP(layer);
+ PCB_POLY_LOOP(layer);
{
XORPolygon(polygon, x, y, 0);
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* draw elements if visible */
if (PCB->PinOn && PCB->ElementOn)
- ELEMENT_LOOP(Buffer->Data);
+ PCB_ELEMENT_LOOP(Buffer->Data);
{
- if (FRONT(element) || PCB->InvisibleObjectsOn)
+ if (PCB_FRONT(element) || PCB->InvisibleObjectsOn)
XORDrawElement(element, x, y);
}
- END_LOOP;
+ PCB_END_LOOP;
/* and the vias */
if (PCB->ViaOn)
- VIA_LOOP(Buffer->Data);
+ PCB_VIA_LOOP(Buffer->Data);
{
thindraw_moved_pv(via, x, y);
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* ---------------------------------------------------------------------------
@@ -345,35 +340,33 @@ static void XORDrawBuffer(BufferTypePtr Buffer)
*/
static void XORDrawInsertPointObject(void)
{
- LineTypePtr line = (LineTypePtr) Crosshair.AttachedObject.Ptr2;
- PointTypePtr point = (PointTypePtr) Crosshair.AttachedObject.Ptr3;
+ pcb_line_t *line = (pcb_line_t *) pcb_crosshair.AttachedObject.Ptr2;
+ pcb_point_t *point = (pcb_point_t *) pcb_crosshair.AttachedObject.Ptr3;
- if (Crosshair.AttachedObject.Type != PCB_TYPE_NONE) {
- gui->draw_line(Crosshair.GC, point->X, point->Y, line->Point1.X, line->Point1.Y);
- gui->draw_line(Crosshair.GC, point->X, point->Y, line->Point2.X, line->Point2.Y);
+ if (pcb_crosshair.AttachedObject.Type != PCB_TYPE_NONE) {
+ pcb_gui->draw_line(pcb_crosshair.GC, point->X, point->Y, line->Point1.X, line->Point1.Y);
+ pcb_gui->draw_line(pcb_crosshair.GC, point->X, point->Y, line->Point2.X, line->Point2.Y);
}
}
/* ---------------------------------------------------------------------------
* draws the attached object while in PCB_MODE_MOVE or PCB_MODE_COPY
*/
-static void XORDrawMoveOrCopyObject(void)
+static void XORDrawMoveOrCopy(void)
{
- RubberbandTypePtr ptr;
- pcb_cardinal_t i;
- Coord dx = Crosshair.X - Crosshair.AttachedObject.X, dy = Crosshair.Y - Crosshair.AttachedObject.Y;
+ pcb_coord_t dx = pcb_crosshair.X - pcb_crosshair.AttachedObject.X, dy = pcb_crosshair.Y - pcb_crosshair.AttachedObject.Y;
- switch (Crosshair.AttachedObject.Type) {
+ switch (pcb_crosshair.AttachedObject.Type) {
case PCB_TYPE_VIA:
{
- PinTypePtr via = (PinTypePtr) Crosshair.AttachedObject.Ptr1;
+ pcb_pin_t *via = (pcb_pin_t *) pcb_crosshair.AttachedObject.Ptr1;
thindraw_moved_pv(via, dx, dy);
break;
}
case PCB_TYPE_LINE:
{
- LineTypePtr line = (LineTypePtr) Crosshair.AttachedObject.Ptr2;
+ pcb_line_t *line = (pcb_line_t *) pcb_crosshair.AttachedObject.Ptr2;
XORDrawAttachedLine(line->Point1.X + dx, line->Point1.Y + dy, line->Point2.X + dx, line->Point2.Y + dy, line->Thickness);
break;
@@ -381,15 +374,15 @@ static void XORDrawMoveOrCopyObject(void)
case PCB_TYPE_ARC:
{
- ArcTypePtr Arc = (ArcTypePtr) Crosshair.AttachedObject.Ptr2;
+ pcb_arc_t *Arc = (pcb_arc_t *) pcb_crosshair.AttachedObject.Ptr2;
- gui->draw_arc(Crosshair.GC, Arc->X + dx, Arc->Y + dy, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta);
+ pcb_gui->draw_arc(pcb_crosshair.GC, Arc->X + dx, Arc->Y + dy, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta);
break;
}
case PCB_TYPE_POLYGON:
{
- PolygonTypePtr polygon = (PolygonTypePtr) Crosshair.AttachedObject.Ptr2;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) pcb_crosshair.AttachedObject.Ptr2;
/* the tmp polygon has n+1 points because the first
* and the last one are set to the same coordinates
@@ -400,11 +393,11 @@ static void XORDrawMoveOrCopyObject(void)
case PCB_TYPE_LINE_POINT:
{
- LineTypePtr line;
- PointTypePtr point;
+ pcb_line_t *line;
+ pcb_point_t *point;
- line = (LineTypePtr) Crosshair.AttachedObject.Ptr2;
- point = (PointTypePtr) Crosshair.AttachedObject.Ptr3;
+ line = (pcb_line_t *) pcb_crosshair.AttachedObject.Ptr2;
+ point = (pcb_point_t *) pcb_crosshair.AttachedObject.Ptr3;
if (point == &line->Point1)
XORDrawAttachedLine(point->X + dx, point->Y + dy, line->Point2.X, line->Point2.Y, line->Thickness);
else
@@ -412,39 +405,43 @@ static void XORDrawMoveOrCopyObject(void)
break;
}
+ case PCB_TYPE_ARC_POINT:
+ pcb_arc_ui_move_or_copy(&pcb_crosshair);
+ break;
+
case PCB_TYPE_POLYGON_POINT:
{
- PolygonTypePtr polygon;
- PointTypePtr point;
+ pcb_polygon_t *polygon;
+ pcb_point_t *point;
pcb_cardinal_t point_idx, prev, next;
- polygon = (PolygonTypePtr) Crosshair.AttachedObject.Ptr2;
- point = (PointTypePtr) Crosshair.AttachedObject.Ptr3;
- point_idx = polygon_point_idx(polygon, point);
+ polygon = (pcb_polygon_t *) pcb_crosshair.AttachedObject.Ptr2;
+ point = (pcb_point_t *) pcb_crosshair.AttachedObject.Ptr3;
+ point_idx = pcb_poly_point_idx(polygon, point);
/* get previous and following point */
- prev = prev_contour_point(polygon, point_idx);
- next = next_contour_point(polygon, point_idx);
+ prev = pcb_poly_contour_prev_point(polygon, point_idx);
+ next = pcb_poly_contour_next_point(polygon, point_idx);
/* draw the two segments */
- gui->draw_line(Crosshair.GC, polygon->Points[prev].X, polygon->Points[prev].Y, point->X + dx, point->Y + dy);
- gui->draw_line(Crosshair.GC, point->X + dx, point->Y + dy, polygon->Points[next].X, polygon->Points[next].Y);
+ pcb_gui->draw_line(pcb_crosshair.GC, polygon->Points[prev].X, polygon->Points[prev].Y, point->X + dx, point->Y + dy);
+ pcb_gui->draw_line(pcb_crosshair.GC, point->X + dx, point->Y + dy, polygon->Points[next].X, polygon->Points[next].Y);
break;
}
case PCB_TYPE_ELEMENT_NAME:
{
/* locate the element "mark" and draw an association line from crosshair to it */
- ElementTypePtr element = (ElementTypePtr) Crosshair.AttachedObject.Ptr1;
+ pcb_element_t *element = (pcb_element_t *) pcb_crosshair.AttachedObject.Ptr1;
- gui->draw_line(Crosshair.GC, element->MarkX, element->MarkY, Crosshair.X, Crosshair.Y);
+ pcb_gui->draw_line(pcb_crosshair.GC, element->MarkX, element->MarkY, pcb_crosshair.X, pcb_crosshair.Y);
/* fall through to move the text as a box outline */
}
case PCB_TYPE_TEXT:
{
- TextTypePtr text = (TextTypePtr) Crosshair.AttachedObject.Ptr2;
- BoxTypePtr box = &text->BoundingBox;
- gui->draw_rect(Crosshair.GC, box->X1 + dx, box->Y1 + dy, box->X2 + dx, box->Y2 + dy);
+ pcb_text_t *text = (pcb_text_t *) pcb_crosshair.AttachedObject.Ptr2;
+ pcb_box_t *box = &text->BoundingBox;
+ pcb_gui->draw_rect(pcb_crosshair.GC, box->X1 + dx, box->Y1 + dy, box->X2 + dx, box->Y2 + dy);
break;
}
@@ -452,66 +449,39 @@ static void XORDrawMoveOrCopyObject(void)
case PCB_TYPE_PAD:
case PCB_TYPE_PIN:
case PCB_TYPE_ELEMENT:
- XORDrawElement((ElementTypePtr) Crosshair.AttachedObject.Ptr2, dx, dy);
+ XORDrawElement((pcb_element_t *) pcb_crosshair.AttachedObject.Ptr2, dx, dy);
break;
}
- /* draw the attached rubberband lines too */
- i = Crosshair.AttachedObject.RubberbandN;
- ptr = Crosshair.AttachedObject.Rubberband;
- while (i) {
- PointTypePtr point1, point2;
-
- if (TEST_FLAG(PCB_FLAG_VIA, ptr->Line)) {
- /* this is a rat going to a polygon. do not draw for rubberband */ ;
- }
- else if (TEST_FLAG(PCB_FLAG_RUBBEREND, ptr->Line)) {
- /* 'point1' is always the fix-point */
- if (ptr->MovedPoint == &ptr->Line->Point1) {
- point1 = &ptr->Line->Point2;
- point2 = &ptr->Line->Point1;
- }
- else {
- point1 = &ptr->Line->Point1;
- point2 = &ptr->Line->Point2;
- }
- XORDrawAttachedLine(point1->X, point1->Y, point2->X + dx, point2->Y + dy, ptr->Line->Thickness);
- }
- else if (ptr->MovedPoint == &ptr->Line->Point1)
- XORDrawAttachedLine(ptr->Line->Point1.X + dx,
- ptr->Line->Point1.Y + dy, ptr->Line->Point2.X + dx, ptr->Line->Point2.Y + dy, ptr->Line->Thickness);
-
- ptr++;
- i--;
- }
+ pcb_event(PCB_EVENT_RUBBER_MOVE_DRAW, "cc", dx, dy);
}
/* ---------------------------------------------------------------------------
* draws additional stuff that follows the crosshair
*/
-void DrawAttached(void)
+void pcb_draw_attached(void)
{
switch (conf_core.editor.mode) {
case PCB_MODE_VIA:
{
/* Make a dummy via structure to draw from */
- PinType via;
- via.X = Crosshair.X;
- via.Y = Crosshair.Y;
+ pcb_pin_t via;
+ via.X = pcb_crosshair.X;
+ via.Y = pcb_crosshair.Y;
via.Thickness = conf_core.design.via_thickness;
via.Clearance = 2 * conf_core.design.clearance;
via.DrillingHole = conf_core.design.via_drilling_hole;
via.Mask = 0;
- via.Flags = NoFlags();
+ via.Flags = pcb_no_flags();
- gui->thindraw_pcb_pv(Crosshair.GC, Crosshair.GC, &via, pcb_true, pcb_false);
+ pcb_gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &via, pcb_true, pcb_false);
if (conf_core.editor.show_drc) {
/* XXX: Naughty cheat - use the mask to draw DRC clearance! */
via.Mask = conf_core.design.via_thickness + PCB->Bloat * 2;
- gui->set_color(Crosshair.GC, conf_core.appearance.color.cross);
- gui->thindraw_pcb_pv(Crosshair.GC, Crosshair.GC, &via, pcb_false, pcb_true);
- gui->set_color(Crosshair.GC, conf_core.appearance.color.crosshair);
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross);
+ pcb_gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &via, pcb_false, pcb_true);
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair);
}
break;
}
@@ -520,24 +490,24 @@ void DrawAttached(void)
case PCB_MODE_POLYGON:
case PCB_MODE_POLYGON_HOLE:
/* draw only if starting point is set */
- if (Crosshair.AttachedLine.State != STATE_FIRST)
- gui->draw_line(Crosshair.GC,
- Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y, Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y);
+ if (pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST)
+ pcb_gui->draw_line(pcb_crosshair.GC,
+ pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y, pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y);
/* draw attached polygon only if in PCB_MODE_POLYGON or PCB_MODE_POLYGON_HOLE */
- if (Crosshair.AttachedPolygon.PointN > 1) {
- XORPolygon(&Crosshair.AttachedPolygon, 0, 0, 1);
+ if (pcb_crosshair.AttachedPolygon.PointN > 1) {
+ XORPolygon(&pcb_crosshair.AttachedPolygon, 0, 0, 1);
}
break;
case PCB_MODE_ARC:
- if (Crosshair.AttachedBox.State != STATE_FIRST) {
+ if (pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) {
XORDrawAttachedArc(conf_core.design.line_thickness);
if (conf_core.editor.show_drc) {
- gui->set_color(Crosshair.GC, conf_core.appearance.color.cross);
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross);
XORDrawAttachedArc(conf_core.design.line_thickness + 2 * (PCB->Bloat + 1));
- gui->set_color(Crosshair.GC, conf_core.appearance.color.crosshair);
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair);
}
}
@@ -545,38 +515,38 @@ void DrawAttached(void)
case PCB_MODE_LINE:
/* draw only if starting point exists and the line has length */
- if (Crosshair.AttachedLine.State != STATE_FIRST && Crosshair.AttachedLine.draw) {
- XORDrawAttachedLine(Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
- Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness);
+ if (pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && pcb_crosshair.AttachedLine.draw) {
+ XORDrawAttachedLine(pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y,
+ pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness);
/* draw two lines ? */
if (conf_core.editor.line_refraction)
- XORDrawAttachedLine(Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y,
- Crosshair.X, Crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness);
+ XORDrawAttachedLine(pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y,
+ pcb_crosshair.X, pcb_crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness);
if (conf_core.editor.show_drc) {
- gui->set_color(Crosshair.GC, conf_core.appearance.color.cross);
- XORDrawAttachedLine(Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
- Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness + 2 * (PCB->Bloat + 1));
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross);
+ XORDrawAttachedLine(pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y,
+ pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness + 2 * (PCB->Bloat + 1));
if (conf_core.editor.line_refraction)
- XORDrawAttachedLine(Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y,
- Crosshair.X, Crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness + 2 * (PCB->Bloat + 1));
- gui->set_color(Crosshair.GC, conf_core.appearance.color.crosshair);
+ XORDrawAttachedLine(pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y,
+ pcb_crosshair.X, pcb_crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness + 2 * (PCB->Bloat + 1));
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair);
}
}
break;
case PCB_MODE_PASTE_BUFFER:
- XORDrawBuffer(PASTEBUFFER);
+ XORDrawBuffer(PCB_PASTEBUFFER);
break;
case PCB_MODE_COPY:
case PCB_MODE_MOVE:
- XORDrawMoveOrCopyObject();
+ XORDrawMoveOrCopy();
break;
case PCB_MODE_INSERT_POINT:
@@ -585,14 +555,14 @@ void DrawAttached(void)
}
/* an attached box does not depend on a special mode */
- if (Crosshair.AttachedBox.State == STATE_SECOND || Crosshair.AttachedBox.State == STATE_THIRD) {
- Coord x1, y1, x2, y2;
-
- x1 = Crosshair.AttachedBox.Point1.X;
- y1 = Crosshair.AttachedBox.Point1.Y;
- x2 = Crosshair.AttachedBox.Point2.X;
- y2 = Crosshair.AttachedBox.Point2.Y;
- gui->draw_rect(Crosshair.GC, x1, y1, x2, y2);
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_SECOND || pcb_crosshair.AttachedBox.State == PCB_CH_STATE_THIRD) {
+ pcb_coord_t x1, y1, x2, y2;
+
+ x1 = pcb_crosshair.AttachedBox.Point1.X;
+ y1 = pcb_crosshair.AttachedBox.Point1.Y;
+ x2 = pcb_crosshair.AttachedBox.Point2.X;
+ y2 = pcb_crosshair.AttachedBox.Point2.Y;
+ pcb_gui->draw_rect(pcb_crosshair.GC, x1, y1, x2, y2);
}
}
@@ -600,22 +570,22 @@ void DrawAttached(void)
/* --------------------------------------------------------------------------
* draw the marker position
*/
-void DrawMark(void)
+void pcb_draw_mark(void)
{
- Coord ms = conf_core.appearance.mark_size;
+ pcb_coord_t ms = conf_core.appearance.mark_size;
/* Mark is not drawn when it is not set */
- if (!Marked.status)
+ if (!pcb_marked.status)
return;
- gui->draw_line(Crosshair.GC, Marked.X - ms, Marked.Y - ms, Marked.X + ms, Marked.Y + ms);
- gui->draw_line(Crosshair.GC, Marked.X + ms, Marked.Y - ms, Marked.X - ms, Marked.Y + ms);
+ pcb_gui->draw_line(pcb_crosshair.GC, pcb_marked.X - ms, pcb_marked.Y - ms, pcb_marked.X + ms, pcb_marked.Y + ms);
+ pcb_gui->draw_line(pcb_crosshair.GC, pcb_marked.X + ms, pcb_marked.Y - ms, pcb_marked.X - ms, pcb_marked.Y + ms);
}
/* ---------------------------------------------------------------------------
* Returns the nearest grid-point to the given Coord
*/
-Coord GridFit(Coord x, Coord grid_spacing, Coord grid_offset)
+pcb_coord_t pcb_grid_fit(pcb_coord_t x, pcb_coord_t grid_spacing, pcb_coord_t grid_offset)
{
x -= grid_offset;
x = grid_spacing * pcb_round((double) x / grid_spacing);
@@ -639,10 +609,10 @@ Coord GridFit(Coord x, Coord grid_spacing, Coord grid_offset)
* (if necessary) mean repainting the whole screen if the GUI hasn't tracked the
* location of existing attached drawing.
*/
-void notify_crosshair_change(pcb_bool changes_complete)
+void pcb_notify_crosshair_change(pcb_bool changes_complete)
{
- if (gui->notify_crosshair_change)
- gui->notify_crosshair_change(changes_complete);
+ if (pcb_gui->notify_crosshair_change)
+ pcb_gui->notify_crosshair_change(changes_complete);
}
@@ -660,111 +630,75 @@ void notify_crosshair_change(pcb_bool changes_complete)
* They should initiate a redraw of the mark - which may (if necessary) mean
* repainting the whole screen if the GUI hasn't tracked the mark's location.
*/
-void notify_mark_change(pcb_bool changes_complete)
+void pcb_notify_mark_change(pcb_bool changes_complete)
{
- if (gui->notify_mark_change)
- gui->notify_mark_change(changes_complete);
+ if (pcb_gui->notify_mark_change)
+ pcb_gui->notify_mark_change(changes_complete);
}
-/* ---------------------------------------------------------------------------
- * Convenience for plugins using the old {Hide,Restore}Crosshair API.
- * This links up to notify the GUI of the expected changes using the new APIs.
- *
- * Use of this old API is deprecated, as the names don't necessarily reflect
- * what all GUIs may do in response to the notifications. Keeping these APIs
- * is aimed at easing transition to the newer API, they will emit a harmless
- * warning at the time of their first use.
- *
- */
-void HideCrosshair(void)
-{
- static pcb_bool warned_old_api = pcb_false;
- if (!warned_old_api) {
- Message(PCB_MSG_DEFAULT, _("WARNING: A plugin is using the deprecated API HideCrosshair().\n"
- " This API may be removed in a future release of PCB.\n"));
- warned_old_api = pcb_true;
- }
-
- notify_crosshair_change(pcb_false);
- notify_mark_change(pcb_false);
-}
-
-void RestoreCrosshair(void)
-{
- static pcb_bool warned_old_api = pcb_false;
- if (!warned_old_api) {
- Message(PCB_MSG_DEFAULT, _("WARNING: A plugin is using the deprecated API RestoreCrosshair().\n"
- " This API may be removed in a future release of PCB.\n"));
- warned_old_api = pcb_true;
- }
-
- notify_crosshair_change(pcb_true);
- notify_mark_change(pcb_true);
-}
-
/*
* Below is the implementation of the "highlight on endpoint" functionality.
* This highlights lines and arcs when the crosshair is on of their (two)
* endpoints.
*/
struct onpoint_search_info {
- CrosshairType *crosshair;
- Coord X;
- Coord Y;
+ pcb_crosshair_t *crosshair;
+ pcb_coord_t X;
+ pcb_coord_t Y;
};
-static r_dir_t onpoint_line_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t onpoint_line_callback(const pcb_box_t * box, void *cl)
{
struct onpoint_search_info *info = (struct onpoint_search_info *) cl;
- CrosshairType *crosshair = info->crosshair;
- LineType *line = (LineType *) box;
+ pcb_crosshair_t *crosshair = info->crosshair;
+ pcb_line_t *line = (pcb_line_t *) box;
#ifdef DEBUG_ONPOINT
printf("X=%ld Y=%ld X1=%ld Y1=%ld X2=%ld Y2=%ld\n", info->X, info->Y,
line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y);
#endif
if ((line->Point1.X == info->X && line->Point1.Y == info->Y) || (line->Point2.X == info->X && line->Point2.Y == info->Y)) {
- OnpointType op;
+ pcb_onpoint_t op;
op.type = PCB_TYPE_LINE;
op.obj.line = line;
vtop_append(&crosshair->onpoint_objs, op);
- SET_FLAG(PCB_FLAG_ONPOINT, (AnyObjectType *) line);
+ PCB_FLAG_SET(PCB_FLAG_ONPOINT, (pcb_any_obj_t *) line);
DrawLine(NULL, line);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
else {
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
}
#define close_enough(v1, v2) (coord_abs((v1)-(v2)) < 10)
-static r_dir_t onpoint_arc_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t onpoint_arc_callback(const pcb_box_t * box, void *cl)
{
struct onpoint_search_info *info = (struct onpoint_search_info *) cl;
- CrosshairType *crosshair = info->crosshair;
- ArcType *arc = (ArcType *) box;
- Coord p1x, p1y, p2x, p2y;
+ pcb_crosshair_t *crosshair = info->crosshair;
+ pcb_arc_t *arc = (pcb_arc_t *) box;
+ pcb_coord_t p1x, p1y, p2x, p2y;
- p1x = arc->X - arc->Width * cos(TO_RADIANS(arc->StartAngle));
- p1y = arc->Y + arc->Height * sin(TO_RADIANS(arc->StartAngle));
- p2x = arc->X - arc->Width * cos(TO_RADIANS(arc->StartAngle + arc->Delta));
- p2y = arc->Y + arc->Height * sin(TO_RADIANS(arc->StartAngle + arc->Delta));
+ p1x = arc->X - arc->Width * cos(PCB_TO_RADIANS(arc->StartAngle));
+ p1y = arc->Y + arc->Height * sin(PCB_TO_RADIANS(arc->StartAngle));
+ p2x = arc->X - arc->Width * cos(PCB_TO_RADIANS(arc->StartAngle + arc->Delta));
+ p2y = arc->Y + arc->Height * sin(PCB_TO_RADIANS(arc->StartAngle + arc->Delta));
/* printf("p1=%ld;%ld p2=%ld;%ld info=%ld;%ld\n", p1x, p1y, p2x, p2y, info->X, info->Y); */
if ((close_enough(p1x, info->X) && close_enough(p1y, info->Y)) || (close_enough(p2x, info->X) && close_enough(p2y, info->Y))) {
- OnpointType op;
+ pcb_onpoint_t op;
op.type = PCB_TYPE_ARC;
op.obj.arc = arc;
vtop_append(&crosshair->onpoint_objs, op);
- SET_FLAG(PCB_FLAG_ONPOINT, (AnyObjectType *) arc);
+ PCB_FLAG_SET(PCB_FLAG_ONPOINT, (pcb_any_obj_t *) arc);
DrawArc(NULL, arc);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
else {
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
}
@@ -777,14 +711,12 @@ void DrawLineOrArc(int type, void *obj)
* ATM DrawLine() only calls AddPart() internally, which invalidates
* the area specified by the line's bounding box.
*/
- DrawLine(NULL, (LineType *) obj);
+ DrawLine(NULL, (pcb_line_t *) obj);
break;
-#if 0
- case ARCPOINT_TYPE:
+ case PCB_TYPE_ARC_POINT:
/* See comment above */
- DrawArc(NULL, (ArcType *) obj);
+ DrawArc(NULL, (pcb_arc_t *) obj);
break;
-#endif
}
}
@@ -801,7 +733,7 @@ static void *onpoint_find(vtop_t *vect, void *obj_ptr)
int i;
for (i = 0; i < vect->used; i++) {
- OnpointType *op = &(vect->array[i]);
+ pcb_onpoint_t *op = &(vect->array[i]);
if (op->obj.any == obj_ptr)
return op;
}
@@ -813,9 +745,9 @@ static void *onpoint_find(vtop_t *vect, void *obj_ptr)
* at the given coordinates and adds them to the crosshair's
* object list along with their respective type.
*/
-static void onpoint_work(CrosshairType * crosshair, Coord X, Coord Y)
+static void onpoint_work(pcb_crosshair_t * crosshair, pcb_coord_t X, pcb_coord_t Y)
{
- BoxType SearchBox = point_box(X, Y);
+ pcb_box_t SearchBox = pcb_point_box(X, Y);
struct onpoint_search_info info;
int i;
pcb_bool redraw = pcb_false;
@@ -831,31 +763,31 @@ static void onpoint_work(CrosshairType * crosshair, Coord X, Coord Y)
info.X = X;
info.Y = Y;
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *layer = &PCB->Data->Layer[i];
+ for (i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layer_t *layer = &PCB->Data->Layer[i];
/* Only find points of arcs and lines on currently visible layers. */
if (!layer->On)
continue;
- r_search(layer->line_tree, &SearchBox, NULL, onpoint_line_callback, &info, NULL);
- r_search(layer->arc_tree, &SearchBox, NULL, onpoint_arc_callback, &info, NULL);
+ pcb_r_search(layer->line_tree, &SearchBox, NULL, onpoint_line_callback, &info, NULL);
+ pcb_r_search(layer->arc_tree, &SearchBox, NULL, onpoint_arc_callback, &info, NULL);
}
/* Undraw the old objects */
for (i = 0; i < crosshair->old_onpoint_objs.used; i++) {
- OnpointType *op = &crosshair->old_onpoint_objs.array[i];
+ pcb_onpoint_t *op = &crosshair->old_onpoint_objs.array[i];
/* only remove and redraw those which aren't in the new list */
if (onpoint_find(&crosshair->onpoint_objs, op->obj.any) != NULL)
continue;
- CLEAR_FLAG(PCB_FLAG_ONPOINT, (AnyObjectType *) op->obj.any);
+ PCB_FLAG_CLEAR(PCB_FLAG_ONPOINT, (pcb_any_obj_t *) op->obj.any);
DrawLineOrArc(op->type, op->obj.any);
redraw = pcb_true;
}
/* draw the new objects */
for (i = 0; i < crosshair->onpoint_objs.used; i++) {
- OnpointType *op = &crosshair->onpoint_objs.array[i];
+ pcb_onpoint_t *op = &crosshair->onpoint_objs.array[i];
/* only draw those which aren't in the old list */
if (onpoint_find(&crosshair->old_onpoint_objs, op->obj.any) != NULL)
@@ -865,7 +797,7 @@ static void onpoint_work(CrosshairType * crosshair, Coord X, Coord Y)
}
if (redraw) {
- Redraw();
+ pcb_redraw();
}
}
@@ -877,16 +809,16 @@ static double square(double x)
return x * x;
}
-static double crosshair_sq_dist(CrosshairType * crosshair, Coord x, Coord y)
+static double crosshair_sq_dist(pcb_crosshair_t * crosshair, pcb_coord_t x, pcb_coord_t y)
{
return square(x - crosshair->X) + square(y - crosshair->Y);
}
struct snap_data {
- CrosshairType *crosshair;
+ pcb_crosshair_t *crosshair;
double nearest_sq_dist;
pcb_bool nearest_is_grid;
- Coord x, y;
+ pcb_coord_t x, y;
};
/* Snap to a given location if it is the closest thing we found so far.
@@ -895,12 +827,12 @@ struct snap_data {
* pressing the SHIFT key. If the SHIFT key is pressed, the closest object
* (including grid points), is always preferred.
*/
-static void check_snap_object(struct snap_data *snap_data, Coord x, Coord y, pcb_bool prefer_to_grid)
+static void check_snap_object(struct snap_data *snap_data, pcb_coord_t x, pcb_coord_t y, pcb_bool prefer_to_grid)
{
double sq_dist;
sq_dist = crosshair_sq_dist(snap_data->crosshair, x, y);
- if (sq_dist < snap_data->nearest_sq_dist || (prefer_to_grid && snap_data->nearest_is_grid && !gui->shift_is_pressed())) {
+ if (sq_dist < snap_data->nearest_sq_dist || (prefer_to_grid && snap_data->nearest_is_grid && !pcb_gui->shift_is_pressed())) {
snap_data->x = x;
snap_data->y = y;
snap_data->nearest_sq_dist = sq_dist;
@@ -908,12 +840,12 @@ static void check_snap_object(struct snap_data *snap_data, Coord x, Coord y, pcb
}
}
-static void check_snap_offgrid_line(struct snap_data *snap_data, Coord nearest_grid_x, Coord nearest_grid_y)
+static void check_snap_offgrid_line(struct snap_data *snap_data, pcb_coord_t nearest_grid_x, pcb_coord_t nearest_grid_y)
{
void *ptr1, *ptr2, *ptr3;
int ans;
- LineType *line;
- Coord try_x, try_y;
+ pcb_line_t *line;
+ pcb_coord_t try_x, try_y;
double dx, dy;
double dist;
@@ -924,12 +856,12 @@ static void check_snap_offgrid_line(struct snap_data *snap_data, Coord nearest_g
/* Pick the nearest grid-point in the x or y direction
* to align with, then adjust until we hit the line
*/
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_LINE, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_LINE, &ptr1, &ptr2, &ptr3);
if (ans == PCB_TYPE_NONE)
return;
- line = (LineType *) ptr2;
+ line = (pcb_line_t *) ptr2;
/* Allow snapping to off-grid lines when drawing new lines (on
* the same layer), and when moving a line end-point
@@ -937,8 +869,9 @@ static void check_snap_offgrid_line(struct snap_data *snap_data, Coord nearest_g
*/
if ((conf_core.editor.mode != PCB_MODE_LINE || CURRENT != ptr1) &&
(conf_core.editor.mode != PCB_MODE_MOVE ||
- Crosshair.AttachedObject.Ptr1 != ptr1 ||
- Crosshair.AttachedObject.Type != PCB_TYPE_LINE_POINT || Crosshair.AttachedObject.Ptr2 == line))
+ pcb_crosshair.AttachedObject.Ptr1 != ptr1 ||
+ pcb_crosshair.AttachedObject.Type != PCB_TYPE_LINE_POINT
+ || pcb_crosshair.AttachedObject.Ptr2 == line))
return;
dx = line->Point2.X - line->Point1.X;
@@ -991,76 +924,76 @@ static void check_snap_offgrid_line(struct snap_data *snap_data, Coord nearest_g
/* ---------------------------------------------------------------------------
* recalculates the passed coordinates to fit the current grid setting
*/
-void FitCrosshairIntoGrid(Coord X, Coord Y)
+void pcb_crosshair_grid_fit(pcb_coord_t X, pcb_coord_t Y)
{
- Coord nearest_grid_x, nearest_grid_y;
+ pcb_coord_t nearest_grid_x, nearest_grid_y;
void *ptr1, *ptr2, *ptr3;
struct snap_data snap_data;
int ans;
- Crosshair.X = PCB_CLAMP(X, Crosshair.MinX, Crosshair.MaxX);
- Crosshair.Y = PCB_CLAMP(Y, Crosshair.MinY, Crosshair.MaxY);
+ pcb_crosshair.X = PCB_CLAMP(X, pcb_crosshair.MinX, pcb_crosshair.MaxX);
+ pcb_crosshair.Y = PCB_CLAMP(Y, pcb_crosshair.MinY, pcb_crosshair.MaxY);
if (PCB->RatDraw) {
nearest_grid_x = -PCB_MIL_TO_COORD(6);
nearest_grid_y = -PCB_MIL_TO_COORD(6);
}
else {
- nearest_grid_x = GridFit(Crosshair.X, PCB->Grid, PCB->GridOffsetX);
- nearest_grid_y = GridFit(Crosshair.Y, PCB->Grid, PCB->GridOffsetY);
+ nearest_grid_x = pcb_grid_fit(pcb_crosshair.X, PCB->Grid, PCB->GridOffsetX);
+ nearest_grid_y = pcb_grid_fit(pcb_crosshair.Y, PCB->Grid, PCB->GridOffsetY);
- if (Marked.status && conf_core.editor.orthogonal_moves) {
- Coord dx = Crosshair.X - Marked.X;
- Coord dy = Crosshair.Y - Marked.Y;
+ if (pcb_marked.status && conf_core.editor.orthogonal_moves) {
+ pcb_coord_t dx = pcb_crosshair.X - pcb_marked.X;
+ pcb_coord_t dy = pcb_crosshair.Y - pcb_marked.Y;
if (PCB_ABS(dx) > PCB_ABS(dy))
- nearest_grid_y = Marked.Y;
+ nearest_grid_y = pcb_marked.Y;
else
- nearest_grid_x = Marked.X;
+ nearest_grid_x = pcb_marked.X;
}
}
- snap_data.crosshair = &Crosshair;
- snap_data.nearest_sq_dist = crosshair_sq_dist(&Crosshair, nearest_grid_x, nearest_grid_y);
+ snap_data.crosshair = &pcb_crosshair;
+ snap_data.nearest_sq_dist = crosshair_sq_dist(&pcb_crosshair, nearest_grid_x, nearest_grid_y);
snap_data.nearest_is_grid = pcb_true;
snap_data.x = nearest_grid_x;
snap_data.y = nearest_grid_y;
ans = PCB_TYPE_NONE;
if (!PCB->RatDraw)
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3);
if (ans & PCB_TYPE_ELEMENT) {
- ElementType *el = (ElementType *) ptr1;
+ pcb_element_t *el = (pcb_element_t *) ptr1;
check_snap_object(&snap_data, el->MarkX, el->MarkY, pcb_false);
}
ans = PCB_TYPE_NONE;
if (PCB->RatDraw || conf_core.editor.snap_pin)
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3);
/* Avoid self-snapping when moving */
if (ans != PCB_TYPE_NONE &&
- conf_core.editor.mode == PCB_MODE_MOVE && Crosshair.AttachedObject.Type == PCB_TYPE_ELEMENT && ptr1 == Crosshair.AttachedObject.Ptr1)
+ conf_core.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_TYPE_ELEMENT && ptr1 == pcb_crosshair.AttachedObject.Ptr1)
ans = PCB_TYPE_NONE;
if (ans != PCB_TYPE_NONE &&
- (conf_core.editor.mode == PCB_MODE_LINE || (conf_core.editor.mode == PCB_MODE_MOVE && Crosshair.AttachedObject.Type == PCB_TYPE_LINE_POINT))) {
- PadTypePtr pad = (PadTypePtr) ptr2;
- LayerType *desired_layer;
- pcb_cardinal_t desired_group;
- pcb_cardinal_t SLayer, CLayer;
+ (conf_core.editor.mode == PCB_MODE_LINE || (conf_core.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_TYPE_LINE_POINT))) {
+ pcb_pad_t *pad = (pcb_pad_t *) ptr2;
+ pcb_layer_t *desired_layer;
+ pcb_layergrp_id_t desired_group;
+ pcb_layergrp_id_t SLayer, CLayer;
int found_our_layer = pcb_false;
desired_layer = CURRENT;
- if (conf_core.editor.mode == PCB_MODE_MOVE && Crosshair.AttachedObject.Type == PCB_TYPE_LINE_POINT) {
- desired_layer = (LayerType *) Crosshair.AttachedObject.Ptr1;
+ if (conf_core.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_TYPE_LINE_POINT) {
+ desired_layer = (pcb_layer_t *) pcb_crosshair.AttachedObject.Ptr1;
}
/* find layer groups of the component side and solder side */
- SLayer = GetLayerGroupNumberByNumber(solder_silk_layer);
- CLayer = GetLayerGroupNumberByNumber(component_silk_layer);
- desired_group = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer;
+ SLayer = pcb_layer_get_group(pcb_solder_silk_layer);
+ CLayer = pcb_layer_get_group(pcb_component_silk_layer);
+ desired_group = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer;
GROUP_LOOP(PCB->Data, desired_group);
{
@@ -1069,50 +1002,56 @@ void FitCrosshairIntoGrid(Coord X, Coord Y)
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (found_our_layer == pcb_false)
ans = PCB_TYPE_NONE;
}
if (ans != PCB_TYPE_NONE) {
- PadType *pad = (PadType *) ptr2;
+ pcb_pad_t *pad = (pcb_pad_t *) ptr2;
check_snap_object(&snap_data, (pad->Point1.X + pad->Point2.X) / 2, (pad->Point1.Y + pad->Point2.Y) / 2, pcb_true);
}
ans = PCB_TYPE_NONE;
if (PCB->RatDraw || conf_core.editor.snap_pin)
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3);
/* Avoid self-snapping when moving */
if (ans != PCB_TYPE_NONE &&
- conf_core.editor.mode == PCB_MODE_MOVE && Crosshair.AttachedObject.Type == PCB_TYPE_ELEMENT && ptr1 == Crosshair.AttachedObject.Ptr1)
+ conf_core.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_TYPE_ELEMENT && ptr1 == pcb_crosshair.AttachedObject.Ptr1)
ans = PCB_TYPE_NONE;
if (ans != PCB_TYPE_NONE) {
- PinType *pin = (PinType *) ptr2;
+ pcb_pin_t *pin = (pcb_pin_t *) ptr2;
check_snap_object(&snap_data, pin->X, pin->Y, pcb_true);
}
ans = PCB_TYPE_NONE;
if (conf_core.editor.snap_pin)
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3);
/* Avoid snapping vias to any other vias */
- if (conf_core.editor.mode == PCB_MODE_MOVE && Crosshair.AttachedObject.Type == PCB_TYPE_VIA && (ans & PCB_TYPEMASK_PIN))
+ if (conf_core.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_TYPE_VIA && (ans & PCB_TYPEMASK_PIN))
ans = PCB_TYPE_NONE;
if (ans != PCB_TYPE_NONE) {
- PinType *pin = (PinType *) ptr2;
+ pcb_pin_t *pin = (pcb_pin_t *) ptr2;
check_snap_object(&snap_data, pin->X, pin->Y, pcb_true);
}
ans = PCB_TYPE_NONE;
if (conf_core.editor.snap_pin)
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_LINE_POINT, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_LINE_POINT | PCB_TYPE_ARC_POINT, &ptr1, &ptr2, &ptr3);
- if (ans != PCB_TYPE_NONE) {
- PointType *pnt = (PointType *) ptr3;
+ if (ans == PCB_TYPE_ARC_POINT) {
+ /* Arc point needs special handling as it's not a real point but has to be calculated */
+ pcb_coord_t ex, ey;
+ pcb_arc_get_end((pcb_arc_t *)ptr2, (ptr3 != pcb_arc_start_ptr), &ex, &ey);
+ check_snap_object(&snap_data, ex, ey, pcb_true);
+ }
+ else if (ans != PCB_TYPE_NONE) {
+ pcb_point_t *pnt = (pcb_point_t *) ptr3;
check_snap_object(&snap_data, pnt->X, pnt->Y, pcb_true);
}
@@ -1124,65 +1063,69 @@ void FitCrosshairIntoGrid(Coord X, Coord Y)
ans = PCB_TYPE_NONE;
if (conf_core.editor.snap_pin)
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_POLYGON_POINT, &ptr1, &ptr2, &ptr3);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_POLYGON_POINT, &ptr1, &ptr2, &ptr3);
if (ans != PCB_TYPE_NONE) {
- PointType *pnt = (PointType *) ptr3;
+ pcb_point_t *pnt = (pcb_point_t *) ptr3;
check_snap_object(&snap_data, pnt->X, pnt->Y, pcb_true);
}
if (snap_data.x >= 0 && snap_data.y >= 0) {
- Crosshair.X = snap_data.x;
- Crosshair.Y = snap_data.y;
+ pcb_crosshair.X = snap_data.x;
+ pcb_crosshair.Y = snap_data.y;
}
if (conf_core.editor.highlight_on_point)
- onpoint_work(&Crosshair, Crosshair.X, Crosshair.Y);
+ onpoint_work(&pcb_crosshair, pcb_crosshair.X, pcb_crosshair.Y);
if (conf_core.editor.mode == PCB_MODE_ARROW) {
- ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_LINE_POINT, &ptr1, &ptr2, &ptr3);
- if (ans == PCB_TYPE_NONE)
- hid_action("PointCursor");
- else if (!TEST_FLAG(PCB_FLAG_SELECTED, (LineType *) ptr2))
- hid_actionl("PointCursor", "True", NULL);
+ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_LINE_POINT, &ptr1, &ptr2, &ptr3);
+ if (ans == PCB_TYPE_NONE) {
+ if ((pcb_gui != NULL) && (pcb_gui->point_cursor != NULL))
+ pcb_gui->point_cursor(pcb_false);
+ }
+ else if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, (pcb_line_t *) ptr2)) {
+ if ((pcb_gui != NULL) && (pcb_gui->point_cursor != NULL))
+ pcb_gui->point_cursor(pcb_true);
+ }
}
- if (conf_core.editor.mode == PCB_MODE_LINE && Crosshair.AttachedLine.State != STATE_FIRST && conf_core.editor.auto_drc)
- EnforceLineDRC();
+ if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && conf_core.editor.auto_drc)
+ pcb_line_enforce_drc();
- gui->set_crosshair(Crosshair.X, Crosshair.Y, HID_SC_DO_NOTHING);
+ pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_DO_NOTHING);
}
/* ---------------------------------------------------------------------------
* move crosshair relative (has to be switched off)
*/
-void MoveCrosshairRelative(Coord DeltaX, Coord DeltaY)
+void pcb_crosshair_move_relative(pcb_coord_t DeltaX, pcb_coord_t DeltaY)
{
- FitCrosshairIntoGrid(Crosshair.X + DeltaX, Crosshair.Y + DeltaY);
+ pcb_crosshair_grid_fit(pcb_crosshair.X + DeltaX, pcb_crosshair.Y + DeltaY);
}
/* ---------------------------------------------------------------------------
* move crosshair absolute
* return pcb_true if the crosshair was moved from its existing position
*/
-pcb_bool MoveCrosshairAbsolute(Coord X, Coord Y)
+pcb_bool pcb_crosshair_move_absolute(pcb_coord_t X, pcb_coord_t Y)
{
- Coord x, y, z;
- x = Crosshair.X;
- y = Crosshair.Y;
- FitCrosshairIntoGrid(X, Y);
- if (Crosshair.X != x || Crosshair.Y != y) {
+ pcb_coord_t x, y, z;
+ x = pcb_crosshair.X;
+ y = pcb_crosshair.Y;
+ pcb_crosshair_grid_fit(X, Y);
+ if (pcb_crosshair.X != x || pcb_crosshair.Y != y) {
/* back up to old position to notify the GUI
* (which might want to erase the old crosshair) */
- z = Crosshair.X;
- Crosshair.X = x;
+ z = pcb_crosshair.X;
+ pcb_crosshair.X = x;
x = z;
- z = Crosshair.Y;
- Crosshair.Y = y;
- notify_crosshair_change(pcb_false); /* Our caller notifies when it has done */
+ z = pcb_crosshair.Y;
+ pcb_crosshair.Y = y;
+ pcb_notify_crosshair_change(pcb_false); /* Our caller notifies when it has done */
/* now move forward again */
- Crosshair.X = x;
- Crosshair.Y = z;
+ pcb_crosshair.X = x;
+ pcb_crosshair.Y = z;
return (pcb_true);
}
return (pcb_false);
@@ -1191,51 +1134,196 @@ pcb_bool MoveCrosshairAbsolute(Coord X, Coord Y)
/* ---------------------------------------------------------------------------
* sets the valid range for the crosshair cursor
*/
-void SetCrosshairRange(Coord MinX, Coord MinY, Coord MaxX, Coord MaxY)
+void pcb_crosshair_set_range(pcb_coord_t MinX, pcb_coord_t MinY, pcb_coord_t MaxX, pcb_coord_t MaxY)
{
- Crosshair.MinX = MAX(0, MinX);
- Crosshair.MinY = MAX(0, MinY);
- Crosshair.MaxX = MIN(PCB->MaxWidth, MaxX);
- Crosshair.MaxY = MIN(PCB->MaxHeight, MaxY);
+ pcb_crosshair.MinX = MAX(0, MinX);
+ pcb_crosshair.MinY = MAX(0, MinY);
+ pcb_crosshair.MaxX = MIN(PCB->MaxWidth, MaxX);
+ pcb_crosshair.MaxY = MIN(PCB->MaxHeight, MaxY);
/* force update of position */
- MoveCrosshairRelative(0, 0);
+ pcb_crosshair_move_relative(0, 0);
+}
+
+/* ---------------------------------------------------------------------------
+ * centers the displayed PCB around the specified point (X,Y)
+ */
+void pcb_center_display(pcb_coord_t X, pcb_coord_t Y)
+{
+ pcb_coord_t save_grid = PCB->Grid;
+ PCB->Grid = 1;
+ if (pcb_crosshair_move_absolute(X, Y))
+ pcb_notify_crosshair_change(pcb_true);
+ pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_WARP_POINTER);
+ PCB->Grid = save_grid;
}
/* ---------------------------------------------------------------------------
* initializes crosshair stuff
* clears the struct, allocates to graphical contexts
*/
-void InitCrosshair(void)
+void pcb_crosshair_init(void)
{
- Crosshair.GC = gui->make_gc();
+ pcb_crosshair.GC = pcb_gui->make_gc();
- gui->set_color(Crosshair.GC, conf_core.appearance.color.crosshair);
- gui->set_draw_xor(Crosshair.GC, 1);
- gui->set_line_cap(Crosshair.GC, Trace_Cap);
- gui->set_line_width(Crosshair.GC, 1);
+ pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair);
+ pcb_gui->set_draw_xor(pcb_crosshair.GC, 1);
+ pcb_gui->set_line_cap(pcb_crosshair.GC, Trace_Cap);
+ pcb_gui->set_line_width(pcb_crosshair.GC, 1);
/* set initial shape */
- Crosshair.shape = Basic_Crosshair_Shape;
+ pcb_crosshair.shape = pcb_ch_shape_basic;
/* set default limits */
- Crosshair.MinX = Crosshair.MinY = 0;
- Crosshair.MaxX = PCB->MaxWidth;
- Crosshair.MaxY = PCB->MaxHeight;
+ pcb_crosshair.MinX = pcb_crosshair.MinY = 0;
+ pcb_crosshair.MaxX = PCB->MaxWidth;
+ pcb_crosshair.MaxY = PCB->MaxHeight;
/* Initialize the onpoint data. */
- memset(&Crosshair.onpoint_objs, 0, sizeof(vtop_t));
- memset(&Crosshair.old_onpoint_objs, 0, sizeof(vtop_t));
+ memset(&pcb_crosshair.onpoint_objs, 0, sizeof(vtop_t));
+ memset(&pcb_crosshair.old_onpoint_objs, 0, sizeof(vtop_t));
/* clear the mark */
- Marked.status = pcb_false;
+ pcb_marked.status = pcb_false;
}
/* ---------------------------------------------------------------------------
* exits crosshair routines, release GCs
*/
-void DestroyCrosshair(void)
+void pcb_crosshair_uninit(void)
+{
+ pcb_poly_free_fields(&pcb_crosshair.AttachedPolygon);
+ pcb_gui->destroy_gc(pcb_crosshair.GC);
+}
+
+/************************* mode *************************************/
+static int mode_position = 0;
+static int mode_stack[PCB_MAX_MODESTACK_DEPTH];
+
+/* sets the crosshair range to the current buffer extents */
+void pcb_crosshair_range_to_buffer(void)
+{
+ if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER) {
+ if (pcb_set_buffer_bbox(PCB_PASTEBUFFER) == 0) {
+ pcb_crosshair_set_range(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->BoundingBox.X1,
+ PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->BoundingBox.Y1,
+ PCB->MaxWidth -
+ (PCB_PASTEBUFFER->BoundingBox.X2 - PCB_PASTEBUFFER->X),
+ PCB->MaxHeight - (PCB_PASTEBUFFER->BoundingBox.Y2 - PCB_PASTEBUFFER->Y));
+ }
+ else /* failed to calculate the bounding box of the buffer, it's probably a single-object move, allow the whole page */
+ pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ }
+}
+
+void pcb_crosshair_save_mode(void)
+{
+ mode_stack[mode_position] = conf_core.editor.mode;
+ if (mode_position < PCB_MAX_MODESTACK_DEPTH - 1)
+ mode_position++;
+}
+
+void pcb_crosshair_restore_mode(void)
+{
+ if (mode_position == 0) {
+ pcb_message(PCB_MSG_ERROR, "hace: underflow of restore mode\n");
+ return;
+ }
+ pcb_crosshair_set_mode(mode_stack[--mode_position]);
+}
+
+
+/* set a new mode and update X cursor */
+void pcb_crosshair_set_mode(int Mode)
+{
+ char sMode[32];
+ static pcb_bool recursing = pcb_false;
+ /* protect the cursor while changing the mode
+ * perform some additional stuff depending on the new mode
+ * reset 'state' of attached objects
+ */
+ if (recursing)
+ return;
+ recursing = pcb_true;
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_added_lines = 0;
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_NONE;
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedPolygon.PointN = 0;
+ if (PCB->RatDraw) {
+ if (Mode == PCB_MODE_ARC || Mode == PCB_MODE_RECTANGLE ||
+ Mode == PCB_MODE_VIA || Mode == PCB_MODE_POLYGON ||
+ Mode == PCB_MODE_POLYGON_HOLE || Mode == PCB_MODE_TEXT || Mode == PCB_MODE_THERMAL) {
+ pcb_message(PCB_MSG_WARNING, _("That mode is NOT allowed when drawing ratlines!\n"));
+ Mode = PCB_MODE_NO;
+ }
+ }
+ if (conf_core.editor.mode == PCB_MODE_LINE && Mode == PCB_MODE_ARC && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) {
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_SECOND;
+ pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.AttachedLine.Point1.X;
+ pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.AttachedLine.Point1.Y;
+ pcb_adjust_attached_objects();
+ }
+ else if (conf_core.editor.mode == PCB_MODE_ARC && Mode == PCB_MODE_LINE && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) {
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_SECOND;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = pcb_crosshair.AttachedBox.Point1.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = pcb_crosshair.AttachedBox.Point1.Y;
+ sprintf(sMode, "%d", Mode);
+ conf_set(CFR_DESIGN, "editor/mode", -1, sMode, POL_OVERWRITE);
+ pcb_adjust_attached_objects();
+ }
+ else {
+ if (conf_core.editor.mode == PCB_MODE_ARC || conf_core.editor.mode == PCB_MODE_LINE)
+ pcb_crosshair_set_local_ref(0, 0, pcb_false);
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ if (Mode == PCB_MODE_LINE && conf_core.editor.auto_drc) {
+ if (pcb_reset_conns(pcb_true)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
+ }
+ }
+ }
+
+ sprintf(sMode, "%d", Mode);
+ conf_set(CFR_DESIGN, "editor/mode", -1, sMode, POL_OVERWRITE);
+
+ if (Mode == PCB_MODE_PASTE_BUFFER)
+ /* do an update on the crosshair range */
+ pcb_crosshair_range_to_buffer();
+ else
+ pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight);
+
+ recursing = pcb_false;
+
+ /* force a crosshair grid update because the valid range
+ * may have changed
+ */
+ pcb_crosshair_move_relative(0, 0);
+ pcb_notify_crosshair_change(pcb_true);
+}
+
+void pcb_crosshair_set_local_ref(pcb_coord_t X, pcb_coord_t Y, pcb_bool Showing)
{
- FreePolygonMemory(&Crosshair.AttachedPolygon);
- gui->destroy_gc(Crosshair.GC);
+ static pcb_mark_t old;
+ static int count = 0;
+
+ if (Showing) {
+ pcb_notify_mark_change(pcb_false);
+ if (count == 0)
+ old = pcb_marked;
+ pcb_marked.X = X;
+ pcb_marked.Y = Y;
+ pcb_marked.status = pcb_true;
+ count++;
+ pcb_notify_mark_change(pcb_true);
+ }
+ else if (count > 0) {
+ pcb_notify_mark_change(pcb_false);
+ count = 0;
+ pcb_marked = old;
+ pcb_notify_mark_change(pcb_true);
+ }
}
diff --git a/src/crosshair.h b/src/crosshair.h
index d06c16e..888ab21 100644
--- a/src/crosshair.h
+++ b/src/crosshair.h
@@ -29,27 +29,99 @@
#ifndef PCB_CROSSHAIR_H
#define PCB_CROSSHAIR_H
-#include "global.h"
+#include "config.h"
+#include "vtonpoint.h"
+#include "hid.h"
+#include "obj_line.h"
+#include "obj_poly.h"
+
+typedef struct { /* currently marked block */
+ pcb_point_t Point1, /* start- and end-position */
+ Point2;
+ long int State;
+ pcb_bool otherway;
+} pcb_attached_box_t;
+
+typedef struct { /* currently attached object */
+ pcb_coord_t X, Y; /* saved position when PCB_MODE_MOVE */
+ pcb_box_t BoundingBox;
+ long int Type, /* object type */
+ State;
+ void *Ptr1, /* three pointers to data, see */
+ *Ptr2, /* search.c */
+ *Ptr3;
+ pcb_angle_t start_angle, delta_angle;
+ pcb_coord_t radius;
+} pcb_attached_object_t;
+
+typedef struct {
+ pcb_bool status;
+ pcb_coord_t X, Y;
+} pcb_mark_t;
+
+enum pcb_crosshair_shape_e {
+ pcb_ch_shape_basic = 0, /* 4-ray */
+ pcb_ch_shape_union_jack, /* 8-ray */
+ pcb_ch_shape_dozen, /* 12-ray */
+ pcb_ch_shape_NUM
+};
+
+typedef struct { /* holds cursor information */
+ pcb_hid_gc_t GC, /* GC for cursor drawing */
+ AttachGC; /* and for displaying buffer contents */
+ pcb_coord_t X, Y, /* position in PCB coordinates */
+ MinX, MinY, /* lowest and highest coordinates */
+ MaxX, MaxY;
+ pcb_attached_line_t AttachedLine; /* data of new lines... */
+ pcb_attached_box_t AttachedBox;
+ pcb_polygon_t AttachedPolygon;
+ pcb_attached_object_t AttachedObject; /* data of attached objects */
+ enum pcb_crosshair_shape_e shape; /* shape of crosshair */
+ vtop_t onpoint_objs;
+ vtop_t old_onpoint_objs;
+
+ /* list of object IDs that could have been dragged so that they can be cycled */
+ long int *drags;
+ int drags_len, drags_current;
+ pcb_coord_t dragx, dragy; /* the point where drag started */
+} pcb_crosshair_t;
+
/* ---------------------------------------------------------------------------
* all possible states of an attached object
*/
-#define STATE_FIRST 0 /* initial state */
-#define STATE_SECOND 1
-#define STATE_THIRD 2
-
-Coord GridFit(Coord x, Coord grid_spacing, Coord grid_offset);
-void notify_crosshair_change(pcb_bool changes_complete);
-void notify_mark_change(pcb_bool changes_complete);
-void HideCrosshair(void);
-void RestoreCrosshair(void);
-void DrawAttached(void);
-void DrawMark(void);
-void MoveCrosshairRelative(Coord, Coord);
-pcb_bool MoveCrosshairAbsolute(Coord, Coord);
-void SetCrosshairRange(Coord, Coord, Coord, Coord);
-void InitCrosshair(void);
-void DestroyCrosshair(void);
-void FitCrosshairIntoGrid(Coord, Coord);
+#define PCB_CH_STATE_FIRST 0 /* initial state */
+#define PCB_CH_STATE_SECOND 1
+#define PCB_CH_STATE_THIRD 2
+
+extern pcb_crosshair_t pcb_crosshair;
+extern pcb_mark_t pcb_marked;
+
+
+pcb_coord_t pcb_grid_fit(pcb_coord_t x, pcb_coord_t grid_spacing, pcb_coord_t grid_offset);
+void pcb_notify_crosshair_change(pcb_bool changes_complete);
+void pcb_notify_mark_change(pcb_bool changes_complete);
+void pcb_draw_attached(void);
+void pcb_draw_mark(void);
+void pcb_crosshair_move_relative(pcb_coord_t, pcb_coord_t);
+pcb_bool pcb_crosshair_move_absolute(pcb_coord_t, pcb_coord_t);
+void pcb_crosshair_set_range(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t);
+void pcb_crosshair_init(void);
+void pcb_crosshair_uninit(void);
+void pcb_crosshair_grid_fit(pcb_coord_t, pcb_coord_t);
+void pcb_center_display(pcb_coord_t X, pcb_coord_t Y);
+
+/*** cursor/crosshair mode ***/
+
+/* sets the crosshair range to the current buffer extents */
+void pcb_crosshair_range_to_buffer(void);
+void pcb_crosshair_save_mode(void);
+void pcb_crosshair_restore_mode(void);
+void pcb_crosshair_set_mode(int Mode);
+void pcb_crosshair_set_local_ref(pcb_coord_t X, pcb_coord_t Y, pcb_bool Showing);
+
+
+/*** utility for plugins ***/
+void XORDrawAttachedLine(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t);
#endif
diff --git a/src/data.c b/src/data.c
index d7ae35c..b9b2c10 100644
--- a/src/data.c
+++ b/src/data.c
@@ -28,137 +28,135 @@
*/
#include "config.h"
+#include "board.h"
#include "data.h"
+#include "rtree.h"
+#include "list_common.h"
+#include "obj_all.h"
/* ---------------------------------------------------------------------------
* some shared identifiers
*/
+int pcb_layer_stack[PCB_MAX_LAYER]; /* determines the layer draw order */
-CrosshairType Crosshair; /* information about cursor settings */
-MarkType Marked; /* a cross-hair mark */
-OutputType Output; /* some widgets ... used for drawing */
-PCBTypePtr PCB; /* pointer to layout struct */
+pcb_buffer_t pcb_buffers[PCB_MAX_BUFFER]; /* my buffers */
+pcb_bool pcb_bumped; /* if the undo serial number has changed */
-int LayerStack[MAX_LAYER]; /* determines the layer draw order */
-
-BufferType Buffers[MAX_BUFFER]; /* my buffers */
-pcb_bool Bumped; /* if the undo serial number has changed */
-
-int addedLines;
+int pcb_added_lines;
/* callback based loops */
void pcb_loop_layers(void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb)
{
if ((lacb != NULL) || (lcb != NULL) || (acb != NULL) || (tcb != NULL) || (pocb != NULL)) {
- LAYER_LOOP(PCB->Data, max_copper_layer + 2);
+ LAYER_LOOP(PCB->Data, pcb_max_copper_layer + 2);
{
if (lacb != NULL)
if (lacb(ctx, PCB, layer, 1))
continue;
if (lcb != NULL) {
- LINE_LOOP(layer);
+ PCB_LINE_LOOP(layer);
{
lcb(ctx, PCB, layer, line);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (acb != NULL) {
- ARC_LOOP(layer);
+ PCB_ARC_LOOP(layer);
{
acb(ctx, PCB, layer, arc);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (tcb != NULL) {
- TEXT_LOOP(layer);
+ PCB_TEXT_LOOP(layer);
{
tcb(ctx, PCB, layer, text);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (pocb != NULL) {
- POLYGON_LOOP(layer);
+ PCB_POLY_LOOP(layer);
{
pocb(ctx, PCB, layer, polygon);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (lacb != NULL)
lacb(ctx, PCB, layer, 0);
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
void pcb_loop_elements(void *ctx, pcb_element_cb_t ecb, pcb_eline_cb_t elcb, pcb_earc_cb_t eacb, pcb_etext_cb_t etcb, pcb_epin_cb_t epicb, pcb_epad_cb_t epacb)
{
if ((ecb != NULL) || (elcb != NULL) || (eacb != NULL) || (etcb != NULL) || (epicb != NULL) || (epacb != NULL)) {
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
if (ecb != NULL)
if (ecb(ctx, PCB, element, 1))
continue;
if (elcb != NULL) {
- ELEMENTLINE_LOOP(element);
+ PCB_ELEMENT_PCB_LINE_LOOP(element);
{
elcb(ctx, PCB, element, line);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (eacb != NULL) {
- ELEMENTARC_LOOP(element);
+ PCB_ELEMENT_ARC_LOOP(element);
{
eacb(ctx, PCB, element, arc);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (etcb != NULL) {
- ELEMENTTEXT_LOOP(element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
etcb(ctx, PCB, element, text);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (epicb != NULL) {
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
epicb(ctx, PCB, element, pin);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (epacb != NULL) {
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
epacb(ctx, PCB, element, pad);
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (ecb != NULL)
ecb(ctx, PCB, element, 0);
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
void pcb_loop_vias(void *ctx, pcb_via_cb_t vcb)
{
if (vcb != NULL) {
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
vcb(ctx, PCB, via);
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
@@ -172,3 +170,167 @@ void pcb_loop_all(void *ctx,
pcb_loop_elements(ctx, ecb, elcb, eacb, etcb, epicb, epacb);
pcb_loop_vias(ctx, vcb);
}
+
+/* ---------------------------------------------------------------------------
+ * free memory used by data struct
+ */
+void pcb_data_free(pcb_data_t * data)
+{
+ pcb_layer_t *layer;
+ int i;
+
+ if (data == NULL)
+ return;
+
+ PCB_VIA_LOOP(data);
+ {
+ free(via->Name);
+ }
+ PCB_END_LOOP;
+ list_map0(&data->Via, pcb_pin_t, pcb_via_free);
+ PCB_ELEMENT_LOOP(data);
+ {
+ pcb_element_destroy(element);
+ }
+ PCB_END_LOOP;
+ list_map0(&data->Element, pcb_element_t, pcb_element_free);
+ list_map0(&data->Rat, pcb_rat_t, pcb_rat_free);
+
+ for (layer = data->Layer, i = 0; i < PCB_MAX_LAYER + 2; layer++, i++) {
+ pcb_attribute_free(&layer->Attributes);
+ PCB_TEXT_LOOP(layer);
+ {
+ free(text->TextString);
+ }
+ PCB_END_LOOP;
+ if (layer->Name)
+ free((char*)layer->Name);
+ PCB_LINE_LOOP(layer);
+ {
+ if (line->Number)
+ free(line->Number);
+ }
+ PCB_END_LOOP;
+
+ list_map0(&layer->Line, pcb_line_t, pcb_line_free);
+ list_map0(&layer->Arc, pcb_arc_t, pcb_arc_free);
+ list_map0(&layer->Text, pcb_text_t, pcb_text_free);
+ PCB_POLY_LOOP(layer);
+ {
+ pcb_poly_free_fields(polygon);
+ }
+ PCB_END_LOOP;
+ list_map0(&layer->Polygon, pcb_polygon_t, pcb_poly_free);
+ if (layer->line_tree)
+ pcb_r_destroy_tree(&layer->line_tree);
+ if (layer->arc_tree)
+ pcb_r_destroy_tree(&layer->arc_tree);
+ if (layer->text_tree)
+ pcb_r_destroy_tree(&layer->text_tree);
+ if (layer->polygon_tree)
+ pcb_r_destroy_tree(&layer->polygon_tree);
+ }
+
+ if (data->element_tree)
+ pcb_r_destroy_tree(&data->element_tree);
+ for (i = 0; i < PCB_MAX_ELEMENTNAMES; i++)
+ if (data->name_tree[i])
+ pcb_r_destroy_tree(&data->name_tree[i]);
+ if (data->via_tree)
+ pcb_r_destroy_tree(&data->via_tree);
+ if (data->pin_tree)
+ pcb_r_destroy_tree(&data->pin_tree);
+ if (data->pad_tree)
+ pcb_r_destroy_tree(&data->pad_tree);
+ if (data->rat_tree)
+ pcb_r_destroy_tree(&data->rat_tree);
+ /* clear struct */
+ memset(data, 0, sizeof(pcb_data_t));
+}
+
+/* ---------------------------------------------------------------------------
+ * returns pcb_true if data area is empty
+ */
+pcb_bool pcb_data_is_empty(pcb_data_t *Data)
+{
+ pcb_bool hasNoObjects;
+ pcb_cardinal_t i;
+
+ hasNoObjects = (pinlist_length(&Data->Via) == 0);
+ hasNoObjects &= (elementlist_length(&Data->Element) == 0);
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
+ hasNoObjects = hasNoObjects && PCB_LAYER_IS_EMPTY(&(Data->Layer[i]));
+ return (hasNoObjects);
+}
+
+pcb_box_t *pcb_data_bbox(pcb_box_t *out, pcb_data_t *Data)
+{
+ /* FIX ME: use r_search to do this much faster */
+
+ /* preset identifiers with highest and lowest possible values */
+ out->X1 = out->Y1 = PCB_MAX_COORD;
+ out->X2 = out->Y2 = -PCB_MAX_COORD;
+
+ /* now scan for the lowest/highest X and Y coordinate */
+ PCB_VIA_LOOP(Data);
+ {
+ out->X1 = MIN(out->X1, via->X - via->Thickness / 2);
+ out->Y1 = MIN(out->Y1, via->Y - via->Thickness / 2);
+ out->X2 = MAX(out->X2, via->X + via->Thickness / 2);
+ out->Y2 = MAX(out->Y2, via->Y + via->Thickness / 2);
+ }
+ PCB_END_LOOP;
+ PCB_ELEMENT_LOOP(Data);
+ {
+ out->X1 = MIN(out->X1, element->BoundingBox.X1);
+ out->Y1 = MIN(out->Y1, element->BoundingBox.Y1);
+ out->X2 = MAX(out->X2, element->BoundingBox.X2);
+ out->Y2 = MAX(out->Y2, element->BoundingBox.Y2);
+ {
+ pcb_text_t *text = &PCB_ELEM_TEXT_REFDES(element);
+ out->X1 = MIN(out->X1, text->BoundingBox.X1);
+ out->Y1 = MIN(out->Y1, text->BoundingBox.Y1);
+ out->X2 = MAX(out->X2, text->BoundingBox.X2);
+ out->Y2 = MAX(out->Y2, text->BoundingBox.Y2);
+ };
+ }
+ PCB_END_LOOP;
+ PCB_LINE_ALL_LOOP(Data);
+ {
+ out->X1 = MIN(out->X1, line->Point1.X - line->Thickness / 2);
+ out->Y1 = MIN(out->Y1, line->Point1.Y - line->Thickness / 2);
+ out->X1 = MIN(out->X1, line->Point2.X - line->Thickness / 2);
+ out->Y1 = MIN(out->Y1, line->Point2.Y - line->Thickness / 2);
+ out->X2 = MAX(out->X2, line->Point1.X + line->Thickness / 2);
+ out->Y2 = MAX(out->Y2, line->Point1.Y + line->Thickness / 2);
+ out->X2 = MAX(out->X2, line->Point2.X + line->Thickness / 2);
+ out->Y2 = MAX(out->Y2, line->Point2.Y + line->Thickness / 2);
+ }
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(Data);
+ {
+ out->X1 = MIN(out->X1, arc->BoundingBox.X1);
+ out->Y1 = MIN(out->Y1, arc->BoundingBox.Y1);
+ out->X2 = MAX(out->X2, arc->BoundingBox.X2);
+ out->Y2 = MAX(out->Y2, arc->BoundingBox.Y2);
+ }
+ PCB_ENDALL_LOOP;
+ PCB_TEXT_ALL_LOOP(Data);
+ {
+ out->X1 = MIN(out->X1, text->BoundingBox.X1);
+ out->Y1 = MIN(out->Y1, text->BoundingBox.Y1);
+ out->X2 = MAX(out->X2, text->BoundingBox.X2);
+ out->Y2 = MAX(out->Y2, text->BoundingBox.Y2);
+ }
+ PCB_ENDALL_LOOP;
+ PCB_POLY_ALL_LOOP(Data);
+ {
+ out->X1 = MIN(out->X1, polygon->BoundingBox.X1);
+ out->Y1 = MIN(out->Y1, polygon->BoundingBox.Y1);
+ out->X2 = MAX(out->X2, polygon->BoundingBox.X2);
+ out->Y2 = MAX(out->Y2, polygon->BoundingBox.Y2);
+ }
+ PCB_ENDALL_LOOP;
+ return (pcb_data_is_empty(Data) ? NULL : out);
+}
+
diff --git a/src/data.h b/src/data.h
index 319e4cb..293c8fc 100644
--- a/src/data.h
+++ b/src/data.h
@@ -29,38 +29,40 @@
#ifndef PCB_DATA_H
#define PCB_DATA_H
-#include "global.h"
-
-/* ---------------------------------------------------------------------------
- * some shared identifiers
- */
-
-
-extern CrosshairType Crosshair;
-
-extern MarkType Marked;
-
-extern OutputType Output;
-
-extern PCBTypePtr PCB;
-
-#define max_group (PCB->Data->LayerN)
-#define max_copper_layer (PCB->Data->LayerN)
-#define solder_silk_layer (max_copper_layer + SOLDER_LAYER)
-#define component_silk_layer (max_copper_layer + COMPONENT_LAYER)
-
-extern BufferType Buffers[MAX_BUFFER];
-
-/*extern DeviceInfoType PrintingDevice[];*/
-
-extern char *InputTranslations;
-
-extern int addedLines;
-extern int LayerStack[MAX_LAYER];
-
-extern pcb_bool Bumped;
-
-extern FlagType no_flags;
+#include "globalconst.h"
+#include "global_typedefs.h"
+#include "layer.h"
+#include "crosshair.h"
+#include "buffer.h"
+
+#include "obj_all_list.h"
+
+/* Generic container object that can hold subcircuits with layer-global
+ objects (e.g. vias and rats) and layer-locals (lines, arcs) */
+struct pcb_data_s {
+ int LayerN; /* number of layers in this board */
+ pinlist_t Via;
+ elementlist_t Element;
+/**/
+ pcb_rtree_t *via_tree, *element_tree, *pin_tree, *pad_tree, *name_tree[3], /* for element names */
+ *rat_tree;
+ pcb_board_t *pcb;
+ pcb_layer_t Layer[PCB_MAX_LAYER + 2]; /* add 2 silkscreen layers */
+ pcb_plug_io_t *loader;
+ ratlist_t Rat;
+};
+
+
+#define pcb_max_group (PCB->Data->LayerN)
+#define pcb_max_copper_layer (PCB->Data->LayerN)
+#define pcb_solder_silk_layer (pcb_max_copper_layer + PCB_SOLDER_SIDE)
+#define pcb_component_silk_layer (pcb_max_copper_layer + PCB_COMPONENT_SIDE)
+
+extern pcb_buffer_t pcb_buffers[PCB_MAX_BUFFER];
+extern int pcb_added_lines;
+extern int pcb_layer_stack[PCB_MAX_LAYER];
+
+extern pcb_bool pcb_bumped;
/****** callback based loops *****/
@@ -74,22 +76,22 @@ extern FlagType no_flags;
*/
/* layer object callbacks */
-typedef int (*pcb_layer_cb_t)(void *ctx, PCBType *pcb, LayerType *layer, int enter);
-typedef void (*pcb_line_cb_t)(void *ctx, PCBType *pcb, LayerType *layer, LineType *line);
-typedef void (*pcb_arc_cb_t)(void *ctx, PCBType *pcb, LayerType *layer, ArcType *arc);
-typedef void (*pcb_text_cb_t)(void *ctx, PCBType *pcb, LayerType *layer, TextType *text);
-typedef void (*pcb_poly_cb_t)(void *ctx, PCBType *pcb, LayerType *layer, PolygonType *poly);
+typedef int (*pcb_layer_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, int enter);
+typedef void (*pcb_line_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line);
+typedef void (*pcb_arc_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc);
+typedef void (*pcb_text_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_text_t *text);
+typedef void (*pcb_poly_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly);
/* element callbacks */
-typedef int (*pcb_element_cb_t)(void *ctx, PCBType *pcb, ElementType *element, int enter);
-typedef void (*pcb_eline_cb_t)(void *ctx, PCBType *pcb, ElementType *element, LineType *line);
-typedef void (*pcb_earc_cb_t)(void *ctx, PCBType *pcb, ElementType *element, ArcType *arc);
-typedef void (*pcb_etext_cb_t)(void *ctx, PCBType *pcb, ElementType *element, TextType *text);
-typedef void (*pcb_epin_cb_t)(void *ctx, PCBType *pcb, ElementType *element, PinType *pin);
-typedef void (*pcb_epad_cb_t)(void *ctx, PCBType *pcb, ElementType *element, PadType *pad);
+typedef int (*pcb_element_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, int enter);
+typedef void (*pcb_eline_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line);
+typedef void (*pcb_earc_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc);
+typedef void (*pcb_etext_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_text_t *text);
+typedef void (*pcb_epin_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin);
+typedef void (*pcb_epad_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad);
/* via callbacks */
-typedef void (*pcb_via_cb_t)(void *ctx, PCBType *pcb, PinType *via);
+typedef void (*pcb_via_cb_t)(void *ctx, pcb_board_t *pcb, pcb_pin_t *via);
/* Loop over all layer objects on each layer. Layer is the outer loop. */
void pcb_loop_layers(void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb);
@@ -107,4 +109,11 @@ void pcb_loop_all(void *ctx,
pcb_via_cb_t vcb
);
+void pcb_data_free(pcb_data_t *);
+pcb_bool pcb_data_is_empty(pcb_data_t *);
+
+/* gets minimum and maximum coordinates
+ * returns NULL if layout is empty */
+pcb_box_t *pcb_data_bbox(pcb_box_t *out, pcb_data_t *Data);
+
#endif
diff --git a/src/dolists.h b/src/dolists.h
index 83fa7c6..22ca310 100644
--- a/src/dolists.h
+++ b/src/dolists.h
@@ -1,6 +1,6 @@
-#undef REGISTER_ACTIONS
-#undef REGISTER_ATTRIBUTES
+#undef PCB_REGISTER_ACTIONS
+#undef PCB_REGISTER_ATTRIBUTES
-#define REGISTER_ACTIONS(a, cookie) {extern void HIDCONCAT(register_,a)();HIDCONCAT(register_,a)();}
-#define REGISTER_ATTRIBUTES(a, cookie) {extern void HIDCONCAT(register_,a)();HIDCONCAT(register_,a)();}
+#define PCB_REGISTER_ACTIONS(a, cookie) {extern void PCB_HIDCONCAT(register_,a)();PCB_HIDCONCAT(register_,a)();}
+#define PCB_REGISTER_ATTRIBUTES(a, cookie) {extern void PCB_HIDCONCAT(register_,a)();PCB_HIDCONCAT(register_,a)();}
diff --git a/src/draw.c b/src/draw.c
index 687009e..d540437 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -31,52 +31,57 @@
#include "config.h"
#include "conf_core.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
-#include "error.h"
-#include "misc.h"
#include "rotate.h"
#include "rtree.h"
-#include "draw_fab.h"
-#include "hid_helper.h"
-#include "layer.h"
+#include "stub_draw_fab.h"
+#include "obj_all.h"
+#include "layer_ui.h"
+
+#include "obj_pad_draw.h"
+#include "obj_pinvia_draw.h"
+#include "obj_elem_draw.h"
+#include "obj_line_draw.h"
+#include "obj_arc_draw.h"
+#include "obj_rat_draw.h"
+#include "obj_poly_draw.h"
+#include "obj_text_draw.h"
#undef NDEBUG
#include <assert.h>
-#ifndef MAXINT
-#define MAXINT (((unsigned int)(~0))>>1)
-#endif
-
#define SMALL_SMALL_TEXT_SIZE 0
#define SMALL_TEXT_SIZE 1
#define NORMAL_TEXT_SIZE 2
#define LARGE_TEXT_SIZE 3
#define N_TEXT_SIZES 4
+pcb_output_t Output; /* some widgets ... used for drawing */
+
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static BoxType Block = { MAXINT, MAXINT, -MAXINT, -MAXINT };
-static int doing_pinout = 0;
-static pcb_bool doing_assy = pcb_false;
+pcb_box_t pcb_draw_invalidated = { COORD_MAX, COORD_MAX, -COORD_MAX, -COORD_MAX };
+
+int pcb_draw_doing_pinout = 0;
+pcb_bool pcb_draw_doing_assy = pcb_false;
/* ---------------------------------------------------------------------------
* some local prototypes
*/
-static void DrawEverything(const BoxType *);
-static void DrawPPV(int group, const BoxType *);
-static void DrawLayerGroup(int, const BoxType *);
-static void AddPart(void *);
-static void SetPVColor(PinTypePtr, int);
-static void DrawEMark(ElementTypePtr, Coord, Coord, pcb_bool);
-static void DrawMask(int side, const BoxType *);
-static void DrawPaste(int side, const BoxType *);
-static void DrawRats(const BoxType *);
-static void DrawSilk(int side, const BoxType *);
-
-static void LightenColor(const char *orig, char buf[8], double factor)
+static void DrawEverything(const pcb_box_t *);
+static void DrawPPV(int group, const pcb_box_t *);
+static void DrawLayerGroup(int, const pcb_box_t *);
+static void DrawMask(int side, const pcb_box_t *);
+static void DrawRats(const pcb_box_t *);
+static void DrawSilk(int side, const pcb_box_t *);
+
+#warning TODO: this should be cached
+void pcb_lighten_color(const char *orig, char buf[8], double factor)
{
unsigned int r, g, b;
@@ -94,378 +99,31 @@ static void LightenColor(const char *orig, char buf[8], double factor)
pcb_snprintf(buf, sizeof("#XXXXXX"), "#%02x%02x%02x", r, g, b);
}
-
-/*--------------------------------------------------------------------------------------
- * setup color for pin or via
- */
-static void SetPVColor(PinTypePtr Pin, int Type)
-{
- char *color;
- char buf[sizeof("#XXXXXX")];
-
- if (Type == PCB_TYPE_VIA) {
- if (!doing_pinout && TEST_FLAG(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, Pin)) {
- if (TEST_FLAG(PCB_FLAG_WARN, Pin))
- color = PCB->WarnColor;
- else if (TEST_FLAG(PCB_FLAG_SELECTED, Pin))
- color = PCB->ViaSelectedColor;
- else
- color = PCB->ConnectedColor;
-
- if (TEST_FLAG(PCB_FLAG_ONPOINT, Pin)) {
- assert(color != NULL);
- LightenColor(color, buf, 1.75);
- color = buf;
- }
- }
- else
- color = PCB->ViaColor;
- }
- else {
- if (!doing_pinout && TEST_FLAG(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, Pin)) {
- if (TEST_FLAG(PCB_FLAG_WARN, Pin))
- color = PCB->WarnColor;
- else if (TEST_FLAG(PCB_FLAG_SELECTED, Pin))
- color = PCB->PinSelectedColor;
- else
- color = PCB->ConnectedColor;
-
- if (TEST_FLAG(PCB_FLAG_ONPOINT, Pin)) {
- assert(color != NULL);
- LightenColor(color, buf, 1.75);
- color = buf;
- }
- }
- else
- color = PCB->PinColor;
- }
-
- gui->set_color(Output.fgGC, color);
-}
-
-/*---------------------------------------------------------------------------
- * Adds the update rect to the update region
- */
-static void AddPart(void *b)
-{
- BoxType *box = (BoxType *) b;
-
- Block.X1 = MIN(Block.X1, box->X1);
- Block.X2 = MAX(Block.X2, box->X2);
- Block.Y1 = MIN(Block.Y1, box->Y1);
- Block.Y2 = MAX(Block.Y2, box->Y2);
-}
-
/*
* initiate the actual redrawing of the updated area
*/
pcb_cardinal_t pcb_draw_inhibit = 0;
-void Draw(void)
+void pcb_draw(void)
{
if (pcb_draw_inhibit)
return;
- if (Block.X1 <= Block.X2 && Block.Y1 <= Block.Y2)
- gui->invalidate_lr(Block.X1, Block.X2, Block.Y1, Block.Y2);
+ if (pcb_draw_invalidated.X1 <= pcb_draw_invalidated.X2 && pcb_draw_invalidated.Y1 <= pcb_draw_invalidated.Y2)
+ pcb_gui->invalidate_lr(pcb_draw_invalidated.X1, pcb_draw_invalidated.X2, pcb_draw_invalidated.Y1, pcb_draw_invalidated.Y2);
/* shrink the update block */
- Block.X1 = Block.Y1 = MAXINT;
- Block.X2 = Block.Y2 = -MAXINT;
+ pcb_draw_invalidated.X1 = pcb_draw_invalidated.Y1 = COORD_MAX;
+ pcb_draw_invalidated.X2 = pcb_draw_invalidated.Y2 = -COORD_MAX;
}
/* ----------------------------------------------------------------------
* redraws all the data by the event handlers
*/
-void Redraw(void)
-{
- gui->invalidate_all();
-}
-
-static void _draw_pv_name(PinType * pv)
-{
- BoxType box;
- pcb_bool vert;
- TextType text;
- char buff[128];
- const char *pn;
-
- if (!pv->Name || !pv->Name[0])
- pn = EMPTY(pv->Number);
- else
- pn = EMPTY(conf_core.editor.show_number ? pv->Number : pv->Name);
-
- if (GET_INTCONN(pv) > 0)
- pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, GET_INTCONN(pv));
- else
- strcpy(buff, pn);
- text.TextString = buff;
-
- vert = TEST_FLAG(PCB_FLAG_EDGE2, pv);
-
- if (vert) {
- box.X1 = pv->X - pv->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
- box.Y1 = pv->Y - pv->DrillingHole / 2 - conf_core.appearance.pinout.text_offset_x;
- }
- else {
- box.X1 = pv->X + pv->DrillingHole / 2 + conf_core.appearance.pinout.text_offset_x;
- box.Y1 = pv->Y - pv->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
- }
-
- gui->set_color(Output.fgGC, PCB->PinNameColor);
-
- text.Flags = NoFlags();
- /* Set font height to approx 56% of pin thickness */
- text.Scale = 56 * pv->Thickness / FONT_CAPHEIGHT;
- text.X = box.X1;
- text.Y = box.Y1;
- text.Direction = vert ? 1 : 0;
-
- if (gui->gui)
- doing_pinout++;
- DrawTextLowLevel(&text, 0);
- if (gui->gui)
- doing_pinout--;
-}
-
-static void _draw_pv(PinTypePtr pv, pcb_bool draw_hole)
-{
- if (conf_core.editor.thin_draw)
- gui->thindraw_pcb_pv(Output.fgGC, Output.fgGC, pv, draw_hole, pcb_false);
- else
- gui->fill_pcb_pv(Output.fgGC, Output.bgGC, pv, draw_hole, pcb_false);
-
- if (!TEST_FLAG(PCB_FLAG_HOLE, pv) && TEST_FLAG(PCB_FLAG_DISPLAYNAME, pv))
- _draw_pv_name(pv);
-}
-
-static void draw_pin(PinTypePtr pin, pcb_bool draw_hole)
-{
- SetPVColor(pin, PCB_TYPE_PIN);
- _draw_pv(pin, draw_hole);
-}
-
-static r_dir_t pin_callback(const BoxType * b, void *cl)
-{
- draw_pin((PinType *) b, pcb_false);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static void draw_via(PinTypePtr via, pcb_bool draw_hole)
-{
- SetPVColor(via, PCB_TYPE_VIA);
- _draw_pv(via, draw_hole);
-}
-
-static r_dir_t via_callback(const BoxType * b, void *cl)
+void pcb_redraw(void)
{
- draw_via((PinType *) b, pcb_false);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static void draw_pad_name(PadType * pad)
-{
- BoxType box;
- pcb_bool vert;
- TextType text;
- char buff[128];
- const char *pn;
-
- if (!pad->Name || !pad->Name[0])
- pn = EMPTY(pad->Number);
- else
- pn = conf_core.editor.show_number ? pad->Number : pad->Name;
-
- if (GET_INTCONN(pad) > 0)
- pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, GET_INTCONN(pad));
- else
- strcpy(buff, pn);
- text.TextString = buff;
-
- /* should text be vertical ? */
- vert = (pad->Point1.X == pad->Point2.X);
-
- if (vert) {
- box.X1 = pad->Point1.X - pad->Thickness / 2;
- box.Y1 = MAX(pad->Point1.Y, pad->Point2.Y) + pad->Thickness / 2;
- box.X1 += conf_core.appearance.pinout.text_offset_y;
- box.Y1 -= conf_core.appearance.pinout.text_offset_x;
- }
- else {
- box.X1 = MIN(pad->Point1.X, pad->Point2.X) - pad->Thickness / 2;
- box.Y1 = pad->Point1.Y - pad->Thickness / 2;
- box.X1 += conf_core.appearance.pinout.text_offset_x;
- box.Y1 += conf_core.appearance.pinout.text_offset_y;
- }
-
- gui->set_color(Output.fgGC, PCB->PinNameColor);
-
- text.Flags = NoFlags();
- /* Set font height to approx 90% of pin thickness */
- text.Scale = 90 * pad->Thickness / FONT_CAPHEIGHT;
- text.X = box.X1;
- text.Y = box.Y1;
- text.Direction = vert ? 1 : 0;
-
- DrawTextLowLevel(&text, 0);
-}
-
-static void _draw_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask)
-{
- if (clear && !mask && pad->Clearance <= 0)
- return;
-
- if (conf_core.editor.thin_draw || (clear && conf_core.editor.thin_draw_poly))
- gui->thindraw_pcb_pad(gc, pad, clear, mask);
- else
- gui->fill_pcb_pad(gc, pad, clear, mask);
-}
-
-static void draw_pad(PadType * pad)
-{
- const char *color = NULL;
- char buf[sizeof("#XXXXXX")];
-
- if (doing_pinout)
- gui->set_color(Output.fgGC, PCB->PinColor);
- else if (TEST_FLAG(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, pad)) {
- if (TEST_FLAG(PCB_FLAG_WARN, pad))
- color = PCB->WarnColor;
- else if (TEST_FLAG(PCB_FLAG_SELECTED, pad))
- color = PCB->PinSelectedColor;
- else
- color = PCB->ConnectedColor;
- }
- else if (FRONT(pad))
- color = PCB->PinColor;
- else
- color = PCB->InvisibleObjectsColor;
-
- if (TEST_FLAG(PCB_FLAG_ONPOINT, pad)) {
- assert(color != NULL);
- LightenColor(color, buf, 1.75);
- color = buf;
- }
-
- if (color != NULL)
- gui->set_color(Output.fgGC, color);
-
- _draw_pad(Output.fgGC, pad, pcb_false, pcb_false);
-
- if (doing_pinout || TEST_FLAG(PCB_FLAG_DISPLAYNAME, pad))
- draw_pad_name(pad);
-}
-
-static r_dir_t pad_callback(const BoxType * b, void *cl)
-{
- PadTypePtr pad = (PadTypePtr) b;
- int *side = cl;
-
- if (ON_SIDE(pad, *side))
- draw_pad(pad);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static void draw_element_name(ElementType * element)
-{
- if ((conf_core.editor.hide_names && gui->gui) || TEST_FLAG(PCB_FLAG_HIDENAME, element))
- return;
- if (doing_pinout || doing_assy)
- gui->set_color(Output.fgGC, PCB->ElementColor);
- else if (TEST_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element)))
- gui->set_color(Output.fgGC, PCB->ElementSelectedColor);
- else if (FRONT(element)) {
-/* TODO: why do we test for Name's flag here? */
- if (TEST_FLAG(PCB_FLAG_NONETLIST, element))
- gui->set_color(Output.fgGC, PCB->ElementColor_nonetlist);
- else
- gui->set_color(Output.fgGC, PCB->ElementColor);
- }
- else
- gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor);
-
- DrawTextLowLevel(&ELEMENT_TEXT(PCB, element), PCB->minSlk);
-
-}
-
-static r_dir_t name_callback(const BoxType * b, void *cl)
-{
- TextTypePtr text = (TextTypePtr) b;
- ElementTypePtr element = (ElementTypePtr) text->Element;
- int *side = cl;
-
- if (TEST_FLAG(PCB_FLAG_HIDENAME, element))
- return R_DIR_NOT_FOUND;
-
- if (ON_SIDE(element, *side))
- draw_element_name(element);
- return R_DIR_NOT_FOUND;
-}
-
-static void draw_element_pins_and_pads(ElementType * element)
-{
- PAD_LOOP(element);
- {
- if (doing_pinout || doing_assy || FRONT(pad) || PCB->InvisibleObjectsOn)
- draw_pad(pad);
- }
- END_LOOP;
- PIN_LOOP(element);
- {
- draw_pin(pin, pcb_true);
- }
- END_LOOP;
+ pcb_gui->invalidate_all();
}
-static r_dir_t EMark_callback(const BoxType * b, void *cl)
-{
- ElementTypePtr element = (ElementTypePtr) b;
-
- DrawEMark(element, element->MarkX, element->MarkY, !FRONT(element));
- return R_DIR_FOUND_CONTINUE;
-}
-
-static r_dir_t hole_callback(const BoxType * b, void *cl)
-{
- PinTypePtr pv = (PinTypePtr) b;
- int plated = cl ? *(int *) cl : -1;
- const char *color;
- char buf[sizeof("#XXXXXX")];
-
- if ((plated == 0 && !TEST_FLAG(PCB_FLAG_HOLE, pv)) || (plated == 1 && TEST_FLAG(PCB_FLAG_HOLE, pv)))
- return R_DIR_FOUND_CONTINUE;
-
- if (conf_core.editor.thin_draw) {
- if (!TEST_FLAG(PCB_FLAG_HOLE, pv)) {
- gui->set_line_cap(Output.fgGC, Round_Cap);
- gui->set_line_width(Output.fgGC, 0);
- gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360);
- }
- }
- else
- gui->fill_circle(Output.bgGC, pv->X, pv->Y, pv->DrillingHole / 2);
-
- if (TEST_FLAG(PCB_FLAG_HOLE, pv)) {
- if (TEST_FLAG(PCB_FLAG_WARN, pv))
- color = PCB->WarnColor;
- else if (TEST_FLAG(PCB_FLAG_SELECTED, pv))
- color = PCB->ViaSelectedColor;
- else
- color = conf_core.appearance.color.black;
-
- if (TEST_FLAG(PCB_FLAG_ONPOINT, pv)) {
- assert(color != NULL);
- LightenColor(color, buf, 1.75);
- color = buf;
- }
- gui->set_color(Output.fgGC, color);
-
- gui->set_line_cap(Output.fgGC, Round_Cap);
- gui->set_line_width(Output.fgGC, 0);
- gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360);
- }
- return R_DIR_FOUND_CONTINUE;
-}
-
-static void DrawHoles(pcb_bool draw_plated, pcb_bool draw_unplated, const BoxType * drawn_area)
+static void DrawHoles(pcb_bool draw_plated, pcb_bool draw_unplated, const pcb_box_t * drawn_area)
{
int plated = -1;
@@ -474,208 +132,55 @@ static void DrawHoles(pcb_bool draw_plated, pcb_bool draw_unplated, const BoxTyp
if (!draw_plated && draw_unplated)
plated = 0;
- r_search(PCB->Data->pin_tree, drawn_area, NULL, hole_callback, &plated, NULL);
- r_search(PCB->Data->via_tree, drawn_area, NULL, hole_callback, &plated, NULL);
-}
-
-static 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;
-
- if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, rat)) {
- if (TEST_FLAG(PCB_FLAG_SELECTED, rat))
- gui->set_color(Output.fgGC, PCB->RatSelectedColor);
- else
- gui->set_color(Output.fgGC, PCB->ConnectedColor);
- }
- else
- gui->set_color(Output.fgGC, PCB->RatColor);
-
- if (conf_core.appearance.rat_thickness < 20)
- rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness;
- /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */
- if (TEST_FLAG(PCB_FLAG_VIA, rat)) {
- int w = rat->Thickness;
-
- if (conf_core.editor.thin_draw)
- gui->set_line_width(Output.fgGC, 0);
- else
- gui->set_line_width(Output.fgGC, w);
- gui->draw_arc(Output.fgGC, rat->Point1.X, rat->Point1.Y, w * 2, w * 2, 0, 360);
- }
- else
- _draw_line((LineType *) rat);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static 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;
-}
-
-static void draw_element_package(ElementType * element)
-{
- /* set color and draw lines, arcs, text and pins */
- if (doing_pinout || doing_assy)
- gui->set_color(Output.fgGC, PCB->ElementColor);
- else if (TEST_FLAG(PCB_FLAG_SELECTED, element))
- gui->set_color(Output.fgGC, PCB->ElementSelectedColor);
- else if (FRONT(element))
- gui->set_color(Output.fgGC, PCB->ElementColor);
- else
- gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor);
-
- /* draw lines, arcs, text and pins */
- ELEMENTLINE_LOOP(element);
- {
- _draw_line(line);
- }
- END_LOOP;
- ARC_LOOP(element);
- {
- _draw_arc(arc);
- }
- END_LOOP;
-}
-
-static r_dir_t element_callback(const BoxType * b, void *cl)
-{
- ElementTypePtr element = (ElementTypePtr) b;
- int *side = cl;
-
- if (ON_SIDE(element, *side))
- draw_element_package(element);
- return R_DIR_FOUND_CONTINUE;
+ pcb_r_search(PCB->Data->pin_tree, drawn_area, NULL, draw_hole_callback, &plated, NULL);
+ pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, draw_hole_callback, &plated, NULL);
}
/* ---------------------------------------------------------------------------
* prints assembly drawing.
*/
-
-static void PrintAssembly(int side, const BoxType * drawn_area)
+static void PrintAssembly(int side, const pcb_box_t * drawn_area)
{
- int side_group = GetLayerGroupNumberByNumber(max_copper_layer + side);
+ pcb_layergrp_id_t side_group = pcb_layer_get_group(pcb_max_copper_layer + side);
- doing_assy = pcb_true;
- gui->set_draw_faded(Output.fgGC, 1);
+ pcb_draw_doing_assy = pcb_true;
+ pcb_gui->set_draw_faded(Output.fgGC, 1);
DrawLayerGroup(side_group, drawn_area);
- gui->set_draw_faded(Output.fgGC, 0);
+ pcb_gui->set_draw_faded(Output.fgGC, 0);
/* draw package */
DrawSilk(side, drawn_area);
- doing_assy = pcb_false;
+ pcb_draw_doing_assy = pcb_false;
}
-static void DrawEverything_holes(const BoxType * drawn_area)
+static void DrawEverything_holes(const pcb_box_t * drawn_area)
{
int plated, unplated;
- CountHoles(&plated, &unplated, drawn_area);
+ pcb_board_count_holes(&plated, &unplated, drawn_area);
- if (plated && gui->set_layer("plated-drill", SL(PDRILL, 0), 0)) {
+ if (plated && pcb_layer_gui_set_vlayer(PCB_VLY_PLATED_DRILL, 0)) {
DrawHoles(pcb_true, pcb_false, drawn_area);
- gui->end_layer();
+ pcb_gui->end_layer();
}
- if (unplated && gui->set_layer("unplated-drill", SL(UDRILL, 0), 0)) {
+ if (unplated && pcb_layer_gui_set_vlayer(PCB_VLY_UNPLATED_DRILL, 0)) {
DrawHoles(pcb_false, pcb_true, drawn_area);
- gui->end_layer();
+ pcb_gui->end_layer();
}
}
/* ---------------------------------------------------------------------------
* initializes some identifiers for a new zoom factor and redraws whole screen
*/
-static void DrawEverything(const BoxType * drawn_area)
+static void DrawEverything(const pcb_box_t * drawn_area)
{
int i, ngroups, side;
- int component, solder;
+ pcb_layergrp_id_t component, solder;
/* This is the list of layer groups we will draw. */
- int do_group[MAX_LAYER];
+ pcb_layergrp_id_t do_group[PCB_MAX_LAYERGRP];
/* This is the reverse of the order in which we draw them. */
- int drawn_groups[MAX_LAYER];
+ pcb_layergrp_id_t drawn_groups[PCB_MAX_LAYERGRP];
+ pcb_layer_t *first;
pcb_bool paste_empty;
@@ -683,258 +188,172 @@ static void DrawEverything(const BoxType * drawn_area)
PCB->Data->BACKSILKLAYER.Color = PCB->InvisibleObjectsColor;
memset(do_group, 0, sizeof(do_group));
- for (ngroups = 0, i = 0; i < max_copper_layer; i++) {
- LayerType *l = LAYER_ON_STACK(i);
- int group = GetLayerGroupNumberByNumber(LayerStack[i]);
+ for (ngroups = 0, i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layer_t *l = LAYER_ON_STACK(i);
+ pcb_layergrp_id_t group = pcb_layer_get_group(pcb_layer_stack[i]);
if (l->On && !do_group[group]) {
do_group[group] = 1;
drawn_groups[ngroups++] = group;
}
}
- component = GetLayerGroupNumberByNumber(component_silk_layer);
- solder = GetLayerGroupNumberByNumber(solder_silk_layer);
+ component = pcb_layer_get_group(pcb_component_silk_layer);
+ solder = pcb_layer_get_group(pcb_solder_silk_layer);
/*
* first draw all 'invisible' stuff
*/
- if (!conf_core.editor.check_planes
- && gui->set_layer("invisible", SL(INVISIBLE, 0), 0)) {
- side = SWAP_IDENT ? COMPONENT_LAYER : SOLDER_LAYER;
+ if (!conf_core.editor.check_planes && pcb_layer_gui_set_vlayer(PCB_VLY_INVISIBLE, 0)) {
+ side = PCB_SWAP_IDENT ? PCB_COMPONENT_SIDE : PCB_SOLDER_SIDE;
if (PCB->ElementOn) {
- r_search(PCB->Data->element_tree, drawn_area, NULL, element_callback, &side, NULL);
- r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, name_callback, &side, NULL);
- DrawLayer(&(PCB->Data->Layer[max_copper_layer + side]), drawn_area);
+ pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_callback, &side, NULL);
+ pcb_r_search(PCB->Data->name_tree[PCB_ELEMNAME_IDX_VISIBLE()], drawn_area, NULL, draw_element_name_callback, &side, NULL);
+ pcb_draw_layer(&(PCB->Data->Layer[pcb_max_copper_layer + side]), drawn_area);
}
- r_search(PCB->Data->pad_tree, drawn_area, NULL, pad_callback, &side, NULL);
- gui->end_layer();
+ pcb_r_search(PCB->Data->pad_tree, drawn_area, NULL, draw_pad_callback, &side, NULL);
+ pcb_gui->end_layer();
}
/* draw all layers in layerstack order */
for (i = ngroups - 1; i >= 0; i--) {
- int group = drawn_groups[i];
+ pcb_layergrp_id_t group = drawn_groups[i];
- if (gui->set_layer(0, group, 0)) {
+ if (pcb_layer_gui_set_glayer(group, 0)) {
DrawLayerGroup(group, drawn_area);
- gui->end_layer();
+ pcb_gui->end_layer();
}
}
- if (conf_core.editor.check_planes && gui->gui)
+ if (conf_core.editor.check_planes && pcb_gui->gui)
return;
/* Draw pins, pads, vias below silk */
- if (gui->gui)
- DrawPPV(SWAP_IDENT ? solder : component, drawn_area);
- else if (!gui->holes_after)
+ if (pcb_gui->gui)
+ DrawPPV(PCB_SWAP_IDENT ? solder : component, drawn_area);
+ else if (!pcb_gui->holes_after)
DrawEverything_holes(drawn_area);
/* Draw the solder mask if turned on */
- if (gui->set_layer("componentmask", SL(MASK, TOP), 0)) {
- DrawMask(COMPONENT_LAYER, drawn_area);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_TOP_MASK, 0)) {
+ DrawMask(PCB_COMPONENT_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->set_layer("soldermask", SL(MASK, BOTTOM), 0)) {
- DrawMask(SOLDER_LAYER, drawn_area);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_BOTTOM_MASK, 0)) {
+ DrawMask(PCB_SOLDER_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->set_layer("topsilk", SL(SILK, TOP), 0)) {
- DrawSilk(COMPONENT_LAYER, drawn_area);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_TOP_SILK, 0)) {
+ DrawSilk(PCB_COMPONENT_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->set_layer("bottomsilk", SL(SILK, BOTTOM), 0)) {
- DrawSilk(SOLDER_LAYER, drawn_area);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_BOTTOM_SILK, 0)) {
+ DrawSilk(PCB_SOLDER_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->holes_after)
+ if (pcb_gui->holes_after)
DrawEverything_holes(drawn_area);
- if (gui->gui) {
+ if (pcb_gui->gui) {
/* Draw element Marks */
if (PCB->PinOn)
- r_search(PCB->Data->element_tree, drawn_area, NULL, EMark_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_mark_callback, NULL, NULL);
/* Draw rat lines on top */
- if (gui->set_layer("rats", SL(RATS, 0), 0)) {
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_RATS, 0)) {
DrawRats(drawn_area);
- gui->end_layer();
+ pcb_gui->end_layer();
}
}
- paste_empty = IsPasteEmpty(COMPONENT_LAYER);
- if (gui->set_layer("toppaste", SL(PASTE, TOP), paste_empty)) {
- DrawPaste(COMPONENT_LAYER, drawn_area);
- gui->end_layer();
+ paste_empty = pcb_layer_is_paste_empty(PCB_COMPONENT_SIDE);
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_TOP_PASTE, paste_empty)) {
+ DrawPaste(PCB_COMPONENT_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- paste_empty = IsPasteEmpty(SOLDER_LAYER);
- if (gui->set_layer("bottompaste", SL(PASTE, BOTTOM), paste_empty)) {
- DrawPaste(SOLDER_LAYER, drawn_area);
- gui->end_layer();
+ paste_empty = pcb_layer_is_paste_empty(PCB_SOLDER_SIDE);
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_BOTTOM_PASTE, paste_empty)) {
+ DrawPaste(PCB_SOLDER_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->set_layer("topassembly", SL(ASSY, TOP), 0)) {
- PrintAssembly(COMPONENT_LAYER, drawn_area);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_TOP_ASSY, 0)) {
+ PrintAssembly(PCB_COMPONENT_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->set_layer("bottomassembly", SL(ASSY, BOTTOM), 0)) {
- PrintAssembly(SOLDER_LAYER, drawn_area);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_BOTTOM_ASSY, 0)) {
+ PrintAssembly(PCB_SOLDER_SIDE, drawn_area);
+ pcb_gui->end_layer();
}
- if (gui->set_layer("fab", SL(FAB, 0), 0)) {
- DrawFab(Output.fgGC);
- gui->end_layer();
+ if (pcb_layer_gui_set_vlayer(PCB_VLY_FAB, 0)) {
+ pcb_stub_draw_fab(Output.fgGC);
+ pcb_gui->end_layer();
}
-}
-static void DrawEMark(ElementTypePtr e, Coord X, Coord Y, pcb_bool invisible)
-{
- Coord mark_size = EMARK_SIZE;
- if (!PCB->InvisibleObjectsOn && invisible)
- return;
-
- if (pinlist_length(&e->Pin) != 0) {
- PinType *pin0 = pinlist_first(&e->Pin);
- if (TEST_FLAG(PCB_FLAG_HOLE, pin0))
- mark_size = MIN(mark_size, pin0->DrillingHole / 2);
- else
- mark_size = MIN(mark_size, pin0->Thickness / 2);
+ /* find the first ui layer in use */
+ first = NULL;
+ for(i = 0; i < vtlayer_len(&pcb_uilayer); i++) {
+ if (pcb_uilayer.array[i].cookie != NULL) {
+ first = pcb_uilayer.array+i;
+ break;
+ }
}
- if (padlist_length(&e->Pad) != 0) {
- PadType *pad0 = padlist_first(&e->Pad);
- mark_size = MIN(mark_size, pad0->Thickness / 2);
+ /* if there's any UI layer, try to draw them */
+ if ((first != NULL) && pcb_layer_gui_set_g_ui(first, 0)) {
+ for(i = 0; i < vtlayer_len(&pcb_uilayer); i++)
+ if ((pcb_uilayer.array[i].cookie != NULL) && (pcb_uilayer.array[i].On))
+ pcb_draw_layer(pcb_uilayer.array+i, drawn_area);
+ pcb_gui->end_layer();
}
- gui->set_color(Output.fgGC, invisible ? PCB->InvisibleMarkColor : PCB->ElementColor);
- gui->set_line_cap(Output.fgGC, Trace_Cap);
- gui->set_line_width(Output.fgGC, 0);
- gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y - mark_size);
- gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y - mark_size);
- gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y + mark_size);
- gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y + mark_size);
-
- /*
- * If an element is locked, place a "L" on top of the "diamond".
- * This provides a nice visual indication that it is locked that
- * works even for color blind users.
- */
- if (TEST_FLAG(PCB_FLAG_LOCK, e)) {
- gui->draw_line(Output.fgGC, X, Y, X + 2 * mark_size, Y);
- gui->draw_line(Output.fgGC, X, Y, X, Y - 4 * mark_size);
- }
}
/* ---------------------------------------------------------------------------
* Draws pins pads and vias - Always draws for non-gui HIDs,
* otherwise drawing depends on PCB->PinOn and PCB->ViaOn
*/
-static void DrawPPV(int group, const BoxType * drawn_area)
+static void DrawPPV(int group, const pcb_box_t * drawn_area)
{
- int component_group = GetLayerGroupNumberByNumber(component_silk_layer);
- int solder_group = GetLayerGroupNumberByNumber(solder_silk_layer);
+ pcb_layergrp_id_t component_group = pcb_layer_get_group(pcb_component_silk_layer);
+ pcb_layergrp_id_t solder_group = pcb_layer_get_group(pcb_solder_silk_layer);
int side;
- if (PCB->PinOn || !gui->gui) {
+ if (PCB->PinOn || !pcb_gui->gui) {
/* draw element pins */
- r_search(PCB->Data->pin_tree, drawn_area, NULL, pin_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->pin_tree, drawn_area, NULL, draw_pin_callback, NULL, NULL);
/* draw element pads */
if (group == component_group) {
- side = COMPONENT_LAYER;
- r_search(PCB->Data->pad_tree, drawn_area, NULL, pad_callback, &side, NULL);
+ side = PCB_COMPONENT_SIDE;
+ pcb_r_search(PCB->Data->pad_tree, drawn_area, NULL, draw_pad_callback, &side, NULL);
}
if (group == solder_group) {
- side = SOLDER_LAYER;
- r_search(PCB->Data->pad_tree, drawn_area, NULL, pad_callback, &side, NULL);
+ side = PCB_SOLDER_SIDE;
+ pcb_r_search(PCB->Data->pad_tree, drawn_area, NULL, draw_pad_callback, &side, NULL);
}
}
/* draw vias */
- if (PCB->ViaOn || !gui->gui) {
- r_search(PCB->Data->via_tree, drawn_area, NULL, via_callback, NULL, NULL);
- r_search(PCB->Data->via_tree, drawn_area, NULL, hole_callback, NULL, NULL);
+ if (PCB->ViaOn || !pcb_gui->gui) {
+ pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, draw_via_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, draw_hole_callback, NULL, NULL);
}
- if (PCB->PinOn || doing_assy)
- r_search(PCB->Data->pin_tree, drawn_area, NULL, hole_callback, NULL, NULL);
-}
-
-static r_dir_t clearPin_callback(const BoxType * b, void *cl)
-{
- PinType *pin = (PinTypePtr) b;
- if (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly)
- gui->thindraw_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true);
- else
- gui->fill_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true);
- return R_DIR_FOUND_CONTINUE;
-}
-
-struct poly_info {
- const BoxType *drawn_area;
- LayerType *layer;
-};
-
-static r_dir_t poly_callback(const BoxType * b, void *cl)
-{
- struct poly_info *i = cl;
- PolygonType *polygon = (PolygonType *) b;
- static const char *color;
- char buf[sizeof("#XXXXXX")];
-
- if (!polygon->Clipped)
- return R_DIR_NOT_FOUND;
-
- if (TEST_FLAG(PCB_FLAG_WARN, polygon))
- color = PCB->WarnColor;
- else if (TEST_FLAG(PCB_FLAG_SELECTED, polygon))
- color = i->layer->SelectedColor;
- else if (TEST_FLAG(PCB_FLAG_FOUND, polygon))
- color = PCB->ConnectedColor;
- else if (TEST_FLAG(PCB_FLAG_ONPOINT, polygon)) {
- assert(color != NULL);
- LightenColor(color, buf, 1.75);
- color = buf;
- }
- else
- color = i->layer->Color;
- gui->set_color(Output.fgGC, color);
-
- if ((gui->thindraw_pcb_polygon != NULL) && (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly))
- gui->thindraw_pcb_polygon(Output.fgGC, polygon, i->drawn_area);
- else
- gui->fill_pcb_polygon(Output.fgGC, polygon, i->drawn_area);
-
- /* If checking planes, thin-draw any pieces which have been clipped away */
- if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !TEST_FLAG(PCB_FLAG_FULLPOLY, polygon)) {
- PolygonType poly = *polygon;
-
- for (poly.Clipped = polygon->Clipped->f; poly.Clipped != polygon->Clipped; poly.Clipped = poly.Clipped->f)
- gui->thindraw_pcb_polygon(Output.fgGC, &poly, i->drawn_area);
- }
-
- return R_DIR_FOUND_CONTINUE;
-}
-
-static r_dir_t clearPad_callback(const BoxType * b, void *cl)
-{
- PadTypePtr pad = (PadTypePtr) b;
- int *side = cl;
- if (ON_SIDE(pad, *side) && pad->Mask)
- _draw_pad(Output.pmGC, pad, pcb_true, pcb_true);
- return R_DIR_FOUND_CONTINUE;
+ if (PCB->PinOn || pcb_draw_doing_assy)
+ pcb_r_search(PCB->Data->pin_tree, drawn_area, NULL, draw_hole_callback, NULL, NULL);
}
/* ---------------------------------------------------------------------------
* Draws silk layer.
*/
-static void DrawSilk(int side, const BoxType * drawn_area)
+static void DrawSilk(int side, const pcb_box_t * drawn_area)
{
#if 0
/* This code is used when you want to mask silk to avoid exposed
@@ -943,155 +362,128 @@ static void DrawSilk(int side, const BoxType * drawn_area)
#endif
#if 0
- if (gui->poly_before) {
- gui->use_mask(HID_MASK_BEFORE);
+ if (pcb_gui->poly_before) {
+ pcb_gui->use_mask(HID_MASK_BEFORE);
#endif
- DrawLayer(LAYER_PTR(max_copper_layer + side), drawn_area);
+ pcb_draw_layer(LAYER_PTR(pcb_max_copper_layer + side), drawn_area);
/* draw package */
- r_search(PCB->Data->element_tree, drawn_area, NULL, element_callback, &side, NULL);
- r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, name_callback, &side, NULL);
+ pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_callback, &side, NULL);
+ pcb_r_search(PCB->Data->name_tree[PCB_ELEMNAME_IDX_VISIBLE()], drawn_area, NULL, draw_element_name_callback, &side, NULL);
#if 0
}
- gui->use_mask(HID_MASK_CLEAR);
- r_search(PCB->Data->pin_tree, drawn_area, NULL, clearPin_callback, NULL, NULL);
- r_search(PCB->Data->via_tree, drawn_area, NULL, clearPin_callback, NULL, NULL);
- r_search(PCB->Data->pad_tree, drawn_area, NULL, clearPad_callback, &side, NULL);
+ pcb_gui->use_mask(HID_MASK_CLEAR);
+ pcb_r_search(PCB->Data->pin_tree, drawn_area, NULL, clear_pin_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, clear_pin_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->pad_tree, drawn_area, NULL, clear_pad_callback, &side, NULL);
- if (gui->poly_after) {
- gui->use_mask(HID_MASK_AFTER);
- DrawLayer(LAYER_PTR(max_copper_layer + layer), drawn_area);
+ if (pcb_gui->poly_after) {
+ pcb_gui->use_mask(HID_MASK_AFTER);
+ pcb_draw_layer(LAYER_PTR(pcb_max_copper_layer + layer), drawn_area);
/* draw package */
- r_search(PCB->Data->element_tree, drawn_area, NULL, element_callback, &side, NULL);
- r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, name_callback, &side, NULL);
+ pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_callback, &side, NULL);
+ pcb_r_search(PCB->Data->name_tree[PCB_ELEMNAME_IDX_VISIBLE()], drawn_area, NULL, draw_element_name_callback, &side, NULL);
}
- gui->use_mask(HID_MASK_OFF);
+ pcb_gui->use_mask(HID_MASK_OFF);
#endif
}
-static void DrawMaskBoardArea(int mask_type, const BoxType * drawn_area)
+static void DrawMaskBoardArea(int mask_type, const pcb_box_t * drawn_area)
{
/* Skip the mask drawing if the GUI doesn't want this type */
- if ((mask_type == HID_MASK_BEFORE && !gui->poly_before) || (mask_type == HID_MASK_AFTER && !gui->poly_after))
+ if ((mask_type == HID_MASK_BEFORE && !pcb_gui->poly_before) || (mask_type == HID_MASK_AFTER && !pcb_gui->poly_after))
return;
- gui->use_mask(mask_type);
- gui->set_color(Output.fgGC, PCB->MaskColor);
+ pcb_gui->use_mask(mask_type);
+ pcb_gui->set_color(Output.fgGC, PCB->MaskColor);
if (drawn_area == NULL)
- gui->fill_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_gui->fill_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
else
- gui->fill_rect(Output.fgGC, drawn_area->X1, drawn_area->Y1, drawn_area->X2, drawn_area->Y2);
+ pcb_gui->fill_rect(Output.fgGC, drawn_area->X1, drawn_area->Y1, drawn_area->X2, drawn_area->Y2);
}
/* ---------------------------------------------------------------------------
* draws solder mask layer - this will cover nearly everything
*/
-static void DrawMask(int side, const BoxType * screen)
+static void DrawMask(int side, const pcb_box_t * screen)
{
int thin = conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly;
if (thin)
- gui->set_color(Output.pmGC, PCB->MaskColor);
+ pcb_gui->set_color(Output.pmGC, PCB->MaskColor);
else {
DrawMaskBoardArea(HID_MASK_BEFORE, screen);
- gui->use_mask(HID_MASK_CLEAR);
+ pcb_gui->use_mask(HID_MASK_CLEAR);
}
- r_search(PCB->Data->pin_tree, screen, NULL, clearPin_callback, NULL, NULL);
- r_search(PCB->Data->via_tree, screen, NULL, clearPin_callback, NULL, NULL);
- r_search(PCB->Data->pad_tree, screen, NULL, clearPad_callback, &side, NULL);
+ pcb_r_search(PCB->Data->pin_tree, screen, NULL, clear_pin_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->via_tree, screen, NULL, clear_pin_callback, NULL, NULL);
+ pcb_r_search(PCB->Data->pad_tree, screen, NULL, clear_pad_callback, &side, NULL);
if (thin)
- gui->set_color(Output.pmGC, "erase");
+ pcb_gui->set_color(Output.pmGC, "erase");
else {
DrawMaskBoardArea(HID_MASK_AFTER, screen);
- gui->use_mask(HID_MASK_OFF);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * draws solder paste layer for a given side of the board
- */
-static void DrawPaste(int side, const BoxType * drawn_area)
-{
- gui->set_color(Output.fgGC, PCB->ElementColor);
- ALLPAD_LOOP(PCB->Data);
- {
- if (ON_SIDE(pad, side) && !TEST_FLAG(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) {
- if (pad->Mask < pad->Thickness)
- _draw_pad(Output.fgGC, pad, pcb_true, pcb_true);
- else
- _draw_pad(Output.fgGC, pad, pcb_false, pcb_false);
- }
+ pcb_gui->use_mask(HID_MASK_OFF);
}
- ENDALL_LOOP;
}
-static void DrawRats(const BoxType * drawn_area)
+static void DrawRats(const pcb_box_t * drawn_area)
{
/*
- * XXX lesstif allows positive AND negative drawing in HID_MASK_CLEAR.
- * XXX gtk only allows negative drawing.
- * XXX using the mask here is to get rat transparency
+ * lesstif allows positive AND negative drawing in HID_MASK_CLEAR.
+ * gtk only allows negative drawing.
+ * using the mask here is to get rat transparency
*/
- int can_mask = strcmp(gui->name, "lesstif") == 0;
-
- if (can_mask)
- gui->use_mask(HID_MASK_CLEAR);
- r_search(PCB->Data->rat_tree, drawn_area, NULL, rat_callback, NULL, NULL);
- if (can_mask)
- gui->use_mask(HID_MASK_OFF);
+ if (pcb_gui->can_mask_clear_rats)
+ pcb_gui->use_mask(HID_MASK_CLEAR);
+ pcb_r_search(PCB->Data->rat_tree, drawn_area, NULL, draw_rat_callback, NULL, NULL);
+ if (pcb_gui->can_mask_clear_rats)
+ pcb_gui->use_mask(HID_MASK_OFF);
}
-static r_dir_t text_callback(const BoxType * b, void *cl)
+void pcb_draw_layer(pcb_layer_t *Layer, const pcb_box_t * screen)
{
- LayerType *layer = cl;
- TextType *text = (TextType *) b;
- int min_silk_line;
+ struct pcb_draw_poly_info_s info;
+ pcb_box_t scr2;
- if (TEST_FLAG(PCB_FLAG_SELECTED, text))
- gui->set_color(Output.fgGC, layer->SelectedColor);
- else
- gui->set_color(Output.fgGC, layer->Color);
- if (layer == &PCB->Data->SILKLAYER || layer == &PCB->Data->BACKSILKLAYER)
- min_silk_line = PCB->minSlk;
- else
- min_silk_line = PCB->minWid;
- DrawTextLowLevel(text, min_silk_line);
- return R_DIR_FOUND_CONTINUE;
-}
-
-void DrawLayer(LayerTypePtr Layer, const BoxType * screen)
-{
- struct poly_info info;
+ if ((screen->X2 <= screen->X1) || (screen->Y2 <= screen->Y1)) {
+ scr2 = *screen;
+ screen = &scr2;
+ if (scr2.X2 <= scr2.X1)
+ scr2.X2 = scr2.X1+1;
+ if (scr2.Y2 <= scr2.Y1)
+ scr2.Y2 = scr2.Y1+1;
+ }
info.drawn_area = screen;
info.layer = Layer;
+
/* print the non-clearing polys */
- r_search(Layer->polygon_tree, screen, NULL, poly_callback, &info, NULL);
+ pcb_r_search(Layer->polygon_tree, screen, NULL, draw_poly_callback, &info, NULL);
if (conf_core.editor.check_planes)
return;
/* draw all visible lines this layer */
- r_search(Layer->line_tree, screen, NULL, line_callback, Layer, NULL);
+ pcb_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);
+ pcb_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);
+ pcb_r_search(Layer->text_tree, screen, NULL, draw_text_callback, Layer, NULL);
- /* We should check for gui->gui here, but it's kinda cool seeing the
+ /* We should check for pcb_gui->gui here, but it's kinda cool seeing the
auto-outline magically disappear when you first add something to
the "outline" layer. */
- if (IsLayerEmpty(Layer)
+ if (pcb_layer_is_empty_(Layer)
&& (strcmp(Layer->Name, "outline") == 0 || strcmp(Layer->Name, "route") == 0)) {
- gui->set_color(Output.fgGC, Layer->Color);
- gui->set_line_width(Output.fgGC, PCB->minWid);
- gui->draw_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_gui->set_color(Output.fgGC, Layer->Color);
+ pcb_gui->set_line_width(Output.fgGC, PCB->minWid);
+ pcb_gui->draw_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
}
}
@@ -1099,11 +491,11 @@ void DrawLayer(LayerTypePtr Layer, const BoxType * screen)
* draws one layer group. If the exporter is not a GUI,
* also draws the pins / pads / vias in this layer group.
*/
-static void DrawLayerGroup(int group, const BoxType * drawn_area)
+static void DrawLayerGroup(int group, const pcb_box_t * drawn_area)
{
int i, rv = 1;
int layernum;
- LayerTypePtr Layer;
+ pcb_layer_t *Layer;
int n_entries = PCB->LayerGroups.Number[group];
pcb_cardinal_t *layers = PCB->LayerGroups.Entries[group];
@@ -1112,602 +504,123 @@ static void DrawLayerGroup(int group, const BoxType * drawn_area)
Layer = PCB->Data->Layer + layers[i];
if (strcmp(Layer->Name, "outline") == 0 || strcmp(Layer->Name, "route") == 0)
rv = 0;
- if (layernum < max_copper_layer && Layer->On)
- DrawLayer(Layer, drawn_area);
+ if (layernum < pcb_max_copper_layer && Layer->On)
+ pcb_draw_layer(Layer, drawn_area);
}
if (n_entries > 1)
rv = 1;
- if (rv && !gui->gui)
+ if (rv && !pcb_gui->gui)
DrawPPV(group, drawn_area);
}
-static void GatherPVName(PinTypePtr Ptr)
-{
- BoxType box;
- pcb_bool vert = TEST_FLAG(PCB_FLAG_EDGE2, Ptr);
-
- if (vert) {
- box.X1 = Ptr->X - Ptr->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
- box.Y1 = Ptr->Y - Ptr->DrillingHole / 2 - conf_core.appearance.pinout.text_offset_x;
- }
- else {
- box.X1 = Ptr->X + Ptr->DrillingHole / 2 + conf_core.appearance.pinout.text_offset_x;
- box.Y1 = Ptr->Y - Ptr->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
- }
-
- if (vert) {
- box.X2 = box.X1;
- box.Y2 = box.Y1;
- }
- else {
- box.X2 = box.X1;
- box.Y2 = box.Y1;
- }
- AddPart(&box);
-}
-
-static void GatherPadName(PadTypePtr Pad)
-{
- BoxType box;
- pcb_bool vert;
-
- /* should text be vertical ? */
- vert = (Pad->Point1.X == Pad->Point2.X);
-
- if (vert) {
- box.X1 = Pad->Point1.X - Pad->Thickness / 2;
- box.Y1 = MAX(Pad->Point1.Y, Pad->Point2.Y) + Pad->Thickness / 2;
- box.X1 += conf_core.appearance.pinout.text_offset_y;
- box.Y1 -= conf_core.appearance.pinout.text_offset_x;
- box.X2 = box.X1;
- box.Y2 = box.Y1;
- }
- else {
- box.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - Pad->Thickness / 2;
- box.Y1 = Pad->Point1.Y - Pad->Thickness / 2;
- box.X1 += conf_core.appearance.pinout.text_offset_x;
- box.Y1 += conf_core.appearance.pinout.text_offset_y;
- box.X2 = box.X1;
- box.Y2 = box.Y1;
- }
-
- AddPart(&box);
- return;
-}
-
-/* ---------------------------------------------------------------------------
- * lowlevel drawing routine for text objects
- */
-void DrawTextLowLevel(TextTypePtr Text, Coord min_line_width)
-{
- Coord x = 0;
- unsigned char *string = (unsigned char *) Text->TextString;
- pcb_cardinal_t n;
- FontTypePtr font = &PCB->Font;
-
- while (string && *string) {
- /* draw lines if symbol is valid and data is present */
- if (*string <= MAX_FONTPOSITION && font->Symbol[*string].Valid) {
- LineTypePtr line = font->Symbol[*string].Line;
- LineType newline;
-
- for (n = font->Symbol[*string].LineN; n; n--, line++) {
- /* create one line, scale, move, rotate and swap it */
- newline = *line;
- newline.Point1.X = PCB_SCALE_TEXT(newline.Point1.X + x, Text->Scale);
- newline.Point1.Y = PCB_SCALE_TEXT(newline.Point1.Y, Text->Scale);
- newline.Point2.X = PCB_SCALE_TEXT(newline.Point2.X + x, Text->Scale);
- newline.Point2.Y = PCB_SCALE_TEXT(newline.Point2.Y, Text->Scale);
- newline.Thickness = PCB_SCALE_TEXT(newline.Thickness, Text->Scale / 2);
- if (newline.Thickness < min_line_width)
- newline.Thickness = min_line_width;
-
- RotateLineLowLevel(&newline, 0, 0, Text->Direction);
-
- /* the labels of SMD objects on the bottom
- * side haven't been swapped yet, only their offset
- */
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, Text)) {
- newline.Point1.X = SWAP_SIGN_X(newline.Point1.X);
- newline.Point1.Y = SWAP_SIGN_Y(newline.Point1.Y);
- newline.Point2.X = SWAP_SIGN_X(newline.Point2.X);
- newline.Point2.Y = SWAP_SIGN_Y(newline.Point2.Y);
- }
- /* add offset and draw line */
- newline.Point1.X += Text->X;
- newline.Point1.Y += Text->Y;
- newline.Point2.X += Text->X;
- newline.Point2.Y += Text->Y;
- _draw_line(&newline);
- }
-
- /* move on to next cursor position */
- x += (font->Symbol[*string].Width + font->Symbol[*string].Delta);
- }
- else {
- /* the default symbol is a filled box */
- BoxType defaultsymbol = PCB->Font.DefaultSymbol;
- Coord size = (defaultsymbol.X2 - defaultsymbol.X1) * 6 / 5;
-
- defaultsymbol.X1 = PCB_SCALE_TEXT(defaultsymbol.X1 + x, Text->Scale);
- defaultsymbol.Y1 = PCB_SCALE_TEXT(defaultsymbol.Y1, Text->Scale);
- defaultsymbol.X2 = PCB_SCALE_TEXT(defaultsymbol.X2 + x, Text->Scale);
- defaultsymbol.Y2 = PCB_SCALE_TEXT(defaultsymbol.Y2, Text->Scale);
-
- RotateBoxLowLevel(&defaultsymbol, 0, 0, Text->Direction);
-
- /* add offset and draw box */
- defaultsymbol.X1 += Text->X;
- defaultsymbol.Y1 += Text->Y;
- defaultsymbol.X2 += Text->X;
- defaultsymbol.Y2 += Text->Y;
- gui->fill_rect(Output.fgGC, defaultsymbol.X1, defaultsymbol.Y1, defaultsymbol.X2, defaultsymbol.Y2);
-
- /* move on to next cursor position */
- x += size;
- }
- string++;
- }
-}
-
-/* ---------------------------------------------------------------------------
- * draw a via object
- */
-void DrawVia(PinTypePtr Via)
-{
- AddPart(Via);
- if (!TEST_FLAG(PCB_FLAG_HOLE, Via) && TEST_FLAG(PCB_FLAG_DISPLAYNAME, Via))
- DrawViaName(Via);
-}
-
-/* ---------------------------------------------------------------------------
- * draws the name of a via
- */
-void DrawViaName(PinTypePtr Via)
-{
- GatherPVName(Via);
-}
-
-/* ---------------------------------------------------------------------------
- * draw a pin object
- */
-void DrawPin(PinTypePtr Pin)
-{
- AddPart(Pin);
- if ((!TEST_FLAG(PCB_FLAG_HOLE, Pin) && TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin))
- || doing_pinout)
- DrawPinName(Pin);
-}
-
-/* ---------------------------------------------------------------------------
- * draws the name of a pin
- */
-void DrawPinName(PinTypePtr Pin)
-{
- GatherPVName(Pin);
-}
-
-/* ---------------------------------------------------------------------------
- * draw a pad object
- */
-void DrawPad(PadTypePtr Pad)
-{
- AddPart(Pad);
- if (doing_pinout || TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad))
- DrawPadName(Pad);
-}
-
-/* ---------------------------------------------------------------------------
- * draws the name of a pad
- */
-void DrawPadName(PadTypePtr Pad)
-{
- GatherPadName(Pad);
-}
-
-/* ---------------------------------------------------------------------------
- * draws a line on a layer
- */
-void DrawLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- AddPart(Line);
-}
-
-/* ---------------------------------------------------------------------------
- * draws a ratline
- */
-void DrawRat(RatTypePtr Rat)
-{
- if (conf_core.appearance.rat_thickness < 20)
- Rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness;
- /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */
- if (TEST_FLAG(PCB_FLAG_VIA, Rat)) {
- Coord w = Rat->Thickness;
-
- BoxType b;
-
- b.X1 = Rat->Point1.X - w * 2 - w / 2;
- b.X2 = Rat->Point1.X + w * 2 + w / 2;
- b.Y1 = Rat->Point1.Y - w * 2 - w / 2;
- b.Y2 = Rat->Point1.Y + w * 2 + w / 2;
- AddPart(&b);
- }
- else
- DrawLine(NULL, (LineType *) Rat);
-}
-
-/* ---------------------------------------------------------------------------
- * draws an arc on a layer
- */
-void DrawArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- AddPart(Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * draws a text on a layer
- */
-void DrawText(LayerTypePtr Layer, TextTypePtr Text)
-{
- AddPart(Text);
-}
-
-
-/* ---------------------------------------------------------------------------
- * draws a polygon on a layer
- */
-void DrawPolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- AddPart(Polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * draws an element
- */
-void DrawElement(ElementTypePtr Element)
-{
- DrawElementPackage(Element);
- DrawElementName(Element);
- DrawElementPinsAndPads(Element);
-}
-
-/* ---------------------------------------------------------------------------
- * draws the name of an element
- */
-void DrawElementName(ElementTypePtr Element)
-{
- if (TEST_FLAG(PCB_FLAG_HIDENAME, Element))
- return;
- DrawText(NULL, &ELEMENT_TEXT(PCB, Element));
-}
-
-/* ---------------------------------------------------------------------------
- * draws the package of an element
- */
-void DrawElementPackage(ElementTypePtr Element)
-{
- ELEMENTLINE_LOOP(Element);
- {
- DrawLine(NULL, line);
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- DrawArc(NULL, arc);
- }
- END_LOOP;
-}
-
-/* ---------------------------------------------------------------------------
- * draw pins of an element
- */
-void DrawElementPinsAndPads(ElementTypePtr Element)
-{
- PAD_LOOP(Element);
- {
- if (doing_pinout || doing_assy || FRONT(pad) || PCB->InvisibleObjectsOn)
- DrawPad(pad);
- }
- END_LOOP;
- PIN_LOOP(Element);
- {
- DrawPin(pin);
- }
- END_LOOP;
-}
-
-void EraseFlags(FlagType * f)
-{
- unknown_flag_t *u, *next;
- for (u = f->unknowns; u != NULL; u = next) {
- free(u->str);
- next = u->next;
- free(u);
- }
- f->unknowns = NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * erase a via
- */
-void EraseVia(PinTypePtr Via)
-{
- AddPart(Via);
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Via))
- EraseViaName(Via);
- EraseFlags(&Via->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erase a ratline
- */
-void EraseRat(RatTypePtr Rat)
-{
- if (TEST_FLAG(PCB_FLAG_VIA, Rat)) {
- Coord w = Rat->Thickness;
-
- BoxType b;
-
- b.X1 = Rat->Point1.X - w * 2 - w / 2;
- b.X2 = Rat->Point1.X + w * 2 + w / 2;
- b.Y1 = Rat->Point1.Y - w * 2 - w / 2;
- b.Y2 = Rat->Point1.Y + w * 2 + w / 2;
- AddPart(&b);
- }
- else
- EraseLine((LineType *) Rat);
- EraseFlags(&Rat->Flags);
-}
-
-
-/* ---------------------------------------------------------------------------
- * erase a via name
- */
-void EraseViaName(PinTypePtr Via)
-{
- GatherPVName(Via);
-}
-
-/* ---------------------------------------------------------------------------
- * erase a pad object
- */
-void ErasePad(PadTypePtr Pad)
-{
- AddPart(Pad);
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad))
- ErasePadName(Pad);
- EraseFlags(&Pad->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erase a pad name
- */
-void ErasePadName(PadTypePtr Pad)
-{
- GatherPadName(Pad);
-}
-
-/* ---------------------------------------------------------------------------
- * erase a pin object
- */
-void ErasePin(PinTypePtr Pin)
-{
- AddPart(Pin);
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin))
- ErasePinName(Pin);
- EraseFlags(&Pin->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erase a pin name
- */
-void ErasePinName(PinTypePtr Pin)
-{
- GatherPVName(Pin);
-}
-
-/* ---------------------------------------------------------------------------
- * erases a line on a layer
- */
-void EraseLine(LineTypePtr Line)
-{
- AddPart(Line);
- EraseFlags(&Line->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erases an arc on a layer
- */
-void EraseArc(ArcTypePtr Arc)
-{
- if (!Arc->Thickness)
- return;
- AddPart(Arc);
- EraseFlags(&Arc->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erases a text on a layer
- */
-void EraseText(LayerTypePtr Layer, TextTypePtr Text)
-{
- r_delete_entry(Layer->text_tree, (BoxTypePtr)Text);
- AddPart(Text);
-}
-
-/* ---------------------------------------------------------------------------
- * erases a polygon on a layer
- */
-void ErasePolygon(PolygonTypePtr Polygon)
-{
- AddPart(Polygon);
- EraseFlags(&Polygon->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erases an element
- */
-void EraseElement(ElementTypePtr Element)
-{
- ELEMENTLINE_LOOP(Element);
- {
- EraseLine(line);
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- EraseArc(arc);
- }
- END_LOOP;
- EraseElementName(Element);
- EraseElementPinsAndPads(Element);
- EraseFlags(&Element->Flags);
-}
-
-/* ---------------------------------------------------------------------------
- * erases all pins and pads of an element
- */
-void EraseElementPinsAndPads(ElementTypePtr Element)
-{
- PIN_LOOP(Element);
- {
- ErasePin(pin);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- ErasePad(pad);
- }
- END_LOOP;
-}
-
-/* ---------------------------------------------------------------------------
- * erases the name of an element
- */
-void EraseElementName(ElementTypePtr Element)
-{
- if (TEST_FLAG(PCB_FLAG_HIDENAME, Element)) {
- return;
- }
- DrawText(NULL, &ELEMENT_TEXT(PCB, Element));
-}
-
-
-void EraseObject(int type, void *lptr, void *ptr)
+void pcb_erase_obj(int type, void *lptr, void *ptr)
{
switch (type) {
case PCB_TYPE_VIA:
case PCB_TYPE_PIN:
- ErasePin((PinTypePtr) ptr);
+ ErasePin((pcb_pin_t *) ptr);
break;
case PCB_TYPE_TEXT:
case PCB_TYPE_ELEMENT_NAME:
- EraseText((LayerTypePtr) lptr, (TextTypePtr) ptr);
+ EraseText((pcb_layer_t *) lptr, (pcb_text_t *) ptr);
break;
case PCB_TYPE_POLYGON:
- ErasePolygon((PolygonTypePtr) ptr);
+ ErasePolygon((pcb_polygon_t *) ptr);
break;
case PCB_TYPE_ELEMENT:
- EraseElement((ElementTypePtr) ptr);
+ EraseElement((pcb_element_t *) ptr);
break;
case PCB_TYPE_LINE:
case PCB_TYPE_ELEMENT_LINE:
case PCB_TYPE_RATLINE:
- EraseLine((LineTypePtr) ptr);
+ EraseLine((pcb_line_t *) ptr);
break;
case PCB_TYPE_PAD:
- ErasePad((PadTypePtr) ptr);
+ ErasePad((pcb_pad_t *) ptr);
break;
case PCB_TYPE_ARC:
case PCB_TYPE_ELEMENT_ARC:
- EraseArc((ArcTypePtr) ptr);
+ EraseArc((pcb_arc_t *) ptr);
break;
default:
- Message(PCB_MSG_DEFAULT, "hace: Internal ERROR, trying to erase an unknown type\n");
+ pcb_message(PCB_MSG_ERROR, "hace: Internal ERROR, trying to erase an unknown type\n");
}
}
-void DrawObject(int type, void *ptr1, void *ptr2)
+void pcb_draw_obj(int type, void *ptr1, void *ptr2)
{
switch (type) {
case PCB_TYPE_VIA:
if (PCB->ViaOn)
- DrawVia((PinTypePtr) ptr2);
+ DrawVia((pcb_pin_t *) ptr2);
break;
case PCB_TYPE_LINE:
- if (((LayerTypePtr) ptr1)->On)
- DrawLine((LayerTypePtr) ptr1, (LineTypePtr) ptr2);
+ if (((pcb_layer_t *) ptr1)->On)
+ DrawLine((pcb_layer_t *) ptr1, (pcb_line_t *) ptr2);
break;
case PCB_TYPE_ARC:
- if (((LayerTypePtr) ptr1)->On)
- DrawArc((LayerTypePtr) ptr1, (ArcTypePtr) ptr2);
+ if (((pcb_layer_t *) ptr1)->On)
+ DrawArc((pcb_layer_t *) ptr1, (pcb_arc_t *) ptr2);
break;
case PCB_TYPE_TEXT:
- if (((LayerTypePtr) ptr1)->On)
- DrawText((LayerTypePtr) ptr1, (TextTypePtr) ptr2);
+ if (((pcb_layer_t *) ptr1)->On)
+ DrawText((pcb_layer_t *) ptr1, (pcb_text_t *) ptr2);
break;
case PCB_TYPE_POLYGON:
- if (((LayerTypePtr) ptr1)->On)
- DrawPolygon((LayerTypePtr) ptr1, (PolygonTypePtr) ptr2);
+ if (((pcb_layer_t *) ptr1)->On)
+ DrawPolygon((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2);
break;
case PCB_TYPE_ELEMENT:
- if (PCB->ElementOn && (FRONT((ElementTypePtr) ptr2) || PCB->InvisibleObjectsOn))
- DrawElement((ElementTypePtr) ptr2);
+ if (PCB->ElementOn && (PCB_FRONT((pcb_element_t *) ptr2) || PCB->InvisibleObjectsOn))
+ DrawElement((pcb_element_t *) ptr2);
break;
case PCB_TYPE_RATLINE:
if (PCB->RatOn)
- DrawRat((RatTypePtr) ptr2);
+ DrawRat((pcb_rat_t *) ptr2);
break;
case PCB_TYPE_PIN:
if (PCB->PinOn)
- DrawPin((PinTypePtr) ptr2);
+ DrawPin((pcb_pin_t *) ptr2);
break;
case PCB_TYPE_PAD:
if (PCB->PinOn)
- DrawPad((PadTypePtr) ptr2);
+ DrawPad((pcb_pad_t *) ptr2);
break;
case PCB_TYPE_ELEMENT_NAME:
- if (PCB->ElementOn && (FRONT((ElementTypePtr) ptr2) || PCB->InvisibleObjectsOn))
- DrawElementName((ElementTypePtr) ptr1);
+ if (PCB->ElementOn && (PCB_FRONT((pcb_element_t *) ptr2) || PCB->InvisibleObjectsOn))
+ DrawElementName((pcb_element_t *) ptr1);
break;
}
}
-static void draw_element(ElementTypePtr element)
-{
- draw_element_package(element);
- draw_element_name(element);
- draw_element_pins_and_pads(element);
-}
-
/* ---------------------------------------------------------------------------
* HID drawing callback.
*/
-void hid_expose_callback(HID * hid, BoxType * region, void *item)
+void pcb_hid_expose_callback(pcb_hid_t * hid, pcb_box_t * region, void *item)
{
- HID *old_gui = gui;
+ pcb_hid_t *old_gui = pcb_gui;
- gui = hid;
- Output.fgGC = gui->make_gc();
- Output.bgGC = gui->make_gc();
- Output.pmGC = gui->make_gc();
+ pcb_gui = hid;
+ Output.fgGC = pcb_gui->make_gc();
+ Output.bgGC = pcb_gui->make_gc();
+ Output.pmGC = pcb_gui->make_gc();
hid->set_color(Output.pmGC, "erase");
hid->set_color(Output.bgGC, "drill");
if (item) {
- doing_pinout = pcb_true;
- draw_element((ElementType *) item);
- doing_pinout = pcb_false;
+ pcb_draw_doing_pinout = pcb_true;
+ draw_element((pcb_element_t *) item);
+ pcb_draw_doing_pinout = pcb_false;
}
- else
+ else if (!pcb_draw_inhibit)
DrawEverything(region);
- gui->destroy_gc(Output.fgGC);
- gui->destroy_gc(Output.bgGC);
- gui->destroy_gc(Output.pmGC);
- gui = old_gui;
+ pcb_gui->destroy_gc(Output.fgGC);
+ pcb_gui->destroy_gc(Output.bgGC);
+ pcb_gui->destroy_gc(Output.pmGC);
+ pcb_gui = old_gui;
}
diff --git a/src/draw.h b/src/draw.h
index 53c9964..fef538c 100644
--- a/src/draw.h
+++ b/src/draw.h
@@ -29,11 +29,23 @@
#ifndef PCB_DRAW_H
#define PCB_DRAW_H
-#include "global.h"
+#include "config.h"
+#include "hid.h"
+
+/* ---------------------------------------------------------------------------
+ * some useful values of our widgets
+ */
+typedef struct { /* holds information about output window */
+ pcb_hid_gc_t bgGC, /* background and foreground; */
+ fgGC, /* changed from some routines */
+ pmGC; /* depth 1 pixmap GC to store clip */
+} pcb_output_t;
+
+extern pcb_output_t Output;
/* Temporarily inhibid drawing if this is non-zero. A function that calls a
- lot of other functions that would call Draw() a lot in turn may increase
- this value before the calls, then decrease it at the end and call Draw().
+ lot of other functions that would call pcb_draw() a lot in turn may increase
+ this value before the calls, then decrease it at the end and call pcb_draw().
This makes sure the whole block is redrawn only once at the end. */
extern pcb_cardinal_t pcb_draw_inhibit;
@@ -44,40 +56,30 @@ do { \
pcb_draw_inhibit--; \
} while(0) \
-void Draw(void);
-void Redraw(void);
-void DrawVia(PinTypePtr);
-void DrawRat(RatTypePtr);
-void DrawViaName(PinTypePtr);
-void DrawPin(PinTypePtr);
-void DrawPinName(PinTypePtr);
-void DrawPad(PadTypePtr);
-void DrawPadName(PadTypePtr);
-void DrawLine(LayerTypePtr, LineTypePtr);
-void DrawArc(LayerTypePtr, ArcTypePtr);
-void DrawText(LayerTypePtr, TextTypePtr);
-void DrawTextLowLevel(TextTypePtr, Coord);
-void DrawPolygon(LayerTypePtr, PolygonTypePtr);
-void DrawElement(ElementTypePtr);
-void DrawElementName(ElementTypePtr);
-void DrawElementPackage(ElementTypePtr);
-void DrawElementPinsAndPads(ElementTypePtr);
-void DrawObject(int, void *, void *);
-void DrawLayer(LayerTypePtr, const BoxType *);
-void EraseVia(PinTypePtr);
-void EraseRat(RatTypePtr);
-void EraseViaName(PinTypePtr);
-void ErasePad(PadTypePtr);
-void ErasePadName(PadTypePtr);
-void ErasePin(PinTypePtr);
-void ErasePinName(PinTypePtr);
-void EraseLine(LineTypePtr);
-void EraseArc(ArcTypePtr);
-void EraseText(LayerTypePtr, TextTypePtr);
-void ErasePolygon(PolygonTypePtr);
-void EraseElement(ElementTypePtr);
-void EraseElementPinsAndPads(ElementTypePtr);
-void EraseElementName(ElementTypePtr);
-void EraseObject(int, void *, void *);
+/* the minimum box that needs to be redrawn */
+extern pcb_box_t pcb_draw_invalidated;
+
+/* Adds the update rect to the invalidated region. This schedules the object
+ for redraw (by pcb_draw()). obj is anything that can be casted to pcb_box_t */
+#define pcb_draw_invalidate(obj) \
+do { \
+ pcb_box_t *box = (pcb_box_t *)obj; \
+ pcb_draw_invalidated.X1 = MIN(pcb_draw_invalidated.X1, box->X1); \
+ pcb_draw_invalidated.X2 = MAX(pcb_draw_invalidated.X2, box->X2); \
+ pcb_draw_invalidated.Y1 = MIN(pcb_draw_invalidated.Y1, box->Y1); \
+ pcb_draw_invalidated.Y2 = MAX(pcb_draw_invalidated.Y2, box->Y2); \
+} while(0)
+
+extern int pcb_draw_doing_pinout;
+extern pcb_bool pcb_draw_doing_assy;
+
+void pcb_lighten_color(const char *orig, char buf[8], double factor);
+
+
+void pcb_draw(void);
+void pcb_redraw(void);
+void pcb_draw_obj(int, void *, void *);
+void pcb_draw_layer(pcb_layer_t *, const pcb_box_t *);
+void pcb_erase_obj(int, void *, void *);
#endif
diff --git a/src/draw_fab.c b/src/draw_fab.c
deleted file mode 100644
index 5152279..0000000
--- a/src/draw_fab.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996, 2003 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 at rz.uni-ulm.de
- *
- */
-
-/* Change History:
- * 10/11/96 11:37 AJF Added support for a Text() driver function.
- * This was done out of a pressing need to force text to be printed on the
- * silkscreen layer. Perhaps the design is not the best.
- */
-
-
-/* printing routines
- */
-#include "config.h"
-
-#include <time.h>
-#include <setjmp.h>
-
-
-#include "data.h"
-#include "draw.h"
-#include "drill.h"
-#include "misc.h"
-#include "draw_fab.h"
-#include "polygon.h"
-#include "layer.h"
-
-/* ---------------------------------------------------------------------------
- * prints a FAB drawing.
- */
-
-#define TEXT_SIZE PCB_MIL_TO_COORD(150)
-#define TEXT_LINE PCB_MIL_TO_COORD(150)
-#define DRILL_MARK_SIZE PCB_MIL_TO_COORD(16)
-#define FAB_LINE_W PCB_MIL_TO_COORD(8)
-
-static void fab_line(hidGC gc, int x1, int y1, int x2, int y2)
-{
- gui->draw_line(gc, x1, y1, x2, y2);
-}
-
-static void fab_circle(hidGC gc, int x, int y, int r)
-{
- gui->draw_arc(gc, x, y, r, r, 0, 180);
- gui->draw_arc(gc, x, y, r, r, 180, 180);
-}
-
-/* align is 0=left, 1=center, 2=right, add 8 for underline */
-static void text_at(hidGC gc, int x, int y, int align, const char *fmt, ...)
-{
- char tmp[512];
- int w = 0, i;
- TextType t;
- va_list a;
- FontTypePtr font = &PCB->Font;
- va_start(a, fmt);
- vsprintf(tmp, fmt, a);
- va_end(a);
- t.Direction = 0;
- t.TextString = tmp;
- t.Scale = PCB_COORD_TO_MIL(TEXT_SIZE); /* pcnt of 100mil base height */
- t.Flags = NoFlags();
- t.X = x;
- t.Y = y;
- for (i = 0; tmp[i]; i++)
- w += (font->Symbol[(int) tmp[i]].Width + font->Symbol[(int) tmp[i]].Delta);
- w = PCB_SCALE_TEXT(w, t.Scale);
- t.X -= w * (align & 3) / 2;
- if (t.X < 0)
- t.X = 0;
- DrawTextLowLevel(&t, 0);
- if (align & 8)
- fab_line(gc, t.X,
- t.Y + PCB_SCALE_TEXT(font->MaxHeight, t.Scale) + PCB_MIL_TO_COORD(10),
- t.X + w, t.Y + PCB_SCALE_TEXT(font->MaxHeight, t.Scale) + PCB_MIL_TO_COORD(10));
-}
-
-/* Y, +, X, circle, square */
-static void drill_sym(hidGC gc, int idx, int x, int y)
-{
- int type = idx % 5;
- int size = idx / 5;
- int s2 = (size + 1) * DRILL_MARK_SIZE;
- int i;
- switch (type) {
- case 0: /* Y */ ;
- fab_line(gc, x, y, x, y + s2);
- fab_line(gc, x, y, x + s2 * 13 / 15, y - s2 / 2);
- fab_line(gc, x, y, x - s2 * 13 / 15, y - s2 / 2);
- for (i = 1; i <= size; i++)
- fab_circle(gc, x, y, i * DRILL_MARK_SIZE);
- break;
- case 1: /* + */
- ;
- fab_line(gc, x, y - s2, x, y + s2);
- fab_line(gc, x - s2, y, x + s2, y);
- for (i = 1; i <= size; i++) {
- fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE);
- fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- fab_line(gc, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- fab_line(gc, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- }
- break;
- case 2: /* X */ ;
- fab_line(gc, x - s2 * 3 / 4, y - s2 * 3 / 4, x + s2 * 3 / 4, y + s2 * 3 / 4);
- fab_line(gc, x - s2 * 3 / 4, y + s2 * 3 / 4, x + s2 * 3 / 4, y - s2 * 3 / 4);
- for (i = 1; i <= size; i++) {
- fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE);
- fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- fab_line(gc, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- fab_line(gc, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- }
- break;
- case 3: /* circle */ ;
- for (i = 0; i <= size; i++)
- fab_circle(gc, x, y, (i + 1) * DRILL_MARK_SIZE - DRILL_MARK_SIZE / 2);
- break;
- case 4: /* square */
- for (i = 1; i <= size + 1; i++) {
- fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE);
- fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- fab_line(gc, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- fab_line(gc, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
- }
- break;
- }
-}
-
-static int count_drill_lines(DrillInfoTypePtr AllDrills)
-{
- int n, ds = 0;
- for (n = AllDrills->DrillN - 1; n >= 0; n--) {
- DrillTypePtr drill = &(AllDrills->Drill[n]);
- if (drill->PinCount + drill->ViaCount > drill->UnplatedCount)
- ds++;
- if (drill->UnplatedCount)
- ds++;
- }
- return ds;
-}
-
-
-int DrawFab_overhang(void)
-{
- DrillInfoTypePtr AllDrills = GetDrillInfo(PCB->Data);
- int ds = count_drill_lines(AllDrills);
- if (ds < 4)
- ds = 4;
- return (ds + 2) * TEXT_LINE;
-}
-
-void DrawFab(hidGC gc)
-{
- DrillInfoTypePtr AllDrills;
- int i, n, yoff, total_drills = 0, ds = 0;
- time_t currenttime;
- char utcTime[64];
- AllDrills = GetDrillInfo(PCB->Data);
- RoundDrillInfo(AllDrills, PCB_MIL_TO_COORD(1));
- yoff = -TEXT_LINE;
-
- /* count how many drill description lines will be needed */
- ds = count_drill_lines(AllDrills);
-
- /*
- * When we only have a few drill sizes we need to make sure the
- * drill table header doesn't fall on top of the board info
- * section.
- */
- if (ds < 4) {
- yoff -= (4 - ds) * TEXT_LINE;
- }
-
- gui->set_line_width(gc, FAB_LINE_W);
-
- for (n = AllDrills->DrillN - 1; n >= 0; n--) {
- int plated_sym = -1, unplated_sym = -1;
- DrillTypePtr drill = &(AllDrills->Drill[n]);
- if (drill->PinCount + drill->ViaCount > drill->UnplatedCount)
- plated_sym = --ds;
- if (drill->UnplatedCount)
- unplated_sym = --ds;
- gui->set_color(gc, PCB->PinColor);
- for (i = 0; i < drill->PinN; i++)
- drill_sym(gc, TEST_FLAG(PCB_FLAG_HOLE, drill->Pin[i]) ? unplated_sym : plated_sym, drill->Pin[i]->X, drill->Pin[i]->Y);
- if (plated_sym != -1) {
- drill_sym(gc, plated_sym, TEXT_SIZE, yoff + TEXT_SIZE / 4);
- text_at(gc, PCB_MIL_TO_COORD(1350), yoff, PCB_MIL_TO_COORD(2), "YES");
- text_at(gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->PinCount + drill->ViaCount - drill->UnplatedCount);
-
- if (unplated_sym != -1)
- yoff -= TEXT_LINE;
- }
- if (unplated_sym != -1) {
- drill_sym(gc, unplated_sym, TEXT_SIZE, yoff + TEXT_SIZE / 4);
- text_at(gc, PCB_MIL_TO_COORD(1400), yoff, PCB_MIL_TO_COORD(2), "NO");
- text_at(gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->UnplatedCount);
- }
- gui->set_color(gc, PCB->ElementColor);
- text_at(gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize) + 0.0004);
- if (plated_sym != -1 && unplated_sym != -1)
- text_at(gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize) + 0.0004);
- yoff -= TEXT_LINE;
- total_drills += drill->PinCount;
- total_drills += drill->ViaCount;
- }
-
- gui->set_color(gc, PCB->ElementColor);
- text_at(gc, 0, yoff, PCB_MIL_TO_COORD(9), "Symbol");
- text_at(gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (Inch)");
- text_at(gc, PCB_MIL_TO_COORD(950), yoff, PCB_MIL_TO_COORD(9), "Count");
- text_at(gc, PCB_MIL_TO_COORD(1300), yoff, PCB_MIL_TO_COORD(9), "Plated?");
- yoff -= TEXT_LINE;
- text_at(gc, 0, yoff, 0,
- "There are %d different drill sizes used in this layout, %d holes total", AllDrills->DrillN, total_drills);
- /* Create a portable timestamp. */
- currenttime = time(NULL);
- {
- /* avoid gcc complaints */
- const char *fmt = "%c UTC";
- strftime(utcTime, sizeof utcTime, fmt, gmtime(¤ttime));
- }
- yoff = -TEXT_LINE;
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *l = LAYER_PTR(i);
- if (l->Name && (linelist_length(&l->Line) || arclist_length(&l->Arc))) {
- if (strcmp("route", l->Name) == 0)
- break;
- if (strcmp("outline", l->Name) == 0)
- break;
- }
- }
- if (i == max_copper_layer) {
- gui->set_line_width(gc, PCB_MIL_TO_COORD(10));
- gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0);
- gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight);
- gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
- gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight);
- /*FPrintOutline (); */
- gui->set_line_width(gc, FAB_LINE_W);
- text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0,
- "Maximum Dimensions: %f mils wide, %f mils high", PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight));
- text_at(gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1,
- "Board outline is the centerline of this %f mil"
- " rectangle - 0,0 to %f,%f mils",
- PCB_COORD_TO_MIL(FAB_LINE_W), PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight));
- }
- else {
- LayerTypePtr layer = LAYER_PTR(i);
- gui->set_line_width(gc, PCB_MIL_TO_COORD(10));
- LINE_LOOP(layer);
- {
- gui->draw_line(gc, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y);
- }
- END_LOOP;
- ARC_LOOP(layer);
- {
- gui->draw_arc(gc, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
- }
- END_LOOP;
- TEXT_LOOP(layer);
- {
- DrawTextLowLevel(text, 0);
- }
- END_LOOP;
- gui->set_line_width(gc, FAB_LINE_W);
- text_at(gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1, "Board outline is the centerline of this path");
- }
- yoff -= TEXT_LINE;
- text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Date: %s", utcTime);
- yoff -= TEXT_LINE;
- text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Author: %s", pcb_author());
- yoff -= TEXT_LINE;
- text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Title: %s - Fabrication Drawing", UNKNOWN(PCB->Name));
-}
diff --git a/src/draw_fab.h b/src/draw_fab.h
deleted file mode 100644
index 957f5c7..0000000
--- a/src/draw_fab.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for printing routines */
-
-#ifndef PCB_PRINT_H
-#define PCB_PRINT_H
-
-#include <stdio.h>
-
-#include "global.h"
-
-int DrawFab_overhang(void);
-void DrawFab(hidGC gc);
-
-#endif
diff --git a/src/drc.h b/src/drc.h
new file mode 100644
index 0000000..ec5c2d8
--- /dev/null
+++ b/src/drc.h
@@ -0,0 +1,47 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
+ * 15 Oct 2008 Ineiev: add different crosshair shapes
+ *
+ * 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 addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+#ifndef PCB_DRC_H
+#define PCB_DRC_H
+
+#include "unit.h"
+
+struct drc_violation_s {
+ char *title;
+ char *explanation;
+ pcb_coord_t x, y;
+ pcb_angle_t angle;
+ int have_measured;
+ pcb_coord_t measured_value;
+ pcb_coord_t required_value;
+ int object_count;
+ long int *object_id_list;
+ int *object_type_list;
+};
+
+typedef struct drc_violation_s pcb_drc_violation_t;
+
+#endif
diff --git a/src/drill.c b/src/drill.c
deleted file mode 100644
index bc910ef..0000000
--- a/src/drill.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * This module, drill.c, was written and is Copyright (C) 1997 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-#include "config.h"
-
-#include "mymem.h"
-
-/*
- * some local prototypes
- */
-static void FillDrill(DrillTypePtr, ElementTypePtr, PinTypePtr);
-static void InitializeDrill(DrillTypePtr, PinTypePtr, ElementTypePtr);
-
-
-static void FillDrill(DrillTypePtr Drill, ElementTypePtr Element, PinTypePtr Pin)
-{
- pcb_cardinal_t n;
- ElementTypeHandle ptr;
- PinTypeHandle pin;
-
- pin = GetDrillPinMemory(Drill);
- *pin = Pin;
- if (Element) {
- Drill->PinCount++;
- for (n = Drill->ElementN - 1; n != -1; n--)
- if (Drill->Element[n] == Element)
- break;
- if (n == -1) {
- ptr = GetDrillElementMemory(Drill);
- *ptr = Element;
- }
- }
- else
- Drill->ViaCount++;
- if (TEST_FLAG(PCB_FLAG_HOLE, Pin))
- Drill->UnplatedCount++;
-}
-
-static void InitializeDrill(DrillTypePtr drill, PinTypePtr pin, ElementTypePtr element)
-{
- void *ptr;
-
- drill->DrillSize = pin->DrillingHole;
- drill->ElementN = 0;
- drill->ViaCount = 0;
- drill->PinCount = 0;
- drill->UnplatedCount = 0;
- drill->ElementMax = 0;
- drill->Element = NULL;
- drill->PinN = 0;
- drill->Pin = NULL;
- drill->PinMax = 0;
- ptr = (void *) GetDrillPinMemory(drill);
- *((PinTypeHandle) ptr) = pin;
- if (element) {
- ptr = (void *) GetDrillElementMemory(drill);
- *((ElementTypeHandle) ptr) = element;
- drill->PinCount = 1;
- }
- else
- drill->ViaCount = 1;
- if (TEST_FLAG(PCB_FLAG_HOLE, pin))
- drill->UnplatedCount = 1;
-}
-
-static int DrillQSort(const void *va, const void *vb)
-{
- DrillType *a = (DrillType *) va;
- DrillType *b = (DrillType *) vb;
- return a->DrillSize - b->DrillSize;
-}
-
-DrillInfoTypePtr GetDrillInfo(DataTypePtr top)
-{
- DrillInfoTypePtr AllDrills;
- DrillTypePtr Drill = NULL;
- DrillType savedrill, swapdrill;
- pcb_bool DrillFound = pcb_false;
- pcb_bool NewDrill;
-
- AllDrills = (DrillInfoTypePtr) calloc(1, sizeof(DrillInfoType));
- ALLPIN_LOOP(top);
- {
- if (!DrillFound) {
- DrillFound = pcb_true;
- Drill = GetDrillInfoDrillMemory(AllDrills);
- InitializeDrill(Drill, pin, element);
- }
- else {
- if (Drill->DrillSize == pin->DrillingHole)
- FillDrill(Drill, element, pin);
- else {
- NewDrill = pcb_false;
- DRILL_LOOP(AllDrills);
- {
- if (drill->DrillSize == pin->DrillingHole) {
- Drill = drill;
- FillDrill(Drill, element, pin);
- break;
- }
- else if (drill->DrillSize > pin->DrillingHole) {
- if (!NewDrill) {
- NewDrill = pcb_true;
- InitializeDrill(&swapdrill, pin, element);
- Drill = GetDrillInfoDrillMemory(AllDrills);
- Drill->DrillSize = pin->DrillingHole + 1;
- Drill = drill;
- }
- savedrill = *drill;
- *drill = swapdrill;
- swapdrill = savedrill;
- }
- }
- END_LOOP;
- if (AllDrills->Drill[AllDrills->DrillN - 1].DrillSize < pin->DrillingHole) {
- Drill = GetDrillInfoDrillMemory(AllDrills);
- InitializeDrill(Drill, pin, element);
- }
- }
- }
- }
- ENDALL_LOOP;
- VIA_LOOP(top);
- {
- if (!DrillFound) {
- DrillFound = pcb_true;
- Drill = GetDrillInfoDrillMemory(AllDrills);
- Drill->DrillSize = via->DrillingHole;
- FillDrill(Drill, NULL, via);
- }
- else {
- if (Drill->DrillSize != via->DrillingHole) {
- DRILL_LOOP(AllDrills);
- {
- if (drill->DrillSize == via->DrillingHole) {
- Drill = drill;
- FillDrill(Drill, NULL, via);
- break;
- }
- }
- END_LOOP;
- if (Drill->DrillSize != via->DrillingHole) {
- Drill = GetDrillInfoDrillMemory(AllDrills);
- Drill->DrillSize = via->DrillingHole;
- FillDrill(Drill, NULL, via);
- }
- }
- else
- FillDrill(Drill, NULL, via);
- }
- }
- END_LOOP;
- qsort(AllDrills->Drill, AllDrills->DrillN, sizeof(DrillType), DrillQSort);
- return (AllDrills);
-}
-
-#define ROUND(x,n) ((int)(((x)+(n)/2)/(n))*(n))
-
-void RoundDrillInfo(DrillInfoTypePtr d, int roundto)
-{
- unsigned int i = 0;
-
- while ((d->DrillN > 0) && (i < d->DrillN - 1)) {
- int diam1 = ROUND(d->Drill[i].DrillSize, roundto);
- int diam2 = ROUND(d->Drill[i + 1].DrillSize, roundto);
-
- if (diam1 == diam2) {
- int ei, ej;
-
- d->Drill[i].ElementMax = d->Drill[i].ElementN + d->Drill[i + 1].ElementN;
- if (d->Drill[i].ElementMax) {
- d->Drill[i].Element = (ElementTypePtr *) realloc(d->Drill[i].Element, d->Drill[i].ElementMax * sizeof(ElementTypePtr));
-
- for (ei = 0; ei < d->Drill[i + 1].ElementN; ei++) {
- for (ej = 0; ej < d->Drill[i].ElementN; ej++)
- if (d->Drill[i].Element[ej] == d->Drill[i + 1].Element[ei])
- break;
- if (ej == d->Drill[i].ElementN)
- d->Drill[i].Element[d->Drill[i].ElementN++]
- = d->Drill[i + 1].Element[ei];
- }
- }
- free(d->Drill[i + 1].Element);
- d->Drill[i + 1].Element = NULL;
-
- d->Drill[i].PinMax = d->Drill[i].PinN + d->Drill[i + 1].PinN;
- d->Drill[i].Pin = (PinTypePtr *) realloc(d->Drill[i].Pin, d->Drill[i].PinMax * sizeof(PinTypePtr));
- memcpy(d->Drill[i].Pin + d->Drill[i].PinN, d->Drill[i + 1].Pin, d->Drill[i + 1].PinN * sizeof(PinTypePtr));
- d->Drill[i].PinN += d->Drill[i + 1].PinN;
- free(d->Drill[i + 1].Pin);
- d->Drill[i + 1].Pin = NULL;
-
- d->Drill[i].PinCount += d->Drill[i + 1].PinCount;
- d->Drill[i].ViaCount += d->Drill[i + 1].ViaCount;
- d->Drill[i].UnplatedCount += d->Drill[i + 1].UnplatedCount;
-
- d->Drill[i].DrillSize = diam1;
-
- memmove(d->Drill + i + 1, d->Drill + i + 2, (d->DrillN - i - 2) * sizeof(DrillType));
- d->DrillN--;
- }
- else {
- d->Drill[i].DrillSize = diam1;
- i++;
- }
- }
-}
-
-void FreeDrillInfo(DrillInfoTypePtr Drills)
-{
- DRILL_LOOP(Drills);
- {
- free(drill->Element);
- free(drill->Pin);
- }
- END_LOOP;
- free(Drills->Drill);
- free(Drills);
-}
diff --git a/src/drill.h b/src/drill.h
deleted file mode 100644
index 27a5ffe..0000000
--- a/src/drill.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * This module, drill.h, was written and is Copyright (C) 1997 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-
-DrillInfoTypePtr GetDrillInfo(DataTypePtr);
-void FreeDrillInfo(DrillInfoTypePtr);
-void RoundDrillInfo(DrillInfoTypePtr, int);
diff --git a/src/error.c b/src/error.c
index c58deb0..84065a8 100644
--- a/src/error.c
+++ b/src/error.c
@@ -29,22 +29,15 @@
#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
#include <stdarg.h>
-#include <signal.h>
-#include <string.h>
-#include <stdarg.h>
-#include <fcntl.h>
-
-#include "global.h"
#include "data.h"
#include "error.h"
#include "plug_io.h"
#include "compat_misc.h"
-#include "pcb-printf.h"
+#include "compat_nls.h"
+#include "conf_core.h"
#define utf8_dup_string(a,b) *(a) = pcb_strdup(b)
@@ -63,21 +56,27 @@ extern char *sys_errlist[]; /* array of error messages */
/* ---------------------------------------------------------------------------
* output of message in a dialog window or log window
*/
-void Message(enum pcb_message_level level, const char *Format, ...)
+void pcb_message(enum pcb_message_level level, const char *Format, ...)
{
va_list args;
+ pcb_message_level_t min_level = PCB_MSG_INFO;
/* TODO(hzeller): do something useful with the level, e.g. color coding. */
- if (gui != NULL) {
+ if (pcb_gui != NULL) {
va_start(args, Format);
- gui->logv(level, Format, args);
+ pcb_gui->logv(level, Format, args);
va_end(args);
}
- va_start(args, Format);
- pcb_vfprintf(stderr, Format, args);
- va_end(args);
+ if (conf_core.rc.quiet)
+ min_level = PCB_MSG_ERROR;
+
+ if ((level >= min_level) || (conf_core.rc.verbose)) {
+ va_start(args, Format);
+ pcb_vfprintf(stderr, Format, args);
+ va_end(args);
+ }
}
void pcb_trace(const char *Format, ...)
@@ -94,102 +93,47 @@ void pcb_trace(const char *Format, ...)
/* ---------------------------------------------------------------------------
* print standard 'open error'
*/
-void OpenErrorMessage(const char *Filename)
+void pcb_open_error_message(const char *Filename)
{
char *utf8 = NULL;
utf8_dup_string(&utf8, Filename);
- Message(PCB_MSG_DEFAULT, _("Can't open file\n" " '%s'\nfopen() returned: '%s'\n"), utf8, strerror(errno));
+ pcb_message(PCB_MSG_ERROR, _("Can't open file\n" " '%s'\nfopen() returned: '%s'\n"), utf8, strerror(errno));
free(utf8);
}
/* ---------------------------------------------------------------------------
* print standard 'popen error'
*/
-void PopenErrorMessage(const char *Filename)
+void pcb_popen_error_message(const char *Filename)
{
char *utf8 = NULL;
utf8_dup_string(&utf8, Filename);
- Message(PCB_MSG_DEFAULT, _("Can't execute command\n" " '%s'\npopen() returned: '%s'\n"), utf8, strerror(errno));
+ pcb_message(PCB_MSG_ERROR, _("Can't execute command\n" " '%s'\npopen() returned: '%s'\n"), utf8, strerror(errno));
free(utf8);
}
/* ---------------------------------------------------------------------------
* print standard 'opendir'
*/
-void OpendirErrorMessage(const char *DirName)
+void pcb_opendir_error_message(const char *DirName)
{
char *utf8 = NULL;
utf8_dup_string(&utf8, DirName);
- Message(PCB_MSG_DEFAULT, _("Can't scan directory\n" " '%s'\nopendir() returned: '%s'\n"), utf8, strerror(errno));
+ pcb_message(PCB_MSG_ERROR, _("Can't scan directory\n" " '%s'\nopendir() returned: '%s'\n"), utf8, strerror(errno));
free(utf8);
}
/* ---------------------------------------------------------------------------
* print standard 'chdir error'
*/
-void ChdirErrorMessage(const char *DirName)
+void pcb_chdir_error_message(const char *DirName)
{
char *utf8 = NULL;
utf8_dup_string(&utf8, DirName);
- Message(PCB_MSG_DEFAULT, _("Can't change working directory to\n" " '%s'\nchdir() returned: '%s'\n"), utf8, strerror(errno));
+ pcb_message(PCB_MSG_ERROR, _("Can't change working directory to\n" " '%s'\nchdir() returned: '%s'\n"), utf8, strerror(errno));
free(utf8);
}
-
-/* ---------------------------------------------------------------------------
- * output of fatal error message
- */
-void MyFatal(const char *Format, ...)
-{
- va_list args;
-
- va_start(args, Format);
-
- /* try to save the layout and do some cleanup */
- EmergencySave();
- fprintf(stderr, "pcb-rnd (%i): fatal, ", pcb_getpid());
- vfprintf(stderr, Format, args);
- fflush(stderr);
- va_end(args);
- exit(1);
-}
-
-/* ---------------------------------------------------------------------------
- * catches signals which abort the program
- */
-void CatchSignal(int Signal)
-{
- const char *s;
-
- switch (Signal) {
-#ifdef SIGHUP
- case SIGHUP:
- s = "SIGHUP";
- break;
-#endif
- case SIGINT:
- s = "SIGINT";
- break;
-#ifdef SIGQUIT
- case SIGQUIT:
- s = "SIGQUIT";
- break;
-#endif
- case SIGABRT:
- s = "SIGABRT";
- break;
- case SIGTERM:
- s = "SIGTERM";
- break;
- case SIGSEGV:
- s = "SIGSEGV";
- break;
- default:
- s = "unknown";
- break;
- }
- MyFatal("aborted by %s signal\n", s);
-}
diff --git a/src/error.h b/src/error.h
index b330fff..1b10dd3 100644
--- a/src/error.h
+++ b/src/error.h
@@ -29,31 +29,18 @@
#ifndef PCB_ERROR_H
#define PCB_ERROR_H
-/* Common return codes. */
-#define STATUS_OK 0
-#define STATUS_BREAK 1
-#define STATUS_ERROR -1
-
typedef enum pcb_message_level {
- /* MSG_DEFAULT is the default level when a message is not converted yet
- to any of the levels below. This level will go away once all messages
- are converted. Please grep for this and convert the message to the
- more specific. */
- PCB_MSG_DEFAULT = 1,
-
PCB_MSG_DEBUG = 0, /* Debug message. Should probably not be shown in regular operation. */
PCB_MSG_INFO, /* Info message. FYI for the user, no action needed. */
PCB_MSG_WARNING, /* Something the user should probably take note */
PCB_MSG_ERROR /* Couldn't finish an action, needs user attention. */
} pcb_message_level_t;
-void Message(enum pcb_message_level level, const char *Format, ...);
-void MyFatal(const char *Format, ...);
-void OpenErrorMessage(const char *);
-void PopenErrorMessage(const char *);
-void OpendirErrorMessage(const char *);
-void ChdirErrorMessage(const char *);
-void CatchSignal(int);
+void pcb_message(enum pcb_message_level level, const char *Format, ...);
+void pcb_open_error_message(const char *);
+void pcb_popen_error_message(const char *);
+void pcb_opendir_error_message(const char *);
+void pcb_chdir_error_message(const char *);
void pcb_trace(const char *Format, ...);
#endif
diff --git a/src/event.c b/src/event.c
index 4f0a310..a123fb5 100644
--- a/src/event.c
+++ b/src/event.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#include "config.h"
#include "event.h"
#include "error.h"
#include "fptr_cast.h"
@@ -30,17 +31,17 @@
typedef struct event_s event_t;
struct event_s {
- event_handler_t *handler;
+ pcb_event_handler_t *handler;
void *user_data;
const char *cookie;
event_t *next;
};
-event_t *events[EVENT_last];
+event_t *events[PCB_EVENT_last];
-#define event_valid(ev) (((ev) >= 0) && ((ev) < EVENT_last))
+#define event_valid(ev) (((ev) >= 0) && ((ev) < PCB_EVENT_last))
-void event_bind(event_id_t ev, event_handler_t * handler, void *user_data, const char *cookie)
+void pcb_event_bind(pcb_event_id_t ev, pcb_event_handler_t * handler, void *user_data, const char *cookie)
{
event_t *e;
@@ -62,7 +63,7 @@ static void event_destroy(event_t * ev)
free(ev);
}
-void event_unbind(event_id_t ev, event_handler_t * handler)
+void pcb_event_unbind(pcb_event_id_t ev, pcb_event_handler_t * handler)
{
event_t *prev = NULL, *e, *next;
if (!(event_valid(ev)))
@@ -81,7 +82,7 @@ void event_unbind(event_id_t ev, event_handler_t * handler)
}
}
-void event_unbind_cookie(event_id_t ev, const char *cookie)
+void pcb_event_unbind_cookie(pcb_event_id_t ev, const char *cookie)
{
event_t *prev = NULL, *e, *next;
if (!(event_valid(ev)))
@@ -101,22 +102,22 @@ void event_unbind_cookie(event_id_t ev, const char *cookie)
}
-void event_unbind_allcookie(const char *cookie)
+void pcb_event_unbind_allcookie(const char *cookie)
{
- event_id_t n;
- for (n = 0; n < EVENT_last; n++)
- event_unbind_cookie(n, cookie);
+ pcb_event_id_t n;
+ for (n = 0; n < PCB_EVENT_last; n++)
+ pcb_event_unbind_cookie(n, cookie);
}
-void event(event_id_t ev, const char *fmt, ...)
+void pcb_event(pcb_event_id_t ev, const char *fmt, ...)
{
va_list ap;
- event_arg_t argv[EVENT_MAX_ARG], *a;
+ pcb_event_arg_t argv[EVENT_MAX_ARG], *a;
event_t *e;
int argc;
a = argv;
- a->type = ARG_INT;
+ a->type = PCB_EVARG_INT;
a->d.i = ev;
argc = 1;
@@ -124,26 +125,38 @@ void event(event_id_t ev, const char *fmt, ...)
va_start(ap, fmt);
for (a++; *fmt != '\0'; fmt++, a++, argc++) {
if (argc >= EVENT_MAX_ARG) {
- Message(PCB_MSG_DEFAULT, "event(): too many arguments\n");
+ pcb_message(PCB_MSG_ERROR, "pcb_event(): too many arguments\n");
break;
}
switch (*fmt) {
case 'i':
- a->type = ARG_INT;
+ a->type = PCB_EVARG_INT;
a->d.i = va_arg(ap, int);
break;
case 'd':
- a->type = ARG_DOUBLE;
+ a->type = PCB_EVARG_DOUBLE;
a->d.d = va_arg(ap, double);
break;
case 's':
- a->type = ARG_STR;
+ a->type = PCB_EVARG_STR;
a->d.s = va_arg(ap, const char *);
break;
+ case 'p':
+ a->type = PCB_EVARG_PTR;
+ a->d.p = va_arg(ap, void *);
+ break;
+ case 'c':
+ a->type = PCB_EVARG_COORD;
+ a->d.c = va_arg(ap, pcb_coord_t);
+ break;
+ case 'a':
+ a->type = PCB_EVARG_ANGLE;
+ a->d.a = va_arg(ap, pcb_angle_t);
+ break;
default:
- a->type = ARG_INT;
+ a->type = PCB_EVARG_INT;
a->d.i = 0;
- Message(PCB_MSG_DEFAULT, "event(): invalid argument type '%c'\n", *fmt);
+ pcb_message(PCB_MSG_ERROR, "pcb_event(): invalid argument type '%c'\n", *fmt);
break;
}
}
@@ -151,18 +164,18 @@ void event(event_id_t ev, const char *fmt, ...)
}
for (e = events[ev]; e != NULL; e = e->next)
- e->handler(e->user_data, argc, (event_arg_t **) & argv);
+ e->handler(e->user_data, argc, argv);
}
-void events_init(void)
+void pcb_events_init(void)
{
}
-void events_uninit(void)
+void pcb_events_uninit(void)
{
int ev;
- for(ev = 0; ev < EVENT_last; ev++) {
+ for(ev = 0; ev < PCB_EVENT_last; ev++) {
event_t *e, *next;
for(e = events[ev]; e != NULL; e = next) {
next = e->next;
diff --git a/src/event.h b/src/event.h
index 6d6b9f4..7a5eac0 100644
--- a/src/event.h
+++ b/src/event.h
@@ -22,62 +22,89 @@
#ifndef PCB_EVENT_H
#define PCB_EVENT_H
+#include "config.h"
+#include "unit.h"
+
typedef enum {
- EVENT_GUI_INIT, /* finished initializing the GUI called right before the main loop of the GUI; args: (void) */
- EVENT_CLI_ENTER, /* the user pressed enter on a CLI command - called before parsing the line for actions; args: (str commandline) */
- EVENT_SAVE_PRE, /* called before saving the design */
- EVENT_SAVE_POST, /* called after saving the design */
- EVENT_LOAD_PRE, /* called before loading a new design */
- EVENT_LOAD_POST, /* called after loading a new design, whether it was successful or not */
- EVENT_last /* not a real event */
-} event_id_t;
+ PCB_EVENT_GUI_INIT, /* finished initializing the GUI called right before the main loop of the GUI; args: (void) */
+ PCB_EVENT_CLI_ENTER, /* the user pressed enter on a CLI command - called before parsing the line for actions; args: (str commandline) */
+ PCB_EVENT_SAVE_PRE, /* called before saving the design */
+ PCB_EVENT_SAVE_POST, /* called after saving the design */
+ PCB_EVENT_LOAD_PRE, /* called before loading a new design */
+ PCB_EVENT_LOAD_POST, /* called after loading a new design, whether it was successful or not */
+
+ PCB_EVENT_BOARD_CHANGED, /* called after the board being edited got replaced (used to be the PCBChanged action) */
+ PCB_EVENT_ROUTE_STYLES_CHANGED, /* called after any route style change (used to be the RouteStylesChanged action) */
+ PCB_EVENT_NETLIST_CHANGED, /* called after any netlist change (used to be the NetlistChanged action) */
+ PCB_EVENT_LAYERS_CHANGED, /* called after layers or layer groups change (used to be the LayersChanged action) */
+ PCB_EVENT_LIBRARY_CHANGED, /* called after a change in the footprint lib (used to be the LibraryChanged action) */
+
+ PCB_EVENT_BUSY, /* called before CPU-intensive task begins */
+
+ PCB_EVENT_RUBBER_RESET, /* rubber band: reset attached */
+ PCB_EVENT_RUBBER_REMOVE_ELEMENT, /* rubber band: removed an element with rubber bands attached */
+ PCB_EVENT_RUBBER_MOVE, /* rubber band: object moved */
+ PCB_EVENT_RUBBER_MOVE_DRAW, /* rubber band: draw crosshair-attached rubber band objects after a move or copy */
+ PCB_EVENT_RUBBER_ROTATE90, /* rubber band: crosshair object rotated by 90 degrees */
+ PCB_EVENT_RUBBER_RENAME, /* rubber band: element pin/pad got renamed */
+ PCB_EVENT_RUBBER_LOOKUP_LINES, /* rubber band: attach rubber banded line objects to crosshair */
+ PCB_EVENT_RUBBER_LOOKUP_RATS, /* rubber band: attach rubber banded rat lines objects to crosshair */
+
+ PCB_EVENT_last /* not a real event */
+} pcb_event_id_t;
/* Maximum number of arguments for an event handler, auto-set argv[0] included */
#define EVENT_MAX_ARG 16
/* Argument types in event's argv[] */
typedef enum {
- ARG_INT, /* format char: i */
- ARG_DOUBLE, /* format char: d */
- ARG_STR /* format char: s */
-} event_argtype_t;
+ PCB_EVARG_INT, /* format char: i */
+ PCB_EVARG_DOUBLE, /* format char: d */
+ PCB_EVARG_STR, /* format char: s */
+ PCB_EVARG_PTR, /* format char: p */
+ PCB_EVARG_COORD, /* format char: c */
+ PCB_EVARG_ANGLE /* format char: a */
+} pcb_event_argtype_t;
/* An argument is its type and value */
typedef struct {
- event_argtype_t type;
+ pcb_event_argtype_t type;
union {
int i;
double d;
const char *s;
+ void *p;
+ pcb_coord_t c;
+ pcb_angle_t a;
} d;
-} event_arg_t;
+} pcb_event_arg_t;
/* Initialize the event system */
-void events_init(void);
+void pcb_events_init(void);
/* Uninitialize the event system and remove all events */
-void events_uninit(void);
+void pcb_events_uninit(void);
-/* Event callback prototype; user_data is the same as in event_bind().
- argv[0] is always an ARG_INT with the event id that triggered the event. */
-typedef void (event_handler_t) (void *user_data, int argc, event_arg_t * argv[]);
+/* Event callback prototype; user_data is the same as in pcb_event_bind().
+ argv[0] is always an PCB_EVARG_INT with the event id that triggered the event. */
+typedef void (pcb_event_handler_t) (void *user_data, int argc, pcb_event_arg_t argv[]);
/* Bind: add a handler to the call-list of an event; the cookie is also remembered
so that mass-unbind is easier later. user_data is passed to the handler. */
-void event_bind(event_id_t ev, event_handler_t * handler, void *user_data, const char *cookie);
+void pcb_event_bind(pcb_event_id_t ev, pcb_event_handler_t * handler, void *user_data, const char *cookie);
/* Unbind: remove a handler from an event */
-void event_unbind(event_id_t ev, event_handler_t * handler);
+void pcb_event_unbind(pcb_event_id_t ev, pcb_event_handler_t * handler);
/* Unbind by cookie: remove all handlers from an event matching the cookie */
-void event_unbind_cookie(event_id_t ev, const char *cookie);
+void pcb_event_unbind_cookie(pcb_event_id_t ev, const char *cookie);
/* Unbind all by cookie: remove all handlers from all events matching the cookie */
-void event_unbind_allcookie(const char *cookie);
+void pcb_event_unbind_allcookie(const char *cookie);
/* Event trigger: call all handlers for an event. Fmt is a list of
- format characters (e.g. i for ARG_INT). */
-void event(event_id_t ev, const char *fmt, ...);
+ format characters (e.g. i for PCB_EVARG_INT). */
+void pcb_event(pcb_event_id_t ev, const char *fmt, ...);
#endif
diff --git a/src/file_act.c b/src/file_act.c
index 3ce5d80..d5857bf 100644
--- a/src/file_act.c
+++ b/src/file_act.c
@@ -25,30 +25,28 @@
*
*/
#include "config.h"
+#include "board.h"
+#include "build_run.h"
#include "conf_core.h"
#include "data.h"
#include "action_helper.h"
-#include "error.h"
-#include "crosshair.h"
-#include "set.h"
#include "plug_io.h"
#include "plug_import.h"
-#include "buffer.h"
-#include "misc.h"
#include "remove.h"
-#include "create.h"
#include "draw.h"
#include "find.h"
#include "search.h"
#include "hid_actions.h"
-#include "hid_attrib.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "hid_init.h"
+#include "layer_vis.h"
/* ---------------------------------------------------------------- */
-static const char execcommand_syntax[] = "ExecCommand(command)";
+static const char pcb_acts_ExecCommand[] = "ExecCommand(command)";
-static const char execcommand_help[] = "Runs a command.";
+static const char pcb_acth_ExecCommand[] = "Runs a command.";
/* %start-doc actions execcommand
@@ -56,15 +54,15 @@ Runs the given command, which is a system executable.
%end-doc */
-static int ActionExecCommand(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ExecCommand(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *command;
if (argc < 1) {
- AFAIL(execcommand);
+ PCB_ACT_FAIL(ExecCommand);
}
- command = ACTION_ARG(0);
+ command = PCB_ACTION_ARG(0);
if (system(command))
return 1;
@@ -73,9 +71,9 @@ static int ActionExecCommand(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char loadfrom_syntax[] = "LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename[,format])";
+static const char pcb_acts_LoadFrom[] = "LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename[,format])";
-static const char loadfrom_help[] = "Load layout data from a file.";
+static const char pcb_acth_LoadFrom[] = "Load layout data from a file.";
/* %start-doc actions LoadFrom
@@ -108,52 +106,52 @@ you may have made.
%end-doc */
-static int ActionLoadFrom(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_LoadFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function, *name, *format = NULL;
if (argc < 2)
- AFAIL(loadfrom);
+ PCB_ACT_FAIL(LoadFrom);
function = argv[0];
name = argv[1];
if (argc > 2)
format = argv[2];
- if (strcasecmp(function, "ElementToBuffer") == 0) {
- notify_crosshair_change(pcb_false);
- if (LoadElementToBuffer(PASTEBUFFER, name))
- SetMode(PCB_MODE_PASTE_BUFFER);
- notify_crosshair_change(pcb_true);
+ if (pcb_strcasecmp(function, "ElementToBuffer") == 0) {
+ pcb_notify_crosshair_change(pcb_false);
+ if (pcb_element_load_to_buffer(PCB_PASTEBUFFER, name))
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
+ pcb_notify_crosshair_change(pcb_true);
}
- else if (strcasecmp(function, "LayoutToBuffer") == 0) {
- notify_crosshair_change(pcb_false);
- if (LoadLayoutToBuffer(PASTEBUFFER, name, format))
- SetMode(PCB_MODE_PASTE_BUFFER);
- notify_crosshair_change(pcb_true);
+ else if (pcb_strcasecmp(function, "LayoutToBuffer") == 0) {
+ pcb_notify_crosshair_change(pcb_false);
+ if (pcb_buffer_load_layout(PCB_PASTEBUFFER, name, format))
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
+ pcb_notify_crosshair_change(pcb_true);
}
- else if (strcasecmp(function, "Layout") == 0) {
- if (!PCB->Changed || gui->confirm_dialog(_("OK to override layout data?"), 0))
- LoadPCB(name, format, pcb_true, 0);
+ else if (pcb_strcasecmp(function, "Layout") == 0) {
+ if (!PCB->Changed || pcb_gui->confirm_dialog(_("OK to override layout data?"), 0))
+ pcb_load_pcb(name, format, pcb_true, 0);
}
- else if (strcasecmp(function, "Netlist") == 0) {
+ else if (pcb_strcasecmp(function, "Netlist") == 0) {
if (PCB->Netlistname)
free(PCB->Netlistname);
- PCB->Netlistname = StripWhiteSpaceAndDup(name);
+ PCB->Netlistname = pcb_strdup_strip_wspace(name);
{
int i;
- for (i = 0; i < NUM_NETLISTS; i++)
- FreeLibraryMemory(&(PCB->NetlistLib[i]));
+ for (i = 0; i < PCB_NUM_NETLISTS; i++)
+ pcb_lib_free(&(PCB->NetlistLib[i]));
}
- if (!ImportNetlist(PCB->Netlistname))
+ if (!pcb_import_netlist(PCB->Netlistname))
pcb_netlist_changed(1);
}
- else if (strcasecmp(function, "Revert") == 0 && PCB->Filename
- && (!PCB->Changed || gui->confirm_dialog(_("OK to override changes?"), 0))) {
- RevertPCB();
+ else if (pcb_strcasecmp(function, "Revert") == 0 && PCB->Filename
+ && (!PCB->Changed || pcb_gui->confirm_dialog(_("OK to override changes?"), 0))) {
+ pcb_revert_pcb();
}
return 0;
@@ -161,9 +159,9 @@ static int ActionLoadFrom(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char new_syntax[] = "New([name])";
+static const char pcb_acts_New[] = "New([name])";
-static const char new_help[] = "Starts a new layout.";
+static const char pcb_acth_New[] = "Starts a new layout.";
/* %start-doc actions New
@@ -171,42 +169,40 @@ If a name is not given, one is prompted for.
%end-doc */
-static int ActionNew(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_New(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *argument_name = ACTION_ARG(0);
+ const char *argument_name = PCB_ACTION_ARG(0);
char *name = NULL;
- if (!PCB->Changed || gui->confirm_dialog(_("OK to clear layout data?"), 0)) {
+ if (!PCB->Changed || pcb_gui->confirm_dialog(_("OK to clear layout data?"), 0)) {
if (argument_name)
name = pcb_strdup(argument_name);
else
- name = gui->prompt_for(_("Enter the layout name:"), "");
+ name = pcb_gui->prompt_for(_("Enter the layout name:"), "");
if (!name)
return 1;
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
/* do emergency saving
* clear the old struct and allocate memory for the new one
*/
if (PCB->Changed && conf_core.editor.save_in_tmp)
- SaveInTMP();
- RemovePCB(PCB);
- PCB = CreateNewPCB();
- CreateNewPCBPost(PCB, 1);
+ pcb_save_in_tmp();
+ pcb_board_remove(PCB);
+ PCB = pcb_board_new();
+ pcb_board_new_postproc(PCB, 1);
/* setup the new name and reset some values to default */
free(PCB->Name);
PCB->Name = name;
- ResetStackAndVisibility();
- SetCrosshairRange(0, 0, PCB->MaxWidth, PCB->MaxHeight);
- CenterDisplay(PCB->MaxWidth / 2, PCB->MaxHeight / 2);
- Redraw();
-
- if (gui != NULL)
- hid_action("PCBChanged");
- notify_crosshair_change(pcb_true);
+ pcb_layervis_reset_stack();
+ pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_center_display(PCB->MaxWidth / 2, PCB->MaxHeight / 2);
+ pcb_redraw();
+ pcb_board_changed(0);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
return 1;
@@ -214,11 +210,11 @@ static int ActionNew(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char saveto_syntax[] =
+static const char pcb_acts_SaveTo[] =
"SaveTo(Layout|LayoutAs,filename)\n"
"SaveTo(AllConnections|AllUnusedPins|ElementConnections,filename)\n" "SaveTo(PasteBuffer,filename)";
-static const char saveto_help[] = "Saves data to a file.";
+static const char pcb_acth_SaveTo[] = "Saves data to a file.";
/* %start-doc actions SaveTo
@@ -246,7 +242,7 @@ Save the content of the active Buffer to a file. This is the graphical way to cr
%end-doc */
-static int ActionSaveTo(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SaveTo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function;
const char *name;
@@ -255,82 +251,82 @@ static int ActionSaveTo(int argc, const char **argv, Coord x, Coord y)
function = argv[0];
name = argv[1];
- if (strcasecmp(function, "Layout") == 0) {
- if (SavePCB(PCB->Filename, NULL) == 0)
- SetChangedFlag(pcb_false);
- if (gui->notify_filename_changed != NULL)
- gui->notify_filename_changed();
+ if (pcb_strcasecmp(function, "Layout") == 0) {
+ if (pcb_save_pcb(PCB->Filename, NULL) == 0)
+ pcb_board_set_changed_flag(pcb_false);
+ if (pcb_gui->notify_filename_changed != NULL)
+ pcb_gui->notify_filename_changed();
return 0;
}
if ((argc != 2) && (argc != 3))
- AFAIL(saveto);
+ PCB_ACT_FAIL(SaveTo);
if (argc >= 3)
fmt = argv[2];
- if (strcasecmp(function, "LayoutAs") == 0) {
- if (SavePCB(name, fmt) == 0) {
- SetChangedFlag(pcb_false);
+ if (pcb_strcasecmp(function, "LayoutAs") == 0) {
+ if (pcb_save_pcb(name, fmt) == 0) {
+ pcb_board_set_changed_flag(pcb_false);
free(PCB->Filename);
PCB->Filename = pcb_strdup(name);
- if (gui->notify_filename_changed != NULL)
- gui->notify_filename_changed();
+ if (pcb_gui->notify_filename_changed != NULL)
+ pcb_gui->notify_filename_changed();
}
return 0;
}
- if (strcasecmp(function, "AllConnections") == 0) {
+ if (pcb_strcasecmp(function, "AllConnections") == 0) {
FILE *fp;
pcb_bool result;
- if ((fp = CheckAndOpenFile(name, pcb_true, pcb_false, &result, NULL)) != NULL) {
- LookupConnectionsToAllElements(fp);
+ if ((fp = pcb_check_and_open_file(name, pcb_true, pcb_false, &result, NULL)) != NULL) {
+ pcb_lookup_conns_to_all_elements(fp);
fclose(fp);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
return 0;
}
- if (strcasecmp(function, "AllUnusedPins") == 0) {
+ if (pcb_strcasecmp(function, "AllUnusedPins") == 0) {
FILE *fp;
pcb_bool result;
- if ((fp = CheckAndOpenFile(name, pcb_true, pcb_false, &result, NULL)) != NULL) {
- LookupUnusedPins(fp);
+ if ((fp = pcb_check_and_open_file(name, pcb_true, pcb_false, &result, NULL)) != NULL) {
+ pcb_lookup_unused_pins(fp);
fclose(fp);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
return 0;
}
- if (strcasecmp(function, "ElementConnections") == 0) {
- ElementTypePtr element;
+ if (pcb_strcasecmp(function, "ElementConnections") == 0) {
+ pcb_element_t *element;
void *ptrtmp;
FILE *fp;
pcb_bool result;
- if ((SearchScreen(Crosshair.X, Crosshair.Y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) {
- element = (ElementTypePtr) ptrtmp;
- if ((fp = CheckAndOpenFile(name, pcb_true, pcb_false, &result, NULL)) != NULL) {
- LookupElementConnections(element, fp);
+ if ((pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) {
+ element = (pcb_element_t *) ptrtmp;
+ if ((fp = pcb_check_and_open_file(name, pcb_true, pcb_false, &result, NULL)) != NULL) {
+ pcb_lookup_element_conns(element, fp);
fclose(fp);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
}
return 0;
}
- if (strcasecmp(function, "PasteBuffer") == 0) {
- return SaveBufferElements(name, fmt);
+ if (pcb_strcasecmp(function, "PasteBuffer") == 0) {
+ return pcb_save_buffer_elements(name, fmt);
}
- AFAIL(saveto);
+ PCB_ACT_FAIL(SaveTo);
}
/* --------------------------------------------------------------------------- */
-static const char quit_syntax[] = "Quit()";
+static const char pcb_acts_Quit[] = "Quit()";
-static const char quit_help[] = "Quits the application after confirming.";
+static const char pcb_acth_Quit[] = "Quits the application after confirming.";
/* %start-doc actions Quit
@@ -339,34 +335,67 @@ save) before quitting.
%end-doc */
-static int ActionQuit(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Quit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *force = ACTION_ARG(0);
- if (force && strcasecmp(force, "force") == 0) {
+ const char *force = PCB_ACTION_ARG(0);
+ if (force && pcb_strcasecmp(force, "force") == 0) {
PCB->Changed = 0;
exit(0);
}
- if (!PCB->Changed || gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK)
- QuitApplication();
+ if (!PCB->Changed || pcb_gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK)
+ pcb_quit_app();
return 1;
}
-HID_Action file_action_list[] = {
- {"ExecCommand", 0, ActionExecCommand,
- execcommand_help, execcommand_syntax}
+/* --------------------------------------------------------------------------- */
+static const char pcb_acts_Export[] = "Export(exporter, [exporter-args])";
+static const char pcb_acth_Export[] = "Export the current layout, e.g. Export(png, --dpi, 600)";
+static int pcb_act_Export(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ if (argc < 1) {
+ pcb_message(PCB_MSG_ERROR, "Export() needs at least one argument, the name of the export plugin\n");
+ return 1;
+ }
+
+ pcb_exporter = pcb_hid_find_exporter(argv[0]);
+ if (pcb_exporter == NULL) {
+ pcb_message(PCB_MSG_ERROR, "Export plugin %s not found. Was it enabled in ./configure?\n", argv[0]);
+ return 1;
+ }
+
+ /* remove the name of the exporter */
+ argc--;
+ argv++;
+
+ /* call the exporter */
+ pcb_exporter->parse_arguments(&argc, (char ***)&argv);
+ pcb_exporter->do_export(NULL);
+
+ pcb_exporter = NULL;
+ return 0;
+}
+
+
+
+pcb_hid_action_t file_action_list[] = {
+ {"ExecCommand", 0, pcb_act_ExecCommand,
+ pcb_acth_ExecCommand, pcb_acts_ExecCommand}
+ ,
+ {"Export", 0, pcb_act_Export,
+ pcb_acth_Export, pcb_acts_Export}
,
- {"LoadFrom", 0, ActionLoadFrom,
- loadfrom_help, loadfrom_syntax}
+ {"LoadFrom", 0, pcb_act_LoadFrom,
+ pcb_acth_LoadFrom, pcb_acts_LoadFrom}
,
- {"New", 0, ActionNew,
- new_help, new_syntax}
+ {"New", 0, pcb_act_New,
+ pcb_acth_New, pcb_acts_New}
,
- {"SaveTo", 0, ActionSaveTo,
- saveto_help, saveto_syntax}
+ {"SaveTo", 0, pcb_act_SaveTo,
+ pcb_acth_SaveTo, pcb_acts_SaveTo}
,
- {"Quit", 0, ActionQuit,
- quit_help, quit_syntax}
+ {"Quit", 0, pcb_act_Quit,
+ pcb_acth_Quit, pcb_acts_Quit}
};
-REGISTER_ACTIONS(file_action_list, NULL)
+PCB_REGISTER_ACTIONS(file_action_list, NULL)
diff --git a/src/find.c b/src/find.c
index 304e7fa..9fcaf3e 100644
--- a/src/find.c
+++ b/src/find.c
@@ -55,20 +55,19 @@
#include <stdlib.h>
#include <string.h>
-#include <math.h>
#include <setjmp.h>
#include <assert.h>
+#include "const.h"
+#include "math_helper.h"
#include "conf_core.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "find.h"
-#include "misc.h"
#include "rtree.h"
#include "polygon.h"
#include "search.h"
-#include "set.h"
#include "undo.h"
#include "rats.h"
#include "plug_io.h"
@@ -76,6 +75,10 @@
#include "misc_util.h"
#include "compat_misc.h"
#include "layer.h"
+#include "event.h"
+#include "layer_vis.h"
+
+#include "obj_all.h"
#undef DEBUG
@@ -93,22 +96,22 @@
}
#define PADLIST_ENTRY(L,I) \
- (((PadTypePtr *)PadList[(L)].Data)[(I)])
+ (((pcb_pad_t **)PadList[(L)].Data)[(I)])
#define LINELIST_ENTRY(L,I) \
- (((LineTypePtr *)LineList[(L)].Data)[(I)])
+ (((pcb_line_t **)LineList[(L)].Data)[(I)])
#define ARCLIST_ENTRY(L,I) \
- (((ArcTypePtr *)ArcList[(L)].Data)[(I)])
+ (((pcb_arc_t **)ArcList[(L)].Data)[(I)])
#define RATLIST_ENTRY(I) \
- (((RatTypePtr *)RatList.Data)[(I)])
+ (((pcb_rat_t **)RatList.Data)[(I)])
#define POLYGONLIST_ENTRY(L,I) \
- (((PolygonTypePtr *)PolygonList[(L)].Data)[(I)])
+ (((pcb_polygon_t **)PolygonList[(L)].Data)[(I)])
#define PVLIST_ENTRY(I) \
- (((PinTypePtr *)PVList.Data)[(I)])
+ (((pcb_pin_t **)PVList.Data)[(I)])
/* ---------------------------------------------------------------------------
* some local types
@@ -126,16 +129,16 @@ typedef struct {
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord Bloat = 0;
+static pcb_coord_t Bloat = 0;
static int TheFlag = PCB_FLAG_FOUND;
static int OldFlag = PCB_FLAG_FOUND;
static void *thing_ptr1, *thing_ptr2, *thing_ptr3;
static int thing_type;
-find_callback_t find_callback = NULL;
+pcb_find_callback_t pcb_find_callback = NULL;
#define make_callback(current_type, current_ptr, from_type, from_ptr, type) \
do { \
- if (find_callback != NULL) \
- find_callback(current_type, current_ptr, from_type, from_ptr, type); \
+ if (pcb_find_callback != NULL) \
+ pcb_find_callback(current_type, current_ptr, from_type, from_ptr, type); \
} while(0)
static pcb_bool User = pcb_false; /* user action causing this */
@@ -143,8 +146,8 @@ static pcb_bool drc = pcb_false; /* whether to stop if finding something not
static pcb_bool IsBad = pcb_false;
static pcb_cardinal_t drcerr_count; /* count of drc errors */
static pcb_cardinal_t TotalP, TotalV, NumberOfPads[2];
-static ListType LineList[MAX_LAYER], /* list of objects to */
- PolygonList[MAX_LAYER], ArcList[MAX_LAYER], PadList[2], RatList, PVList;
+static ListType LineList[PCB_MAX_LAYER], /* list of objects to */
+ PolygonList[PCB_MAX_LAYER], ArcList[PCB_MAX_LAYER], PadList[2], RatList, PVList;
/* ---------------------------------------------------------------------------
* some local prototypes
@@ -153,19 +156,19 @@ static pcb_bool LookupLOConnectionsToPVList(pcb_bool);
static pcb_bool LookupLOConnectionsToLOList(pcb_bool);
static pcb_bool LookupPVConnectionsToLOList(pcb_bool);
static pcb_bool LookupPVConnectionsToPVList(void);
-static pcb_bool LookupLOConnectionsToLine(LineTypePtr, pcb_cardinal_t, pcb_bool);
-static pcb_bool LookupLOConnectionsToPad(PadTypePtr, pcb_cardinal_t);
-static pcb_bool LookupLOConnectionsToPolygon(PolygonTypePtr, pcb_cardinal_t);
-static pcb_bool LookupLOConnectionsToArc(ArcTypePtr, pcb_cardinal_t);
-static pcb_bool LookupLOConnectionsToRatEnd(PointTypePtr, pcb_cardinal_t);
-static pcb_bool IsRatPointOnLineEnd(PointTypePtr, LineTypePtr);
-static pcb_bool ArcArcIntersect(ArcTypePtr, ArcTypePtr);
-static pcb_bool PrintElementConnections(ElementTypePtr, FILE *, pcb_bool);
+static pcb_bool LookupLOConnectionsToLine(pcb_line_t *, pcb_cardinal_t, pcb_bool);
+static pcb_bool LookupLOConnectionsToPad(pcb_pad_t *, pcb_cardinal_t);
+static pcb_bool LookupLOConnectionsToPolygon(pcb_polygon_t *, pcb_cardinal_t);
+static pcb_bool LookupLOConnectionsToArc(pcb_arc_t *, pcb_cardinal_t);
+static pcb_bool LookupLOConnectionsToRatEnd(pcb_point_t *, pcb_cardinal_t);
+static pcb_bool IsRatPointOnLineEnd(pcb_point_t *, pcb_line_t *);
+static pcb_bool ArcArcIntersect(pcb_arc_t *, pcb_arc_t *);
+static pcb_bool PrintElementConnections(pcb_element_t *, FILE *, pcb_bool);
static pcb_bool ListsEmpty(pcb_bool);
static pcb_bool DoIt(pcb_bool, pcb_bool);
-static void PrintElementNameList(ElementTypePtr, FILE *);
-static void PrintConnectionElementName(ElementTypePtr, FILE *);
-static void PrintConnectionListEntry(char *, ElementTypePtr, pcb_bool, FILE *);
+static void PrintElementNameList(pcb_element_t *, FILE *);
+static void PrintConnectionElementName(pcb_element_t *, FILE *);
+static void PrintConnectionListEntry(char *, pcb_element_t *, pcb_bool, FILE *);
static void PrintPadConnections(pcb_cardinal_t, FILE *, pcb_bool);
static void PrintPinConnections(FILE *, pcb_bool);
static void DumpList(void);
diff --git a/src/find.h b/src/find.h
index ef09670..a1c57c6 100644
--- a/src/find.h
+++ b/src/find.h
@@ -30,67 +30,67 @@
#define PCB_FIND_H
#include <stdio.h> /* needed to define 'FILE *' */
-#include "global.h"
+#include "config.h"
typedef enum {
- FCT_COPPER = 1, /* copper connection */
- FCT_INTERNAL = 2, /* element-internal connection */
- FCT_RAT = 4, /* connected by a rat line */
- FCT_ELEMENT = 8, /* pin/pad is part of an element whose pins/pads are being listed */
- FCT_START = 16 /* starting object of a query */
-} found_conn_type_t;
+ PCB_FCT_COPPER = 1, /* copper connection */
+ PCB_FCT_INTERNAL = 2, /* element-internal connection */
+ PCB_FCT_RAT = 4, /* connected by a rat line */
+ PCB_FCT_ELEMENT = 8, /* pin/pad is part of an element whose pins/pads are being listed */
+ PCB_FCT_START = 16 /* starting object of a query */
+} pcb_found_conn_type_t;
-typedef void (*find_callback_t) (int current_type, void *current_ptr, int from_type, void *from_ptr,
- found_conn_type_t conn_type);
+typedef void (*pcb_find_callback_t)(int current_type, void *current_ptr, int from_type, void *from_ptr,
+ pcb_found_conn_type_t conn_type);
/* if not NULL, this function is called whenever something is found
(in LookupConnections for example). The caller should save the original
value and set that back around the call, if the callback needs to be changed.
*/
-extern find_callback_t find_callback;
+extern pcb_find_callback_t pcb_find_callback;
/* ---------------------------------------------------------------------------
* some local defines
*/
-#define LOOKUP_FIRST \
+#define PCB_LOOKUP_FIRST \
(PCB_TYPE_PIN | PCB_TYPE_PAD)
-#define LOOKUP_MORE \
+#define PCB_LOOKUP_MORE \
(PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_RATLINE | PCB_TYPE_POLYGON | PCB_TYPE_ARC)
-#define SILK_TYPE \
+#define PCB_SILK_TYPE \
(PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_POLYGON)
-pcb_bool LineLineIntersect(LineTypePtr, LineTypePtr);
-pcb_bool LineArcIntersect(LineTypePtr, ArcTypePtr);
-pcb_bool PinLineIntersect(PinTypePtr, LineTypePtr);
-pcb_bool LinePadIntersect(LineTypePtr, PadTypePtr);
-pcb_bool ArcPadIntersect(ArcTypePtr, PadTypePtr);
-pcb_bool IsPolygonInPolygon(PolygonTypePtr, PolygonTypePtr);
-void LookupElementConnections(ElementTypePtr, FILE *);
-void LookupConnectionsToAllElements(FILE *);
-void LookupConnection(Coord, Coord, pcb_bool, Coord, int);
-void LookupConnectionByPin(int type, void *ptr1);
-void LookupUnusedPins(FILE *);
-pcb_bool ResetFoundLinesAndPolygons(pcb_bool);
-pcb_bool ResetFoundPinsViasAndPads(pcb_bool);
-pcb_bool ResetConnections(pcb_bool);
-void InitConnectionLookup(void);
-void InitComponentLookup(void);
-void InitLayoutLookup(void);
-void FreeConnectionLookupMemory(void);
-void FreeComponentLookupMemory(void);
-void FreeLayoutLookupMemory(void);
-void RatFindHook(int, void *, void *, void *, pcb_bool, pcb_bool);
-void SaveFindFlag(int);
-void RestoreFindFlag(void);
-int DRCAll(void);
-pcb_bool IsLineInPolygon(LineTypePtr, PolygonTypePtr);
-pcb_bool IsArcInPolygon(ArcTypePtr, PolygonTypePtr);
-pcb_bool IsPadInPolygon(PadTypePtr, PolygonTypePtr);
+pcb_bool pcb_intersect_line_line(pcb_line_t *, pcb_line_t *);
+pcb_bool pcb_intersect_line_arc(pcb_line_t *, pcb_arc_t *);
+pcb_bool pcb_intersect_line_pin(pcb_pin_t *, pcb_line_t *);
+pcb_bool pcb_intersect_line_pad(pcb_line_t *, pcb_pad_t *);
+pcb_bool pcb_intersect_arc_pad(pcb_arc_t *, pcb_pad_t *);
+pcb_bool pcb_is_poly_in_poly(pcb_polygon_t *, pcb_polygon_t *);
+void pcb_lookup_element_conns(pcb_element_t *, FILE *);
+void pcb_lookup_conns_to_all_elements(FILE *);
+void pcb_lookup_conn(pcb_coord_t, pcb_coord_t, pcb_bool, pcb_coord_t, int);
+void pcb_lookup_conn_by_pin(int type, void *ptr1);
+void pcb_lookup_unused_pins(FILE *);
+pcb_bool pcb_reset_found_lines_polys(pcb_bool);
+pcb_bool pcb_reset_found_pins_vias_pads(pcb_bool);
+pcb_bool pcb_reset_conns(pcb_bool);
+void pcb_conn_lookup_init(void);
+void pcb_component_lookup_init(void);
+void pcb_layout_lookup_init(void);
+void pcb_conn_lookup_uninit(void);
+void pcb_component_lookup_uninit(void);
+void pcb_layout_lookup_uninit(void);
+void pcb_rat_find_hook(int, void *, void *, void *, pcb_bool, pcb_bool);
+void pcb_save_find_flag(int);
+void pcb_restore_find_flag(void);
+int pcb_drc_all(void);
+pcb_bool pcb_is_line_in_poly(pcb_line_t *, pcb_polygon_t *);
+pcb_bool pcb_is_arc_in_poly(pcb_arc_t *, pcb_polygon_t *);
+pcb_bool pcb_is_pad_in_poly(pcb_pad_t *, pcb_polygon_t *);
/* find_clear.c */
-pcb_bool ClearFlagOnPinsViasAndPads(pcb_bool AndDraw, int flag);
-pcb_bool ClearFlagOnLinesAndPolygons(pcb_bool AndDraw, int flag);
-pcb_bool ClearFlagOnAllObjects(pcb_bool AndDraw, int flag);
+pcb_bool pcb_clear_flag_on_pins_vias_pads(pcb_bool AndDraw, int flag);
+pcb_bool pcb_clear_flag_on_lines_polys(pcb_bool AndDraw, int flag);
+pcb_bool pcb_clear_flag_on_all_objs(pcb_bool AndDraw, int flag);
#endif
diff --git a/src/find_act.c b/src/find_act.c
index d753960..7fd3df6 100644
--- a/src/find_act.c
+++ b/src/find_act.c
@@ -25,10 +25,12 @@
*
*/
#include "config.h"
+#include "board.h"
#include "conf_core.h"
#include "data.h"
#include "error.h"
#include "find.h"
+#include "compat_nls.h"
/* -------------------------------------------------------------------------- */
@@ -43,31 +45,31 @@ not the current style settings.
%end-doc */
-static int ActionDRCheck(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DRCheck(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int count;
- if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) {
- Message(PCB_MSG_DEFAULT, _("%m+Rules are minspace %$mS, minoverlap %$mS "
+ if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_overview) {
+ pcb_message(PCB_MSG_INFO, _("%m+Rules are minspace %$mS, minoverlap %$mS "
"minwidth %$mS, minsilk %$mS\n"
"min drill %$mS, min annular ring %$mS\n"),
conf_core.editor.grid_unit->allow, PCB->Bloat, PCB->Shrink, PCB->minWid, PCB->minSlk, PCB->minDrill, PCB->minRing);
}
- count = DRCAll();
- if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) {
+ count = pcb_drc_all();
+ if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_overview) {
if (count == 0)
- Message(PCB_MSG_DEFAULT, _("No DRC problems found.\n"));
+ pcb_message(PCB_MSG_INFO, _("No DRC problems found.\n"));
else if (count > 0)
- Message(PCB_MSG_DEFAULT, _("Found %d design rule errors.\n"), count);
+ pcb_message(PCB_MSG_INFO, _("Found %d design rule errors.\n"), count);
else
- Message(PCB_MSG_DEFAULT, _("Aborted DRC after %d design rule errors.\n"), -count);
+ pcb_message(PCB_MSG_INFO, _("Aborted DRC after %d design rule errors.\n"), -count);
}
return 0;
}
-HID_Action find_action_list[] = {
- {"DRC", 0, ActionDRCheck,
+pcb_hid_action_t find_action_list[] = {
+ {"DRC", 0, pcb_act_DRCheck,
drc_help, drc_syntax}
};
-REGISTER_ACTIONS(find_action_list, NULL)
+PCB_REGISTER_ACTIONS(find_action_list, NULL)
diff --git a/src/find_clear.c b/src/find_clear.c
index 6068605..36cf982 100644
--- a/src/find_clear.c
+++ b/src/find_clear.c
@@ -25,124 +25,125 @@
/*!
* \brief Resets all used flags of pins and vias.
*/
-pcb_bool ClearFlagOnPinsViasAndPads(pcb_bool AndDraw, int flag)
+
+pcb_bool pcb_clear_flag_on_pins_vias_pads(pcb_bool AndDraw, int flag)
{
pcb_bool change = pcb_false;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, via)) {
+ if (PCB_FLAG_TEST(flag, via)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- CLEAR_FLAG(flag, via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_CLEAR(flag, via);
if (AndDraw)
DrawVia(via);
change = pcb_true;
}
}
- END_LOOP;
- ELEMENT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(flag, pin)) {
+ if (PCB_FLAG_TEST(flag, pin)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- CLEAR_FLAG(flag, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_CLEAR(flag, pin);
if (AndDraw)
DrawPin(pin);
change = pcb_true;
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(flag, pad)) {
+ if (PCB_FLAG_TEST(flag, pad)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- CLEAR_FLAG(flag, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_CLEAR(flag, pad);
if (AndDraw)
DrawPad(pad);
change = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
if (change)
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
return change;
}
/*!
* \brief Resets all used flags of LOs.
*/
-pcb_bool ClearFlagOnLinesAndPolygons(pcb_bool AndDraw, int flag)
+pcb_bool pcb_clear_flag_on_lines_polys(pcb_bool AndDraw, int flag)
{
pcb_bool change = pcb_false;
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, line)) {
+ if (PCB_FLAG_TEST(flag, line)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line);
- CLEAR_FLAG(flag, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_CLEAR(flag, line);
if (AndDraw)
DrawRat(line);
change = pcb_true;
}
}
- END_LOOP;
- COPPERLINE_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_LINE_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, line)) {
+ if (PCB_FLAG_TEST(flag, line)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line);
- CLEAR_FLAG(flag, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, layer, line, line);
+ PCB_FLAG_CLEAR(flag, line);
if (AndDraw)
DrawLine(layer, line);
change = pcb_true;
}
}
- ENDALL_LOOP;
- COPPERARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, arc)) {
+ if (PCB_FLAG_TEST(flag, arc)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc);
- CLEAR_FLAG(flag, arc);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, layer, arc, arc);
+ PCB_FLAG_CLEAR(flag, arc);
if (AndDraw)
DrawArc(layer, arc);
change = pcb_true;
}
}
- ENDALL_LOOP;
- COPPERPOLYGON_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, polygon)) {
+ if (PCB_FLAG_TEST(flag, polygon)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon);
- CLEAR_FLAG(flag, polygon);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, layer, polygon, polygon);
+ PCB_FLAG_CLEAR(flag, polygon);
if (AndDraw)
DrawPolygon(layer, polygon);
change = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (change)
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
return change;
}
/*!
* \brief Resets all found connections.
*/
-pcb_bool ClearFlagOnAllObjects(pcb_bool AndDraw, int flag)
+pcb_bool pcb_clear_flag_on_all_objs(pcb_bool AndDraw, int flag)
{
pcb_bool change = pcb_false;
- change = ClearFlagOnPinsViasAndPads(AndDraw, flag) || change;
- change = ClearFlagOnLinesAndPolygons(AndDraw, flag) || change;
+ change = pcb_clear_flag_on_pins_vias_pads(AndDraw, flag) || change;
+ change = pcb_clear_flag_on_lines_polys(AndDraw, flag) || change;
return change;
}
diff --git a/src/find_deadcode.c b/src/find_deadcode.c
index b7d033a..f10b476 100644
--- a/src/find_deadcode.c
+++ b/src/find_deadcode.c
@@ -29,58 +29,58 @@
#error do not compile this
-static int LOT_Linecallback(const BoxType * b, void *cl)
+static int LOT_Linecallback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, line) && LineLineIntersect(&i->line, line))
+ if (!PCB_FLAG_TEST(TheFlag, line) && pcb_intersect_line_line(&i->line, line))
longjmp(i->env, 1);
return 0;
}
-static int LOT_Arccallback(const BoxType * b, void *cl)
+static int LOT_Arccallback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct lo_info *i = (struct lo_info *) cl;
if (!arc->Thickness)
return 0;
- if (!TEST_FLAG(TheFlag, arc) && LineArcIntersect(&i->line, arc))
+ if (!PCB_FLAG_TEST(TheFlag, arc) && pcb_intersect_line_arc(&i->line, arc))
longjmp(i->env, 1);
return 0;
}
-static int LOT_Padcallback(const BoxType * b, void *cl)
+static int LOT_Padcallback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER)
- && LinePadIntersect(&i->line, pad))
+ if (!PCB_FLAG_TEST(TheFlag, pad) && i->layer == (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)
+ && pcb_intersect_line_pad(&i->line, pad))
longjmp(i->env, 1);
return 0;
}
-static pcb_bool PVTouchesLine(LineTypePtr line)
+static pcb_bool PVTouchesLine(pcb_line_t *line)
{
struct lo_info info;
info.line = *line;
EXPAND_BOUNDS(&info.line);
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, (BoxType *) & info.line, NULL, pv_touch_callback, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, (pcb_box_t *) & info.line, NULL, pv_touch_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, (BoxType *) & info.line, NULL, pv_touch_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, (pcb_box_t *) & info.line, NULL, pv_touch_callback, &info, NULL);
else
return pcb_true;
return (pcb_false);
}
-static pcb_bool LOTouchesLine(LineTypePtr Line, pcb_cardinal_t LayerGroup)
+static pcb_bool LOTouchesLine(pcb_line_t *Line, pcb_cardinal_t LayerGroup)
{
pcb_cardinal_t entry;
struct lo_info info;
@@ -96,33 +96,33 @@ static pcb_bool LOTouchesLine(LineTypePtr Line, pcb_cardinal_t LayerGroup)
pcb_cardinal_t layer = PCB->LayerGroups.Entries[LayerGroup][entry];
/* handle normal layers */
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
gdl_iterator_t it;
- PolygonType *polygon;
+ pcb_polygon_t *polygon;
/* find the first line that touches coordinates */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->line_tree, (BoxType *) & info.line, NULL, LOT_Linecallback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->line_tree, (pcb_box_t *) & info.line, NULL, LOT_Linecallback, &info, NULL);
else
return (pcb_true);
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->arc_tree, (BoxType *) & info.line, NULL, LOT_Arccallback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->arc_tree, (pcb_box_t *) & info.line, NULL, LOT_Arccallback, &info, NULL);
else
return (pcb_true);
/* now check all polygons */
polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) {
- if (!TEST_FLAG(TheFlag, polygon)
- && IsLineInPolygon(Line, polygon))
+ if (!PCB_FLAG_TEST(TheFlag, polygon)
+ && pcb_is_line_in_poly(Line, polygon))
return (pcb_true);
}
}
else {
/* handle special 'pad' layers */
- info.layer = layer - max_copper_layer;
+ info.layer = layer - pcb_max_copper_layer;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pad_tree, &info.line.BoundingBox, NULL, LOT_Padcallback, &info, NULL);
+ pcb_r_search(PCB->Data->pad_tree, &info.line.BoundingBox, NULL, LOT_Padcallback, &info, NULL);
else
return pcb_true;
}
@@ -135,7 +135,7 @@ static pcb_bool LOTouchesLine(LineTypePtr Line, pcb_cardinal_t LayerGroup)
* doesn't include rat-lines in the search
*/
-pcb_bool lineClear(LineTypePtr line, pcb_cardinal_t group)
+pcb_bool lineClear(pcb_line_t *line, pcb_cardinal_t group)
{
if (LOTouchesLine(line, group))
return (pcb_false);
diff --git a/src/find_debug.c b/src/find_debug.c
index b3ead5d..ad7e73c 100644
--- a/src/find_debug.c
+++ b/src/find_debug.c
@@ -30,14 +30,14 @@
/* ---------------------------------------------------------------------------
* writes the several names of an element to a file
*/
-static void PrintElementNameList(ElementTypePtr Element, FILE * FP)
+static void PrintElementNameList(pcb_element_t *Element, FILE * FP)
{
fputc('(', FP);
- PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(Element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(Element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(Element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_REFDES(Element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(Element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_VALUE(Element)));
fputc(')', FP);
fputc('\n', FP);
}
@@ -45,7 +45,7 @@ static void PrintElementNameList(ElementTypePtr Element, FILE * FP)
/* ---------------------------------------------------------------------------
* writes the several names of an element to a file
*/
-static void PrintConnectionElementName(ElementTypePtr Element, FILE * FP)
+static void PrintConnectionElementName(pcb_element_t *Element, FILE * FP)
{
fputs("Element", FP);
PrintElementNameList(Element, FP);
@@ -55,16 +55,16 @@ static void PrintConnectionElementName(ElementTypePtr Element, FILE * FP)
/* ---------------------------------------------------------------------------
* prints one {pin,pad,via}/element entry of connection lists
*/
-static void PrintConnectionListEntry(char *ObjName, ElementTypePtr Element, pcb_bool FirstOne, FILE * FP)
+static void PrintConnectionListEntry(char *ObjName, pcb_element_t *Element, pcb_bool FirstOne, FILE * FP)
{
if (FirstOne) {
fputc('\t', FP);
- PrintQuotedString(FP, ObjName);
+ pcb_print_quoted_string(FP, ObjName);
fprintf(FP, "\n\t{\n");
}
else {
fprintf(FP, "\t\t");
- PrintQuotedString(FP, ObjName);
+ pcb_print_quoted_string(FP, ObjName);
fputc(' ', FP);
if (Element)
PrintElementNameList(Element, FP);
@@ -80,7 +80,7 @@ static void PrintConnectionListEntry(char *ObjName, ElementTypePtr Element, pcb_
static void PrintPadConnections(pcb_cardinal_t Layer, FILE * FP, pcb_bool IsFirst)
{
pcb_cardinal_t i;
- PadTypePtr ptr;
+ pcb_pad_t *ptr;
if (!PadList[Layer].Number)
return;
@@ -89,7 +89,7 @@ static void PrintPadConnections(pcb_cardinal_t Layer, FILE * FP, pcb_bool IsFirs
if (IsFirst) {
ptr = PADLIST_ENTRY(Layer, 0);
if (ptr != NULL)
- PrintConnectionListEntry((char *) UNKNOWN(ptr->Name), NULL, pcb_true, FP);
+ PrintConnectionListEntry((char *) PCB_UNKNOWN(ptr->Name), NULL, pcb_true, FP);
else
printf("Skipping NULL ptr in 1st part of PrintPadConnections\n");
}
@@ -100,7 +100,7 @@ static void PrintPadConnections(pcb_cardinal_t Layer, FILE * FP, pcb_bool IsFirs
for (i = IsFirst ? 1 : 0; i < PadList[Layer].Number; i++) {
ptr = PADLIST_ENTRY(Layer, i);
if (ptr != NULL)
- PrintConnectionListEntry((char *) EMPTY(ptr->Name), (ElementTypePtr) ptr->Element, pcb_false, FP);
+ PrintConnectionListEntry((char *) PCB_EMPTY(ptr->Name), (pcb_element_t *) ptr->Element, pcb_false, FP);
else
printf("Skipping NULL ptr in 2nd part of PrintPadConnections\n");
}
@@ -113,7 +113,7 @@ static void PrintPadConnections(pcb_cardinal_t Layer, FILE * FP, pcb_bool IsFirs
static void PrintPinConnections(FILE * FP, pcb_bool IsFirst)
{
pcb_cardinal_t i;
- PinTypePtr pv;
+ pcb_pin_t *pv;
if (!PVList.Number)
return;
@@ -121,7 +121,7 @@ static void PrintPinConnections(FILE * FP, pcb_bool IsFirst)
if (IsFirst) {
/* the starting pin */
pv = PVLIST_ENTRY(0);
- PrintConnectionListEntry((char *) EMPTY(pv->Name), NULL, pcb_true, FP);
+ PrintConnectionListEntry((char *) PCB_EMPTY(pv->Name), NULL, pcb_true, FP);
}
/* we maybe have to start with i=1 if we are handling the
@@ -130,6 +130,6 @@ static void PrintPinConnections(FILE * FP, pcb_bool IsFirst)
for (i = IsFirst ? 1 : 0; i < PVList.Number; i++) {
/* get the elements name or assume that its a via */
pv = PVLIST_ENTRY(i);
- PrintConnectionListEntry((char *) EMPTY(pv->Name), (ElementTypePtr) pv->Element, pcb_false, FP);
+ PrintConnectionListEntry((char *) PCB_EMPTY(pv->Name), (pcb_element_t *) pv->Element, pcb_false, FP);
}
}
diff --git a/src/find_drc.c b/src/find_drc.c
index 7bc0ed7..875f3e4 100644
--- a/src/find_drc.c
+++ b/src/find_drc.c
@@ -25,21 +25,32 @@
*
*/
+#include "drc.h"
+#include "compat_nls.h"
+
+#include "obj_arc_draw.h"
+#include "obj_pad_draw.h"
+#include "obj_rat_draw.h"
+#include "obj_line_draw.h"
+#include "obj_elem_draw.h"
+#include "obj_poly_draw.h"
+#include "obj_pinvia_draw.h"
+
/* DRC related functions */
static void GotoError(void);
static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3);
-static DrcViolationType
+static pcb_drc_violation_t
* pcb_drc_violation_new(const char *title,
const char *explanation,
- Coord x, Coord y,
- Angle angle,
+ pcb_coord_t x, pcb_coord_t y,
+ pcb_angle_t angle,
pcb_bool have_measured,
- Coord measured_value,
- Coord required_value, int object_count, long int *object_id_list, int *object_type_list)
+ pcb_coord_t measured_value,
+ pcb_coord_t required_value, int object_count, long int *object_id_list, int *object_type_list)
{
- DrcViolationType *violation = (DrcViolationType *) malloc(sizeof(DrcViolationType));
+ pcb_drc_violation_t *violation = (pcb_drc_violation_t *) malloc(sizeof(pcb_drc_violation_t));
violation->title = pcb_strdup(title);
violation->explanation = pcb_strdup(explanation);
@@ -56,7 +67,7 @@ static DrcViolationType
return violation;
}
-static void pcb_drc_violation_free(DrcViolationType * violation)
+static void pcb_drc_violation_free(pcb_drc_violation_t * violation)
{
free(violation->title);
free(violation->explanation);
@@ -67,8 +78,8 @@ static gds_t drc_dialog_message;
static void reset_drc_dialog_message(void)
{
gds_truncate(&drc_dialog_message, 0);
- if (gui->drc_gui != NULL)
- gui->drc_gui->reset_drc_dialog_message();
+ if (pcb_gui->drc_gui != NULL)
+ pcb_gui->drc_gui->reset_drc_dialog_message();
}
static void append_drc_dialog_message(const char *fmt, ...)
@@ -102,7 +113,7 @@ static void BuildObjectList(int *object_count, long int **object_id_list, int **
*object_count = 1;
*object_id_list = (long int *) malloc(sizeof(long int));
*object_type_list = (int *) malloc(sizeof(int));
- **object_id_list = ((AnyObjectType *) thing_ptr3)->ID;
+ **object_id_list = ((pcb_any_obj_t *) thing_ptr3)->ID;
**object_type_list = thing_type;
return;
@@ -114,28 +125,28 @@ static void BuildObjectList(int *object_count, long int **object_id_list, int **
/*----------------------------------------------------------------------------
- * Locate the coordinatates of offending item (thing)
+ * Locate the coordinates of offending item (thing)
*/
-static void LocateError(Coord * x, Coord * y)
+static void LocateError(pcb_coord_t * x, pcb_coord_t * y)
{
switch (thing_type) {
case PCB_TYPE_LINE:
{
- LineTypePtr line = (LineTypePtr) thing_ptr3;
+ pcb_line_t *line = (pcb_line_t *) thing_ptr3;
*x = (line->Point1.X + line->Point2.X) / 2;
*y = (line->Point1.Y + line->Point2.Y) / 2;
break;
}
case PCB_TYPE_ARC:
{
- ArcTypePtr arc = (ArcTypePtr) thing_ptr3;
+ pcb_arc_t *arc = (pcb_arc_t *) thing_ptr3;
*x = arc->X;
*y = arc->Y;
break;
}
case PCB_TYPE_POLYGON:
{
- PolygonTypePtr polygon = (PolygonTypePtr) thing_ptr3;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) thing_ptr3;
*x = (polygon->Clipped->contours->xmin + polygon->Clipped->contours->xmax) / 2;
*y = (polygon->Clipped->contours->ymin + polygon->Clipped->contours->ymax) / 2;
break;
@@ -143,21 +154,21 @@ static void LocateError(Coord * x, Coord * y)
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
{
- PinTypePtr pin = (PinTypePtr) thing_ptr3;
+ pcb_pin_t *pin = (pcb_pin_t *) thing_ptr3;
*x = pin->X;
*y = pin->Y;
break;
}
case PCB_TYPE_PAD:
{
- PadTypePtr pad = (PadTypePtr) thing_ptr3;
+ pcb_pad_t *pad = (pcb_pad_t *) thing_ptr3;
*x = (pad->Point1.X + pad->Point2.X) / 2;
*y = (pad->Point1.Y + pad->Point2.Y) / 2;
break;
}
case PCB_TYPE_ELEMENT:
{
- ElementTypePtr element = (ElementTypePtr) thing_ptr3;
+ pcb_element_t *element = (pcb_element_t *) thing_ptr3;
*x = element->MarkX;
*y = element->MarkY;
break;
@@ -168,10 +179,10 @@ static void LocateError(Coord * x, Coord * y)
}
-static void append_drc_violation(DrcViolationType * violation)
+static void append_drc_violation(pcb_drc_violation_t * violation)
{
- if (gui->drc_gui != NULL) {
- gui->drc_gui->append_drc_violation(violation);
+ if (pcb_gui->drc_gui != NULL) {
+ pcb_gui->drc_gui->append_drc_violation(violation);
}
else {
/* Fallback to formatting the violation message as text */
@@ -180,9 +191,9 @@ static void append_drc_violation(DrcViolationType * violation)
GotoError();
}
- if (gui->drc_gui == NULL || gui->drc_gui->log_drc_violations) {
- Message(PCB_MSG_DEFAULT, _("WARNING! Design Rule error - %s\n"), violation->title);
- Message(PCB_MSG_DEFAULT, _("%m+near location %$mD\n"), conf_core.editor.grid_unit->allow, violation->x, violation->y);
+ if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_violations) {
+ pcb_message(PCB_MSG_WARNING, _("WARNING! Design Rule error - %s\n"), violation->title);
+ pcb_message(PCB_MSG_WARNING, _("%m+near location %$mD\n"), conf_core.editor.grid_unit->allow, violation->x, violation->y);
}
}
@@ -199,32 +210,32 @@ static int throw_drc_dialog(void)
{
int r;
- if (gui->drc_gui != NULL) {
- r = gui->drc_gui->throw_drc_dialog();
+ if (pcb_gui->drc_gui != NULL) {
+ r = pcb_gui->drc_gui->throw_drc_dialog();
}
else {
/* Fallback to formatting the violation message as text */
append_drc_dialog_message(DRC_CONTINUE);
- r = gui->confirm_dialog(drc_dialog_message.array, DRC_CANCEL, DRC_NEXT);
+ r = pcb_gui->confirm_dialog(drc_dialog_message.array, DRC_CANCEL, DRC_NEXT);
reset_drc_dialog_message();
}
return r;
}
/* DRC clearance callback */
-static r_dir_t drc_callback(DataTypePtr data, LayerTypePtr layer, PolygonTypePtr polygon, int type, void *ptr1, void *ptr2)
+static pcb_r_dir_t drc_callback(pcb_data_t *data, pcb_layer_t *layer, pcb_polygon_t *polygon, int type, void *ptr1, void *ptr2)
{
const char *message;
- Coord x, y;
+ pcb_coord_t x, y;
int object_count;
long int *object_id_list;
int *object_type_list;
- DrcViolationType *violation;
+ pcb_drc_violation_t *violation;
- LineTypePtr line = (LineTypePtr) ptr2;
- ArcTypePtr arc = (ArcTypePtr) ptr2;
- PinTypePtr pin = (PinTypePtr) ptr2;
- PadTypePtr pad = (PadTypePtr) ptr2;
+ pcb_line_t *line = (pcb_line_t *) ptr2;
+ pcb_arc_t *arc = (pcb_arc_t *) ptr2;
+ pcb_pin_t *pin = (pcb_pin_t *) ptr2;
+ pcb_pad_t *pad = (pcb_pad_t *) ptr2;
thing_type = type;
thing_ptr1 = ptr1;
@@ -233,60 +244,60 @@ static r_dir_t drc_callback(DataTypePtr data, LayerTypePtr layer, PolygonTypePtr
switch (type) {
case PCB_TYPE_LINE:
if (line->Clearance < 2 * PCB->Bloat) {
- AddObjectToFlagUndoList(type, ptr1, ptr2, ptr2);
- SET_FLAG(TheFlag, line);
+ pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr2);
+ PCB_FLAG_SET(TheFlag, line);
message = _("Line with insufficient clearance inside polygon\n");
goto doIsBad;
}
break;
case PCB_TYPE_ARC:
if (arc->Clearance < 2 * PCB->Bloat) {
- AddObjectToFlagUndoList(type, ptr1, ptr2, ptr2);
- SET_FLAG(TheFlag, arc);
+ pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr2);
+ PCB_FLAG_SET(TheFlag, arc);
message = _("Arc with insufficient clearance inside polygon\n");
goto doIsBad;
}
break;
case PCB_TYPE_PAD:
if (pad->Clearance && pad->Clearance < 2 * PCB->Bloat)
- if (IsPadInPolygon(pad, polygon)) {
- AddObjectToFlagUndoList(type, ptr1, ptr2, ptr2);
- SET_FLAG(TheFlag, pad);
+ if (pcb_is_pad_in_poly(pad, polygon)) {
+ pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr2);
+ PCB_FLAG_SET(TheFlag, pad);
message = _("Pad with insufficient clearance inside polygon\n");
goto doIsBad;
}
break;
case PCB_TYPE_PIN:
if (pin->Clearance && pin->Clearance < 2 * PCB->Bloat) {
- AddObjectToFlagUndoList(type, ptr1, ptr2, ptr2);
- SET_FLAG(TheFlag, pin);
+ pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr2);
+ PCB_FLAG_SET(TheFlag, pin);
message = _("Pin with insufficient clearance inside polygon\n");
goto doIsBad;
}
break;
case PCB_TYPE_VIA:
if (pin->Clearance && pin->Clearance < 2 * PCB->Bloat) {
- AddObjectToFlagUndoList(type, ptr1, ptr2, ptr2);
- SET_FLAG(TheFlag, pin);
+ pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr2);
+ PCB_FLAG_SET(TheFlag, pin);
message = _("Via with insufficient clearance inside polygon\n");
goto doIsBad;
}
break;
default:
- Message(PCB_MSG_DEFAULT, "hace: Bad Plow object in callback\n");
+ pcb_message(PCB_MSG_ERROR, "hace: Bad Plow object in callback\n");
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
doIsBad:
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon);
- SET_FLAG(PCB_FLAG_FOUND, polygon);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, layer, polygon, polygon);
+ PCB_FLAG_SET(PCB_FLAG_FOUND, polygon);
DrawPolygon(layer, polygon);
- DrawObject(type, ptr1, ptr2);
+ pcb_draw_obj(type, ptr1, ptr2);
drcerr_count++;
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(message, _("Circuits that are too close may bridge during imaging, etching,\n" "plating, or soldering processes resulting in a direct short."), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- FALSE, /* MEASUREMENT OF ERROR UNKNOWN */
+ pcb_false, /* MEASUREMENT OF ERROR UNKNOWN */
0, /* MAGNITUDE OF ERROR UNKNOWN */
PCB->Bloat, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
@@ -295,11 +306,11 @@ doIsBad:
free(object_type_list);
if (!throw_drc_dialog()) {
IsBad = pcb_true;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
- IncrementUndoSerialNumber();
- Undo(pcb_true);
- return R_DIR_NOT_FOUND;
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_true);
+ return PCB_R_DIR_NOT_FOUND;
}
@@ -308,13 +319,13 @@ doIsBad:
* Check for DRC violations
* see if the connectivity changes when everything is bloated, or shrunk
*/
-int DRCAll(void)
+int pcb_drc_all(void)
{
- Coord x, y;
+ pcb_coord_t x, y;
int object_count;
long int *object_id_list;
int *object_type_list;
- DrcViolationType *violation;
+ pcb_drc_violation_t *violation;
int tmpcnt;
int nopastecnt = 0;
@@ -322,83 +333,83 @@ int DRCAll(void)
IsBad = pcb_false;
drcerr_count = 0;
- SaveStackAndVisibility();
- ResetStackAndVisibility();
- hid_action("LayersChanged");
- InitConnectionLookup();
+ pcb_layervis_save_stack();
+ pcb_layervis_reset_stack();
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ pcb_conn_lookup_init();
TheFlag = PCB_FLAG_FOUND | PCB_FLAG_DRC | PCB_FLAG_SELECTED;
- if (ResetConnections(pcb_true)) {
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_reset_conns(pcb_true)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
}
User = pcb_false;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (!TEST_FLAG(PCB_FLAG_DRC, pin)
+ if (!PCB_FLAG_TEST(PCB_FLAG_DRC, pin)
&& DRCFind(PCB_TYPE_PIN, (void *) element, (void *) pin, (void *) pin)) {
IsBad = pcb_true;
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (IsBad)
break;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
/* count up how many pads have no solderpaste openings */
- if (TEST_FLAG(PCB_FLAG_NOPASTE, pad))
+ if (PCB_FLAG_TEST(PCB_FLAG_NOPASTE, pad))
nopastecnt++;
- if (!TEST_FLAG(PCB_FLAG_DRC, pad)
+ if (!PCB_FLAG_TEST(PCB_FLAG_DRC, pad)
&& DRCFind(PCB_TYPE_PAD, (void *) element, (void *) pad, (void *) pad)) {
IsBad = pcb_true;
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (IsBad)
break;
}
- END_LOOP;
+ PCB_END_LOOP;
if (!IsBad)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_DRC, via)
+ if (!PCB_FLAG_TEST(PCB_FLAG_DRC, via)
&& DRCFind(PCB_TYPE_VIA, (void *) via, (void *) via, (void *) via)) {
IsBad = pcb_true;
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
TheFlag = (IsBad) ? PCB_FLAG_DRC : (PCB_FLAG_FOUND | PCB_FLAG_DRC | PCB_FLAG_SELECTED);
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
TheFlag = PCB_FLAG_SELECTED;
/* check minimum widths and polygon clearances */
if (!IsBad) {
- COPPERLINE_LOOP(PCB->Data);
+ PCB_LINE_COPPER_LOOP(PCB->Data);
{
/* check line clearances in polygons */
- PlowsPolygon(PCB->Data, PCB_TYPE_LINE, layer, line, drc_callback);
+ pcb_poly_plows(PCB->Data, PCB_TYPE_LINE, layer, line, drc_callback);
if (IsBad)
break;
if (line->Thickness < PCB->minWid) {
- AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line);
- SET_FLAG(TheFlag, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, layer, line, line);
+ PCB_FLAG_SET(TheFlag, line);
DrawLine(layer, line);
drcerr_count++;
SetThing(PCB_TYPE_LINE, layer, line, line);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Line width is too thin"), _("Process specifications dictate a minimum feature-width\n" "that can reliably be reproduced"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
line->Thickness, PCB->minWid, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
pcb_drc_violation_free(violation);
@@ -408,28 +419,28 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (!IsBad) {
- COPPERARC_LOOP(PCB->Data);
+ PCB_ARC_COPPER_LOOP(PCB->Data);
{
- PlowsPolygon(PCB->Data, PCB_TYPE_ARC, layer, arc, drc_callback);
+ pcb_poly_plows(PCB->Data, PCB_TYPE_ARC, layer, arc, drc_callback);
if (IsBad)
break;
if (arc->Thickness < PCB->minWid) {
- AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc);
- SET_FLAG(TheFlag, arc);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, layer, arc, arc);
+ PCB_FLAG_SET(TheFlag, arc);
DrawArc(layer, arc);
drcerr_count++;
SetThing(PCB_TYPE_ARC, layer, arc, arc);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Arc width is too thin"), _("Process specifications dictate a minimum feature-width\n" "that can reliably be reproduced"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
arc->Thickness, PCB->minWid, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
pcb_drc_violation_free(violation);
@@ -439,28 +450,28 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (!IsBad) {
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- PlowsPolygon(PCB->Data, PCB_TYPE_PIN, element, pin, drc_callback);
+ pcb_poly_plows(PCB->Data, PCB_TYPE_PIN, element, pin, drc_callback);
if (IsBad)
break;
- if (!TEST_FLAG(PCB_FLAG_HOLE, pin) && pin->Thickness - pin->DrillingHole < 2 * PCB->minRing) {
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- SET_FLAG(TheFlag, pin);
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) && pin->Thickness - pin->DrillingHole < 2 * PCB->minRing) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_SET(TheFlag, pin);
DrawPin(pin);
drcerr_count++;
SetThing(PCB_TYPE_PIN, element, pin, pin);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Pin annular ring too small"), _("Annular rings that are too small may erode during etching,\n" "resulting in a broken connection"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
(pin->Thickness - pin->DrillingHole) / 2,
PCB->minRing, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
@@ -471,19 +482,19 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
if (pin->DrillingHole < PCB->minDrill) {
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- SET_FLAG(TheFlag, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_SET(TheFlag, pin);
DrawPin(pin);
drcerr_count++;
SetThing(PCB_TYPE_PIN, element, pin, pin);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Pin drill size is too small"), _("Process rules dictate the minimum drill size which can be used"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
pin->DrillingHole, PCB->minDrill, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
pcb_drc_violation_free(violation);
@@ -493,28 +504,28 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (!IsBad) {
- ALLPAD_LOOP(PCB->Data);
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- PlowsPolygon(PCB->Data, PCB_TYPE_PAD, element, pad, drc_callback);
+ pcb_poly_plows(PCB->Data, PCB_TYPE_PAD, element, pad, drc_callback);
if (IsBad)
break;
if (pad->Thickness < PCB->minWid) {
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- SET_FLAG(TheFlag, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_SET(TheFlag, pad);
DrawPad(pad);
drcerr_count++;
SetThing(PCB_TYPE_PAD, element, pad, pad);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Pad is too thin"), _("Pads which are too thin may erode during etching,\n" "resulting in a broken or unreliable connection"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
pad->Thickness, PCB->minWid, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
pcb_drc_violation_free(violation);
@@ -524,28 +535,28 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (!IsBad) {
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- PlowsPolygon(PCB->Data, PCB_TYPE_VIA, via, via, drc_callback);
+ pcb_poly_plows(PCB->Data, PCB_TYPE_VIA, via, via, drc_callback);
if (IsBad)
break;
- if (!TEST_FLAG(PCB_FLAG_HOLE, via) && via->Thickness - via->DrillingHole < 2 * PCB->minRing) {
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- SET_FLAG(TheFlag, via);
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, via) && via->Thickness - via->DrillingHole < 2 * PCB->minRing) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_SET(TheFlag, via);
DrawVia(via);
drcerr_count++;
SetThing(PCB_TYPE_VIA, via, via, via);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Via annular ring too small"), _("Annular rings that are too small may erode during etching,\n" "resulting in a broken connection"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
(via->Thickness - via->DrillingHole) / 2,
PCB->minRing, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
@@ -556,19 +567,19 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
if (via->DrillingHole < PCB->minDrill) {
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- SET_FLAG(TheFlag, via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_SET(TheFlag, via);
DrawVia(via);
drcerr_count++;
SetThing(PCB_TYPE_VIA, via, via, via);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Via drill size is too small"), _("Process rules dictate the minimum drill size which can be used"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
via->DrillingHole, PCB->minDrill, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
pcb_drc_violation_free(violation);
@@ -578,14 +589,14 @@ int DRCAll(void)
IsBad = pcb_true;
break;
}
- IncrementUndoSerialNumber();
- Undo(pcb_false);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_false);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- FreeConnectionLookupMemory();
+ pcb_conn_lookup_uninit();
TheFlag = PCB_FLAG_FOUND;
Bloat = 0;
@@ -593,17 +604,17 @@ int DRCAll(void)
/* XXX - need to check text and polygons too! */
TheFlag = PCB_FLAG_SELECTED;
if (!IsBad) {
- SILKLINE_LOOP(PCB->Data);
+ PCB_LINE_SILK_LOOP(PCB->Data);
{
if (line->Thickness < PCB->minSlk) {
- SET_FLAG(TheFlag, line);
+ PCB_FLAG_SET(TheFlag, line);
DrawLine(layer, line);
drcerr_count++;
SetThing(PCB_TYPE_LINE, layer, line, line);
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Silk line is too thin"), _("Process specifications dictate a minimum silkscreen feature-width\n" "that can reliably be reproduced"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
line->Thickness, PCB->minSlk, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
pcb_drc_violation_free(violation);
@@ -615,29 +626,29 @@ int DRCAll(void)
}
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
/* check silkscreen minimum widths inside of elements */
/* XXX - need to check text and polygons too! */
TheFlag = PCB_FLAG_SELECTED;
if (!IsBad) {
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
tmpcnt = 0;
- ELEMENTLINE_LOOP(element);
+ PCB_ELEMENT_PCB_LINE_LOOP(element);
{
if (line->Thickness < PCB->minSlk)
tmpcnt++;
}
- END_LOOP;
+ PCB_END_LOOP;
if (tmpcnt > 0) {
const char *title;
const char *name;
char *buffer;
int buflen;
- SET_FLAG(TheFlag, element);
+ PCB_FLAG_SET(TheFlag, element);
DrawElement(element);
drcerr_count++;
SetThing(PCB_TYPE_ELEMENT, element, element, element);
@@ -645,7 +656,7 @@ int DRCAll(void)
BuildObjectList(&object_count, &object_id_list, &object_type_list);
title = _("Element %s has %i silk lines which are too thin");
- name = UNKNOWN(NAMEONPCB_NAME(element));
+ name = PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element));
/* -4 is for the %s and %i place-holders */
/* +11 is the max printed length for a 32 bit integer */
@@ -655,7 +666,7 @@ int DRCAll(void)
pcb_snprintf(buffer, buflen, title, name, tmpcnt);
violation = pcb_drc_violation_new(buffer, _("Process specifications dictate a minimum silkscreen\n" "feature-width that can reliably be reproduced"), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- TRUE, /* MEASUREMENT OF ERROR KNOWN */
+ pcb_true, /* MEASUREMENT OF ERROR KNOWN */
0, /* MINIMUM OFFENDING WIDTH UNKNOWN */
PCB->minSlk, object_count, object_id_list, object_type_list);
free(buffer);
@@ -669,21 +680,21 @@ int DRCAll(void)
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (IsBad) {
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
}
- RestoreStackAndVisibility();
- hid_action("LayersChanged");
- gui->invalidate_all();
+ pcb_layervis_restore_stack();
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ pcb_gui->invalidate_all();
if (nopastecnt > 0) {
- Message(PCB_MSG_DEFAULT, _("Warning: %d pad%s the nopaste flag set.\n"), nopastecnt, nopastecnt > 1 ? "s have" : " has");
+ pcb_message(PCB_MSG_WARNING, _("Warning: %d pad%s the nopaste flag set.\n"), nopastecnt, nopastecnt > 1 ? "s have" : " has");
}
return IsBad ? -drcerr_count : drcerr_count;
}
@@ -696,11 +707,11 @@ int DRCAll(void)
*/
static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
{
- Coord x, y;
+ pcb_coord_t x, y;
int object_count;
long int *object_id_list;
int *object_type_list;
- DrcViolationType *violation;
+ pcb_drc_violation_t *violation;
if (PCB->Shrink != 0) {
Bloat = -PCB->Shrink;
@@ -717,7 +728,7 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
DumpList();
/* make the flag changes undoable */
TheFlag = PCB_FLAG_FOUND | PCB_FLAG_SELECTED;
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
User = pcb_true;
drc = pcb_false;
Bloat = -PCB->Shrink;
@@ -737,7 +748,7 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Potential for broken trace"), _("Insufficient overlap between objects can lead to broken tracks\n" "due to registration errors with old wheel style photo-plotters."), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- FALSE, /* MEASUREMENT OF ERROR UNKNOWN */
+ pcb_false, /* MEASUREMENT OF ERROR UNKNOWN */
0, /* MAGNITUDE OF ERROR UNKNOWN */
PCB->Shrink, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
@@ -747,14 +758,14 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
if (!throw_drc_dialog())
return (pcb_true);
- IncrementUndoSerialNumber();
- Undo(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_true);
}
DumpList();
}
/* now check the bloated condition */
drc = pcb_false;
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
TheFlag = PCB_FLAG_FOUND;
ListStart(What, ptr1, ptr2, ptr3);
Bloat = PCB->Bloat;
@@ -763,7 +774,7 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
DumpList();
/* make the flag changes undoable */
TheFlag = PCB_FLAG_FOUND | PCB_FLAG_SELECTED;
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
User = pcb_true;
drc = pcb_false;
Bloat = 0;
@@ -781,7 +792,7 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
LocateError(&x, &y);
BuildObjectList(&object_count, &object_id_list, &object_type_list);
violation = pcb_drc_violation_new(_("Copper areas too close"), _("Circuits that are too close may bridge during imaging, etching,\n" "plating, or soldering processes resulting in a direct short."), x, y, 0, /* ANGLE OF ERROR UNKNOWN */
- FALSE, /* MEASUREMENT OF ERROR UNKNOWN */
+ pcb_false, /* MEASUREMENT OF ERROR UNKNOWN */
0, /* MAGNITUDE OF ERROR UNKNOWN */
PCB->Bloat, object_count, object_id_list, object_type_list);
append_drc_violation(violation);
@@ -792,8 +803,8 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
drc = pcb_false;
if (!throw_drc_dialog())
return (pcb_true);
- IncrementUndoSerialNumber();
- Undo(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_undo(pcb_true);
/* highlight the rest of the encroaching net so it's not reported again */
TheFlag |= PCB_FLAG_SELECTED;
Bloat = 0;
@@ -807,7 +818,7 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
drc = pcb_false;
DumpList();
TheFlag = PCB_FLAG_FOUND | PCB_FLAG_SELECTED;
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
return (pcb_false);
}
@@ -816,7 +827,7 @@ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3)
*/
static void GotoError(void)
{
- Coord X, Y;
+ pcb_coord_t X, Y;
LocateError(&X, &Y);
@@ -824,7 +835,7 @@ static void GotoError(void)
case PCB_TYPE_LINE:
case PCB_TYPE_ARC:
case PCB_TYPE_POLYGON:
- ChangeGroupVisibility(GetLayerNumber(PCB->Data, (LayerTypePtr) thing_ptr1), pcb_true, pcb_true);
+ pcb_layervis_change_group_vis(pcb_layer_id(PCB->Data, (pcb_layer_t *) thing_ptr1), pcb_true, pcb_true);
}
- CenterDisplay(X, Y);
+ pcb_center_display(X, Y);
}
diff --git a/src/find_geo.c b/src/find_geo.c
index fab96dd..041c85e 100644
--- a/src/find_geo.c
+++ b/src/find_geo.c
@@ -37,9 +37,11 @@
* to X,Y
*
* Intersection of line <--> line:
- * - see the description of 'LineLineIntersect()'
+ * - see the description of 'pcb_intersect_line_line()'
*/
+#include "macro.h"
+
#define EXPAND_BOUNDS(p) if (Bloat > 0) {\
(p)->BoundingBox.X1 -= Bloat; \
(p)->BoundingBox.X2 += Bloat; \
@@ -47,21 +49,21 @@
(p)->BoundingBox.Y2 += Bloat;}
#define IS_PV_ON_RAT(PV, Rat) \
- (IsPointOnLineEnd((PV)->X,(PV)->Y, (Rat)))
+ (pcb_is_point_on_line_end((PV)->X,(PV)->Y, (Rat)))
#define IS_PV_ON_ARC(PV, Arc) \
- (TEST_FLAG(PCB_FLAG_SQUARE, (PV)) ? \
- IsArcInRectangle( \
+ (PCB_FLAG_TEST(PCB_FLAG_SQUARE, (PV)) ? \
+ pcb_is_arc_in_rectangle( \
(PV)->X -MAX(((PV)->Thickness+1)/2 +Bloat,0), (PV)->Y -MAX(((PV)->Thickness+1)/2 +Bloat,0), \
(PV)->X +MAX(((PV)->Thickness+1)/2 +Bloat,0), (PV)->Y +MAX(((PV)->Thickness+1)/2 +Bloat,0), \
(Arc)) : \
- IsPointOnArc((PV)->X,(PV)->Y,MAX((PV)->Thickness/2.0 + Bloat,0.0), (Arc)))
+ pcb_is_point_on_arc((PV)->X,(PV)->Y,MAX((PV)->Thickness/2.0 + Bloat,0.0), (Arc)))
#define IS_PV_ON_PAD(PV,Pad) \
- ( IsPointInPad((PV)->X, (PV)->Y, MAX((PV)->Thickness/2 +Bloat,0), (Pad)))
+ ( pcb_is_point_in_pad((PV)->X, (PV)->Y, MAX((PV)->Thickness/2 +Bloat,0), (Pad)))
/* reduce arc start angle and delta to 0..360 */
-static void normalize_angles(Angle * sa, Angle * d)
+static void normalize_angles(pcb_angle_t * sa, pcb_angle_t * d)
{
if (*d < 0) {
*sa += *d;
@@ -69,13 +71,13 @@ static void normalize_angles(Angle * sa, Angle * d)
}
if (*d > 360) /* full circle */
*d = 360;
- *sa = NormalizeAngle(*sa);
+ *sa = pcb_normalize_angle(*sa);
}
-static int radius_crosses_arc(double x, double y, ArcTypePtr arc)
+static int radius_crosses_arc(double x, double y, pcb_arc_t *arc)
{
double alpha = atan2(y - arc->Y, -x + arc->X) * PCB_RAD_TO_DEG;
- Angle sa = arc->StartAngle, d = arc->Delta;
+ pcb_angle_t sa = arc->StartAngle, d = arc->Delta;
normalize_angles(&sa, &d);
if (alpha < 0)
@@ -85,7 +87,7 @@ static int radius_crosses_arc(double x, double y, ArcTypePtr arc)
return (sa + d - 360) >= alpha;
}
-static void get_arc_ends(Coord * box, ArcTypePtr arc)
+static void get_arc_ends(pcb_coord_t * box, pcb_arc_t *arc)
{
box[0] = arc->X - arc->Width * cos(PCB_M180 * arc->StartAngle);
box[1] = arc->Y + arc->Height * sin(PCB_M180 * arc->StartAngle);
@@ -118,11 +120,11 @@ static void get_arc_ends(Coord * box, ArcTypePtr arc)
*
*
*/
-static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
+static pcb_bool ArcArcIntersect(pcb_arc_t *Arc1, pcb_arc_t *Arc2)
{
double x, y, dx, dy, r1, r2, a, d, l, t, t1, t2, dl;
- Coord pdx, pdy;
- Coord box[8];
+ pcb_coord_t pdx, pdy;
+ pcb_coord_t box[8];
t = 0.5 * Arc1->Thickness + Bloat;
t2 = 0.5 * Arc2->Thickness;
@@ -135,21 +137,21 @@ static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
/* try the end points first */
get_arc_ends(&box[0], Arc1);
get_arc_ends(&box[4], Arc2);
- if (IsPointOnArc(box[0], box[1], t, Arc2)
- || IsPointOnArc(box[2], box[3], t, Arc2)
- || IsPointOnArc(box[4], box[5], t, Arc1)
- || IsPointOnArc(box[6], box[7], t, Arc1))
+ if (pcb_is_point_on_arc(box[0], box[1], t, Arc2)
+ || pcb_is_point_on_arc(box[2], box[3], t, Arc2)
+ || pcb_is_point_on_arc(box[4], box[5], t, Arc1)
+ || pcb_is_point_on_arc(box[6], box[7], t, Arc1))
return pcb_true;
pdx = Arc2->X - Arc1->X;
pdy = Arc2->Y - Arc1->Y;
- dl = Distance(Arc1->X, Arc1->Y, Arc2->X, Arc2->Y);
+ dl = pcb_distance(Arc1->X, Arc1->Y, Arc2->X, Arc2->Y);
/* concentric arcs, simpler intersection conditions */
if (dl < 0.5) {
if ((Arc1->Width - t >= Arc2->Width - t2 && Arc1->Width - t <= Arc2->Width + t2)
|| (Arc1->Width + t >= Arc2->Width - t2 && Arc1->Width + t <= Arc2->Width + t2)) {
- Angle sa1 = Arc1->StartAngle, d1 = Arc1->Delta;
- Angle sa2 = Arc2->StartAngle, d2 = Arc2->Delta;
+ pcb_angle_t sa1 = Arc1->StartAngle, d1 = Arc1->Delta;
+ pcb_angle_t sa2 = Arc2->StartAngle, d2 = Arc2->Delta;
/* NB the endpoints have already been checked,
so we just compare the angles */
@@ -178,7 +180,7 @@ static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
}
if (radius_crosses_arc(Arc1->X + dx, Arc1->Y + dy, Arc1)
- && IsPointOnArc(Arc1->X + dx, Arc1->Y + dy, t, Arc2))
+ && pcb_is_point_on_arc(Arc1->X + dx, Arc1->Y + dy, t, Arc2))
return pcb_true;
dx = -pdx * r2 / dl;
@@ -189,7 +191,7 @@ static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
}
if (radius_crosses_arc(Arc2->X + dx, Arc2->Y + dy, Arc2)
- && IsPointOnArc(Arc2->X + dx, Arc2->Y + dy, t1, Arc1))
+ && pcb_is_point_on_arc(Arc2->X + dx, Arc2->Y + dy, t1, Arc1))
return pcb_true;
return pcb_false;
}
@@ -211,17 +213,17 @@ static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
dx = d * pdx;
dy = d * pdy;
if (radius_crosses_arc(x + dy, y - dx, Arc1)
- && IsPointOnArc(x + dy, y - dx, t, Arc2))
+ && pcb_is_point_on_arc(x + dy, y - dx, t, Arc2))
return pcb_true;
if (radius_crosses_arc(x + dy, y - dx, Arc2)
- && IsPointOnArc(x + dy, y - dx, t1, Arc1))
+ && pcb_is_point_on_arc(x + dy, y - dx, t1, Arc1))
return pcb_true;
if (radius_crosses_arc(x - dy, y + dx, Arc1)
- && IsPointOnArc(x - dy, y + dx, t, Arc2))
+ && pcb_is_point_on_arc(x - dy, y + dx, t, Arc2))
return pcb_true;
if (radius_crosses_arc(x - dy, y + dx, Arc2)
- && IsPointOnArc(x - dy, y + dx, t1, Arc1))
+ && pcb_is_point_on_arc(x - dy, y + dx, t1, Arc1))
return pcb_true;
return pcb_false;
}
@@ -229,7 +231,7 @@ static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
/* ---------------------------------------------------------------------------
* Tests if point is same as line end point
*/
-static pcb_bool IsRatPointOnLineEnd(PointTypePtr Point, LineTypePtr Line)
+static pcb_bool IsRatPointOnLineEnd(pcb_point_t *Point, pcb_line_t *Line)
{
if ((Point->X == Line->Point1.X && Point->Y == Line->Point1.Y)
|| (Point->X == Line->Point2.X && Point->Y == Line->Point2.Y))
@@ -237,7 +239,7 @@ static pcb_bool IsRatPointOnLineEnd(PointTypePtr Point, LineTypePtr Line)
return (pcb_false);
}
-static void form_slanted_rectangle(PointType p[4], LineTypePtr l)
+static void form_slanted_rectangle(pcb_point_t p[4], pcb_line_t *l)
/* writes vertices of a squared line */
{
double dwx = 0, dwy = 0;
@@ -246,9 +248,9 @@ static void form_slanted_rectangle(PointType p[4], LineTypePtr l)
else if (l->Point1.X == l->Point2.X)
dwy = l->Thickness / 2.0;
else {
- Coord dX = l->Point2.X - l->Point1.X;
- Coord dY = l->Point2.Y - l->Point1.Y;
- double r = Distance(l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y);
+ pcb_coord_t dX = l->Point2.X - l->Point1.X;
+ pcb_coord_t dY = l->Point2.Y - l->Point1.Y;
+ double r = pcb_distance(l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y);
dwx = l->Thickness / 2.0 / r * dX;
dwy = l->Thickness / 2.0 / r * dY;
}
@@ -317,21 +319,21 @@ static void form_slanted_rectangle(PointType p[4], LineTypePtr l)
* Also note that the denominators of eqn 1 & 2 are identical.
*
*/
-pcb_bool LineLineIntersect(LineTypePtr Line1, LineTypePtr Line2)
+pcb_bool pcb_intersect_line_line(pcb_line_t *Line1, pcb_line_t *Line2)
{
double s, r;
double line1_dx, line1_dy, line2_dx, line2_dy, point1_dx, point1_dy;
- if (TEST_FLAG(PCB_FLAG_SQUARE, Line1)) { /* pretty reckless recursion */
- PointType p[4];
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Line1)) { /* pretty reckless recursion */
+ pcb_point_t p[4];
form_slanted_rectangle(p, Line1);
- return IsLineInQuadrangle(p, Line2);
+ return pcb_is_line_in_quadrangle(p, Line2);
}
- /* here come only round Line1 because IsLineInQuadrangle()
- calls LineLineIntersect() with first argument rounded */
- if (TEST_FLAG(PCB_FLAG_SQUARE, Line2)) {
- PointType p[4];
+ /* here come only round Line1 because pcb_is_line_in_quadrangle()
+ calls pcb_intersect_line_line() with first argument rounded */
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Line2)) {
+ pcb_point_t p[4];
form_slanted_rectangle(p, Line2);
- return IsLineInQuadrangle(p, Line1);
+ return pcb_is_line_in_quadrangle(p, Line1);
}
/* now all lines are round */
@@ -339,10 +341,10 @@ pcb_bool LineLineIntersect(LineTypePtr Line1, LineTypePtr Line2)
* cases where the "real" lines don't intersect but the
* thick lines touch, and ensures that the dx/dy business
* below does not cause a divide-by-zero. */
- if (IsPointInPad(Line2->Point1.X, Line2->Point1.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (PadTypePtr) Line1)
- || IsPointInPad(Line2->Point2.X, Line2->Point2.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (PadTypePtr) Line1)
- || IsPointInPad(Line1->Point1.X, Line1->Point1.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (PadTypePtr) Line2)
- || IsPointInPad(Line1->Point2.X, Line1->Point2.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (PadTypePtr) Line2))
+ if (pcb_is_point_in_pad(Line2->Point1.X, Line2->Point1.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line1)
+ || pcb_is_point_in_pad(Line2->Point2.X, Line2->Point2.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line1)
+ || pcb_is_point_in_pad(Line1->Point1.X, Line1->Point1.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line2)
+ || pcb_is_point_in_pad(Line1->Point2.X, Line1->Point2.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (pcb_pad_t *) Line2))
return pcb_true;
/* setup some constants */
@@ -368,7 +370,7 @@ pcb_bool LineLineIntersect(LineTypePtr Line1, LineTypePtr Line2)
/* No cross product means parallel lines, or maybe Line2 is
* zero-length. In either case, since we did a bounding-box
- * check before getting here, the above IsPointInPad() checks
+ * check before getting here, the above pcb_is_point_in_pad() checks
* will have caught any intersections. */
if (r == 0.0)
return pcb_false;
@@ -390,7 +392,7 @@ pcb_bool LineLineIntersect(LineTypePtr Line1, LineTypePtr Line2)
* Check for line intersection with an arc
*
* Mostly this is like the circle/line intersection
- * found in IsPointOnLine (search.c) see the detailed
+ * found in pcb_is_point_on_line(search.c) see the detailed
* discussion for the basics there.
*
* Since this is only an arc, not a full circle we need
@@ -414,10 +416,10 @@ pcb_bool LineLineIntersect(LineTypePtr Line1, LineTypePtr Line2)
*
* The end points are hell so they are checked individually
*/
-pcb_bool LineArcIntersect(LineTypePtr Line, ArcTypePtr Arc)
+pcb_bool pcb_intersect_line_arc(pcb_line_t *Line, pcb_arc_t *Arc)
{
double dx, dy, dx1, dy1, l, d, r, r2, Radius;
- BoxTypePtr box;
+ pcb_coord_t ex, ey;
dx = Line->Point2.X - Line->Point1.X;
dy = Line->Point2.Y - Line->Point1.Y;
@@ -436,9 +438,9 @@ pcb_bool LineArcIntersect(LineTypePtr Line, ArcTypePtr Arc)
return (pcb_false);
/* check the ends of the line in case the projected point */
/* of intersection is beyond the line end */
- if (IsPointOnArc(Line->Point1.X, Line->Point1.Y, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
+ if (pcb_is_point_on_arc(Line->Point1.X, Line->Point1.Y, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
return (pcb_true);
- if (IsPointOnArc(Line->Point2.X, Line->Point2.Y, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
+ if (pcb_is_point_on_arc(Line->Point2.X, Line->Point2.Y, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
return (pcb_true);
if (l == 0.0)
return (pcb_false);
@@ -446,17 +448,20 @@ pcb_bool LineArcIntersect(LineTypePtr Line, ArcTypePtr Arc)
Radius = -(dx * dx1 + dy * dy1);
r = (Radius + r2) / l;
if (r >= 0 && r <= 1
- && IsPointOnArc(Line->Point1.X + r * dx, Line->Point1.Y + r * dy, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
+ && pcb_is_point_on_arc(Line->Point1.X + r * dx, Line->Point1.Y + r * dy, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
return (pcb_true);
r = (Radius - r2) / l;
if (r >= 0 && r <= 1
- && IsPointOnArc(Line->Point1.X + r * dx, Line->Point1.Y + r * dy, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
+ && pcb_is_point_on_arc(Line->Point1.X + r * dx, Line->Point1.Y + r * dy, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
return (pcb_true);
+
/* check arc end points */
- box = GetArcEnds(Arc);
- if (IsPointInPad(box->X1, box->Y1, Arc->Thickness * 0.5 + Bloat, (PadTypePtr) Line))
+ pcb_arc_get_end(Arc, 0, &ex, &ey);
+ if (pcb_is_point_in_pad(ex, ey, Arc->Thickness * 0.5 + Bloat, (pcb_pad_t *) Line))
return pcb_true;
- if (IsPointInPad(box->X2, box->Y2, Arc->Thickness * 0.5 + Bloat, (PadTypePtr) Line))
+
+ pcb_arc_get_end(Arc, 1, &ex, &ey);
+ if (pcb_is_point_in_pad(ex, ey, Arc->Thickness * 0.5 + Bloat, (pcb_pad_t *) Line))
return pcb_true;
return pcb_false;
}
@@ -469,23 +474,23 @@ pcb_bool LineArcIntersect(LineTypePtr Line, ArcTypePtr Arc)
* - check the two end points of the arc. If none of them matches
* - check all segments of the polygon against the arc.
*/
-pcb_bool IsArcInPolygon(ArcTypePtr Arc, PolygonTypePtr Polygon)
+pcb_bool pcb_is_arc_in_poly(pcb_arc_t *Arc, pcb_polygon_t *Polygon)
{
- BoxTypePtr Box = (BoxType *) Arc;
+ pcb_box_t *Box = (pcb_box_t *) Arc;
/* arcs with clearance never touch polys */
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Arc))
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, Polygon) && PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Arc))
return pcb_false;
if (!Polygon->Clipped)
return pcb_false;
if (Box->X1 <= Polygon->Clipped->contours->xmax + Bloat
&& Box->X2 >= Polygon->Clipped->contours->xmin - Bloat
&& Box->Y1 <= Polygon->Clipped->contours->ymax + Bloat && Box->Y2 >= Polygon->Clipped->contours->ymin - Bloat) {
- POLYAREA *ap;
+ pcb_polyarea_t *ap;
- if (!(ap = ArcPoly(Arc, Arc->Thickness + Bloat)))
+ if (!(ap = pcb_poly_from_arc(Arc, Arc->Thickness + Bloat)))
return pcb_false; /* error */
- return isects(ap, Polygon, pcb_true);
+ return pcb_poly_isects_poly(ap, Polygon, pcb_true);
}
return pcb_false;
}
@@ -498,32 +503,32 @@ pcb_bool IsArcInPolygon(ArcTypePtr Arc, PolygonTypePtr Polygon)
* - check the two end points of the line. If none of them matches
* - check all segments of the polygon against the line.
*/
-pcb_bool IsLineInPolygon(LineTypePtr Line, PolygonTypePtr Polygon)
+pcb_bool pcb_is_line_in_poly(pcb_line_t *Line, pcb_polygon_t *Polygon)
{
- BoxTypePtr Box = (BoxType *) Line;
- POLYAREA *lp;
+ pcb_box_t *Box = (pcb_box_t *) Line;
+ pcb_polyarea_t *lp;
/* lines with clearance never touch polygons */
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Line))
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, Polygon) && PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Line))
return pcb_false;
if (!Polygon->Clipped)
return pcb_false;
- if (TEST_FLAG(PCB_FLAG_SQUARE, Line) && (Line->Point1.X == Line->Point2.X || Line->Point1.Y == Line->Point2.Y)) {
- Coord wid = (Line->Thickness + Bloat + 1) / 2;
- Coord x1, x2, y1, y2;
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Line) && (Line->Point1.X == Line->Point2.X || Line->Point1.Y == Line->Point2.Y)) {
+ pcb_coord_t wid = (Line->Thickness + Bloat + 1) / 2;
+ pcb_coord_t x1, x2, y1, y2;
x1 = MIN(Line->Point1.X, Line->Point2.X) - wid;
y1 = MIN(Line->Point1.Y, Line->Point2.Y) - wid;
x2 = MAX(Line->Point1.X, Line->Point2.X) + wid;
y2 = MAX(Line->Point1.Y, Line->Point2.Y) + wid;
- return IsRectangleInPolygon(x1, y1, x2, y2, Polygon);
+ return pcb_poly_is_rect_in_p(x1, y1, x2, y2, Polygon);
}
if (Box->X1 <= Polygon->Clipped->contours->xmax + Bloat
&& Box->X2 >= Polygon->Clipped->contours->xmin - Bloat
&& Box->Y1 <= Polygon->Clipped->contours->ymax + Bloat && Box->Y2 >= Polygon->Clipped->contours->ymin - Bloat) {
- if (!(lp = LinePoly(Line, Line->Thickness + Bloat)))
- return FALSE; /* error */
- return isects(lp, Polygon, pcb_true);
+ if (!(lp = pcb_poly_from_line(Line, Line->Thickness + Bloat)))
+ return pcb_false; /* error */
+ return pcb_poly_isects_poly(lp, Polygon, pcb_true);
}
return pcb_false;
}
@@ -533,9 +538,9 @@ pcb_bool IsLineInPolygon(LineTypePtr Line, PolygonTypePtr Polygon)
*
* The polygon is assumed to already have been proven non-clearing
*/
-pcb_bool IsPadInPolygon(PadTypePtr pad, PolygonTypePtr polygon)
+pcb_bool pcb_is_pad_in_poly(pcb_pad_t *pad, pcb_polygon_t *polygon)
{
- return IsLineInPolygon((LineTypePtr) pad, polygon);
+ return pcb_is_line_in_poly((pcb_line_t *) pad, polygon);
}
/* ---------------------------------------------------------------------------
@@ -544,7 +549,7 @@ pcb_bool IsPadInPolygon(PadTypePtr pad, PolygonTypePtr polygon)
* First check all points out of P1 against P2 and vice versa.
* If both fail check all lines of P1 against the ones of P2
*/
-pcb_bool IsPolygonInPolygon(PolygonTypePtr P1, PolygonTypePtr P2)
+pcb_bool pcb_is_poly_in_poly(pcb_polygon_t *P1, pcb_polygon_t *P2)
{
if (!P1->Clipped || !P2->Clipped)
return pcb_false;
@@ -559,15 +564,15 @@ pcb_bool IsPolygonInPolygon(PolygonTypePtr P1, PolygonTypePtr P2)
return pcb_false;
/* first check un-bloated case */
- if (isects(P1->Clipped, P2, pcb_false))
- return TRUE;
+ if (pcb_poly_isects_poly(P1->Clipped, P2, pcb_false))
+ return pcb_true;
/* now the difficult case of bloated */
if (Bloat > 0) {
- PLINE *c;
+ pcb_pline_t *c;
for (c = P1->Clipped->contours; c; c = c->next) {
- LineType line;
- VNODE *v = &c->head;
+ pcb_line_t line;
+ pcb_vnode_t *v = &c->head;
if (c->xmin - Bloat <= P2->Clipped->contours->xmax &&
c->xmax + Bloat >= P2->Clipped->contours->xmin &&
c->ymin - Bloat <= P2->Clipped->contours->ymax && c->ymax + Bloat >= P2->Clipped->contours->ymin) {
@@ -576,12 +581,12 @@ pcb_bool IsPolygonInPolygon(PolygonTypePtr P1, PolygonTypePtr P2)
line.Point1.Y = v->point[1];
line.Thickness = 2 * Bloat;
line.Clearance = 0;
- line.Flags = NoFlags();
+ line.Flags = pcb_no_flags();
for (v = v->next; v != &c->head; v = v->next) {
line.Point2.X = v->point[0];
line.Point2.Y = v->point[1];
- SetLineBoundingBox(&line);
- if (IsLineInPolygon(&line, P2))
+ pcb_line_bbox(&line);
+ if (pcb_is_line_in_poly(&line, P2))
return (pcb_true);
line.Point1.X = line.Point2.X;
line.Point1.Y = line.Point2.Y;
@@ -597,17 +602,17 @@ pcb_bool IsPolygonInPolygon(PolygonTypePtr P1, PolygonTypePtr P2)
* some of the 'pad' routines are the same as for lines because the 'pad'
* struct starts with a line struct. See global.h for details
*/
-pcb_bool LinePadIntersect(LineTypePtr Line, PadTypePtr Pad)
+pcb_bool pcb_intersect_line_pad(pcb_line_t *Line, pcb_pad_t *Pad)
{
- return LineLineIntersect((Line), (LineTypePtr) Pad);
+ return pcb_intersect_line_line((Line), (pcb_line_t *) Pad);
}
-pcb_bool ArcPadIntersect(ArcTypePtr Arc, PadTypePtr Pad)
+pcb_bool pcb_intersect_arc_pad(pcb_arc_t *Arc, pcb_pad_t *Pad)
{
- return LineArcIntersect((LineTypePtr) (Pad), (Arc));
+ return pcb_intersect_line_arc((pcb_line_t *) (Pad), (Arc));
}
-pcb_bool BoxBoxIntersection(BoxTypePtr b1, BoxTypePtr b2)
+pcb_bool BoxBoxIntersection(pcb_box_t *b1, pcb_box_t *b2)
{
if (b2->X2 < b1->X1 || b2->X1 > b1->X2)
return pcb_false;
@@ -616,39 +621,39 @@ pcb_bool BoxBoxIntersection(BoxTypePtr b1, BoxTypePtr b2)
return pcb_true;
}
-static pcb_bool PadPadIntersect(PadTypePtr p1, PadTypePtr p2)
+static pcb_bool PadPadIntersect(pcb_pad_t *p1, pcb_pad_t *p2)
{
- return LinePadIntersect((LineTypePtr) p1, p2);
+ return pcb_intersect_line_pad((pcb_line_t *) p1, p2);
}
-static inline pcb_bool PV_TOUCH_PV(PinTypePtr PV1, PinTypePtr PV2)
+static inline pcb_bool PV_TOUCH_PV(pcb_pin_t *PV1, pcb_pin_t *PV2)
{
double t1, t2;
- BoxType b1, b2;
+ pcb_box_t b1, b2;
int shape1, shape2;
- shape1 = GET_SQUARE(PV1);
- shape2 = GET_SQUARE(PV2);
+ shape1 = PCB_FLAG_SQUARE_GET(PV1);
+ shape2 = PCB_FLAG_SQUARE_GET(PV2);
if ((shape1 > 1) || (shape2 > 1)) {
- POLYAREA *pl1, *pl2;
+ pcb_polyarea_t *pl1, *pl2;
int ret;
- pl1 = PinPoly(PV1, PIN_SIZE(PV1) + Bloat, 0);
- pl2 = PinPoly(PV2, PIN_SIZE(PV2) + Bloat, 0);
- ret = Touching(pl1, pl2);
- poly_Free(&pl1);
- poly_Free(&pl2);
+ pl1 = pcb_poly_from_pin(PV1, PIN_SIZE(PV1) + Bloat, 0);
+ pl2 = pcb_poly_from_pin(PV2, PIN_SIZE(PV2) + Bloat, 0);
+ ret = pcb_polyarea_touching(pl1, pl2);
+ pcb_polyarea_free(&pl1);
+ pcb_polyarea_free(&pl2);
return ret;
}
t1 = MAX(PV1->Thickness / 2.0 + Bloat, 0);
t2 = MAX(PV2->Thickness / 2.0 + Bloat, 0);
- if (IsPointOnPin(PV1->X, PV1->Y, t1, PV2)
- || IsPointOnPin(PV2->X, PV2->Y, t2, PV1))
+ if (pcb_is_point_in_pin(PV1->X, PV1->Y, t1, PV2)
+ || pcb_is_point_in_pin(PV2->X, PV2->Y, t2, PV1))
return pcb_true;
- if (!TEST_FLAG(PCB_FLAG_SQUARE, PV1) || !TEST_FLAG(PCB_FLAG_SQUARE, PV2))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SQUARE, PV1) || !PCB_FLAG_TEST(PCB_FLAG_SQUARE, PV2))
return pcb_false;
/* check for square/square overlap */
b1.X1 = PV1->X - t1;
@@ -663,28 +668,28 @@ static inline pcb_bool PV_TOUCH_PV(PinTypePtr PV1, PinTypePtr PV2)
return BoxBoxIntersection(&b1, &b2);
}
-pcb_bool PinLineIntersect(PinTypePtr PV, LineTypePtr Line)
+pcb_bool pcb_intersect_line_pin(pcb_pin_t *PV, pcb_line_t *Line)
{
- if (TEST_FLAG(PCB_FLAG_SQUARE, PV)) {
- int shape = GET_SQUARE(PV);
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, PV)) {
+ int shape = PCB_FLAG_SQUARE_GET(PV);
if (shape <= 1) {
/* the original square case */
/* IsLineInRectangle already has Bloat factor */
- return IsLineInRectangle(PV->X - (PIN_SIZE(PV) + 1) / 2,
+ return pcb_is_line_in_rectangle(PV->X - (PIN_SIZE(PV) + 1) / 2,
PV->Y - (PIN_SIZE(PV) + 1) / 2,
PV->X + (PIN_SIZE(PV) + 1) / 2, PV->Y + (PIN_SIZE(PV) + 1) / 2, Line);
}
{
/* shaped pin case */
- POLYAREA *pl, *lp;
+ pcb_polyarea_t *pl, *lp;
int ret;
- pl = PinPoly(PV, PIN_SIZE(PV), 0);
- lp = LinePoly(Line, Line->Thickness + Bloat);
- ret = Touching(lp, pl);
- poly_Free(&pl);
- poly_Free(&lp);
+ pl = pcb_poly_from_pin(PV, PIN_SIZE(PV), 0);
+ lp = pcb_poly_from_line(Line, Line->Thickness + Bloat);
+ ret = pcb_polyarea_touching(lp, pl);
+ pcb_polyarea_free(&pl);
+ pcb_polyarea_free(&lp);
return ret;
}
@@ -692,5 +697,5 @@ pcb_bool PinLineIntersect(PinTypePtr PV, LineTypePtr Line)
/* the original round pin version */
- return IsPointInPad(PV->X, PV->Y, MAX(PIN_SIZE(PV) / 2.0 + Bloat, 0.0), (PadTypePtr) Line);
+ return pcb_is_point_in_pad(PV->X, PV->Y, MAX(PIN_SIZE(PV) / 2.0 + Bloat, 0.0), (pcb_pad_t *) Line);
}
diff --git a/src/find_lookup.c b/src/find_lookup.c
index f8360b2..b2cad8c 100644
--- a/src/find_lookup.c
+++ b/src/find_lookup.c
@@ -25,30 +25,33 @@
*
*/
-static inline r_dir_t r_search_pt(rtree_t * rtree, const PointType * pt,
+#include "compat_nls.h"
+#include "board.h"
+
+static inline pcb_r_dir_t r_search_pt(pcb_rtree_t * rtree, const pcb_point_t * pt,
int radius,
- r_dir_t (*region_in_search) (const BoxType * region, void *cl),
- r_dir_t (*rectangle_in_region) (const BoxType * box, void *cl), void *closure,
+ pcb_r_dir_t (*region_in_search) (const pcb_box_t * region, void *cl),
+ pcb_r_dir_t (*rectangle_in_region) (const pcb_box_t * box, void *cl), void *closure,
int *num_found)
{
- BoxType box;
+ pcb_box_t box;
box.X1 = pt->X - radius;
box.X2 = pt->X + radius;
box.Y1 = pt->Y - radius;
box.Y2 = pt->Y + radius;
- return r_search(rtree, &box, region_in_search, rectangle_in_region, closure, num_found);
+ return pcb_r_search(rtree, &box, region_in_search, rectangle_in_region, closure, num_found);
}
/* Connection lookup functions */
-static pcb_bool ADD_PV_TO_LIST(PinTypePtr Pin, int from_type, void *from_ptr, found_conn_type_t type)
+static pcb_bool ADD_PV_TO_LIST(pcb_pin_t *Pin, int from_type, void *from_ptr, pcb_found_conn_type_t type)
{
if (User)
- AddObjectToFlagUndoList(Pin->Element ? PCB_TYPE_PIN : PCB_TYPE_VIA, Pin->Element ? Pin->Element : Pin, Pin, Pin);
- SET_FLAG(TheFlag, Pin);
+ pcb_undo_add_obj_to_flag(Pin->Element ? PCB_TYPE_PIN : PCB_TYPE_VIA, Pin->Element ? Pin->Element : Pin, Pin, Pin);
+ PCB_FLAG_SET(TheFlag, Pin);
make_callback(PCB_TYPE_PIN, Pin, from_type, from_ptr, type);
PVLIST_ENTRY(PVList.Number) = Pin;
PVList.Number++;
@@ -56,17 +59,17 @@ static pcb_bool ADD_PV_TO_LIST(PinTypePtr Pin, int from_type, void *from_ptr, fo
if (PVList.Number > PVList.Size)
printf("ADD_PV_TO_LIST overflow! num=%d size=%d\n", PVList.Number, PVList.Size);
#endif
- if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, Pin))
+ if (drc && !PCB_FLAG_TEST(PCB_FLAG_SELECTED, Pin))
return (SetThing(PCB_TYPE_PIN, Pin->Element, Pin, Pin));
return pcb_false;
}
-static pcb_bool ADD_PAD_TO_LIST(pcb_cardinal_t L, PadTypePtr Pad, int from_type, void *from_ptr, found_conn_type_t type)
+static pcb_bool ADD_PAD_TO_LIST(pcb_cardinal_t L, pcb_pad_t *Pad, int from_type, void *from_ptr, pcb_found_conn_type_t type)
{
/*fprintf(stderr, "ADD_PAD_TO_LIST cardinal %d %p %d\n", L, Pad, from_type);*/
if (User)
- AddObjectToFlagUndoList(PCB_TYPE_PAD, Pad->Element, Pad, Pad);
- SET_FLAG(TheFlag, Pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, Pad->Element, Pad, Pad);
+ PCB_FLAG_SET(TheFlag, Pad);
make_callback(PCB_TYPE_PAD, Pad, from_type, from_ptr, type);
PADLIST_ENTRY((L), PadList[(L)].Number) = Pad;
PadList[(L)].Number++;
@@ -74,16 +77,16 @@ static pcb_bool ADD_PAD_TO_LIST(pcb_cardinal_t L, PadTypePtr Pad, int from_type,
if (PadList[(L)].Number > PadList[(L)].Size)
printf("ADD_PAD_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, PadList[(L)].Number, PadList[(L)].Size);
#endif
- if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, Pad))
+ if (drc && !PCB_FLAG_TEST(PCB_FLAG_SELECTED, Pad))
return (SetThing(PCB_TYPE_PAD, Pad->Element, Pad, Pad));
return pcb_false;
}
-static pcb_bool ADD_LINE_TO_LIST(pcb_cardinal_t L, LineTypePtr Ptr, int from_type, void *from_ptr, found_conn_type_t type)
+static pcb_bool ADD_LINE_TO_LIST(pcb_cardinal_t L, pcb_line_t *Ptr, int from_type, void *from_ptr, pcb_found_conn_type_t type)
{
if (User)
- AddObjectToFlagUndoList(PCB_TYPE_LINE, LAYER_PTR(L), (Ptr), (Ptr));
- SET_FLAG(TheFlag, (Ptr));
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, LAYER_PTR(L), (Ptr), (Ptr));
+ PCB_FLAG_SET(TheFlag, (Ptr));
make_callback(PCB_TYPE_LINE, Ptr, from_type, from_ptr, type);
LINELIST_ENTRY((L), LineList[(L)].Number) = (Ptr);
LineList[(L)].Number++;
@@ -91,16 +94,16 @@ static pcb_bool ADD_LINE_TO_LIST(pcb_cardinal_t L, LineTypePtr Ptr, int from_typ
if (LineList[(L)].Number > LineList[(L)].Size)
printf("ADD_LINE_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, LineList[(L)].Number, LineList[(L)].Size);
#endif
- if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr)))
+ if (drc && !PCB_FLAG_TEST(PCB_FLAG_SELECTED, (Ptr)))
return (SetThing(PCB_TYPE_LINE, LAYER_PTR(L), (Ptr), (Ptr)));
return pcb_false;
}
-static pcb_bool ADD_ARC_TO_LIST(pcb_cardinal_t L, ArcTypePtr Ptr, int from_type, void *from_ptr, found_conn_type_t type)
+static pcb_bool ADD_ARC_TO_LIST(pcb_cardinal_t L, pcb_arc_t *Ptr, int from_type, void *from_ptr, pcb_found_conn_type_t type)
{
if (User)
- AddObjectToFlagUndoList(PCB_TYPE_ARC, LAYER_PTR(L), (Ptr), (Ptr));
- SET_FLAG(TheFlag, (Ptr));
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, LAYER_PTR(L), (Ptr), (Ptr));
+ PCB_FLAG_SET(TheFlag, (Ptr));
make_callback(PCB_TYPE_ARC, Ptr, from_type, from_ptr, type);
ARCLIST_ENTRY((L), ArcList[(L)].Number) = (Ptr);
ArcList[(L)].Number++;
@@ -108,16 +111,16 @@ static pcb_bool ADD_ARC_TO_LIST(pcb_cardinal_t L, ArcTypePtr Ptr, int from_type,
if (ArcList[(L)].Number > ArcList[(L)].Size)
printf("ADD_ARC_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, ArcList[(L)].Number, ArcList[(L)].Size);
#endif
- if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr)))
+ if (drc && !PCB_FLAG_TEST(PCB_FLAG_SELECTED, (Ptr)))
return (SetThing(PCB_TYPE_ARC, LAYER_PTR(L), (Ptr), (Ptr)));
return pcb_false;
}
-static pcb_bool ADD_RAT_TO_LIST(RatTypePtr Ptr, int from_type, void *from_ptr, found_conn_type_t type)
+static pcb_bool ADD_RAT_TO_LIST(pcb_rat_t *Ptr, int from_type, void *from_ptr, pcb_found_conn_type_t type)
{
if (User)
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, (Ptr), (Ptr), (Ptr));
- SET_FLAG(TheFlag, (Ptr));
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, (Ptr), (Ptr), (Ptr));
+ PCB_FLAG_SET(TheFlag, (Ptr));
make_callback(PCB_TYPE_RATLINE, Ptr, from_type, from_ptr, type);
RATLIST_ENTRY(RatList.Number) = (Ptr);
RatList.Number++;
@@ -125,16 +128,16 @@ static pcb_bool ADD_RAT_TO_LIST(RatTypePtr Ptr, int from_type, void *from_ptr, f
if (RatList.Number > RatList.Size)
printf("ADD_RAT_TO_LIST overflow! num=%d size=%d\n", RatList.Number, RatList.Size);
#endif
- if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr)))
+ if (drc && !PCB_FLAG_TEST(PCB_FLAG_SELECTED, (Ptr)))
return (SetThing(PCB_TYPE_RATLINE, (Ptr), (Ptr), (Ptr)));
return pcb_false;
}
-static pcb_bool ADD_POLYGON_TO_LIST(pcb_cardinal_t L, PolygonTypePtr Ptr, int from_type, void *from_ptr, found_conn_type_t type)
+static pcb_bool ADD_POLYGON_TO_LIST(pcb_cardinal_t L, pcb_polygon_t *Ptr, int from_type, void *from_ptr, pcb_found_conn_type_t type)
{
if (User)
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, LAYER_PTR(L), (Ptr), (Ptr));
- SET_FLAG(TheFlag, (Ptr));
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, LAYER_PTR(L), (Ptr), (Ptr));
+ PCB_FLAG_SET(TheFlag, (Ptr));
make_callback(PCB_TYPE_POLYGON, Ptr, from_type, from_ptr, type);
POLYGONLIST_ENTRY((L), PolygonList[(L)].Number) = (Ptr);
PolygonList[(L)].Number++;
@@ -142,7 +145,7 @@ static pcb_bool ADD_POLYGON_TO_LIST(pcb_cardinal_t L, PolygonTypePtr Ptr, int fr
if (PolygonList[(L)].Number > PolygonList[(L)].Size)
printf("ADD_ARC_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, PolygonList[(L)].Number, PolygonList[(L)].Size);
#endif
- if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr)))
+ if (drc && !PCB_FLAG_TEST(PCB_FLAG_SELECTED, (Ptr)))
return (SetThing(PCB_TYPE_POLYGON, LAYER_PTR(L), (Ptr), (Ptr)));
return pcb_false;
}
@@ -163,11 +166,11 @@ pcb_bool SetThing(int type, void *ptr1, void *ptr2, void *ptr3)
/* ---------------------------------------------------------------------------
* releases all allocated memory
*/
-void FreeLayoutLookupMemory(void)
+void pcb_layout_lookup_uninit(void)
{
pcb_cardinal_t i;
- for (i = 0; i < max_copper_layer; i++) {
+ for (i = 0; i < pcb_max_copper_layer; i++) {
free(LineList[i].Data);
LineList[i].Data = NULL;
free(ArcList[i].Data);
@@ -181,7 +184,7 @@ void FreeLayoutLookupMemory(void)
RatList.Data = NULL;
}
-void FreeComponentLookupMemory(void)
+void pcb_component_lookup_uninit(void)
{
/*fprintf(stderr, "PadList free both\n");*/
free(PadList[0].Data);
@@ -194,27 +197,27 @@ void FreeComponentLookupMemory(void)
* allocates memory for component related stacks ...
* initializes index and sorts it by X1 and X2
*/
-void InitComponentLookup(void)
+void pcb_component_lookup_init(void)
{
pcb_cardinal_t i;
/* initialize pad data; start by counting the total number
* on each of the two possible layers
*/
- NumberOfPads[COMPONENT_LAYER] = NumberOfPads[SOLDER_LAYER] = 0;
- ALLPAD_LOOP(PCB->Data);
+ NumberOfPads[PCB_COMPONENT_SIDE] = NumberOfPads[PCB_SOLDER_SIDE] = 0;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad))
- NumberOfPads[SOLDER_LAYER]++;
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad))
+ NumberOfPads[PCB_SOLDER_SIDE]++;
else
- NumberOfPads[COMPONENT_LAYER]++;
+ NumberOfPads[PCB_COMPONENT_SIDE]++;
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
for (i = 0; i < 2; i++) {
/*fprintf(stderr, "PadList alloc %d: %d\n", i, NumberOfPads[i]);*/
/* allocate memory for working list */
- PadList[i].Data = (void **) calloc(NumberOfPads[i], sizeof(PadTypePtr));
+ PadList[i].Data = (void **) calloc(NumberOfPads[i], sizeof(pcb_pad_t *));
/* clear some struct members */
PadList[i].Location = 0;
@@ -228,25 +231,25 @@ void InitComponentLookup(void)
* allocates memory for component related stacks ...
* initializes index and sorts it by X1 and X2
*/
-void InitLayoutLookup(void)
+void pcb_layout_lookup_init(void)
{
pcb_cardinal_t i;
/* initialize line arc and polygon data */
- for (i = 0; i < max_copper_layer; i++) {
- LayerTypePtr layer = LAYER_PTR(i);
+ for (i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layer_t *layer = LAYER_PTR(i);
if (linelist_length(&layer->Line)) {
LineList[i].Size = linelist_length(&layer->Line);
- LineList[i].Data = (void **) calloc(LineList[i].Size, sizeof(LineTypePtr));
+ LineList[i].Data = (void **) calloc(LineList[i].Size, sizeof(pcb_line_t *));
}
if (arclist_length(&layer->Arc)) {
ArcList[i].Size = arclist_length(&layer->Arc);
- ArcList[i].Data = (void **) calloc(ArcList[i].Size, sizeof(ArcTypePtr));
+ ArcList[i].Data = (void **) calloc(ArcList[i].Size, sizeof(pcb_arc_t *));
}
if (polylist_length(&layer->Polygon)) {
PolygonList[i].Size = polylist_length(&layer->Polygon);
- PolygonList[i].Data = (void **) calloc(PolygonList[i].Size, sizeof(PolygonTypePtr));
+ PolygonList[i].Data = (void **) calloc(PolygonList[i].Size, sizeof(pcb_polygon_t *));
}
/* clear some struct members */
@@ -270,14 +273,14 @@ void InitLayoutLookup(void)
else
TotalV = 0;
/* allocate memory for 'new PV to check' list and clear struct */
- PVList.Data = (void **) calloc(TotalP + TotalV, sizeof(PinTypePtr));
+ PVList.Data = (void **) calloc(TotalP + TotalV, sizeof(pcb_pin_t *));
PVList.Size = TotalP + TotalV;
PVList.Location = 0;
PVList.DrawLocation = 0;
PVList.Number = 0;
/* Initialize ratline data */
RatList.Size = ratlist_length(&PCB->Data->Rat);
- RatList.Data = (void **) calloc(RatList.Size, sizeof(RatTypePtr));
+ RatList.Data = (void **) calloc(RatList.Size, sizeof(pcb_rat_t *));
RatList.Location = 0;
RatList.DrawLocation = 0;
RatList.Number = 0;
@@ -285,59 +288,59 @@ void InitLayoutLookup(void)
struct pv_info {
pcb_cardinal_t layer;
- PinType pv;
+ pcb_pin_t pv;
jmp_buf env;
};
-static r_dir_t LOCtoPVline_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPVline_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct pv_info *i = (struct pv_info *) cl;
- if (!TEST_FLAG(TheFlag, line) && PinLineIntersect(&i->pv, line) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) {
- if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, line) && pcb_intersect_line_pin(&i->pv, line) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, &i->pv)) {
+ if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPVarc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPVarc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct pv_info *i = (struct pv_info *) cl;
- if (!TEST_FLAG(TheFlag, arc) && IS_PV_ON_ARC(&i->pv, arc) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) {
- if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, arc) && IS_PV_ON_ARC(&i->pv, arc) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, &i->pv)) {
+ if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPVpad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPVpad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct pv_info *i = (struct pv_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && IS_PV_ON_PAD(&i->pv, pad) &&
- !TEST_FLAG(PCB_FLAG_HOLE, &i->pv) &&
- ADD_PAD_TO_LIST(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, pad) && IS_PV_ON_PAD(&i->pv, pad) &&
+ !PCB_FLAG_TEST(PCB_FLAG_HOLE, &i->pv) &&
+ ADD_PAD_TO_LIST(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE, pad, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPVrat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPVrat_callback(const pcb_box_t * b, void *cl)
{
- RatTypePtr rat = (RatTypePtr) b;
+ pcb_rat_t *rat = (pcb_rat_t *) b;
struct pv_info *i = (struct pv_info *) cl;
- if (!TEST_FLAG(TheFlag, rat) && IS_PV_ON_RAT(&i->pv, rat) && ADD_RAT_TO_LIST(rat, PCB_TYPE_PIN, &i->pv, FCT_RAT))
+ if (!PCB_FLAG_TEST(TheFlag, rat) && IS_PV_ON_RAT(&i->pv, rat) && ADD_RAT_TO_LIST(rat, PCB_TYPE_PIN, &i->pv, PCB_FCT_RAT))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPVpoly_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPVpoly_callback(const pcb_box_t * b, void *cl)
{
- PolygonTypePtr polygon = (PolygonTypePtr) b;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) b;
struct pv_info *i = (struct pv_info *) cl;
/* if the pin doesn't have a therm and polygon is clearing
@@ -346,30 +349,30 @@ static r_dir_t LOCtoPVpoly_callback(const BoxType * b, void *cl)
* because it might not be inside the polygon, or it could
* be on an edge such that it doesn't actually touch.
*/
- if (!TEST_FLAG(TheFlag, polygon) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv) &&
- (TEST_THERM(i->layer, &i->pv) || !TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon)
+ if (!PCB_FLAG_TEST(TheFlag, polygon) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, &i->pv) &&
+ (PCB_FLAG_THERM_TEST(i->layer, &i->pv) || !PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon)
|| !i->pv.Clearance)) {
double wide = MAX(0.5 * i->pv.Thickness + Bloat, 0);
- if (TEST_FLAG(PCB_FLAG_SQUARE, &i->pv)) {
- Coord x1 = i->pv.X - (i->pv.Thickness + 1 + Bloat) / 2;
- Coord x2 = i->pv.X + (i->pv.Thickness + 1 + Bloat) / 2;
- Coord y1 = i->pv.Y - (i->pv.Thickness + 1 + Bloat) / 2;
- Coord y2 = i->pv.Y + (i->pv.Thickness + 1 + Bloat) / 2;
- if (IsRectangleInPolygon(x1, y1, x2, y2, polygon)
- && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, &i->pv)) {
+ pcb_coord_t x1 = i->pv.X - (i->pv.Thickness + 1 + Bloat) / 2;
+ pcb_coord_t x2 = i->pv.X + (i->pv.Thickness + 1 + Bloat) / 2;
+ pcb_coord_t y1 = i->pv.Y - (i->pv.Thickness + 1 + Bloat) / 2;
+ pcb_coord_t y2 = i->pv.Y + (i->pv.Thickness + 1 + Bloat) / 2;
+ if (pcb_poly_is_rect_in_p(x1, y1, x2, y2, polygon)
+ && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- else if (TEST_FLAG(PCB_FLAG_OCTAGON, &i->pv)) {
- POLYAREA *oct = OctagonPoly(i->pv.X, i->pv.Y, i->pv.Thickness / 2, GET_SQUARE(&i->pv));
- if (isects(oct, polygon, pcb_true)
- && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, &i->pv)) {
+ pcb_polyarea_t *oct = pcb_poly_from_octagon(i->pv.X, i->pv.Y, i->pv.Thickness / 2, PCB_FLAG_SQUARE_GET(&i->pv));
+ if (pcb_poly_isects_poly(oct, polygon, pcb_true)
+ && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- else if (IsPointInPolygon(i->pv.X, i->pv.Y, wide, polygon)
- && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ else if (pcb_poly_is_point_in_p(i->pv.X, i->pv.Y, wide, polygon)
+ && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -389,35 +392,35 @@ static pcb_bool LookupLOConnectionsToPVList(pcb_bool AndRats)
/* check pads */
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pad_tree, (BoxType *) & info.pv, NULL, LOCtoPVpad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pad_tree, (pcb_box_t *) & info.pv, NULL, LOCtoPVpad_callback, &info, NULL);
else
return pcb_true;
/* now all lines, arcs and polygons of the several layers */
- for (layer = 0; layer < max_copper_layer; layer++) {
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
if (LAYER_PTR(layer)->no_drc)
continue;
info.layer = layer;
/* add touching lines */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->line_tree, (BoxType *) & info.pv, NULL, LOCtoPVline_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->line_tree, (pcb_box_t *) & info.pv, NULL, LOCtoPVline_callback, &info, NULL);
else
return pcb_true;
/* add touching arcs */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->arc_tree, (BoxType *) & info.pv, NULL, LOCtoPVarc_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->arc_tree, (pcb_box_t *) & info.pv, NULL, LOCtoPVarc_callback, &info, NULL);
else
return pcb_true;
/* check all polygons */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->polygon_tree, (BoxType *) & info.pv, NULL, LOCtoPVpoly_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->polygon_tree, (pcb_box_t *) & info.pv, NULL, LOCtoPVpoly_callback, &info, NULL);
else
return pcb_true;
}
/* Check for rat-lines that may intersect the PV */
if (AndRats) {
if (setjmp(info.env) == 0)
- r_search(PCB->Data->rat_tree, (BoxType *) & info.pv, NULL, LOCtoPVrat_callback, &info, NULL);
+ pcb_r_search(PCB->Data->rat_tree, (pcb_box_t *) & info.pv, NULL, LOCtoPVrat_callback, &info, NULL);
else
return pcb_true;
}
@@ -433,13 +436,13 @@ static pcb_bool LookupLOConnectionsToLOList(pcb_bool AndRats)
{
pcb_bool done;
pcb_cardinal_t i, group, layer, ratposition,
- lineposition[MAX_LAYER], polyposition[MAX_LAYER], arcposition[MAX_LAYER], padposition[2];
+ lineposition[PCB_MAX_LAYER], polyposition[PCB_MAX_LAYER], arcposition[PCB_MAX_LAYER], padposition[2];
/* copy the current LO list positions; the original data is changed
* by 'LookupPVConnectionsToLOList()' which has to check the same
* list entries plus the new ones
*/
- for (i = 0; i < max_copper_layer; i++) {
+ for (i = 0; i < pcb_max_copper_layer; i++) {
lineposition[i] = LineList[i].Location;
polyposition[i] = PolygonList[i].Location;
arcposition[i] = ArcList[i].Location;
@@ -466,16 +469,16 @@ static pcb_bool LookupLOConnectionsToLOList(pcb_bool AndRats)
}
}
/* loop over all layergroups */
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
pcb_cardinal_t entry;
for (entry = 0; entry < PCB->LayerGroups.Number[group]; entry++) {
layer = PCB->LayerGroups.Entries[group][entry];
- /* be aware that the layer number equal max_copper_layer
- * and max_copper_layer+1 have a special meaning for pads
+ /* be aware that the layer number equal pcb_max_copper_layer
+ * and pcb_max_copper_layer+1 have a special meaning for pads
*/
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
/* try all new lines */
position = &lineposition[layer];
for (; *position < LineList[layer].Number; (*position)++)
@@ -496,9 +499,9 @@ static pcb_bool LookupLOConnectionsToLOList(pcb_bool AndRats)
}
else {
/* try all new pads */
- layer -= max_copper_layer;
+ layer -= pcb_max_copper_layer;
if (layer > 1) {
- Message(PCB_MSG_DEFAULT, _("bad layer number %d max_copper_layer=%d in find.c\n"), layer, max_copper_layer);
+ pcb_message(PCB_MSG_ERROR, _("bad layer number %d pcb_max_copper_layer=%d in find.c\n"), layer, pcb_max_copper_layer);
return pcb_false;
}
position = &padposition[layer];
@@ -513,37 +516,37 @@ static pcb_bool LookupLOConnectionsToLOList(pcb_bool AndRats)
* may have changed the prior lists
*/
done = !AndRats || ratposition >= RatList.Number;
- for (layer = 0; layer < max_copper_layer + 2; layer++) {
- if (layer < max_copper_layer)
+ for (layer = 0; layer < pcb_max_copper_layer + 2; layer++) {
+ if (layer < pcb_max_copper_layer)
done = done &&
lineposition[layer] >= LineList[layer].Number
&& arcposition[layer] >= ArcList[layer].Number && polyposition[layer] >= PolygonList[layer].Number;
else
- done = done && padposition[layer - max_copper_layer] >= PadList[layer - max_copper_layer].Number;
+ done = done && padposition[layer - pcb_max_copper_layer] >= PadList[layer - pcb_max_copper_layer].Number;
}
}
while (!done);
return (pcb_false);
}
-static r_dir_t pv_pv_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pv_pv_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pin = (PinTypePtr) b;
+ pcb_pin_t *pin = (pcb_pin_t *) b;
struct pv_info *i = (struct pv_info *) cl;
- if (!TEST_FLAG(TheFlag, pin) && PV_TOUCH_PV(&i->pv, pin)) {
- if (TEST_FLAG(PCB_FLAG_HOLE, pin) || TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) {
- SET_FLAG(PCB_FLAG_WARN, pin);
+ if (!PCB_FLAG_TEST(TheFlag, pin) && PV_TOUCH_PV(&i->pv, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) || PCB_FLAG_TEST(PCB_FLAG_HOLE, &i->pv)) {
+ PCB_FLAG_SET(PCB_FLAG_WARN, pin);
conf_core.temp.rat_warn = pcb_true;
if (pin->Element)
- Message(PCB_MSG_DEFAULT, _("WARNING: Hole too close to pin.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Hole too close to pin.\n"));
else
- Message(PCB_MSG_DEFAULT, _("WARNING: Hole too close to via.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Hole too close to via.\n"));
}
- else if (ADD_PV_TO_LIST(pin, PCB_TYPE_PIN, &i->pv, FCT_COPPER))
+ else if (ADD_PV_TO_LIST(pin, PCB_TYPE_PIN, &i->pv, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -559,34 +562,34 @@ static pcb_bool LookupPVConnectionsToPVList(void)
save_place = PVList.Location;
while (PVList.Location < PVList.Number) {
int ic;
- PinType *orig_pin;
+ pcb_pin_t *orig_pin;
/* get pointer to data */
orig_pin = (PVLIST_ENTRY(PVList.Location));
info.pv = *orig_pin;
/* Internal connection: if pins in the same element have the same
internal connection group number, they are connected */
- ic = GET_INTCONN(orig_pin);
+ ic = PCB_FLAG_INTCONN_GET(orig_pin);
if ((info.pv.Element != NULL) && (ic > 0)) {
- ElementType *e = info.pv.Element;
- PIN_LOOP(e);
+ pcb_element_t *e = info.pv.Element;
+ PCB_PIN_LOOP(e);
{
- if ((orig_pin != pin) && (ic == GET_INTCONN(pin))) {
- if (!TEST_FLAG(TheFlag, pin))
- ADD_PV_TO_LIST(pin, PCB_TYPE_PIN, orig_pin, FCT_INTERNAL);
+ if ((orig_pin != pin) && (ic == PCB_FLAG_INTCONN_GET(pin))) {
+ if (!PCB_FLAG_TEST(TheFlag, pin))
+ ADD_PV_TO_LIST(pin, PCB_TYPE_PIN, orig_pin, PCB_FCT_INTERNAL);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
EXPAND_BOUNDS(&info.pv);
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, (BoxType *) & info.pv, NULL, pv_pv_callback, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, (pcb_box_t *) & info.pv, NULL, pv_pv_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, (BoxType *) & info.pv, NULL, pv_pv_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, (pcb_box_t *) & info.pv, NULL, pv_pv_callback, &info, NULL);
else
return pcb_true;
PVList.Location++;
@@ -597,106 +600,106 @@ static pcb_bool LookupPVConnectionsToPVList(void)
struct lo_info {
pcb_cardinal_t layer;
- LineType line;
- PadType pad;
- ArcType arc;
- PolygonType polygon;
- RatType rat;
+ pcb_line_t line;
+ pcb_pad_t pad;
+ pcb_arc_t arc;
+ pcb_polygon_t polygon;
+ pcb_rat_t rat;
jmp_buf env;
};
-static r_dir_t pv_line_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pv_line_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pv = (PinTypePtr) b;
+ pcb_pin_t *pv = (pcb_pin_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pv) && PinLineIntersect(pv, &i->line)) {
- if (TEST_FLAG(PCB_FLAG_HOLE, pv)) {
- SET_FLAG(PCB_FLAG_WARN, pv);
+ if (!PCB_FLAG_TEST(TheFlag, pv) && pcb_intersect_line_pin(pv, &i->line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
+ PCB_FLAG_SET(PCB_FLAG_WARN, pv);
conf_core.temp.rat_warn = pcb_true;
- Message(PCB_MSG_DEFAULT, _("WARNING: Hole too close to line.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Hole too close to line.\n"));
}
- else if (ADD_PV_TO_LIST(pv, PCB_TYPE_LINE, &i->line, FCT_COPPER))
+ else if (ADD_PV_TO_LIST(pv, PCB_TYPE_LINE, &i->line, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t pv_pad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pv_pad_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pv = (PinTypePtr) b;
+ pcb_pin_t *pv = (pcb_pin_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pv) && IS_PV_ON_PAD(pv, &i->pad)) {
- if (TEST_FLAG(PCB_FLAG_HOLE, pv)) {
- SET_FLAG(PCB_FLAG_WARN, pv);
+ if (!PCB_FLAG_TEST(TheFlag, pv) && IS_PV_ON_PAD(pv, &i->pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
+ PCB_FLAG_SET(PCB_FLAG_WARN, pv);
conf_core.temp.rat_warn = pcb_true;
- Message(PCB_MSG_DEFAULT, _("WARNING: Hole too close to pad.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Hole too close to pad.\n"));
}
- else if (ADD_PV_TO_LIST(pv, PCB_TYPE_PAD, &i->pad, FCT_COPPER))
+ else if (ADD_PV_TO_LIST(pv, PCB_TYPE_PAD, &i->pad, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t pv_arc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pv_arc_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pv = (PinTypePtr) b;
+ pcb_pin_t *pv = (pcb_pin_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pv) && IS_PV_ON_ARC(pv, &i->arc)) {
- if (TEST_FLAG(PCB_FLAG_HOLE, pv)) {
- SET_FLAG(PCB_FLAG_WARN, pv);
+ if (!PCB_FLAG_TEST(TheFlag, pv) && IS_PV_ON_ARC(pv, &i->arc)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
+ PCB_FLAG_SET(PCB_FLAG_WARN, pv);
conf_core.temp.rat_warn = pcb_true;
- Message(PCB_MSG_DEFAULT, _("WARNING: Hole touches arc.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Hole touches arc.\n"));
}
- else if (ADD_PV_TO_LIST(pv, PCB_TYPE_ARC, &i->arc, FCT_COPPER))
+ else if (ADD_PV_TO_LIST(pv, PCB_TYPE_ARC, &i->arc, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t pv_poly_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pv_poly_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pv = (PinTypePtr) b;
+ pcb_pin_t *pv = (pcb_pin_t *) b;
struct lo_info *i = (struct lo_info *) cl;
/* note that holes in polygons are ok, so they don't generate warnings. */
- if (!TEST_FLAG(TheFlag, pv) && !TEST_FLAG(PCB_FLAG_HOLE, pv) &&
- (TEST_THERM(i->layer, pv) || !TEST_FLAG(PCB_FLAG_CLEARPOLY, &i->polygon) || !pv->Clearance)) {
- if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) {
- Coord x1, x2, y1, y2;
+ if (!PCB_FLAG_TEST(TheFlag, pv) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, pv) &&
+ (PCB_FLAG_THERM_TEST(i->layer, pv) || !PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, &i->polygon) || !pv->Clearance)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pv)) {
+ pcb_coord_t x1, x2, y1, y2;
x1 = pv->X - (PIN_SIZE(pv) + 1 + Bloat) / 2;
x2 = pv->X + (PIN_SIZE(pv) + 1 + Bloat) / 2;
y1 = pv->Y - (PIN_SIZE(pv) + 1 + Bloat) / 2;
y2 = pv->Y + (PIN_SIZE(pv) + 1 + Bloat) / 2;
- if (IsRectangleInPolygon(x1, y1, x2, y2, &i->polygon)
- && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER))
+ if (pcb_poly_is_rect_in_p(x1, y1, x2, y2, &i->polygon)
+ && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv)) {
- POLYAREA *oct = OctagonPoly(pv->X, pv->Y, PIN_SIZE(pv) / 2, GET_SQUARE(pv));
- if (isects(oct, &i->polygon, pcb_true) && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER))
+ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv)) {
+ pcb_polyarea_t *oct = pcb_poly_from_octagon(pv->X, pv->Y, PIN_SIZE(pv) / 2, PCB_FLAG_SQUARE_GET(pv));
+ if (pcb_poly_isects_poly(oct, &i->polygon, pcb_true) && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
else {
- if (IsPointInPolygon(pv->X, pv->Y, PIN_SIZE(pv) * 0.5 + Bloat, &i->polygon)
- && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER))
+ if (pcb_poly_is_point_in_p(pv->X, pv->Y, PIN_SIZE(pv) * 0.5 + Bloat, &i->polygon)
+ && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t pv_rat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pv_rat_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pv = (PinTypePtr) b;
+ pcb_pin_t *pv = (pcb_pin_t *) b;
struct lo_info *i = (struct lo_info *) cl;
/* rats can't cause DRC so there is no early exit */
- if (!TEST_FLAG(TheFlag, pv) && IS_PV_ON_RAT(pv, &i->rat))
- ADD_PV_TO_LIST(pv, PCB_TYPE_RATLINE, &i->rat, FCT_RAT);
- return R_DIR_NOT_FOUND;
+ if (!PCB_FLAG_TEST(TheFlag, pv) && IS_PV_ON_RAT(pv, &i->rat))
+ ADD_PV_TO_LIST(pv, PCB_TYPE_RATLINE, &i->rat, PCB_FCT_RAT);
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -709,7 +712,7 @@ static pcb_bool LookupPVConnectionsToLOList(pcb_bool AndRats)
struct lo_info info;
/* loop over all layers */
- for (layer = 0; layer < max_copper_layer; layer++) {
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
if (LAYER_PTR(layer)->no_drc)
continue;
/* do nothing if there are no PV's */
@@ -725,11 +728,11 @@ static pcb_bool LookupPVConnectionsToLOList(pcb_bool AndRats)
info.line = *(LINELIST_ENTRY(layer, LineList[layer].Location));
EXPAND_BOUNDS(&info.line);
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, (BoxType *) & info.line, NULL, pv_line_callback, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, (pcb_box_t *) & info.line, NULL, pv_line_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, (BoxType *) & info.line, NULL, pv_line_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, (pcb_box_t *) & info.line, NULL, pv_line_callback, &info, NULL);
else
return pcb_true;
LineList[layer].Location++;
@@ -740,11 +743,11 @@ static pcb_bool LookupPVConnectionsToLOList(pcb_bool AndRats)
info.arc = *(ARCLIST_ENTRY(layer, ArcList[layer].Location));
EXPAND_BOUNDS(&info.arc);
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, (BoxType *) & info.arc, NULL, pv_arc_callback, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, (pcb_box_t *) & info.arc, NULL, pv_arc_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, (BoxType *) & info.arc, NULL, pv_arc_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, (pcb_box_t *) & info.arc, NULL, pv_arc_callback, &info, NULL);
else
return pcb_true;
ArcList[layer].Location++;
@@ -756,11 +759,11 @@ static pcb_bool LookupPVConnectionsToLOList(pcb_bool AndRats)
info.polygon = *(POLYGONLIST_ENTRY(layer, PolygonList[layer].Location));
EXPAND_BOUNDS(&info.polygon);
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, (BoxType *) & info.polygon, NULL, pv_poly_callback, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, (pcb_box_t *) & info.polygon, NULL, pv_poly_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, (BoxType *) & info.polygon, NULL, pv_poly_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, (pcb_box_t *) & info.polygon, NULL, pv_poly_callback, &info, NULL);
else
return pcb_true;
PolygonList[layer].Location++;
@@ -782,11 +785,11 @@ static pcb_bool LookupPVConnectionsToLOList(pcb_bool AndRats)
info.pad = *(PADLIST_ENTRY(layer, PadList[layer].Location));
EXPAND_BOUNDS(&info.pad);
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, (BoxType *) & info.pad, NULL, pv_pad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, (pcb_box_t *) & info.pad, NULL, pv_pad_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, (BoxType *) & info.pad, NULL, pv_pad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, (pcb_box_t *) & info.pad, NULL, pv_pad_callback, &info, NULL);
else
return pcb_true;
PadList[layer].Location++;
@@ -812,51 +815,51 @@ static pcb_bool LookupPVConnectionsToLOList(pcb_bool AndRats)
return (pcb_false);
}
-r_dir_t pv_touch_callback(const BoxType * b, void *cl)
+pcb_r_dir_t pv_touch_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pin = (PinTypePtr) b;
+ pcb_pin_t *pin = (pcb_pin_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pin) && PinLineIntersect(pin, &i->line))
+ if (!PCB_FLAG_TEST(TheFlag, pin) && pcb_intersect_line_pin(pin, &i->line))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoArcLine_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoArcLine_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, line) && LineArcIntersect(line, &i->arc)) {
- if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_ARC, &i->arc, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, line) && pcb_intersect_line_arc(line, &i->arc)) {
+ if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_ARC, &i->arc, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoArcArc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoArcArc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct lo_info *i = (struct lo_info *) cl;
if (!arc->Thickness)
return 0;
- if (!TEST_FLAG(TheFlag, arc) && ArcArcIntersect(&i->arc, arc)) {
- if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_ARC, &i->arc, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, arc) && ArcArcIntersect(&i->arc, arc)) {
+ if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_ARC, &i->arc, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoArcPad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoArcPad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER)
- && ArcPadIntersect(&i->arc, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_ARC, &i->arc, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, pad) && i->layer == (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)
+ && pcb_intersect_arc_pad(&i->arc, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_ARC, &i->arc, PCB_FCT_COPPER))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -866,7 +869,7 @@ static r_dir_t LOCtoArcPad_callback(const BoxType * b, void *cl)
* the notation that is used is:
* Xij means Xj at arc i
*/
-static pcb_bool LookupLOConnectionsToArc(ArcTypePtr Arc, pcb_cardinal_t LayerGroup)
+static pcb_bool LookupLOConnectionsToArc(pcb_arc_t *Arc, pcb_cardinal_t LayerGroup)
{
pcb_cardinal_t entry;
struct lo_info info;
@@ -880,33 +883,33 @@ static pcb_bool LookupLOConnectionsToArc(ArcTypePtr Arc, pcb_cardinal_t LayerGro
layer = PCB->LayerGroups.Entries[LayerGroup][entry];
/* handle normal layers */
- if (layer < max_copper_layer) {
- PolygonType *polygon;
+ if (layer < pcb_max_copper_layer) {
+ pcb_polygon_t *polygon;
gdl_iterator_t it;
info.layer = layer;
/* add arcs */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->line_tree, &info.arc.BoundingBox, NULL, LOCtoArcLine_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->line_tree, &info.arc.BoundingBox, NULL, LOCtoArcLine_callback, &info, NULL);
else
return pcb_true;
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->arc_tree, &info.arc.BoundingBox, NULL, LOCtoArcArc_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->arc_tree, &info.arc.BoundingBox, NULL, LOCtoArcArc_callback, &info, NULL);
else
return pcb_true;
/* now check all polygons */
polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) {
- if (!TEST_FLAG(TheFlag, polygon) && IsArcInPolygon(Arc, polygon)
- && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_ARC, Arc, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, polygon) && pcb_is_arc_in_poly(Arc, polygon)
+ && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_ARC, Arc, PCB_FCT_COPPER))
return pcb_true;
}
}
else {
- info.layer = layer - max_copper_layer;
+ info.layer = layer - pcb_max_copper_layer;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pad_tree, &info.arc.BoundingBox, NULL, LOCtoArcPad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pad_tree, &info.arc.BoundingBox, NULL, LOCtoArcPad_callback, &info, NULL);
else
return pcb_true;
}
@@ -914,61 +917,61 @@ static pcb_bool LookupLOConnectionsToArc(ArcTypePtr Arc, pcb_cardinal_t LayerGro
return (pcb_false);
}
-static r_dir_t LOCtoLineLine_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoLineLine_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, line) && LineLineIntersect(&i->line, line)) {
- if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_LINE, &i->line, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, line) && pcb_intersect_line_line(&i->line, line)) {
+ if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_LINE, &i->line, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoLineArc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoLineArc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct lo_info *i = (struct lo_info *) cl;
if (!arc->Thickness)
return 0;
- if (!TEST_FLAG(TheFlag, arc) && LineArcIntersect(&i->line, arc)) {
- if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_LINE, &i->line, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, arc) && pcb_intersect_line_arc(&i->line, arc)) {
+ if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_LINE, &i->line, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoLineRat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoLineRat_callback(const pcb_box_t * b, void *cl)
{
- RatTypePtr rat = (RatTypePtr) b;
+ pcb_rat_t *rat = (pcb_rat_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, rat)) {
+ if (!PCB_FLAG_TEST(TheFlag, rat)) {
if ((rat->group1 == i->layer)
&& IsRatPointOnLineEnd(&rat->Point1, &i->line)) {
- if (ADD_RAT_TO_LIST(rat, PCB_TYPE_LINE, &i->line, FCT_RAT))
+ if (ADD_RAT_TO_LIST(rat, PCB_TYPE_LINE, &i->line, PCB_FCT_RAT))
longjmp(i->env, 1);
}
else if ((rat->group2 == i->layer)
&& IsRatPointOnLineEnd(&rat->Point2, &i->line)) {
- if (ADD_RAT_TO_LIST(rat, PCB_TYPE_LINE, &i->line, FCT_RAT))
+ if (ADD_RAT_TO_LIST(rat, PCB_TYPE_LINE, &i->line, PCB_FCT_RAT))
longjmp(i->env, 1);
}
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoLinePad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoLinePad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER)
- && LinePadIntersect(&i->line, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_LINE, &i->line, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, pad) && i->layer == (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)
+ && pcb_intersect_line_pad(&i->line, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_LINE, &i->line, PCB_FCT_COPPER))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -978,7 +981,7 @@ static r_dir_t LOCtoLinePad_callback(const BoxType * b, void *cl)
* the notation that is used is:
* Xij means Xj at line i
*/
-static pcb_bool LookupLOConnectionsToLine(LineTypePtr Line, pcb_cardinal_t LayerGroup, pcb_bool PolysTo)
+static pcb_bool LookupLOConnectionsToLine(pcb_line_t *Line, pcb_cardinal_t LayerGroup, pcb_bool PolysTo)
{
pcb_cardinal_t entry;
struct lo_info info;
@@ -988,7 +991,7 @@ static pcb_bool LookupLOConnectionsToLine(LineTypePtr Line, pcb_cardinal_t Layer
EXPAND_BOUNDS(&info.line)
/* add the new rat lines */
if (setjmp(info.env) == 0)
- r_search(PCB->Data->rat_tree, &info.line.BoundingBox, NULL, LOCtoLineRat_callback, &info, NULL);
+ pcb_r_search(PCB->Data->rat_tree, &info.line.BoundingBox, NULL, LOCtoLineRat_callback, &info, NULL);
else
return pcb_true;
@@ -999,35 +1002,35 @@ static pcb_bool LookupLOConnectionsToLine(LineTypePtr Line, pcb_cardinal_t Layer
layer = PCB->LayerGroups.Entries[LayerGroup][entry];
/* handle normal layers */
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
info.layer = layer;
/* add lines */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->line_tree, (BoxType *) & info.line, NULL, LOCtoLineLine_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->line_tree, (pcb_box_t *) & info.line, NULL, LOCtoLineLine_callback, &info, NULL);
else
return pcb_true;
/* add arcs */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->arc_tree, (BoxType *) & info.line, NULL, LOCtoLineArc_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->arc_tree, (pcb_box_t *) & info.line, NULL, LOCtoLineArc_callback, &info, NULL);
else
return pcb_true;
/* now check all polygons */
if (PolysTo) {
gdl_iterator_t it;
- PolygonType *polygon;
+ pcb_polygon_t *polygon;
polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) {
- if (!TEST_FLAG(TheFlag, polygon) && IsLineInPolygon(Line, polygon)
- && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_LINE, Line, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, polygon) && pcb_is_line_in_poly(Line, polygon)
+ && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_LINE, Line, PCB_FCT_COPPER))
return pcb_true;
}
}
}
else {
/* handle special 'pad' layers */
- info.layer = layer - max_copper_layer;
+ info.layer = layer - pcb_max_copper_layer;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pad_tree, &info.line.BoundingBox, NULL, LOCtoLinePad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pad_tree, &info.line.BoundingBox, NULL, LOCtoLinePad_callback, &info, NULL);
else
return pcb_true;
}
@@ -1038,52 +1041,52 @@ static pcb_bool LookupLOConnectionsToLine(LineTypePtr Line, pcb_cardinal_t Layer
struct rat_info {
pcb_cardinal_t layer;
- PointTypePtr Point;
+ pcb_point_t *Point;
jmp_buf env;
};
-static r_dir_t LOCtoRat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoRat_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct rat_info *i = (struct rat_info *) cl;
- if (!TEST_FLAG(TheFlag, line) &&
+ if (!PCB_FLAG_TEST(TheFlag, line) &&
((line->Point1.X == i->Point->X &&
line->Point1.Y == i->Point->Y) || (line->Point2.X == i->Point->X && line->Point2.Y == i->Point->Y))) {
- if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_RATLINE, &i->Point, FCT_RAT))
+ if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_RATLINE, &i->Point, PCB_FCT_RAT))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t PolygonToRat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t PolygonToRat_callback(const pcb_box_t * b, void *cl)
{
- PolygonTypePtr polygon = (PolygonTypePtr) b;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) b;
struct rat_info *i = (struct rat_info *) cl;
- if (!TEST_FLAG(TheFlag, polygon) && polygon->Clipped &&
+ if (!PCB_FLAG_TEST(TheFlag, polygon) && polygon->Clipped &&
(i->Point->X == polygon->Clipped->contours->head.point[0]) &&
(i->Point->Y == polygon->Clipped->contours->head.point[1])) {
- if (ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_RATLINE, &i->Point, FCT_RAT))
+ if (ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_RATLINE, &i->Point, PCB_FCT_RAT))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct rat_info *i = (struct rat_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && i->layer ==
- (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) &&
+ if (!PCB_FLAG_TEST(TheFlag, pad) && i->layer ==
+ (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE) &&
((pad->Point1.X == i->Point->X && pad->Point1.Y == i->Point->Y) ||
(pad->Point2.X == i->Point->X && pad->Point2.Y == i->Point->Y) ||
((pad->Point1.X + pad->Point2.X) / 2 == i->Point->X &&
(pad->Point1.Y + pad->Point2.Y) / 2 == i->Point->Y)) &&
- ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_RATLINE, &i->Point, FCT_RAT))
+ ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_RATLINE, &i->Point, PCB_FCT_RAT))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -1093,7 +1096,7 @@ static r_dir_t LOCtoPad_callback(const BoxType * b, void *cl)
* the notation that is used is:
* Xij means Xj at line i
*/
-static pcb_bool LookupLOConnectionsToRatEnd(PointTypePtr Point, pcb_cardinal_t LayerGroup)
+static pcb_bool LookupLOConnectionsToRatEnd(pcb_point_t *Point, pcb_cardinal_t LayerGroup)
{
pcb_cardinal_t entry;
struct rat_info info;
@@ -1109,7 +1112,7 @@ static pcb_bool LookupLOConnectionsToRatEnd(PointTypePtr Point, pcb_cardinal_t L
arcs by definition
*/
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
info.layer = layer;
if (setjmp(info.env) == 0)
r_search_pt(LAYER_PTR(layer)->line_tree, Point, 1, NULL, LOCtoRat_callback, &info, NULL);
@@ -1120,7 +1123,7 @@ static pcb_bool LookupLOConnectionsToRatEnd(PointTypePtr Point, pcb_cardinal_t L
}
else {
/* handle special 'pad' layers */
- info.layer = layer - max_copper_layer;
+ info.layer = layer - pcb_max_copper_layer;
if (setjmp(info.env) == 0)
r_search_pt(PCB->Data->pad_tree, Point, 1, NULL, LOCtoPad_callback, &info, NULL);
else
@@ -1130,57 +1133,57 @@ static pcb_bool LookupLOConnectionsToRatEnd(PointTypePtr Point, pcb_cardinal_t L
return (pcb_false);
}
-static r_dir_t LOCtoPadLine_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPadLine_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, line) && LinePadIntersect(line, &i->pad)) {
- if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PAD, &i->pad, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, line) && pcb_intersect_line_pad(line, &i->pad)) {
+ if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PAD, &i->pad, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPadArc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPadArc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct lo_info *i = (struct lo_info *) cl;
if (!arc->Thickness)
return 0;
- if (!TEST_FLAG(TheFlag, arc) && ArcPadIntersect(arc, &i->pad)) {
- if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_PAD, &i->pad, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, arc) && pcb_intersect_arc_pad(arc, &i->pad)) {
+ if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_PAD, &i->pad, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPadPoly_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPadPoly_callback(const pcb_box_t * b, void *cl)
{
- PolygonTypePtr polygon = (PolygonTypePtr) b;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, polygon) && (!TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon) || !i->pad.Clearance)) {
- if (IsPadInPolygon(&i->pad, polygon) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PAD, &i->pad, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, polygon) && (!PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon) || !i->pad.Clearance)) {
+ if (pcb_is_pad_in_poly(&i->pad, polygon) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PAD, &i->pad, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPadRat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPadRat_callback(const pcb_box_t * b, void *cl)
{
- RatTypePtr rat = (RatTypePtr) b;
+ pcb_rat_t *rat = (pcb_rat_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, rat)) {
+ if (!PCB_FLAG_TEST(TheFlag, rat)) {
if (rat->group1 == i->layer &&
((rat->Point1.X == i->pad.Point1.X && rat->Point1.Y == i->pad.Point1.Y) ||
(rat->Point1.X == i->pad.Point2.X && rat->Point1.Y == i->pad.Point2.Y) ||
(rat->Point1.X == (i->pad.Point1.X + i->pad.Point2.X) / 2 &&
rat->Point1.Y == (i->pad.Point1.Y + i->pad.Point2.Y) / 2))) {
- if (ADD_RAT_TO_LIST(rat, PCB_TYPE_PAD, &i->pad, FCT_RAT))
+ if (ADD_RAT_TO_LIST(rat, PCB_TYPE_PAD, &i->pad, PCB_FCT_RAT))
longjmp(i->env, 1);
}
else if (rat->group2 == i->layer &&
@@ -1188,29 +1191,29 @@ static r_dir_t LOCtoPadRat_callback(const BoxType * b, void *cl)
(rat->Point2.X == i->pad.Point2.X && rat->Point2.Y == i->pad.Point2.Y) ||
(rat->Point2.X == (i->pad.Point1.X + i->pad.Point2.X) / 2 &&
rat->Point2.Y == (i->pad.Point1.Y + i->pad.Point2.Y) / 2))) {
- if (ADD_RAT_TO_LIST(rat, PCB_TYPE_PAD, &i->pad, FCT_RAT))
+ if (ADD_RAT_TO_LIST(rat, PCB_TYPE_PAD, &i->pad, PCB_FCT_RAT))
longjmp(i->env, 1);
}
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPadPad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPadPad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER)
- && PadPadIntersect(pad, &i->pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_PAD, &i->pad, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, pad) && i->layer == (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)
+ && PadPadIntersect(pad, &i->pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_PAD, &i->pad, PCB_FCT_COPPER))
longjmp(i->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
* searches all LOs that are connected to the given pad on the given
* layergroup. All found connections are added to the list
*/
-static pcb_bool LookupLOConnectionsToPad(PadTypePtr Pad, pcb_cardinal_t LayerGroup)
+static pcb_bool LookupLOConnectionsToPad(pcb_pad_t *Pad, pcb_cardinal_t LayerGroup)
{
pcb_cardinal_t entry;
struct lo_info info;
@@ -1219,10 +1222,10 @@ static pcb_bool LookupLOConnectionsToPad(PadTypePtr Pad, pcb_cardinal_t LayerGro
/* Internal connection: if pads in the same element have the same
internal connection group number, they are connected */
- ic = GET_INTCONN(Pad);
+ ic = PCB_FLAG_INTCONN_GET(Pad);
if ((Pad->Element != NULL) && (ic > 0)) {
- ElementType *e = Pad->Element;
- PadTypePtr orig_pad = Pad;
+ pcb_element_t *e = Pad->Element;
+ pcb_pad_t *orig_pad = Pad;
int tlayer = -1;
/*fprintf(stderr, "lg===\n");*/
@@ -1230,42 +1233,42 @@ static pcb_bool LookupLOConnectionsToPad(PadTypePtr Pad, pcb_cardinal_t LayerGro
pcb_cardinal_t layer;
layer = PCB->LayerGroups.Entries[LayerGroup][entry];
/*fprintf(stderr, "lg: %d\n", layer);*/
- if (layer == COMPONENT_LAYER)
- tlayer = COMPONENT_LAYER;
- else if (layer == SOLDER_LAYER)
- tlayer = SOLDER_LAYER;
+ if (layer == PCB_COMPONENT_SIDE)
+ tlayer = PCB_COMPONENT_SIDE;
+ else if (layer == PCB_SOLDER_SIDE)
+ tlayer = PCB_SOLDER_SIDE;
}
/*fprintf(stderr, "tlayer=%d\n", tlayer);*/
if (tlayer >= 0) {
- PAD_LOOP(e);
+ PCB_PAD_LOOP(e);
{
- if ((orig_pad != pad) && (ic == GET_INTCONN(pad))) {
- int padlayer = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER;
-/*fprintf(stderr, "layergroup1: %d {%d %d %d} %d \n", tlayer, TEST_FLAG(PCB_FLAG_ONSOLDER, pad), SOLDER_LAYER, COMPONENT_LAYER, padlayer);*/
- if ((!TEST_FLAG(TheFlag, pad)) && (tlayer != padlayer)) {
+ if ((orig_pad != pad) && (ic == PCB_FLAG_INTCONN_GET(pad))) {
+ int padlayer = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE;
+/*fprintf(stderr, "layergroup1: %d {%d %d %d} %d \n", tlayer, PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad), PCB_SOLDER_SIDE, PCB_COMPONENT_SIDE, padlayer);*/
+ if ((!PCB_FLAG_TEST(TheFlag, pad)) && (tlayer != padlayer)) {
/*fprintf(stderr, "layergroup2\n");*/
- ADD_PAD_TO_LIST(padlayer, pad, PCB_TYPE_PAD, orig_pad, FCT_INTERNAL);
+ ADD_PAD_TO_LIST(padlayer, pad, PCB_TYPE_PAD, orig_pad, PCB_FCT_INTERNAL);
if (LookupLOConnectionsToPad(pad, LayerGroup))
retv = pcb_true;
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- if (!TEST_FLAG(PCB_FLAG_SQUARE, Pad))
- return (LookupLOConnectionsToLine((LineTypePtr) Pad, LayerGroup, pcb_false));
+ if (!PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pad))
+ return (LookupLOConnectionsToLine((pcb_line_t *) Pad, LayerGroup, pcb_false));
info.pad = *Pad;
EXPAND_BOUNDS(&info.pad);
/* add the new rat lines */
info.layer = LayerGroup;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->rat_tree, &info.pad.BoundingBox, NULL, LOCtoPadRat_callback, &info, NULL);
+ pcb_r_search(PCB->Data->rat_tree, &info.pad.BoundingBox, NULL, LOCtoPadRat_callback, &info, NULL);
else
return pcb_true;
@@ -1275,29 +1278,29 @@ static pcb_bool LookupLOConnectionsToPad(PadTypePtr Pad, pcb_cardinal_t LayerGro
layer = PCB->LayerGroups.Entries[LayerGroup][entry];
/* handle normal layers */
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
info.layer = layer;
/* add lines */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->line_tree, &info.pad.BoundingBox, NULL, LOCtoPadLine_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->line_tree, &info.pad.BoundingBox, NULL, LOCtoPadLine_callback, &info, NULL);
else
return pcb_true;
/* add arcs */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->arc_tree, &info.pad.BoundingBox, NULL, LOCtoPadArc_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->arc_tree, &info.pad.BoundingBox, NULL, LOCtoPadArc_callback, &info, NULL);
else
return pcb_true;
/* add polygons */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->polygon_tree, &info.pad.BoundingBox, NULL, LOCtoPadPoly_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->polygon_tree, &info.pad.BoundingBox, NULL, LOCtoPadPoly_callback, &info, NULL);
else
return pcb_true;
}
else {
/* handle special 'pad' layers */
- info.layer = layer - max_copper_layer;
+ info.layer = layer - pcb_max_copper_layer;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pad_tree, (BoxType *) & info.pad, NULL, LOCtoPadPad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pad_tree, (pcb_box_t *) & info.pad, NULL, LOCtoPadPad_callback, &info, NULL);
else
return pcb_true;
}
@@ -1306,60 +1309,60 @@ static pcb_bool LookupLOConnectionsToPad(PadTypePtr Pad, pcb_cardinal_t LayerGro
return retv;
}
-static r_dir_t LOCtoPolyLine_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPolyLine_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, line) && IsLineInPolygon(line, &i->polygon)) {
- if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, line) && pcb_is_line_in_poly(line, &i->polygon)) {
+ if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPolyArc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPolyArc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct lo_info *i = (struct lo_info *) cl;
if (!arc->Thickness)
return 0;
- if (!TEST_FLAG(TheFlag, arc) && IsArcInPolygon(arc, &i->polygon)) {
- if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, arc) && pcb_is_arc_in_poly(arc, &i->polygon)) {
+ if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
return 0;
}
-static r_dir_t LOCtoPolyPad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPolyPad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER)
- && IsPadInPolygon(pad, &i->polygon)) {
- if (ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, pad) && i->layer == (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)
+ && pcb_is_pad_in_poly(pad, &i->polygon)) {
+ if (ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_COPPER))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t LOCtoPolyRat_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t LOCtoPolyRat_callback(const pcb_box_t * b, void *cl)
{
- RatTypePtr rat = (RatTypePtr) b;
+ pcb_rat_t *rat = (pcb_rat_t *) b;
struct lo_info *i = (struct lo_info *) cl;
- if (!TEST_FLAG(TheFlag, rat)) {
+ if (!PCB_FLAG_TEST(TheFlag, rat)) {
if ((rat->Point1.X == (i->polygon.Clipped->contours->head.point[0]) &&
rat->Point1.Y == (i->polygon.Clipped->contours->head.point[1]) &&
rat->group1 == i->layer) ||
(rat->Point2.X == (i->polygon.Clipped->contours->head.point[0]) &&
rat->Point2.Y == (i->polygon.Clipped->contours->head.point[1]) && rat->group2 == i->layer))
- if (ADD_RAT_TO_LIST(rat, PCB_TYPE_POLYGON, &i->polygon, FCT_RAT))
+ if (ADD_RAT_TO_LIST(rat, PCB_TYPE_POLYGON, &i->polygon, PCB_FCT_RAT))
longjmp(i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
@@ -1367,7 +1370,7 @@ static r_dir_t LOCtoPolyRat_callback(const BoxType * b, void *cl)
* looks up LOs that are connected to the given polygon
* on the given layergroup. All found connections are added to the list
*/
-static pcb_bool LookupLOConnectionsToPolygon(PolygonTypePtr Polygon, pcb_cardinal_t LayerGroup)
+static pcb_bool LookupLOConnectionsToPolygon(pcb_polygon_t *Polygon, pcb_cardinal_t LayerGroup)
{
pcb_cardinal_t entry;
struct lo_info info;
@@ -1379,7 +1382,7 @@ static pcb_bool LookupLOConnectionsToPolygon(PolygonTypePtr Polygon, pcb_cardina
info.layer = LayerGroup;
/* check rats */
if (setjmp(info.env) == 0)
- r_search(PCB->Data->rat_tree, (BoxType *) & info.polygon, NULL, LOCtoPolyRat_callback, &info, NULL);
+ pcb_r_search(PCB->Data->rat_tree, (pcb_box_t *) & info.polygon, NULL, LOCtoPolyRat_callback, &info, NULL);
else
return pcb_true;
/* loop over all layers of the group */
@@ -1389,34 +1392,34 @@ static pcb_bool LookupLOConnectionsToPolygon(PolygonTypePtr Polygon, pcb_cardina
layer = PCB->LayerGroups.Entries[LayerGroup][entry];
/* handle normal layers */
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
gdl_iterator_t it;
- PolygonType *polygon;
+ pcb_polygon_t *polygon;
/* check all polygons */
polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) {
- if (!TEST_FLAG(TheFlag, polygon)
- && IsPolygonInPolygon(polygon, Polygon)
- && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_POLYGON, Polygon, FCT_COPPER))
+ if (!PCB_FLAG_TEST(TheFlag, polygon)
+ && pcb_is_poly_in_poly(polygon, Polygon)
+ && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_POLYGON, Polygon, PCB_FCT_COPPER))
return pcb_true;
}
info.layer = layer;
/* check all lines */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->line_tree, (BoxType *) & info.polygon, NULL, LOCtoPolyLine_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->line_tree, (pcb_box_t *) & info.polygon, NULL, LOCtoPolyLine_callback, &info, NULL);
else
return pcb_true;
/* check all arcs */
if (setjmp(info.env) == 0)
- r_search(LAYER_PTR(layer)->arc_tree, (BoxType *) & info.polygon, NULL, LOCtoPolyArc_callback, &info, NULL);
+ pcb_r_search(LAYER_PTR(layer)->arc_tree, (pcb_box_t *) & info.polygon, NULL, LOCtoPolyArc_callback, &info, NULL);
else
return pcb_true;
}
else {
- info.layer = layer - max_copper_layer;
+ info.layer = layer - pcb_max_copper_layer;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pad_tree, (BoxType *) & info.polygon, NULL, LOCtoPolyPad_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pad_tree, (pcb_box_t *) & info.polygon, NULL, LOCtoPolyPad_callback, &info, NULL);
else
return pcb_true;
}
diff --git a/src/find_misc.c b/src/find_misc.c
index 118074c..ec7696b 100644
--- a/src/find_misc.c
+++ b/src/find_misc.c
@@ -38,7 +38,7 @@ static pcb_bool ListsEmpty(pcb_bool AndRats)
empty = (PVList.Location >= PVList.Number);
if (AndRats)
empty = empty && (RatList.Location >= RatList.Number);
- for (i = 0; i < max_copper_layer && empty; i++)
+ for (i = 0; i < pcb_max_copper_layer && empty; i++)
empty = empty && LineList[i].Location >= LineList[i].Number
&& ArcList[i].Location >= ArcList[i].Number && PolygonList[i].Location >= PolygonList[i].Number;
return (empty);
@@ -48,9 +48,9 @@ static void reassign_no_drc_flags(void)
{
int layer;
- for (layer = 0; layer < max_copper_layer; layer++) {
- LayerTypePtr l = LAYER_PTR(layer);
- l->no_drc = AttributeGet(l, "PCB::skip-drc") != NULL;
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
+ pcb_layer_t *l = LAYER_PTR(layer);
+ l->no_drc = pcb_attrib_get(l, "PCB::skip-drc") != NULL;
}
}
@@ -73,7 +73,7 @@ static pcb_bool DoIt(pcb_bool AndRats, pcb_bool AndDraw)
}
while (!newone && !ListsEmpty(AndRats));
if (AndDraw)
- Draw();
+ pcb_draw();
return (newone);
}
@@ -87,8 +87,8 @@ static void DrawNewConnections(void)
pcb_cardinal_t position;
/* decrement 'i' to keep layerstack order */
- for (i = max_copper_layer - 1; i != -1; i--) {
- pcb_cardinal_t layer = LayerStack[i];
+ for (i = pcb_max_copper_layer - 1; i != -1; i--) {
+ pcb_cardinal_t layer = pcb_layer_stack[i];
if (PCB->Data->Layer[layer].On) {
/* draw all new lines */
@@ -125,9 +125,9 @@ static void DrawNewConnections(void)
* sorted array pointers to PV data
*/
while (PVList.DrawLocation < PVList.Number) {
- PinTypePtr pv = PVLIST_ENTRY(PVList.DrawLocation);
+ pcb_pin_t *pv = PVLIST_ENTRY(PVList.DrawLocation);
- if (TEST_FLAG(PCB_FLAG_PIN, pv)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_PIN, pv)) {
if (PCB->PinOn)
DrawPin(pv);
}
@@ -154,52 +154,49 @@ static pcb_bool ListStart(int type, void *ptr1, void *ptr2, void *ptr3)
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
{
- if (ADD_PV_TO_LIST((PinTypePtr) ptr2, 0, NULL, FCT_START))
+ if (ADD_PV_TO_LIST((pcb_pin_t *) ptr2, 0, NULL, PCB_FCT_START))
return pcb_true;
break;
}
case PCB_TYPE_RATLINE:
{
- if (ADD_RAT_TO_LIST((RatTypePtr) ptr1, 0, NULL, FCT_START))
+ if (ADD_RAT_TO_LIST((pcb_rat_t *) ptr1, 0, NULL, PCB_FCT_START))
return pcb_true;
break;
}
case PCB_TYPE_LINE:
{
- int layer = GetLayerNumber(PCB->Data,
- (LayerTypePtr) ptr1);
+ pcb_layer_id_t layer = pcb_layer_id(PCB->Data,
+ (pcb_layer_t *) ptr1);
- if (ADD_LINE_TO_LIST(layer, (LineTypePtr) ptr2, 0, NULL, FCT_START))
+ if (ADD_LINE_TO_LIST(layer, (pcb_line_t *) ptr2, 0, NULL, PCB_FCT_START))
return pcb_true;
break;
}
case PCB_TYPE_ARC:
{
- int layer = GetLayerNumber(PCB->Data,
- (LayerTypePtr) ptr1);
-
- if (ADD_ARC_TO_LIST(layer, (ArcTypePtr) ptr2, 0, NULL, FCT_START))
+ pcb_layer_id_t layer = pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1);
+ if (ADD_ARC_TO_LIST(layer, (pcb_arc_t *) ptr2, 0, NULL, PCB_FCT_START))
return pcb_true;
break;
}
case PCB_TYPE_POLYGON:
{
- int layer = GetLayerNumber(PCB->Data,
- (LayerTypePtr) ptr1);
+ pcb_layer_id_t layer = pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1);
- if (ADD_POLYGON_TO_LIST(layer, (PolygonTypePtr) ptr2, 0, NULL, FCT_START))
+ if (ADD_POLYGON_TO_LIST(layer, (pcb_polygon_t *) ptr2, 0, NULL, PCB_FCT_START))
return pcb_true;
break;
}
case PCB_TYPE_PAD:
{
- PadTypePtr pad = (PadTypePtr) ptr2;
- if (ADD_PAD_TO_LIST(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, 0, NULL, FCT_START))
+ pcb_pad_t *pad = (pcb_pad_t *) ptr2;
+ if (ADD_PAD_TO_LIST(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE, pad, 0, NULL, PCB_FCT_START))
return pcb_true;
break;
}
@@ -214,7 +211,7 @@ static pcb_bool ListStart(int type, void *ptr1, void *ptr2, void *ptr3)
* the objects are re-drawn if AndDraw is pcb_true
* also the action is marked as undoable if AndDraw is pcb_true
*/
-void LookupConnection(Coord X, Coord Y, pcb_bool AndDraw, Coord Range, int which_flag)
+void pcb_lookup_conn(pcb_coord_t X, pcb_coord_t Y, pcb_bool AndDraw, pcb_coord_t Range, int which_flag)
{
void *ptr1, *ptr2, *ptr3;
char *name;
@@ -224,28 +221,27 @@ void LookupConnection(Coord X, Coord Y, pcb_bool AndDraw, Coord Range, int which
reassign_no_drc_flags();
- type = SearchObjectByLocation(LOOKUP_FIRST, &ptr1, &ptr2, &ptr3, X, Y, Range);
+ type = pcb_search_obj_by_location(PCB_LOOKUP_FIRST, &ptr1, &ptr2, &ptr3, X, Y, Range);
if (type == PCB_TYPE_NONE) {
- type = SearchObjectByLocation(LOOKUP_MORE, &ptr1, &ptr2, &ptr3, X, Y, Range);
+ type = pcb_search_obj_by_location(PCB_LOOKUP_MORE, &ptr1, &ptr2, &ptr3, X, Y, Range);
if (type == PCB_TYPE_NONE)
return;
- if (type & SILK_TYPE) {
- int laynum = GetLayerNumber(PCB->Data,
- (LayerTypePtr) ptr1);
+ if (type & PCB_SILK_TYPE) {
+ pcb_layer_id_t laynum = pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1);
/* don't mess with non-conducting objects! */
- if (laynum >= max_copper_layer || ((LayerTypePtr) ptr1)->no_drc)
+ if (laynum >= pcb_max_copper_layer || ((pcb_layer_t *) ptr1)->no_drc)
return;
}
}
else {
- name = ConnectionName(type, ptr1, ptr2);
- hid_actionl("NetlistShow", name, NULL);
+ name = pcb_connection_name(type, ptr1, ptr2);
+ pcb_hid_actionl("NetlistShow", name, NULL);
}
TheFlag = which_flag;
User = AndDraw;
- InitConnectionLookup();
+ pcb_conn_lookup_init();
/* now add the object to the appropriate list and start scanning
* This is step (1) from the description
@@ -253,34 +249,34 @@ void LookupConnection(Coord X, Coord Y, pcb_bool AndDraw, Coord Range, int which
ListStart(type, ptr1, ptr2, ptr3);
DoIt(pcb_true, AndDraw);
if (User)
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
User = pcb_false;
/* we are done */
if (AndDraw)
- Draw();
+ pcb_draw();
if (AndDraw && conf_core.editor.beep_when_finished)
- gui->beep();
- FreeConnectionLookupMemory();
+ pcb_gui->beep();
+ pcb_conn_lookup_uninit();
}
-void LookupConnectionByPin(int type, void *ptr1)
+void pcb_lookup_conn_by_pin(int type, void *ptr1)
{
User = 0;
- InitConnectionLookup();
+ pcb_conn_lookup_init();
ListStart(type, NULL, ptr1, NULL);
DoIt(pcb_true, pcb_false);
- FreeConnectionLookupMemory();
+ pcb_conn_lookup_uninit();
}
/* ---------------------------------------------------------------------------
* find connections for rats nesting
- * assumes InitConnectionLookup() has already been done
+ * assumes pcb_conn_lookup_init() has already been done
*/
-void RatFindHook(int type, void *ptr1, void *ptr2, void *ptr3, pcb_bool undo, pcb_bool AndRats)
+void pcb_rat_find_hook(int type, void *ptr1, void *ptr2, void *ptr3, pcb_bool undo, pcb_bool AndRats)
{
User = undo;
DumpList();
@@ -292,124 +288,124 @@ void RatFindHook(int type, void *ptr1, void *ptr2, void *ptr3, pcb_bool undo, pc
/* ---------------------------------------------------------------------------
* resets all used flags of pins and vias
*/
-pcb_bool ResetFoundPinsViasAndPads(pcb_bool AndDraw)
+pcb_bool pcb_reset_found_pins_vias_pads(pcb_bool AndDraw)
{
pcb_bool change = pcb_false;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(TheFlag, via)) {
+ if (PCB_FLAG_TEST(TheFlag, via)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- CLEAR_FLAG(TheFlag, via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_CLEAR(TheFlag, via);
if (AndDraw)
DrawVia(via);
change = pcb_true;
}
}
- END_LOOP;
- ELEMENT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(TheFlag, pin)) {
+ if (PCB_FLAG_TEST(TheFlag, pin)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- CLEAR_FLAG(TheFlag, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_CLEAR(TheFlag, pin);
if (AndDraw)
DrawPin(pin);
change = pcb_true;
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(TheFlag, pad)) {
+ if (PCB_FLAG_TEST(TheFlag, pad)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- CLEAR_FLAG(TheFlag, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_CLEAR(TheFlag, pad);
if (AndDraw)
DrawPad(pad);
change = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
if (change)
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
return change;
}
/* ---------------------------------------------------------------------------
* resets all used flags of LOs
*/
-pcb_bool ResetFoundLinesAndPolygons(pcb_bool AndDraw)
+pcb_bool pcb_reset_found_lines_polys(pcb_bool AndDraw)
{
pcb_bool change = pcb_false;
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (TEST_FLAG(TheFlag, line)) {
+ if (PCB_FLAG_TEST(TheFlag, line)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line);
- CLEAR_FLAG(TheFlag, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_CLEAR(TheFlag, line);
if (AndDraw)
DrawRat(line);
change = pcb_true;
}
}
- END_LOOP;
- COPPERLINE_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_LINE_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(TheFlag, line)) {
+ if (PCB_FLAG_TEST(TheFlag, line)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line);
- CLEAR_FLAG(TheFlag, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, layer, line, line);
+ PCB_FLAG_CLEAR(TheFlag, line);
if (AndDraw)
DrawLine(layer, line);
change = pcb_true;
}
}
- ENDALL_LOOP;
- COPPERARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(TheFlag, arc)) {
+ if (PCB_FLAG_TEST(TheFlag, arc)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc);
- CLEAR_FLAG(TheFlag, arc);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, layer, arc, arc);
+ PCB_FLAG_CLEAR(TheFlag, arc);
if (AndDraw)
DrawArc(layer, arc);
change = pcb_true;
}
}
- ENDALL_LOOP;
- COPPERPOLYGON_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(TheFlag, polygon)) {
+ if (PCB_FLAG_TEST(TheFlag, polygon)) {
if (AndDraw)
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon);
- CLEAR_FLAG(TheFlag, polygon);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, layer, polygon, polygon);
+ PCB_FLAG_CLEAR(TheFlag, polygon);
if (AndDraw)
DrawPolygon(layer, polygon);
change = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (change)
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
return change;
}
/* ---------------------------------------------------------------------------
* resets all found connections
*/
-pcb_bool ResetConnections(pcb_bool AndDraw)
+pcb_bool pcb_reset_conns(pcb_bool AndDraw)
{
pcb_bool change = pcb_false;
- change = ResetFoundPinsViasAndPads(AndDraw) || change;
- change = ResetFoundLinesAndPolygons(AndDraw) || change;
+ change = pcb_reset_found_pins_vias_pads(AndDraw) || change;
+ change = pcb_reset_found_lines_polys(AndDraw) || change;
return change;
}
@@ -430,7 +426,7 @@ static void DumpList(void)
PVList.Number = 0;
PVList.Location = 0;
- for (i = 0; i < max_copper_layer; i++) {
+ for (i = 0; i < pcb_max_copper_layer; i++) {
LineList[i].Location = 0;
LineList[i].DrawLocation = 0;
LineList[i].Number = 0;
@@ -449,7 +445,7 @@ static void DumpList(void)
/*----------------------------------------------------------------------------
* set up a temporary flag to use
*/
-void SaveFindFlag(int NewFlag)
+void pcb_save_find_flag(int NewFlag)
{
OldFlag = TheFlag;
TheFlag = NewFlag;
@@ -458,19 +454,19 @@ void SaveFindFlag(int NewFlag)
/*----------------------------------------------------------------------------
* restore flag
*/
-void RestoreFindFlag(void)
+void pcb_restore_find_flag(void)
{
TheFlag = OldFlag;
}
-void InitConnectionLookup(void)
+void pcb_conn_lookup_init(void)
{
- InitComponentLookup();
- InitLayoutLookup();
+ pcb_component_lookup_init();
+ pcb_layout_lookup_init();
}
-void FreeConnectionLookupMemory(void)
+void pcb_conn_lookup_uninit(void)
{
- FreeComponentLookupMemory();
- FreeLayoutLookupMemory();
+ pcb_component_lookup_uninit();
+ pcb_layout_lookup_uninit();
}
diff --git a/src/find_print.c b/src/find_print.c
index 18d96e9..051bbc1 100644
--- a/src/find_print.c
+++ b/src/find_print.c
@@ -32,23 +32,23 @@ static pcb_bool PrepareNextLoop(FILE * FP);
/* ---------------------------------------------------------------------------
* prints all unused pins of an element to file FP
*/
-static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(ElementTypePtr Element, FILE * FP)
+static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(pcb_element_t *Element, FILE * FP)
{
pcb_bool first = pcb_true;
pcb_cardinal_t number;
/* check all pins in element */
- PIN_LOOP(Element);
+ PCB_PIN_LOOP(Element);
{
- if (!TEST_FLAG(PCB_FLAG_HOLE, pin)) {
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)) {
/* pin might have bee checked before, add to list if not */
- if (!TEST_FLAG(TheFlag, pin) && FP) {
+ if (!PCB_FLAG_TEST(TheFlag, pin) && FP) {
int i;
if (ADD_PV_TO_LIST(pin, 0, NULL, 0))
return pcb_true;
DoIt(pcb_true, pcb_true);
- number = PadList[COMPONENT_LAYER].Number + PadList[SOLDER_LAYER].Number + PVList.Number;
+ number = PadList[PCB_COMPONENT_SIDE].Number + PadList[PCB_SOLDER_SIDE].Number + PVList.Number;
/* the pin has no connection if it's the only
* list entry; don't count vias
*/
@@ -64,9 +64,9 @@ static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(ElementTypePtr Element,
/* write name to list and draw selected object */
fputc('\t', FP);
- PrintQuotedString(FP, (char *) EMPTY(pin->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Name));
fputc('\n', FP);
- SET_FLAG(PCB_FLAG_SELECTED, pin);
+ PCB_FLAG_SET(PCB_FLAG_SELECTED, pin);
DrawPin(pin);
}
@@ -76,20 +76,20 @@ static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(ElementTypePtr Element,
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* check all pads in element */
- PAD_LOOP(Element);
+ PCB_PAD_LOOP(Element);
{
/* lookup pad in list */
/* pad might has bee checked before, add to list if not */
- if (!TEST_FLAG(TheFlag, pad) && FP) {
+ if (!PCB_FLAG_TEST(TheFlag, pad) && FP) {
int i;
- if (ADD_PAD_TO_LIST(TEST_FLAG(PCB_FLAG_ONSOLDER, pad)
- ? SOLDER_LAYER : COMPONENT_LAYER, pad, 0, NULL, 0))
+ if (ADD_PAD_TO_LIST(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad)
+ ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE, pad, 0, NULL, 0))
return pcb_true;
DoIt(pcb_true, pcb_true);
- number = PadList[COMPONENT_LAYER].Number + PadList[SOLDER_LAYER].Number + PVList.Number;
+ number = PadList[PCB_COMPONENT_SIDE].Number + PadList[PCB_SOLDER_SIDE].Number + PVList.Number;
/* the pin has no connection if it's the only
* list entry; don't count vias
*/
@@ -105,10 +105,10 @@ static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(ElementTypePtr Element,
/* write name to list and draw selected object */
fputc('\t', FP);
- PrintQuotedString(FP, (char *) EMPTY(pad->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Name));
fputc('\n', FP);
- SET_FLAG(PCB_FLAG_SELECTED, pad);
+ PCB_FLAG_SET(PCB_FLAG_SELECTED, pad);
DrawPad(pad);
}
@@ -117,7 +117,7 @@ static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(ElementTypePtr Element,
return (pcb_true);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* print separator if element has unused pins or pads */
if (!first) {
@@ -135,7 +135,7 @@ static pcb_bool PrepareNextLoop(FILE * FP)
pcb_cardinal_t layer;
/* reset found LOs for the next pin */
- for (layer = 0; layer < max_copper_layer; layer++) {
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
LineList[layer].Location = LineList[layer].Number = 0;
ArcList[layer].Location = ArcList[layer].Number = 0;
PolygonList[layer].Location = PolygonList[layer].Number = 0;
@@ -157,55 +157,55 @@ static pcb_bool PrepareNextLoop(FILE * FP)
* The result is written to file FP
* Returns pcb_true if operation was aborted
*/
-static pcb_bool PrintElementConnections(ElementTypePtr Element, FILE * FP, pcb_bool AndDraw)
+static pcb_bool PrintElementConnections(pcb_element_t *Element, FILE * FP, pcb_bool AndDraw)
{
PrintConnectionElementName(Element, FP);
/* check all pins in element */
- PIN_LOOP(Element);
+ PCB_PIN_LOOP(Element);
{
/* pin might have been checked before, add to list if not */
- if (TEST_FLAG(TheFlag, pin)) {
- PrintConnectionListEntry((char *) EMPTY(pin->Name), NULL, pcb_true, FP);
+ if (PCB_FLAG_TEST(TheFlag, pin)) {
+ PrintConnectionListEntry((char *) PCB_EMPTY(pin->Name), NULL, pcb_true, FP);
fputs("\t\t__CHECKED_BEFORE__\n\t}\n", FP);
continue;
}
- if (ADD_PV_TO_LIST(pin, PCB_TYPE_ELEMENT, Element, FCT_ELEMENT))
+ if (ADD_PV_TO_LIST(pin, PCB_TYPE_ELEMENT, Element, PCB_FCT_ELEMENT))
return pcb_true;
DoIt(pcb_true, AndDraw);
/* printout all found connections */
PrintPinConnections(FP, pcb_true);
- PrintPadConnections(COMPONENT_LAYER, FP, pcb_false);
- PrintPadConnections(SOLDER_LAYER, FP, pcb_false);
+ PrintPadConnections(PCB_COMPONENT_SIDE, FP, pcb_false);
+ PrintPadConnections(PCB_SOLDER_SIDE, FP, pcb_false);
fputs("\t}\n", FP);
if (PrepareNextLoop(FP))
return (pcb_true);
}
- END_LOOP;
+ PCB_END_LOOP;
/* check all pads in element */
- PAD_LOOP(Element);
+ PCB_PAD_LOOP(Element);
{
pcb_cardinal_t layer;
/* pad might have been checked before, add to list if not */
- if (TEST_FLAG(TheFlag, pad)) {
- PrintConnectionListEntry((char *) EMPTY(pad->Name), NULL, pcb_true, FP);
+ if (PCB_FLAG_TEST(TheFlag, pad)) {
+ PrintConnectionListEntry((char *) PCB_EMPTY(pad->Name), NULL, pcb_true, FP);
fputs("\t\t__CHECKED_BEFORE__\n\t}\n", FP);
continue;
}
- layer = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER;
- if (ADD_PAD_TO_LIST(layer, pad, PCB_TYPE_ELEMENT, Element, FCT_ELEMENT))
+ layer = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE;
+ if (ADD_PAD_TO_LIST(layer, pad, PCB_TYPE_ELEMENT, Element, PCB_FCT_ELEMENT))
return pcb_true;
DoIt(pcb_true, AndDraw);
/* print all found connections */
PrintPadConnections(layer, FP, pcb_true);
- PrintPadConnections(layer == (COMPONENT_LAYER ? SOLDER_LAYER : COMPONENT_LAYER), FP, pcb_false);
+ PrintPadConnections(layer == (PCB_COMPONENT_SIDE ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE), FP, pcb_false);
PrintPinConnections(FP, pcb_false);
fputs("\t}\n", FP);
if (PrepareNextLoop(FP))
return (pcb_true);
}
- END_LOOP;
+ PCB_END_LOOP;
fputs("}\n\n", FP);
return (pcb_false);
}
@@ -213,14 +213,14 @@ static pcb_bool PrintElementConnections(ElementTypePtr Element, FILE * FP, pcb_b
/* ---------------------------------------------------------------------------
* find all unused pins of all element
*/
-void LookupUnusedPins(FILE * FP)
+void pcb_lookup_unused_pins(FILE * FP)
{
/* reset all currently marked connections */
User = pcb_true;
- ResetConnections(pcb_true);
- InitConnectionLookup();
+ pcb_reset_conns(pcb_true);
+ pcb_conn_lookup_init();
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/* break if abort dialog returned pcb_true;
* passing NULL as filedescriptor discards the normal output
@@ -228,61 +228,61 @@ void LookupUnusedPins(FILE * FP)
if (PrintAndSelectUnusedPinsAndPadsOfElement(element, FP))
break;
}
- END_LOOP;
+ PCB_END_LOOP;
if (conf_core.editor.beep_when_finished)
- gui->beep();
- FreeConnectionLookupMemory();
- IncrementUndoSerialNumber();
+ pcb_gui->beep();
+ pcb_conn_lookup_uninit();
+ pcb_undo_inc_serial();
User = pcb_false;
- Draw();
+ pcb_draw();
}
/* ---------------------------------------------------------------------------
* find all connections to pins within one element
*/
-void LookupElementConnections(ElementTypePtr Element, FILE * FP)
+void pcb_lookup_element_conns(pcb_element_t *Element, FILE * FP)
{
/* reset all currently marked connections */
User = pcb_true;
TheFlag = PCB_FLAG_FOUND;
- ResetConnections(pcb_true);
- InitConnectionLookup();
+ pcb_reset_conns(pcb_true);
+ pcb_conn_lookup_init();
PrintElementConnections(Element, FP, pcb_true);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
if (conf_core.editor.beep_when_finished)
- gui->beep();
- FreeConnectionLookupMemory();
- IncrementUndoSerialNumber();
+ pcb_gui->beep();
+ pcb_conn_lookup_uninit();
+ pcb_undo_inc_serial();
User = pcb_false;
- Draw();
+ pcb_draw();
}
/* ---------------------------------------------------------------------------
* find all connections to pins of all element
*/
-void LookupConnectionsToAllElements(FILE * FP)
+void pcb_lookup_conns_to_all_elements(FILE * FP)
{
/* reset all currently marked connections */
User = pcb_false;
TheFlag = PCB_FLAG_FOUND;
- ResetConnections(pcb_false);
- InitConnectionLookup();
+ pcb_reset_conns(pcb_false);
+ pcb_conn_lookup_init();
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/* break if abort dialog returned pcb_true */
if (PrintElementConnections(element, FP, pcb_false))
break;
SEPARATE(FP);
if (conf_core.editor.reset_after_element && gdl_it_idx(&__it__) != 1)
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
}
- END_LOOP;
+ PCB_END_LOOP;
if (conf_core.editor.beep_when_finished)
- gui->beep();
- ResetConnections(pcb_false);
- FreeConnectionLookupMemory();
- Redraw();
+ pcb_gui->beep();
+ pcb_reset_conns(pcb_false);
+ pcb_conn_lookup_uninit();
+ pcb_redraw();
}
diff --git a/src/flag.c b/src/flag.c
new file mode 100644
index 0000000..5fdb1c7
--- /dev/null
+++ b/src/flag.c
@@ -0,0 +1,87 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2004,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "flag.h"
+
+/* This just fills in a pcb_flag_t with current flags. */
+pcb_flag_t pcb_flag_make(unsigned int flags)
+{
+ pcb_flag_t rv;
+ memset(&rv, 0, sizeof(rv));
+ rv.f = flags;
+ return rv;
+}
+
+pcb_flag_t pcb_flag_add(pcb_flag_t flag, unsigned int flags)
+{
+ flag.f |= flags;
+ return flag;
+}
+
+pcb_flag_t pcb_flag_mask(pcb_flag_t flag, unsigned int flags)
+{
+ flag.f &= ~flags;
+ return flag;
+}
+
+int pcb_mem_any_set(unsigned char *ptr, int bytes)
+{
+ while (bytes--)
+ if (*ptr++)
+ return 1;
+ return 0;
+}
+
+void pcb_flag_erase(pcb_flag_t * f)
+{
+ pcb_unknown_flag_t *u, *next;
+ for (u = f->unknowns; u != NULL; u = next) {
+ free(u->str);
+ next = u->next;
+ free(u);
+ }
+ f->unknowns = NULL;
+}
+
+int pcb_flag_eq(pcb_flag_t *f1, pcb_flag_t *f2)
+{
+ if (f1->f != f2->f)
+ return 0;
+
+ if (f1->q != f2->q)
+ return 0;
+
+ if (f1->int_conn_grp != f2->int_conn_grp)
+ return 0;
+
+ /* WARNING: ignore unknowns for now: the only place where we use this function,
+ undo.c, won't care */
+
+ return (memcmp(f1->t, &f2->t, sizeof(f1->t)) == 0);
+}
diff --git a/src/flag.h b/src/flag.h
new file mode 100644
index 0000000..9840b6b
--- /dev/null
+++ b/src/flag.h
@@ -0,0 +1,240 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_FLAG_H
+#define PCB_FLAG_H
+
+#include "globalconst.h"
+
+/* Nobody should know about the internals of this except the macros in
+ macros.h that access it. This structure must be simple-assignable
+ for now. */
+typedef struct pcb_unknown_flag_s pcb_unknown_flag_t;
+struct pcb_unknown_flag_s {
+ char *str;
+ pcb_unknown_flag_t *next;
+};
+
+typedef struct {
+ unsigned long f; /* generic flags */
+ unsigned char t[(PCB_MAX_LAYER + 1) / 2]; /* thermals */
+ unsigned char q; /* square geometry flag */
+ unsigned char int_conn_grp;
+ pcb_unknown_flag_t *unknowns;
+} pcb_flag_t;
+
+extern pcb_flag_t no_flags;
+
+/* ---------------------------------------------------------------------------
+ * object flags
+ */
+
+/* %start-doc pcbfile ~objectflags
+ at node Object Flags
+ at section Object Flags
+
+Note that object flags can be given numerically (like @code{0x0147})
+or symbolically (like @code{"found,showname,square"}. Some numeric
+values are reused for different object types. The table below lists
+the numeric value followed by the symbolic name.
+%end-doc */
+typedef enum {
+ PCB_FLAG_NO = 0x00000,
+ PCB_FLAG_PIN = 0x00001, /*!< If set, this object is a pin. This flag is for internal use only. */
+ PCB_FLAG_VIA = 0x00002, /*!< Likewise, for vias. */
+ PCB_FLAG_FOUND = 0x00004, /*!< If set, this object has been found by @code{FindConnection()}. */
+ PCB_FLAG_HOLE = 0x00008, /*!< For pins and vias, this flag means that the pin or via is a hole without a copper annulus. */
+ PCB_FLAG_NOPASTE = 0x00008, /*!< Pad should not receive solderpaste. This is to support fiducials */
+ PCB_FLAG_RAT = 0x00010, /*!< If set for a line, indicates that this line is a rat line instead of a copper trace. */
+ PCB_FLAG_PININPOLY = 0x00010, /*!< For pins and pads, this flag is used internally to indicate that the pin or pad overlaps a polygon on some layer.*/
+ PCB_FLAG_CLEARPOLY = 0x00010, /*!< For polygons, this flag means that pins and vias will normally clear these polygons (thus, thermals are required for electrical connection). When clear, polygons will solidly connect to pins and vias. */
+ PCB_FLAG_HIDENAME = 0x00010, /*!< For elements, when set the name of the element is hidden. */
+ PCB_FLAG_DISPLAYNAME = 0x00020, /*!< For elements, when set the names of pins are shown. */
+ PCB_FLAG_CLEARLINE = 0x00020, /*!< For lines and arcs, the line/arc will clear polygons instead of connecting to them. */
+ PCB_FLAG_FULLPOLY = 0x00020, /*!< For polygons, the full polygon is drawn (i.e. all parts instead of only the biggest one). */
+ PCB_FLAG_SELECTED = 0x00040, /*!< Set when the object is selected. */
+ PCB_FLAG_ONSOLDER = 0x00080, /*!< For elements and pads, indicates that they are on the solder side. */
+ PCB_FLAG_AUTO = 0x00080, /*!< For lines and vias, indicates that these were created by the autorouter. */
+ PCB_FLAG_SQUARE = 0x00100, /*!< For pins and pads, indicates a square (vs round) pin/pad. */
+ PCB_FLAG_RUBBEREND = 0x00200, /*!< For lines, used internally for rubber band moves: indicates one end already rubber banding. */
+ PCB_FLAG_WARN = 0x00200, /*!< For pins, vias, and pads, set to indicate a warning. */
+ PCB_FLAG_USETHERMAL = 0x00400, /*!< Obsolete, indicates that pins/vias should be drawn with thermal fingers. */
+ PCB_FLAG_ONSILK = 0x00400, /*!< Obsolete, old files used this to indicate lines drawn on silk. (Used by io_pcb for compatibility.) */
+ PCB_FLAG_OCTAGON = 0x00800, /*!< Draw pins and vias as octagons. */
+ PCB_FLAG_DRC = 0x01000, /*!< Set for objects that fail DRC: flag like FOUND flag for DRC checking. */
+ PCB_FLAG_LOCK = 0x02000, /*!< Set for locked objects. */
+ PCB_FLAG_EDGE2 = 0x04000, /*!< For pads, indicates that the second point is closer to the edge. For pins, indicates that the pin is closer to a horizontal edge and thus pinout text should be vertical. (Padr.Point2 is closer to outside edge also pinout text for pins is vertical) */
+ PCB_FLAG_VISIT = 0x08000, /*!< marker to avoid re-visiting an object */
+ PCB_FLAG_NONETLIST = 0x10000, /* element is not on the netlist and should not interfere with the netlist */
+ PCB_FLAG_MINCUT = 0x20000, /* used by the mincut short find code */
+ PCB_FLAG_ONPOINT = 0x40000 /*!< crosshair is on line point or arc point */
+/* PCB_FLAG_NOCOPY = (PCB_FLAG_FOUND | CONNECTEDFLAG | PCB_FLAG_ONPOINT)*/
+} pcb_flag_values_t;
+
+/* ---------------------------------------------------------------------------
+ * PCB flags - kept only for file format compatibility reasons; these bits
+ should be a mirror of booleans from the conf.
+ */
+/* %start-doc pcbfile ~pcbflags
+ at node PCBFlags
+ at section PCBFlags
+ at table @code
+ at item 0x00001
+Pinout displays pin numbers instead of pin names.
+ at item 0x00002
+Use local reference for moves, by setting the mark at the beginning of
+each move.
+ at item 0x00004
+When set, only polygons and their clearances are drawn, to see if
+polygons have isolated regions.
+ at item 0x00008
+Display DRC region on crosshair.
+ at item 0x00010
+Do all move, mirror, rotate with rubberband connections.
+ at item 0x00020
+Display descriptions of elements, instead of refdes.
+ at item 0x00040
+Display names of elements, instead of refdes.
+ at item 0x00080
+Auto-DRC flag. When set, PCB doesn't let you place copper that
+violates DRC.
+ at item 0x00100
+Enable 'all-direction' lines.
+ at item 0x00200
+Switch starting angle after each click.
+ at item 0x00400
+Force unique names on board.
+ at item 0x00800
+New lines/arc clear polygons.
+ at item 0x01000
+pcb_crosshair snaps to pins and pads.
+ at item 0x02000
+Show the solder mask layer.
+ at item 0x04000
+Draw with thin lines.
+ at item 0x08000
+Move items orthogonally.
+ at item 0x10000
+Draw autoroute paths real-time.
+ at item 0x20000
+New polygons are full ones.
+ at item 0x40000
+Names are locked, the mouse cannot select them.
+ at item 0x80000
+Everything but names are locked, the mouse cannot select anything else.
+ at item 0x100000
+New polygons are full polygons.
+ at item 0x200000
+When set, element names are not drawn.
++ at item 0x800000
++snap to certain off-grid points.
++ at item 0x1000000
++highlight lines and arcs when the crosshair is on one of their endpoints.
+ at end table
+%end-doc */
+
+#define PCB_FLAGS 0x01ffffff /* all used flags */
+
+#define PCB_SHOWNUMBERFLAG 0x00000001
+#define PCB_LOCALREFFLAG 0x00000002
+#define PCB_CHECKPLANESFLAG 0x00000004
+#define PCB_SHOWPCB_FLAG_DRC 0x00000008
+#define PCB_RUBBERBANDFLAG 0x00000010
+#define PCB_DESCRIPTIONFLAG 0x00000020
+#define PCB_NAMEONPCBFLAG 0x00000040
+#define PCB_AUTOPCB_FLAG_DRC 0x00000080
+#define PCB_ALLDIRECTIONFLAG 0x00000100
+#define PCB_SWAPSTARTDIRFLAG 0x00000200
+#define PCB_UNIQUENAMEFLAG 0x00000400
+#define PCB_CLEARNEWFLAG 0x00000800
+#define PCB_SNAPPCB_FLAG_PIN 0x00001000
+#define PCB_SHOWMASKFLAG 0x00002000
+#define PCB_THINDRAWFLAG 0x00004000
+#define PCB_ORTHOMOVEFLAG 0x00008000
+#define PCB_LIVEROUTEFLAG 0x00010000
+#define PCB_THINDRAWPOLYFLAG 0x00020000
+#define PCB_LOCKNAMESFLAG 0x00040000
+#define PCB_ONLYNAMESFLAG 0x00080000
+#define PCB_NEWPCB_FLAG_FULLPOLY 0x00100000
+#define PCB_HIDENAMESFLAG 0x00200000
+#define PCB_ENABLEPCB_FLAG_MINCUT 0x00400000
+
+
+
+/* For passing modified flags to other functions. */
+pcb_flag_t pcb_flag_make(unsigned int);
+pcb_flag_t pcb_flag_add(pcb_flag_t, unsigned int);
+pcb_flag_t pcb_flag_mask(pcb_flag_t, unsigned int);
+void pcb_flag_erase(pcb_flag_t *f);
+#define pcb_no_flags() pcb_flag_make(0)
+
+/* ---------------------------------------------------------------------------
+ * some routines for flag setting, clearing, changing and testing
+ */
+#define PCB_FLAG_SET(F,P) ((P)->Flags.f |= (F))
+#define PCB_FLAG_CLEAR(F,P) ((P)->Flags.f &= (~(F)))
+#define PCB_FLAG_TEST(F,P) ((P)->Flags.f & (F) ? 1 : 0)
+#define PCB_FLAG_TOGGLE(F,P) ((P)->Flags.f ^= (F))
+#define PCB_FLAG_ASSIGN(F,V,P) ((P)->Flags.f = ((P)->Flags.f & (~(F))) | ((V) ? (F) : 0))
+#define PCB_FLAGS_TEST(F,P) (((P)->Flags.f & (F)) == (F) ? 1 : 0)
+
+typedef enum {
+ PCB_CHGFLG_CLEAR,
+ PCB_CHGFLG_SET,
+ PCB_CHGFLG_TOGGLE
+} pcb_change_flag_t;
+
+#define PCB_FLAG_CHANGE(how, F, P) \
+do { \
+ switch(how) { \
+ case PCB_CHGFLG_CLEAR: PCB_FLAG_CLEAR(F, P); break; \
+ case PCB_CHGFLG_SET: PCB_FLAG_SET(F, P); break; \
+ case PCB_CHGFLG_TOGGLE: PCB_FLAG_TOGGLE(F, P); break; \
+ } \
+} while(0)
+
+int pcb_flag_eq(pcb_flag_t *f1, pcb_flag_t *f2);
+#define PCB_FLAG_EQ(F1,F2) pcb_flag_eq(&(F1), &(F2))
+
+#define PCB_FLAG_THERM(L) (0xf << (4 *((L) % 2)))
+
+#define PCB_FLAG_THERM_TEST(L,P) ((P)->Flags.t[(L)/2] & PCB_FLAG_THERM(L) ? 1 : 0)
+#define PCB_FLAG_THERM_GET(L,P) (((P)->Flags.t[(L)/2] >> (4 * ((L) % 2))) & 0xf)
+#define PCB_FLAG_THERM_CLEAR(L,P) (P)->Flags.t[(L)/2] &= ~PCB_FLAG_THERM(L)
+#define PCB_FLAG_THERM_ASSIGN(L,V,P) (P)->Flags.t[(L)/2] = ((P)->Flags.t[(L)/2] & ~PCB_FLAG_THERM(L)) | ((V) << (4 * ((L) % 2)))
+
+
+#define PCB_FLAG_SQUARE_GET(P) ((P)->Flags.q)
+#define PCB_FLAG_SQUARE_CLEAR(P) (P)->Flags.q = 0
+#define PCB_FLAG_SQUARE_ASSIGN(V,P) (P)->Flags.q = V
+
+
+#define PCB_FLAG_INTCONN_GET(P) ((P)->Flags.int_conn_grp)
+
+extern int pcb_mem_any_set(unsigned char *, int);
+#define PCB_FLAG_THERM_TEST_ANY(P) pcb_mem_any_set((P)->Flags.t, sizeof((P)->Flags.t))
+
+#endif
diff --git a/src/flag_str.c b/src/flag_str.c
new file mode 100644
index 0000000..5eadc36
--- /dev/null
+++ b/src/flag_str.c
@@ -0,0 +1,580 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 2005 DJ Delorie
+ *
+ * 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:
+ * DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA
+ * dj at delorie.com
+ *
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+
+#include "const.h"
+#include "flag_str.h"
+#include "compat_misc.h"
+#include "macro.h"
+
+/* Because all the macros expect it, that's why. */
+typedef struct {
+ pcb_flag_t Flags;
+} FlagHolder;
+
+/* Be careful to list more specific flags first, followed by general
+ * flags, when two flags use the same bit. For example, "onsolder" is
+ * for elements only, while "auto" is for everything else. They use
+ * the same bit, but onsolder is listed first so that elements will
+ * use it and not auto.
+ *
+ * Thermals are handled separately, as they're layer-selective.
+ */
+
+#define N(x) x, sizeof(x)-1
+pcb_flag_bits_t pcb_object_flagbits[] = {
+ {PCB_FLAG_PIN, N("pin"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_VIA, N("via"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_FOUND, N("found"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_HOLE, N("hole"), PCB_TYPEMASK_PIN},
+ {PCB_FLAG_RAT, N("rat"), PCB_TYPE_RATLINE},
+ {PCB_FLAG_PININPOLY, N("pininpoly"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
+ {PCB_FLAG_CLEARPOLY, N("clearpoly"), PCB_TYPE_POLYGON},
+ {PCB_FLAG_HIDENAME, N("hidename"), PCB_TYPE_ELEMENT},
+ {PCB_FLAG_DISPLAYNAME, N("showname"), PCB_TYPE_ELEMENT},
+ {PCB_FLAG_CLEARLINE, N("clearline"), PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_TEXT},
+ {PCB_FLAG_SELECTED, N("selected"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_ONSOLDER, N("onsolder"), PCB_TYPE_ELEMENT | PCB_TYPE_PAD | PCB_TYPE_TEXT},
+ {PCB_FLAG_AUTO, N("auto"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_SQUARE, N("square"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
+ {PCB_FLAG_RUBBEREND, N("rubberend"), PCB_TYPE_LINE | PCB_TYPE_ARC},
+ {PCB_FLAG_WARN, N("warn"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
+ {PCB_FLAG_USETHERMAL, N("usetherm"), PCB_TYPEMASK_PIN | PCB_TYPE_LINE | PCB_TYPE_ARC},
+ {PCB_FLAG_OCTAGON, N("octagon"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
+ {PCB_FLAG_DRC, N("drc"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_LOCK, N("lock"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_EDGE2, N("edge2"), PCB_TYPEMASK_ALL},
+ {PCB_FLAG_FULLPOLY, N("fullpoly"), PCB_TYPE_POLYGON},
+ {PCB_FLAG_NOPASTE, N("nopaste"), PCB_TYPE_PAD},
+ {PCB_FLAG_NONETLIST, N("nonetlist"), PCB_TYPEMASK_ALL}
+};
+#undef N
+
+const int pcb_object_flagbits_len = PCB_ENTRIES(pcb_object_flagbits);
+
+
+/*
+ * This helper function maintains a small list of buffers which are
+ * used by pcb_strflg_f2s(). Each buffer is allocated from the heap,
+ * but the caller must not free them (they get realloced when they're
+ * reused, but never completely freed).
+ */
+
+static struct {
+ char *ptr;
+ int len;
+} buffers[10];
+static int bufptr = 0;
+static char *alloc_buf(int len)
+{
+#define B buffers[bufptr]
+ len++;
+ bufptr = (bufptr + 1) % 10;
+ if (B.len < len) {
+ if (B.ptr)
+ B.ptr = (char *) realloc(B.ptr, len);
+ else
+ B.ptr = (char *) malloc(len);
+ B.len = len;
+ }
+ return B.ptr;
+#undef B
+}
+
+void pcb_strflg_uninit_buf(void)
+{
+ int n;
+ for(n = 0; n < 10; n++) {
+ if (buffers[n].ptr != NULL) {
+ free(buffers[n].ptr);
+ buffers[n].ptr = NULL;
+ }
+ }
+}
+
+/*
+ * This set of routines manages a list of layer-specific flags.
+ * Callers should call grow_layer_list(0) to reset the list, and
+ * set_layer_list(layer,1) to set bits in the layer list. The results
+ * are stored in layers[], which has num_layers valid entries.
+ */
+
+static char *layers = 0;
+static int max_layers = 0, num_layers = 0;
+
+static void grow_layer_list(int num)
+{
+ if (layers == 0) {
+ layers = (char *) calloc(num > 0 ? num : 1, 1);
+ max_layers = num;
+ }
+ else if (num > max_layers) {
+ max_layers = num;
+ layers = (char *) realloc(layers, max_layers);
+ }
+ if (num > num_layers)
+ memset(layers + num_layers, 0, num - num_layers - 1);
+ num_layers = num;
+ return;
+}
+
+void pcb_strflg_uninit_layerlist(void)
+{
+ if (layers != NULL) {
+ free(layers);
+ layers = NULL;
+ num_layers = max_layers = 0;
+ }
+}
+
+static inline void set_layer_list(int layer, int v)
+{
+ if (layer >= num_layers)
+ grow_layer_list(layer + 1);
+ layers[layer] = v;
+}
+
+/*
+ * These next two convert between layer lists and strings.
+ * parse_layer_list() is passed a pointer to a string, and parses a
+ * list of integer which reflect layers to be flagged. It returns a
+ * pointer to the first character following the list. The syntax of
+ * the list is a paren-surrounded, comma-separated list of integers
+ * and/or pairs of integers separated by a dash (like "(1,2,3-7)").
+ * Spaces and other punctuation are not allowed. The results are
+ * stored in layers[] defined above.
+ *
+ * print_layer_list() does the opposite - it uses the flags set in
+ * layers[] to build a string that represents them, using the syntax
+ * above.
+ *
+ */
+
+/* Returns a pointer to the first character past the list. */
+static const char *parse_layer_list(const char *bp, int (*error) (const char *))
+{
+ const char *orig_bp = bp;
+ int l = 0, range = -1;
+ int value = 1;
+
+ grow_layer_list(0);
+ while (*bp) {
+ if (*bp == '+')
+ value = 2;
+ else if (*bp == 'S')
+ value = 3;
+ else if (*bp == 'X')
+ value = 4;
+ else if (*bp == 't')
+ value = 5;
+ else if (*bp == ')' || *bp == ',' || *bp == '-') {
+ if (range == -1)
+ range = l;
+ while (range <= l)
+ set_layer_list(range++, value);
+ if (*bp == '-')
+ range = l;
+ else
+ range = -1;
+ value = 1;
+ l = 0;
+ }
+
+ else if (isdigit((int) *bp))
+ l = l * 10 + (*bp - '0');
+
+ else if (error) {
+ const char *fmt = "Syntax error parsing layer list \"%.*s\" at %c";
+ char *msg = alloc_buf(strlen(fmt) + strlen(orig_bp));
+ sprintf(msg, fmt, bp - orig_bp + 5, orig_bp, *bp);
+ error(msg);
+ error = NULL;
+ }
+
+ if (*bp == ')')
+ return bp + 1;
+
+ bp++;
+ }
+ return bp;
+}
+
+/* Number of character the value "i" requires when printed. */
+static int printed_int_length(int i, int j)
+{
+ int rv;
+
+ if (i < 10)
+ return 1 + (j ? 1 : 0);
+ if (i < 100)
+ return 2 + (j ? 1 : 0);
+
+ for (rv = 1; i >= 10; rv++)
+ i /= 10;
+ return rv + (j ? 1 : 0);
+}
+
+/* Returns a pointer to an internal buffer which is overwritten with
+ each new call. */
+static char *print_layer_list()
+{
+ static char *buf = 0;
+ static int buflen = 0;
+ int len, i, j;
+ char *bp;
+
+ len = 2;
+ for (i = 0; i < num_layers; i++)
+ if (layers[i])
+ len += 1 + printed_int_length(i, layers[i]);
+ if (buflen < len) {
+ if (buf)
+ buf = (char *) realloc(buf, len);
+ else
+ buf = (char *) malloc(len);
+ buflen = len;
+ }
+
+ bp = buf;
+ *bp++ = '(';
+
+ for (i = 0; i < num_layers; i++)
+ if (layers[i]) {
+ /* 0 0 1 1 1 0 0 */
+ /* i j */
+ for (j = i + 1; j < num_layers && layers[j] == 1; j++);
+ if (j > i + 2) {
+ sprintf(bp, "%d-%d,", i, j - 1);
+ i = j - 1;
+ }
+ else
+ switch (layers[i]) {
+ case 1:
+ sprintf(bp, "%d,", i);
+ break;
+ case 2:
+ sprintf(bp, "%d+,", i);
+ break;
+ case 3:
+ sprintf(bp, "%dS,", i);
+ break;
+ case 4:
+ sprintf(bp, "%dX,", i);
+ break;
+ case 5:
+ default:
+ sprintf(bp, "%dt,", i);
+ break;
+ }
+ bp += strlen(bp);
+ }
+ bp[-1] = ')';
+ *bp = 0;
+ return buf;
+}
+
+/*
+ * Ok, now the two entry points to this file. The first, string_to_flags,
+ * is passed a string (usually from parse_y.y) and returns a "set of flags".
+ * In theory, this can be anything, but for now it's just an integer. Later
+ * it might be a structure, for example.
+ *
+ * Currently, there is no error handling :-P
+ */
+
+static int error_ignore(const char *msg)
+{ /* do nothing */
+ return 0;
+}
+
+static pcb_flag_t empty_flags;
+
+pcb_flag_t pcb_strflg_common_s2f(const char *flagstring, int (*error) (const char *msg), pcb_flag_bits_t * flagbits, int n_flagbits)
+{
+ const char *fp, *ep;
+ int flen;
+ FlagHolder rv;
+ int i;
+
+ rv.Flags = empty_flags;
+
+ if (error == 0)
+ error = error_ignore;
+
+ if (flagstring == NULL)
+ return empty_flags;
+
+ fp = ep = flagstring;
+
+ if (*fp == '"')
+ ep = ++fp;
+
+ while (*ep && *ep != '"') {
+ int found = 0;
+
+ for (ep = fp; *ep && *ep != ',' && *ep != '"' && *ep != '('; ep++);
+ flen = ep - fp;
+ if (*ep == '(')
+ ep = parse_layer_list(ep + 1, error);
+
+ if (flen == 7 && memcmp(fp, "thermal", 7) == 0) {
+ for (i = 0; i < PCB_MAX_LAYER && i < num_layers; i++)
+ if (layers[i])
+ PCB_FLAG_THERM_ASSIGN(i, layers[i], &rv);
+ }
+ else if (flen == 5 && memcmp(fp, "shape", 5) == 0) {
+ rv.Flags.q = atoi(fp + 6);
+ }
+ else if (flen == 7 && memcmp(fp, "intconn", 7) == 0) {
+ rv.Flags.int_conn_grp = atoi(fp + 8);
+ }
+ else {
+ for (i = 0; i < n_flagbits; i++)
+ if (flagbits[i].nlen == flen && memcmp(flagbits[i].name, fp, flen) == 0) {
+ found = 1;
+ PCB_FLAG_SET(flagbits[i].mask, &rv);
+ break;
+ }
+ if (!found) {
+ const char *fmt = "Unknown flag: \"%.*s\" ignored";
+ pcb_unknown_flag_t *u;
+ char *msg;
+ const char *s;
+
+ /* include () */
+ s = fp + flen;
+ if (*s == '(') {
+ while (*s != ')') {
+ flen++;
+ s++;
+ }
+ }
+ if (*s == ')')
+ flen++;
+
+ msg = alloc_buf(strlen(fmt) + flen);
+ sprintf(msg, fmt, flen, fp);
+ error(msg);
+
+ u = malloc(sizeof(pcb_unknown_flag_t));
+ u->str = pcb_strndup(fp, flen);
+ u->next = NULL;
+ /* need to append, to keep order of flags */
+ if (rv.Flags.unknowns != NULL) {
+ pcb_unknown_flag_t *n;
+ for (n = rv.Flags.unknowns; n->next != NULL; n = n->next);
+ n->next = u;
+ }
+ else
+ rv.Flags.unknowns = u;
+ }
+ }
+ fp = ep + 1;
+ }
+ return rv.Flags;
+}
+
+pcb_flag_t pcb_strflg_s2f(const char *flagstring, int (*error) (const char *msg))
+{
+ return pcb_strflg_common_s2f(flagstring, error, pcb_object_flagbits, PCB_ENTRIES(pcb_object_flagbits));
+}
+
+
+/*
+ * Given a set of flags for a given type of object, return a string
+ * which reflects those flags. The only requirement is that this
+ * string be parseable by string_to_flags.
+ *
+ * Note that this function knows a little about what kinds of flags
+ * will be automatically set by parsing, so it won't (for example)
+ * include the "via" flag for PCB_TYPE_VIAs because it knows those get
+ * forcibly set when vias are parsed.
+ */
+
+char *pcb_strflg_common_f2s(pcb_flag_t flags, int object_type, pcb_flag_bits_t * flagbits, int n_flagbits)
+{
+ int len;
+ int i;
+ FlagHolder fh, savef;
+ char *buf, *bp;
+ pcb_unknown_flag_t *u;
+
+ fh.Flags = flags;
+
+#ifndef FLAG_TEST
+ switch (object_type) {
+ case PCB_TYPE_VIA:
+ PCB_FLAG_CLEAR(PCB_FLAG_VIA, &fh);
+ break;
+ case PCB_TYPE_RATLINE:
+ PCB_FLAG_CLEAR(PCB_FLAG_RAT, &fh);
+ break;
+ case PCB_TYPE_PIN:
+ PCB_FLAG_CLEAR(PCB_FLAG_PIN, &fh);
+ break;
+ }
+#endif
+
+ savef = fh;
+
+ len = 3; /* for "()\0" */
+
+ for (i = 0; i < n_flagbits; i++)
+
+ if ((flagbits[i].object_types & object_type)
+ && (PCB_FLAG_TEST(flagbits[i].mask, &fh))) {
+
+ len += flagbits[i].nlen + 1;
+ PCB_FLAG_CLEAR(flagbits[i].mask, &fh);
+ }
+
+ if (PCB_FLAG_THERM_TEST_ANY(&fh)) {
+ len += sizeof("thermal()");
+ for (i = 0; i < PCB_MAX_LAYER; i++)
+ if (PCB_FLAG_THERM_TEST(i, &fh))
+ len += printed_int_length(i, PCB_FLAG_THERM_GET(i, &fh)) + 1;
+ }
+
+ if (flags.q > 0) {
+ len += sizeof("shape(.)");
+ if (flags.q > 9)
+ len += 2;
+ }
+
+ if (flags.int_conn_grp > 0) {
+ len += sizeof("intconn(.)");
+ if (flags.q > 9)
+ len++;
+ if (flags.q > 99)
+ len++;
+ }
+
+ for (u = flags.unknowns; u != NULL; u = u->next)
+ len += strlen(u->str) + 1;
+
+ bp = buf = alloc_buf(len + 2);
+
+ *bp++ = '"';
+
+ fh = savef;
+ for (i = 0; i < n_flagbits; i++)
+ if (flagbits[i].object_types & object_type && (PCB_FLAG_TEST(flagbits[i].mask, &fh))) {
+ if (bp != buf + 1)
+ *bp++ = ',';
+ strcpy(bp, flagbits[i].name);
+ bp += flagbits[i].nlen;
+ PCB_FLAG_CLEAR(flagbits[i].mask, &fh);
+ }
+
+ if (PCB_FLAG_THERM_TEST_ANY(&fh)) {
+ if (bp != buf + 1)
+ *bp++ = ',';
+ strcpy(bp, "thermal");
+ bp += strlen("thermal");
+ grow_layer_list(0);
+ for (i = 0; i < PCB_MAX_LAYER; i++)
+ if (PCB_FLAG_THERM_TEST(i, &fh))
+ set_layer_list(i, PCB_FLAG_THERM_GET(i, &fh));
+ strcpy(bp, print_layer_list());
+ bp += strlen(bp);
+ }
+
+ if (flags.q > 0) {
+ if (bp != buf + 1)
+ *bp++ = ',';
+ bp += sprintf(bp, "shape(%d)", flags.q);
+ }
+
+ if (flags.int_conn_grp > 0) {
+ if (bp != buf + 1)
+ *bp++ = ',';
+ bp += sprintf(bp, "intconn(%d)", flags.int_conn_grp);
+ }
+
+ for (u = flags.unknowns; u != NULL; u = u->next) {
+ int len;
+ len = strlen(u->str);
+ if (bp != buf + 1)
+ *bp++ = ',';
+ memcpy(bp, u->str, len);
+ bp += len;
+ }
+
+ *bp++ = '"';
+ *bp = 0;
+ return buf;
+}
+
+char *pcb_strflg_f2s(pcb_flag_t flags, int object_type)
+{
+ return pcb_strflg_common_f2s(flags, object_type, pcb_object_flagbits, PCB_ENTRIES(pcb_object_flagbits));
+}
+
+
+#define N(x) x, sizeof(x)-1
+static pcb_flag_bits_t pcb_flagbits[] = {
+ {PCB_SHOWNUMBERFLAG, N("shownumber"), 1},
+ {PCB_LOCALREFFLAG, N("localref"), 1},
+ {PCB_CHECKPLANESFLAG, N("checkplanes"), 1},
+ {PCB_SHOWPCB_FLAG_DRC, N("showdrc"), 1},
+ {PCB_RUBBERBANDFLAG, N("rubberband"), 1},
+ {PCB_DESCRIPTIONFLAG, N("description"), 1},
+ {PCB_NAMEONPCBFLAG, N("nameonpcb"), 1},
+ {PCB_AUTOPCB_FLAG_DRC, N("autodrc"), 1},
+ {PCB_ALLDIRECTIONFLAG, N("alldirection"), 1},
+ {PCB_SWAPSTARTDIRFLAG, N("swapstartdir"), 1},
+ {PCB_UNIQUENAMEFLAG, N("uniquename"), 1},
+ {PCB_CLEARNEWFLAG, N("clearnew"), 1},
+ {PCB_NEWPCB_FLAG_FULLPOLY, N("newfullpoly"), 1},
+ {PCB_SNAPPCB_FLAG_PIN, N("snappin"), 1},
+ {PCB_SHOWMASKFLAG, N("showmask"), 1},
+ {PCB_THINDRAWFLAG, N("thindraw"), 1},
+ {PCB_ORTHOMOVEFLAG, N("orthomove"), 1},
+ {PCB_LIVEROUTEFLAG, N("liveroute"), 1},
+ {PCB_THINDRAWPOLYFLAG, N("thindrawpoly"), 1},
+ {PCB_LOCKNAMESFLAG, N("locknames"), 1},
+ {PCB_ONLYNAMESFLAG, N("onlynames"), 1},
+ {PCB_HIDENAMESFLAG, N("hidenames"), 1},
+ {PCB_ENABLEPCB_FLAG_MINCUT, N("enablemincut"), 1},
+};
+#undef N
+
+
+char *pcb_strflg_board_f2s(pcb_flag_t flags)
+{
+ return pcb_strflg_common_f2s(flags, PCB_TYPEMASK_ALL, pcb_flagbits, PCB_ENTRIES(pcb_flagbits));
+}
+
+pcb_flag_t pcb_strflg_board_s2f(const char *flagstring, int (*error) (const char *msg))
+{
+ return pcb_strflg_common_s2f(flagstring, error, pcb_flagbits, PCB_ENTRIES(pcb_flagbits));
+}
diff --git a/src/flag_str.h b/src/flag_str.h
new file mode 100644
index 0000000..0f47b03
--- /dev/null
+++ b/src/flag_str.h
@@ -0,0 +1,76 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 2005 DJ Delorie
+ *
+ * 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:
+ * DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA
+ * dj at delorie.com
+ *
+ */
+
+#ifndef PCB_STRFLAGS_H
+#define PCB_STRFLAGS_H
+
+#include "flag.h"
+
+typedef struct {
+
+ /* This is the bit that we're setting. */
+ int mask;
+
+ /* The name used in the output file. */
+ const char *name;
+ int nlen;
+
+ /* If set, this entry won't be output unless the object type is one
+ of these. */
+ int object_types;
+
+} pcb_flag_bits_t;
+
+/* All flags natively known by the core */
+extern pcb_flag_bits_t pcb_object_flagbits[];
+extern const int pcb_object_flagbits_len;
+
+/* The purpose of this interface is to make the file format able to
+ handle more than 32 flags, and to hide the internal details of
+ flags from the file format. */
+
+/* When passed a string, parse it and return an appropriate set of
+ flags. Errors cause error() to be called with a suitable message;
+ if error is NULL, errors are ignored. */
+pcb_flag_t pcb_strflg_s2f(const char *flagstring, int (*error) (const char *msg));
+
+/* Given a set of flags for a given object type, return a string which
+ can be output to a file. The returned pointer must not be
+ freed. */
+char *pcb_strflg_f2s(pcb_flag_t flags, int object_type);
+
+/* same as above, for pcb level flags */
+char *pcb_strflg_board_f2s(pcb_flag_t flags);
+pcb_flag_t pcb_strflg_board_s2f(const char *flagstring, int (*error) (const char *msg));
+
+void pcb_strflg_uninit_buf(void);
+void pcb_strflg_uninit_layerlist(void);
+
+/* low level */
+pcb_flag_t pcb_strflg_common_s2f(const char *flagstring, int (*error) (const char *msg), pcb_flag_bits_t * flagbits, int n_flagbits);
+char *pcb_strflg_common_f2s(pcb_flag_t flags, int object_type, pcb_flag_bits_t * flagbits, int n_flagbits);
+
+#endif
diff --git a/src/font.c b/src/font.c
new file mode 100644
index 0000000..33bc51a
--- /dev/null
+++ b/src/font.c
@@ -0,0 +1,147 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2005 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 at rz.uni-ulm.de
+ *
+ */
+
+/* font support. Note: glyphs are called symbols here */
+
+#include "config.h"
+
+#include <string.h>
+
+#include "font.h"
+#include "board.h"
+#include "conf_core.h"
+#include "error.h"
+#include "plug_io.h"
+#include "paths.h"
+#include "compat_nls.h"
+
+#define STEP_SYMBOLLINE 10
+
+/* parses a file with font information and installs it into the provided PCB
+ * checks directories given as colon separated list by resource fontPath
+ * if the fonts filename doesn't contain a directory component */
+void pcb_font_create_default(pcb_board_t *pcb)
+{
+ int res = -1;
+ pcb_io_err_inhibit_inc();
+ conf_list_foreach_path_first(res, &conf_core.rc.default_font_file, pcb_parse_font(&pcb->Font, __path__));
+ pcb_io_err_inhibit_dec();
+
+ if (res != 0) {
+ const char *s;
+ gds_t buff;
+ s = conf_concat_strlist(&conf_core.rc.default_font_file, &buff, NULL, ':');
+ pcb_message(PCB_MSG_ERROR, _("Can't find font-symbol-file - there won't be font in this design. Searched: '%s'\n"), s);
+ gds_uninit(&buff);
+ }
+}
+
+/* transforms symbol coordinates so that the left edge of each symbol
+ * is at the zero position. The y coordinates are moved so that min(y) = 0 */
+void pcb_font_set_info(pcb_font_t *Ptr)
+{
+ pcb_cardinal_t i, j;
+ pcb_symbol_t *symbol;
+ pcb_line_t *line;
+ pcb_coord_t totalminy = PCB_MAX_COORD;
+
+ /* calculate cell with and height (is at least PCB_DEFAULT_CELLSIZE)
+ * maximum cell width and height
+ * minimum x and y position of all lines
+ */
+ Ptr->MaxWidth = PCB_DEFAULT_CELLSIZE;
+ Ptr->MaxHeight = PCB_DEFAULT_CELLSIZE;
+ for (i = 0, symbol = Ptr->Symbol; i <= PCB_MAX_FONTPOSITION; i++, symbol++) {
+ pcb_coord_t minx, miny, maxx, maxy;
+
+ /* next one if the index isn't used or symbol is empty (SPACE) */
+ if (!symbol->Valid || !symbol->LineN)
+ continue;
+
+ minx = miny = PCB_MAX_COORD;
+ maxx = maxy = 0;
+ for (line = symbol->Line, j = symbol->LineN; j; j--, line++) {
+ minx = MIN(minx, line->Point1.X);
+ miny = MIN(miny, line->Point1.Y);
+ minx = MIN(minx, line->Point2.X);
+ miny = MIN(miny, line->Point2.Y);
+ maxx = MAX(maxx, line->Point1.X);
+ maxy = MAX(maxy, line->Point1.Y);
+ maxx = MAX(maxx, line->Point2.X);
+ maxy = MAX(maxy, line->Point2.Y);
+ }
+
+ /* move symbol to left edge */
+ for (line = symbol->Line, j = symbol->LineN; j; j--, line++)
+ pcb_line_move(line, -minx, 0);
+
+ /* set symbol bounding box with a minimum cell size of (1,1) */
+ symbol->Width = maxx - minx + 1;
+ symbol->Height = maxy + 1;
+
+ /* check total min/max */
+ Ptr->MaxWidth = MAX(Ptr->MaxWidth, symbol->Width);
+ Ptr->MaxHeight = MAX(Ptr->MaxHeight, symbol->Height);
+ totalminy = MIN(totalminy, miny);
+ }
+
+ /* move coordinate system to the upper edge (lowest y on screen) */
+ for (i = 0, symbol = Ptr->Symbol; i <= PCB_MAX_FONTPOSITION; i++, symbol++)
+ if (symbol->Valid) {
+ symbol->Height -= totalminy;
+ for (line = symbol->Line, j = symbol->LineN; j; j--, line++)
+ pcb_line_move(line, 0, -totalminy);
+ }
+
+ /* setup the box for the default symbol */
+ Ptr->DefaultSymbol.X1 = Ptr->DefaultSymbol.Y1 = 0;
+ Ptr->DefaultSymbol.X2 = Ptr->DefaultSymbol.X1 + Ptr->MaxWidth;
+ Ptr->DefaultSymbol.Y2 = Ptr->DefaultSymbol.Y1 + Ptr->MaxHeight;
+}
+
+/* creates a new line in a symbol */
+pcb_line_t *pcb_font_new_line_in_sym(pcb_symbol_t *Symbol, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness)
+{
+ pcb_line_t *line = Symbol->Line;
+
+ /* realloc new memory if necessary and clear it */
+ if (Symbol->LineN >= Symbol->LineMax) {
+ Symbol->LineMax += STEP_SYMBOLLINE;
+ line = (pcb_line_t *) realloc(line, Symbol->LineMax * sizeof(pcb_line_t));
+ Symbol->Line = line;
+ memset(line + Symbol->LineN, 0, STEP_SYMBOLLINE * sizeof(pcb_line_t));
+ }
+
+ /* copy values */
+ line = line + Symbol->LineN++;
+ line->Point1.X = X1;
+ line->Point1.Y = Y1;
+ line->Point2.X = X2;
+ line->Point2.Y = Y2;
+ line->Thickness = Thickness;
+ return (line);
+}
+
diff --git a/src/font.h b/src/font.h
new file mode 100644
index 0000000..b68f3f9
--- /dev/null
+++ b/src/font.h
@@ -0,0 +1,57 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_FONT_H
+#define PCB_FONT_H
+
+#include "global_typedefs.h"
+#include "box.h"
+
+/* ---------------------------------------------------------------------------
+ * symbol and font related stuff
+ */
+typedef struct symbol_s { /* a single symbol */
+ pcb_line_t *Line;
+ pcb_bool Valid;
+ pcb_cardinal_t LineN; /* number of lines */
+ pcb_cardinal_t LineMax; /* lines allocated */
+ pcb_coord_t Width, Height, Delta; /* size of cell, distance to next symbol */
+} pcb_symbol_t;
+
+struct pcb_font_s { /* complete set of symbols */
+ pcb_coord_t MaxHeight, MaxWidth; /* maximum cell width and height */
+ pcb_box_t DefaultSymbol; /* the default symbol is a filled box */
+ pcb_symbol_t Symbol[PCB_MAX_FONTPOSITION + 1];
+ pcb_bool Valid;
+};
+
+void pcb_font_create_default(pcb_board_t *pcb);
+void pcb_font_set_info(pcb_font_t *Ptr);
+
+pcb_line_t *pcb_font_new_line_in_sym(pcb_symbol_t *Symbol, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness);
+
+#endif
+
diff --git a/src/fptr_cast.c b/src/fptr_cast.c
index 8bf4dd1..a45fb54 100644
--- a/src/fptr_cast.c
+++ b/src/fptr_cast.c
@@ -21,6 +21,7 @@
*/
#include <assert.h>
+#include "config.h"
#include "fptr_cast.h"
void *pcb_cast_f2d(pcb_fptr_t f)
diff --git a/src/free_atexit.c b/src/free_atexit.c
index 97dea39..556445d 100644
--- a/src/free_atexit.c
+++ b/src/free_atexit.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
+#include "config.h"
/* we need one ID per context - short int with 64k IDs should be enough */
typedef unsigned int leaky_idx_t;
@@ -44,7 +45,7 @@ static void **free_list = NULL;
static leaky_idx_t free_size = 0;
-void *leaky_malloc(size_t size)
+void *pcb_leaky_malloc(size_t size)
{
char *new_memory = malloc(size + sizeof(leaky_admin_t));
@@ -56,23 +57,23 @@ void *leaky_malloc(size_t size)
return new_memory + sizeof(leaky_admin_t);
}
-void *leaky_calloc(size_t nmemb, size_t size)
+void *pcb_leaky_calloc(size_t nmemb, size_t size)
{
size_t size_ = size * nmemb;
- void *new_memory = leaky_malloc(size_);
+ void *new_memory = pcb_leaky_malloc(size_);
memset(new_memory, 0, size_);
return new_memory;
}
-void *leaky_realloc(void *old_memory_, size_t size)
+void *pcb_leaky_realloc(void *old_memory_, size_t size)
{
char *new_memory;
char *old_memory = old_memory_;
leaky_idx_t i;
if (old_memory == NULL)
- return leaky_malloc(size);
+ return pcb_leaky_malloc(size);
old_memory -= sizeof(leaky_admin_t);
@@ -84,15 +85,15 @@ void *leaky_realloc(void *old_memory_, size_t size)
return new_memory + sizeof(leaky_admin_t);
}
-char *leaky_strdup(const char *src)
+char *pcb_leaky_strdup(const char *src)
{
int len = strlen(src)+1;
- char *res = leaky_malloc(len);
+ char *res = pcb_leaky_malloc(len);
memcpy(res, src, len);
return res;
}
-void leaky_uninit(void)
+void pcb_leaky_uninit(void)
{
int i;
@@ -103,7 +104,7 @@ void leaky_uninit(void)
free_size = 0;
}
-void leaky_init(void)
+void pcb_leaky_init(void)
{
- atexit(leaky_uninit);
+ atexit(pcb_leaky_uninit);
}
diff --git a/src/free_atexit.h b/src/free_atexit.h
index f12466b..929819f 100644
--- a/src/free_atexit.h
+++ b/src/free_atexit.h
@@ -1,6 +1,6 @@
/* This tiny library is to assist cleaning up harmless memory leaks caused
by (growing) buffers allocated in static variables in functions. The
- library provides leaky_ prefixed variants of the common allocation
+ library provides pcb_leaky_ prefixed variants of the common allocation
routines. These wrappers will remember all pointers they return and
can free all memory used, at the end of the application.
*/
@@ -8,31 +8,31 @@
#include <stdlib.h>
#ifdef NDEBUG
-#define leaky_init()
-#define leaky_uninit()
-#define leaky_malloc(size) malloc(size)
-#define leaky_calloc(nmemb, size) calloc(nmemb, size)
-#define leaky_realloc(old_memory, size) realloc(old_memory, size)
-#define leaky_strdup(str) strdup(str)
+#define pcb_leaky_init()
+#define pcb_leaky_uninit()
+#define pcb_leaky_malloc(size) malloc(size)
+#define pcb_leaky_calloc(nmemb, size) calloc(nmemb, size)
+#define pcb_leaky_realloc(old_memory, size) realloc(old_memory, size)
+#define pcb_leaky_strdup(str) strdup(str)
#else
-/* set up atexit() hook - can be avoided if leaky_uninit() is called by hand */
-void leaky_init(void);
+/* set up atexit() hook - can be avoided if pcb_leaky_uninit() is called by hand */
+void pcb_leaky_init(void);
/* free all allocations */
-void leaky_uninit(void);
+void pcb_leaky_uninit(void);
/* allocate memory, remember the pointer and free it after exit from the application */
-void *leaky_malloc(size_t size);
+void *pcb_leaky_malloc(size_t size);
/* same as leaky_malloc but this one wraps calloc() */
-void *leaky_calloc(size_t nmemb, size_t size);
+void *pcb_leaky_calloc(size_t nmemb, size_t size);
/* reallocate memory, remember the new pointer and free it after exit from the application */
-void *leaky_realloc(void *old_memory, size_t size);
+void *pcb_leaky_realloc(void *old_memory, size_t size);
-/* strdup() using leaky_malloc() */
-char *leaky_strdup(const char *src);
+/* strdup() using pcb_leaky_malloc() */
+char *pcb_leaky_strdup(const char *src);
#endif
diff --git a/src/funchash.c b/src/funchash.c
index 5cca0a7..84008fa 100644
--- a/src/funchash.c
+++ b/src/funchash.c
@@ -26,10 +26,12 @@
#include <genht/htpi.h>
#include <genht/hash.h>
#include "funchash_core.h"
+#include "config.h"
#include "macro.h"
+#include "compat_misc.h"
#define action_entry(x) { #x, F_ ## x},
-static funchash_table_t Functions[] = {
+static pcb_funchash_table_t Functions[] = {
#include "funchash_core_list.h"
{"F_END", F_END}
};
@@ -47,7 +49,7 @@ static int keyeq(const void *a_, const void *b_)
const fh_key_t *a = a_, *b = b_;
if (a->cookie != b->cookie)
return 1;
- return !strcasecmp(a->key, b->key);
+ return !pcb_strcasecmp(a->key, b->key);
}
static unsigned fh_hash(const void *key)
@@ -56,13 +58,13 @@ static unsigned fh_hash(const void *key)
return strhash_case((char *)k->key) ^ ptrhash((void *)k->cookie);
}
-void funchash_init(void)
+void pcb_funchash_init(void)
{
funchash = htpi_alloc(fh_hash, keyeq);
- funchash_set_table(Functions, ENTRIES(Functions), NULL);
+ pcb_funchash_set_table(Functions, PCB_ENTRIES(Functions), NULL);
}
-void funchash_uninit(void)
+void pcb_funchash_uninit(void)
{
htpi_entry_t *e;
@@ -77,7 +79,7 @@ void funchash_uninit(void)
funchash = NULL;
}
-void funchash_remove_cookie(const char *cookie)
+void pcb_funchash_remove_cookie(const char *cookie)
{
htpi_entry_t *e;
@@ -91,7 +93,7 @@ void funchash_remove_cookie(const char *cookie)
}
}
-int funchash_get(const char *key, const char *cookie)
+int pcb_funchash_get(const char *key, const char *cookie)
{
fh_key_t new_key;
htpi_entry_t *e;
@@ -108,12 +110,12 @@ int funchash_get(const char *key, const char *cookie)
return e->value;
}
-int funchash_set(const char *key, int val, const char *cookie)
+int pcb_funchash_set(const char *key, int val, const char *cookie)
{
fh_key_t *new_key;
int kl;
- if (funchash_get(key, cookie) >= 0)
+ if (pcb_funchash_get(key, cookie) >= 0)
return -1;
kl = strlen(key);
@@ -125,12 +127,12 @@ int funchash_set(const char *key, int val, const char *cookie)
return 0;
}
-int funchash_set_table(funchash_table_t *table, int numelem, const char *cookie)
+int pcb_funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie)
{
int i, rv = 0;
for (i = 0; i < numelem; i++)
- rv |= funchash_set(table[i].key, table[i].val, cookie);
+ rv |= pcb_funchash_set(table[i].key, table[i].val, cookie);
return rv;
}
diff --git a/src/funchash.h b/src/funchash.h
index 8a613e4..e516966 100644
--- a/src/funchash.h
+++ b/src/funchash.h
@@ -20,28 +20,28 @@
*
*/
-/* Table entry format for funchash_set_table() */
+/* Table entry format for pcb_funchash_set_table() */
typedef struct {
const char *key;
int val;
-} funchash_table_t;
+} pcb_funchash_table_t;
/* Cookie is the namespace so that different modules can use the same
function names with different integer IDs without interference. Core
should use cookie==NULL. */
/* Resolve a key string into an integer ID */
-int funchash_get(const char *key, const char *cookie);
+int pcb_funchash_get(const char *key, const char *cookie);
/* Store key string - integer ID pair */
-int funchash_set(const char *key, int val, const char *cookie);
+int pcb_funchash_set(const char *key, int val, const char *cookie);
/* Store multiple key strings - integer ID pairs using a table */
-int funchash_set_table(funchash_table_t *table, int numelem, const char *cookie);
+int pcb_funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie);
/* Remove all keys inserted for a cookie */
-void funchash_remove_cookie(const char *cookie);
+void pcb_funchash_remove_cookie(const char *cookie);
/* Init-uninit the hash */
-void funchash_init(void);
-void funchash_uninit(void);
+void pcb_funchash_init(void);
+void pcb_funchash_uninit(void);
diff --git a/src/funchash_core.h b/src/funchash_core.h
index 0f0478c..b8fbc16 100644
--- a/src/funchash_core.h
+++ b/src/funchash_core.h
@@ -6,5 +6,5 @@
typedef enum {
#include "funchash_core_list.h"
F_END
-} FunctionID;
+} pcb_function_id_t;
#undef action_entry
diff --git a/src/funchash_core_list.h b/src/funchash_core_list.h
index 34fddde..aea3283 100644
--- a/src/funchash_core_list.h
+++ b/src/funchash_core_list.h
@@ -1,7 +1,7 @@
/*
Central list of function IDs
The core and core plugins use these from a single, central hash
- This list is used to cpp-generate the F_* constants in enum FunctionID
+ This list is used to cpp-generate the F_* constants in enum pcb_function_id_t
*/
action_entry(AddSelected)
action_entry(All)
diff --git a/src/global.h b/src/global.h
deleted file mode 100644
index 7d95344..0000000
--- a/src/global.h
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
- * 15 Oct 2008 Ineiev: add different crosshair shapes
- *
- * 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 addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-
-/* definition of types */
-
-/* Change History:
- * 10/11/96 11:37 AJF Added support for a Text() driver function.
- * This was done out of a pressing need to force text to be printed on the
- * silkscreen layer. Perhaps the design is not the best.
- */
-
-#ifndef PCB_GLOBAL_H
-#define PCB_GLOBAL_H
-
-#include "config.h"
-
-#include "const.h"
-#include "macro.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <stdarg.h>
-#include <math.h>
-#include <ctype.h>
-
-#include "global_typedefs.h"
-#include "global_objs.h"
-#include "list_common.h"
-#include "list_line.h"
-#include "list_arc.h"
-#include "list_text.h"
-#include "list_poly.h"
-#include "list_pad.h"
-#include "list_pin.h"
-#include "list_rat.h"
-#include "vtonpoint.h"
-#include "hid.h"
-#include "polyarea.h"
-#include "vtroutestyle.h"
-
-
-/* Internationalization support. */
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-# if defined(gettext_noop)
-# define N_(S) gettext_noop(S)
-# else
-# define N_(S) (S)
-# endif
-#else
-# define _(S) (S)
-# define N_(S) (S)
-# define textdomain(S) (S)
-# define gettext(S) (S)
-# define dgettext(D, S) (S)
-# define dcgettext(D, S, T) (S)
-# define bindtextdomain(D, Dir) (D)
-#endif /* ENABLE_NLS */
-
-/* This is used by the lexer/parser */
-typedef struct {
- int ival;
- Coord bval;
- double dval;
- char has_units;
-} PLMeasure;
-
-/* ---------------------------------------------------------------------------
- * Macros to annotate branch-prediction information.
- * Taken from GLib 2.16.3 (LGPL 2).G_ / g_ prefixes have
- * been removed to avoid namespace clashes.
- */
-
-/* The LIKELY and UNLIKELY macros let the programmer give hints to
- * the compiler about the expected result of an expression. Some compilers
- * can use this information for optimizations.
- *
- * The PCB_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
- * putting assignments inside the test.
- */
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-# define PCB_BOOLEAN_EXPR(expr) \
- __extension__ ({ \
- int _boolean_var_; \
- if (expr) \
- _boolean_var_ = 1; \
- else \
- _boolean_var_ = 0; \
- _boolean_var_; \
-})
-# define LIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 1))
-# define UNLIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 0))
-#else
-# define LIKELY(expr) (expr)
-# define UNLIKELY(expr) (expr)
-#endif
-
-/* ---------------------------------------------------------------------------
- * Macros to annotate branch-prediction information.
- * Taken from GLib 2.42.1 (LGPL 2). PCB_ prefixes have
- * been added to avoid namespace clashes.
- */
-#define PCB_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
-#define PCB_ABS(a) (((a) < 0) ? -(a) : (a))
-
-/* ---------------------------------------------------------------------------
- * some useful values of our widgets
- */
-typedef struct { /* holds information about output window */
- hidGC bgGC, /* background and foreground; */
- fgGC, /* changed from some routines */
- pmGC; /* depth 1 pixmap GC to store clip */
-} OutputType, *OutputTypePtr;
-
-
-/* ----------------------------------------------------------------------
- * layer group. A layer group identifies layers which are always switched
- * on/off together.
- */
-typedef struct {
- pcb_cardinal_t Number[MAX_LAYER], /* number of entries per groups */
- Entries[MAX_LAYER][MAX_LAYER + 2];
-} LayerGroupType, *LayerGroupTypePtr;
-
-typedef struct {
- Coord x, y;
- Coord width, height;
-} RectangleType, *RectangleTypePtr;
-
-/* ---------------------------------------------------------------------------
- * the basic object types supported by PCB
- */
-
-#include "global_element.h"
-
-struct rtree {
- struct rtree_node *root;
- int size; /* number of entries in tree */
-};
-
-struct layer_st { /* holds information about one layer */
- const char *Name; /* layer name */
- linelist_t Line;
- textlist_t Text;
- polylist_t Polygon;
- arclist_t Arc;
- rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree;
- pcb_bool On; /* visible flag */
- const char *Color; /* color */
- const char *SelectedColor;
- AttributeListType Attributes;
- int no_drc; /* whether to ignore the layer when checking the design rules */
-};
-
-struct data_st { /* holds all objects */
- int LayerN; /* number of layers in this board */
- pinlist_t Via;
- elementlist_t Element;
- ratlist_t Rat;
- rtree_t *via_tree, *element_tree, *pin_tree, *pad_tree, *name_tree[3], /* for element names */
- *rat_tree;
- struct PCBType *pcb;
- LayerType Layer[MAX_LAYER + 2]; /* add 2 silkscreen layers */
- plug_io_t *loader;
-};
-
-typedef struct { /* holds drill information */
- Coord DrillSize; /* this drill's diameter */
- pcb_cardinal_t ElementN, /* the number of elements using this drill size */
- ElementMax, /* max number of elements from malloc() */
- PinCount, /* number of pins drilled this size */
- ViaCount, /* number of vias drilled this size */
- UnplatedCount, /* number of these holes that are unplated */
- PinN, /* number of drill coordinates in the list */
- PinMax; /* max number of coordinates from malloc() */
- PinTypePtr *Pin; /* coordinates to drill */
- ElementTypePtr *Element; /* a pointer to an array of element pointers */
-} DrillType, *DrillTypePtr;
-
-typedef struct { /* holds a range of Drill Infos */
- pcb_cardinal_t DrillN, /* number of drill sizes */
- DrillMax; /* max number from malloc() */
- DrillTypePtr Drill; /* plated holes */
-} DrillInfoType, *DrillInfoTypePtr;
-
-typedef struct LibraryEntryTpye_s LibraryEntryType, *LibraryEntryTypePtr;
-typedef struct LibraryMenuType_s LibraryMenuType, *LibraryMenuTypePtr;
-
-/* ---------------------------------------------------------------------------
- * structure used by library routines
- */
-struct LibraryEntryTpye_s {
- const char *ListEntry; /* the string for the selection box */
- int ListEntry_dontfree; /* do not free(ListEntry) if non-zero */
- /* This used to contain some char *AllocatedMemory, possibly with
- * the intention of the following fields pointing into it.
- * It was never used that way, so removing for now.
- * TODO: re-introduce and actually use it for the following fields?
- */
- const char *Package; /* package */
- const char *Value; /* the value field */
- const char *Description; /* some descriptive text */
-#if 0
- fp_type_t Type;
- void **Tags; /* an array of void * tag IDs; last tag ID is NULL */
-#endif
-};
-
-/* If the internal flag is set, the only field that is valid is Name,
- and the struct is allocated with malloc instead of
- CreateLibraryEntry. These "internal" entries are used for
- electrical paths that aren't yet assigned to a real net. */
-
-struct LibraryMenuType_s {
- char *Name, /* name of the menu entry */
- *directory, /* Directory name library elements are from */
- *Style; /* routing style */
- pcb_cardinal_t EntryN, /* number of objects */
- EntryMax; /* number of reserved memory locations */
- LibraryEntryTypePtr Entry; /* the entries */
- char flag; /* used by the netlist window to enable/disable nets */
- char internal; /* if set, this is an internal-only entry, not
- part of the global netlist. */
-};
-
-typedef struct {
- pcb_cardinal_t MenuN; /* number of objects */
- pcb_cardinal_t MenuMax; /* number of reserved memory locations */
- LibraryMenuTypePtr Menu; /* the entries */
-} LibraryType, *LibraryTypePtr;
-
-enum {
- NETLIST_INPUT = 0, /* index of the original netlist as imported */
- NETLIST_EDITED = 1, /* index of the netlist produced by applying netlist patches on [NETLIST_INPUT] */
- NUM_NETLISTS /* so that we know how many netlists we are dealing with */
-};
-
-
- /* The PCBType struct holds information about board layout most of which is
- | saved with the layout. A new PCB layout struct is first initialized
- | with values from the user configurable Settings struct and then reset
- | to the saved layout values when a layout is loaded.
- | This struct is also used for the remove list and for buffer handling
- */
-typedef struct PCBType {
- long ID; /* see macro.h */
- char *Name, /* name of board */
- *Filename, /* name of file (from load) */
- *PrintFilename, /* from print dialog */
- *Netlistname, /* name of netlist file */
- ThermStyle; /* type of thermal to place with thermal tool */
- pcb_bool Changed, /* layout has been changed */
- ViaOn, /* visibility flags */
- ElementOn, RatOn, InvisibleObjectsOn, PinOn, SilkActive, /* active layer is actually silk */
- RatDraw; /* we're drawing rats */
- char *ViaColor, /* some colors */
- *ViaSelectedColor,
- *PinColor,
- *PinSelectedColor,
- *PinNameColor,
- *ElementColor,
- *ElementColor_nonetlist,
- *RatColor,
- *InvisibleObjectsColor,
- *InvisibleMarkColor, *ElementSelectedColor, *RatSelectedColor, *ConnectedColor, *WarnColor, *MaskColor;
- Coord CursorX, /* cursor position as saved with layout */
- CursorY;
- Coord Bloat, /* drc sizes saved with layout */
- Shrink, minWid, minSlk, minDrill, minRing;
- Coord GridOffsetX, /* as saved with layout */
- GridOffsetY, MaxWidth, /* allowed size */
- MaxHeight;
-
- Coord Grid; /* used grid with offsets */
- double Zoom, /* zoom factor */
- IsleArea, /* minimum poly island to retain */
- ThermScale; /* scale factor used with thermals */
- FontType Font;
- LayerGroupType LayerGroups;
- vtroutestyle_t RouteStyle;
- LibraryType NetlistLib[NUM_NETLISTS];
- rats_patch_line_t *NetlistPatches, *NetlistPatchLast;
- AttributeListType Attributes;
- DataTypePtr Data; /* entire database */
-
- pcb_bool is_footprint; /* If set, the user has loaded a footprint, not a pcb. */
-
-/* netlist states */
- int netlist_frozen; /* counter */
- unsigned netlist_needs_update:1;
-
-} PCBType, *PCBTypePtr;
-
-typedef struct { /* information about the paste buffer */
- Coord X, Y; /* offset */
- BoxType BoundingBox;
- DataTypePtr Data; /* data; not all members of PCBType */
- /* are used */
-} BufferType, *BufferTypePtr;
-
-/* ---------------------------------------------------------------------------
- * some types for cursor drawing, setting of block and lines
- * as well as for merging of elements
- */
-typedef struct { /* rubberband lines for element moves */
- LayerTypePtr Layer; /* layer that holds the line */
- LineTypePtr Line; /* the line itself */
- PointTypePtr MovedPoint; /* and finally the point */
-} RubberbandType, *RubberbandTypePtr;
-
-typedef struct { /* current marked line */
- PointType Point1, /* start- and end-position */
- Point2;
- long int State;
- pcb_bool draw;
-} AttachedLineType, *AttachedLineTypePtr;
-
-typedef struct { /* currently marked block */
- PointType Point1, /* start- and end-position */
- Point2;
- long int State;
- pcb_bool otherway;
-} AttachedBoxType, *AttachedBoxTypePtr;
-
-typedef struct { /* currently attached object */
- Coord X, Y; /* saved position when PCB_MODE_MOVE */
- BoxType BoundingBox;
- long int Type, /* object type */
- State;
- void *Ptr1, /* three pointers to data, see */
- *Ptr2, /* search.c */
- *Ptr3;
- pcb_cardinal_t RubberbandN, /* number of lines in array */
- RubberbandMax;
- RubberbandTypePtr Rubberband;
-} AttachedObjectType, *AttachedObjectTypePtr;
-
-enum crosshair_shape {
- Basic_Crosshair_Shape = 0, /* 4-ray */
- Union_Jack_Crosshair_Shape, /* 8-ray */
- Dozen_Crosshair_Shape, /* 12-ray */
- Crosshair_Shapes_Number
-};
-
-typedef struct { /* holds cursor information */
- hidGC GC, /* GC for cursor drawing */
- AttachGC; /* and for displaying buffer contents */
- Coord X, Y, /* position in PCB coordinates */
- MinX, MinY, /* lowest and highest coordinates */
- MaxX, MaxY;
- AttachedLineType AttachedLine; /* data of new lines... */
- AttachedBoxType AttachedBox;
- PolygonType AttachedPolygon;
- AttachedObjectType AttachedObject; /* data of attached objects */
- enum crosshair_shape shape; /* shape of crosshair */
- vtop_t onpoint_objs;
- vtop_t old_onpoint_objs;
-
- /* list of object IDs that could have been dragged so that they can be cycled */
- long int *drags;
- int drags_len, drags_current;
- Coord dragx, dragy; /* the point where drag started */
-} CrosshairType, *CrosshairTypePtr;
-
-typedef struct {
- pcb_bool status;
- Coord X, Y;
-} MarkType, *MarkTypePtr;
-
-/* ----------------------------------------------------------------------
- * pointer to low-level copy, move and rotate functions
- */
-typedef struct {
- void *(*Line) (LayerTypePtr, LineTypePtr);
- void *(*Text) (LayerTypePtr, TextTypePtr);
- void *(*Polygon) (LayerTypePtr, PolygonTypePtr);
- void *(*Via) (PinTypePtr);
- void *(*Element) (ElementTypePtr);
- void *(*ElementName) (ElementTypePtr);
- void *(*Pin) (ElementTypePtr, PinTypePtr);
- void *(*Pad) (ElementTypePtr, PadTypePtr);
- void *(*LinePoint) (LayerTypePtr, LineTypePtr, PointTypePtr);
- void *(*Point) (LayerTypePtr, PolygonTypePtr, PointTypePtr);
- void *(*Arc) (LayerTypePtr, ArcTypePtr);
- void *(*Rat) (RatTypePtr);
-} ObjectFunctionType, *ObjectFunctionTypePtr;
-
-/* ---------------------------------------------------------------------------
- * structure used by device drivers
- */
-
-typedef struct { /* holds a connection */
- Coord X, Y; /* coordinate of connection */
- long int type; /* type of object in ptr1 - 3 */
- void *ptr1, *ptr2; /* the object of the connection */
- pcb_cardinal_t group; /* the layer group of the connection */
- LibraryMenuType *menu; /* the netmenu this *SHOULD* belong too */
-} ConnectionType, *ConnectionTypePtr;
-
-struct net_st { /* holds a net of connections */
- pcb_cardinal_t ConnectionN, /* the number of connections contained */
- ConnectionMax; /* max connections from malloc */
- ConnectionTypePtr Connection;
- RouteStyleTypePtr Style;
-};
-
-typedef struct { /* holds a list of nets */
- pcb_cardinal_t NetN, /* the number of subnets contained */
- NetMax; /* max subnets from malloc */
- NetTypePtr Net;
-} NetListType, *NetListTypePtr;
-
-typedef struct { /* holds a list of net lists */
- pcb_cardinal_t NetListN, /* the number of net lists contained */
- NetListMax; /* max net lists from malloc */
- NetListTypePtr NetList;
-} NetListListType, *NetListListTypePtr;
-
-typedef struct { /* holds a generic list of pointers */
- pcb_cardinal_t PtrN, /* the number of pointers contained */
- PtrMax; /* max subnets from malloc */
- void **Ptr;
-} PointerListType, *PointerListTypePtr;
-
-typedef struct {
- pcb_cardinal_t BoxN, /* the number of boxes contained */
- BoxMax; /* max boxes from malloc */
- BoxTypePtr Box;
-
-} BoxListType, *BoxListTypePtr;
-
-struct drc_violation_st {
- char *title;
- char *explanation;
- Coord x, y;
- Angle angle;
- int have_measured;
- Coord measured_value;
- Coord required_value;
- int object_count;
- long int *object_id_list;
- int *object_type_list;
-};
-
-typedef enum {
- RATP_ADD_CONN,
- RATP_DEL_CONN,
- RATP_CHANGE_ATTRIB
-} rats_patch_op_t;
-
-struct rats_patch_line_s {
- rats_patch_op_t op;
- char *id;
- union {
- char *net_name;
- char *attrib_name;
- } arg1;
- union {
- char *attrib_val;
- } arg2;
-
- rats_patch_line_t *prev, *next;
-};
-
-/* ---------------------------------------------------------------------------
- * define supported types of undo operations
- * note these must be separate bits now
- */
-#define UNDO_CHANGENAME 0x0001 /* change of names */
-#define UNDO_MOVE 0x0002 /* moving objects */
-#define UNDO_REMOVE 0x0004 /* removing objects */
-#define UNDO_REMOVE_POINT 0x0008 /* removing polygon/... points */
-#define UNDO_INSERT_POINT 0x0010 /* inserting polygon/... points */
-#define UNDO_REMOVE_CONTOUR 0x0020 /* removing a contour from a polygon */
-#define UNDO_INSERT_CONTOUR 0x0040 /* inserting a contour from a polygon */
-#define UNDO_ROTATE 0x0080 /* rotations */
-#define UNDO_CREATE 0x0100 /* creation of objects */
-#define UNDO_MOVETOLAYER 0x0200 /* moving objects to */
-#define UNDO_FLAG 0x0400 /* toggling SELECTED flag */
-#define UNDO_CHANGESIZE 0x0800 /* change size of object */
-#define UNDO_CHANGE2NDSIZE 0x1000 /* change 2ndSize of object */
-#define UNDO_MIRROR 0x2000 /* change side of board */
-#define UNDO_CHANGECLEARSIZE 0x4000 /* change clearance size */
-#define UNDO_CHANGEMASKSIZE 0x8000 /* change mask size */
-#define UNDO_CHANGEANGLES 0x10000 /* change arc angles */
-#define UNDO_LAYERCHANGE 0x20000 /* layer new/delete/move */
-#define UNDO_CLEAR 0x40000 /* clear/restore to polygons */
-#define UNDO_NETLISTCHANGE 0x80000 /* netlist change */
-#define UNDO_CHANGEPINNUM 0x100000 /* change of pin number */
-#define UNDO_CHANGERADII 0x200000 /* change arc radii */
-
-
-
-/* ---------------------------------------------------------------------------
- * add a macro for wrapping RCS ID's in so that ident will still work
- * but we won't get as many compiler warnings
- */
-
-#ifndef GCC_VERSION
-# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#endif /* GCC_VERSION */
-
-#if GCC_VERSION > 2007
-# define ATTRIBUTE_UNUSED __attribute__((unused))
-#else
-# define ATTRIBUTE_UNUSED
-#endif
-
-/* ---------------------------------------------------------------------------
- * Macros called by various action routines to show usage or to report
- * a syntax error and fail
- */
-#define AUSAGE(x) Message (PCB_MSG_INFO, "Usage:\n%s\n", (x##_syntax))
-#define AFAIL(x) { Message (PCB_MSG_ERROR, "Syntax error. Usage:\n%s\n", (x##_syntax)); return 1; }
-
-/* Make sure to catch usage of non-portable functions in debug mode */
-#ifndef NDEBUG
-# undef strdup
-# undef strndup
-# undef snprintf
-# undef round
-# define strdup never_use_strdup__use_pcb_strdup
-# define strndup never_use_strndup__use_pcb_strndup
-# define snprintf never_use_snprintf__use_pcb_snprintf
-# define round never_use_round__use_pcb_round
-#endif
-
-#endif /* PCB_GLOBAL_H */
diff --git a/src/global_element.h b/src/global_element.h
deleted file mode 100644
index beeb072..0000000
--- a/src/global_element.h
+++ /dev/null
@@ -1,17 +0,0 @@
-struct element_st {
- ANYOBJECTFIELDS;
- TextType Name[MAX_ELEMENTNAMES]; /* the elements names; */
- /* description text */
- /* name on PCB second, */
- /* value third */
- /* see macro.h */
- Coord MarkX, MarkY; /* position mark */
- pinlist_t Pin;
- padlist_t Pad;
- linelist_t Line;
- arclist_t Arc;
- BoxType VBox;
- gdl_elem_t link;
-};
-
-#include "list_element.h"
diff --git a/src/global_objs.h b/src/global_objs.h
deleted file mode 100644
index 4ec33d8..0000000
--- a/src/global_objs.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996, 2004 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 St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-
-#ifndef GLOBAL_OBJS_H
-#define GLOBAL_OBJS_H
-#include <genlist/gendlist.h>
-#include "config.h"
-#include "globalconst.h"
-#include "global_typedefs.h"
-#include "polyarea.h"
-
-typedef struct {
- char *name;
- char *value;
-} AttributeType, *AttributeTypePtr;
-
-struct AttributeListType {
- int Number, Max;
- AttributeType *List;
-};
-
-/* ---------------------------------------------------------------------------
- * Do not change the following definitions even if they're not very
- * nice. It allows us to have functions act on these "base types" and
- * not need to know what kind of actual object they're working on.
- */
-
-/* Any object that uses the "object flags" defined in const.h, or
- exists as an object on the pcb, MUST be defined using this as the
- first fields, either directly or through ANYLINEFIELDS. */
-#define ANYOBJECTFIELDS \
- BoxType BoundingBox; \
- long int ID; \
- FlagType Flags; \
- AttributeListType Attributes
-
- /* struct LibraryEntryType *net */
-
-/* Lines, pads, and rats all use this so they can be cross-cast. */
-#define ANYLINEFIELDS \
- ANYOBJECTFIELDS; \
- Coord Thickness, \
- Clearance; \
- PointType Point1, \
- Point2
-
-struct BoxType { /* a bounding box */
- Coord X1, Y1; /* upper left */
- Coord X2, Y2; /* and lower right corner */
-};
-
-/* Nobody should know about the internals of this except the macros in
- macros.h that access it. This structure must be simple-assignable
- for now. */
-typedef struct unknown_flag_s unknown_flag_t;
-struct unknown_flag_s {
- char *str;
- unknown_flag_t *next;
-};
-
-typedef struct {
- unsigned long f; /* generic flags */
- unsigned char t[(MAX_LAYER + 1) / 2]; /* thermals */
- unsigned char q; /* square geometry flag */
- unsigned char int_conn_grp;
- unknown_flag_t *unknowns;
-} FlagType, *FlagTypePtr;
-
-
-/* All on-pcb objects (elements, lines, pads, vias, rats, etc) are
- based on this. */
-typedef struct {
- ANYOBJECTFIELDS;
-} AnyObjectType, *AnyObjectTypePtr;
-
-typedef struct { /* a line/polygon point */
- Coord X, Y, X2, Y2; /* so Point type can be cast as BoxType */
- long int ID;
-} PointType, *PointTypePtr;
-
-/* Lines, rats, pads, etc. */
-typedef struct {
- ANYLINEFIELDS;
-} AnyLineObjectType, *AnyLineObjectTypePtr;
-
-typedef struct line_st { /* holds information about one line */
- ANYLINEFIELDS;
- char *Number;
- gdl_elem_t link; /* a line is in a list: either on a layer or in an element */
-} LineType, *LineTypePtr;
-
-typedef struct text_st {
- ANYOBJECTFIELDS;
- int Scale; /* text scaling in percent */
- Coord X, Y; /* origin */
- pcb_uint8_t Direction;
- char *TextString; /* string */
- void *Element;
- gdl_elem_t link; /* a text is in a list of a layer or an element */
-} TextType, *TextTypePtr;
-
-struct polygon_st { /* holds information about a polygon */
- ANYOBJECTFIELDS;
- pcb_cardinal_t PointN, /* number of points in polygon */
- PointMax; /* max number from malloc() */
- POLYAREA *Clipped; /* the clipped region of this polygon */
- PLINE *NoHoles; /* the polygon broken into hole-less regions */
- int NoHolesValid; /* Is the NoHoles polygon up to date? */
- PointTypePtr Points; /* data */
- pcb_cardinal_t *HoleIndex; /* Index of hole data within the Points array */
- pcb_cardinal_t HoleIndexN; /* number of holes in polygon */
- pcb_cardinal_t HoleIndexMax; /* max number from malloc() */
- gdl_elem_t link; /* a text is in a list of a layer */
-};
-
-typedef struct arc_st { /* holds information about arcs */
- ANYOBJECTFIELDS;
- Coord Thickness, Clearance;
- Coord Width, Height, /* length of axis */
- X, Y; /* center coordinates */
- Angle StartAngle, Delta; /* the two limiting angles in degrees */
- gdl_elem_t link; /* an arc is in a list: either on a layer or in an element */
-} ArcType, *ArcTypePtr;
-
-typedef struct rat_st { /* a rat-line */
- ANYLINEFIELDS;
- pcb_cardinal_t group1, group2; /* the layer group each point is on */
- gdl_elem_t link; /* an arc is in a list on a design */
-} RatType, *RatTypePtr;
-
-struct pad_st { /* a SMD pad */
- ANYLINEFIELDS;
- Coord Mask;
- char *Name, *Number; /* 'Line' */
- void *Element;
- void *Spare;
- gdl_elem_t link; /* a pad is in a list (element) */
-};
-
-struct pin_st {
- ANYOBJECTFIELDS;
- Coord Thickness, Clearance, Mask, DrillingHole;
- Coord X, Y; /* center and diameter */
- char *Name, *Number;
- void *Element;
- void *Spare;
- gdl_elem_t link; /* a pin is in a list (element) */
-};
-
-/* This is the extents of a Pin or Via, depending on whether it's a
- hole or not. */
-#define PIN_SIZE(pinptr) (TEST_FLAG(PCB_FLAG_HOLE, (pinptr)) \
- ? (pinptr)->DrillingHole \
- : (pinptr)->Thickness)
-
-/* ---------------------------------------------------------------------------
- * symbol and font related stuff
- */
-typedef struct symbol_st { /* a single symbol */
- LineTypePtr Line;
- pcb_bool Valid;
- pcb_cardinal_t LineN, /* number of lines */
- LineMax;
- Coord Width, Height, /* size of cell */
- Delta; /* distance to next symbol */
-} SymbolType, *SymbolTypePtr;
-
-typedef struct font_st { /* complete set of symbols */
- Coord MaxHeight, /* maximum cell width and height */
- MaxWidth;
- BoxType DefaultSymbol; /* the default symbol is a filled box */
- SymbolType Symbol[MAX_FONTPOSITION + 1];
- pcb_bool Valid;
-} FontType, *FontTypePtr;
-
-
-/* TODO: this could be replaced with pcb_obj_t */
-typedef struct onpoint_st {
- int type;
- union {
- void *any;
- LineType *line;
- ArcType *arc;
- } obj;
-} OnpointType;
-
-#endif
diff --git a/src/global_typedefs.h b/src/global_typedefs.h
index e172828..92496b4 100644
--- a/src/global_typedefs.h
+++ b/src/global_typedefs.h
@@ -24,20 +24,30 @@
#define GLOBAL_TYPEDEFS_H
#include "config.h"
-typedef struct BoxType BoxType, *BoxTypePtr;
-typedef struct polygon_st PolygonType, *PolygonTypePtr;
-typedef struct pad_st PadType, *PadTypePtr;
-typedef struct pin_st PinType, *PinTypePtr, **PinTypeHandle;
-typedef struct drc_violation_st DrcViolationType, *DrcViolationTypePtr;
-typedef struct rtree rtree_t;
-typedef struct AttributeListType AttributeListType, *AttributeListTypePtr;
-typedef struct rats_patch_line_s rats_patch_line_t;
-typedef struct element_st ElementType, *ElementTypePtr, **ElementTypeHandle;
-typedef struct net_st NetType, *NetTypePtr;
-typedef struct layer_st LayerType, *LayerTypePtr;
-typedef struct data_st DataType, *DataTypePtr;
-typedef struct plug_io_s plug_io_t;
+typedef struct pcb_board_s pcb_board_t;
+typedef struct pcb_data_s pcb_data_t;
+typedef struct pcb_layer_group_s pcb_layer_group_t;
+typedef struct pcb_layer_s pcb_layer_t;
+typedef struct pcb_buffer_s pcb_buffer_t;
+typedef struct pcb_net_s pcb_net_t;
+typedef struct pcb_connection_s pcb_connection_t;
+typedef struct pcb_box_s pcb_box_t;
+typedef struct pcb_box_list_s pcb_box_list_t;
+typedef struct pcb_font_s pcb_font_t;
+typedef struct pcb_line_s pcb_line_t;
+typedef struct pcb_arc_s pcb_arc_t;
+typedef struct pcb_point_s pcb_point_t;
+typedef struct pcb_rat_line_s pcb_rat_t;
+typedef struct pcb_polygon_s pcb_polygon_t;
+typedef struct pcb_pad_s pcb_pad_t;
+typedef struct pcb_pin_s pcb_pin_t;
+typedef struct pcb_rtree_s pcb_rtree_t;
+typedef struct pcb_ratspatch_line_s pcb_ratspatch_line_t;
+typedef struct pcb_element_s pcb_element_t;
+typedef struct pcb_text_s pcb_text_t;
+
+typedef struct pcb_plug_io_s pcb_plug_io_t;
typedef unsigned int pcb_cardinal_t;
typedef unsigned char pcb_uint8_t; /* Don't use in new code. */
diff --git a/src/globalconst.h b/src/globalconst.h
index 4b942de..ef03b80 100644
--- a/src/globalconst.h
+++ b/src/globalconst.h
@@ -38,82 +38,79 @@
/* frame between the groundplane and the copper or mask - noone seems
to remember what these two are for; changing them may have unforeseen
side effects. */
-#define GROUNDPLANEFRAME PCB_MIL_TO_COORD(15)
-#define MASKFRAME PCB_MIL_TO_COORD(3)
+#define PCB_GROUNDPLANEFRAME PCB_MIL_TO_COORD(15)
+#define PCB_MASKFRAME PCB_MIL_TO_COORD(3)
/* ---------------------------------------------------------------------------
* some limit specifications
*/
-#define LARGE_VALUE (COORD_MAX / 2 - 1) /* maximum extent of board and elements */
-
-#define MAX_LAYER 16 /* max number of layer, check source */
- /* code for more changes, a *lot* more changes */
-#define MIN_LINESIZE PCB_MIL_TO_COORD(0.01) /* thickness of lines */
-#define MAX_LINESIZE LARGE_VALUE
-#define MIN_ARCSIZE PCB_MIL_TO_COORD(0.01)
-#define MAX_ARCSIZE LARGE_VALUE
-#define MIN_TEXTSCALE 10 /* scaling of text objects in percent */
-#define MAX_TEXTSCALE 10000
-#define MIN_PINORVIASIZE PCB_MIL_TO_COORD(20) /* size of a pin or via */
-#define MIN_PINORVIAHOLE PCB_MIL_TO_COORD(4) /* size of a pins or vias drilling hole */
-#define MAX_PINORVIASIZE LARGE_VALUE
-#define MIN_PINORVIACOPPER PCB_MIL_TO_COORD(4) /* min difference outer-inner diameter */
-#define MIN_PADSIZE PCB_MIL_TO_COORD(1) /* min size of a pad */
-#define MAX_PADSIZE LARGE_VALUE /* max size of a pad */
-#define MIN_DRC_VALUE PCB_MIL_TO_COORD(0.1)
-#define MAX_DRC_VALUE PCB_MIL_TO_COORD(500)
-#define MIN_DRC_SILK PCB_MIL_TO_COORD(1)
-#define MAX_DRC_SILK PCB_MIL_TO_COORD(30)
-#define MIN_DRC_DRILL PCB_MIL_TO_COORD(1)
-#define MAX_DRC_DRILL PCB_MIL_TO_COORD(50)
-#define MIN_DRC_RING 0
-#define MAX_DRC_RING PCB_MIL_TO_COORD(100)
-#define MIN_GRID 1
-#define MAX_GRID PCB_MIL_TO_COORD(1000)
-#define MAX_FONTPOSITION 255 /* upper limit of characters in my font */
+#define PCB_LARGE_VALUE (COORD_MAX / 2 - 1) /* maximum extent of board and elements */
-#define MAX_COORD LARGE_VALUE /* coordinate limits */
-#define MIN_SIZE PCB_MIL_TO_COORD(10) /* lowest width and height of the board */
-#define MAX_BUFFER 5 /* number of pastebuffers */
- /* additional changes in menu.c are */
- /* also required to select more buffers */
+#define PCB_MAX_LAYER 16 /* max number of layer, check source code for more changes, a *lot* more changes */
+#if 0
+/* new array size that allows substrate layers */
+# define PCB_MAX_LAYERGRP ((PCB_MAX_LAYER+4)*2) /* max number of layer groups, a.k.a. physical layers */
+#else
+# define PCB_MAX_LAYERGRP PCB_MAX_LAYER /* max number of layer groups, a.k.a. physical layers */
+#endif
+#define PCB_MIN_LINESIZE PCB_MIL_TO_COORD(0.01) /* thickness of lines */
+#define PCB_MAX_LINESIZE PCB_LARGE_VALUE
+#define PCB_MIN_ARCSIZE PCB_MIL_TO_COORD(0.01)
+#define PCB_MAX_ARCSIZE PCB_LARGE_VALUE
+#define PCB_MIN_TEXTSCALE 10 /* scaling of text objects in percent */
+#define PCB_MAX_TEXTSCALE 10000
+#define PCB_MIN_PINORVIASIZE PCB_MIL_TO_COORD(20) /* size of a pin or via */
+#define PCB_MIN_PINORVIAHOLE PCB_MIL_TO_COORD(4) /* size of a pins or vias drilling hole */
+#define PCB_MAX_PINORVIASIZE PCB_LARGE_VALUE
+#define PCB_MIN_PINORVIACOPPER PCB_MIL_TO_COORD(4) /* min difference outer-inner diameter */
+#define PCB_MIN_PADSIZE PCB_MIL_TO_COORD(1) /* min size of a pad */
+#define PCB_MAX_PADSIZE PCB_LARGE_VALUE /* max size of a pad */
+#define PCB_MIN_DRC_VALUE PCB_MIL_TO_COORD(0.1)
+#define PCB_MAX_DRC_VALUE PCB_MIL_TO_COORD(500)
+#define PCB_MIN_DRC_SILK PCB_MIL_TO_COORD(1)
+#define PCB_MAX_DRC_SILK PCB_MIL_TO_COORD(30)
+#define PCB_MIN_DRC_DRILL PCB_MIL_TO_COORD(1)
+#define PCB_MAX_DRC_DRILL PCB_MIL_TO_COORD(50)
+#define PCB_MIN_DRC_RING 0
+#define PCB_MAX_DRC_RING PCB_MIL_TO_COORD(100)
+#define PCB_MIN_GRID 1
+#define PCB_MAX_GRID PCB_MIL_TO_COORD(1000)
+#define PCB_MAX_FONTPOSITION 255 /* upper limit of characters in my font */
+
+#define PCB_MAX_COORD PCB_LARGE_VALUE /* coordinate limits */
+#define PCB_MIN_SIZE PCB_MIL_TO_COORD(10) /* lowest width and height of the board */
+#define PCB_MAX_BUFFER 5 /* number of pastebuffers additional changes in menu.c are also required to select more buffers */
-#define DEFAULT_DRILLINGHOLE 40 /* default inner/outer ratio for */
- /* pins/vias in percent */
+#define PCB_DEFAULT_DRILLINGHOLE 40 /* default inner/outer ratio for pins/vias in percent */
-#if MAX_LINESIZE > MAX_PINORVIASIZE /* maximum size value */
-#define MAX_SIZE MAX_LINESIZE
+#if PCB_MAX_LINESIZE > PCB_MAX_PINORVIASIZE /* maximum size value */
+#define PCB_MAX_SIZE PCB_MAX_LINESIZE
#else
-#define MAX_SIZE MAX_PINORVIASIZE
+#define PCB_MAX_SIZE PCB_MAX_PINORVIASIZE
#endif
-#ifndef MAXPATHLEN /* maximum path length */
-#ifdef PATH_MAX
-#define MAXPATHLEN PATH_MAX
+#ifndef PCB_PATH_MAX /* maximum path length */
+#ifdef PATH_MAX
+#define PCB_PATH_MAX PATH_MAX
#else
-#define MAXPATHLEN 2048
+#define PCB_PATH_MAX 2048
#endif
#endif
-#define MAX_LINE_POINT_DISTANCE 0 /* maximum distance when searching */
- /* line points */
-#define MAX_POLYGON_POINT_DISTANCE 0 /* maximum distance when searching */
- /* polygon points */
-#define MAX_ELEMENTNAMES 3 /* number of supported names of */
- /* an element */
-#define MAX_NETLIST_LINE_LENGTH 255 /* maximum line length for netlist files */
-#define MAX_MODESTACK_DEPTH 16 /* maximum depth of mode stack */
-#define MIN_GRID_DISTANCE 4 /* minimum distance between point */
- /* to enable grid drawing */
- /* size of diamond element mark */
-#define EMARK_SIZE PCB_MIL_TO_COORD (10)
+#define PCB_MAX_LINE_POINT_DISTANCE 0 /* maximum distance when searching line points; same for arc point */
+#define PCB_MAX_POLYGON_POINT_DISTANCE 0 /* maximum distance when searching polygon points */
+#define PCB_MAX_ELEMENTNAMES 3 /* number of supported names of an element */
+#define PCB_MAX_NETLIST_LINE_LENGTH 255 /* maximum line length for netlist files */
+#define PCB_MAX_MODESTACK_DEPTH 16 /* maximum depth of mode stack */
+#define PCB_MIN_GRID_DISTANCE 4 /* minimum distance between point to enable grid drawing */
+#define PCB_EMARK_SIZE PCB_MIL_TO_COORD(10) /* size of diamond element mark */
/**** Font ***/
/* These are used in debug draw font rendering (e.g. pin names) and reverse
scale calculations (e.g. when report is trying to figure how the font
is scaled. Changing these values is not really supported. */
-#define FONT_CAPHEIGHT PCB_MIL_TO_COORD (45) /* (Approximate) capheight size of the default PCB font */
-#define DEFAULT_CELLSIZE 50 /* default cell size for symbols */
+#define PCB_FONT_CAPHEIGHT PCB_MIL_TO_COORD (45) /* (Approximate) capheight size of the default PCB font */
+#define PCB_DEFAULT_CELLSIZE 50 /* default cell size for symbols */
#endif
diff --git a/src/gui_act.c b/src/gui_act.c
index ea2b9f1..f38216c 100644
--- a/src/gui_act.c
+++ b/src/gui_act.c
@@ -25,6 +25,8 @@
*
*/
#include "config.h"
+#include "board.h"
+#include "build_run.h"
#include "conf_core.h"
#include "data.h"
#include "action_helper.h"
@@ -34,20 +36,24 @@
#include "draw.h"
#include "search.h"
-#include "crosshair.h"
#include "find.h"
-#include "set.h"
-#include "misc.h"
-#include "misc_util.h"
#include "stub_stroke.h"
#include "hid_actions.h"
#include "hid_init.h"
-#include "route_style.h"
-#include "layer.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
+#include "event.h"
+#include "layer_vis.h"
+
+#include "obj_elem_draw.h"
+#include "obj_pinvia_draw.h"
+#include "obj_pad_draw.h"
+
+#define CLONE_TYPES PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_VIA | PCB_TYPE_POLYGON
/* --------------------------------------------------------------------------- */
/* Toggle actions are kept for compatibility; new code should use the conf system instead */
-static const char display_syntax[] =
+static const char pcb_acts_Display[] =
"Display(NameOnPCB|Description|Value)\n"
"Display(Grid|Redraw)\n"
"Display(CycleClip|CycleCrosshair|ToggleAllDirections|ToggleStartDirection)\n"
@@ -58,7 +64,7 @@ static const char display_syntax[] =
"Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC)\n"
"Display(ToggleLiveRoute|LockNames|OnlyNames)\n" "Display(Pinout|PinOrPadName)";
-static const char display_help[] = "Several display-related actions.";
+static const char pcb_acth_Display[] = "Several display-related actions.";
/* %start-doc actions Display
@@ -83,7 +89,7 @@ various settings are: straight only, orthogonal then angled, and angled
then orthogonal. If AllDirections is set, this action disables it.
@item CycleCrosshair
-Changes crosshair drawing. Crosshair may accept form of 4-ray,
+Changes crosshair drawing. pcb_crosshair may accept form of 4-ray,
8-ray and 12-ray cross.
@item ToggleRubberBandMode
@@ -189,52 +195,52 @@ are affected.
%end-doc */
-static enum crosshair_shape CrosshairShapeIncrement(enum crosshair_shape shape)
+static enum pcb_crosshair_shape_e CrosshairShapeIncrement(enum pcb_crosshair_shape_e shape)
{
switch (shape) {
- case Basic_Crosshair_Shape:
- shape = Union_Jack_Crosshair_Shape;
+ case pcb_ch_shape_basic:
+ shape = pcb_ch_shape_union_jack;
break;
- case Union_Jack_Crosshair_Shape:
- shape = Dozen_Crosshair_Shape;
+ case pcb_ch_shape_union_jack:
+ shape = pcb_ch_shape_dozen;
break;
- case Dozen_Crosshair_Shape:
- shape = Crosshair_Shapes_Number;
+ case pcb_ch_shape_dozen:
+ shape = pcb_ch_shape_NUM;
break;
- case Crosshair_Shapes_Number:
- shape = Basic_Crosshair_Shape;
+ case pcb_ch_shape_NUM:
+ shape = pcb_ch_shape_basic;
break;
}
return shape;
}
-static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY)
+static int pcb_act_Display(int argc, const char **argv, pcb_coord_t childX, pcb_coord_t childY)
{
const char *function, *str_dir;
int id;
int err = 0;
- function = ACTION_ARG(0);
- str_dir = ACTION_ARG(1);
+ function = PCB_ACTION_ARG(0);
+ str_dir = PCB_ACTION_ARG(1);
if (function && (!str_dir || !*str_dir)) {
- switch (id = funchash_get(function, NULL)) {
+ switch (id = pcb_funchash_get(function, NULL)) {
/* redraw layout */
case F_ClearAndRedraw:
case F_Redraw:
- Redraw();
+ pcb_redraw();
break;
/* change the displayed name of elements */
case F_Value:
case F_NameOnPCB:
case F_Description:
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
EraseElementName(element);
}
- END_LOOP;
+ PCB_END_LOOP;
switch (id) {
case F_Value:
if (conf_core.editor.description || conf_core.editor.name_on_pcb) {
@@ -261,22 +267,22 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
conf_set_editor(name_on_pcb, 0); /* need to write once so the event is triggered */
break;
}
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
DrawElementName(element);
}
- END_LOOP;
- Draw();
+ PCB_END_LOOP;
+ pcb_draw();
break;
/* toggle line-adjust flag */
case F_ToggleAllDirections:
conf_toggle_editor(all_direction_lines);
- AdjustAttachedObjects();
+ pcb_adjust_attached_objects();
break;
case F_CycleClip:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
if (conf_core.editor.all_direction_lines) {
conf_toggle_editor(all_direction_lines);
conf_setf(CFR_DESIGN,"editor/line_refraction",-1,"%d",0);
@@ -284,28 +290,28 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
else {
conf_setf(CFR_DESIGN,"editor/line_refraction",-1,"%d",(conf_core.editor.line_refraction +1) % 3);
}
- AdjustAttachedObjects();
- notify_crosshair_change(pcb_true);
+ pcb_adjust_attached_objects();
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_CycleCrosshair:
- notify_crosshair_change(pcb_false);
- Crosshair.shape = CrosshairShapeIncrement(Crosshair.shape);
- if (Crosshair_Shapes_Number == Crosshair.shape)
- Crosshair.shape = Basic_Crosshair_Shape;
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_crosshair.shape = CrosshairShapeIncrement(pcb_crosshair.shape);
+ if (pcb_ch_shape_NUM == pcb_crosshair.shape)
+ pcb_crosshair.shape = pcb_ch_shape_basic;
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleRubberBandMode:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
conf_toggle_editor(rubber_band_mode);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleStartDirection:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
conf_toggle_editor(swap_start_direction);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleUniqueNames:
@@ -313,21 +319,21 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
break;
case F_ToggleSnapPin:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
conf_toggle_editor(snap_pin);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleSnapOffGridLine:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
conf_toggle_editor(snap_offgrid_line);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleHighlightOnPoint:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
conf_toggle_editor(highlight_on_point);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleLocalRef:
@@ -336,12 +342,12 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
case F_ToggleThindraw:
conf_toggle_editor(thin_draw);
- Redraw();
+ pcb_redraw();
break;
case F_ToggleThindrawPoly:
conf_toggle_editor(thin_draw_poly);
- Redraw();
+ pcb_redraw();
break;
case F_ToggleLockNames:
@@ -356,7 +362,7 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
case F_ToggleHideNames:
conf_toggle_editor(hide_names);
- Redraw();
+ pcb_redraw();
break;
case F_ToggleStroke:
@@ -372,22 +378,22 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
break;
case F_ToggleAutoDRC:
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
conf_toggle_editor(auto_drc);
if (conf_core.editor.auto_drc && conf_core.editor.mode == PCB_MODE_LINE) {
- if (ResetConnections(pcb_true)) {
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_reset_conns(pcb_true)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
}
- if (Crosshair.AttachedLine.State != STATE_FIRST)
- LookupConnection(Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, pcb_true, 1, PCB_FLAG_FOUND);
+ if (pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST)
+ pcb_lookup_conn(pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, pcb_true, 1, PCB_FLAG_FOUND);
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
case F_ToggleCheckPlanes:
conf_toggle_editor(check_planes);
- Redraw();
+ pcb_redraw();
break;
case F_ToggleOrthoMove:
@@ -396,12 +402,12 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
case F_ToggleName:
conf_toggle_editor(show_number);
- Redraw();
+ pcb_redraw();
break;
case F_ToggleMask:
conf_toggle_editor(show_mask);
- Redraw();
+ pcb_redraw();
break;
case F_ToggleClearLine:
@@ -415,32 +421,32 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
/* shift grid alignment */
case F_ToggleGrid:
{
- Coord oldGrid = PCB->Grid;
+ pcb_coord_t oldGrid = PCB->Grid;
PCB->Grid = 1;
- if (MoveCrosshairAbsolute(Crosshair.X, Crosshair.Y))
- notify_crosshair_change(pcb_true); /* first notify was in MoveCrosshairAbs */
- SetGrid(oldGrid, pcb_true);
+ if (pcb_crosshair_move_absolute(pcb_crosshair.X, pcb_crosshair.Y))
+ pcb_notify_crosshair_change(pcb_true); /* first notify was in MoveCrosshairAbs */
+ pcb_board_set_grid(oldGrid, pcb_true);
}
break;
/* toggle displaying of the grid */
case F_Grid:
conf_toggle_editor(draw_grid);
- Redraw();
+ pcb_redraw();
break;
/* display the pinout of an element */
case F_Pinout:
{
- ElementTypePtr element;
+ pcb_element_t *element;
void *ptrtmp;
- Coord x, y;
+ pcb_coord_t x, y;
- gui->get_coords(_("Click on an element"), &x, &y);
- if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) {
- element = (ElementTypePtr) ptrtmp;
- gui->show_item(element);
+ pcb_gui->get_coords(_("Click on an element"), &x, &y);
+ if ((pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) {
+ element = (pcb_element_t *) ptrtmp;
+ pcb_gui->show_item(element);
}
break;
}
@@ -449,71 +455,71 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
case F_PinOrPadName:
{
void *ptr1, *ptr2, *ptr3;
- Coord x, y;
- gui->get_coords(_("Click on an element"), &x, &y);
+ pcb_coord_t x, y;
+ pcb_gui->get_coords(_("Click on an element"), &x, &y);
- switch (SearchScreen(x, y,
+ switch (pcb_search_screen(x, y,
PCB_TYPE_ELEMENT | PCB_TYPE_PIN | PCB_TYPE_PAD |
PCB_TYPE_VIA, (void **) &ptr1, (void **) &ptr2, (void **) &ptr3)) {
case PCB_TYPE_ELEMENT:
- PIN_LOOP((ElementTypePtr) ptr1);
+ PCB_PIN_LOOP((pcb_element_t *) ptr1);
{
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, pin))
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, pin))
ErasePinName(pin);
else
DrawPinName(pin);
- AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, pin, pin);
- TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, ptr1, pin, pin);
+ PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, pin);
}
- END_LOOP;
- PAD_LOOP((ElementTypePtr) ptr1);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP((pcb_element_t *) ptr1);
{
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, pad))
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, pad))
ErasePadName(pad);
else
DrawPadName(pad);
- AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, pad, pad);
- TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, ptr1, pad, pad);
+ PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, pad);
}
- END_LOOP;
- SetChangedFlag(pcb_true);
- IncrementUndoSerialNumber();
- Draw();
+ PCB_END_LOOP;
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_draw();
break;
case PCB_TYPE_PIN:
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2))
- ErasePinName((PinTypePtr) ptr2);
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, (pcb_pin_t *) ptr2))
+ ErasePinName((pcb_pin_t *) ptr2);
else
- DrawPinName((PinTypePtr) ptr2);
- AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, ptr2, ptr3);
- TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2);
- SetChangedFlag(pcb_true);
- IncrementUndoSerialNumber();
- Draw();
+ DrawPinName((pcb_pin_t *) ptr2);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, ptr1, ptr2, ptr3);
+ PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, (pcb_pin_t *) ptr2);
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_draw();
break;
case PCB_TYPE_PAD:
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, (PadTypePtr) ptr2))
- ErasePadName((PadTypePtr) ptr2);
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, (pcb_pad_t *) ptr2))
+ ErasePadName((pcb_pad_t *) ptr2);
else
- DrawPadName((PadTypePtr) ptr2);
- AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, ptr2, ptr3);
- TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, (PadTypePtr) ptr2);
- SetChangedFlag(pcb_true);
- IncrementUndoSerialNumber();
- Draw();
+ DrawPadName((pcb_pad_t *) ptr2);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, ptr1, ptr2, ptr3);
+ PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, (pcb_pad_t *) ptr2);
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_draw();
break;
case PCB_TYPE_VIA:
- if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2))
- EraseViaName((PinTypePtr) ptr2);
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, (pcb_pin_t *) ptr2))
+ EraseViaName((pcb_pin_t *) ptr2);
else
- DrawViaName((PinTypePtr) ptr2);
- AddObjectToFlagUndoList(PCB_TYPE_VIA, ptr1, ptr2, ptr3);
- TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2);
- SetChangedFlag(pcb_true);
- IncrementUndoSerialNumber();
- Draw();
+ DrawViaName((pcb_pin_t *) ptr2);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, ptr1, ptr2, ptr3);
+ PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, (pcb_pin_t *) ptr2);
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_draw();
break;
}
break;
@@ -523,13 +529,13 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
}
}
else if (function && str_dir) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_ToggleGrid:
if (argc > 2) {
- PCB->GridOffsetX = GetValue(argv[1], NULL, NULL, NULL);
- PCB->GridOffsetY = GetValue(argv[2], NULL, NULL, NULL);
+ PCB->GridOffsetX = pcb_get_value(argv[1], NULL, NULL, NULL);
+ PCB->GridOffsetY = pcb_get_value(argv[2], NULL, NULL, NULL);
if (conf_core.editor.draw_grid)
- Redraw();
+ pcb_redraw();
}
break;
@@ -542,15 +548,15 @@ static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY
if (!err)
return 0;
- AFAIL(display);
+ PCB_ACT_FAIL(Display);
}
/* --------------------------------------------------------------------------- */
-static const char mode_syntax[] =
+static const char pcb_acts_Mode[] =
"Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer)\n"
"Mode(Polygon|Rectangle|Remove|Rotate|Text|Thermal|Via)\n" "Mode(Notify|Release|Cancel|Stroke)\n" "Mode(Save|Restore)";
-static const char mode_help[] = "Change or use the tool mode.";
+static const char pcb_acth_Mode[] = "Change or use the tool mode.";
/* %start-doc actions Mode
@@ -604,44 +610,44 @@ Restores the tool to the last saved tool.
%end-doc */
-static int ActionMode(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Mode(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- Note.X = Crosshair.X;
- Note.Y = Crosshair.Y;
- notify_crosshair_change(pcb_false);
- switch (funchash_get(function, NULL)) {
+ Note.X = pcb_crosshair.X;
+ Note.Y = pcb_crosshair.Y;
+ pcb_notify_crosshair_change(pcb_false);
+ switch (pcb_funchash_get(function, NULL)) {
case F_Arc:
- SetMode(PCB_MODE_ARC);
+ pcb_crosshair_set_mode(PCB_MODE_ARC);
break;
case F_Arrow:
- SetMode(PCB_MODE_ARROW);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
break;
case F_Copy:
- SetMode(PCB_MODE_COPY);
+ pcb_crosshair_set_mode(PCB_MODE_COPY);
break;
case F_InsertPoint:
- SetMode(PCB_MODE_INSERT_POINT);
+ pcb_crosshair_set_mode(PCB_MODE_INSERT_POINT);
break;
case F_Line:
- SetMode(PCB_MODE_LINE);
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
break;
case F_Lock:
- SetMode(PCB_MODE_LOCK);
+ pcb_crosshair_set_mode(PCB_MODE_LOCK);
break;
case F_Move:
- SetMode(PCB_MODE_MOVE);
+ pcb_crosshair_set_mode(PCB_MODE_MOVE);
break;
case F_None:
- SetMode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
break;
case F_Cancel:
{
int saved_mode = conf_core.editor.mode;
- SetMode(PCB_MODE_NO);
- SetMode(saved_mode);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(saved_mode);
}
break;
case F_Escape:
@@ -658,52 +664,52 @@ static int ActionMode(int argc, const char **argv, Coord x, Coord y)
case PCB_MODE_RUBBERBAND_MOVE:
case PCB_MODE_THERMAL:
case PCB_MODE_LOCK:
- SetMode(PCB_MODE_NO);
- SetMode(PCB_MODE_ARROW);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
break;
case PCB_MODE_LINE:
- if (Crosshair.AttachedLine.State == STATE_FIRST)
- SetMode(PCB_MODE_ARROW);
+ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
else {
- SetMode(PCB_MODE_NO);
- SetMode(PCB_MODE_LINE);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
}
break;
case PCB_MODE_RECTANGLE:
- if (Crosshair.AttachedBox.State == STATE_FIRST)
- SetMode(PCB_MODE_ARROW);
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
else {
- SetMode(PCB_MODE_NO);
- SetMode(PCB_MODE_RECTANGLE);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_RECTANGLE);
}
break;
case PCB_MODE_POLYGON:
- if (Crosshair.AttachedLine.State == STATE_FIRST)
- SetMode(PCB_MODE_ARROW);
+ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
else {
- SetMode(PCB_MODE_NO);
- SetMode(PCB_MODE_POLYGON);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_POLYGON);
}
break;
case PCB_MODE_POLYGON_HOLE:
- if (Crosshair.AttachedLine.State == STATE_FIRST)
- SetMode(PCB_MODE_ARROW);
+ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
else {
- SetMode(PCB_MODE_NO);
- SetMode(PCB_MODE_POLYGON_HOLE);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_POLYGON_HOLE);
}
break;
case PCB_MODE_ARC:
- if (Crosshair.AttachedBox.State == STATE_FIRST)
- SetMode(PCB_MODE_ARROW);
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
else {
- SetMode(PCB_MODE_NO);
- SetMode(PCB_MODE_ARC);
+ pcb_crosshair_set_mode(PCB_MODE_NO);
+ pcb_crosshair_set_mode(PCB_MODE_ARC);
}
break;
@@ -717,154 +723,176 @@ static int ActionMode(int argc, const char **argv, Coord x, Coord y)
break;
case F_Notify:
- NotifyMode();
+ pcb_notify_mode();
break;
case F_PasteBuffer:
- SetMode(PCB_MODE_PASTE_BUFFER);
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
break;
case F_Polygon:
- SetMode(PCB_MODE_POLYGON);
+ pcb_crosshair_set_mode(PCB_MODE_POLYGON);
break;
case F_PolygonHole:
- SetMode(PCB_MODE_POLYGON_HOLE);
+ pcb_crosshair_set_mode(PCB_MODE_POLYGON_HOLE);
break;
case F_Release:
- if ((mid_stroke) && (conf_core.editor.enable_stroke))
- stub_stroke_finish();
+ if ((pcb_mid_stroke) && (conf_core.editor.enable_stroke))
+ pcb_stub_stroke_finish();
else
- ReleaseMode();
+ pcb_release_mode();
break;
case F_Remove:
- SetMode(PCB_MODE_REMOVE);
+ pcb_crosshair_set_mode(PCB_MODE_REMOVE);
break;
case F_Rectangle:
- SetMode(PCB_MODE_RECTANGLE);
+ pcb_crosshair_set_mode(PCB_MODE_RECTANGLE);
break;
case F_Rotate:
- SetMode(PCB_MODE_ROTATE);
+ pcb_crosshair_set_mode(PCB_MODE_ROTATE);
break;
case F_Stroke:
if (conf_core.editor.enable_stroke) {
- stub_stroke_start();
+ pcb_stub_stroke_start();
break;
}
/* Handle middle mouse button restarts of drawing mode. If not in
| a drawing mode, middle mouse button will select objects.
*/
- if (conf_core.editor.mode == PCB_MODE_LINE && Crosshair.AttachedLine.State != STATE_FIRST) {
- SetMode(PCB_MODE_LINE);
+ if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) {
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
}
- else if (conf_core.editor.mode == PCB_MODE_ARC && Crosshair.AttachedBox.State != STATE_FIRST)
- SetMode(PCB_MODE_ARC);
- else if (conf_core.editor.mode == PCB_MODE_RECTANGLE && Crosshair.AttachedBox.State != STATE_FIRST)
- SetMode(PCB_MODE_RECTANGLE);
- else if (conf_core.editor.mode == PCB_MODE_POLYGON && Crosshair.AttachedLine.State != STATE_FIRST)
- SetMode(PCB_MODE_POLYGON);
+ else if (conf_core.editor.mode == PCB_MODE_ARC && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_ARC);
+ else if (conf_core.editor.mode == PCB_MODE_RECTANGLE && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_RECTANGLE);
+ else if (conf_core.editor.mode == PCB_MODE_POLYGON && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST)
+ pcb_crosshair_set_mode(PCB_MODE_POLYGON);
else {
- SaveMode();
+ pcb_crosshair_save_mode();
saved_mode = pcb_true;
- SetMode(PCB_MODE_ARROW);
- NotifyMode();
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
+ pcb_notify_mode();
}
break;
case F_Text:
- SetMode(PCB_MODE_TEXT);
+ pcb_crosshair_set_mode(PCB_MODE_TEXT);
break;
case F_Thermal:
- SetMode(PCB_MODE_THERMAL);
+ pcb_crosshair_set_mode(PCB_MODE_THERMAL);
break;
case F_Via:
- SetMode(PCB_MODE_VIA);
+ pcb_crosshair_set_mode(PCB_MODE_VIA);
break;
case F_Restore: /* restore the last saved mode */
- RestoreMode();
+ pcb_crosshair_restore_mode();
break;
case F_Save: /* save currently selected mode */
- SaveMode();
+ pcb_crosshair_save_mode();
break;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
- AFAIL(mode);
+ PCB_ACT_FAIL(Mode);
}
/* ---------------------------------------------------------------- */
-static const char cycledrag_syntax[] = "CycleDrag()\n";
+static const char pcb_acts_CycleDrag[] = "CycleDrag()\n";
-static const char cycledrag_help[] = "Cycle through which object is being dragged";
+static const char pcb_acth_CycleDrag[] = "Cycle through which object is being dragged";
-#define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (SLOP * pixel_slop)) : ((a)-(b) > -(SLOP * pixel_slop)))
-static int ActionCycleDrag(int argc, const char **argv, Coord x, Coord y)
+#define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (PCB_SLOP * pcb_pixel_slop)) : ((a)-(b) > -(PCB_SLOP * pcb_pixel_slop)))
+static int pcb_act_CycleDrag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
void *ptr1, *ptr2, *ptr3;
int over = 0;
- if (Crosshair.drags == NULL)
+ if ((pcb_crosshair.drags == NULL) || (conf_core.editor.rubber_band_mode))
return 0;
do {
- Crosshair.drags_current++;
- if (Crosshair.drags_current >= Crosshair.drags_len) {
- Crosshair.drags_current = 0;
+ pcb_crosshair.drags_current++;
+ if (pcb_crosshair.drags_current >= pcb_crosshair.drags_len) {
+ pcb_crosshair.drags_current = 0;
over++;
}
- if (SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Crosshair.drags[Crosshair.drags_current], PCB_TYPE_LINE) != PCB_TYPE_NONE) {
+ if (pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, pcb_crosshair.drags[pcb_crosshair.drags_current], PCB_TYPE_LINE) != PCB_TYPE_NONE) {
/* line has two endpoints, check which one is close to the original x;y */
- LineType *l = ptr2;
+ pcb_line_t *l = ptr2;
if (close_enough(Note.X, l->Point1.X) && close_enough(Note.Y, l->Point1.Y)) {
- Crosshair.AttachedObject.Type = PCB_TYPE_LINE_POINT;
- Crosshair.AttachedObject.Ptr1 = ptr1;
- Crosshair.AttachedObject.Ptr2 = ptr2;
- Crosshair.AttachedObject.Ptr3 = &l->Point1;
- return 0;
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_LINE_POINT;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = &l->Point1;
+ goto switched;
}
if (close_enough(Note.X, l->Point2.X) && close_enough(Note.Y, l->Point2.Y)) {
- Crosshair.AttachedObject.Type = PCB_TYPE_LINE_POINT;
- Crosshair.AttachedObject.Ptr1 = ptr1;
- Crosshair.AttachedObject.Ptr2 = ptr2;
- Crosshair.AttachedObject.Ptr3 = &l->Point2;
- return 0;
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_LINE_POINT;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = &l->Point2;
+ goto switched;
}
}
- else if (SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Crosshair.drags[Crosshair.drags_current], PCB_TYPE_VIA) != PCB_TYPE_NONE) {
- Crosshair.AttachedObject.Type = PCB_TYPE_VIA;
- Crosshair.AttachedObject.Ptr1 = ptr1;
- Crosshair.AttachedObject.Ptr2 = ptr2;
- Crosshair.AttachedObject.Ptr3 = ptr3;
- return 0;
+ else if (pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, pcb_crosshair.drags[pcb_crosshair.drags_current], PCB_TYPE_ARC_POINT) != PCB_TYPE_NONE) {
+ pcb_coord_t ex, ey;
+ pcb_arc_get_end((pcb_arc_t *)ptr2, 0, &ex, &ey);
+ if (close_enough(Note.X, ex) && close_enough(Note.Y, ey)) {
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_ARC_POINT;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = pcb_arc_start_ptr;
+ goto switched;
+ }
+ pcb_arc_get_end((pcb_arc_t *)ptr2, 1, &ex, &ey);
+ if (close_enough(Note.X, ex) && close_enough(Note.Y, ey)) {
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_ARC_POINT;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = pcb_arc_end_ptr;
+ goto switched;
+ }
}
- else if (SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Crosshair.drags[Crosshair.drags_current], PCB_TYPE_PAD) != PCB_TYPE_NONE) {
- Crosshair.AttachedObject.Type = PCB_TYPE_ELEMENT;
- Crosshair.AttachedObject.Ptr1 = ptr1;
- Crosshair.AttachedObject.Ptr2 = ptr1;
- Crosshair.AttachedObject.Ptr3 = ptr1;
- return 0;
+ else if (pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, pcb_crosshair.drags[pcb_crosshair.drags_current], PCB_TYPE_VIA) != PCB_TYPE_NONE) {
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_VIA;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = ptr3;
+ goto switched;
}
- else if (SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Crosshair.drags[Crosshair.drags_current], PCB_TYPE_ARC) != PCB_TYPE_NONE) {
- Crosshair.AttachedObject.Type = PCB_TYPE_ARC;
- Crosshair.AttachedObject.Ptr1 = ptr1;
- Crosshair.AttachedObject.Ptr2 = ptr2;
- Crosshair.AttachedObject.Ptr3 = ptr3;
- return 0;
+ else if (pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, pcb_crosshair.drags[pcb_crosshair.drags_current], PCB_TYPE_PAD) != PCB_TYPE_NONE) {
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_ELEMENT;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr3 = ptr1;
+ goto switched;
+ }
+ else if (pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, pcb_crosshair.drags[pcb_crosshair.drags_current], PCB_TYPE_ARC) != PCB_TYPE_NONE) {
+ pcb_crosshair.AttachedObject.Type = PCB_TYPE_ARC;
+ pcb_crosshair.AttachedObject.Ptr1 = ptr1;
+ pcb_crosshair.AttachedObject.Ptr2 = ptr2;
+ pcb_crosshair.AttachedObject.Ptr3 = ptr3;
+ goto switched;
}
} while (over <= 1);
return -1;
+ switched:;
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_LINES, "ippp", pcb_crosshair.AttachedObject.Type, pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3);
+ return 0;
}
#undef close_enough
/* -------------------------------------------------------------------------- */
-static const char message_syntax[] = "Message(message)";
+static const char pcb_acts_Message[] = "pcb_message(message)";
-static const char message_help[] = "Writes a message to the log window.";
+static const char pcb_acth_Message[] = "Writes a message to the log window.";
/* %start-doc actions Message
@@ -875,16 +903,16 @@ followed by a newline.
%end-doc */
-static int ActionMessage(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Message(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int i;
if (argc < 1)
- AFAIL(message);
+ PCB_ACT_FAIL(Message);
for (i = 0; i < argc; i++) {
- Message(PCB_MSG_DEFAULT, argv[i]);
- Message(PCB_MSG_DEFAULT, "\n");
+ pcb_message(PCB_MSG_INFO, argv[i]);
+ pcb_message(PCB_MSG_INFO, "\n");
}
return 0;
@@ -892,9 +920,9 @@ static int ActionMessage(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char togglehidename_syntax[] = "ToggleHideName(Object|SelectedElements)";
+static const char pcb_acts_ToggleHideName[] = "ToggleHideName(Object|SelectedElements)";
-static const char togglehidename_help[] = "Toggles the visibility of element names.";
+static const char pcb_acth_ToggleHideName[] = "Toggles the visibility of element names.";
/* %start-doc actions ToggleHideName
@@ -903,24 +931,24 @@ appear on the silk layer when you print the layout.
%end-doc */
-static int ActionToggleHideName(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ToggleHideName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function && PCB->ElementOn) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
- AddObjectToFlagUndoList(type, ptr1, ptr2, ptr3);
- EraseElementName((ElementTypePtr) ptr2);
- TOGGLE_FLAG(PCB_FLAG_HIDENAME, (ElementTypePtr) ptr2);
- DrawElementName((ElementTypePtr) ptr2);
- Draw();
- IncrementUndoSerialNumber();
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
+ pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr3);
+ EraseElementName((pcb_element_t *) ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_HIDENAME, (pcb_element_t *) ptr2);
+ DrawElementName((pcb_element_t *) ptr2);
+ pcb_draw();
+ pcb_undo_inc_serial();
}
break;
}
@@ -928,21 +956,21 @@ static int ActionToggleHideName(int argc, const char **argv, Coord x, Coord y)
case F_Selected:
{
pcb_bool changed = pcb_false;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if ((TEST_FLAG(PCB_FLAG_SELECTED, element) || TEST_FLAG(PCB_FLAG_SELECTED, &NAMEONPCB_TEXT(element)))
- && (FRONT(element) || PCB->InvisibleObjectsOn)) {
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element);
+ if ((PCB_FLAG_TEST(PCB_FLAG_SELECTED, element) || PCB_FLAG_TEST(PCB_FLAG_SELECTED, &PCB_ELEM_TEXT_REFDES(element)))
+ && (PCB_FRONT(element) || PCB->InvisibleObjectsOn)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT, element, element, element);
EraseElementName(element);
- TOGGLE_FLAG(PCB_FLAG_HIDENAME, element);
+ PCB_FLAG_TOGGLE(PCB_FLAG_HIDENAME, element);
DrawElementName(element);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (changed) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
}
}
@@ -952,9 +980,9 @@ static int ActionToggleHideName(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char markcrosshair_syntax[] = "MarkCrosshair()\n" "MarkCrosshair(Center)";
+static const char pcb_acts_MarkCrosshair[] = "MarkCrosshair()\n" "MarkCrosshair(Center)";
-static const char markcrosshair_help[] = "Set/Reset the Crosshair mark.";
+static const char pcb_acth_MarkCrosshair[] = "Set/Reset the pcb_crosshair mark.";
/* %start-doc actions MarkCrosshair
@@ -970,48 +998,48 @@ cursor location.
%end-doc */
-static int ActionMarkCrosshair(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_MarkCrosshair(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (!function || !*function) {
- if (Marked.status) {
- notify_mark_change(pcb_false);
- Marked.status = pcb_false;
- notify_mark_change(pcb_true);
+ if (pcb_marked.status) {
+ pcb_notify_mark_change(pcb_false);
+ pcb_marked.status = pcb_false;
+ pcb_notify_mark_change(pcb_true);
}
else {
- notify_mark_change(pcb_false);
- Marked.status = pcb_false;
- Marked.status = pcb_true;
- Marked.X = Crosshair.X;
- Marked.Y = Crosshair.Y;
- notify_mark_change(pcb_true);
+ pcb_notify_mark_change(pcb_false);
+ pcb_marked.status = pcb_false;
+ pcb_marked.status = pcb_true;
+ pcb_marked.X = pcb_crosshair.X;
+ pcb_marked.Y = pcb_crosshair.Y;
+ pcb_notify_mark_change(pcb_true);
}
}
- else if (funchash_get(function, NULL) == F_Center) {
- notify_mark_change(pcb_false);
- Marked.status = pcb_true;
- Marked.X = Crosshair.X;
- Marked.Y = Crosshair.Y;
- notify_mark_change(pcb_true);
+ else if (pcb_funchash_get(function, NULL) == F_Center) {
+ pcb_notify_mark_change(pcb_false);
+ pcb_marked.status = pcb_true;
+ pcb_marked.X = pcb_crosshair.X;
+ pcb_marked.Y = pcb_crosshair.Y;
+ pcb_notify_mark_change(pcb_true);
}
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char routestyle_syntax[] = "RouteStyle(1|2|3|4)";
+static const char pcb_acts_RouteStyle[] = "RouteStyle(1|2|3|4)";
-static const char routestyle_help[] = "Copies the indicated routing style into the current sizes.";
+static const char pcb_acth_RouteStyle[] = "Copies the indicated routing style into the current sizes.";
/* %start-doc actions RouteStyle
%end-doc */
-static int ActionRouteStyle(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_RouteStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *str = ACTION_ARG(0);
- RouteStyleType *rts;
+ const char *str = PCB_ACTION_ARG(0);
+ pcb_route_style_t *rts;
int number;
if (str) {
@@ -1023,7 +1051,7 @@ static int ActionRouteStyle(int argc, const char **argv, Coord x, Coord y)
number = -1;
for(n = 0; n < vtroutestyle_len(&PCB->RouteStyle); n++) {
rts = &PCB->RouteStyle.array[n];
- if (strcasecmp(rts->name, str) == 0) {
+ if (pcb_strcasecmp(rts->name, str) == 0) {
number = n + 1;
break;
}
@@ -1032,77 +1060,77 @@ static int ActionRouteStyle(int argc, const char **argv, Coord x, Coord y)
if (number > 0 && number <= vtroutestyle_len(&PCB->RouteStyle)) {
rts = &PCB->RouteStyle.array[number - 1];
- SetLineSize(rts->Thick);
- SetViaSize(rts->Diameter, pcb_true);
- SetViaDrillingHole(rts->Hole, pcb_true);
- SetClearanceWidth(rts->Clearance);
- hid_action("RouteStylesChanged");
+ pcb_board_set_line_width(rts->Thick);
+ pcb_board_set_via_size(rts->Diameter, pcb_true);
+ pcb_board_set_via_drilling_hole(rts->Hole, pcb_true);
+ pcb_board_set_clearance(rts->Clearance);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
}
else
- Message(PCB_MSG_DEFAULT, "Error: invalid route style name or index\n");
+ pcb_message(PCB_MSG_ERROR, "Error: invalid route style name or index\n");
}
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char createmenu_syntax[] = "CreateMenu(path | path, action, mnemonic, accel, tooltip, cookie)";
-static const char createmenu_help[] = "Creates a new menu, popup (only path specified) or submenu (at least path and action are specified)";
+static const char pcb_acts_CreateMenu[] = "CreateMenu(path | path, action, mnemonic, accel, tooltip, cookie)";
+static const char pcb_acth_CreateMenu[] = "Creates a new menu, popup (only path specified) or submenu (at least path and action are specified)";
/* %start-doc actions RouteStyle
%end-doc */
-static int ActionCreateMenu(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_CreateMenu(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- if (gui == NULL) {
- Message(PCB_MSG_DEFAULT, "Error: can't create menu, there's no GUI hid loaded\n");
+ if (pcb_gui == NULL) {
+ pcb_message(PCB_MSG_ERROR, "Error: can't create menu, there's no GUI hid loaded\n");
return 1;
}
if (argc > 0) {
- gui->create_menu(argv[0], (argc > 1) ? argv[1] : NULL, (argc > 2) ? argv[2] : NULL, (argc > 3) ? argv[3] : NULL, (argc > 4) ? argv[4] : NULL, (argc > 5) ? argv[5] : NULL);
+ pcb_gui->create_menu(argv[0], (argc > 1) ? argv[1] : NULL, (argc > 2) ? argv[2] : NULL, (argc > 3) ? argv[3] : NULL, (argc > 4) ? argv[4] : NULL, (argc > 5) ? argv[5] : NULL);
return 0;
}
- AFAIL(message);
+ PCB_ACT_FAIL(CreateMenu);
}
/* --------------------------------------------------------------------------- */
-static const char removemenu_syntax[] = "RemoveMenu(path|cookie)";
-static const char removemenu_help[] = "Recursively removes a new menu, popup (only path specified) or submenu. ";
+static const char pcb_acts_RemoveMenu[] = "RemoveMenu(path|cookie)";
+static const char pcb_acth_RemoveMenu[] = "Recursively removes a new menu, popup (only path specified) or submenu. ";
/* %start-doc actions RouteStyle
%end-doc */
-static int ActionRemoveMenu(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_RemoveMenu(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- if (gui == NULL) {
- Message(PCB_MSG_ERROR, "can't remove menu, there's no GUI hid loaded\n");
+ if (pcb_gui == NULL) {
+ pcb_message(PCB_MSG_ERROR, "can't remove menu, there's no GUI hid loaded\n");
return 1;
}
- if (gui->remove_menu == NULL) {
- Message(PCB_MSG_ERROR, "can't remove menu, the GUI doesn't support it\n");
+ if (pcb_gui->remove_menu == NULL) {
+ pcb_message(PCB_MSG_ERROR, "can't remove menu, the GUI doesn't support it\n");
return 1;
}
if (argc > 0) {
- if (gui->remove_menu(argv[0]) != 0)
- Message(PCB_MSG_ERROR, "failed to remove some of the menu items\n");
- return 0;
+ if (pcb_gui->remove_menu(argv[0]) != 0)
+ pcb_message(PCB_MSG_ERROR, "failed to remove some of the menu items\n");
+ return 0;
}
- AFAIL(message);
+ PCB_ACT_FAIL(RemoveMenu);
}
/* --------------------------------------------------------------------------- */
-static const char setsame_syntax[] = "SetSame()";
+static const char pcb_acts_SetSame[] = "SetSame()";
-static const char setsame_help[] = "Sets current layer and sizes to match indicated item.";
+static const char pcb_acth_SetSame[] = "Sets current layer and sizes to match indicated item.";
/* %start-doc actions SetSame
@@ -1111,7 +1139,7 @@ current layer to be the layer that item is on, and changes the current
sizes (thickness, clearance, drill, etc) according to that item.
%end-doc */
-static void set_same_(Coord Thick, Coord Diameter, Coord Hole, Coord Clearance, char *Name)
+static void set_same_(pcb_coord_t Thick, pcb_coord_t Diameter, pcb_coord_t Hole, pcb_coord_t Clearance, char *Name)
{
int known;
known = pcb_route_style_lookup(&PCB->RouteStyle, Thick, Diameter, Hole, Clearance, Name);
@@ -1121,68 +1149,69 @@ static void set_same_(Coord Thick, Coord Diameter, Coord Hole, Coord Clearance,
if (Clearance != 0) { pcb_custom_route_style.Clearance = Clearance; conf_set_design("design/clearance", "%$mS", Clearance); }
if (Diameter != 0) { pcb_custom_route_style.Diameter = Diameter; conf_set_design("design/via_thickness", "%$mS", Diameter); }
if (Hole != 0) { pcb_custom_route_style.Hole = Hole; conf_set_design("design/via_drilling_hole", "%$mS", Hole); }
+ PCB->pen_attr = NULL;
}
else
pcb_use_route_style_idx(&PCB->RouteStyle, known);
}
-static int ActionSetSame(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SetSame(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
void *ptr1, *ptr2, *ptr3;
int type;
- LayerTypePtr layer = CURRENT;
+ pcb_layer_t *layer = CURRENT;
- type = SearchScreen(x, y, CLONE_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(x, y, CLONE_TYPES, &ptr1, &ptr2, &ptr3);
/* set layer current and size from line or arc */
switch (type) {
case PCB_TYPE_LINE:
- notify_crosshair_change(pcb_false);
- set_same_(((LineTypePtr) ptr2)->Thickness, 0, 0, ((LineTypePtr) ptr2)->Clearance / 2, NULL);
- layer = (LayerTypePtr) ptr1;
+ pcb_notify_crosshair_change(pcb_false);
+ set_same_(((pcb_line_t *) ptr2)->Thickness, 0, 0, ((pcb_line_t *) ptr2)->Clearance / 2, NULL);
+ layer = (pcb_layer_t *) ptr1;
if (conf_core.editor.mode != PCB_MODE_LINE)
- SetMode(PCB_MODE_LINE);
- notify_crosshair_change(pcb_true);
- hid_action("RouteStylesChanged");
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
+ pcb_notify_crosshair_change(pcb_true);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
break;
case PCB_TYPE_ARC:
- notify_crosshair_change(pcb_false);
- set_same_(((ArcTypePtr) ptr2)->Thickness, 0, 0, ((ArcTypePtr) ptr2)->Clearance / 2, NULL);
- layer = (LayerTypePtr) ptr1;
+ pcb_notify_crosshair_change(pcb_false);
+ set_same_(((pcb_arc_t *) ptr2)->Thickness, 0, 0, ((pcb_arc_t *) ptr2)->Clearance / 2, NULL);
+ layer = (pcb_layer_t *) ptr1;
if (conf_core.editor.mode != PCB_MODE_ARC)
- SetMode(PCB_MODE_ARC);
- notify_crosshair_change(pcb_true);
- hid_action("RouteStylesChanged");
+ pcb_crosshair_set_mode(PCB_MODE_ARC);
+ pcb_notify_crosshair_change(pcb_true);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
break;
case PCB_TYPE_POLYGON:
- layer = (LayerTypePtr) ptr1;
+ layer = (pcb_layer_t *) ptr1;
break;
case PCB_TYPE_VIA:
- notify_crosshair_change(pcb_false);
- set_same_(0, ((PinTypePtr) ptr2)->Thickness, ((PinTypePtr) ptr2)->DrillingHole, ((PinTypePtr) ptr2)->Clearance / 2, NULL);
+ pcb_notify_crosshair_change(pcb_false);
+ set_same_(0, ((pcb_pin_t *) ptr2)->Thickness, ((pcb_pin_t *) ptr2)->DrillingHole, ((pcb_pin_t *) ptr2)->Clearance / 2, NULL);
if (conf_core.editor.mode != PCB_MODE_VIA)
- SetMode(PCB_MODE_VIA);
- notify_crosshair_change(pcb_true);
- hid_action("RouteStylesChanged");
+ pcb_crosshair_set_mode(PCB_MODE_VIA);
+ pcb_notify_crosshair_change(pcb_true);
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
break;
default:
return 1;
}
if (layer != CURRENT) {
- ChangeGroupVisibility(GetLayerNumber(PCB->Data, layer), pcb_true, pcb_true);
- Redraw();
+ pcb_layervis_change_group_vis(pcb_layer_id(PCB->Data, layer), pcb_true, pcb_true);
+ pcb_redraw();
}
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char switchhid_syntax[] = "SwitchHID(lesstif|gtk|batch)";
+static const char pcb_acts_SwitchHID[] = "SwitchHID(lesstif|gtk|batch)";
-static const char switchhid_help[] = "Switch to another HID.";
+static const char pcb_acth_SwitchHID[] = "Switch to another HID.";
/* %start-doc actions SwitchHID
@@ -1190,19 +1219,19 @@ Switch to another HID.
%end-doc */
-static int ActionSwitchHID(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SwitchHID(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- HID *ng = hid_find_gui(argv[0]);
+ pcb_hid_t *ng = pcb_hid_find_gui(argv[0]);
int chg;
if (ng == NULL) {
- Message(PCB_MSG_DEFAULT, "No such HID.");
+ pcb_message(PCB_MSG_ERROR, "No such HID.");
return 1;
}
- next_gui = ng;
+ pcb_next_gui = ng;
chg = PCB->Changed;
- QuitApplication();
+ pcb_quit_app();
PCB->Changed = chg;
return 0;
@@ -1211,12 +1240,12 @@ static int ActionSwitchHID(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-/* This action is provided for CLI convience */
-static const char fullscreen_syntax[] = "FullScreen(on|off|toggle)\n";
+/* This action is provided for CLI convenience */
+static const char pcb_acts_FullScreen[] = "pcb_act_FullScreen(on|off|toggle)\n";
-static const char fullscreen_help[] = "Hide widgets to get edit area full screen";
+static const char pcb_acth_FullScreen[] = "Hide widgets to get edit area full screen";
-static int FullScreen(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_FullScreen(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *op = argv == NULL ? NULL : argv[0];
@@ -1231,43 +1260,92 @@ static int FullScreen(int argc, const char **argv, Coord x, Coord y)
return 0;
}
+static const char pcb_acts_PCBChanged[] = "PCBChanged([revert])";
+static const char pcb_acth_PCBChanged[] =
+ "Tells the GUI that the whole PCB has changed. The optional \"revert\""
+ "parameter can be used as a hint to the GUI that the same design is being"
+ "reloaded, and that it might keep some viewport settings";
+static int pcb_act_PCBChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ const char *rv = argv == NULL ? NULL : argv[0];
+ pcb_board_changed((rv != NULL) && (pcb_strcasecmp(rv, "revert") == 0));
+ return 0;
+}
+
+static const char pcb_acts_NetlistChanged[] = "NetlistChanged()";
+static const char pcb_acth_NetlistChanged[] = "Tells the GUI that the netlist has changed.";
+static int pcb_act_NetlistChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ pcb_netlist_changed(0);
+ return 0;
+}
-HID_Action gui_action_list[] = {
- {"Display", 0, ActionDisplay,
- display_help, display_syntax}
+static const char pcb_acts_RouteStylesChanged[] = "RouteStylesChanged()";
+static const char pcb_acth_RouteStylesChanged[] = "Tells the GUI that the routing styles have changed.";
+static int pcb_act_RouteStylesChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL);
+ return 0;
+}
+
+static const char pcb_acts_LibraryChanged[] = "LibraryChanged()";
+static const char pcb_acth_LibraryChanged[] = "Tells the GUI that the libraries have changed.";
+static int pcb_act_LibraryChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ pcb_event(PCB_EVENT_LIBRARY_CHANGED, NULL);
+ return 0;
+}
+
+
+pcb_hid_action_t gui_action_list[] = {
+ {"Display", 0, pcb_act_Display,
+ pcb_acth_Display, pcb_acts_Display}
+ ,
+ {"CycleDrag", 0, pcb_act_CycleDrag,
+ pcb_acth_CycleDrag, pcb_acts_CycleDrag}
+ ,
+ {"FullScreen", 0, pcb_act_FullScreen,
+ pcb_acth_FullScreen, pcb_acts_FullScreen}
+ ,
+ {"MarkCrosshair", 0, pcb_act_MarkCrosshair,
+ pcb_acth_MarkCrosshair, pcb_acts_MarkCrosshair}
+ ,
+ {"Message", 0, pcb_act_Message,
+ pcb_acth_Message, pcb_acts_Message}
,
- {"CycleDrag", 0, ActionCycleDrag,
- cycledrag_help, cycledrag_syntax}
+ {"Mode", 0, pcb_act_Mode,
+ pcb_acth_Mode, pcb_acts_Mode}
,
- {"FullScreen", 0, FullScreen, fullscreen_help, fullscreen_syntax}
+ {"ToggleHideName", 0, pcb_act_ToggleHideName,
+ pcb_acth_ToggleHideName, pcb_acts_ToggleHideName}
,
- {"MarkCrosshair", 0, ActionMarkCrosshair,
- markcrosshair_help, markcrosshair_syntax}
+ {"SetSame", N_("Select item to use attributes from"), pcb_act_SetSame,
+ pcb_acth_SetSame, pcb_acts_SetSame}
,
- {"Message", 0, ActionMessage,
- message_help, message_syntax}
+ {"RouteStyle", 0, pcb_act_RouteStyle,
+ pcb_acth_RouteStyle, pcb_acts_RouteStyle}
,
- {"Mode", 0, ActionMode,
- mode_help, mode_syntax}
+ {"CreateMenu", 0, pcb_act_CreateMenu,
+ pcb_acth_CreateMenu, pcb_acts_CreateMenu}
,
- {"ToggleHideName", 0, ActionToggleHideName,
- togglehidename_help, togglehidename_syntax}
+ {"RemoveMenu", 0, pcb_act_RemoveMenu,
+ pcb_acth_RemoveMenu, pcb_acts_RemoveMenu}
,
- {"SetSame", N_("Select item to use attributes from"), ActionSetSame,
- setsame_help, setsame_syntax}
+ {"SwitchHID", 0, pcb_act_SwitchHID,
+ pcb_acth_SwitchHID, pcb_acts_SwitchHID}
,
- {"RouteStyle", 0, ActionRouteStyle,
- routestyle_help, routestyle_syntax}
+ {"PCBChanged", 0, pcb_act_PCBChanged,
+ pcb_acth_PCBChanged, pcb_acts_PCBChanged}
,
- {"CreateMenu", 0, ActionCreateMenu,
- createmenu_help, createmenu_syntax}
+ {"NetlistChanged", 0, pcb_act_NetlistChanged,
+ pcb_acth_NetlistChanged, pcb_acts_NetlistChanged}
,
- {"RemoveMenu", 0, ActionRemoveMenu,
- removemenu_help, removemenu_syntax}
+ {"RouteStylesChanged", 0, pcb_act_RouteStylesChanged,
+ pcb_acth_RouteStylesChanged, pcb_acts_RouteStylesChanged}
,
- {"SwitchHID", 0, ActionSwitchHID,
- switchhid_help, switchhid_syntax}
+ {"LibraryChanged", 0, pcb_act_LibraryChanged,
+ pcb_acth_LibraryChanged, pcb_acts_LibraryChanged}
};
-REGISTER_ACTIONS(gui_action_list, NULL)
+PCB_REGISTER_ACTIONS(gui_action_list, NULL)
diff --git a/src/heap.c b/src/heap.c
index dc8537e..d35dfac 100644
--- a/src/heap.c
+++ b/src/heap.c
@@ -29,9 +29,9 @@
*/
-/* operations on heaps.
- */
+/* operations on heaps. */
+#include <stdlib.h>
#include <assert.h>
#include "config.h"
#include "heap.h"
@@ -47,10 +47,10 @@
* some local types
*/
struct heap_element {
- cost_t cost;
+ pcb_cost_t cost;
void *data;
};
-struct heap_struct {
+struct pcb_heap_s {
struct heap_element *element;
int size, max;
};
@@ -58,7 +58,7 @@ struct heap_struct {
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static cost_t MIN_COST = 0;
+static pcb_cost_t MIN_COST = 0;
/* ---------------------------------------------------------------------------
* functions.
@@ -66,7 +66,7 @@ static cost_t MIN_COST = 0;
/* helper functions for assertions */
#ifndef NDEBUG
#ifdef SLOW_ASSERTIONS
-static int __heap_is_good_slow(heap_t * heap)
+static int __heap_is_good_slow(pcb_heap_t * heap)
{
int i;
/* heap condition: key in each node should be smaller than in its children */
@@ -79,7 +79,7 @@ static int __heap_is_good_slow(heap_t * heap)
return 1;
}
#endif /* SLOW_ASSERTIONS */
-static int __heap_is_good(heap_t * heap)
+static int __heap_is_good(pcb_heap_t * heap)
{
return heap && (heap->max == 0 || heap->element) &&
(heap->max >= 0) && (heap->size >= 0) && (heap->max == 0 || heap->size < heap->max) &&
@@ -91,22 +91,22 @@ static int __heap_is_good(heap_t * heap)
#endif /* ! NDEBUG */
/* create an empty heap */
-heap_t *heap_create()
+pcb_heap_t *pcb_heap_create()
{
- heap_t *heap;
+ pcb_heap_t *heap;
/* initialize MIN_COST if necessary */
if (MIN_COST == 0)
MIN_COST = -1e23;
assert(MIN_COST < 0);
/* okay, create empty heap */
- heap = (heap_t *) calloc(1, sizeof(*heap));
+ heap = (pcb_heap_t *) calloc(1, sizeof(*heap));
assert(heap);
assert(__heap_is_good(heap));
return heap;
}
/* destroy a heap */
-void heap_destroy(heap_t ** heap)
+void pcb_heap_destroy(pcb_heap_t ** heap)
{
assert(heap && *heap);
assert(__heap_is_good(*heap));
@@ -117,7 +117,7 @@ void heap_destroy(heap_t ** heap)
}
/* free all elements in the heap */
-void heap_free(heap_t * heap, void (*freefunc) (void *))
+void pcb_heap_free(pcb_heap_t * heap, void (*freefunc) (void *))
{
assert(heap);
assert(__heap_is_good(heap));
@@ -128,7 +128,7 @@ void heap_free(heap_t * heap, void (*freefunc) (void *))
}
/* -- mutation -- */
-static void __upheap(heap_t * heap, int k)
+static void __upheap(pcb_heap_t * heap, int k)
{
struct heap_element v;
@@ -142,7 +142,7 @@ static void __upheap(heap_t * heap, int k)
heap->element[k] = v;
}
-void heap_insert(heap_t * heap, cost_t cost, void *data)
+void pcb_heap_insert(pcb_heap_t * heap, pcb_cost_t cost, void *data)
{
assert(heap && __heap_is_good(heap));
assert(cost >= MIN_COST);
@@ -167,7 +167,7 @@ void heap_insert(heap_t * heap, cost_t cost, void *data)
* k with the smaller of its two children as necessary and stopping when
* the node at k is smaller than both children or the bottom is reached.
*/
-static void __downheap(heap_t * heap, int k)
+static void __downheap(pcb_heap_t * heap, int k)
{
struct heap_element v;
@@ -187,7 +187,7 @@ static void __downheap(heap_t * heap, int k)
heap->element[k] = v;
}
-void *heap_remove_smallest(heap_t * heap)
+void *pcb_heap_remove_smallest(pcb_heap_t * heap)
{
struct heap_element v;
assert(heap && __heap_is_good(heap));
@@ -203,11 +203,11 @@ void *heap_remove_smallest(heap_t * heap)
return v.data;
}
-void *heap_replace(heap_t * heap, cost_t cost, void *data)
+void *pcb_heap_replace(pcb_heap_t * heap, pcb_cost_t cost, void *data)
{
assert(heap && __heap_is_good(heap));
- if (heap_is_empty(heap))
+ if (pcb_heap_is_empty(heap))
return data;
assert(heap->size > 0);
@@ -222,14 +222,14 @@ void *heap_replace(heap_t * heap, cost_t cost, void *data)
}
/* -- interrogation -- */
-int heap_is_empty(heap_t * heap)
+int pcb_heap_is_empty(pcb_heap_t * heap)
{
assert(__heap_is_good(heap));
return heap->size == 0;
}
/* -- size -- */
-int heap_size(heap_t * heap)
+int pcb_heap_size(pcb_heap_t * heap)
{
assert(__heap_is_good(heap));
return heap->size;
diff --git a/src/heap.h b/src/heap.h
index a959ded..c5c7784 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -34,29 +34,29 @@
#ifndef PCB_HEAP_H
#define PCB_HEAP_H
-#include "global.h"
+#include "config.h"
/* type of heap costs */
-typedef double cost_t;
+typedef double pcb_cost_t;
/* what a heap looks like */
-typedef struct heap_struct heap_t;
+typedef struct pcb_heap_s pcb_heap_t;
/* create an empty heap */
-heap_t *heap_create();
+pcb_heap_t *pcb_heap_create();
/* destroy a heap */
-void heap_destroy(heap_t ** heap);
+void pcb_heap_destroy(pcb_heap_t ** heap);
/* free all elements in a heap */
-void heap_free(heap_t * heap, void (*funcfree) (void *));
+void pcb_heap_free(pcb_heap_t * heap, void (*funcfree) (void *));
/* -- mutation -- */
-void heap_insert(heap_t * heap, cost_t cost, void *data);
-void *heap_remove_smallest(heap_t * heap);
+void pcb_heap_insert(pcb_heap_t * heap, pcb_cost_t cost, void *data);
+void *pcb_heap_remove_smallest(pcb_heap_t * heap);
/* replace the smallest item with a new item and return the smallest item.
* (if the new item is the smallest, than return it, instead.) */
-void *heap_replace(heap_t * heap, cost_t cost, void *data);
+void *pcb_heap_replace(pcb_heap_t * heap, pcb_cost_t cost, void *data);
/* -- interrogation -- */
-int heap_is_empty(heap_t * heap);
-int heap_size(heap_t * heap);
+int pcb_heap_is_empty(pcb_heap_t * heap);
+int pcb_heap_size(pcb_heap_t * heap);
#endif /* PCB_HEAP_H */
diff --git a/src/hid.h b/src/hid.h
index 55f3582..56fce89 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -5,10 +5,13 @@
#include "config.h"
#include "error.h"
+#include "drc.h"
#include "global_typedefs.h"
+#include "attrib.h"
+#include "layer.h"
-typedef struct HID_Attr_Val_s HID_Attr_Val;
-typedef struct HID_Attribute_s HID_Attribute;
+typedef struct pcb_hid_attr_val_s pcb_hid_attr_val_t;
+typedef struct pcb_hid_attribute_s pcb_hid_attribute_t;
/* Human Interface Device */
@@ -44,7 +47,7 @@ typedef enum {
Square_Cap, /* Square pins or pads. */
Round_Cap, /* Round pins or round-ended pads, thermals. */
Beveled_Cap /* Octagon pins or bevel-cornered pads. */
-} EndCapStyle;
+} pcb_cap_style_t;
/* The HID may need something more than an "int" for colors, timers,
etc. So it passes/returns one of these, which is castable to a
@@ -52,14 +55,14 @@ typedef enum {
typedef union {
long lval;
void *ptr;
-} hidval;
+} pcb_hidval_t;
/* This graphics context is an opaque pointer defined by the HID. GCs
are HID-specific; attempts to use one HID's GC for a different HID
will result in a fatal error. */
-typedef struct hid_gc_struct *hidGC;
+typedef struct hid_gc_s *pcb_hid_gc_t;
-#define HIDCONCAT(a,b) a##b
+#define PCB_HIDCONCAT(a,b) a##b
/* This is used to register the action callbacks (for menus and
whatnot). HID assumes the following actions are available for its
@@ -78,40 +81,24 @@ typedef struct {
/* Called when the action is triggered. If this function returns
non-zero, no further actions will be invoked for this key/mouse
event. */
- int (*trigger_cb) (int argc, const char **argv, Coord x, Coord y);
+ int (*trigger_cb) (int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
/* Short description that sometimes accompanies the name. */
const char *description;
/* Full allowed syntax; use \n to separate lines. */
const char *syntax;
-} HID_Action;
+} pcb_hid_action_t;
-extern void hid_register_action(const HID_Action *a, const char *cookie, int copy);
+extern void pcb_hid_register_action(const pcb_hid_action_t *a, const char *cookie, int copy);
-extern void hid_register_actions(const HID_Action *a, int, const char *cookie, int copy);
-#define REGISTER_ACTIONS(a, cookie) HIDCONCAT(void register_,a) ()\
-{ hid_register_actions(a, sizeof(a)/sizeof(a[0]), cookie, 0); }
+extern void pcb_hid_register_actions(const pcb_hid_action_t *a, int, const char *cookie, int copy);
+#define PCB_REGISTER_ACTIONS(a, cookie) PCB_HIDCONCAT(void register_,a) ()\
+{ pcb_hid_register_actions(a, sizeof(a)/sizeof(a[0]), cookie, 0); }
/* Note that PCB expects the gui to provide the following actions:
- PCBChanged();
- RouteStylesChanged()
- NetlistChanged() (but core should call "void NetlistChanged(int);" in netlist.c)
- LayersChanged()
LibraryChanged()
- Busy()
*/
-extern const char pcbchanged_help[];
-extern const char pcbchanged_syntax[];
-extern const char routestyleschanged_help[];
-extern const char routestyleschanged_syntax[];
-extern const char netlistchanged_help[];
-extern const char netlistchanged_syntax[];
-extern const char layerschanged_help[];
-extern const char layerschanged_syntax[];
-extern const char librarychanged_help[];
-extern const char librarychanged_syntax[];
-
/* File Watch flags */
/* Based upon those in dbus/dbus-connection.h */
typedef enum {
@@ -121,21 +108,21 @@ typedef enum {
/**< As in POLLOUT */
PCB_WATCH_ERROR = 1 << 2, /**< As in POLLERR */
PCB_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP */
-} PCBWatchFlags;
+} pcb_watch_flags_t;
/* DRC GUI Hooks */
typedef struct {
int log_drc_overview;
int log_drc_violations;
void (*reset_drc_dialog_message) (void);
- void (*append_drc_violation) (DrcViolationType * violation);
+ void (*append_drc_violation) (pcb_drc_violation_t * violation);
int (*throw_drc_dialog) (void);
-} HID_DRC_GUI;
+} pcb_hid_drc_gui_t;
-typedef struct hid_st HID;
+typedef struct hid_s pcb_hid_t;
/* This is the main HID structure. */
-struct hid_st {
+struct hid_s {
/* The size of this structure. We use this as a compatibility
check; a HID built with a different hid.h than we're expecting
should have a different size here. */
@@ -181,24 +168,29 @@ struct hid_st {
punches through everything. */
unsigned holes_after:1;
+ /* lesstif allows positive AND negative drawing in HID_MASK_CLEAR.
+ gtk only allows negative drawing.
+ using the mask is to get rat transparency */
+ unsigned can_mask_clear_rats:1;
+
/* Returns a set of resources describing options the export or print
HID supports. In GUI mode, the print/export dialogs use this to
set up the selectable options. In command line mode, these are
used to interpret command line options. If n_ret is non-NULL,
the number of attributes is stored there. */
- HID_Attribute *(*get_export_options) (int *n_ret_);
+ pcb_hid_attribute_t *(*get_export_options) (int *n_ret_);
/* Export (or print) the current PCB. The options given represent
the choices made from the options returned from
get_export_options. Call with options == NULL to start the
primary GUI (create a main window, print, export, etc) */
- void (*do_export) (HID_Attr_Val * options_);
+ void (*do_export) (pcb_hid_attr_val_t * options_);
/* uninit a GUI hid */
- void (*uninit) (HID *hid);
+ void (*uninit) (pcb_hid_t *hid);
/* uninit a GUI hid */
- void (*do_exit) (HID *hid);
+ void (*do_exit) (pcb_hid_t *hid);
/* Parse the command line. Call this early for whatever HID will be
the primary HID, as it will set all the registered attributes.
@@ -207,23 +199,21 @@ struct hid_st {
void (*parse_arguments) (int *argc_, char ***argv_);
/* This may be called to ask the GUI to force a redraw of a given area */
- void (*invalidate_lr) (int left_, int right_, int top_, int bottom_);
+ void (*invalidate_lr) (pcb_coord_t left_, pcb_coord_t right_, pcb_coord_t top_, pcb_coord_t bottom_);
void (*invalidate_all) (void);
void (*notify_crosshair_change) (pcb_bool changes_complete);
void (*notify_mark_change) (pcb_bool changes_complete);
- /* During redraw or print/export cycles, this is called once per
- layer (or layer group, for copper layers). If it returns false
- (zero), the HID does not want that layer, and none of the drawing
- functions should be called. If it returns pcb_true (nonzero), the
- items in that layer [group] should be drawn using the various
- drawing functions. In addition to the MAX_LAYERS copper layer
- groups, you may select layers indicated by the macros SL_*
- defined above, or any others with an index of -1. For copper
- layer groups, you may pass NULL for name to have a name fetched
- from the PCB struct. The EMPTY argument is a hint - if set, the
- layer is empty, if zero it may be non-empty. */
- int (*set_layer) (const char *name_, int group_, int _empty);
+ /* During redraw or print/export cycles, this is called once per layer group
+ (physical layer); layer is the first layer in the group.
+ TODO: The group may be -1 until the layer rewrite is finished.
+ If it returns false (zero), the HID does not want that layer, and none of
+ the drawing functions should be called. If it returns pcb_true (nonzero),
+ the items in that layer [group] should be drawn using the various drawing
+ functions. In addition to the copper layer groups, you may select virtual
+ layers. The is_empty argument is a hint - if set, the layer is empty, if
+ zero it may be non-empty. */
+ int (*set_layer_group)(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty);
/* Tell the GUI the layer last selected has been finished with */
void (*end_layer) (void);
@@ -234,8 +224,8 @@ struct hid_st {
(positive X) and 90 being "up" (positive Y). */
/* Make an empty graphics context. */
- hidGC (*make_gc) (void);
- void (*destroy_gc) (hidGC gc_);
+ pcb_hid_gc_t (*make_gc) (void);
+ void (*destroy_gc) (pcb_hid_gc_t gc_);
/* Special note about the "erase" color: To use this color, you must
use this function to tell the HID when you're using it. At the
@@ -262,33 +252,33 @@ struct hid_st {
use the "drill" color to draw holes. You may assume this is
cheap enough to call inside the redraw callback, but not cheap
enough to call for each item drawn. */
- void (*set_color) (hidGC gc_, const char *name_);
+ void (*set_color) (pcb_hid_gc_t gc_, const char *name_);
/* Set the line style. While calling this is cheap, calling it with
different values each time may be expensive, so grouping items by
line style is helpful. */
- void (*set_line_cap) (hidGC gc_, EndCapStyle style_);
- void (*set_line_width) (hidGC gc_, Coord width_);
- void (*set_draw_xor) (hidGC gc_, int xor_);
+ void (*set_line_cap) (pcb_hid_gc_t gc_, pcb_cap_style_t style_);
+ void (*set_line_width) (pcb_hid_gc_t gc_, pcb_coord_t width_);
+ void (*set_draw_xor) (pcb_hid_gc_t gc_, int xor_);
/* Blends 20% or so color with 80% background. Only used for
assembly drawings so far. */
- void (*set_draw_faded) (hidGC gc_, int faded_);
+ void (*set_draw_faded) (pcb_hid_gc_t gc_, int faded_);
/* The usual drawing functions. "draw" means to use segments of the
given width, whereas "fill" means to fill to a zero-width
outline. */
- void (*draw_line) (hidGC gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_);
- void (*draw_arc) (hidGC gc_, Coord cx_, Coord cy_, Coord xradius_, Coord yradius_, Angle start_angle_, Angle delta_angle_);
- void (*draw_rect) (hidGC gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_);
- void (*fill_circle) (hidGC gc_, Coord cx_, Coord cy_, Coord radius_);
- void (*fill_polygon) (hidGC gc_, int n_coords_, Coord * x_, Coord * y_);
- void (*fill_pcb_polygon) (hidGC gc_, PolygonType * poly, const BoxType * clip_box);
- void (*thindraw_pcb_polygon) (hidGC gc_, PolygonType * poly, const BoxType * clip_box);
- void (*fill_pcb_pad) (hidGC gc_, PadType * pad, pcb_bool clip, pcb_bool mask);
- void (*thindraw_pcb_pad) (hidGC gc_, PadType * pad, pcb_bool clip, pcb_bool mask);
- void (*fill_pcb_pv) (hidGC fg_gc, hidGC bg_gc, PinType * pv, pcb_bool drawHole, pcb_bool mask);
- void (*thindraw_pcb_pv) (hidGC fg_gc, hidGC bg_gc, PinType * pv, pcb_bool drawHole, pcb_bool mask);
- void (*fill_rect) (hidGC gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_);
+ void (*draw_line) (pcb_hid_gc_t gc_, pcb_coord_t x1_, pcb_coord_t y1_, pcb_coord_t x2_, pcb_coord_t y2_);
+ void (*draw_arc) (pcb_hid_gc_t gc_, pcb_coord_t cx_, pcb_coord_t cy_, pcb_coord_t xradius_, pcb_coord_t yradius_, pcb_angle_t start_angle_, pcb_angle_t delta_angle_);
+ void (*draw_rect) (pcb_hid_gc_t gc_, pcb_coord_t x1_, pcb_coord_t y1_, pcb_coord_t x2_, pcb_coord_t y2_);
+ void (*fill_circle) (pcb_hid_gc_t gc_, pcb_coord_t cx_, pcb_coord_t cy_, pcb_coord_t radius_);
+ void (*fill_polygon) (pcb_hid_gc_t gc_, int n_coords_, pcb_coord_t * x_, pcb_coord_t * y_);
+ void (*fill_pcb_polygon) (pcb_hid_gc_t gc_, pcb_polygon_t * poly, const pcb_box_t * clip_box);
+ void (*thindraw_pcb_polygon) (pcb_hid_gc_t gc_, pcb_polygon_t * poly, const pcb_box_t * clip_box);
+ void (*fill_pcb_pad) (pcb_hid_gc_t gc_, pcb_pad_t * pad, pcb_bool clip, pcb_bool mask);
+ void (*thindraw_pcb_pad) (pcb_hid_gc_t gc_, pcb_pad_t * pad, pcb_bool clip, pcb_bool mask);
+ void (*fill_pcb_pv) (pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask);
+ void (*thindraw_pcb_pv) (pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask);
+ void (*fill_rect) (pcb_hid_gc_t gc_, pcb_coord_t x1_, pcb_coord_t y1_, pcb_coord_t x2_, pcb_coord_t y2_);
/* This is for the printer. If you call this for the GUI, xval and
@@ -308,7 +298,7 @@ struct hid_st {
int (*shift_is_pressed) (void);
int (*control_is_pressed) (void);
int (*mod1_is_pressed) (void);
- void (*get_coords) (const char *msg_, Coord * x_, Coord * y_);
+ void (*get_coords) (const char *msg_, pcb_coord_t * x_, pcb_coord_t * y_);
/* Sets the crosshair, which may differ from the pointer depending
on grid and pad snap. Note that the HID is responsible for
@@ -328,24 +318,24 @@ struct hid_st {
timer during the callback for the first. user_data can be
anything, it's just passed to func. Times are not guaranteed to
be accurate. */
- hidval(*add_timer) (void (*func) (hidval user_data_), unsigned long milliseconds_, hidval user_data_);
+ pcb_hidval_t(*add_timer) (void (*func) (pcb_hidval_t user_data_), unsigned long milliseconds_, pcb_hidval_t user_data_);
/* Use this to stop a timer that hasn't triggered yet. */
- void (*stop_timer) (hidval timer_);
+ void (*stop_timer) (pcb_hidval_t timer_);
/* Causes func to be called when some condition occurs on the file
descriptor passed. Conditions include data for reading, writing,
hangup, and errors. user_data can be anything, it's just passed
to func. */
- hidval(*watch_file) (int fd_, unsigned int condition_,
- void (*func_) (hidval watch_, int fd_, unsigned int condition_, hidval user_data_),
- hidval user_data);
+ pcb_hidval_t(*watch_file) (int fd_, unsigned int condition_,
+ void (*func_) (pcb_hidval_t watch_, int fd_, unsigned int condition_, pcb_hidval_t user_data_),
+ pcb_hidval_t user_data);
/* Use this to stop a file watch. */
- void (*unwatch_file) (hidval watch_);
+ void (*unwatch_file) (pcb_hidval_t watch_);
/* Causes func to be called in the mainloop prior to blocking */
- hidval(*add_block_hook) (void (*func_) (hidval data_), hidval data_);
+ pcb_hidval_t(*add_block_hook) (void (*func_) (pcb_hidval_t data_), pcb_hidval_t data_);
/* Use this to stop a mainloop block hook. */
- void (*stop_block_hook) (hidval block_hook_);
+ void (*stop_block_hook) (pcb_hidval_t block_hook_);
/* Various dialogs */
@@ -424,8 +414,8 @@ struct hid_st {
may use it for a tooltip or text in a dialog box, or a help
string.
*/
- int (*attribute_dialog) (HID_Attribute * attrs_,
- int n_attrs_, HID_Attr_Val * results_, const char *title_, const char *descr_);
+ int (*attribute_dialog) (pcb_hid_attribute_t * attrs_,
+ int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, const char *descr_);
/* This causes a second window to display, which only shows the
selected item. The expose callback is called twice; once to size
@@ -442,9 +432,9 @@ struct hid_st {
Returns nonzero if the user wishes to cancel the operation. */
int (*progress) (int so_far_, int total_, const char *message_);
- HID_DRC_GUI *drc_gui;
+ pcb_hid_drc_gui_t *drc_gui;
- void (*edit_attributes) (const char *owner, AttributeListType * attrlist_);
+ void (*edit_attributes) (const char *owner, pcb_attribute_list_t * attrlist_);
/* Debug drawing support. These APIs must be implemented (non NULL),
* but they do not have to be functional. request_debug_draw can
@@ -460,7 +450,7 @@ struct hid_st {
* gui-> for making drawing calls. If the return value is NULL, then
* permission has been denied, and the drawing must not continue.
*/
- HID *(*request_debug_draw) (void);
+ pcb_hid_t *(*request_debug_draw) (void);
/* Flush pending drawing to the screen
*
@@ -510,6 +500,9 @@ struct hid_st {
int (*usage)(const char *subtopic);
+ /* Optional: change cursor to indicate if an object is grabbed (or not) */
+ void (*point_cursor)(pcb_bool grabbed);
+
/*** PROPEDIT (optional) ****/
/* Optional: start a propedit session: a series of propedit calls will follow
Return 0 on success; non-zero aborts the session.
@@ -548,31 +541,31 @@ struct hid_st {
Do *not* assume that the hid that is passed is the GUI hid. This
callback is also used for printing and exporting. */
-struct BoxType;
-void hid_expose_callback(HID * hid_, struct BoxType *region_, void *item_);
+struct pcb_box_t;
+void pcb_hid_expose_callback(pcb_hid_t * hid_, pcb_box_t *region_, void *item_);
/* This is initially set to a "no-gui" gui, and later reset by
main. hid_expose_callback also temporarily set it for drawing. */
-extern HID *gui;
+extern pcb_hid_t *pcb_gui;
/* When not NULL, auto-start the next gui after the current one quits */
-extern HID *next_gui;
+extern pcb_hid_t *pcb_next_gui;
/* This is either NULL or points to the current HID that is being called to
do the exporting. The gui HIDs set and unset this var.*/
-extern HID *exporter;
+extern pcb_hid_t *pcb_exporter;
-/* This is either NULL or points to the current HID_Action that is being
+/* This is either NULL or points to the current pcb_hid_action_t that is being
called. The action launcher sets and unsets this variable. */
-extern const HID_Action *current_action;
+extern const pcb_hid_action_t *pcb_current_action;
/* The GUI may set this to be approximately the PCB size of a pixel,
to allow for near-misses in selection and changes in drawing items
smaller than a screen pixel. */
-extern int pixel_slop;
+extern int pcb_pixel_slop;
/* Init and uninit the whole action framework */
-void hid_actions_init(void);
-void hid_actions_uninit(void);
+void pcb_hid_actions_init(void);
+void pcb_hid_actions_uninit(void);
#endif
diff --git a/src/hid_actions.c b/src/hid_actions.c
index 58687be..dd257fc 100644
--- a/src/hid_actions.c
+++ b/src/hid_actions.c
@@ -1,9 +1,6 @@
#include "config.h"
#include "conf_core.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <ctype.h>
#include <genht/hash.h>
@@ -13,25 +10,10 @@
#include "event.h"
#include "hid_actions.h"
#include "compat_misc.h"
-
-/* do not throw "unknown action" warning for these: they are known
- actions, the GUI HID may register them, but nothing bad happens if
- they are not registered or not handled by the GUI. */
-static const char *action_no_warn[] = {
- "LayersChanged", "PointCursor", "LibraryChanged", "RouteStylesChanged",
- NULL
-};
-static int action_legal_unknown(const char *name)
-{
- const char **s;
- for(s = action_no_warn; *s != NULL; s++)
- if (strcmp(*s, name) == 0)
- return 1;
- return 0;
-}
+#include "compat_nls.h"
static htsp_t *all_actions = NULL;
-const HID_Action *current_action = NULL;
+const pcb_hid_action_t *pcb_current_action = NULL;
static const char *check_action_name(const char *s)
{
@@ -43,10 +25,10 @@ static const char *check_action_name(const char *s)
typedef struct {
const char *cookie;
- const HID_Action *action;
+ const pcb_hid_action_t *action;
} hid_cookie_action_t;
-void hid_register_actions(const HID_Action * a, int n, const char *cookie, int copy)
+void pcb_hid_register_actions(const pcb_hid_action_t * a, int n, const char *cookie, int copy)
{
int i;
hid_cookie_action_t *ca;
@@ -56,11 +38,11 @@ void hid_register_actions(const HID_Action * a, int n, const char *cookie, int c
for (i = 0; i < n; i++) {
if (check_action_name(a[i].name)) {
- Message(PCB_MSG_DEFAULT, _("ERROR! Invalid action name, " "action \"%s\" not registered.\n"), a[i].name);
+ pcb_message(PCB_MSG_ERROR, _("ERROR! Invalid action name, " "action \"%s\" not registered.\n"), a[i].name);
continue;
}
if (htsp_get(all_actions, a[i].name) != NULL) {
- Message(PCB_MSG_DEFAULT, _("ERROR! Invalid action name, " "action \"%s\" is already registered.\n"), a[i].name);
+ pcb_message(PCB_MSG_ERROR, _("ERROR! Invalid action name, " "action \"%s\" is already registered.\n"), a[i].name);
continue;
}
ca = malloc(sizeof(hid_cookie_action_t));
@@ -70,12 +52,12 @@ void hid_register_actions(const HID_Action * a, int n, const char *cookie, int c
}
}
-void hid_register_action(const HID_Action * a, const char *cookie, int copy)
+void pcb_hid_register_action(const pcb_hid_action_t * a, const char *cookie, int copy)
{
- hid_register_actions(a, 1, cookie, copy);
+ pcb_hid_register_actions(a, 1, cookie, copy);
}
-void hid_remove_actions(const HID_Action * a, int n)
+void pcb_hid_remove_actions(const pcb_hid_action_t * a, int n)
{
int i;
@@ -90,7 +72,7 @@ void hid_remove_actions(const HID_Action * a, int n)
}
}
-void hid_remove_actions_by_cookie(const char *cookie)
+void pcb_hid_remove_actions_by_cookie(const char *cookie)
{
htsp_entry_t *e;
@@ -108,7 +90,7 @@ void hid_remove_actions_by_cookie(const char *cookie)
}
}
-void hid_remove_action(const HID_Action * a)
+void pcb_hid_remove_action(const pcb_hid_action_t * a)
{
htsp_entry_t *e;
@@ -122,7 +104,7 @@ void hid_remove_action(const HID_Action * a)
}
}
-const HID_Action *hid_find_action(const char *name)
+const pcb_hid_action_t *pcb_hid_find_action(const char *name)
{
hid_cookie_action_t *ca;
@@ -134,12 +116,11 @@ const HID_Action *hid_find_action(const char *name)
if (ca)
return ca->action;
- if (!action_legal_unknown(name))
- Message(PCB_MSG_DEFAULT, "unknown action `%s'\n", name);
+ pcb_message(PCB_MSG_ERROR, "unknown action `%s'\n", name);
return 0;
}
-void print_actions()
+void pcb_print_actions()
{
htsp_entry_t *e;
@@ -183,7 +164,7 @@ static void dump_string(char prefix, const char *str)
putchar('\n');
}
-void dump_actions(void)
+void pcb_dump_actions(void)
{
htsp_entry_t *e;
@@ -202,12 +183,12 @@ void dump_actions(void)
}
}
-int hid_action(const char *name)
+int pcb_hid_action(const char *name)
{
- return hid_actionv(name, 0, 0);
+ return pcb_hid_actionv(name, 0, 0);
}
-int hid_actionl(const char *name, ...)
+int pcb_hid_actionl(const char *name, ...)
{
const char *argv[20];
int argc = 0;
@@ -218,17 +199,17 @@ int hid_actionl(const char *name, ...)
while ((arg = va_arg(ap, char *)) != 0)
argv[argc++] = arg;
va_end(ap);
- return hid_actionv(name, argc, argv);
+ return pcb_hid_actionv(name, argc, argv);
}
-int hid_actionv_(const HID_Action *a, int argc, const char **argv)
+int pcb_hid_actionv_(const pcb_hid_action_t *a, int argc, const char **argv)
{
- Coord x = 0, y = 0;
+ pcb_coord_t x = 0, y = 0;
int i, ret;
- const HID_Action *old_action;
+ const pcb_hid_action_t *old_action;
if (a->need_coord_msg)
- gui->get_coords(_(a->need_coord_msg), &x, &y);
+ pcb_gui->get_coords(_(a->need_coord_msg), &x, &y);
if (conf_core.rc.verbose) {
printf("Action: \033[34m%s(", a->name);
@@ -237,33 +218,31 @@ int hid_actionv_(const HID_Action *a, int argc, const char **argv)
printf(")\033[0m\n");
}
- old_action = current_action;
- current_action = a;
- ret = current_action->trigger_cb(argc, argv, x, y);
- current_action = old_action;
+ old_action = pcb_current_action;
+ pcb_current_action = a;
+ ret = pcb_current_action->trigger_cb(argc, argv, x, y);
+ pcb_current_action = old_action;
return ret;
}
-int hid_actionv(const char *name, int argc, const char **argv)
+int pcb_hid_actionv(const char *name, int argc, const char **argv)
{
- const HID_Action *a;
+ const pcb_hid_action_t *a;
if (!name)
return 1;
- a = hid_find_action(name);
+ a = pcb_hid_find_action(name);
if (!a) {
int i;
- if (action_legal_unknown(name))
- return 1;
- Message(PCB_MSG_DEFAULT, "no action %s(", name);
+ pcb_message(PCB_MSG_ERROR, "no action %s(", name);
for (i = 0; i < argc; i++)
- Message(PCB_MSG_DEFAULT, "%s%s", i ? ", " : "", argv[i]);
- Message(PCB_MSG_DEFAULT, ")\n");
+ pcb_message(PCB_MSG_ERROR, "%s%s", i ? ", " : "", argv[i]);
+ pcb_message(PCB_MSG_ERROR, ")\n");
return 1;
}
- return hid_actionv_(a, argc, argv);
+ return pcb_hid_actionv_(a, argc, argv);
}
static int hid_parse_actionstring(const char *rstr, char require_parens)
@@ -314,7 +293,7 @@ another:
* with no parameters or event.
*/
if (!*sp) {
- retcode = hid_actionv(aname, 0, 0);
+ retcode = pcb_hid_actionv(aname, 0, 0);
goto cleanup;
}
@@ -324,8 +303,8 @@ another:
sp++;
}
else if (require_parens) {
- Message(PCB_MSG_DEFAULT, _("Syntax error: %s\n"), rstr);
- Message(PCB_MSG_DEFAULT, _(" expected: Action(arg1, arg2)"));
+ pcb_message(PCB_MSG_ERROR, _("Syntax error: %s\n"), rstr);
+ pcb_message(PCB_MSG_ERROR, _(" expected: Action(arg1, arg2)"));
retcode = 1;
goto cleanup;
}
@@ -337,7 +316,7 @@ another:
* ","
*/
if (!maybe_empty && ((parens && *sp == ')') || (!parens && !*sp))) {
- retcode = hid_actionv(aname, num, list);
+ retcode = pcb_hid_actionv(aname, num, list);
if (retcode)
goto cleanup;
@@ -413,23 +392,23 @@ cleanup:
return retcode;
}
-int hid_parse_command(const char *str_)
+int pcb_hid_parse_command(const char *str_)
{
- event(EVENT_CLI_ENTER, "s", str_);
- return hid_parse_actionstring(str_, FALSE);
+ pcb_event(PCB_EVENT_CLI_ENTER, "s", str_);
+ return hid_parse_actionstring(str_, pcb_false);
}
-int hid_parse_actions(const char *str_)
+int pcb_hid_parse_actions(const char *str_)
{
- return hid_parse_actionstring(str_, TRUE);
+ return hid_parse_actionstring(str_, pcb_true);
}
-void hid_actions_init(void)
+void pcb_hid_actions_init(void)
{
}
-void hid_actions_uninit(void)
+void pcb_hid_actions_uninit(void)
{
htsp_entry_t *e;
@@ -465,37 +444,6 @@ these directly.
%end-doc */
-
-static const char pcbchanged_syntax[] = "PCBChanged([revert])";
-static const char pcbchanged_help[] =
- "Tells the GUI that the whole PCB has changed. The optional \"revert\""
- "parameter can be used as a hint to the GUI that the same design is being"
- "reloaded, and that it might keep some viewport settings";
-
-/* %start-doc actions PCBChanged
-
- at hidaction
-
-%end-doc */
-
-static const char routestyleschanged_syntax[] = "RouteStylesChanged()";
-static const char routestyleschanged_help[] = "Tells the GUI that the routing styles have changed.";
-
-/* %start-doc actions RouteStylesChanged
-
- at hidaction
-
-%end-doc */
-
-static const char netlistchanged_syntax[] = "NetlistChanged()";
-static const char netlistchanged_help[] = "Tells the GUI that the netlist has changed.";
-
-/* %start-doc actions NetlistChanged
-
- at hidaction
-
-%end-doc */
-
static const char layerschanged_syntax[] = "LayersChanged()";
static const char layerschanged_help[] = "Tells the GUI that the layers have changed.";
@@ -507,11 +455,3 @@ This includes layer names, colors, stacking order, visibility, etc.
%end-doc */
-static const char librarychanged_syntax[] = "LibraryChanged()";
-static const char librarychanged_help[] = "Tells the GUI that the libraries have changed.";
-
-/* %start-doc actions LibraryChanged
-
- at hidaction
-
-%end-doc */
diff --git a/src/hid_actions.h b/src/hid_actions.h
index 8038211..33f2517 100644
--- a/src/hid_actions.h
+++ b/src/hid_actions.h
@@ -1,35 +1,37 @@
#ifndef PCB_HID_ACTIONS_H
#define PCB_HID_ACTIONS_H
+#include "hid.h"
+
/* These are called from main_act.c */
-void print_actions(void);
-void dump_actions(void);
+void pcb_print_actions(void);
+void pcb_dump_actions(void);
/* HID internal interfaces. These may ONLY be called from the HID
modules, not from the common PCB code. */
-const HID_Action *hid_find_action(const char *name);
+const pcb_hid_action_t *pcb_hid_find_action(const char *name);
-extern void hid_remove_actions(const HID_Action * a, int n);
-extern void hid_remove_action(const HID_Action * a);
-extern void hid_remove_actions_by_cookie(const char *cookie);
+extern void pcb_hid_remove_actions(const pcb_hid_action_t * a, int n);
+extern void pcb_hid_remove_action(const pcb_hid_action_t * a);
+extern void pcb_hid_remove_actions_by_cookie(const char *cookie);
-int hid_action(const char *action_);
-int hid_actionl(const char *action_, ...); /* NULL terminated */
-int hid_actionv(const char *action_, int argc_, const char **argv_);
-int hid_actionv_(const HID_Action *a, int argc, const char **argv);
+int pcb_hid_action(const char *action_);
+int pcb_hid_actionl(const char *action_, ...); /* NULL terminated */
+int pcb_hid_actionv(const char *action_, int argc_, const char **argv_);
+int pcb_hid_actionv_(const pcb_hid_action_t *a, int argc, const char **argv);
/* Parse the given command string into action calls, and call
hid_actionv for each action found. Accepts both "action(arg1,
arg2)" and command-style "action arg1 arg2", allowing only one
action in the later case. Returns nonzero if the action handler(s)
return nonzero. */
-int hid_parse_command(const char *str_);
+int pcb_hid_parse_command(const char *str_);
/* Parse the given string into action calls, and call
hid_actionv for each action found. Accepts only
"action(arg1, arg2)" */
-int hid_parse_actions(const char *str_);
+int pcb_hid_parse_actions(const char *str_);
#endif
diff --git a/src/hid_attrib.c b/src/hid_attrib.c
index df0c58e..033c229 100644
--- a/src/hid_attrib.c
+++ b/src/hid_attrib.c
@@ -1,20 +1,16 @@
#include "config.h"
-#include "global.h"
#include "hid_attrib.h"
-#include "misc.h"
#include "misc_util.h"
#include "pcb-printf.h"
-#include "compat_fs.h"
-#include "error.h"
-HID_AttrNode *hid_attr_nodes = 0;
+pcb_hid_attr_node_t *hid_attr_nodes = 0;
-void hid_register_attributes(HID_Attribute * a, int n, const char *cookie, int copy)
+void pcb_hid_register_attributes(pcb_hid_attribute_t * a, int n, const char *cookie, int copy)
{
- HID_AttrNode *ha;
+ pcb_hid_attr_node_t *ha;
/* printf("%d attributes registered\n", n); */
- ha = (HID_AttrNode *) malloc(sizeof(HID_AttrNode));
+ ha = malloc(sizeof(pcb_hid_attr_node_t));
ha->next = hid_attr_nodes;
hid_attr_nodes = ha;
ha->attributes = a;
@@ -22,9 +18,9 @@ void hid_register_attributes(HID_Attribute * a, int n, const char *cookie, int c
ha->cookie = cookie;
}
-void hid_attributes_uninit(void)
+void pcb_hid_attributes_uninit(void)
{
- HID_AttrNode *ha, *next;
+ pcb_hid_attr_node_t *ha, *next;
for (ha = hid_attr_nodes; ha; ha = next) {
next = ha->next;
if (ha->cookie != NULL)
@@ -34,9 +30,9 @@ void hid_attributes_uninit(void)
hid_attr_nodes = NULL;
}
-void hid_remove_attributes_by_cookie(const char *cookie)
+void pcb_hid_remove_attributes_by_cookie(const char *cookie)
{
- HID_AttrNode *ha, *next, *prev = NULL;
+ pcb_hid_attr_node_t *ha, *next, *prev = NULL;
for (ha = hid_attr_nodes; ha; ha = next) {
next = ha->next;
if (ha->cookie == cookie) {
@@ -51,14 +47,14 @@ void hid_remove_attributes_by_cookie(const char *cookie)
}
}
-void hid_parse_command_line(int *argc, char ***argv)
+void pcb_hid_parse_command_line(int *argc, char ***argv)
{
- HID_AttrNode *ha;
+ pcb_hid_attr_node_t *ha;
int i, e, ok;
for (ha = hid_attr_nodes; ha; ha = ha->next)
for (i = 0; i < ha->n; i++) {
- HID_Attribute *a = ha->attributes + i;
+ pcb_hid_attribute_t *a = ha->attributes + i;
switch (a->type) {
case HID_Label:
break;
@@ -68,7 +64,7 @@ void hid_parse_command_line(int *argc, char ***argv)
break;
case HID_Coord:
if (a->value)
- *(Coord *) a->value = a->default_val.coord_value;
+ *(pcb_coord_t *) a->value = a->default_val.coord_value;
break;
case HID_Boolean:
if (a->value)
@@ -88,7 +84,7 @@ void hid_parse_command_line(int *argc, char ***argv)
break;
case HID_Mixed:
if (a->value) {
- *(HID_Attr_Val *) a->value = a->default_val;
+ *(pcb_hid_attr_val_t *) a->value = a->default_val;
case HID_Unit:
if (a->value)
*(int *) a->value = a->default_val.int_value;
@@ -110,9 +106,9 @@ void hid_parse_command_line(int *argc, char ***argv)
for (ha = hid_attr_nodes; ha; ha = ha->next)
for (i = 0; i < ha->n; i++)
if (strcmp((*argv)[0] + arg_ofs, ha->attributes[i].name) == 0) {
- HID_Attribute *a = ha->attributes + i;
+ pcb_hid_attribute_t *a = ha->attributes + i;
char *ep;
- const Unit *unit;
+ const pcb_unit_t *unit;
switch (ha->attributes[i].type) {
case HID_Label:
break;
@@ -126,9 +122,9 @@ void hid_parse_command_line(int *argc, char ***argv)
break;
case HID_Coord:
if (a->value)
- *(Coord *) a->value = GetValue((*argv)[1], NULL, NULL, NULL);
+ *(pcb_coord_t *) a->value = pcb_get_value((*argv)[1], NULL, NULL, NULL);
else
- a->default_val.coord_value = GetValue((*argv)[1], NULL, NULL, NULL);
+ a->default_val.coord_value = pcb_get_value((*argv)[1], NULL, NULL, NULL);
(*argc)--;
(*argv)++;
break;
@@ -209,18 +205,18 @@ void hid_parse_command_line(int *argc, char ***argv)
}
}
-void hid_usage_option(const char *name, const char *help)
+void pcb_hid_usage_option(const char *name, const char *help)
{
fprintf(stderr, "%-20s %s\n", name, help);
}
-void hid_usage(HID_Attribute * a, int numa)
+void pcb_hid_usage(pcb_hid_attribute_t * a, int numa)
{
for (; numa > 0; numa--,a++) {
const char *help;
if (a->help_text == NULL) help = "";
else if (a->help_text == ATTR_UNDOCUMENTED) help = "<undocumented>";
else help = a->help_text;
- hid_usage_option(a->name, help);
+ pcb_hid_usage_option(a->name, help);
}
}
diff --git a/src/hid_attrib.h b/src/hid_attrib.h
index eefc62c..ae4cb72 100644
--- a/src/hid_attrib.h
+++ b/src/hid_attrib.h
@@ -8,56 +8,56 @@
str_value to the enumeration string. HID_Label just shows the
default str_value. HID_Mixed is a real_value followed by an enum,
like 0.5in or 100mm. */
-struct HID_Attr_Val_s {
+struct pcb_hid_attr_val_s {
int int_value;
const char *str_value;
double real_value;
- Coord coord_value;
+ pcb_coord_t coord_value;
};
-enum hids { HID_Label, HID_Integer, HID_Real, HID_String,
+enum pcb_hids_t { HID_Label, HID_Integer, HID_Real, HID_String,
HID_Boolean, HID_Enum, HID_Mixed, HID_Path,
HID_Unit, HID_Coord
};
-struct HID_Attribute_s {
+struct pcb_hid_attribute_s {
const char *name;
/* If the help_text is this, usage() won't show this option */
#define ATTR_UNDOCUMENTED ((char *)(1))
const char *help_text;
- enum hids type;
+ enum pcb_hids_t type;
int min_val, max_val; /* for integer and real */
- HID_Attr_Val default_val; /* Also actual value for global attributes. */
+ pcb_hid_attr_val_t default_val; /* Also actual value for global attributes. */
const char **enumerations;
/* If set, this is used for global attributes (i.e. those set
statically with REGISTER_ATTRIBUTES below) instead of changing
the default_val. Note that a HID_Mixed attribute must specify a
- pointer to HID_Attr_Val here, and HID_Boolean assumes this is
+ pointer to pcb_hid_attr_val_t here, and HID_Boolean assumes this is
"char *" so the value should be initialized to zero, and may be
set to non-zero (not always one). */
void *value;
int hash; /* for detecting changes. */
};
-extern void hid_register_attributes(HID_Attribute *, int, const char *cookie, int copy);
-#define REGISTER_ATTRIBUTES(a, cookie) HIDCONCAT(void register_,a) ()\
-{ hid_register_attributes(a, sizeof(a)/sizeof(a[0]), cookie, 0); }
+extern void pcb_hid_register_attributes(pcb_hid_attribute_t *, int, const char *cookie, int copy);
+#define PCB_REGISTER_ATTRIBUTES(a, cookie) PCB_HIDCONCAT(void register_,a) ()\
+{ pcb_hid_register_attributes(a, sizeof(a)/sizeof(a[0]), cookie, 0); }
/* Remove all attributes registered with the given cookie */
-void hid_remove_attributes_by_cookie(const char *cookie);
+void pcb_hid_remove_attributes_by_cookie(const char *cookie);
/* remove all attributes and free the list */
-void hid_attributes_uninit(void);
+void pcb_hid_attributes_uninit(void);
-typedef struct HID_AttrNode {
- struct HID_AttrNode *next;
- HID_Attribute *attributes;
+typedef struct pcb_hid_attr_node_s {
+ struct pcb_hid_attr_node_s *next;
+ pcb_hid_attribute_t *attributes;
int n;
const char *cookie;
-} HID_AttrNode;
+} pcb_hid_attr_node_t;
-extern HID_AttrNode *hid_attr_nodes;
+extern pcb_hid_attr_node_t *hid_attr_nodes;
-void hid_usage(HID_Attribute * a, int numa);
-void hid_usage_option(const char *name, const char *help);
+void pcb_hid_usage(pcb_hid_attribute_t * a, int numa);
+void pcb_hid_usage_option(const char *name, const char *help);
#endif
diff --git a/src/hid_cfg.c b/src/hid_cfg.c
index fb3c603..e578a77 100644
--- a/src/hid_cfg.c
+++ b/src/hid_cfg.c
@@ -23,10 +23,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <assert.h>
#include <liblihata/lihata.h>
#include <liblihata/tree.h>
-#include "global.h"
+#include "config.h"
#include "hid_cfg.h"
#include "error.h"
#include "paths.h"
@@ -35,8 +36,8 @@
char hid_cfg_error_shared[1024];
typedef struct {
- hid_cfg_t *hr;
- create_menu_widget_t cb;
+ pcb_hid_cfg_t *hr;
+ pcb_create_menu_widget_t cb;
void *cb_ctx;
lht_node_t *parent;
const char *action;
@@ -68,19 +69,19 @@ static lht_node_t *create_menu_cb(void *ctx, lht_node_t *node, const char *path,
for(end = name; *end == '/'; end++) ;
end = strchr(end, '/');
*end = '\0';
- psub = cmc->parent = hid_cfg_get_menu(cmc->hr, name);
+ psub = cmc->parent = pcb_hid_cfg_get_menu(cmc->hr, name);
free(name);
}
else
- psub = hid_cfg_menu_field(cmc->parent, MF_SUBMENU, NULL);
+ psub = pcb_hid_cfg_menu_field(cmc->parent, PCB_MF_SUBMENU, NULL);
if (rel_level == cmc->target_level) {
- node = hid_cfg_create_hash_node(psub, name, "dyn", "1", "m", "cookie", cmc->cookie, cmc->mnemonic, "a", cmc->accel, "tip", cmc->tip, ((cmc->action != NULL) ? "action": NULL), cmc->action, NULL);
+ node = pcb_hid_cfg_create_hash_node(psub, name, "dyn", "1", "m", "cookie", cmc->cookie, cmc->mnemonic, "a", cmc->accel, "tip", cmc->tip, ((cmc->action != NULL) ? "action": NULL), cmc->action, NULL);
if (node != NULL)
cmc->err = 0;
}
else
- node = hid_cfg_create_hash_node(psub, name, "dyn", "1", "cookie", cmc->cookie, NULL);
+ node = pcb_hid_cfg_create_hash_node(psub, name, "dyn", "1", "cookie", cmc->cookie, NULL);
if (node == NULL)
return NULL;
@@ -102,7 +103,7 @@ static lht_node_t *create_menu_cb(void *ctx, lht_node_t *node, const char *path,
return node;
}
-int hid_cfg_create_menu(hid_cfg_t *hr, const char *path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie, create_menu_widget_t cb, void *cb_ctx)
+int pcb_hid_cfg_create_menu(pcb_hid_cfg_t *hr, const char *path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie, pcb_create_menu_widget_t cb, void *cb_ctx)
{
const char *name;
create_menu_ctx_t cmc;
@@ -134,13 +135,13 @@ int hid_cfg_create_menu(hid_cfg_t *hr, const char *path, const char *action, con
/* descend and visit each level, create missing levels */
- hid_cfg_get_menu_at(hr, NULL, path, create_menu_cb, &cmc);
+ pcb_hid_cfg_get_menu_at(hr, NULL, path, create_menu_cb, &cmc);
}
return cmc.err;
}
-static int hid_cfg_remove_item(hid_cfg_t *hr, lht_node_t *item, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx)
+static int hid_cfg_remove_item(pcb_hid_cfg_t *hr, lht_node_t *item, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx)
{
if (gui_remove(ctx, item) != 0)
return -1;
@@ -149,14 +150,14 @@ static int hid_cfg_remove_item(hid_cfg_t *hr, lht_node_t *item, int (*gui_remove
}
-static int hid_cfg_remove_menu_(hid_cfg_t *hr, lht_node_t *root, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx)
+static int hid_cfg_remove_menu_(pcb_hid_cfg_t *hr, lht_node_t *root, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx)
{
if (root == NULL)
return -1;
if (root->type == LHT_HASH) {
lht_node_t *psub, *n, *next;
- psub = hid_cfg_menu_field(root, MF_SUBMENU, NULL);
+ psub = pcb_hid_cfg_menu_field(root, PCB_MF_SUBMENU, NULL);
if (psub != NULL) { /* remove a whole submenu with all children */
int res = 0;
for(n = psub->data.list.first; n != NULL; n = next) {
@@ -177,9 +178,9 @@ static int hid_cfg_remove_menu_(hid_cfg_t *hr, lht_node_t *root, int (*gui_remov
return hid_cfg_remove_item(hr, root, gui_remove, ctx);
}
-int hid_cfg_remove_menu(hid_cfg_t *hr, const char *path, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx)
+int pcb_hid_cfg_remove_menu(pcb_hid_cfg_t *hr, const char *path, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx)
{
- return hid_cfg_remove_menu_(hr, hid_cfg_get_menu_at(hr, NULL, path, NULL, NULL), gui_remove, ctx);
+ return hid_cfg_remove_menu_(hr, pcb_hid_cfg_get_menu_at(hr, NULL, path, NULL, NULL), gui_remove, ctx);
}
@@ -188,18 +189,18 @@ static int hid_cfg_load_error(lht_doc_t *doc, const char *filename, lht_err_t er
const char *fn;
int line, col;
lht_dom_loc_active(doc, &fn, &line, &col);
- Message(PCB_MSG_DEFAULT, "Resource error: %s (%s:%d.%d)*\n", lht_err_str(err), filename, line+1, col+1);
+ pcb_message(PCB_MSG_ERROR, "Resource error: %s (%s:%d.%d)*\n", lht_err_str(err), filename, line+1, col+1);
return 1;
}
-lht_doc_t *hid_cfg_load_lht(const char *filename)
+lht_doc_t *pcb_hid_cfg_load_lht(const char *filename)
{
FILE *f;
lht_doc_t *doc;
int error = 0;
char *efn;
- resolve_path(filename, &efn, 0);
+ pcb_path_resolve(filename, &efn, 0);
f = fopen(efn, "r");
if (f == NULL) {
@@ -232,7 +233,7 @@ lht_doc_t *hid_cfg_load_lht(const char *filename)
return doc;
}
-lht_doc_t *hid_cfg_load_str(const char *text)
+lht_doc_t *pcb_hid_cfg_load_str(const char *text)
{
lht_doc_t *doc;
int error = 0;
@@ -261,22 +262,22 @@ lht_doc_t *hid_cfg_load_str(const char *text)
return doc;
}
-const char *hid_cfg_text_value(lht_doc_t *doc, const char *path)
+const char *pcb_hid_cfg_text_value(lht_doc_t *doc, const char *path)
{
lht_node_t *n = lht_tree_path(doc, "/", path, 1, NULL);
if (n == NULL)
return NULL;
if (n->type != LHT_TEXT) {
- hid_cfg_error(n, "Error: node %s should be a text node\n", path);
+ pcb_hid_cfg_error(n, "Error: node %s should be a text node\n", path);
return NULL;
}
return n->data.text.value;
}
-hid_cfg_t *hid_cfg_load(const char *fn, int exact_fn, const char *embedded_fallback)
+pcb_hid_cfg_t *pcb_hid_cfg_load(const char *fn, int exact_fn, const char *embedded_fallback)
{
lht_doc_t *doc;
- hid_cfg_t *hr;
+ pcb_hid_cfg_t *hr;
if (!exact_fn) {
/* try different paths to find the menu file inventing its exact name */
@@ -285,28 +286,28 @@ hid_cfg_t *hid_cfg_load(const char *fn, int exact_fn, const char *embedded_fallb
int fn_len = strlen(fn);
doc = NULL;
- resolve_all_paths(hid_cfg_paths_in, paths, fn_len+32);
+ pcb_paths_resolve_all(hid_cfg_paths_in, paths, fn_len+32);
for(p = paths; *p != NULL; p++) {
if (doc == NULL) {
char *end = *p + strlen(*p);
sprintf(end, "pcb-menu-%s.lht", fn);
- doc = hid_cfg_load_lht(*p);
+ doc = pcb_hid_cfg_load_lht(*p);
if (doc != NULL)
- Message(PCB_MSG_DEFAULT, "Loaded menu file '%s'\n", *p);
+ pcb_message(PCB_MSG_INFO, "Loaded menu file '%s'\n", *p);
}
free(*p);
}
free(paths);
}
else
- doc = hid_cfg_load_lht(fn);
+ doc = pcb_hid_cfg_load_lht(fn);
if (doc == NULL)
- doc = hid_cfg_load_str(embedded_fallback);
+ doc = pcb_hid_cfg_load_str(embedded_fallback);
if (doc == NULL)
return NULL;
- hr = calloc(sizeof(hid_cfg_t), 1); /* make sure the cache is cleared */
+ hr = calloc(sizeof(pcb_hid_cfg_t), 1); /* make sure the cache is cleared */
hr->doc = doc;
return hr;
@@ -314,7 +315,7 @@ hid_cfg_t *hid_cfg_load(const char *fn, int exact_fn, const char *embedded_fallb
/************* "parsing" **************/
-lht_node_t *hid_cfg_get_menu_at(hid_cfg_t *hr, lht_node_t *at, const char *menu_path, lht_node_t *(*cb)(void *ctx, lht_node_t *node, const char *path, int rel_level), void *ctx)
+lht_node_t *pcb_hid_cfg_get_menu_at(pcb_hid_cfg_t *hr, lht_node_t *at, const char *menu_path, lht_node_t *(*cb)(void *ctx, lht_node_t *node, const char *path, int rel_level), void *ctx)
{
lht_err_t err;
lht_node_t *curr;
@@ -370,29 +371,29 @@ lht_node_t *hid_cfg_get_menu_at(hid_cfg_t *hr, lht_node_t *at, const char *menu_
return curr;
}
-lht_node_t *hid_cfg_get_menu(hid_cfg_t *hr, const char *menu_path)
+lht_node_t *pcb_hid_cfg_get_menu(pcb_hid_cfg_t *hr, const char *menu_path)
{
- return hid_cfg_get_menu_at(hr, NULL, menu_path, NULL, NULL);
+ return pcb_hid_cfg_get_menu_at(hr, NULL, menu_path, NULL, NULL);
}
-lht_node_t *hid_cfg_menu_field(const lht_node_t *submenu, hid_cfg_menufield_t field, const char **field_name)
+lht_node_t *pcb_hid_cfg_menu_field(const lht_node_t *submenu, pcb_hid_cfg_menufield_t field, const char **field_name)
{
lht_err_t err;
const char *fieldstr = NULL;
switch(field) {
- case MF_ACCELERATOR: fieldstr = "a"; break;
- case MF_MNEMONIC: fieldstr = "m"; break;
- case MF_SUBMENU: fieldstr = "submenu"; break;
- case MF_CHECKED: fieldstr = "checked"; break;
- case MF_UPDATE_ON: fieldstr = "update_on"; break;
- case MF_SENSITIVE: fieldstr = "sensitive"; break;
- case MF_TIP: fieldstr = "tip"; break;
- case MF_ACTIVE: fieldstr = "active"; break;
- case MF_ACTION: fieldstr = "action"; break;
- case MF_FOREGROUND: fieldstr = "foreground"; break;
- case MF_BACKGROUND: fieldstr = "background"; break;
- case MF_FONT: fieldstr = "font"; break;
+ case PCB_MF_ACCELERATOR: fieldstr = "a"; break;
+ case PCB_MF_MNEMONIC: fieldstr = "m"; break;
+ case PCB_MF_SUBMENU: fieldstr = "submenu"; break;
+ case PCB_MF_CHECKED: fieldstr = "checked"; break;
+ case PCB_MF_UPDATE_ON: fieldstr = "update_on"; break;
+ case PCB_MF_SENSITIVE: fieldstr = "sensitive"; break;
+ case PCB_MF_TIP: fieldstr = "tip"; break;
+ case PCB_MF_ACTIVE: fieldstr = "active"; break;
+ case PCB_MF_ACTION: fieldstr = "action"; break;
+ case PCB_MF_FOREGROUND: fieldstr = "foreground"; break;
+ case PCB_MF_BACKGROUND: fieldstr = "background"; break;
+ case PCB_MF_FONT: fieldstr = "font"; break;
/* case MF_RADIO: fieldstr = "radio"; break; */
}
if (field_name != NULL)
@@ -404,35 +405,35 @@ lht_node_t *hid_cfg_menu_field(const lht_node_t *submenu, hid_cfg_menufield_t fi
return lht_tree_path_(submenu->doc, submenu, fieldstr, 1, 0, &err);
}
-const char *hid_cfg_menu_field_str(const lht_node_t *submenu, hid_cfg_menufield_t field)
+const char *pcb_hid_cfg_menu_field_str(const lht_node_t *submenu, pcb_hid_cfg_menufield_t field)
{
const char *fldname;
- lht_node_t *n = hid_cfg_menu_field(submenu, field, &fldname);
+ lht_node_t *n = pcb_hid_cfg_menu_field(submenu, field, &fldname);
if (n == NULL)
return NULL;
if (n->type != LHT_TEXT) {
- hid_cfg_error(submenu, "Error: field %s should be a text node\n", fldname);
+ pcb_hid_cfg_error(submenu, "Error: field %s should be a text node\n", fldname);
return NULL;
}
return n->data.text.value;
}
-int hid_cfg_has_submenus(const lht_node_t *submenu)
+int pcb_hid_cfg_has_submenus(const lht_node_t *submenu)
{
const char *fldname;
- lht_node_t *n = hid_cfg_menu_field(submenu, MF_SUBMENU, &fldname);
+ lht_node_t *n = pcb_hid_cfg_menu_field(submenu, PCB_MF_SUBMENU, &fldname);
if (n == NULL)
return 0;
if (n->type != LHT_LIST) {
- hid_cfg_error(submenu, "Error: field %s should be a list (of submenus)\n", fldname);
+ pcb_hid_cfg_error(submenu, "Error: field %s should be a list (of submenus)\n", fldname);
return 0;
}
return 1;
}
-void hid_cfg_extend_hash_nodev(lht_node_t *node, va_list ap)
+void pcb_hid_cfg_extend_hash_nodev(lht_node_t *node, va_list ap)
{
for(;;) {
char *cname, *cval;
@@ -451,15 +452,15 @@ void hid_cfg_extend_hash_nodev(lht_node_t *node, va_list ap)
}
}
-void hid_cfg_extend_hash_node(lht_node_t *node, ...)
+void pcb_hid_cfg_extend_hash_node(lht_node_t *node, ...)
{
va_list ap;
va_start(ap, node);
- hid_cfg_extend_hash_nodev(node, ap);
+ pcb_hid_cfg_extend_hash_nodev(node, ap);
va_end(ap);
}
-lht_node_t *hid_cfg_create_hash_node(lht_node_t *parent, const char *name, ...)
+lht_node_t *pcb_hid_cfg_create_hash_node(lht_node_t *parent, const char *name, ...)
{
lht_node_t *n;
va_list ap;
@@ -472,18 +473,18 @@ lht_node_t *hid_cfg_create_hash_node(lht_node_t *parent, const char *name, ...)
lht_dom_list_append(parent, n);
va_start(ap, name);
- hid_cfg_extend_hash_nodev(n, ap);
+ pcb_hid_cfg_extend_hash_nodev(n, ap);
va_end(ap);
return n;
}
-lht_node_t *hid_cfg_menu_field_path(const lht_node_t *parent, const char *path)
+lht_node_t *pcb_hid_cfg_menu_field_path(const lht_node_t *parent, const char *path)
{
return lht_tree_path_(parent->doc, parent, path, 1, 0, NULL);
}
-int hid_cfg_dfs(lht_node_t *parent, int (*cb)(void *ctx, lht_node_t *n), void *ctx)
+int pcb_hid_cfg_dfs(lht_node_t *parent, int (*cb)(void *ctx, lht_node_t *n), void *ctx)
{
lht_dom_iterator_t it;
lht_node_t *n;
@@ -494,7 +495,7 @@ int hid_cfg_dfs(lht_node_t *parent, int (*cb)(void *ctx, lht_node_t *n), void *c
if (ret != 0)
return ret;
if (n->type != LHT_TEXT) {
- ret = hid_cfg_dfs(n, cb, ctx);
+ ret = pcb_hid_cfg_dfs(n, cb, ctx);
if (ret != 0)
return ret;
}
@@ -503,7 +504,7 @@ int hid_cfg_dfs(lht_node_t *parent, int (*cb)(void *ctx, lht_node_t *n), void *c
}
/* extern char hid_cfg_error_shared[]; */
-void hid_cfg_error(const lht_node_t *node, const char *fmt, ...)
+void pcb_hid_cfg_error(const lht_node_t *node, const char *fmt, ...)
{
char *end;
va_list ap;
@@ -512,5 +513,5 @@ void hid_cfg_error(const lht_node_t *node, const char *fmt, ...)
va_start(ap, fmt);
end += vsprintf(end, fmt, ap);
va_end(ap);
- Message(PCB_MSG_DEFAULT, hid_cfg_error_shared);
+ pcb_message(PCB_MSG_ERROR, hid_cfg_error_shared);
}
diff --git a/src/hid_cfg.h b/src/hid_cfg.h
index 7f529a6..586dc6c 100644
--- a/src/hid_cfg.h
+++ b/src/hid_cfg.h
@@ -26,88 +26,89 @@
#define PCB_HID_CFG_H
#include <liblihata/dom.h>
+#include <stdarg.h>
-typedef struct hid_cfg_s {
+typedef struct pcb_hid_cfg_s {
lht_doc_t *doc;
-} hid_cfg_t;
+} pcb_hid_cfg_t;
/* Create a set of resources representing a single menu item
If action is NULL, it's a drop-down item that has submenus.
The callback is called after the new lihata node is created.
NOTE: unlike other cookies, this cookie is strdup()'d.
*/
-typedef int (*create_menu_widget_t)(void *ctx, const char *path, const char *name, int is_main, lht_node_t *parent, lht_node_t *menu_item);
-int hid_cfg_create_menu(hid_cfg_t *hr, const char *path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie, create_menu_widget_t cb, void *cb_ctx);
+typedef int (*pcb_create_menu_widget_t)(void *ctx, const char *path, const char *name, int is_main, lht_node_t *parent, lht_node_t *menu_item);
+int pcb_hid_cfg_create_menu(pcb_hid_cfg_t *hr, const char *path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie, pcb_create_menu_widget_t cb, void *cb_ctx);
/* Remove a path recursively; call gui_remove() on leaf paths until the subtree
is consumed (should return 0 on success) */
-int hid_cfg_remove_menu(hid_cfg_t *hr, const char *path, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx);
+int pcb_hid_cfg_remove_menu(pcb_hid_cfg_t *hr, const char *path, int (*gui_remove)(void *ctx, lht_node_t *nd), void *ctx);
/* Search and load the menu res for hidname; if not found, and embedded_fallback
is not NULL, parse that string instead. Returns NULL on error */
-hid_cfg_t *hid_cfg_load(const char *fn, int exact_fn, const char *embedded_fallback);
+pcb_hid_cfg_t *pcb_hid_cfg_load(const char *fn, int exact_fn, const char *embedded_fallback);
/* Generic, low level lihata loader */
-lht_doc_t *hid_cfg_load_lht(const char *filename);
-lht_doc_t *hid_cfg_load_str(const char *text);
+lht_doc_t *pcb_hid_cfg_load_lht(const char *filename);
+lht_doc_t *pcb_hid_cfg_load_str(const char *text);
/* Generic, low level lihata text value fetch */
-const char *hid_cfg_text_value(lht_doc_t *doc, const char *path);
+const char *pcb_hid_cfg_text_value(lht_doc_t *doc, const char *path);
-lht_node_t *hid_cfg_get_menu(hid_cfg_t *hr, const char *menu_path);
-lht_node_t *hid_cfg_get_menu_at(hid_cfg_t *hr, lht_node_t *at, const char *menu_path, lht_node_t *(*cb)(void *ctx, lht_node_t *node, const char *path, int rel_level), void *ctx);
+lht_node_t *pcb_hid_cfg_get_menu(pcb_hid_cfg_t *hr, const char *menu_path);
+lht_node_t *pcb_hid_cfg_get_menu_at(pcb_hid_cfg_t *hr, lht_node_t *at, const char *menu_path, lht_node_t *(*cb)(void *ctx, lht_node_t *node, const char *path, int rel_level), void *ctx);
/* Fields are retrieved using this enum so that HIDs don't need to hardwire
lihata node names */
typedef enum {
- MF_ACCELERATOR,
- MF_MNEMONIC,
- MF_SUBMENU,
- MF_CHECKED,
- MF_UPDATE_ON,
- MF_SENSITIVE,
- MF_TIP,
- MF_ACTIVE,
- MF_ACTION,
- MF_FOREGROUND,
- MF_BACKGROUND,
- MF_FONT
+ PCB_MF_ACCELERATOR,
+ PCB_MF_MNEMONIC,
+ PCB_MF_SUBMENU,
+ PCB_MF_CHECKED,
+ PCB_MF_UPDATE_ON,
+ PCB_MF_SENSITIVE,
+ PCB_MF_TIP,
+ PCB_MF_ACTIVE,
+ PCB_MF_ACTION,
+ PCB_MF_FOREGROUND,
+ PCB_MF_BACKGROUND,
+ PCB_MF_FONT
/* MF_RADIO*/
-} hid_cfg_menufield_t;
+} pcb_hid_cfg_menufield_t;
/* Return a field of a submenu and optionally fill in field_name with the
field name expected in the lihata document (useful for error messages) */
-lht_node_t *hid_cfg_menu_field(const lht_node_t *submenu, hid_cfg_menufield_t field, const char **field_name);
+lht_node_t *pcb_hid_cfg_menu_field(const lht_node_t *submenu, pcb_hid_cfg_menufield_t field, const char **field_name);
/* Return a lihata node using a relative lihata path from parent - this is
just a wrapper around lht_tree_path_ */
-lht_node_t *hid_cfg_menu_field_path(const lht_node_t *parent, const char *path);
+lht_node_t *pcb_hid_cfg_menu_field_path(const lht_node_t *parent, const char *path);
-/* Return a text field of a submenu; return NULL and generate a Message(PCB_MSG_DEFAULT, ) if
+/* Return a text field of a submenu; return NULL and generate a pcb_message(PCB_MSG_ERROR, ) if
the given field is not text */
-const char *hid_cfg_menu_field_str(const lht_node_t *submenu, hid_cfg_menufield_t field);
+const char *pcb_hid_cfg_menu_field_str(const lht_node_t *submenu, pcb_hid_cfg_menufield_t field);
-/* Return non-zero if submenu has further submenus; generate Message(PCB_MSG_DEFAULT, ) if
+/* Return non-zero if submenu has further submenus; generate pcb_message(PCB_MSG_ERROR, ) if
there is a submenu field with the wrong lihata type */
-int hid_cfg_has_submenus(const lht_node_t *submenu);
+int pcb_hid_cfg_has_submenus(const lht_node_t *submenu);
/* Create a new hash node under parent (optional) and create a flat subtree of
text nodes from name,value varargs (NULL terminated). This is a shorthand
for creating a menu item in a subtree list. */
-lht_node_t *hid_cfg_create_hash_node(lht_node_t *parent, const char *name, ...);
+lht_node_t *pcb_hid_cfg_create_hash_node(lht_node_t *parent, const char *name, ...);
/* Create a flat subtree of text nodes from name,value varargs (NULL
terminated). This is a shorthand for creating a menu item in a
subtree list. */
-void hid_cfg_extend_hash_node(lht_node_t *node, ...);
-void hid_cfg_extend_hash_nodev(lht_node_t *node, va_list ap);
+void pcb_hid_cfg_extend_hash_node(lht_node_t *node, ...);
+void pcb_hid_cfg_extend_hash_nodev(lht_node_t *node, va_list ap);
/* Search a subtree in depth-first-search manner. Call cb on each node as
descending. If cb returns non-zero, stop the search and return that value.
Do all this recursively. */
-int hid_cfg_dfs(lht_node_t *parent, int (*cb)(void *ctx, lht_node_t *n), void *ctx);
+int pcb_hid_cfg_dfs(lht_node_t *parent, int (*cb)(void *ctx, lht_node_t *n), void *ctx);
/* Report an error about a node */
-void hid_cfg_error(const lht_node_t *node, const char *fmt, ...);
+void pcb_hid_cfg_error(const lht_node_t *node, const char *fmt, ...);
#endif
diff --git a/src/hid_cfg_action.c b/src/hid_cfg_action.c
index a40e04a..d0f7865 100644
--- a/src/hid_cfg_action.c
+++ b/src/hid_cfg_action.c
@@ -21,21 +21,20 @@
*/
#include "config.h"
-#include "global.h"
#include "hid_cfg_action.h"
#include "hid_actions.h"
-int hid_cfg_action(const lht_node_t *node)
+int pcb_hid_cfg_action(const lht_node_t *node)
{
if (node == NULL)
return -1;
switch(node->type) {
case LHT_TEXT:
- return hid_parse_actions(node->data.text.value);
+ return pcb_hid_parse_actions(node->data.text.value);
case LHT_LIST:
for(node = node->data.list.first; node != NULL; node = node->next) {
if (node->type == LHT_TEXT) {
- if (hid_parse_actions(node->data.text.value) != 0)
+ if (pcb_hid_parse_actions(node->data.text.value) != 0)
return -1;
}
else
diff --git a/src/hid_cfg_action.h b/src/hid_cfg_action.h
index 9b1a2d6..9f7c8b3 100644
--- a/src/hid_cfg_action.h
+++ b/src/hid_cfg_action.h
@@ -24,4 +24,4 @@
#include "hid_cfg.h"
/* Run an action node. The node is either a list of text nodes or a text node;
returns non-zero on error, the first action that fails in a chain breaks the chain */
-int hid_cfg_action(const lht_node_t *node);
+int pcb_hid_cfg_action(const lht_node_t *node);
diff --git a/src/hid_cfg_input.c b/src/hid_cfg_input.c
index 7d42988..9e3b8fd 100644
--- a/src/hid_cfg_input.c
+++ b/src/hid_cfg_input.c
@@ -23,24 +23,23 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
#include <liblihata/lihata.h>
#include <liblihata/tree.h>
#include <genht/hash.h>
#include <genvector/gds_char.h>
-#include "global.h"
-#include "hid.h"
-#include "hid_cfg.h"
+#include "config.h"
#include "hid_cfg_input.h"
-#include "hid_actions.h"
#include "hid_cfg_action.h"
#include "error.h"
+#include "compat_misc.h"
/* split value into a list of '-' separated words; examine each word
and set the bitmask of modifiers */
-static hid_cfg_mod_t parse_mods(const char *value, const char **last, unsigned int vlen)
+static pcb_hid_cfg_mod_t parse_mods(const char *value, const char **last, unsigned int vlen)
{
- hid_cfg_mod_t m = 0;
+ pcb_hid_cfg_mod_t m = 0;
int press = 0;
const char *next;
@@ -48,13 +47,13 @@ static hid_cfg_mod_t parse_mods(const char *value, const char **last, unsigned i
if (*value != '<') {
for(;;) {
- if ((vlen >= 5) && (strncasecmp(value, "shift", 5) == 0)) m |= M_Shift;
- else if ((vlen >= 4) && (strncasecmp(value, "ctrl", 4) == 0)) m |= M_Ctrl;
- else if ((vlen >= 3) && (strncasecmp(value, "alt", 3) == 0)) m |= M_Alt;
- else if ((vlen >= 7) && (strncasecmp(value, "release", 7) == 0)) m |= M_Release;
- else if ((vlen >= 5) && (strncasecmp(value, "press", 5) == 0)) press = 1;
+ if ((vlen >= 5) && (pcb_strncasecmp(value, "shift", 5) == 0)) m |= PCB_M_Shift;
+ else if ((vlen >= 4) && (pcb_strncasecmp(value, "ctrl", 4) == 0)) m |= PCB_M_Ctrl;
+ else if ((vlen >= 3) && (pcb_strncasecmp(value, "alt", 3) == 0)) m |= PCB_M_Alt;
+ else if ((vlen >= 7) && (pcb_strncasecmp(value, "release", 7) == 0)) m |= PCB_M_Release;
+ else if ((vlen >= 5) && (pcb_strncasecmp(value, "press", 5) == 0)) press = 1;
else
- Message(PCB_MSG_DEFAULT, "Unknown modifier: %s\n", value);
+ pcb_message(PCB_MSG_ERROR, "Unknown modifier: %s\n", value);
/* skip to next word */
next = strpbrk(value, "<- \t");
if (next == NULL)
@@ -69,28 +68,28 @@ static hid_cfg_mod_t parse_mods(const char *value, const char **last, unsigned i
if (last != NULL)
*last = value;
- if (press && (m & M_Release))
- Message(PCB_MSG_DEFAULT, "Bogus modifier: both press and release\n");
+ if (press && (m & PCB_M_Release))
+ pcb_message(PCB_MSG_ERROR, "Bogus modifier: both press and release\n");
return m;
}
-static hid_cfg_mod_t button_name2mask(const char *name)
+static pcb_hid_cfg_mod_t button_name2mask(const char *name)
{
/* All mouse-related resources must be named. The name is the
mouse button number. */
if (!name)
return 0;
- else if (strcasecmp(name, "left") == 0) return MB_LEFT;
- else if (strcasecmp(name, "middle") == 0) return MB_MIDDLE;
- else if (strcasecmp(name, "right") == 0) return MB_RIGHT;
-
- else if (strcasecmp(name, "scroll-up") == 0) return MB_SCROLL_UP;
- else if (strcasecmp(name, "scroll-down") == 0) return MB_SCROLL_DOWN;
- else if (strcasecmp(name, "scroll-left") == 0) return MB_SCROLL_UP;
- else if (strcasecmp(name, "scroll-right") == 0) return MB_SCROLL_DOWN;
+ else if (pcb_strcasecmp(name, "left") == 0) return PCB_MB_LEFT;
+ else if (pcb_strcasecmp(name, "middle") == 0) return PCB_MB_MIDDLE;
+ else if (pcb_strcasecmp(name, "right") == 0) return PCB_MB_RIGHT;
+
+ else if (pcb_strcasecmp(name, "scroll-up") == 0) return PCB_MB_SCROLL_UP;
+ else if (pcb_strcasecmp(name, "scroll-down") == 0) return PCB_MB_SCROLL_DOWN;
+ else if (pcb_strcasecmp(name, "scroll-left") == 0) return PCB_MB_SCROLL_UP;
+ else if (pcb_strcasecmp(name, "scroll-right") == 0) return PCB_MB_SCROLL_DOWN;
else {
- Message(PCB_MSG_DEFAULT, "Error: unknown mouse button: %s\n", name);
+ pcb_message(PCB_MSG_ERROR, "Error: unknown mouse button: %s\n", name);
return 0;
}
}
@@ -99,19 +98,19 @@ static unsigned int keyhash_int(htip_key_t a) { return murmurhash32(a & 0xF
/************************** MOUSE ***************************/
-int hid_cfg_mouse_init(hid_cfg_t *hr, hid_cfg_mouse_t *mouse)
+int hid_cfg_mouse_init(pcb_hid_cfg_t *hr, pcb_hid_cfg_mouse_t *mouse)
{
lht_node_t *btn, *m;
- mouse->mouse = hid_cfg_get_menu(hr, "/mouse");
+ mouse->mouse = pcb_hid_cfg_get_menu(hr, "/mouse");
if (mouse->mouse == NULL) {
- Message(PCB_MSG_DEFAULT, "Warning: no /mouse section in the resource file - mouse is disabled\n");
+ pcb_message(PCB_MSG_ERROR, "Warning: no /mouse section in the resource file - mouse is disabled\n");
return -1;
}
if (mouse->mouse->type != LHT_LIST) {
- hid_cfg_error(mouse->mouse, "Warning: should be a list - mouse is disabled\n");
+ pcb_hid_cfg_error(mouse->mouse, "Warning: should be a list - mouse is disabled\n");
return -1;
}
@@ -121,24 +120,24 @@ int hid_cfg_mouse_init(hid_cfg_t *hr, hid_cfg_mouse_t *mouse)
htip_clear(mouse->mouse_mask);
for(btn = mouse->mouse->data.list.first; btn != NULL; btn = btn->next) {
- hid_cfg_mod_t btn_mask = button_name2mask(btn->name);
+ pcb_hid_cfg_mod_t btn_mask = button_name2mask(btn->name);
if (btn_mask == 0) {
- hid_cfg_error(btn, "unknown mouse button");
+ pcb_hid_cfg_error(btn, "unknown mouse button");
continue;
}
if (btn->type != LHT_LIST) {
- hid_cfg_error(btn, "needs to be a list");
+ pcb_hid_cfg_error(btn, "needs to be a list");
continue;
}
for(m = btn->data.list.first; m != NULL; m = m->next) {
- hid_cfg_mod_t mod_mask = parse_mods(m->name, NULL, -1);
+ pcb_hid_cfg_mod_t mod_mask = parse_mods(m->name, NULL, -1);
htip_set(mouse->mouse_mask, btn_mask|mod_mask, m);
}
}
return 0;
}
-static lht_node_t *find_best_action(hid_cfg_mouse_t *mouse, hid_cfg_mod_t button_and_mask)
+static lht_node_t *find_best_action(pcb_hid_cfg_mouse_t *mouse, pcb_hid_cfg_mod_t button_and_mask)
{
lht_node_t *n;
@@ -150,9 +149,9 @@ static lht_node_t *find_best_action(hid_cfg_mouse_t *mouse, hid_cfg_mod_t button
if (n != NULL)
return n;
- if (button_and_mask & M_Release) {
+ if (button_and_mask & PCB_M_Release) {
/* look for plain release for the given button */
- n = htip_get(mouse->mouse_mask, (button_and_mask & M_ANY) | M_Release);
+ n = htip_get(mouse->mouse_mask, (button_and_mask & PCB_M_ANY) | PCB_M_Release);
if (n != NULL)
return n;
}
@@ -160,29 +159,29 @@ static lht_node_t *find_best_action(hid_cfg_mouse_t *mouse, hid_cfg_mod_t button
return NULL;
}
-void hid_cfg_mouse_action(hid_cfg_mouse_t *mouse, hid_cfg_mod_t button_and_mask)
+void hid_cfg_mouse_action(pcb_hid_cfg_mouse_t *mouse, pcb_hid_cfg_mod_t button_and_mask)
{
- hid_cfg_action(find_best_action(mouse, button_and_mask));
+ pcb_hid_cfg_action(find_best_action(mouse, button_and_mask));
}
/************************** KEYBOARD ***************************/
-int hid_cfg_keys_init(hid_cfg_keys_t *km)
+int pcb_hid_cfg_keys_init(pcb_hid_cfg_keys_t *km)
{
htip_init(&km->keys, keyhash_int, htip_keyeq);
return 0;
}
-int hid_cfg_keys_uninit(hid_cfg_keys_t *km)
+int pcb_hid_cfg_keys_uninit(pcb_hid_cfg_keys_t *km)
{
#warning TODO: recursive free of nodes
htip_uninit(&km->keys);
return 0;
}
-hid_cfg_keyseq_t *hid_cfg_keys_add_under(hid_cfg_keys_t *km, hid_cfg_keyseq_t *parent, hid_cfg_mod_t mods, unsigned short int key_char, int terminal)
+pcb_hid_cfg_keyseq_t *pcb_hid_cfg_keys_add_under(pcb_hid_cfg_keys_t *km, pcb_hid_cfg_keyseq_t *parent, pcb_hid_cfg_mod_t mods, unsigned short int key_char, int terminal)
{
- hid_cfg_keyseq_t *ns;
+ pcb_hid_cfg_keyseq_t *ns;
hid_cfg_keyhash_t addr;
htip_t *phash = (parent == NULL) ? &km->keys : &parent->seq_next;
@@ -204,19 +203,19 @@ hid_cfg_keyseq_t *hid_cfg_keys_add_under(hid_cfg_keys_t *km, hid_cfg_keyseq_t *p
}
/* new node on this level */
- ns = calloc(sizeof(hid_cfg_keyseq_t), 1);
+ ns = calloc(sizeof(pcb_hid_cfg_keyseq_t), 1);
if (!terminal)
htip_init(&ns->seq_next, keyhash_int, htip_keyeq);
htip_set(phash, addr.hash, ns);
return ns;
}
-const hid_cfg_keytrans_t hid_cfg_key_default_trans[] = {
+const pcb_hid_cfg_keytrans_t hid_cfg_key_default_trans[] = {
{ "semicolon", ';' },
{ NULL, 0 },
};
-static unsigned short int translate_key(hid_cfg_keys_t *km, const char *desc, int len)
+static unsigned short int translate_key(pcb_hid_cfg_keys_t *km, const char *desc, int len)
{
char tmp[256];
@@ -224,16 +223,16 @@ static unsigned short int translate_key(hid_cfg_keys_t *km, const char *desc, in
return *desc;
if (len > sizeof(tmp)-1) {
- Message(PCB_MSG_DEFAULT, "key sym name too long\n");
+ pcb_message(PCB_MSG_ERROR, "key sym name too long\n");
return 0;
}
strncpy(tmp, desc, len);
tmp[len] = '\0';
if (km->auto_tr != NULL) {
- const hid_cfg_keytrans_t *t;
+ const pcb_hid_cfg_keytrans_t *t;
for(t = km->auto_tr; t->name != NULL; t++) {
- if (strcasecmp(tmp, t->name) == 0) {
+ if (pcb_strcasecmp(tmp, t->name) == 0) {
tmp[0] = t->sym;
tmp[1] = '\0';
len = 1;
@@ -245,7 +244,7 @@ static unsigned short int translate_key(hid_cfg_keys_t *km, const char *desc, in
return km->translate_key(tmp, len);
}
-static int parse_keydesc(hid_cfg_keys_t *km, const char *keydesc, hid_cfg_mod_t *mods, unsigned short int *key_chars, int arr_len)
+static int parse_keydesc(pcb_hid_cfg_keys_t *km, const char *keydesc, pcb_hid_cfg_mod_t *mods, unsigned short int *key_chars, int arr_len)
{
const char *curr, *next, *last, *k;
int slen, len;
@@ -270,13 +269,13 @@ static int parse_keydesc(hid_cfg_keys_t *km, const char *keydesc, hid_cfg_mod_t
k = strchr(last, '<');
if (k == NULL) {
- Message(PCB_MSG_DEFAULT, "Missing <key> in the key description: '%s'\n", keydesc);
+ pcb_message(PCB_MSG_ERROR, "Missing <key> in the key description: '%s'\n", keydesc);
return -1;
}
len -= k-last;
k++; len--;
if ((strncmp(k, "key>", 4) != 0) && (strncmp(k, "Key>", 4) != 0)) {
- Message(PCB_MSG_DEFAULT, "Missing <key> in the key description\n");
+ pcb_message(PCB_MSG_ERROR, "Missing <key> in the key description\n");
return -1;
}
k+=4; len-=4;
@@ -287,7 +286,7 @@ static int parse_keydesc(hid_cfg_keys_t *km, const char *keydesc, hid_cfg_mod_t
s = malloc(len+1);
memcpy(s, k, len);
s[len] = '\0';
- Message(PCB_MSG_DEFAULT, "Unrecognised key symbol in key description: %s\n", s);
+ pcb_message(PCB_MSG_ERROR, "Unrecognised key symbol in key description: %s\n", s);
free(s);
return -1;
}
@@ -298,11 +297,11 @@ static int parse_keydesc(hid_cfg_keys_t *km, const char *keydesc, hid_cfg_mod_t
return slen;
}
-int hid_cfg_keys_add_by_strdesc(hid_cfg_keys_t *km, const char *keydesc, const lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len)
+int pcb_hid_cfg_keys_add_by_strdesc(pcb_hid_cfg_keys_t *km, const char *keydesc, const lht_node_t *action_node, pcb_hid_cfg_keyseq_t **out_seq, int out_seq_len)
{
- hid_cfg_mod_t mods[HIDCFG_MAX_KEYSEQ_LEN];
+ pcb_hid_cfg_mod_t mods[HIDCFG_MAX_KEYSEQ_LEN];
unsigned short int key_chars[HIDCFG_MAX_KEYSEQ_LEN];
- hid_cfg_keyseq_t *lasts;
+ pcb_hid_cfg_keyseq_t *lasts;
int slen, n;
slen = parse_keydesc(km, keydesc, mods, key_chars, HIDCFG_MAX_KEYSEQ_LEN);
@@ -316,12 +315,12 @@ int hid_cfg_keys_add_by_strdesc(hid_cfg_keys_t *km, const char *keydesc, const l
lasts = NULL;
for(n = 0; n < slen; n++) {
- hid_cfg_keyseq_t *s;
+ pcb_hid_cfg_keyseq_t *s;
int terminal = (n == slen-1);
/* printf(" mods=%x sym=%x\n", mods[n], key_chars[n]);*/
- s = hid_cfg_keys_add_under(km, lasts, mods[n], key_chars[n], terminal);
+ s = pcb_hid_cfg_keys_add_under(km, lasts, mods[n], key_chars[n], terminal);
if (s == NULL) {
printf(" ERROR\n");
#warning TODO: free stuff?
@@ -338,10 +337,10 @@ int hid_cfg_keys_add_by_strdesc(hid_cfg_keys_t *km, const char *keydesc, const l
return slen;
}
-int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const lht_node_t *keydescn, const lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len)
+int pcb_hid_cfg_keys_add_by_desc(pcb_hid_cfg_keys_t *km, const lht_node_t *keydescn, const lht_node_t *action_node, pcb_hid_cfg_keyseq_t **out_seq, int out_seq_len)
{
switch(keydescn->type) {
- case LHT_TEXT: return hid_cfg_keys_add_by_strdesc(km, keydescn->data.text.value, action_node, out_seq, out_seq_len);
+ case LHT_TEXT: return pcb_hid_cfg_keys_add_by_strdesc(km, keydescn->data.text.value, action_node, out_seq, out_seq_len);
case LHT_LIST:
{
int ret = -1, cnt;
@@ -350,9 +349,9 @@ int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const lht_node_t *keydescn, con
if (n->type != LHT_TEXT)
break;
if (cnt == 0)
- ret = hid_cfg_keys_add_by_strdesc(km, n->data.text.value, action_node, out_seq, out_seq_len);
+ ret = pcb_hid_cfg_keys_add_by_strdesc(km, n->data.text.value, action_node, out_seq, out_seq_len);
else
- hid_cfg_keys_add_by_strdesc(km, n->data.text.value, action_node, NULL, 0);
+ pcb_hid_cfg_keys_add_by_strdesc(km, n->data.text.value, action_node, NULL, 0);
}
return ret;
}
@@ -361,9 +360,9 @@ int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const lht_node_t *keydescn, con
return -1;
}
-static void gen_accel(gds_t *s, hid_cfg_keys_t *km, const char *keydesc, int *cnt, const char *sep)
+static void gen_accel(gds_t *s, pcb_hid_cfg_keys_t *km, const char *keydesc, int *cnt, const char *sep)
{
- hid_cfg_mod_t mods[HIDCFG_MAX_KEYSEQ_LEN];
+ pcb_hid_cfg_mod_t mods[HIDCFG_MAX_KEYSEQ_LEN];
unsigned short int key_chars[HIDCFG_MAX_KEYSEQ_LEN];
int slen, n;
@@ -383,14 +382,14 @@ static void gen_accel(gds_t *s, hid_cfg_keys_t *km, const char *keydesc, int *cn
if (km->key_name(key_chars[n], buff, sizeof(buff)) != 0)
strcpy(buff, "<unknown>");
- if (mods[n] & M_Alt) gds_append_str(s, "Alt-");
- if (mods[n] & M_Ctrl) gds_append_str(s, "Ctrl-");
- if (mods[n] & M_Shift) gds_append_str(s, "Shift-");
+ if (mods[n] & PCB_M_Alt) gds_append_str(s, "Alt-");
+ if (mods[n] & PCB_M_Ctrl) gds_append_str(s, "Ctrl-");
+ if (mods[n] & PCB_M_Shift) gds_append_str(s, "Shift-");
gds_append_str(s, buff);
}
}
-char *hid_cfg_keys_gen_accel(hid_cfg_keys_t *km, const lht_node_t *keydescn, unsigned long mask, const char *sep)
+char *pcb_hid_cfg_keys_gen_accel(pcb_hid_cfg_keys_t *km, const lht_node_t *keydescn, unsigned long mask, const char *sep)
{
gds_t s;
int cnt = 0;
@@ -420,9 +419,9 @@ char *hid_cfg_keys_gen_accel(hid_cfg_keys_t *km, const lht_node_t *keydescn, uns
}
-int hid_cfg_keys_input(hid_cfg_keys_t *km, hid_cfg_mod_t mods, unsigned short int key_char, hid_cfg_keyseq_t **seq, int *seq_len)
+int pcb_hid_cfg_keys_input(pcb_hid_cfg_keys_t *km, pcb_hid_cfg_mod_t mods, unsigned short int key_char, pcb_hid_cfg_keyseq_t **seq, int *seq_len)
{
- hid_cfg_keyseq_t *ns;
+ pcb_hid_cfg_keyseq_t *ns;
hid_cfg_keyhash_t addr;
htip_t *phash = (*seq_len == 0) ? &km->keys : &((seq[(*seq_len)-1])->seq_next);
@@ -450,10 +449,10 @@ int hid_cfg_keys_input(hid_cfg_keys_t *km, hid_cfg_mod_t mods, unsigned short in
return 0;
}
-int hid_cfg_keys_action(hid_cfg_keyseq_t **seq, int seq_len)
+int pcb_hid_cfg_keys_action(pcb_hid_cfg_keyseq_t **seq, int seq_len)
{
if (seq_len < 1)
return -1;
- return hid_cfg_action(seq[seq_len-1]->action_node);
+ return pcb_hid_cfg_action(seq[seq_len-1]->action_node);
}
diff --git a/src/hid_cfg_input.h b/src/hid_cfg_input.h
index 6646483..fa6f5a7 100644
--- a/src/hid_cfg_input.h
+++ b/src/hid_cfg_input.h
@@ -5,40 +5,40 @@
#include <genht/htip.h>
#include "hid_cfg.h"
-#define M_Mod0(n) (1u<<(n))
+#define PCB_M_Mod0(n) (1u<<(n))
typedef enum {
- M_Shift = M_Mod0(0),
- M_Ctrl = M_Mod0(1),
- M_Alt = M_Mod0(2),
- M_Mod1 = M_Alt,
- /* M_Mod(3) is M_Mod0(4) */
- /* M_Mod(4) is M_Mod0(5) */
- M_Release = M_Mod0(6), /* there might be a random number of modkeys, but hopefully not this many */
-
- MB_LEFT = M_Mod0(7),
- MB_MIDDLE = M_Mod0(8),
- MB_RIGHT = M_Mod0(9),
+ PCB_M_Shift = PCB_M_Mod0(0),
+ PCB_M_Ctrl = PCB_M_Mod0(1),
+ PCB_M_Alt = PCB_M_Mod0(2),
+ PCB_M_Mod1 = PCB_M_Alt,
+ /* PCB_M_Mod(3) is PCB_M_Mod0(4) */
+ /* PCB_M_Mod(4) is PCB_M_Mod0(5) */
+ PCB_M_Release = PCB_M_Mod0(6), /* there might be a random number of modkeys, but hopefully not this many */
+
+ PCB_MB_LEFT = PCB_M_Mod0(7),
+ PCB_MB_MIDDLE = PCB_M_Mod0(8),
+ PCB_MB_RIGHT = PCB_M_Mod0(9),
/* scroll wheel */
- MB_SCROLL_UP = M_Mod0(10),
- MB_SCROLL_DOWN = M_Mod0(11),
- MB_SCROLL_LEFT = M_Mod0(12),
- MB_SCROLL_RIGHT = M_Mod0(13)
-} hid_cfg_mod_t;
-#undef M_Mod0
+ PCB_MB_SCROLL_UP = PCB_M_Mod0(10),
+ PCB_MB_SCROLL_DOWN = PCB_M_Mod0(11),
+ PCB_MB_SCROLL_LEFT = PCB_M_Mod0(12),
+ PCB_MB_SCROLL_RIGHT = PCB_M_Mod0(13)
+} pcb_hid_cfg_mod_t;
+#undef PCB_M_Mod0
-#define MB_ANY (MB_LEFT | MB_MIDDLE | MB_RIGHT | MB_SCROLL_UP | MB_SCROLL_DOWN | MB_SCROLL_LEFT | MB_SCROLL_RIGHT)
-#define M_ANY (M_Release-1)
+#define PCB_MB_ANY (PCB_MB_LEFT | PCB_MB_MIDDLE | PCB_MB_RIGHT | PCB_MB_SCROLL_UP | PCB_MB_SCROLL_DOWN | PCB_MB_SCROLL_LEFT | PCB_MB_SCROLL_RIGHT)
+#define PCB_M_ANY (PCB_M_Release-1)
/************************** MOUSE ***************************/
typedef struct {
lht_node_t *mouse;
htip_t *mouse_mask;
-} hid_cfg_mouse_t;
+} pcb_hid_cfg_mouse_t;
-int hid_cfg_mouse_init(hid_cfg_t *hr, hid_cfg_mouse_t *mouse);
-void hid_cfg_mouse_action(hid_cfg_mouse_t *mouse, hid_cfg_mod_t button_and_mask);
+int hid_cfg_mouse_init(pcb_hid_cfg_t *hr, pcb_hid_cfg_mouse_t *mouse);
+void hid_cfg_mouse_action(pcb_hid_cfg_mouse_t *mouse, pcb_hid_cfg_mod_t button_and_mask);
/************************** KEYBOARD ***************************/
@@ -46,34 +46,34 @@ void hid_cfg_mouse_action(hid_cfg_mouse_t *mouse, hid_cfg_mod_t button_and_mask)
typedef union hid_cfg_keyhash_u { /* integer hash key */
unsigned long hash;
struct {
- unsigned short int mods; /* of hid_cfg_mod_t */
+ unsigned short int mods; /* of pcb_hid_cfg_mod_t */
unsigned short int key_char;
} details;
} hid_cfg_keyhash_t;
-typedef struct hid_cfg_keyseq_s hid_cfg_keyseq_t;
-struct hid_cfg_keyseq_s {
+typedef struct pcb_hid_cfg_keyseq_s pcb_hid_cfg_keyseq_t;
+struct pcb_hid_cfg_keyseq_s {
unsigned long int keysym; /* optional 32 bit long storage the GUI hid should cast to whatever the GUI backend supports */
const lht_node_t *action_node; /* terminal node: end of sequence, run actions */
htip_t seq_next; /* ... or if node is NULL, a hash for each key that may follow the current one */
- hid_cfg_keyseq_t *parent;
+ pcb_hid_cfg_keyseq_t *parent;
};
/* Translate symbolic name to single-char keysym before processing; useful
for shortcuts like "Return -> '\r'" which are otherwise hard to describe
in text format */
-typedef struct hid_cfg_keytrans_s {
+typedef struct pcb_hid_cfg_keytrans_s {
const char *name;
char sym;
-} hid_cfg_keytrans_t;
+} pcb_hid_cfg_keytrans_t;
-extern const hid_cfg_keytrans_t hid_cfg_key_default_trans[];
+extern const pcb_hid_cfg_keytrans_t hid_cfg_key_default_trans[];
/* A complete tree of keyboard shortcuts/hotkeys */
-typedef struct hid_cfg_keys_s {
+typedef struct pcb_hid_cfg_keys_s {
htip_t keys;
/* translate key sym description (the portion after <Key>) to key_char;
@@ -87,24 +87,24 @@ typedef struct hid_cfg_keys_s {
int auto_chr; /* if non-zero: don't call translate_key() for 1-char symbols, handle the default way */
- const hid_cfg_keytrans_t *auto_tr; /* apply this table before calling translate_key() */
-} hid_cfg_keys_t;
+ const pcb_hid_cfg_keytrans_t *auto_tr; /* apply this table before calling translate_key() */
+} pcb_hid_cfg_keys_t;
/* Initialize a new keyboard context
Returns 0 on success.
*/
-int hid_cfg_keys_init(hid_cfg_keys_t *km);
+int pcb_hid_cfg_keys_init(pcb_hid_cfg_keys_t *km);
/* Free km's fields recursively */
-int hid_cfg_keys_uninit(hid_cfg_keys_t *km);
+int pcb_hid_cfg_keys_uninit(pcb_hid_cfg_keys_t *km);
/* Add the next key of a key sequence; key sequences form a tree. A key starting
a new key sequence should have parent set NULL, subsequent calls should have
parent set to the previously returned keyseq value. Terminal is non-zero if
this is the last key of the sequence.
Returns NULL on error */
-hid_cfg_keyseq_t *hid_cfg_keys_add_under(hid_cfg_keys_t *km, hid_cfg_keyseq_t *parent, hid_cfg_mod_t mods, unsigned short int key_char, int terminal);
+pcb_hid_cfg_keyseq_t *pcb_hid_cfg_keys_add_under(pcb_hid_cfg_keys_t *km, pcb_hid_cfg_keyseq_t *parent, pcb_hid_cfg_mod_t mods, unsigned short int key_char, int terminal);
/* Add a new key using a description (read from a lihata file usually)
If out_seq is not NULL, load the array with pointers pointing to each
@@ -113,8 +113,8 @@ hid_cfg_keyseq_t *hid_cfg_keys_add_under(hid_cfg_keys_t *km, hid_cfg_keyseq_t *p
same action). In this case return value and seq are set using the first key.
Returns -1 on failure or the length of the sequence.
*/
-int hid_cfg_keys_add_by_desc(hid_cfg_keys_t *km, const lht_node_t *keydesc, const lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len);
-int hid_cfg_keys_add_by_strdesc(hid_cfg_keys_t *km, const char *keydesc, const lht_node_t *action_node, hid_cfg_keyseq_t **out_seq, int out_seq_len);
+int pcb_hid_cfg_keys_add_by_desc(pcb_hid_cfg_keys_t *km, const lht_node_t *keydesc, const lht_node_t *action_node, pcb_hid_cfg_keyseq_t **out_seq, int out_seq_len);
+int pcb_hid_cfg_keys_add_by_strdesc(pcb_hid_cfg_keys_t *km, const char *keydesc, const lht_node_t *action_node, pcb_hid_cfg_keyseq_t **out_seq, int out_seq_len);
/* Allocate a new string and generate a human readable accel-text; mask determines
@@ -122,7 +122,7 @@ int hid_cfg_keys_add_by_strdesc(hid_cfg_keys_t *km, const char *keydesc, const l
specified for the same action; from LSB to MSB, at most 32 keys)
Caller needs to free the string; returns NULL on error.
*/
-char *hid_cfg_keys_gen_accel(hid_cfg_keys_t *km, const lht_node_t *keydescn, unsigned long mask, const char *sep);
+char *pcb_hid_cfg_keys_gen_accel(pcb_hid_cfg_keys_t *km, const lht_node_t *keydescn, unsigned long mask, const char *sep);
/* Process next input key stroke.
Seq and seq_len must not be NULL as they are the internal state of multi-key
@@ -134,11 +134,11 @@ char *hid_cfg_keys_gen_accel(hid_cfg_keys_t *km, const lht_node_t *keydescn, uns
+ a positive integer means the lookup succeeded and the return value
is the length of the resulting sequence.
*/
-int hid_cfg_keys_input(hid_cfg_keys_t *km, hid_cfg_mod_t mods, unsigned short int key_char, hid_cfg_keyseq_t **seq, int *seq_len);
+int pcb_hid_cfg_keys_input(pcb_hid_cfg_keys_t *km, pcb_hid_cfg_mod_t mods, unsigned short int key_char, pcb_hid_cfg_keyseq_t **seq, int *seq_len);
-/* Run the action for a key sequence looked up by hid_cfg_keys_input().
+/* Run the action for a key sequence looked up by pcb_hid_cfg_keys_input().
Returns: the result of the action or -1 on error */
-int hid_cfg_keys_action(hid_cfg_keyseq_t **seq, int seq_len);
+int pcb_hid_cfg_keys_action(pcb_hid_cfg_keyseq_t **seq, int seq_len);
#endif
diff --git a/src/hid_color.c b/src/hid_color.c
index 06d2897..19afe9d 100644
--- a/src/hid_color.c
+++ b/src/hid_color.c
@@ -1,15 +1,15 @@
+#include <string.h>
#include "config.h"
-#include "global.h"
#include "hid_color.h"
#include <genht/hash.h>
#include "compat_misc.h"
-static hidval invalid_color = { 0 };
+static pcb_hidval_t invalid_color = { 0 };
#define HT_HAS_CONST_KEY
typedef char *htsh_key_t;
typedef const char *htsh_const_key_t;
-typedef hidval htsh_value_t;
+typedef pcb_hidval_t htsh_value_t;
#define HT_INVALID_VALUE invalid_color
#define HT(x) htsh_ ## x
#include <genht/ht.h>
@@ -17,7 +17,7 @@ typedef hidval htsh_value_t;
#undef HT
-int hid_cache_color(int set, const char *name, hidval * val, void **vcache)
+int pcb_hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **vcache)
{
htsh_t *cache;
htsh_entry_t *e;
@@ -32,7 +32,7 @@ int hid_cache_color(int set, const char *name, hidval * val, void **vcache)
e = htsh_getentry(cache, (char *)name);
if (e == NULL) /* not found */
return 0;
- memcpy(val, &e->value, sizeof(hidval));
+ memcpy(val, &e->value, sizeof(pcb_hidval_t));
}
else
htsh_set(cache, pcb_strdup(name), *val); /* write */
diff --git a/src/hid_color.h b/src/hid_color.h
index 147c5b9..a5f0e0f 100644
--- a/src/hid_color.h
+++ b/src/hid_color.h
@@ -1,6 +1,8 @@
#ifndef PCB_HID_COLOR_H
#define PCB_HID_COLOR_H
+#include "hid.h"
+
/* HID internal interfaces. These may ONLY be called from the HID
modules, not from the common PCB code. */
@@ -8,6 +10,6 @@
and if found sets val and returns nonzero. If not found, it
returns zero. If set is nonzero, name/val is added to the
cache. */
-int hid_cache_color(int set, const char *name, hidval * val, void **cache);
+int pcb_hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **cache);
#endif
diff --git a/src/hid_draw_helpers.c b/src/hid_draw_helpers.c
index 8bd0e29..5a8da39 100644
--- a/src/hid_draw_helpers.c
+++ b/src/hid_draw_helpers.c
@@ -1,39 +1,44 @@
-#include "global.h"
+#include "config.h"
#include "hid.h"
#include "polygon.h"
+#include "macro.h"
-static void fill_contour(hidGC gc, PLINE * pl)
+#include "obj_pinvia.h"
+#include "obj_pad.h"
+#include "obj_poly.h"
+
+static void fill_contour(pcb_hid_gc_t gc, pcb_pline_t * pl)
{
- Coord *x, *y, n, i = 0;
- VNODE *v;
+ pcb_coord_t *x, *y, n, i = 0;
+ pcb_vnode_t *v;
n = pl->Count;
- x = (Coord *) malloc(n * sizeof(*x));
- y = (Coord *) malloc(n * sizeof(*y));
+ x = (pcb_coord_t *) malloc(n * sizeof(*x));
+ y = (pcb_coord_t *) malloc(n * sizeof(*y));
for (v = &pl->head; i < n; v = v->next) {
x[i] = v->point[0];
y[i++] = v->point[1];
}
- gui->fill_polygon(gc, n, x, y);
+ pcb_gui->fill_polygon(gc, n, x, y);
free(x);
free(y);
}
-static void thindraw_contour(hidGC gc, PLINE * pl)
+static void thindraw_contour(pcb_hid_gc_t gc, pcb_pline_t * pl)
{
- VNODE *v;
- Coord last_x, last_y;
- Coord this_x, this_y;
+ pcb_vnode_t *v;
+ pcb_coord_t last_x, last_y;
+ pcb_coord_t this_x, this_y;
- gui->set_line_width(gc, 0);
- gui->set_line_cap(gc, Round_Cap);
+ pcb_gui->set_line_width(gc, 0);
+ pcb_gui->set_line_cap(gc, Round_Cap);
/* If the contour is round, use an arc drawing routine. */
if (pl->is_round) {
- gui->draw_arc(gc, pl->cx, pl->cy, pl->radius, pl->radius, 0, 360);
+ pcb_gui->draw_arc(gc, pl->cx, pl->cy, pl->radius, pl->radius, 0, 360);
return;
}
@@ -49,8 +54,8 @@ static void thindraw_contour(hidGC gc, PLINE * pl)
this_x = v->point[0];
this_y = v->point[1];
- gui->draw_line(gc, last_x, last_y, this_x, this_y);
- /* gui->fill_circle (gc, this_x, this_y, 30); */
+ pcb_gui->draw_line(gc, last_x, last_y, this_x, this_y);
+ /* pcb_gui->fill_circle (gc, this_x, this_y, 30); */
last_x = this_x;
last_y = this_y;
@@ -58,30 +63,30 @@ static void thindraw_contour(hidGC gc, PLINE * pl)
while ((v = v->next) != pl->head.next);
}
-static void fill_contour_cb(PLINE * pl, void *user_data)
+static void fill_contour_cb(pcb_pline_t * pl, void *user_data)
{
- hidGC gc = (hidGC) user_data;
- PLINE *local_pl = pl;
+ pcb_hid_gc_t gc = (pcb_hid_gc_t) user_data;
+ pcb_pline_t *local_pl = pl;
fill_contour(gc, pl);
- poly_FreeContours(&local_pl);
+ pcb_poly_contours_free(&local_pl);
}
-static void fill_clipped_contour(hidGC gc, PLINE * pl, const BoxType * clip_box)
+static void fill_clipped_contour(pcb_hid_gc_t gc, pcb_pline_t * pl, const pcb_box_t * clip_box)
{
- PLINE *pl_copy;
- POLYAREA *clip_poly;
- POLYAREA *piece_poly;
- POLYAREA *clipped_pieces;
- POLYAREA *draw_piece;
+ pcb_pline_t *pl_copy;
+ pcb_polyarea_t *clip_poly;
+ pcb_polyarea_t *piece_poly;
+ pcb_polyarea_t *clipped_pieces;
+ pcb_polyarea_t *draw_piece;
int x;
- clip_poly = RectPoly(clip_box->X1, clip_box->X2, clip_box->Y1, clip_box->Y2);
- poly_CopyContour(&pl_copy, pl);
- piece_poly = poly_Create();
- poly_InclContour(piece_poly, pl_copy);
- x = poly_Boolean_free(piece_poly, clip_poly, &clipped_pieces, PBO_ISECT);
- if (x != err_ok || clipped_pieces == NULL)
+ clip_poly = pcb_poly_from_rect(clip_box->X1, clip_box->X2, clip_box->Y1, clip_box->Y2);
+ pcb_poly_contour_copy(&pl_copy, pl);
+ piece_poly = pcb_polyarea_create();
+ pcb_polyarea_contour_include(piece_poly, pl_copy);
+ x = pcb_polyarea_boolean_free(piece_poly, clip_poly, &clipped_pieces, PCB_PBO_ISECT);
+ if (x != pcb_err_ok || clipped_pieces == NULL)
return;
draw_piece = clipped_pieces;
@@ -90,16 +95,16 @@ static void fill_clipped_contour(hidGC gc, PLINE * pl, const BoxType * clip_box)
fill_contour(gc, draw_piece->contours);
}
while ((draw_piece = draw_piece->f) != clipped_pieces);
- poly_Free(&clipped_pieces);
+ pcb_polyarea_free(&clipped_pieces);
}
/* If at least 50% of the bounding box of the polygon is on the screen,
* lets compute the complete no-holes polygon.
*/
#define BOUNDS_INSIDE_CLIP_THRESHOLD 0.5
-static int should_compute_no_holes(PolygonType * poly, const BoxType * clip_box)
+static int should_compute_no_holes(pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
- Coord x1, x2, y1, y2;
+ pcb_coord_t x1, x2, y1, y2;
double poly_bounding_area;
double clipped_poly_area;
@@ -129,7 +134,7 @@ static int should_compute_no_holes(PolygonType * poly, const BoxType * clip_box)
#undef BOUNDS_INSIDE_CLIP_THRESHOLD
-void common_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box)
+void pcb_dhlp_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
if (!poly->NoHolesValid) {
/* If enough of the polygon is on-screen, compute the entire
@@ -137,12 +142,12 @@ void common_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_
* just compute what we need to render now.
*/
if (should_compute_no_holes(poly, clip_box))
- ComputeNoHoles(poly);
+ pcb_poly_compute_no_holes(poly);
else
- NoHolesPolygonDicer(poly, clip_box, fill_contour_cb, gc);
+ pcb_poly_no_holes_dicer(poly, clip_box, fill_contour_cb, gc);
}
if (poly->NoHolesValid && poly->NoHoles) {
- PLINE *pl;
+ pcb_pline_t *pl;
for (pl = poly->NoHoles; pl != NULL; pl = pl->next) {
if (clip_box == NULL)
@@ -154,48 +159,48 @@ void common_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_
/* Draw other parts of the polygon if fullpoly flag is set */
/* NB: No "NoHoles" cache for these */
- if (TEST_FLAG(PCB_FLAG_FULLPOLY, poly)) {
- PolygonType p = *poly;
+ if (PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, poly)) {
+ pcb_polygon_t p = *poly;
for (p.Clipped = poly->Clipped->f; p.Clipped != poly->Clipped; p.Clipped = p.Clipped->f)
- NoHolesPolygonDicer(&p, clip_box, fill_contour_cb, gc);
+ pcb_poly_no_holes_dicer(&p, clip_box, fill_contour_cb, gc);
}
}
-static int thindraw_hole_cb(PLINE * pl, void *user_data)
+static int thindraw_hole_cb(pcb_pline_t * pl, void *user_data)
{
- hidGC gc = (hidGC) user_data;
+ pcb_hid_gc_t gc = (pcb_hid_gc_t) user_data;
thindraw_contour(gc, pl);
return 0;
}
-void common_thindraw_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box)
+void pcb_dhlp_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
thindraw_contour(gc, poly->Clipped->contours);
- PolygonHoles(poly, clip_box, thindraw_hole_cb, gc);
+ pcb_poly_holes(poly, clip_box, thindraw_hole_cb, gc);
}
-void common_thindraw_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask)
+void pcb_dhlp_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask)
{
- Coord w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance)
+ pcb_coord_t w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance)
: pad->Thickness;
- Coord x1, y1, x2, y2;
- Coord t = w / 2;
+ pcb_coord_t x1, y1, x2, y2;
+ pcb_coord_t t = w / 2;
x1 = pad->Point1.X;
y1 = pad->Point1.Y;
x2 = pad->Point2.X;
y2 = pad->Point2.Y;
if (x1 > x2 || y1 > y2) {
- Coord temp_x = x1;
- Coord temp_y = y1;
+ pcb_coord_t temp_x = x1;
+ pcb_coord_t temp_y = y1;
x1 = x2;
x2 = temp_x;
y1 = y2;
y2 = temp_y;
}
- gui->set_line_cap(gc, Round_Cap);
- gui->set_line_width(gc, 0);
- if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) {
+ pcb_gui->set_line_cap(gc, Round_Cap);
+ pcb_gui->set_line_width(gc, 0);
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) {
/* slanted square pad */
double tx, ty, theta;
@@ -209,59 +214,59 @@ void common_thindraw_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool m
tx = t * cos(theta + M_PI / 4) * sqrt(2.0);
ty = t * sin(theta + M_PI / 4) * sqrt(2.0);
- gui->draw_line(gc, x1 - tx, y1 - ty, x2 + ty, y2 - tx);
- gui->draw_line(gc, x2 + ty, y2 - tx, x2 + tx, y2 + ty);
- gui->draw_line(gc, x2 + tx, y2 + ty, x1 - ty, y1 + tx);
- gui->draw_line(gc, x1 - ty, y1 + tx, x1 - tx, y1 - ty);
+ pcb_gui->draw_line(gc, x1 - tx, y1 - ty, x2 + ty, y2 - tx);
+ pcb_gui->draw_line(gc, x2 + ty, y2 - tx, x2 + tx, y2 + ty);
+ pcb_gui->draw_line(gc, x2 + tx, y2 + ty, x1 - ty, y1 + tx);
+ pcb_gui->draw_line(gc, x1 - ty, y1 + tx, x1 - tx, y1 - ty);
}
else if (x1 == x2 && y1 == y2) {
- gui->draw_arc(gc, x1, y1, t, t, 0, 360);
+ pcb_gui->draw_arc(gc, x1, y1, t, t, 0, 360);
}
else {
/* Slanted round-end pads. */
- Coord dx, dy, ox, oy;
+ pcb_coord_t dx, dy, ox, oy;
double h;
dx = x2 - x1;
dy = y2 - y1;
- h = t / sqrt(SQUARE(dx) + SQUARE(dy));
+ h = t / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy));
ox = dy * h + 0.5 * SGN(dy);
oy = -(dx * h + 0.5 * SGN(dx));
- gui->draw_line(gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy);
+ pcb_gui->draw_line(gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy);
- if (labs(ox) >= pixel_slop || coord_abs(oy) >= pixel_slop) {
- Angle angle = atan2(dx, dy) * 57.295779;
- gui->draw_line(gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy);
- gui->draw_arc(gc, x1, y1, t, t, angle - 180, 180);
- gui->draw_arc(gc, x2, y2, t, t, angle, 180);
+ if (labs(ox) >= pcb_pixel_slop || coord_abs(oy) >= pcb_pixel_slop) {
+ pcb_angle_t angle = atan2(dx, dy) * 57.295779;
+ pcb_gui->draw_line(gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy);
+ pcb_gui->draw_arc(gc, x1, y1, t, t, angle - 180, 180);
+ pcb_gui->draw_arc(gc, x2, y2, t, t, angle, 180);
}
}
}
-void common_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask)
+void pcb_dhlp_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask)
{
- Coord w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance)
+ pcb_coord_t w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance)
: pad->Thickness;
if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y) {
- if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) {
- Coord l, r, t, b;
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) {
+ pcb_coord_t l, r, t, b;
l = pad->Point1.X - w / 2;
b = pad->Point1.Y - w / 2;
r = l + w;
t = b + w;
- gui->fill_rect(gc, l, b, r, t);
+ pcb_gui->fill_rect(gc, l, b, r, t);
}
else {
- gui->fill_circle(gc, pad->Point1.X, pad->Point1.Y, w / 2);
+ pcb_gui->fill_circle(gc, pad->Point1.X, pad->Point1.Y, w / 2);
}
}
else {
- gui->set_line_cap(gc, TEST_FLAG(PCB_FLAG_SQUARE, pad) ? Square_Cap : Round_Cap);
- gui->set_line_width(gc, w);
+ pcb_gui->set_line_cap(gc, PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad) ? Square_Cap : Round_Cap);
+ pcb_gui->set_line_width(gc, w);
- gui->draw_line(gc, pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y);
+ pcb_gui->draw_line(gc, pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y);
}
}
@@ -283,7 +288,7 @@ typedef struct {
double X, Y;
} FloatPolyType;
-static void draw_square_pin_poly(hidGC gc, Coord X, Coord Y, Coord Thickness, Coord thin_draw, int style)
+static void draw_square_pin_poly(pcb_hid_gc_t gc, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t thin_draw, int style)
{
static FloatPolyType p[8] = {
{0.5, -PCB_TAN_22_5_DEGREE_2},
@@ -298,12 +303,12 @@ static void draw_square_pin_poly(hidGC gc, Coord X, Coord Y, Coord Thickness, Co
static int special_size = 0;
static int scaled_x[8];
static int scaled_y[8];
- Coord polygon_x[9];
- Coord polygon_y[9];
+ pcb_coord_t polygon_x[9];
+ pcb_coord_t polygon_y[9];
double xm[8], ym[8];
int i;
- square_pin_factors(style, xm, ym);
+ pcb_poly_square_pin_factors(style, xm, ym);
if (Thickness != special_size) {
special_size = Thickness;
@@ -320,117 +325,117 @@ static void draw_square_pin_poly(hidGC gc, Coord X, Coord Y, Coord Thickness, Co
if (thin_draw) {
int i;
- gui->set_line_cap(gc, Round_Cap);
- gui->set_line_width(gc, 0);
+ pcb_gui->set_line_cap(gc, Round_Cap);
+ pcb_gui->set_line_width(gc, 0);
polygon_x[8] = X + scaled_x[0] * xm[0];
polygon_y[8] = Y + scaled_y[0] * ym[0];
for (i = 0; i < 8; i++)
- gui->draw_line(gc, polygon_x[i], polygon_y[i], polygon_x[i + 1], polygon_y[i + 1]);
+ pcb_gui->draw_line(gc, polygon_x[i], polygon_y[i], polygon_x[i + 1], polygon_y[i + 1]);
}
else
- gui->fill_polygon(gc, 8, polygon_x, polygon_y);
+ pcb_gui->fill_polygon(gc, 8, polygon_x, polygon_y);
}
-static void draw_octagon_poly(hidGC gc, Coord X, Coord Y, Coord Thickness, Coord thin_draw)
+static void draw_octagon_poly(pcb_hid_gc_t gc, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t thin_draw)
{
draw_square_pin_poly(gc, X, Y, Thickness, thin_draw, 17);
}
-void common_fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType * pv, pcb_bool drawHole, pcb_bool mask)
+void pcb_dhlp_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask)
{
- Coord w = mask ? pv->Mask : pv->Thickness;
- Coord r = w / 2;
+ pcb_coord_t w = mask ? pv->Mask : pv->Thickness;
+ pcb_coord_t r = w / 2;
- if (TEST_FLAG(PCB_FLAG_HOLE, pv)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
if (mask)
- gui->fill_circle(bg_gc, pv->X, pv->Y, r);
+ pcb_gui->fill_circle(bg_gc, pv->X, pv->Y, r);
if (drawHole) {
- gui->fill_circle(bg_gc, pv->X, pv->Y, r);
- gui->set_line_cap(fg_gc, Round_Cap);
- gui->set_line_width(fg_gc, 0);
- gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360);
+ pcb_gui->fill_circle(bg_gc, pv->X, pv->Y, r);
+ pcb_gui->set_line_cap(fg_gc, Round_Cap);
+ pcb_gui->set_line_width(fg_gc, 0);
+ pcb_gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360);
}
return;
}
- if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pv)) {
/* use the original code for now */
- if ((GET_SQUARE(pv) == 0) || (GET_SQUARE(pv) == 1)) {
- Coord l = pv->X - r;
- Coord b = pv->Y - r;
- Coord r = l + w;
- Coord t = b + w;
- gui->fill_rect(fg_gc, l, b, r, t);
+ if ((PCB_FLAG_SQUARE_GET(pv) == 0) || (PCB_FLAG_SQUARE_GET(pv) == 1)) {
+ pcb_coord_t l = pv->X - r;
+ pcb_coord_t b = pv->Y - r;
+ pcb_coord_t r = l + w;
+ pcb_coord_t t = b + w;
+ pcb_gui->fill_rect(fg_gc, l, b, r, t);
}
else
- draw_square_pin_poly(fg_gc, pv->X, pv->Y, w, pcb_false, GET_SQUARE(pv));
+ draw_square_pin_poly(fg_gc, pv->X, pv->Y, w, pcb_false, PCB_FLAG_SQUARE_GET(pv));
}
- else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv))
+ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv))
draw_octagon_poly(fg_gc, pv->X, pv->Y, w, pcb_false);
else /* draw a round pin or via */
- gui->fill_circle(fg_gc, pv->X, pv->Y, r);
+ pcb_gui->fill_circle(fg_gc, pv->X, pv->Y, r);
/* and the drilling hole (which is always round) */
if (drawHole)
- gui->fill_circle(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2);
+ pcb_gui->fill_circle(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2);
}
-void common_thindraw_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType * pv, pcb_bool drawHole, pcb_bool mask)
+void pcb_dhlp_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask)
{
- Coord w = mask ? pv->Mask : pv->Thickness;
- Coord r = w / 2;
+ pcb_coord_t w = mask ? pv->Mask : pv->Thickness;
+ pcb_coord_t r = w / 2;
- if (TEST_FLAG(PCB_FLAG_HOLE, pv)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
if (mask)
- gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360);
+ pcb_gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360);
if (drawHole) {
r = pv->DrillingHole / 2;
- gui->set_line_cap(bg_gc, Round_Cap);
- gui->set_line_width(bg_gc, 0);
- gui->draw_arc(bg_gc, pv->X, pv->Y, r, r, 0, 360);
+ pcb_gui->set_line_cap(bg_gc, Round_Cap);
+ pcb_gui->set_line_width(bg_gc, 0);
+ pcb_gui->draw_arc(bg_gc, pv->X, pv->Y, r, r, 0, 360);
}
return;
}
- if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) {
- Coord l = pv->X - r;
- Coord b = pv->Y - r;
- Coord r = l + w;
- Coord t = b + w;
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pv)) {
+ pcb_coord_t l = pv->X - r;
+ pcb_coord_t b = pv->Y - r;
+ pcb_coord_t r = l + w;
+ pcb_coord_t t = b + w;
- gui->set_line_cap(fg_gc, Round_Cap);
- gui->set_line_width(fg_gc, 0);
- gui->draw_line(fg_gc, r, t, r, b);
- gui->draw_line(fg_gc, l, t, l, b);
- gui->draw_line(fg_gc, r, t, l, t);
- gui->draw_line(fg_gc, r, b, l, b);
+ pcb_gui->set_line_cap(fg_gc, Round_Cap);
+ pcb_gui->set_line_width(fg_gc, 0);
+ pcb_gui->draw_line(fg_gc, r, t, r, b);
+ pcb_gui->draw_line(fg_gc, l, t, l, b);
+ pcb_gui->draw_line(fg_gc, r, t, l, t);
+ pcb_gui->draw_line(fg_gc, r, b, l, b);
}
- else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv)) {
+ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv)) {
draw_octagon_poly(fg_gc, pv->X, pv->Y, w, pcb_true);
}
else { /* draw a round pin or via */
- gui->set_line_cap(fg_gc, Round_Cap);
- gui->set_line_width(fg_gc, 0);
- gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360);
+ pcb_gui->set_line_cap(fg_gc, Round_Cap);
+ pcb_gui->set_line_width(fg_gc, 0);
+ pcb_gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360);
}
/* and the drilling hole (which is always round */
if (drawHole) {
- gui->set_line_cap(bg_gc, Round_Cap);
- gui->set_line_width(bg_gc, 0);
- gui->draw_arc(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360);
+ pcb_gui->set_line_cap(bg_gc, Round_Cap);
+ pcb_gui->set_line_width(bg_gc, 0);
+ pcb_gui->draw_arc(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360);
}
}
-void common_draw_helpers_init(HID * hid)
+void pcb_dhlp_draw_helpers_init(pcb_hid_t * hid)
{
- hid->fill_pcb_polygon = common_fill_pcb_polygon;
- hid->thindraw_pcb_polygon = common_thindraw_pcb_polygon;
- hid->fill_pcb_pad = common_fill_pcb_pad;
- hid->thindraw_pcb_pad = common_thindraw_pcb_pad;
- hid->fill_pcb_pv = common_fill_pcb_pv;
- hid->thindraw_pcb_pv = common_thindraw_pcb_pv;
+ hid->fill_pcb_polygon = pcb_dhlp_fill_pcb_polygon;
+ hid->thindraw_pcb_polygon = pcb_dhlp_thindraw_pcb_polygon;
+ hid->fill_pcb_pad = pcb_dhlp_fill_pcb_pad;
+ hid->thindraw_pcb_pad = pcb_dhlp_thindraw_pcb_pad;
+ hid->fill_pcb_pv = pcb_dhlp_fill_pcb_pv;
+ hid->thindraw_pcb_pv = pcb_dhlp_thindraw_pcb_pv;
}
diff --git a/src/hid_draw_helpers.h b/src/hid_draw_helpers.h
index d9b5a48..cf9a58c 100644
--- a/src/hid_draw_helpers.h
+++ b/src/hid_draw_helpers.h
@@ -1,10 +1,10 @@
#ifndef PCB_HID_DRAW_HELPERS_H
#define PCB_HID_DRAW_HELPERS_H
-void common_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box);
-void common_thindraw_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box);
-void common_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask);
-void common_thindraw_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask);
-void common_fill_pcb_pv(hidGC gc, PinType * pv, pcb_bool drawHole, pcb_bool mask);
-void common_thindraw_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType * pv, pcb_bool drawHole, pcb_bool mask);
-void common_draw_helpers_init(HID * hid);
+void pcb_dhlp_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box);
+void pcb_dhlp_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box);
+void pcb_dhlp_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask);
+void pcb_dhlp_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask);
+void pcb_dhlp_fill_pcb_pv(pcb_hid_gc_t gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask);
+void pcb_dhlp_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask);
+void pcb_dhlp_draw_helpers_init(pcb_hid_t * hid);
#endif
diff --git a/src/hid_extents.c b/src/hid_extents.c
index 14f55a9..148a628 100644
--- a/src/hid_extents.c
+++ b/src/hid_extents.c
@@ -1,59 +1,38 @@
#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "global.h"
+#include "board.h"
#include "data.h"
-#include "layer.h"
-
-#include "hid.h"
#include "hid_draw_helpers.h"
-#include "hid_helper.h"
-
-#ifndef MAXINT
-#define MAXINT (((unsigned int)(~0))>>1)
-#endif
+#include "hid_extents.h"
-static BoxType box;
+static pcb_box_t box;
-typedef struct hid_gc_struct {
+typedef struct hid_gc_s {
int width;
-} hid_gc_struct;
+} hid_gc_s;
-static int extents_set_layer(const char *name, int group, int empty)
+static int extents_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- int idx = group;
- if (idx >= 0 && idx < max_group) {
- idx = PCB->LayerGroups.Entries[idx][0];
- }
- if (idx >= 0 && idx < max_copper_layer + 2)
- return 1;
- if (idx < 0) {
- switch (SL_TYPE(idx)) {
- case SL_INVISIBLE:
- case SL_MASK:
- case SL_ASSY:
- return 0;
- case SL_SILK:
- case SL_PDRILL:
- case SL_UDRILL:
+ switch (flags & PCB_LYT_ANYTHING) {
+ case PCB_LYT_COPPER:
+ case PCB_LYT_OUTLINE:
+ case PCB_LYT_SILK:
+ case PCB_LYT_PDRILL:
+ case PCB_LYT_UDRILL:
return 1;
- }
+ default:
+ return 0;
}
return 0;
}
-static hidGC extents_make_gc(void)
+static pcb_hid_gc_t extents_make_gc(void)
{
- hidGC rv = (hidGC) malloc(sizeof(hid_gc_struct));
- memset(rv, 0, sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) malloc(sizeof(hid_gc_s));
+ memset(rv, 0, sizeof(hid_gc_s));
return rv;
}
-static void extents_destroy_gc(hidGC gc)
+static void extents_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -62,20 +41,20 @@ static void extents_use_mask(int use_it)
{
}
-static void extents_set_color(hidGC gc, const char *name)
+static void extents_set_color(pcb_hid_gc_t gc, const char *name)
{
}
-static void extents_set_line_cap(hidGC gc, EndCapStyle style)
+static void extents_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
}
-static void extents_set_line_width(hidGC gc, Coord width)
+static void extents_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void extents_set_draw_xor(hidGC gc, int xor_)
+static void extents_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
}
@@ -84,7 +63,7 @@ static void extents_set_draw_xor(hidGC gc, int xor_)
#define PEY(y,w) if (box.Y1 > (y)-(w)) box.Y1 = (y)-(w); \
if (box.Y2 < (y)+(w)) box.Y2 = (y)+(w)
-static void extents_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void extents_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
PEX(x1, gc->width);
PEY(y1, gc->width);
@@ -92,14 +71,14 @@ static void extents_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
PEY(y2, gc->width);
}
-static void extents_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle end_angle)
+static void extents_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle)
{
/* Naive but good enough. */
PEX(cx, width + gc->width);
PEY(cy, height + gc->width);
}
-static void extents_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void extents_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
PEX(x1, gc->width);
PEY(y1, gc->width);
@@ -107,13 +86,13 @@ static void extents_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
PEY(y2, gc->width);
}
-static void extents_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void extents_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
PEX(cx, radius);
PEY(cy, radius);
}
-static void extents_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void extents_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
for (i = 0; i < n_coords; i++) {
@@ -122,7 +101,7 @@ static void extents_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
}
}
-static void extents_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void extents_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
PEX(x1, 0);
PEY(y1, 0);
@@ -130,7 +109,7 @@ static void extents_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
PEY(y2, 0);
}
-static HID extents_hid;
+static pcb_hid_t extents_hid;
void hid_extents_init(void)
{
@@ -139,16 +118,16 @@ void hid_extents_init(void)
if (initialised)
return;
- memset(&extents_hid, 0, sizeof(HID));
+ memset(&extents_hid, 0, sizeof(pcb_hid_t));
- common_draw_helpers_init(&extents_hid);
+ pcb_dhlp_draw_helpers_init(&extents_hid);
- extents_hid.struct_size = sizeof(HID);
+ extents_hid.struct_size = sizeof(pcb_hid_t);
extents_hid.name = "extents-extents";
extents_hid.description = "used to calculate extents";
extents_hid.poly_before = 1;
- extents_hid.set_layer = extents_set_layer;
+ extents_hid.set_layer_group = extents_set_layer_group;
extents_hid.make_gc = extents_make_gc;
extents_hid.destroy_gc = extents_destroy_gc;
extents_hid.use_mask = extents_use_mask;
@@ -166,23 +145,23 @@ void hid_extents_init(void)
initialised = pcb_true;
}
-BoxType *hid_get_extents(void *item)
+pcb_box_t *pcb_hid_get_extents(void *item)
{
- BoxType region;
+ pcb_box_t region;
/* As this isn't a real "HID", we need to ensure we are initialised. */
hid_extents_init();
- box.X1 = MAXINT;
- box.Y1 = MAXINT;
- box.X2 = -MAXINT;
- box.Y2 = -MAXINT;
+ box.X1 = COORD_MAX;
+ box.Y1 = COORD_MAX;
+ box.X2 = -COORD_MAX;
+ box.Y2 = -COORD_MAX;
- region.X1 = -MAXINT;
- region.Y1 = -MAXINT;
- region.X2 = MAXINT;
- region.Y2 = MAXINT;
- hid_expose_callback(&extents_hid, ®ion, item);
+ region.X1 = -COORD_MAX;
+ region.Y1 = -COORD_MAX;
+ region.X2 = COORD_MAX;
+ region.Y2 = COORD_MAX;
+ pcb_hid_expose_callback(&extents_hid, ®ion, item);
return &box;
}
diff --git a/src/hid_extents.h b/src/hid_extents.h
index 51acdf1..6f5eabd 100644
--- a/src/hid_extents.h
+++ b/src/hid_extents.h
@@ -6,7 +6,7 @@
/* Convenience function that calls the expose callback for the item,
and returns the extents of what was drawn. */
-BoxType *hid_get_extents(void *item);
+pcb_box_t *pcb_hid_get_extents(void *item);
#endif
diff --git a/src/hid_flags.c b/src/hid_flags.c
index bf09b42..7734166 100644
--- a/src/hid_flags.c
+++ b/src/hid_flags.c
@@ -1,21 +1,15 @@
#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "data.h"
-#include "misc.h"
+#include "board.h"
#include "conf.h"
-#include "hid.h"
#include "hid_flags.h"
#include "genht/hash.h"
#include "genht/htsp.h"
#include "error.h"
#include "hid_actions.h"
-int hid_get_flag(const char *name)
+int pcb_hid_get_flag(const char *name)
{
const char *cp;
@@ -35,19 +29,19 @@ int hid_get_flag(const char *name)
const char *end, *s;
const char *argv[2];
if (cp != NULL) {
- const HID_Action *a;
+ const pcb_hid_action_t *a;
char buff[256];
int len, multiarg;
len = cp - name;
if (len > sizeof(buff)-1) {
- Message(PCB_MSG_DEFAULT, "hid_get_flag: action name too long: %s()\n", name);
+ pcb_message(PCB_MSG_ERROR, "hid_get_flag: action name too long: %s()\n", name);
return -1;
}
memcpy(buff, name, len);
buff[len] = '\0';
- a = hid_find_action(buff);
+ a = pcb_hid_find_action(buff);
if (!a) {
- Message(PCB_MSG_DEFAULT, "hid_get_flag: no action %s\n", name);
+ pcb_message(PCB_MSG_ERROR, "hid_get_flag: no action %s\n", name);
return -1;
}
cp++;
@@ -65,7 +59,7 @@ int hid_get_flag(const char *name)
if (!multiarg) {
/* faster but limited way for a single arg */
if ((len > sizeof(buff)-1) || (end == NULL)) {
- Message(PCB_MSG_DEFAULT, "hid_get_flag: action arg too long or unterminated: %s\n", name);
+ pcb_message(PCB_MSG_ERROR, "hid_get_flag: action arg too long or unterminated: %s\n", name);
return -1;
}
len = end - cp;
@@ -73,32 +67,32 @@ int hid_get_flag(const char *name)
buff[len] = '\0';
argv[0] = buff;
argv[1] = NULL;
- return hid_actionv_(a, len > 0, argv);
+ return pcb_hid_actionv_(a, len > 0, argv);
}
else {
/* slower but more generic way */
- return hid_parse_command(name);
+ return pcb_hid_parse_command(name);
}
}
else {
- fprintf(stderr, "ERROR: hid_get_flag(%s) - not a path or an action\n", name);
+ fprintf(stderr, "ERROR: pcb_hid_get_flag(%s) - not a path or an action\n", name);
}
}
return -1;
}
-void hid_save_and_show_layer_ons(int *save_array)
+void pcb_hid_save_and_show_layer_ons(int *save_array)
{
int i;
- for (i = 0; i < max_copper_layer + 2; i++) {
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
save_array[i] = PCB->Data->Layer[i].On;
PCB->Data->Layer[i].On = 1;
}
}
-void hid_restore_layer_ons(int *save_array)
+void pcb_hid_restore_layer_ons(int *save_array)
{
int i;
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
PCB->Data->Layer[i].On = save_array[i];
}
diff --git a/src/hid_flags.h b/src/hid_flags.h
index e6b288f..9f0fcef 100644
--- a/src/hid_flags.h
+++ b/src/hid_flags.h
@@ -3,16 +3,16 @@
/* Use this to temporarily enable all layers, so that they can be
exported even if they're not currently visible. save_array must be
- MAX_LAYER+2 big. */
-void hid_save_and_show_layer_ons(int *save_array);
+ PCB_MAX_LAYER+2 big. */
+void pcb_hid_save_and_show_layer_ons(int *save_array);
/* Use this to restore them. */
-void hid_restore_layer_ons(int *save_array);
+void pcb_hid_restore_layer_ons(int *save_array);
/* Looks up an integer (usually boolean) value by conf path or by running
an action (if name has a parenthesis). When an action is run, it has 0
or 1 argument only and the return value of the action is returned.
On error, returns -1. */
-int hid_get_flag(const char *name);
+int pcb_hid_get_flag(const char *name);
#endif
diff --git a/src/hid_helper.c b/src/hid_helper.c
index ea69c76..22029d2 100644
--- a/src/hid_helper.c
+++ b/src/hid_helper.c
@@ -26,74 +26,64 @@
*/
#include "config.h"
+#include "board.h"
#include "data.h"
-#include "misc.h"
-#include "layer.h"
#include "hid_helper.h"
#include "hid_attrib.h"
+#include "hid_helper.h"
#include "compat_misc.h"
-const char *layer_type_to_file_name(int idx, int style)
+char *pcb_layer_to_file_name(char *dest, pcb_layer_id_t lid, unsigned int flags, pcb_file_name_style_t style)
{
- int group;
+ const pcb_virt_layer_t *v;
+ pcb_layergrp_id_t group;
int nlayers;
- const char *single_name;
+ const char *single_name, *res = NULL;
+
+ if (flags == 0)
+ flags = pcb_layer_flags(lid);
+
+ if (flags & PCB_LYT_OUTLINE) {
+ strcpy(dest, "outline");
+ return dest;
+ }
- switch (idx) {
- case SL(SILK, TOP):
- return "topsilk";
- case SL(SILK, BOTTOM):
- return "bottomsilk";
- case SL(MASK, TOP):
- return "topmask";
- case SL(MASK, BOTTOM):
- return "bottommask";
- case SL(PDRILL, 0):
- return "plated-drill";
- case SL(UDRILL, 0):
- return "unplated-drill";
- case SL(PASTE, TOP):
- return "toppaste";
- case SL(PASTE, BOTTOM):
- return "bottompaste";
- case SL(INVISIBLE, 0):
- return "invisible";
- case SL(FAB, 0):
- return "fab";
- case SL(ASSY, TOP):
- return "topassembly";
- case SL(ASSY, BOTTOM):
- return "bottomassembly";
- default:
- group = GetLayerGroupNumberByNumber(idx);
- nlayers = PCB->LayerGroups.Number[group];
- single_name = PCB->Data->Layer[idx].Name;
- if (group == GetLayerGroupNumberByNumber(component_silk_layer)) {
- if (style == FNS_first || (style == FNS_single && nlayers == 2))
- return single_name;
- return "top";
- }
- else if (group == GetLayerGroupNumberByNumber(solder_silk_layer)) {
- if (style == FNS_first || (style == FNS_single && nlayers == 2))
- return single_name;
- return "bottom";
- }
- else if (nlayers == 1
- && (strcmp(PCB->Data->Layer[idx].Name, "route") == 0 || strcmp(PCB->Data->Layer[idx].Name, "outline") == 0)) {
- return "outline";
- }
- else {
- static char buf[20];
- if (style == FNS_first || (style == FNS_single && nlayers == 1))
- return single_name;
- sprintf(buf, "group%d", group);
- return buf;
- }
- break;
+ v = pcb_vlayer_get_first(flags);
+ if (v != NULL) {
+ strcpy(dest, v->name);
+ return dest;
}
+
+
+ group = pcb_layer_get_group(lid);
+ nlayers = PCB->LayerGroups.Number[group];
+ single_name = pcb_layer_name(lid);
+
+ if (flags & PCB_LYT_TOP) {
+ if (style == PCB_FNS_first || (style == PCB_FNS_single && nlayers == 2))
+ res = single_name;
+ res = "top";
+ }
+ else if (flags & PCB_LYT_BOTTOM) {
+ if (style == PCB_FNS_first || (style == PCB_FNS_single && nlayers == 2))
+ res = single_name;
+ res = "bottom";
+ }
+ else {
+ static char buf[20];
+ if (style == PCB_FNS_first || (style == PCB_FNS_single && nlayers == 1))
+ res = single_name;
+ sprintf(buf, "group%ld", group);
+ res = buf;
+ }
+
+ assert(res != NULL);
+ strcpy(dest, res);
+ return dest;
}
-void derive_default_filename(const char *pcbfile, HID_Attribute * filename_attrib, const char *suffix, char **memory)
+
+void pcb_derive_default_filename(const char *pcbfile, pcb_hid_attribute_t * filename_attrib, const char *suffix, char **memory)
{
char *buf;
char *pf;
diff --git a/src/hid_helper.h b/src/hid_helper.h
index 45e7e79..a753c82 100644
--- a/src/hid_helper.h
+++ b/src/hid_helper.h
@@ -1,19 +1,22 @@
#ifndef PCB_HID_HELPER_H
#define PCB_HID_HELPER_H
-enum File_Name_Style {
+typedef enum pcb_file_name_style_e {
/* Files for copper layers are named top, groupN, bottom. */
- FNS_fixed,
+ PCB_FNS_fixed,
/* Groups with multiple layers are named as above, else the single
layer name is used. */
- FNS_single,
+ PCB_FNS_single,
/* The name of the first layer in each group is used. */
- FNS_first
-};
+ PCB_FNS_first
+} pcb_file_name_style_t;
/* Returns a filename base that can be used to output the layer. */
-const char *layer_type_to_file_name(int idx, int style);
+char *pcb_layer_to_file_name(char *dest, pcb_layer_id_t lid, unsigned int flags, pcb_file_name_style_t style);
-void derive_default_filename(const char *pcbfile, HID_Attribute * filename_attrib, const char *suffix, char **memory);
+/* Returns a filename base that can be used to output the layer; if flags is 0,
+ look it up. Copies result in dest (which should be at least TODO bytes wide).
+ Returns dest. */
+void pcb_derive_default_filename(const char *pcbfile, pcb_hid_attribute_t * filename_attrib, const char *suffix, char **memory);
#endif
diff --git a/src/hid_init.c b/src/hid_init.c
index 7747dd7..efe5e1c 100644
--- a/src/hid_init.c
+++ b/src/hid_init.c
@@ -1,10 +1,5 @@
#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "global.h"
#include "hid.h"
#include "hid_nogui.h"
@@ -13,37 +8,67 @@
includes. */
#include "compat_dl.h"
-#include "global.h"
-#include "misc.h"
#include "plugins.h"
#include "hid_attrib.h"
-#include "hid_flags.h"
+#include "hid_init.h"
#include "misc_util.h"
#include "conf_core.h"
#include "compat_misc.h"
#include "compat_inc.h"
#include "fptr_cast.h"
-HID **hid_list = 0;
-int hid_num_hids = 0;
+pcb_hid_t **pcb_hid_list = 0;
+int pcb_hid_num_hids = 0;
+
+pcb_hid_t *pcb_gui = NULL;
+pcb_hid_t *pcb_next_gui = NULL;
+pcb_hid_t *pcb_exporter = NULL;
-HID *gui = NULL;
-HID *next_gui = NULL;
-HID *exporter = NULL;
+int pcb_pixel_slop = 1;
-int pixel_slop = 1;
+pcb_plugin_dir_t *pcb_plugin_dir_first = NULL, *pcb_plugin_dir_last = NULL;
+
+void hid_append_dir(char *dirname, int count)
+{
+ pcb_plugin_dir_t *pd;
+ pd = malloc(sizeof(pcb_plugin_dir_t));
+ pd->path = dirname;
+ pd->num_plugins = count;
+ pd->next = NULL;
+ if (pcb_plugin_dir_first == NULL)
+ pcb_plugin_dir_first = pd;
+ if (pcb_plugin_dir_last != NULL)
+ pcb_plugin_dir_last->next = pd;
+ pcb_plugin_dir_last = pd;
+}
+
+static unsigned int plugin_hash(const char *fn)
+{
+ unsigned int h = 0;
+ FILE *f = fopen(fn, "r");
+ if (f != NULL) {
+ char buff[256];
+ int len = fread(buff, 1, sizeof(buff), f);
+ h ^= jenhash(buff, len);
+ fclose(f);
+ }
+ return h;
+}
-static void hid_load_dir(char *dirname)
+/* dirname must be strdup()'d on the caller's side! */
+static int hid_load_dir(char *dirname)
{
DIR *dir;
struct dirent *de;
+ int count = 0;
dir = opendir(dirname);
if (!dir) {
- free(dirname);
- return;
+ hid_append_dir(dirname, 0);
+ return 0;
}
while ((de = readdir(dir)) != NULL) {
+ unsigned int phash;
void *sym;
pcb_uninit_t (*symv) ();
pcb_uninit_t uninit;
@@ -52,11 +77,11 @@ static void hid_load_dir(char *dirname)
struct stat st;
basename = pcb_strdup(de->d_name);
- if (strlen(basename) > 3 && strcasecmp(basename + strlen(basename) - 3, ".so") == 0)
+ if (strlen(basename) > 3 && pcb_strcasecmp(basename + strlen(basename) - 3, ".so") == 0)
basename[strlen(basename) - 3] = 0;
- else if (strlen(basename) > 4 && strcasecmp(basename + strlen(basename) - 4, ".dll") == 0)
+ else if (strlen(basename) > 4 && pcb_strcasecmp(basename + strlen(basename) - 4, ".dll") == 0)
basename[strlen(basename) - 4] = 0;
- path = Concat(dirname, PCB_DIR_SEPARATOR_S, de->d_name, NULL);
+ path = pcb_concat(dirname, PCB_DIR_SEPARATOR_S, de->d_name, NULL);
if (stat(path, &st) == 0 && (
/* mingw and win32 do not support S_IXGRP or S_IXOTH */
@@ -72,9 +97,10 @@ static void hid_load_dir(char *dirname)
fprintf(stderr, "dl_error: %s\n", dlerror());
}
else {
- plugin_info_t *inf = plugin_find(basename);
+ pcb_plugin_info_t *inf = plugin_find(basename);
+ phash = plugin_hash(path);
if (inf == NULL) {
- symname = Concat("hid_", basename, "_init", NULL);
+ symname = pcb_concat("hid_", basename, "_init", NULL);
if ((sym = dlsym(so, symname)) != NULL) {
symv = (pcb_uninit_t (*)())pcb_cast_d2f(sym);
uninit = symv();
@@ -85,144 +111,161 @@ static void hid_load_dir(char *dirname)
}
else
uninit = NULL;
- plugin_register(basename, path, so, 1, uninit);
+ inf = pcb_plugin_register(basename, path, so, 1, uninit);
+ inf->hash = phash;
+ count++;
free(symname);
}
- else
- Message(PCB_MSG_ERROR, "Can't load %s because it'd provide plugin %s that is already loaded from %s\n", path, basename, (*inf->path == '<' ? "<buildin>" : inf->path));
+ else if (phash != inf->hash) /* warn only if this is not the very same file in yet-another-copy */
+ pcb_message(PCB_MSG_ERROR, "Can't load %s because it'd provide plugin %s that is already loaded from %s\n", path, basename, (*inf->path == '<' ? "<buildin>" : inf->path));
}
}
free(basename);
free(path);
}
- free(dirname);
closedir(dir);
+ hid_append_dir(dirname, count);
+ return count;
}
-void hid_init()
+void pcb_hid_init()
{
- hid_actions_init();
+ int found;
+ pcb_hid_actions_init();
/* Setup a "nogui" default HID */
- gui = hid_nogui_get_hid();
+ pcb_gui = pcb_hid_nogui_get_hid();
#warning TODO: make this configurable
- hid_load_dir(Concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib",
+ found = hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib",
PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL));
- hid_load_dir(Concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib",
+ found += hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib",
PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", NULL));
+ /* hardwired libdir, just in case exec-prefix goes wrong (e.g. linstall) */
+ hid_load_dir(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL));
+ hid_load_dir(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S, "plugins", NULL));
+
/* conf_core.rc.path.home is set by the conf_core immediately on startup */
if (conf_core.rc.path.home != NULL) {
- hid_load_dir(Concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL));
- hid_load_dir(Concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", NULL));
+ hid_load_dir(pcb_concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL));
+ hid_load_dir(pcb_concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", NULL));
}
- hid_load_dir(Concat("plugins", PCB_DIR_SEPARATOR_S, HOST, NULL));
- hid_load_dir(Concat("plugins", NULL));
+ hid_load_dir(pcb_concat("plugins", PCB_DIR_SEPARATOR_S, HOST, NULL));
+ hid_load_dir(pcb_concat("plugins", NULL));
}
-void hid_uninit(void)
+void pcb_hid_uninit(void)
{
- if (hid_num_hids > 0) {
+ pcb_plugin_dir_t *pd, *next;
+
+ if (pcb_hid_num_hids > 0) {
int i;
- for (i = hid_num_hids-1; i >= 0; i--) {
- if (hid_list[i]->uninit != NULL)
- hid_list[i]->uninit(hid_list[i]);
+ for (i = pcb_hid_num_hids-1; i >= 0; i--) {
+ if (pcb_hid_list[i]->uninit != NULL)
+ pcb_hid_list[i]->uninit(pcb_hid_list[i]);
}
}
- free(hid_list);
+ free(pcb_hid_list);
+
+ pcb_hid_actions_uninit();
+ pcb_hid_attributes_uninit();
- hid_actions_uninit();
- hid_attributes_uninit();
+ for(pd = pcb_plugin_dir_first; pd != NULL; pd = next) {
+ next = pd->next;
+ free(pd->path);
+ free(pd);
+ }
+ pcb_plugin_dir_first = pcb_plugin_dir_last = NULL;
}
-void hid_register_hid(HID * hid)
+void pcb_hid_register_hid(pcb_hid_t * hid)
{
int i;
- int sz = (hid_num_hids + 2) * sizeof(HID *);
+ int sz = (pcb_hid_num_hids + 2) * sizeof(pcb_hid_t *);
- if (hid->struct_size != sizeof(HID)) {
+ if (hid->struct_size != sizeof(pcb_hid_t)) {
fprintf(stderr, "Warning: hid \"%s\" has an incompatible ABI.\n", hid->name);
return;
}
- for (i = 0; i < hid_num_hids; i++)
- if (hid == hid_list[i])
+ for (i = 0; i < pcb_hid_num_hids; i++)
+ if (hid == pcb_hid_list[i])
return;
- hid_num_hids++;
- if (hid_list)
- hid_list = (HID **) realloc(hid_list, sz);
+ pcb_hid_num_hids++;
+ if (pcb_hid_list)
+ pcb_hid_list = (pcb_hid_t **) realloc(pcb_hid_list, sz);
else
- hid_list = (HID **) malloc(sz);
+ pcb_hid_list = (pcb_hid_t **) malloc(sz);
- hid_list[hid_num_hids - 1] = hid;
- hid_list[hid_num_hids] = 0;
+ pcb_hid_list[pcb_hid_num_hids - 1] = hid;
+ pcb_hid_list[pcb_hid_num_hids] = 0;
}
-void hid_remove_hid(HID * hid)
+void pcb_hid_remove_hid(pcb_hid_t * hid)
{
int i;
- for (i = 0; i < hid_num_hids; i++) {
- if (hid == hid_list[i]) {
- hid_list[i] = hid_list[hid_num_hids - 1];
- hid_list[hid_num_hids - 1] = 0;
- hid_num_hids--;
+ for (i = 0; i < pcb_hid_num_hids; i++) {
+ if (hid == pcb_hid_list[i]) {
+ pcb_hid_list[i] = pcb_hid_list[pcb_hid_num_hids - 1];
+ pcb_hid_list[pcb_hid_num_hids - 1] = 0;
+ pcb_hid_num_hids--;
return;
}
}
}
-HID *hid_find_gui(const char *preference)
+pcb_hid_t *pcb_hid_find_gui(const char *preference)
{
int i;
if (preference != NULL) {
- for (i = 0; i < hid_num_hids; i++)
- if (!hid_list[i]->printer && !hid_list[i]->exporter && !strcmp(hid_list[i]->name, preference))
- return hid_list[i];
+ for (i = 0; i < pcb_hid_num_hids; i++)
+ if (!pcb_hid_list[i]->printer && !pcb_hid_list[i]->exporter && !strcmp(pcb_hid_list[i]->name, preference))
+ return pcb_hid_list[i];
return NULL;
}
- for (i = 0; i < hid_num_hids; i++)
- if (!hid_list[i]->printer && !hid_list[i]->exporter)
- return hid_list[i];
+ for (i = 0; i < pcb_hid_num_hids; i++)
+ if (!pcb_hid_list[i]->printer && !pcb_hid_list[i]->exporter)
+ return pcb_hid_list[i];
fprintf(stderr, "Error: No GUI available.\n");
exit(1);
}
-HID *hid_find_printer()
+pcb_hid_t *pcb_hid_find_printer()
{
int i;
- for (i = 0; i < hid_num_hids; i++)
- if (hid_list[i]->printer)
- return hid_list[i];
+ for (i = 0; i < pcb_hid_num_hids; i++)
+ if (pcb_hid_list[i]->printer)
+ return pcb_hid_list[i];
return 0;
}
-HID *hid_find_exporter(const char *which)
+pcb_hid_t *pcb_hid_find_exporter(const char *which)
{
int i;
- for (i = 0; i < hid_num_hids; i++)
- if (hid_list[i]->exporter && strcmp(which, hid_list[i]->name) == 0)
- return hid_list[i];
+ for (i = 0; i < pcb_hid_num_hids; i++)
+ if (pcb_hid_list[i]->exporter && strcmp(which, pcb_hid_list[i]->name) == 0)
+ return pcb_hid_list[i];
fprintf(stderr, "Invalid exporter %s, available ones:", which);
- for (i = 0; i < hid_num_hids; i++)
- if (hid_list[i]->exporter)
- fprintf(stderr, " %s", hid_list[i]->name);
+ for (i = 0; i < pcb_hid_num_hids; i++)
+ if (pcb_hid_list[i]->exporter)
+ fprintf(stderr, " %s", pcb_hid_list[i]->name);
fprintf(stderr, "\n");
return 0;
}
-HID **hid_enumerate()
+pcb_hid_t **pcb_hid_enumerate()
{
- return hid_list;
+ return pcb_hid_list;
}
diff --git a/src/hid_init.h b/src/hid_init.h
index 6c679de..9480765 100644
--- a/src/hid_init.h
+++ b/src/hid_init.h
@@ -1,36 +1,38 @@
#ifndef PCB_HID_INIT_H
#define PCB_HID_INIT_H
+#include "hid.h"
+
/* NULL terminated list of all static HID structures. Built by
- hid_register_hid, used by hid_find_*() and hid_enumerate(). The
+ hid_register_hid, used by hid_find_*() and pcb_hid_enumerate(). The
order in this list is the same as the order of hid_register_hid
calls. */
-extern HID **hid_list;
+extern pcb_hid_t **pcb_hid_list;
/* Count of entries in the above. */
-extern int hid_num_hids;
+extern int pcb_hid_num_hids;
/* Call this as soon as possible from main(). No other HID calls are
valid until this is called. */
-void hid_init(void);
+void pcb_hid_init(void);
/* Call this at exit */
-void hid_uninit(void);
+void pcb_hid_uninit(void);
/* When PCB runs in interactive mode, this is called to instantiate
one GUI HID which happens to be the GUI. This HID is the one that
interacts with the mouse and keyboard. */
-HID *hid_find_gui(const char *preference);
+pcb_hid_t *pcb_hid_find_gui(const char *preference);
/* Finds the one printer HID and instantiates it. */
-HID *hid_find_printer(void);
+pcb_hid_t *pcb_hid_find_printer(void);
/* Finds the indicated exporter HID and instantiates it. */
-HID *hid_find_exporter(const char *);
+pcb_hid_t *pcb_hid_find_exporter(const char *);
/* This returns a NULL-terminated array of available HIDs. The only
real reason to use this is to locate all the export-style HIDs. */
-HID **hid_enumerate(void);
+pcb_hid_t **pcb_hid_enumerate(void);
/* HID internal interfaces. These may ONLY be called from the HID
modules, not from the common PCB code. */
@@ -38,10 +40,20 @@ HID **hid_enumerate(void);
/* A HID may use this if it does not need command line arguments in
any special format; for example, the Lesstif HID needs to use the
Xt parser, but the Postscript HID can use this function. */
-void hid_parse_command_line(int *argc, char ***argv);
+void pcb_hid_parse_command_line(int *argc, char ***argv);
+
+/* Called by the init funcs, used to set up pcb_hid_list. */
+extern void pcb_hid_register_hid(pcb_hid_t * hid);
+void pcb_hid_remove_hid(pcb_hid_t * hid);
+
+typedef struct pcb_plugin_dir_s pcb_plugin_dir_t;
+struct pcb_plugin_dir_s {
+ char *path;
+ int num_plugins;
+ pcb_plugin_dir_t *next;
+};
+
+extern pcb_plugin_dir_t *pcb_plugin_dir_first, *pcb_plugin_dir_last;
-/* Called by the init funcs, used to set up hid_list. */
-extern void hid_register_hid(HID * hid);
-void hid_remove_hid(HID * hid);
#endif
diff --git a/src/hid_nogui.c b/src/hid_nogui.c
index b99b996..b6750be 100644
--- a/src/hid_nogui.c
+++ b/src/hid_nogui.c
@@ -1,13 +1,13 @@
#include "config.h"
#include <stdio.h>
-#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#include "global.h"
#include "hid.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "conf_core.h"
/* This is the "gui" that is installed at startup, and is used when
there is no other real GUI to use. For the most part, it just
@@ -16,17 +16,17 @@
#define CRASH(func) fprintf(stderr, "HID error: pcb called GUI function %s without having a GUI available.\n", func); abort()
-typedef struct hid_gc_struct {
+typedef struct hid_gc_s {
int nothing_interesting_here;
-} hid_gc_struct;
+} hid_gc_s;
-static HID_Attribute *nogui_get_export_options(int *n_ret)
+static pcb_hid_attribute_t *nogui_get_export_options(int *n_ret)
{
CRASH("get_export_options");
return 0;
}
-static void nogui_do_export(HID_Attr_Val * options)
+static void nogui_do_export(pcb_hid_attr_val_t * options)
{
CRASH("do_export");
}
@@ -36,7 +36,7 @@ static void nogui_parse_arguments(int *argc, char ***argv)
CRASH("parse_arguments");
}
-static void nogui_invalidate_lr(int l, int r, int t, int b)
+static void nogui_invalidate_lr(pcb_coord_t l, pcb_coord_t r, pcb_coord_t t, pcb_coord_t b)
{
CRASH("invalidate_lr");
}
@@ -46,9 +46,9 @@ static void nogui_invalidate_all(void)
CRASH("invalidate_all");
}
-static int nogui_set_layer(const char *name, int idx, int empty)
+static int nogui_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- CRASH("set_layer");
+ CRASH("set_layer_group");
return 0;
}
@@ -56,12 +56,12 @@ static void nogui_end_layer(void)
{
}
-static hidGC nogui_make_gc(void)
+static pcb_hid_gc_t nogui_make_gc(void)
{
return 0;
}
-static void nogui_destroy_gc(hidGC gc)
+static void nogui_destroy_gc(pcb_hid_gc_t gc)
{
}
@@ -70,81 +70,81 @@ static void nogui_use_mask(int use_it)
CRASH("use_mask");
}
-static void nogui_set_color(hidGC gc, const char *name)
+static void nogui_set_color(pcb_hid_gc_t gc, const char *name)
{
CRASH("set_color");
}
-static void nogui_set_line_cap(hidGC gc, EndCapStyle style)
+static void nogui_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
CRASH("set_line_cap");
}
-static void nogui_set_line_width(hidGC gc, Coord width)
+static void nogui_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
CRASH("set_line_width");
}
-static void nogui_set_draw_xor(hidGC gc, int xor_)
+static void nogui_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
CRASH("set_draw_xor");
}
-static void nogui_set_draw_faded(hidGC gc, int faded)
+static void nogui_set_draw_faded(pcb_hid_gc_t gc, int faded)
{
}
-static void nogui_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void nogui_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
CRASH("draw_line");
}
-static void nogui_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle end_angle)
+static void nogui_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle)
{
CRASH("draw_arc");
}
-static void nogui_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void nogui_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
CRASH("draw_rect");
}
-static void nogui_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void nogui_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
CRASH("fill_circle");
}
-static void nogui_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void nogui_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
CRASH("fill_polygon");
}
-static void nogui_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box)
+static void nogui_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
CRASH("fill_pcb_polygon");
}
-static void nogui_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask)
+static void nogui_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask)
{
CRASH("fill_pcb_pad");
}
-static void nogui_thindraw_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask)
+static void nogui_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask)
{
CRASH("thindraw_pcb_pad");
}
-static void nogui_fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType * pad, pcb_bool drawHole, pcb_bool mask)
+static void nogui_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pad, pcb_bool drawHole, pcb_bool mask)
{
CRASH("fill_pcb_pv");
}
-static void nogui_thindraw_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType * pad, pcb_bool drawHole, pcb_bool mask)
+static void nogui_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pad, pcb_bool drawHole, pcb_bool mask)
{
CRASH("thindraw_pcb_pv");
}
-static void nogui_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void nogui_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
CRASH("fill_rect");
}
@@ -156,7 +156,7 @@ static void nogui_calibrate(double xval, double yval)
static int nogui_shift_is_pressed(void)
{
- /* This is called from FitCrosshairIntoGrid() when the board is loaded. */
+ /* This is called from pcb_crosshair_grid_fit() when the board is loaded. */
return 0;
}
@@ -172,7 +172,7 @@ static int nogui_mod1_is_pressed(void)
return 0;
}
-static void nogui_get_coords(const char *msg, Coord * x, Coord * y)
+static void nogui_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y)
{
CRASH("get_coords");
}
@@ -181,41 +181,41 @@ static void nogui_set_crosshair(int x, int y, int action)
{
}
-static hidval nogui_add_timer(void (*func) (hidval user_data), unsigned long milliseconds, hidval user_data)
+static pcb_hidval_t nogui_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data)
{
- hidval rv;
+ pcb_hidval_t rv;
CRASH("add_timer");
rv.lval = 0;
return rv;
}
-static void nogui_stop_timer(hidval timer)
+static void nogui_stop_timer(pcb_hidval_t timer)
{
CRASH("stop_timer");
}
-static hidval nogui_watch_file(int fd, unsigned int condition, void (*func) (hidval watch, int fd, unsigned int condition, hidval user_data), hidval user_data)
+static pcb_hidval_t nogui_watch_file(int fd, unsigned int condition, void (*func) (pcb_hidval_t watch, int fd, unsigned int condition, pcb_hidval_t user_data), pcb_hidval_t user_data)
{
- hidval rv;
+ pcb_hidval_t rv;
CRASH("watch_file");
rv.lval = 0;
return rv;
}
-static void nogui_unwatch_file(hidval watch)
+static void nogui_unwatch_file(pcb_hidval_t watch)
{
CRASH("unwatch_file");
}
-static hidval nogui_add_block_hook(void (*func) (hidval data), hidval data)
+static pcb_hidval_t nogui_add_block_hook(void (*func) (pcb_hidval_t data), pcb_hidval_t data)
{
- hidval rv;
+ pcb_hidval_t rv;
CRASH("add_block_hook");
rv.ptr = NULL;
return rv;
}
-static void nogui_stop_block_hook(hidval block_hook)
+static void nogui_stop_block_hook(pcb_hidval_t block_hook)
{
CRASH("stop_block_hook");
}
@@ -230,6 +230,11 @@ static void nogui_log(const char *fmt, ...)
static void nogui_logv(enum pcb_message_level level, const char *fmt, va_list ap)
{
+ if ((conf_core.rc.quiet) && (level < PCB_MSG_ERROR))
+ return;
+ if ((!conf_core.rc.verbose) && (level < PCB_MSG_INFO))
+ return;
+
switch (level) {
case PCB_MSG_DEBUG:
printf("D:");
@@ -356,7 +361,7 @@ static char *nogui_fileselect(const char *title, const char *descr,
return pcb_strdup(answer);
}
-static int nogui_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * results, const char *title, const char *descr)
+static int nogui_attribute_dialog(pcb_hid_attribute_t * attrs, int n_attrs, pcb_hid_attr_val_t * results, const char *title, const char *descr)
{
CRASH("attribute_dialog");
}
@@ -377,7 +382,7 @@ static int nogui_progress(int so_far, int total, const char *message)
return 0;
}
-static HID *nogui_request_debug_draw(void)
+static pcb_hid_t *nogui_request_debug_draw(void)
{
return NULL;
}
@@ -394,14 +399,14 @@ static void nogui_create_menu(const char *menu, const char *action, const char *
{
}
-void common_nogui_init(HID * hid)
+void pcb_hid_nogui_init(pcb_hid_t * hid)
{
hid->get_export_options = nogui_get_export_options;
hid->do_export = nogui_do_export;
hid->parse_arguments = nogui_parse_arguments;
hid->invalidate_lr = nogui_invalidate_lr;
hid->invalidate_all = nogui_invalidate_all;
- hid->set_layer = nogui_set_layer;
+ hid->set_layer_group = nogui_set_layer_group;
hid->end_layer = nogui_end_layer;
hid->make_gc = nogui_make_gc;
hid->destroy_gc = nogui_destroy_gc;
@@ -451,17 +456,17 @@ void common_nogui_init(HID * hid)
hid->create_menu = nogui_create_menu;
}
-static HID nogui_hid;
+static pcb_hid_t nogui_hid;
-HID *hid_nogui_get_hid(void)
+pcb_hid_t *pcb_hid_nogui_get_hid(void)
{
- memset(&nogui_hid, 0, sizeof(HID));
+ memset(&nogui_hid, 0, sizeof(pcb_hid_t));
- nogui_hid.struct_size = sizeof(HID);
+ nogui_hid.struct_size = sizeof(pcb_hid_t);
nogui_hid.name = "nogui";
nogui_hid.description = "Default GUI when no other GUI is present. " "Does nothing.";
- common_nogui_init(&nogui_hid);
+ pcb_hid_nogui_init(&nogui_hid);
return &nogui_hid;
}
diff --git a/src/hid_nogui.h b/src/hid_nogui.h
index eb4e916..ac8ea41 100644
--- a/src/hid_nogui.h
+++ b/src/hid_nogui.h
@@ -1,7 +1,7 @@
#ifndef PCB_HID_COMMON_HIDNOGUI_H
#define PCB_HID_COMMON_HIDNOGUI_H
-void common_nogui_init(HID * hid);
-HID *hid_nogui_get_hid(void);
+void pcb_hid_nogui_init(pcb_hid_t * hid);
+pcb_hid_t *pcb_hid_nogui_get_hid(void);
#endif
diff --git a/src/ht_element.c b/src/ht_element.c
index c77ac15..06257ad 100644
--- a/src/ht_element.c
+++ b/src/ht_element.c
@@ -1,216 +1,9 @@
-#include "global.h"
-#include "list_element.h"
+#include <string.h>
+#include "config.h"
+#include "obj_elem_list.h"
#define HT(x) htep_ ## x
#include <genht/ht.c>
#undef HT
-#warning TODO: move these in the big split
-
-/* compare two strings and return 0 if they are equal. NULL == NULL means equal. */
-static int neqs(const char *s1, const char *s2)
-{
- if ((s1 == NULL) && (s2 == NULL)) return 0;
- if ((s1 == NULL) || (s2 == NULL)) return 1;
- return strcmp(s1, s2) != 0;
-}
-
-/* compare two fields and return 0 if they are equal */
-#define neq(s1, s2, f) ((s1)->f != (s2)->f)
-
-#define eoffs(e,ef, s,sf) ((e == NULL) ? (s)->sf : ((s)->sf) - ((e)->ef))
-#define neqox(e1, x1, e2, x2, f) (eoffs(e1, MarkX, x1, f) != eoffs(e2, MarkX, x2, f))
-#define neqoy(e1, y1, e2, y2, f) (eoffs(e1, MarkY, y1, f) != eoffs(e2, MarkY, y2, f))
-
-static inline unsigned h_coord(Coord c)
-{
- return murmurhash(&(c), sizeof(Coord));
-}
-
-#define h_coordox(e, c) ((e) == NULL ? h_coord(c) : h_coord(c - e->MarkX))
-#define h_coordoy(e, c) ((e) == NULL ? h_coord(c) : h_coord(c - e->MarkY))
-
-#define h_str(s) ((s) == NULL ? 0 : strhash(s))
-
-int pcb_pin_eq(const ElementType *e1, const PinType *p1, const ElementType *e2, const PinType *p2)
-{
- if (neq(p1, p2, Thickness) || neq(p1, p2, Clearance)) return 0;
- if (neq(p1, p2, Mask) || neq(p1, p2, DrillingHole)) return 0;
- if (neqox(e1, p1, e2, p2, X) || neqoy(e1, p1, e2, p2, Y)) return 0;
- if (neqs(p1->Name, p2->Name)) return 0;
- if (neqs(p1->Number, p2->Number)) return 0;
- return 1;
-}
-
-unsigned int pcb_pin_hash(const ElementType *e, const PinType *p)
-{
- return
- h_coord(p->Thickness) ^ h_coord(p->Clearance) ^
- h_coord(p->Mask) ^ h_coord(p->DrillingHole) ^
- h_coordox(e, p->X) ^ h_coordoy(e, p->Y) ^
- h_str(p->Name) ^ h_str(p->Number);
-}
-
-int pcb_pad_eq(const ElementType *e1, const PadType *p1, const ElementType *e2, const PadType *p2)
-{
- if (neq(p1, p2, Thickness) || neq(p1, p2, Clearance)) return 0;
- if (neqox(e1, p1, e2, p2, Point1.X) || neqoy(e1, p1, e2, p2, Point1.Y)) return 0;
- if (neqox(e1, p1, e2, p2, Point2.X) || neqoy(e1, p1, e2, p2, Point2.Y)) return 0;
- if (neq(p1, p2, Mask)) return 0;
- if (neqs(p1->Name, p2->Name)) return 0;
- if (neqs(p1->Number, p2->Number)) return 0;
- return 1;
-}
-
-unsigned int pcb_pad_hash(const ElementType *e, const PadType *p)
-{
- return
- h_coord(p->Thickness) ^ h_coord(p->Clearance) ^
- h_coordox(e, p->Point1.X) ^ h_coordoy(e, p->Point1.Y) ^
- h_coordox(e, p->Point2.X) ^ h_coordoy(e, p->Point2.Y) ^
- h_coord(p->Mask) ^
- h_str(p->Name) ^ h_str(p->Number);
-}
-
-
-int pcb_line_eq(const ElementType *e1, const LineType *l1, const ElementType *e2, const LineType *l2)
-{
- if (neq(l1, l2, Thickness) || neq(l1, l2, Clearance)) return 0;
- if (neqox(e1, l1, e2, l2, Point1.X) || neqoy(e1, l1, e2, l2, Point1.Y)) return 0;
- if (neqox(e1, l1, e2, l2, Point2.X) || neqoy(e1, l1, e2, l2, Point2.Y)) return 0;
- if (neqs(l1->Number, l2->Number)) return 0;
- return 1;
-}
-
-
-unsigned int pcb_line_hash(const ElementType *e, const LineType *l)
-{
- return
- h_coord(l->Thickness) ^ h_coord(l->Clearance) ^
- h_coordox(e, l->Point1.X) ^ h_coordoy(e, l->Point1.Y) ^
- h_coordox(e, l->Point2.X) ^ h_coordoy(e, l->Point2.Y) ^
- h_str(l->Number);
-}
-
-int pcb_arc_eq(const ElementType *e1, const ArcType *a1, const ElementType *e2, const ArcType *a2)
-{
- if (neq(a1, a2, Thickness) || neq(a1, a2, Clearance)) return 0;
- if (neq(a1, a2, Width) || neq(a1, a2, Height)) return 0;
- if (neqox(e1, a1, e2, a2, X) || neqoy(e1, a1, e2, a2, Y)) return 0;
- if (neq(a1, a2, StartAngle) || neq(a1, a2, Delta)) return 0;
-
- return 1;
-}
-
-unsigned int pcb_arc_hash(const ElementType *e, const ArcType *a)
-{
- return
- h_coord(a->Thickness) ^ h_coord(a->Clearance) ^
- h_coord(a->Width) ^ h_coord(a->Height) ^
- h_coordox(e, a->X) ^ h_coordoy(e, a->Y) ^
- h_coord(a->StartAngle) ^ h_coord(a->Delta);
-}
-
-#undef h_coord
-#undef neq
-
-unsigned int pcb_element_hash(const ElementType *e)
-{
- unsigned int val = 0;
- gdl_iterator_t it;
-
- {
- PinType *p;
- pinlist_foreach(&e->Pin, &it, p) {
- val ^= pcb_pin_hash(e, p);
- }
- }
-
- {
- PadType *p;
- padlist_foreach(&e->Pad, &it, p) {
- val ^= pcb_pad_hash(e, p);
- }
- }
-
- {
- LineType *l;
- linelist_foreach(&e->Line, &it, l) {
- val ^= pcb_line_hash(e, l);
- }
- }
-
- {
- ArcType *a;
- linelist_foreach(&e->Arc, &it, a) {
- val ^= pcb_arc_hash(e, a);
- }
- }
-
- return val;
-}
-
-int pcb_element_eq(const ElementType *e1, const ElementType *e2)
-{
- /* Require the same objects in the same order - bail out at the first mismatch */
-
- {
- PinType *p1, *p2;
- p1 = pinlist_first((pinlist_t *)&e1->Pin);
- p2 = pinlist_first((pinlist_t *)&e2->Pin);
- for(;;) {
- if ((p1 == NULL) && (p2 == NULL))
- break;
- if (!pcb_pin_eq(e1, p1, e2, p2))
- return 0;
- p1 = pinlist_next(p1);
- p2 = pinlist_next(p2);
- }
- }
-
- {
- PadType *p1, *p2;
- p1 = padlist_first((padlist_t *)&e1->Pad);
- p2 = padlist_first((padlist_t *)&e2->Pad);
- for(;;) {
- if ((p1 == NULL) && (p2 == NULL))
- break;
- if (!pcb_pad_eq(e1, p1, e2, p2))
- return 0;
- p1 = padlist_next(p1);
- p2 = padlist_next(p2);
- }
- }
-
- {
- LineType *l1, *l2;
- l1 = linelist_first((linelist_t *)&e1->Line);
- l2 = linelist_first((linelist_t *)&e2->Line);
- for(;;) {
- if ((l1 == NULL) && (l2 == NULL))
- break;
- if (!pcb_line_eq(e1, l1, e2, l2))
- return 0;
- l1 = linelist_next(l1);
- l2 = linelist_next(l2);
- }
- }
-
- {
- ArcType *a1, *a2;
- a1 = arclist_first((arclist_t *)&e1->Arc);
- a2 = arclist_first((arclist_t *)&e2->Arc);
- for(;;) {
- if ((a1 == NULL) && (a2 == NULL))
- break;
- if (!pcb_arc_eq(e1, a1, e2, a2))
- return 0;
- a1 = arclist_next(a1);
- a2 = arclist_next(a2);
- }
- }
-
- return 1;
-}
-
diff --git a/src/ht_element.h b/src/ht_element.h
index 2d7b8db..1d50419 100644
--- a/src/ht_element.h
+++ b/src/ht_element.h
@@ -1,8 +1,10 @@
#ifndef PCB_HT_ELEMENT_H
#define PCB_HT_ELEMENT_H
+/* Hash: element -> pointer */
+
/* hash instance */
-typedef const ElementType *htep_key_t;
+typedef const pcb_element_t *htep_key_t;
typedef int htep_value_t;
#define HT(x) htep_ ## x
#include <genht/ht.h>
diff --git a/src/insert.c b/src/insert.c
index fe0f91c..41bc837 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -31,36 +31,20 @@
#include "config.h"
#include "conf_core.h"
-#include "create.h"
-#include "crosshair.h"
+#include "board.h"
#include "data.h"
-#include "draw.h"
-#include "line.h"
-#include "misc.h"
-#include "polygon.h"
-#include "rtree.h"
-#include "search.h"
#include "select.h"
-#include "set.h"
#include "undo.h"
-#include "misc_util.h"
-#include "layer.h"
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *InsertPointIntoLine(LayerTypePtr, LineTypePtr);
-static void *InsertPointIntoPolygon(LayerTypePtr, PolygonTypePtr);
-static void *InsertPointIntoRat(RatTypePtr);
+#include "obj_line_op.h"
+#include "obj_arc_op.h"
+#include "obj_rat_op.h"
+#include "obj_poly_op.h"
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord InsertX, InsertY; /* used by local routines as offset */
-static pcb_cardinal_t InsertAt;
-static pcb_bool InsertLast;
-static pcb_bool Forcible;
-static ObjectFunctionType InsertFunctions = {
+static pcb_opfunc_t InsertFunctions = {
InsertPointIntoLine,
NULL,
InsertPointIntoPolygon,
@@ -71,184 +55,78 @@ static ObjectFunctionType InsertFunctions = {
NULL,
NULL,
NULL,
- NULL,
- InsertPointIntoRat
+ pcb_arc_insert_point,
+ InsertPointIntoRat,
+ NULL
};
/* ---------------------------------------------------------------------------
- * inserts a point into a rat-line
- */
-static void *InsertPointIntoRat(RatTypePtr Rat)
-{
- LineTypePtr newone;
-
- newone = CreateDrawnLineOnLayer(CURRENT, Rat->Point1.X, Rat->Point1.Y,
- InsertX, InsertY, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
- if (!newone)
- return newone;
- AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, newone, newone);
- EraseRat(Rat);
- DrawLine(CURRENT, newone);
- newone = CreateDrawnLineOnLayer(CURRENT, Rat->Point2.X, Rat->Point2.Y,
- InsertX, InsertY, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
- if (newone) {
- AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, newone, newone);
- DrawLine(CURRENT, newone);
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, Rat, Rat, Rat);
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * inserts a point into a line
- */
-static void *InsertPointIntoLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- LineTypePtr line;
- Coord X, Y;
-
- if (((Line->Point1.X == InsertX) && (Line->Point1.Y == InsertY)) ||
- ((Line->Point2.X == InsertX) && (Line->Point2.Y == InsertY)))
- return (NULL);
- X = Line->Point2.X;
- Y = Line->Point2.Y;
- AddObjectToMoveUndoList(PCB_TYPE_LINE_POINT, Layer, Line, &Line->Point2, InsertX - X, InsertY - Y);
- EraseLine(Line);
- r_delete_entry(Layer->line_tree, (BoxTypePtr) Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- Line->Point2.X = InsertX;
- Line->Point2.Y = InsertY;
- SetLineBoundingBox(Line);
- r_insert_entry(Layer->line_tree, (BoxTypePtr) Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- DrawLine(Layer, Line);
- /* we must create after playing with Line since creation may
- * invalidate the line pointer
- */
- if ((line = CreateDrawnLineOnLayer(Layer, InsertX, InsertY, X, Y, Line->Thickness, Line->Clearance, Line->Flags))) {
- AddObjectToCreateUndoList(PCB_TYPE_LINE, Layer, line, line);
- DrawLine(Layer, line);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, line);
- /* creation call adds it to the rtree */
- }
- Draw();
- return (line);
-}
-
-/* ---------------------------------------------------------------------------
- * inserts a point into a polygon
- */
-static void *InsertPointIntoPolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- PointType save;
- pcb_cardinal_t n;
- LineType line;
-
- if (!Forcible) {
- /*
- * first make sure adding the point is sensible
- */
- line.Thickness = 0;
- line.Point1 = Polygon->Points[prev_contour_point(Polygon, InsertAt)];
- line.Point2 = Polygon->Points[InsertAt];
- if (IsPointOnLine((float) InsertX, (float) InsertY, 0.0, &line))
- return (NULL);
- }
- /*
- * second, shift the points up to make room for the new point
- */
- ErasePolygon(Polygon);
- r_delete_entry(Layer->polygon_tree, (BoxTypePtr) Polygon);
- save = *CreateNewPointInPolygon(Polygon, InsertX, InsertY);
- for (n = Polygon->PointN - 1; n > InsertAt; n--)
- Polygon->Points[n] = Polygon->Points[n - 1];
-
- /* Shift up indices of any holes */
- for (n = 0; n < Polygon->HoleIndexN; n++)
- if (Polygon->HoleIndex[n] > InsertAt || (InsertLast && Polygon->HoleIndex[n] == InsertAt))
- Polygon->HoleIndex[n]++;
-
- Polygon->Points[InsertAt] = save;
- SetChangedFlag(pcb_true);
- AddObjectToInsertPointUndoList(PCB_TYPE_POLYGON_POINT, Layer, Polygon, &Polygon->Points[InsertAt]);
-
- SetPolygonBoundingBox(Polygon);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- InitClip(PCB->Data, Layer, Polygon);
- if (Forcible || !RemoveExcessPolygonPoints(Layer, Polygon)) {
- DrawPolygon(Layer, Polygon);
- Draw();
- }
- return (&Polygon->Points[InsertAt]);
-}
-
-/* ---------------------------------------------------------------------------
* inserts point into objects
*/
-void *InsertPointIntoObject(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t * Ptr3, Coord DX, Coord DY, pcb_bool Force, pcb_bool insert_last)
+void *pcb_insert_point_in_object(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t * Ptr3, pcb_coord_t DX, pcb_coord_t DY, pcb_bool Force, pcb_bool insert_last)
{
void *ptr;
+ pcb_opctx_t ctx;
- /* setup offset */
- InsertX = DX;
- InsertY = DY;
- InsertAt = *Ptr3;
- InsertLast = insert_last;
- Forcible = Force;
+ ctx.insert.pcb = PCB;
+ ctx.insert.x = DX;
+ ctx.insert.y = DY;
+ ctx.insert.idx = *Ptr3;
+ ctx.insert.last = insert_last;
+ ctx.insert.forcible = Force;
/* the operation insert the points to the undo-list */
- ptr = ObjectOperation(&InsertFunctions, Type, Ptr1, Ptr2, Ptr3);
+ ptr = pcb_object_operation(&InsertFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
if (ptr != NULL)
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return (ptr);
}
/* ---------------------------------------------------------------------------
* adjusts the insert point to make 45 degree lines as necessary
*/
-PointTypePtr AdjustInsertPoint(void)
+pcb_point_t *pcb_adjust_insert_point(void)
{
- static PointType InsertedPoint;
+ static pcb_point_t InsertedPoint;
double m;
- Coord x, y, m1, m2;
- LineTypePtr line = (LineTypePtr) Crosshair.AttachedObject.Ptr2;
+ pcb_coord_t x, y, m1, m2;
+ pcb_line_t *line = (pcb_line_t *) pcb_crosshair.AttachedObject.Ptr2;
- if (Crosshair.AttachedObject.State == STATE_FIRST)
+ if (pcb_crosshair.AttachedObject.State == PCB_CH_STATE_FIRST)
return NULL;
- Crosshair.AttachedObject.Ptr3 = &InsertedPoint;
- if (gui->shift_is_pressed()) {
- AttachedLineType myline;
+ pcb_crosshair.AttachedObject.Ptr3 = &InsertedPoint;
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_attached_line_t myline;
/* only force 45 degree for nearest point */
- if (Distance(Crosshair.X, Crosshair.Y, line->Point1.X, line->Point1.Y) <
- Distance(Crosshair.X, Crosshair.Y, line->Point2.X, line->Point2.Y))
+ if (pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, line->Point1.X, line->Point1.Y) <
+ pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, line->Point2.X, line->Point2.Y))
myline.Point1 = myline.Point2 = line->Point1;
else
myline.Point1 = myline.Point2 = line->Point2;
- FortyFiveLine(&myline);
+ pcb_line_45(&myline);
InsertedPoint.X = myline.Point2.X;
InsertedPoint.Y = myline.Point2.Y;
return &InsertedPoint;
}
- if (conf_core.editor.all_direction_lines) {
- InsertedPoint.X = Crosshair.X;
- InsertedPoint.Y = Crosshair.Y;
+ if (PCB->RatDraw || conf_core.editor.all_direction_lines) {
+ InsertedPoint.X = pcb_crosshair.X;
+ InsertedPoint.Y = pcb_crosshair.Y;
return &InsertedPoint;
}
- if (Crosshair.X == line->Point1.X)
+ if (pcb_crosshair.X == line->Point1.X)
m1 = 2; /* 2 signals infinite slope */
else {
- m = (double) (Crosshair.X - line->Point1.X) / (Crosshair.Y - line->Point1.Y);
+ m = (double) (pcb_crosshair.X - line->Point1.X) / (pcb_crosshair.Y - line->Point1.Y);
m1 = 0;
if (m > PCB_TAN_30_DEGREE)
m1 = (m > PCB_TAN_60_DEGREE) ? 2 : 1;
else if (m < -PCB_TAN_30_DEGREE)
m1 = (m < -PCB_TAN_60_DEGREE) ? 2 : -1;
}
- if (Crosshair.X == line->Point2.X)
+ if (pcb_crosshair.X == line->Point2.X)
m2 = 2; /* 2 signals infinite slope */
else {
- m = (double) (Crosshair.X - line->Point1.X) / (Crosshair.Y - line->Point1.Y);
+ m = (double) (pcb_crosshair.X - line->Point1.X) / (pcb_crosshair.Y - line->Point1.Y);
m2 = 0;
if (m > PCB_TAN_30_DEGREE)
m2 = (m > PCB_TAN_60_DEGREE) ? 2 : 1;
diff --git a/src/insert.h b/src/insert.h
index d92799b..b474b46 100644
--- a/src/insert.h
+++ b/src/insert.h
@@ -29,14 +29,14 @@
#ifndef PCB_INSERT_H
#define PCB_INSERT_H
-#include "global.h"
+#include "config.h"
-#define INSERT_TYPES (PCB_TYPE_POLYGON | PCB_TYPE_LINE | PCB_TYPE_RATLINE)
+#define PCB_INSERT_TYPES (PCB_TYPE_POLYGON | PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_RATLINE)
/* ---------------------------------------------------------------------------
* prototypes
*/
-void *InsertPointIntoObject(int, void *, void *, pcb_cardinal_t *, Coord, Coord, pcb_bool, pcb_bool);
-PointTypePtr AdjustInsertPoint(void);
+void *pcb_insert_point_in_object(int, void *, void *, pcb_cardinal_t *, pcb_coord_t, pcb_coord_t, pcb_bool, pcb_bool);
+pcb_point_t *pcb_adjust_insert_point(void);
#endif
diff --git a/src/intersect.c b/src/intersect.c
index 4c0bf08..88913a0 100644
--- a/src/intersect.c
+++ b/src/intersect.c
@@ -35,6 +35,7 @@
#include <assert.h>
#include "intersect.h"
+#include "box.h"
/* ---------------------------------------------------------------------------
* some local prototypes
@@ -48,9 +49,9 @@ static int nextpwrof2(int i);
* some local types
*/
typedef struct {
- Coord left, right;
+ pcb_coord_t left, right;
int covered;
- Coord area;
+ pcb_coord_t area;
} SegmentTreeNode;
typedef struct {
@@ -59,21 +60,21 @@ typedef struct {
} SegmentTree;
typedef struct {
- Coord *p;
+ pcb_coord_t *p;
int size;
} LocationList;
/* ---------------------------------------------------------------------------
* Create a sorted list of unique y coords from a BoxList.
*/
-static LocationList createSortedYList(BoxListTypePtr boxlist)
+static LocationList createSortedYList(pcb_box_list_t *boxlist)
{
LocationList yCoords;
- Coord last;
+ pcb_coord_t last;
int i, n;
/* create sorted list of Y coordinates */
yCoords.size = 2 * boxlist->BoxN;
- yCoords.p = (Coord *) calloc(yCoords.size, sizeof(*yCoords.p));
+ yCoords.p = (pcb_coord_t *) calloc(yCoords.size, sizeof(*yCoords.p));
for (i = 0; i < boxlist->BoxN; i++) {
yCoords.p[2 * i] = boxlist->Box[i].Y1;
yCoords.p[2 * i + 1] = boxlist->Box[i].Y2;
@@ -91,7 +92,7 @@ static LocationList createSortedYList(BoxListTypePtr boxlist)
/* ---------------------------------------------------------------------------
* Create an empty segment tree from the given sorted list of uniq y coords.
*/
-static SegmentTree createSegmentTree(Coord * yCoords, int N)
+static SegmentTree createSegmentTree(pcb_coord_t * yCoords, int N)
{
SegmentTree st;
int i;
@@ -115,9 +116,9 @@ static SegmentTree createSegmentTree(Coord * yCoords, int N)
return st;
}
-void insertSegment(SegmentTree * st, int n, Coord Y1, Coord Y2)
+void insertSegment(SegmentTree * st, int n, pcb_coord_t Y1, pcb_coord_t Y2)
{
- Coord discriminant;
+ pcb_coord_t discriminant;
if (st->nodes[n].left >= Y1 && st->nodes[n].right <= Y2) {
st->nodes[n].covered++;
}
@@ -134,9 +135,9 @@ void insertSegment(SegmentTree * st, int n, Coord Y1, Coord Y2)
(st->nodes[n].right - st->nodes[n].left) : (n >= st->size / 2) ? 0 : st->nodes[n * 2].area + st->nodes[n * 2 + 1].area;
}
-void deleteSegment(SegmentTree * st, int n, Coord Y1, Coord Y2)
+void deleteSegment(SegmentTree * st, int n, pcb_coord_t Y1, pcb_coord_t Y2)
{
- Coord discriminant;
+ pcb_coord_t discriminant;
if (st->nodes[n].left >= Y1 && st->nodes[n].right <= Y2) {
assert(st->nodes[n].covered);
--st->nodes[n].covered;
@@ -161,7 +162,7 @@ void deleteSegment(SegmentTree * st, int n, Coord Y1, Coord Y2)
* etc.).
* Runs in O(N ln N) time.
*/
-double ComputeIntersectionArea(BoxListTypePtr boxlist)
+double pcb_intersect_box_box(pcb_box_list_t *boxlist)
{
pcb_cardinal_t i;
double area = 0.0;
@@ -169,20 +170,20 @@ double ComputeIntersectionArea(BoxListTypePtr boxlist)
for (i = 0; i < boxlist->BoxN; i++)
area += (double) (boxlist->Box[i].X2 - boxlist->Box[i].X1) * (double) (boxlist->Box[i].Y2 - boxlist->Box[i].Y1);
/* intersection area is aggregate - union. */
- return area * 0.0001 - ComputeUnionArea(boxlist);
+ return area * 0.0001 - pcb_union_box_box(boxlist);
}
/* ---------------------------------------------------------------------------
* Compute the area of the union of the given rectangles.
* O(N ln N) time.
*/
-double ComputeUnionArea(BoxListTypePtr boxlist)
+double pcb_union_box_box(pcb_box_list_t *boxlist)
{
- BoxTypePtr *rectLeft, *rectRight;
+ pcb_box_t **rectLeft, **rectRight;
pcb_cardinal_t i, j;
LocationList yCoords;
SegmentTree segtree;
- Coord lastX;
+ pcb_coord_t lastX;
double area = 0.0;
if (boxlist->BoxN == 0)
@@ -193,8 +194,8 @@ double ComputeUnionArea(BoxListTypePtr boxlist)
segtree = createSegmentTree(yCoords.p, yCoords.size);
free(yCoords.p);
/* create sorted list of left and right X coordinates of rectangles */
- rectLeft = (BoxTypePtr *) calloc(boxlist->BoxN, sizeof(*rectLeft));
- rectRight = (BoxTypePtr *) calloc(boxlist->BoxN, sizeof(*rectRight));
+ rectLeft = (pcb_box_t **) calloc(boxlist->BoxN, sizeof(*rectLeft));
+ rectRight = (pcb_box_t **) calloc(boxlist->BoxN, sizeof(*rectRight));
for (i = 0; i < boxlist->BoxN; i++) {
assert(boxlist->Box[i].X1 <= boxlist->Box[i].X2);
assert(boxlist->Box[i].Y1 <= boxlist->Box[i].Y2);
@@ -210,7 +211,7 @@ double ComputeUnionArea(BoxListTypePtr boxlist)
/* i will step through rectLeft, j will through rectRight */
if (i == boxlist->BoxN || rectRight[j]->X2 < rectLeft[i]->X1) {
/* right edge of rectangle */
- BoxTypePtr b = rectRight[j++];
+ pcb_box_t *b = rectRight[j++];
/* check lastX */
if (b->X2 != lastX) {
assert(lastX < b->X2);
@@ -222,7 +223,7 @@ double ComputeUnionArea(BoxListTypePtr boxlist)
}
else {
/* left edge of rectangle */
- BoxTypePtr b = rectLeft[i++];
+ pcb_box_t *b = rectLeft[i++];
/* check lastX */
if (b->X1 != lastX) {
assert(lastX < b->X1);
@@ -241,19 +242,19 @@ double ComputeUnionArea(BoxListTypePtr boxlist)
static int compareleft(const void *ptr1, const void *ptr2)
{
- BoxTypePtr *b1 = (BoxTypePtr *) ptr1, *b2 = (BoxTypePtr *) ptr2;
+ pcb_box_t **b1 = (pcb_box_t **) ptr1, **b2 = (pcb_box_t **) ptr2;
return (*b1)->X1 - (*b2)->X1;
}
static int compareright(const void *ptr1, const void *ptr2)
{
- BoxTypePtr *b1 = (BoxTypePtr *) ptr1, *b2 = (BoxTypePtr *) ptr2;
+ pcb_box_t **b1 = (pcb_box_t **) ptr1, **b2 = (pcb_box_t **) ptr2;
return (*b1)->X2 - (*b2)->X2;
}
static int comparepos(const void *ptr1, const void *ptr2)
{
- return *((Coord *) ptr1) - *((Coord *) ptr2);
+ return *((pcb_coord_t *) ptr1) - *((pcb_coord_t *) ptr2);
}
static int nextpwrof2(int n)
diff --git a/src/intersect.h b/src/intersect.h
index f13665d..98f2c08 100644
--- a/src/intersect.h
+++ b/src/intersect.h
@@ -35,9 +35,9 @@
#ifndef PCB_INTERSECT_H
#define PCB_INTERSECT_H
-#include "global.h"
+#include "global_typedefs.h"
-double ComputeIntersectionArea(BoxListTypePtr boxlist); /* will sort boxlist */
-double ComputeUnionArea(BoxListTypePtr boxlist);
+double pcb_intersect_box_box(pcb_box_list_t *boxlist); /* will sort boxlist */
+double pcb_union_box_box(pcb_box_list_t *boxlist);
#endif
diff --git a/src/layer.c b/src/layer.c
index 96077a3..e995833 100644
--- a/src/layer.c
+++ b/src/layer.c
@@ -25,61 +25,137 @@
*
*/
-#include "global.h"
+#include "config.h"
+#include "board.h"
#include "data.h"
#include "conf_core.h"
#include "layer.h"
#include "hid_actions.h"
#include "compat_misc.h"
+#include "undo.h"
+#include "event.h"
+#include "layer_ui.h"
+
+pcb_virt_layer_t pcb_virt_layers[] = {
+ {"invisible", PCB_LYT_VIRTUAL + 1, -1, PCB_LYT_VIRTUAL | PCB_LYT_INVIS | PCB_LYT_LOGICAL },
+ {"topmask", PCB_LYT_VIRTUAL + 2, -1, PCB_LYT_VIRTUAL | PCB_LYT_MASK | PCB_LYT_TOP },
+ {"bottommask", PCB_LYT_VIRTUAL + 3, -1, PCB_LYT_VIRTUAL | PCB_LYT_MASK | PCB_LYT_BOTTOM },
+ {"topsilk", PCB_LYT_VIRTUAL + 4, +PCB_COMPONENT_SIDE, PCB_LYT_SILK | PCB_LYT_TOP },
+ {"bottomsilk", PCB_LYT_VIRTUAL + 5, +PCB_SOLDER_SIDE, PCB_LYT_SILK | PCB_LYT_BOTTOM },
+ {"rats", PCB_LYT_VIRTUAL + 6, -1, PCB_LYT_VIRTUAL | PCB_LYT_RAT },
+ {"toppaste", PCB_LYT_VIRTUAL + 7, -1, PCB_LYT_VIRTUAL | PCB_LYT_PASTE | PCB_LYT_TOP },
+ {"bottompaste", PCB_LYT_VIRTUAL + 8, -1, PCB_LYT_VIRTUAL | PCB_LYT_PASTE | PCB_LYT_BOTTOM },
+ {"topassembly", PCB_LYT_VIRTUAL + 9, -1, PCB_LYT_VIRTUAL | PCB_LYT_ASSY | PCB_LYT_TOP},
+ {"bottomassembly", PCB_LYT_VIRTUAL + 10, -1, PCB_LYT_VIRTUAL | PCB_LYT_ASSY | PCB_LYT_BOTTOM },
+ {"fab", PCB_LYT_VIRTUAL + 11, -1, PCB_LYT_VIRTUAL | PCB_LYT_FAB | PCB_LYT_LOGICAL },
+ {"plated-drill", PCB_LYT_VIRTUAL + 12, -1, PCB_LYT_VIRTUAL | PCB_LYT_PDRILL },
+ {"unplated-drill", PCB_LYT_VIRTUAL + 13, -1, PCB_LYT_VIRTUAL | PCB_LYT_UDRILL },
+ { NULL, 0 },
+};
+
+
+typedef struct {
+ pcb_layer_type_t type;
+ int class;
+ const char *name;
+} pcb_layer_type_name_t;
+
+static const pcb_layer_type_name_t pcb_layer_type_names[] = {
+ { PCB_LYT_TOP, 1, "top" },
+ { PCB_LYT_BOTTOM, 1, "bottom" },
+ { PCB_LYT_INTERN, 1, "intern" },
+ { PCB_LYT_LOGICAL, 1, "logical" },
+ { PCB_LYT_COPPER, 2, "copper" },
+ { PCB_LYT_SILK, 2, "silk" },
+ { PCB_LYT_MASK, 2, "mask" },
+ { PCB_LYT_PASTE, 2, "paste" },
+ { PCB_LYT_OUTLINE, 2, "outline" },
+ { PCB_LYT_RAT, 2, "rat" },
+ { PCB_LYT_INVIS, 2, "invis" },
+ { PCB_LYT_ASSY, 2, "assy" },
+ { PCB_LYT_FAB, 2, "fab" },
+ { PCB_LYT_PDRILL, 2, "plateddrill" },
+ { PCB_LYT_UDRILL, 2, "unplateddrill" },
+ { PCB_LYT_UI, 2, "userinterface" },
+ { PCB_LYT_VIRTUAL, 3, "virtual" },
+ { 0, 0, NULL }
+};
+
+static const char *pcb_layer_type_class_names[] = {
+ "INVALID", "location", "purpose", "property"
+};
+
+#define PCB_LAYER_VIRT_MIN (PCB_LYT_VIRTUAL + PCB_VLY_first + 1)
+#define PCB_LAYER_VIRT_MAX (PCB_LYT_VIRTUAL + PCB_VLY_end - 1)
+
+
+pcb_bool pcb_layer_is_empty_(pcb_layer_t *layer)
+{
+ unsigned int flags;
+ pcb_layer_id_t lid = pcb_layer_id(PCB->Data, layer);
-/*
- * Used by SaveStackAndVisibility() and
- * RestoreStackAndVisibility()
- */
+ if (lid < 0)
+ return 1;
+
+ flags = pcb_layer_flags(lid);
-static struct {
- pcb_bool ElementOn, InvisibleObjectsOn, PinOn, ViaOn, RatOn;
- int LayerStack[MAX_LAYER];
- pcb_bool LayerOn[MAX_LAYER];
- int cnt;
-} SavedStack;
+ if ((flags & PCB_LYT_COPPER) && (flags & PCB_LYT_TOP)) { /* if our layer is the top copper layer and we have an element pad on it, it's non-empty */
+ PCB_PAD_ALL_LOOP(PCB->Data);
+ {
+ if (!PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad))
+ return 0;
+ }
+ PCB_ENDALL_LOOP;
+ }
-pcb_bool IsLayerEmpty(LayerTypePtr layer)
-{
- return LAYER_IS_EMPTY(layer);
+ if ((flags & PCB_LYT_COPPER) && (flags & PCB_LYT_BOTTOM)) { /* if our layer is the bottom copper layer and we have an element pad on it, it's non-empty */
+ PCB_PAD_ALL_LOOP(PCB->Data);
+ {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad))
+ return 0;
+ }
+ PCB_ENDALL_LOOP;
+ }
+
+#warning TODO: check top silk and bottom silk for elements
+
+ /* normal case: a layer is empty if all lists are empty */
+ return
+ (linelist_length(&layer->Line) == 0) &&
+ (arclist_length(&layer->Arc) == 0) &&
+ (polylist_length(&layer->Polygon) == 0) &&
+ (textlist_length(&layer->Text) == 0);
}
-pcb_bool IsLayerNumEmpty(int num)
+pcb_bool pcb_layer_is_empty(pcb_layer_id_t num)
{
- return IsLayerEmpty(PCB->Data->Layer + num);
+ if ((num >= 0) && (num < pcb_max_copper_layer+2))
+ return pcb_layer_is_empty_(PCB->Data->Layer + num);
+ return pcb_false;
}
-pcb_bool IsLayerGroupEmpty(int num)
+pcb_bool pcb_is_layergrp_empty(pcb_layergrp_id_t num)
{
int i;
for (i = 0; i < PCB->LayerGroups.Number[num]; i++)
- if (!IsLayerNumEmpty(PCB->LayerGroups.Entries[num][i]))
+ if (!pcb_layer_is_empty(PCB->LayerGroups.Entries[num][i]))
return pcb_false;
return pcb_true;
}
-/* ----------------------------------------------------------------------
- * parses the group definition string which is a colon separated list of
- * comma separated layer numbers (1,2,b:4,6,8,t)
- */
-int ParseGroupString(const char *s, LayerGroupTypePtr LayerGroup, int LayerN)
+int pcb_layer_parse_group_string(const char *s, pcb_layer_group_t *LayerGroup, int LayerN, int oldfmt)
{
int group, member, layer;
pcb_bool c_set = pcb_false, /* flags for the two special layers to */
s_set = pcb_false; /* provide a default setting for old formats */
- int groupnum[MAX_LAYER + 2];
+ int groupnum[PCB_MAX_LAYERGRP + 2];
/* clear struct */
- memset(LayerGroup, 0, sizeof(LayerGroupType));
+ memset(LayerGroup, 0, sizeof(pcb_layer_group_t));
/* Clear assignments */
- for (layer = 0; layer < MAX_LAYER + 2; layer++)
+ for (layer = 0; layer < PCB_MAX_LAYER + 2; layer++)
groupnum[layer] = -1;
/* loop over all groups */
@@ -97,7 +173,7 @@ int ParseGroupString(const char *s, LayerGroupTypePtr LayerGroup, int LayerN)
case 'C':
case 't':
case 'T':
- layer = LayerN + COMPONENT_LAYER;
+ layer = LayerN + PCB_COMPONENT_SIDE;
c_set = pcb_true;
break;
@@ -105,7 +181,7 @@ int ParseGroupString(const char *s, LayerGroupTypePtr LayerGroup, int LayerN)
case 'S':
case 'b':
case 'B':
- layer = LayerN + SOLDER_LAYER;
+ layer = LayerN + PCB_SOLDER_SIDE;
s_set = pcb_true;
break;
@@ -115,8 +191,22 @@ int ParseGroupString(const char *s, LayerGroupTypePtr LayerGroup, int LayerN)
layer = atoi(s) - 1;
break;
}
- if (layer > LayerN + MAX(SOLDER_LAYER, COMPONENT_LAYER) || member >= LayerN + 1)
+ if (member >= LayerN + 1)
goto error;
+ if (oldfmt) {
+ /* the old format didn't always have the silks */
+ if (layer > LayerN + MAX(PCB_SOLDER_SIDE, PCB_COMPONENT_SIDE)) {
+ /* UGLY HACK: we assume oldfmt is 1 only when called from io_pcb .y */
+ PCB->Data->LayerN++;
+ LayerN++;
+ }
+ if (layer > LayerN + MAX(PCB_SOLDER_SIDE, PCB_COMPONENT_SIDE) + 2)
+ goto error;
+ }
+ else {
+ if (layer > LayerN + MAX(PCB_SOLDER_SIDE, PCB_COMPONENT_SIDE))
+ goto error;
+ }
groupnum[layer] = group;
LayerGroup->Entries[group][member++] = layer;
while (*++s && isdigit((int) *s));
@@ -134,9 +224,9 @@ int ParseGroupString(const char *s, LayerGroupTypePtr LayerGroup, int LayerN)
s++;
}
if (!s_set)
- LayerGroup->Entries[SOLDER_LAYER][LayerGroup->Number[SOLDER_LAYER]++] = LayerN + SOLDER_LAYER;
+ LayerGroup->Entries[PCB_SOLDER_SIDE][LayerGroup->Number[PCB_SOLDER_SIDE]++] = LayerN + PCB_SOLDER_SIDE;
if (!c_set)
- LayerGroup->Entries[COMPONENT_LAYER][LayerGroup->Number[COMPONENT_LAYER]++] = LayerN + COMPONENT_LAYER;
+ LayerGroup->Entries[PCB_COMPONENT_SIDE][LayerGroup->Number[PCB_COMPONENT_SIDE]++] = LayerN + PCB_COMPONENT_SIDE;
for (layer = 0; layer < LayerN && group < LayerN; layer++)
if (groupnum[layer] == -1) {
@@ -148,323 +238,66 @@ int ParseGroupString(const char *s, LayerGroupTypePtr LayerGroup, int LayerN)
/* reset structure on error */
error:
- memset(LayerGroup, 0, sizeof(LayerGroupType));
+ memset(LayerGroup, 0, sizeof(pcb_layer_group_t));
return (1);
}
-
-
-/* ---------------------------------------------------------------------------
- * returns the layer number for the passed pointer
- */
-int GetLayerNumber(DataTypePtr Data, LayerTypePtr Layer)
-{
- int i;
-
- for (i = 0; i < MAX_LAYER + 2; i++)
- if (Layer == &Data->Layer[i])
- break;
- return (i);
-}
-
-/* ---------------------------------------------------------------------------
- * move layer (number is passed in) to top of layerstack
- */
-static void PushOnTopOfLayerStack(int NewTop)
+pcb_layer_id_t pcb_layer_id(pcb_data_t *Data, pcb_layer_t *Layer)
{
- int i;
+ if ((Layer >= Data->Layer) && (Layer < (Data->Layer + PCB_MAX_LAYER + 2)))
+ return Layer - Data->Layer;
- /* ignore silk layers */
- if (NewTop < max_copper_layer) {
- /* first find position of passed one */
- for (i = 0; i < max_copper_layer; i++)
- if (LayerStack[i] == NewTop)
- break;
+ if ((Layer >= pcb_uilayer.array) && (Layer < pcb_uilayer.array + vtlayer_len(&pcb_uilayer)))
+ return (Layer - pcb_uilayer.array) | PCB_LYT_UI;
- /* bring this element to the top of the stack */
- for (; i; i--)
- LayerStack[i] = LayerStack[i - 1];
- LayerStack[0] = NewTop;
- }
+ return -1;
}
-
-/* ----------------------------------------------------------------------
- * changes the visibility of all layers in a group
- * returns the number of changed layers
- */
-int ChangeGroupVisibility(int Layer, pcb_bool On, pcb_bool ChangeStackOrder)
+pcb_layergrp_id_t pcb_layer_get_group(pcb_layer_id_t Layer)
{
- int group, i, changed = 1; /* at least the current layer changes */
-
- /* Warning: these special case values must agree with what gui-top-window.c
- | thinks the are.
- */
-
- if (conf_core.rc.verbose)
- printf("ChangeGroupVisibility(Layer=%d, On=%d, ChangeStackOrder=%d)\n", Layer, On, ChangeStackOrder);
-
- /* decrement 'i' to keep stack in order of layergroup */
- if ((group = GetGroupOfLayer(Layer)) < max_group)
- for (i = PCB->LayerGroups.Number[group]; i;) {
- int layer = PCB->LayerGroups.Entries[group][--i];
-
- /* don't count the passed member of the group */
- if (layer != Layer && layer < max_copper_layer) {
- PCB->Data->Layer[layer].On = On;
-
- /* push layer on top of stack if switched on */
- if (On && ChangeStackOrder)
- PushOnTopOfLayerStack(layer);
- changed++;
- }
- }
-
- /* change at least the passed layer */
- PCB->Data->Layer[Layer].On = On;
- if (On && ChangeStackOrder)
- PushOnTopOfLayerStack(Layer);
-
- /* update control panel and exit */
- hid_action("LayersChanged");
- return (changed);
-}
-
-/* ----------------------------------------------------------------------
- * Given a string description of a layer stack, adjust the layer stack
- * to correspond.
-*/
+ pcb_layergrp_id_t group, i;
-void LayerStringToLayerStack(const char *layer_string)
-{
- static int listed_layers = 0;
- int l = strlen(layer_string);
- char **args;
- int i, argn, lno;
- int prev_sep = 1;
- char *s;
-
- s = pcb_strdup(layer_string);
- args = (char **) malloc(l * sizeof(char *));
- argn = 0;
-
- for (i = 0; i < l; i++) {
- switch (s[i]) {
- case ' ':
- case '\t':
- case ',':
- case ';':
- case ':':
- prev_sep = 1;
- s[i] = '\0';
- break;
- default:
- if (prev_sep)
- args[argn++] = s + i;
- prev_sep = 0;
- break;
- }
- }
-
- for (i = 0; i < max_copper_layer + 2; i++) {
- if (i < max_copper_layer)
- LayerStack[i] = i;
- PCB->Data->Layer[i].On = pcb_false;
- }
- PCB->ElementOn = pcb_false;
- PCB->InvisibleObjectsOn = pcb_false;
- PCB->PinOn = pcb_false;
- PCB->ViaOn = pcb_false;
- PCB->RatOn = pcb_false;
-
- conf_set_editor(show_mask, 0);
- conf_set_editor(show_solder_side, 0);
-
- for (i = argn - 1; i >= 0; i--) {
- if (strcasecmp(args[i], "rats") == 0)
- PCB->RatOn = pcb_true;
- else if (strcasecmp(args[i], "invisible") == 0)
- PCB->InvisibleObjectsOn = pcb_true;
- else if (strcasecmp(args[i], "pins") == 0)
- PCB->PinOn = pcb_true;
- else if (strcasecmp(args[i], "vias") == 0)
- PCB->ViaOn = pcb_true;
- else if (strcasecmp(args[i], "elements") == 0 || strcasecmp(args[i], "silk") == 0)
- PCB->ElementOn = pcb_true;
- else if (strcasecmp(args[i], "mask") == 0)
- conf_set_editor(show_mask, 1);
- else if (strcasecmp(args[i], "solderside") == 0)
- conf_set_editor(show_solder_side, 1);
- else if (isdigit((int) args[i][0])) {
- lno = atoi(args[i]);
- ChangeGroupVisibility(lno, pcb_true, pcb_true);
- }
- else {
- int found = 0;
- for (lno = 0; lno < max_copper_layer; lno++)
- if (strcasecmp(args[i], PCB->Data->Layer[lno].Name) == 0) {
- ChangeGroupVisibility(lno, pcb_true, pcb_true);
- found = 1;
- break;
- }
- if (!found) {
- fprintf(stderr, "Warning: layer \"%s\" not known\n", args[i]);
- if (!listed_layers) {
- fprintf(stderr, "Named layers in this board are:\n");
- listed_layers = 1;
- for (lno = 0; lno < max_copper_layer; lno++)
- fprintf(stderr, "\t%s\n", PCB->Data->Layer[lno].Name);
- fprintf(stderr, "Also: component, solder, rats, invisible, pins, vias, elements or silk, mask, solderside.\n");
- }
- }
- }
- }
-}
-
-/* ----------------------------------------------------------------------
- * lookup the group to which a layer belongs to
- * returns max_group if no group is found, or is
- * passed Layer is equal to max_copper_layer
- */
-int GetGroupOfLayer(int Layer)
-{
- int group, i;
+#warning TODO: layer group cleanup: remove this +2 for the silks
+ if ((Layer < 0) || (Layer > pcb_max_copper_layer+2))
+ return -1;
- if (Layer == max_copper_layer)
- return max_group;
- for (group = 0; group < max_group; group++)
+ for (group = 0; group < pcb_max_group; group++)
for (i = 0; i < PCB->LayerGroups.Number[group]; i++)
if (PCB->LayerGroups.Entries[group][i] == Layer)
return (group);
- return max_group;
-}
-
-
-/* ---------------------------------------------------------------------------
- * returns the layergroup number for the passed pointer
- */
-int GetLayerGroupNumberByPointer(LayerTypePtr Layer)
-{
- return (GetLayerGroupNumberByNumber(GetLayerNumber(PCB->Data, Layer)));
-}
-
-/* ---------------------------------------------------------------------------
- * returns the layergroup number for the passed layernumber
- */
-int GetLayerGroupNumberByNumber(pcb_cardinal_t Layer)
-{
- int group, entry;
-
- for (group = 0; group < max_group; group++)
- for (entry = 0; entry < PCB->LayerGroups.Number[group]; entry++)
- if (PCB->LayerGroups.Entries[group][entry] == Layer)
- return (group);
- /* since every layer belongs to a group it is safe to return
- * the value without boundary checking
- */
- return (group);
+ return -1;
}
-
-/* ---------------------------------------------------------------------------
- * resets the layerstack setting
- */
-void ResetStackAndVisibility(void)
+pcb_layergrp_id_t pcb_layer_get_group_(pcb_layer_t *Layer)
{
- int comp_group;
- pcb_cardinal_t i;
-
- for (i = 0; i < max_copper_layer + 2; i++) {
- if (i < max_copper_layer)
- LayerStack[i] = i;
- PCB->Data->Layer[i].On = pcb_true;
- }
- PCB->ElementOn = pcb_true;
- PCB->InvisibleObjectsOn = pcb_true;
- PCB->PinOn = pcb_true;
- PCB->ViaOn = pcb_true;
- PCB->RatOn = pcb_true;
-
- /* Bring the component group to the front and make it active. */
- comp_group = GetLayerGroupNumberByNumber(component_silk_layer);
- ChangeGroupVisibility(PCB->LayerGroups.Entries[comp_group][0], 1, 1);
+ return pcb_layer_get_group(pcb_layer_id(PCB->Data, Layer));
}
-/* ---------------------------------------------------------------------------
- * saves the layerstack setting
- */
-void SaveStackAndVisibility(void)
+pcb_bool pcb_layer_is_paste_empty(pcb_side_t side)
{
- pcb_cardinal_t i;
- static pcb_bool run = pcb_false;
-
- if (run == pcb_false) {
- SavedStack.cnt = 0;
- run = pcb_true;
- }
-
- if (SavedStack.cnt != 0) {
- fprintf(stderr,
- "SaveStackAndVisibility() layerstack was already saved and not" "yet restored. cnt = %d\n", SavedStack.cnt);
- }
-
- for (i = 0; i < max_copper_layer + 2; i++) {
- if (i < max_copper_layer)
- SavedStack.LayerStack[i] = LayerStack[i];
- SavedStack.LayerOn[i] = PCB->Data->Layer[i].On;
- }
- SavedStack.ElementOn = PCB->ElementOn;
- SavedStack.InvisibleObjectsOn = PCB->InvisibleObjectsOn;
- SavedStack.PinOn = PCB->PinOn;
- SavedStack.ViaOn = PCB->ViaOn;
- SavedStack.RatOn = PCB->RatOn;
- SavedStack.cnt++;
-}
-
-/* ---------------------------------------------------------------------------
- * restores the layerstack setting
- */
-void RestoreStackAndVisibility(void)
-{
- pcb_cardinal_t i;
-
- if (SavedStack.cnt == 0) {
- fprintf(stderr, "RestoreStackAndVisibility() layerstack has not" " been saved. cnt = %d\n", SavedStack.cnt);
- return;
- }
- else if (SavedStack.cnt != 1) {
- fprintf(stderr, "RestoreStackAndVisibility() layerstack save count is" " wrong. cnt = %d\n", SavedStack.cnt);
- }
-
- for (i = 0; i < max_copper_layer + 2; i++) {
- if (i < max_copper_layer)
- LayerStack[i] = SavedStack.LayerStack[i];
- PCB->Data->Layer[i].On = SavedStack.LayerOn[i];
+ pcb_bool paste_empty = pcb_true;
+ PCB_PAD_ALL_LOOP(PCB->Data);
+ {
+ if (PCB_ON_SIDE(pad, side) && !PCB_FLAG_TEST(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) {
+ paste_empty = pcb_false;
+ break;
+ }
}
- PCB->ElementOn = SavedStack.ElementOn;
- PCB->InvisibleObjectsOn = SavedStack.InvisibleObjectsOn;
- PCB->PinOn = SavedStack.PinOn;
- PCB->ViaOn = SavedStack.ViaOn;
- PCB->RatOn = SavedStack.RatOn;
-
- SavedStack.cnt--;
+ PCB_ENDALL_LOOP;
+ return paste_empty;
}
-/***********************************************************************
- * Layer Group Functions
- */
-
-int MoveLayerToGroup(int layer, int group)
+pcb_layergrp_id_t pcb_layer_move_to_group(pcb_layer_id_t layer, pcb_layergrp_id_t group)
{
- int prev, i, j;
+ pcb_layergrp_id_t prev, i, j;
- if (layer < 0 || layer > max_copper_layer + 1)
+ if (layer < 0 || layer > pcb_max_copper_layer + 1)
return -1;
- prev = GetLayerGroupNumberByNumber(layer);
- if ((layer == solder_silk_layer && group == GetLayerGroupNumberByNumber(component_silk_layer))
- || (layer == component_silk_layer && group == GetLayerGroupNumberByNumber(solder_silk_layer))
- || (group < 0 || group >= max_group) || (prev == group))
+ prev = pcb_layer_get_group(layer);
+ if ((layer == pcb_solder_silk_layer && group == pcb_layer_get_group(pcb_component_silk_layer))
+ || (layer == pcb_component_silk_layer && group == pcb_layer_get_group(pcb_solder_silk_layer))
+ || (group < 0 || group >= pcb_max_group) || (prev == group))
return prev;
/* Remove layer from prev group */
@@ -480,67 +313,42 @@ int MoveLayerToGroup(int layer, int group)
return group;
}
-char *LayerGroupsToString(LayerGroupTypePtr lg)
-{
-#if MAX_LAYER < 9998
- /* Allows for layer numbers 0..9999 */
- static char buf[(MAX_LAYER + 2) * 5 + 1];
-#endif
- char *cp = buf;
- char sep = 0;
- int group, entry;
- for (group = 0; group < max_group; group++)
- if (PCB->LayerGroups.Number[group]) {
- if (sep)
- *cp++ = ':';
- sep = 1;
- for (entry = 0; entry < PCB->LayerGroups.Number[group]; entry++) {
- int layer = PCB->LayerGroups.Entries[group][entry];
- if (layer == component_silk_layer) {
- *cp++ = 'c';
- }
- else if (layer == solder_silk_layer) {
- *cp++ = 's';
- }
- else {
- sprintf(cp, "%d", layer + 1);
- while (*++cp);
- }
- if (entry != PCB->LayerGroups.Number[group] - 1)
- *cp++ = ',';
- }
- }
- *cp++ = 0;
- return buf;
-}
+#warning TODO: remove this once we have explicit outline layer
+#define LAYER_IS_OUTLINE(idx) (((idx) > 0) && ((idx) <= pcb_max_copper_layer) && (strcmp(PCB->Data->Layer[idx].Name, "route") == 0 || strcmp(PCB->Data->Layer[(idx)].Name, "outline") == 0))
-unsigned int pcb_layer_flags(int layer_idx)
+unsigned int pcb_layer_flags(pcb_layer_id_t layer_idx)
{
unsigned int res = 0;
- if (layer_idx == solder_silk_layer)
+ if (layer_idx & PCB_LYT_UI)
+ return PCB_LYT_UI | PCB_LYT_VIRTUAL;
+
+ if (layer_idx == pcb_solder_silk_layer)
return PCB_LYT_SILK | PCB_LYT_BOTTOM;
- if (layer_idx == component_silk_layer)
+ if (layer_idx == pcb_component_silk_layer)
return PCB_LYT_SILK | PCB_LYT_TOP;
- if (layer_idx > max_copper_layer+2)
+ if ((layer_idx >= PCB_LAYER_VIRT_MIN) && (layer_idx <= PCB_LAYER_VIRT_MAX))
+ return pcb_virt_layers[layer_idx - PCB_LAYER_VIRT_MIN].type;
+
+ if (layer_idx > pcb_max_copper_layer+2)
return 0;
- if (layer_idx < max_copper_layer) {
+ if (layer_idx < pcb_max_copper_layer) {
if (!LAYER_IS_OUTLINE(layer_idx)) {
/* check whether it's top, bottom or internal */
int group, entry;
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
if (PCB->LayerGroups.Number[group]) {
unsigned int my_group = 0, gf = 0;
for (entry = 0; entry < PCB->LayerGroups.Number[group]; entry++) {
int layer = PCB->LayerGroups.Entries[group][entry];
if (layer == layer_idx)
my_group = 1;
- if (layer == component_silk_layer)
+ if (layer == pcb_component_silk_layer)
gf |= PCB_LYT_TOP;
- else if (layer == solder_silk_layer)
+ else if (layer == pcb_solder_silk_layer)
gf |= PCB_LYT_BOTTOM;
}
if (my_group) {
@@ -560,6 +368,17 @@ unsigned int pcb_layer_flags(int layer_idx)
return res;
}
+unsigned int pcb_layergrp_flags(pcb_layergrp_id_t group)
+{
+ unsigned int res = 0;
+ int layeri;
+
+ for (layeri = 0; layeri < PCB->LayerGroups.Number[group]; layeri++)
+ res |= pcb_layer_flags(PCB->LayerGroups.Entries[group][layeri]);
+
+ return res;
+}
+
#define APPEND(n) \
do { \
if (res != NULL) { \
@@ -572,21 +391,74 @@ unsigned int pcb_layer_flags(int layer_idx)
used++; \
} while(0)
-int pcb_layer_list(pcb_layer_type_t mask, int *res, int res_len)
+/* For now, return only non-silks */
+#define APPEND_VIRT(v) \
+do { \
+ if (v->data_layer_offs < 0) \
+ APPEND(v->new_id); \
+} while(0)
+
+/* this would be how we returned silks from here
+ APPEND(pcb_max_copper_layer + v->data_layer_offs); \
+ else \
+*/
+
+
+const pcb_virt_layer_t *pcb_vlayer_get_first(pcb_layer_type_t mask)
+{
+ const pcb_virt_layer_t *v;
+ mask &= (~PCB_LYT_VIRTUAL);
+ for(v = pcb_virt_layers; v->name != NULL; v++)
+ if (((v->type & (~PCB_LYT_VIRTUAL)) & mask) == mask)
+ return v;
+ return NULL;
+}
+
+
+int pcb_layer_list(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len)
{
int n, used = 0;
+ pcb_virt_layer_t *v;
+
+ for(v = pcb_virt_layers; v->name != NULL; v++)
+ if ((v->type & mask) == mask)
+ APPEND_VIRT(v);
- for (n = 0; n < MAX_LAYER + 2; n++) {
+ for (n = 0; n < PCB_MAX_LAYER + 2; n++)
if ((pcb_layer_flags(n) & mask) == mask)
APPEND(n);
- }
+
+ if (mask == PCB_LYT_UI)
+ for (n = 0; n < vtlayer_len(&pcb_uilayer); n++)
+ APPEND(n | PCB_LYT_UI | PCB_LYT_VIRTUAL);
+
+ return used;
+}
+
+int pcb_layer_list_any(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len)
+{
+ int n, used = 0;
+ pcb_virt_layer_t *v;
+
+ for(v = pcb_virt_layers; v->name != NULL; v++)
+ if ((v->type & mask))
+ APPEND_VIRT(v);
+
+ for (n = 0; n < PCB_MAX_LAYER + 2; n++)
+ if ((pcb_layer_flags(n) & mask))
+ APPEND(n);
+
+ if (mask & PCB_LYT_UI)
+ for (n = 0; n < vtlayer_len(&pcb_uilayer); n++)
+ APPEND(n | PCB_LYT_UI | PCB_LYT_VIRTUAL);
+
return used;
}
-int pcb_layer_group_list(pcb_layer_type_t mask, int *res, int res_len)
+int pcb_layer_group_list(pcb_layer_type_t mask, pcb_layergrp_id_t *res, int res_len)
{
int group, layeri, used = 0;
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
for (layeri = 0; layeri < PCB->LayerGroups.Number[group]; layeri++) {
int layer = PCB->LayerGroups.Entries[group][layeri];
if ((pcb_layer_flags(layer) & mask) == mask) {
@@ -599,19 +471,35 @@ int pcb_layer_group_list(pcb_layer_type_t mask, int *res, int res_len)
return used;
}
-int pcb_layer_by_name(const char *name)
+int pcb_layer_group_list_any(pcb_layer_type_t mask, pcb_layergrp_id_t *res, int res_len)
+{
+ int group, layeri, used = 0;
+ for (group = 0; group < pcb_max_group; group++) {
+ for (layeri = 0; layeri < PCB->LayerGroups.Number[group]; layeri++) {
+ int layer = PCB->LayerGroups.Entries[group][layeri];
+ if ((pcb_layer_flags(layer) & mask)) {
+ APPEND(group);
+ goto added; /* do not add a group twice */
+ }
+ }
+ added:;
+ }
+ return used;
+}
+
+pcb_layer_id_t pcb_layer_by_name(const char *name)
{
int n;
- for (n = 0; n < max_copper_layer + 2; n++)
+ for (n = 0; n < pcb_max_copper_layer + 2; n++)
if (strcmp(PCB->Data->Layer[n].Name, name) == 0)
return n;
return -1;
}
-int pcb_layer_lookup_group(int layer_id)
+pcb_layergrp_id_t pcb_layer_lookup_group(pcb_layer_id_t layer_id)
{
int group, layeri;
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
for (layeri = 0; layeri < PCB->LayerGroups.Number[group]; layeri++) {
int layer = PCB->LayerGroups.Entries[group][layeri];
if (layer == layer_id)
@@ -621,7 +509,7 @@ int pcb_layer_lookup_group(int layer_id)
return -1;
}
-void pcb_layer_add_in_group(int layer_id, int group_id)
+void pcb_layer_add_in_group(pcb_layer_id_t layer_id, pcb_layergrp_id_t group_id)
{
int glen = PCB->LayerGroups.Number[group_id];
PCB->LayerGroups.Entries[group_id][glen] = layer_id;
@@ -634,38 +522,43 @@ void pcb_layers_reset()
int n;
/* reset layer names */
- for(n = 2; n < MAX_LAYER; n++) {
+ for(n = 2; n < PCB_MAX_LAYER; n++) {
if (PCB->Data->Layer[n].Name != NULL)
free((char *)PCB->Data->Layer[n].Name);
PCB->Data->Layer[n].Name = pcb_strdup("<pcb_layers_reset>");
}
/* reset layer groups */
- for(n = 0; n < MAX_LAYER; n++)
+ for(n = 0; n < PCB_MAX_LAYERGRP; n++)
PCB->LayerGroups.Number[n] = 0;
/* set up one copper layer on top and one on bottom */
PCB->Data->LayerN = 2;
- PCB->LayerGroups.Number[SOLDER_LAYER] = 1;
- PCB->LayerGroups.Number[COMPONENT_LAYER] = 1;
- PCB->LayerGroups.Entries[SOLDER_LAYER][0] = SOLDER_LAYER;
- PCB->LayerGroups.Entries[COMPONENT_LAYER][0] = COMPONENT_LAYER;
+ PCB->LayerGroups.Number[PCB_SOLDER_SIDE] = 1;
+ PCB->LayerGroups.Number[PCB_COMPONENT_SIDE] = 1;
+ PCB->LayerGroups.Entries[PCB_SOLDER_SIDE][0] = PCB_SOLDER_SIDE;
+ PCB->LayerGroups.Entries[PCB_COMPONENT_SIDE][0] = PCB_COMPONENT_SIDE;
/* Name top and bottom layers */
- if (PCB->Data->Layer[COMPONENT_LAYER].Name != NULL)
- free((char *)PCB->Data->Layer[COMPONENT_LAYER].Name);
- PCB->Data->Layer[COMPONENT_LAYER].Name = pcb_strdup("<top>");
+ if (PCB->Data->Layer[PCB_COMPONENT_SIDE].Name != NULL)
+ free((char *)PCB->Data->Layer[PCB_COMPONENT_SIDE].Name);
+ PCB->Data->Layer[PCB_COMPONENT_SIDE].Name = pcb_strdup("<top>");
- if (PCB->Data->Layer[SOLDER_LAYER].Name != NULL)
- free((char *)PCB->Data->Layer[SOLDER_LAYER].Name);
- PCB->Data->Layer[SOLDER_LAYER].Name = pcb_strdup("<bottom>");
+ if (PCB->Data->Layer[PCB_SOLDER_SIDE].Name != NULL)
+ free((char *)PCB->Data->Layer[PCB_SOLDER_SIDE].Name);
+ PCB->Data->Layer[PCB_SOLDER_SIDE].Name = pcb_strdup("<bottom>");
}
-int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reuse_group, const char *lname)
+pcb_layer_id_t pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reuse_group, const char *lname)
{
- int id, grp = -1, found;
- unsigned int loc = type & PCB_LYT_ANYWHERE;
- unsigned int role = type & PCB_LYT_ANYTHING;
+ pcb_layer_id_t id;
+ pcb_layergrp_id_t grp = -1;
+ int found;
+ unsigned long loc = type & PCB_LYT_ANYWHERE;
+ pcb_layer_type_t role = type & PCB_LYT_ANYTHING;
+
+ if ((type & PCB_LYT_VIRTUAL) || (type & PCB_LYT_LOGICAL))
+ return -1;
/* look for an existing layer if reuse is enabled */
if (reuse_layer) {
@@ -673,14 +566,31 @@ int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reu
case PCB_LYT_MASK:
case PCB_LYT_PASTE:
case PCB_LYT_SILK:
- return -1; /* do not create silk, paste or mask layers, they are special */
+ case PCB_LYT_FAB:
+ case PCB_LYT_ASSY:
+ case PCB_LYT_RAT:
+ case PCB_LYT_INVIS:
+ case PCB_LYT_VIRTUAL:
+ case PCB_LYT_ANYTHING:
+ case PCB_LYT_ANYWHERE:
+ case PCB_LYT_ANYPROP:
+ case PCB_LYT_UDRILL:
+ case PCB_LYT_PDRILL:
+ case PCB_LYT_UI:
+ return -1; /* do not create virtual layers */
+
+ case PCB_LYT_INTERN:
+ case PCB_LYT_TOP:
+ case PCB_LYT_BOTTOM:
+ case PCB_LYT_LOGICAL:
+ return -1; /* suppress compiler warnings */
case PCB_LYT_COPPER:
switch(loc) {
- case PCB_LYT_TOP: return COMPONENT_LAYER;
- case PCB_LYT_BOTTOM: return SOLDER_LAYER;
+ case PCB_LYT_TOP: return PCB_COMPONENT_SIDE;
+ case PCB_LYT_BOTTOM: return PCB_SOLDER_SIDE;
case PCB_LYT_INTERN:
- for(grp = 2; grp < MAX_LAYER; grp++) {
+ for(grp = 2; grp < PCB_MAX_LAYERGRP; grp++) {
if (PCB->LayerGroups.Number[grp] > 0) {
id = PCB->LayerGroups.Entries[grp][0];
if (strcmp(PCB->Data->Layer[id].Name, "outline") != 0)
@@ -692,7 +602,7 @@ int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reu
break;
case PCB_LYT_OUTLINE:
- for(grp = 2; grp < MAX_LAYER; grp++) {
+ for(grp = 2; grp < PCB_MAX_LAYERGRP; grp++) {
if (PCB->LayerGroups.Number[grp] > 0) {
id = PCB->LayerGroups.Entries[grp][0];
if (strcmp(PCB->Data->Layer[id].Name, "outline") == 0)
@@ -720,8 +630,8 @@ int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reu
/* there's only one top and bottom group, always reuse them */
if (role == PCB_LYT_COPPER) {
switch(loc) {
- case PCB_LYT_TOP: grp = COMPONENT_LAYER; reuse_group = 0; break;
- case PCB_LYT_BOTTOM: grp = SOLDER_LAYER; reuse_group = 0; break;
+ case PCB_LYT_TOP: grp = PCB_COMPONENT_SIDE; reuse_group = 0; break;
+ case PCB_LYT_BOTTOM: grp = PCB_SOLDER_SIDE; reuse_group = 0; break;
}
}
@@ -730,7 +640,24 @@ int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reu
case PCB_LYT_MASK:
case PCB_LYT_PASTE:
case PCB_LYT_SILK:
- return -1; /* do not create silk, paste or mask layers, they are special */
+ case PCB_LYT_FAB:
+ case PCB_LYT_ASSY:
+ case PCB_LYT_RAT:
+ case PCB_LYT_INVIS:
+ case PCB_LYT_VIRTUAL:
+ case PCB_LYT_ANYTHING:
+ case PCB_LYT_ANYWHERE:
+ case PCB_LYT_ANYPROP:
+ case PCB_LYT_UDRILL:
+ case PCB_LYT_PDRILL:
+ case PCB_LYT_UI:
+ return -1; /* do not create virtual layers */
+
+ case PCB_LYT_INTERN:
+ case PCB_LYT_TOP:
+ case PCB_LYT_BOTTOM:
+ case PCB_LYT_LOGICAL:
+ return -1; /* suppress compiler warnings */
case PCB_LYT_COPPER:
switch(loc) {
@@ -739,7 +666,7 @@ int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reu
abort(); /* can't get here */
case PCB_LYT_INTERN:
/* find the first internal layer */
- for(found = 0, grp = 2; grp < MAX_LAYER; grp++) {
+ for(found = 0, grp = 2; grp < PCB_MAX_LAYERGRP; grp++) {
if (PCB->LayerGroups.Number[grp] > 0) {
id = PCB->LayerGroups.Entries[grp][0];
if (strcmp(PCB->Data->Layer[id].Name, "outline") != 0) {
@@ -760,10 +687,10 @@ int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reu
if (grp < 0) {
/* Also need to create a group */
- for(grp = 0; grp < MAX_LAYER; grp++)
+ for(grp = 0; grp < PCB_MAX_LAYERGRP; grp++)
if (PCB->LayerGroups.Number[grp] == 0)
break;
- if (grp >= MAX_LAYER)
+ if (grp >= PCB_MAX_LAYERGRP)
return -2;
}
@@ -787,35 +714,35 @@ static void hack_in_silks()
{
int sl, cl, found, n;
- sl = SOLDER_LAYER + PCB->Data->LayerN;
- for(found = 0, n = 0; n < PCB->LayerGroups.Number[SOLDER_LAYER]; n++)
- if (PCB->LayerGroups.Entries[SOLDER_LAYER][n] == sl)
+ sl = PCB_SOLDER_SIDE + PCB->Data->LayerN;
+ for(found = 0, n = 0; n < PCB->LayerGroups.Number[PCB_SOLDER_SIDE]; n++)
+ if (PCB->LayerGroups.Entries[PCB_SOLDER_SIDE][n] == sl)
found = 1;
if (!found) {
- PCB->LayerGroups.Entries[SOLDER_LAYER][PCB->LayerGroups.Number[SOLDER_LAYER]] = sl;
- PCB->LayerGroups.Number[SOLDER_LAYER]++;
+ PCB->LayerGroups.Entries[PCB_SOLDER_SIDE][PCB->LayerGroups.Number[PCB_SOLDER_SIDE]] = sl;
+ PCB->LayerGroups.Number[PCB_SOLDER_SIDE]++;
if (PCB->Data->Layer[sl].Name != NULL)
free((char *)PCB->Data->Layer[sl].Name);
PCB->Data->Layer[sl].Name = pcb_strdup("silk");
}
- cl = COMPONENT_LAYER + PCB->Data->LayerN;
- for(found = 0, n = 0; n < PCB->LayerGroups.Number[COMPONENT_LAYER]; n++)
- if (PCB->LayerGroups.Entries[COMPONENT_LAYER][n] == cl)
+ cl = PCB_COMPONENT_SIDE + PCB->Data->LayerN;
+ for(found = 0, n = 0; n < PCB->LayerGroups.Number[PCB_COMPONENT_SIDE]; n++)
+ if (PCB->LayerGroups.Entries[PCB_COMPONENT_SIDE][n] == cl)
found = 1;
if (!found) {
- PCB->LayerGroups.Entries[COMPONENT_LAYER][PCB->LayerGroups.Number[COMPONENT_LAYER]] = cl;
- PCB->LayerGroups.Number[COMPONENT_LAYER]++;
+ PCB->LayerGroups.Entries[PCB_COMPONENT_SIDE][PCB->LayerGroups.Number[PCB_COMPONENT_SIDE]] = cl;
+ PCB->LayerGroups.Number[PCB_COMPONENT_SIDE]++;
if (PCB->Data->Layer[cl].Name != NULL)
free((char *)PCB->Data->Layer[cl].Name);
PCB->Data->Layer[cl].Name = pcb_strdup("silk");
}
}
-int pcb_layer_rename(int layer, const char *lname)
+int pcb_layer_rename(pcb_layer_id_t layer, const char *lname)
{
if (PCB->Data->Layer[layer].Name != NULL)
free((char *)PCB->Data->Layer[layer].Name);
@@ -829,3 +756,279 @@ void pcb_layers_finalize()
}
#undef APPEND
+
+/* ---------------------------------------------------------------------------
+ * move layer
+ * moves the selected layers to a new index in the layer list.
+ */
+
+static void move_one_thermal(int old_index, int new_index, pcb_pin_t * pin)
+{
+ int t1 = 0, i;
+ int oi = old_index, ni = new_index;
+
+ if (old_index != -1)
+ t1 = PCB_FLAG_THERM_GET(old_index, pin);
+
+ if (oi == -1)
+ oi = PCB_MAX_LAYER - 1; /* inserting a layer */
+ if (ni == -1)
+ ni = PCB_MAX_LAYER - 1; /* deleting a layer */
+
+ if (oi < ni) {
+ for (i = oi; i < ni; i++)
+ PCB_FLAG_THERM_ASSIGN(i, PCB_FLAG_THERM_GET(i + 1, pin), pin);
+ }
+ else {
+ for (i = oi; i > ni; i--)
+ PCB_FLAG_THERM_ASSIGN(i, PCB_FLAG_THERM_GET(i - 1, pin), pin);
+ }
+
+ if (new_index != -1)
+ PCB_FLAG_THERM_ASSIGN(new_index, t1, pin);
+ else
+ PCB_FLAG_THERM_ASSIGN(ni, 0, pin);
+}
+
+static void move_all_thermals(int old_index, int new_index)
+{
+ PCB_VIA_LOOP(PCB->Data);
+ {
+ move_one_thermal(old_index, new_index, via);
+ }
+ PCB_END_LOOP;
+
+ PCB_PIN_ALL_LOOP(PCB->Data);
+ {
+ move_one_thermal(old_index, new_index, pin);
+ }
+ PCB_ENDALL_LOOP;
+}
+
+static int LastLayerInComponentGroup(int layer)
+{
+ pcb_layergrp_id_t cgroup = pcb_layer_get_group(pcb_max_group + PCB_COMPONENT_SIDE);
+ pcb_layergrp_id_t lgroup = pcb_layer_get_group(layer);
+ if (cgroup == lgroup && PCB->LayerGroups.Number[lgroup] == 2)
+ return 1;
+ return 0;
+}
+
+static int LastLayerInSolderGroup(int layer)
+{
+ int sgroup = pcb_layer_get_group(pcb_max_group + PCB_SOLDER_SIDE);
+ int lgroup = pcb_layer_get_group(layer);
+ if (sgroup == lgroup && PCB->LayerGroups.Number[lgroup] == 2)
+ return 1;
+ return 0;
+}
+
+int pcb_layer_rename_(pcb_layer_t *Layer, char *Name)
+{
+ free((char*)Layer->Name);
+ Layer->Name = Name;
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ return 0;
+}
+
+int pcb_layer_move(pcb_layer_id_t old_index, pcb_layer_id_t new_index)
+{
+ int groups[PCB_MAX_LAYERGRP + 2], l, g;
+ pcb_layer_t saved_layer;
+ int saved_group;
+
+ pcb_undo_add_layer_move(old_index, new_index);
+ pcb_undo_inc_serial();
+
+ if (old_index < -1 || old_index >= pcb_max_copper_layer) {
+ pcb_message(PCB_MSG_ERROR, "Invalid old layer %d for move: must be -1..%d\n", old_index, pcb_max_copper_layer - 1);
+ return 1;
+ }
+ if (new_index < -1 || new_index > pcb_max_copper_layer || new_index >= PCB_MAX_LAYER) {
+ pcb_message(PCB_MSG_ERROR, "Invalid new layer %d for move: must be -1..%d\n", new_index, pcb_max_copper_layer);
+ return 1;
+ }
+ if (old_index == new_index)
+ return 0;
+
+ if (new_index == -1 && LastLayerInComponentGroup(old_index)) {
+ pcb_gui->confirm_dialog("You can't delete the last top-side layer\n", "Ok", NULL);
+ return 1;
+ }
+
+ if (new_index == -1 && LastLayerInSolderGroup(old_index)) {
+ pcb_gui->confirm_dialog("You can't delete the last bottom-side layer\n", "Ok", NULL);
+ return 1;
+ }
+
+ for (g = 0; g < PCB_MAX_LAYERGRP + 2; g++)
+ groups[g] = -1;
+
+ for (g = 0; g < PCB_MAX_LAYERGRP; g++)
+ for (l = 0; l < PCB->LayerGroups.Number[g]; l++)
+ groups[PCB->LayerGroups.Entries[g][l]] = g;
+
+ if (old_index == -1) {
+ pcb_layer_t *lp;
+ if (pcb_max_copper_layer == PCB_MAX_LAYER) {
+ pcb_message(PCB_MSG_ERROR, "No room for new layers\n");
+ return 1;
+ }
+ /* Create a new layer at new_index. */
+ lp = &PCB->Data->Layer[new_index];
+ memmove(&PCB->Data->Layer[new_index + 1],
+ &PCB->Data->Layer[new_index], (pcb_max_copper_layer - new_index + 2) * sizeof(pcb_layer_t));
+ memmove(&groups[new_index + 1], &groups[new_index], (pcb_max_copper_layer - new_index + 2) * sizeof(int));
+ pcb_max_copper_layer++;
+ memset(lp, 0, sizeof(pcb_layer_t));
+ lp->On = 1;
+ lp->Name = pcb_strdup("New Layer");
+ lp->Color = conf_core.appearance.color.layer[new_index];
+ lp->SelectedColor = conf_core.appearance.color.layer_selected[new_index];
+ for (l = 0; l < pcb_max_copper_layer; l++)
+ if (pcb_layer_stack[l] >= new_index)
+ pcb_layer_stack[l]++;
+ pcb_layer_stack[pcb_max_copper_layer - 1] = new_index;
+ }
+ else if (new_index == -1) {
+ /* Delete the layer at old_index */
+ memmove(&PCB->Data->Layer[old_index],
+ &PCB->Data->Layer[old_index + 1], (pcb_max_copper_layer - old_index + 2 - 1) * sizeof(pcb_layer_t));
+ memset(&PCB->Data->Layer[pcb_max_copper_layer + 1], 0, sizeof(pcb_layer_t));
+ memmove(&groups[old_index], &groups[old_index + 1], (pcb_max_copper_layer - old_index + 2 - 1) * sizeof(int));
+ for (l = 0; l < pcb_max_copper_layer; l++)
+ if (pcb_layer_stack[l] == old_index)
+ memmove(pcb_layer_stack + l, pcb_layer_stack + l + 1, (pcb_max_copper_layer - l - 1) * sizeof(pcb_layer_stack[0]));
+ pcb_max_copper_layer--;
+ for (l = 0; l < pcb_max_copper_layer; l++)
+ if (pcb_layer_stack[l] > old_index)
+ pcb_layer_stack[l]--;
+ }
+ else {
+ /* Move an existing layer */
+ memcpy(&saved_layer, &PCB->Data->Layer[old_index], sizeof(pcb_layer_t));
+ saved_group = groups[old_index];
+ if (old_index < new_index) {
+ memmove(&PCB->Data->Layer[old_index], &PCB->Data->Layer[old_index + 1], (new_index - old_index) * sizeof(pcb_layer_t));
+ memmove(&groups[old_index], &groups[old_index + 1], (new_index - old_index) * sizeof(int));
+ }
+ else {
+ memmove(&PCB->Data->Layer[new_index + 1], &PCB->Data->Layer[new_index], (old_index - new_index) * sizeof(pcb_layer_t));
+ memmove(&groups[new_index + 1], &groups[new_index], (old_index - new_index) * sizeof(int));
+ }
+ memcpy(&PCB->Data->Layer[new_index], &saved_layer, sizeof(pcb_layer_t));
+ groups[new_index] = saved_group;
+ }
+
+ move_all_thermals(old_index, new_index);
+
+ for (g = 0; g < PCB_MAX_LAYERGRP; g++)
+ PCB->LayerGroups.Number[g] = 0;
+ for (l = 0; l < pcb_max_copper_layer + 2; l++) {
+ int i;
+ g = groups[l];
+ if (g >= 0) {
+ i = PCB->LayerGroups.Number[g]++;
+ PCB->LayerGroups.Entries[g][i] = l;
+ }
+ }
+
+ for (g = 0; g < PCB_MAX_LAYERGRP; g++)
+ if (PCB->LayerGroups.Number[g] == 0) {
+ memmove(&PCB->LayerGroups.Number[g],
+ &PCB->LayerGroups.Number[g + 1], (PCB_MAX_LAYERGRP - g - 1) * sizeof(PCB->LayerGroups.Number[g]));
+ memmove(&PCB->LayerGroups.Entries[g],
+ &PCB->LayerGroups.Entries[g + 1], (PCB_MAX_LAYERGRP - g - 1) * sizeof(PCB->LayerGroups.Entries[g]));
+ }
+
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ pcb_gui->invalidate_all();
+ return 0;
+}
+
+const char *pcb_layer_name(pcb_layer_id_t id)
+{
+ if (id < 0)
+ return NULL;
+ if (id < pcb_max_copper_layer+2)
+ return PCB->Data->Layer[id].Name;
+ if ((id >= PCB_LAYER_VIRT_MIN) && (id <= PCB_LAYER_VIRT_MAX))
+ return pcb_virt_layers[id-PCB_LAYER_VIRT_MIN].name;
+ return NULL;
+}
+
+pcb_layer_t *pcb_get_layer(pcb_layer_id_t id)
+{
+ if ((id >= 0) && (id < pcb_max_copper_layer+2))
+ return &PCB->Data->Layer[id];
+ if (id & PCB_LYT_UI) {
+ id &= ~(PCB_LYT_VIRTUAL | PCB_LYT_UI);
+ if ((id >= 0) && (id < vtlayer_len(&pcb_uilayer)))
+ return &(pcb_uilayer.array[id]);
+ }
+ return NULL;
+}
+
+int pcb_layer_type_map(pcb_layer_type_t type, void *ctx, void (*cb)(void *ctx, pcb_layer_type_t bit, const char *name, int class, const char *class_name))
+{
+ const pcb_layer_type_name_t *n;
+ int found = 0;
+ for(n = pcb_layer_type_names; n->name != NULL; n++) {
+ if (type & n->type) {
+ cb(ctx, n->type, n->name, n->class, pcb_layer_type_class_names[n->class]);
+ found++;
+ }
+ }
+ return found;
+}
+
+int pcb_layer_gui_set_vlayer(pcb_virtual_layer_t vid, int is_empty)
+{
+ pcb_virt_layer_t *v = &pcb_virt_layers[vid];
+ assert((vid >= 0) && (vid < PCB_VLY_end));
+
+ /* if there's no GUI, that means no draw should be done */
+ if (pcb_gui == NULL)
+ return 0;
+
+#warning TODO: need to pass the flags of the group, not the flags of the layer once we have a group for each layer
+ if (pcb_gui->set_layer_group != NULL) {
+ pcb_layer_id_t lid = v->data_layer_offs;
+ pcb_layergrp_id_t grp;
+ if (lid >= 0)
+ lid += pcb_max_copper_layer;
+ grp = pcb_layer_lookup_group(lid);
+ return pcb_gui->set_layer_group(grp, lid, v->type, is_empty);
+ }
+
+ /* if the GUI doesn't have a set_layer, assume it wants to draw all layers */
+ return 1;
+}
+
+int pcb_layer_gui_set_glayer(pcb_layergrp_id_t grp, int is_empty)
+{
+ /* if there's no GUI, that means no draw should be done */
+ if (pcb_gui == NULL)
+ return 0;
+
+ if (pcb_gui->set_layer_group != NULL)
+ return pcb_gui->set_layer_group(grp, PCB->LayerGroups.Entries[grp][0], pcb_layergrp_flags(grp), is_empty);
+
+ /* if the GUI doesn't have a set_layer, assume it wants to draw all layers */
+ return 1;
+}
+
+
+int pcb_layer_gui_set_g_ui(pcb_layer_t *first, int is_empty)
+{
+ /* if there's no GUI, that means no draw should be done */
+ if (pcb_gui == NULL)
+ return 0;
+
+ if (pcb_gui->set_layer_group != NULL)
+ return pcb_gui->set_layer_group(-1, first, PCB_LYT_VIRTUAL | PCB_LYT_UI, is_empty);
+
+ /* if the GUI doesn't have a set_layer, assume it wants to draw all layers */
+ return 1;
+}
+
diff --git a/src/layer.h b/src/layer.h
index 962f394..2d84aa1 100644
--- a/src/layer.h
+++ b/src/layer.h
@@ -25,115 +25,201 @@
*
*/
-/* prototypes for layer manipulation */
+#ifndef PCB_LAYER_H
+#define PCB_LAYER_H
-/* Returns pcb_true if the given layer is empty (there are no objects on the layer) */
-pcb_bool IsLayerEmpty(LayerTypePtr);
-pcb_bool IsLayerNumEmpty(int);
+#include "globalconst.h"
+#include "global_typedefs.h"
+#include "attrib.h"
+#include "obj_all_list.h"
-/* Returns pcb_true if all layers in a group are empty */
-pcb_bool IsLayerGroupEmpty(int);
+typedef long int pcb_layer_id_t;
+typedef long int pcb_layergrp_id_t;
+/* ----------------------------------------------------------------------
+ * layer group. A layer group identifies layers which are always switched
+ * on/off together.
+ */
+struct pcb_layer_group_s {
+ pcb_cardinal_t Number[PCB_MAX_LAYERGRP], /* number of entries per groups */
+ Entries[PCB_MAX_LAYERGRP][PCB_MAX_LAYER + 2];
+};
-/************ OLD API - new code should not use these **************/
+struct pcb_layer_s { /* holds information about one layer */
+ const char *Name; /* layer name */
+ linelist_t Line;
+ textlist_t Text;
+ polylist_t Polygon;
+ arclist_t Arc;
+ pcb_rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree;
+ pcb_bool On; /* visible flag */
+ const char *Color; /* color */
+ const char *SelectedColor;
+ pcb_attribute_list_t Attributes;
+ int no_drc; /* whether to ignore the layer when checking the design rules */
+
+ const char *cookie; /* for UI layers: registration cookie; NULL for unused UI layers */
+};
-int ParseGroupString(const char *, LayerGroupTypePtr, int /* LayerN */ );
-int GetLayerNumber(DataTypePtr, LayerTypePtr);
-int GetLayerGroupNumberByPointer(LayerTypePtr);
-int GetLayerGroupNumberByNumber(pcb_cardinal_t);
-int GetGroupOfLayer(int);
-int ChangeGroupVisibility(int, pcb_bool, pcb_bool);
-void LayerStringToLayerStack(const char *);
+/* returns the layer number for the passed copper or silk layer pointer */
+pcb_layer_id_t pcb_layer_id(pcb_data_t *Data, pcb_layer_t *Layer);
+
+/* lookup the group to which a layer belongs to returns -1 if no group is found */
+pcb_layergrp_id_t pcb_layer_get_group(pcb_layer_id_t Layer);
+pcb_layergrp_id_t pcb_layer_get_group_(pcb_layer_t *Layer);
+
+/* the offsets of the two additional special layers (e.g. silk) for 'component'
+ and 'solder'. The offset of PCB_MAX_LAYER is not added here. Also can be
+ used to address side of the board without referencing to groups or layers. */
+typedef enum {
+ PCB_SOLDER_SIDE = 0,
+ PCB_COMPONENT_SIDE = 1
+} pcb_side_t;
+
+pcb_bool pcb_layer_is_paste_empty(pcb_side_t side);
-/* Layer Group Functions */
/* Returns group actually moved to (i.e. either group or previous) */
-int MoveLayerToGroup(int layer, int group);
+pcb_layergrp_id_t pcb_layer_move_to_group(pcb_layer_id_t layer, pcb_layergrp_id_t group);
-/* Returns pointer to private buffer */
-char *LayerGroupsToString(LayerGroupTypePtr);
+/************ OLD API - new code should not use these **************/
-#define LAYER_ON_STACK(n) (&PCB->Data->Layer[LayerStack[(n)]])
+#define LAYER_ON_STACK(n) (&PCB->Data->Layer[pcb_layer_stack[(n)]])
#define LAYER_PTR(n) (&PCB->Data->Layer[(n)])
#define CURRENT (PCB->SilkActive ? &PCB->Data->Layer[ \
- (conf_core.editor.show_solder_side ? solder_silk_layer : component_silk_layer)] \
+ (conf_core.editor.show_solder_side ? pcb_solder_silk_layer : pcb_component_silk_layer)] \
: LAYER_ON_STACK(0))
#define INDEXOFCURRENT (PCB->SilkActive ? \
- (conf_core.editor.show_solder_side ? solder_silk_layer : component_silk_layer) \
- : LayerStack[0])
+ (conf_core.editor.show_solder_side ? pcb_solder_silk_layer : pcb_component_silk_layer) \
+ : pcb_layer_stack[0])
#define SILKLAYER Layer[ \
- (conf_core.editor.show_solder_side ? solder_silk_layer : component_silk_layer)]
+ (conf_core.editor.show_solder_side ? pcb_solder_silk_layer : pcb_component_silk_layer)]
#define BACKSILKLAYER Layer[ \
- (conf_core.editor.show_solder_side ? component_silk_layer : solder_silk_layer)]
+ (conf_core.editor.show_solder_side ? pcb_component_silk_layer : pcb_solder_silk_layer)]
-#define TEST_SILK_LAYER(layer) (GetLayerNumber (PCB->Data, layer) >= max_copper_layer)
+#define TEST_SILK_LAYER(layer) (pcb_layer_id(PCB->Data, layer) >= pcb_max_copper_layer)
-/* These decode the set_layer index. */
-#define SL_TYPE(x) ((x) < 0 ? (x) & 0x0f0 : 0)
-#define SL_SIDE(x) ((x) & 0x00f)
-#define SL_MYSIDE(x) ((((x) & SL_BOTTOM_SIDE)!=0) == (SWAP_IDENT != 0))
+#define GROUP_LOOP(data, group) do { \
+ pcb_cardinal_t entry; \
+ for (entry = 0; entry < ((pcb_board_t *)(data->pcb))->LayerGroups.Number[(group)]; entry++) \
+ { \
+ pcb_layer_t *layer; \
+ pcb_cardinal_t number; \
+ number = ((pcb_board_t *)(data->pcb))->LayerGroups.Entries[(group)][entry]; \
+ if (number >= pcb_max_copper_layer) \
+ continue; \
+ layer = &data->Layer[number];
-#define SL_0_SIDE 0x0000
-#define SL_TOP_SIDE 0x0001
-#define SL_BOTTOM_SIDE 0x0002
-#define SL_SILK 0x0010
-#define SL_MASK 0x0020
-#define SL_PDRILL 0x0030
-#define SL_UDRILL 0x0040
-#define SL_PASTE 0x0050
-#define SL_INVISIBLE 0x0060
-#define SL_FAB 0x0070
-#define SL_ASSY 0x0080
-#define SL_RATS 0x0090
-/* Callers should use this. */
-#define SL(type,side) (~0xfff | SL_##type | SL_##side##_SIDE)
+#define LAYER_LOOP(data, ml) do { \
+ pcb_cardinal_t n; \
+ for (n = 0; n < ml; n++) \
+ { \
+ pcb_layer_t *layer = (&data->Layer[(n)]);
+/************ NEW API - new code should use these **************/
-#define LAYER_IS_OUTLINE(idx) (strcmp(PCB->Data->Layer[idx].Name, "route") == 0 || strcmp(PCB->Data->Layer[idx].Name, "outline") == 0)
+/* Return the layer pointer (or NULL on invalid or virtual layers) for an id */
+pcb_layer_t *pcb_get_layer(pcb_layer_id_t id);
-/************ NEW API - new code should use these **************/
+/* Return the name of a layer (real or virtual) or NULL on error */
+const char *pcb_layer_name(pcb_layer_id_t id);
+
+/* Returns pcb_true if the given layer is empty (there are no objects on the layer) */
+pcb_bool pcb_layer_is_empty_(pcb_layer_t *ly);
+pcb_bool pcb_layer_is_empty(pcb_layer_id_t ly);
+#define PCB_LAYER_IS_EMPTY(layer) pcb_layer_is_empty_((layer))
+
+/* Returns pcb_true if all layers in a group are empty */
+pcb_bool pcb_is_layergrp_empty(pcb_layergrp_id_t lgrp);
/* Layer type bitfield */
typedef enum {
/* Stack-up (vertical position): */
- PCB_LYT_TOP = 0x0001, /* layer is on the top side of the board */
- PCB_LYT_BOTTOM = 0x0002, /* layer is on the bottom side of the board */
- PCB_LYT_INTERN = 0x0004, /* layer is internal */
- PCB_LYT_ANYWHERE = 0x00FF, /* MASK: layer is anywhere on the stack */
+ PCB_LYT_TOP = 0x00000001, /* layer is on the top side of the board */
+ PCB_LYT_BOTTOM = 0x00000002, /* layer is on the bottom side of the board */
+ PCB_LYT_INTERN = 0x00000004, /* layer is internal */
+ PCB_LYT_LOGICAL = 0x00000008, /* not in the layer stackup (typically aux drawing layer ) */
+ PCB_LYT_ANYWHERE = 0x000000FF, /* MASK: layer is anywhere on the stack */
/* What the layer consists of */
- PCB_LYT_COPPER = 0x0100, /* copper objects */
- PCB_LYT_SILK = 0x0200, /* silk objects */
- PCB_LYT_MASK = 0x0400, /* solder mask */
- PCB_LYT_PASTE = 0x0800, /* paste */
- PCB_LYT_OUTLINE = 0x1000, /* outline (contour of the board) */
- PCB_LYT_ANYTHING = 0xFF00 /* MASK */
+ PCB_LYT_COPPER = 0x00000100, /* copper objects */
+ PCB_LYT_SILK = 0x00000200, /* silk objects */
+ PCB_LYT_MASK = 0x00000400, /* solder mask */
+ PCB_LYT_PASTE = 0x00000800, /* paste */
+ PCB_LYT_OUTLINE = 0x00001000, /* outline (contour of the board) */
+ PCB_LYT_RAT = 0x00002000, /* (virtual) rats nest (one, not in the stackup) */
+ PCB_LYT_INVIS = 0x00004000, /* (virtual) layer is invisible (one, not in the stackup) */
+ PCB_LYT_ASSY = 0x00008000, /* (virtual) assembly drawing (top and bottom) */
+ PCB_LYT_FAB = 0x00010000, /* (virtual) fab drawing (one, not in the stackup) */
+ PCB_LYT_PDRILL = 0x00020000, /* (virtual) plated drills (affects all physical layers) */
+ PCB_LYT_UDRILL = 0x00040000, /* (virtual) unplated drills (affects all physical layers) */
+ PCB_LYT_UI = 0x00080000, /* (virtual) user interface drawings (feature plugins use this for displaying states or debug info) */
+ PCB_LYT_ANYTHING = 0x00FFFF00, /* MASK: layers consist anything */
+
+ /* misc properties */
+ PCB_LYT_VIRTUAL = 0x01000000, /* the layer is not in the layer array (generated layer) */
+ PCB_LYT_ANYPROP = 0x7F000000 /* MASK: misc layer properties */
} pcb_layer_type_t;
+typedef enum {
+ PCB_VLY_INVISIBLE,
+ PCB_VLY_TOP_MASK,
+ PCB_VLY_BOTTOM_MASK,
+ PCB_VLY_TOP_SILK,
+ PCB_VLY_BOTTOM_SILK,
+ PCB_VLY_RATS,
+ PCB_VLY_TOP_PASTE,
+ PCB_VLY_BOTTOM_PASTE,
+ PCB_VLY_TOP_ASSY,
+ PCB_VLY_BOTTOM_ASSY,
+ PCB_VLY_FAB,
+ PCB_VLY_PLATED_DRILL,
+ PCB_VLY_UNPLATED_DRILL,
+
+ /* for determining the range, do not use */
+ PCB_VLY_end,
+ PCB_VLY_first = PCB_VLY_INVISIBLE
+} pcb_virtual_layer_t;
+
+/* call the gui to set a virtual layer or a layer group or the UI layer group */
+int pcb_layer_gui_set_vlayer(pcb_virtual_layer_t vid, int is_empty);
+int pcb_layer_gui_set_glayer(pcb_layergrp_id_t grp, int is_empty);
+int pcb_layer_gui_set_g_ui(pcb_layer_t *first, int is_empty);
+
+
/* returns a bitfield of pcb_layer_type_t; returns 0 if layer_idx is invalid. */
-unsigned int pcb_layer_flags(int layer_idx);
+unsigned int pcb_layer_flags(pcb_layer_id_t layer_idx);
+unsigned int pcb_layergrp_flags(pcb_layergrp_id_t group_idx);
+
+/* map bits of a layer type (call cb for each bit set); return number of bits
+ found. */
+int pcb_layer_type_map(pcb_layer_type_t type, void *ctx, void (*cb)(void *ctx, pcb_layer_type_t bit, const char *name, int class, const char *class_name));
/* List layer IDs that matches mask - write the first res_len items in res,
if res is not NULL. Returns:
- the total number of layers matching the query, if res is NULL
- the number of layers copied into res if res is not NULL
+ The plain version require exact match (look for a specific layer),
+ the _any version allows partial match so work with PCB_LYT_ANY*.
*/
-int pcb_layer_list(pcb_layer_type_t mask, int *res, int res_len);
+int pcb_layer_list(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len);
+int pcb_layer_list_any(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len);
/* Same as pcb_layer_list but lists layer groups. A group is matching
if any layer in that group matches mask. */
-int pcb_layer_group_list(pcb_layer_type_t mask, int *res, int res_len);
+int pcb_layer_group_list(pcb_layer_type_t mask, pcb_layergrp_id_t *res, int res_len);
+int pcb_layer_group_list_any(pcb_layer_type_t mask, pcb_layergrp_id_t *res, int res_len);
/* Looks up which group a layer is in. Returns group ID. */
-int pcb_layer_lookup_group(int layer_id);
+pcb_layergrp_id_t pcb_layer_lookup_group(pcb_layer_id_t layer_id);
/* Put a layer in a group (the layer should not be in any other group) */
-void pcb_layer_add_in_group(int layer_id, int group_id);
+void pcb_layer_add_in_group(pcb_layer_id_t layer_id, pcb_layergrp_id_t group_id);
/* Slow linear search for a layer by name */
-int pcb_layer_by_name(const char *name);
+pcb_layer_id_t pcb_layer_by_name(const char *name);
/**** layer creation (for load/import code) ****/
@@ -148,10 +234,51 @@ void pcb_layers_reset();
Returns a layer index (or -1 on error)
Do not create: mask, silk, paste; they are special layers.
*/
-int pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reuse_group, const char *lname);
+pcb_layer_id_t pcb_layer_create(pcb_layer_type_t type, pcb_bool reuse_layer, pcb_bool_t reuse_group, const char *lname);
+
+/* Rename an existing layer by idx */
+int pcb_layer_rename(pcb_layer_id_t layer, const char *lname);
+
+/* changes the name of a layer; memory has to be already allocated */
+int pcb_layer_rename_(pcb_layer_t *Layer, char *Name);
-/* Rename an existing layer */
-int pcb_layer_rename(int layer, const char *lname);
/* Needs to be called once at the end, when all layers has been added */
void pcb_layers_finalize();
+
+
+/* index is 0..PCB_MAX_LAYER-1. If old_index is -1, a new layer is
+ inserted at that index. If new_index is -1, the specified layer is
+ deleted. Returns non-zero on error, zero if OK. */
+int pcb_layer_move(pcb_layer_id_t old_index, pcb_layer_id_t new_index);
+
+
+
+/* list of virtual layers: these are generated by the draw code but do not
+ have a real layer in the array */
+typedef struct pcb_virt_layer_s {
+ char *name;
+ pcb_layer_id_t new_id, data_layer_offs;
+ pcb_layer_type_t type;
+} pcb_virt_layer_t;
+
+extern pcb_virt_layer_t pcb_virt_layers[];
+
+/* Return the first virtual layer that fully matches mask */
+const pcb_virt_layer_t *pcb_vlayer_get_first(pcb_layer_type_t mask);
+
+/* Returns whether the given unsigned int layer flags corresponds to a layer
+ that's on the visible side of the board at the moment. */
+#define PCB_LAYERFLG_ON_VISIBLE_SIDE(uint_flags) \
+ (!!(conf_core.editor.show_solder_side ? ((uint_flags) & PCB_LYT_BOTTOM) : ((uint_flags) & PCB_LYT_TOP)))
+
+/********* OBSOLETE functions, do not use in new code *********/
+/* parses the group definition string which is a colon separated list of
+ comma separated layer numbers (1,2,b:4,6,8,t); oldfmt is 0 or 1
+ depending on PCB() or PCB[] in the file header.
+
+ OBSOLETE, do not use in new code: only the conf system and io_pcb
+ may need this. */
+int pcb_layer_parse_group_string(const char *s, pcb_layer_group_t *LayerGroup, int LayerN, int oldfmt);
+
+#endif
diff --git a/src/layer_ui.c b/src/layer_ui.c
new file mode 100644
index 0000000..6ff323a
--- /dev/null
+++ b/src/layer_ui.c
@@ -0,0 +1,76 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, layer_ui.c, was written and is Copyright (C) 2016 by
+ * Tibor 'Igor2' Palinkas.
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+/* Virtual layers for UI and debug */
+#include "config.h"
+#define GVT_DONT_UNDEF
+#include "layer_ui.h"
+#include "event.h"
+#include <genvector/genvector_impl.c>
+
+vtlayer_t pcb_uilayer;
+
+pcb_layer_t *pcb_uilayer_alloc(const char *cookie, const char *name, const char *color)
+{
+ int n;
+ pcb_layer_t *l;
+
+ if (cookie == NULL)
+ return NULL;
+
+ for(n = 0; n < vtlayer_len(&pcb_uilayer); n++) {
+ l = &pcb_uilayer.array[n];
+ if (l->cookie == NULL) {
+ l->cookie = cookie;
+ goto found;
+ }
+ }
+
+ l = vtlayer_alloc_append(&pcb_uilayer, 1);
+found:;
+ l->cookie = cookie;
+ l->Color = color;
+ l->Name = name;
+ l->On = 1;
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ return l;
+}
+
+void pcb_uilayer_free_all_cookie(const char *cookie)
+{
+ int n;
+ for(n = 0; n < vtlayer_len(&pcb_uilayer); n++) {
+ pcb_layer_t *l = &pcb_uilayer.array[n];
+ if (l->cookie == cookie) {
+#warning TODO: free all objects
+ l->cookie = NULL;
+ l->Color = l->Name = NULL;
+ l->On = 0;
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ }
+ }
+}
+
diff --git a/src/layer_ui.h b/src/layer_ui.h
new file mode 100644
index 0000000..508dc2e
--- /dev/null
+++ b/src/layer_ui.h
@@ -0,0 +1,49 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, layer_ui.c, was written and is Copyright (C) 2016 by
+ * Tibor 'Igor2' Palinkas.
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+/* Virtual layers for UI and debug */
+#include "layer.h"
+
+/* layer vector: Elem=pcb_layer_t *; init=0 */
+#define GVT(x) vtlayer_ ## x
+#define GVT_ELEM_TYPE pcb_layer_t
+#define GVT_SIZE_TYPE size_t
+#define GVT_DOUBLING_THRS 64
+#define GVT_START_SIZE 4
+#define GVT_FUNC
+#define GVT_SET_NEW_BYTES_TO 0
+#include <genvector/genvector_impl.h>
+#define GVT_REALLOC(vect, ptr, size) realloc(ptr, size)
+#define GVT_FREE(vect, ptr) free(ptr)
+#include <genvector/genvector_undef.h>
+
+/* list of all UI layers */
+extern vtlayer_t pcb_uilayer;
+
+pcb_layer_t *pcb_uilayer_alloc(const char *cookie, const char *name, const char *color);
+void pcb_uilayer_free_all_cookie(const char *cookie);
+
+
diff --git a/src/layer_vis.c b/src/layer_vis.c
new file mode 100644
index 0000000..a8c7d78
--- /dev/null
+++ b/src/layer_vis.c
@@ -0,0 +1,301 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas (pcb-rnd extensions)
+ *
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Layer visibility logics (affects the GUI and some exporters) */
+
+#include "config.h"
+#include "board.h"
+#include "data.h"
+#include "conf_core.h"
+#include "layer.h"
+#include "layer_ui.h"
+#include "layer_vis.h"
+#include "event.h"
+#include "compat_misc.h"
+
+/*
+ * Used by pcb_layervis_save_stack() and
+ * pcb_layervis_restore_stack()
+ */
+static struct {
+ pcb_bool ElementOn, InvisibleObjectsOn, PinOn, ViaOn, RatOn;
+ int pcb_layer_stack[PCB_MAX_LAYER];
+ pcb_bool LayerOn[PCB_MAX_LAYER];
+ int cnt;
+} SavedStack;
+
+
+/* ----------------------------------------------------------------------
+ * Given a string description of a layer stack, adjust the layer stack
+ * to correspond.
+*/
+
+void pcb_layervis_parse_string(const char *layer_string)
+{
+ static int listed_layers = 0;
+ int l = strlen(layer_string);
+ char **args;
+ int i, argn, lno;
+ int prev_sep = 1;
+ char *s;
+
+ s = pcb_strdup(layer_string);
+ args = (char **) malloc(l * sizeof(char *));
+ argn = 0;
+
+ for (i = 0; i < l; i++) {
+ switch (s[i]) {
+ case ' ':
+ case '\t':
+ case ',':
+ case ';':
+ case ':':
+ prev_sep = 1;
+ s[i] = '\0';
+ break;
+ default:
+ if (prev_sep)
+ args[argn++] = s + i;
+ prev_sep = 0;
+ break;
+ }
+ }
+
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
+ if (i < pcb_max_copper_layer)
+ pcb_layer_stack[i] = i;
+ PCB->Data->Layer[i].On = pcb_false;
+ }
+ PCB->ElementOn = pcb_false;
+ PCB->InvisibleObjectsOn = pcb_false;
+ PCB->PinOn = pcb_false;
+ PCB->ViaOn = pcb_false;
+ PCB->RatOn = pcb_false;
+
+ conf_set_editor(show_mask, 0);
+ conf_set_editor(show_solder_side, 0);
+
+ for (i = argn - 1; i >= 0; i--) {
+ if (pcb_strcasecmp(args[i], "rats") == 0)
+ PCB->RatOn = pcb_true;
+ else if (pcb_strcasecmp(args[i], "invisible") == 0)
+ PCB->InvisibleObjectsOn = pcb_true;
+ else if (pcb_strcasecmp(args[i], "pins") == 0)
+ PCB->PinOn = pcb_true;
+ else if (pcb_strcasecmp(args[i], "vias") == 0)
+ PCB->ViaOn = pcb_true;
+ else if (pcb_strcasecmp(args[i], "elements") == 0 || pcb_strcasecmp(args[i], "silk") == 0)
+ PCB->ElementOn = pcb_true;
+ else if (pcb_strcasecmp(args[i], "mask") == 0)
+ conf_set_editor(show_mask, 1);
+ else if (pcb_strcasecmp(args[i], "solderside") == 0)
+ conf_set_editor(show_solder_side, 1);
+ else if (isdigit((int) args[i][0])) {
+ lno = atoi(args[i]);
+ pcb_layervis_change_group_vis(lno, pcb_true, pcb_true);
+ }
+ else {
+ int found = 0;
+ for (lno = 0; lno < pcb_max_copper_layer; lno++)
+ if (pcb_strcasecmp(args[i], PCB->Data->Layer[lno].Name) == 0) {
+ pcb_layervis_change_group_vis(lno, pcb_true, pcb_true);
+ found = 1;
+ break;
+ }
+ if (!found) {
+ fprintf(stderr, "Warning: layer \"%s\" not known\n", args[i]);
+ if (!listed_layers) {
+ fprintf(stderr, "Named layers in this board are:\n");
+ listed_layers = 1;
+ for (lno = 0; lno < pcb_max_copper_layer; lno++)
+ fprintf(stderr, "\t%s\n", PCB->Data->Layer[lno].Name);
+ fprintf(stderr, "Also: component, solder, rats, invisible, pins, vias, elements or silk, mask, solderside.\n");
+ }
+ }
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * move layer (number is passed in) to top of layerstack
+ */
+static void PushOnTopOfLayerStack(int NewTop)
+{
+ int i;
+
+ /* ignore silk layers */
+ if (NewTop < pcb_max_copper_layer) {
+ /* first find position of passed one */
+ for (i = 0; i < pcb_max_copper_layer; i++)
+ if (pcb_layer_stack[i] == NewTop)
+ break;
+
+ /* bring this element to the top of the stack */
+ for (; i; i--)
+ pcb_layer_stack[i] = pcb_layer_stack[i - 1];
+ pcb_layer_stack[0] = NewTop;
+ }
+}
+
+
+/* ----------------------------------------------------------------------
+ * changes the visibility of all layers in a group
+ * returns the number of changed layers
+ */
+int pcb_layervis_change_group_vis(int Layer, pcb_bool On, pcb_bool ChangeStackOrder)
+{
+ pcb_layergrp_id_t group;
+ int i, changed = 1; /* at least the current layer changes */
+
+ if (Layer & PCB_LYT_UI) {
+ Layer &= ~(PCB_LYT_UI | PCB_LYT_VIRTUAL);
+ if (Layer >= vtlayer_len(&pcb_uilayer))
+ return 0;
+ pcb_uilayer.array[Layer].On = On;
+ changed = 1;
+ goto done;
+ }
+
+ /* Warning: these special case values must agree with what gui-top-window.c
+ | thinks the are.
+ */
+
+ if (conf_core.rc.verbose)
+ printf("pcb_layervis_change_group_vis(Layer=%d, On=%d, ChangeStackOrder=%d)\n", Layer, On, ChangeStackOrder);
+
+ /* decrement 'i' to keep stack in order of layergroup */
+ if ((group = pcb_layer_get_group(Layer)) >= 0) {
+ for (i = PCB->LayerGroups.Number[group]; i;) {
+ int layer = PCB->LayerGroups.Entries[group][--i];
+
+ /* don't count the passed member of the group */
+ if (layer != Layer && layer < pcb_max_copper_layer) {
+ PCB->Data->Layer[layer].On = On;
+
+ /* push layer on top of stack if switched on */
+ if (On && ChangeStackOrder)
+ PushOnTopOfLayerStack(layer);
+ changed++;
+ }
+ }
+ }
+
+ /* change at least the passed layer */
+ PCB->Data->Layer[Layer].On = On;
+ if (On && ChangeStackOrder)
+ PushOnTopOfLayerStack(Layer);
+
+ done:;
+ /* update control panel and exit */
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
+ return (changed);
+}
+
+/* ---------------------------------------------------------------------------
+ * resets the layerstack setting
+ */
+void pcb_layervis_reset_stack(void)
+{
+ pcb_layergrp_id_t comp_group;
+ pcb_cardinal_t i;
+
+ assert(PCB->Data->LayerN <= PCB_MAX_LAYER);
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
+ if (i < pcb_max_copper_layer)
+ pcb_layer_stack[i] = i;
+ PCB->Data->Layer[i].On = pcb_true;
+ }
+ PCB->ElementOn = pcb_true;
+ PCB->InvisibleObjectsOn = pcb_true;
+ PCB->PinOn = pcb_true;
+ PCB->ViaOn = pcb_true;
+ PCB->RatOn = pcb_true;
+
+ /* Bring the component group to the front and make it active. */
+ comp_group = pcb_layer_get_group(pcb_component_silk_layer);
+ pcb_layervis_change_group_vis(PCB->LayerGroups.Entries[comp_group][0], 1, 1);
+}
+
+/* ---------------------------------------------------------------------------
+ * saves the layerstack setting
+ */
+void pcb_layervis_save_stack(void)
+{
+ pcb_cardinal_t i;
+ static pcb_bool run = pcb_false;
+
+ if (run == pcb_false) {
+ SavedStack.cnt = 0;
+ run = pcb_true;
+ }
+
+ if (SavedStack.cnt != 0) {
+ fprintf(stderr,
+ "pcb_layervis_save_stack() layerstack was already saved and not" "yet restored. cnt = %d\n", SavedStack.cnt);
+ }
+
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
+ if (i < pcb_max_copper_layer)
+ SavedStack.pcb_layer_stack[i] = pcb_layer_stack[i];
+ SavedStack.LayerOn[i] = PCB->Data->Layer[i].On;
+ }
+ SavedStack.ElementOn = PCB->ElementOn;
+ SavedStack.InvisibleObjectsOn = PCB->InvisibleObjectsOn;
+ SavedStack.PinOn = PCB->PinOn;
+ SavedStack.ViaOn = PCB->ViaOn;
+ SavedStack.RatOn = PCB->RatOn;
+ SavedStack.cnt++;
+}
+
+/* ---------------------------------------------------------------------------
+ * restores the layerstack setting
+ */
+void pcb_layervis_restore_stack(void)
+{
+ pcb_cardinal_t i;
+
+ if (SavedStack.cnt == 0) {
+ fprintf(stderr, "pcb_layervis_restore_stack() layerstack has not" " been saved. cnt = %d\n", SavedStack.cnt);
+ return;
+ }
+ else if (SavedStack.cnt != 1) {
+ fprintf(stderr, "pcb_layervis_restore_stack() layerstack save count is" " wrong. cnt = %d\n", SavedStack.cnt);
+ }
+
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
+ if (i < pcb_max_copper_layer)
+ pcb_layer_stack[i] = SavedStack.pcb_layer_stack[i];
+ PCB->Data->Layer[i].On = SavedStack.LayerOn[i];
+ }
+ PCB->ElementOn = SavedStack.ElementOn;
+ PCB->InvisibleObjectsOn = SavedStack.InvisibleObjectsOn;
+ PCB->PinOn = SavedStack.PinOn;
+ PCB->ViaOn = SavedStack.ViaOn;
+ PCB->RatOn = SavedStack.RatOn;
+
+ SavedStack.cnt--;
+}
diff --git a/src/layer_vis.h b/src/layer_vis.h
new file mode 100644
index 0000000..26b91f8
--- /dev/null
+++ b/src/layer_vis.h
@@ -0,0 +1,52 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas (pcb-rnd extensions)
+ *
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Layer visibility logics (affects the GUI and some exporters) */
+
+#ifndef PCB_LAYER_VIS_H
+#define PCB_LAYER_VIS_H
+
+#include "layer.h"
+
+/* Given a string description of a layer visibility stack, adjust the layer
+ visibility to correspond */
+void pcb_layervis_parse_string(const char *layer_string);
+
+/* changes the visibility of all layers in a group; returns the number of
+ changed layers */
+int pcb_layervis_change_group_vis(int Layer, pcb_bool On, pcb_bool ChangeStackOrder);
+
+/* resets the layer visibility stack setting */
+void pcb_layervis_reset_stack(void);
+
+/* saves the layerstack setting */
+void pcb_layervis_save_stack(void);
+
+/* restores the layerstack setting */
+void pcb_layervis_restore_stack(void);
+
+#endif
diff --git a/src/library.c b/src/library.c
new file mode 100644
index 0000000..8f8dcf9
--- /dev/null
+++ b/src/library.c
@@ -0,0 +1,144 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+#warning TODO: replace this with genvect
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "config.h"
+#include "library.h"
+#include "macro.h"
+#include "compat_misc.h"
+
+#define STEP_LIBRARYMENU 10
+#define STEP_LIBRARYENTRY 20
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a library menu, allocates memory if necessary
+ */
+pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *lib, int *idx)
+{
+ pcb_lib_menu_t *menu = lib->Menu;
+
+ /* realloc new memory if necessary and clear it */
+ if (lib->MenuN >= lib->MenuMax) {
+ lib->MenuMax += STEP_LIBRARYMENU;
+ menu = (pcb_lib_menu_t *) realloc(menu, lib->MenuMax * sizeof(pcb_lib_menu_t));
+ lib->Menu = menu;
+ memset(menu + lib->MenuN, 0, STEP_LIBRARYMENU * sizeof(pcb_lib_menu_t));
+ }
+ if (idx != NULL)
+ *idx = lib->MenuN;
+ return (menu + lib->MenuN++);
+}
+
+void pcb_lib_menu_free(pcb_lib_t *lib, int menuidx)
+{
+ pcb_lib_menu_t *menu = lib->Menu;
+
+ if (menu[menuidx].Name != NULL)
+ free(menu[menuidx].Name);
+ if (menu[menuidx].directory != NULL)
+ free(menu[menuidx].directory);
+
+ lib->MenuN--;
+ memmove(menu + menuidx, menu + menuidx + 1, sizeof(pcb_lib_menu_t) * (lib->MenuN - menuidx));
+}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a library entry, allocates memory if necessary
+ */
+pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *Menu)
+{
+ pcb_lib_entry_t *entry = Menu->Entry;
+
+ /* realloc new memory if necessary and clear it */
+ if (Menu->EntryN >= Menu->EntryMax) {
+ Menu->EntryMax += STEP_LIBRARYENTRY;
+ entry = (pcb_lib_entry_t *) realloc(entry, Menu->EntryMax * sizeof(pcb_lib_entry_t));
+ Menu->Entry = entry;
+ memset(entry + Menu->EntryN, 0, STEP_LIBRARYENTRY * sizeof(pcb_lib_entry_t));
+ }
+ return (entry + Menu->EntryN++);
+}
+
+
+/* ---------------------------------------------------------------------------
+ * releases the memory that's allocated by the library
+ */
+void pcb_lib_free(pcb_lib_t *lib)
+{
+ PCB_MENU_LOOP(lib);
+ {
+ PCB_ENTRY_LOOP(menu);
+ {
+ if (!entry->ListEntry_dontfree)
+ free((char*)entry->ListEntry);
+ }
+ PCB_END_LOOP;
+ free(menu->Entry);
+ free(menu->Name);
+ free(menu->directory);
+ }
+ PCB_END_LOOP;
+ free(lib->Menu);
+
+ /* clear struct */
+ memset(lib, 0, sizeof(pcb_lib_t));
+}
+
+/* ---------------------------------------------------------------------------
+ * Add a new net to the netlist menu
+ */
+pcb_lib_menu_t *pcb_lib_net_new(pcb_lib_t *lib, char *name, const char *style)
+{
+ pcb_lib_menu_t *menu;
+ char temp[64];
+
+ sprintf(temp, " %s", name);
+ menu = pcb_lib_menu_new(lib, NULL);
+ menu->Name = pcb_strdup(temp);
+ menu->flag = 1; /* net is enabled by default */
+ if (style == NULL || PCB_NSTRCMP("(unknown)", style) == 0)
+ menu->Style = NULL;
+ else
+ menu->Style = pcb_strdup(style);
+ return (menu);
+}
+
+/* ---------------------------------------------------------------------------
+ * Add a connection to the net
+ */
+pcb_lib_entry_t *pcb_lib_conn_new(pcb_lib_menu_t *net, char *conn)
+{
+ pcb_lib_entry_t *entry = pcb_lib_entry_new(net);
+
+ entry->ListEntry = pcb_strdup_null(conn);
+ entry->ListEntry_dontfree = 0;
+
+ return (entry);
+}
diff --git a/src/library.h b/src/library.h
new file mode 100644
index 0000000..93c93fe
--- /dev/null
+++ b/src/library.h
@@ -0,0 +1,102 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
+ * 15 Oct 2008 Ineiev: add different crosshair shapes
+ *
+ * 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 addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_LIBRARY_H
+#define PCB_LIBRARY_H
+
+#include "global_typedefs.h"
+
+typedef struct pcb_lib_entry_s pcb_lib_entry_t;
+typedef struct pcb_lib_menu_s pcb_lib_menu_t;
+
+/* ---------------------------------------------------------------------------
+ * structure used by library routines
+ */
+struct pcb_lib_entry_s {
+ const char *ListEntry; /* the string for the selection box */
+ int ListEntry_dontfree; /* do not free(ListEntry) if non-zero */
+ /* This used to contain some char *AllocatedMemory, possibly with
+ * the intention of the following fields pointing into it.
+ * It was never used that way, so removing for now.
+ * TODO: re-introduce and actually use it for the following fields?
+ */
+ const char *Package; /* package */
+ const char *Value; /* the value field */
+ const char *Description; /* some descriptive text */
+#if 0
+ pcb_fp_type_t Type;
+ void **Tags; /* an array of void * tag IDs; last tag ID is NULL */
+#endif
+};
+
+/* If the internal flag is set, the only field that is valid is Name,
+ and the struct is allocated with malloc instead of
+ CreateLibraryEntry. These "internal" entries are used for
+ electrical paths that aren't yet assigned to a real net. */
+
+struct pcb_lib_menu_s {
+ char *Name, /* name of the menu entry */
+ *directory, /* Directory name library elements are from */
+ *Style; /* routing style */
+ pcb_cardinal_t EntryN, /* number of objects */
+ EntryMax; /* number of reserved memory locations */
+ pcb_lib_entry_t *Entry; /* the entries */
+ char flag; /* used by the netlist window to enable/disable nets */
+ char internal; /* if set, this is an internal-only entry, not
+ part of the global netlist. */
+};
+
+typedef struct {
+ pcb_cardinal_t MenuN; /* number of objects */
+ pcb_cardinal_t MenuMax; /* number of reserved memory locations */
+ pcb_lib_menu_t *Menu; /* the entries */
+} pcb_lib_t;
+
+pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *, int *idx);
+pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *);
+void pcb_lib_free(pcb_lib_t *);
+void pcb_lib_menu_free(pcb_lib_t *lib, int menuidx);
+
+pcb_lib_menu_t *pcb_lib_net_new(pcb_lib_t *lib, char *name, const char *style);
+pcb_lib_entry_t *pcb_lib_conn_new(pcb_lib_menu_t *net, char *conn);
+
+
+#define PCB_MENU_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_lib_menu_t *menu; \
+ for (l = (top)->MenuN-1; l != -1; l--) \
+ { \
+ menu = &(top)->Menu[l]
+
+#define PCB_ENTRY_LOOP(top) do { \
+ pcb_cardinal_t n; \
+ pcb_lib_entry_t *entry; \
+ for (n = (top)->EntryN-1; n != -1; n--) \
+ { \
+ entry = &(top)->Entry[n]
+
+#endif
diff --git a/src/line.c b/src/line.c
deleted file mode 100644
index f18f518..0000000
--- a/src/line.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- * Copyright (C) 2004 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-
-#include "config.h"
-#include "conf_core.h"
-
-#include <math.h>
-#include <setjmp.h>
-#include <stdlib.h>
-
-#include "data.h"
-#include "crosshair.h"
-#include "find.h"
-#include "line.h"
-#include "misc.h"
-#include "rtree.h"
-#include "layer.h"
-
-static double drc_lines(PointTypePtr end, pcb_bool way);
-
-/* ---------------------------------------------------------------------------
- * Adjust the attached line to 45 degrees if necessary
- */
-void AdjustAttachedLine(void)
-{
- AttachedLineTypePtr line = &Crosshair.AttachedLine;
-
- /* I need at least one point */
- if (line->State == STATE_FIRST)
- return;
- /* don't draw outline when ctrl key is pressed */
- if (conf_core.editor.mode == PCB_MODE_LINE && gui->control_is_pressed()) {
- line->draw = pcb_false;
- return;
- }
- else
- line->draw = pcb_true;
- /* no 45 degree lines required */
- if (PCB->RatDraw || conf_core.editor.all_direction_lines) {
- line->Point2.X = Crosshair.X;
- line->Point2.Y = Crosshair.Y;
- return;
- }
- FortyFiveLine(line);
-}
-
-/* ---------------------------------------------------------------------------
- * makes the attached line fit into a 45 degree direction
- *
- * directions:
- *
- * 0
- * 7 1
- * 6 2
- * 5 3
- * 4
- */
-void FortyFiveLine(AttachedLineTypePtr Line)
-{
- Coord dx, dy, min;
- unsigned direction = 0;
- double m;
-
- /* first calculate direction of line */
- dx = Crosshair.X - Line->Point1.X;
- dy = Crosshair.Y - Line->Point1.Y;
-
- if (!dx) {
- if (!dy)
- /* zero length line, don't draw anything */
- return;
- else
- direction = dy > 0 ? 0 : 4;
- }
- else {
- m = (double) dy / dx;
- direction = 2;
- if (m > PCB_TAN_30_DEGREE)
- direction = m > PCB_TAN_60_DEGREE ? 0 : 1;
- else if (m < -PCB_TAN_30_DEGREE)
- direction = m < -PCB_TAN_60_DEGREE ? 0 : 3;
- }
- if (dx < 0)
- direction += 4;
-
- dx = coord_abs(dx);
- dy = coord_abs(dy);
- min = MIN(dx, dy);
-
- /* now set up the second pair of coordinates */
- switch (direction) {
- case 0:
- case 4:
- Line->Point2.X = Line->Point1.X;
- Line->Point2.Y = Crosshair.Y;
- break;
-
- case 2:
- case 6:
- Line->Point2.X = Crosshair.X;
- Line->Point2.Y = Line->Point1.Y;
- break;
-
- case 1:
- Line->Point2.X = Line->Point1.X + min;
- Line->Point2.Y = Line->Point1.Y + min;
- break;
-
- case 3:
- Line->Point2.X = Line->Point1.X + min;
- Line->Point2.Y = Line->Point1.Y - min;
- break;
-
- case 5:
- Line->Point2.X = Line->Point1.X - min;
- Line->Point2.Y = Line->Point1.Y - min;
- break;
-
- case 7:
- Line->Point2.X = Line->Point1.X - min;
- Line->Point2.Y = Line->Point1.Y + min;
- break;
- }
-}
-
-/* ---------------------------------------------------------------------------
- * adjusts the insert lines to make them 45 degrees as necessary
- */
-void AdjustTwoLine(pcb_bool way)
-{
- Coord dx, dy;
- AttachedLineTypePtr line = &Crosshair.AttachedLine;
-
- if (Crosshair.AttachedLine.State == STATE_FIRST)
- return;
- /* don't draw outline when ctrl key is pressed */
- if (gui->control_is_pressed()) {
- line->draw = pcb_false;
- return;
- }
- else
- line->draw = pcb_true;
- if (conf_core.editor.all_direction_lines) {
- line->Point2.X = Crosshair.X;
- line->Point2.Y = Crosshair.Y;
- return;
- }
- /* swap the modes if shift is held down */
- if (gui->shift_is_pressed())
- way = !way;
- dx = Crosshair.X - line->Point1.X;
- dy = Crosshair.Y - line->Point1.Y;
- if (!way) {
- if (coord_abs(dx) > coord_abs(dy)) {
- line->Point2.X = Crosshair.X - SGN(dx) * coord_abs(dy);
- line->Point2.Y = line->Point1.Y;
- }
- else {
- line->Point2.X = line->Point1.X;
- line->Point2.Y = Crosshair.Y - SGN(dy) * coord_abs(dx);
- }
- }
- else {
- if (coord_abs(dx) > coord_abs(dy)) {
- line->Point2.X = line->Point1.X + SGN(dx) * coord_abs(dy);
- line->Point2.Y = Crosshair.Y;
- }
- else {
- line->Point2.X = Crosshair.X;
- line->Point2.Y = line->Point1.Y + SGN(dy) * coord_abs(dx);;
- }
- }
-}
-
-struct drc_info {
- LineTypePtr line;
- pcb_bool solder;
- jmp_buf env;
-};
-
-static r_dir_t drcVia_callback(const BoxType * b, void *cl)
-{
- PinTypePtr via = (PinTypePtr) b;
- struct drc_info *i = (struct drc_info *) cl;
-
- if (!TEST_FLAG(PCB_FLAG_FOUND, via) && PinLineIntersect(via, i->line))
- longjmp(i->env, 1);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static r_dir_t drcPad_callback(const BoxType * b, void *cl)
-{
- PadTypePtr pad = (PadTypePtr) b;
- struct drc_info *i = (struct drc_info *) cl;
-
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == i->solder && !TEST_FLAG(PCB_FLAG_FOUND, pad) && LinePadIntersect(i->line, pad))
- longjmp(i->env, 1);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static r_dir_t drcLine_callback(const BoxType * b, void *cl)
-{
- LineTypePtr line = (LineTypePtr) b;
- struct drc_info *i = (struct drc_info *) cl;
-
- if (!TEST_FLAG(PCB_FLAG_FOUND, line) && LineLineIntersect(line, i->line))
- longjmp(i->env, 1);
- return R_DIR_FOUND_CONTINUE;
-}
-
-static r_dir_t drcArc_callback(const BoxType * b, void *cl)
-{
- ArcTypePtr arc = (ArcTypePtr) b;
- struct drc_info *i = (struct drc_info *) cl;
-
- if (!TEST_FLAG(PCB_FLAG_FOUND, arc) && LineArcIntersect(i->line, arc))
- longjmp(i->env, 1);
- return R_DIR_FOUND_CONTINUE;
-}
-
-/* drc_lines() checks for intersectors against two lines and
- * adjusts the end point until there is no intersection or
- * it winds up back at the start. If way is pcb_false it checks
- * an ortho start line with one 45 refraction to reach the endpoint,
- * otherwise it checks a 45 start, with a ortho refraction to reach endpoint
- *
- * It returns the straight-line length of the best answer, and
- * changes the position of the input end point to the best answer.
- */
-static double drc_lines(PointTypePtr end, pcb_bool way)
-{
- double f, s, f2, s2, len, best;
- Coord dx, dy, temp, last, length;
- Coord temp2, last2, length2;
- LineType line1, line2;
- pcb_cardinal_t group, comp;
- struct drc_info info;
- pcb_bool two_lines, x_is_long, blocker;
- PointType ans;
-
- f = 1.0;
- s = 0.5;
- last = -1;
- line1.Flags = line2.Flags = NoFlags();
- line1.Thickness = conf_core.design.line_thickness + 2 * (PCB->Bloat + 1);
- line2.Thickness = line1.Thickness;
- line1.Clearance = line2.Clearance = 0;
- line1.Point1.X = Crosshair.AttachedLine.Point1.X;
- line1.Point1.Y = Crosshair.AttachedLine.Point1.Y;
- dy = end->Y - line1.Point1.Y;
- dx = end->X - line1.Point1.X;
- if (coord_abs(dx) > coord_abs(dy)) {
- x_is_long = pcb_true;
- length = coord_abs(dx);
- }
- else {
- x_is_long = pcb_false;
- length = coord_abs(dy);
- }
- group = GetGroupOfLayer(INDEXOFCURRENT);
- comp = max_group + 10; /* this out-of-range group might save a call */
- if (GetLayerGroupNumberByNumber(solder_silk_layer) == group)
- info.solder = pcb_true;
- else {
- info.solder = pcb_false;
- comp = GetLayerGroupNumberByNumber(component_silk_layer);
- }
- temp = length;
- /* assume the worst */
- best = 0.0;
- ans.X = line1.Point1.X;
- ans.Y = line1.Point1.Y;
- while (length != last) {
- last = length;
- if (x_is_long) {
- dx = SGN(dx) * length;
- dy = end->Y - line1.Point1.Y;
- length2 = coord_abs(dy);
- }
- else {
- dy = SGN(dy) * length;
- dx = end->X - line1.Point1.X;
- length2 = coord_abs(dx);
- }
- temp2 = length2;
- f2 = 1.0;
- s2 = 0.5;
- last2 = -1;
- blocker = pcb_true;
- while (length2 != last2) {
- if (x_is_long)
- dy = SGN(dy) * length2;
- else
- dx = SGN(dx) * length2;
- two_lines = pcb_true;
- if (coord_abs(dx) > coord_abs(dy) && x_is_long) {
- line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * coord_abs(dy) : dx - SGN(dx) * coord_abs(dy));
- line1.Point2.Y = line1.Point1.Y + (way ? dy : 0);
- }
- else if (coord_abs(dy) >= coord_abs(dx) && !x_is_long) {
- line1.Point2.X = line1.Point1.X + (way ? dx : 0);
- line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * coord_abs(dx) : dy - SGN(dy) * coord_abs(dx));
- }
- else if (x_is_long) {
- /* we've changed which axis is long, so only do one line */
- line1.Point2.X = line1.Point1.X + dx;
- line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * coord_abs(dx) : 0);
- two_lines = pcb_false;
- }
- else {
- /* we've changed which axis is long, so only do one line */
- line1.Point2.Y = line1.Point1.Y + dy;
- line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * coord_abs(dy) : 0);
- two_lines = pcb_false;
- }
- line2.Point1.X = line1.Point2.X;
- line2.Point1.Y = line1.Point2.Y;
- if (!two_lines) {
- line2.Point2.Y = line1.Point2.Y;
- line2.Point2.X = line1.Point2.X;
- }
- else {
- line2.Point2.X = line1.Point1.X + dx;
- line2.Point2.Y = line1.Point1.Y + dy;
- }
- SetLineBoundingBox(&line1);
- SetLineBoundingBox(&line2);
- last2 = length2;
- if (setjmp(info.env) == 0) {
- info.line = &line1;
- r_search(PCB->Data->via_tree, &line1.BoundingBox, NULL, drcVia_callback, &info, NULL);
- r_search(PCB->Data->pin_tree, &line1.BoundingBox, NULL, drcVia_callback, &info, NULL);
- if (info.solder || comp == group)
- r_search(PCB->Data->pad_tree, &line1.BoundingBox, NULL, drcPad_callback, &info, NULL);
- if (two_lines) {
- info.line = &line2;
- r_search(PCB->Data->via_tree, &line2.BoundingBox, NULL, drcVia_callback, &info, NULL);
- r_search(PCB->Data->pin_tree, &line2.BoundingBox, NULL, drcVia_callback, &info, NULL);
- if (info.solder || comp == group)
- r_search(PCB->Data->pad_tree, &line2.BoundingBox, NULL, drcPad_callback, &info, NULL);
- }
- GROUP_LOOP(PCB->Data, group);
- {
- info.line = &line1;
- r_search(layer->line_tree, &line1.BoundingBox, NULL, drcLine_callback, &info, NULL);
- r_search(layer->arc_tree, &line1.BoundingBox, NULL, drcArc_callback, &info, NULL);
- if (two_lines) {
- info.line = &line2;
- r_search(layer->line_tree, &line2.BoundingBox, NULL, drcLine_callback, &info, NULL);
- r_search(layer->arc_tree, &line2.BoundingBox, NULL, drcArc_callback, &info, NULL);
- }
- }
- END_LOOP;
- /* no intersector! */
- blocker = pcb_false;
- f2 += s2;
- len = (line2.Point2.X - line1.Point1.X);
- len *= len;
- len += (double) (line2.Point2.Y - line1.Point1.Y) * (line2.Point2.Y - line1.Point1.Y);
- if (len > best) {
- best = len;
- ans.X = line2.Point2.X;
- ans.Y = line2.Point2.Y;
- }
-#if 0
- if (f2 > 1.0)
- f2 = 0.5;
-#endif
- }
- else {
- /* bumped into something, back off */
- f2 -= s2;
- }
- s2 *= 0.5;
- length2 = MIN(f2 * temp2, temp2);
- }
- if (!blocker && ((x_is_long && line2.Point2.X - line1.Point1.X == dx)
- || (!x_is_long && line2.Point2.Y - line1.Point1.Y == dy)))
- f += s;
- else
- f -= s;
- s *= 0.5;
- length = MIN(f * temp, temp);
- }
-
- end->X = ans.X;
- end->Y = ans.Y;
- return best;
-}
-
-static void drc_line(PointTypePtr end)
-{
- struct drc_info info;
- pcb_cardinal_t group, comp;
- LineType line;
- AttachedLineType aline;
- static PointType last_good; /* internal state of last good endpoint - we cna do thsi cheat, because... */
-
- /* ... we hardwire the assumption on how a line is drawn: it starts out as a 0 long segment, which is valid: */
- if ((Crosshair.AttachedLine.Point1.X == Crosshair.X) && (Crosshair.AttachedLine.Point1.Y == Crosshair.Y)) {
- line.Point1 = line.Point2 = Crosshair.AttachedLine.Point1;
- goto auto_good;
- }
-
- memset(&line, 0, sizeof(line));
-
- /* check where the line wants to end */
- aline.Point1.X = Crosshair.AttachedLine.Point1.X;
- aline.Point1.Y = Crosshair.AttachedLine.Point1.Y;
- FortyFiveLine(&aline);
- line.Point1 = aline.Point1;
- line.Point2 = aline.Point2;
-
- /* prepare for the intersection search */
- group = GetGroupOfLayer(INDEXOFCURRENT);
- comp = max_group + 10; /* this out-of-range group might save a call */
- if (GetLayerGroupNumberByNumber(solder_silk_layer) == group)
- info.solder = pcb_true;
- else {
- info.solder = pcb_false;
- comp = GetLayerGroupNumberByNumber(component_silk_layer);
- }
-
- /* search for intersection */
- SetLineBoundingBox(&line);
- if (setjmp(info.env) == 0) {
- info.line = &line;
- r_search(PCB->Data->via_tree, &line.BoundingBox, NULL, drcVia_callback, &info, NULL);
- r_search(PCB->Data->pin_tree, &line.BoundingBox, NULL, drcVia_callback, &info, NULL);
- if (info.solder || comp == group)
- r_search(PCB->Data->pad_tree, &line.BoundingBox, NULL, drcPad_callback, &info, NULL);
- GROUP_LOOP(PCB->Data, group);
- {
- info.line = &line;
- r_search(layer->line_tree, &line.BoundingBox, NULL, drcLine_callback, &info, NULL);
- r_search(layer->arc_tree, &line.BoundingBox, NULL, drcArc_callback, &info, NULL);
- }
- END_LOOP;
- /* no intersector! */
- auto_good:;
- last_good.X = end->X = line.Point2.X;
- last_good.Y = end->Y = line.Point2.Y;
- return;
- }
-
- /* bumped into ans */
- end->X = last_good.X;
- end->Y = last_good.Y;
-}
-
-void EnforceLineDRC(void)
-{
- PointType r45, rs;
- pcb_bool shift;
- double r1, r2;
-
- /* Silence a bogus compiler warning by storing this in a variable */
- int layer_idx = INDEXOFCURRENT;
-
- if (gui->mod1_is_pressed() || gui->control_is_pressed() || PCB->RatDraw || layer_idx >= max_copper_layer)
- return;
-
- rs.X = r45.X = Crosshair.X;
- rs.Y = r45.Y = Crosshair.Y;
-
- if (conf_core.editor.line_refraction != 0) {
- /* first try starting straight */
- r1 = drc_lines(&rs, pcb_false);
- /* then try starting at 45 */
- r2 = drc_lines(&r45, pcb_true);
- }
- else {
- drc_line(&rs);
- r45 = rs;
-#define sqr(a) ((a) * (a))
- r1 = r2 = sqrt(sqr(rs.X - Crosshair.AttachedLine.Point1.X) + sqr(rs.Y - Crosshair.AttachedLine.Point1.Y));
-#undef sqr
- }
- /* shift<Key> forces the line lookahead path to refract the alternate way */
- shift = gui->shift_is_pressed();
-
- if (XOR(r1 > r2, shift)) {
- if (conf_core.editor.line_refraction != 0) {
- if (shift) {
- if (conf_core.editor.line_refraction !=2)
- conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2);
- }
- else{
- if (conf_core.editor.line_refraction != 1)
- conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1);
- }
- }
- Crosshair.X = rs.X;
- Crosshair.Y = rs.Y;
- }
- else {
- if (conf_core.editor.line_refraction !=0) {
- if (shift) {
- if (conf_core.editor.line_refraction != 1)
- conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1);
- }
- else {
- if (conf_core.editor.line_refraction != 2)
- conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2);
- }
- }
- Crosshair.X = r45.X;
- Crosshair.Y = r45.Y;
- }
-}
diff --git a/src/line.h b/src/line.h
deleted file mode 100644
index a62c74a..0000000
--- a/src/line.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- * Copyright (C) 2004 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-
-/* prototypes for inserting points into objects */
-
-#ifndef PCB_LINE_H
-#define PCB_LINE_H
-
-#include "global.h"
-
-/* ---------------------------------------------------------------------------
- * prototypes
- */
-void AdjustAttachedLine(void);
-void AdjustTwoLine(pcb_bool);
-void FortyFiveLine(AttachedLineTypePtr);
-void EnforceLineDRC(void);
-#endif
diff --git a/src/list_arc.c b/src/list_arc.c
deleted file mode 100644
index 2665245..0000000
--- a/src/list_arc.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_arc.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_arc.h b/src/list_arc.h
deleted file mode 100644
index 47c244d..0000000
--- a/src/list_arc.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_ARC_H
-#define LIST_ARC_H
-
-/* List of Arcs */
-#define TDL(x) arclist_ ## x
-#define TDL_LIST_T arclist_t
-#define TDL_ITEM_T ArcType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define arclist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/list_element.c b/src/list_element.c
deleted file mode 100644
index 3fc17fb..0000000
--- a/src/list_element.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-
-
-#include "global.h"
-#undef LIST_ELEMENT_H
-#define LIST_ELEMENT_NOINSTANT
-#define TDL_DONT_UNDEF
-#include "list_element.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_element.h b/src/list_element.h
deleted file mode 100644
index 5a59e9d..0000000
--- a/src/list_element.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_ELEMENT_H
-#define LIST_ELEMENT_H
-
-/* List of Elements */
-#define TDL(x) elementlist_ ## x
-#define TDL_LIST_T elementlist_t
-#define TDL_ITEM_T ElementType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define elementlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-#include "ht_element.h"
-#include <genht/hash.h>
-
-/* Calculate a hash value using the content of the element. The hash value
- represents the actual content of an element */
-unsigned int pcb_element_hash(const ElementType *e);
-
-/* Compare two elements and return 1 if they contain the same objects. */
-int pcb_element_eq(const ElementType *e1, const ElementType *e2);
-
-/* Create a new local variable to be used for deduplication */
-#define elementlist_dedup_initializer(state) htep_t *state = NULL;
-
-/* Do a "continue" if an element matching loop_elem has been seen already;
- Typically this is invoked as the first statement of an elementlist_foreach()
- loop. */
-#define elementlist_dedup_skip(state, loop_elem) \
-switch(1) { \
- case 1: { \
- if (state == NULL) \
- state = htep_alloc(pcb_element_hash, pcb_element_eq); \
- if (htep_has(state, loop_elem)) \
- continue; \
- htep_set(state, loop_elem, 1); \
- } \
-}
-
-/* use this after the loop to free all memory used by state */
-#define elementlist_dedup_free(state) \
- do { \
- if (state != NULL) { \
- htep_free(state); \
- state = NULL; \
- } \
- } while(0)
-
-
-#ifndef LIST_ELEMENT_NOINSTANT
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-#endif
-
-#endif
diff --git a/src/list_line.c b/src/list_line.c
deleted file mode 100644
index 2ecad37..0000000
--- a/src/list_line.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_line.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_line.h b/src/list_line.h
deleted file mode 100644
index 498c698..0000000
--- a/src/list_line.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_LINE_H
-#define LIST_LINE_H
-
-/* List of Lines */
-#define TDL(x) linelist_ ## x
-#define TDL_LIST_T linelist_t
-#define TDL_ITEM_T LineType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define linelist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/list_pad.c b/src/list_pad.c
deleted file mode 100644
index 24914f7..0000000
--- a/src/list_pad.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_pad.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_pad.h b/src/list_pad.h
deleted file mode 100644
index 91fcb32..0000000
--- a/src/list_pad.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_PAD_H
-#define LIST_PAD_H
-
-/* List of Pads */
-#define TDL(x) padlist_ ## x
-#define TDL_LIST_T padlist_t
-#define TDL_ITEM_T PadType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define padlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/list_pin.c b/src/list_pin.c
deleted file mode 100644
index 58fa7b0..0000000
--- a/src/list_pin.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_pin.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_pin.h b/src/list_pin.h
deleted file mode 100644
index 4350231..0000000
--- a/src/list_pin.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_PIN_H
-#define LIST_PIN_H
-
-/* List of Pins */
-#define TDL(x) pinlist_ ## x
-#define TDL_LIST_T pinlist_t
-#define TDL_ITEM_T PinType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define pinlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/list_poly.c b/src/list_poly.c
deleted file mode 100644
index 276c90a..0000000
--- a/src/list_poly.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_poly.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_poly.h b/src/list_poly.h
deleted file mode 100644
index 91104b1..0000000
--- a/src/list_poly.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_POLY_H
-#define LIST_POLY_H
-
-/* List of Lines */
-#define TDL(x) polylist_ ## x
-#define TDL_LIST_T polylist_t
-#define TDL_ITEM_T PolygonType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define polylist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/list_rat.c b/src/list_rat.c
deleted file mode 100644
index f028a3c..0000000
--- a/src/list_rat.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_rat.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_rat.h b/src/list_rat.h
deleted file mode 100644
index 8590f6a..0000000
--- a/src/list_rat.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_RAT_H
-#define LIST_RAT_H
-
-/* List of Rats */
-#define TDL(x) ratlist_ ## x
-#define TDL_LIST_T ratlist_t
-#define TDL_ITEM_T RatType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define ratlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/list_text.c b/src/list_text.c
deleted file mode 100644
index b3e3ce8..0000000
--- a/src/list_text.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_text.h"
-#include <genlist/gentdlist_impl.c>
diff --git a/src/list_text.h b/src/list_text.h
deleted file mode 100644
index 3f87d2c..0000000
--- a/src/list_text.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * 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.
- *
- */
-
-#ifndef LIST_TEXT_H
-#define LIST_TEXT_H
-
-/* List of Text */
-#define TDL(x) textlist_ ## x
-#define TDL_LIST_T textlist_t
-#define TDL_ITEM_T TextType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define textlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include <genlist/gentdlist_impl.h>
-#include <genlist/gentdlist_undef.h>
-
-#endif
diff --git a/src/macro.h b/src/macro.h
index c23b7c2..479c17d 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -35,131 +35,35 @@
* macros to transform coord systems
* draw.c uses a different definition of TO_SCREEN
*/
-#ifndef SWAP_IDENT
-#define SWAP_IDENT conf_core.editor.show_solder_side
+#ifndef PCB_SWAP_IDENT
+#define PCB_SWAP_IDENT conf_core.editor.show_solder_side
#endif
-#define SWAP_SIGN_X(x) (x)
-#define SWAP_SIGN_Y(y) (-(y))
-#define SWAP_ANGLE(a) (-(a))
-#define SWAP_DELTA(d) (-(d))
-#define SWAP_X(x) (SWAP_SIGN_X(x))
-#define SWAP_Y(y) (PCB->MaxHeight +SWAP_SIGN_Y(y))
-
-/* ---------------------------------------------------------------------------
- * misc macros, some might already be defined by <limits.h>
- */
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-#ifndef SGN
-#define SGN(a) ((a) >0 ? 1 : ((a) == 0 ? 0 : -1))
-#endif
-#define SGNZ(a) ((a) >=0 ? 1 : -1)
-#define MAKEMIN(a,b) if ((b) < (a)) (a) = (b)
-#define MAKEMAX(a,b) if ((b) > (a)) (a) = (b)
-
-#define ENTRIES(x) (sizeof((x))/sizeof((x)[0]))
-#define UNKNOWN(a) ((a) && *(a) ? (a) : "(unknown)")
-#define NSTRCMP(a, b) ((a) ? ((b) ? strcmp((a),(b)) : 1) : -1)
-#define EMPTY(a) ((a) ? (a) : "")
-#define EMPTY_STRING_P(a) ((a) ? (a)[0]==0 : 1)
-#define XOR(a,b) (((a) && !(b)) || (!(a) && (b)))
-#define SQUARE(x) ((float) (x) * (float) (x))
-#define TO_RADIANS(degrees) (PCB_M180 * (degrees))
+#define PCB_ENTRIES(x) (sizeof((x))/sizeof((x)[0]))
+#define PCB_UNKNOWN(a) ((a) && *(a) ? (a) : "(unknown)")
+#define PCB_NSTRCMP(a, b) ((a) ? ((b) ? strcmp((a),(b)) : 1) : -1)
+#define PCB_EMPTY(a) ((a) ? (a) : "")
+#define PCB_EMPTY_STRING_P(a) ((a) ? (a)[0]==0 : 1)
+#define PCB_XOR(a,b) (((a) && !(b)) || (!(a) && (b)))
+#define PCB_SQUARE(x) ((float) (x) * (float) (x))
/* ---------------------------------------------------------------------------
* returns the object ID
*/
-#define OBJECT_ID(p) (((AnyObjectTypePtr) p)->ID)
-
-/* ---------------------------------------------------------------------------
- * access macro for current buffer
- */
-#define PASTEBUFFER (&Buffers[conf_core.editor.buffer_number])
-
-/* ---------------------------------------------------------------------------
- * some routines for flag setting, clearing, changing and testing
- */
-#define SET_FLAG(F,P) ((P)->Flags.f |= (F))
-#define CLEAR_FLAG(F,P) ((P)->Flags.f &= (~(F)))
-#define TEST_FLAG(F,P) ((P)->Flags.f & (F) ? 1 : 0)
-#define TOGGLE_FLAG(F,P) ((P)->Flags.f ^= (F))
-#define ASSIGN_FLAG(F,V,P) ((P)->Flags.f = ((P)->Flags.f & (~(F))) | ((V) ? (F) : 0))
-#define TEST_FLAGS(F,P) (((P)->Flags.f & (F)) == (F) ? 1 : 0)
-
-typedef enum {
- PCB_CHGFLG_CLEAR,
- PCB_CHGFLG_SET,
- PCB_CHGFLG_TOGGLE
-} pcb_change_flag_t;
-
-#define CHANGE_FLAG(how, F, P) \
-do { \
- switch(how) { \
- case PCB_CHGFLG_CLEAR: CLEAR_FLAG(F, P); break; \
- case PCB_CHGFLG_SET: SET_FLAG(F, P); break; \
- case PCB_CHGFLG_TOGGLE: TOGGLE_FLAG(F, P); break; \
- } \
-} while(0)
-
-#define FLAGS_EQUAL(F1,F2) (memcmp (&F1, &F2, sizeof(FlagType)) == 0)
-
-#define THERMFLAG(L) (0xf << (4 *((L) % 2)))
-
-#define TEST_THERM(L,P) ((P)->Flags.t[(L)/2] & THERMFLAG(L) ? 1 : 0)
-#define GET_THERM(L,P) (((P)->Flags.t[(L)/2] >> (4 * ((L) % 2))) & 0xf)
-#define CLEAR_THERM(L,P) (P)->Flags.t[(L)/2] &= ~THERMFLAG(L)
-#define ASSIGN_THERM(L,V,P) (P)->Flags.t[(L)/2] = ((P)->Flags.t[(L)/2] & ~THERMFLAG(L)) | ((V) << (4 * ((L) % 2)))
-
-
-#define GET_SQUARE(P) ((P)->Flags.q)
-#define CLEAR_SQUARE(P) (P)->Flags.q = 0
-#define ASSIGN_SQUARE(V,P) (P)->Flags.q = V
-
-
-#define GET_INTCONN(P) ((P)->Flags.int_conn_grp)
-
-extern int mem_any_set(unsigned char *, int);
-#define TEST_ANY_THERMS(P) mem_any_set((P)->Flags.t, sizeof((P)->Flags.t))
-
-/* ---------------------------------------------------------------------------
- * access macros for elements name structure
- */
-#define DESCRIPTION_INDEX 0
-#define NAMEONPCB_INDEX 1
-#define VALUE_INDEX 2
-#define NAME_INDEX() (conf_core.editor.name_on_pcb ? NAMEONPCB_INDEX :\
- (conf_core.editor.description ? \
- DESCRIPTION_INDEX : VALUE_INDEX))
-#define ELEMENT_NAME(p,e) ((e)->Name[NAME_INDEX()].TextString)
-#define DESCRIPTION_NAME(e) ((e)->Name[DESCRIPTION_INDEX].TextString)
-#define NAMEONPCB_NAME(e) ((e)->Name[NAMEONPCB_INDEX].TextString)
-#define VALUE_NAME(e) ((e)->Name[VALUE_INDEX].TextString)
-#define ELEMENT_TEXT(p,e) ((e)->Name[NAME_INDEX()])
-#define DESCRIPTION_TEXT(e) ((e)->Name[DESCRIPTION_INDEX])
-#define NAMEONPCB_TEXT(e) ((e)->Name[NAMEONPCB_INDEX])
-#define VALUE_TEXT(e) ((e)->Name[VALUE_INDEX])
-
-/* ---------------------------------------------------------------------------
- * Determines if text is actually visible
- */
-#define TEXT_IS_VISIBLE(b, l, t) \
- ((l)->On)
+#define PCB_OBJECT_ID(p) (((pcb_any_obj_t *) p)->ID)
/* ---------------------------------------------------------------------------
* Determines if object is on front or back
*/
-#define FRONT(o) \
- ((TEST_FLAG(PCB_FLAG_ONSOLDER, (o)) != 0) == SWAP_IDENT)
+#define PCB_FRONT(o) \
+ ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (o)) != 0) == PCB_SWAP_IDENT)
/* ---------------------------------------------------------------------------
- * Determines if an object is on the given side. side is either SOLDER_LAYER
- * or COMPONENT_LAYER.
+ * Determines if an object is on the given side. side is either PCB_SOLDER_SIDE
+ * or PCB_COMPONENT_SIDE.
*/
-#define ON_SIDE(element, side) \
- (TEST_FLAG (PCB_FLAG_ONSOLDER, element) == (side == SOLDER_LAYER))
+#define PCB_ON_SIDE(element, side) \
+ (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) == (side == PCB_SOLDER_SIDE))
/* ---------------------------------------------------------------------------
* some loop shortcuts
@@ -170,267 +74,8 @@ extern int mem_any_set(unsigned char *, int);
* all data is relative to an objects name 'top' which can be either
* PCB or PasteBuffer
*/
-#define END_LOOP }} while (0)
-
-#define VIA_LOOP(top) do { \
- PinType *via; \
- gdl_iterator_t __it__; \
- pinlist_foreach(&(top)->Via, &__it__, via) {
-
-#define DRILL_LOOP(top) do { \
- pcb_cardinal_t n; \
- DrillTypePtr drill; \
- for (n = 0; (top)->DrillN > 0 && n < (top)->DrillN; n++) \
- { \
- drill = &(top)->Drill[n]
-
-#define NETLIST_LOOP(top) do { \
- pcb_cardinal_t n; \
- NetListTypePtr netlist; \
- for (n = (top)->NetListN-1; n != -1; n--) \
- { \
- netlist = &(top)->NetList[n]
-
-#define NET_LOOP(top) do { \
- pcb_cardinal_t n; \
- NetTypePtr net; \
- for (n = (top)->NetN-1; n != -1; n--) \
- { \
- net = &(top)->Net[n]
-
-#define CONNECTION_LOOP(net) do { \
- pcb_cardinal_t n; \
- ConnectionTypePtr connection; \
- for (n = (net)->ConnectionN-1; n != -1; n--) \
- { \
- connection = & (net)->Connection[n]
-
-#define ELEMENT_LOOP(top) do { \
- ElementType *element; \
- gdl_iterator_t __it__; \
- pinlist_foreach(&(top)->Element, &__it__, element) {
-
-#define RAT_LOOP(top) do { \
- RatType *line; \
- gdl_iterator_t __it__; \
- ratlist_foreach(&(top)->Rat, &__it__, line) {
-
-#define ELEMENTTEXT_LOOP(element) do { \
- pcb_cardinal_t n; \
- TextTypePtr text; \
- for (n = MAX_ELEMENTNAMES-1; n != -1; n--) \
- { \
- text = &(element)->Name[n]
-
-#define ELEMENTNAME_LOOP(element) do { \
- pcb_cardinal_t n; \
- char *textstring; \
- for (n = MAX_ELEMENTNAMES-1; n != -1; n--) \
- { \
- textstring = (element)->Name[n].TextString
-
-#define PIN_LOOP(element) do { \
- PinType *pin; \
- gdl_iterator_t __it__; \
- pinlist_foreach(&(element)->Pin, &__it__, pin) {
-
-#define PAD_LOOP(element) do { \
- PadType *pad; \
- gdl_iterator_t __it__; \
- padlist_foreach(&(element)->Pad, &__it__, pad) {
-
-#define ARC_LOOP(element) do { \
- ArcType *arc; \
- gdl_iterator_t __it__; \
- linelist_foreach(&(element)->Arc, &__it__, arc) {
-
-#define ELEMENTLINE_LOOP(element) do { \
- LineType *line; \
- gdl_iterator_t __it__; \
- linelist_foreach(&(element)->Line, &__it__, line) {
-
-#define ELEMENTARC_LOOP(element) do { \
- ArcType *arc; \
- gdl_iterator_t __it__; \
- linelist_foreach(&(element)->Arc, &__it__, arc) {
-
-#define LINE_LOOP(layer) do { \
- LineType *line; \
- gdl_iterator_t __it__; \
- linelist_foreach(&(layer)->Line, &__it__, line) {
-
-#define TEXT_LOOP(layer) do { \
- TextType *text; \
- gdl_iterator_t __it__; \
- linelist_foreach(&(layer)->Text, &__it__, text) {
-
-#define POLYGON_LOOP(layer) do { \
- PolygonType *polygon; \
- gdl_iterator_t __it__; \
- linelist_foreach(&(layer)->Polygon, &__it__, polygon) {
-
-#define POLYGONPOINT_LOOP(polygon) do { \
- pcb_cardinal_t n; \
- PointTypePtr point; \
- for (n = (polygon)->PointN-1; n != -1; n--) \
- { \
- point = &(polygon)->Points[n]
-
-#define ENDALL_LOOP }} while (0); }} while(0)
-
-#define ALLPIN_LOOP(top) \
- ELEMENT_LOOP(top); \
- PIN_LOOP(element)\
-
-#define ALLPAD_LOOP(top) \
- ELEMENT_LOOP(top); \
- PAD_LOOP(element)
-
-#define ALLLINE_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- LINE_LOOP(layer)
-
-#define ALLARC_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l =0; l < max_copper_layer + 2; l++, layer++) \
- { \
- ARC_LOOP(layer)
-
-#define ALLPOLYGON_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- POLYGON_LOOP(layer)
-
-#define COPPERLINE_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer; l++, layer++) \
- { \
- LINE_LOOP(layer)
-
-#define COPPERARC_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l =0; l < max_copper_layer; l++, layer++) \
- { \
- ARC_LOOP(layer)
-
-#define COPPERPOLYGON_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer; l++, layer++) \
- { \
- POLYGON_LOOP(layer)
-
-#define SILKLINE_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- layer += max_copper_layer; \
- for (l = 0; l < 2; l++, layer++) \
- { \
- LINE_LOOP(layer)
-
-#define SILKARC_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- layer += max_copper_layer; \
- for (l = 0; l < 2; l++, layer++) \
- { \
- ARC_LOOP(layer)
-
-#define SILKPOLYGON_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- layer += max_copper_layer; \
- for (l = 0; l < 2; l++, layer++) \
- { \
- POLYGON_LOOP(layer)
-
-#define ALLTEXT_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- TEXT_LOOP(layer)
-
-#define VISIBLELINE_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- if (layer->On) \
- LINE_LOOP(layer)
-
-#define VISIBLEARC_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- if (layer->On) \
- ARC_LOOP(layer)
-
-#define VISIBLETEXT_LOOP(board) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (board)->Data->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- TEXT_LOOP(layer); \
- if (TEXT_IS_VISIBLE((board), layer, text))
-
-#define VISIBLEPOLYGON_LOOP(top) do { \
- pcb_cardinal_t l; \
- LayerTypePtr layer = (top)->Layer; \
- for (l = 0; l < max_copper_layer + 2; l++, layer++) \
- { \
- if (layer->On) \
- POLYGON_LOOP(layer)
-
-#define POINTER_LOOP(top) do { \
- pcb_cardinal_t n; \
- void **ptr; \
- for (n = (top)->PtrN-1; n != -1; n--) \
- { \
- ptr = &(top)->Ptr[n]
-
-#define MENU_LOOP(top) do { \
- pcb_cardinal_t l; \
- LibraryMenuTypePtr menu; \
- for (l = (top)->MenuN-1; l != -1; l--) \
- { \
- menu = &(top)->Menu[l]
-
-#define ENTRY_LOOP(top) do { \
- pcb_cardinal_t n; \
- LibraryEntryTypePtr entry; \
- for (n = (top)->EntryN-1; n != -1; n--) \
- { \
- entry = &(top)->Entry[n]
-
-#define GROUP_LOOP(data, group) do { \
- pcb_cardinal_t entry; \
- for (entry = 0; entry < ((PCBTypePtr)(data->pcb))->LayerGroups.Number[(group)]; entry++) \
- { \
- LayerTypePtr layer; \
- pcb_cardinal_t number; \
- number = ((PCBTypePtr)(data->pcb))->LayerGroups.Entries[(group)][entry]; \
- if (number >= max_copper_layer) \
- continue; \
- layer = &data->Layer[number];
-
-#define LAYER_LOOP(data, ml) do { \
- pcb_cardinal_t n; \
- for (n = 0; n < ml; n++) \
- { \
- LayerTypePtr layer = (&data->Layer[(n)]);
+#define PCB_END_LOOP }} while (0)
+#define PCB_ENDALL_LOOP }} while (0); }} while(0)
-#define LAYER_IS_EMPTY(layer) LAYER_IS_EMPTY_((layer))
-#define LAYER_IS_EMPTY_(layer) \
- ((linelist_length(&layer->Line) == 0) && (arclist_length(&layer->Arc) == 0) && (polylist_length(&layer->Polygon) == 0) && (textlist_length(&layer->Text) == 0))
#endif
diff --git a/src/main.c b/src/main.c
index efed6b1..d062f5c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,7 +28,6 @@
/* main program, initializes some stuff and handles user input
*/
#include "config.h"
-#include "conf_core.h"
#include <stdlib.h>
#include <string.h>
@@ -37,36 +36,30 @@
#include <time.h> /* Seed for srand() */
#include <locale.h>
-#include "data.h"
-#include "buffer.h"
-#include "create.h"
-#include "crosshair.h"
+#include "board.h"
#include "error.h"
#include "plug_io.h"
-#include "set.h"
-#include "layer.h"
-#include "misc.h"
+#include "buffer.h"
+#include "crosshair.h"
#include "compat_lrealpath.h"
#include "free_atexit.h"
#include "polygon.h"
#include "buildin.h"
-#include "paths.h"
-#include "strflags.h"
+#include "build_run.h"
+#include "flag_str.h"
#include "plugins.h"
#include "plug_footprint.h"
#include "event.h"
#include "funchash.h"
#include "conf.h"
#include "conf_core.h"
+#include "vtptr.h"
+#include "layer_vis.h"
#include "hid_actions.h"
-#include "hid_attrib.h"
#include "hid_init.h"
#include "compat_misc.h"
-
-#if ENABLE_NLS
-#include <libintl.h>
-#endif
+#include "compat_nls.h"
/* ----------------------------------------------------------------------
* initialize signal and error handlers
@@ -74,25 +67,25 @@
static void InitHandler(void)
{
#ifdef PCB_HAVE_SIGHUP
- signal(SIGHUP, CatchSignal);
+ signal(SIGHUP, pcb_catch_signal);
#endif
#ifdef PCB_HAVE_SIGQUIT
- signal(SIGQUIT, CatchSignal);
+ signal(SIGQUIT, pcb_catch_signal);
#endif
#ifdef PCB_HAVE_SIGTERM
- signal(SIGTERM, CatchSignal);
+ signal(SIGTERM, pcb_catch_signal);
#endif
#ifdef PCB_HAVE_SIGINT
- signal(SIGINT, CatchSignal);
+ signal(SIGINT, pcb_catch_signal);
#endif
#ifdef NDEBUG
/* so that we get a core dump on segfault in debug mode */
# ifdef PCB_HAVE_SIGABRT
- signal(SIGABRT, CatchSignal);
+ signal(SIGABRT, pcb_catch_signal);
# endif
# ifdef PCB_HAVE_SIGSEGV
- signal(SIGSEGV, CatchSignal);
+ signal(SIGSEGV, pcb_catch_signal);
# endif
#endif
@@ -143,7 +136,7 @@ static void InitPaths(char *argv0)
if (haspath) {
#ifndef NO_BINDIR_HEURISTICS
- bindir = pcb_strdup(lrealpath(argv0));
+ bindir = pcb_strdup(pcb_lrealpath(argv0));
#endif
found_bindir = 1;
}
@@ -172,7 +165,7 @@ static void InitPaths(char *argv0)
#ifdef DEBUG
printf("Found it: \"%s\"\n", tmps);
#endif
- bindir = lrealpath(tmps);
+ bindir = pcb_lrealpath(tmps);
found_bindir = 1;
free(tmps);
break;
@@ -226,26 +219,26 @@ void pcb_main_uninit(void)
if (conf_isdirty(CFR_USER))
conf_save_file(NULL, NULL, CFR_USER, NULL);
- UninitBuffers();
+ pcb_uninit_buffers();
/* Free up memory allocated to the PCB. Why bother when we're about to exit ?
* Because it removes some false positives from heap bug detectors such as
* lib dmalloc.
*/
- FreePCBMemory(PCB);
+ pcb_board_free(PCB);
free(PCB);
PCB = NULL;
- plugins_uninit();
- hid_uninit();
- events_uninit();
+ pcb_plugins_uninit();
+ pcb_hid_uninit();
+ pcb_events_uninit();
- uninit_strflags_buf();
- uninit_strflags_layerlist();
+ pcb_strflg_uninit_buf();
+ pcb_strflg_uninit_layerlist();
- fp_uninit();
- fp_host_uninit();
- funchash_uninit();
+ pcb_fp_uninit();
+ pcb_fp_host_uninit();
+ pcb_funchash_uninit();
free(hid_argv_orig);
conf_uninit();
}
@@ -259,6 +252,8 @@ const char *pcb_action_args[] = {
/*short, -long, action, help */
NULL, "-show-actions", "PrintActions()", "Print all available actions (human readable) and exit",
NULL, "-dump-actions", "DumpActions()", "Print all available actions (script readable) and exit",
+ NULL, "-dump-plugins", "DumpPlugins()", "Print all available plugins (script readable) and exit",
+ NULL, "-dump-plugindirs","DumpPluginDirs()", "Print all plugin directories searched and the number of plugins loaded from them (script readable) and exit",
NULL, "-show-paths", "PrintPaths()", "Print all configured paths and exit",
NULL, "-dump-config", "dumpconf(native,1)", "Print the config tree and exit",
"V", "-version", "PrintVersion()", "Print version info and exit",
@@ -279,6 +274,7 @@ int main(int argc, char *argv[])
const char **cs;
const char *main_action = NULL;
char *command_line_pcb = NULL;
+ vtptr_t plugin_cli_conf;
hid_argv_orig = hid_argv = calloc(sizeof(char *), argc);
/* init application:
@@ -294,6 +290,8 @@ int main(int argc, char *argv[])
conf_core_init();
conf_core_postproc(); /* to get all the paths initialized */
+ vtptr_init(&plugin_cli_conf);
+
/* process arguments */
for(n = 1; n < argc; n++) {
cmd = argv[n];
@@ -310,7 +308,7 @@ int main(int argc, char *argv[])
main_action = "PrintUsage()";
goto next_arg;
}
- if ((strcmp(cmd, "g") == 0) || (strcmp(cmd, "-gui") == 0)) {
+ if ((strcmp(cmd, "g") == 0) || (strcmp(cmd, "-gui") == 0) || (strcmp(cmd, "-hid") == 0)) {
do_what = DO_GUI;
hid_name = arg;
n++;
@@ -339,9 +337,19 @@ int main(int argc, char *argv[])
if (arg_match(cmd, "c", "-conf")) {
const char *why;
n++; /* eat up arg */
- if (conf_set_from_cli(NULL, arg, NULL, &why) != 0) {
- fprintf(stderr, "Error: failed to set config %s: %s\n", arg, why);
- exit(1);
+ if (strncmp(arg, "plugins/", 8) == 0) {
+ /* plugins are not yet loaded or initialized so their configs are
+ unavailable. Store these settings until plugins are up. This
+ should not happen to non-plugin config items as those might
+ affect how plugins are searched/loaded. */
+ void **a = vtptr_alloc_append(&plugin_cli_conf, 1);
+ *a = arg;
+ }
+ else {
+ if (conf_set_from_cli(NULL, arg, NULL, &why) != 0) {
+ fprintf(stderr, "Error: failed to set config %s: %s\n", arg, why);
+ exit(1);
+ }
}
goto next_arg;
}
@@ -357,7 +365,7 @@ int main(int argc, char *argv[])
setbuf(stdout, 0);
InitPaths(argv[0]);
- fp_init();
+ pcb_fp_init();
#ifdef LOCALEDIR
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
@@ -368,16 +376,16 @@ int main(int argc, char *argv[])
srand(time(NULL)); /* Set seed for rand() */
- funchash_init();
- initialize_units();
- polygon_init();
+ pcb_funchash_init();
+ pcb_units_init();
+ pcb_polygon_init();
/* This must be called before any other atexit functions
* are registered, as it configures an atexit function to
* clean up and free various items of allocated memory,
* and must be the last last atexit function to run.
*/
- leaky_init();
+ pcb_leaky_init();
/* Register a function to be called when the program terminates.
* This makes sure that data is saved even if LEX/YACC routines
@@ -385,23 +393,34 @@ int main(int argc, char *argv[])
* If the OS doesn't have at least one of them,
* the critical sections will be handled by parse_l.l
*/
- atexit(EmergencySave);
+ atexit(pcb_emergency_save);
- events_init();
+ pcb_events_init();
- buildin_init();
- hid_init();
- plugins_init();
+ pcb_buildin_init();
+ pcb_hid_init();
+ pcb_plugins_init();
+ { /* Now that plugins are already initialized, apply plugin config items */
+ int n;
+ for(n = 0; n < vtptr_len(&plugin_cli_conf); n++) {
+ const char *why, *arg = plugin_cli_conf.array[n];
+ if (conf_set_from_cli(NULL, arg, NULL, &why) != 0) {
+ fprintf(stderr, "Error: failed to set config %s: %s\n", arg, why);
+ exit(1);
+ }
+ }
+ vtptr_uninit(&plugin_cli_conf);
+ }
/* Export pcb from command line if requested. */
switch(do_what) {
- case DO_PRINT: exporter = gui = hid_find_printer(); break;
- case DO_EXPORT: exporter = gui = hid_find_exporter(hid_name); break;
+ case DO_PRINT: pcb_exporter = pcb_gui = pcb_hid_find_printer(); break;
+ case DO_EXPORT: pcb_exporter = pcb_gui = pcb_hid_find_exporter(hid_name); break;
case DO_GUI:
- gui = hid_find_gui(argv[2]);
- if (gui == NULL) {
- Message(PCB_MSG_DEFAULT, "Can't find the gui requested.\n");
+ pcb_gui = pcb_hid_find_gui(hid_name);
+ if (pcb_gui == NULL) {
+ pcb_message(PCB_MSG_ERROR, "Can't find the gui (%s) requested.\n", hid_name);
exit(1);
}
break;
@@ -410,23 +429,23 @@ int main(int argc, char *argv[])
int n;
const char *g;
- gui = NULL;
+ pcb_gui = NULL;
conf_loop_list_str(&conf_core.rc.preferred_gui, i, g, n) {
- gui = hid_find_gui(g);
- if (gui != NULL)
+ pcb_gui = pcb_hid_find_gui(g);
+ if (pcb_gui != NULL)
break;
}
/* try anything */
- if (gui == NULL) {
- Message(PCB_MSG_DEFAULT, "Warning: can't find any of the preferred GUIs, falling back to anything available...\n");
- gui = hid_find_gui(NULL);
+ if (pcb_gui == NULL) {
+ pcb_message(PCB_MSG_WARNING, "Warning: can't find any of the preferred GUIs, falling back to anything available...\nYou may want to check if the plugin is loaded, try --dump_plugins and --dump-plugindirs");
+ pcb_gui = pcb_hid_find_gui(NULL);
}
}
}
/* Exit with error if GUI failed to start. */
- if (!gui)
+ if (!pcb_gui)
exit(1);
/* Initialize actions only when the gui is already known so only the right
@@ -438,83 +457,83 @@ int main(int argc, char *argv[])
conf_update(NULL);
if (main_action != NULL) {
- hid_parse_command(main_action);
+ pcb_hid_parse_command(main_action);
exit(0);
}
- gui->parse_arguments(&hid_argc, &hid_argv);
+ pcb_gui->parse_arguments(&hid_argc, &hid_argv);
/* Create a new PCB object in memory */
- PCB = CreateNewPCB();
+ PCB = pcb_board_new();
if (PCB == NULL) {
- Message(PCB_MSG_ERROR, "Can't load the default pcb for creating an empty layout\n");
+ pcb_message(PCB_MSG_ERROR, "Can't load the default pcb for creating an empty layout\n");
exit(1);
}
/* Add silk layers to newly created PCB */
- CreateNewPCBPost(PCB, 1);
+ pcb_board_new_postproc(PCB, 1);
if (hid_argc > 0)
command_line_pcb = hid_argv[0];
- ResetStackAndVisibility();
+ pcb_layervis_reset_stack();
- if (gui->gui)
- InitCrosshair();
+ if (pcb_gui->gui)
+ pcb_crosshair_init();
InitHandler();
- InitBuffers();
+ pcb_init_buffers();
- SetMode(PCB_MODE_ARROW);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
if (command_line_pcb) {
/* keep filename even if initial load command failed;
* file might not exist
*/
- if (LoadPCB(command_line_pcb, NULL, pcb_true, 0))
+ if (pcb_load_pcb(command_line_pcb, NULL, pcb_true, 0))
PCB->Filename = pcb_strdup(command_line_pcb);
}
if (conf_core.design.initial_layer_stack && conf_core.design.initial_layer_stack[0]) {
- LayerStringToLayerStack(conf_core.design.initial_layer_stack);
+ pcb_layervis_parse_string(conf_core.design.initial_layer_stack);
}
/* read the library file and display it if it's not empty
*/
- if (!fp_read_lib_all() && library.data.dir.children.used)
- hid_action("LibraryChanged");
+ if (!pcb_fp_read_lib_all() && pcb_library.data.dir.children.used)
+ pcb_event(PCB_EVENT_LIBRARY_CHANGED, NULL);
if (conf_core.rc.script_filename) {
- Message(PCB_MSG_DEFAULT, _("Executing startup script file %s\n"), conf_core.rc.script_filename);
- hid_actionl("ExecuteFile", conf_core.rc.script_filename, NULL);
+ pcb_message(PCB_MSG_INFO, _("Executing startup script file %s\n"), conf_core.rc.script_filename);
+ pcb_hid_actionl("ExecuteFile", conf_core.rc.script_filename, NULL);
}
if (conf_core.rc.action_string) {
- Message(PCB_MSG_DEFAULT, _("Executing startup action %s\n"), conf_core.rc.action_string);
- hid_parse_actions(conf_core.rc.action_string);
+ pcb_message(PCB_MSG_INFO, _("Executing startup action %s\n"), conf_core.rc.action_string);
+ pcb_hid_parse_actions(conf_core.rc.action_string);
}
- if (gui->printer || gui->exporter) {
+ if (pcb_gui->printer || pcb_gui->exporter) {
/* Workaround to fix batch output for non-C locales */
setlocale(LC_NUMERIC, "C");
- gui->do_export(0);
+ pcb_gui->do_export(0);
exit(0);
}
- EnableAutosave();
+ pcb_enable_autosave();
/* main loop */
do {
- gui->do_export(0);
- gui = next_gui;
- next_gui = NULL;
- if (gui != NULL) {
+ pcb_gui->do_export(0);
+ pcb_gui = pcb_next_gui;
+ pcb_next_gui = NULL;
+ if (pcb_gui != NULL) {
/* init the next GUI */
- gui->parse_arguments(&hid_argc, &hid_argv);
- if (gui->gui)
- InitCrosshair();
- SetMode(PCB_MODE_ARROW);
- hid_action("LibraryChanged");
+ pcb_gui->parse_arguments(&hid_argc, &hid_argv);
+ if (pcb_gui->gui)
+ pcb_crosshair_init();
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
+ pcb_event(PCB_EVENT_LIBRARY_CHANGED, NULL);
}
- } while(gui != NULL);
+ } while(pcb_gui != NULL);
pcb_main_uninit();
diff --git a/src/main_act.c b/src/main_act.c
index 0ab5d6b..2cce0b6 100644
--- a/src/main_act.c
+++ b/src/main_act.c
@@ -29,35 +29,32 @@
#include "config.h"
-#include "action_helper.h"
#include "hid_actions.h"
-#include "hid_attrib.h"
#include "hid_init.h"
-#include "hid.h"
-#include "data.h"
#include "conf_core.h"
+#include "plugins.h"
/* --------------------------------------------------------------------------- */
-static const char printactions_syntax[] = "PrintActions()";
+static const char pcb_acts_PrintActions[] = "PrintActions()";
-static const char printactions_help[] = "Print all actions available.";
+static const char pcb_acth_PrintActions[] = "Print all actions available.";
-int ActionPrintActions(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_PrintActions(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- print_actions();
+ pcb_print_actions();
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char dumpactions_syntax[] = "DumpActions()";
+static const char pcb_acts_DumpActions[] = "DumpActions()";
-static const char dumpactions_help[] = "Dump all actions available.";
+static const char pcb_acth_DumpActions[] = "Dump all actions available.";
-int ActionDumpActions(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_DumpActions(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- dump_actions();
+ pcb_dump_actions();
return 0;
}
@@ -71,15 +68,15 @@ static inline void u(const char *fmt, ...)
va_end(ap);
}
-static const char printusage_syntax[] =
+static const char pcb_acts_PrintUsage[] =
"PrintUsage()\n"
"PrintUsage(plugin)";
-static const char printusage_help[] = "Print command line arguments of pcb-rnd or a plugin loaded.";
+static const char pcb_acth_PrintUsage[] = "Print command line arguments of pcb-rnd or a plugin loaded.";
static int help0(void)
{
- HID **hl = hid_enumerate();
+ pcb_hid_t **hl = pcb_hid_enumerate();
int i;
u("pcb-rnd Printed Circuit Board editing program, http://repo.hu/projects/pcb-rnd");
@@ -112,7 +109,7 @@ static int help_main(void) {
static int help_invoc(void)
{
- HID **hl = hid_enumerate();
+ pcb_hid_t **hl = pcb_hid_enumerate();
int i;
int n_printer = 0, n_gui = 0, n_exporter = 0;
@@ -146,11 +143,11 @@ static int help_invoc(void)
return 0;
}
-int ActionPrintUsage(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_PrintUsage(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
u("");
if (argc > 0) {
- HID **hl = hid_enumerate();
+ pcb_hid_t **hl = pcb_hid_enumerate();
int i;
if (strcmp(argv[0], "invocation") == 0) return help_invoc();
@@ -174,22 +171,22 @@ int ActionPrintUsage(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char printversion_syntax[] = "PrintVersion()";
+static const char pcb_acts_PrintVersion[] = "PrintVersion()";
-static const char printversion_help[] = "Print version.";
+static const char pcb_acth_PrintVersion[] = "Print version.";
-int ActionPrintVersion(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_PrintVersion(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
printf("PCB version %s\n", VERSION);
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char printcopyright_syntax[] = "PrintCopyright()";
+static const char pcb_acts_PrintCopyright[] = "PrintCopyright()";
-static const char printcopyright_help[] = "Print copyright notice.";
+static const char pcb_acth_PrintCopyright[] = "Print copyright notice.";
-int ActionPrintCopyright(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_PrintCopyright(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
printf("\n"
" COPYRIGHT for the original pcb program:\n\n"
@@ -214,9 +211,9 @@ int ActionPrintCopyright(int argc, const char **argv, Coord x, Coord y)
}
/* --------------------------------------------------------------------------- */
-static const char printpaths_syntax[] = "PrintPaths()";
+static const char pcb_acts_PrintPaths[] = "PrintPaths()";
-static const char printpaths_help[] = "Print full paths and search paths.";
+static const char pcb_acth_PrintPaths[] = "Print full paths and search paths.";
static void print_list(const conflist_t *cl)
{
@@ -231,7 +228,7 @@ static void print_list(const conflist_t *cl)
printf("\"\n");
}
-int ActionPrintPaths(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_PrintPaths(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
htsp_entry_t *e;
conf_fields_foreach(e) {
@@ -245,27 +242,60 @@ int ActionPrintPaths(int argc, const char **argv, Coord x, Coord y)
return 0;
}
+/* --------------------------------------------------------------------------- */
+static const char pcb_acts_DumpPlugins[] = "DumpPlugins()";
+
+static const char pcb_acth_DumpPlugins[] = "Print plugins loaded.";
+
+int pcb_act_DumpPlugins(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ pcb_plugin_info_t *i;
+ for(i = plugins; i != NULL; i = i->next)
+ printf("%s\t%s\n", i->name, i->path);
+ return 0;
+}
/* --------------------------------------------------------------------------- */
+static const char pcb_acts_DumpPluginDirs[] = "DumpPluginDirs()";
+
+static const char pcb_acth_DumpPluginDirs[] = "Print plugins directories and the number of plugins loaded from each.";
-HID_Action main_action_list[] = {
- {"PrintActions", 0, ActionPrintActions,
- printactions_help, printactions_syntax}
+int pcb_act_DumpPluginDirs(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ const pcb_plugin_dir_t *d;
+ for(d = pcb_plugin_dir_first; d != NULL; d = d->next)
+ printf("%s\t%d\n", d->path, d->num_plugins);
+ return 0;
+}
+
+
+/* --------------------------------------------------------------------------- */
+
+pcb_hid_action_t main_action_list[] = {
+ {"PrintActions", 0, pcb_act_PrintActions,
+ pcb_acth_PrintActions, pcb_acts_PrintActions}
+ ,
+ {"DumpActions", 0, pcb_act_DumpActions,
+ pcb_acth_DumpActions, pcb_acts_DumpActions}
,
- {"DumpActions", 0, ActionDumpActions,
- dumpactions_help, dumpactions_syntax}
+ {"PrintUsage", 0, pcb_act_PrintUsage,
+ pcb_acth_PrintUsage, pcb_acts_PrintUsage}
,
- {"PrintUsage", 0, ActionPrintUsage,
- printusage_help, printusage_syntax}
+ {"PrintVersion", 0, pcb_act_PrintVersion,
+ pcb_acth_PrintVersion, pcb_acts_PrintVersion}
,
- {"PrintVersion", 0, ActionPrintVersion,
- printversion_help, printversion_syntax}
+ {"PrintCopyright", 0, pcb_act_PrintCopyright,
+ pcb_acth_PrintCopyright, pcb_acts_PrintCopyright}
,
- {"PrintCopyright", 0, ActionPrintCopyright,
- printcopyright_help, printcopyright_syntax}
+ {"PrintPaths", 0, pcb_act_PrintPaths,
+ pcb_acth_PrintPaths, pcb_acts_PrintPaths}
,
- {"PrintPaths", 0, ActionPrintPaths,
- printpaths_help, printpaths_syntax}
+ {"DumpPlugins", 0, pcb_act_DumpPlugins,
+ pcb_acth_DumpPlugins, pcb_acts_DumpPlugins}
+ ,
+ {"DumpPluginDirs", 0, pcb_act_DumpPluginDirs,
+ pcb_acth_DumpPluginDirs, pcb_acts_DumpPluginDirs}
+
};
-REGISTER_ACTIONS(main_action_list, NULL)
+PCB_REGISTER_ACTIONS(main_action_list, NULL)
diff --git a/src/math_helper.h b/src/math_helper.h
new file mode 100644
index 0000000..c950082
--- /dev/null
+++ b/src/math_helper.h
@@ -0,0 +1,66 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+#include <math.h>
+
+/* ---------------------------------------------------------------------------
+ * some math constants
+ */
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+#ifndef M_SQRT1_2
+#define M_SQRT1_2 0.707106781 /* 1/sqrt(2) */
+#endif
+#define PCB_M180 (M_PI/180.0)
+#define PCB_RAD_TO_DEG (180.0/M_PI)
+#define PCB_TAN_22_5_DEGREE_2 0.207106781 /* 0.5*tan(22.5) */
+#define PCB_COS_22_5_DEGREE 0.923879533 /* cos(22.5) */
+#define PCB_TAN_30_DEGREE 0.577350269 /* tan(30) */
+#define PCB_TAN_60_DEGREE 1.732050808 /* tan(60) */
+#define PCB_LN_2_OVER_2 0.346573590
+#define PCB_TO_RADIANS(degrees) (PCB_M180 * (degrees))
+
+#define PCB_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
+#define PCB_ABS(a) (((a) < 0) ? -(a) : (a))
+
+/* ---------------------------------------------------------------------------
+ * misc macros, some might already be defined by <limits.h>
+ */
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef SGN
+#define SGN(a) ((a) >0 ? 1 : ((a) == 0 ? 0 : -1))
+#endif
+#define PCB_SGNZ(a) ((a) >=0 ? 1 : -1)
+#define PCB_MAKE_MIN(a,b) if ((b) < (a)) (a) = (b)
+#define PCB_MAKE_MAX(a,b) if ((b) > (a)) (a) = (b)
+
+
+#define PCB_SWAP_SIGN_X(x) (x)
+#define PCB_SWAP_SIGN_Y(y) (-(y))
diff --git a/src/mirror.c b/src/mirror.c
deleted file mode 100644
index 6b4c356..0000000
--- a/src/mirror.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-
-/* functions used to change the mirror flag of an object
- *
- * an undo operation is not implemented because it's easy to
- * recover an object
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-
-#include "data.h"
-#include "mirror.h"
-#include "misc.h"
-#include "polygon.h"
-
-/* ---------------------------------------------------------------------------
- * mirrors the coordinates of an element
- * an additional offset is passed
- */
-void MirrorElementCoordinates(DataTypePtr Data, ElementTypePtr Element, Coord yoff)
-{
- r_delete_element(Data, Element);
- ELEMENTLINE_LOOP(Element);
- {
- line->Point1.X = SWAP_X(line->Point1.X);
- line->Point1.Y = SWAP_Y(line->Point1.Y) + yoff;
- line->Point2.X = SWAP_X(line->Point2.X);
- line->Point2.Y = SWAP_Y(line->Point2.Y) + yoff;
- }
- END_LOOP;
- PIN_LOOP(Element);
- {
- RestoreToPolygon(Data, PCB_TYPE_PIN, Element, pin);
- pin->X = SWAP_X(pin->X);
- pin->Y = SWAP_Y(pin->Y) + yoff;
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- RestoreToPolygon(Data, PCB_TYPE_PAD, Element, pad);
- pad->Point1.X = SWAP_X(pad->Point1.X);
- pad->Point1.Y = SWAP_Y(pad->Point1.Y) + yoff;
- pad->Point2.X = SWAP_X(pad->Point2.X);
- pad->Point2.Y = SWAP_Y(pad->Point2.Y) + yoff;
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, pad);
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- arc->X = SWAP_X(arc->X);
- arc->Y = SWAP_Y(arc->Y) + yoff;
- arc->StartAngle = SWAP_ANGLE(arc->StartAngle);
- arc->Delta = SWAP_DELTA(arc->Delta);
- }
- END_LOOP;
- ELEMENTTEXT_LOOP(Element);
- {
- text->X = SWAP_X(text->X);
- text->Y = SWAP_Y(text->Y) + yoff;
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, text);
- }
- END_LOOP;
- Element->MarkX = SWAP_X(Element->MarkX);
- Element->MarkY = SWAP_Y(Element->MarkY) + yoff;
-
- /* now toggle the solder-side flag */
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, Element);
- /* this inserts all of the rtree data too */
- SetElementBoundingBox(Data, Element, &PCB->Font);
- ClearFromPolygon(Data, PCB_TYPE_ELEMENT, Element, Element);
-}
diff --git a/src/mirror.h b/src/mirror.h
deleted file mode 100644
index 9488a84..0000000
--- a/src/mirror.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes to change objects mirror flag */
-
-#ifndef PCB_MIRROR_H
-#define PCB_MIRROR_H
-
-#include "global.h"
-
-/* ---------------------------------------------------------------------------
- * some useful macros and defines
- */
-#define MIRROR(object) TOGGLE_FLAG(MIRRORFLAG, (object))
-
-#define MIRROR_TYPES (PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME)
-
-
-void MirrorElementCoordinates(DataTypePtr, ElementTypePtr, Coord);
-
-#endif
diff --git a/src/misc.c b/src/misc.c
deleted file mode 100644
index 085d31b..0000000
--- a/src/misc.c
+++ /dev/null
@@ -1,1310 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996,2004,2006 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 at rz.uni-ulm.de
- *
- */
-
-/* misc functions used by several modules */
-
-#include "config.h"
-#include "conf_core.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <math.h>
-#include <string.h>
-#include <memory.h>
-#include <ctype.h>
-#include <signal.h>
-#include <math.h>
-
-#include "box.h"
-#include "crosshair.h"
-#include "data.h"
-#include "plug_io.h"
-#include "error.h"
-#include "misc.h"
-#include "move.h"
-#include "polygon.h"
-#include "rtree.h"
-#include "rotate.h"
-#include "rubberband.h"
-#include "set.h"
-#include "undo.h"
-#include "compat_misc.h"
-#include "hid_actions.h"
-#include "hid_init.h"
-
-/* forward declarations */
-static char *BumpName(char *);
-static void GetGridLockCoordinates(int, void *, void *, void *, Coord *, Coord *);
-
-/* Local variables */
-
-/* Bring an angle into [0, 360) range */
-Angle NormalizeAngle(Angle a)
-{
- while (a < 0)
- a += 360.0;
- while (a >= 360.0)
- a -= 360.0;
- return a;
-}
-
-/* ---------------------------------------------------------------------------
- * sets the bounding box of a point (which is silly)
- */
-void SetPointBoundingBox(PointTypePtr Pnt)
-{
- Pnt->X2 = Pnt->X + 1;
- Pnt->Y2 = Pnt->Y + 1;
-}
-
-/* ---------------------------------------------------------------------------
- * sets the bounding box of a pin or via
- */
-void SetPinBoundingBox(PinTypePtr Pin)
-{
- Coord width;
-
- if ((GET_SQUARE(Pin) > 1) && (TEST_FLAG(PCB_FLAG_SQUARE, Pin))) {
- POLYAREA *p = PinPoly(Pin, PIN_SIZE(Pin), Pin->Clearance);
- poly_bbox(p, &Pin->BoundingBox);
- poly_Free(&p);
- }
-
- /* the bounding box covers the extent of influence
- * so it must include the clearance values too
- */
- width = MAX(Pin->Clearance + PIN_SIZE(Pin), Pin->Mask) / 2;
-
- /* Adjust for our discrete polygon approximation */
- width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5;
-
- Pin->BoundingBox.X1 = Pin->X - width;
- Pin->BoundingBox.Y1 = Pin->Y - width;
- Pin->BoundingBox.X2 = Pin->X + width;
- Pin->BoundingBox.Y2 = Pin->Y + width;
- close_box(&Pin->BoundingBox);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the bounding box of a pad
- */
-void SetPadBoundingBox(PadTypePtr Pad)
-{
- Coord width;
- Coord deltax;
- Coord deltay;
-
- /* the bounding box covers the extent of influence
- * so it must include the clearance values too
- */
- width = (Pad->Thickness + Pad->Clearance + 1) / 2;
- width = MAX(width, (Pad->Mask + 1) / 2);
- deltax = Pad->Point2.X - Pad->Point1.X;
- deltay = Pad->Point2.Y - Pad->Point1.Y;
-
- if (TEST_FLAG(PCB_FLAG_SQUARE, Pad) && deltax != 0 && deltay != 0) {
- /* slanted square pad */
- double theta;
- Coord btx, bty;
-
- /* T is a vector half a thickness long, in the direction of
- one of the corners. */
- theta = atan2(deltay, deltax);
- btx = width * cos(theta + M_PI / 4) * sqrt(2.0);
- bty = width * sin(theta + M_PI / 4) * sqrt(2.0);
-
-
- Pad->BoundingBox.X1 = MIN(MIN(Pad->Point1.X - btx, Pad->Point1.X - bty), MIN(Pad->Point2.X + btx, Pad->Point2.X + bty));
- Pad->BoundingBox.X2 = MAX(MAX(Pad->Point1.X - btx, Pad->Point1.X - bty), MAX(Pad->Point2.X + btx, Pad->Point2.X + bty));
- Pad->BoundingBox.Y1 = MIN(MIN(Pad->Point1.Y + btx, Pad->Point1.Y - bty), MIN(Pad->Point2.Y - btx, Pad->Point2.Y + bty));
- Pad->BoundingBox.Y2 = MAX(MAX(Pad->Point1.Y + btx, Pad->Point1.Y - bty), MAX(Pad->Point2.Y - btx, Pad->Point2.Y + bty));
- }
- else {
- /* Adjust for our discrete polygon approximation */
- width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5;
-
- Pad->BoundingBox.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - width;
- Pad->BoundingBox.X2 = MAX(Pad->Point1.X, Pad->Point2.X) + width;
- Pad->BoundingBox.Y1 = MIN(Pad->Point1.Y, Pad->Point2.Y) - width;
- Pad->BoundingBox.Y2 = MAX(Pad->Point1.Y, Pad->Point2.Y) + width;
- }
- close_box(&Pad->BoundingBox);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the bounding box of a line
- */
-void SetLineBoundingBox(LineTypePtr Line)
-{
- Coord width = (Line->Thickness + Line->Clearance + 1) / 2;
-
- /* Adjust for our discrete polygon approximation */
- width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5;
-
- Line->BoundingBox.X1 = MIN(Line->Point1.X, Line->Point2.X) - width;
- Line->BoundingBox.X2 = MAX(Line->Point1.X, Line->Point2.X) + width;
- Line->BoundingBox.Y1 = MIN(Line->Point1.Y, Line->Point2.Y) - width;
- Line->BoundingBox.Y2 = MAX(Line->Point1.Y, Line->Point2.Y) + width;
- close_box(&Line->BoundingBox);
- SetPointBoundingBox(&Line->Point1);
- SetPointBoundingBox(&Line->Point2);
-}
-
-/* ---------------------------------------------------------------------------
- * sets the bounding box of a polygons
- */
-void SetPolygonBoundingBox(PolygonTypePtr Polygon)
-{
- Polygon->BoundingBox.X1 = Polygon->BoundingBox.Y1 = MAX_COORD;
- Polygon->BoundingBox.X2 = Polygon->BoundingBox.Y2 = 0;
- POLYGONPOINT_LOOP(Polygon);
- {
- MAKEMIN(Polygon->BoundingBox.X1, point->X);
- MAKEMIN(Polygon->BoundingBox.Y1, point->Y);
- MAKEMAX(Polygon->BoundingBox.X2, point->X);
- MAKEMAX(Polygon->BoundingBox.Y2, point->Y);
- }
- /* boxes don't include the lower right corner */
- close_box(&Polygon->BoundingBox);
- END_LOOP;
-}
-
-/* ---------------------------------------------------------------------------
- * sets the bounding box of an elements
- */
-void SetElementBoundingBox(DataTypePtr Data, ElementTypePtr Element, FontTypePtr Font)
-{
- BoxTypePtr box, vbox;
-
- if (Data && Data->element_tree)
- r_delete_entry(Data->element_tree, (BoxType *) Element);
- /* first update the text objects */
- ELEMENTTEXT_LOOP(Element);
- {
- if (Data && Data->name_tree[n])
- r_delete_entry(Data->name_tree[n], (BoxType *) text);
- SetTextBoundingBox(Font, text);
- if (Data && !Data->name_tree[n])
- Data->name_tree[n] = r_create_tree(NULL, 0, 0);
- if (Data)
- r_insert_entry(Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
-
- /* do not include the elementnames bounding box which
- * is handled separately
- */
- box = &Element->BoundingBox;
- vbox = &Element->VBox;
- box->X1 = box->Y1 = MAX_COORD;
- box->X2 = box->Y2 = 0;
- ELEMENTLINE_LOOP(Element);
- {
- SetLineBoundingBox(line);
- MAKEMIN(box->X1, line->Point1.X - (line->Thickness + 1) / 2);
- MAKEMIN(box->Y1, line->Point1.Y - (line->Thickness + 1) / 2);
- MAKEMIN(box->X1, line->Point2.X - (line->Thickness + 1) / 2);
- MAKEMIN(box->Y1, line->Point2.Y - (line->Thickness + 1) / 2);
- MAKEMAX(box->X2, line->Point1.X + (line->Thickness + 1) / 2);
- MAKEMAX(box->Y2, line->Point1.Y + (line->Thickness + 1) / 2);
- MAKEMAX(box->X2, line->Point2.X + (line->Thickness + 1) / 2);
- MAKEMAX(box->Y2, line->Point2.Y + (line->Thickness + 1) / 2);
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- SetArcBoundingBox(arc);
- MAKEMIN(box->X1, arc->BoundingBox.X1);
- MAKEMIN(box->Y1, arc->BoundingBox.Y1);
- MAKEMAX(box->X2, arc->BoundingBox.X2);
- MAKEMAX(box->Y2, arc->BoundingBox.Y2);
- }
- END_LOOP;
- *vbox = *box;
- PIN_LOOP(Element);
- {
- if (Data && Data->pin_tree)
- r_delete_entry(Data->pin_tree, (BoxType *) pin);
- SetPinBoundingBox(pin);
- if (Data) {
- if (!Data->pin_tree)
- Data->pin_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Data->pin_tree, (BoxType *) pin, 0);
- }
- MAKEMIN(box->X1, pin->BoundingBox.X1);
- MAKEMIN(box->Y1, pin->BoundingBox.Y1);
- MAKEMAX(box->X2, pin->BoundingBox.X2);
- MAKEMAX(box->Y2, pin->BoundingBox.Y2);
- MAKEMIN(vbox->X1, pin->X - pin->Thickness / 2);
- MAKEMIN(vbox->Y1, pin->Y - pin->Thickness / 2);
- MAKEMAX(vbox->X2, pin->X + pin->Thickness / 2);
- MAKEMAX(vbox->Y2, pin->Y + pin->Thickness / 2);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- if (Data && Data->pad_tree)
- r_delete_entry(Data->pad_tree, (BoxType *) pad);
- SetPadBoundingBox(pad);
- if (Data) {
- if (!Data->pad_tree)
- Data->pad_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Data->pad_tree, (BoxType *) pad, 0);
- }
- MAKEMIN(box->X1, pad->BoundingBox.X1);
- MAKEMIN(box->Y1, pad->BoundingBox.Y1);
- MAKEMAX(box->X2, pad->BoundingBox.X2);
- MAKEMAX(box->Y2, pad->BoundingBox.Y2);
- MAKEMIN(vbox->X1, MIN(pad->Point1.X, pad->Point2.X) - pad->Thickness / 2);
- MAKEMIN(vbox->Y1, MIN(pad->Point1.Y, pad->Point2.Y) - pad->Thickness / 2);
- MAKEMAX(vbox->X2, MAX(pad->Point1.X, pad->Point2.X) + pad->Thickness / 2);
- MAKEMAX(vbox->Y2, MAX(pad->Point1.Y, pad->Point2.Y) + pad->Thickness / 2);
- }
- END_LOOP;
- /* now we set the PCB_FLAG_EDGE2 of the pad if Point2
- * is closer to the outside edge than Point1
- */
- PAD_LOOP(Element);
- {
- if (pad->Point1.Y == pad->Point2.Y) {
- /* horizontal pad */
- if (box->X2 - pad->Point2.X < pad->Point1.X - box->X1)
- SET_FLAG(PCB_FLAG_EDGE2, pad);
- else
- CLEAR_FLAG(PCB_FLAG_EDGE2, pad);
- }
- else {
- /* vertical pad */
- if (box->Y2 - pad->Point2.Y < pad->Point1.Y - box->Y1)
- SET_FLAG(PCB_FLAG_EDGE2, pad);
- else
- CLEAR_FLAG(PCB_FLAG_EDGE2, pad);
- }
- }
- END_LOOP;
-
- /* mark pins with component orientation */
- if ((box->X2 - box->X1) > (box->Y2 - box->Y1)) {
- PIN_LOOP(Element);
- {
- SET_FLAG(PCB_FLAG_EDGE2, pin);
- }
- END_LOOP;
- }
- else {
- PIN_LOOP(Element);
- {
- CLEAR_FLAG(PCB_FLAG_EDGE2, pin);
- }
- END_LOOP;
- }
- close_box(box);
- close_box(vbox);
- if (Data && !Data->element_tree)
- Data->element_tree = r_create_tree(NULL, 0, 0);
- if (Data)
- r_insert_entry(Data->element_tree, box, 0);
-}
-
-/* ---------------------------------------------------------------------------
- * creates the bounding box of a text object
- */
-void SetTextBoundingBox(FontTypePtr FontPtr, TextTypePtr Text)
-{
- SymbolTypePtr symbol = FontPtr->Symbol;
- unsigned char *s = (unsigned char *) Text->TextString;
- int i;
- int space;
-
- Coord minx, miny, maxx, maxy, tx;
- Coord min_final_radius;
- Coord min_unscaled_radius;
- pcb_bool first_time = pcb_true;
-
- minx = miny = maxx = maxy = tx = 0;
-
- /* Calculate the bounding box based on the larger of the thicknesses
- * the text might clamped at on silk or copper layers.
- */
- min_final_radius = MAX(PCB->minWid, PCB->minSlk) / 2;
-
- /* Pre-adjust the line radius for the fact we are initially computing the
- * bounds of the un-scaled text, and the thickness clamping applies to
- * scaled text.
- */
- min_unscaled_radius = PCB_UNPCB_SCALE_TEXT(min_final_radius, Text->Scale);
-
- /* calculate size of the bounding box */
- for (; s && *s; s++) {
- if (*s <= MAX_FONTPOSITION && symbol[*s].Valid) {
- LineTypePtr line = symbol[*s].Line;
- for (i = 0; i < symbol[*s].LineN; line++, i++) {
- /* Clamp the width of text lines at the minimum thickness.
- * NB: Divide 4 in thickness calculation is comprised of a factor
- * of 1/2 to get a radius from the center-line, and a factor
- * of 1/2 because some stupid reason we render our glyphs
- * at half their defined stroke-width.
- */
- Coord unscaled_radius = MAX(min_unscaled_radius, line->Thickness / 4);
-
- if (first_time) {
- minx = maxx = line->Point1.X;
- miny = maxy = line->Point1.Y;
- first_time = pcb_false;
- }
-
- minx = MIN(minx, line->Point1.X - unscaled_radius + tx);
- miny = MIN(miny, line->Point1.Y - unscaled_radius);
- minx = MIN(minx, line->Point2.X - unscaled_radius + tx);
- miny = MIN(miny, line->Point2.Y - unscaled_radius);
- maxx = MAX(maxx, line->Point1.X + unscaled_radius + tx);
- maxy = MAX(maxy, line->Point1.Y + unscaled_radius);
- maxx = MAX(maxx, line->Point2.X + unscaled_radius + tx);
- maxy = MAX(maxy, line->Point2.Y + unscaled_radius);
- }
- space = symbol[*s].Delta;
- }
- else {
- BoxType *ds = &FontPtr->DefaultSymbol;
- Coord w = ds->X2 - ds->X1;
-
- minx = MIN(minx, ds->X1 + tx);
- miny = MIN(miny, ds->Y1);
- minx = MIN(minx, ds->X2 + tx);
- miny = MIN(miny, ds->Y2);
- maxx = MAX(maxx, ds->X1 + tx);
- maxy = MAX(maxy, ds->Y1);
- maxx = MAX(maxx, ds->X2 + tx);
- maxy = MAX(maxy, ds->Y2);
-
- space = w / 5;
- }
- tx += symbol[*s].Width + space;
- }
-
- /* scale values */
- minx = PCB_SCALE_TEXT(minx, Text->Scale);
- miny = PCB_SCALE_TEXT(miny, Text->Scale);
- maxx = PCB_SCALE_TEXT(maxx, Text->Scale);
- maxy = PCB_SCALE_TEXT(maxy, Text->Scale);
-
- /* set upper-left and lower-right corner;
- * swap coordinates if necessary (origin is already in 'swapped')
- * and rotate box
- */
-
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, Text)) {
- Text->BoundingBox.X1 = Text->X + minx;
- Text->BoundingBox.Y1 = Text->Y - miny;
- Text->BoundingBox.X2 = Text->X + maxx;
- Text->BoundingBox.Y2 = Text->Y - maxy;
- RotateBoxLowLevel(&Text->BoundingBox, Text->X, Text->Y, (4 - Text->Direction) & 0x03);
- }
- else {
- Text->BoundingBox.X1 = Text->X + minx;
- Text->BoundingBox.Y1 = Text->Y + miny;
- Text->BoundingBox.X2 = Text->X + maxx;
- Text->BoundingBox.Y2 = Text->Y + maxy;
- RotateBoxLowLevel(&Text->BoundingBox, Text->X, Text->Y, Text->Direction);
- }
-
- /* the bounding box covers the extent of influence
- * so it must include the clearance values too
- */
- Text->BoundingBox.X1 -= PCB->Bloat;
- Text->BoundingBox.Y1 -= PCB->Bloat;
- Text->BoundingBox.X2 += PCB->Bloat;
- Text->BoundingBox.Y2 += PCB->Bloat;
- close_box(&Text->BoundingBox);
-}
-
-/* ---------------------------------------------------------------------------
- * returns pcb_true if data area is empty
- */
-pcb_bool IsDataEmpty(DataTypePtr Data)
-{
- pcb_bool hasNoObjects;
- pcb_cardinal_t i;
-
- hasNoObjects = (pinlist_length(&Data->Via) == 0);
- hasNoObjects &= (elementlist_length(&Data->Element) == 0);
- for (i = 0; i < max_copper_layer + 2; i++)
- hasNoObjects = hasNoObjects && LAYER_IS_EMPTY(&(Data->Layer[i]));
- return (hasNoObjects);
-}
-
-int FlagIsDataEmpty(int parm)
-{
- int i = IsDataEmpty(PCB->Data);
- return parm ? !i : i;
-}
-
-/* FLAG(DataEmpty,FlagIsDataEmpty,0) */
-/* FLAG(DataNonEmpty,FlagIsDataEmpty,1) */
-
-pcb_bool IsPasteEmpty(int side)
-{
- pcb_bool paste_empty = pcb_true;
- ALLPAD_LOOP(PCB->Data);
- {
- if (ON_SIDE(pad, side) && !TEST_FLAG(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) {
- paste_empty = pcb_false;
- break;
- }
- }
- ENDALL_LOOP;
- return paste_empty;
-}
-
-
-typedef struct {
- int nplated;
- int nunplated;
-} HoleCountStruct;
-
-static r_dir_t hole_counting_callback(const BoxType * b, void *cl)
-{
- PinTypePtr pin = (PinTypePtr) b;
- HoleCountStruct *hcs = (HoleCountStruct *) cl;
- if (TEST_FLAG(PCB_FLAG_HOLE, pin))
- hcs->nunplated++;
- else
- hcs->nplated++;
- return R_DIR_FOUND_CONTINUE;
-}
-
-/* ---------------------------------------------------------------------------
- * counts the number of plated and unplated holes in the design within
- * a given area of the board. To count for the whole board, pass NULL
- * within_area.
- */
-void CountHoles(int *plated, int *unplated, const BoxType * within_area)
-{
- HoleCountStruct hcs = { 0, 0 };
-
- r_search(PCB->Data->pin_tree, within_area, NULL, hole_counting_callback, &hcs, NULL);
- r_search(PCB->Data->via_tree, within_area, NULL, hole_counting_callback, &hcs, NULL);
-
- if (plated != NULL)
- *plated = hcs.nplated;
- if (unplated != NULL)
- *unplated = hcs.nunplated;
-}
-
-
-/* ---------------------------------------------------------------------------
- * gets minimum and maximum coordinates
- * returns NULL if layout is empty
- */
-BoxTypePtr GetDataBoundingBox(DataTypePtr Data)
-{
- static BoxType box;
- /* FIX ME: use r_search to do this much faster */
-
- /* preset identifiers with highest and lowest possible values */
- box.X1 = box.Y1 = MAX_COORD;
- box.X2 = box.Y2 = -MAX_COORD;
-
- /* now scan for the lowest/highest X and Y coordinate */
- VIA_LOOP(Data);
- {
- box.X1 = MIN(box.X1, via->X - via->Thickness / 2);
- box.Y1 = MIN(box.Y1, via->Y - via->Thickness / 2);
- box.X2 = MAX(box.X2, via->X + via->Thickness / 2);
- box.Y2 = MAX(box.Y2, via->Y + via->Thickness / 2);
- }
- END_LOOP;
- ELEMENT_LOOP(Data);
- {
- box.X1 = MIN(box.X1, element->BoundingBox.X1);
- box.Y1 = MIN(box.Y1, element->BoundingBox.Y1);
- box.X2 = MAX(box.X2, element->BoundingBox.X2);
- box.Y2 = MAX(box.Y2, element->BoundingBox.Y2);
- {
- TextTypePtr text = &NAMEONPCB_TEXT(element);
- box.X1 = MIN(box.X1, text->BoundingBox.X1);
- box.Y1 = MIN(box.Y1, text->BoundingBox.Y1);
- box.X2 = MAX(box.X2, text->BoundingBox.X2);
- box.Y2 = MAX(box.Y2, text->BoundingBox.Y2);
- };
- }
- END_LOOP;
- ALLLINE_LOOP(Data);
- {
- box.X1 = MIN(box.X1, line->Point1.X - line->Thickness / 2);
- box.Y1 = MIN(box.Y1, line->Point1.Y - line->Thickness / 2);
- box.X1 = MIN(box.X1, line->Point2.X - line->Thickness / 2);
- box.Y1 = MIN(box.Y1, line->Point2.Y - line->Thickness / 2);
- box.X2 = MAX(box.X2, line->Point1.X + line->Thickness / 2);
- box.Y2 = MAX(box.Y2, line->Point1.Y + line->Thickness / 2);
- box.X2 = MAX(box.X2, line->Point2.X + line->Thickness / 2);
- box.Y2 = MAX(box.Y2, line->Point2.Y + line->Thickness / 2);
- }
- ENDALL_LOOP;
- ALLARC_LOOP(Data);
- {
- box.X1 = MIN(box.X1, arc->BoundingBox.X1);
- box.Y1 = MIN(box.Y1, arc->BoundingBox.Y1);
- box.X2 = MAX(box.X2, arc->BoundingBox.X2);
- box.Y2 = MAX(box.Y2, arc->BoundingBox.Y2);
- }
- ENDALL_LOOP;
- ALLTEXT_LOOP(Data);
- {
- box.X1 = MIN(box.X1, text->BoundingBox.X1);
- box.Y1 = MIN(box.Y1, text->BoundingBox.Y1);
- box.X2 = MAX(box.X2, text->BoundingBox.X2);
- box.Y2 = MAX(box.Y2, text->BoundingBox.Y2);
- }
- ENDALL_LOOP;
- ALLPOLYGON_LOOP(Data);
- {
- box.X1 = MIN(box.X1, polygon->BoundingBox.X1);
- box.Y1 = MIN(box.Y1, polygon->BoundingBox.Y1);
- box.X2 = MAX(box.X2, polygon->BoundingBox.X2);
- box.Y2 = MAX(box.Y2, polygon->BoundingBox.Y2);
- }
- ENDALL_LOOP;
- return (IsDataEmpty(Data) ? NULL : &box);
-}
-
-/* ---------------------------------------------------------------------------
- * centers the displayed PCB around the specified point (X,Y)
- */
-void CenterDisplay(Coord X, Coord Y)
-{
- Coord save_grid = PCB->Grid;
- PCB->Grid = 1;
- if (MoveCrosshairAbsolute(X, Y))
- notify_crosshair_change(pcb_true);
- gui->set_crosshair(Crosshair.X, Crosshair.Y, HID_SC_WARP_POINTER);
- PCB->Grid = save_grid;
-}
-
-/* ---------------------------------------------------------------------------
- * transforms symbol coordinates so that the left edge of each symbol
- * is at the zero position. The y coordinates are moved so that min(y) = 0
- *
- */
-void SetFontInfo(FontTypePtr Ptr)
-{
- pcb_cardinal_t i, j;
- SymbolTypePtr symbol;
- LineTypePtr line;
- Coord totalminy = MAX_COORD;
-
- /* calculate cell with and height (is at least DEFAULT_CELLSIZE)
- * maximum cell width and height
- * minimum x and y position of all lines
- */
- Ptr->MaxWidth = DEFAULT_CELLSIZE;
- Ptr->MaxHeight = DEFAULT_CELLSIZE;
- for (i = 0, symbol = Ptr->Symbol; i <= MAX_FONTPOSITION; i++, symbol++) {
- Coord minx, miny, maxx, maxy;
-
- /* next one if the index isn't used or symbol is empty (SPACE) */
- if (!symbol->Valid || !symbol->LineN)
- continue;
-
- minx = miny = MAX_COORD;
- maxx = maxy = 0;
- for (line = symbol->Line, j = symbol->LineN; j; j--, line++) {
- minx = MIN(minx, line->Point1.X);
- miny = MIN(miny, line->Point1.Y);
- minx = MIN(minx, line->Point2.X);
- miny = MIN(miny, line->Point2.Y);
- maxx = MAX(maxx, line->Point1.X);
- maxy = MAX(maxy, line->Point1.Y);
- maxx = MAX(maxx, line->Point2.X);
- maxy = MAX(maxy, line->Point2.Y);
- }
-
- /* move symbol to left edge */
- for (line = symbol->Line, j = symbol->LineN; j; j--, line++)
- MOVE_LINE_LOWLEVEL(line, -minx, 0);
-
- /* set symbol bounding box with a minimum cell size of (1,1) */
- symbol->Width = maxx - minx + 1;
- symbol->Height = maxy + 1;
-
- /* check total min/max */
- Ptr->MaxWidth = MAX(Ptr->MaxWidth, symbol->Width);
- Ptr->MaxHeight = MAX(Ptr->MaxHeight, symbol->Height);
- totalminy = MIN(totalminy, miny);
- }
-
- /* move coordinate system to the upper edge (lowest y on screen) */
- for (i = 0, symbol = Ptr->Symbol; i <= MAX_FONTPOSITION; i++, symbol++)
- if (symbol->Valid) {
- symbol->Height -= totalminy;
- for (line = symbol->Line, j = symbol->LineN; j; j--, line++)
- MOVE_LINE_LOWLEVEL(line, 0, -totalminy);
- }
-
- /* setup the box for the default symbol */
- Ptr->DefaultSymbol.X1 = Ptr->DefaultSymbol.Y1 = 0;
- Ptr->DefaultSymbol.X2 = Ptr->DefaultSymbol.X1 + Ptr->MaxWidth;
- Ptr->DefaultSymbol.Y2 = Ptr->DefaultSymbol.Y1 + Ptr->MaxHeight;
-}
-
-Coord GetNum(char **s, const char *default_unit)
-{
- /* Read value */
- Coord ret_val = GetValueEx(*s, NULL, NULL, NULL, default_unit, NULL);
- /* Advance pointer */
- while (isalnum(**s) || **s == '.')
- (*s)++;
- return ret_val;
-}
-
-/* ---------------------------------------------------------------------------
- * quits application
- */
-extern void pcb_main_uninit(void);
-void QuitApplication(void)
-{
- /*
- * save data if necessary. It not needed, then don't trigger EmergencySave
- * via our atexit() registering of EmergencySave(). We presumably wanted to
- * exit here and thus it is not an emergency.
- */
- if (PCB->Changed && conf_core.editor.save_in_tmp)
- EmergencySave();
- else
- DisableEmergencySave();
-
- if (gui->do_exit == NULL) {
- pcb_main_uninit();
- exit(0);
- }
- else
- gui->do_exit(gui);
-}
-
-/* ---------------------------------------------------------------------------
- * creates a filename from a template
- * %f is replaced by the filename
- * %p by the searchpath
- */
-char *EvaluateFilename(const char *Template, const char *Path, const char *Filename, const char *Parameter)
-{
- gds_t command;
- const char *p;
-
- if (conf_core.rc.verbose) {
- printf("EvaluateFilename:\n");
- printf("\tTemplate: \033[33m%s\033[0m\n", Template);
- printf("\tPath: \033[33m%s\033[0m\n", Path);
- printf("\tFilename: \033[33m%s\033[0m\n", Filename);
- printf("\tParameter: \033[33m%s\033[0m\n", Parameter);
- }
-
- gds_init(&command);
-
- for (p = Template; p && *p; p++) {
- /* copy character or add string to command */
- if (*p == '%' && (*(p + 1) == 'f' || *(p + 1) == 'p' || *(p + 1) == 'a'))
- switch (*(++p)) {
- case 'a':
- gds_append_str(&command, Parameter);
- break;
- case 'f':
- gds_append_str(&command, Filename);
- break;
- case 'p':
- gds_append_str(&command, Path);
- break;
- }
- else
- gds_append(&command, *p);
- }
-
- if (conf_core.rc.verbose)
- printf("EvaluateFilename: \033[32m%s\033[0m\n", command.array);
-
- return command.array;
-}
-
-/* ---------------------------------------------------------------------------
- * returns a pointer to an objects bounding box;
- * data is valid until the routine is called again
- */
-BoxTypePtr GetObjectBoundingBox(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
-{
- switch (Type) {
- case PCB_TYPE_LINE:
- case PCB_TYPE_ARC:
- case PCB_TYPE_TEXT:
- case PCB_TYPE_POLYGON:
- case PCB_TYPE_PAD:
- case PCB_TYPE_PIN:
- case PCB_TYPE_ELEMENT_NAME:
- return (BoxType *) Ptr2;
- case PCB_TYPE_VIA:
- case PCB_TYPE_ELEMENT:
- return (BoxType *) Ptr1;
- case PCB_TYPE_POLYGON_POINT:
- case PCB_TYPE_LINE_POINT:
- return (BoxType *) Ptr3;
- default:
- Message(PCB_MSG_DEFAULT, "Request for bounding box of unsupported type %d\n", Type);
- return (BoxType *) Ptr2;
- }
-}
-
-/* ---------------------------------------------------------------------------
- * computes the bounding box of an arc
- */
-void SetArcBoundingBox(ArcTypePtr Arc)
-{
- double ca1, ca2, sa1, sa2;
- double minx, maxx, miny, maxy;
- Angle ang1, ang2;
- Coord width;
-
- /* first put angles into standard form:
- * ang1 < ang2, both angles between 0 and 720 */
- Arc->Delta = PCB_CLAMP(Arc->Delta, -360, 360);
-
- if (Arc->Delta > 0) {
- ang1 = NormalizeAngle(Arc->StartAngle);
- ang2 = NormalizeAngle(Arc->StartAngle + Arc->Delta);
- }
- else {
- ang1 = NormalizeAngle(Arc->StartAngle + Arc->Delta);
- ang2 = NormalizeAngle(Arc->StartAngle);
- }
- if (ang1 > ang2)
- ang2 += 360;
- /* Make sure full circles aren't treated as zero-length arcs */
- if (Arc->Delta == 360 || Arc->Delta == -360)
- ang2 = ang1 + 360;
-
- /* calculate sines, cosines */
- sa1 = sin(PCB_M180 * ang1);
- ca1 = cos(PCB_M180 * ang1);
- sa2 = sin(PCB_M180 * ang2);
- ca2 = cos(PCB_M180 * ang2);
-
- minx = MIN(ca1, ca2);
- maxx = MAX(ca1, ca2);
- miny = MIN(sa1, sa2);
- maxy = MAX(sa1, sa2);
-
- /* Check for extreme angles */
- if ((ang1 <= 0 && ang2 >= 0) || (ang1 <= 360 && ang2 >= 360))
- maxx = 1;
- if ((ang1 <= 90 && ang2 >= 90) || (ang1 <= 450 && ang2 >= 450))
- maxy = 1;
- if ((ang1 <= 180 && ang2 >= 180) || (ang1 <= 540 && ang2 >= 540))
- minx = -1;
- if ((ang1 <= 270 && ang2 >= 270) || (ang1 <= 630 && ang2 >= 630))
- miny = -1;
-
- /* Finally, calculate bounds, converting sane geometry into pcb geometry */
- Arc->BoundingBox.X1 = Arc->X - Arc->Width * maxx;
- Arc->BoundingBox.X2 = Arc->X - Arc->Width * minx;
- Arc->BoundingBox.Y1 = Arc->Y + Arc->Height * miny;
- Arc->BoundingBox.Y2 = Arc->Y + Arc->Height * maxy;
-
- width = (Arc->Thickness + Arc->Clearance) / 2;
-
- /* Adjust for our discrete polygon approximation */
- width = (double) width *MAX(POLY_CIRC_RADIUS_ADJ, (1.0 + POLY_ARC_MAX_DEVIATION)) + 0.5;
-
- Arc->BoundingBox.X1 -= width;
- Arc->BoundingBox.X2 += width;
- Arc->BoundingBox.Y1 -= width;
- Arc->BoundingBox.Y2 += width;
- close_box(&Arc->BoundingBox);
-}
-
-BoxTypePtr GetArcEnds(ArcTypePtr Arc)
-{
- static BoxType box;
- box.X1 = Arc->X - Arc->Width * cos(Arc->StartAngle * PCB_M180);
- box.Y1 = Arc->Y + Arc->Height * sin(Arc->StartAngle * PCB_M180);
- box.X2 = Arc->X - Arc->Width * cos((Arc->StartAngle + Arc->Delta) * PCB_M180);
- box.Y2 = Arc->Y + Arc->Height * sin((Arc->StartAngle + Arc->Delta) * PCB_M180);
- return &box;
-}
-
-/* doesn't these belong in change.c ?? */
-void ChangeArcAngles(LayerTypePtr Layer, ArcTypePtr a, Angle new_sa, Angle new_da)
-{
- if (new_da >= 360) {
- new_da = 360;
- new_sa = 0;
- }
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, a);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) a);
- AddObjectToChangeAnglesUndoList(PCB_TYPE_ARC, a, a, a);
- a->StartAngle = new_sa;
- a->Delta = new_da;
- SetArcBoundingBox(a);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) a, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, a);
-}
-
-
-void ChangeArcRadii(LayerTypePtr Layer, ArcTypePtr a, Coord new_width, Coord new_height)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, a);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) a);
- AddObjectToChangeRadiiUndoList(PCB_TYPE_ARC, a, a, a);
- a->Width = new_width;
- a->Height = new_height;
- SetArcBoundingBox(a);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) a, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, a);
-}
-
-static char *BumpName(char *Name)
-{
- int num;
- char c, *start;
- static char temp[256];
-
- start = Name;
- /* seek end of string */
- while (*Name != 0)
- Name++;
- /* back up to potential number */
- for (Name--; isdigit((int) *Name); Name--);
- Name++;
- if (*Name)
- num = atoi(Name) + 1;
- else
- num = 1;
- c = *Name;
- *Name = 0;
- sprintf(temp, "%s%d", start, num);
- /* if this is not our string, put back the blown character */
- if (start != temp)
- *Name = c;
- return (temp);
-}
-
-/*
- * make a unique name for the name on board
- * this can alter the contents of the input string
- */
-char *UniqueElementName(DataTypePtr Data, char *Name)
-{
- pcb_bool unique = pcb_true;
- /* null strings are ok */
- if (!Name || !*Name)
- return (Name);
-
- for (;;) {
- ELEMENT_LOOP(Data);
- {
- if (NAMEONPCB_NAME(element) && NSTRCMP(NAMEONPCB_NAME(element), Name) == 0) {
- Name = BumpName(Name);
- unique = pcb_false;
- break;
- }
- }
- END_LOOP;
- if (unique)
- return (Name);
- unique = pcb_true;
- }
-}
-
-static void GetGridLockCoordinates(int type, void *ptr1, void *ptr2, void *ptr3, Coord * x, Coord * y)
-{
- switch (type) {
- case PCB_TYPE_VIA:
- *x = ((PinTypePtr) ptr2)->X;
- *y = ((PinTypePtr) ptr2)->Y;
- break;
- case PCB_TYPE_LINE:
- *x = ((LineTypePtr) ptr2)->Point1.X;
- *y = ((LineTypePtr) ptr2)->Point1.Y;
- break;
- case PCB_TYPE_TEXT:
- case PCB_TYPE_ELEMENT_NAME:
- *x = ((TextTypePtr) ptr2)->X;
- *y = ((TextTypePtr) ptr2)->Y;
- break;
- case PCB_TYPE_ELEMENT:
- *x = ((ElementTypePtr) ptr2)->MarkX;
- *y = ((ElementTypePtr) ptr2)->MarkY;
- break;
- case PCB_TYPE_POLYGON:
- *x = ((PolygonTypePtr) ptr2)->Points[0].X;
- *y = ((PolygonTypePtr) ptr2)->Points[0].Y;
- break;
-
- case PCB_TYPE_LINE_POINT:
- case PCB_TYPE_POLYGON_POINT:
- *x = ((PointTypePtr) ptr3)->X;
- *y = ((PointTypePtr) ptr3)->Y;
- break;
- case PCB_TYPE_ARC:
- {
- BoxTypePtr box;
-
- box = GetArcEnds((ArcTypePtr) ptr2);
- *x = box->X1;
- *y = box->Y1;
- break;
- }
- }
-}
-
-void AttachForCopy(Coord PlaceX, Coord PlaceY)
-{
- BoxTypePtr box;
- Coord mx = 0, my = 0;
-
- Crosshair.AttachedObject.RubberbandN = 0;
- if (!conf_core.editor.snap_pin) {
- /* dither the grab point so that the mark, center, etc
- * will end up on a grid coordinate
- */
- GetGridLockCoordinates(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1,
- Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3, &mx, &my);
- mx = GridFit(mx, PCB->Grid, PCB->GridOffsetX) - mx;
- my = GridFit(my, PCB->Grid, PCB->GridOffsetY) - my;
- }
- Crosshair.AttachedObject.X = PlaceX - mx;
- Crosshair.AttachedObject.Y = PlaceY - my;
- if (!Marked.status || conf_core.editor.local_ref)
- SetLocalRef(PlaceX - mx, PlaceY - my, pcb_true);
- Crosshair.AttachedObject.State = STATE_SECOND;
-
- /* get boundingbox of object and set cursor range */
- box = GetObjectBoundingBox(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3);
- SetCrosshairRange(Crosshair.AttachedObject.X - box->X1,
- Crosshair.AttachedObject.Y - box->Y1,
- PCB->MaxWidth - (box->X2 - Crosshair.AttachedObject.X),
- PCB->MaxHeight - (box->Y2 - Crosshair.AttachedObject.Y));
-
- /* get all attached objects if necessary */
- if ((conf_core.editor.mode != PCB_MODE_COPY) && conf_core.editor.rubber_band_mode)
- LookupRubberbandLines(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3);
- if (conf_core.editor.mode != PCB_MODE_COPY &&
- (Crosshair.AttachedObject.Type == PCB_TYPE_ELEMENT ||
- Crosshair.AttachedObject.Type == PCB_TYPE_VIA ||
- Crosshair.AttachedObject.Type == PCB_TYPE_LINE || Crosshair.AttachedObject.Type == PCB_TYPE_LINE_POINT))
- LookupRatLines(Crosshair.AttachedObject.Type,
- Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3);
-}
-
-/* This just fills in a FlagType with current flags. */
-FlagType MakeFlags(unsigned int flags)
-{
- FlagType rv;
- memset(&rv, 0, sizeof(rv));
- rv.f = flags;
- return rv;
-}
-
-/* This converts old flag bits (from saved PCB files) to new format. */
-FlagType OldFlags(unsigned int flags)
-{
- FlagType rv;
- int i, f;
- memset(&rv, 0, sizeof(rv));
- /* If we move flag bits around, this is where we map old bits to them. */
- rv.f = flags & 0xffff;
- f = 0x10000;
- for (i = 0; i < 8; i++) {
- /* use the closest thing to the old thermal style */
- if (flags & f)
- rv.t[i / 2] |= (1 << (4 * (i % 2)));
- f <<= 1;
- }
- return rv;
-}
-
-FlagType AddFlags(FlagType flag, unsigned int flags)
-{
- flag.f |= flags;
- return flag;
-}
-
-FlagType MaskFlags(FlagType flag, unsigned int flags)
-{
- flag.f &= ~flags;
- return flag;
-}
-
-char *AttributeGetFromList(AttributeListType * list, const char *name)
-{
- int i;
- for (i = 0; i < list->Number; i++)
- if (strcmp(name, list->List[i].name) == 0)
- return list->List[i].value;
- return NULL;
-}
-
-int AttributePutToList(AttributeListType * list, const char *name, const char *value, int replace)
-{
- int i;
-
- /* If we're allowed to replace an existing attribute, see if we
- can. */
- if (replace) {
- for (i = 0; i < list->Number; i++)
- if (strcmp(name, list->List[i].name) == 0) {
- free(list->List[i].value);
- list->List[i].value = pcb_strdup_null(value);
- return 1;
- }
- }
-
- /* At this point, we're going to need to add a new attribute to the
- list. See if there's room. */
- if (list->Number >= list->Max) {
- list->Max += 10;
- list->List = (AttributeType *) realloc(list->List, list->Max * sizeof(AttributeType));
- }
-
- /* Now add the new attribute. */
- i = list->Number;
- list->List[i].name = pcb_strdup_null(name);
- list->List[i].value = pcb_strdup_null(value);
- list->Number++;
- return 0;
-}
-
-int AttributeRemoveFromList(AttributeListType * list, const char *name)
-{
- int i, j, found = 0;
- for (i = 0; i < list->Number; i++)
- if (strcmp(name, list->List[i].name) == 0) {
- free(list->List[i].name);
- free(list->List[i].value);
- found++;
- for (j = i; j < list->Number - i; j++)
- list->List[j] = list->List[j + 1];
- list->Number--;
- }
- return found;
-}
-
-void r_delete_element(DataType * data, ElementType * element)
-{
- r_delete_entry(data->element_tree, (BoxType *) element);
- PIN_LOOP(element);
- {
- r_delete_entry(data->pin_tree, (BoxType *) pin);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- r_delete_entry(data->pad_tree, (BoxType *) pad);
- }
- END_LOOP;
- ELEMENTTEXT_LOOP(element);
- {
- r_delete_entry(data->name_tree[n], (BoxType *) text);
- }
- END_LOOP;
-}
-
-
-/* ---------------------------------------------------------------------------
- * Returns a string that has a bunch of information about the program.
- * Can be used for things like "about" dialog boxes.
- */
-
-char *GetInfoString(void)
-{
- HID **hids;
- int i;
- static gds_t info;
- static int first_time = 1;
-
-#define TAB " "
-
- if (first_time) {
- first_time = 0;
- gds_append_str(&info, "This is PCB-rnd " VERSION " (" REVISION ")" "\n an interactive\n");
- gds_append_str(&info, "printed circuit board editor\n");
- gds_append_str(&info, "PCB-rnd forked from PCB version.");
- gds_append_str(&info, "\n\n" "PCB is by harry eaton and others\n\n");
- gds_append_str(&info, "\nPCB-rnd adds a collection of\n");
- gds_append_str(&info, "useful-looking random patches.\n");
- gds_append_str(&info, "\n");
- gds_append_str(&info, "Copyright (C) Thomas Nau 1994, 1995, 1996, 1997\n");
- gds_append_str(&info, "Copyright (C) harry eaton 1998-2007\n");
- gds_append_str(&info, "Copyright (C) C. Scott Ananian 2001\n");
- gds_append_str(&info, "Copyright (C) DJ Delorie 2003, 2004, 2005, 2006, 2007, 2008\n");
- gds_append_str(&info, "Copyright (C) Dan McMahill 2003, 2004, 2005, 2006, 2007, 2008\n\n");
- gds_append_str(&info, "Copyright (C) Tibor Palinkas 2013-2016 (pcb-rnd patches)\n\n");
- gds_append_str(&info, "It is licensed under the terms of the GNU\n");
- gds_append_str(&info, "General Public License version 2\n");
- gds_append_str(&info, "See the LICENSE file for more information\n\n");
- gds_append_str(&info, "For more information see:\n\n");
- gds_append_str(&info, "PCB-rnd homepage: http://repo.hu/projects/pcb-rnd\n");
- gds_append_str(&info, "PCB homepage: http://pcb.geda-project.org\n");
- gds_append_str(&info, "gEDA homepage: http://www.geda-project.org\n");
- gds_append_str(&info, "gEDA Wiki: http://wiki.geda-project.org\n\n");
-
- gds_append_str(&info, "----- Compile Time Options -----\n");
- hids = hid_enumerate();
- gds_append_str(&info, "GUI:\n");
- for (i = 0; hids[i]; i++) {
- if (hids[i]->gui) {
- gds_append_str(&info, TAB);
- gds_append_str(&info, hids[i]->name);
- gds_append_str(&info, " : ");
- gds_append_str(&info, hids[i]->description);
- gds_append_str(&info, "\n");
- }
- }
-
- gds_append_str(&info, "Exporters:\n");
- for (i = 0; hids[i]; i++) {
- if (hids[i]->exporter) {
- gds_append_str(&info, TAB);
- gds_append_str(&info, hids[i]->name);
- gds_append_str(&info, " : ");
- gds_append_str(&info, hids[i]->description);
- gds_append_str(&info, "\n");
- }
- }
-
- gds_append_str(&info, "Printers:\n");
- for (i = 0; hids[i]; i++) {
- if (hids[i]->printer) {
- gds_append_str(&info, TAB);
- gds_append_str(&info, hids[i]->name);
- gds_append_str(&info, " : ");
- gds_append_str(&info, hids[i]->description);
- gds_append_str(&info, "\n");
- }
- }
- }
-#undef TAB
-
- return info.array;
-}
-
-const char *pcb_author(void)
-{
- if (conf_core.design.fab_author && conf_core.design.fab_author[0])
- return conf_core.design.fab_author;
- else
- return get_user_name();
-}
-
-
-/* ---------------------------------------------------------------------------
- * Returns a best guess about the orientation of an element. The
- * value corresponds to the rotation; a difference is the right value
- * to pass to RotateElementLowLevel. However, the actual value is no
- * indication of absolute rotation; only relative rotation is
- * meaningful.
- */
-
-int ElementOrientation(ElementType * e)
-{
- Coord pin1x, pin1y, pin2x, pin2y, dx, dy;
- pcb_bool found_pin1 = 0;
- pcb_bool found_pin2 = 0;
-
- /* in case we don't find pin 1 or 2, make sure we have initialized these variables */
- pin1x = 0;
- pin1y = 0;
- pin2x = 0;
- pin2y = 0;
-
- PIN_LOOP(e);
- {
- if (NSTRCMP(pin->Number, "1") == 0) {
- pin1x = pin->X;
- pin1y = pin->Y;
- found_pin1 = 1;
- }
- else if (NSTRCMP(pin->Number, "2") == 0) {
- pin2x = pin->X;
- pin2y = pin->Y;
- found_pin2 = 1;
- }
- }
- END_LOOP;
-
- PAD_LOOP(e);
- {
- if (NSTRCMP(pad->Number, "1") == 0) {
- pin1x = (pad->Point1.X + pad->Point2.X) / 2;
- pin1y = (pad->Point1.Y + pad->Point2.Y) / 2;
- found_pin1 = 1;
- }
- else if (NSTRCMP(pad->Number, "2") == 0) {
- pin2x = (pad->Point1.X + pad->Point2.X) / 2;
- pin2y = (pad->Point1.Y + pad->Point2.Y) / 2;
- found_pin2 = 1;
- }
- }
- END_LOOP;
-
- if (found_pin1 && found_pin2) {
- dx = pin2x - pin1x;
- dy = pin2y - pin1y;
- }
- else if (found_pin1 && (pin1x || pin1y)) {
- dx = pin1x;
- dy = pin1y;
- }
- else if (found_pin2 && (pin2x || pin2y)) {
- dx = pin2x;
- dy = pin2y;
- }
- else
- return 0;
-
- if (coord_abs(dx) > coord_abs(dy))
- return dx > 0 ? 0 : 2;
- return dy > 0 ? 3 : 1;
-}
-
-int ActionListRotations(int argc, const char **argv, Coord x, Coord y)
-{
- ELEMENT_LOOP(PCB->Data);
- {
- printf("%d %s\n", ElementOrientation(element), NAMEONPCB_NAME(element));
- }
- END_LOOP;
-
- return 0;
-}
-
-HID_Action misc_action_list[] = {
- {"ListRotations", 0, ActionListRotations,
- 0, 0}
- ,
-};
-
-REGISTER_ACTIONS(misc_action_list, NULL)
diff --git a/src/misc.h b/src/misc.h
deleted file mode 100644
index 0cb37e5..0000000
--- a/src/misc.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for misc routines - PCB data type dependent ones */
-
-#ifndef PCB_MISC_H
-#define PCB_MISC_H
-
-#include <stdlib.h>
-#include "global.h"
-#include <genvector/gds_char.h>
-#include "mymem.h"
-
-const char *pcb_author(void);
-
-Angle NormalizeAngle(Angle a);
-
-void r_delete_element(DataTypePtr, ElementTypePtr);
-void SetLineBoundingBox(LineTypePtr);
-void SetArcBoundingBox(ArcTypePtr);
-void SetPointBoundingBox(PointTypePtr);
-void SetPinBoundingBox(PinTypePtr);
-void SetPadBoundingBox(PadTypePtr);
-void SetPolygonBoundingBox(PolygonTypePtr);
-void SetElementBoundingBox(DataTypePtr, ElementTypePtr, FontTypePtr);
-pcb_bool IsDataEmpty(DataTypePtr);
-pcb_bool IsPasteEmpty(int);
-void CountHoles(int *, int *, const BoxType *);
-BoxTypePtr GetDataBoundingBox(DataTypePtr);
-void CenterDisplay(Coord, Coord);
-void SetFontInfo(FontTypePtr);
-Coord GetNum(char **s, const char *default_unit);
-
-void QuitApplication(void);
-char *EvaluateFilename(const char *, const char *, const char *, const char *);
-void SetTextBoundingBox(FontTypePtr, TextTypePtr);
-
-void SaveOutputWindow(void);
-
-BoxTypePtr GetObjectBoundingBox(int, void *, void *, void *);
-void ResetStackAndVisibility(void);
-void SaveStackAndVisibility(void);
-void RestoreStackAndVisibility(void);
-BoxTypePtr GetArcEnds(ArcTypePtr);
-void ChangeArcAngles(LayerTypePtr, ArcTypePtr, Angle, Angle);
-void ChangeArcRadii(LayerTypePtr, ArcTypePtr, Coord, Coord);
-char *UniqueElementName(DataTypePtr, char *);
-void AttachForCopy(Coord, Coord);
-
-/* Returns NULL if the name isn't found, else the value for that named
- attribute. */
-char *AttributeGetFromList(AttributeListType * list, const char *name);
-/* Adds an attribute to the list. If the attribute already exists,
- whether it's replaced or a second copy added depends on
- REPLACE. Returns non-zero if an existing attribute was replaced. */
-int AttributePutToList(AttributeListType * list, const char *name, const char *value, int replace);
-/* Simplistic version: Takes a pointer to an object, looks up attributes in it. */
-#define AttributeGet(OBJ,name) AttributeGetFromList (&(OBJ->Attributes), name)
-/* Simplistic version: Takes a pointer to an object, sets attributes in it. */
-#define AttributePut(OBJ,name,value) AttributePutToList (&(OBJ->Attributes), name, value, 1)
-/* Remove an attribute by name; returns number of items removed */
-int AttributeRemoveFromList(AttributeListType * list, const char *name);
-/* Simplistic version of Remove. */
-#define AttributeRemove(OBJ, name) AttributeRemoveFromList (&(OBJ->Attributes), name)
-
-/* For passing modified flags to other functions. */
-FlagType MakeFlags(unsigned int);
-FlagType OldFlags(unsigned int);
-FlagType AddFlags(FlagType, unsigned int);
-FlagType MaskFlags(FlagType, unsigned int);
-#define NoFlags() MakeFlags(0)
-
-/* Returns a string with info about this copy of pcb. */
-char *GetInfoString(void);
-
-/* Return a relative rotation for an element, useful only for
- comparing two similar footprints. */
-int ElementOrientation(ElementType * e);
-
-#endif /* PCB_MISC_H */
diff --git a/src/misc_util.c b/src/misc_util.c
index 593096a..2a14488 100644
--- a/src/misc_util.c
+++ b/src/misc_util.c
@@ -32,25 +32,26 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include <genvector/gds_char.h>
#include <math.h>
#include <ctype.h>
#include "misc_util.h"
#include "unit.h"
-/* Distance() should be used so that there is only one
+/* pcb_distance() should be used so that there is only one
* place to deal with overflow/precision errors
*/
-double Distance(double x1, double y1, double x2, double y2)
+double pcb_distance(double x1, double y1, double x2, double y2)
{
double delta_x = (x2 - x1);
double delta_y = (y2 - y1);
return sqrt(delta_x * delta_x + delta_y * delta_y);
}
-/* Distance2() should be used so that there is only one
+/* pcb_distance2() should be used so that there is only one
* place to deal with overflow/precision errors
*/
-double Distance2(double x1, double y1, double x2, double y2)
+double pcb_distance2(double x1, double y1, double x2, double y2)
{
double delta_x = (x2 - x1);
double delta_y = (y2 - y1);
@@ -60,12 +61,12 @@ double Distance2(double x1, double y1, double x2, double y2)
/* Get Value returns a numeric value passed from the string and sets the
* pcb_bool variable absolute to false if it leads with a +/- character
*/
-double GetValue(const char *val, const char *units, pcb_bool * absolute, pcb_bool *success)
+double pcb_get_value(const char *val, const char *units, pcb_bool * absolute, pcb_bool *success)
{
- return GetValueEx(val, units, absolute, NULL, "cmil", success);
+ return pcb_get_value_ex(val, units, absolute, NULL, "cmil", success);
}
-double GetValueEx(const char *val, const char *units, pcb_bool * absolute, UnitList extra_units, const char *default_unit, pcb_bool *success)
+double pcb_get_value_ex(const char *val, const char *units, pcb_bool * absolute, pcb_unit_list_t extra_units, const char *default_unit, pcb_bool *success)
{
double value;
int n = -1;
@@ -102,9 +103,9 @@ double GetValueEx(const char *val, const char *units, pcb_bool * absolute, UnitL
if (units && *units) {
int i, unit_ok = 0;
- const Unit *unit = get_unit_struct(units);
+ const pcb_unit_t *unit = get_unit_struct(units);
if (unit != NULL) {
- value = unit_to_coord(unit, value);
+ value = pcb_unit_to_coord(unit, value);
scaled = 1;
unit_ok = 1;
}
@@ -126,7 +127,7 @@ double GetValueEx(const char *val, const char *units, pcb_bool * absolute, UnitL
/* Apply default unit */
if (!scaled && default_unit && *default_unit) {
int i;
- const Unit *unit = get_unit_struct(default_unit);
+ const pcb_unit_t *unit = get_unit_struct(default_unit);
if (extra_units)
for (i = 0; *extra_units[i].suffix; ++i)
if (strcmp(extra_units[i].suffix, default_unit) == 0) {
@@ -136,7 +137,7 @@ double GetValueEx(const char *val, const char *units, pcb_bool * absolute, UnitL
scaled = 1;
}
if (!scaled && unit != NULL)
- value = unit_to_coord(unit, value);
+ value = pcb_unit_to_coord(unit, value);
}
if (success != NULL)
@@ -149,33 +150,58 @@ double GetValueEx(const char *val, const char *units, pcb_bool * absolute, UnitL
return 0;
}
-char *Concat(const char *first, ...)
+char *pcb_concat(const char *first, ...)
{
- char *rv;
- int len;
+ gds_t buf;
va_list a;
+ const char *s;
- len = strlen(first);
- rv = (char *) malloc(len + 1);
- strcpy(rv, first);
-
+ gds_init(&buf);
va_start(a, first);
- while (1) {
- const char *s = va_arg(a, const char *);
- if (!s)
- break;
- len += strlen(s);
- rv = (char *) realloc(rv, len + 1);
- strcat(rv, s);
- }
+ for(s = first; s != NULL; s = va_arg(a, const char *))
+ gds_append_str(&buf, s);
va_end(a);
- return rv;
+ return buf.array;
}
-int mem_any_set(unsigned char *ptr, int bytes)
+pcb_coord_t pcb_get_num(char **s, const char *default_unit)
{
- while (bytes--)
- if (*ptr++)
- return 1;
- return 0;
+ /* Read value */
+ pcb_coord_t ret_val = pcb_get_value_ex(*s, NULL, NULL, NULL, default_unit, NULL);
+ /* Advance pointer */
+ while (isalnum(**s) || **s == '.')
+ (*s)++;
+ return ret_val;
+}
+
+/* ---------------------------------------------------------------------------
+ * strips leading and trailing blanks from the passed string and
+ * returns a pointer to the new 'duped' one or NULL if the old one
+ * holds only white space characters
+ */
+char *pcb_strdup_strip_wspace(const char *S)
+{
+ const char *p1, *p2;
+ char *copy;
+ size_t length;
+
+ if (!S || !*S)
+ return (NULL);
+
+ /* strip leading blanks */
+ for (p1 = S; *p1 && isspace((int) *p1); p1++);
+
+ /* strip trailing blanks and get string length */
+ length = strlen(p1);
+ for (p2 = p1 + length - 1; length && isspace((int) *p2); p2--, length--);
+
+ /* string is not empty -> allocate memory */
+ if (length) {
+ copy = (char *) realloc(NULL, length + 1);
+ strncpy(copy, p1, length);
+ copy[length] = '\0';
+ return (copy);
+ }
+ else
+ return (NULL);
}
diff --git a/src/misc_util.h b/src/misc_util.h
index 46ce46f..08ac09f 100644
--- a/src/misc_util.h
+++ b/src/misc_util.h
@@ -29,23 +29,28 @@
#ifndef PCB_MISC_UTIL_H
#define PCB_MISC_UTIL_H
+#include "unit.h"
#include "pcb_bool.h"
-double Distance(double x1, double y1, double x2, double y2);
-double Distance2(double x1, double y1, double x2, double y2); /* distance square */
+double pcb_distance(double x1, double y1, double x2, double y2);
+double pcb_distance2(double x1, double y1, double x2, double y2); /* distance square */
-enum unitflags { UNIT_PERCENT = 1 };
+enum pcb_unit_flags_e { UNIT_PERCENT = 1 };
typedef struct {
const char *suffix;
double scale;
- enum unitflags flags;
-} UnitList[];
+ enum pcb_unit_flags_e flags;
+} pcb_unit_list_t[];
-double GetValue(const char *, const char *, pcb_bool *, pcb_bool *success);
-double GetValueEx(const char *, const char *, pcb_bool *, UnitList, const char *, pcb_bool *success);
+double pcb_get_value(const char *, const char *, pcb_bool *, pcb_bool *success);
+double pcb_get_value_ex(const char *, const char *, pcb_bool *, pcb_unit_list_t, const char *, pcb_bool *success);
+pcb_coord_t pcb_get_num(char **s, const char *default_unit);
-char *Concat(const char *, ...); /* end with NULL */
-int mem_any_set(unsigned char *ptr, int bytes);
+
+char *pcb_concat(const char *, ...); /* end with NULL */
+int pcb_mem_any_set(unsigned char *ptr, int bytes);
+
+char *pcb_strdup_strip_wspace(const char *S);
#endif
diff --git a/src/move.c b/src/move.c
index ebdd440..3b59c21 100644
--- a/src/move.c
+++ b/src/move.c
@@ -31,49 +31,24 @@
#include "config.h"
#include "conf_core.h"
-#include <setjmp.h>
#include <stdlib.h>
-#include "create.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
#include "error.h"
-#include "misc.h"
#include "move.h"
-#include "polygon.h"
-#include "rtree.h"
-#include "search.h"
#include "select.h"
#include "undo.h"
+#include "event.h"
#include "hid_actions.h"
#include "compat_misc.h"
-#include "layer.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *MoveElementName(ElementTypePtr);
-static void *MoveElement(ElementTypePtr);
-static void *MoveVia(PinTypePtr);
-static void *MoveLine(LayerTypePtr, LineTypePtr);
-static void *MoveArc(LayerTypePtr, ArcTypePtr);
-static void *MoveText(LayerTypePtr, TextTypePtr);
-static void *MovePolygon(LayerTypePtr, PolygonTypePtr);
-static void *MoveLinePoint(LayerTypePtr, LineTypePtr, PointTypePtr);
-static void *MovePolygonPoint(LayerTypePtr, PolygonTypePtr, PointTypePtr);
-static void *MoveLineToLayer(LayerTypePtr, LineTypePtr);
-static void *MoveArcToLayer(LayerTypePtr, ArcTypePtr);
-static void *MoveRatToLayer(RatTypePtr);
-static void *MoveTextToLayer(LayerTypePtr, TextTypePtr);
-static void *MovePolygonToLayer(LayerTypePtr, PolygonTypePtr);
+#include "obj_all_op.h"
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord DeltaX, DeltaY; /* used by local routines as offset */
-static LayerTypePtr Dest;
-static pcb_bool MoreToCome;
-static ObjectFunctionType MoveFunctions = {
+static pcb_opfunc_t MoveFunctions = {
MoveLine,
MoveText,
MovePolygon,
@@ -85,603 +60,40 @@ static ObjectFunctionType MoveFunctions = {
MoveLinePoint,
MovePolygonPoint,
MoveArc,
+ NULL,
NULL
-}, MoveToLayerFunctions = {
-MoveLineToLayer, MoveTextToLayer, MovePolygonToLayer, NULL, NULL, NULL, NULL, NULL, NULL, NULL, MoveArcToLayer, MoveRatToLayer};
-
-/* ---------------------------------------------------------------------------
- * moves a element by +-X and +-Y
- */
-void MoveElementLowLevel(DataTypePtr Data, ElementTypePtr Element, Coord DX, Coord DY)
-{
- if (Data)
- r_delete_entry(Data->element_tree, (BoxType *) Element);
- ELEMENTLINE_LOOP(Element);
- {
- MOVE_LINE_LOWLEVEL(line, DX, DY);
- }
- END_LOOP;
- PIN_LOOP(Element);
- {
- if (Data) {
- r_delete_entry(Data->pin_tree, (BoxType *) pin);
- RestoreToPolygon(Data, PCB_TYPE_PIN, Element, pin);
- }
- MOVE_PIN_LOWLEVEL(pin, DX, DY);
- if (Data) {
- r_insert_entry(Data->pin_tree, (BoxType *) pin, 0);
- ClearFromPolygon(Data, PCB_TYPE_PIN, Element, pin);
- }
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- if (Data) {
- r_delete_entry(Data->pad_tree, (BoxType *) pad);
- RestoreToPolygon(Data, PCB_TYPE_PAD, Element, pad);
- }
- MOVE_PAD_LOWLEVEL(pad, DX, DY);
- if (Data) {
- r_insert_entry(Data->pad_tree, (BoxType *) pad, 0);
- ClearFromPolygon(Data, PCB_TYPE_PAD, Element, pad);
- }
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- MOVE_ARC_LOWLEVEL(arc, DX, DY);
- }
- END_LOOP;
- ELEMENTTEXT_LOOP(Element);
- {
- if (Data && Data->name_tree[n])
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- MOVE_TEXT_LOWLEVEL(text, DX, DY);
- if (Data && Data->name_tree[n])
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- MOVE_BOX_LOWLEVEL(&Element->BoundingBox, DX, DY);
- MOVE_BOX_LOWLEVEL(&Element->VBox, DX, DY);
- MOVE(Element->MarkX, Element->MarkY, DX, DY);
- if (Data)
- r_insert_entry(Data->element_tree, (BoxType *) Element, 0);
-}
-
-/* ----------------------------------------------------------------------
- * moves all names of an element to a new position
- */
-static void *MoveElementName(ElementTypePtr Element)
-{
- if (PCB->ElementOn && (FRONT(Element) || PCB->InvisibleObjectsOn)) {
- EraseElementName(Element);
- ELEMENTTEXT_LOOP(Element);
- {
- if (PCB->Data->name_tree[n])
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- MOVE_TEXT_LOWLEVEL(text, DeltaX, DeltaY);
- if (PCB->Data->name_tree[n])
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- DrawElementName(Element);
- Draw();
- }
- else {
- ELEMENTTEXT_LOOP(Element);
- {
- if (PCB->Data->name_tree[n])
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- MOVE_TEXT_LOWLEVEL(text, DeltaX, DeltaY);
- if (PCB->Data->name_tree[n])
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- }
- return (Element);
-}
-
-/* ---------------------------------------------------------------------------
- * moves an element
- */
-static void *MoveElement(ElementTypePtr Element)
-{
- pcb_bool didDraw = pcb_false;
-
- if (PCB->ElementOn && (FRONT(Element) || PCB->InvisibleObjectsOn)) {
- EraseElement(Element);
- MoveElementLowLevel(PCB->Data, Element, DeltaX, DeltaY);
- DrawElementName(Element);
- DrawElementPackage(Element);
- didDraw = pcb_true;
- }
- else {
- if (PCB->PinOn)
- EraseElementPinsAndPads(Element);
- MoveElementLowLevel(PCB->Data, Element, DeltaX, DeltaY);
- }
- if (PCB->PinOn) {
- DrawElementPinsAndPads(Element);
- didDraw = pcb_true;
- }
- if (didDraw)
- Draw();
- return (Element);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a via
- */
-static void *MoveVia(PinTypePtr Via)
-{
- r_delete_entry(PCB->Data->via_tree, (BoxType *) Via);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- MOVE_VIA_LOWLEVEL(Via, DeltaX, DeltaY);
- if (PCB->ViaOn)
- EraseVia(Via);
- r_insert_entry(PCB->Data->via_tree, (BoxType *) Via, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- if (PCB->ViaOn) {
- DrawVia(Via);
- Draw();
- }
- return (Via);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line
- */
-static void *MoveLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- if (Layer->On)
- EraseLine(Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- r_delete_entry(Layer->line_tree, (BoxType *) Line);
- MOVE_LINE_LOWLEVEL(Line, DeltaX, DeltaY);
- r_insert_entry(Layer->line_tree, (BoxType *) Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- if (Layer->On) {
- DrawLine(Layer, Line);
- Draw();
- }
- return (Line);
-}
-
-/* ---------------------------------------------------------------------------
- * moves an arc
- */
-static void *MoveArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- r_delete_entry(Layer->arc_tree, (BoxType *) Arc);
- if (Layer->On) {
- EraseArc(Arc);
- MOVE_ARC_LOWLEVEL(Arc, DeltaX, DeltaY);
- DrawArc(Layer, Arc);
- Draw();
- }
- else {
- MOVE_ARC_LOWLEVEL(Arc, DeltaX, DeltaY);
- }
- r_insert_entry(Layer->arc_tree, (BoxType *) Arc, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- return (Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text object
- */
-static void *MoveText(LayerTypePtr Layer, TextTypePtr Text)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- r_delete_entry(Layer->text_tree, (BoxType *) Text);
- if (Layer->On) {
- EraseText(Layer, Text);
- MOVE_TEXT_LOWLEVEL(Text, DeltaX, DeltaY);
- DrawText(Layer, Text);
- Draw();
- }
- else
- MOVE_TEXT_LOWLEVEL(Text, DeltaX, DeltaY);
- r_insert_entry(Layer->text_tree, (BoxType *) Text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- return (Text);
-}
-
-/* ---------------------------------------------------------------------------
- * low level routine to move a polygon
- */
-void MovePolygonLowLevel(PolygonTypePtr Polygon, Coord DeltaX, Coord DeltaY)
-{
- POLYGONPOINT_LOOP(Polygon);
- {
- MOVE(point->X, point->Y, DeltaX, DeltaY);
- }
- END_LOOP;
- MOVE_BOX_LOWLEVEL(&Polygon->BoundingBox, DeltaX, DeltaY);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon
- */
-static void *MovePolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- if (Layer->On) {
- ErasePolygon(Polygon);
- }
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
- MovePolygonLowLevel(Polygon, DeltaX, DeltaY);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- InitClip(PCB->Data, Layer, Polygon);
- if (Layer->On) {
- DrawPolygon(Layer, Polygon);
- Draw();
- }
- return (Polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * moves one end of a line
- */
-static void *MoveLinePoint(LayerTypePtr Layer, LineTypePtr Line, PointTypePtr Point)
-{
- if (Layer) {
- if (Layer->On)
- EraseLine(Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- r_delete_entry(Layer->line_tree, &Line->BoundingBox);
- MOVE(Point->X, Point->Y, DeltaX, DeltaY);
- SetLineBoundingBox(Line);
- r_insert_entry(Layer->line_tree, &Line->BoundingBox, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- if (Layer->On) {
- DrawLine(Layer, Line);
- Draw();
- }
- return (Line);
- }
- else { /* must be a rat */
-
- if (PCB->RatOn)
- EraseRat((RatTypePtr) Line);
- r_delete_entry(PCB->Data->rat_tree, &Line->BoundingBox);
- MOVE(Point->X, Point->Y, DeltaX, DeltaY);
- SetLineBoundingBox(Line);
- r_insert_entry(PCB->Data->rat_tree, &Line->BoundingBox, 0);
- if (PCB->RatOn) {
- DrawRat((RatTypePtr) Line);
- Draw();
- }
- return (Line);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon-point
- */
-static void *MovePolygonPoint(LayerTypePtr Layer, PolygonTypePtr Polygon, PointTypePtr Point)
-{
- if (Layer->On) {
- ErasePolygon(Polygon);
- }
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
- MOVE(Point->X, Point->Y, DeltaX, DeltaY);
- SetPolygonBoundingBox(Polygon);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- RemoveExcessPolygonPoints(Layer, Polygon);
- InitClip(PCB->Data, Layer, Polygon);
- if (Layer->On) {
- DrawPolygon(Layer, Polygon);
- Draw();
- }
- return (Point);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line between layers; lowlevel routines
- */
-static void *MoveLineToLayerLowLevel(LayerType * Source, LineType * line, LayerType * Destination)
-{
- r_delete_entry(Source->line_tree, (BoxType *) line);
-
- linelist_remove(line);
- linelist_append(&(Destination->Line), line);
-
- if (!Destination->line_tree)
- Destination->line_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->line_tree, (BoxType *) line, 0);
- return line;
-}
-
-/* ---------------------------------------------------------------------------
- * moves an arc between layers; lowlevel routines
- */
-static void *MoveArcToLayerLowLevel(LayerType * Source, ArcType * arc, LayerType * Destination)
-{
- r_delete_entry(Source->arc_tree, (BoxType *) arc);
-
- arclist_remove(arc);
- arclist_append(&Destination->Arc, arc);
-
- if (!Destination->arc_tree)
- Destination->arc_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->arc_tree, (BoxType *) arc, 0);
- return arc;
-}
-
-
-/* ---------------------------------------------------------------------------
- * moves an arc between layers
- */
-static void *MoveArcToLayer(LayerType * Layer, ArcType * Arc)
-{
- ArcTypePtr newone;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (Dest == Layer && Layer->On) {
- DrawArc(Layer, Arc);
- Draw();
- }
- if (((long int) Dest == -1) || Dest == Layer)
- return (Arc);
- AddObjectToMoveToLayerUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- if (Layer->On)
- EraseArc(Arc);
- newone = (ArcTypePtr) MoveArcToLayerLowLevel(Layer, Arc, Dest);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Dest, Arc);
- if (Dest->On)
- DrawArc(Dest, newone);
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line between layers
- */
-static void *MoveRatToLayer(RatType * Rat)
-{
- LineTypePtr newone;
- /*Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y;
- Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y;
- if PCB_FLAG_VIA
- if we're on a pin, add a thermal
- else make a via and a wire, but 0-length wire not good
- else as before */
-
- newone = CreateNewLineOnLayer(Dest, Rat->Point1.X, Rat->Point1.Y,
- Rat->Point2.X, Rat->Point2.Y, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
- if (conf_core.editor.clear_line)
- conf_set_editor(clear_line, 1);
- if (!newone)
- return (NULL);
- AddObjectToCreateUndoList(PCB_TYPE_LINE, Dest, newone, newone);
- if (PCB->RatOn)
- EraseRat(Rat);
- MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, Rat, Rat, Rat);
- DrawLine(Dest, newone);
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line between layers
- */
-
-struct via_info {
- Coord X, Y;
- jmp_buf env;
};
-static r_dir_t moveline_callback(const BoxType * b, void *cl)
-{
- struct via_info *i = (struct via_info *) cl;
- PinTypePtr via;
-
- if ((via =
- CreateNewVia(PCB->Data, i->X, i->Y,
- conf_core.design.via_thickness, 2 * conf_core.design.clearance, PCB_FLAG_NO, conf_core.design.via_drilling_hole, NULL, NoFlags())) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via);
- DrawVia(via);
- }
- longjmp(i->env, 1);
-}
-
-static void *MoveLineToLayer(LayerType * Layer, LineType * Line)
-{
- struct via_info info;
- BoxType sb;
- LineTypePtr newone;
- void *ptr1, *ptr2, *ptr3;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Line)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (Dest == Layer && Layer->On) {
- DrawLine(Layer, Line);
- Draw();
- }
- if (((long int) Dest == -1) || Dest == Layer)
- return (Line);
-
- AddObjectToMoveToLayerUndoList(PCB_TYPE_LINE, Layer, Line, Line);
- if (Layer->On)
- EraseLine(Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- newone = (LineTypePtr) MoveLineToLayerLowLevel(Layer, Line, Dest);
- Line = NULL;
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Dest, newone);
- if (Dest->On)
- DrawLine(Dest, newone);
- Draw();
- if (!PCB->ViaOn || MoreToCome ||
- GetLayerGroupNumberByPointer(Layer) ==
- GetLayerGroupNumberByPointer(Dest) || TEST_SILK_LAYER(Layer) || TEST_SILK_LAYER(Dest))
- return (newone);
- /* consider via at Point1 */
- sb.X1 = newone->Point1.X - newone->Thickness / 2;
- sb.X2 = newone->Point1.X + newone->Thickness / 2;
- sb.Y1 = newone->Point1.Y - newone->Thickness / 2;
- sb.Y2 = newone->Point1.Y + newone->Thickness / 2;
- if ((SearchObjectByLocation(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
- newone->Point1.X, newone->Point1.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE)) {
- info.X = newone->Point1.X;
- info.Y = newone->Point1.Y;
- if (setjmp(info.env) == 0)
- r_search(Layer->line_tree, &sb, NULL, moveline_callback, &info, NULL);
- }
- /* consider via at Point2 */
- sb.X1 = newone->Point2.X - newone->Thickness / 2;
- sb.X2 = newone->Point2.X + newone->Thickness / 2;
- sb.Y1 = newone->Point2.Y - newone->Thickness / 2;
- sb.Y2 = newone->Point2.Y + newone->Thickness / 2;
- if ((SearchObjectByLocation(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
- newone->Point2.X, newone->Point2.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE)) {
- info.X = newone->Point2.X;
- info.Y = newone->Point2.Y;
- if (setjmp(info.env) == 0)
- r_search(Layer->line_tree, &sb, NULL, moveline_callback, &info, NULL);
- }
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text object between layers; lowlevel routines
- */
-static void *MoveTextToLayerLowLevel(LayerType * Source, TextType * text, LayerType * Destination)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Source, text);
- r_delete_entry(Source->text_tree, (BoxType *) text);
-
- textlist_remove(text);
- textlist_append(&Destination->Text, text);
-
- if (GetLayerGroupNumberByNumber(solder_silk_layer) == GetLayerGroupNumberByPointer(Destination))
- SET_FLAG(PCB_FLAG_ONSOLDER, text);
- else
- CLEAR_FLAG(PCB_FLAG_ONSOLDER, text);
-
- /* re-calculate the bounding box (it could be mirrored now) */
- SetTextBoundingBox(&PCB->Font, text);
- if (!Destination->text_tree)
- Destination->text_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->text_tree, (BoxType *) text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Destination, text);
-
- return text;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text object between layers
- */
-static void *MoveTextToLayer(LayerType * layer, TextType * text)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, text)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (Dest != layer) {
- AddObjectToMoveToLayerUndoList(PCB_TYPE_TEXT, layer, text, text);
- if (layer->On)
- EraseText(layer, text);
- text = MoveTextToLayerLowLevel(layer, text, Dest);
- if (Dest->On)
- DrawText(Dest, text);
- if (layer->On || Dest->On)
- Draw();
- }
- return text;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon between layers; lowlevel routines
- */
-static void *MovePolygonToLayerLowLevel(LayerType * Source, PolygonType * polygon, LayerType * Destination)
-{
- r_delete_entry(Source->polygon_tree, (BoxType *) polygon);
-
- polylist_remove(polygon);
- polylist_append(&Destination->Polygon, polygon);
-
- if (!Destination->polygon_tree)
- Destination->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->polygon_tree, (BoxType *) polygon, 0);
-
- return polygon;
-}
-
-struct mptlc {
- pcb_cardinal_t snum, dnum;
- int type;
- PolygonTypePtr polygon;
-} mptlc;
-
-r_dir_t mptl_pin_callback(const BoxType * b, void *cl)
-{
- struct mptlc *d = (struct mptlc *) cl;
- PinTypePtr pin = (PinTypePtr) b;
- if (!TEST_THERM(d->snum, pin) || !IsPointInPolygon(pin->X, pin->Y, pin->Thickness + pin->Clearance + 2, d->polygon))
- return R_DIR_NOT_FOUND;
- if (d->type == PCB_TYPE_PIN)
- AddObjectToFlagUndoList(PCB_TYPE_PIN, pin->Element, pin, pin);
- else
- AddObjectToFlagUndoList(PCB_TYPE_VIA, pin, pin, pin);
- ASSIGN_THERM(d->dnum, GET_THERM(d->snum, pin), pin);
- CLEAR_THERM(d->snum, pin);
- return R_DIR_FOUND_CONTINUE;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon between layers
- */
-static void *MovePolygonToLayer(LayerType * Layer, PolygonType * Polygon)
-{
- PolygonTypePtr newone;
- struct mptlc d;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Polygon)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (((long int) Dest == -1) || (Layer == Dest))
- return (Polygon);
- AddObjectToMoveToLayerUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
- if (Layer->On)
- ErasePolygon(Polygon);
- /* Move all of the thermals with the polygon */
- d.snum = GetLayerNumber(PCB->Data, Layer);
- d.dnum = GetLayerNumber(PCB->Data, Dest);
- d.polygon = Polygon;
- d.type = PCB_TYPE_PIN;
- r_search(PCB->Data->pin_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL);
- d.type = PCB_TYPE_VIA;
- r_search(PCB->Data->via_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL);
- newone = (struct polygon_st *) MovePolygonToLayerLowLevel(Layer, Polygon, Dest);
- InitClip(PCB->Data, Dest, newone);
- if (Dest->On) {
- DrawPolygon(Dest, newone);
- Draw();
- }
- return (newone);
-}
+static pcb_opfunc_t MoveToLayerFunctions = {
+ MoveLineToLayer,
+ MoveTextToLayer,
+ MovePolygonToLayer,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ MoveArcToLayer,
+ MoveRatToLayer,
+ NULL
+};
/* ---------------------------------------------------------------------------
* moves the object identified by its data pointers and the type
* not we don't bump the undo serial number
*/
-void *MoveObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
+void *pcb_move_obj(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY)
{
void *result;
- /* setup offset */
- DeltaX = DX;
- DeltaY = DY;
- AddObjectToMoveUndoList(Type, Ptr1, Ptr2, Ptr3, DX, DY);
- result = ObjectOperation(&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
+ pcb_opctx_t ctx;
+
+ ctx.move.pcb = PCB;
+ ctx.move.dx = DX;
+ ctx.move.dy = DY;
+ pcb_undo_add_obj_to_move(Type, Ptr1, Ptr2, Ptr3, DX, DY);
+ result = pcb_object_operation(&MoveFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
return (result);
}
@@ -689,43 +101,38 @@ void *MoveObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord D
* moves the object identified by its data pointers and the type
* as well as all attached rubberband lines
*/
-void *MoveObjectAndRubberband(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
+void *pcb_move_obj_and_rubberband(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY)
{
- RubberbandTypePtr ptr;
+ pcb_opctx_t ctx;
void *ptr2;
- pcb_draw_inhibit_inc();
+ ctx.move.pcb = PCB;
+ ctx.move.dx = DX;
+ ctx.move.dy = DY;
- /* setup offset */
- DeltaX = DX;
- DeltaY = DY;
- if (DX == 0 && DY == 0) {
- int n;
+ pcb_event(PCB_EVENT_RUBBER_MOVE, "ccp", DX, DY, &ctx);
- /* first clear any marks that we made in the line flags */
- for(n = 0, ptr = Crosshair.AttachedObject.Rubberband; n < Crosshair.AttachedObject.RubberbandN; n++, ptr++)
- CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line);
+ if (DX == 0 && DY == 0)
+ return NULL;
- return (NULL);
- }
+ pcb_draw_inhibit_inc();
- /* move all the lines... and reset the counter */
- ptr = Crosshair.AttachedObject.Rubberband;
- while (Crosshair.AttachedObject.RubberbandN) {
- /* first clear any marks that we made in the line flags */
- CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line);
- AddObjectToMoveUndoList(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, DX, DY);
- MoveLinePoint(ptr->Layer, ptr->Line, ptr->MovedPoint);
- Crosshair.AttachedObject.RubberbandN--;
- ptr++;
+ if (Type == PCB_TYPE_ARC_POINT) {
+ /* moving the endpoint of an arc is not really a move, but a change of arc properties */
+ if (pcb_crosshair.AttachedObject.radius == 0)
+ pcb_arc_set_angles((pcb_layer_t *)Ptr1, (pcb_arc_t *)Ptr2, pcb_crosshair.AttachedObject.start_angle, pcb_crosshair.AttachedObject.delta_angle);
+ else
+ pcb_arc_set_radii((pcb_layer_t *)Ptr1, (pcb_arc_t *)Ptr2, pcb_crosshair.AttachedObject.radius, pcb_crosshair.AttachedObject.radius);
+ pcb_crosshair.AttachedObject.radius = 0;
}
-
- AddObjectToMoveUndoList(Type, Ptr1, Ptr2, Ptr3, DX, DY);
- ptr2 = ObjectOperation(&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
- IncrementUndoSerialNumber();
+ else {
+ pcb_undo_add_obj_to_move(Type, Ptr1, Ptr2, Ptr3, DX, DY);
+ ptr2 = pcb_object_operation(&MoveFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
+ }
+ pcb_undo_inc_serial();
pcb_draw_inhibit_dec();
- Draw();
+ pcb_draw();
return (ptr2);
}
@@ -734,15 +141,17 @@ void *MoveObjectAndRubberband(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coor
* moves the object identified by its data pointers and the type
* to a new layer without changing it's position
*/
-void *MoveObjectToLayer(int Type, void *Ptr1, void *Ptr2, void *Ptr3, LayerTypePtr Target, pcb_bool enmasse)
+void *pcb_move_obj_to_layer(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_layer_t *Target, pcb_bool enmasse)
{
void *result;
+ pcb_opctx_t ctx;
+
+ ctx.move.pcb = PCB;
+ ctx.move.dst_layer = Target;
+ ctx.move.more_to_come = enmasse;
- /* setup global identifiers */
- Dest = Target;
- MoreToCome = enmasse;
- result = ObjectOperation(&MoveToLayerFunctions, Type, Ptr1, Ptr2, Ptr3);
- IncrementUndoSerialNumber();
+ result = pcb_object_operation(&MoveToLayerFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
+ pcb_undo_inc_serial();
return (result);
}
@@ -750,302 +159,16 @@ void *MoveObjectToLayer(int Type, void *Ptr1, void *Ptr2, void *Ptr3, LayerTypeP
* moves the selected objects to a new layer without changing their
* positions
*/
-pcb_bool MoveSelectedObjectsToLayer(LayerTypePtr Target)
+pcb_bool pcb_move_selected_objs_to_layer(pcb_layer_t *Target)
{
pcb_bool changed;
+ pcb_opctx_t ctx;
- /* setup global identifiers */
- Dest = Target;
- MoreToCome = pcb_true;
- changed = SelectedOperation(&MoveToLayerFunctions, pcb_true, PCB_TYPEMASK_ALL);
+ ctx.move.pcb = PCB;
+ ctx.move.dst_layer = Target;
+ ctx.move.more_to_come = pcb_true;
+
+ changed = pcb_selected_operation(&MoveToLayerFunctions, &ctx, pcb_true, PCB_TYPEMASK_ALL);
/* passing pcb_true to above operation causes Undoserial to auto-increment */
return (changed);
}
-
-/* ---------------------------------------------------------------------------
- * moves the selected layers to a new index in the layer list.
- */
-
-static void move_one_thermal(int old_index, int new_index, PinType * pin)
-{
- int t1 = 0, i;
- int oi = old_index, ni = new_index;
-
- if (old_index != -1)
- t1 = GET_THERM(old_index, pin);
-
- if (oi == -1)
- oi = MAX_LAYER - 1; /* inserting a layer */
- if (ni == -1)
- ni = MAX_LAYER - 1; /* deleting a layer */
-
- if (oi < ni) {
- for (i = oi; i < ni; i++)
- ASSIGN_THERM(i, GET_THERM(i + 1, pin), pin);
- }
- else {
- for (i = oi; i > ni; i--)
- ASSIGN_THERM(i, GET_THERM(i - 1, pin), pin);
- }
-
- if (new_index != -1)
- ASSIGN_THERM(new_index, t1, pin);
- else
- ASSIGN_THERM(ni, 0, pin);
-}
-
-static void move_all_thermals(int old_index, int new_index)
-{
- VIA_LOOP(PCB->Data);
- {
- move_one_thermal(old_index, new_index, via);
- }
- END_LOOP;
-
- ALLPIN_LOOP(PCB->Data);
- {
- move_one_thermal(old_index, new_index, pin);
- }
- ENDALL_LOOP;
-}
-
-static int LastLayerInComponentGroup(int layer)
-{
- int cgroup = GetLayerGroupNumberByNumber(max_group + COMPONENT_LAYER);
- int lgroup = GetLayerGroupNumberByNumber(layer);
- if (cgroup == lgroup && PCB->LayerGroups.Number[lgroup] == 2)
- return 1;
- return 0;
-}
-
-static int LastLayerInSolderGroup(int layer)
-{
- int sgroup = GetLayerGroupNumberByNumber(max_group + SOLDER_LAYER);
- int lgroup = GetLayerGroupNumberByNumber(layer);
- if (sgroup == lgroup && PCB->LayerGroups.Number[lgroup] == 2)
- return 1;
- return 0;
-}
-
-int MoveLayer(int old_index, int new_index)
-{
- int groups[MAX_LAYER + 2], l, g;
- LayerType saved_layer;
- int saved_group;
-
- AddLayerChangeToUndoList(old_index, new_index);
- IncrementUndoSerialNumber();
-
- if (old_index < -1 || old_index >= max_copper_layer) {
- Message(PCB_MSG_DEFAULT, "Invalid old layer %d for move: must be -1..%d\n", old_index, max_copper_layer - 1);
- return 1;
- }
- if (new_index < -1 || new_index > max_copper_layer || new_index >= MAX_LAYER) {
- Message(PCB_MSG_DEFAULT, "Invalid new layer %d for move: must be -1..%d\n", new_index, max_copper_layer);
- return 1;
- }
- if (old_index == new_index)
- return 0;
-
- if (new_index == -1 && LastLayerInComponentGroup(old_index)) {
- gui->confirm_dialog("You can't delete the last top-side layer\n", "Ok", NULL);
- return 1;
- }
-
- if (new_index == -1 && LastLayerInSolderGroup(old_index)) {
- gui->confirm_dialog("You can't delete the last bottom-side layer\n", "Ok", NULL);
- return 1;
- }
-
- for (g = 0; g < MAX_LAYER + 2; g++)
- groups[g] = -1;
-
- for (g = 0; g < MAX_LAYER; g++)
- for (l = 0; l < PCB->LayerGroups.Number[g]; l++)
- groups[PCB->LayerGroups.Entries[g][l]] = g;
-
- if (old_index == -1) {
- LayerTypePtr lp;
- if (max_copper_layer == MAX_LAYER) {
- Message(PCB_MSG_DEFAULT, "No room for new layers\n");
- return 1;
- }
- /* Create a new layer at new_index. */
- lp = &PCB->Data->Layer[new_index];
- memmove(&PCB->Data->Layer[new_index + 1],
- &PCB->Data->Layer[new_index], (max_copper_layer - new_index + 2) * sizeof(LayerType));
- memmove(&groups[new_index + 1], &groups[new_index], (max_copper_layer - new_index + 2) * sizeof(int));
- max_copper_layer++;
- memset(lp, 0, sizeof(LayerType));
- lp->On = 1;
- lp->Name = pcb_strdup("New Layer");
- lp->Color = conf_core.appearance.color.layer[new_index];
- lp->SelectedColor = conf_core.appearance.color.layer_selected[new_index];
- for (l = 0; l < max_copper_layer; l++)
- if (LayerStack[l] >= new_index)
- LayerStack[l]++;
- LayerStack[max_copper_layer - 1] = new_index;
- }
- else if (new_index == -1) {
- /* Delete the layer at old_index */
- memmove(&PCB->Data->Layer[old_index],
- &PCB->Data->Layer[old_index + 1], (max_copper_layer - old_index + 2 - 1) * sizeof(LayerType));
- memset(&PCB->Data->Layer[max_copper_layer + 1], 0, sizeof(LayerType));
- memmove(&groups[old_index], &groups[old_index + 1], (max_copper_layer - old_index + 2 - 1) * sizeof(int));
- for (l = 0; l < max_copper_layer; l++)
- if (LayerStack[l] == old_index)
- memmove(LayerStack + l, LayerStack + l + 1, (max_copper_layer - l - 1) * sizeof(LayerStack[0]));
- max_copper_layer--;
- for (l = 0; l < max_copper_layer; l++)
- if (LayerStack[l] > old_index)
- LayerStack[l]--;
- }
- else {
- /* Move an existing layer */
- memcpy(&saved_layer, &PCB->Data->Layer[old_index], sizeof(LayerType));
- saved_group = groups[old_index];
- if (old_index < new_index) {
- memmove(&PCB->Data->Layer[old_index], &PCB->Data->Layer[old_index + 1], (new_index - old_index) * sizeof(LayerType));
- memmove(&groups[old_index], &groups[old_index + 1], (new_index - old_index) * sizeof(int));
- }
- else {
- memmove(&PCB->Data->Layer[new_index + 1], &PCB->Data->Layer[new_index], (old_index - new_index) * sizeof(LayerType));
- memmove(&groups[new_index + 1], &groups[new_index], (old_index - new_index) * sizeof(int));
- }
- memcpy(&PCB->Data->Layer[new_index], &saved_layer, sizeof(LayerType));
- groups[new_index] = saved_group;
- }
-
- move_all_thermals(old_index, new_index);
-
- for (g = 0; g < MAX_LAYER; g++)
- PCB->LayerGroups.Number[g] = 0;
- for (l = 0; l < max_copper_layer + 2; l++) {
- int i;
- g = groups[l];
- if (g >= 0) {
- i = PCB->LayerGroups.Number[g]++;
- PCB->LayerGroups.Entries[g][i] = l;
- }
- }
-
- for (g = 0; g < MAX_LAYER; g++)
- if (PCB->LayerGroups.Number[g] == 0) {
- memmove(&PCB->LayerGroups.Number[g],
- &PCB->LayerGroups.Number[g + 1], (MAX_LAYER - g - 1) * sizeof(PCB->LayerGroups.Number[g]));
- memmove(&PCB->LayerGroups.Entries[g],
- &PCB->LayerGroups.Entries[g + 1], (MAX_LAYER - g - 1) * sizeof(PCB->LayerGroups.Entries[g]));
- }
-
- hid_action("LayersChanged");
- gui->invalidate_all();
- return 0;
-}
-
-/* --------------------------------------------------------------------------- */
-
-static const char movelayer_syntax[] = "MoveLayer(old,new)";
-
-static const char movelayer_help[] = "Moves/Creates/Deletes Layers.";
-
-/* %start-doc actions MoveLayer
-
-Moves a layer, creates a new layer, or deletes a layer.
-
- at table @code
-
- at item old
-The is the layer number to act upon. Allowed values are:
- at table @code
-
- at item c
-Currently selected layer.
-
- at item -1
-Create a new layer.
-
- at item number
-An existing layer number.
-
- at end table
-
- at item new
-Specifies where to move the layer to. Allowed values are:
- at table @code
- at item -1
-Deletes the layer.
-
- at item up
-Moves the layer up.
-
- at item down
-Moves the layer down.
-
- at item c
-Creates a new layer.
-
- at end table
-
- at end table
-
-%end-doc */
-
-int MoveLayerAction(int argc, const char **argv, Coord x, Coord y)
-{
- int old_index, new_index;
- int new_top = -1;
-
- if (argc != 2) {
- Message(PCB_MSG_DEFAULT, "Usage; MoveLayer(old,new)");
- return 1;
- }
-
- if (strcmp(argv[0], "c") == 0)
- old_index = INDEXOFCURRENT;
- else
- old_index = atoi(argv[0]);
-
- if (strcmp(argv[1], "c") == 0) {
- new_index = INDEXOFCURRENT;
- if (new_index < 0)
- new_index = 0;
- }
- else if (strcmp(argv[1], "up") == 0) {
- new_index = INDEXOFCURRENT - 1;
- if (new_index < 0)
- return 1;
- new_top = new_index;
- }
- else if (strcmp(argv[1], "down") == 0) {
- new_index = INDEXOFCURRENT + 1;
- if (new_index >= max_copper_layer)
- return 1;
- new_top = new_index;
- }
- else
- new_index = atoi(argv[1]);
-
- if (MoveLayer(old_index, new_index))
- return 1;
-
- if (new_index == -1) {
- new_top = old_index;
- if (new_top >= max_copper_layer)
- new_top--;
- new_index = new_top;
- }
- if (old_index == -1)
- new_top = new_index;
-
- if (new_top != -1)
- ChangeGroupVisibility(new_index, 1, 1);
-
- return 0;
-}
-
-HID_Action move_action_list[] = {
- {"MoveLayer", 0, MoveLayerAction,
- movelayer_help, movelayer_syntax}
-};
-
-REGISTER_ACTIONS(move_action_list, NULL)
diff --git a/src/move.h b/src/move.h
index e90e398..1f6eb99 100644
--- a/src/move.h
+++ b/src/move.h
@@ -29,78 +29,30 @@
#ifndef PCB_MOVE_H
#define PCB_MOVE_H
-#include "global.h"
+#include "config.h"
/* ---------------------------------------------------------------------------
* some useful transformation macros and constants
*/
-#define MOVE(xs,ys,deltax,deltay) \
+#define PCB_MOVE(xs,ys,deltax,deltay) \
{ \
((xs) += (deltax)); \
((ys) += (deltay)); \
}
-#define MOVE_BOX_LOWLEVEL(b,dx,dy) \
- { \
- MOVE((b)->X1,(b)->Y1,(dx),(dy)) \
- MOVE((b)->X2,(b)->Y2,(dx),(dy)) \
- }
-#define MOVE_VIA_LOWLEVEL(v,dx,dy) \
- { \
- MOVE((v)->X,(v)->Y,(dx),(dy)) \
- MOVE_BOX_LOWLEVEL(&((v)->BoundingBox),(dx),(dy)); \
- }
-#define MOVE_PIN_LOWLEVEL(p,dx,dy) \
- { \
- MOVE((p)->X,(p)->Y,(dx),(dy)) \
- MOVE_BOX_LOWLEVEL(&((p)->BoundingBox),(dx),(dy)); \
- }
-
-#define MOVE_ARC_LOWLEVEL(a,dx,dy) \
- { \
- MOVE((a)->X,(a)->Y,(dx),(dy)) \
- MOVE_BOX_LOWLEVEL(&((a)->BoundingBox),(dx),(dy)); \
- }
-/* Rather than mode the line bounding box, we set it so the point bounding
- * boxes are updated too.
- */
-#define MOVE_LINE_LOWLEVEL(l,dx,dy) \
- { \
- MOVE((l)->Point1.X,(l)->Point1.Y,(dx),(dy)) \
- MOVE((l)->Point2.X,(l)->Point2.Y,(dx),(dy)) \
- SetLineBoundingBox ((l)); \
- }
-#define MOVE_PAD_LOWLEVEL(p,dx,dy) \
- { \
- MOVE((p)->Point1.X,(p)->Point1.Y,(dx),(dy)) \
- MOVE((p)->Point2.X,(p)->Point2.Y,(dx),(dy)) \
- SetPadBoundingBox ((p)); \
- }
-#define MOVE_TEXT_LOWLEVEL(t,dx,dy) \
- { \
- MOVE_BOX_LOWLEVEL(&((t)->BoundingBox),(dx),(dy)); \
- MOVE((t)->X, (t)->Y, (dx), (dy)); \
- }
-#define MOVE_TYPES \
+#define PCB_MOVE_TYPES \
(PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT | PCB_TYPE_ELEMENT_NAME | \
- PCB_TYPE_POLYGON | PCB_TYPE_POLYGON_POINT | PCB_TYPE_LINE_POINT | PCB_TYPE_ARC)
-#define MOVETOLAYER_TYPES \
+ PCB_TYPE_POLYGON | PCB_TYPE_POLYGON_POINT | PCB_TYPE_LINE_POINT | PCB_TYPE_ARC | PCB_TYPE_ARC_POINT)
+#define PCB_MOVETOLAYER_TYPES \
(PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_POLYGON | PCB_TYPE_RATLINE | PCB_TYPE_ARC)
/* ---------------------------------------------------------------------------
* prototypes
*/
-void MovePolygonLowLevel(PolygonTypePtr, Coord, Coord);
-void MoveElementLowLevel(DataTypePtr, ElementTypePtr, Coord, Coord);
-void *MoveObject(int, void *, void *, void *, Coord, Coord);
-void *MoveObjectToLayer(int, void *, void *, void *, LayerTypePtr, pcb_bool);
-void *MoveObjectAndRubberband(int, void *, void *, void *, Coord, Coord);
-pcb_bool MoveSelectedObjectsToLayer(LayerTypePtr);
-
-/* index is 0..MAX_LAYER-1. If old_index is -1, a new layer is
- inserted at that index. If new_index is -1, the specified layer is
- deleted. Returns non-zero on error, zero if OK. */
-int MoveLayer(int old_index, int new_index);
+void *pcb_move_obj(int, void *, void *, void *, pcb_coord_t, pcb_coord_t);
+void *pcb_move_obj_to_layer(int, void *, void *, void *, pcb_layer_t *, pcb_bool);
+void *pcb_move_obj_and_rubberband(int, void *, void *, void *, pcb_coord_t, pcb_coord_t);
+pcb_bool pcb_move_selected_objs_to_layer(pcb_layer_t *);
#endif
diff --git a/src/mymem.c b/src/mymem.c
deleted file mode 100644
index e851545..0000000
--- a/src/mymem.c
+++ /dev/null
@@ -1,765 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-
-/* memory management functions
- */
-
-#include "config.h"
-
-#include <memory.h>
-
-#include "data.h"
-#include "mymem.h"
-#include "rtree.h"
-#include "rats_patch.h"
-
-/* ---------------------------------------------------------------------------
- * local prototypes
- */
-/* memset object to 0, but keep the link field */
-#define reset_obj_mem(type, obj) \
-do { \
- gdl_elem_t __lnk__ = obj->link; \
- memset(obj, 0, sizeof(type)); \
- obj->link = __lnk__; \
-} while(0) \
-
-/* ---------------------------------------------------------------------------
- * get next slot for a rubberband connection, allocates memory if necessary
- */
-RubberbandTypePtr GetRubberbandMemory(void)
-{
- RubberbandTypePtr ptr = Crosshair.AttachedObject.Rubberband;
-
- /* realloc new memory if necessary and clear it */
- if (Crosshair.AttachedObject.RubberbandN >= Crosshair.AttachedObject.RubberbandMax) {
- Crosshair.AttachedObject.RubberbandMax += STEP_RUBBERBAND;
- ptr = (RubberbandTypePtr) realloc(ptr, Crosshair.AttachedObject.RubberbandMax * sizeof(RubberbandType));
- Crosshair.AttachedObject.Rubberband = ptr;
- memset(ptr + Crosshair.AttachedObject.RubberbandN, 0, STEP_RUBBERBAND * sizeof(RubberbandType));
- }
- return (ptr + Crosshair.AttachedObject.RubberbandN++);
-}
-
-void **GetPointerMemory(PointerListTypePtr list)
-{
- void **ptr = list->Ptr;
-
- /* realloc new memory if necessary and clear it */
- if (list->PtrN >= list->PtrMax) {
- list->PtrMax = STEP_POINT + (2 * list->PtrMax);
- ptr = (void **) realloc(ptr, list->PtrMax * sizeof(void *));
- list->Ptr = ptr;
- memset(ptr + list->PtrN, 0, (list->PtrMax - list->PtrN) * sizeof(void *));
- }
- return (ptr + list->PtrN++);
-}
-
-void FreePointerListMemory(PointerListTypePtr list)
-{
- free(list->Ptr);
- memset(list, 0, sizeof(PointerListType));
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a box, allocates memory if necessary
- */
-BoxTypePtr GetBoxMemory(BoxListTypePtr Boxes)
-{
- BoxTypePtr box = Boxes->Box;
-
- /* realloc new memory if necessary and clear it */
- if (Boxes->BoxN >= Boxes->BoxMax) {
- Boxes->BoxMax = STEP_POINT + (2 * Boxes->BoxMax);
- box = (BoxTypePtr) realloc(box, Boxes->BoxMax * sizeof(BoxType));
- Boxes->Box = box;
- memset(box + Boxes->BoxN, 0, (Boxes->BoxMax - Boxes->BoxN) * sizeof(BoxType));
- }
- return (box + Boxes->BoxN++);
-}
-
-
-/* ---------------------------------------------------------------------------
- * get next slot for a connection, allocates memory if necessary
- */
-ConnectionTypePtr GetConnectionMemory(NetTypePtr Net)
-{
- ConnectionTypePtr con = Net->Connection;
-
- /* realloc new memory if necessary and clear it */
- if (Net->ConnectionN >= Net->ConnectionMax) {
- Net->ConnectionMax += STEP_POINT;
- con = (ConnectionTypePtr) realloc(con, Net->ConnectionMax * sizeof(ConnectionType));
- Net->Connection = con;
- memset(con + Net->ConnectionN, 0, STEP_POINT * sizeof(ConnectionType));
- }
- return (con + Net->ConnectionN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a subnet, allocates memory if necessary
- */
-NetTypePtr GetNetMemory(NetListTypePtr Netlist)
-{
- NetTypePtr net = Netlist->Net;
-
- /* realloc new memory if necessary and clear it */
- if (Netlist->NetN >= Netlist->NetMax) {
- Netlist->NetMax += STEP_POINT;
- net = (NetTypePtr) realloc(net, Netlist->NetMax * sizeof(NetType));
- Netlist->Net = net;
- memset(net + Netlist->NetN, 0, STEP_POINT * sizeof(NetType));
- }
- return (net + Netlist->NetN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a net list, allocates memory if necessary
- */
-NetListTypePtr GetNetListMemory(NetListListTypePtr Netlistlist)
-{
- NetListTypePtr netlist = Netlistlist->NetList;
-
- /* realloc new memory if necessary and clear it */
- if (Netlistlist->NetListN >= Netlistlist->NetListMax) {
- Netlistlist->NetListMax += STEP_POINT;
- netlist = (NetListTypePtr) realloc(netlist, Netlistlist->NetListMax * sizeof(NetListType));
- Netlistlist->NetList = netlist;
- memset(netlist + Netlistlist->NetListN, 0, STEP_POINT * sizeof(NetListType));
- }
- return (netlist + Netlistlist->NetListN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a pin, allocates memory if necessary
- */
-PinType *GetPinMemory(ElementType * element)
-{
- PinType *new_obj;
-
- new_obj = calloc(sizeof(PinType), 1);
- pinlist_append(&element->Pin, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreePin(PinType * data)
-{
- pinlist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a pad, allocates memory if necessary
- */
-PadType *GetPadMemory(ElementType * element)
-{
- PadType *new_obj;
-
- new_obj = calloc(sizeof(PadType), 1);
- padlist_append(&element->Pad, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreePad(PadType * data)
-{
- padlist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a via, allocates memory if necessary
- */
-PinType *GetViaMemory(DataType * data)
-{
- PinType *new_obj;
-
- new_obj = calloc(sizeof(PinType), 1);
- pinlist_append(&data->Via, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreeVia(PinType * data)
-{
- pinlist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a Rat, allocates memory if necessary
- */
-RatType *GetRatMemory(DataType * data)
-{
- RatType *new_obj;
-
- new_obj = calloc(sizeof(RatType), 1);
- ratlist_append(&data->Rat, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreeRat(RatType * data)
-{
- ratlist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a line, allocates memory if necessary
- */
-LineType *GetLineMemory(LayerType * layer)
-{
- LineType *new_obj;
-
- new_obj = calloc(sizeof(LineType), 1);
- linelist_append(&layer->Line, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreeLine(LineType * data)
-{
- linelist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for an arc, allocates memory if necessary
- */
-ArcTypePtr GetArcMemory(LayerType * layer)
-{
- ArcType *new_obj;
-
- new_obj = calloc(sizeof(ArcType), 1);
- arclist_append(&layer->Arc, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreeArc(ArcType * data)
-{
- arclist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a text object, allocates memory if necessary
- */
-TextTypePtr GetTextMemory(LayerType * layer)
-{
- TextType *new_obj;
-
- new_obj = calloc(sizeof(TextType), 1);
- textlist_append(&layer->Text, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreeText(TextType * data)
-{
- textlist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a polygon object, allocates memory if necessary
- */
-PolygonType *GetPolygonMemory(LayerType * layer)
-{
- PolygonType *new_obj;
-
- new_obj = calloc(sizeof(PolygonType), 1);
- polylist_append(&layer->Polygon, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreePolygon(PolygonType * data)
-{
- polylist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * gets the next slot for a point in a polygon struct, allocates memory
- * if necessary
- */
-PointTypePtr GetPointMemoryInPolygon(PolygonTypePtr Polygon)
-{
- PointTypePtr points = Polygon->Points;
-
- /* realloc new memory if necessary and clear it */
- if (Polygon->PointN >= Polygon->PointMax) {
- Polygon->PointMax += STEP_POLYGONPOINT;
- points = (PointTypePtr) realloc(points, Polygon->PointMax * sizeof(PointType));
- Polygon->Points = points;
- memset(points + Polygon->PointN, 0, STEP_POLYGONPOINT * sizeof(PointType));
- }
- return (points + Polygon->PointN++);
-}
-
-/* ---------------------------------------------------------------------------
- * gets the next slot for a point in a polygon struct, allocates memory
- * if necessary
- */
-pcb_cardinal_t *GetHoleIndexMemoryInPolygon(PolygonTypePtr Polygon)
-{
- pcb_cardinal_t *holeindex = Polygon->HoleIndex;
-
- /* realloc new memory if necessary and clear it */
- if (Polygon->HoleIndexN >= Polygon->HoleIndexMax) {
- Polygon->HoleIndexMax += STEP_POLYGONHOLEINDEX;
- holeindex = (pcb_cardinal_t *) realloc(holeindex, Polygon->HoleIndexMax * sizeof(int));
- Polygon->HoleIndex = holeindex;
- memset(holeindex + Polygon->HoleIndexN, 0, STEP_POLYGONHOLEINDEX * sizeof(int));
- }
- return (holeindex + Polygon->HoleIndexN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for an element, allocates memory if necessary
- */
-ElementType *GetElementMemory(DataType * data)
-{
- ElementType *new_obj;
-
- new_obj = calloc(sizeof(ElementType), 1);
- elementlist_append(&data->Element, new_obj);
-
- return new_obj;
-}
-
-void RemoveFreeElement(ElementType * data)
-{
- elementlist_remove(data);
- free(data);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a library menu, allocates memory if necessary
- */
-LibraryMenuTypePtr GetLibraryMenuMemory(LibraryTypePtr lib, int *idx)
-{
- LibraryMenuTypePtr menu = lib->Menu;
-
- /* realloc new memory if necessary and clear it */
- if (lib->MenuN >= lib->MenuMax) {
- lib->MenuMax += STEP_LIBRARYMENU;
- menu = (LibraryMenuTypePtr) realloc(menu, lib->MenuMax * sizeof(LibraryMenuType));
- lib->Menu = menu;
- memset(menu + lib->MenuN, 0, STEP_LIBRARYMENU * sizeof(LibraryMenuType));
- }
- if (idx != NULL)
- *idx = lib->MenuN;
- return (menu + lib->MenuN++);
-}
-
-void DeleteLibraryMenuMemory(LibraryTypePtr lib, int menuidx)
-{
- LibraryMenuTypePtr menu = lib->Menu;
-
- if (menu[menuidx].Name != NULL)
- free(menu[menuidx].Name);
- if (menu[menuidx].directory != NULL)
- free(menu[menuidx].directory);
-
- lib->MenuN--;
- memmove(menu + menuidx, menu + menuidx + 1, sizeof(LibraryMenuType) * (lib->MenuN - menuidx));
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a library entry, allocates memory if necessary
- */
-LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr Menu)
-{
- LibraryEntryTypePtr entry = Menu->Entry;
-
- /* realloc new memory if necessary and clear it */
- if (Menu->EntryN >= Menu->EntryMax) {
- Menu->EntryMax += STEP_LIBRARYENTRY;
- entry = (LibraryEntryTypePtr) realloc(entry, Menu->EntryMax * sizeof(LibraryEntryType));
- Menu->Entry = entry;
- memset(entry + Menu->EntryN, 0, STEP_LIBRARYENTRY * sizeof(LibraryEntryType));
- }
- return (entry + Menu->EntryN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a DrillElement, allocates memory if necessary
- */
-ElementTypeHandle GetDrillElementMemory(DrillTypePtr Drill)
-{
- ElementTypePtr *element;
-
- element = Drill->Element;
-
- /* realloc new memory if necessary and clear it */
- if (Drill->ElementN >= Drill->ElementMax) {
- Drill->ElementMax += STEP_ELEMENT;
- element = (ElementTypePtr *) realloc(element, Drill->ElementMax * sizeof(ElementTypeHandle));
- Drill->Element = element;
- memset(element + Drill->ElementN, 0, STEP_ELEMENT * sizeof(ElementTypeHandle));
- }
- return (element + Drill->ElementN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a DrillPoint, allocates memory if necessary
- */
-PinTypeHandle GetDrillPinMemory(DrillTypePtr Drill)
-{
- PinTypePtr *pin;
-
- pin = Drill->Pin;
-
- /* realloc new memory if necessary and clear it */
- if (Drill->PinN >= Drill->PinMax) {
- Drill->PinMax += STEP_POINT;
- pin = (PinTypePtr *) realloc(pin, Drill->PinMax * sizeof(PinTypeHandle));
- Drill->Pin = pin;
- memset(pin + Drill->PinN, 0, STEP_POINT * sizeof(PinTypeHandle));
- }
- return (pin + Drill->PinN++);
-}
-
-/* ---------------------------------------------------------------------------
- * get next slot for a Drill, allocates memory if necessary
- */
-DrillTypePtr GetDrillInfoDrillMemory(DrillInfoTypePtr DrillInfo)
-{
- DrillTypePtr drill = DrillInfo->Drill;
-
- /* realloc new memory if necessary and clear it */
- if (DrillInfo->DrillN >= DrillInfo->DrillMax) {
- DrillInfo->DrillMax += STEP_DRILL;
- drill = (DrillTypePtr) realloc(drill, DrillInfo->DrillMax * sizeof(DrillType));
- DrillInfo->Drill = drill;
- memset(drill + DrillInfo->DrillN, 0, STEP_DRILL * sizeof(DrillType));
- }
- return (drill + DrillInfo->DrillN++);
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by a polygon
- */
-void FreePolygonMemory(PolygonType * polygon)
-{
- if (polygon == NULL)
- return;
-
- free(polygon->Points);
- free(polygon->HoleIndex);
-
- if (polygon->Clipped)
- poly_Free(&polygon->Clipped);
- poly_FreeContours(&polygon->NoHoles);
-
- reset_obj_mem(PolygonType, polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by a box list
- */
-void FreeBoxListMemory(BoxListTypePtr Boxlist)
-{
- if (Boxlist) {
- free(Boxlist->Box);
- memset(Boxlist, 0, sizeof(BoxListType));
- }
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by a net
- */
-void FreeNetListMemory(NetListTypePtr Netlist)
-{
- if (Netlist) {
- NET_LOOP(Netlist);
- {
- FreeNetMemory(net);
- }
- END_LOOP;
- free(Netlist->Net);
- memset(Netlist, 0, sizeof(NetListType));
- }
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by a net list
- */
-void FreeNetListListMemory(NetListListTypePtr Netlistlist)
-{
- if (Netlistlist) {
- NETLIST_LOOP(Netlistlist);
- {
- FreeNetListMemory(netlist);
- }
- END_LOOP;
- free(Netlistlist->NetList);
- memset(Netlistlist, 0, sizeof(NetListListType));
- }
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by a subnet
- */
-void FreeNetMemory(NetTypePtr Net)
-{
- if (Net) {
- free(Net->Connection);
- memset(Net, 0, sizeof(NetType));
- }
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by an attribute list
- */
-static void FreeAttributeListMemory(AttributeListTypePtr list)
-{
- int i;
-
- for (i = 0; i < list->Number; i++) {
- free(list->List[i].name);
- free(list->List[i].value);
- }
- free(list->List);
- list->List = NULL;
- list->Max = 0;
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory used by an element
- */
-void FreeElementMemory(ElementType * element)
-{
- if (element == NULL)
- return;
-
- ELEMENTNAME_LOOP(element);
- {
- free(textstring);
- }
- END_LOOP;
- PIN_LOOP(element);
- {
- free(pin->Name);
- free(pin->Number);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- free(pad->Name);
- free(pad->Number);
- }
- END_LOOP;
-
- list_map0(&element->Pin, PinType, RemoveFreePin);
- list_map0(&element->Pad, PadType, RemoveFreePad);
- list_map0(&element->Line, LineType, RemoveFreeLine);
- list_map0(&element->Arc, ArcType, RemoveFreeArc);
-
- FreeAttributeListMemory(&element->Attributes);
- reset_obj_mem(ElementType, element);
-}
-
-/* ---------------------------------------------------------------------------
- * free memory used by PCB
- */
-void FreePCBMemory(PCBType * pcb)
-{
- int i;
-
- if (pcb == NULL)
- return;
-
- free(pcb->Name);
- free(pcb->Filename);
- free(pcb->PrintFilename);
- rats_patch_destroy(pcb);
- FreeDataMemory(pcb->Data);
- free(pcb->Data);
- /* release font symbols */
- for (i = 0; i <= MAX_FONTPOSITION; i++)
- free(pcb->Font.Symbol[i].Line);
- for (i = 0; i < NUM_NETLISTS; i++)
- FreeLibraryMemory(&(pcb->NetlistLib[i]));
- vtroutestyle_uninit(&pcb->RouteStyle);
- FreeAttributeListMemory(&pcb->Attributes);
- /* clear struct */
- memset(pcb, 0, sizeof(PCBType));
-}
-
-/* ---------------------------------------------------------------------------
- * free memory used by data struct
- */
-void FreeDataMemory(DataType * data)
-{
- LayerTypePtr layer;
- int i;
-
- if (data == NULL)
- return;
-
- VIA_LOOP(data);
- {
- free(via->Name);
- }
- END_LOOP;
- list_map0(&data->Via, PinType, RemoveFreeVia);
- ELEMENT_LOOP(data);
- {
- FreeElementMemory(element);
- }
- END_LOOP;
- list_map0(&data->Element, ElementType, RemoveFreeElement);
- list_map0(&data->Rat, RatType, RemoveFreeRat);
-
- for (layer = data->Layer, i = 0; i < MAX_LAYER + 2; layer++, i++) {
- FreeAttributeListMemory(&layer->Attributes);
- TEXT_LOOP(layer);
- {
- free(text->TextString);
- }
- END_LOOP;
- if (layer->Name)
- free((char*)layer->Name);
- LINE_LOOP(layer);
- {
- if (line->Number)
- free(line->Number);
- }
- END_LOOP;
-
- list_map0(&layer->Line, LineType, RemoveFreeLine);
- list_map0(&layer->Arc, ArcType, RemoveFreeArc);
- list_map0(&layer->Text, TextType, RemoveFreeText);
- POLYGON_LOOP(layer);
- {
- FreePolygonMemory(polygon);
- }
- END_LOOP;
- list_map0(&layer->Polygon, PolygonType, RemoveFreePolygon);
- if (layer->line_tree)
- r_destroy_tree(&layer->line_tree);
- if (layer->arc_tree)
- r_destroy_tree(&layer->arc_tree);
- if (layer->text_tree)
- r_destroy_tree(&layer->text_tree);
- if (layer->polygon_tree)
- r_destroy_tree(&layer->polygon_tree);
- }
-
- if (data->element_tree)
- r_destroy_tree(&data->element_tree);
- for (i = 0; i < MAX_ELEMENTNAMES; i++)
- if (data->name_tree[i])
- r_destroy_tree(&data->name_tree[i]);
- if (data->via_tree)
- r_destroy_tree(&data->via_tree);
- if (data->pin_tree)
- r_destroy_tree(&data->pin_tree);
- if (data->pad_tree)
- r_destroy_tree(&data->pad_tree);
- if (data->rat_tree)
- r_destroy_tree(&data->rat_tree);
- /* clear struct */
- memset(data, 0, sizeof(DataType));
-}
-
-/* ---------------------------------------------------------------------------
- * releases the memory that's allocated by the library
- */
-void FreeLibraryMemory(LibraryTypePtr lib)
-{
- MENU_LOOP(lib);
- {
- ENTRY_LOOP(menu);
- {
- if (!entry->ListEntry_dontfree)
- free((char*)entry->ListEntry);
- }
- END_LOOP;
- free(menu->Entry);
- free(menu->Name);
- free(menu->directory);
- }
- END_LOOP;
- free(lib->Menu);
-
- /* clear struct */
- memset(lib, 0, sizeof(LibraryType));
-}
-
-/* ---------------------------------------------------------------------------
- * strips leading and trailing blanks from the passed string and
- * returns a pointer to the new 'duped' one or NULL if the old one
- * holds only white space characters
- */
-char *StripWhiteSpaceAndDup(const char *S)
-{
- const char *p1, *p2;
- char *copy;
- size_t length;
-
- if (!S || !*S)
- return (NULL);
-
- /* strip leading blanks */
- for (p1 = S; *p1 && isspace((int) *p1); p1++);
-
- /* strip trailing blanks and get string length */
- length = strlen(p1);
- for (p2 = p1 + length - 1; length && isspace((int) *p2); p2--, length--);
-
- /* string is not empty -> allocate memory */
- if (length) {
- copy = (char *) realloc(NULL, length + 1);
- strncpy(copy, p1, length);
- copy[length] = '\0';
- return (copy);
- }
- else
- return (NULL);
-}
-
-LineType *GetElementLineMemory(ElementType *Element)
-{
- LineType *line = calloc(sizeof(LineType), 1);
- linelist_append(&Element->Line, line);
-
- return line;
-}
-
-ArcType *GetElementArcMemory(ElementType *Element)
-{
- ArcType *arc = calloc(sizeof(ArcType), 1);
-
- arclist_append(&Element->Arc, arc);
- return arc;
-}
diff --git a/src/mymem.h b/src/mymem.h
deleted file mode 100644
index 49a9ff3..0000000
--- a/src/mymem.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for memory routines
- */
-
-#ifndef PCB_MYMEM_H
-#define PCB_MYMEM_H
-
-#include "config.h"
-
-#include <stdlib.h>
-#include "global.h"
-
-/* ---------------------------------------------------------------------------
- * number of additional objects that are allocated with one system call
- */
-#define STEP_ELEMENT 50
-#define STEP_DRILL 30
-#define STEP_POINT 100
-#define STEP_SYMBOLLINE 10
-#define STEP_SELECTORENTRY 128
-#define STEP_REMOVELIST 500
-#define STEP_UNDOLIST 500
-#define STEP_POLYGONPOINT 10
-#define STEP_POLYGONHOLEINDEX 10
-#define STEP_LIBRARYMENU 10
-#define STEP_LIBRARYENTRY 20
-#define STEP_RUBBERBAND 100
-
-/* ---------------------------------------------------------------------------
- * some memory types
- */
-
-RubberbandTypePtr GetRubberbandMemory(void);
-PinTypePtr GetPinMemory(ElementTypePtr);
-PadTypePtr GetPadMemory(ElementTypePtr);
-PinTypePtr GetViaMemory(DataTypePtr);
-LineTypePtr GetLineMemory(LayerTypePtr);
-ArcTypePtr GetArcMemory(LayerTypePtr);
-RatTypePtr GetRatMemory(DataTypePtr);
-TextTypePtr GetTextMemory(LayerTypePtr);
-PolygonTypePtr GetPolygonMemory(LayerTypePtr);
-PointTypePtr GetPointMemoryInPolygon(PolygonTypePtr);
-pcb_cardinal_t *GetHoleIndexMemoryInPolygon(PolygonTypePtr);
-ElementTypePtr GetElementMemory(DataTypePtr);
-BoxTypePtr GetBoxMemory(BoxListTypePtr);
-ConnectionTypePtr GetConnectionMemory(NetTypePtr);
-NetTypePtr GetNetMemory(NetListTypePtr);
-NetListTypePtr GetNetListMemory(NetListListTypePtr);
-LibraryMenuTypePtr GetLibraryMenuMemory(LibraryTypePtr, int *idx);
-LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
-ElementTypeHandle GetDrillElementMemory(DrillTypePtr);
-PinTypeHandle GetDrillPinMemory(DrillTypePtr);
-DrillTypePtr GetDrillInfoDrillMemory(DrillInfoTypePtr);
-void **GetPointerMemory(PointerListTypePtr);
-void FreePolygonMemory(PolygonTypePtr);
-void FreeElementMemory(ElementTypePtr);
-void FreePCBMemory(PCBTypePtr);
-void FreeBoxListMemory(BoxListTypePtr);
-void FreeNetListListMemory(NetListListTypePtr);
-void FreeNetListMemory(NetListTypePtr);
-void FreeNetMemory(NetTypePtr);
-void FreeDataMemory(DataTypePtr);
-void FreeLibraryMemory(LibraryTypePtr);
-void FreePointerListMemory(PointerListTypePtr);
-void DeleteLibraryMenuMemory(LibraryTypePtr lib, int menuidx);
-char *StripWhiteSpaceAndDup(const char *);
-
-void RemoveFreeArc(ArcType * data);
-void RemoveFreeLine(LineType * data);
-void RemoveFreeText(TextType * data);
-void RemoveFreePolygon(PolygonType * data);
-void RemoveFreePin(PinType * data);
-void RemoveFreePad(PadType * data);
-void RemoveFreeVia(PinType * data);
-void RemoveFreeElement(ElementType * data);
-void RemoveFreeRat(RatType * data);
-
-/* Allocate element-objects */
-LineType *GetElementLineMemory(ElementType *Element);
-ArcType *GetElementArcMemory(ElementType *Element);
-
-#ifndef HAVE_LIBDMALLOC
-#define malloc(x) calloc(1,(x))
-#endif
-
-#endif
diff --git a/src/netlist.c b/src/netlist.c
index 0d4a3c1..87e4671 100644
--- a/src/netlist.c
+++ b/src/netlist.c
@@ -31,21 +31,18 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
-#include <genregex/regex_sei.h>
-#include "action_helper.h"
-#include "data.h"
+#include "board.h"
#include "error.h"
#include "plug_io.h"
#include "find.h"
-#include "mymem.h"
#include "rats.h"
-#include "create.h"
-#include "rats_patch.h"
#include "hid_actions.h"
#include "compat_misc.h"
#include "netlist.h"
+#include "event.h"
+
+#define STEP_POINT 100
/*
int PCB->NetlistLib[n].MenuN
@@ -66,26 +63,26 @@ void pcb_netlist_changed(int force_unfreeze)
PCB->netlist_needs_update = 1;
else {
PCB->netlist_needs_update = 0;
- hid_action("NetlistChanged");
+ pcb_event(PCB_EVENT_NETLIST_CHANGED, NULL);
}
}
-LibraryMenuTypePtr pcb_netnode_to_netname(const char *nodename)
+pcb_lib_menu_t *pcb_netnode_to_netname(const char *nodename)
{
int i, j;
/*printf("nodename [%s]\n", nodename); */
- for (i = 0; i < PCB->NetlistLib[NETLIST_EDITED].MenuN; i++) {
- for (j = 0; j < PCB->NetlistLib[NETLIST_EDITED].Menu[i].EntryN; j++) {
- if (strcmp(PCB->NetlistLib[NETLIST_EDITED].Menu[i].Entry[j].ListEntry, nodename) == 0) {
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; i++) {
+ for (j = 0; j < PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i].EntryN; j++) {
+ if (strcmp(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i].Entry[j].ListEntry, nodename) == 0) {
/*printf(" in [%s]\n", PCB->NetlistLib.Menu[i].Name); */
- return &(PCB->NetlistLib[NETLIST_EDITED].Menu[i]);
+ return &(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i]);
}
}
}
return 0;
}
-LibraryMenuTypePtr pcb_netname_to_netname(const char *netname)
+pcb_lib_menu_t *pcb_netname_to_netname(const char *netname)
{
int i;
@@ -93,56 +90,56 @@ LibraryMenuTypePtr pcb_netname_to_netname(const char *netname)
/* Looks like we were passed an internal netname, skip the prefix */
netname += 2;
}
- for (i = 0; i < PCB->NetlistLib[NETLIST_EDITED].MenuN; i++) {
- if (strcmp(PCB->NetlistLib[NETLIST_EDITED].Menu[i].Name + 2, netname) == 0) {
- return &(PCB->NetlistLib[NETLIST_EDITED].Menu[i]);
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; i++) {
+ if (strcmp(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i].Name + 2, netname) == 0) {
+ return &(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i]);
}
}
return 0;
}
-int pcb_pin_name_to_xy(LibraryEntryType * pin, Coord *x, Coord *y)
+int pcb_pin_name_to_xy(pcb_lib_entry_t * pin, pcb_coord_t *x, pcb_coord_t *y)
{
- ConnectionType conn;
- if (!SeekPad(pin, &conn, pcb_false))
+ pcb_connection_t conn;
+ if (!pcb_rat_seek_pad(pin, &conn, pcb_false))
return 1;
switch (conn.type) {
case PCB_TYPE_PIN:
- *x = ((PinType *) (conn.ptr2))->X;
- *y = ((PinType *) (conn.ptr2))->Y;
+ *x = ((pcb_pin_t *) (conn.ptr2))->X;
+ *y = ((pcb_pin_t *) (conn.ptr2))->Y;
return 0;
case PCB_TYPE_PAD:
- *x = ((PadType *) (conn.ptr2))->Point1.X;
- *y = ((PadType *) (conn.ptr2))->Point1.Y;
+ *x = ((pcb_pad_t *) (conn.ptr2))->Point1.X;
+ *y = ((pcb_pad_t *) (conn.ptr2))->Point1.Y;
return 0;
}
return 1;
}
-void pcb_netlist_find(LibraryMenuType * net, LibraryEntryType * pin)
+void pcb_netlist_find(pcb_lib_menu_t * net, pcb_lib_entry_t * pin)
{
- Coord x, y;
+ pcb_coord_t x, y;
if (pcb_pin_name_to_xy(net->Entry, &x, &y))
return;
- LookupConnection(x, y, 1, 1, PCB_FLAG_FOUND);
+ pcb_lookup_conn(x, y, 1, 1, PCB_FLAG_FOUND);
}
-void pcb_netlist_select(LibraryMenuType * net, LibraryEntryType * pin)
+void pcb_netlist_select(pcb_lib_menu_t * net, pcb_lib_entry_t * pin)
{
- Coord x, y;
+ pcb_coord_t x, y;
if (pcb_pin_name_to_xy(net->Entry, &x, &y))
return;
- LookupConnection(x, y, 1, 1, PCB_FLAG_SELECTED);
+ pcb_lookup_conn(x, y, 1, 1, PCB_FLAG_SELECTED);
}
-void pcb_netlist_rats(LibraryMenuType * net, LibraryEntryType * pin)
+void pcb_netlist_rats(pcb_lib_menu_t * net, pcb_lib_entry_t * pin)
{
net->Name[0] = ' ';
net->flag = 1;
pcb_netlist_changed(0);
}
-void pcb_netlist_norats(LibraryMenuType * net, LibraryEntryType * pin)
+void pcb_netlist_norats(pcb_lib_menu_t * net, pcb_lib_entry_t * pin)
{
net->Name[0] = '*';
net->flag = 0;
@@ -152,15 +149,15 @@ void pcb_netlist_norats(LibraryMenuType * net, LibraryEntryType * pin)
/* The primary purpose of this action is to remove the netlist
completely so that a new one can be loaded, usually via a gsch2pcb
style script. */
-void pcb_netlist_clear(LibraryMenuType * net, LibraryEntryType * pin)
+void pcb_netlist_clear(pcb_lib_menu_t * net, pcb_lib_entry_t * pin)
{
- LibraryType *netlist = (LibraryType *) & PCB->NetlistLib;
+ pcb_lib_t *netlist = (pcb_lib_t *) & PCB->NetlistLib;
int ni, pi;
if (net == 0) {
/* Clear the entire netlist. */
- for (ni = 0; ni < NUM_NETLISTS; ni++)
- FreeLibraryMemory(&(PCB->NetlistLib[ni]));
+ for (ni = 0; ni < PCB_NUM_NETLISTS; ni++)
+ pcb_lib_free(&(PCB->NetlistLib[ni]));
}
else if (pin == 0) {
/* Remove a net from the netlist. */
@@ -187,21 +184,21 @@ void pcb_netlist_clear(LibraryMenuType * net, LibraryEntryType * pin)
pcb_netlist_changed(0);
}
-void pcb_netlist_style(LibraryMenuType * net, const char *style)
+void pcb_netlist_style(pcb_lib_menu_t * net, const char *style)
{
free(net->Style);
net->Style = pcb_strdup_null((char *) style);
}
-LibraryMenuTypePtr pcb_netlist_find_net4pinname(PCBTypePtr pcb, const char *pin)
+pcb_lib_menu_t *pcb_netlist_find_net4pinname(pcb_board_t *pcb, const char *pin)
{
int n;
- for (n = 0; n < pcb->NetlistLib[NETLIST_EDITED].MenuN; n++) {
- LibraryMenuTypePtr menu = &pcb->NetlistLib[NETLIST_EDITED].Menu[n];
+ for (n = 0; n < pcb->NetlistLib[PCB_NETLIST_EDITED].MenuN; n++) {
+ pcb_lib_menu_t *menu = &pcb->NetlistLib[PCB_NETLIST_EDITED].Menu[n];
int p;
for (p = 0; p < menu->EntryN; p++) {
- LibraryEntryTypePtr entry = &menu->Entry[p];
+ pcb_lib_entry_t *entry = &menu->Entry[p];
if (strcmp(entry->ListEntry, pin) == 0)
return menu;
}
@@ -209,7 +206,7 @@ LibraryMenuTypePtr pcb_netlist_find_net4pinname(PCBTypePtr pcb, const char *pin)
return NULL;
}
-static LibraryMenuTypePtr pcb_netlist_find_net4pin_any(PCBTypePtr pcb, const char *ename, const char *pname)
+static pcb_lib_menu_t *pcb_netlist_find_net4pin_any(pcb_board_t *pcb, const char *ename, const char *pname)
{
char pinname[256];
int len;
@@ -224,34 +221,111 @@ static LibraryMenuTypePtr pcb_netlist_find_net4pin_any(PCBTypePtr pcb, const cha
return pcb_netlist_find_net4pinname(pcb, pinname);
}
-LibraryMenuTypePtr pcb_netlist_find_net4pin(PCBTypePtr pcb, const PinType *pin)
+pcb_lib_menu_t *pcb_netlist_find_net4pin(pcb_board_t *pcb, const pcb_pin_t *pin)
{
- const ElementType *e = pin->Element;
+ const pcb_element_t *e = pin->Element;
if (e == NULL)
return NULL;
- return pcb_netlist_find_net4pin_any(pcb, e->Name[NAMEONPCB_INDEX].TextString, pin->Number);
+ return pcb_netlist_find_net4pin_any(pcb, e->Name[PCB_ELEMNAME_IDX_REFDES].TextString, pin->Number);
}
-LibraryMenuTypePtr pcb_netlist_find_net4pad(PCBTypePtr pcb, const PadType *pad)
+pcb_lib_menu_t *pcb_netlist_find_net4pad(pcb_board_t *pcb, const pcb_pad_t *pad)
{
- const ElementType *e = pad->Element;
+ const pcb_element_t *e = pad->Element;
if (e == NULL)
return NULL;
- return pcb_netlist_find_net4pin_any(pcb, e->Name[NAMEONPCB_INDEX].TextString, pad->Number);
+ return pcb_netlist_find_net4pin_any(pcb, e->Name[PCB_ELEMNAME_IDX_REFDES].TextString, pad->Number);
}
-pcb_cardinal_t pcb_netlist_net_idx(PCBTypePtr pcb, LibraryMenuType *net)
+pcb_cardinal_t pcb_netlist_net_idx(pcb_board_t *pcb, pcb_lib_menu_t *net)
{
- LibraryMenuType *first = &pcb->NetlistLib[NETLIST_EDITED].Menu[0];
- LibraryMenuType *last = &pcb->NetlistLib[NETLIST_EDITED].Menu[pcb->NetlistLib[NETLIST_EDITED].MenuN-1];
+ pcb_lib_menu_t *first = &pcb->NetlistLib[PCB_NETLIST_EDITED].Menu[0];
+ pcb_lib_menu_t *last = &pcb->NetlistLib[PCB_NETLIST_EDITED].Menu[pcb->NetlistLib[PCB_NETLIST_EDITED].MenuN-1];
if ((net < first) || (net > last))
return PCB_NETLIST_INVALID_INDEX;
return net - first;
}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a subnet, allocates memory if necessary
+ */
+pcb_net_t *pcb_net_new(pcb_netlist_t *Netlist)
+{
+ pcb_net_t *net = Netlist->Net;
+
+ /* realloc new memory if necessary and clear it */
+ if (Netlist->NetN >= Netlist->NetMax) {
+ Netlist->NetMax += STEP_POINT;
+ net = (pcb_net_t *) realloc(net, Netlist->NetMax * sizeof(pcb_net_t));
+ Netlist->Net = net;
+ memset(net + Netlist->NetN, 0, STEP_POINT * sizeof(pcb_net_t));
+ }
+ return (net + Netlist->NetN++);
+}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a net list, allocates memory if necessary
+ */
+pcb_netlist_t *pcb_netlist_new(pcb_netlist_list_t *Netlistlist)
+{
+ pcb_netlist_t *netlist = Netlistlist->NetList;
+
+ /* realloc new memory if necessary and clear it */
+ if (Netlistlist->NetListN >= Netlistlist->NetListMax) {
+ Netlistlist->NetListMax += STEP_POINT;
+ netlist = (pcb_netlist_t *) realloc(netlist, Netlistlist->NetListMax * sizeof(pcb_netlist_t));
+ Netlistlist->NetList = netlist;
+ memset(netlist + Netlistlist->NetListN, 0, STEP_POINT * sizeof(pcb_netlist_t));
+ }
+ return (netlist + Netlistlist->NetListN++);
+}
+
+/* ---------------------------------------------------------------------------
+ * frees memory used by a net
+ */
+void pcb_netlist_free(pcb_netlist_t *Netlist)
+{
+ if (Netlist) {
+ PCB_NET_LOOP(Netlist);
+ {
+ pcb_net_free(net);
+ }
+ PCB_END_LOOP;
+ free(Netlist->Net);
+ memset(Netlist, 0, sizeof(pcb_netlist_t));
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * frees memory used by a net list
+ */
+void pcb_netlist_list_free(pcb_netlist_list_t *Netlistlist)
+{
+ if (Netlistlist) {
+ PCB_NETLIST_LOOP(Netlistlist);
+ {
+ pcb_netlist_free(netlist);
+ }
+ PCB_END_LOOP;
+ free(Netlistlist->NetList);
+ memset(Netlistlist, 0, sizeof(pcb_netlist_list_t));
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * frees memory used by a subnet
+ */
+void pcb_net_free(pcb_net_t *Net)
+{
+ if (Net) {
+ free(Net->Connection);
+ memset(Net, 0, sizeof(pcb_net_t));
+ }
+}
diff --git a/src/netlist.h b/src/netlist.h
index c473435..d4a9b70 100644
--- a/src/netlist.h
+++ b/src/netlist.h
@@ -24,40 +24,88 @@
*
*/
+#ifndef PCB_NETLIST_H
+#define PCB_NETLIST_H
+
/* generic netlist operations */
-#include "global.h"
+#include "config.h"
+#include "library.h"
+#include "route_style.h"
+
+struct pcb_net_s { /* holds a net of connections */
+ pcb_cardinal_t ConnectionN, /* the number of connections contained */
+ ConnectionMax; /* max connections from malloc */
+ pcb_connection_t *Connection;
+ pcb_route_style_t *Style;
+};
+
+typedef struct { /* holds a list of nets */
+ pcb_cardinal_t NetN, /* the number of subnets contained */
+ NetMax; /* max subnets from malloc */
+ pcb_net_t *Net;
+} pcb_netlist_t;
+
+typedef struct { /* holds a list of net lists */
+ pcb_cardinal_t NetListN, /* the number of net lists contained */
+ NetListMax; /* max net lists from malloc */
+ pcb_netlist_t *NetList;
+} pcb_netlist_list_t;
+
void pcb_netlist_changed(int force_unfreeze);
-LibraryMenuTypePtr pcb_netnode_to_netname(const char *nodename);
-LibraryMenuTypePtr pcb_netname_to_netname(const char *netname);
+pcb_lib_menu_t *pcb_netnode_to_netname(const char *nodename);
+pcb_lib_menu_t *pcb_netname_to_netname(const char *netname);
-int pcb_pin_name_to_xy(LibraryEntryType *pin, Coord *x, Coord *y);
-void pcb_netlist_find(LibraryMenuType *net, LibraryEntryType *pin);
-void pcb_netlist_select(LibraryMenuType *net, LibraryEntryType *pin);
-void pcb_netlist_rats(LibraryMenuType *net, LibraryEntryType *pin);
-void pcb_netlist_norats(LibraryMenuType *net, LibraryEntryType *pin);
-void pcb_netlist_clear(LibraryMenuType *net, LibraryEntryType *pin);
-void pcb_netlist_style(LibraryMenuType *net, const char *style);
+int pcb_pin_name_to_xy(pcb_lib_entry_t *pin, pcb_coord_t *x, pcb_coord_t *y);
+void pcb_netlist_find(pcb_lib_menu_t *net, pcb_lib_entry_t *pin);
+void pcb_netlist_select(pcb_lib_menu_t *net, pcb_lib_entry_t *pin);
+void pcb_netlist_rats(pcb_lib_menu_t *net, pcb_lib_entry_t *pin);
+void pcb_netlist_norats(pcb_lib_menu_t *net, pcb_lib_entry_t *pin);
+void pcb_netlist_clear(pcb_lib_menu_t *net, pcb_lib_entry_t *pin);
+void pcb_netlist_style(pcb_lib_menu_t *net, const char *style);
/* Return the net entry for a pin name (slow search). The pin name is
like "U101-5", so element's refdes, dash, pin number */
-LibraryMenuTypePtr pcb_netlist_find_net4pinname(PCBTypePtr pcb, const char *pinname);
+pcb_lib_menu_t *pcb_netlist_find_net4pinname(pcb_board_t *pcb, const char *pinname);
/* Same as pcb_netlist_find_net4pinname but with pin pointer */
-LibraryMenuTypePtr pcb_netlist_find_net4pin(PCBTypePtr pcb, const PinType *pin);
-LibraryMenuTypePtr pcb_netlist_find_net4pad(PCBTypePtr pcb, const PadType *pad);
+pcb_lib_menu_t *pcb_netlist_find_net4pin(pcb_board_t *pcb, const pcb_pin_t *pin);
+pcb_lib_menu_t *pcb_netlist_find_net4pad(pcb_board_t *pcb, const pcb_pad_t *pad);
-/* Evaluate to const char * name of the network; lmt is (LibraryMenuType *) */
+/* Evaluate to const char * name of the network; lmt is (pcb_lib_menu_t *) */
#define pcb_netlist_name(lmt) ((const char *)((lmt)->Name+2))
-/* Evaluate to 0 or 1 depending on whether the net is marked with *; lmt is (LibraryMenuType *) */
+/* Evaluate to 0 or 1 depending on whether the net is marked with *; lmt is (pcb_lib_menu_t *) */
#define pcb_netlist_is_bad(lmt) (((lmt)->Name[0]) == '*')
/* Return the index of the net or PCB_NETLIST_INVALID_INDEX if the net is not
on the netlist. NOTE: indices returned are valid only until the first
netlist change! */
-pcb_cardinal_t pcb_netlist_net_idx(PCBTypePtr pcb, LibraryMenuType *net);
+pcb_cardinal_t pcb_netlist_net_idx(pcb_board_t *pcb, pcb_lib_menu_t *net);
#define PCB_NETLIST_INVALID_INDEX ((pcb_cardinal_t)(-1))
+
+pcb_net_t *pcb_net_new(pcb_netlist_t *);
+pcb_netlist_t *pcb_netlist_new(pcb_netlist_list_t *);
+void pcb_netlist_list_free(pcb_netlist_list_t *);
+void pcb_netlist_free(pcb_netlist_t *);
+void pcb_net_free(pcb_net_t *);
+
+#define PCB_NETLIST_LOOP(top) do { \
+ pcb_cardinal_t n; \
+ pcb_netlist_t * netlist; \
+ for (n = (top)->NetListN-1; n != -1; n--) \
+ { \
+ netlist = &(top)->NetList[n]
+
+#define PCB_NET_LOOP(top) do { \
+ pcb_cardinal_t n; \
+ pcb_net_t * net; \
+ for (n = (top)->NetN-1; n != -1; n--) \
+ { \
+ net = &(top)->Net[n]
+
+
+#endif
diff --git a/src/netlist_act.c b/src/netlist_act.c
index 991d50d..2c8b700 100644
--- a/src/netlist_act.c
+++ b/src/netlist_act.c
@@ -36,14 +36,11 @@
#include "action_helper.h"
#include "data.h"
+#include "board.h"
#include "error.h"
#include "plug_io.h"
-#include "find.h"
-#include "mymem.h"
-#include "rats.h"
-#include "create.h"
-#include "rats_patch.h"
#include "hid_actions.h"
+#include "compat_nls.h"
#include "compat_misc.h"
#include "netlist.h"
@@ -52,17 +49,17 @@ static int pcb_netlist_swap()
char *pins[3] = { NULL, NULL, NULL };
int next = 0, n;
int ret = -1;
- LibraryMenuTypePtr nets[2];
+ pcb_lib_menu_t *nets[2];
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pin)) {
int le, lp;
if (next > 2) {
- Message(PCB_MSG_DEFAULT, "Exactly two pins should be selected for swap (more than 2 selected at the moment)\n");
+ pcb_message(PCB_MSG_ERROR, "Exactly two pins should be selected for swap (more than 2 selected at the moment)\n");
goto quit;
}
@@ -73,12 +70,12 @@ static int pcb_netlist_swap()
next++;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
if (next < 2) {
- Message(PCB_MSG_DEFAULT, "Exactly two pins should be selected for swap (less than 2 selected at the moment)\n");
+ pcb_message(PCB_MSG_ERROR, "Exactly two pins should be selected for swap (less than 2 selected at the moment)\n");
goto quit;
}
@@ -86,22 +83,22 @@ static int pcb_netlist_swap()
nets[0] = pcb_netlist_find_net4pinname(PCB, pins[0]);
nets[1] = pcb_netlist_find_net4pinname(PCB, pins[1]);
if ((nets[0] == NULL) || (nets[1] == NULL)) {
- Message(PCB_MSG_DEFAULT, "That pin is not on a net.\n");
+ pcb_message(PCB_MSG_ERROR, "That pin is not on a net.\n");
goto quit;
}
if (nets[0] == nets[1]) {
- Message(PCB_MSG_DEFAULT, "Those two pins are on the same net, can't swap them.\n");
+ pcb_message(PCB_MSG_ERROR, "Those two pins are on the same net, can't swap them.\n");
goto quit;
}
- rats_patch_append_optimize(PCB, RATP_DEL_CONN, pins[0], nets[0]->Name + 2, NULL);
- rats_patch_append_optimize(PCB, RATP_DEL_CONN, pins[1], nets[1]->Name + 2, NULL);
- rats_patch_append_optimize(PCB, RATP_ADD_CONN, pins[0], nets[1]->Name + 2, NULL);
- rats_patch_append_optimize(PCB, RATP_ADD_CONN, pins[1], nets[0]->Name + 2, NULL);
+ pcb_ratspatch_append_optimize(PCB, RATP_DEL_CONN, pins[0], nets[0]->Name + 2, NULL);
+ pcb_ratspatch_append_optimize(PCB, RATP_DEL_CONN, pins[1], nets[1]->Name + 2, NULL);
+ pcb_ratspatch_append_optimize(PCB, RATP_ADD_CONN, pins[0], nets[1]->Name + 2, NULL);
+ pcb_ratspatch_append_optimize(PCB, RATP_ADD_CONN, pins[1], nets[0]->Name + 2, NULL);
/* TODO: not very efficient to regenerate the whole list... */
- rats_patch_make_edited(PCB);
+ pcb_ratspatch_make_edited(PCB);
ret = 0;
quit:;
@@ -117,9 +114,9 @@ quit:;
static int pcb_netlist_add(int patch, const char *netname, const char *pinname)
{
int ni, pi;
- LibraryType *netlist = patch ? &PCB->NetlistLib[NETLIST_EDITED] : &PCB->NetlistLib[NETLIST_INPUT];
- LibraryMenuType *net = NULL;
- LibraryEntryType *pin = NULL;
+ pcb_lib_t *netlist = patch ? &PCB->NetlistLib[PCB_NETLIST_EDITED] : &PCB->NetlistLib[PCB_NETLIST_INPUT];
+ pcb_lib_menu_t *net = NULL;
+ pcb_lib_entry_t *pin = NULL;
for (ni = 0; ni < netlist->MenuN; ni++) {
if (strcmp(netlist->Menu[ni].Name + 2, netname) == 0) {
@@ -131,14 +128,13 @@ static int pcb_netlist_add(int patch, const char *netname, const char *pinname)
if (net == NULL) {
if (!patch) {
- net = CreateNewNet(netlist, (char *) netname, NULL);
+ net = pcb_lib_menu_new(netlist, NULL);
net->Name = pcb_strdup_printf(" %s", netname);
net->flag = 1;
PCB->netlist_needs_update=1;
}
- else {
- abort(); /* applying this to net patch is not supported until 1.2.0 */
- }
+ else
+ net = pcb_lib_net_new(netlist, (char *) netname, NULL);
}
for (pi = 0; pi < net->EntryN; pi++) {
@@ -151,13 +147,14 @@ static int pcb_netlist_add(int patch, const char *netname, const char *pinname)
if (pin == NULL) {
if (!patch) {
- LibraryEntryType *entry = GetLibraryEntryMemory(net);
+ pcb_lib_entry_t *entry = pcb_lib_entry_new(net);
entry->ListEntry = pcb_strdup_printf("%s", pinname);
entry->ListEntry_dontfree = 0;
PCB->netlist_needs_update=1;
}
else {
- abort(); /* applying this to net patch is not supported until 1.2.0 */
+ pin = pcb_lib_conn_new(net, (char *) pinname);
+ pcb_ratspatch_append_optimize(PCB, RATP_ADD_CONN, pin->ListEntry, net->Name + 2, NULL);
}
}
@@ -165,10 +162,10 @@ static int pcb_netlist_add(int patch, const char *netname, const char *pinname)
return 0;
}
-static const char netlist_syntax[] =
+static const char pcb_acts_Netlist[] =
"Net(find|select|rats|norats|clear[,net[,pin]])\n" "Net(freeze|thaw|forcethaw)\n" "Net(swap)\n" "Net(add,net,pin)";
-static const char netlist_help[] = "Perform various actions on netlists.";
+static const char pcb_acth_Netlist[] = "Perform various actions on netlists.";
/* %start-doc actions Netlist
@@ -225,14 +222,14 @@ updates the GUI.
%end-doc */
-typedef void (*NFunc) (LibraryMenuType *, LibraryEntryType *);
+typedef void (*NFunc) (pcb_lib_menu_t *, pcb_lib_entry_t *);
-static int ActionNetlist(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Netlist(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
NFunc func;
int i, j;
- LibraryMenuType *net;
- LibraryEntryType *pin;
+ pcb_lib_menu_t *net;
+ pcb_lib_entry_t *pin;
int net_found = 0;
int pin_found = 0;
int use_re = 0;
@@ -241,42 +238,42 @@ static int ActionNetlist(int argc, const char **argv, Coord x, Coord y)
if (!PCB)
return 1;
if (argc == 0) {
- Message(PCB_MSG_DEFAULT, netlist_syntax);
+ pcb_message(PCB_MSG_ERROR, pcb_acts_Netlist);
return 1;
}
- if (strcasecmp(argv[0], "find") == 0)
+ if (pcb_strcasecmp(argv[0], "find") == 0)
func = pcb_netlist_find;
- else if (strcasecmp(argv[0], "select") == 0)
+ else if (pcb_strcasecmp(argv[0], "select") == 0)
func = pcb_netlist_select;
- else if (strcasecmp(argv[0], "rats") == 0)
+ else if (pcb_strcasecmp(argv[0], "rats") == 0)
func = pcb_netlist_rats;
- else if (strcasecmp(argv[0], "norats") == 0)
+ else if (pcb_strcasecmp(argv[0], "norats") == 0)
func = pcb_netlist_norats;
- else if (strcasecmp(argv[0], "clear") == 0) {
+ else if (pcb_strcasecmp(argv[0], "clear") == 0) {
func = pcb_netlist_clear;
if (argc == 1) {
pcb_netlist_clear(NULL, NULL);
return 0;
}
}
- else if (strcasecmp(argv[0], "style") == 0)
+ else if (pcb_strcasecmp(argv[0], "style") == 0)
func = (NFunc) pcb_netlist_style;
- else if (strcasecmp(argv[0], "swap") == 0)
+ else if (pcb_strcasecmp(argv[0], "swap") == 0)
return pcb_netlist_swap();
- else if (strcasecmp(argv[0], "add") == 0) {
+ else if (pcb_strcasecmp(argv[0], "add") == 0) {
/* Add is different, because the net/pin won't already exist. */
- return pcb_netlist_add(0, ACTION_ARG(1), ACTION_ARG(2));
+ return pcb_netlist_add(0, PCB_ACTION_ARG(1), PCB_ACTION_ARG(2));
}
- else if (strcasecmp(argv[0], "sort") == 0) {
+ else if (pcb_strcasecmp(argv[0], "sort") == 0) {
pcb_sort_netlist();
- rats_patch_make_edited(PCB);
+ pcb_ratspatch_make_edited(PCB);
return 0;
}
- else if (strcasecmp(argv[0], "freeze") == 0) {
+ else if (pcb_strcasecmp(argv[0], "freeze") == 0) {
PCB->netlist_frozen++;
return 0;
}
- else if (strcasecmp(argv[0], "thaw") == 0) {
+ else if (pcb_strcasecmp(argv[0], "thaw") == 0) {
if (PCB->netlist_frozen > 0) {
PCB->netlist_frozen--;
if (PCB->netlist_needs_update)
@@ -284,45 +281,45 @@ static int ActionNetlist(int argc, const char **argv, Coord x, Coord y)
}
return 0;
}
- else if (strcasecmp(argv[0], "forcethaw") == 0) {
+ else if (pcb_strcasecmp(argv[0], "forcethaw") == 0) {
PCB->netlist_frozen = 0;
if (PCB->netlist_needs_update)
pcb_netlist_changed(0);
return 0;
}
else {
- Message(PCB_MSG_DEFAULT, netlist_syntax);
+ pcb_message(PCB_MSG_ERROR, pcb_acts_Netlist);
return 1;
}
if (argc > 1) {
use_re = 1;
- for (i = 0; i < PCB->NetlistLib[NETLIST_INPUT].MenuN; i++) {
- net = PCB->NetlistLib[NETLIST_INPUT].Menu + i;
- if (strcasecmp(argv[1], net->Name + 2) == 0)
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_INPUT].MenuN; i++) {
+ net = PCB->NetlistLib[PCB_NETLIST_INPUT].Menu + i;
+ if (pcb_strcasecmp(argv[1], net->Name + 2) == 0)
use_re = 0;
}
if (use_re) {
regex = re_sei_comp(argv[1]);
if (re_sei_errno(regex) != 0) {
- Message(PCB_MSG_DEFAULT, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
+ pcb_message(PCB_MSG_ERROR, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
re_sei_free(regex);
return (1);
}
}
}
-
/* This code is for changing the netlist style */
- for (i = PCB->NetlistLib[NETLIST_INPUT].MenuN - 1; i >= 0; i--) {
- net = PCB->NetlistLib[NETLIST_INPUT].Menu + i;
+ for (i = PCB->NetlistLib[PCB_NETLIST_INPUT].MenuN - 1; i >= 0; i--) {
+ net = PCB->NetlistLib[PCB_NETLIST_INPUT].Menu + i;
+
if (argc > 1) {
if (use_re) {
if (re_sei_exec(regex, net->Name + 2) == 0)
continue;
}
else {
- if (strcasecmp(net->Name + 2, argv[1]))
+ if (pcb_strcasecmp(net->Name + 2, argv[1]))
continue;
}
}
@@ -330,13 +327,13 @@ static int ActionNetlist(int argc, const char **argv, Coord x, Coord y)
pin = 0;
if (func == (NFunc) pcb_netlist_style) {
- pcb_netlist_style(net, ACTION_ARG(2));
+ pcb_netlist_style(net, PCB_ACTION_ARG(2));
}
else if (argc > 2) {
int l = strlen(argv[2]);
for (j = net->EntryN - 1; j >= 0; j--)
- if (strcasecmp(net->Entry[j].ListEntry, argv[2]) == 0
- || (strncasecmp(net->Entry[j].ListEntry, argv[2], l) == 0 && net->Entry[j].ListEntry[l] == '-')) {
+ if (pcb_strcasecmp(net->Entry[j].ListEntry, argv[2]) == 0
+ || (pcb_strncasecmp(net->Entry[j].ListEntry, argv[2], l) == 0 && net->Entry[j].ListEntry[l] == '-')) {
pin = net->Entry + j;
pin_found = 1;
func(net, pin);
@@ -347,11 +344,11 @@ static int ActionNetlist(int argc, const char **argv, Coord x, Coord y)
}
if (argc > 2 && !pin_found) {
- gui->log("Net %s has no pin %s\n", argv[1], argv[2]);
+ pcb_gui->log("Net %s has no pin %s\n", argv[1], argv[2]);
return 1;
}
else if (!net_found) {
- gui->log("No net named %s\n", argv[1]);
+ pcb_gui->log("No net named %s\n", argv[1]);
}
if (use_re)
@@ -360,12 +357,12 @@ static int ActionNetlist(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-HID_Action netlist_action_list[] = {
- {"net", 0, ActionNetlist,
- netlist_help, netlist_syntax}
+pcb_hid_action_t netlist_action_list[] = {
+ {"net", 0, pcb_act_Netlist,
+ pcb_acth_Netlist, pcb_acts_Netlist}
,
- {"netlist", 0, ActionNetlist,
- netlist_help, netlist_syntax}
+ {"netlist", 0, pcb_act_Netlist,
+ pcb_acth_Netlist, pcb_acts_Netlist}
};
-REGISTER_ACTIONS(netlist_action_list, NULL)
+PCB_REGISTER_ACTIONS(netlist_action_list, NULL)
diff --git a/src/obj_all.h b/src/obj_all.h
new file mode 100644
index 0000000..f76bb74
--- /dev/null
+++ b/src/obj_all.h
@@ -0,0 +1,8 @@
+#include "obj_arc.h"
+#include "obj_elem.h"
+#include "obj_line.h"
+#include "obj_pad.h"
+#include "obj_pinvia.h"
+#include "obj_poly.h"
+#include "obj_text.h"
+#include "obj_rat.h"
diff --git a/src/obj_all_list.h b/src/obj_all_list.h
new file mode 100644
index 0000000..5029136
--- /dev/null
+++ b/src/obj_all_list.h
@@ -0,0 +1,8 @@
+#include "obj_arc_list.h"
+#include "obj_elem_list.h"
+#include "obj_line_list.h"
+#include "obj_pad_list.h"
+#include "obj_pinvia_list.h"
+#include "obj_poly_list.h"
+#include "obj_text_list.h"
+#include "obj_rat_list.h"
diff --git a/src/obj_all_op.h b/src/obj_all_op.h
new file mode 100644
index 0000000..bc8f125
--- /dev/null
+++ b/src/obj_all_op.h
@@ -0,0 +1,8 @@
+#include "obj_arc_op.h"
+#include "obj_elem_op.h"
+#include "obj_line_op.h"
+#include "obj_pad_op.h"
+#include "obj_pinvia_op.h"
+#include "obj_poly_op.h"
+#include "obj_text_op.h"
+#include "obj_rat_op.h"
diff --git a/src/obj_any.c b/src/obj_any.c
index 6db6dcf..4bd42c7 100644
--- a/src/obj_any.c
+++ b/src/obj_any.c
@@ -23,5 +23,6 @@
/* object model - type+union that can represent any object */
#define TDL_DONT_UNDEF
+#include "config.h"
#include "obj_any.h"
#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_any.h b/src/obj_any.h
index 761fabd..aea53b6 100644
--- a/src/obj_any.h
+++ b/src/obj_any.h
@@ -25,7 +25,7 @@
#ifndef PCB_OBJ_H
#define PCB_OBJ_H
-#include "global_objs.h"
+#include "obj_common.h"
#include "global_typedefs.h"
/* Can be used as a bitfield */
@@ -54,7 +54,7 @@ typedef enum pcb_objtype_e {
/* combinations, groups, masks */
PCB_OBJ_CLASS_MASK= 0xF00000,
- PCB_OBJ_CLASS_OBJ = 0x000000, /* anything with common object fields (AnyObjectType) */
+ PCB_OBJ_CLASS_OBJ = 0x000000, /* anything with common object fields (pcb_any_obj_t) */
PCB_OBJ_ANY = 0xFFFFFF
} pcb_objtype_t;
@@ -77,27 +77,27 @@ struct pcb_obj_s {
pcb_objtype_t type;
union {
void *any;
- AnyObjectType *anyobj;
- PointType *point;
- LineType *line;
- TextType *text;
- PolygonType *polygon;
- ArcType *arc;
- RatType *rat;
- PadType *pad;
- PinType *pin;
- PinType *via;
- ElementType *element;
- NetType *net;
- LayerType *layer;
+ pcb_any_obj_t *anyobj;
+ pcb_point_t *point;
+ pcb_line_t *line;
+ pcb_text_t *text;
+ pcb_polygon_t *polygon;
+ pcb_arc_t *arc;
+ pcb_rat_t *rat;
+ pcb_pad_t *pad;
+ pcb_pin_t *pin;
+ pcb_pin_t *via;
+ pcb_element_t *element;
+ pcb_net_t *net;
+ pcb_layer_t *layer;
} data;
pcb_parenttype_t parent_type;
union {
void *any;
- LayerType *layer;
- DataType *data;
- ElementType *element;
+ pcb_layer_t *layer;
+ pcb_data_t *data;
+ pcb_element_t *element;
} parent;
gdl_elem_t link;
};
diff --git a/src/obj_arc.c b/src/obj_arc.c
new file mode 100644
index 0000000..c382900
--- /dev/null
+++ b/src/obj_arc.c
@@ -0,0 +1,716 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: (elliptical) arc */
+
+
+#include "config.h"
+#include "compat_nls.h"
+#include "board.h"
+#include "data.h"
+#include "polygon.h"
+#include "undo.h"
+#include "rotate.h"
+#include "move.h"
+#include "conf_core.h"
+#include "compat_misc.h"
+
+#include "obj_arc.h"
+#include "obj_arc_op.h"
+
+/* TODO: could be removed if draw.c could be split up */
+#include "draw.h"
+#include "obj_arc_draw.h"
+
+static int pcb_arc_end_addr = 1;
+int *pcb_arc_start_ptr = NULL, *pcb_arc_end_ptr = &pcb_arc_end_addr;
+
+pcb_arc_t *pcb_arc_alloc(pcb_layer_t * layer)
+{
+ pcb_arc_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_arc_t), 1);
+ arclist_append(&layer->Arc, new_obj);
+
+ return new_obj;
+}
+
+pcb_arc_t *pcb_element_arc_alloc(pcb_element_t *Element)
+{
+ pcb_arc_t *arc = calloc(sizeof(pcb_arc_t), 1);
+
+ arclist_append(&Element->Arc, arc);
+ return arc;
+}
+
+
+
+/* computes the bounding box of an arc */
+void pcb_arc_bbox(pcb_arc_t *Arc)
+{
+ double ca1, ca2, sa1, sa2;
+ double minx, maxx, miny, maxy;
+ pcb_angle_t ang1, ang2;
+ pcb_coord_t width;
+
+ /* first put angles into standard form:
+ * ang1 < ang2, both angles between 0 and 720 */
+ Arc->Delta = PCB_CLAMP(Arc->Delta, -360, 360);
+
+ if (Arc->Delta > 0) {
+ ang1 = pcb_normalize_angle(Arc->StartAngle);
+ ang2 = pcb_normalize_angle(Arc->StartAngle + Arc->Delta);
+ }
+ else {
+ ang1 = pcb_normalize_angle(Arc->StartAngle + Arc->Delta);
+ ang2 = pcb_normalize_angle(Arc->StartAngle);
+ }
+ if (ang1 > ang2)
+ ang2 += 360;
+ /* Make sure full circles aren't treated as zero-length arcs */
+ if (Arc->Delta == 360 || Arc->Delta == -360)
+ ang2 = ang1 + 360;
+
+ /* calculate sines, cosines */
+ sa1 = sin(PCB_M180 * ang1);
+ ca1 = cos(PCB_M180 * ang1);
+ sa2 = sin(PCB_M180 * ang2);
+ ca2 = cos(PCB_M180 * ang2);
+
+ minx = MIN(ca1, ca2);
+ maxx = MAX(ca1, ca2);
+ miny = MIN(sa1, sa2);
+ maxy = MAX(sa1, sa2);
+
+ /* Check for extreme angles */
+ if ((ang1 <= 0 && ang2 >= 0) || (ang1 <= 360 && ang2 >= 360))
+ maxx = 1;
+ if ((ang1 <= 90 && ang2 >= 90) || (ang1 <= 450 && ang2 >= 450))
+ maxy = 1;
+ if ((ang1 <= 180 && ang2 >= 180) || (ang1 <= 540 && ang2 >= 540))
+ minx = -1;
+ if ((ang1 <= 270 && ang2 >= 270) || (ang1 <= 630 && ang2 >= 630))
+ miny = -1;
+
+ /* Finally, calculate bounds, converting sane geometry into pcb geometry */
+ Arc->BoundingBox.X1 = Arc->X - Arc->Width * maxx;
+ Arc->BoundingBox.X2 = Arc->X - Arc->Width * minx;
+ Arc->BoundingBox.Y1 = Arc->Y + Arc->Height * miny;
+ Arc->BoundingBox.Y2 = Arc->Y + Arc->Height * maxy;
+
+ width = (Arc->Thickness + Arc->Clearance) / 2;
+
+ /* Adjust for our discrete polygon approximation */
+ width = (double) width *MAX(PCB_POLY_CIRC_RADIUS_ADJ, (1.0 + PCB_POLY_ARC_MAX_DEVIATION)) + 0.5;
+
+ Arc->BoundingBox.X1 -= width;
+ Arc->BoundingBox.X2 += width;
+ Arc->BoundingBox.Y1 -= width;
+ Arc->BoundingBox.Y2 += width;
+ pcb_close_box(&Arc->BoundingBox);
+}
+
+
+void pcb_arc_get_end(pcb_arc_t *Arc, int which, pcb_coord_t *x, pcb_coord_t *y)
+{
+ if (which == 0) {
+ *x = Arc->X - Arc->Width * cos(Arc->StartAngle * PCB_M180);
+ *y = Arc->Y + Arc->Height * sin(Arc->StartAngle * PCB_M180);
+ }
+ else {
+ *x = Arc->X - Arc->Width * cos((Arc->StartAngle + Arc->Delta) * PCB_M180);
+ *y = Arc->Y + Arc->Height * sin((Arc->StartAngle + Arc->Delta) * PCB_M180);
+ }
+}
+
+/* doesn't these belong in change.c ?? */
+void pcb_arc_set_angles(pcb_layer_t *Layer, pcb_arc_t *a, pcb_angle_t new_sa, pcb_angle_t new_da)
+{
+ if (new_da >= 360) {
+ new_da = 360;
+ new_sa = 0;
+ }
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, a);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) a);
+ pcb_undo_add_obj_to_change_angles(PCB_TYPE_ARC, a, a, a);
+ a->StartAngle = new_sa;
+ a->Delta = new_da;
+ pcb_arc_bbox(a);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) a, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, a);
+}
+
+
+void pcb_arc_set_radii(pcb_layer_t *Layer, pcb_arc_t *a, pcb_coord_t new_width, pcb_coord_t new_height)
+{
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, a);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) a);
+ pcb_undo_add_obj_to_change_radii(PCB_TYPE_ARC, a, a, a);
+ a->Width = new_width;
+ a->Height = new_height;
+ pcb_arc_bbox(a);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) a, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, a);
+}
+
+
+/* creates a new arc on a layer */
+pcb_arc_t *pcb_arc_new(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t width, pcb_coord_t height, pcb_angle_t sa, pcb_angle_t dir, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags)
+{
+ pcb_arc_t *Arc;
+
+ PCB_ARC_LOOP(Layer);
+ {
+ if (arc->X == X1 && arc->Y == Y1 && arc->Width == width &&
+ pcb_normalize_angle(arc->StartAngle) == pcb_normalize_angle(sa) && arc->Delta == dir)
+ return (NULL); /* prevent stacked arcs */
+ }
+ PCB_END_LOOP;
+ Arc = pcb_arc_alloc(Layer);
+ if (!Arc)
+ return (Arc);
+
+ Arc->ID = pcb_create_ID_get();
+ Arc->Flags = Flags;
+ Arc->Thickness = Thickness;
+ Arc->Clearance = Clearance;
+ Arc->X = X1;
+ Arc->Y = Y1;
+ Arc->Width = width;
+ Arc->Height = height;
+ Arc->StartAngle = sa;
+ Arc->Delta = dir;
+ pcb_add_arc_on_layer(Layer, Arc);
+ return (Arc);
+}
+
+void pcb_add_arc_on_layer(pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_arc_bbox(Arc);
+ if (!Layer->arc_tree)
+ Layer->arc_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+}
+
+
+
+void pcb_arc_free(pcb_arc_t * data)
+{
+ arclist_remove(data);
+ free(data);
+}
+
+
+int pcb_arc_eq(const pcb_element_t *e1, const pcb_arc_t *a1, const pcb_element_t *e2, const pcb_arc_t *a2)
+{
+ if (pcb_field_neq(a1, a2, Thickness) || pcb_field_neq(a1, a2, Clearance)) return 0;
+ if (pcb_field_neq(a1, a2, Width) || pcb_field_neq(a1, a2, Height)) return 0;
+ if (pcb_element_neq_offsx(e1, a1, e2, a2, X) || pcb_element_neq_offsy(e1, a1, e2, a2, Y)) return 0;
+ if (pcb_field_neq(a1, a2, StartAngle) || pcb_field_neq(a1, a2, Delta)) return 0;
+
+ return 1;
+}
+
+unsigned int pcb_arc_hash(const pcb_element_t *e, const pcb_arc_t *a)
+{
+ return
+ pcb_hash_coord(a->Thickness) ^ pcb_hash_coord(a->Clearance) ^
+ pcb_hash_coord(a->Width) ^ pcb_hash_coord(a->Height) ^
+ pcb_hash_element_ox(e, a->X) ^ pcb_hash_element_oy(e, a->Y) ^
+ pcb_hash_coord(a->StartAngle) ^ pcb_hash_coord(a->Delta);
+}
+
+pcb_coord_t pcb_arc_length(const pcb_arc_t *arc)
+{
+ double da = arc->Delta;
+ double r = ((double)arc->Width + (double)arc->Height) / 2.0; /* TODO: lame approximation */
+ if (da < 0)
+ da = -da;
+ while(da > 360.0)
+ da = 360.0;
+ return pcb_round(2.0*r*M_PI*da/360.0);
+}
+
+double pcb_arc_area(const pcb_arc_t *arc)
+{
+ return
+ (pcb_arc_length(arc) * (double)arc->Thickness /* body */
+ + (double)arc->Thickness * (double)arc->Thickness * (double)M_PI); /* cap circles */
+}
+
+
+/***** operations *****/
+
+/* copies an arc to buffer */
+void *AddArcToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_layer_t *layer = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, Layer)];
+
+ return (pcb_arc_new(layer, Arc->X, Arc->Y,
+ Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta,
+ Arc->Thickness, Arc->Clearance, pcb_flag_mask(Arc->Flags, PCB_FLAG_FOUND | ctx->buffer.extraflg)));
+}
+
+/* moves an arc to buffer */
+void *MoveArcToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_arc_t * arc)
+{
+ pcb_layer_t *lay = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, layer)];
+
+ pcb_poly_restore_to_poly(ctx->buffer.src, PCB_TYPE_ARC, layer, arc);
+ pcb_r_delete_entry(layer->arc_tree, (pcb_box_t *) arc);
+
+ arclist_remove(arc);
+ arclist_append(&lay->Arc, arc);
+
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, arc);
+
+ if (!lay->arc_tree)
+ lay->arc_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(lay->arc_tree, (pcb_box_t *) arc, 0);
+ pcb_poly_clear_from_poly(ctx->buffer.dst, PCB_TYPE_ARC, lay, arc);
+ return (arc);
+}
+
+/* changes the size of an arc */
+void *ChangeArcSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Arc->Thickness + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc))
+ return (NULL);
+ if (value <= PCB_MAX_LINESIZE && value >= PCB_MIN_LINESIZE && value != Arc->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_ARC, Layer, Arc, Arc);
+ EraseArc(Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ Arc->Thickness = value;
+ pcb_arc_bbox(Arc);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ DrawArc(Layer, Arc);
+ return (Arc);
+ }
+ return (NULL);
+}
+
+/* changes the clearance size of an arc */
+void *ChangeArcClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Arc->Clearance + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc) || !PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Arc))
+ return (NULL);
+ value = MIN(PCB_MAX_LINESIZE, MAX(value, PCB->Bloat * 2 + 2));
+ if (value != Arc->Clearance) {
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_ARC, Layer, Arc, Arc);
+ EraseArc(Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ Arc->Clearance = value;
+ if (Arc->Clearance == 0) {
+ PCB_FLAG_CLEAR(PCB_FLAG_CLEARLINE, Arc);
+ Arc->Clearance = PCB_MIL_TO_COORD(10);
+ }
+ pcb_arc_bbox(Arc);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ DrawArc(Layer, Arc);
+ return (Arc);
+ }
+ return (NULL);
+}
+
+/* changes the radius of an arc (is_primary 0=width or 1=height or 2=both) */
+void *ChangeArcRadius(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_coord_t value, *dst;
+ void *a0, *a1;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc))
+ return (NULL);
+
+ switch(ctx->chgsize.is_primary) {
+ case 0: dst = &Arc->Width; break;
+ case 1: dst = &Arc->Height; break;
+ case 2:
+ ctx->chgsize.is_primary = 0; a0 = ChangeArcRadius(ctx, Layer, Arc);
+ ctx->chgsize.is_primary = 1; a1 = ChangeArcRadius(ctx, Layer, Arc);
+ if ((a0 != NULL) || (a1 != NULL))
+ return Arc;
+ return NULL;
+ }
+
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : (*dst) + ctx->chgsize.delta;
+ value = MIN(PCB_MAX_ARCSIZE, MAX(value, PCB_MIN_ARCSIZE));
+ if (value != *dst) {
+ pcb_undo_add_obj_to_change_radii(PCB_TYPE_ARC, Layer, Arc, Arc);
+ EraseArc(Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ *dst = value;
+ pcb_arc_bbox(Arc);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ DrawArc(Layer, Arc);
+ return (Arc);
+ }
+ return (NULL);
+}
+
+/* changes the angle of an arc (is_primary 0=start or 1=end) */
+void *ChangeArcAngle(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_angle_t value, *dst;
+ void *a0, *a1;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc))
+ return (NULL);
+
+ switch(ctx->chgangle.is_primary) {
+ case 0: dst = &Arc->StartAngle; break;
+ case 1: dst = &Arc->Delta; break;
+ case 2:
+ ctx->chgangle.is_primary = 0; a0 = ChangeArcAngle(ctx, Layer, Arc);
+ ctx->chgangle.is_primary = 1; a1 = ChangeArcAngle(ctx, Layer, Arc);
+ if ((a0 != NULL) || (a1 != NULL))
+ return Arc;
+ return NULL;
+ }
+
+ value = (ctx->chgangle.absolute) ? ctx->chgangle.absolute : (*dst) + ctx->chgangle.delta;
+ value = fmod(value, 360.0);
+ if (value < 0)
+ value += 360;
+
+ if (value != *dst) {
+ pcb_undo_add_obj_to_change_angles(PCB_TYPE_ARC, Layer, Arc, Arc);
+ EraseArc(Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ *dst = value;
+ pcb_arc_bbox(Arc);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ DrawArc(Layer, Arc);
+ return (Arc);
+ }
+ return (NULL);
+}
+
+/* changes the clearance flag of an arc */
+void *ChangeArcJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc))
+ return (NULL);
+ EraseArc(Arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Arc)) {
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_ARC, Layer, Arc, Arc, pcb_false);
+ }
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, Layer, Arc, Arc);
+ PCB_FLAG_TOGGLE(PCB_FLAG_CLEARLINE, Arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Arc)) {
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_ARC, Layer, Arc, Arc, pcb_true);
+ }
+ DrawArc(Layer, Arc);
+ return (Arc);
+}
+
+/* sets the clearance flag of an arc */
+void *SetArcJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc) || PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Arc))
+ return (NULL);
+ return ChangeArcJoin(ctx, Layer, Arc);
+}
+
+/* clears the clearance flag of an arc */
+void *ClrArcJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc) || !PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Arc))
+ return (NULL);
+ return ChangeArcJoin(ctx, Layer, Arc);
+}
+
+/* copies an arc */
+void *CopyArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_arc_t *arc;
+
+ arc = pcb_arc_new(Layer, Arc->X + ctx->copy.DeltaX,
+ Arc->Y + ctx->copy.DeltaY, Arc->Width, Arc->Height, Arc->StartAngle,
+ Arc->Delta, Arc->Thickness, Arc->Clearance, pcb_flag_mask(Arc->Flags, PCB_FLAG_FOUND));
+ if (!arc)
+ return (arc);
+ DrawArc(Layer, arc);
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, Layer, arc, arc);
+ return (arc);
+}
+
+/* moves an arc */
+void *MoveArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+ if (Layer->On) {
+ EraseArc(Arc);
+ pcb_arc_move(Arc, ctx->move.dx, ctx->move.dy);
+ DrawArc(Layer, Arc);
+ pcb_draw();
+ }
+ else {
+ pcb_arc_move(Arc, ctx->move.dx, ctx->move.dy);
+ }
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ return (Arc);
+}
+
+/* moves an arc between layers; lowlevel routines */
+void *MoveArcToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_arc_t * arc, pcb_layer_t * Destination)
+{
+ pcb_r_delete_entry(Source->arc_tree, (pcb_box_t *) arc);
+
+ arclist_remove(arc);
+ arclist_append(&Destination->Arc, arc);
+
+ if (!Destination->arc_tree)
+ Destination->arc_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Destination->arc_tree, (pcb_box_t *) arc, 0);
+ return arc;
+}
+
+
+/* moves an arc between layers */
+void *MoveArcToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_arc_t * Arc)
+{
+ pcb_arc_t *newone;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ return NULL;
+ }
+ if (ctx->move.dst_layer == Layer && Layer->On) {
+ DrawArc(Layer, Arc);
+ pcb_draw();
+ }
+ if (((long int) ctx->move.dst_layer == -1) || ctx->move.dst_layer == Layer)
+ return (Arc);
+ pcb_undo_add_obj_to_move_to_layer(PCB_TYPE_ARC, Layer, Arc, Arc);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ if (Layer->On)
+ EraseArc(Arc);
+ newone = (pcb_arc_t *) MoveArcToLayerLowLevel(ctx, Layer, Arc, ctx->move.dst_layer);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, ctx->move.dst_layer, Arc);
+ if (ctx->move.dst_layer->On)
+ DrawArc(ctx->move.dst_layer, newone);
+ pcb_draw();
+ return (newone);
+}
+
+/* destroys an arc from a layer */
+void *DestroyArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+
+ pcb_arc_free(Arc);
+
+ return NULL;
+}
+
+/* removes an arc from a layer */
+void *RemoveArc_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ /* erase from screen */
+ if (Layer->On) {
+ EraseArc(Arc);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_ARC, Layer, Arc, Arc);
+ return NULL;
+}
+
+void *pcb_arc_destroy(pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = NULL;
+
+ return RemoveArc_op(&ctx, Layer, Arc);
+}
+
+/* rotates an arc */
+void pcb_arc_rotate90(pcb_arc_t *Arc, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
+{
+ pcb_coord_t save;
+
+ /* add Number*90 degrees (i.e., Number quarter-turns) */
+ Arc->StartAngle = pcb_normalize_angle(Arc->StartAngle + Number * 90);
+ PCB_COORD_ROTATE90(Arc->X, Arc->Y, X, Y, Number);
+
+ /* now change width and height */
+ if (Number == 1 || Number == 3) {
+ save = Arc->Width;
+ Arc->Width = Arc->Height;
+ Arc->Height = save;
+ }
+ pcb_box_rotate90(&Arc->BoundingBox, X, Y, Number);
+}
+
+void pcb_arc_rotate(pcb_layer_t *layer, pcb_arc_t *arc, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, pcb_angle_t angle)
+{
+ pcb_r_delete_entry(layer->arc_tree, (pcb_box_t *) arc);
+ pcb_rotate(&arc->X, &arc->Y, X, Y, cosa, sina);
+ arc->StartAngle = pcb_normalize_angle(arc->StartAngle + angle);
+ pcb_r_insert_entry(layer->arc_tree, (pcb_box_t *) arc, 0);
+}
+
+void pcb_arc_mirror(pcb_layer_t *layer, pcb_arc_t *arc)
+{
+ pcb_r_delete_entry(layer->arc_tree, (pcb_box_t *) arc);
+ arc->X = PCB_SWAP_X(arc->X);
+ arc->Y = PCB_SWAP_Y(arc->Y);
+ arc->StartAngle = PCB_SWAP_ANGLE(arc->StartAngle);
+ arc->Delta = PCB_SWAP_DELTA(arc->Delta);
+ pcb_arc_bbox(arc);
+ pcb_r_insert_entry(layer->arc_tree, (pcb_box_t *) arc, 0);
+}
+
+void pcb_arc_flip_side(pcb_layer_t *layer, pcb_arc_t *arc)
+{
+ pcb_r_delete_entry(layer->arc_tree, (pcb_box_t *) arc);
+ arc->X = PCB_SWAP_X(arc->X);
+ arc->Y = PCB_SWAP_Y(arc->Y);
+ arc->StartAngle = PCB_SWAP_ANGLE(arc->StartAngle);
+ arc->Delta = PCB_SWAP_DELTA(arc->Delta);
+ pcb_arc_bbox(arc);
+ pcb_r_insert_entry(layer->arc_tree, (pcb_box_t *) arc, 0);
+}
+
+/* rotates an arc */
+void *Rotate90Arc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ EraseArc(Arc);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
+ pcb_arc_rotate90(Arc, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
+ DrawArc(Layer, Arc);
+ pcb_draw();
+ return (Arc);
+}
+
+void *pcb_arc_insert_point(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *arc)
+{
+ pcb_angle_t end_ang = arc->StartAngle + arc->Delta;
+ pcb_coord_t x = pcb_crosshair.X, y = pcb_crosshair.Y;
+ pcb_angle_t angle = atan2(-(y - arc->Y), (x - arc->X)) * 180.0 / M_PI + 180.0;
+ pcb_arc_t *new_arc;
+
+ if (end_ang > 360.0)
+ end_ang -= 360.0;
+ if (end_ang < -360.0)
+ end_ang += 360.0;
+
+ if ((arc->Delta < 0) || (arc->Delta > 180))
+ new_arc = pcb_arc_new(Layer, arc->X, arc->Y, arc->Width, arc->Height, angle, end_ang - angle + 360.0, arc->Thickness, arc->Clearance, arc->Flags);
+ else
+ new_arc = pcb_arc_new(Layer, arc->X, arc->Y, arc->Width, arc->Height, angle, end_ang - angle, arc->Thickness, arc->Clearance, arc->Flags);
+
+ if (new_arc != NULL) {
+ PCB_FLAG_CHANGE(PCB_CHGFLG_SET, PCB_FLAG_FOUND, new_arc);
+ if (arc->Delta < 0)
+ pcb_arc_set_angles(Layer, arc, arc->StartAngle, angle - arc->StartAngle - 360.0);
+ else
+ pcb_arc_set_angles(Layer, arc, arc->StartAngle, angle - arc->StartAngle);
+ }
+ return new_arc;
+}
+
+/*** draw ***/
+void _draw_arc(pcb_arc_t * arc)
+{
+ if (!arc->Thickness)
+ return;
+
+ if (conf_core.editor.thin_draw)
+ pcb_gui->set_line_width(Output.fgGC, 0);
+ else
+ pcb_gui->set_line_width(Output.fgGC, arc->Thickness);
+ pcb_gui->set_line_cap(Output.fgGC, Trace_Cap);
+
+ pcb_gui->draw_arc(Output.fgGC, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
+}
+
+void draw_arc(pcb_layer_t * layer, pcb_arc_t * arc)
+{
+ const char *color;
+ char buf[sizeof("#XXXXXX")];
+
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, arc))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, arc)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, arc))
+ color = layer->SelectedColor;
+ else
+ color = PCB->ConnectedColor;
+ }
+ else
+ color = layer->Color;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, arc)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+ pcb_gui->set_color(Output.fgGC, color);
+ _draw_arc(arc);
+}
+
+pcb_r_dir_t draw_arc_callback(const pcb_box_t * b, void *cl)
+{
+ draw_arc((pcb_layer_t *) cl, (pcb_arc_t *) b);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* erases an arc on a layer */
+void EraseArc(pcb_arc_t *Arc)
+{
+ if (!Arc->Thickness)
+ return;
+ pcb_draw_invalidate(Arc);
+ pcb_flag_erase(&Arc->Flags);
+}
+
+void DrawArc(pcb_layer_t *Layer, pcb_arc_t *Arc)
+{
+ pcb_draw_invalidate(Arc);
+}
diff --git a/src/obj_arc.h b/src/obj_arc.h
new file mode 100644
index 0000000..77b6d45
--- /dev/null
+++ b/src/obj_arc.h
@@ -0,0 +1,124 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: (elliptical) arc */
+
+#ifndef PCB_OBJ_ARC_H
+#define PCB_OBJ_ARC_H
+
+#include "obj_common.h"
+
+struct pcb_arc_s { /* holds information about arcs */
+ PCB_ANYOBJECTFIELDS;
+ pcb_coord_t Thickness, Clearance;
+ pcb_coord_t Width, Height, /* length of axis */
+ X, Y; /* center coordinates */
+ pcb_angle_t StartAngle, Delta; /* the two limiting angles in degrees */
+ gdl_elem_t link; /* an arc is in a list: either on a layer or in an element */
+};
+
+/*** Memory ***/
+pcb_arc_t *pcb_arc_alloc(pcb_layer_t *);
+pcb_arc_t *pcb_element_arc_alloc(pcb_element_t *Element);
+void pcb_arc_free(pcb_arc_t *data);
+
+pcb_arc_t *pcb_arc_new(pcb_layer_t *Layer, pcb_coord_t center_x, pcb_coord_t center_y, pcb_coord_t width_r, pcb_coord_t height_r, pcb_angle_t start_angle, pcb_angle_t delta_angle, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags);
+void *pcb_arc_destroy(pcb_layer_t *Layer, pcb_arc_t *Arc);
+
+/* Add objects without creating them or making any "sanity modifications" to them */
+void pcb_add_arc_on_layer(pcb_layer_t *Layer, pcb_arc_t *Arc);
+
+
+/*** Utility ***/
+void pcb_arc_bbox(pcb_arc_t *Arc);
+void pcb_arc_rotate90(pcb_arc_t *Arc, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
+void pcb_arc_rotate(pcb_layer_t *layer, pcb_arc_t *arc, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, pcb_angle_t angle);
+void pcb_arc_mirror(pcb_layer_t *layer, pcb_arc_t *arc);
+void pcb_arc_flip_side(pcb_layer_t *layer, pcb_arc_t *arc);
+
+/*** hash ***/
+int pcb_arc_eq(const pcb_element_t *e1, const pcb_arc_t *a1, const pcb_element_t *e2, const pcb_arc_t *a2);
+unsigned int pcb_arc_hash(const pcb_element_t *e, const pcb_arc_t *a);
+
+
+/* Return the x;y coordinate of the endpoint of an arc; if which is 0, return
+ the endpoint that corresponds to StartAngle, else return the end angle's. */
+void pcb_arc_get_end(pcb_arc_t *Arc, int which, pcb_coord_t *x, pcb_coord_t *y);
+
+void pcb_arc_set_angles(pcb_layer_t *Layer, pcb_arc_t *a, pcb_angle_t new_sa, pcb_angle_t new_da);
+void pcb_arc_set_radii(pcb_layer_t *Layer, pcb_arc_t *a, pcb_coord_t new_width, pcb_coord_t new_height);
+
+pcb_coord_t pcb_arc_length(const pcb_arc_t *arc);
+double pcb_arc_area(const pcb_arc_t *arc);
+
+/* ptr3 values for start and end point */
+extern int *pcb_arc_start_ptr, *pcb_arc_end_ptr;
+
+
+#define pcb_arc_move(a,dx,dy) \
+ do { \
+ pcb_coord_t __dx__ = (dx), __dy__ = (dy); \
+ pcb_arc_t *__a__ = (a); \
+ PCB_MOVE((__a__)->X,(__a__)->Y,__dx__,__dy__) \
+ PCB_BOX_MOVE_LOWLEVEL(&((__a__)->BoundingBox),__dx__,__dy__); \
+ } while(0)
+
+#define PCB_ARC_LOOP(element) do { \
+ pcb_arc_t *arc; \
+ gdl_iterator_t __it__; \
+ linelist_foreach(&(element)->Arc, &__it__, arc) {
+
+#define PCB_ARC_ALL_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l =0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ PCB_ARC_LOOP(layer)
+
+#define PCB_ARC_COPPER_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l =0; l < pcb_max_copper_layer; l++, layer++) \
+ { \
+ PCB_ARC_LOOP(layer)
+
+#define PCB_ARC_SILK_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ layer += pcb_max_copper_layer; \
+ for (l = 0; l < 2; l++, layer++) \
+ { \
+ PCB_ARC_LOOP(layer)
+
+#define PCB_ARC_VISIBLE_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ if (layer->On) \
+ PCB_ARC_LOOP(layer)
+
+#endif
diff --git a/src/obj_arc_draw.h b/src/obj_arc_draw.h
new file mode 100644
index 0000000..c39ec03
--- /dev/null
+++ b/src/obj_arc_draw.h
@@ -0,0 +1,37 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw of arcs ***/
+
+/* Include rtree.h for this */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_arc_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void _draw_arc(pcb_arc_t * arc);
+void draw_arc(pcb_layer_t * layer, pcb_arc_t * arc);
+void EraseArc(pcb_arc_t *Arc);
+void DrawArc(pcb_layer_t *Layer, pcb_arc_t *Arc);
diff --git a/src/obj_arc_list.c b/src/obj_arc_list.c
new file mode 100644
index 0000000..1b61b7e
--- /dev/null
+++ b/src/obj_arc_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_arc_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_arc_list.h b/src/obj_arc_list.h
new file mode 100644
index 0000000..7f49fca
--- /dev/null
+++ b/src/obj_arc_list.h
@@ -0,0 +1,44 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_ARC_LIST_H
+#define PCB_OBJ_ARC_LIST_H
+
+#include "obj_common.h"
+#include "obj_arc.h"
+
+/* List of Arcs */
+#define TDL(x) arclist_ ## x
+#define TDL_LIST_T arclist_t
+#define TDL_ITEM_T pcb_arc_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define arclist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_arc_op.h b/src/obj_arc_op.h
new file mode 100644
index 0000000..0036d56
--- /dev/null
+++ b/src/obj_arc_op.h
@@ -0,0 +1,50 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on arc ***/
+
+#include "operation.h"
+
+void *AddArcToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *MoveArcToBuffer(pcb_opctx_t *ctx, pcb_layer_t *layer, pcb_arc_t *arc);
+void *ChangeArcSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *ChangeArcClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *ChangeArcRadius(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *ChangeArcAngle(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *ChangeArcJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *SetArcJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *ClrArcJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *CopyArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *MoveArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *MoveArcToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_arc_t * arc, pcb_layer_t * Destination);
+void *MoveArcToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_arc_t * Arc);
+void *DestroyArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *RemoveArc_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+void *Rotate90Arc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc);
+
+void *pcb_arc_insert_point(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *arc);
+
+
diff --git a/src/obj_arc_ui.c b/src/obj_arc_ui.c
new file mode 100644
index 0000000..ba9c3a4
--- /dev/null
+++ b/src/obj_arc_ui.c
@@ -0,0 +1,139 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+/* Arc UI logics */
+
+#include "config.h"
+#include <math.h>
+#include "obj_arc_ui.h"
+#include "obj_arc.h"
+#include "box.h"
+
+
+#include <stdio.h>
+
+static void draw_mark(pcb_hid_gc_t gc, const pcb_arc_t *arc)
+{
+ const pcb_coord_t mark = PCB_MM_TO_COORD(0.2);
+ pcb_gui->draw_line(gc, arc->X-mark, arc->Y, arc->X+mark, arc->Y);
+ pcb_gui->draw_line(gc, arc->X, arc->Y-mark, arc->X, arc->Y+mark);
+}
+
+static void pcb_arc_ui_move_or_copy_angle(pcb_crosshair_t *ch)
+{
+ int *end_pt = ch->AttachedObject.Ptr3;
+ pcb_arc_t *arc = (pcb_arc_t *) pcb_crosshair.AttachedObject.Ptr2;
+ pcb_angle_t start = arc->StartAngle, delta = arc->Delta;
+
+ if (end_pt == pcb_arc_start_ptr) {
+ double end2, new_delta, new_start = atan2(-(ch->Y - arc->Y), (ch->X - arc->X)) * 180.0 / M_PI + 180.0;
+
+ end2 = start + delta;
+ new_delta = end2 - new_start;
+ if (new_delta > 360.0)
+ new_delta -= 360.0;
+ if (new_delta < -360.0)
+ new_delta += 360.0;
+
+/* fprintf(stderr, "start: %f new_start: %f delta=%f new delta=%f\n", start, new_start, delta, new_delta);*/
+
+ if (delta > 0) {
+ if (new_delta < 0)
+ new_delta += 360.0;
+ }
+ else {
+ if (new_delta > 0)
+ new_delta -= 360.0;
+ }
+
+ start = new_start;
+ delta = new_delta;
+ }
+ else {
+ double new_delta, new_end = atan2(-(ch->Y - arc->Y), (ch->X - arc->X)) * 180.0 / M_PI + 180.0;
+ if (delta < 0)
+ new_end -= 360.0;
+/* fprintf(stderr, "delta: %f abs-end: %f new-abs: %f new-delta: %f\n", delta, start+delta, new_end, new_end-start);*/
+ new_delta = new_end-start;
+ if (delta > 0) {
+ if (new_delta < 0)
+ new_delta += 360.0;
+ }
+ else {
+ if (new_delta > 0)
+ new_delta -= 360.0;
+ }
+ delta = new_delta;
+ }
+
+ /* remember the result of the calculation so the actual move code can reuse them */
+ ch->AttachedObject.start_angle = start;
+ ch->AttachedObject.delta_angle = delta;
+ ch->AttachedObject.radius = 0;
+
+ pcb_gui->draw_arc(ch->GC, arc->X, arc->Y, arc->Width, arc->Height, start, delta);
+ draw_mark(ch->GC, arc);
+}
+
+void pcb_arc_ui_move_or_copy_endp(pcb_crosshair_t *ch)
+{
+ int *end_pt = ch->AttachedObject.Ptr3;
+ pcb_arc_t arc2, *arc = (pcb_arc_t *) pcb_crosshair.AttachedObject.Ptr2;
+ pcb_coord_t ex, ey;
+ double dx, dy, d;
+
+ pcb_arc_get_end(arc, (end_pt != NULL), &ex, &ey);
+
+ dx = (arc->X - ch->X);
+ dy = (arc->Y - ch->Y);
+ d = sqrt(dx*dx+dy*dy);
+
+ ch->AttachedObject.radius = d;
+
+ pcb_gui->draw_arc(ch->GC, arc->X, arc->Y, ch->AttachedObject.radius, ch->AttachedObject.radius, arc->StartAngle, arc->Delta);
+
+ draw_mark(ch->GC, &arc2);
+}
+
+
+void pcb_arc_ui_move_or_copy(pcb_crosshair_t *ch)
+{
+ if (pcb_gui->shift_is_pressed() || (ch->AttachedObject.radius != 0))
+ pcb_arc_ui_move_or_copy_endp(ch);
+ else
+ pcb_arc_ui_move_or_copy_angle(ch);
+}
+
+
+int pcb_obj_ui_arc_point_bbox(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_box_t *res)
+{
+ pcb_arc_t *arc = Ptr2;
+ int *end_pt = Ptr3;
+ pcb_coord_t ex, ey;
+ pcb_arc_get_end(arc, (end_pt != pcb_arc_start_ptr), &ex, &ey);
+ *res = pcb_point_box(ex, ey);
+ return 0;
+}
+
diff --git a/src/obj_arc_ui.h b/src/obj_arc_ui.h
new file mode 100644
index 0000000..37402c5
--- /dev/null
+++ b/src/obj_arc_ui.h
@@ -0,0 +1,31 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+/* Arc UI logics */
+
+#include "crosshair.h"
+
+void pcb_arc_ui_move_or_copy(pcb_crosshair_t *ch);
+int pcb_obj_ui_arc_point_bbox(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_box_t *res);
+
diff --git a/src/obj_common.c b/src/obj_common.c
new file mode 100644
index 0000000..b91fc58
--- /dev/null
+++ b/src/obj_common.c
@@ -0,0 +1,108 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2005 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 at rz.uni-ulm.de
+ *
+ */
+
+/* functions used to create vias, pins ... */
+
+#include "config.h"
+
+#include "conf_core.h"
+#include "global_typedefs.h"
+#include "const.h"
+#include "error.h"
+#include "obj_common.h"
+#include "obj_arc_ui.h"
+
+
+/* returns a pointer to an objects bounding box;
+ * data is valid until the routine is called again
+ */
+int GetObjectBoundingBox(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_box_t *res)
+{
+ switch (Type) {
+ case PCB_TYPE_LINE:
+ case PCB_TYPE_ARC:
+ case PCB_TYPE_TEXT:
+ case PCB_TYPE_POLYGON:
+ case PCB_TYPE_PAD:
+ case PCB_TYPE_PIN:
+ case PCB_TYPE_ELEMENT_NAME:
+ *res = *(pcb_box_t *)Ptr2;
+ return 0;
+ case PCB_TYPE_VIA:
+ case PCB_TYPE_ELEMENT:
+ *res = *(pcb_box_t *)Ptr1;
+ return 0;
+ case PCB_TYPE_POLYGON_POINT:
+ case PCB_TYPE_LINE_POINT:
+ *res = *(pcb_box_t *)Ptr3;
+ return 0;
+ case PCB_TYPE_ARC_POINT:
+ return pcb_obj_ui_arc_point_bbox(Type, Ptr1, Ptr2, Ptr3, res);
+ default:
+ pcb_message(PCB_MSG_ERROR, "Request for bounding box of unsupported type %d\n", Type);
+ *res = *(pcb_box_t *)Ptr2;
+ return -1;
+ }
+}
+
+
+
+/* current object ID; incremented after each creation of an object */
+long int ID = 1;
+
+pcb_bool pcb_create_being_lenient = pcb_false;
+
+/* ---------------------------------------------------------------------------
+ * Set the lenience mode.
+ */
+void pcb_create_be_lenient(pcb_bool v)
+{
+ pcb_create_being_lenient = v;
+}
+
+void pcb_create_ID_bump(int min_id)
+{
+ if (ID < min_id)
+ ID = min_id;
+}
+
+void pcb_create_ID_reset(void)
+{
+ ID = 1;
+}
+
+long int pcb_create_ID_get(void)
+{
+ return ID++;
+}
+
+void pcb_obj_add_attribs(void *obj, const pcb_attribute_list_t *src)
+{
+ pcb_any_obj_t *o = obj;
+ if (src == NULL)
+ return;
+ pcb_attribute_copy_all(&o->Attributes, src, 0);
+}
diff --git a/src/obj_common.h b/src/obj_common.h
new file mode 100644
index 0000000..7b4e96d
--- /dev/null
+++ b/src/obj_common.h
@@ -0,0 +1,136 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_OBJ_COMMON_H
+#define PCB_OBJ_COMMON_H
+
+#include <genht/hash.h>
+#include <genlist/gendlist.h>
+#include <string.h>
+#include "flag.h"
+#include "attrib.h"
+#include "global_typedefs.h"
+
+/* point and box type - they are so common everything depends on them */
+struct pcb_point_s { /* a line/polygon point */
+ pcb_coord_t X, Y, X2, Y2; /* so Point type can be cast as pcb_box_t */
+ long int ID;
+};
+
+struct pcb_box_s { /* a bounding box */
+ pcb_coord_t X1, Y1; /* upper left */
+ pcb_coord_t X2, Y2; /* and lower right corner */
+};
+
+int GetObjectBoundingBox(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_box_t *res);
+
+/* memset object to 0, but keep the link field */
+#define reset_obj_mem(type, obj) \
+do { \
+ gdl_elem_t __lnk__ = obj->link; \
+ memset(obj, 0, sizeof(type)); \
+ obj->link = __lnk__; \
+} while(0) \
+
+
+/* pcb_true during file loads, for example to allow overlapping vias.
+ pcb_false otherwise, to stop the user from doing normally dangerous
+ things. */
+void pcb_create_be_lenient(pcb_bool);
+extern pcb_bool pcb_create_being_lenient;
+
+void pcb_create_ID_bump(int min_id);
+void pcb_create_ID_reset(void);
+long int pcb_create_ID_get(void);
+
+void pcb_obj_add_attribs(void *obj, const pcb_attribute_list_t *src);
+
+/* ---------------------------------------------------------------------------
+ * Do not change the following definitions even if they're not very
+ * nice. It allows us to have functions act on these "base types" and
+ * not need to know what kind of actual object they're working on.
+ */
+
+/* Any object that uses the "object flags" defined in const.h, or
+ exists as an object on the pcb, MUST be defined using this as the
+ first fields, either directly or through PCB_ANYLINEFIELDS. */
+#define PCB_ANYOBJECTFIELDS \
+ pcb_box_t BoundingBox; \
+ long int ID; \
+ pcb_flag_t Flags; \
+ pcb_attribute_list_t Attributes
+
+ /* struct pcb_lib_entry_t *net */
+
+/* Lines, pads, and rats all use this so they can be cross-cast. */
+#define PCB_ANYLINEFIELDS \
+ PCB_ANYOBJECTFIELDS; \
+ pcb_coord_t Thickness, \
+ Clearance; \
+ pcb_point_t Point1, \
+ Point2
+
+/* All on-pcb objects (elements, lines, pads, vias, rats, etc) are
+ based on this. */
+typedef struct {
+ PCB_ANYOBJECTFIELDS;
+} pcb_any_obj_t;
+
+/* Lines, rats, pads, etc. */
+typedef struct {
+ PCB_ANYLINEFIELDS;
+} pcb_any_line_t;
+
+/*** Functions and macros used for hashing ***/
+
+/* compare two strings and return 0 if they are equal. NULL == NULL means equal. */
+static inline PCB_FUNC_UNUSED int pcb_neqs(const char *s1, const char *s2)
+{
+ if ((s1 == NULL) && (s2 == NULL)) return 0;
+ if ((s1 == NULL) || (s2 == NULL)) return 1;
+ return strcmp(s1, s2) != 0;
+}
+
+static inline PCB_FUNC_UNUSED unsigned pcb_hash_coord(pcb_coord_t c)
+{
+ return murmurhash(&(c), sizeof(pcb_coord_t));
+}
+
+
+/* compare two fields and return 0 if they are equal */
+#define pcb_field_neq(s1, s2, f) ((s1)->f != (s2)->f)
+
+/* hash relative x and y within an element */
+#define pcb_hash_element_ox(e, c) ((e) == NULL ? pcb_hash_coord(c) : pcb_hash_coord(c - e->MarkX))
+#define pcb_hash_element_oy(e, c) ((e) == NULL ? pcb_hash_coord(c) : pcb_hash_coord(c - e->MarkY))
+
+#define pcb_hash_str(s) ((s) == NULL ? 0 : strhash(s))
+
+#define pcb_element_offs(e,ef, s,sf) ((e == NULL) ? (s)->sf : ((s)->sf) - ((e)->ef))
+#define pcb_element_neq_offsx(e1, x1, e2, x2, f) (pcb_element_offs(e1, MarkX, x1, f) != pcb_element_offs(e2, MarkX, x2, f))
+#define pcb_element_neq_offsy(e1, y1, e2, y2, f) (pcb_element_offs(e1, MarkY, y1, f) != pcb_element_offs(e2, MarkY, y2, f))
+
+#endif
diff --git a/src/obj_elem.c b/src/obj_elem.c
new file mode 100644
index 0000000..a063b03
--- /dev/null
+++ b/src/obj_elem.c
@@ -0,0 +1,1982 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: elements */
+
+#include "config.h"
+
+#include "board.h"
+#include "data.h"
+#include "list_common.h"
+#include "plug_io.h"
+#include "conf_core.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
+#include "rotate.h"
+#include "remove.h"
+#include "polygon.h"
+#include "undo.h"
+#include "obj_pinvia_op.h"
+#include "obj_pad_op.h"
+
+#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"
+#include "obj_elem_op.h"
+
+/* TODO: remove this: */
+#include "draw.h"
+#include "obj_text_draw.h"
+#include "obj_elem_draw.h"
+
+/*** allocation ***/
+
+/* get next slot for an element, allocates memory if necessary */
+pcb_element_t *pcb_element_alloc(pcb_data_t * data)
+{
+ pcb_element_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_element_t), 1);
+ elementlist_append(&data->Element, new_obj);
+
+ return new_obj;
+}
+
+void pcb_element_free(pcb_element_t * data)
+{
+ elementlist_remove(data);
+ free(data);
+}
+
+/* frees memory used by an element */
+void pcb_element_destroy(pcb_element_t * element)
+{
+ if (element == NULL)
+ return;
+
+ PCB_ELEMENT_NAME_LOOP(element);
+ {
+ free(textstring);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(element);
+ {
+ free(pin->Name);
+ free(pin->Number);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ free(pad->Name);
+ free(pad->Number);
+ }
+ PCB_END_LOOP;
+
+ list_map0(&element->Pin, pcb_pin_t, pcb_pin_free);
+ list_map0(&element->Pad, pcb_pad_t, pcb_pad_free);
+ list_map0(&element->Line, pcb_line_t, pcb_line_free);
+ list_map0(&element->Arc, pcb_arc_t, pcb_arc_free);
+
+ pcb_attribute_free(&element->Attributes);
+ reset_obj_mem(pcb_element_t, element);
+}
+
+pcb_line_t *pcb_element_line_alloc(pcb_element_t *Element)
+{
+ pcb_line_t *line = calloc(sizeof(pcb_line_t), 1);
+ linelist_append(&Element->Line, line);
+
+ return line;
+}
+
+/*** utility ***/
+/* loads element data from file/library into buffer
+ * parse the file with disabled 'PCB mode' (see parser)
+ * returns pcb_false on error
+ * if successful, update some other stuff and reposition the pastebuffer
+ */
+pcb_bool pcb_element_load_to_buffer(pcb_buffer_t *Buffer, const char *Name)
+{
+ pcb_element_t *element;
+
+ pcb_buffer_clear(Buffer);
+ if (!pcb_parse_element(Buffer->Data, Name)) {
+ if (conf_core.editor.show_solder_side)
+ pcb_buffer_flip_side(Buffer);
+ pcb_set_buffer_bbox(Buffer);
+ if (elementlist_length(&Buffer->Data->Element)) {
+ element = elementlist_first(&Buffer->Data->Element);
+ Buffer->X = element->MarkX;
+ Buffer->Y = element->MarkY;
+ }
+ else {
+ Buffer->X = 0;
+ Buffer->Y = 0;
+ }
+ return (pcb_true);
+ }
+
+ /* release memory which might have been acquired */
+ pcb_buffer_clear(Buffer);
+ return (pcb_false);
+}
+
+
+/* Searches for the given element by "footprint" name, and loads it
+ into the buffer. Returns zero on success, non-zero on error. */
+int pcb_element_load_footprint_by_name(pcb_buffer_t *Buffer, const char *Footprint)
+{
+ return !pcb_element_load_to_buffer(Buffer, Footprint);
+}
+
+
+/* break buffer element into pieces */
+pcb_bool pcb_element_smash_buffer(pcb_buffer_t *Buffer)
+{
+ pcb_element_t *element;
+ pcb_layergrp_id_t group;
+ pcb_layer_t *clayer, *slayer;
+
+ if (elementlist_length(&Buffer->Data->Element) != 1) {
+ pcb_message(PCB_MSG_ERROR, _("Error! Buffer doesn't contain a single element\n"));
+ return (pcb_false);
+ }
+ /*
+ * At this point the buffer should contain just a single element.
+ * Now we detach the single element from the buffer and then clear the
+ * buffer, ready to receive the smashed elements. As a result of detaching
+ * it the single element is orphaned from the buffer and thus will not be
+ * free()'d by pcb_data_free(called via ClearBuffer). This leaves it
+ * around for us to smash bits off it. It then becomes our responsibility,
+ * however, to free the single element when we're finished with it.
+ */
+ element = elementlist_first(&Buffer->Data->Element);
+ elementlist_remove(element);
+ pcb_buffer_clear(Buffer);
+ PCB_ELEMENT_PCB_LINE_LOOP(element);
+ {
+ pcb_line_new(&Buffer->Data->SILKLAYER,
+ line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y, line->Thickness, 0, pcb_no_flags());
+ if (line)
+ line->Number = pcb_strdup_null(PCB_ELEM_NAME_REFDES(element));
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(element);
+ {
+ pcb_arc_new(&Buffer->Data->SILKLAYER,
+ arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness, 0, pcb_no_flags());
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(element);
+ {
+ pcb_flag_t f = pcb_no_flags();
+ pcb_flag_add(f, PCB_FLAG_VIA);
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin))
+ pcb_flag_add(f, PCB_FLAG_HOLE);
+
+ pcb_via_new(Buffer->Data, pin->X, pin->Y, pin->Thickness, pin->Clearance, pin->Mask, pin->DrillingHole, pin->Number, f);
+ }
+ PCB_END_LOOP;
+ group = pcb_layer_get_group(PCB_SWAP_IDENT ? pcb_solder_silk_layer : pcb_component_silk_layer);
+ clayer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
+ group = pcb_layer_get_group(PCB_SWAP_IDENT ? pcb_component_silk_layer : pcb_solder_silk_layer);
+ slayer = &Buffer->Data->Layer[PCB->LayerGroups.Entries[group][0]];
+ PCB_PAD_LOOP(element);
+ {
+ pcb_line_t *line;
+ line = pcb_line_new(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? slayer : clayer,
+ pad->Point1.X, pad->Point1.Y,
+ pad->Point2.X, pad->Point2.Y, pad->Thickness, pad->Clearance, pcb_no_flags());
+ if (line)
+ line->Number = pcb_strdup_null(pad->Number);
+ }
+ PCB_END_LOOP;
+ pcb_element_destroy(element);
+ pcb_element_free(element);
+ return (pcb_true);
+}
+
+/* see if a polygon is a rectangle. If so, canonicalize it. */
+static int polygon_is_rectangle(pcb_polygon_t *poly)
+{
+ int i, best;
+ pcb_point_t temp[4];
+ if (poly->PointN != 4 || poly->HoleIndexN != 0)
+ return 0;
+ best = 0;
+ for (i = 1; i < 4; i++)
+ if (poly->Points[i].X < poly->Points[best].X || poly->Points[i].Y < poly->Points[best].Y)
+ best = i;
+ for (i = 0; i < 4; i++)
+ temp[i] = poly->Points[(i + best) % 4];
+ if (temp[0].X == temp[1].X)
+ memcpy(poly->Points, temp, sizeof(temp));
+ else {
+ /* reverse them */
+ poly->Points[0] = temp[0];
+ poly->Points[1] = temp[3];
+ poly->Points[2] = temp[2];
+ poly->Points[3] = temp[1];
+ }
+ if (poly->Points[0].X == poly->Points[1].X
+ && poly->Points[1].Y == poly->Points[2].Y
+ && poly->Points[2].X == poly->Points[3].X && poly->Points[3].Y == poly->Points[0].Y)
+ return 1;
+ return 0;
+}
+
+/* convert buffer contents into an element */
+pcb_bool pcb_element_convert_from_buffer(pcb_buffer_t *Buffer)
+{
+ pcb_element_t *Element;
+ pcb_layergrp_id_t group;
+ pcb_cardinal_t pin_n = 1;
+ pcb_bool hasParts = pcb_false, crooked = pcb_false;
+ int onsolder;
+ pcb_bool warned = pcb_false;
+
+ if (Buffer->Data->pcb == 0)
+ Buffer->Data->pcb = PCB;
+
+ Element = pcb_element_new(PCB->Data, NULL, &PCB->Font, pcb_no_flags(),
+ NULL, NULL, NULL, PCB_PASTEBUFFER->X,
+ PCB_PASTEBUFFER->Y, 0, 100, pcb_flag_make(PCB_SWAP_IDENT ? PCB_FLAG_ONSOLDER : PCB_FLAG_NO), pcb_false);
+ if (!Element)
+ return (pcb_false);
+ PCB_VIA_LOOP(Buffer->Data);
+ {
+ char num[8];
+ if (via->Mask < via->Thickness)
+ via->Mask = via->Thickness + 2 * PCB_MASKFRAME;
+ if (via->Name)
+ pcb_element_pin_new(Element, via->X, via->Y, via->Thickness,
+ via->Clearance, via->Mask, via->DrillingHole,
+ NULL, via->Name, pcb_flag_mask(via->Flags, PCB_FLAG_VIA | PCB_FLAG_FOUND | PCB_FLAG_SELECTED | PCB_FLAG_WARN));
+ else {
+ sprintf(num, "%d", pin_n++);
+ pcb_element_pin_new(Element, via->X, via->Y, via->Thickness,
+ via->Clearance, via->Mask, via->DrillingHole,
+ NULL, num, pcb_flag_mask(via->Flags, PCB_FLAG_VIA | PCB_FLAG_FOUND | PCB_FLAG_SELECTED | PCB_FLAG_WARN));
+ }
+ hasParts = pcb_true;
+ }
+ PCB_END_LOOP;
+
+ for (onsolder = 0; onsolder < 2; onsolder++) {
+ int silk_layer;
+ int onsolderflag;
+
+ if ((!onsolder) == (!PCB_SWAP_IDENT)) {
+ silk_layer = pcb_component_silk_layer;
+ onsolderflag = PCB_FLAG_NO;
+ }
+ else {
+ silk_layer = pcb_solder_silk_layer;
+ onsolderflag = PCB_FLAG_ONSOLDER;
+ }
+
+#define MAYBE_WARN() \
+ if (onsolder && !hasParts && !warned) \
+ { \
+ warned = pcb_true; \
+ pcb_message \
+ (PCB_MSG_WARNING, _("Warning: All of the pads are on the opposite\n" \
+ "side from the component - that's probably not what\n" \
+ "you wanted\n")); \
+ } \
+
+ /* get the component-side SM pads */
+ group = pcb_layer_get_group(silk_layer);
+ GROUP_LOOP(Buffer->Data, group);
+ {
+ char num[8];
+ PCB_LINE_LOOP(layer);
+ {
+ sprintf(num, "%d", pin_n++);
+ pcb_element_pad_new(Element, line->Point1.X,
+ line->Point1.Y, line->Point2.X,
+ line->Point2.Y, line->Thickness,
+ line->Clearance,
+ line->Thickness + line->Clearance, NULL, line->Number ? line->Number : num, pcb_flag_make(onsolderflag));
+ MAYBE_WARN();
+ hasParts = pcb_true;
+ }
+ PCB_END_LOOP;
+ PCB_POLY_LOOP(layer);
+ {
+ pcb_coord_t x1, y1, x2, y2, w, h, t;
+
+ if (!polygon_is_rectangle(polygon)) {
+ crooked = pcb_true;
+ continue;
+ }
+
+ w = polygon->Points[2].X - polygon->Points[0].X;
+ h = polygon->Points[1].Y - polygon->Points[0].Y;
+ t = (w < h) ? w : h;
+ x1 = polygon->Points[0].X + t / 2;
+ y1 = polygon->Points[0].Y + t / 2;
+ x2 = x1 + (w - t);
+ y2 = y1 + (h - t);
+
+ sprintf(num, "%d", pin_n++);
+ pcb_element_pad_new(Element,
+ x1, y1, x2, y2, t,
+ 2 * conf_core.design.clearance, t + conf_core.design.clearance, NULL, num, pcb_flag_make(PCB_FLAG_SQUARE | onsolderflag));
+ MAYBE_WARN();
+ hasParts = pcb_true;
+ }
+ PCB_END_LOOP;
+ }
+ PCB_END_LOOP;
+ }
+
+ /* now add the silkscreen. NOTE: elements must have pads or pins too */
+ PCB_LINE_LOOP(&Buffer->Data->SILKLAYER);
+ {
+ if (line->Number && !PCB_ELEM_NAME_REFDES(Element))
+ PCB_ELEM_NAME_REFDES(Element) = pcb_strdup(line->Number);
+ pcb_element_line_new(Element, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y, line->Thickness);
+ hasParts = pcb_true;
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(&Buffer->Data->SILKLAYER);
+ {
+ pcb_element_arc_new(Element, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness);
+ hasParts = pcb_true;
+ }
+ PCB_END_LOOP;
+ if (!hasParts) {
+ pcb_destroy_object(PCB->Data, PCB_TYPE_ELEMENT, Element, Element, Element);
+ pcb_message(PCB_MSG_ERROR, _("There was nothing to convert!\n" "Elements must have some silk, pads or pins.\n"));
+ return (pcb_false);
+ }
+ if (crooked)
+ pcb_message(PCB_MSG_ERROR, _("There were polygons that can't be made into pins!\n" "So they were not included in the element\n"));
+ Element->MarkX = Buffer->X;
+ Element->MarkY = Buffer->Y;
+ if (PCB_SWAP_IDENT)
+ PCB_FLAG_SET(PCB_FLAG_ONSOLDER, Element);
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ pcb_buffer_clear(Buffer);
+ pcb_move_obj_to_buffer(Buffer->Data, PCB->Data, PCB_TYPE_ELEMENT, Element, Element, Element);
+ pcb_set_buffer_bbox(Buffer);
+ return (pcb_true);
+}
+
+void pcb_element_rotate(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, pcb_angle_t angle)
+{
+ /* solder side objects need a different orientation */
+
+ /* the text subroutine decides by itself if the direction
+ * is to be corrected
+ */
+#if 0
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (Data && Data->name_tree[n])
+ pcb_r_delete_entry(Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_rotate90(text, X, Y, Number);
+ }
+ PCB_END_LOOP;
+#endif
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ pcb_rotate(&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina);
+ pcb_rotate(&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina);
+ pcb_line_bbox(line);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(Element);
+ {
+ /* pre-delete the pins from the pin-tree before their coordinates change */
+ if (Data)
+ pcb_r_delete_entry(Data->pin_tree, (pcb_box_t *) pin);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PIN, Element, pin);
+ pcb_rotate(&pin->X, &pin->Y, X, Y, cosa, sina);
+ pcb_pin_bbox(pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ /* pre-delete the pads before their coordinates change */
+ if (Data)
+ pcb_r_delete_entry(Data->pad_tree, (pcb_box_t *) pad);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PAD, Element, pad);
+ pcb_rotate(&pad->Point1.X, &pad->Point1.Y, X, Y, cosa, sina);
+ pcb_rotate(&pad->Point2.X, &pad->Point2.Y, X, Y, cosa, sina);
+ pcb_line_bbox((pcb_line_t *) pad);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ pcb_rotate(&arc->X, &arc->Y, X, Y, cosa, sina);
+ arc->StartAngle = pcb_normalize_angle(arc->StartAngle + angle);
+ }
+ PCB_END_LOOP;
+
+ pcb_rotate(&Element->MarkX, &Element->MarkY, X, Y, cosa, sina);
+ pcb_element_bbox(Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element);
+}
+
+/* changes the side of the board an element is on; returns pcb_true if done */
+pcb_bool pcb_element_change_side(pcb_element_t *Element, pcb_coord_t yoff)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (pcb_false);
+ EraseElement(Element);
+ pcb_undo_add_obj_to_mirror(PCB_TYPE_ELEMENT, Element, Element, Element, yoff);
+ pcb_element_mirror(PCB->Data, Element, yoff);
+ DrawElement(Element);
+ return (pcb_true);
+}
+
+/* changes the side of all selected and visible elements;
+ returns pcb_true if anything has changed */
+pcb_bool pcb_selected_element_change_side(void)
+{
+ pcb_bool change = pcb_false;
+
+ if (PCB->PinOn && PCB->ElementOn)
+ PCB_ELEMENT_LOOP(PCB->Data);
+ {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) {
+ change |= pcb_element_change_side(element, 0);
+ }
+ }
+ PCB_END_LOOP;
+ if (change) {
+ pcb_draw();
+ pcb_undo_inc_serial();
+ }
+ return (change);
+}
+
+/* changes the layout-name of an element */
+char *pcb_element_text_change(pcb_board_t * pcb, pcb_data_t * data, pcb_element_t *Element, int which, char *new_name)
+{
+ char *old = Element->Name[which].TextString;
+
+#ifdef DEBUG
+ printf("In ChangeElementText, updating old TextString %s to %s\n", old, new_name);
+#endif
+
+ if (pcb && which == PCB_ELEMNAME_IDX_VISIBLE())
+ EraseElementName(Element);
+
+ pcb_r_delete_entry(data->name_tree[which], &Element->Name[which].BoundingBox);
+
+ Element->Name[which].TextString = new_name;
+ pcb_text_bbox(&PCB->Font, &Element->Name[which]);
+
+ pcb_r_insert_entry(data->name_tree[which], &Element->Name[which].BoundingBox, 0);
+
+ if (pcb && which == PCB_ELEMNAME_IDX_VISIBLE())
+ DrawElementName(Element);
+
+ return old;
+}
+
+/* copies data from one element to another and creates the destination; if necessary */
+pcb_element_t *pcb_element_copy(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy)
+{
+ int i;
+ /* release old memory if necessary */
+ if (Dest)
+ pcb_element_destroy(Dest);
+
+ /* both coordinates and flags are the same */
+ Dest = pcb_element_new(Data, Dest, &PCB->Font,
+ pcb_flag_mask(Src->Flags, PCB_FLAG_FOUND),
+ PCB_ELEM_NAME_DESCRIPTION(Src), PCB_ELEM_NAME_REFDES(Src),
+ PCB_ELEM_NAME_VALUE(Src), PCB_ELEM_TEXT_DESCRIPTION(Src).X + dx,
+ PCB_ELEM_TEXT_DESCRIPTION(Src).Y + dy,
+ PCB_ELEM_TEXT_DESCRIPTION(Src).Direction,
+ PCB_ELEM_TEXT_DESCRIPTION(Src).Scale, pcb_flag_mask(PCB_ELEM_TEXT_DESCRIPTION(Src).Flags, PCB_FLAG_FOUND), uniqueName);
+
+ /* abort on error */
+ if (!Dest)
+ return (Dest);
+
+ PCB_ELEMENT_PCB_LINE_LOOP(Src);
+ {
+ pcb_element_line_new(Dest, line->Point1.X + dx,
+ line->Point1.Y + dy, line->Point2.X + dx, line->Point2.Y + dy, line->Thickness);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(Src);
+ {
+ pcb_element_pin_new(Dest, pin->X + dx, pin->Y + dy, pin->Thickness,
+ pin->Clearance, pin->Mask, pin->DrillingHole, pin->Name, pin->Number, pcb_flag_mask(pin->Flags, PCB_FLAG_FOUND));
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Src);
+ {
+ pcb_element_pad_new(Dest, pad->Point1.X + dx, pad->Point1.Y + dy,
+ pad->Point2.X + dx, pad->Point2.Y + dy, pad->Thickness,
+ pad->Clearance, pad->Mask, pad->Name, pad->Number, pcb_flag_mask(pad->Flags, PCB_FLAG_FOUND));
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Src);
+ {
+ pcb_element_arc_new(Dest, arc->X + dx, arc->Y + dy, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness);
+ }
+ PCB_END_LOOP;
+
+ for (i = 0; i < Src->Attributes.Number; i++)
+ pcb_attribute_put(&Dest->Attributes, Src->Attributes.List[i].name, Src->Attributes.List[i].value, 0);
+
+ Dest->MarkX = Src->MarkX + dx;
+ Dest->MarkY = Src->MarkY + dy;
+
+ pcb_element_bbox(Data, Dest, &PCB->Font);
+ return (Dest);
+}
+
+/* creates an new element; memory is allocated if needed */
+pcb_element_t *pcb_element_new(pcb_data_t *Data, pcb_element_t *Element,
+ pcb_font_t *PCBFont, pcb_flag_t Flags, char *Description, char *NameOnPCB,
+ char *Value, pcb_coord_t TextX, pcb_coord_t TextY, pcb_uint8_t Direction,
+ int TextScale, pcb_flag_t TextFlags, pcb_bool uniqueName)
+{
+#ifdef DEBUG
+ printf("Entered CreateNewElement.....\n");
+#endif
+
+ if (!Element)
+ Element = pcb_element_alloc(Data);
+
+ /* copy values and set additional information */
+ TextScale = MAX(PCB_MIN_TEXTSCALE, TextScale);
+ pcb_element_text_set(&PCB_ELEM_TEXT_DESCRIPTION(Element), PCBFont, TextX, TextY, Direction, Description, TextScale, TextFlags);
+ if (uniqueName)
+ NameOnPCB = pcb_element_uniq_name(Data, NameOnPCB);
+ pcb_element_text_set(&PCB_ELEM_TEXT_REFDES(Element), PCBFont, TextX, TextY, Direction, NameOnPCB, TextScale, TextFlags);
+ pcb_element_text_set(&PCB_ELEM_TEXT_VALUE(Element), PCBFont, TextX, TextY, Direction, Value, TextScale, TextFlags);
+ PCB_ELEM_TEXT_DESCRIPTION(Element).Element = Element;
+ PCB_ELEM_TEXT_REFDES(Element).Element = Element;
+ PCB_ELEM_TEXT_VALUE(Element).Element = Element;
+ Element->Flags = Flags;
+ Element->ID = pcb_create_ID_get();
+
+#ifdef DEBUG
+ printf(" .... Leaving CreateNewElement.\n");
+#endif
+
+ return (Element);
+}
+
+/* creates a new arc in an element */
+pcb_arc_t *pcb_element_arc_new(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y,
+ pcb_coord_t Width, pcb_coord_t Height, pcb_angle_t angle, pcb_angle_t delta, pcb_coord_t Thickness)
+{
+ pcb_arc_t *arc = pcb_element_arc_alloc(Element);
+
+ /* set Delta (0,360], StartAngle in [0,360) */
+ if (delta < 0) {
+ delta = -delta;
+ angle -= delta;
+ }
+ angle = pcb_normalize_angle(angle);
+ delta = pcb_normalize_angle(delta);
+ if (delta == 0)
+ delta = 360;
+
+ /* copy values */
+ arc->X = X;
+ arc->Y = Y;
+ arc->Width = Width;
+ arc->Height = Height;
+ arc->StartAngle = angle;
+ arc->Delta = delta;
+ arc->Thickness = Thickness;
+ arc->ID = pcb_create_ID_get();
+ return arc;
+}
+
+/* creates a new line for an element */
+pcb_line_t *pcb_element_line_new(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness)
+{
+ pcb_line_t *line;
+
+ if (Thickness == 0)
+ return NULL;
+
+ line = pcb_element_line_alloc(Element);
+
+ /* copy values */
+ line->Point1.X = X1;
+ line->Point1.Y = Y1;
+ line->Point2.X = X2;
+ line->Point2.Y = Y2;
+ line->Thickness = Thickness;
+ line->Flags = pcb_no_flags();
+ line->ID = pcb_create_ID_get();
+ return line;
+}
+
+/* creates a new textobject as part of an element
+ copies the values to the appropriate text object */
+void pcb_element_text_set(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y,
+ unsigned Direction, char *TextString, int Scale, pcb_flag_t Flags)
+{
+ free(Text->TextString);
+ Text->TextString = (TextString && *TextString) ? pcb_strdup(TextString) : NULL;
+ Text->X = X;
+ Text->Y = Y;
+ Text->Direction = Direction;
+ Text->Flags = Flags;
+ Text->Scale = Scale;
+
+ /* calculate size of the bounding box */
+ pcb_text_bbox(PCBFont, Text);
+ Text->ID = pcb_create_ID_get();
+}
+
+/* mirrors the coordinates of an element; an additional offset is passed */
+void pcb_element_mirror(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t yoff)
+{
+ r_delete_element(Data, Element);
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ line->Point1.X = PCB_SWAP_X(line->Point1.X);
+ line->Point1.Y = PCB_SWAP_Y(line->Point1.Y) + yoff;
+ line->Point2.X = PCB_SWAP_X(line->Point2.X);
+ line->Point2.Y = PCB_SWAP_Y(line->Point2.Y) + yoff;
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(Element);
+ {
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PIN, Element, pin);
+ pin->X = PCB_SWAP_X(pin->X);
+ pin->Y = PCB_SWAP_Y(pin->Y) + yoff;
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PAD, Element, pad);
+ pad->Point1.X = PCB_SWAP_X(pad->Point1.X);
+ pad->Point1.Y = PCB_SWAP_Y(pad->Point1.Y) + yoff;
+ pad->Point2.X = PCB_SWAP_X(pad->Point2.X);
+ pad->Point2.Y = PCB_SWAP_Y(pad->Point2.Y) + yoff;
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, pad);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ arc->X = PCB_SWAP_X(arc->X);
+ arc->Y = PCB_SWAP_Y(arc->Y) + yoff;
+ arc->StartAngle = PCB_SWAP_ANGLE(arc->StartAngle);
+ arc->Delta = PCB_SWAP_DELTA(arc->Delta);
+ }
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ text->X = PCB_SWAP_X(text->X);
+ text->Y = PCB_SWAP_Y(text->Y) + yoff;
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, text);
+ }
+ PCB_END_LOOP;
+ Element->MarkX = PCB_SWAP_X(Element->MarkX);
+ Element->MarkY = PCB_SWAP_Y(Element->MarkY) + yoff;
+
+ /* now toggle the solder-side flag */
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, Element);
+ /* this inserts all of the rtree data too */
+ pcb_element_bbox(Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element);
+}
+
+/* sets the bounding box of an elements */
+void pcb_element_bbox(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *Font)
+{
+ pcb_box_t *box, *vbox;
+
+ if (Data && Data->element_tree)
+ pcb_r_delete_entry(Data->element_tree, (pcb_box_t *) Element);
+ /* first update the text objects */
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (Data && Data->name_tree[n])
+ pcb_r_delete_entry(Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_bbox(Font, text);
+ if (Data && !Data->name_tree[n])
+ Data->name_tree[n] = pcb_r_create_tree(NULL, 0, 0);
+ if (Data)
+ pcb_r_insert_entry(Data->name_tree[n], (pcb_box_t *) text, 0);
+ }
+ PCB_END_LOOP;
+
+ /* do not include the elementnames bounding box which
+ * is handled separately
+ */
+ box = &Element->BoundingBox;
+ vbox = &Element->VBox;
+ box->X1 = box->Y1 = PCB_MAX_COORD;
+ box->X2 = box->Y2 = 0;
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ pcb_line_bbox(line);
+ PCB_MAKE_MIN(box->X1, line->Point1.X - (line->Thickness + 1) / 2);
+ PCB_MAKE_MIN(box->Y1, line->Point1.Y - (line->Thickness + 1) / 2);
+ PCB_MAKE_MIN(box->X1, line->Point2.X - (line->Thickness + 1) / 2);
+ PCB_MAKE_MIN(box->Y1, line->Point2.Y - (line->Thickness + 1) / 2);
+ PCB_MAKE_MAX(box->X2, line->Point1.X + (line->Thickness + 1) / 2);
+ PCB_MAKE_MAX(box->Y2, line->Point1.Y + (line->Thickness + 1) / 2);
+ PCB_MAKE_MAX(box->X2, line->Point2.X + (line->Thickness + 1) / 2);
+ PCB_MAKE_MAX(box->Y2, line->Point2.Y + (line->Thickness + 1) / 2);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ pcb_arc_bbox(arc);
+ PCB_MAKE_MIN(box->X1, arc->BoundingBox.X1);
+ PCB_MAKE_MIN(box->Y1, arc->BoundingBox.Y1);
+ PCB_MAKE_MAX(box->X2, arc->BoundingBox.X2);
+ PCB_MAKE_MAX(box->Y2, arc->BoundingBox.Y2);
+ }
+ PCB_END_LOOP;
+ *vbox = *box;
+ PCB_PIN_LOOP(Element);
+ {
+ if (Data && Data->pin_tree)
+ pcb_r_delete_entry(Data->pin_tree, (pcb_box_t *) pin);
+ pcb_pin_bbox(pin);
+ if (Data) {
+ if (!Data->pin_tree)
+ Data->pin_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Data->pin_tree, (pcb_box_t *) pin, 0);
+ }
+ PCB_MAKE_MIN(box->X1, pin->BoundingBox.X1);
+ PCB_MAKE_MIN(box->Y1, pin->BoundingBox.Y1);
+ PCB_MAKE_MAX(box->X2, pin->BoundingBox.X2);
+ PCB_MAKE_MAX(box->Y2, pin->BoundingBox.Y2);
+ PCB_MAKE_MIN(vbox->X1, pin->X - pin->Thickness / 2);
+ PCB_MAKE_MIN(vbox->Y1, pin->Y - pin->Thickness / 2);
+ PCB_MAKE_MAX(vbox->X2, pin->X + pin->Thickness / 2);
+ PCB_MAKE_MAX(vbox->Y2, pin->Y + pin->Thickness / 2);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ if (Data && Data->pad_tree)
+ pcb_r_delete_entry(Data->pad_tree, (pcb_box_t *) pad);
+ pcb_pad_bbox(pad);
+ if (Data) {
+ if (!Data->pad_tree)
+ Data->pad_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Data->pad_tree, (pcb_box_t *) pad, 0);
+ }
+ PCB_MAKE_MIN(box->X1, pad->BoundingBox.X1);
+ PCB_MAKE_MIN(box->Y1, pad->BoundingBox.Y1);
+ PCB_MAKE_MAX(box->X2, pad->BoundingBox.X2);
+ PCB_MAKE_MAX(box->Y2, pad->BoundingBox.Y2);
+ PCB_MAKE_MIN(vbox->X1, MIN(pad->Point1.X, pad->Point2.X) - pad->Thickness / 2);
+ PCB_MAKE_MIN(vbox->Y1, MIN(pad->Point1.Y, pad->Point2.Y) - pad->Thickness / 2);
+ PCB_MAKE_MAX(vbox->X2, MAX(pad->Point1.X, pad->Point2.X) + pad->Thickness / 2);
+ PCB_MAKE_MAX(vbox->Y2, MAX(pad->Point1.Y, pad->Point2.Y) + pad->Thickness / 2);
+ }
+ PCB_END_LOOP;
+ /* now we set the PCB_FLAG_EDGE2 of the pad if Point2
+ * is closer to the outside edge than Point1
+ */
+ PCB_PAD_LOOP(Element);
+ {
+ if (pad->Point1.Y == pad->Point2.Y) {
+ /* horizontal pad */
+ if (box->X2 - pad->Point2.X < pad->Point1.X - box->X1)
+ PCB_FLAG_SET(PCB_FLAG_EDGE2, pad);
+ else
+ PCB_FLAG_CLEAR(PCB_FLAG_EDGE2, pad);
+ }
+ else {
+ /* vertical pad */
+ if (box->Y2 - pad->Point2.Y < pad->Point1.Y - box->Y1)
+ PCB_FLAG_SET(PCB_FLAG_EDGE2, pad);
+ else
+ PCB_FLAG_CLEAR(PCB_FLAG_EDGE2, pad);
+ }
+ }
+ PCB_END_LOOP;
+
+ /* mark pins with component orientation */
+ if ((box->X2 - box->X1) > (box->Y2 - box->Y1)) {
+ PCB_PIN_LOOP(Element);
+ {
+ PCB_FLAG_SET(PCB_FLAG_EDGE2, pin);
+ }
+ PCB_END_LOOP;
+ }
+ else {
+ PCB_PIN_LOOP(Element);
+ {
+ PCB_FLAG_CLEAR(PCB_FLAG_EDGE2, pin);
+ }
+ PCB_END_LOOP;
+ }
+ pcb_close_box(box);
+ pcb_close_box(vbox);
+ if (Data && !Data->element_tree)
+ Data->element_tree = pcb_r_create_tree(NULL, 0, 0);
+ if (Data)
+ pcb_r_insert_entry(Data->element_tree, box, 0);
+}
+
+static char *BumpName(char *Name)
+{
+ int num;
+ char c, *start;
+ static char temp[256];
+
+ start = Name;
+ /* seek end of string */
+ while (*Name != 0)
+ Name++;
+ /* back up to potential number */
+ for (Name--; isdigit((int) *Name); Name--);
+ Name++;
+ if (*Name)
+ num = atoi(Name) + 1;
+ else
+ num = 1;
+ c = *Name;
+ *Name = 0;
+ sprintf(temp, "%s%d", start, num);
+ /* if this is not our string, put back the blown character */
+ if (start != temp)
+ *Name = c;
+ return (temp);
+}
+
+
+/* make a unique name for the name on board
+ * this can alter the contents of the input string */
+char *pcb_element_uniq_name(pcb_data_t *Data, char *Name)
+{
+ pcb_bool unique = pcb_true;
+ /* null strings are ok */
+ if (!Name || !*Name)
+ return (Name);
+
+ for (;;) {
+ PCB_ELEMENT_LOOP(Data);
+ {
+ if (PCB_ELEM_NAME_REFDES(element) && PCB_NSTRCMP(PCB_ELEM_NAME_REFDES(element), Name) == 0) {
+ Name = BumpName(Name);
+ unique = pcb_false;
+ break;
+ }
+ }
+ PCB_END_LOOP;
+ if (unique)
+ return (Name);
+ unique = pcb_true;
+ }
+}
+
+void r_delete_element(pcb_data_t * data, pcb_element_t * element)
+{
+ pcb_r_delete_entry(data->element_tree, (pcb_box_t *) element);
+ PCB_PIN_LOOP(element);
+ {
+ pcb_r_delete_entry(data->pin_tree, (pcb_box_t *) pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ pcb_r_delete_entry(data->pad_tree, (pcb_box_t *) pad);
+ }
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
+ {
+ pcb_r_delete_entry(data->name_tree[n], (pcb_box_t *) text);
+ }
+ PCB_END_LOOP;
+}
+
+/* Returns a best guess about the orientation of an element. The
+ * value corresponds to the rotation; a difference is the right value
+ * to pass to RotateElementLowLevel. However, the actual value is no
+ * indication of absolute rotation; only relative rotation is
+ * meaningful.
+ */
+int pcb_element_get_orientation(pcb_element_t * e)
+{
+ pcb_coord_t pin1x, pin1y, pin2x, pin2y, dx, dy;
+ pcb_bool found_pin1 = 0;
+ pcb_bool found_pin2 = 0;
+
+ /* in case we don't find pin 1 or 2, make sure we have initialized these variables */
+ pin1x = 0;
+ pin1y = 0;
+ pin2x = 0;
+ pin2y = 0;
+
+ PCB_PIN_LOOP(e);
+ {
+ if (PCB_NSTRCMP(pin->Number, "1") == 0) {
+ pin1x = pin->X;
+ pin1y = pin->Y;
+ found_pin1 = 1;
+ }
+ else if (PCB_NSTRCMP(pin->Number, "2") == 0) {
+ pin2x = pin->X;
+ pin2y = pin->Y;
+ found_pin2 = 1;
+ }
+ }
+ PCB_END_LOOP;
+
+ PCB_PAD_LOOP(e);
+ {
+ if (PCB_NSTRCMP(pad->Number, "1") == 0) {
+ pin1x = (pad->Point1.X + pad->Point2.X) / 2;
+ pin1y = (pad->Point1.Y + pad->Point2.Y) / 2;
+ found_pin1 = 1;
+ }
+ else if (PCB_NSTRCMP(pad->Number, "2") == 0) {
+ pin2x = (pad->Point1.X + pad->Point2.X) / 2;
+ pin2y = (pad->Point1.Y + pad->Point2.Y) / 2;
+ found_pin2 = 1;
+ }
+ }
+ PCB_END_LOOP;
+
+ if (found_pin1 && found_pin2) {
+ dx = pin2x - pin1x;
+ dy = pin2y - pin1y;
+ }
+ else if (found_pin1 && (pin1x || pin1y)) {
+ dx = pin1x;
+ dy = pin1y;
+ }
+ else if (found_pin2 && (pin2x || pin2y)) {
+ dx = pin2x;
+ dy = pin2y;
+ }
+ else
+ return 0;
+
+ if (coord_abs(dx) > coord_abs(dy))
+ return dx > 0 ? 0 : 2;
+ return dy > 0 ? 3 : 1;
+}
+
+/* moves a element by +-X and +-Y */
+void pcb_element_move(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY)
+{
+ if (Data)
+ pcb_r_delete_entry(Data->element_tree, (pcb_box_t *) Element);
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ pcb_line_move(line, DX, DY);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(Element);
+ {
+ if (Data) {
+ pcb_r_delete_entry(Data->pin_tree, (pcb_box_t *) pin);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PIN, Element, pin);
+ }
+ pcb_pin_move(pin, DX, DY);
+ if (Data) {
+ pcb_r_insert_entry(Data->pin_tree, (pcb_box_t *) pin, 0);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_PIN, Element, pin);
+ }
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ if (Data) {
+ pcb_r_delete_entry(Data->pad_tree, (pcb_box_t *) pad);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PAD, Element, pad);
+ }
+ pcb_pad_move(pad, DX, DY);
+ if (Data) {
+ pcb_r_insert_entry(Data->pad_tree, (pcb_box_t *) pad, 0);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_PAD, Element, pad);
+ }
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ pcb_arc_move(arc, DX, DY);
+ }
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (Data && Data->name_tree[n])
+ pcb_r_delete_entry(PCB->Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_move(text, DX, DY);
+ if (Data && Data->name_tree[n])
+ pcb_r_insert_entry(PCB->Data->name_tree[n], (pcb_box_t *) text, 0);
+ }
+ PCB_END_LOOP;
+ PCB_BOX_MOVE_LOWLEVEL(&Element->BoundingBox, DX, DY);
+ PCB_BOX_MOVE_LOWLEVEL(&Element->VBox, DX, DY);
+ PCB_MOVE(Element->MarkX, Element->MarkY, DX, DY);
+ if (Data)
+ pcb_r_insert_entry(Data->element_tree, (pcb_box_t *) Element, 0);
+}
+
+void *pcb_element_remove(pcb_element_t *Element)
+{
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = NULL;
+
+ return RemoveElement_op(&ctx, Element);
+}
+
+/* rotate an element in 90 degree steps */
+void pcb_element_rotate90(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
+{
+ /* solder side objects need a different orientation */
+
+ /* the text subroutine decides by itself if the direction
+ * is to be corrected
+ */
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (Data && Data->name_tree[n])
+ pcb_r_delete_entry(Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_rotate90(text, X, Y, Number);
+ }
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ pcb_line_rotate90(line, X, Y, Number);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(Element);
+ {
+ /* pre-delete the pins from the pin-tree before their coordinates change */
+ if (Data)
+ pcb_r_delete_entry(Data->pin_tree, (pcb_box_t *) pin);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PIN, Element, pin);
+ PCB_PIN_ROTATE90(pin, X, Y, Number);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ /* pre-delete the pads before their coordinates change */
+ if (Data)
+ pcb_r_delete_entry(Data->pad_tree, (pcb_box_t *) pad);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_PAD, Element, pad);
+ PCB_PAD_ROTATE90(pad, X, Y, Number);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ pcb_arc_rotate90(arc, X, Y, Number);
+ }
+ PCB_END_LOOP;
+ PCB_COORD_ROTATE90(Element->MarkX, Element->MarkY, X, Y, Number);
+ /* SetElementBoundingBox reenters the rtree data */
+ pcb_element_bbox(Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element);
+}
+
+unsigned int pcb_element_hash(const pcb_element_t *e)
+{
+ unsigned int val = 0;
+ gdl_iterator_t it;
+
+ {
+ pcb_pin_t *p;
+ pinlist_foreach(&e->Pin, &it, p) {
+ val ^= pcb_pin_hash(e, p);
+ }
+ }
+
+ {
+ pcb_pad_t *p;
+ padlist_foreach(&e->Pad, &it, p) {
+ val ^= pcb_pad_hash(e, p);
+ }
+ }
+
+ {
+ pcb_line_t *l;
+ linelist_foreach(&e->Line, &it, l) {
+ val ^= pcb_line_hash(e, l);
+ }
+ }
+
+ {
+ pcb_arc_t *a;
+ linelist_foreach(&e->Arc, &it, a) {
+ val ^= pcb_arc_hash(e, a);
+ }
+ }
+
+ return val;
+}
+
+int pcb_element_eq(const pcb_element_t *e1, const pcb_element_t *e2)
+{
+ /* Require the same objects in the same order - bail out at the first mismatch */
+
+ {
+ pcb_pin_t *p1, *p2;
+ p1 = pinlist_first((pinlist_t *)&e1->Pin);
+ p2 = pinlist_first((pinlist_t *)&e2->Pin);
+ for(;;) {
+ if ((p1 == NULL) && (p2 == NULL))
+ break;
+ if (!pcb_pin_eq(e1, p1, e2, p2))
+ return 0;
+ p1 = pinlist_next(p1);
+ p2 = pinlist_next(p2);
+ }
+ }
+
+ {
+ pcb_pad_t *p1, *p2;
+ p1 = padlist_first((padlist_t *)&e1->Pad);
+ p2 = padlist_first((padlist_t *)&e2->Pad);
+ for(;;) {
+ if ((p1 == NULL) && (p2 == NULL))
+ break;
+ if (!pcb_pad_eq(e1, p1, e2, p2))
+ return 0;
+ p1 = padlist_next(p1);
+ p2 = padlist_next(p2);
+ }
+ }
+
+ {
+ pcb_line_t *l1, *l2;
+ l1 = linelist_first((linelist_t *)&e1->Line);
+ l2 = linelist_first((linelist_t *)&e2->Line);
+ for(;;) {
+ if ((l1 == NULL) && (l2 == NULL))
+ break;
+ if (!pcb_line_eq(e1, l1, e2, l2))
+ return 0;
+ l1 = linelist_next(l1);
+ l2 = linelist_next(l2);
+ }
+ }
+
+ {
+ pcb_arc_t *a1, *a2;
+ a1 = arclist_first((arclist_t *)&e1->Arc);
+ a2 = arclist_first((arclist_t *)&e2->Arc);
+ for(;;) {
+ if ((a1 == NULL) && (a2 == NULL))
+ break;
+ if (!pcb_arc_eq(e1, a1, e2, a2))
+ return 0;
+ a1 = arclist_next(a1);
+ a2 = arclist_next(a2);
+ }
+ }
+
+ return 1;
+}
+
+
+
+/*** ops ***/
+/* copies a element to buffer */
+void *AddElementToBuffer(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ pcb_element_t *element;
+
+ element = pcb_element_alloc(ctx->buffer.dst);
+ pcb_element_copy(ctx->buffer.dst, element, Element, pcb_false, 0, 0);
+ PCB_FLAG_CLEAR(ctx->buffer.extraflg, element);
+ if (ctx->buffer.extraflg) {
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
+ {
+ PCB_FLAG_CLEAR(ctx->buffer.extraflg, text);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(element);
+ {
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND | ctx->buffer.extraflg, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND | ctx->buffer.extraflg, pad);
+ }
+ PCB_END_LOOP;
+ }
+ return (element);
+}
+
+/* moves a element to buffer without allocating memory for pins/names */
+void *MoveElementToBuffer(pcb_opctx_t *ctx, pcb_element_t * element)
+{
+ /*
+ * Delete the element from the source (remove it from trees,
+ * restore to polygons)
+ */
+ r_delete_element(ctx->buffer.src, element);
+
+ elementlist_remove(element);
+ elementlist_append(&ctx->buffer.dst->Element, element);
+
+ PCB_PIN_LOOP(element);
+ {
+ pcb_poly_restore_to_poly(ctx->buffer.src, PCB_TYPE_PIN, element, pin);
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ pcb_poly_restore_to_poly(ctx->buffer.src, PCB_TYPE_PAD, element, pad);
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND, pad);
+ }
+ PCB_END_LOOP;
+ pcb_element_bbox(ctx->buffer.dst, element, &PCB->Font);
+ /*
+ * Now clear the from the polygons in the destination
+ */
+ PCB_PIN_LOOP(element);
+ {
+ pcb_poly_clear_from_poly(ctx->buffer.dst, PCB_TYPE_PIN, element, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ pcb_poly_clear_from_poly(ctx->buffer.dst, PCB_TYPE_PAD, element, pad);
+ }
+ PCB_END_LOOP;
+
+ return element;
+}
+
+
+/* changes the drilling hole of all pins of an element; returns pcb_true if changed */
+void *ChangeElement2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ pcb_bool changed = pcb_false;
+ pcb_coord_t value;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : pin->DrillingHole + ctx->chgsize.delta;
+ if (value <= PCB_MAX_PINORVIASIZE &&
+ value >= PCB_MIN_PINORVIAHOLE && (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) || value <= pin->Thickness - PCB_MIN_PINORVIACOPPER)
+ && value != pin->DrillingHole) {
+ changed = pcb_true;
+ pcb_undo_add_obj_to_2nd_size(PCB_TYPE_PIN, Element, pin, pin);
+ ErasePin(pin);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, pin);
+ pin->DrillingHole = value;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PIN, Element, pin, pin);
+ pin->Thickness = value;
+ }
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, pin);
+ DrawPin(pin);
+ }
+ }
+ PCB_END_LOOP;
+ if (changed)
+ return (Element);
+ else
+ return (NULL);
+}
+
+/* changes ring dia of all pins of an element; returns pcb_true if changed */
+void *ChangeElement1stSize(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ pcb_bool changed = pcb_false;
+ pcb_coord_t value;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : pin->DrillingHole + ctx->chgsize.delta;
+ if (value <= PCB_MAX_PINORVIASIZE && value >= pin->DrillingHole + PCB_MIN_PINORVIACOPPER && value != pin->Thickness) {
+ changed = pcb_true;
+ pcb_undo_add_obj_to_size(PCB_TYPE_PIN, Element, pin, pin);
+ ErasePin(pin);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, pin);
+ pin->Thickness = value;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PIN, Element, pin, pin);
+ pin->Thickness = value;
+ }
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, pin);
+ DrawPin(pin);
+ }
+ }
+ PCB_END_LOOP;
+ if (changed)
+ return (Element);
+ else
+ return (NULL);
+}
+
+/* changes the clearance of all pins of an element; returns pcb_true if changed */
+void *ChangeElementClearSize(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ pcb_bool changed = pcb_false;
+ pcb_coord_t value;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : pin->Clearance + ctx->chgsize.delta;
+ if (value <= PCB_MAX_PINORVIASIZE &&
+ value >= PCB_MIN_PINORVIAHOLE && (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) || value <= pin->Thickness - PCB_MIN_PINORVIACOPPER)
+ && value != pin->Clearance) {
+ changed = pcb_true;
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_PIN, Element, pin, pin);
+ ErasePin(pin);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, pin);
+ pin->Clearance = value;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PIN, Element, pin, pin);
+ pin->Thickness = value;
+ }
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, pin);
+ DrawPin(pin);
+ }
+ }
+ PCB_END_LOOP;
+
+ PCB_PAD_LOOP(Element);
+ {
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : pad->Clearance + ctx->chgsize.delta;
+ if (value <= PCB_MAX_PINORVIASIZE && value >= PCB_MIN_PINORVIAHOLE && value != pad->Clearance) {
+ changed = pcb_true;
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_PAD, Element, pad, pad);
+ ErasePad(pad);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PAD, Element, pad);
+ pcb_r_delete_entry(PCB->Data->pad_tree, &pad->BoundingBox);
+ pad->Clearance = value;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pad)) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PAD, Element, pad, pad);
+ pad->Thickness = value;
+ }
+ /* SetElementBB updates all associated rtrees */
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, pad);
+ DrawPad(pad);
+ }
+ }
+ PCB_END_LOOP;
+
+ if (changed)
+ return (Element);
+ else
+ return (NULL);
+}
+
+/* changes the scaling factor of an element's outline; returns pcb_true if changed */
+void *ChangeElementSize(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ pcb_coord_t value;
+ pcb_bool changed = pcb_false;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ if (PCB->ElementOn)
+ EraseElement(Element);
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : line->Thickness + ctx->chgsize.delta;
+ if (value <= PCB_MAX_LINESIZE && value >= PCB_MIN_LINESIZE && value != line->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_ELEMENT_LINE, Element, line, line);
+ line->Thickness = value;
+ changed = pcb_true;
+ }
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : arc->Thickness + ctx->chgsize.delta;
+ if (value <= PCB_MAX_LINESIZE && value >= PCB_MIN_LINESIZE && value != arc->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_ELEMENT_ARC, Element, arc, arc);
+ arc->Thickness = value;
+ changed = pcb_true;
+ }
+ }
+ PCB_END_LOOP;
+ if (PCB->ElementOn) {
+ DrawElement(Element);
+ }
+ if (changed)
+ return (Element);
+ return (NULL);
+}
+
+/* changes the scaling factor of a elementname object; returns pcb_true if changed */
+void *ChangeElementNameSize(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ int value = ctx->chgsize.absolute ? PCB_COORD_TO_MIL(ctx->chgsize.absolute)
+ : PCB_ELEM_TEXT_DESCRIPTION(Element).Scale + PCB_COORD_TO_MIL(ctx->chgsize.delta);
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, &Element->Name[0]))
+ return (NULL);
+ if (value <= PCB_MAX_TEXTSCALE && value >= PCB_MIN_TEXTSCALE) {
+ EraseElementName(Element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ pcb_undo_add_obj_to_size(PCB_TYPE_ELEMENT_NAME, Element, text, text);
+ pcb_r_delete_entry(PCB->Data->name_tree[n], (pcb_box_t *) text);
+ text->Scale = value;
+ pcb_text_bbox(&PCB->Font, text);
+ pcb_r_insert_entry(PCB->Data->name_tree[n], (pcb_box_t *) text, 0);
+ }
+ PCB_END_LOOP;
+ DrawElementName(Element);
+ return (Element);
+ }
+ return (NULL);
+}
+
+
+void *ChangeElementName(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, &Element->Name[0]))
+ return (NULL);
+ if (PCB_ELEMNAME_IDX_VISIBLE() == PCB_ELEMNAME_IDX_REFDES) {
+ if (conf_core.editor.unique_names && pcb_element_uniq_name(PCB->Data, ctx->chgname.new_name) != ctx->chgname.new_name) {
+ pcb_message(PCB_MSG_ERROR, _("Error: The name \"%s\" is not unique!\n"), ctx->chgname.new_name);
+ return ((char *) -1);
+ }
+ }
+
+ return pcb_element_text_change(PCB, PCB->Data, Element, PCB_ELEMNAME_IDX_VISIBLE(), ctx->chgname.new_name);
+}
+
+void *ChangeElementNonetlist(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_FLAG_TOGGLE(PCB_FLAG_NONETLIST, Element);
+ return Element;
+}
+
+
+/* changes the square flag of all pins on an element */
+void *ChangeElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ void *ans = NULL;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ ans = ChangePinSquare(ctx, Element, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ ans = ChangePadSquare(ctx, Element, pad);
+ }
+ PCB_END_LOOP;
+ return (ans);
+}
+
+/* sets the square flag of all pins on an element */
+void *SetElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ void *ans = NULL;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ ans = SetPinSquare(ctx, Element, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ ans = SetPadSquare(ctx, Element, pad);
+ }
+ PCB_END_LOOP;
+ return (ans);
+}
+
+/* clears the square flag of all pins on an element */
+void *ClrElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ void *ans = NULL;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ ans = ClrPinSquare(ctx, Element, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ ans = ClrPadSquare(ctx, Element, pad);
+ }
+ PCB_END_LOOP;
+ return (ans);
+}
+
+/* changes the octagon flags of all pins of an element */
+void *ChangeElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ void *result = NULL;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ ChangePinOctagon(ctx, Element, pin);
+ result = Element;
+ }
+ PCB_END_LOOP;
+ return (result);
+}
+
+/* sets the octagon flags of all pins of an element */
+void *SetElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ void *result = NULL;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ SetPinOctagon(ctx, Element, pin);
+ result = Element;
+ }
+ PCB_END_LOOP;
+ return (result);
+}
+
+/* clears the octagon flags of all pins of an element */
+void *ClrElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ void *result = NULL;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Element))
+ return (NULL);
+ PCB_PIN_LOOP(Element);
+ {
+ ClrPinOctagon(ctx, Element, pin);
+ result = Element;
+ }
+ PCB_END_LOOP;
+ return (result);
+}
+
+/* copies an element onto the PCB. Then does a draw. */
+void *CopyElement(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+
+#ifdef DEBUG
+ printf("Entered CopyElement, trying to copy element %s\n", Element->Name[1].TextString);
+#endif
+
+ pcb_element_t *element = pcb_element_copy(PCB->Data,
+ NULL, Element,
+ conf_core.editor.unique_names, ctx->copy.DeltaX,
+ ctx->copy.DeltaY);
+
+ /* this call clears the polygons */
+ pcb_undo_add_obj_to_create(PCB_TYPE_ELEMENT, element, element, element);
+ if (PCB->ElementOn && (PCB_FRONT(element) || PCB->InvisibleObjectsOn)) {
+ DrawElementName(element);
+ DrawElementPackage(element);
+ }
+ if (PCB->PinOn) {
+ DrawElementPinsAndPads(element);
+ }
+#ifdef DEBUG
+ printf(" ... Leaving CopyElement.\n");
+#endif
+ return (element);
+}
+
+/* moves all names of an element to a new position */
+void *MoveElementName(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ if (PCB->ElementOn && (PCB_FRONT(Element) || PCB->InvisibleObjectsOn)) {
+ EraseElementName(Element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (PCB->Data->name_tree[n])
+ pcb_r_delete_entry(PCB->Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_move(text, ctx->move.dx, ctx->move.dy);
+ if (PCB->Data->name_tree[n])
+ pcb_r_insert_entry(PCB->Data->name_tree[n], (pcb_box_t *) text, 0);
+ }
+ PCB_END_LOOP;
+ DrawElementName(Element);
+ pcb_draw();
+ }
+ else {
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (PCB->Data->name_tree[n])
+ pcb_r_delete_entry(PCB->Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_move(text, ctx->move.dx, ctx->move.dy);
+ if (PCB->Data->name_tree[n])
+ pcb_r_insert_entry(PCB->Data->name_tree[n], (pcb_box_t *) text, 0);
+ }
+ PCB_END_LOOP;
+ }
+ return (Element);
+}
+
+/* moves an element */
+void *MoveElement(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ pcb_bool didDraw = pcb_false;
+
+ if (PCB->ElementOn && (PCB_FRONT(Element) || PCB->InvisibleObjectsOn)) {
+ EraseElement(Element);
+ pcb_element_move(PCB->Data, Element, ctx->move.dx, ctx->move.dy);
+ DrawElementName(Element);
+ DrawElementPackage(Element);
+ didDraw = pcb_true;
+ }
+ else {
+ if (PCB->PinOn)
+ EraseElementPinsAndPads(Element);
+ pcb_element_move(PCB->Data, Element, ctx->move.dx, ctx->move.dy);
+ }
+ if (PCB->PinOn) {
+ DrawElementPinsAndPads(Element);
+ didDraw = pcb_true;
+ }
+ if (didDraw)
+ pcb_draw();
+ return (Element);
+}
+
+/* destroys a element */
+void *DestroyElement(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ if (ctx->remove.destroy_target->element_tree)
+ pcb_r_delete_entry(ctx->remove.destroy_target->element_tree, (pcb_box_t *) Element);
+ if (ctx->remove.destroy_target->pin_tree) {
+ PCB_PIN_LOOP(Element);
+ {
+ pcb_r_delete_entry(ctx->remove.destroy_target->pin_tree, (pcb_box_t *) pin);
+ }
+ PCB_END_LOOP;
+ }
+ if (ctx->remove.destroy_target->pad_tree) {
+ PCB_PAD_LOOP(Element);
+ {
+ pcb_r_delete_entry(ctx->remove.destroy_target->pad_tree, (pcb_box_t *) pad);
+ }
+ PCB_END_LOOP;
+ }
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ if (ctx->remove.destroy_target->name_tree[n])
+ pcb_r_delete_entry(ctx->remove.destroy_target->name_tree[n], (pcb_box_t *) text);
+ }
+ PCB_END_LOOP;
+ pcb_element_destroy(Element);
+
+ pcb_element_free(Element);
+
+ return NULL;
+}
+
+/* removes an element */
+void *RemoveElement_op(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ /* erase from screen */
+ if ((PCB->ElementOn || PCB->PinOn) && (PCB_FRONT(Element) || PCB->InvisibleObjectsOn)) {
+ EraseElement(Element);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_ELEMENT, Element, Element, Element);
+ return NULL;
+}
+
+/* rotates an element */
+void *Rotate90Element(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ EraseElement(Element);
+ pcb_element_rotate90(PCB->Data, Element, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number);
+ DrawElement(Element);
+ pcb_draw();
+ return (Element);
+}
+
+/* ----------------------------------------------------------------------
+ * rotates the name of an element
+ */
+void *Rotate90ElementName(pcb_opctx_t *ctx, pcb_element_t *Element)
+{
+ EraseElementName(Element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(Element);
+ {
+ pcb_r_delete_entry(PCB->Data->name_tree[n], (pcb_box_t *) text);
+ pcb_text_rotate90(text, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number);
+ pcb_r_insert_entry(PCB->Data->name_tree[n], (pcb_box_t *) text, 0);
+ }
+ PCB_END_LOOP;
+ DrawElementName(Element);
+ pcb_draw();
+ return (Element);
+}
+
+/*** draw ***/
+void draw_element_name(pcb_element_t * element)
+{
+ if ((conf_core.editor.hide_names && pcb_gui->gui) || PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element))
+ return;
+ if (pcb_draw_doing_pinout || pcb_draw_doing_assy)
+ pcb_gui->set_color(Output.fgGC, PCB->ElementColor);
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, &PCB_ELEM_TEXT_VISIBLE(PCB, element)))
+ pcb_gui->set_color(Output.fgGC, PCB->ElementSelectedColor);
+ else if (PCB_FRONT(element)) {
+#warning TODO: why do we test for Names flag here instead of elements flag?
+ if (PCB_FLAG_TEST(PCB_FLAG_NONETLIST, element))
+ pcb_gui->set_color(Output.fgGC, PCB->ElementColor_nonetlist);
+ else
+ pcb_gui->set_color(Output.fgGC, PCB->ElementColor);
+ }
+ else
+ pcb_gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor);
+
+ DrawTextLowLevel(&PCB_ELEM_TEXT_VISIBLE(PCB, element), PCB->minSlk);
+
+}
+
+pcb_r_dir_t draw_element_name_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_text_t *text = (pcb_text_t *) b;
+ pcb_element_t *element = (pcb_element_t *) text->Element;
+ int *side = cl;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element))
+ return PCB_R_DIR_NOT_FOUND;
+
+ if (PCB_ON_SIDE(element, *side))
+ draw_element_name(element);
+ return PCB_R_DIR_NOT_FOUND;
+}
+
+void draw_element_pins_and_pads(pcb_element_t * element)
+{
+ PCB_PAD_LOOP(element);
+ {
+ if (pcb_draw_doing_pinout || pcb_draw_doing_assy || PCB_FRONT(pad) || PCB->InvisibleObjectsOn)
+ draw_pad(pad);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(element);
+ {
+ draw_pin(pin, pcb_true);
+ }
+ PCB_END_LOOP;
+}
+
+
+void draw_element_package(pcb_element_t * element)
+{
+ /* set color and draw lines, arcs, text and pins */
+ if (pcb_draw_doing_pinout || pcb_draw_doing_assy)
+ pcb_gui->set_color(Output.fgGC, PCB->ElementColor);
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))
+ pcb_gui->set_color(Output.fgGC, PCB->ElementSelectedColor);
+ else if (PCB_FRONT(element))
+ pcb_gui->set_color(Output.fgGC, PCB->ElementColor);
+ else
+ pcb_gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor);
+
+ /* draw lines, arcs, text and pins */
+ PCB_ELEMENT_PCB_LINE_LOOP(element);
+ {
+ _draw_line(line);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(element);
+ {
+ _draw_arc(arc);
+ }
+ PCB_END_LOOP;
+}
+
+void draw_element(pcb_element_t *element)
+{
+ draw_element_package(element);
+ draw_element_name(element);
+ draw_element_pins_and_pads(element);
+}
+
+pcb_r_dir_t draw_element_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_element_t *element = (pcb_element_t *) b;
+ int *side = cl;
+
+ if (PCB_ON_SIDE(element, *side))
+ draw_element_package(element);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+static void DrawEMark(pcb_element_t *e, pcb_coord_t X, pcb_coord_t Y, pcb_bool invisible)
+{
+ pcb_coord_t mark_size = PCB_EMARK_SIZE;
+ if (!PCB->InvisibleObjectsOn && invisible)
+ return;
+
+ if (pinlist_length(&e->Pin) != 0) {
+ pcb_pin_t *pin0 = pinlist_first(&e->Pin);
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin0))
+ mark_size = MIN(mark_size, pin0->DrillingHole / 2);
+ else
+ mark_size = MIN(mark_size, pin0->Thickness / 2);
+ }
+
+ if (padlist_length(&e->Pad) != 0) {
+ pcb_pad_t *pad0 = padlist_first(&e->Pad);
+ mark_size = MIN(mark_size, pad0->Thickness / 2);
+ }
+
+ pcb_gui->set_color(Output.fgGC, invisible ? PCB->InvisibleMarkColor : PCB->ElementColor);
+ pcb_gui->set_line_cap(Output.fgGC, Trace_Cap);
+ pcb_gui->set_line_width(Output.fgGC, 0);
+ pcb_gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y - mark_size);
+ pcb_gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y - mark_size);
+ pcb_gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y + mark_size);
+ pcb_gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y + mark_size);
+
+ /*
+ * If an element is locked, place a "L" on top of the "diamond".
+ * This provides a nice visual indication that it is locked that
+ * works even for color blind users.
+ */
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, e)) {
+ pcb_gui->draw_line(Output.fgGC, X, Y, X + 2 * mark_size, Y);
+ pcb_gui->draw_line(Output.fgGC, X, Y, X, Y - 4 * mark_size);
+ }
+}
+
+pcb_r_dir_t draw_element_mark_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_element_t *element = (pcb_element_t *) b;
+
+ DrawEMark(element, element->MarkX, element->MarkY, !PCB_FRONT(element));
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+void EraseElement(pcb_element_t *Element)
+{
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ EraseLine(line);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ EraseArc(arc);
+ }
+ PCB_END_LOOP;
+ EraseElementName(Element);
+ EraseElementPinsAndPads(Element);
+ pcb_flag_erase(&Element->Flags);
+}
+
+void EraseElementPinsAndPads(pcb_element_t *Element)
+{
+ PCB_PIN_LOOP(Element);
+ {
+ ErasePin(pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(Element);
+ {
+ ErasePad(pad);
+ }
+ PCB_END_LOOP;
+}
+
+void EraseElementName(pcb_element_t *Element)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_HIDENAME, Element)) {
+ return;
+ }
+ DrawText(NULL, &PCB_ELEM_TEXT_VISIBLE(PCB, Element));
+}
+
+void DrawElement(pcb_element_t *Element)
+{
+ DrawElementPackage(Element);
+ DrawElementName(Element);
+ DrawElementPinsAndPads(Element);
+}
+
+void DrawElementName(pcb_element_t *Element)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_HIDENAME, Element))
+ return;
+ DrawText(NULL, &PCB_ELEM_TEXT_VISIBLE(PCB, Element));
+}
+
+void DrawElementPackage(pcb_element_t *Element)
+{
+ PCB_ELEMENT_PCB_LINE_LOOP(Element);
+ {
+ DrawLine(NULL, line);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(Element);
+ {
+ DrawArc(NULL, arc);
+ }
+ PCB_END_LOOP;
+}
+
+void DrawElementPinsAndPads(pcb_element_t *Element)
+{
+ PCB_PAD_LOOP(Element);
+ {
+ if (pcb_draw_doing_pinout || pcb_draw_doing_assy || PCB_FRONT(pad) || PCB->InvisibleObjectsOn)
+ DrawPad(pad);
+ }
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(Element);
+ {
+ DrawPin(pin);
+ }
+ PCB_END_LOOP;
+}
+
diff --git a/src/obj_elem.h b/src/obj_elem.h
new file mode 100644
index 0000000..964f189
--- /dev/null
+++ b/src/obj_elem.h
@@ -0,0 +1,159 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: elements */
+
+#ifndef PCB_OBJ_ELEM_H
+#define PCB_OBJ_ELEM_H
+
+#include "obj_common.h"
+#include "obj_arc_list.h"
+#include "obj_line_list.h"
+#include "obj_pad_list.h"
+#include "obj_pinvia_list.h"
+#include "obj_text.h"
+
+
+struct pcb_element_s {
+ PCB_ANYOBJECTFIELDS;
+ pcb_text_t Name[PCB_MAX_ELEMENTNAMES]; /* the elements names: description text, name on PCB second, value third - see PCB_ELEMNAME_IDX_VISIBLE() below */
+ pcb_coord_t MarkX, MarkY; /* position mark */
+ pinlist_t Pin;
+ padlist_t Pad;
+ linelist_t Line;
+ arclist_t Arc;
+ pcb_box_t VBox;
+ gdl_elem_t link;
+};
+
+pcb_element_t *pcb_element_alloc(pcb_data_t * data);
+void pcb_element_free(pcb_element_t * data);
+
+pcb_element_t *pcb_element_new(pcb_data_t *Data, pcb_element_t *Element,
+ pcb_font_t *PCBFont, pcb_flag_t Flags, char *Description, char *NameOnPCB,
+ char *Value, pcb_coord_t TextX, pcb_coord_t TextY, pcb_uint8_t Direction,
+ int TextScale, pcb_flag_t TextFlags, pcb_bool uniqueName);
+
+void pcb_element_destroy(pcb_element_t * element);
+
+pcb_line_t *pcb_element_line_alloc(pcb_element_t *Element);
+
+
+void pcb_element_bbox(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *Font);
+void pcb_element_rotate90(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
+void pcb_element_rotate(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, pcb_angle_t angle);
+
+pcb_bool pcb_element_change_side(pcb_element_t *Element, pcb_coord_t yoff);
+pcb_bool pcb_selected_element_change_side(void);
+/* Return a relative rotation for an element, useful only for
+ comparing two similar footprints. */
+int pcb_element_get_orientation(pcb_element_t * e);
+
+/* hash */
+unsigned int pcb_element_hash(const pcb_element_t *e);
+int pcb_element_eq(const pcb_element_t *e1, const pcb_element_t *e2);
+
+
+pcb_bool pcb_element_load_to_buffer(pcb_buffer_t *Buffer, const char *Name);
+int pcb_element_load_footprint_by_name(pcb_buffer_t *Buffer, const char *Footprint);
+pcb_bool pcb_element_smash_buffer(pcb_buffer_t *Buffer);
+pcb_bool pcb_element_convert_from_buffer(pcb_buffer_t *Buffer);
+pcb_element_t *pcb_element_copy(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy);
+char *pcb_element_uniq_name(pcb_data_t *Data, char *Name);
+
+void r_delete_element(pcb_data_t * data, pcb_element_t * element);
+
+void pcb_element_move(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY);
+void *pcb_element_remove(pcb_element_t *Element);
+void pcb_element_mirror(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t yoff);
+
+pcb_arc_t *pcb_element_arc_new(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y,
+ pcb_coord_t Width, pcb_coord_t Height, pcb_angle_t angle, pcb_angle_t delta, pcb_coord_t Thickness);
+
+pcb_line_t *pcb_element_line_new(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness);
+
+void pcb_element_text_set(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y,
+ unsigned Direction, char *TextString, int Scale, pcb_flag_t Flags);
+
+
+/* Change the specified text on an element, either on the board (give
+ PCB, PCB->Data) or in a buffer (give NULL, Buffer->Data). The old
+ string is returned, and must be properly freed by the caller. */
+char *pcb_element_text_change(pcb_board_t * pcb, pcb_data_t * data, pcb_element_t *Element, int which, char *new_name);
+
+
+/* ---------------------------------------------------------------------------
+ * access macros for elements name structure
+ */
+#define PCB_ELEMNAME_IDX_DESCRIPTION 0
+#define PCB_ELEMNAME_IDX_REFDES 1
+#define PCB_ELEMNAME_IDX_VALUE 2
+#define PCB_ELEMNAME_IDX_VISIBLE() (conf_core.editor.name_on_pcb ? PCB_ELEMNAME_IDX_REFDES :\
+ (conf_core.editor.description ? PCB_ELEMNAME_IDX_DESCRIPTION : PCB_ELEMNAME_IDX_VALUE))
+
+#define PCB_ELEM_NAME_VISIBLE(p,e) ((e)->Name[PCB_ELEMNAME_IDX_VISIBLE()].TextString)
+#define PCB_ELEM_NAME_DESCRIPTION(e) ((e)->Name[PCB_ELEMNAME_IDX_DESCRIPTION].TextString)
+#define PCB_ELEM_NAME_REFDES(e) ((e)->Name[PCB_ELEMNAME_IDX_REFDES].TextString)
+#define PCB_ELEM_NAME_VALUE(e) ((e)->Name[PCB_ELEMNAME_IDX_VALUE].TextString)
+
+#define PCB_ELEM_TEXT_VISIBLE(p,e) ((e)->Name[PCB_ELEMNAME_IDX_VISIBLE()])
+#define PCB_ELEM_TEXT_DESCRIPTION(e) ((e)->Name[PCB_ELEMNAME_IDX_DESCRIPTION])
+#define PCB_ELEM_TEXT_REFDES(e) ((e)->Name[PCB_ELEMNAME_IDX_REFDES])
+#define PCB_ELEM_TEXT_VALUE(e) ((e)->Name[PCB_ELEMNAME_IDX_VALUE])
+
+/*** loops ***/
+
+#define PCB_ELEMENT_LOOP(top) do { \
+ pcb_element_t *element; \
+ gdl_iterator_t __it__; \
+ pinlist_foreach(&(top)->Element, &__it__, element) {
+
+#define PCB_ELEMENT_PCB_TEXT_LOOP(element) do { \
+ pcb_cardinal_t n; \
+ pcb_text_t *text; \
+ for (n = PCB_MAX_ELEMENTNAMES-1; n != -1; n--) \
+ { \
+ text = &(element)->Name[n]
+
+#define PCB_ELEMENT_NAME_LOOP(element) do { \
+ pcb_cardinal_t n; \
+ char *textstring; \
+ for (n = PCB_MAX_ELEMENTNAMES-1; n != -1; n--) \
+ { \
+ textstring = (element)->Name[n].TextString
+
+#define PCB_ELEMENT_PCB_LINE_LOOP(element) do { \
+ pcb_line_t *line; \
+ gdl_iterator_t __it__; \
+ linelist_foreach(&(element)->Line, &__it__, line) {
+
+#define PCB_ELEMENT_ARC_LOOP(element) do { \
+ pcb_arc_t *arc; \
+ gdl_iterator_t __it__; \
+ linelist_foreach(&(element)->Arc, &__it__, arc) {
+
+#endif
+
diff --git a/src/obj_elem_draw.h b/src/obj_elem_draw.h
new file mode 100644
index 0000000..83f9d8b
--- /dev/null
+++ b/src/obj_elem_draw.h
@@ -0,0 +1,48 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw of elements ***/
+
+/* Include rtree.h for these */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_element_name_callback(const pcb_box_t * b, void *cl);
+pcb_r_dir_t draw_element_mark_callback(const pcb_box_t * b, void *cl);
+pcb_r_dir_t draw_element_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void draw_element_package(pcb_element_t * element);
+void draw_element_name(pcb_element_t * element);
+void draw_element_pins_and_pads(pcb_element_t * element);
+void draw_element(pcb_element_t *element);
+
+void EraseElement(pcb_element_t *Element);
+void EraseElementPinsAndPads(pcb_element_t *Element);
+void EraseElementName(pcb_element_t *Element);
+
+void DrawElement(pcb_element_t *Element);
+void DrawElementName(pcb_element_t *Element);
+void DrawElementPackage(pcb_element_t *Element);
+void DrawElementPinsAndPads(pcb_element_t *Element);
diff --git a/src/obj_elem_list.c b/src/obj_elem_list.c
new file mode 100644
index 0000000..af5bc08
--- /dev/null
+++ b/src/obj_elem_list.c
@@ -0,0 +1,32 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+
+
+#include "config.h"
+
+/* include other lists before TDL_DONT_UNDEF makes them pollute the namespace */
+#include "obj_elem.h"
+
+#define TDL_DONT_UNDEF
+#include "obj_elem_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_elem_list.h b/src/obj_elem_list.h
new file mode 100644
index 0000000..0973071
--- /dev/null
+++ b/src/obj_elem_list.h
@@ -0,0 +1,81 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_ELEM_LIST_H
+#define PCB_OBJ_ELEM_LIST_H
+
+#include "obj_elem.h"
+
+/* List of Elements */
+#define TDL(x) elementlist_ ## x
+#define TDL_LIST_T elementlist_t
+#define TDL_ITEM_T pcb_element_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define elementlist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+#include "ht_element.h"
+#include <genht/hash.h>
+
+/* Calculate a hash value using the content of the element. The hash value
+ represents the actual content of an element */
+unsigned int pcb_element_hash(const pcb_element_t *e);
+
+/* Compare two elements and return 1 if they contain the same objects. */
+int pcb_element_eq(const pcb_element_t *e1, const pcb_element_t *e2);
+
+/* Create a new local variable to be used for deduplication */
+#define elementlist_dedup_initializer(state) htep_t *state = NULL;
+
+/* Do a "continue" if an element matching loop_elem has been seen already;
+ Typically this is invoked as the first statement of an elementlist_foreach()
+ loop. */
+#define elementlist_dedup_skip(state, loop_elem) \
+switch(1) { \
+ case 1: { \
+ if (state == NULL) \
+ state = htep_alloc(pcb_element_hash, pcb_element_eq); \
+ if (htep_has(state, loop_elem)) \
+ continue; \
+ htep_set(state, loop_elem, 1); \
+ } \
+}
+
+/* use this after the loop to free all memory used by state */
+#define elementlist_dedup_free(state) \
+ do { \
+ if (state != NULL) { \
+ htep_free(state); \
+ state = NULL; \
+ } \
+ } while(0)
+
+
+#ifndef LIST_ELEMENT_NOINSTANT
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+#endif
+
+#endif
diff --git a/src/obj_elem_op.h b/src/obj_elem_op.h
new file mode 100644
index 0000000..887db39
--- /dev/null
+++ b/src/obj_elem_op.h
@@ -0,0 +1,53 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on elements ***/
+
+#include "operation.h"
+
+void *AddElementToBuffer(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *MoveElementToBuffer(pcb_opctx_t *ctx, pcb_element_t * element);
+void *ClrElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *SetElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ClrElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *SetElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementNonetlist(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementName(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementNameSize(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementSize(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElementClearSize(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElement1stSize(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *ChangeElement2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *CopyElement(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *MoveElementName(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *MoveElement(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *DestroyElement(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *RemoveElement_op(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *Rotate90Element(pcb_opctx_t *ctx, pcb_element_t *Element);
+void *Rotate90ElementName(pcb_opctx_t *ctx, pcb_element_t *Element);
+
diff --git a/src/obj_line.c b/src/obj_line.c
new file mode 100644
index 0000000..2babd90
--- /dev/null
+++ b/src/obj_line.c
@@ -0,0 +1,849 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: line segment */
+
+#include "config.h"
+#include <setjmp.h>
+
+#include "undo.h"
+#include "board.h"
+#include "data.h"
+#include "search.h"
+#include "polygon.h"
+#include "conf_core.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
+#include "rotate.h"
+
+#include "obj_line.h"
+#include "obj_line_op.h"
+
+/* TODO: maybe remove this and move lines from draw here? */
+#include "draw.h"
+#include "obj_line_draw.h"
+#include "obj_rat_draw.h"
+#include "obj_pinvia_draw.h"
+
+
+/**** allocation ****/
+
+/* get next slot for a line, allocates memory if necessary */
+pcb_line_t *pcb_line_alloc(pcb_layer_t * layer)
+{
+ pcb_line_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_line_t), 1);
+ linelist_append(&layer->Line, new_obj);
+
+ return new_obj;
+}
+
+void pcb_line_free(pcb_line_t * data)
+{
+ linelist_remove(data);
+ free(data);
+}
+
+
+/**** utility ****/
+struct line_info {
+ pcb_coord_t X1, X2, Y1, Y2;
+ pcb_coord_t Thickness;
+ pcb_flag_t Flags;
+ pcb_line_t test, *ans;
+ jmp_buf env;
+};
+
+static pcb_r_dir_t line_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_line_t *line = (pcb_line_t *) b;
+ struct line_info *i = (struct line_info *) cl;
+
+ if (line->Point1.X == i->X1 && line->Point2.X == i->X2 && line->Point1.Y == i->Y1 && line->Point2.Y == i->Y2) {
+ i->ans = (pcb_line_t *) (-1);
+ longjmp(i->env, 1);
+ }
+ /* check the other point order */
+ if (line->Point1.X == i->X1 && line->Point2.X == i->X2 && line->Point1.Y == i->Y1 && line->Point2.Y == i->Y2) {
+ i->ans = (pcb_line_t *) (-1);
+ longjmp(i->env, 1);
+ }
+ if (line->Point2.X == i->X1 && line->Point1.X == i->X2 && line->Point2.Y == i->Y1 && line->Point1.Y == i->Y2) {
+ i->ans = (pcb_line_t *) - 1;
+ longjmp(i->env, 1);
+ }
+ /* remove unnecessary line points */
+ if (line->Thickness == i->Thickness
+ /* don't merge lines if the clear flags differ */
+ && PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, line) == PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, i)) {
+ if (line->Point1.X == i->X1 && line->Point1.Y == i->Y1) {
+ i->test.Point1.X = line->Point2.X;
+ i->test.Point1.Y = line->Point2.Y;
+ i->test.Point2.X = i->X2;
+ i->test.Point2.Y = i->Y2;
+ if (pcb_is_point_on_line(i->X1, i->Y1, 0.0, &i->test)) {
+ i->ans = line;
+ longjmp(i->env, 1);
+ }
+ }
+ else if (line->Point2.X == i->X1 && line->Point2.Y == i->Y1) {
+ i->test.Point1.X = line->Point1.X;
+ i->test.Point1.Y = line->Point1.Y;
+ i->test.Point2.X = i->X2;
+ i->test.Point2.Y = i->Y2;
+ if (pcb_is_point_on_line(i->X1, i->Y1, 0.0, &i->test)) {
+ i->ans = line;
+ longjmp(i->env, 1);
+ }
+ }
+ else if (line->Point1.X == i->X2 && line->Point1.Y == i->Y2) {
+ i->test.Point1.X = line->Point2.X;
+ i->test.Point1.Y = line->Point2.Y;
+ i->test.Point2.X = i->X1;
+ i->test.Point2.Y = i->Y1;
+ if (pcb_is_point_on_line(i->X2, i->Y2, 0.0, &i->test)) {
+ i->ans = line;
+ longjmp(i->env, 1);
+ }
+ }
+ else if (line->Point2.X == i->X2 && line->Point2.Y == i->Y2) {
+ i->test.Point1.X = line->Point1.X;
+ i->test.Point1.Y = line->Point1.Y;
+ i->test.Point2.X = i->X1;
+ i->test.Point2.Y = i->Y1;
+ if (pcb_is_point_on_line(i->X2, i->Y2, 0.0, &i->test)) {
+ i->ans = line;
+ longjmp(i->env, 1);
+ }
+ }
+ }
+ return PCB_R_DIR_NOT_FOUND;
+}
+
+
+/* creates a new line on a layer and checks for overlap and extension */
+pcb_line_t *pcb_line_new_merge(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags)
+{
+ struct line_info info;
+ pcb_box_t search;
+
+ search.X1 = MIN(X1, X2);
+ search.X2 = MAX(X1, X2);
+ search.Y1 = MIN(Y1, Y2);
+ search.Y2 = MAX(Y1, Y2);
+ if (search.Y2 == search.Y1)
+ search.Y2++;
+ if (search.X2 == search.X1)
+ search.X2++;
+ info.X1 = X1;
+ info.X2 = X2;
+ info.Y1 = Y1;
+ info.Y2 = Y2;
+ info.Thickness = Thickness;
+ info.Flags = Flags;
+ info.test.Thickness = 0;
+ info.test.Flags = pcb_no_flags();
+ info.ans = NULL;
+ /* prevent stacking of duplicate lines
+ * and remove needless intermediate points
+ * verify that the layer is on the board first!
+ */
+ if (setjmp(info.env) == 0) {
+ pcb_r_search(Layer->line_tree, &search, NULL, line_callback, &info, NULL);
+ return pcb_line_new(Layer, X1, Y1, X2, Y2, Thickness, Clearance, Flags);
+ }
+
+ if ((void *) info.ans == (void *) (-1))
+ return NULL; /* stacked line */
+ /* remove unnecessary points */
+ if (info.ans) {
+ /* must do this BEFORE getting new line memory */
+ pcb_undo_move_obj_to_remove(PCB_TYPE_LINE, Layer, info.ans, info.ans);
+ X1 = info.test.Point1.X;
+ X2 = info.test.Point2.X;
+ Y1 = info.test.Point1.Y;
+ Y2 = info.test.Point2.Y;
+ }
+ return pcb_line_new(Layer, X1, Y1, X2, Y2, Thickness, Clearance, Flags);
+}
+
+pcb_line_t *pcb_line_new(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags)
+{
+ pcb_line_t *Line;
+
+ Line = pcb_line_alloc(Layer);
+ if (!Line)
+ return (Line);
+ Line->ID = pcb_create_ID_get();
+ Line->Flags = Flags;
+ PCB_FLAG_CLEAR(PCB_FLAG_RAT, Line);
+ Line->Thickness = Thickness;
+ Line->Clearance = Clearance;
+ Line->Point1.X = X1;
+ Line->Point1.Y = Y1;
+ Line->Point1.ID = pcb_create_ID_get();
+ Line->Point2.X = X2;
+ Line->Point2.Y = Y2;
+ Line->Point2.ID = pcb_create_ID_get();
+ pcb_add_line_on_layer(Layer, Line);
+ return (Line);
+}
+
+void pcb_add_line_on_layer(pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_line_bbox(Line);
+ if (!Layer->line_tree)
+ Layer->line_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+}
+
+/* sets the bounding box of a line */
+void pcb_line_bbox(pcb_line_t *Line)
+{
+ pcb_coord_t width = (Line->Thickness + Line->Clearance + 1) / 2;
+
+ /* Adjust for our discrete polygon approximation */
+ width = (double) width *PCB_POLY_CIRC_RADIUS_ADJ + 0.5;
+
+ Line->BoundingBox.X1 = MIN(Line->Point1.X, Line->Point2.X) - width;
+ Line->BoundingBox.X2 = MAX(Line->Point1.X, Line->Point2.X) + width;
+ Line->BoundingBox.Y1 = MIN(Line->Point1.Y, Line->Point2.Y) - width;
+ Line->BoundingBox.Y2 = MAX(Line->Point1.Y, Line->Point2.Y) + width;
+ pcb_close_box(&Line->BoundingBox);
+ pcb_set_point_bounding_box(&Line->Point1);
+ pcb_set_point_bounding_box(&Line->Point2);
+}
+
+int pcb_line_eq(const pcb_element_t *e1, const pcb_line_t *l1, const pcb_element_t *e2, const pcb_line_t *l2)
+{
+ if (pcb_field_neq(l1, l2, Thickness) || pcb_field_neq(l1, l2, Clearance)) return 0;
+ if (pcb_element_neq_offsx(e1, l1, e2, l2, Point1.X) || pcb_element_neq_offsy(e1, l1, e2, l2, Point1.Y)) return 0;
+ if (pcb_element_neq_offsx(e1, l1, e2, l2, Point2.X) || pcb_element_neq_offsy(e1, l1, e2, l2, Point2.Y)) return 0;
+ if (pcb_neqs(l1->Number, l2->Number)) return 0;
+ return 1;
+}
+
+
+unsigned int pcb_line_hash(const pcb_element_t *e, const pcb_line_t *l)
+{
+ return
+ pcb_hash_coord(l->Thickness) ^ pcb_hash_coord(l->Clearance) ^
+ pcb_hash_element_ox(e, l->Point1.X) ^ pcb_hash_element_oy(e, l->Point1.Y) ^
+ pcb_hash_element_ox(e, l->Point2.X) ^ pcb_hash_element_oy(e, l->Point2.Y) ^
+ pcb_hash_str(l->Number);
+}
+
+
+pcb_coord_t pcb_line_length(const pcb_line_t *line)
+{
+ pcb_coord_t dx = line->Point1.X - line->Point2.X;
+ pcb_coord_t dy = line->Point1.Y - line->Point2.Y;
+ return pcb_round(sqrt((double)dx*(double)dx + (double)dy*(double)dy));
+}
+
+double pcb_line_area(const pcb_line_t *line)
+{
+ return
+ pcb_line_length(line) * (double)line->Thickness /* body */
+ + (double)line->Thickness * (double)line->Thickness * M_PI; /* cap circles */
+}
+
+
+/*** ops ***/
+
+/* copies a line to buffer */
+void *AddLineToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_line_t *line;
+ pcb_layer_t *layer = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, Layer)];
+
+ line = pcb_line_new(layer, Line->Point1.X, Line->Point1.Y,
+ Line->Point2.X, Line->Point2.Y,
+ Line->Thickness, Line->Clearance, pcb_flag_mask(Line->Flags, PCB_FLAG_FOUND | ctx->buffer.extraflg));
+ if (line && Line->Number)
+ line->Number = pcb_strdup(Line->Number);
+ return (line);
+}
+
+/* moves a line to buffer */
+void *MoveLineToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_line_t * line)
+{
+ pcb_layer_t *lay = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, layer)];
+
+ pcb_poly_restore_to_poly(ctx->buffer.src, PCB_TYPE_LINE, layer, line);
+ pcb_r_delete_entry(layer->line_tree, (pcb_box_t *) line);
+
+ linelist_remove(line);
+ linelist_append(&(lay->Line), line);
+
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, line);
+
+ if (!lay->line_tree)
+ lay->line_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(lay->line_tree, (pcb_box_t *) line, 0);
+ pcb_poly_clear_from_poly(ctx->buffer.dst, PCB_TYPE_LINE, lay, line);
+ return (line);
+}
+
+/* changes the size of a line */
+void *ChangeLineSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Line->Thickness + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Line))
+ return (NULL);
+ if (value <= PCB_MAX_LINESIZE && value >= PCB_MIN_LINESIZE && value != Line->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_LINE, Layer, Line, Line);
+ EraseLine(Line);
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ Line->Thickness = value;
+ pcb_line_bbox(Line);
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ DrawLine(Layer, Line);
+ return (Line);
+ }
+ return (NULL);
+}
+
+/*changes the clearance size of a line */
+void *ChangeLineClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Line->Clearance + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Line) || !PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Line))
+ return (NULL);
+ value = MIN(PCB_MAX_LINESIZE, MAX(value, PCB->Bloat * 2 + 2));
+ if (value != Line->Clearance) {
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_LINE, Layer, Line, Line);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ EraseLine(Line);
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
+ Line->Clearance = value;
+ if (Line->Clearance == 0) {
+ PCB_FLAG_CLEAR(PCB_FLAG_CLEARLINE, Line);
+ Line->Clearance = PCB_MIL_TO_COORD(10);
+ }
+ pcb_line_bbox(Line);
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ DrawLine(Layer, Line);
+ return (Line);
+ }
+ return (NULL);
+}
+
+/* changes the name of a line */
+void *ChangeLineName(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ char *old = Line->Number;
+
+ Layer = Layer;
+ Line->Number = ctx->chgname.new_name;
+ return (old);
+}
+
+/* changes the clearance flag of a line */
+void *ChangeLineJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Line))
+ return (NULL);
+ EraseLine(Line);
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Line)) {
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_LINE, Layer, Line, Line, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ }
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, Layer, Line, Line);
+ PCB_FLAG_TOGGLE(PCB_FLAG_CLEARLINE, Line);
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Line)) {
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_LINE, Layer, Line, Line, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ }
+ DrawLine(Layer, Line);
+ return (Line);
+}
+
+/* sets the clearance flag of a line */
+void *SetLineJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Line) || PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Line))
+ return (NULL);
+ return ChangeLineJoin(ctx, Layer, Line);
+}
+
+/* clears the clearance flag of a line */
+void *ClrLineJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Line) || !PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Line))
+ return (NULL);
+ return ChangeLineJoin(ctx, Layer, Line);
+}
+
+/* copies a line */
+void *CopyLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_line_t *line;
+
+ line = pcb_line_new_merge(Layer, Line->Point1.X + ctx->copy.DeltaX,
+ Line->Point1.Y + ctx->copy.DeltaY,
+ Line->Point2.X + ctx->copy.DeltaX,
+ Line->Point2.Y + ctx->copy.DeltaY, Line->Thickness, Line->Clearance, pcb_flag_mask(Line->Flags, PCB_FLAG_FOUND));
+ if (!line)
+ return (line);
+ if (Line->Number)
+ line->Number = pcb_strdup(Line->Number);
+ DrawLine(Layer, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, Layer, line, line);
+ return (line);
+}
+
+/* moves a line */
+void *MoveLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ if (Layer->On)
+ EraseLine(Line);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
+ pcb_line_move(Line, ctx->move.dx, ctx->move.dy);
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ if (Layer->On) {
+ DrawLine(Layer, Line);
+ pcb_draw();
+ }
+ return (Line);
+}
+
+/* moves one end of a line */
+void *MoveLinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point)
+{
+ if (Layer) {
+ if (Layer->On)
+ EraseLine(Line);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ pcb_r_delete_entry(Layer->line_tree, &Line->BoundingBox);
+ PCB_MOVE(Point->X, Point->Y, ctx->move.dx, ctx->move.dy);
+ pcb_line_bbox(Line);
+ pcb_r_insert_entry(Layer->line_tree, &Line->BoundingBox, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ if (Layer->On) {
+ DrawLine(Layer, Line);
+ pcb_draw();
+ }
+ return (Line);
+ }
+ else { /* must be a rat */
+
+ if (PCB->RatOn)
+ EraseRat((pcb_rat_t *) Line);
+ pcb_r_delete_entry(PCB->Data->rat_tree, &Line->BoundingBox);
+ PCB_MOVE(Point->X, Point->Y, ctx->move.dx, ctx->move.dy);
+ pcb_line_bbox(Line);
+ pcb_r_insert_entry(PCB->Data->rat_tree, &Line->BoundingBox, 0);
+ if (PCB->RatOn) {
+ DrawRat((pcb_rat_t *) Line);
+ pcb_draw();
+ }
+ return (Line);
+ }
+}
+
+/* moves a line between layers; lowlevel routines */
+void *MoveLineToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_line_t * line, pcb_layer_t * Destination)
+{
+ pcb_r_delete_entry(Source->line_tree, (pcb_box_t *) line);
+
+ linelist_remove(line);
+ linelist_append(&(Destination->Line), line);
+
+ if (!Destination->line_tree)
+ Destination->line_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Destination->line_tree, (pcb_box_t *) line, 0);
+ return line;
+}
+
+/* ---------------------------------------------------------------------------
+ * moves a line between layers
+ */
+struct via_info {
+ pcb_coord_t X, Y;
+ jmp_buf env;
+};
+
+static pcb_r_dir_t moveline_callback(const pcb_box_t * b, void *cl)
+{
+ struct via_info *i = (struct via_info *) cl;
+ pcb_pin_t *via;
+
+ if ((via =
+ pcb_via_new(PCB->Data, i->X, i->Y,
+ conf_core.design.via_thickness, 2 * conf_core.design.clearance, PCB_FLAG_NO, conf_core.design.via_drilling_hole, NULL, pcb_no_flags())) != NULL) {
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, via, via, via);
+ DrawVia(via);
+ }
+ longjmp(i->env, 1);
+}
+
+void *MoveLineToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_line_t * Line)
+{
+ struct via_info info;
+ pcb_box_t sb;
+ pcb_line_t *newone;
+ void *ptr1, *ptr2, *ptr3;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Line)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ return NULL;
+ }
+ if (ctx->move.dst_layer == Layer && Layer->On) {
+ DrawLine(Layer, Line);
+ pcb_draw();
+ }
+ if (((long int) ctx->move.dst_layer == -1) || ctx->move.dst_layer == Layer)
+ return (Line);
+
+ pcb_undo_add_obj_to_move_to_layer(PCB_TYPE_LINE, Layer, Line, Line);
+ if (Layer->On)
+ EraseLine(Line);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ newone = (pcb_line_t *) MoveLineToLayerLowLevel(ctx, Layer, Line, ctx->move.dst_layer);
+ Line = NULL;
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, ctx->move.dst_layer, newone);
+ if (ctx->move.dst_layer->On)
+ DrawLine(ctx->move.dst_layer, newone);
+ pcb_draw();
+ if (!PCB->ViaOn || ctx->move.more_to_come ||
+ pcb_layer_get_group_(Layer) ==
+ pcb_layer_get_group_(ctx->move.dst_layer) || TEST_SILK_LAYER(Layer) || TEST_SILK_LAYER(ctx->move.dst_layer))
+ return (newone);
+ /* consider via at Point1 */
+ sb.X1 = newone->Point1.X - newone->Thickness / 2;
+ sb.X2 = newone->Point1.X + newone->Thickness / 2;
+ sb.Y1 = newone->Point1.Y - newone->Thickness / 2;
+ sb.Y2 = newone->Point1.Y + newone->Thickness / 2;
+ if ((pcb_search_obj_by_location(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
+ newone->Point1.X, newone->Point1.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE)) {
+ info.X = newone->Point1.X;
+ info.Y = newone->Point1.Y;
+ if (setjmp(info.env) == 0)
+ pcb_r_search(Layer->line_tree, &sb, NULL, moveline_callback, &info, NULL);
+ }
+ /* consider via at Point2 */
+ sb.X1 = newone->Point2.X - newone->Thickness / 2;
+ sb.X2 = newone->Point2.X + newone->Thickness / 2;
+ sb.Y1 = newone->Point2.Y - newone->Thickness / 2;
+ sb.Y2 = newone->Point2.Y + newone->Thickness / 2;
+ if ((pcb_search_obj_by_location(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
+ newone->Point2.X, newone->Point2.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE)) {
+ info.X = newone->Point2.X;
+ info.Y = newone->Point2.Y;
+ if (setjmp(info.env) == 0)
+ pcb_r_search(Layer->line_tree, &sb, NULL, moveline_callback, &info, NULL);
+ }
+ pcb_draw();
+ return (newone);
+}
+
+/* destroys a line from a layer */
+void *DestroyLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
+ free(Line->Number);
+
+ pcb_line_free(Line);
+ return NULL;
+}
+
+/* remove point... */
+struct rlp_info {
+ jmp_buf env;
+ pcb_line_t *line;
+ pcb_point_t *point;
+};
+static pcb_r_dir_t remove_point(const pcb_box_t * b, void *cl)
+{
+ pcb_line_t *line = (pcb_line_t *) b;
+ struct rlp_info *info = (struct rlp_info *) cl;
+ if (line == info->line)
+ return PCB_R_DIR_NOT_FOUND;
+ if ((line->Point1.X == info->point->X)
+ && (line->Point1.Y == info->point->Y)) {
+ info->line = line;
+ info->point = &line->Point1;
+ longjmp(info->env, 1);
+ }
+ else if ((line->Point2.X == info->point->X)
+ && (line->Point2.Y == info->point->Y)) {
+ info->line = line;
+ info->point = &line->Point2;
+ longjmp(info->env, 1);
+ }
+ return PCB_R_DIR_NOT_FOUND;
+}
+
+/* removes a line point, or a line if the selected point is the end */
+void *RemoveLinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point)
+{
+ pcb_point_t other;
+ struct rlp_info info;
+ if (&Line->Point1 == Point)
+ other = Line->Point2;
+ else
+ other = Line->Point1;
+ info.line = Line;
+ info.point = Point;
+ if (setjmp(info.env) == 0) {
+ pcb_r_search(Layer->line_tree, (const pcb_box_t *) Point, NULL, remove_point, &info, NULL);
+ return RemoveLine_op(ctx, Layer, Line);
+ }
+ pcb_move_obj(PCB_TYPE_LINE_POINT, Layer, info.line, info.point, other.X - Point->X, other.Y - Point->Y);
+ return (RemoveLine_op(ctx, Layer, Line));
+}
+
+/* removes a line from a layer */
+void *RemoveLine_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ /* erase from screen */
+ if (Layer->On) {
+ EraseLine(Line);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_LINE, Layer, Line, Line);
+ return NULL;
+}
+
+void *pcb_line_destroy(pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = NULL;
+
+ return RemoveLine_op(&ctx, Layer, Line);
+}
+
+/* rotates a line in 90 degree steps */
+void pcb_line_rotate90(pcb_line_t *Line, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
+{
+ PCB_COORD_ROTATE90(Line->Point1.X, Line->Point1.Y, X, Y, Number);
+ PCB_COORD_ROTATE90(Line->Point2.X, Line->Point2.Y, X, Y, Number);
+ /* keep horizontal, vertical Point2 > Point1 */
+ if (Line->Point1.X == Line->Point2.X) {
+ if (Line->Point1.Y > Line->Point2.Y) {
+ pcb_coord_t t;
+ t = Line->Point1.Y;
+ Line->Point1.Y = Line->Point2.Y;
+ Line->Point2.Y = t;
+ }
+ }
+ else if (Line->Point1.Y == Line->Point2.Y) {
+ if (Line->Point1.X > Line->Point2.X) {
+ pcb_coord_t t;
+ t = Line->Point1.X;
+ Line->Point1.X = Line->Point2.X;
+ Line->Point2.X = t;
+ }
+ }
+ /* instead of rotating the bounding box, the call updates both end points too */
+ pcb_line_bbox(Line);
+}
+
+void pcb_line_rotate(pcb_layer_t *layer, pcb_line_t *line, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina)
+{
+ pcb_r_delete_entry(layer->line_tree, (pcb_box_t *) line);
+ pcb_rotate(&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina);
+ pcb_rotate(&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina);
+ pcb_line_bbox(line);
+ pcb_r_insert_entry(layer->line_tree, (pcb_box_t *) line, 0);
+}
+
+void pcb_line_mirror(pcb_layer_t *layer, pcb_line_t *line)
+{
+ line->Point1.X = PCB_SWAP_X(line->Point1.X);
+ line->Point1.Y = PCB_SWAP_Y(line->Point1.Y);
+ line->Point2.X = PCB_SWAP_X(line->Point2.X);
+ line->Point2.Y = PCB_SWAP_Y(line->Point2.Y);
+}
+
+void pcb_line_flip_side(pcb_layer_t *layer, pcb_line_t *line)
+{
+ pcb_r_delete_entry(layer->line_tree, (pcb_box_t *) line);
+ line->Point1.X = PCB_SWAP_X(line->Point1.X);
+ line->Point1.Y = PCB_SWAP_Y(line->Point1.Y);
+ line->Point2.X = PCB_SWAP_X(line->Point2.X);
+ line->Point2.Y = PCB_SWAP_Y(line->Point2.Y);
+ pcb_line_bbox(line);
+ pcb_r_insert_entry(layer->line_tree, (pcb_box_t *) line, 0);
+}
+
+static void rotate_line1(pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ EraseLine(Line);
+ if (Layer) {
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
+ }
+ else
+ pcb_r_delete_entry(PCB->Data->rat_tree, (pcb_box_t *) Line);
+}
+
+static void rotate_line2(pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_line_bbox(Line);
+ if (Layer) {
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ DrawLine(Layer, Line);
+ }
+ else {
+ pcb_r_insert_entry(PCB->Data->rat_tree, (pcb_box_t *) Line, 0);
+ DrawRat((pcb_rat_t *) Line);
+ }
+ pcb_draw();
+}
+
+/* rotates a line's point */
+void *Rotate90LinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point)
+{
+ pcb_point_t *center;
+
+ rotate_line1(Layer, Line);
+
+ if ((Point->X == Line->Point1.X) && (Point->Y == Line->Point1.Y))
+ center = &Line->Point2;
+ else
+ center = &Line->Point1;
+
+ pcb_point_rotate90(Point, center->X, center->Y, ctx->rotate.number);
+
+ rotate_line2(Layer, Line);
+ return Line;
+}
+
+/* rotates a line */
+void *Rotate90Line(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ rotate_line1(Layer, Line);
+ pcb_point_rotate90(&Line->Point1, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number);
+ pcb_point_rotate90(&Line->Point2, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number);
+ rotate_line2(Layer, Line);
+ return Line;
+}
+
+/* inserts a point into a line */
+void *InsertPointIntoLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_line_t *line;
+ pcb_coord_t X, Y;
+
+ if (((Line->Point1.X == ctx->insert.x) && (Line->Point1.Y == ctx->insert.y)) ||
+ ((Line->Point2.X == ctx->insert.x) && (Line->Point2.Y == ctx->insert.y)))
+ return (NULL);
+ X = Line->Point2.X;
+ Y = Line->Point2.Y;
+ pcb_undo_add_obj_to_move(PCB_TYPE_LINE_POINT, Layer, Line, &Line->Point2, ctx->insert.x - X, ctx->insert.y - Y);
+ EraseLine(Line);
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ Line->Point2.X = ctx->insert.x;
+ Line->Point2.Y = ctx->insert.y;
+ pcb_line_bbox(Line);
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line);
+ DrawLine(Layer, Line);
+ /* we must create after playing with Line since creation may
+ * invalidate the line pointer
+ */
+ if ((line = pcb_line_new_merge(Layer, ctx->insert.x, ctx->insert.y, X, Y, Line->Thickness, Line->Clearance, Line->Flags))) {
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, Layer, line, line);
+ DrawLine(Layer, line);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, line);
+ /* creation call adds it to the rtree */
+ }
+ pcb_draw();
+ return (line);
+}
+
+/*** draw ***/
+void _draw_line(pcb_line_t * line)
+{
+ pcb_gui->set_line_cap(Output.fgGC, Trace_Cap);
+ if (conf_core.editor.thin_draw)
+ pcb_gui->set_line_width(Output.fgGC, 0);
+ else
+ pcb_gui->set_line_width(Output.fgGC, line->Thickness);
+
+ pcb_gui->draw_line(Output.fgGC, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y);
+}
+
+void draw_line(pcb_layer_t * layer, pcb_line_t * line)
+{
+ const char *color;
+ char buf[sizeof("#XXXXXX")];
+
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, line))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line))
+ color = layer->SelectedColor;
+ else
+ color = PCB->ConnectedColor;
+ }
+ else
+ color = layer->Color;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, line)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+
+ pcb_gui->set_color(Output.fgGC, color);
+ _draw_line(line);
+}
+
+pcb_r_dir_t draw_line_callback(const pcb_box_t * b, void *cl)
+{
+ draw_line((pcb_layer_t *) cl, (pcb_line_t *) b);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* erases a line on a layer */
+void EraseLine(pcb_line_t *Line)
+{
+ pcb_draw_invalidate(Line);
+ pcb_flag_erase(&Line->Flags);
+}
+
+void DrawLine(pcb_layer_t *Layer, pcb_line_t *Line)
+{
+ pcb_draw_invalidate(Line);
+}
+
diff --git a/src/obj_line.h b/src/obj_line.h
new file mode 100644
index 0000000..70e53b3
--- /dev/null
+++ b/src/obj_line.h
@@ -0,0 +1,129 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: line segment */
+
+#ifndef PCB_OBJ_LINE_H
+#define PCB_OBJ_LINE_H
+
+#include "obj_common.h"
+
+struct pcb_line_s { /* holds information about one line */
+ PCB_ANYLINEFIELDS;
+ char *Number;
+ gdl_elem_t link; /* a line is in a list: either on a layer or in an element */
+};
+
+/* crosshair: */
+typedef struct { /* current marked line */
+ pcb_point_t Point1, /* start- and end-position */
+ Point2;
+ long int State;
+ pcb_bool draw;
+} pcb_attached_line_t;
+
+
+pcb_line_t *pcb_line_alloc(pcb_layer_t * layer);
+void pcb_line_free(pcb_line_t * data);
+
+pcb_line_t *pcb_line_new_merge(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags);
+pcb_line_t *pcb_line_new(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags);
+void *pcb_line_destroy(pcb_layer_t *Layer, pcb_line_t *Line);
+
+
+/* Add objects without creating them or making any "sanity modifications" to them */
+void pcb_add_line_on_layer(pcb_layer_t *Layer, pcb_line_t *Line);
+
+void pcb_line_bbox(pcb_line_t *Line);
+void pcb_line_rotate90(pcb_line_t *Line, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
+void pcb_line_rotate(pcb_layer_t *layer, pcb_line_t *line, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina);
+void pcb_line_mirror(pcb_layer_t *layer, pcb_line_t *line);
+void pcb_line_flip_side(pcb_layer_t *layer, pcb_line_t *line);
+
+pcb_coord_t pcb_line_length(const pcb_line_t *line);
+double pcb_line_area(const pcb_line_t *line);
+
+
+/* hash */
+int pcb_line_eq(const pcb_element_t *e1, const pcb_line_t *l1, const pcb_element_t *e2, const pcb_line_t *l2);
+unsigned int pcb_line_hash(const pcb_element_t *e, const pcb_line_t *l);
+
+
+/*** DRC enforcement (obj_line_drcenf.c) ***/
+void pcb_line_adjust_attached(void);
+void pcb_line_adjust_attached_2lines(pcb_bool);
+void pcb_line_45(pcb_attached_line_t *);
+void pcb_line_enforce_drc(void);
+
+/* Rather than mode the line bounding box, we set it so the point bounding
+ * boxes are updated too.
+ */
+#define pcb_line_move(l,dx,dy) \
+ do { \
+ pcb_coord_t __dx__ = (dx), __dy__ = (dy); \
+ pcb_line_t *__l__ = (l); \
+ PCB_MOVE((__l__)->Point1.X,(__l__)->Point1.Y,(__dx__),(__dy__)) \
+ PCB_MOVE((__l__)->Point2.X,(__l__)->Point2.Y,(__dx__),(__dy__)) \
+ pcb_line_bbox(__l__); \
+ } while(0)
+
+
+#define PCB_LINE_LOOP(layer) do { \
+ pcb_line_t *line; \
+ gdl_iterator_t __it__; \
+ linelist_foreach(&(layer)->Line, &__it__, line) {
+
+#define PCB_LINE_ALL_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ PCB_LINE_LOOP(layer)
+
+#define PCB_LINE_COPPER_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer; l++, layer++) \
+ { \
+ PCB_LINE_LOOP(layer)
+
+#define PCB_LINE_SILK_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ layer += pcb_max_copper_layer; \
+ for (l = 0; l < 2; l++, layer++) \
+ { \
+ PCB_LINE_LOOP(layer)
+
+#define PCB_LINE_VISIBLE_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ if (layer->On) \
+ PCB_LINE_LOOP(layer)
+
+#endif
diff --git a/src/obj_line_draw.h b/src/obj_line_draw.h
new file mode 100644
index 0000000..188580c
--- /dev/null
+++ b/src/obj_line_draw.h
@@ -0,0 +1,37 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw of lines ***/
+
+/* Include rtree.h for this */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_line_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void _draw_line(pcb_line_t * line);
+void draw_line(pcb_layer_t * layer, pcb_line_t * line);
+void EraseLine(pcb_line_t *Line);
+void DrawLine(pcb_layer_t *Layer, pcb_line_t *Line);
diff --git a/src/obj_line_drcenf.c b/src/obj_line_drcenf.c
new file mode 100644
index 0000000..0e64c05
--- /dev/null
+++ b/src/obj_line_drcenf.c
@@ -0,0 +1,531 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996 Thomas Nau
+ * Copyright (C) 2004 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Contact addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+#include "config.h"
+#include "conf_core.h"
+#include "math_helper.h"
+
+#include <setjmp.h>
+#include <stdlib.h>
+
+#include "board.h"
+#include "data.h"
+#include "find.h"
+#include "rtree.h"
+
+static double drc_lines(pcb_point_t *end, pcb_bool way);
+
+/* ---------------------------------------------------------------------------
+ * Adjust the attached line to 45 degrees if necessary
+ */
+void pcb_line_adjust_attached(void)
+{
+ pcb_attached_line_t *line = &pcb_crosshair.AttachedLine;
+
+ /* I need at least one point */
+ if (line->State == PCB_CH_STATE_FIRST)
+ return;
+ /* don't draw outline when ctrl key is pressed */
+ if (conf_core.editor.mode == PCB_MODE_LINE && pcb_gui->control_is_pressed()) {
+ line->draw = pcb_false;
+ return;
+ }
+ else
+ line->draw = pcb_true;
+ /* no 45 degree lines required */
+ if (PCB->RatDraw || conf_core.editor.all_direction_lines) {
+ line->Point2.X = pcb_crosshair.X;
+ line->Point2.Y = pcb_crosshair.Y;
+ return;
+ }
+ pcb_line_45(line);
+}
+
+/* ---------------------------------------------------------------------------
+ * makes the attached line fit into a 45 degree direction
+ *
+ * directions:
+ *
+ * 0
+ * 7 1
+ * 6 2
+ * 5 3
+ * 4
+ */
+void pcb_line_45(pcb_attached_line_t *Line)
+{
+ pcb_coord_t dx, dy, min;
+ unsigned direction = 0;
+ double m;
+
+ /* first calculate direction of line */
+ dx = pcb_crosshair.X - Line->Point1.X;
+ dy = pcb_crosshair.Y - Line->Point1.Y;
+
+ if (!dx) {
+ if (!dy)
+ /* zero length line, don't draw anything */
+ return;
+ else
+ direction = dy > 0 ? 0 : 4;
+ }
+ else {
+ m = (double) dy / dx;
+ direction = 2;
+ if (m > PCB_TAN_30_DEGREE)
+ direction = m > PCB_TAN_60_DEGREE ? 0 : 1;
+ else if (m < -PCB_TAN_30_DEGREE)
+ direction = m < -PCB_TAN_60_DEGREE ? 0 : 3;
+ }
+ if (dx < 0)
+ direction += 4;
+
+ dx = coord_abs(dx);
+ dy = coord_abs(dy);
+ min = MIN(dx, dy);
+
+ /* now set up the second pair of coordinates */
+ switch (direction) {
+ case 0:
+ case 4:
+ Line->Point2.X = Line->Point1.X;
+ Line->Point2.Y = pcb_crosshair.Y;
+ break;
+
+ case 2:
+ case 6:
+ Line->Point2.X = pcb_crosshair.X;
+ Line->Point2.Y = Line->Point1.Y;
+ break;
+
+ case 1:
+ Line->Point2.X = Line->Point1.X + min;
+ Line->Point2.Y = Line->Point1.Y + min;
+ break;
+
+ case 3:
+ Line->Point2.X = Line->Point1.X + min;
+ Line->Point2.Y = Line->Point1.Y - min;
+ break;
+
+ case 5:
+ Line->Point2.X = Line->Point1.X - min;
+ Line->Point2.Y = Line->Point1.Y - min;
+ break;
+
+ case 7:
+ Line->Point2.X = Line->Point1.X - min;
+ Line->Point2.Y = Line->Point1.Y + min;
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * adjusts the insert lines to make them 45 degrees as necessary
+ */
+void pcb_line_adjust_attached_2lines(pcb_bool way)
+{
+ pcb_coord_t dx, dy;
+ pcb_attached_line_t *line = &pcb_crosshair.AttachedLine;
+
+ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST)
+ return;
+ /* don't draw outline when ctrl key is pressed */
+ if (pcb_gui->control_is_pressed()) {
+ line->draw = pcb_false;
+ return;
+ }
+ else
+ line->draw = pcb_true;
+ if (conf_core.editor.all_direction_lines) {
+ line->Point2.X = pcb_crosshair.X;
+ line->Point2.Y = pcb_crosshair.Y;
+ return;
+ }
+ /* swap the modes if shift is held down */
+ if (pcb_gui->shift_is_pressed())
+ way = !way;
+ dx = pcb_crosshair.X - line->Point1.X;
+ dy = pcb_crosshair.Y - line->Point1.Y;
+ if (!way) {
+ if (coord_abs(dx) > coord_abs(dy)) {
+ line->Point2.X = pcb_crosshair.X - SGN(dx) * coord_abs(dy);
+ line->Point2.Y = line->Point1.Y;
+ }
+ else {
+ line->Point2.X = line->Point1.X;
+ line->Point2.Y = pcb_crosshair.Y - SGN(dy) * coord_abs(dx);
+ }
+ }
+ else {
+ if (coord_abs(dx) > coord_abs(dy)) {
+ line->Point2.X = line->Point1.X + SGN(dx) * coord_abs(dy);
+ line->Point2.Y = pcb_crosshair.Y;
+ }
+ else {
+ line->Point2.X = pcb_crosshair.X;
+ line->Point2.Y = line->Point1.Y + SGN(dy) * coord_abs(dx);;
+ }
+ }
+}
+
+struct drc_info {
+ pcb_line_t *line;
+ pcb_bool solder;
+ jmp_buf env;
+};
+
+static pcb_r_dir_t drcVia_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pin_t *via = (pcb_pin_t *) b;
+ struct drc_info *i = (struct drc_info *) cl;
+
+ if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, via) && pcb_intersect_line_pin(via, i->line))
+ longjmp(i->env, 1);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+static pcb_r_dir_t drcPad_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pad_t *pad = (pcb_pad_t *) b;
+ struct drc_info *i = (struct drc_info *) cl;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) == i->solder && !PCB_FLAG_TEST(PCB_FLAG_FOUND, pad) && pcb_intersect_line_pad(i->line, pad))
+ longjmp(i->env, 1);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+static pcb_r_dir_t drcLine_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_line_t *line = (pcb_line_t *) b;
+ struct drc_info *i = (struct drc_info *) cl;
+
+ if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, line) && pcb_intersect_line_line(line, i->line))
+ longjmp(i->env, 1);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+static pcb_r_dir_t drcArc_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_arc_t *arc = (pcb_arc_t *) b;
+ struct drc_info *i = (struct drc_info *) cl;
+
+ if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, arc) && pcb_intersect_line_arc(i->line, arc))
+ longjmp(i->env, 1);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* drc_lines() checks for intersectors against two lines and
+ * adjusts the end point until there is no intersection or
+ * it winds up back at the start. If way is pcb_false it checks
+ * an ortho start line with one 45 refraction to reach the endpoint,
+ * otherwise it checks a 45 start, with a ortho refraction to reach endpoint
+ *
+ * It returns the straight-line length of the best answer, and
+ * changes the position of the input end point to the best answer.
+ */
+static double drc_lines(pcb_point_t *end, pcb_bool way)
+{
+ double f, s, f2, s2, len, best;
+ pcb_coord_t dx, dy, temp, last, length;
+ pcb_coord_t temp2, last2, length2;
+ pcb_line_t line1, line2;
+ pcb_layergrp_id_t group, comp;
+ struct drc_info info;
+ pcb_bool two_lines, x_is_long, blocker;
+ pcb_point_t ans;
+
+ f = 1.0;
+ s = 0.5;
+ last = -1;
+ line1.Flags = line2.Flags = pcb_no_flags();
+ line1.Thickness = conf_core.design.line_thickness + 2 * (PCB->Bloat + 1);
+ line2.Thickness = line1.Thickness;
+ line1.Clearance = line2.Clearance = 0;
+ line1.Point1.X = pcb_crosshair.AttachedLine.Point1.X;
+ line1.Point1.Y = pcb_crosshair.AttachedLine.Point1.Y;
+ dy = end->Y - line1.Point1.Y;
+ dx = end->X - line1.Point1.X;
+ if (coord_abs(dx) > coord_abs(dy)) {
+ x_is_long = pcb_true;
+ length = coord_abs(dx);
+ }
+ else {
+ x_is_long = pcb_false;
+ length = coord_abs(dy);
+ }
+ group = pcb_layer_get_group(INDEXOFCURRENT);
+ comp = pcb_max_group + 10; /* this out-of-range group might save a call */
+ if (pcb_layer_get_group(pcb_solder_silk_layer) == group)
+ info.solder = pcb_true;
+ else {
+ info.solder = pcb_false;
+ comp = pcb_layer_get_group(pcb_component_silk_layer);
+ }
+ temp = length;
+ /* assume the worst */
+ best = 0.0;
+ ans.X = line1.Point1.X;
+ ans.Y = line1.Point1.Y;
+ while (length != last) {
+ last = length;
+ if (x_is_long) {
+ dx = SGN(dx) * length;
+ dy = end->Y - line1.Point1.Y;
+ length2 = coord_abs(dy);
+ }
+ else {
+ dy = SGN(dy) * length;
+ dx = end->X - line1.Point1.X;
+ length2 = coord_abs(dx);
+ }
+ temp2 = length2;
+ f2 = 1.0;
+ s2 = 0.5;
+ last2 = -1;
+ blocker = pcb_true;
+ while (length2 != last2) {
+ if (x_is_long)
+ dy = SGN(dy) * length2;
+ else
+ dx = SGN(dx) * length2;
+ two_lines = pcb_true;
+ if (coord_abs(dx) > coord_abs(dy) && x_is_long) {
+ line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * coord_abs(dy) : dx - SGN(dx) * coord_abs(dy));
+ line1.Point2.Y = line1.Point1.Y + (way ? dy : 0);
+ }
+ else if (coord_abs(dy) >= coord_abs(dx) && !x_is_long) {
+ line1.Point2.X = line1.Point1.X + (way ? dx : 0);
+ line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * coord_abs(dx) : dy - SGN(dy) * coord_abs(dx));
+ }
+ else if (x_is_long) {
+ /* we've changed which axis is long, so only do one line */
+ line1.Point2.X = line1.Point1.X + dx;
+ line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * coord_abs(dx) : 0);
+ two_lines = pcb_false;
+ }
+ else {
+ /* we've changed which axis is long, so only do one line */
+ line1.Point2.Y = line1.Point1.Y + dy;
+ line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * coord_abs(dy) : 0);
+ two_lines = pcb_false;
+ }
+ line2.Point1.X = line1.Point2.X;
+ line2.Point1.Y = line1.Point2.Y;
+ if (!two_lines) {
+ line2.Point2.Y = line1.Point2.Y;
+ line2.Point2.X = line1.Point2.X;
+ }
+ else {
+ line2.Point2.X = line1.Point1.X + dx;
+ line2.Point2.Y = line1.Point1.Y + dy;
+ }
+ pcb_line_bbox(&line1);
+ pcb_line_bbox(&line2);
+ last2 = length2;
+ if (setjmp(info.env) == 0) {
+ info.line = &line1;
+ pcb_r_search(PCB->Data->via_tree, &line1.BoundingBox, NULL, drcVia_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, &line1.BoundingBox, NULL, drcVia_callback, &info, NULL);
+ if (info.solder || comp == group)
+ pcb_r_search(PCB->Data->pad_tree, &line1.BoundingBox, NULL, drcPad_callback, &info, NULL);
+ if (two_lines) {
+ info.line = &line2;
+ pcb_r_search(PCB->Data->via_tree, &line2.BoundingBox, NULL, drcVia_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, &line2.BoundingBox, NULL, drcVia_callback, &info, NULL);
+ if (info.solder || comp == group)
+ pcb_r_search(PCB->Data->pad_tree, &line2.BoundingBox, NULL, drcPad_callback, &info, NULL);
+ }
+ GROUP_LOOP(PCB->Data, group);
+ {
+ info.line = &line1;
+ pcb_r_search(layer->line_tree, &line1.BoundingBox, NULL, drcLine_callback, &info, NULL);
+ pcb_r_search(layer->arc_tree, &line1.BoundingBox, NULL, drcArc_callback, &info, NULL);
+ if (two_lines) {
+ info.line = &line2;
+ pcb_r_search(layer->line_tree, &line2.BoundingBox, NULL, drcLine_callback, &info, NULL);
+ pcb_r_search(layer->arc_tree, &line2.BoundingBox, NULL, drcArc_callback, &info, NULL);
+ }
+ }
+ PCB_END_LOOP;
+ /* no intersector! */
+ blocker = pcb_false;
+ f2 += s2;
+ len = (line2.Point2.X - line1.Point1.X);
+ len *= len;
+ len += (double) (line2.Point2.Y - line1.Point1.Y) * (line2.Point2.Y - line1.Point1.Y);
+ if (len > best) {
+ best = len;
+ ans.X = line2.Point2.X;
+ ans.Y = line2.Point2.Y;
+ }
+#if 0
+ if (f2 > 1.0)
+ f2 = 0.5;
+#endif
+ }
+ else {
+ /* bumped into something, back off */
+ f2 -= s2;
+ }
+ s2 *= 0.5;
+ length2 = MIN(f2 * temp2, temp2);
+ }
+ if (!blocker && ((x_is_long && line2.Point2.X - line1.Point1.X == dx)
+ || (!x_is_long && line2.Point2.Y - line1.Point1.Y == dy)))
+ f += s;
+ else
+ f -= s;
+ s *= 0.5;
+ length = MIN(f * temp, temp);
+ }
+
+ end->X = ans.X;
+ end->Y = ans.Y;
+ return best;
+}
+
+static void drc_line(pcb_point_t *end)
+{
+ struct drc_info info;
+ pcb_layergrp_id_t group, comp;
+ pcb_line_t line;
+ pcb_attached_line_t aline;
+ static pcb_point_t last_good; /* internal state of last good endpoint - we can do this cheat, because... */
+
+ /* ... we hardwire the assumption on how a line is drawn: it starts out as a 0 long segment, which is valid: */
+ if ((pcb_crosshair.AttachedLine.Point1.X == pcb_crosshair.X) && (pcb_crosshair.AttachedLine.Point1.Y == pcb_crosshair.Y)) {
+ line.Point1 = line.Point2 = pcb_crosshair.AttachedLine.Point1;
+ goto auto_good;
+ }
+
+ memset(&line, 0, sizeof(line));
+
+ /* check where the line wants to end */
+ aline.Point1.X = pcb_crosshair.AttachedLine.Point1.X;
+ aline.Point1.Y = pcb_crosshair.AttachedLine.Point1.Y;
+ pcb_line_45(&aline);
+ line.Point1 = aline.Point1;
+ line.Point2 = aline.Point2;
+
+ /* prepare for the intersection search */
+ group = pcb_layer_get_group(INDEXOFCURRENT);
+ comp = pcb_max_group + 10; /* this out-of-range group might save a call */
+ if (pcb_layer_get_group(pcb_solder_silk_layer) == group)
+ info.solder = pcb_true;
+ else {
+ info.solder = pcb_false;
+ comp = pcb_layer_get_group(pcb_component_silk_layer);
+ }
+
+ /* search for intersection */
+ pcb_line_bbox(&line);
+ if (setjmp(info.env) == 0) {
+ info.line = &line;
+ pcb_r_search(PCB->Data->via_tree, &line.BoundingBox, NULL, drcVia_callback, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, &line.BoundingBox, NULL, drcVia_callback, &info, NULL);
+ if (info.solder || comp == group)
+ pcb_r_search(PCB->Data->pad_tree, &line.BoundingBox, NULL, drcPad_callback, &info, NULL);
+ GROUP_LOOP(PCB->Data, group);
+ {
+ info.line = &line;
+ pcb_r_search(layer->line_tree, &line.BoundingBox, NULL, drcLine_callback, &info, NULL);
+ pcb_r_search(layer->arc_tree, &line.BoundingBox, NULL, drcArc_callback, &info, NULL);
+ }
+ PCB_END_LOOP;
+ /* no intersector! */
+ auto_good:;
+ last_good.X = end->X = line.Point2.X;
+ last_good.Y = end->Y = line.Point2.Y;
+ return;
+ }
+
+ /* bumped into ans */
+ end->X = last_good.X;
+ end->Y = last_good.Y;
+}
+
+void pcb_line_enforce_drc(void)
+{
+ pcb_point_t r45, rs;
+ pcb_bool shift;
+ double r1, r2;
+
+ /* Silence a bogus compiler warning by storing this in a variable */
+ int layer_idx = INDEXOFCURRENT;
+
+ if (pcb_gui->mod1_is_pressed() || pcb_gui->control_is_pressed() || PCB->RatDraw || layer_idx >= pcb_max_copper_layer)
+ return;
+
+ rs.X = r45.X = pcb_crosshair.X;
+ rs.Y = r45.Y = pcb_crosshair.Y;
+
+ if (conf_core.editor.line_refraction != 0) {
+ /* first try starting straight */
+ r1 = drc_lines(&rs, pcb_false);
+ /* then try starting at 45 */
+ r2 = drc_lines(&r45, pcb_true);
+ }
+ else {
+ drc_line(&rs);
+ r45 = rs;
+#define sqr(a) ((a) * (a))
+ r1 = r2 = sqrt(sqr(rs.X - pcb_crosshair.AttachedLine.Point1.X) + sqr(rs.Y - pcb_crosshair.AttachedLine.Point1.Y));
+#undef sqr
+ }
+ /* shift<Key> forces the line lookahead path to refract the alternate way */
+ shift = pcb_gui->shift_is_pressed();
+
+ if (PCB_XOR(r1 > r2, shift)) {
+ if (conf_core.editor.line_refraction != 0) {
+ if (shift) {
+ if (conf_core.editor.line_refraction !=2)
+ conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2);
+ }
+ else{
+ if (conf_core.editor.line_refraction != 1)
+ conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1);
+ }
+ }
+ pcb_crosshair.X = rs.X;
+ pcb_crosshair.Y = rs.Y;
+ }
+ else {
+ if (conf_core.editor.line_refraction !=0) {
+ if (shift) {
+ if (conf_core.editor.line_refraction != 1)
+ conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1);
+ }
+ else {
+ if (conf_core.editor.line_refraction != 2)
+ conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2);
+ }
+ }
+ pcb_crosshair.X = r45.X;
+ pcb_crosshair.Y = r45.Y;
+ }
+}
diff --git a/src/obj_line_list.c b/src/obj_line_list.c
new file mode 100644
index 0000000..7ca383f
--- /dev/null
+++ b/src/obj_line_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_line_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_line_list.h b/src/obj_line_list.h
new file mode 100644
index 0000000..07189be
--- /dev/null
+++ b/src/obj_line_list.h
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_LINE_LIST_H
+#define PCB_OBJ_LINE_LIST_H
+
+#include "obj_line.h"
+
+/* List of Lines */
+#define TDL(x) linelist_ ## x
+#define TDL_LIST_T linelist_t
+#define TDL_ITEM_T pcb_line_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define linelist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_line_op.h b/src/obj_line_op.h
new file mode 100644
index 0000000..ccd3f16
--- /dev/null
+++ b/src/obj_line_op.h
@@ -0,0 +1,52 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on line segments ***/
+
+#include "operation.h"
+
+void *AddLineToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *ChangeLineSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *ChangeLineClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *ChangeLineName(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *ChangeLineJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *SetLineJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *ClrLineJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *InsertPointIntoLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *MoveLineToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_line_t * line);
+void *CopyLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *MoveLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *MoveLinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point);
+void *MoveLineToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_line_t * line, pcb_layer_t * Destination);
+void *MoveLineToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_line_t * Line);
+void *DestroyLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *RemoveLinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point);
+void *RemoveLine_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+void *Rotate90LinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point);
+void *Rotate90Line(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line);
+
+
+
diff --git a/src/obj_pad.c b/src/obj_pad.c
new file mode 100644
index 0000000..0874156
--- /dev/null
+++ b/src/obj_pad.c
@@ -0,0 +1,505 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: smd pads */
+
+#include "config.h"
+
+#include "board.h"
+#include "data.h"
+#include "undo.h"
+#include "polygon.h"
+#include "compat_misc.h"
+#include "conf_core.h"
+
+#include "obj_pad.h"
+#include "obj_pad_list.h"
+#include "obj_pad_op.h"
+
+
+/* TODO: remove this if draw.[ch] pads are moved */
+#include "draw.h"
+#include "obj_text_draw.h"
+#include "obj_pad_draw.h"
+
+/*** allocation ***/
+/* get next slot for a pad, allocates memory if necessary */
+pcb_pad_t *pcb_pad_alloc(pcb_element_t * element)
+{
+ pcb_pad_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_pad_t), 1);
+ padlist_append(&element->Pad, new_obj);
+
+ return new_obj;
+}
+
+void pcb_pad_free(pcb_pad_t * data)
+{
+ padlist_remove(data);
+ free(data);
+}
+
+
+/*** utility ***/
+/* creates a new pad in an element */
+pcb_pad_t *pcb_element_pad_new(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, char *Name, char *Number, pcb_flag_t Flags)
+{
+ pcb_pad_t *pad = pcb_pad_alloc(Element);
+
+ /* copy values */
+ if (X1 > X2 || (X1 == X2 && Y1 > Y2)) {
+ pad->Point1.X = X2;
+ pad->Point1.Y = Y2;
+ pad->Point2.X = X1;
+ pad->Point2.Y = Y1;
+ }
+ else {
+ pad->Point1.X = X1;
+ pad->Point1.Y = Y1;
+ pad->Point2.X = X2;
+ pad->Point2.Y = Y2;
+ }
+ pad->Thickness = Thickness;
+ pad->Clearance = Clearance;
+ pad->Mask = Mask;
+ pad->Name = pcb_strdup_null(Name);
+ pad->Number = pcb_strdup_null(Number);
+ pad->Flags = Flags;
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, pad);
+ pad->ID = pcb_create_ID_get();
+ pad->Element = Element;
+ return (pad);
+}
+
+/* sets the bounding box of a pad */
+void pcb_pad_bbox(pcb_pad_t *Pad)
+{
+ pcb_coord_t width;
+ pcb_coord_t deltax;
+ pcb_coord_t deltay;
+
+ /* the bounding box covers the extent of influence
+ * so it must include the clearance values too
+ */
+ width = (Pad->Thickness + Pad->Clearance + 1) / 2;
+ width = MAX(width, (Pad->Mask + 1) / 2);
+ deltax = Pad->Point2.X - Pad->Point1.X;
+ deltay = Pad->Point2.Y - Pad->Point1.Y;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pad) && deltax != 0 && deltay != 0) {
+ /* slanted square pad */
+ double theta;
+ pcb_coord_t btx, bty;
+
+ /* T is a vector half a thickness long, in the direction of
+ one of the corners. */
+ theta = atan2(deltay, deltax);
+ btx = width * cos(theta + M_PI / 4) * sqrt(2.0);
+ bty = width * sin(theta + M_PI / 4) * sqrt(2.0);
+
+
+ Pad->BoundingBox.X1 = MIN(MIN(Pad->Point1.X - btx, Pad->Point1.X - bty), MIN(Pad->Point2.X + btx, Pad->Point2.X + bty));
+ Pad->BoundingBox.X2 = MAX(MAX(Pad->Point1.X - btx, Pad->Point1.X - bty), MAX(Pad->Point2.X + btx, Pad->Point2.X + bty));
+ Pad->BoundingBox.Y1 = MIN(MIN(Pad->Point1.Y + btx, Pad->Point1.Y - bty), MIN(Pad->Point2.Y - btx, Pad->Point2.Y + bty));
+ Pad->BoundingBox.Y2 = MAX(MAX(Pad->Point1.Y + btx, Pad->Point1.Y - bty), MAX(Pad->Point2.Y - btx, Pad->Point2.Y + bty));
+ }
+ else {
+ /* Adjust for our discrete polygon approximation */
+ width = (double) width *PCB_POLY_CIRC_RADIUS_ADJ + 0.5;
+
+ Pad->BoundingBox.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - width;
+ Pad->BoundingBox.X2 = MAX(Pad->Point1.X, Pad->Point2.X) + width;
+ Pad->BoundingBox.Y1 = MIN(Pad->Point1.Y, Pad->Point2.Y) - width;
+ Pad->BoundingBox.Y2 = MAX(Pad->Point1.Y, Pad->Point2.Y) + width;
+ }
+ pcb_close_box(&Pad->BoundingBox);
+}
+
+/* changes the nopaste flag of a pad */
+pcb_bool pcb_pad_change_paste(pcb_pad_t *Pad)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad))
+ return (pcb_false);
+ ErasePad(Pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, Pad, Pad, Pad);
+ PCB_FLAG_TOGGLE(PCB_FLAG_NOPASTE, Pad);
+ DrawPad(Pad);
+ pcb_draw();
+ return (pcb_true);
+}
+
+int pcb_pad_eq(const pcb_element_t *e1, const pcb_pad_t *p1, const pcb_element_t *e2, const pcb_pad_t *p2)
+{
+ if (pcb_field_neq(p1, p2, Thickness) || pcb_field_neq(p1, p2, Clearance)) return 0;
+ if (pcb_element_neq_offsx(e1, p1, e2, p2, Point1.X) || pcb_element_neq_offsy(e1, p1, e2, p2, Point1.Y)) return 0;
+ if (pcb_element_neq_offsx(e1, p1, e2, p2, Point2.X) || pcb_element_neq_offsy(e1, p1, e2, p2, Point2.Y)) return 0;
+ if (pcb_field_neq(p1, p2, Mask)) return 0;
+ if (pcb_neqs(p1->Name, p2->Name)) return 0;
+ if (pcb_neqs(p1->Number, p2->Number)) return 0;
+ return 1;
+}
+
+unsigned int pcb_pad_hash(const pcb_element_t *e, const pcb_pad_t *p)
+{
+ return
+ pcb_hash_coord(p->Thickness) ^ pcb_hash_coord(p->Clearance) ^
+ pcb_hash_element_ox(e, p->Point1.X) ^ pcb_hash_element_oy(e, p->Point1.Y) ^
+ pcb_hash_element_ox(e, p->Point2.X) ^ pcb_hash_element_oy(e, p->Point2.Y) ^
+ pcb_hash_coord(p->Mask) ^
+ pcb_hash_str(p->Name) ^ pcb_hash_str(p->Number);
+}
+
+
+/*** ops ***/
+
+/* changes the size of a pad */
+void *ChangePadSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Thickness + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad))
+ return (NULL);
+ if (value <= PCB_MAX_PADSIZE && value >= PCB_MIN_PADSIZE && value != Pad->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PAD, Element, Pad, Pad);
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_PAD, Element, Pad, Pad);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad);
+ ErasePad(Pad);
+ pcb_r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox);
+ Pad->Mask += value - Pad->Thickness;
+ Pad->Thickness = value;
+ /* SetElementBB updates all associated rtrees */
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad);
+ DrawPad(Pad);
+ return (Pad);
+ }
+ return (NULL);
+}
+
+/* changes the clearance size of a pad */
+void *ChangePadClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Clearance + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad))
+ return (NULL);
+ value = MIN(PCB_MAX_LINESIZE, value);
+ if (value < 0)
+ value = 0;
+ if (ctx->chgsize.delta < 0 && value < PCB->Bloat * 2)
+ value = 0;
+ if ((ctx->chgsize.delta > 0 || ctx->chgsize.absolute) && value < PCB->Bloat * 2)
+ value = PCB->Bloat * 2 + 2;
+ if (value == Pad->Clearance)
+ return NULL;
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_PAD, Element, Pad, Pad);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad);
+ ErasePad(Pad);
+ pcb_r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox);
+ Pad->Clearance = value;
+ /* SetElementBB updates all associated rtrees */
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad);
+ DrawPad(Pad);
+ return Pad;
+}
+
+/* changes the name of a pad */
+void *ChangePadName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+ char *old = Pad->Name;
+
+ Element = Element; /* get rid of 'unused...' warnings */
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pad)) {
+ ErasePadName(Pad);
+ Pad->Name = ctx->chgname.new_name;
+ DrawPadName(Pad);
+ }
+ else
+ Pad->Name = ctx->chgname.new_name;
+ return (old);
+}
+
+/* changes the number of a pad */
+void *ChangePadNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+ char *old = Pad->Number;
+
+ Element = Element; /* get rid of 'unused...' warnings */
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pad)) {
+ ErasePadName(Pad);
+ Pad->Number = ctx->chgname.new_name;
+ DrawPadName(Pad);
+ }
+ else
+ Pad->Number = ctx->chgname.new_name;
+ return (old);
+}
+
+/* changes the square flag of a pad */
+void *ChangePadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad))
+ return (NULL);
+ ErasePad(Pad);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PAD, Element, Pad, Pad, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, Element, Pad, Pad);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SQUARE, Pad);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PAD, Element, Pad, Pad, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad);
+ DrawPad(Pad);
+ return (Pad);
+}
+
+/* sets the square flag of a pad */
+void *SetPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad) || PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pad))
+ return (NULL);
+
+ return (ChangePadSquare(ctx, Element, Pad));
+}
+
+
+/* clears the square flag of a pad */
+void *ClrPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad) || !PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pad))
+ return (NULL);
+
+ return (ChangePadSquare(ctx, Element, Pad));
+}
+
+/* changes the mask size of a pad */
+void *ChangePadMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Mask + ctx->chgsize.delta;
+
+ value = MAX(value, 0);
+ if (value == Pad->Mask && ctx->chgsize.absolute == 0)
+ value = Pad->Thickness;
+ if (value != Pad->Mask) {
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_PAD, Element, Pad, Pad);
+ ErasePad(Pad);
+ pcb_r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox);
+ Pad->Mask = value;
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ DrawPad(Pad);
+ return (Pad);
+ }
+ return (NULL);
+}
+
+/*** draw ***/
+static void draw_pad_name(pcb_pad_t * pad)
+{
+ pcb_box_t box;
+ pcb_bool vert;
+ pcb_text_t text;
+ char buff[128];
+ const char *pn;
+
+ if (!pad->Name || !pad->Name[0]) {
+ pn = PCB_EMPTY(pad->Number);
+ }
+ else {
+ pn = conf_core.editor.show_number ? pad->Number : pad->Name;
+ if (pn == NULL)
+ pn = "n/a";
+ }
+
+ if (PCB_FLAG_INTCONN_GET(pad) > 0)
+ pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, PCB_FLAG_INTCONN_GET(pad));
+ else
+ strcpy(buff, pn);
+ text.TextString = buff;
+
+ /* should text be vertical ? */
+ vert = (pad->Point1.X == pad->Point2.X);
+
+ if (vert) {
+ box.X1 = pad->Point1.X - pad->Thickness / 2;
+ box.Y1 = MAX(pad->Point1.Y, pad->Point2.Y) + pad->Thickness / 2;
+ box.X1 += conf_core.appearance.pinout.text_offset_y;
+ box.Y1 -= conf_core.appearance.pinout.text_offset_x;
+ }
+ else {
+ box.X1 = MIN(pad->Point1.X, pad->Point2.X) - pad->Thickness / 2;
+ box.Y1 = pad->Point1.Y - pad->Thickness / 2;
+ box.X1 += conf_core.appearance.pinout.text_offset_x;
+ box.Y1 += conf_core.appearance.pinout.text_offset_y;
+ }
+
+ pcb_gui->set_color(Output.fgGC, PCB->PinNameColor);
+
+ text.Flags = pcb_no_flags();
+ /* Set font height to approx 90% of pin thickness */
+ text.Scale = 90 * pad->Thickness / PCB_FONT_CAPHEIGHT;
+ text.X = box.X1;
+ text.Y = box.Y1;
+ text.Direction = vert ? 1 : 0;
+
+ DrawTextLowLevel(&text, 0);
+}
+
+static void _draw_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask)
+{
+ if (clear && !mask && pad->Clearance <= 0)
+ return;
+
+ if (conf_core.editor.thin_draw || (clear && conf_core.editor.thin_draw_poly))
+ pcb_gui->thindraw_pcb_pad(gc, pad, clear, mask);
+ else
+ pcb_gui->fill_pcb_pad(gc, pad, clear, mask);
+}
+
+void draw_pad(pcb_pad_t * pad)
+{
+ const char *color = NULL;
+ char buf[sizeof("#XXXXXX")];
+
+ if (pcb_draw_doing_pinout)
+ pcb_gui->set_color(Output.fgGC, PCB->PinColor);
+ else if (PCB_FLAG_TEST(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, pad))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad))
+ color = PCB->PinSelectedColor;
+ else
+ color = PCB->ConnectedColor;
+ }
+ else if (PCB_FRONT(pad))
+ color = PCB->PinColor;
+ else
+ color = PCB->InvisibleObjectsColor;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, pad)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+
+ if (color != NULL)
+ pcb_gui->set_color(Output.fgGC, color);
+
+ _draw_pad(Output.fgGC, pad, pcb_false, pcb_false);
+
+ if (pcb_draw_doing_pinout || PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, pad))
+ draw_pad_name(pad);
+}
+
+pcb_r_dir_t draw_pad_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pad_t *pad = (pcb_pad_t *) b;
+ int *side = cl;
+
+ if (PCB_ON_SIDE(pad, *side))
+ draw_pad(pad);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+pcb_r_dir_t clear_pad_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pad_t *pad = (pcb_pad_t *) b;
+ int *side = cl;
+ if (PCB_ON_SIDE(pad, *side) && pad->Mask)
+ _draw_pad(Output.pmGC, pad, pcb_true, pcb_true);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* draws solder paste layer for a given side of the board - only pads get paste */
+void DrawPaste(int side, const pcb_box_t * drawn_area)
+{
+ pcb_gui->set_color(Output.fgGC, PCB->ElementColor);
+ PCB_PAD_ALL_LOOP(PCB->Data);
+ {
+ if (PCB_ON_SIDE(pad, side) && !PCB_FLAG_TEST(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) {
+ if (pad->Mask < pad->Thickness)
+ _draw_pad(Output.fgGC, pad, pcb_true, pcb_true);
+ else
+ _draw_pad(Output.fgGC, pad, pcb_false, pcb_false);
+ }
+ }
+ PCB_ENDALL_LOOP;
+}
+
+static void GatherPadName(pcb_pad_t *Pad)
+{
+ pcb_box_t box;
+ pcb_bool vert;
+
+ /* should text be vertical ? */
+ vert = (Pad->Point1.X == Pad->Point2.X);
+
+ if (vert) {
+ box.X1 = Pad->Point1.X - Pad->Thickness / 2;
+ box.Y1 = MAX(Pad->Point1.Y, Pad->Point2.Y) + Pad->Thickness / 2;
+ box.X1 += conf_core.appearance.pinout.text_offset_y;
+ box.Y1 -= conf_core.appearance.pinout.text_offset_x;
+ box.X2 = box.X1;
+ box.Y2 = box.Y1;
+ }
+ else {
+ box.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - Pad->Thickness / 2;
+ box.Y1 = Pad->Point1.Y - Pad->Thickness / 2;
+ box.X1 += conf_core.appearance.pinout.text_offset_x;
+ box.Y1 += conf_core.appearance.pinout.text_offset_y;
+ box.X2 = box.X1;
+ box.Y2 = box.Y1;
+ }
+
+ pcb_draw_invalidate(&box);
+ return;
+}
+
+void ErasePad(pcb_pad_t *Pad)
+{
+ pcb_draw_invalidate(Pad);
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pad))
+ ErasePadName(Pad);
+ pcb_flag_erase(&Pad->Flags);
+}
+
+void ErasePadName(pcb_pad_t *Pad)
+{
+ GatherPadName(Pad);
+}
+
+void DrawPad(pcb_pad_t *Pad)
+{
+ pcb_draw_invalidate(Pad);
+ if (pcb_draw_doing_pinout || PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pad))
+ DrawPadName(Pad);
+}
+
+void DrawPadName(pcb_pad_t *Pad)
+{
+ GatherPadName(Pad);
+}
diff --git a/src/obj_pad.h b/src/obj_pad.h
new file mode 100644
index 0000000..ecd988e
--- /dev/null
+++ b/src/obj_pad.h
@@ -0,0 +1,83 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: smd pads */
+
+#ifndef PCB_OBJ_PAD_H
+#define PCB_OBJ_PAD_H
+
+#include "obj_common.h"
+
+struct pcb_pad_s { /* a SMD pad */
+ PCB_ANYLINEFIELDS;
+ pcb_coord_t Mask;
+ char *Name, *Number; /* 'Line' */
+ void *Element;
+ void *Spare;
+ gdl_elem_t link; /* a pad is in a list (element) */
+};
+
+
+pcb_pad_t *pcb_pad_alloc(pcb_element_t * element);
+void pcb_pad_free(pcb_pad_t * data);
+
+pcb_pad_t *pcb_element_pad_new(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, char *Name, char *Number, pcb_flag_t Flags);
+void pcb_pad_bbox(pcb_pad_t *Pad);
+
+pcb_bool pcb_pad_change_paste(pcb_pad_t *Pad);
+
+/* hash */
+int pcb_pad_eq(const pcb_element_t *e1, const pcb_pad_t *p1, const pcb_element_t *e2, const pcb_pad_t *p2);
+unsigned int pcb_pad_hash(const pcb_element_t *e, const pcb_pad_t *p);
+
+
+/* Rather than move the line bounding box, we set it so the point bounding
+ * boxes are updated too.
+ */
+#define pcb_pad_move(p,dx,dy) \
+ do { \
+ pcb_coord_t __dx__ = (dx), __dy__ = (dy); \
+ pcb_pad_t *__p__ = (p); \
+ PCB_MOVE((__p__)->Point1.X,(__p__)->Point1.Y,(__dx__),(__dy__)) \
+ PCB_MOVE((__p__)->Point2.X,(__p__)->Point2.Y,(__dx__),(__dy__)) \
+ pcb_pad_bbox((__p__)); \
+ } while(0)
+
+#define PCB_PAD_ROTATE90(p,x0,y0,n) \
+ pcb_line_rotate90(((pcb_line_t *) (p)),(x0),(y0),(n))
+
+#define PCB_PAD_LOOP(element) do { \
+ pcb_pad_t *pad; \
+ gdl_iterator_t __it__; \
+ padlist_foreach(&(element)->Pad, &__it__, pad) {
+
+#define PCB_PAD_ALL_LOOP(top) \
+ PCB_ELEMENT_LOOP(top); \
+ PCB_PAD_LOOP(element)
+
+
+#endif
+
diff --git a/src/obj_pad_draw.h b/src/obj_pad_draw.h
new file mode 100644
index 0000000..91e293e
--- /dev/null
+++ b/src/obj_pad_draw.h
@@ -0,0 +1,41 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw on pads ***/
+
+
+/* Include rtree.h for these */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_pad_callback(const pcb_box_t * b, void *cl);
+pcb_r_dir_t clear_pad_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void draw_pad(pcb_pad_t * pad);
+void DrawPaste(int side, const pcb_box_t * drawn_area);
+void ErasePad(pcb_pad_t *Pad);
+void ErasePadName(pcb_pad_t *Pad);
+void DrawPad(pcb_pad_t *Pad);
+void DrawPadName(pcb_pad_t *Pad);
diff --git a/src/obj_pad_list.c b/src/obj_pad_list.c
new file mode 100644
index 0000000..72f6926
--- /dev/null
+++ b/src/obj_pad_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_pad_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_pad_list.h b/src/obj_pad_list.h
new file mode 100644
index 0000000..3b0b6c7
--- /dev/null
+++ b/src/obj_pad_list.h
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_PAD_LIST_H
+#define PCB_OBJ_PAD_LIST_H
+
+#include "obj_pad.h"
+
+/* List of Pads */
+#define TDL(x) padlist_ ## x
+#define TDL_LIST_T padlist_t
+#define TDL_ITEM_T pcb_pad_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define padlist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_pad_op.h b/src/obj_pad_op.h
new file mode 100644
index 0000000..1dd13bb
--- /dev/null
+++ b/src/obj_pad_op.h
@@ -0,0 +1,42 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on pads ***/
+
+#include "operation.h"
+
+void *ChangePadSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *ChangePadClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *ChangePadName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *ChangePadNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *ChangePadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *SetPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *ClrPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+void *ChangePadMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad);
+
+
+
+
diff --git a/src/obj_pinvia.c b/src/obj_pinvia.c
new file mode 100644
index 0000000..4ca890c
--- /dev/null
+++ b/src/obj_pinvia.c
@@ -0,0 +1,1058 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: pins and vias */
+
+#include "config.h"
+#include "board.h"
+#include "data.h"
+#include "undo.h"
+#include "conf_core.h"
+#include "polygon.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
+#include "stub_vendor.h"
+#include "rotate.h"
+
+#include "obj_pinvia.h"
+#include "obj_pinvia_op.h"
+
+/* TODO: consider removing this by moving pin/via functions here: */
+#include "draw.h"
+#include "obj_text_draw.h"
+#include "obj_pinvia_draw.h"
+
+/*** allocation ***/
+
+/* get next slot for a via, allocates memory if necessary */
+pcb_pin_t *pcb_via_alloc(pcb_data_t * data)
+{
+ pcb_pin_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_pin_t), 1);
+ pinlist_append(&data->Via, new_obj);
+
+ return new_obj;
+}
+
+void pcb_via_free(pcb_pin_t * data)
+{
+ pinlist_remove(data);
+ free(data);
+}
+
+/* get next slot for a pin, allocates memory if necessary */
+pcb_pin_t *pcb_pin_alloc(pcb_element_t * element)
+{
+ pcb_pin_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_pin_t), 1);
+ pinlist_append(&element->Pin, new_obj);
+
+ return new_obj;
+}
+
+void pcb_pin_free(pcb_pin_t * data)
+{
+ pinlist_remove(data);
+ free(data);
+}
+
+
+
+/*** utility ***/
+
+/* creates a new via */
+pcb_pin_t *pcb_via_new(pcb_data_t *Data, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, const char *Name, pcb_flag_t Flags)
+{
+ pcb_pin_t *Via;
+
+ if (!pcb_create_being_lenient) {
+ PCB_VIA_LOOP(Data);
+ {
+ if (pcb_distance(X, Y, via->X, via->Y) <= via->DrillingHole / 2 + DrillingHole / 2) {
+ pcb_message(PCB_MSG_WARNING, _("%m+Dropping via at %$mD because it's hole would overlap with the via "
+ "at %$mD\n"), conf_core.editor.grid_unit->allow, X, Y, via->X, via->Y);
+ return (NULL); /* don't allow via stacking */
+ }
+ }
+ PCB_END_LOOP;
+ }
+
+ Via = pcb_via_alloc(Data);
+
+ if (!Via)
+ return (Via);
+ /* copy values */
+ Via->X = X;
+ Via->Y = Y;
+ Via->Thickness = Thickness;
+ Via->Clearance = Clearance;
+ Via->Mask = Mask;
+ Via->DrillingHole = pcb_stub_vendor_drill_map(DrillingHole);
+ if (Via->DrillingHole != DrillingHole) {
+ pcb_message(PCB_MSG_INFO, _("%m+Mapped via drill hole to %$mS from %$mS per vendor table\n"),
+ conf_core.editor.grid_unit->allow, Via->DrillingHole, DrillingHole);
+ }
+
+ Via->Name = pcb_strdup_null(Name);
+ Via->Flags = Flags;
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, Via);
+ PCB_FLAG_SET(PCB_FLAG_VIA, Via);
+ Via->ID = pcb_create_ID_get();
+
+ /*
+ * don't complain about PCB_MIN_PINORVIACOPPER on a mounting hole (pure
+ * hole)
+ */
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, Via) && (Via->Thickness < Via->DrillingHole + PCB_MIN_PINORVIACOPPER)) {
+ Via->Thickness = Via->DrillingHole + PCB_MIN_PINORVIACOPPER;
+ pcb_message(PCB_MSG_WARNING, _("%m+Increased via thickness to %$mS to allow enough copper"
+ " at %$mD.\n"), conf_core.editor.grid_unit->allow, Via->Thickness, Via->X, Via->Y);
+ }
+
+ pcb_add_via(Data, Via);
+ return (Via);
+}
+
+/* creates a new pin in an element */
+pcb_pin_t *pcb_element_pin_new(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, char *Name, char *Number, pcb_flag_t Flags)
+{
+ pcb_pin_t *pin = pcb_pin_alloc(Element);
+
+ /* copy values */
+ pin->X = X;
+ pin->Y = Y;
+ pin->Thickness = Thickness;
+ pin->Clearance = Clearance;
+ pin->Mask = Mask;
+ pin->Name = pcb_strdup_null(Name);
+ pin->Number = pcb_strdup_null(Number);
+ pin->Flags = Flags;
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN, pin);
+ PCB_FLAG_SET(PCB_FLAG_PIN, pin);
+ pin->ID = pcb_create_ID_get();
+ pin->Element = Element;
+
+ /*
+ * If there is no vendor drill map installed, this will simply
+ * return DrillingHole.
+ */
+ pin->DrillingHole = pcb_stub_vendor_drill_map(DrillingHole);
+
+ /* Unless we should not map drills on this element, map them! */
+ if (pcb_stub_vendor_is_element_mappable(Element)) {
+ if (pin->DrillingHole < PCB_MIN_PINORVIASIZE) {
+ pcb_message(PCB_MSG_WARNING, _("%m+Did not map pin #%s (%s) drill hole because %$mS is below the minimum allowed size\n"),
+ conf_core.editor.grid_unit->allow, PCB_UNKNOWN(Number), PCB_UNKNOWN(Name), pin->DrillingHole);
+ pin->DrillingHole = DrillingHole;
+ }
+ else if (pin->DrillingHole > PCB_MAX_PINORVIASIZE) {
+ pcb_message(PCB_MSG_WARNING, _("%m+Did not map pin #%s (%s) drill hole because %$mS is above the maximum allowed size\n"),
+ conf_core.editor.grid_unit->allow, PCB_UNKNOWN(Number), PCB_UNKNOWN(Name), pin->DrillingHole);
+ pin->DrillingHole = DrillingHole;
+ }
+ else if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)
+ && (pin->DrillingHole > pin->Thickness - PCB_MIN_PINORVIACOPPER)) {
+ pcb_message(PCB_MSG_WARNING, _("%m+Did not map pin #%s (%s) drill hole because %$mS does not leave enough copper\n"),
+ conf_core.editor.grid_unit->allow, PCB_UNKNOWN(Number), PCB_UNKNOWN(Name), pin->DrillingHole);
+ pin->DrillingHole = DrillingHole;
+ }
+ }
+ else {
+ pin->DrillingHole = DrillingHole;
+ }
+
+ if (pin->DrillingHole != DrillingHole) {
+ pcb_message(PCB_MSG_INFO, _("%m+Mapped pin drill hole to %$mS from %$mS per vendor table\n"),
+ conf_core.editor.grid_unit->allow, pin->DrillingHole, DrillingHole);
+ }
+
+ return (pin);
+}
+
+
+
+void pcb_add_via(pcb_data_t *Data, pcb_pin_t *Via)
+{
+ pcb_pin_bbox(Via);
+ if (!Data->via_tree)
+ Data->via_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Data->via_tree, (pcb_box_t *) Via, 0);
+}
+
+/* sets the bounding box of a pin or via */
+void pcb_pin_bbox(pcb_pin_t *Pin)
+{
+ pcb_coord_t width;
+
+ if ((PCB_FLAG_SQUARE_GET(Pin) > 1) && (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pin))) {
+ pcb_polyarea_t *p = pcb_poly_from_pin(Pin, PIN_SIZE(Pin), Pin->Clearance);
+ pcb_polyarea_bbox(p, &Pin->BoundingBox);
+ pcb_polyarea_free(&p);
+ }
+
+ /* the bounding box covers the extent of influence
+ * so it must include the clearance values too
+ */
+ width = MAX(Pin->Clearance + PIN_SIZE(Pin), Pin->Mask) / 2;
+
+ /* Adjust for our discrete polygon approximation */
+ width = (double) width *PCB_POLY_CIRC_RADIUS_ADJ + 0.5;
+
+ Pin->BoundingBox.X1 = Pin->X - width;
+ Pin->BoundingBox.Y1 = Pin->Y - width;
+ Pin->BoundingBox.X2 = Pin->X + width;
+ Pin->BoundingBox.Y2 = Pin->Y + width;
+ pcb_close_box(&Pin->BoundingBox);
+}
+
+void pcb_via_rotate(pcb_data_t *Data, pcb_pin_t *Via, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina)
+{
+ pcb_r_delete_entry(Data->via_tree, (pcb_box_t *) Via);
+ pcb_rotate(&Via->X, &Via->Y, X, Y, cosa, sina);
+ pcb_pin_bbox(Via);
+ pcb_r_insert_entry(Data->via_tree, (pcb_box_t *) Via, 0);
+}
+
+void pcb_via_mirror(pcb_data_t *Data, pcb_pin_t *via)
+{
+ via->X = PCB_SWAP_X(via->X);
+ via->Y = PCB_SWAP_Y(via->Y);
+}
+
+void pcb_via_flip_side(pcb_data_t *Data, pcb_pin_t *via)
+{
+ pcb_r_delete_entry(Data->via_tree, (pcb_box_t *) via);
+ via->X = PCB_SWAP_X(via->X);
+ via->Y = PCB_SWAP_Y(via->Y);
+ pcb_pin_bbox(via);
+ pcb_r_insert_entry(Data->via_tree, (pcb_box_t *) via, 0);
+}
+
+int pcb_pin_eq(const pcb_element_t *e1, const pcb_pin_t *p1, const pcb_element_t *e2, const pcb_pin_t *p2)
+{
+ if (pcb_field_neq(p1, p2, Thickness) || pcb_field_neq(p1, p2, Clearance)) return 0;
+ if (pcb_field_neq(p1, p2, Mask) || pcb_field_neq(p1, p2, DrillingHole)) return 0;
+ if (pcb_element_neq_offsx(e1, p1, e2, p2, X) || pcb_element_neq_offsy(e1, p1, e2, p2, Y)) return 0;
+ if (pcb_neqs(p1->Name, p2->Name)) return 0;
+ if (pcb_neqs(p1->Number, p2->Number)) return 0;
+ return 1;
+}
+
+unsigned int pcb_pin_hash(const pcb_element_t *e, const pcb_pin_t *p)
+{
+ return
+ pcb_hash_coord(p->Thickness) ^ pcb_hash_coord(p->Clearance) ^
+ pcb_hash_coord(p->Mask) ^ pcb_hash_coord(p->DrillingHole) ^
+ pcb_hash_element_ox(e, p->X) ^ pcb_hash_element_oy(e, p->Y) ^
+ pcb_hash_str(p->Name) ^ pcb_hash_str(p->Number);
+}
+
+
+/*** ops ***/
+/* copies a via to paste buffer */
+void *AddViaToBuffer(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ return (pcb_via_new(ctx->buffer.dst, Via->X, Via->Y, Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, pcb_flag_mask(Via->Flags, PCB_FLAG_FOUND | ctx->buffer.extraflg)));
+}
+
+/* moves a via to paste buffer without allocating memory for the name */
+void *MoveViaToBuffer(pcb_opctx_t *ctx, pcb_pin_t * via)
+{
+ pcb_poly_restore_to_poly(ctx->buffer.src, PCB_TYPE_VIA, via, via);
+
+ pcb_r_delete_entry(ctx->buffer.src->via_tree, (pcb_box_t *) via);
+ pinlist_remove(via);
+ pinlist_append(&ctx->buffer.dst->Via, via);
+
+ PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND, via);
+
+ if (!ctx->buffer.dst->via_tree)
+ ctx->buffer.dst->via_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(ctx->buffer.dst->via_tree, (pcb_box_t *) via, 0);
+ pcb_poly_clear_from_poly(ctx->buffer.dst, PCB_TYPE_VIA, via, via);
+ return via;
+}
+
+/* changes the thermal on a via */
+void *ChangeViaThermal(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_VIA, Via, Via, Via, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, CURRENT, Via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, Via, Via, Via);
+ if (!ctx->chgtherm.style) /* remove the thermals */
+ PCB_FLAG_THERM_CLEAR(INDEXOFCURRENT, Via);
+ else
+ PCB_FLAG_THERM_ASSIGN(INDEXOFCURRENT, ctx->chgtherm.style, Via);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_VIA, Via, Via, Via, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, CURRENT, Via);
+ DrawVia(Via);
+ return Via;
+}
+
+/* changes the thermal on a pin */
+void *ChangePinThermal(pcb_opctx_t *ctx, pcb_element_t *element, pcb_pin_t *Pin)
+{
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PIN, element, Pin, Pin, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, Pin, Pin);
+ if (!ctx->chgtherm.style) /* remove the thermals */
+ PCB_FLAG_THERM_CLEAR(INDEXOFCURRENT, Pin);
+ else
+ PCB_FLAG_THERM_ASSIGN(INDEXOFCURRENT, ctx->chgtherm.style, Pin);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PIN, element, Pin, Pin, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin);
+ DrawPin(Pin);
+ return Pin;
+}
+
+/* changes the size of a via */
+void *ChangeViaSize(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_coord_t value = ctx->chgsize.absolute ? ctx->chgsize.absolute : Via->Thickness + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via))
+ return (NULL);
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, Via) && value <= PCB_MAX_PINORVIASIZE &&
+ value >= PCB_MIN_PINORVIASIZE && value >= Via->DrillingHole + PCB_MIN_PINORVIACOPPER && value != Via->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_VIA, Via, Via, Via);
+ EraseVia(Via);
+ pcb_r_delete_entry(PCB->Data->via_tree, (pcb_box_t *) Via);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Via, Via);
+ if (Via->Mask) {
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_VIA, Via, Via, Via);
+ Via->Mask += value - Via->Thickness;
+ }
+ Via->Thickness = value;
+ pcb_pin_bbox(Via);
+ pcb_r_insert_entry(PCB->Data->via_tree, (pcb_box_t *) Via, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ DrawVia(Via);
+ return (Via);
+ }
+ return (NULL);
+}
+
+/* changes the drilling hole of a via */
+void *ChangeVia2ndSize(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->DrillingHole + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via))
+ return (NULL);
+ if (value <= PCB_MAX_PINORVIASIZE &&
+ value >= PCB_MIN_PINORVIAHOLE && (PCB_FLAG_TEST(PCB_FLAG_HOLE, Via) || value <= Via->Thickness - PCB_MIN_PINORVIACOPPER)
+ && value != Via->DrillingHole) {
+ pcb_undo_add_obj_to_2nd_size(PCB_TYPE_VIA, Via, Via, Via);
+ EraseVia(Via);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ Via->DrillingHole = value;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, Via)) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_VIA, Via, Via, Via);
+ Via->Thickness = value;
+ }
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ DrawVia(Via);
+ return (Via);
+ }
+ return (NULL);
+}
+
+/* changes the drilling hole of a pin */
+void *ChangePin2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->DrillingHole + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin))
+ return (NULL);
+ if (value <= PCB_MAX_PINORVIASIZE &&
+ value >= PCB_MIN_PINORVIAHOLE && (PCB_FLAG_TEST(PCB_FLAG_HOLE, Pin) || value <= Pin->Thickness - PCB_MIN_PINORVIACOPPER)
+ && value != Pin->DrillingHole) {
+ pcb_undo_add_obj_to_2nd_size(PCB_TYPE_PIN, Element, Pin, Pin);
+ ErasePin(Pin);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ Pin->DrillingHole = value;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, Pin)) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PIN, Element, Pin, Pin);
+ Pin->Thickness = value;
+ }
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ DrawPin(Pin);
+ return (Pin);
+ }
+ return (NULL);
+}
+
+
+/* changes the clearance size of a via */
+void *ChangeViaClearSize(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->Clearance + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via))
+ return (NULL);
+ value = MIN(PCB_MAX_LINESIZE, value);
+ if (value < 0)
+ value = 0;
+ if (ctx->chgsize.delta < 0 && value < PCB->Bloat * 2)
+ value = 0;
+ if ((ctx->chgsize.delta > 0 || ctx->chgsize.absolute) && value < PCB->Bloat * 2)
+ value = PCB->Bloat * 2 + 2;
+ if (Via->Clearance == value)
+ return NULL;
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_VIA, Via, Via, Via);
+ EraseVia(Via);
+ pcb_r_delete_entry(PCB->Data->via_tree, (pcb_box_t *) Via);
+ Via->Clearance = value;
+ pcb_pin_bbox(Via);
+ pcb_r_insert_entry(PCB->Data->via_tree, (pcb_box_t *) Via, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ DrawVia(Via);
+ Via->Element = NULL;
+ return (Via);
+}
+
+
+/* changes the size of a pin */
+void *ChangePinSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Thickness + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin))
+ return (NULL);
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, Pin) && value <= PCB_MAX_PINORVIASIZE &&
+ value >= PCB_MIN_PINORVIASIZE && value >= Pin->DrillingHole + PCB_MIN_PINORVIACOPPER && value != Pin->Thickness) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_PIN, Element, Pin, Pin);
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_PIN, Element, Pin, Pin);
+ ErasePin(Pin);
+ pcb_r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ Pin->Mask += value - Pin->Thickness;
+ Pin->Thickness = value;
+ /* SetElementBB updates all associated rtrees */
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ DrawPin(Pin);
+ return (Pin);
+ }
+ return (NULL);
+}
+
+/* changes the clearance size of a pin */
+void *ChangePinClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Clearance + ctx->chgsize.delta;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin))
+ return (NULL);
+ value = MIN(PCB_MAX_LINESIZE, value);
+ if (value < 0)
+ value = 0;
+ if (ctx->chgsize.delta < 0 && value < PCB->Bloat * 2)
+ value = 0;
+ if ((ctx->chgsize.delta > 0 || ctx->chgsize.absolute) && value < PCB->Bloat * 2)
+ value = PCB->Bloat * 2 + 2;
+ if (Pin->Clearance == value)
+ return NULL;
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ pcb_undo_add_obj_to_clear_size(PCB_TYPE_PIN, Element, Pin, Pin);
+ ErasePin(Pin);
+ pcb_r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox);
+ Pin->Clearance = value;
+ /* SetElementBB updates all associated rtrees */
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ DrawPin(Pin);
+ return (Pin);
+}
+
+/* changes the name of a via */
+void *ChangeViaName(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ char *old = Via->Name;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Via)) {
+ ErasePinName(Via);
+ Via->Name = ctx->chgname.new_name;
+ DrawPinName(Via);
+ }
+ else
+ Via->Name = ctx->chgname.new_name;
+ return (old);
+}
+
+/* changes the name of a pin */
+void *ChangePinName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ char *old = Pin->Name;
+
+ Element = Element; /* get rid of 'unused...' warnings */
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pin)) {
+ ErasePinName(Pin);
+ Pin->Name = ctx->chgname.new_name;
+ DrawPinName(Pin);
+ }
+ else
+ Pin->Name = ctx->chgname.new_name;
+ return (old);
+}
+
+/* changes the number of a pin */
+void *ChangePinNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ char *old = Pin->Number;
+
+ Element = Element; /* get rid of 'unused...' warnings */
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pin)) {
+ ErasePinName(Pin);
+ Pin->Number = ctx->chgname.new_name;
+ DrawPinName(Pin);
+ }
+ else
+ Pin->Number = ctx->chgname.new_name;
+ return (old);
+}
+
+
+/* changes the square flag of a via */
+void *ChangeViaSquare(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via))
+ return (NULL);
+ EraseVia(Via);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_VIA, NULL, Via, Via, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, NULL, Via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, NULL, Via, Via);
+ PCB_FLAG_SQUARE_ASSIGN(ctx->chgsize.absolute, Via);
+ if (ctx->chgsize.absolute == 0)
+ PCB_FLAG_CLEAR(PCB_FLAG_SQUARE, Via);
+ else
+ PCB_FLAG_SET(PCB_FLAG_SQUARE, Via);
+ pcb_pin_bbox(Via);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_VIA, NULL, Via, Via, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, NULL, Via);
+ DrawVia(Via);
+ return (Via);
+}
+
+/* changes the square flag of a pin */
+void *ChangePinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin))
+ return (NULL);
+ ErasePin(Pin);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PIN, Element, Pin, Pin, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, Element, Pin, Pin);
+ PCB_FLAG_SQUARE_ASSIGN(ctx->chgsize.absolute, Pin);
+ if (ctx->chgsize.absolute == 0)
+ PCB_FLAG_CLEAR(PCB_FLAG_SQUARE, Pin);
+ else
+ PCB_FLAG_SET(PCB_FLAG_SQUARE, Pin);
+ pcb_pin_bbox(Pin);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PIN, Element, Pin, Pin, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ DrawPin(Pin);
+ return (Pin);
+}
+
+/* sets the square flag of a pin */
+void *SetPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) || PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pin))
+ return (NULL);
+
+ return (ChangePinSquare(ctx, Element, Pin));
+}
+
+/* clears the square flag of a pin */
+void *ClrPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) || !PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pin))
+ return (NULL);
+
+ return (ChangePinSquare(ctx, Element, Pin));
+}
+
+/* changes the octagon flag of a via */
+void *ChangeViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via))
+ return (NULL);
+ EraseVia(Via);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_VIA, Via, Via, Via, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, Via, Via, Via);
+ PCB_FLAG_TOGGLE(PCB_FLAG_OCTAGON, Via);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_VIA, Via, Via, Via, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ DrawVia(Via);
+ return (Via);
+}
+
+/* sets the octagon flag of a via */
+void *SetViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via) || PCB_FLAG_TEST(PCB_FLAG_OCTAGON, Via))
+ return (NULL);
+
+ return (ChangeViaOctagon(ctx, Via));
+}
+
+/* clears the octagon flag of a via */
+void *ClrViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via) || !PCB_FLAG_TEST(PCB_FLAG_OCTAGON, Via))
+ return (NULL);
+
+ return (ChangeViaOctagon(ctx, Via));
+}
+
+/* changes the octagon flag of a pin */
+void *ChangePinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin))
+ return (NULL);
+ ErasePin(Pin);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PIN, Element, Pin, Pin, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, Element, Pin, Pin);
+ PCB_FLAG_TOGGLE(PCB_FLAG_OCTAGON, Pin);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_PIN, Element, Pin, Pin, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin);
+ DrawPin(Pin);
+ return (Pin);
+}
+
+/* sets the octagon flag of a pin */
+void *SetPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) || PCB_FLAG_TEST(PCB_FLAG_OCTAGON, Pin))
+ return (NULL);
+
+ return (ChangePinOctagon(ctx, Element, Pin));
+}
+
+/* clears the octagon flag of a pin */
+void *ClrPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) || !PCB_FLAG_TEST(PCB_FLAG_OCTAGON, Pin))
+ return (NULL);
+
+ return (ChangePinOctagon(ctx, Element, Pin));
+}
+
+/* changes the hole flag of a via */
+pcb_bool pcb_pin_change_hole(pcb_pin_t *Via)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Via))
+ return (pcb_false);
+ EraseVia(Via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, Via, Via, Via);
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_VIA, Via, Via, Via);
+ pcb_r_delete_entry(PCB->Data->via_tree, (pcb_box_t *) Via);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ PCB_FLAG_TOGGLE(PCB_FLAG_HOLE, Via);
+
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, Via)) {
+ /* A tented via becomes an minimally untented hole. An untented
+ via retains its mask clearance. */
+ if (Via->Mask > Via->Thickness) {
+ Via->Mask = (Via->DrillingHole + (Via->Mask - Via->Thickness));
+ }
+ else if (Via->Mask < Via->DrillingHole) {
+ Via->Mask = Via->DrillingHole + 2 * PCB_MASKFRAME;
+ }
+ }
+ else {
+ Via->Mask = (Via->Thickness + (Via->Mask - Via->DrillingHole));
+ }
+
+ pcb_pin_bbox(Via);
+ pcb_r_insert_entry(PCB->Data->via_tree, (pcb_box_t *) Via, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ DrawVia(Via);
+ pcb_draw();
+ return (pcb_true);
+}
+
+/* changes the mask size of a pin */
+void *ChangePinMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Mask + ctx->chgsize.delta;
+
+ value = MAX(value, 0);
+ if (value == Pin->Mask && ctx->chgsize.absolute == 0)
+ value = Pin->Thickness;
+ if (value != Pin->Mask) {
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_PIN, Element, Pin, Pin);
+ ErasePin(Pin);
+ pcb_r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox);
+ Pin->Mask = value;
+ pcb_element_bbox(PCB->Data, Element, &PCB->Font);
+ DrawPin(Pin);
+ return (Pin);
+ }
+ return (NULL);
+}
+
+/* changes the mask size of a via */
+void *ChangeViaMaskSize(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_coord_t value;
+
+ value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->Mask + ctx->chgsize.delta;
+ value = MAX(value, 0);
+ if (value != Via->Mask) {
+ pcb_undo_add_obj_to_mask_size(PCB_TYPE_VIA, Via, Via, Via);
+ EraseVia(Via);
+ pcb_r_delete_entry(PCB->Data->via_tree, &Via->BoundingBox);
+ Via->Mask = value;
+ pcb_pin_bbox(Via);
+ pcb_r_insert_entry(PCB->Data->via_tree, &Via->BoundingBox, 0);
+ DrawVia(Via);
+ return (Via);
+ }
+ return (NULL);
+}
+
+/* copies a via */
+void *CopyVia(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_pin_t *via;
+
+ via = pcb_via_new(PCB->Data, Via->X + ctx->copy.DeltaX, Via->Y + ctx->copy.DeltaY,
+ Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, pcb_flag_mask(Via->Flags, PCB_FLAG_FOUND));
+ if (!via)
+ return (via);
+ DrawVia(via);
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, via, via, via);
+ return (via);
+}
+
+/* moves a via */
+void *MoveVia(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_r_delete_entry(PCB->Data->via_tree, (pcb_box_t *) Via);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ pcb_via_move(Via, ctx->move.dx, ctx->move.dy);
+ if (PCB->ViaOn)
+ EraseVia(Via);
+ pcb_r_insert_entry(PCB->Data->via_tree, (pcb_box_t *) Via, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, Via, Via);
+ if (PCB->ViaOn) {
+ DrawVia(Via);
+ pcb_draw();
+ }
+ return (Via);
+}
+
+/* destroys a via */
+void *DestroyVia(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ pcb_r_delete_entry(ctx->remove.destroy_target->via_tree, (pcb_box_t *) Via);
+ free(Via->Name);
+
+ pcb_via_free(Via);
+ return NULL;
+}
+
+/* removes a via */
+void *RemoveVia(pcb_opctx_t *ctx, pcb_pin_t *Via)
+{
+ /* erase from screen and memory */
+ if (PCB->ViaOn) {
+ EraseVia(Via);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_VIA, Via, Via, Via);
+ return NULL;
+}
+
+/*** draw ***/
+
+/* setup color for pin or via */
+static void SetPVColor(pcb_pin_t *Pin, int Type)
+{
+ char *color;
+ char buf[sizeof("#XXXXXX")];
+
+ if (Type == PCB_TYPE_VIA) {
+ if (!pcb_draw_doing_pinout && PCB_FLAG_TEST(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, Pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, Pin))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, Pin))
+ color = PCB->ViaSelectedColor;
+ else
+ color = PCB->ConnectedColor;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, Pin)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+ }
+ else
+ color = PCB->ViaColor;
+ }
+ else {
+ if (!pcb_draw_doing_pinout && PCB_FLAG_TEST(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, Pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, Pin))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, Pin))
+ color = PCB->PinSelectedColor;
+ else
+ color = PCB->ConnectedColor;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, Pin)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+ }
+ else
+ color = PCB->PinColor;
+ }
+
+ pcb_gui->set_color(Output.fgGC, color);
+}
+
+static void _draw_pv_name(pcb_pin_t * pv)
+{
+ pcb_box_t box;
+ pcb_bool vert;
+ pcb_text_t text;
+ char buff[128];
+ const char *pn;
+
+ if (!pv->Name || !pv->Name[0]) {
+ pn = PCB_EMPTY(pv->Number);
+ }
+ else {
+ pn = PCB_EMPTY(conf_core.editor.show_number ? pv->Number : pv->Name);
+ if (pn == NULL)
+ pn = "n/a";
+ }
+
+ if (PCB_FLAG_INTCONN_GET(pv) > 0)
+ pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, PCB_FLAG_INTCONN_GET(pv));
+ else
+ strcpy(buff, pn);
+ text.TextString = buff;
+
+ vert = PCB_FLAG_TEST(PCB_FLAG_EDGE2, pv);
+
+ if (vert) {
+ box.X1 = pv->X - pv->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
+ box.Y1 = pv->Y - pv->DrillingHole / 2 - conf_core.appearance.pinout.text_offset_x;
+ }
+ else {
+ box.X1 = pv->X + pv->DrillingHole / 2 + conf_core.appearance.pinout.text_offset_x;
+ box.Y1 = pv->Y - pv->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
+ }
+
+ pcb_gui->set_color(Output.fgGC, PCB->PinNameColor);
+
+ text.Flags = pcb_no_flags();
+ /* Set font height to approx 56% of pin thickness */
+ text.Scale = 56 * pv->Thickness / PCB_FONT_CAPHEIGHT;
+ text.X = box.X1;
+ text.Y = box.Y1;
+ text.Direction = vert ? 1 : 0;
+
+ if (pcb_gui->gui)
+ pcb_draw_doing_pinout++;
+ DrawTextLowLevel(&text, 0);
+ if (pcb_gui->gui)
+ pcb_draw_doing_pinout--;
+}
+
+static void _draw_pv(pcb_pin_t *pv, pcb_bool draw_hole)
+{
+ if (conf_core.editor.thin_draw)
+ pcb_gui->thindraw_pcb_pv(Output.fgGC, Output.fgGC, pv, draw_hole, pcb_false);
+ else
+ pcb_gui->fill_pcb_pv(Output.fgGC, Output.bgGC, pv, draw_hole, pcb_false);
+
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pv) && PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, pv))
+ _draw_pv_name(pv);
+}
+
+void draw_pin(pcb_pin_t *pin, pcb_bool draw_hole)
+{
+ SetPVColor(pin, PCB_TYPE_PIN);
+ _draw_pv(pin, draw_hole);
+}
+
+pcb_r_dir_t draw_pin_callback(const pcb_box_t * b, void *cl)
+{
+ draw_pin((pcb_pin_t *) b, pcb_false);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+pcb_r_dir_t clear_pin_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pin_t *pin = (pcb_pin_t *) b;
+ if (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly)
+ pcb_gui->thindraw_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true);
+ else
+ pcb_gui->fill_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+
+static void draw_via(pcb_pin_t *via, pcb_bool draw_hole)
+{
+ SetPVColor(via, PCB_TYPE_VIA);
+ _draw_pv(via, draw_hole);
+}
+
+pcb_r_dir_t draw_via_callback(const pcb_box_t * b, void *cl)
+{
+ draw_via((pcb_pin_t *) b, pcb_false);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+pcb_r_dir_t draw_hole_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_pin_t *pv = (pcb_pin_t *) b;
+ int plated = cl ? *(int *) cl : -1;
+ const char *color;
+ char buf[sizeof("#XXXXXX")];
+
+ if ((plated == 0 && !PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) || (plated == 1 && PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)))
+ return PCB_R_DIR_FOUND_CONTINUE;
+
+ if (conf_core.editor.thin_draw) {
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
+ pcb_gui->set_line_cap(Output.fgGC, Round_Cap);
+ pcb_gui->set_line_width(Output.fgGC, 0);
+ pcb_gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360);
+ }
+ }
+ else
+ pcb_gui->fill_circle(Output.bgGC, pv->X, pv->Y, pv->DrillingHole / 2);
+
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, pv))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pv))
+ color = PCB->ViaSelectedColor;
+ else
+ color = conf_core.appearance.color.black;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, pv)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+ pcb_gui->set_color(Output.fgGC, color);
+
+ pcb_gui->set_line_cap(Output.fgGC, Round_Cap);
+ pcb_gui->set_line_width(Output.fgGC, 0);
+ pcb_gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360);
+ }
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+static void GatherPVName(pcb_pin_t *Ptr)
+{
+ pcb_box_t box;
+ pcb_bool vert = PCB_FLAG_TEST(PCB_FLAG_EDGE2, Ptr);
+
+ if (vert) {
+ box.X1 = Ptr->X - Ptr->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
+ box.Y1 = Ptr->Y - Ptr->DrillingHole / 2 - conf_core.appearance.pinout.text_offset_x;
+ }
+ else {
+ box.X1 = Ptr->X + Ptr->DrillingHole / 2 + conf_core.appearance.pinout.text_offset_x;
+ box.Y1 = Ptr->Y - Ptr->Thickness / 2 + conf_core.appearance.pinout.text_offset_y;
+ }
+
+ if (vert) {
+ box.X2 = box.X1;
+ box.Y2 = box.Y1;
+ }
+ else {
+ box.X2 = box.X1;
+ box.Y2 = box.Y1;
+ }
+ pcb_draw_invalidate(&box);
+}
+
+void EraseVia(pcb_pin_t *Via)
+{
+ pcb_draw_invalidate(Via);
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Via))
+ EraseViaName(Via);
+ pcb_flag_erase(&Via->Flags);
+}
+
+void EraseViaName(pcb_pin_t *Via)
+{
+ GatherPVName(Via);
+}
+
+void ErasePin(pcb_pin_t *Pin)
+{
+ pcb_draw_invalidate(Pin);
+ if (PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pin))
+ ErasePinName(Pin);
+ pcb_flag_erase(&Pin->Flags);
+}
+
+void ErasePinName(pcb_pin_t *Pin)
+{
+ GatherPVName(Pin);
+}
+
+void DrawVia(pcb_pin_t *Via)
+{
+ pcb_draw_invalidate(Via);
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, Via) && PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Via))
+ DrawViaName(Via);
+}
+
+void DrawViaName(pcb_pin_t *Via)
+{
+ GatherPVName(Via);
+}
+
+void DrawPin(pcb_pin_t *Pin)
+{
+ pcb_draw_invalidate(Pin);
+ if ((!PCB_FLAG_TEST(PCB_FLAG_HOLE, Pin) && PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, Pin))
+ || pcb_draw_doing_pinout)
+ DrawPinName(Pin);
+}
+
+void DrawPinName(pcb_pin_t *Pin)
+{
+ GatherPVName(Pin);
+}
diff --git a/src/obj_pinvia.h b/src/obj_pinvia.h
new file mode 100644
index 0000000..9a80a67
--- /dev/null
+++ b/src/obj_pinvia.h
@@ -0,0 +1,133 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: pins and vias */
+
+#ifndef PCB_OBJ_PINVIA_H
+#define PCB_OBJ_PINVIA_H
+
+#include "obj_common.h"
+
+struct pcb_pin_s {
+ PCB_ANYOBJECTFIELDS;
+ pcb_coord_t Thickness, Clearance, Mask, DrillingHole;
+ pcb_coord_t X, Y; /* center and diameter */
+ char *Name, *Number;
+ void *Element;
+ void *Spare;
+ gdl_elem_t link; /* a pin is in a list (element) */
+};
+
+
+pcb_pin_t *pcb_via_alloc(pcb_data_t * data);
+void pcb_via_free(pcb_pin_t * data);
+pcb_pin_t *pcb_pin_alloc(pcb_element_t * element);
+void pcb_pin_free(pcb_pin_t * data);
+
+pcb_pin_t *pcb_via_new(pcb_data_t *Data, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, const char *Name, pcb_flag_t Flags);
+pcb_pin_t *pcb_element_pin_new(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, char *Name, char *Number, pcb_flag_t Flags);
+void pcb_add_via(pcb_data_t *Data, pcb_pin_t *Via);
+void pcb_pin_bbox(pcb_pin_t *Pin);
+
+void pcb_via_rotate(pcb_data_t *Data, pcb_pin_t *Via, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina);
+void pcb_via_mirror(pcb_data_t *Data, pcb_pin_t *Via);
+void pcb_via_flip_side(pcb_data_t *Data, pcb_pin_t *via);
+
+/* hash */
+int pcb_pin_eq(const pcb_element_t *e1, const pcb_pin_t *p1, const pcb_element_t *e2, const pcb_pin_t *p2);
+unsigned int pcb_pin_hash(const pcb_element_t *e, const pcb_pin_t *p);
+
+
+pcb_bool pcb_pin_change_hole(pcb_pin_t *Via);
+
+/* This is the extents of a Pin or Via, depending on whether it's a
+ hole or not. */
+#define PIN_SIZE(pinptr) \
+ (PCB_FLAG_TEST(PCB_FLAG_HOLE, (pinptr)) \
+ ? (pinptr)->DrillingHole \
+ : (pinptr)->Thickness)
+
+
+#define pcb_via_move(v,dx,dy) \
+ do { \
+ pcb_coord_t __dx__ = (dx), __dy__ = (dy); \
+ pcb_pin_t *__v__ = (v); \
+ PCB_MOVE((__v__)->X,(__v__)->Y,(__dx__),(__dy__)) \
+ PCB_BOX_MOVE_LOWLEVEL(&((__v__)->BoundingBox),(__dx__),(__dy__)); \
+ } while(0)
+
+#define pcb_pin_move(p,dx,dy) pcb_via_move(p, dx, dy)
+
+/* Rotate pin shape style by n_in * 90 degrees */
+#define PCB_PIN_ROTATE_SHAPE(p,n_in) \
+do { \
+ int _n_; \
+ for(_n_ = n_in;_n_>0;_n_--) { \
+ int _old_, _nw_ = 0; \
+ _old_ = PCB_FLAG_SQUARE_GET(p); \
+ if ((_old_ > 1) && (_old_ < 17)) { \
+ _old_--; \
+ if (_old_ & 1) \
+ _nw_ |= 8; \
+ if (_old_ & 8) \
+ _nw_ |= 2; \
+ if (_old_ & 2) \
+ _nw_ |= 4; \
+ if (_old_ & 4) \
+ _nw_ |= 1; \
+ PCB_FLAG_SQUARE_GET(p) = _nw_+1; \
+ } \
+ } \
+} while(0)
+
+#define PCB_VIA_ROTATE90(v,x0,y0,n) \
+do { \
+ PCB_COORD_ROTATE90((v)->X,(v)->Y,(x0),(y0),(n)); \
+ PCB_PIN_ROTATE_SHAPE(v, (n)); \
+} while(0)
+
+#define PCB_PIN_ROTATE90(p,x0,y0,n) \
+do { \
+ PCB_COORD_ROTATE90((p)->X,(p)->Y,(x0),(y0),(n)); \
+ PCB_PIN_ROTATE_SHAPE((p), (n)); \
+} while(0)
+
+
+#define PCB_VIA_LOOP(top) do { \
+ pcb_pin_t *via; \
+ gdl_iterator_t __it__; \
+ pinlist_foreach(&(top)->Via, &__it__, via) {
+
+#define PCB_PIN_LOOP(element) do { \
+ pcb_pin_t *pin; \
+ gdl_iterator_t __it__; \
+ pinlist_foreach(&(element)->Pin, &__it__, pin) {
+
+#define PCB_PIN_ALL_LOOP(top) \
+ PCB_ELEMENT_LOOP(top); \
+ PCB_PIN_LOOP(element) \
+
+#endif
diff --git a/src/obj_pinvia_draw.h b/src/obj_pinvia_draw.h
new file mode 100644
index 0000000..4eadb88
--- /dev/null
+++ b/src/obj_pinvia_draw.h
@@ -0,0 +1,46 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw on pins and vias ***/
+
+/* Include rtree.h for these */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_pin_callback(const pcb_box_t * b, void *cl);
+pcb_r_dir_t clear_pin_callback(const pcb_box_t * b, void *cl);
+pcb_r_dir_t draw_via_callback(const pcb_box_t * b, void *cl);
+pcb_r_dir_t draw_hole_callback(const pcb_box_t * b, void *cl);
+#endif
+
+
+void draw_pin(pcb_pin_t *pin, pcb_bool draw_hole);
+void EraseVia(pcb_pin_t *Via);
+void EraseViaName(pcb_pin_t *Via);
+void ErasePin(pcb_pin_t *Pin);
+void ErasePinName(pcb_pin_t *Pin);
+void DrawVia(pcb_pin_t *Via);
+void DrawViaName(pcb_pin_t *Via);
+void DrawPin(pcb_pin_t *Pin);
+void DrawPinName(pcb_pin_t *Pin);
diff --git a/src/obj_pinvia_list.c b/src/obj_pinvia_list.c
new file mode 100644
index 0000000..e097010
--- /dev/null
+++ b/src/obj_pinvia_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_pinvia_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_pinvia_list.h b/src/obj_pinvia_list.h
new file mode 100644
index 0000000..c4d002a
--- /dev/null
+++ b/src/obj_pinvia_list.h
@@ -0,0 +1,42 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_PINVIA_LIST_H
+#define PCB_OBJ_PINVIA_LIST_H
+
+#include "obj_pinvia.h"
+
+/* List of Pins */
+#define TDL(x) pinlist_ ## x
+#define TDL_LIST_T pinlist_t
+#define TDL_ITEM_T pcb_pin_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define pinlist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_pinvia_op.h b/src/obj_pinvia_op.h
new file mode 100644
index 0000000..8bb5f66
--- /dev/null
+++ b/src/obj_pinvia_op.h
@@ -0,0 +1,60 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on pins and vias ***/
+
+#include "operation.h"
+
+void *AddViaToBuffer(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *MoveViaToBuffer(pcb_opctx_t *ctx, pcb_pin_t * via);
+void *ChangeViaThermal(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangePinThermal(pcb_opctx_t *ctx, pcb_element_t *element, pcb_pin_t *Pin);
+void *ChangeViaSize(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangeVia2ndSize(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangePin2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangeViaClearSize(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangePinSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangePinClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangeViaName(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangePinName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangePinNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangeViaSquare(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangePinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *SetPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ClrPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangeViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *SetViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ClrViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *ChangePinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *SetPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ClrPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+pcb_bool pcb_pin_change_hole(pcb_pin_t *Via);
+void *ChangePinMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin);
+void *ChangeViaMaskSize(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *CopyVia(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *MoveVia(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *DestroyVia(pcb_opctx_t *ctx, pcb_pin_t *Via);
+void *RemoveVia(pcb_opctx_t *ctx, pcb_pin_t *Via);
diff --git a/src/obj_pinvia_therm.c b/src/obj_pinvia_therm.c
new file mode 100644
index 0000000..da99fcc
--- /dev/null
+++ b/src/obj_pinvia_therm.c
@@ -0,0 +1,438 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau
+ *
+ * this file, thermal.c was written by and is
+ * (C) Copyright 2006, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Contact addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+/* negative thermal finger polygons */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <math.h>
+
+#include "board.h"
+#include "polygon.h"
+#include "obj_pinvia_therm.h"
+
+static pcb_board_t *pcb;
+
+struct cent {
+ pcb_coord_t x, y;
+ pcb_coord_t s, c;
+ char style;
+ pcb_polyarea_t *p;
+};
+
+static pcb_polyarea_t *diag_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t l, pcb_coord_t w, pcb_bool rt)
+{
+ pcb_pline_t *c;
+ pcb_vector_t v;
+ pcb_coord_t x1, x2, y1, y2;
+
+ if (rt) {
+ x1 = (l - w) * M_SQRT1_2;
+ x2 = (l + w) * M_SQRT1_2;
+ y1 = x1;
+ y2 = x2;
+ }
+ else {
+ x2 = -(l - w) * M_SQRT1_2;
+ x1 = -(l + w) * M_SQRT1_2;
+ y1 = -x1;
+ y2 = -x2;
+ }
+
+ v[0] = X + x1;
+ v[1] = Y + y2;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[0] = X - x2;
+ v[1] = Y - y1;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = X - x1;
+ v[1] = Y - y2;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = X + x2;
+ v[1] = Y + y1;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ return pcb_poly_from_contour(c);
+}
+
+static pcb_polyarea_t *square_therm(pcb_pin_t *pin, pcb_cardinal_t style)
+{
+ pcb_polyarea_t *p, *p2;
+ pcb_pline_t *c;
+ pcb_vector_t v;
+ pcb_coord_t d, in, out;
+
+ switch (style) {
+ case 1:
+ d = pcb->ThermScale * pin->Clearance * M_SQRT1_2;
+ out = (pin->Thickness + pin->Clearance) / 2;
+ in = pin->Thickness / 2;
+ /* top (actually bottom since +y is down) */
+ v[0] = pin->X - in + d;
+ v[1] = pin->Y + in;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[0] = pin->X + in - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X + out - d;
+ v[1] = pin->Y + out;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X - out + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ p = pcb_poly_from_contour(c);
+ /* right */
+ v[0] = pin->X + in;
+ v[1] = pin->Y + in - d;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[1] = pin->Y - in + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X + out;
+ v[1] = pin->Y - out + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[1] = pin->Y + out - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ p2 = pcb_poly_from_contour(c);
+ p->f = p2;
+ p2->b = p;
+ /* left */
+ v[0] = pin->X - in;
+ v[1] = pin->Y - in + d;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[1] = pin->Y + in - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X - out;
+ v[1] = pin->Y + out - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[1] = pin->Y - out + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ p2 = pcb_poly_from_contour(c);
+ p->f->f = p2;
+ p2->b = p->f;
+ /* bottom (actually top since +y is down) */
+ v[0] = pin->X + in - d;
+ v[1] = pin->Y - in;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[0] = pin->X - in + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X - out + d;
+ v[1] = pin->Y - out;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X + out - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ p2 = pcb_poly_from_contour(c);
+ p->f->f->f = p2;
+ p2->f = p;
+ p2->b = p->f->f;
+ p->b = p2;
+ return p;
+ case 4:
+ {
+ pcb_line_t l;
+ l.Flags = pcb_no_flags();
+ d = pin->Thickness / 2 - pcb->ThermScale * pin->Clearance;
+ out = pin->Thickness / 2 + pin->Clearance / 4;
+ in = pin->Clearance / 2;
+ /* top */
+ l.Point1.X = pin->X - d;
+ l.Point2.Y = l.Point1.Y = pin->Y + out;
+ l.Point2.X = pin->X + d;
+ p = pcb_poly_from_line(&l, in);
+ /* right */
+ l.Point1.X = l.Point2.X = pin->X + out;
+ l.Point1.Y = pin->Y - d;
+ l.Point2.Y = pin->Y + d;
+ p2 = pcb_poly_from_line(&l, in);
+ p->f = p2;
+ p2->b = p;
+ /* bottom */
+ l.Point1.X = pin->X - d;
+ l.Point2.Y = l.Point1.Y = pin->Y - out;
+ l.Point2.X = pin->X + d;
+ p2 = pcb_poly_from_line(&l, in);
+ p->f->f = p2;
+ p2->b = p->f;
+ /* left */
+ l.Point1.X = l.Point2.X = pin->X - out;
+ l.Point1.Y = pin->Y - d;
+ l.Point2.Y = pin->Y + d;
+ p2 = pcb_poly_from_line(&l, in);
+ p->f->f->f = p2;
+ p2->b = p->f->f;
+ p->b = p2;
+ p2->f = p;
+ return p;
+ }
+ default: /* style 2 and 5 */
+ d = 0.5 * pcb->ThermScale * pin->Clearance;
+ if (style == 5)
+ d += d;
+ out = (pin->Thickness + pin->Clearance) / 2;
+ in = pin->Thickness / 2;
+ /* topright */
+ v[0] = pin->X + in;
+ v[1] = pin->Y + in;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[1] = pin->Y + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 2) {
+ v[0] = pin->X + out;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ }
+ else
+ pcb_poly_frac_cicle(c, v[0] + pin->Clearance / 4, v[1], v, 2);
+ v[1] = pin->Y + in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ /* pivot 1/4 circle to next point */
+ pcb_poly_frac_cicle(c, pin->X + in, pin->Y + in, v, 4);
+ v[0] = pin->X + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 2) {
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[1] = pin->Y + in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ }
+ else
+ pcb_poly_frac_cicle(c, v[0], v[1] - pin->Clearance / 4, v, 2);
+ p = pcb_poly_from_contour(c);
+ /* bottom right */
+ v[0] = pin->X + in;
+ v[1] = pin->Y - d;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[1] = pin->Y - in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 2) {
+ v[1] = pin->Y - out;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ }
+ else
+ pcb_poly_frac_cicle(c, v[0], v[1] - pin->Clearance / 4, v, 2);
+ v[0] = pin->X + in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ /* pivot 1/4 circle to next point */
+ pcb_poly_frac_cicle(c, pin->X + in, pin->Y - in, v, 4);
+ v[1] = pin->Y - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 5)
+ pcb_poly_frac_cicle(c, v[0] - pin->Clearance / 4, v[1], v, 2);
+ p2 = pcb_poly_from_contour(c);
+ p->f = p2;
+ p2->b = p;
+ /* bottom left */
+ v[0] = pin->X - d;
+ v[1] = pin->Y - in;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[0] = pin->X - in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[1] = pin->Y - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 2) {
+ v[0] = pin->X - out;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ }
+ else
+ pcb_poly_frac_cicle(c, v[0] - pin->Clearance / 4, v[1], v, 2);
+ v[1] = pin->Y - in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ /* pivot 1/4 circle to next point */
+ pcb_poly_frac_cicle(c, pin->X - in, pin->Y - in, v, 4);
+ v[0] = pin->X - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 5)
+ pcb_poly_frac_cicle(c, v[0], v[1] + pin->Clearance / 4, v, 2);
+ p2 = pcb_poly_from_contour(c);
+ p->f->f = p2;
+ p2->b = p->f;
+ /* top left */
+ v[0] = pin->X - d;
+ v[1] = pin->Y + out;
+ if ((c = pcb_poly_contour_new(v)) == NULL)
+ return NULL;
+ v[0] = pin->X - in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ /* pivot 1/4 circle to next point (x-out, y+in) */
+ pcb_poly_frac_cicle(c, pin->X - in, pin->Y + in, v, 4);
+ v[1] = pin->Y + d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 2) {
+ v[0] = pin->X - in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ }
+ else
+ pcb_poly_frac_cicle(c, v[0] + pin->Clearance / 4, v[1], v, 2);
+ v[1] = pin->Y + in;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ v[0] = pin->X - d;
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
+ if (style == 5)
+ pcb_poly_frac_cicle(c, v[0], v[1] + pin->Clearance / 4, v, 2);
+ p2 = pcb_poly_from_contour(c);
+ p->f->f->f = p2;
+ p2->f = p;
+ p2->b = p->f->f;
+ p->b = p2;
+ return p;
+ }
+}
+
+static pcb_polyarea_t *oct_therm(pcb_pin_t *pin, pcb_cardinal_t style)
+{
+ pcb_polyarea_t *p, *p2, *m;
+ pcb_coord_t t = 0.5 * pcb->ThermScale * pin->Clearance;
+ pcb_coord_t w = pin->Thickness + pin->Clearance;
+
+ p = pcb_poly_from_octagon(pin->X, pin->Y, w, PCB_FLAG_SQUARE_GET(pin));
+ p2 = pcb_poly_from_octagon(pin->X, pin->Y, pin->Thickness, PCB_FLAG_SQUARE_GET(pin));
+ /* make full clearance ring */
+ pcb_polyarea_boolean_free(p, p2, &m, PCB_PBO_SUB);
+ switch (style) {
+ default:
+ case 1:
+ p = diag_line(pin->X, pin->Y, w, t, pcb_true);
+ pcb_polyarea_boolean_free(m, p, &p2, PCB_PBO_SUB);
+ p = diag_line(pin->X, pin->Y, w, t, pcb_false);
+ pcb_polyarea_boolean_free(p2, p, &m, PCB_PBO_SUB);
+ return m;
+ case 2:
+ p = pcb_poly_from_rect(pin->X - t, pin->X + t, pin->Y - w, pin->Y + w);
+ pcb_polyarea_boolean_free(m, p, &p2, PCB_PBO_SUB);
+ p = pcb_poly_from_rect(pin->X - w, pin->X + w, pin->Y - t, pin->Y + t);
+ pcb_polyarea_boolean_free(p2, p, &m, PCB_PBO_SUB);
+ return m;
+ /* fix me add thermal style 4 */
+ case 5:
+ {
+ pcb_coord_t t = pin->Thickness / 2;
+ pcb_polyarea_t *q;
+ /* cheat by using the square therm's rounded parts */
+ p = square_therm(pin, style);
+ q = pcb_poly_from_rect(pin->X - t, pin->X + t, pin->Y - t, pin->Y + t);
+ pcb_polyarea_boolean_free(p, q, &p2, PCB_PBO_UNITE);
+ pcb_polyarea_boolean_free(m, p2, &p, PCB_PBO_ISECT);
+ return p;
+ }
+ }
+}
+
+/* ThermPoly returns a pcb_polyarea_t having all of the clearance that when
+ * subtracted from the plane create the desired thermal fingers.
+ * Usually this is 4 disjoint regions.
+ *
+ */
+pcb_polyarea_t *ThermPoly(pcb_board_t *p, pcb_pin_t *pin, pcb_cardinal_t laynum)
+{
+ pcb_arc_t a;
+ pcb_polyarea_t *pa, *arc;
+ pcb_cardinal_t style = PCB_FLAG_THERM_GET(laynum, pin);
+
+ if (style == 3)
+ return NULL; /* solid connection no clearance */
+ pcb = p;
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin))
+ return square_therm(pin, style);
+ if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pin))
+ return oct_therm(pin, style);
+ /* must be circular */
+ switch (style) {
+ case 1:
+ case 2:
+ {
+ pcb_polyarea_t *m;
+ pcb_coord_t t = (pin->Thickness + pin->Clearance) / 2;
+ pcb_coord_t w = 0.5 * pcb->ThermScale * pin->Clearance;
+ pa = pcb_poly_from_circle(pin->X, pin->Y, t);
+ arc = pcb_poly_from_circle(pin->X, pin->Y, pin->Thickness / 2);
+ /* create a thin ring */
+ pcb_polyarea_boolean_free(pa, arc, &m, PCB_PBO_SUB);
+ /* fix me needs error checking */
+ if (style == 2) {
+ /* t is the theoretically required length, but we use twice that
+ * to avoid discretisation errors in our circle approximation.
+ */
+ pa = pcb_poly_from_rect(pin->X - t * 2, pin->X + t * 2, pin->Y - w, pin->Y + w);
+ pcb_polyarea_boolean_free(m, pa, &arc, PCB_PBO_SUB);
+ pa = pcb_poly_from_rect(pin->X - w, pin->X + w, pin->Y - t * 2, pin->Y + t * 2);
+ }
+ else {
+ /* t is the theoretically required length, but we use twice that
+ * to avoid discretisation errors in our circle approximation.
+ */
+ pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_true);
+ pcb_polyarea_boolean_free(m, pa, &arc, PCB_PBO_SUB);
+ pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_false);
+ }
+ pcb_polyarea_boolean_free(arc, pa, &m, PCB_PBO_SUB);
+ return m;
+ }
+
+
+ default:
+ a.X = pin->X;
+ a.Y = pin->Y;
+ a.Height = a.Width = pin->Thickness / 2 + pin->Clearance / 4;
+ a.Thickness = 1;
+ a.Clearance = pin->Clearance / 2;
+ a.Flags = pcb_no_flags();
+ a.Delta = 90 - (a.Clearance * (1. + 2. * pcb->ThermScale) * 180) / (M_PI * a.Width);
+ a.StartAngle = 90 - a.Delta / 2 + (style == 4 ? 0 : 45);
+ pa = pcb_poly_from_arc(&a, a.Clearance);
+ if (!pa)
+ return NULL;
+ a.StartAngle += 90;
+ arc = pcb_poly_from_arc(&a, a.Clearance);
+ if (!arc)
+ return NULL;
+ pa->f = arc;
+ arc->b = pa;
+ a.StartAngle += 90;
+ arc = pcb_poly_from_arc(&a, a.Clearance);
+ if (!arc)
+ return NULL;
+ pa->f->f = arc;
+ arc->b = pa->f;
+ a.StartAngle += 90;
+ arc = pcb_poly_from_arc(&a, a.Clearance);
+ if (!arc)
+ return NULL;
+ pa->b = arc;
+ pa->f->f->f = arc;
+ arc->b = pa->f->f;
+ arc->f = pa;
+ pa->b = arc;
+ return pa;
+ }
+}
diff --git a/src/obj_pinvia_therm.h b/src/obj_pinvia_therm.h
new file mode 100644
index 0000000..bb4f68e
--- /dev/null
+++ b/src/obj_pinvia_therm.h
@@ -0,0 +1,44 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
+ *
+ */
+
+/* prototypes for thermal routines
+ *
+ * Thermals are normal lines on the layout. The only thing unique
+ * about them is that they have the PCB_FLAG_USETHERMAL set so that they
+ * can be identified as thermals. It is handy for pcb to automatically
+ * make adjustments to the thermals when the user performs certain
+ * operations, and the functions in thermal.h help implement that.
+ */
+
+#ifndef PCB_THERMAL_H
+#define PCB_THERMAL_H
+
+#include <stdlib.h>
+#include "config.h"
+
+pcb_polyarea_t *ThermPoly(pcb_board_t *, pcb_pin_t *, pcb_cardinal_t);
+
+#endif
diff --git a/src/obj_poly.c b/src/obj_poly.c
new file mode 100644
index 0000000..e8a2b7d
--- /dev/null
+++ b/src/obj_poly.c
@@ -0,0 +1,761 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: polygons */
+
+
+#include "config.h"
+
+#include "board.h"
+#include "data.h"
+#include "compat_nls.h"
+#include "undo.h"
+#include "polygon.h"
+#include "rotate.h"
+#include "search.h"
+
+#include "conf_core.h"
+
+#include "obj_poly.h"
+#include "obj_poly_op.h"
+#include "obj_poly_list.h"
+#include "obj_poly_draw.h"
+
+/* TODO: get rid of these: */
+#include "draw.h"
+
+#define STEP_POLYGONPOINT 10
+#define STEP_POLYGONHOLEINDEX 10
+
+/*** allocation ***/
+
+/* get next slot for a polygon object, allocates memory if necessary */
+pcb_polygon_t *pcb_poly_alloc(pcb_layer_t * layer)
+{
+ pcb_polygon_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_polygon_t), 1);
+ polylist_append(&layer->Polygon, new_obj);
+
+ return new_obj;
+}
+
+void pcb_poly_free(pcb_polygon_t * data)
+{
+ polylist_remove(data);
+ free(data);
+}
+
+/* gets the next slot for a point in a polygon struct, allocates memory if necessary */
+pcb_point_t *pcb_poly_point_alloc(pcb_polygon_t *Polygon)
+{
+ pcb_point_t *points = Polygon->Points;
+
+ /* realloc new memory if necessary and clear it */
+ if (Polygon->PointN >= Polygon->PointMax) {
+ Polygon->PointMax += STEP_POLYGONPOINT;
+ points = (pcb_point_t *) realloc(points, Polygon->PointMax * sizeof(pcb_point_t));
+ Polygon->Points = points;
+ memset(points + Polygon->PointN, 0, STEP_POLYGONPOINT * sizeof(pcb_point_t));
+ }
+ return (points + Polygon->PointN++);
+}
+
+/* gets the next slot for a point in a polygon struct, allocates memory if necessary */
+pcb_cardinal_t *pcb_poly_holeidx_new(pcb_polygon_t *Polygon)
+{
+ pcb_cardinal_t *holeindex = Polygon->HoleIndex;
+
+ /* realloc new memory if necessary and clear it */
+ if (Polygon->HoleIndexN >= Polygon->HoleIndexMax) {
+ Polygon->HoleIndexMax += STEP_POLYGONHOLEINDEX;
+ holeindex = (pcb_cardinal_t *) realloc(holeindex, Polygon->HoleIndexMax * sizeof(int));
+ Polygon->HoleIndex = holeindex;
+ memset(holeindex + Polygon->HoleIndexN, 0, STEP_POLYGONHOLEINDEX * sizeof(int));
+ }
+ return (holeindex + Polygon->HoleIndexN++);
+}
+
+/* frees memory used by a polygon */
+void pcb_poly_free_fields(pcb_polygon_t * polygon)
+{
+ if (polygon == NULL)
+ return;
+
+ free(polygon->Points);
+ free(polygon->HoleIndex);
+
+ if (polygon->Clipped)
+ pcb_polyarea_free(&polygon->Clipped);
+ pcb_poly_contours_free(&polygon->NoHoles);
+
+ reset_obj_mem(pcb_polygon_t, polygon);
+}
+
+/*** utility ***/
+
+/* rotates a polygon in 90 degree steps */
+void pcb_poly_rotate90(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
+{
+ PCB_POLY_POINT_LOOP(Polygon);
+ {
+ PCB_COORD_ROTATE90(point->X, point->Y, X, Y, Number);
+ }
+ PCB_END_LOOP;
+ pcb_box_rotate90(&Polygon->BoundingBox, X, Y, Number);
+}
+
+void pcb_poly_rotate(pcb_layer_t *layer, pcb_polygon_t *polygon, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina)
+{
+ pcb_r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon);
+ PCB_POLY_POINT_LOOP(polygon);
+ {
+ pcb_rotate(&point->X, &point->Y, X, Y, cosa, sina);
+ }
+ PCB_END_LOOP;
+ pcb_poly_bbox(polygon);
+ pcb_r_insert_entry(layer->polygon_tree, (pcb_box_t *) polygon, 0);
+}
+
+void pcb_poly_mirror(pcb_layer_t *layer, pcb_polygon_t *polygon)
+{
+ pcb_r_delete_entry(layer->polygon_tree, (pcb_box_t *)polygon);
+ PCB_POLY_POINT_LOOP(polygon);
+ {
+ point->X = PCB_SWAP_X(point->X);
+ point->Y = PCB_SWAP_Y(point->Y);
+ }
+ PCB_END_LOOP;
+ pcb_poly_bbox(polygon);
+ pcb_r_insert_entry(layer->polygon_tree, (pcb_box_t *)polygon, 0);
+}
+
+void pcb_poly_flip_side(pcb_layer_t *layer, pcb_polygon_t *polygon)
+{
+ pcb_r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon);
+ PCB_POLY_POINT_LOOP(polygon);
+ {
+ point->X = PCB_SWAP_X(point->X);
+ point->Y = PCB_SWAP_Y(point->Y);
+ }
+ PCB_END_LOOP;
+ pcb_poly_bbox(polygon);
+ pcb_r_insert_entry(layer->polygon_tree, (pcb_box_t *) polygon, 0);
+ /* hmmm, how to handle clip */
+}
+
+
+/* sets the bounding box of a polygons */
+void pcb_poly_bbox(pcb_polygon_t *Polygon)
+{
+ Polygon->BoundingBox.X1 = Polygon->BoundingBox.Y1 = PCB_MAX_COORD;
+ Polygon->BoundingBox.X2 = Polygon->BoundingBox.Y2 = 0;
+ PCB_POLY_POINT_LOOP(Polygon);
+ {
+ PCB_MAKE_MIN(Polygon->BoundingBox.X1, point->X);
+ PCB_MAKE_MIN(Polygon->BoundingBox.Y1, point->Y);
+ PCB_MAKE_MAX(Polygon->BoundingBox.X2, point->X);
+ PCB_MAKE_MAX(Polygon->BoundingBox.Y2, point->Y);
+ }
+ /* boxes don't include the lower right corner */
+ pcb_close_box(&Polygon->BoundingBox);
+ PCB_END_LOOP;
+}
+
+/* creates a new polygon from the old formats rectangle data */
+pcb_polygon_t *pcb_poly_new_from_rectangle(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_flag_t Flags)
+{
+ pcb_polygon_t *polygon = pcb_poly_new(Layer, Flags);
+ if (!polygon)
+ return (polygon);
+
+ pcb_poly_point_new(polygon, X1, Y1);
+ pcb_poly_point_new(polygon, X2, Y1);
+ pcb_poly_point_new(polygon, X2, Y2);
+ pcb_poly_point_new(polygon, X1, Y2);
+
+ pcb_add_polygon_on_layer(Layer, polygon);
+ return (polygon);
+}
+
+void pcb_add_polygon_on_layer(pcb_layer_t *Layer, pcb_polygon_t *polygon)
+{
+ pcb_poly_bbox(polygon);
+ if (!Layer->polygon_tree)
+ Layer->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) polygon, 0);
+}
+
+/* creates a new polygon on a layer */
+pcb_polygon_t *pcb_poly_new(pcb_layer_t *Layer, pcb_flag_t Flags)
+{
+ pcb_polygon_t *polygon = pcb_poly_alloc(Layer);
+
+ /* copy values */
+ polygon->Flags = Flags;
+ polygon->ID = pcb_create_ID_get();
+ polygon->Clipped = NULL;
+ polygon->NoHoles = NULL;
+ polygon->NoHolesValid = 0;
+ return (polygon);
+}
+
+/* creates a new point in a polygon */
+pcb_point_t *pcb_poly_point_new(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y)
+{
+ pcb_point_t *point = pcb_poly_point_alloc(Polygon);
+
+ /* copy values */
+ point->X = X;
+ point->Y = Y;
+ point->ID = pcb_create_ID_get();
+ return (point);
+}
+
+/* creates a new hole in a polygon */
+pcb_polygon_t *pcb_poly_hole_new(pcb_polygon_t * Polygon)
+{
+ pcb_cardinal_t *holeindex = pcb_poly_holeidx_new(Polygon);
+ *holeindex = Polygon->PointN;
+ return Polygon;
+}
+
+/* copies data from one polygon to another; 'Dest' has to exist */
+pcb_polygon_t *pcb_poly_copy(pcb_polygon_t *Dest, pcb_polygon_t *Src)
+{
+ pcb_cardinal_t hole = 0;
+ pcb_cardinal_t n;
+
+ for (n = 0; n < Src->PointN; n++) {
+ if (hole < Src->HoleIndexN && n == Src->HoleIndex[hole]) {
+ pcb_poly_hole_new(Dest);
+ hole++;
+ }
+ pcb_poly_point_new(Dest, Src->Points[n].X, Src->Points[n].Y);
+ }
+ pcb_poly_bbox(Dest);
+ Dest->Flags = Src->Flags;
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, Dest);
+ return (Dest);
+}
+
+static double poly_area(pcb_point_t *points, pcb_cardinal_t n_points)
+{
+ double area = 0;
+ int n;
+
+ for(n = 1; n < n_points; n++)
+ area += (double)(points[n-1].X - points[n].X) * (double)(points[n-1].Y + points[n].Y);
+ area +=(double)(points[n_points-1].X - points[0].X) * (double)(points[n_points-1].Y + points[0].Y);
+
+ if (area > 0)
+ area /= 2.0;
+ else
+ area /= -2.0;
+
+ return area;
+}
+
+double pcb_poly_area(const pcb_polygon_t *poly)
+{
+ double area;
+
+ if (poly->HoleIndexN > 0) {
+ int h;
+ area = poly_area(poly->Points, poly->HoleIndex[0]);
+ for(h = 0; h < poly->HoleIndexN - 1; h++)
+ area -= poly_area(poly->Points + poly->HoleIndex[h], poly->HoleIndex[h+1] - poly->HoleIndex[h]);
+ area -= poly_area(poly->Points + poly->HoleIndex[h], poly->PointN - poly->HoleIndex[h]);
+ }
+ else
+ area = poly_area(poly->Points, poly->PointN);
+
+ return area;
+}
+
+
+
+/*** ops ***/
+/* copies a polygon to buffer */
+void *AddPolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_layer_t *layer = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, Layer)];
+ pcb_polygon_t *polygon;
+
+ polygon = pcb_poly_new(layer, Polygon->Flags);
+ pcb_poly_copy(polygon, Polygon);
+
+ /* Update the polygon r-tree. Unlike similarly named functions for
+ * other objects, CreateNewPolygon does not do this as it creates a
+ * skeleton polygon object, which won't have correct bounds.
+ */
+ if (!layer->polygon_tree)
+ layer->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(layer->polygon_tree, (pcb_box_t *) polygon, 0);
+
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND | ctx->buffer.extraflg, polygon);
+ return (polygon);
+}
+
+
+/* moves a polygon to buffer. Doesn't allocate memory for the points */
+void *MovePolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_polygon_t * polygon)
+{
+ pcb_layer_t *lay = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, layer)];
+
+ pcb_r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon);
+
+ polylist_remove(polygon);
+ polylist_append(&lay->Polygon, polygon);
+
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, polygon);
+
+ if (!lay->polygon_tree)
+ lay->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(lay->polygon_tree, (pcb_box_t *) polygon, 0);
+ return (polygon);
+}
+
+/* Handle attempts to change the clearance of a polygon. */
+void *ChangePolygonClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *poly)
+{
+ static int shown_this_message = 0;
+ if (!shown_this_message) {
+ pcb_gui->confirm_dialog(_("To change the clearance of objects in a polygon, "
+ "change the objects, not the polygon.\n"
+ "Hint: To set a minimum clearance for a group of objects, "
+ "select them all then :MinClearGap(Selected,=10,mil)"), "Ok", NULL);
+ shown_this_message = 1;
+ }
+
+ return (NULL);
+}
+
+/* changes the CLEARPOLY flag of a polygon */
+void *ChangePolyClear(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Polygon))
+ return (NULL);
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_POLYGON, Layer, Polygon, Polygon, pcb_true);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
+ PCB_FLAG_TOGGLE(PCB_FLAG_CLEARPOLY, Polygon);
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+ DrawPolygon(Layer, Polygon);
+ return (Polygon);
+}
+
+/* inserts a point into a polygon */
+void *InsertPointIntoPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_point_t save;
+ pcb_cardinal_t n;
+ pcb_line_t line;
+
+ if (!ctx->insert.forcible) {
+ /*
+ * first make sure adding the point is sensible
+ */
+ line.Thickness = 0;
+ line.Point1 = Polygon->Points[pcb_poly_contour_prev_point(Polygon, ctx->insert.idx)];
+ line.Point2 = Polygon->Points[ctx->insert.idx];
+ if (pcb_is_point_on_line((float) ctx->insert.x, (float) ctx->insert.y, 0.0, &line))
+ return (NULL);
+ }
+ /*
+ * second, shift the points up to make room for the new point
+ */
+ ErasePolygon(Polygon);
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
+ save = *pcb_poly_point_new(Polygon, ctx->insert.x, ctx->insert.y);
+ for (n = Polygon->PointN - 1; n > ctx->insert.idx; n--)
+ Polygon->Points[n] = Polygon->Points[n - 1];
+
+ /* Shift up indices of any holes */
+ for (n = 0; n < Polygon->HoleIndexN; n++)
+ if (Polygon->HoleIndex[n] > ctx->insert.idx || (ctx->insert.last && Polygon->HoleIndex[n] == ctx->insert.idx))
+ Polygon->HoleIndex[n]++;
+
+ Polygon->Points[ctx->insert.idx] = save;
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_add_obj_to_insert_point(PCB_TYPE_POLYGON_POINT, Layer, Polygon, &Polygon->Points[ctx->insert.idx]);
+
+ pcb_poly_bbox(Polygon);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+ if (ctx->insert.forcible || !pcb_poly_remove_excess_points(Layer, Polygon)) {
+ DrawPolygon(Layer, Polygon);
+ pcb_draw();
+ }
+ return (&Polygon->Points[ctx->insert.idx]);
+}
+
+/* low level routine to move a polygon */
+void pcb_poly_move(pcb_polygon_t *Polygon, pcb_coord_t DX, pcb_coord_t DY)
+{
+ PCB_POLY_POINT_LOOP(Polygon);
+ {
+ PCB_MOVE(point->X, point->Y, DX, DY);
+ }
+ PCB_END_LOOP;
+ PCB_BOX_MOVE_LOWLEVEL(&Polygon->BoundingBox, DX, DY);
+}
+
+/* moves a polygon */
+void *MovePolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ if (Layer->On) {
+ ErasePolygon(Polygon);
+ }
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
+ pcb_poly_move(Polygon, ctx->move.dx, ctx->move.dy);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+ if (Layer->On) {
+ DrawPolygon(Layer, Polygon);
+ pcb_draw();
+ }
+ return (Polygon);
+}
+
+/* moves a polygon-point */
+void *MovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point)
+{
+ if (Layer->On) {
+ ErasePolygon(Polygon);
+ }
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
+ PCB_MOVE(Point->X, Point->Y, ctx->move.dx, ctx->move.dy);
+ pcb_poly_bbox(Polygon);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
+ pcb_poly_remove_excess_points(Layer, Polygon);
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+ if (Layer->On) {
+ DrawPolygon(Layer, Polygon);
+ pcb_draw();
+ }
+ return (Point);
+}
+
+/* moves a polygon between layers; lowlevel routines */
+void *MovePolygonToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_polygon_t * polygon, pcb_layer_t * Destination)
+{
+ pcb_r_delete_entry(Source->polygon_tree, (pcb_box_t *) polygon);
+
+ polylist_remove(polygon);
+ polylist_append(&Destination->Polygon, polygon);
+
+ if (!Destination->polygon_tree)
+ Destination->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Destination->polygon_tree, (pcb_box_t *) polygon, 0);
+
+ return polygon;
+}
+
+struct mptlc {
+ pcb_layer_id_t snum, dnum;
+ int type;
+ pcb_polygon_t *polygon;
+} mptlc;
+
+pcb_r_dir_t mptl_pin_callback(const pcb_box_t * b, void *cl)
+{
+ struct mptlc *d = (struct mptlc *) cl;
+ pcb_pin_t *pin = (pcb_pin_t *) b;
+ if (!PCB_FLAG_THERM_TEST(d->snum, pin) || !pcb_poly_is_point_in_p(pin->X, pin->Y, pin->Thickness + pin->Clearance + 2, d->polygon))
+ return PCB_R_DIR_NOT_FOUND;
+ if (d->type == PCB_TYPE_PIN)
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, pin->Element, pin, pin);
+ else
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, pin, pin, pin);
+ PCB_FLAG_THERM_ASSIGN(d->dnum, PCB_FLAG_THERM_GET(d->snum, pin), pin);
+ PCB_FLAG_THERM_CLEAR(d->snum, pin);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* moves a polygon between layers */
+void *MovePolygonToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_polygon_t * Polygon)
+{
+ pcb_polygon_t *newone;
+ struct mptlc d;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Polygon)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ return NULL;
+ }
+ if (((long int) ctx->move.dst_layer == -1) || (Layer == ctx->move.dst_layer))
+ return (Polygon);
+ pcb_undo_add_obj_to_move_to_layer(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
+ if (Layer->On)
+ ErasePolygon(Polygon);
+ /* Move all of the thermals with the polygon */
+ d.snum = pcb_layer_id(PCB->Data, Layer);
+ d.dnum = pcb_layer_id(PCB->Data, ctx->move.dst_layer);
+ d.polygon = Polygon;
+ d.type = PCB_TYPE_PIN;
+ pcb_r_search(PCB->Data->pin_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL);
+ d.type = PCB_TYPE_VIA;
+ pcb_r_search(PCB->Data->via_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL);
+ newone = (struct pcb_polygon_s *) MovePolygonToLayerLowLevel(ctx, Layer, Polygon, ctx->move.dst_layer);
+ pcb_poly_init_clip(PCB->Data, ctx->move.dst_layer, newone);
+ if (ctx->move.dst_layer->On) {
+ DrawPolygon(ctx->move.dst_layer, newone);
+ pcb_draw();
+ }
+ return (newone);
+}
+
+
+/* destroys a polygon from a layer */
+void *DestroyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
+ pcb_poly_free_fields(Polygon);
+
+ pcb_poly_free(Polygon);
+
+ return NULL;
+}
+
+/* removes a polygon-point from a polygon and destroys the data */
+void *DestroyPolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point)
+{
+ pcb_cardinal_t point_idx;
+ pcb_cardinal_t i;
+ pcb_cardinal_t contour;
+ pcb_cardinal_t contour_start, contour_end, contour_points;
+
+ point_idx = pcb_poly_point_idx(Polygon, Point);
+ contour = pcb_poly_contour_point(Polygon, point_idx);
+ contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
+ contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN : Polygon->HoleIndex[contour];
+ contour_points = contour_end - contour_start;
+
+ if (contour_points <= 3)
+ return RemovePolygonContour(ctx, Layer, Polygon, contour);
+
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
+
+ /* remove point from list, keep point order */
+ for (i = point_idx; i < Polygon->PointN - 1; i++)
+ Polygon->Points[i] = Polygon->Points[i + 1];
+ Polygon->PointN--;
+
+ /* Shift down indices of any holes */
+ for (i = 0; i < Polygon->HoleIndexN; i++)
+ if (Polygon->HoleIndex[i] > point_idx)
+ Polygon->HoleIndex[i]--;
+
+ pcb_poly_bbox(Polygon);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+ return (Polygon);
+}
+
+/* removes a polygon from a layer */
+void *RemovePolygon_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ /* erase from screen */
+ if (Layer->On) {
+ ErasePolygon(Polygon);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
+ return NULL;
+}
+
+void *pcb_poly_remove(pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = NULL;
+
+ return RemovePolygon_op(&ctx, Layer, Polygon);
+}
+
+/* Removes a contour from a polygon.
+ If removing the outer contour, it removes the whole polygon. */
+void *RemovePolygonContour(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_cardinal_t contour)
+{
+ pcb_cardinal_t contour_start, contour_end, contour_points;
+ pcb_cardinal_t i;
+
+ if (contour == 0)
+ return pcb_poly_remove(Layer, Polygon);
+
+ if (Layer->On) {
+ ErasePolygon(Polygon);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+
+ /* Copy the polygon to the undo list */
+ pcb_undo_add_obj_to_remove_contour(PCB_TYPE_POLYGON, Layer, Polygon);
+
+ contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
+ contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN : Polygon->HoleIndex[contour];
+ contour_points = contour_end - contour_start;
+
+ /* remove points from list, keep point order */
+ for (i = contour_start; i < Polygon->PointN - contour_points; i++)
+ Polygon->Points[i] = Polygon->Points[i + contour_points];
+ Polygon->PointN -= contour_points;
+
+ /* remove hole from list and shift down remaining indices */
+ for (i = contour; i < Polygon->HoleIndexN; i++)
+ Polygon->HoleIndex[i - 1] = Polygon->HoleIndex[i] - contour_points;
+ Polygon->HoleIndexN--;
+
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+ /* redraw polygon if necessary */
+ if (Layer->On) {
+ DrawPolygon(Layer, Polygon);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ return NULL;
+}
+
+/* removes a polygon-point from a polygon */
+void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point)
+{
+ pcb_cardinal_t point_idx;
+ pcb_cardinal_t i;
+ pcb_cardinal_t contour;
+ pcb_cardinal_t contour_start, contour_end, contour_points;
+
+ point_idx = pcb_poly_point_idx(Polygon, Point);
+ contour = pcb_poly_contour_point(Polygon, point_idx);
+ contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
+ contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN : Polygon->HoleIndex[contour];
+ contour_points = contour_end - contour_start;
+
+ if (contour_points <= 3)
+ return RemovePolygonContour(ctx, Layer, Polygon, contour);
+
+ if (Layer->On)
+ ErasePolygon(Polygon);
+
+ /* insert the polygon-point into the undo list */
+ pcb_undo_add_obj_to_remove_point(PCB_TYPE_POLYGON_POINT, Layer, Polygon, point_idx);
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
+
+ /* remove point from list, keep point order */
+ for (i = point_idx; i < Polygon->PointN - 1; i++)
+ Polygon->Points[i] = Polygon->Points[i + 1];
+ Polygon->PointN--;
+
+ /* Shift down indices of any holes */
+ for (i = 0; i < Polygon->HoleIndexN; i++)
+ if (Polygon->HoleIndex[i] > point_idx)
+ Polygon->HoleIndex[i]--;
+
+ pcb_poly_bbox(Polygon);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
+ pcb_poly_remove_excess_points(Layer, Polygon);
+ pcb_poly_init_clip(PCB->Data, Layer, Polygon);
+
+ /* redraw polygon if necessary */
+ if (Layer->On) {
+ DrawPolygon(Layer, Polygon);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ return NULL;
+}
+
+/* copies a polygon */
+void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_polygon_t *polygon;
+
+ polygon = pcb_poly_new(Layer, pcb_no_flags());
+ pcb_poly_copy(polygon, Polygon);
+ pcb_poly_move(polygon, ctx->copy.DeltaX, ctx->copy.DeltaY);
+ if (!Layer->polygon_tree)
+ Layer->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) polygon, 0);
+ pcb_poly_init_clip(PCB->Data, Layer, polygon);
+ DrawPolygon(Layer, polygon);
+ pcb_undo_add_obj_to_create(PCB_TYPE_POLYGON, Layer, polygon, polygon);
+ return (polygon);
+}
+
+/*** draw ***/
+pcb_r_dir_t draw_poly_callback(const pcb_box_t * b, void *cl)
+{
+ struct pcb_draw_poly_info_s *i = cl;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) b;
+ static const char *color;
+ char buf[sizeof("#XXXXXX")];
+
+ if (!polygon->Clipped)
+ return PCB_R_DIR_NOT_FOUND;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_WARN, polygon))
+ color = PCB->WarnColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon))
+ color = i->layer->SelectedColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_FOUND, polygon))
+ color = PCB->ConnectedColor;
+ else if (PCB_FLAG_TEST(PCB_FLAG_ONPOINT, polygon)) {
+ assert(color != NULL);
+ pcb_lighten_color(color, buf, 1.75);
+ color = buf;
+ }
+ else
+ color = i->layer->Color;
+ pcb_gui->set_color(Output.fgGC, color);
+
+ if ((pcb_gui->thindraw_pcb_polygon != NULL) && (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly))
+ pcb_gui->thindraw_pcb_polygon(Output.fgGC, polygon, i->drawn_area);
+ else
+ pcb_gui->fill_pcb_polygon(Output.fgGC, polygon, i->drawn_area);
+
+ /* If checking planes, thin-draw any pieces which have been clipped away */
+ if (pcb_gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, polygon)) {
+ pcb_polygon_t poly = *polygon;
+
+ for (poly.Clipped = polygon->Clipped->f; poly.Clipped != polygon->Clipped; poly.Clipped = poly.Clipped->f)
+ pcb_gui->thindraw_pcb_polygon(Output.fgGC, &poly, i->drawn_area);
+ }
+
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* erases a polygon on a layer */
+void ErasePolygon(pcb_polygon_t *Polygon)
+{
+ pcb_draw_invalidate(Polygon);
+ pcb_flag_erase(&Polygon->Flags);
+}
+
+void DrawPolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_draw_invalidate(Polygon);
+}
diff --git a/src/obj_poly.h b/src/obj_poly.h
new file mode 100644
index 0000000..3402e16
--- /dev/null
+++ b/src/obj_poly.h
@@ -0,0 +1,120 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: polygons */
+
+#ifndef PCB_OBJ_POLY_H
+#define PCB_OBJ_POLY_H
+
+#include "obj_common.h"
+#include "polyarea.h"
+
+struct pcb_polygon_s { /* holds information about a polygon */
+ PCB_ANYOBJECTFIELDS;
+ pcb_cardinal_t PointN; /* number of points in polygon */
+ pcb_cardinal_t PointMax; /* max number from malloc() */
+ pcb_polyarea_t *Clipped; /* the clipped region of this polygon */
+ pcb_pline_t *NoHoles; /* the polygon broken into hole-less regions */
+ int NoHolesValid; /* Is the NoHoles polygon up to date? */
+ pcb_point_t *Points; /* data */
+ pcb_cardinal_t *HoleIndex; /* Index of hole data within the Points array */
+ pcb_cardinal_t HoleIndexN; /* number of holes in polygon */
+ pcb_cardinal_t HoleIndexMax; /* max number from malloc() */
+ gdl_elem_t link; /* a text is in a list of a layer */
+};
+
+
+
+pcb_polygon_t *pcb_poly_alloc(pcb_layer_t * layer);
+void pcb_poly_free(pcb_polygon_t * data);
+pcb_point_t *pcb_poly_point_alloc(pcb_polygon_t *Polygon);
+pcb_cardinal_t *pcb_poly_holeidx_new(pcb_polygon_t *Polygon);
+void pcb_poly_free_fields(pcb_polygon_t * polygon);
+
+void pcb_poly_bbox(pcb_polygon_t *Polygon);
+pcb_polygon_t *pcb_poly_new_from_rectangle(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_flag_t Flags);
+pcb_polygon_t *pcb_poly_new(pcb_layer_t *Layer, pcb_flag_t Flags);
+pcb_point_t *pcb_poly_point_new(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y);
+pcb_polygon_t *pcb_poly_hole_new(pcb_polygon_t * Polygon);
+void *pcb_poly_remove(pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+
+void pcb_poly_rotate90(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
+void pcb_poly_rotate(pcb_layer_t *layer, pcb_polygon_t *poly, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina);
+void pcb_poly_mirror(pcb_layer_t *layer, pcb_polygon_t *polygon);
+void pcb_poly_flip_side(pcb_layer_t *layer, pcb_polygon_t *polygon);
+
+void pcb_poly_move(pcb_polygon_t *Polygon, pcb_coord_t DX, pcb_coord_t DY);
+pcb_polygon_t *pcb_poly_copy(pcb_polygon_t *Dest, pcb_polygon_t *Src);
+
+/* Add objects without creating them or making any "sanity modifications" to them */
+void pcb_add_polygon_on_layer(pcb_layer_t *Layer, pcb_polygon_t *polygon);
+
+double pcb_poly_area(const pcb_polygon_t *poly);
+
+#define PCB_POLY_LOOP(layer) do { \
+ pcb_polygon_t *polygon; \
+ gdl_iterator_t __it__; \
+ linelist_foreach(&(layer)->Polygon, &__it__, polygon) {
+
+#define PCB_POLY_POINT_LOOP(polygon) do { \
+ pcb_cardinal_t n; \
+ pcb_point_t *point; \
+ for (n = (polygon)->PointN-1; n != -1; n--) \
+ { \
+ point = &(polygon)->Points[n]
+
+#define PCB_POLY_ALL_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ PCB_POLY_LOOP(layer)
+
+#define PCB_POLY_COPPER_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer; l++, layer++) \
+ { \
+ PCB_POLY_LOOP(layer)
+
+#define PCB_POLY_SILK_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ layer += pcb_max_copper_layer; \
+ for (l = 0; l < 2; l++, layer++) \
+ { \
+ PCB_POLY_LOOP(layer)
+
+#define PCB_POLY_VISIBLE_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ if (layer->On) \
+ PCB_POLY_LOOP(layer)
+
+
+#endif
diff --git a/src/obj_poly_draw.h b/src/obj_poly_draw.h
new file mode 100644
index 0000000..d6dd09b
--- /dev/null
+++ b/src/obj_poly_draw.h
@@ -0,0 +1,39 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw of polygons ***/
+
+/* Include rtree.h for these */
+#ifdef PCB_RTREE_H
+struct pcb_draw_poly_info_s {
+ const pcb_box_t *drawn_area;
+ pcb_layer_t *layer;
+};
+pcb_r_dir_t draw_poly_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void ErasePolygon(pcb_polygon_t *Polygon);
+void DrawPolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon);
diff --git a/src/obj_poly_list.c b/src/obj_poly_list.c
new file mode 100644
index 0000000..23323d3
--- /dev/null
+++ b/src/obj_poly_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_poly_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_poly_list.h b/src/obj_poly_list.h
new file mode 100644
index 0000000..dff7814
--- /dev/null
+++ b/src/obj_poly_list.h
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef LIST_POLY_H
+#define LIST_POLY_H
+
+#include "obj_poly.h"
+
+/* List of Lines */
+#define TDL(x) polylist_ ## x
+#define TDL_LIST_T polylist_t
+#define TDL_ITEM_T pcb_polygon_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define polylist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_poly_op.h b/src/obj_poly_op.h
new file mode 100644
index 0000000..9b80136
--- /dev/null
+++ b/src/obj_poly_op.h
@@ -0,0 +1,47 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on polygons ***/
+
+#include "operation.h"
+
+void *AddPolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+void *MovePolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_polygon_t * polygon);
+void *ChangePolygonClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *poly);
+void *ChangePolyClear(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+void *InsertPointIntoPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+void *MovePolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+void *MovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point);
+void *MovePolygonToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_polygon_t * polygon, pcb_layer_t * Destination);
+void *MovePolygonToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_polygon_t * Polygon);
+void *DestroyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+void *DestroyPolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point);
+void *RemovePolygon_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+void *RemovePolygonContour(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_cardinal_t contour);
+void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point);
+void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon);
+
+
diff --git a/src/obj_rat.c b/src/obj_rat.c
new file mode 100644
index 0000000..1cf0e18
--- /dev/null
+++ b/src/obj_rat.c
@@ -0,0 +1,289 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: pins and vias */
+
+#include "config.h"
+
+#include "board.h"
+#include "data.h"
+#include "conf_core.h"
+#include "undo.h"
+#include "rtree.h"
+
+#include "obj_line_draw.h"
+
+#include "obj_rat.h"
+#include "obj_rat_list.h"
+#include "obj_rat_op.h"
+
+
+
+/* TODO: consider moving the code from draw.c here and remove this: */
+#include "draw.h"
+#include "obj_rat_draw.h"
+
+/* TODO: merge rats.[ch] too */
+#include "rats.h"
+
+/*** allocation ***/
+/* get next slot for a Rat, allocates memory if necessary */
+pcb_rat_t *pcb_rat_alloc(pcb_data_t *data)
+{
+ pcb_rat_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_rat_t), 1);
+ ratlist_append(&data->Rat, new_obj);
+
+ return new_obj;
+}
+
+void pcb_rat_free(pcb_rat_t *data)
+{
+ ratlist_remove(data);
+ free(data);
+}
+
+/*** utility ***/
+/* creates a new rat-line */
+pcb_rat_t *pcb_rat_new(pcb_data_t *Data, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, pcb_coord_t Thickness, pcb_flag_t Flags)
+{
+ pcb_rat_t *Line = pcb_rat_alloc(Data);
+
+ if (!Line)
+ return (Line);
+
+ Line->ID = pcb_create_ID_get();
+ Line->Flags = Flags;
+ PCB_FLAG_SET(PCB_FLAG_RAT, Line);
+ Line->Thickness = Thickness;
+ Line->Point1.X = X1;
+ Line->Point1.Y = Y1;
+ Line->Point1.ID = pcb_create_ID_get();
+ Line->Point2.X = X2;
+ Line->Point2.Y = Y2;
+ Line->Point2.ID = pcb_create_ID_get();
+ Line->group1 = group1;
+ Line->group2 = group2;
+ pcb_line_bbox((pcb_line_t *) Line);
+ if (!Data->rat_tree)
+ Data->rat_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Data->rat_tree, &Line->BoundingBox, 0);
+ return (Line);
+}
+
+/* DeleteRats - deletes rat lines only
+ * can delete all rat lines, or only selected one */
+pcb_bool pcb_rats_destroy(pcb_bool selected)
+{
+ pcb_opctx_t ctx;
+ pcb_bool changed = pcb_false;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_true;
+ ctx.remove.destroy_target = NULL;
+
+ PCB_RAT_LOOP(PCB->Data);
+ {
+ if ((!selected) || PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) {
+ changed = pcb_true;
+ RemoveRat(&ctx, line);
+ }
+ }
+ PCB_END_LOOP;
+ if (changed) {
+ pcb_draw();
+ pcb_undo_inc_serial();
+ }
+ return (changed);
+}
+
+
+/*** ops ***/
+/* copies a rat-line to paste buffer */
+void *AddRatToBuffer(pcb_opctx_t *ctx, pcb_rat_t *Rat)
+{
+ return (pcb_rat_new(ctx->buffer.dst, Rat->Point1.X, Rat->Point1.Y,
+ Rat->Point2.X, Rat->Point2.Y, Rat->group1, Rat->group2, Rat->Thickness,
+ pcb_flag_mask(Rat->Flags, PCB_FLAG_FOUND | ctx->buffer.extraflg)));
+}
+
+/* moves a rat-line to paste buffer */
+void *MoveRatToBuffer(pcb_opctx_t *ctx, pcb_rat_t * rat)
+{
+ pcb_r_delete_entry(ctx->buffer.src->rat_tree, (pcb_box_t *) rat);
+
+ ratlist_remove(rat);
+ ratlist_append(&ctx->buffer.dst->Rat, rat);
+
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, rat);
+
+ if (!ctx->buffer.dst->rat_tree)
+ ctx->buffer.dst->rat_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(ctx->buffer.dst->rat_tree, (pcb_box_t *) rat, 0);
+ return rat;
+}
+
+/* inserts a point into a rat-line */
+void *InsertPointIntoRat(pcb_opctx_t *ctx, pcb_rat_t *Rat)
+{
+ pcb_line_t *newone;
+
+ newone = pcb_line_new_merge(CURRENT, Rat->Point1.X, Rat->Point1.Y,
+ ctx->insert.x, ctx->insert.y, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
+ if (!newone)
+ return newone;
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, CURRENT, newone, newone);
+ EraseRat(Rat);
+ DrawLine(CURRENT, newone);
+ newone = pcb_line_new_merge(CURRENT, Rat->Point2.X, Rat->Point2.Y,
+ ctx->insert.x, ctx->insert.y, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
+ if (newone) {
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, CURRENT, newone, newone);
+ DrawLine(CURRENT, newone);
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_RATLINE, Rat, Rat, Rat);
+ pcb_draw();
+ return (newone);
+}
+
+/* moves a line between layers */
+void *MoveRatToLayer(pcb_opctx_t *ctx, pcb_rat_t * Rat)
+{
+ pcb_line_t *newone;
+ /*pcb_coord_t X1 = Rat->Point1.X, Y1 = Rat->Point1.Y;
+ pcb_coord_t X1 = Rat->Point1.X, Y1 = Rat->Point1.Y;
+ if PCB_FLAG_VIA
+ if we're on a pin, add a thermal
+ else make a via and a wire, but 0-length wire not good
+ else as before */
+
+ newone = pcb_line_new(ctx->move.dst_layer, Rat->Point1.X, Rat->Point1.Y,
+ Rat->Point2.X, Rat->Point2.Y, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
+ if (conf_core.editor.clear_line)
+ conf_set_editor(clear_line, 1);
+ if (!newone)
+ return (NULL);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, ctx->move.dst_layer, newone, newone);
+ if (PCB->RatOn)
+ EraseRat(Rat);
+ pcb_undo_move_obj_to_remove(PCB_TYPE_RATLINE, Rat, Rat, Rat);
+ DrawLine(ctx->move.dst_layer, newone);
+ pcb_draw();
+ return (newone);
+}
+
+/* destroys a rat */
+void *DestroyRat(pcb_opctx_t *ctx, pcb_rat_t *Rat)
+{
+ if (ctx->remove.destroy_target->rat_tree)
+ pcb_r_delete_entry(ctx->remove.destroy_target->rat_tree, &Rat->BoundingBox);
+
+ pcb_rat_free(Rat);
+ return NULL;
+}
+
+/* removes a rat */
+void *RemoveRat(pcb_opctx_t *ctx, pcb_rat_t *Rat)
+{
+ /* erase from screen and memory */
+ if (PCB->RatOn) {
+ EraseRat(Rat);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_RATLINE, Rat, Rat, Rat);
+ return NULL;
+}
+
+/*** draw ***/
+pcb_r_dir_t draw_rat_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_rat_t *rat = (pcb_rat_t *) b;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, rat)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, rat))
+ pcb_gui->set_color(Output.fgGC, PCB->RatSelectedColor);
+ else
+ pcb_gui->set_color(Output.fgGC, PCB->ConnectedColor);
+ }
+ else
+ pcb_gui->set_color(Output.fgGC, PCB->RatColor);
+
+ if (conf_core.appearance.rat_thickness < 20)
+ rat->Thickness = pcb_pixel_slop * conf_core.appearance.rat_thickness;
+ /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */
+ if (PCB_FLAG_TEST(PCB_FLAG_VIA, rat)) {
+ int w = rat->Thickness;
+
+ if (conf_core.editor.thin_draw)
+ pcb_gui->set_line_width(Output.fgGC, 0);
+ else
+ pcb_gui->set_line_width(Output.fgGC, w);
+ pcb_gui->draw_arc(Output.fgGC, rat->Point1.X, rat->Point1.Y, w * 2, w * 2, 0, 360);
+ }
+ else
+ _draw_line((pcb_line_t *) rat);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+void EraseRat(pcb_rat_t *Rat)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_VIA, Rat)) {
+ pcb_coord_t w = Rat->Thickness;
+
+ pcb_box_t b;
+
+ b.X1 = Rat->Point1.X - w * 2 - w / 2;
+ b.X2 = Rat->Point1.X + w * 2 + w / 2;
+ b.Y1 = Rat->Point1.Y - w * 2 - w / 2;
+ b.Y2 = Rat->Point1.Y + w * 2 + w / 2;
+ pcb_draw_invalidate(&b);
+ }
+ else
+ EraseLine((pcb_line_t *) Rat);
+ pcb_flag_erase(&Rat->Flags);
+}
+
+void DrawRat(pcb_rat_t *Rat)
+{
+ if (conf_core.appearance.rat_thickness < 20)
+ Rat->Thickness = pcb_pixel_slop * conf_core.appearance.rat_thickness;
+ /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */
+ if (PCB_FLAG_TEST(PCB_FLAG_VIA, Rat)) {
+ pcb_coord_t w = Rat->Thickness;
+
+ pcb_box_t b;
+
+ b.X1 = Rat->Point1.X - w * 2 - w / 2;
+ b.X2 = Rat->Point1.X + w * 2 + w / 2;
+ b.Y1 = Rat->Point1.Y - w * 2 - w / 2;
+ b.Y2 = Rat->Point1.Y + w * 2 + w / 2;
+ pcb_draw_invalidate(&b);
+ }
+ else
+ DrawLine(NULL, (pcb_line_t *) Rat);
+}
diff --git a/src/obj_rat.h b/src/obj_rat.h
new file mode 100644
index 0000000..621fbda
--- /dev/null
+++ b/src/obj_rat.h
@@ -0,0 +1,47 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: rats */
+
+#ifndef PCB_OBJ_RAT_H
+#define PCB_OBJ_RAT_H
+
+#include "obj_common.h"
+
+struct pcb_rat_line_s { /* a rat-line */
+ PCB_ANYLINEFIELDS;
+ pcb_cardinal_t group1, group2; /* the layer group each point is on */
+ gdl_elem_t link; /* an arc is in a list on a design */
+};
+
+
+pcb_rat_t *pcb_rat_alloc(pcb_data_t *data);
+void pcb_rat_free(pcb_rat_t *data);
+
+pcb_rat_t *pcb_rat_new(pcb_data_t *Data, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, pcb_coord_t Thickness, pcb_flag_t Flags);
+pcb_bool pcb_rats_destroy(pcb_bool selected);
+
+#endif
diff --git a/src/obj_rat_draw.h b/src/obj_rat_draw.h
new file mode 100644
index 0000000..3c8e8fc
--- /dev/null
+++ b/src/obj_rat_draw.h
@@ -0,0 +1,35 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw on rats ***/
+
+/* Include rtree.h for these */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_rat_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void EraseRat(pcb_rat_t *Rat);
+void DrawRat(pcb_rat_t *Rat);
diff --git a/src/obj_rat_list.c b/src/obj_rat_list.c
new file mode 100644
index 0000000..31a55b6
--- /dev/null
+++ b/src/obj_rat_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_rat_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_rat_list.h b/src/obj_rat_list.h
new file mode 100644
index 0000000..d5662a2
--- /dev/null
+++ b/src/obj_rat_list.h
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_RAT_LIST_H
+#define PCB_OBJ_RAT_LIST_H
+
+#include "obj_rat.h"
+
+/* List of Rats */
+#define TDL(x) ratlist_ ## x
+#define TDL_LIST_T ratlist_t
+#define TDL_ITEM_T pcb_rat_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define ratlist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_rat_op.h b/src/obj_rat_op.h
new file mode 100644
index 0000000..d064f21
--- /dev/null
+++ b/src/obj_rat_op.h
@@ -0,0 +1,36 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on rat lines ***/
+
+#include "operation.h"
+
+void *AddRatToBuffer(pcb_opctx_t *ctx, pcb_rat_t *Rat);
+void *MoveRatToBuffer(pcb_opctx_t *ctx, pcb_rat_t * rat);
+void *InsertPointIntoRat(pcb_opctx_t *ctx, pcb_rat_t *Rat);
+void *MoveRatToLayer(pcb_opctx_t *ctx, pcb_rat_t * Rat);
+void *DestroyRat(pcb_opctx_t *ctx, pcb_rat_t *Rat);
+void *RemoveRat(pcb_opctx_t *ctx, pcb_rat_t *Rat);
diff --git a/src/obj_text.c b/src/obj_text.c
new file mode 100644
index 0000000..f618905
--- /dev/null
+++ b/src/obj_text.c
@@ -0,0 +1,581 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: text */
+
+#include "config.h"
+
+#include "rotate.h"
+#include "board.h"
+#include "data.h"
+#include "compat_misc.h"
+#include "compat_nls.h"
+#include "undo.h"
+#include "polygon.h"
+
+#include "obj_text.h"
+#include "obj_text_op.h"
+#include "obj_text_list.h"
+
+/* TODO: remove this if draw.c is moved here: */
+#include "draw.h"
+#include "obj_line_draw.h"
+#include "obj_text_draw.h"
+#include "conf_core.h"
+
+/*** allocation ***/
+/* get next slot for a text object, allocates memory if necessary */
+pcb_text_t *pcb_text_alloc(pcb_layer_t * layer)
+{
+ pcb_text_t *new_obj;
+
+ new_obj = calloc(sizeof(pcb_text_t), 1);
+ textlist_append(&layer->Text, new_obj);
+
+ return new_obj;
+}
+
+void pcb_text_free(pcb_text_t * data)
+{
+ textlist_remove(data);
+ free(data);
+}
+
+/*** utility ***/
+
+/* creates a new text on a layer */
+pcb_text_t *pcb_text_new(pcb_layer_t *Layer, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, int Scale, char *TextString, pcb_flag_t Flags)
+{
+ pcb_text_t *text;
+
+ if (TextString == NULL)
+ return NULL;
+
+ text = pcb_text_alloc(Layer);
+ if (text == NULL)
+ return NULL;
+
+ /* copy values, width and height are set by drawing routine
+ * because at this point we don't know which symbols are available
+ */
+ text->X = X;
+ text->Y = Y;
+ text->Direction = Direction;
+ text->Flags = Flags;
+ text->Scale = Scale;
+ text->TextString = pcb_strdup(TextString);
+
+ pcb_add_text_on_layer(Layer, text, PCBFont);
+
+ return (text);
+}
+
+void pcb_add_text_on_layer(pcb_layer_t *Layer, pcb_text_t *text, pcb_font_t *PCBFont)
+{
+ /* calculate size of the bounding box */
+ pcb_text_bbox(PCBFont, text);
+ text->ID = pcb_create_ID_get();
+ if (!Layer->text_tree)
+ Layer->text_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) text, 0);
+}
+
+/* creates the bounding box of a text object */
+void pcb_text_bbox(pcb_font_t *FontPtr, pcb_text_t *Text)
+{
+ pcb_symbol_t *symbol = FontPtr->Symbol;
+ unsigned char *s = (unsigned char *) Text->TextString;
+ int i;
+ int space;
+
+ pcb_coord_t minx, miny, maxx, maxy, tx;
+ pcb_coord_t min_final_radius;
+ pcb_coord_t min_unscaled_radius;
+ pcb_bool first_time = pcb_true;
+
+ minx = miny = maxx = maxy = tx = 0;
+
+ /* Calculate the bounding box based on the larger of the thicknesses
+ * the text might clamped at on silk or copper layers.
+ */
+ min_final_radius = MAX(PCB->minWid, PCB->minSlk) / 2;
+
+ /* Pre-adjust the line radius for the fact we are initially computing the
+ * bounds of the un-scaled text, and the thickness clamping applies to
+ * scaled text.
+ */
+ min_unscaled_radius = PCB_UNPCB_SCALE_TEXT(min_final_radius, Text->Scale);
+
+ /* calculate size of the bounding box */
+ for (; s && *s; s++) {
+ if (*s <= PCB_MAX_FONTPOSITION && symbol[*s].Valid) {
+ pcb_line_t *line = symbol[*s].Line;
+ for (i = 0; i < symbol[*s].LineN; line++, i++) {
+ /* Clamp the width of text lines at the minimum thickness.
+ * NB: Divide 4 in thickness calculation is comprised of a factor
+ * of 1/2 to get a radius from the center-line, and a factor
+ * of 1/2 because some stupid reason we render our glyphs
+ * at half their defined stroke-width.
+ */
+ pcb_coord_t unscaled_radius = MAX(min_unscaled_radius, line->Thickness / 4);
+
+ if (first_time) {
+ minx = maxx = line->Point1.X;
+ miny = maxy = line->Point1.Y;
+ first_time = pcb_false;
+ }
+
+ minx = MIN(minx, line->Point1.X - unscaled_radius + tx);
+ miny = MIN(miny, line->Point1.Y - unscaled_radius);
+ minx = MIN(minx, line->Point2.X - unscaled_radius + tx);
+ miny = MIN(miny, line->Point2.Y - unscaled_radius);
+ maxx = MAX(maxx, line->Point1.X + unscaled_radius + tx);
+ maxy = MAX(maxy, line->Point1.Y + unscaled_radius);
+ maxx = MAX(maxx, line->Point2.X + unscaled_radius + tx);
+ maxy = MAX(maxy, line->Point2.Y + unscaled_radius);
+ }
+ space = symbol[*s].Delta;
+ }
+ else {
+ pcb_box_t *ds = &FontPtr->DefaultSymbol;
+ pcb_coord_t w = ds->X2 - ds->X1;
+
+ minx = MIN(minx, ds->X1 + tx);
+ miny = MIN(miny, ds->Y1);
+ minx = MIN(minx, ds->X2 + tx);
+ miny = MIN(miny, ds->Y2);
+ maxx = MAX(maxx, ds->X1 + tx);
+ maxy = MAX(maxy, ds->Y1);
+ maxx = MAX(maxx, ds->X2 + tx);
+ maxy = MAX(maxy, ds->Y2);
+
+ space = w / 5;
+ }
+ tx += symbol[*s].Width + space;
+ }
+
+ /* scale values */
+ minx = PCB_SCALE_TEXT(minx, Text->Scale);
+ miny = PCB_SCALE_TEXT(miny, Text->Scale);
+ maxx = PCB_SCALE_TEXT(maxx, Text->Scale);
+ maxy = PCB_SCALE_TEXT(maxy, Text->Scale);
+
+ /* set upper-left and lower-right corner;
+ * swap coordinates if necessary (origin is already in 'swapped')
+ * and rotate box
+ */
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Text)) {
+ Text->BoundingBox.X1 = Text->X + minx;
+ Text->BoundingBox.Y1 = Text->Y - miny;
+ Text->BoundingBox.X2 = Text->X + maxx;
+ Text->BoundingBox.Y2 = Text->Y - maxy;
+ pcb_box_rotate90(&Text->BoundingBox, Text->X, Text->Y, (4 - Text->Direction) & 0x03);
+ }
+ else {
+ Text->BoundingBox.X1 = Text->X + minx;
+ Text->BoundingBox.Y1 = Text->Y + miny;
+ Text->BoundingBox.X2 = Text->X + maxx;
+ Text->BoundingBox.Y2 = Text->Y + maxy;
+ pcb_box_rotate90(&Text->BoundingBox, Text->X, Text->Y, Text->Direction);
+ }
+
+ /* the bounding box covers the extent of influence
+ * so it must include the clearance values too
+ */
+ Text->BoundingBox.X1 -= PCB->Bloat;
+ Text->BoundingBox.Y1 -= PCB->Bloat;
+ Text->BoundingBox.X2 += PCB->Bloat;
+ Text->BoundingBox.Y2 += PCB->Bloat;
+ pcb_close_box(&Text->BoundingBox);
+}
+
+
+
+/*** ops ***/
+/* copies a text to buffer */
+void *AddTextToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ pcb_layer_t *layer = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, Layer)];
+
+ return (pcb_text_new(layer, &PCB->Font, Text->X, Text->Y, Text->Direction, Text->Scale, Text->TextString, pcb_flag_mask(Text->Flags, ctx->buffer.extraflg)));
+}
+
+/* moves a text to buffer without allocating memory for the name */
+void *MoveTextToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_text_t * text)
+{
+ pcb_layer_t *lay = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, layer)];
+
+ pcb_r_delete_entry(layer->text_tree, (pcb_box_t *) text);
+ pcb_poly_restore_to_poly(ctx->buffer.src, PCB_TYPE_TEXT, layer, text);
+
+ textlist_remove(text);
+ textlist_append(&lay->Text, text);
+
+ if (!lay->text_tree)
+ lay->text_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(lay->text_tree, (pcb_box_t *) text, 0);
+ pcb_poly_clear_from_poly(ctx->buffer.dst, PCB_TYPE_TEXT, lay, text);
+ return (text);
+}
+
+/* changes the scaling factor of a text object */
+void *ChangeTextSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ int value = ctx->chgsize.absolute ? PCB_COORD_TO_MIL(ctx->chgsize.absolute)
+ : Text->Scale + PCB_COORD_TO_MIL(ctx->chgsize.delta);
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Text))
+ return (NULL);
+ if (value <= PCB_MAX_TEXTSCALE && value >= PCB_MIN_TEXTSCALE && value != Text->Scale) {
+ pcb_undo_add_obj_to_size(PCB_TYPE_TEXT, Layer, Text, Text);
+ EraseText(Layer, Text);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ Text->Scale = value;
+ pcb_text_bbox(&PCB->Font, Text);
+ pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ DrawText(Layer, Text);
+ return (Text);
+ }
+ return (NULL);
+}
+
+/* sets data of a text object and calculates bounding box; memory must have
+ already been allocated the one for the new string is allocated */
+void *ChangeTextName(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ char *old = Text->TextString;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Text))
+ return (NULL);
+ EraseText(Layer, Text);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *)Text);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ Text->TextString = ctx->chgname.new_name;
+
+ /* calculate size of the bounding box */
+ pcb_text_bbox(&PCB->Font, Text);
+ pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ DrawText(Layer, Text);
+ return (old);
+}
+
+/* changes the clearance flag of a text */
+void *ChangeTextJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Text))
+ return (NULL);
+ EraseText(Layer, Text);
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Text)) {
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_TEXT, Layer, Text, Text, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ }
+ pcb_undo_add_obj_to_flag(PCB_TYPE_TEXT, Layer, Text, Text);
+ PCB_FLAG_TOGGLE(PCB_FLAG_CLEARLINE, Text);
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Text)) {
+ pcb_undo_add_obj_to_clear_poly(PCB_TYPE_TEXT, Layer, Text, Text, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ }
+ DrawText(Layer, Text);
+ return (Text);
+}
+
+/* sets the clearance flag of a text */
+void *SetTextJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Text) || PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Text))
+ return (NULL);
+ return ChangeTextJoin(ctx, Layer, Text);
+}
+
+/* clears the clearance flag of a text */
+void *ClrTextJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Text) || !PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, Text))
+ return (NULL);
+ return ChangeTextJoin(ctx, Layer, Text);
+}
+
+/* copies a text */
+void *CopyText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ pcb_text_t *text;
+
+ text = pcb_text_new(Layer, &PCB->Font, Text->X + ctx->copy.DeltaX,
+ Text->Y + ctx->copy.DeltaY, Text->Direction, Text->Scale, Text->TextString, pcb_flag_mask(Text->Flags, PCB_FLAG_FOUND));
+ DrawText(Layer, text);
+ pcb_undo_add_obj_to_create(PCB_TYPE_TEXT, Layer, text, text);
+ return (text);
+}
+
+/* moves a text object */
+void *MoveText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text);
+ if (Layer->On) {
+ EraseText(Layer, Text);
+ pcb_text_move(Text, ctx->move.dx, ctx->move.dy);
+ DrawText(Layer, Text);
+ pcb_draw();
+ }
+ else
+ pcb_text_move(Text, ctx->move.dx, ctx->move.dy);
+ pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ return (Text);
+}
+
+/* moves a text object between layers; lowlevel routines */
+void *MoveTextToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_text_t * text, pcb_layer_t * Destination)
+{
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Source, text);
+ pcb_r_delete_entry(Source->text_tree, (pcb_box_t *) text);
+
+ textlist_remove(text);
+ textlist_append(&Destination->Text, text);
+
+ if (pcb_layer_get_group(pcb_solder_silk_layer) == pcb_layer_get_group_(Destination))
+ PCB_FLAG_SET(PCB_FLAG_ONSOLDER, text);
+ else
+ PCB_FLAG_CLEAR(PCB_FLAG_ONSOLDER, text);
+
+ /* re-calculate the bounding box (it could be mirrored now) */
+ pcb_text_bbox(&PCB->Font, text);
+ if (!Destination->text_tree)
+ Destination->text_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Destination->text_tree, (pcb_box_t *) text, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Destination, text);
+
+ return text;
+}
+
+/* moves a text object between layers */
+void *MoveTextToLayer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_text_t * text)
+{
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, text)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
+ return NULL;
+ }
+ if (ctx->move.dst_layer != layer) {
+ pcb_undo_add_obj_to_move_to_layer(PCB_TYPE_TEXT, layer, text, text);
+ if (layer->On)
+ EraseText(layer, text);
+ text = MoveTextToLayerLowLevel(ctx, layer, text, ctx->move.dst_layer);
+ if (ctx->move.dst_layer->On)
+ DrawText(ctx->move.dst_layer, text);
+ if (layer->On || ctx->move.dst_layer->On)
+ pcb_draw();
+ }
+ return text;
+}
+
+/* destroys a text from a layer */
+void *DestroyText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ free(Text->TextString);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text);
+
+ pcb_text_free(Text);
+
+ return NULL;
+}
+
+/* removes a text from a layer */
+void *RemoveText_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ /* erase from screen */
+ if (Layer->On) {
+ EraseText(Layer, Text);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *)Text);
+ if (!ctx->remove.bulk)
+ pcb_draw();
+ }
+ pcb_undo_move_obj_to_remove(PCB_TYPE_TEXT, Layer, Text, Text);
+ return NULL;
+}
+
+void *pcb_text_destroy(pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = NULL;
+
+ return RemoveText_op(&ctx, Layer, Text);
+}
+
+/* rotates a text in 90 degree steps; only the bounding box is rotated,
+ text rotation itself is done by the drawing routines */
+void pcb_text_rotate90(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
+{
+ pcb_uint8_t number;
+
+ number = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Text) ? (4 - Number) & 3 : Number;
+ pcb_box_rotate90(&Text->BoundingBox, X, Y, Number);
+ PCB_COORD_ROTATE90(Text->X, Text->Y, X, Y, Number);
+
+ /* set new direction, 0..3,
+ * 0-> to the right, 1-> straight up,
+ * 2-> to the left, 3-> straight down
+ */
+ Text->Direction = ((Text->Direction + number) & 0x03);
+}
+
+/* rotates a text object and redraws it */
+void *Rotate90Text(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ EraseText(Layer, Text);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text);
+ pcb_text_rotate90(Text, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number);
+ pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
+ DrawText(Layer, Text);
+ pcb_draw();
+ return (Text);
+}
+
+void pcb_text_flip_side(pcb_layer_t *layer, pcb_text_t *text)
+{
+ pcb_r_delete_entry(layer->text_tree, (pcb_box_t *) text);
+ text->X = PCB_SWAP_X(text->X);
+ text->Y = PCB_SWAP_Y(text->Y);
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, text);
+ pcb_text_bbox(&PCB->Font, text);
+ pcb_r_insert_entry(layer->text_tree, (pcb_box_t *) text, 0);
+}
+
+/*** draw ***/
+
+/* ---------------------------------------------------------------------------
+ * lowlevel drawing routine for text objects
+ */
+void DrawTextLowLevel(pcb_text_t *Text, pcb_coord_t min_line_width)
+{
+ pcb_coord_t x = 0;
+ unsigned char *string = (unsigned char *) Text->TextString;
+ pcb_cardinal_t n;
+ pcb_font_t *font = &PCB->Font;
+
+ while (string && *string) {
+ /* draw lines if symbol is valid and data is present */
+ if (*string <= PCB_MAX_FONTPOSITION && font->Symbol[*string].Valid) {
+ pcb_line_t *line = font->Symbol[*string].Line;
+ pcb_line_t newline;
+
+ for (n = font->Symbol[*string].LineN; n; n--, line++) {
+ /* create one line, scale, move, rotate and swap it */
+ newline = *line;
+ newline.Point1.X = PCB_SCALE_TEXT(newline.Point1.X + x, Text->Scale);
+ newline.Point1.Y = PCB_SCALE_TEXT(newline.Point1.Y, Text->Scale);
+ newline.Point2.X = PCB_SCALE_TEXT(newline.Point2.X + x, Text->Scale);
+ newline.Point2.Y = PCB_SCALE_TEXT(newline.Point2.Y, Text->Scale);
+ newline.Thickness = PCB_SCALE_TEXT(newline.Thickness, Text->Scale / 2);
+ if (newline.Thickness < min_line_width)
+ newline.Thickness = min_line_width;
+
+ pcb_line_rotate90(&newline, 0, 0, Text->Direction);
+
+ /* the labels of SMD objects on the bottom
+ * side haven't been swapped yet, only their offset
+ */
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Text)) {
+ newline.Point1.X = PCB_SWAP_SIGN_X(newline.Point1.X);
+ newline.Point1.Y = PCB_SWAP_SIGN_Y(newline.Point1.Y);
+ newline.Point2.X = PCB_SWAP_SIGN_X(newline.Point2.X);
+ newline.Point2.Y = PCB_SWAP_SIGN_Y(newline.Point2.Y);
+ }
+ /* add offset and draw line */
+ newline.Point1.X += Text->X;
+ newline.Point1.Y += Text->Y;
+ newline.Point2.X += Text->X;
+ newline.Point2.Y += Text->Y;
+ _draw_line(&newline);
+ }
+
+ /* move on to next cursor position */
+ x += (font->Symbol[*string].Width + font->Symbol[*string].Delta);
+ }
+ else {
+ /* the default symbol is a filled box */
+ pcb_box_t defaultsymbol = PCB->Font.DefaultSymbol;
+ pcb_coord_t size = (defaultsymbol.X2 - defaultsymbol.X1) * 6 / 5;
+
+ defaultsymbol.X1 = PCB_SCALE_TEXT(defaultsymbol.X1 + x, Text->Scale);
+ defaultsymbol.Y1 = PCB_SCALE_TEXT(defaultsymbol.Y1, Text->Scale);
+ defaultsymbol.X2 = PCB_SCALE_TEXT(defaultsymbol.X2 + x, Text->Scale);
+ defaultsymbol.Y2 = PCB_SCALE_TEXT(defaultsymbol.Y2, Text->Scale);
+
+ pcb_box_rotate90(&defaultsymbol, 0, 0, Text->Direction);
+
+ /* add offset and draw box */
+ defaultsymbol.X1 += Text->X;
+ defaultsymbol.Y1 += Text->Y;
+ defaultsymbol.X2 += Text->X;
+ defaultsymbol.Y2 += Text->Y;
+ pcb_gui->fill_rect(Output.fgGC, defaultsymbol.X1, defaultsymbol.Y1, defaultsymbol.X2, defaultsymbol.Y2);
+
+ /* move on to next cursor position */
+ x += size;
+ }
+ string++;
+ }
+}
+
+
+pcb_r_dir_t draw_text_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_layer_t *layer = cl;
+ pcb_text_t *text = (pcb_text_t *) b;
+ int min_silk_line;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, text))
+ pcb_gui->set_color(Output.fgGC, layer->SelectedColor);
+ else
+ pcb_gui->set_color(Output.fgGC, layer->Color);
+ if (layer == &PCB->Data->SILKLAYER || layer == &PCB->Data->BACKSILKLAYER)
+ min_silk_line = PCB->minSlk;
+ else
+ min_silk_line = PCB->minWid;
+ DrawTextLowLevel(text, min_silk_line);
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* erases a text on a layer */
+void EraseText(pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ pcb_draw_invalidate(Text);
+}
+
+void DrawText(pcb_layer_t *Layer, pcb_text_t *Text)
+{
+ pcb_draw_invalidate(Text);
+}
diff --git a/src/obj_text.h b/src/obj_text.h
new file mode 100644
index 0000000..d5c55ba
--- /dev/null
+++ b/src/obj_text.h
@@ -0,0 +1,90 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* Drawing primitive: text */
+
+#ifndef PCB_OBJ_TEXT_H
+#define PCB_OBJ_TEXT_H
+
+#include "obj_common.h"
+
+struct pcb_text_s {
+ PCB_ANYOBJECTFIELDS;
+ int Scale; /* text scaling in percent */
+ pcb_coord_t X, Y; /* origin */
+ pcb_uint8_t Direction;
+ char *TextString; /* string */
+ void *Element;
+ gdl_elem_t link; /* a text is in a list of a layer or an element */
+};
+
+
+pcb_text_t *pcb_text_alloc(pcb_layer_t * layer);
+void pcb_text_free(pcb_text_t * data);
+pcb_text_t *pcb_text_new(pcb_layer_t *Layer, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, int Scale, char *TextString, pcb_flag_t Flags);
+void *pcb_text_destroy(pcb_layer_t *Layer, pcb_text_t *Text);
+
+
+/* Add objects without creating them or making any "sanity modifications" to them */
+void pcb_add_text_on_layer(pcb_layer_t *Layer, pcb_text_t *text, pcb_font_t *PCBFont);
+
+void pcb_text_bbox(pcb_font_t *FontPtr, pcb_text_t *Text);
+void pcb_text_rotate90(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
+void pcb_text_flip_side(pcb_layer_t *layer, pcb_text_t *text);
+
+
+#define pcb_text_move(t,dx,dy) \
+ do { \
+ pcb_coord_t __dx__ = (dx), __dy__ = (dy); \
+ pcb_text_t *__t__ = (t); \
+ PCB_BOX_MOVE_LOWLEVEL(&((__t__)->BoundingBox), __dx__, __dy__); \
+ PCB_MOVE((__t__)->X, (__t__)->Y, __dx__, __dy__); \
+ } while(0)
+
+/* Determines if text is actually visible */
+#define pcb_text_is_visible(b, l, t) ((l)->On)
+
+#define PCB_TEXT_LOOP(layer) do { \
+ pcb_text_t *text; \
+ gdl_iterator_t __it__; \
+ linelist_foreach(&(layer)->Text, &__it__, text) {
+
+#define PCB_TEXT_ALL_LOOP(top) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (top)->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ PCB_TEXT_LOOP(layer)
+
+#define PCB_TEXT_VISIBLE_LOOP(board) do { \
+ pcb_cardinal_t l; \
+ pcb_layer_t *layer = (board)->Data->Layer; \
+ for (l = 0; l < pcb_max_copper_layer + 2; l++, layer++) \
+ { \
+ PCB_TEXT_LOOP(layer); \
+ if (pcb_text_is_visible((board), layer, text))
+
+#endif
diff --git a/src/obj_text_draw.h b/src/obj_text_draw.h
new file mode 100644
index 0000000..5ce7ae9
--- /dev/null
+++ b/src/obj_text_draw.h
@@ -0,0 +1,37 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard draw of text ***/
+
+
+/* Include rtree.h for these */
+#ifdef PCB_RTREE_H
+pcb_r_dir_t draw_text_callback(const pcb_box_t * b, void *cl);
+#endif
+
+void DrawTextLowLevel(pcb_text_t *Text, pcb_coord_t min_line_width);
+void EraseText(pcb_layer_t *Layer, pcb_text_t *Text);
+void DrawText(pcb_layer_t *Layer, pcb_text_t *Text);
diff --git a/src/obj_text_list.c b/src/obj_text_list.c
new file mode 100644
index 0000000..f193fba
--- /dev/null
+++ b/src/obj_text_list.c
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#define TDL_DONT_UNDEF
+#include "obj_text_list.h"
+#include <genlist/gentdlist_impl.c>
diff --git a/src/obj_text_list.h b/src/obj_text_list.h
new file mode 100644
index 0000000..42e105f
--- /dev/null
+++ b/src/obj_text_list.h
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#ifndef PCB_OBJ_TEXT_LIST_H
+#define PCB_OBJ_TEXT_LIST_H
+
+#include "obj_text.h"
+
+/* List of Text */
+#define TDL(x) textlist_ ## x
+#define TDL_LIST_T textlist_t
+#define TDL_ITEM_T pcb_text_t
+#define TDL_FIELD link
+#define TDL_SIZE_T size_t
+#define TDL_FUNC
+
+#define textlist_foreach(list, iterator, loop_elem) \
+ gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
+
+
+#include <genlist/gentdlist_impl.h>
+#include <genlist/gentdlist_undef.h>
+
+#endif
diff --git a/src/obj_text_op.h b/src/obj_text_op.h
new file mode 100644
index 0000000..5079a38
--- /dev/null
+++ b/src/obj_text_op.h
@@ -0,0 +1,44 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/*** Standard operations on text ***/
+
+#include "operation.h"
+
+void *AddTextToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *MoveTextToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_text_t * text);
+void *ChangeTextSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *ChangeTextName(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *ChangeTextJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *SetTextJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *ClrTextJoin(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *CopyText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *MoveText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *MoveTextToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_text_t * text, pcb_layer_t * Destination);
+void *MoveTextToLayer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_text_t * text);
+void *DestroyText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *RemoveText_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
+void *Rotate90Text(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text);
diff --git a/src/object_act.c b/src/object_act.c
index 96cd237..870f9be 100644
--- a/src/object_act.c
+++ b/src/object_act.c
@@ -28,51 +28,45 @@
#include "conf_core.h"
#include "data.h"
+#include "board.h"
#include "action_helper.h"
#include "change.h"
#include "error.h"
#include "undo.h"
+#include "event.h"
#include "funchash_core.h"
#include "search.h"
-#include "move.h"
#include "draw.h"
-#include "mirror.h"
-#include "rotate.h"
-#include "set.h"
#include "copy.h"
-#include "misc.h"
-#include "rubberband.h"
-#include "buffer.h"
#include "remove.h"
-#include "create.h"
-#include "misc_util.h"
#include "compat_misc.h"
-#include "layer.h"
+#include "compat_nls.h"
+#include "layer_vis.h"
/* --------------------------------------------------------------------------- */
-static ElementType *element_cache = NULL;
+static pcb_element_t *element_cache = NULL;
-static ElementType *find_element_by_refdes(const char *refdes)
+static pcb_element_t *find_element_by_refdes(const char *refdes)
{
- if (element_cache && NAMEONPCB_NAME(element_cache)
- && strcmp(NAMEONPCB_NAME(element_cache), refdes) == 0)
+ if (element_cache && PCB_ELEM_NAME_REFDES(element_cache)
+ && strcmp(PCB_ELEM_NAME_REFDES(element_cache), refdes) == 0)
return element_cache;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (NAMEONPCB_NAME(element)
- && strcmp(NAMEONPCB_NAME(element), refdes) == 0) {
+ if (PCB_ELEM_NAME_REFDES(element)
+ && strcmp(PCB_ELEM_NAME_REFDES(element), refdes) == 0) {
element_cache = element;
return element_cache;
}
}
- END_LOOP;
+ PCB_END_LOOP;
return NULL;
}
-static AttributeType *lookup_attr(AttributeListTypePtr list, const char *name)
+static pcb_attribute_t *lookup_attr(pcb_attribute_list_t *list, const char *name)
{
int i;
for (i = 0; i < list->Number; i++)
@@ -81,21 +75,21 @@ static AttributeType *lookup_attr(AttributeListTypePtr list, const char *name)
return NULL;
}
-static void delete_attr(AttributeListTypePtr list, AttributeType * attr)
+static void delete_attr(pcb_attribute_list_t *list, pcb_attribute_t * attr)
{
int idx = attr - list->List;
if (idx < 0 || idx >= list->Number)
return;
if (list->Number - idx > 1)
- memmove(attr, attr + 1, (list->Number - idx - 1) * sizeof(AttributeType));
+ memmove(attr, attr + 1, (list->Number - idx - 1) * sizeof(pcb_attribute_t));
list->Number--;
}
/* ------------------------------------------------------------ */
-static const char attributes_syntax[] = "Attributes(Layout|Layer|Element)\n" "Attributes(Layer,layername)";
+static const char pcb_acts_Attributes[] = "Attributes(Layout|Layer|Element)\n" "Attributes(Layer,layername)";
-static const char attributes_help[] =
+static const char pcb_acth_Attributes[] =
"Let the user edit the attributes of the layout, current or given\n" "layer, or selected element.";
/* %start-doc actions Attributes
@@ -106,46 +100,46 @@ pcb, an element, or a layer.
%end-doc */
-static int ActionAttributes(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Attributes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *layername = ACTION_ARG(1);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *layername = PCB_ACTION_ARG(1);
char *buf;
if (!function)
- AFAIL(attributes);
+ PCB_ACT_FAIL(Attributes);
- if (!gui->edit_attributes) {
- Message(PCB_MSG_DEFAULT, _("This GUI doesn't support Attribute Editing\n"));
+ if (!pcb_gui->edit_attributes) {
+ pcb_message(PCB_MSG_ERROR, _("This GUI doesn't support Attribute Editing\n"));
return 1;
}
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Layout:
{
- gui->edit_attributes("Layout Attributes", &(PCB->Attributes));
+ pcb_gui->edit_attributes("Layout Attributes", &(PCB->Attributes));
return 0;
}
case F_Layer:
{
- LayerType *layer = CURRENT;
+ pcb_layer_t *layer = CURRENT;
if (layername) {
int i;
layer = NULL;
- for (i = 0; i < max_copper_layer; i++)
+ for (i = 0; i < pcb_max_copper_layer; i++)
if (strcmp(PCB->Data->Layer[i].Name, layername) == 0) {
layer = &(PCB->Data->Layer[i]);
break;
}
if (layer == NULL) {
- Message(PCB_MSG_DEFAULT, _("No layer named %s\n"), layername);
+ pcb_message(PCB_MSG_ERROR, _("No layer named %s\n"), layername);
return 1;
}
}
buf = (char *) malloc(strlen(layer->Name) + strlen("Layer X Attributes"));
sprintf(buf, "Layer %s Attributes", layer->Name);
- gui->edit_attributes(buf, &(layer->Attributes));
+ pcb_gui->edit_attributes(buf, &(layer->Attributes));
free(buf);
return 0;
}
@@ -153,44 +147,44 @@ static int ActionAttributes(int argc, const char **argv, Coord x, Coord y)
case F_Element:
{
int n_found = 0;
- ElementType *e = NULL;
- ELEMENT_LOOP(PCB->Data);
+ pcb_element_t *e = NULL;
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, element)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) {
e = element;
n_found++;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (n_found > 1) {
- Message(PCB_MSG_DEFAULT, _("Too many elements selected\n"));
+ pcb_message(PCB_MSG_ERROR, _("Too many elements selected\n"));
return 1;
}
if (n_found == 0) {
void *ptrtmp;
- gui->get_coords(_("Click on an element"), &x, &y);
- if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE)
- e = (ElementTypePtr) ptrtmp;
+ pcb_gui->get_coords(_("Click on an element"), &x, &y);
+ if ((pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE)
+ e = (pcb_element_t *) ptrtmp;
else {
- Message(PCB_MSG_DEFAULT, _("No element found there\n"));
+ pcb_message(PCB_MSG_ERROR, _("No element found there\n"));
return 1;
}
}
- if (NAMEONPCB_NAME(e)) {
- buf = (char *) malloc(strlen(NAMEONPCB_NAME(e)) + strlen("Element X Attributes"));
- sprintf(buf, "Element %s Attributes", NAMEONPCB_NAME(e));
+ if (PCB_ELEM_NAME_REFDES(e)) {
+ buf = (char *) malloc(strlen(PCB_ELEM_NAME_REFDES(e)) + strlen("Element X Attributes"));
+ sprintf(buf, "Element %s Attributes", PCB_ELEM_NAME_REFDES(e));
}
else {
buf = pcb_strdup("Unnamed Element Attributes");
}
- gui->edit_attributes(buf, &(e->Attributes));
+ pcb_gui->edit_attributes(buf, &(e->Attributes));
free(buf);
break;
}
default:
- AFAIL(attributes);
+ PCB_ACT_FAIL(Attributes);
}
return 0;
@@ -198,9 +192,9 @@ static int ActionAttributes(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char disperseelements_syntax[] = "DisperseElements(All|Selected)";
+static const char pcb_acts_DisperseElements[] = "DisperseElements(All|Selected)";
-static const char disperseelements_help[] = "Disperses elements.";
+static const char pcb_acth_DisperseElements[] = "Disperses elements.";
/* %start-doc actions DisperseElements
@@ -214,17 +208,17 @@ from.
#define GAP PCB_MIL_TO_COORD(100)
-static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DisperseElements(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- Coord minx = GAP, miny = GAP, maxy = GAP, dx, dy;
+ const char *function = PCB_ACTION_ARG(0);
+ pcb_coord_t minx = GAP, miny = GAP, maxy = GAP, dx, dy;
int all = 0, bad = 0;
if (!function || !*function) {
bad = 1;
}
else {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_All:
all = 1;
break;
@@ -239,11 +233,11 @@ static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y)
}
if (bad) {
- AFAIL(disperseelements);
+ PCB_ACT_FAIL(DisperseElements);
}
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/*
* If we want to disperse selected elements, maybe we need smarter
@@ -252,7 +246,7 @@ static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y)
* going to be used either with a brand new design or a scratch
* design holding some new components
*/
- if (!TEST_FLAG(PCB_FLAG_LOCK, element) && (all || TEST_FLAG(PCB_FLAG_SELECTED, element))) {
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, element) && (all || PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))) {
/* figure out how much to move the element */
dx = minx - element->BoundingBox.X1;
@@ -283,10 +277,10 @@ static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y)
dy += PCB->Grid;
/* move the element */
- MoveElementLowLevel(PCB->Data, element, dx, dy);
+ pcb_element_move(PCB->Data, element, dx, dy);
/* and add to the undo list so we can undo this operation */
- AddObjectToMoveUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
/* keep track of how tall this row is */
minx += element->BoundingBox.X2 - element->BoundingBox.X1 + GAP;
@@ -296,13 +290,13 @@ static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y)
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* done with our action so increment the undo # */
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
- Redraw();
- SetChangedFlag(pcb_true);
+ pcb_redraw();
+ pcb_board_set_changed_flag(pcb_true);
return 0;
}
@@ -311,9 +305,9 @@ static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y)
/* -------------------------------------------------------------------------- */
-static const char flip_syntax[] = "Flip(Object|Selected|SelectedElements)";
+static const char pcb_acts_Flip[] = "Flip(Object|Selected|SelectedElements)";
-static const char flip_help[] = "Flip an element to the opposite side of the board.";
+static const char pcb_acth_Flip[] = "Flip an element to the opposite side of the board.";
/* %start-doc actions Flip
@@ -325,26 +319,26 @@ other, not their absolute positions on the board.
%end-doc */
-static int ActionFlip(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Flip(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- ElementTypePtr element;
+ const char *function = PCB_ACTION_ARG(0);
+ pcb_element_t *element;
void *ptrtmp;
int err = 0;
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
- if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) {
- element = (ElementTypePtr) ptrtmp;
- ChangeElementSide(element, 2 * Crosshair.Y - PCB->MaxHeight);
- IncrementUndoSerialNumber();
- Draw();
+ if ((pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) {
+ element = (pcb_element_t *) ptrtmp;
+ pcb_element_change_side(element, 2 * pcb_crosshair.Y - PCB->MaxHeight);
+ pcb_undo_inc_serial();
+ pcb_draw();
}
break;
case F_Selected:
case F_SelectedElements:
- ChangeSelectedElementSide();
+ pcb_selected_element_change_side();
break;
default:
err = 1;
@@ -354,13 +348,13 @@ static int ActionFlip(int argc, const char **argv, Coord x, Coord y)
return 0;
}
- AFAIL(flip);
+ PCB_ACT_FAIL(Flip);
}
/* --------------------------------------------------------------------------- */
-static const char moveobject_syntax[] = "MoveObject(X,Y,dim)";
+static const char pcb_acts_MoveObject[] = "pcb_move_obj(X,Y,dim)";
-static const char moveobject_help[] = "Moves the object under the crosshair.";
+static const char pcb_acth_MoveObject[] = "Moves the object under the crosshair.";
/* %start-doc actions MoveObject
@@ -372,43 +366,43 @@ units, currently 1/100 mil.
%end-doc */
-static int ActionMoveObject(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_MoveObject(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *x_str = ACTION_ARG(0);
- const char *y_str = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
- Coord nx, ny;
+ const char *x_str = PCB_ACTION_ARG(0);
+ const char *y_str = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
+ pcb_coord_t nx, ny;
pcb_bool absolute1, absolute2;
void *ptr1, *ptr2, *ptr3;
int type;
- ny = GetValue(y_str, units, &absolute1, NULL);
- nx = GetValue(x_str, units, &absolute2, NULL);
+ ny = pcb_get_value(y_str, units, &absolute1, NULL);
+ nx = pcb_get_value(x_str, units, &absolute2, NULL);
- type = SearchScreen(x, y, MOVE_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(x, y, PCB_MOVE_TYPES, &ptr1, &ptr2, &ptr3);
if (type == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, _("Nothing found under crosshair\n"));
+ pcb_message(PCB_MSG_ERROR, _("Nothing found under crosshair\n"));
return 1;
}
if (absolute1)
nx -= x;
if (absolute2)
ny -= y;
- Crosshair.AttachedObject.RubberbandN = 0;
+ pcb_event(PCB_EVENT_RUBBER_RESET, NULL);
if (conf_core.editor.rubber_band_mode)
- LookupRubberbandLines(type, ptr1, ptr2, ptr3);
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_LINES, "ippp", type, ptr1, ptr2, ptr3);
if (type == PCB_TYPE_ELEMENT)
- LookupRatLines(type, ptr1, ptr2, ptr3);
- MoveObjectAndRubberband(type, ptr1, ptr2, ptr3, nx, ny);
- SetChangedFlag(pcb_true);
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_RATS, "ippp", type, ptr1, ptr2, ptr3);
+ pcb_move_obj_and_rubberband(type, ptr1, ptr2, ptr3, nx, ny);
+ pcb_board_set_changed_flag(pcb_true);
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char movetocurrentlayer_syntax[] = "MoveToCurrentLayer(Object|SelectedObjects)";
+static const char pcb_acts_MoveToCurrentLayer[] = "MoveToCurrentLayer(Object|SelectedObjects)";
-static const char movetocurrentlayer_help[] = "Moves objects to the current layer.";
+static const char pcb_acth_MoveToCurrentLayer[] = "Moves objects to the current layer.";
/* %start-doc actions MoveToCurrentLayer
@@ -418,27 +412,27 @@ or from solder to component, won't automatically flip it. Use the
%end-doc */
-static int ActionMoveToCurrentLayer(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_MoveToCurrentLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, MOVETOLAYER_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
- if (MoveObjectToLayer(type, ptr1, ptr2, ptr3, CURRENT, pcb_false))
- SetChangedFlag(pcb_true);
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_MOVETOLAYER_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE)
+ if (pcb_move_obj_to_layer(type, ptr1, ptr2, ptr3, CURRENT, pcb_false))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
case F_SelectedObjects:
case F_Selected:
- if (MoveSelectedObjectsToLayer(CURRENT))
- SetChangedFlag(pcb_true);
+ if (pcb_move_selected_objs_to_layer(CURRENT))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -446,9 +440,9 @@ static int ActionMoveToCurrentLayer(int argc, const char **argv, Coord x, Coord
}
/* ---------------------------------------------------------------- */
-static const char elementlist_syntax[] = "ElementList(Start|Done|Need,<refdes>,<footprint>,<value>)";
+static const char pcb_acts_ElementList[] = "ElementList(Start|Done|Need,<refdes>,<footprint>,<value>)";
-static const char elementlist_help[] = "Adds the given element if it doesn't already exist.";
+static const char pcb_acth_ElementList[] = "Adds the given element if it doesn't already exist.";
/* %start-doc actions elementlist
@@ -479,64 +473,64 @@ static int number_of_footprints_not_found;
static int parse_layout_attribute_units(const char *name, int def)
{
- const char *as = AttributeGet(PCB, name);
+ const char *as = pcb_attrib_get(PCB, name);
if (!as)
return def;
- return GetValue(as, NULL, NULL, NULL);
+ return pcb_get_value(as, NULL, NULL, NULL);
}
-static int ActionElementList(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ElementList(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- ElementType *e = NULL;
+ pcb_element_t *e = NULL;
const char *refdes, *value, *footprint;
const char *args[3];
const char *function = argv[0];
char *old;
#ifdef DEBUG
- printf("Entered ActionElementList, executing function %s\n", function);
+ printf("Entered pcb_act_ElementList, executing function %s\n", function);
#endif
- if (strcasecmp(function, "start") == 0) {
- ELEMENT_LOOP(PCB->Data);
+ if (pcb_strcasecmp(function, "start") == 0) {
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- CLEAR_FLAG(PCB_FLAG_FOUND, element);
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, element);
}
- END_LOOP;
+ PCB_END_LOOP;
element_cache = NULL;
number_of_footprints_not_found = 0;
return 0;
}
- if (strcasecmp(function, "done") == 0) {
- ELEMENT_LOOP(PCB->Data);
+ if (pcb_strcasecmp(function, "done") == 0) {
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, element)) {
- CLEAR_FLAG(PCB_FLAG_FOUND, element);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, element)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_FOUND, element);
}
- else if (!EMPTY_STRING_P(NAMEONPCB_NAME(element))) {
+ else if (!PCB_EMPTY_STRING_P(PCB_ELEM_NAME_REFDES(element))) {
/* Unnamed elements should remain untouched */
- SET_FLAG(PCB_FLAG_SELECTED, element);
+ PCB_FLAG_SET(PCB_FLAG_SELECTED, element);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (number_of_footprints_not_found > 0)
- gui->confirm_dialog("Not all requested footprints were found.\n" "See the message log for details", "Ok", NULL);
+ pcb_gui->confirm_dialog("Not all requested footprints were found.\n" "See the message log for details", "Ok", NULL);
return 0;
}
- if (strcasecmp(function, "need") != 0)
- AFAIL(elementlist);
+ if (pcb_strcasecmp(function, "need") != 0)
+ PCB_ACT_FAIL(ElementList);
if (argc != 4)
- AFAIL(elementlist);
+ PCB_ACT_FAIL(ElementList);
argc--;
argv++;
- refdes = ACTION_ARG(0);
- footprint = ACTION_ARG(1);
- value = ACTION_ARG(2);
+ refdes = PCB_ACTION_ARG(0);
+ footprint = PCB_ACTION_ARG(1);
+ value = PCB_ACTION_ARG(2);
args[0] = footprint;
args[1] = refdes;
@@ -551,13 +545,13 @@ static int ActionElementList(int argc, const char **argv, Coord x, Coord y)
e = find_element_by_refdes(refdes);
if (!e) {
- Coord nx, ny, d;
+ pcb_coord_t nx, ny, d;
#ifdef DEBUG
printf(" ... Footprint not on board, need to add it.\n");
#endif
/* Not on board, need to add it. */
- if (LoadFootprint(argc, args, x, y)) {
+ if (pcb_act_LoadFootprint(argc, args, x, y)) {
number_of_footprints_not_found++;
return 1;
}
@@ -585,73 +579,73 @@ static int ActionElementList(int argc, const char **argv, Coord x, Coord y)
ny = PCB->MaxHeight - 1;
/* Place components onto center of board. */
- if (CopyPastebufferToLayout(nx, ny))
- SetChangedFlag(pcb_true);
+ if (pcb_buffer_copy_to_layout(nx, ny))
+ pcb_board_set_changed_flag(pcb_true);
}
- else if (e && strcmp(DESCRIPTION_NAME(e), footprint) != 0) {
+ else if (e && strcmp(PCB_ELEM_NAME_DESCRIPTION(e), footprint) != 0) {
#ifdef DEBUG
printf(" ... Footprint on board, but different from footprint loaded.\n");
#endif
int er, pr, i;
- Coord mx, my;
- ElementType *pe;
+ pcb_coord_t mx, my;
+ pcb_element_t *pe;
/* Different footprint, we need to swap them out. */
- if (LoadFootprint(argc, args, x, y)) {
+ if (pcb_act_LoadFootprint(argc, args, x, y)) {
number_of_footprints_not_found++;
return 1;
}
- er = ElementOrientation(e);
- pe = elementlist_first(&(PASTEBUFFER->Data->Element));
- if (!FRONT(e))
- MirrorElementCoordinates(PASTEBUFFER->Data, pe, pe->MarkY * 2 - PCB->MaxHeight);
- pr = ElementOrientation(pe);
+ er = pcb_element_get_orientation(e);
+ pe = elementlist_first(&(PCB_PASTEBUFFER->Data->Element));
+ if (!PCB_FRONT(e))
+ pcb_element_mirror(PCB_PASTEBUFFER->Data, pe, pe->MarkY * 2 - PCB->MaxHeight);
+ pr = pcb_element_get_orientation(pe);
mx = e->MarkX;
my = e->MarkY;
if (er != pr)
- RotateElementLowLevel(PASTEBUFFER->Data, pe, pe->MarkX, pe->MarkY, (er - pr + 4) % 4);
+ pcb_element_rotate90(PCB_PASTEBUFFER->Data, pe, pe->MarkX, pe->MarkY, (er - pr + 4) % 4);
- for (i = 0; i < MAX_ELEMENTNAMES; i++) {
+ for (i = 0; i < PCB_MAX_ELEMENTNAMES; i++) {
pe->Name[i].X = e->Name[i].X - mx + pe->MarkX;
pe->Name[i].Y = e->Name[i].Y - my + pe->MarkY;
pe->Name[i].Direction = e->Name[i].Direction;
pe->Name[i].Scale = e->Name[i].Scale;
}
- RemoveElement(e);
+ pcb_element_remove(e);
- if (CopyPastebufferToLayout(mx, my))
- SetChangedFlag(pcb_true);
+ if (pcb_buffer_copy_to_layout(mx, my))
+ pcb_board_set_changed_flag(pcb_true);
}
/* Now reload footprint */
element_cache = NULL;
e = find_element_by_refdes(refdes);
- old = ChangeElementText(PCB, PCB->Data, e, NAMEONPCB_INDEX, pcb_strdup(refdes));
+ old = pcb_element_text_change(PCB, PCB->Data, e, PCB_ELEMNAME_IDX_REFDES, pcb_strdup(refdes));
if (old)
free(old);
- old = ChangeElementText(PCB, PCB->Data, e, VALUE_INDEX, pcb_strdup(value));
+ old = pcb_element_text_change(PCB, PCB->Data, e, PCB_ELEMNAME_IDX_VALUE, pcb_strdup(value));
if (old)
free(old);
- SET_FLAG(PCB_FLAG_FOUND, e);
+ PCB_FLAG_SET(PCB_FLAG_FOUND, e);
#ifdef DEBUG
- printf(" ... Leaving ActionElementList.\n");
+ printf(" ... Leaving pcb_act_ElementList.\n");
#endif
return 0;
}
/* ---------------------------------------------------------------- */
-static const char elementsetattr_syntax[] = "ElementSetAttr(refdes,name[,value])";
+static const char pcb_acts_ElementSetAttr[] = "ElementSetAttr(refdes,name[,value])";
-static const char elementsetattr_help[] = "Sets or clears an element-specific attribute.";
+static const char pcb_acth_ElementSetAttr[] = "Sets or clears an element-specific attribute.";
/* %start-doc actions elementsetattr
@@ -661,31 +655,31 @@ not specified, the given attribute is removed if present.
%end-doc */
-static int ActionElementSetAttr(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ElementSetAttr(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- ElementType *e = NULL;
+ pcb_element_t *e = NULL;
const char *refdes, *name, *value;
- AttributeType *attr;
+ pcb_attribute_t *attr;
if (argc < 2) {
- AFAIL(elementsetattr);
+ PCB_ACT_FAIL(ElementSetAttr);
}
refdes = argv[0];
name = argv[1];
- value = ACTION_ARG(2);
+ value = PCB_ACTION_ARG(2);
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (NSTRCMP(refdes, NAMEONPCB_NAME(element)) == 0) {
+ if (PCB_NSTRCMP(refdes, PCB_ELEM_NAME_REFDES(element)) == 0) {
e = element;
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (!e) {
- Message(PCB_MSG_DEFAULT, _("Cannot change attribute of %s - element not found\n"), refdes);
+ pcb_message(PCB_MSG_ERROR, _("Cannot change attribute of %s - element not found\n"), refdes);
return 1;
}
@@ -699,7 +693,7 @@ static int ActionElementSetAttr(int argc, const char **argv, Coord x, Coord y)
delete_attr(&e->Attributes, attr);
}
if (!attr && value) {
- CreateNewAttribute(&e->Attributes, name, value);
+ pcb_attribute_put(&e->Attributes, name, value, 0);
}
return 0;
@@ -707,9 +701,9 @@ static int ActionElementSetAttr(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char ripup_syntax[] = "RipUp(All|Selected|Element)";
+static const char pcb_acts_RipUp[] = "RipUp(All|Selected|Element)";
-static const char ripup_help[] = "Ripup auto-routed tracks, or convert an element to parts.";
+static const char pcb_acth_RipUp[] = "Ripup auto-routed tracks, or convert an element to parts.";
/* %start-doc actions RipUp
@@ -730,88 +724,88 @@ that this uses the highest numbered paste buffer.
%end-doc */
-static int ActionRipUp(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_RipUp(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
pcb_bool changed = pcb_false;
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_All:
- ALLLINE_LOOP(PCB->Data);
+ PCB_LINE_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_AUTO, line) && !TEST_FLAG(PCB_FLAG_LOCK, line)) {
- RemoveObject(PCB_TYPE_LINE, layer, line, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_AUTO, line) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line)) {
+ pcb_remove_object(PCB_TYPE_LINE, layer, line, line);
changed = pcb_true;
}
}
- ENDALL_LOOP;
- ALLARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_AUTO, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc)) {
- RemoveObject(PCB_TYPE_ARC, layer, arc, arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_AUTO, arc) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, arc)) {
+ pcb_remove_object(PCB_TYPE_ARC, layer, arc, arc);
changed = pcb_true;
}
}
- ENDALL_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_AUTO, via) && !TEST_FLAG(PCB_FLAG_LOCK, via)) {
- RemoveObject(PCB_TYPE_VIA, via, via, via);
+ if (PCB_FLAG_TEST(PCB_FLAG_AUTO, via) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, via)) {
+ pcb_remove_object(PCB_TYPE_VIA, via, via, via);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (changed) {
- IncrementUndoSerialNumber();
- SetChangedFlag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_board_set_changed_flag(pcb_true);
}
break;
case F_Selected:
- VISIBLELINE_LOOP(PCB->Data);
+ PCB_LINE_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAGS(PCB_FLAG_AUTO | PCB_FLAG_SELECTED, line)
- && !TEST_FLAG(PCB_FLAG_LOCK, line)) {
- RemoveObject(PCB_TYPE_LINE, layer, line, line);
+ if (PCB_FLAGS_TEST(PCB_FLAG_AUTO | PCB_FLAG_SELECTED, line)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line)) {
+ pcb_remove_object(PCB_TYPE_LINE, layer, line, line);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->ViaOn)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAGS(PCB_FLAG_AUTO | PCB_FLAG_SELECTED, via)
- && !TEST_FLAG(PCB_FLAG_LOCK, via)) {
- RemoveObject(PCB_TYPE_VIA, via, via, via);
+ if (PCB_FLAGS_TEST(PCB_FLAG_AUTO | PCB_FLAG_SELECTED, via)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, via)) {
+ pcb_remove_object(PCB_TYPE_VIA, via, via, via);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (changed) {
- IncrementUndoSerialNumber();
- SetChangedFlag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_board_set_changed_flag(pcb_true);
}
break;
case F_Element:
{
void *ptr1, *ptr2, *ptr3;
- if (SearchScreen(Crosshair.X, Crosshair.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3) != PCB_TYPE_NONE) {
+ if (pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3) != PCB_TYPE_NONE) {
Note.Buffer = conf_core.editor.buffer_number;
- SetBufferNumber(MAX_BUFFER - 1);
- ClearBuffer(PASTEBUFFER);
- CopyObjectToBuffer(PASTEBUFFER->Data, PCB->Data, PCB_TYPE_ELEMENT, ptr1, ptr2, ptr3);
- SmashBufferElement(PASTEBUFFER);
- PASTEBUFFER->X = 0;
- PASTEBUFFER->Y = 0;
- SaveUndoSerialNumber();
- EraseObject(PCB_TYPE_ELEMENT, ptr1, ptr1);
- MoveObjectToRemoveUndoList(PCB_TYPE_ELEMENT, ptr1, ptr2, ptr3);
- RestoreUndoSerialNumber();
- CopyPastebufferToLayout(0, 0);
- SetBufferNumber(Note.Buffer);
- SetChangedFlag(pcb_true);
+ pcb_buffer_set_number(PCB_MAX_BUFFER - 1);
+ pcb_buffer_clear(PCB_PASTEBUFFER);
+ pcb_copy_obj_to_buffer(PCB_PASTEBUFFER->Data, PCB->Data, PCB_TYPE_ELEMENT, ptr1, ptr2, ptr3);
+ pcb_element_smash_buffer(PCB_PASTEBUFFER);
+ PCB_PASTEBUFFER->X = 0;
+ PCB_PASTEBUFFER->Y = 0;
+ pcb_undo_save_serial();
+ pcb_erase_obj(PCB_TYPE_ELEMENT, ptr1, ptr1);
+ pcb_undo_move_obj_to_remove(PCB_TYPE_ELEMENT, ptr1, ptr2, ptr3);
+ pcb_undo_restore_serial();
+ pcb_buffer_copy_to_layout(0, 0);
+ pcb_buffer_set_number(Note.Buffer);
+ pcb_board_set_changed_flag(pcb_true);
}
}
break;
@@ -822,9 +816,9 @@ static int ActionRipUp(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char minmaskgap_syntax[] = "MinMaskGap(delta)\n" "MinMaskGap(Selected, delta)";
+static const char pcb_acts_MinMaskGap[] = "MinMaskGap(delta)\n" "MinMaskGap(Selected, delta)";
-static const char minmaskgap_help[] = "Ensures the mask is a minimum distance from pins and pads.";
+static const char pcb_acth_MinMaskGap[] = "Ensures the mask is a minimum distance from pins and pads.";
/* %start-doc actions MinMaskGap
@@ -834,71 +828,71 @@ the mask edge.
%end-doc */
-static int ActionMinMaskGap(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_MinMaskGap(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *delta = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *delta = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
pcb_bool absolute;
- Coord value;
+ pcb_coord_t value;
int flags;
if (!function)
return 1;
- if (strcasecmp(function, "Selected") == 0)
+ if (pcb_strcasecmp(function, "Selected") == 0)
flags = PCB_FLAG_SELECTED;
else {
units = delta;
delta = function;
flags = 0;
}
- value = 2 * GetValue(delta, units, &absolute, NULL);
+ value = 2 * pcb_get_value(delta, units, &absolute, NULL);
- SaveUndoSerialNumber();
- ELEMENT_LOOP(PCB->Data);
+ pcb_undo_save_serial();
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (!TEST_FLAGS(flags, pin))
+ if (!PCB_FLAGS_TEST(flags, pin))
continue;
if (pin->Mask < pin->Thickness + value) {
- ChangeObjectMaskSize(PCB_TYPE_PIN, element, pin, 0, pin->Thickness + value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_mask_size(PCB_TYPE_PIN, element, pin, 0, pin->Thickness + value, 1);
+ pcb_undo_restore_serial();
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (!TEST_FLAGS(flags, pad))
+ if (!PCB_FLAGS_TEST(flags, pad))
continue;
if (pad->Mask < pad->Thickness + value) {
- ChangeObjectMaskSize(PCB_TYPE_PAD, element, pad, 0, pad->Thickness + value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_mask_size(PCB_TYPE_PAD, element, pad, 0, pad->Thickness + value, 1);
+ pcb_undo_restore_serial();
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
- if (!TEST_FLAGS(flags, via))
+ if (!PCB_FLAGS_TEST(flags, via))
continue;
if (via->Mask && via->Mask < via->Thickness + value) {
- ChangeObjectMaskSize(PCB_TYPE_VIA, via, 0, 0, via->Thickness + value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_mask_size(PCB_TYPE_VIA, via, 0, 0, via->Thickness + value, 1);
+ pcb_undo_restore_serial();
}
}
- END_LOOP;
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
+ PCB_END_LOOP;
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char mincleargap_syntax[] = "MinClearGap(delta)\n" "MinClearGap(Selected, delta)";
+static const char pcb_acts_MinClearGap[] = "MinClearGap(delta)\n" "MinClearGap(Selected, delta)";
-static const char mincleargap_help[] = "Ensures that polygons are a minimum distance from objects.";
+static const char pcb_acth_MinClearGap[] = "Ensures that polygons are a minimum distance from objects.";
/* %start-doc actions MinClearGap
@@ -908,117 +902,237 @@ polygon edges.
%end-doc */
-static int ActionMinClearGap(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_MinClearGap(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- const char *delta = ACTION_ARG(1);
- const char *units = ACTION_ARG(2);
+ const char *function = PCB_ACTION_ARG(0);
+ const char *delta = PCB_ACTION_ARG(1);
+ const char *units = PCB_ACTION_ARG(2);
pcb_bool absolute;
- Coord value;
+ pcb_coord_t value;
int flags;
if (!function)
return 1;
- if (strcasecmp(function, "Selected") == 0)
+ if (pcb_strcasecmp(function, "Selected") == 0)
flags = PCB_FLAG_SELECTED;
else {
units = delta;
delta = function;
flags = 0;
}
- value = 2 * GetValue(delta, units, &absolute, NULL);
+ value = 2 * pcb_get_value(delta, units, &absolute, NULL);
- SaveUndoSerialNumber();
- ELEMENT_LOOP(PCB->Data);
+ pcb_undo_save_serial();
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (!TEST_FLAGS(flags, pin))
+ if (!PCB_FLAGS_TEST(flags, pin))
continue;
if (pin->Clearance < value) {
- ChangeObjectClearSize(PCB_TYPE_PIN, element, pin, 0, value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_clear_size(PCB_TYPE_PIN, element, pin, 0, value, 1);
+ pcb_undo_restore_serial();
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (!TEST_FLAGS(flags, pad))
+ if (!PCB_FLAGS_TEST(flags, pad))
continue;
if (pad->Clearance < value) {
- ChangeObjectClearSize(PCB_TYPE_PAD, element, pad, 0, value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_clear_size(PCB_TYPE_PAD, element, pad, 0, value, 1);
+ pcb_undo_restore_serial();
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
- if (!TEST_FLAGS(flags, via))
+ if (!PCB_FLAGS_TEST(flags, via))
continue;
if (via->Clearance < value) {
- ChangeObjectClearSize(PCB_TYPE_VIA, via, 0, 0, value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_clear_size(PCB_TYPE_VIA, via, 0, 0, value, 1);
+ pcb_undo_restore_serial();
}
}
- END_LOOP;
- ALLLINE_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_LINE_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAGS(flags, line))
+ if (!PCB_FLAGS_TEST(flags, line))
continue;
if (line->Clearance < value) {
- ChangeObjectClearSize(PCB_TYPE_LINE, layer, line, 0, value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_clear_size(PCB_TYPE_LINE, layer, line, 0, value, 1);
+ pcb_undo_restore_serial();
}
}
- ENDALL_LOOP;
- ALLARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAGS(flags, arc))
+ if (!PCB_FLAGS_TEST(flags, arc))
continue;
if (arc->Clearance < value) {
- ChangeObjectClearSize(PCB_TYPE_ARC, layer, arc, 0, value, 1);
- RestoreUndoSerialNumber();
+ pcb_chg_obj_clear_size(PCB_TYPE_ARC, layer, arc, 0, value, 1);
+ pcb_undo_restore_serial();
}
}
- ENDALL_LOOP;
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
+ PCB_ENDALL_LOOP;
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
+ return 0;
+}
+
+/* --------------------------------------------------------------------------- */
+int pcb_act_ListRotations(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ PCB_ELEMENT_LOOP(PCB->Data);
+ {
+ printf("%d %s\n", pcb_element_get_orientation(element), PCB_ELEM_NAME_REFDES(element));
+ }
+ PCB_END_LOOP;
+
return 0;
}
-HID_Action object_action_list[] = {
- {"Attributes", 0, ActionAttributes,
- attributes_help, attributes_syntax}
+/* --------------------------------------------------------------------------- */
+
+static const char movelayer_syntax[] = "MoveLayer(old,new)";
+
+static const char movelayer_help[] = "Moves/Creates/Deletes Layers.";
+
+/* %start-doc actions MoveLayer
+
+Moves a layer, creates a new layer, or deletes a layer.
+
+ at table @code
+
+ at item old
+The is the layer number to act upon. Allowed values are:
+ at table @code
+
+ at item c
+Currently selected layer.
+
+ at item -1
+Create a new layer.
+
+ at item number
+An existing layer number.
+
+ at end table
+
+ at item new
+Specifies where to move the layer to. Allowed values are:
+ at table @code
+ at item -1
+Deletes the layer.
+
+ at item up
+Moves the layer up.
+
+ at item down
+Moves the layer down.
+
+ at item c
+Creates a new layer.
+
+ at end table
+
+ at end table
+
+%end-doc */
+
+int pcb_act_MoveLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ int old_index, new_index;
+ int new_top = -1;
+
+ if (argc != 2) {
+ pcb_message(PCB_MSG_ERROR, "Usage; MoveLayer(old,new)");
+ return 1;
+ }
+
+ if (strcmp(argv[0], "c") == 0)
+ old_index = INDEXOFCURRENT;
+ else
+ old_index = atoi(argv[0]);
+
+ if (strcmp(argv[1], "c") == 0) {
+ new_index = INDEXOFCURRENT;
+ if (new_index < 0)
+ new_index = 0;
+ }
+ else if (strcmp(argv[1], "up") == 0) {
+ new_index = INDEXOFCURRENT - 1;
+ if (new_index < 0)
+ return 1;
+ new_top = new_index;
+ }
+ else if (strcmp(argv[1], "down") == 0) {
+ new_index = INDEXOFCURRENT + 1;
+ if (new_index >= pcb_max_copper_layer)
+ return 1;
+ new_top = new_index;
+ }
+ else
+ new_index = atoi(argv[1]);
+
+ if (pcb_layer_move(old_index, new_index))
+ return 1;
+
+ if (new_index == -1) {
+ new_top = old_index;
+ if (new_top >= pcb_max_copper_layer)
+ new_top--;
+ new_index = new_top;
+ }
+ if (old_index == -1)
+ new_top = new_index;
+
+ if (new_top != -1)
+ pcb_layervis_change_group_vis(new_index, 1, 1);
+
+ return 0;
+}
+
+
+pcb_hid_action_t object_action_list[] = {
+ {"Attributes", 0, pcb_act_Attributes,
+ pcb_acth_Attributes, pcb_acts_Attributes}
+ ,
+ {"DisperseElements", 0, pcb_act_DisperseElements,
+ pcb_acth_DisperseElements, pcb_acts_DisperseElements}
+ ,
+ {"Flip", N_("Click on Object or Flip Point"), pcb_act_Flip,
+ pcb_acth_Flip, pcb_acts_Flip}
,
- {"DisperseElements", 0, ActionDisperseElements,
- disperseelements_help, disperseelements_syntax}
+ {"ListRotations", 0, pcb_act_ListRotations,
+ 0, 0}
,
- {"Flip", N_("Click on Object or Flip Point"), ActionFlip,
- flip_help, flip_syntax}
+ {"MoveObject", N_("Select an Object"), pcb_act_MoveObject,
+ pcb_acth_MoveObject, pcb_acts_MoveObject}
,
- {"MoveObject", N_("Select an Object"), ActionMoveObject,
- moveobject_help, moveobject_syntax}
+ {"MoveToCurrentLayer", 0, pcb_act_MoveToCurrentLayer,
+ pcb_acth_MoveToCurrentLayer, pcb_acts_MoveToCurrentLayer}
,
- {"MoveToCurrentLayer", 0, ActionMoveToCurrentLayer,
- movetocurrentlayer_help, movetocurrentlayer_syntax}
+ {"ElementList", 0, pcb_act_ElementList,
+ pcb_acth_ElementList, pcb_acts_ElementList}
,
- {"ElementList", 0, ActionElementList,
- elementlist_help, elementlist_syntax}
+ {"ElementSetAttr", 0, pcb_act_ElementSetAttr,
+ pcb_acth_ElementSetAttr, pcb_acts_ElementSetAttr}
,
- {"ElementSetAttr", 0, ActionElementSetAttr,
- elementsetattr_help, elementsetattr_syntax}
+ {"RipUp", 0, pcb_act_RipUp,
+ pcb_acth_RipUp, pcb_acts_RipUp}
,
- {"RipUp", 0, ActionRipUp,
- ripup_help, ripup_syntax}
+ {"MinMaskGap", 0, pcb_act_MinMaskGap,
+ pcb_acth_MinMaskGap, pcb_acts_MinMaskGap}
,
- {"MinMaskGap", 0, ActionMinMaskGap,
- minmaskgap_help, minmaskgap_syntax}
+ {"MinClearGap", 0, pcb_act_MinClearGap,
+ pcb_acth_MinClearGap, pcb_acts_MinClearGap}
,
- {"MinClearGap", 0, ActionMinClearGap,
- mincleargap_help, mincleargap_syntax}
+ {"MoveLayer", 0, pcb_act_MoveLayer,
+ movelayer_help, movelayer_syntax}
};
-REGISTER_ACTIONS(object_action_list, NULL)
+PCB_REGISTER_ACTIONS(object_action_list, NULL)
diff --git a/src/operation.h b/src/operation.h
new file mode 100644
index 0000000..11a4d8e
--- /dev/null
+++ b/src/operation.h
@@ -0,0 +1,128 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
+ * 15 Oct 2008 Ineiev: add different crosshair shapes
+ *
+ * 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 addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+
+#ifndef PCB_OPERATION_H
+#define PCB_OPERATION_H
+
+#include "global_typedefs.h"
+
+/* Each object operation gets an operation-context with some operation-specific
+ configuration, and the board to operate on. Optionally this is the place to
+ hold temporary states of a multi-call operation too. */
+
+typedef struct {
+ pcb_board_t *pcb;
+ int extraflg;
+ pcb_data_t *dst, *src;
+} pcb_opctx_buffer_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ int is_primary; /* whether the primary parameter should be changed */
+ pcb_coord_t delta; /* change of size */
+ pcb_coord_t absolute; /* Absolute size */
+} pcb_opctx_chgsize_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ int is_primary; /* whether the primary parameter should be changed */
+ pcb_angle_t delta, absolute; /* same as above, but for angles */
+} pcb_opctx_chgangle_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ char *new_name;
+} pcb_opctx_chgname_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ int style;
+} pcb_opctx_chgtherm_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ pcb_coord_t DeltaX, DeltaY; /* movement vector */
+} pcb_opctx_copy_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ pcb_coord_t x, y;
+ pcb_cardinal_t idx; /* poly point idx */
+ pcb_bool last;
+ pcb_bool forcible;
+} pcb_opctx_insert_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ pcb_coord_t dx, dy; /* used by local routines as offset */
+ pcb_layer_t *dst_layer;
+ pcb_bool more_to_come;
+} pcb_opctx_move_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ pcb_data_t *destroy_target;
+ pcb_bool bulk; /* don't draw if part of a bulk operation */
+} pcb_opctx_remove_t;
+
+typedef struct {
+ pcb_board_t *pcb;
+ pcb_coord_t center_x, center_y; /* center of rotation */
+ unsigned number; /* number of rotations */
+} pcb_opctx_rotate_t;
+
+typedef union {
+ pcb_opctx_buffer_t buffer;
+ pcb_opctx_chgname_t chgname;
+ pcb_opctx_chgsize_t chgsize;
+ pcb_opctx_chgangle_t chgangle;
+ pcb_opctx_chgtherm_t chgtherm;
+ pcb_opctx_copy_t copy;
+ pcb_opctx_insert_t insert;
+ pcb_opctx_move_t move;
+ pcb_opctx_remove_t remove;
+ pcb_opctx_rotate_t rotate;
+} pcb_opctx_t;
+
+/* pointer to low-level operation (copy, move and rotate) functions */
+typedef struct {
+ void *(*Line)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_line_t *);
+ void *(*Text)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_text_t *);
+ void *(*Polygon)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_polygon_t *);
+ void *(*Via)(pcb_opctx_t *ctx, pcb_pin_t *);
+ void *(*Element)(pcb_opctx_t *ctx, pcb_element_t *);
+ void *(*ElementName)(pcb_opctx_t *ctx, pcb_element_t *);
+ void *(*Pin)(pcb_opctx_t *ctx, pcb_element_t *, pcb_pin_t *);
+ void *(*Pad)(pcb_opctx_t *ctx, pcb_element_t *, pcb_pad_t *);
+ void *(*LinePoint)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_line_t *, pcb_point_t *);
+ void *(*Point)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_polygon_t *, pcb_point_t *);
+ void *(*Arc)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_arc_t *);
+ void *(*Rat)(pcb_opctx_t *ctx, pcb_rat_t *);
+ void *(*ArcPoint)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_arc_t *, int *end_id);
+} pcb_opfunc_t;
+
+#endif
diff --git a/src/paths.c b/src/paths.c
index 56044f6..8e2bc32 100644
--- a/src/paths.c
+++ b/src/paths.c
@@ -1,13 +1,44 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+/* Resolve paths, build paths using template */
+#include <time.h>
#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
#include "config.h"
#include "paths.h"
#include "error.h"
-#include "conf.h"
#include "conf_core.h"
-void resolve_paths(const char **in, char **out, int numpaths, unsigned int extra_room)
+/* don't include board.h or compat_misc.h because of gsch2pcb-rnd */
+const char *pcb_board_get_filename(void);
+const char *pcb_board_get_name(void);
+int pcb_getpid(void);
+
+
+void pcb_paths_resolve(const char **in, char **out, int numpaths, unsigned int extra_room)
{
const char *subst_to;
int subst_offs;
@@ -16,13 +47,13 @@ void resolve_paths(const char **in, char **out, int numpaths, unsigned int extra
if (**in == '~') {
int l1, l2;
if (conf_core.rc.path.home == NULL) {
- Message(PCB_MSG_DEFAULT, "can't resolve home dir required for path %s\n", *in);
+ pcb_message(PCB_MSG_ERROR, "can't resolve home dir required for path %s\n", *in);
exit(1);
}
subst_to = conf_core.rc.path.home;
subst_offs = 1;
replace:;
- /* avoid Concat() here to reduce dependencies for external tools */
+ /* avoid pcb_concat() here to reduce dependencies for external tools */
l1 = strlen(subst_to);
l2 = strlen((*in) + 1);
*out = malloc(l1 + l2 + 4 + extra_room);
@@ -57,7 +88,7 @@ void resolve_paths(const char **in, char **out, int numpaths, unsigned int extra
}
}
}
- Message(PCB_MSG_DEFAULT, "can't resolve conf-hash dir required for path %s\n", *in);
+ pcb_message(PCB_MSG_WARNING, "can't resolve conf-hash dir required for path %s\n", *in);
*out = NULL;
}
else
@@ -73,15 +104,98 @@ void resolve_paths(const char **in, char **out, int numpaths, unsigned int extra
}
}
-void resolve_path(const char *in, char **out, unsigned int extra_room)
+void pcb_path_resolve(const char *in, char **out, unsigned int extra_room)
{
- resolve_paths(&in, out, 1, extra_room);
+ pcb_paths_resolve(&in, out, 1, extra_room);
}
-char *resolve_path_inplace(char *in, unsigned int extra_room)
+char *pcb_path_resolve_inplace(char *in, unsigned int extra_room)
{
char *out;
- resolve_path(in, &out, extra_room);
+ pcb_path_resolve(in, &out, extra_room);
free(in);
return out;
}
+
+int pcb_build_fn_cb(void *ctx, gds_t *s, const char **input)
+{
+ char buff[20];
+ const char *name;
+
+
+
+ switch(**input) {
+ case 'P':
+ sprintf(buff, "%.8i", pcb_getpid());
+ gds_append_str(s, buff);
+ (*input)++;
+ return 0;
+ case 'F':
+ name = pcb_board_get_filename();
+ gds_append_str(s, (name != NULL) ? name : "no_file_name");
+ (*input)++;
+ return 0;
+ case 'B':
+ name = pcb_board_get_filename();
+ if (name != NULL) {
+ const char *bn = strrchr(name, '/');
+ if (bn != NULL)
+ bn++;
+ else
+ bn = name;
+ gds_append_str(s, bn);
+ }
+ else
+ gds_append_str(s, "no_file_name");
+ (*input)++;
+ return 0;
+ case 'D':
+ name = pcb_board_get_filename();
+ if (name != NULL) {
+ char *bn = strrchr(name, '/');
+ if (bn != NULL)
+ gds_append_len(s, name, bn-name+1);
+ else
+ gds_append_str(s, "./");
+ }
+ else
+ gds_append_str(s, "./");
+ (*input)++;
+ return 0;
+ case 'N':
+ name = pcb_board_get_name();
+ gds_append_str(s, (name != NULL) ? name : "no_name");
+ (*input)++;
+ return 0;
+ case 'T':
+ sprintf(buff, "%lu", (unsigned long int)time(NULL));
+ gds_append_str(s, buff);
+ (*input)++;
+ return 0;
+ }
+ return -1;
+}
+
+int pcb_build_argfn_cb(void *ctx_, gds_t *s, const char **input)
+{
+ if ((**input >= 'a') && (**input <= 'z')) {
+ int idx = **input - 'a';
+ pcb_build_argfn_t *ctx = ctx_;
+ if (ctx->params[idx] == NULL)
+ return -1;
+ gds_append_str(s, ctx->params[idx]);
+ (*input)++;
+ return 0;
+ }
+ return pcb_build_fn_cb(NULL, s, input);
+}
+
+char *pcb_build_fn(const char *template)
+{
+ return pcb_strdup_subst(template, pcb_build_fn_cb, NULL);
+}
+
+char *pcb_build_argfn(const char *template, pcb_build_argfn_t *arg)
+{
+ return pcb_strdup_subst(template, pcb_build_argfn_cb, arg);
+}
diff --git a/src/paths.h b/src/paths.h
index 140ff18..3e6f12d 100644
--- a/src/paths.h
+++ b/src/paths.h
@@ -1,23 +1,76 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+/* Resolve paths, build paths using template */
+
+#include "genvector/gds_char.h"
/* Allocate *out and copy the path from in to out, replacing ~ with conf_core.rc.path.home
If extra_room is non-zero, allocate this many bytes extra for each slot;
this leaves some room to append a file name. */
-void resolve_path(const char *in, char **out, unsigned int extra_room);
+void pcb_path_resolve(const char *in, char **out, unsigned int extra_room);
/* Same as resolve_path, but it returns the pointer to the new path and calls
free() on in */
-char *resolve_path_inplace(char *in, unsigned int extra_room);
+char *pcb_path_resolve_inplace(char *in, unsigned int extra_room);
/* Resolve all paths from a in[] into out[](should be large enough) */
-void resolve_paths(const char **in, char **out, int numpaths, unsigned int extra_room);
+void pcb_paths_resolve(const char **in, char **out, int numpaths, unsigned int extra_room);
/* Resolve all paths from a char *in[] into a freshly allocated char **out */
-#define resolve_all_paths(in, out, extra_room) \
+#define pcb_paths_resolve_all(in, out, extra_room) \
do { \
int __numpath__ = sizeof(in) / sizeof(char *); \
if (__numpath__ > 0) { \
out = malloc(sizeof(char *) * __numpath__); \
- resolve_paths(in, out, __numpath__, extra_room); \
+ pcb_paths_resolve(in, out, __numpath__, extra_room); \
} \
} while(0)
+
+
+/* generic file name template substitution callbacks for pcb_strdup_subst:
+ %P pid
+ %F load-time file name of the current pcb
+ %B basename (load-time file name of the current pcb without path)
+ %D dirname (load-time file path of the current pcb, without file name, with trailing slash, might be ./)
+ %N name of the current pcb
+ %T wall time (Epoch)
+*/
+int pcb_build_fn_cb(void *ctx, gds_t *s, const char **input);
+
+char *pcb_build_fn(const char *template);
+
+
+/* Same as above, but also replaces lower case formatting to the members of
+ the array if they are not NULL; use with pcb_build_argfn() */
+typedef struct {
+ const char *params['z' - 'a' + 1]; /* [0] for 'a' */
+} pcb_build_argfn_t;
+
+char *pcb_build_argfn(const char *template, pcb_build_argfn_t *arg);
+
+int pcb_build_argfn_cb(void *ctx, gds_t *s, const char **input);
+
diff --git a/src/pcb-conf.lht b/src/pcb-conf.lht
index 92e1b20..d804e2d 100644
--- a/src/pcb-conf.lht
+++ b/src/pcb-conf.lht
@@ -72,12 +72,17 @@ li:pcb-rnd-conf-v1 {
flip_x = 0
flip_y = 0
}
+ ha:selection {
+ disable_negative = 0
+ symmetric_negative = 0
+ }
undo_warning_size = 1024
fullscreen = 0
} # editor
ha:rc {
verbose = 0
+ quiet = 0
backup_interval = 60
# font_command = {}
# file_command = {}
@@ -110,6 +115,7 @@ li:pcb-rnd-conf-v1 {
# rat_path = {}
# rat_command = {}
li:preferred_gui = { gtk; lesstif }
+ save_final_fallback_fmt = lihata
} # rc
ha:design {
diff --git a/src/pcb-menu-gtk.lht b/src/pcb-menu-gtk.lht
index c5f2331..8b365a4 100644
--- a/src/pcb-menu-gtk.lht
+++ b/src/pcb-menu-gtk.lht
@@ -66,7 +66,7 @@ ha:{
}
-
ha:Print layout... = { action=Print()}
- ha:Export layout... = { action=Export()}
+ ha:Export layout... = { action=ExportGUI()}
ha:Maintenance {
li:submenu {
ha:Calibrate Printer... = { action=PrintCalibrate() }
diff --git a/src/pcb-menu-lesstif.lht b/src/pcb-menu-lesstif.lht
index 053954b..329d617 100644
--- a/src/pcb-menu-lesstif.lht
+++ b/src/pcb-menu-lesstif.lht
@@ -43,7 +43,7 @@ ha:{
ha:Load netlist file = { action=Load(Netlist) }
ha:Load vendor resource file = { action=LoadVendor() }
ha:Print layout... = { action=Print() }
- ha:Export layout... = { action=Export() }
+ ha:Export layout... = { action=ExportGUI() }
ha:Maintenance {
li:submenu {
ha:Calibrate Printer... = { action=PrintCalibrate() }
diff --git a/src/pcb-menu-mkey.lht b/src/pcb-menu-mkey.lht
index 1fefb33..be3a48b 100644
--- a/src/pcb-menu-mkey.lht
+++ b/src/pcb-menu-mkey.lht
@@ -66,7 +66,7 @@ ha:{
}
-
ha:Print layout... = { a={<key>f;<key>p}; action=Print()}
- ha:Export layout... = { a={<key>f;<key>i}; action=Export()}
+ ha:Export layout... = { a={<key>f;<key>i}; action=ExportGUI()}
ha:Maintenance {
li:submenu {
ha:Calibrate Printer... = { action=PrintCalibrate() }
diff --git a/src/pcb-printf.c b/src/pcb-printf.c
index 4d706c7..955cdba 100644
--- a/src/pcb-printf.c
+++ b/src/pcb-printf.c
@@ -33,9 +33,9 @@
*/
#include <locale.h>
+#include <ctype.h>
+#include <math.h>
#include "config.h"
-#include "global.h"
-
#include "pcb-printf.h"
const char *pcb_printf_slot[PCB_PRINTF_SLOT_max] =
@@ -110,15 +110,15 @@ do { \
} while(0)
/* append a suffix, with or without space */
-static int inline append_suffix(gds_t *dest, enum e_suffix suffix_type, const char *suffix)
+static int inline append_suffix(gds_t *dest, enum pcb_suffix_e suffix_type, const char *suffix)
{
switch (suffix_type) {
- case NO_SUFFIX:
+ case PCB_UNIT_NO_SUFFIX:
break;
- case SUFFIX:
+ case PCB_UNIT_SUFFIX:
if (gds_append(dest, ' ') != 0) return -1;
/* deliberate fall-thru */
- case FILE_MODE:
+ case PCB_UNIT_FILE_MODE:
if (gds_append_str(dest, suffix) != 0) return -1;
break;
}
@@ -142,13 +142,13 @@ static int inline append_suffix(gds_t *dest, enum e_suffix suffix_type, const ch
*
* \return 0 on success, -1 on error
*/
-static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t *printf_spec_, enum e_allow allow,
- enum e_suffix suffix_type)
+static int CoordsToString(gds_t *dest, pcb_coord_t coord[], int n_coords, const gds_t *printf_spec_, enum pcb_allow_e allow,
+ enum pcb_suffix_e suffix_type)
{
char filemode_buff[128]; /* G_ASCII_DTOSTR_BUF_SIZE */
char printf_spec_new_local[256];
double *value, value_local[32];
- enum e_family family;
+ enum pcb_family_e family;
const char *suffix;
int i, n, retval = -1, trunc0 = 0;
const char *printf_spec = printf_spec_->array;
@@ -163,7 +163,7 @@ static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t
value = value_local;
if (allow == 0)
- allow = ALLOW_ALL;
+ allow = PCB_UNIT_ALLOW_ALL;
i = printf_spec_->used + 64;
if (i > sizeof(printf_spec_new_local))
@@ -172,10 +172,10 @@ static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t
printf_spec_new = printf_spec_new_local;
/* Check our freedom in choosing units */
- if ((allow & ALLOW_IMPERIAL) == 0)
- family = METRIC;
- else if ((allow & ALLOW_METRIC) == 0)
- family = IMPERIAL;
+ if ((allow & PCB_UNIT_ALLOW_IMPERIAL) == 0)
+ family = PCB_UNIT_METRIC;
+ else if ((allow & PCB_UNIT_ALLOW_METRIC) == 0)
+ family = PCB_UNIT_IMPERIAL;
else {
int met_votes = 0, imp_votes = 0;
@@ -186,18 +186,18 @@ static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t
++met_votes;
if (imp_votes > met_votes)
- family = IMPERIAL;
+ family = PCB_UNIT_IMPERIAL;
else
- family = METRIC;
+ family = PCB_UNIT_METRIC;
}
/* Set base unit */
for (i = 0; i < n_coords; ++i) {
switch (family) {
- case METRIC:
+ case PCB_UNIT_METRIC:
value[i] = PCB_COORD_TO_MM(coord[i]);
break;
- case IMPERIAL:
+ case PCB_UNIT_IMPERIAL:
value[i] = PCB_COORD_TO_MIL(coord[i]);
break;
}
@@ -205,19 +205,19 @@ static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t
/* Determine scale factor -- find smallest unit that brings
* the whole group above unity */
- for (n = 0; n < get_n_units(); ++n) {
+ for (n = 0; n < pcb_get_n_units(); ++n) {
if ((Units[n].allow & allow) != 0 && (Units[n].family == family)) {
int n_above_one = 0;
for (i = 0; i < n_coords; ++i)
- if (fabs(value[i] * Units[n].scale_factor) > 1)
+ if (abs(value[i] * Units[n].scale_factor) > 1)
++n_above_one;
if (n_above_one == n_coords)
break;
}
}
/* If nothing worked, wind back to the smallest allowable unit */
- if (n == get_n_units()) {
+ if (n == pcb_get_n_units()) {
do {
--n;
} while ((Units[n].allow & allow) == 0 || Units[n].family != family);
@@ -236,12 +236,12 @@ static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t
if (gds_append(dest, '(') != 0)
goto err;
- sprintf_lc_safe((suffix_type == FILE_MODE), filemode_buff, printf_spec_new + 2, value[0]);
+ sprintf_lc_safe((suffix_type == PCB_UNIT_FILE_MODE), filemode_buff, printf_spec_new + 2, value[0]);
if (gds_append_str(dest, filemode_buff) != 0)
goto err;
for (i = 1; i < n_coords; ++i) {
- sprintf_lc_safe((suffix_type == FILE_MODE), filemode_buff, printf_spec_new, value[i]);
+ sprintf_lc_safe((suffix_type == PCB_UNIT_FILE_MODE), filemode_buff, printf_spec_new, value[i]);
if (gds_append_str(dest, filemode_buff) != 0)
goto err;
}
@@ -267,31 +267,31 @@ err:;
typedef struct {
int score_factor;
- enum e_allow base;
+ enum pcb_allow_e base;
double down_limit;
- enum e_allow down;
+ enum pcb_allow_e down;
double up_limit;
- enum e_allow up;
+ enum pcb_allow_e up;
/* persistent, calculated once */
- const Unit *base_unit, *down_unit, *up_unit;
+ const pcb_unit_t *base_unit, *down_unit, *up_unit;
} human_coord_t;
/* Conversion preference table */
static human_coord_t human_coord[] = {
- {2, ALLOW_MM, 0.001, ALLOW_UM, 1000.0, ALLOW_M ,NULL,NULL,NULL},
- {1, ALLOW_MIL, 0, 0, 1000.0, ALLOW_IN ,NULL,NULL,NULL}
+ {2, PCB_UNIT_ALLOW_MM, 0.001, PCB_UNIT_ALLOW_UM, 1000.0, PCB_UNIT_ALLOW_M ,NULL,NULL,NULL},
+ {1, PCB_UNIT_ALLOW_MIL, 0, 0, 1000.0, PCB_UNIT_ALLOW_IN ,NULL,NULL,NULL}
};
#define NUM_HUMAN_COORD (sizeof(human_coord) / sizeof(human_coord[0]))
-static inline int try_human_coord(Coord coord, const Unit *unit, double down_limit, double up_limit, int score_factor, double *value, unsigned int *best, const char **suffix)
+static inline int try_human_coord(pcb_coord_t coord, const pcb_unit_t *unit, double down_limit, double up_limit, int score_factor, double *value, unsigned int *best, const char **suffix)
{
double v, frac;
long int digs, zeros;
unsigned int score;
/* convert the value to the proposed unit */
- if (unit->family == METRIC)
+ if (unit->family == PCB_UNIT_METRIC)
v = PCB_COORD_TO_MM(coord);
else
v = PCB_COORD_TO_MIL(coord);
@@ -327,7 +327,7 @@ static inline int try_human_coord(Coord coord, const Unit *unit, double down_lim
}
/* Same as CoordsToString but take only one coord and print it in human readable format */
-static int CoordsToHumanString(gds_t *dest, Coord coord, const gds_t *printf_spec_, enum e_suffix suffix_type)
+static int CoordsToHumanString(gds_t *dest, pcb_coord_t coord, const gds_t *printf_spec_, enum pcb_suffix_e suffix_type)
{
char filemode_buff[128]; /* G_ASCII_DTOSTR_BUF_SIZE */
char printf_spec_new_local[256];
@@ -364,13 +364,13 @@ static int CoordsToHumanString(gds_t *dest, Coord coord, const gds_t *printf_spe
}
make_printf_spec(printf_spec_new, printf_spec, 8, &trunc0);
- sprintf_lc_safe((suffix_type == FILE_MODE), filemode_buff, printf_spec_new + 2, value);
+ sprintf_lc_safe((suffix_type == PCB_UNIT_FILE_MODE), filemode_buff, printf_spec_new + 2, value);
if (gds_append_str(dest, filemode_buff) != 0)
goto err;
if (value != 0) {
- if (suffix_type == NO_SUFFIX)
- suffix_type = SUFFIX;
+ if (suffix_type == PCB_UNIT_NO_SUFFIX)
+ suffix_type = PCB_UNIT_SUFFIX;
if (append_suffix(dest, suffix_type, suffix) != 0)
goto err;
}
@@ -399,17 +399,17 @@ int pcb_append_vprintf(gds_t *string, const char *fmt, va_list args)
char tmp[128]; /* large enough for rendering a long long int */
int tmplen, retval = -1, slot_recursion = 0;
char *free_fmt = NULL;
- enum e_allow mask = ALLOW_ALL;
+ enum pcb_allow_e mask = PCB_UNIT_ALLOW_ALL;
gds_init(&spec);
new_fmt:;
while (*fmt) {
- enum e_suffix suffix = NO_SUFFIX;
+ enum pcb_suffix_e suffix = PCB_UNIT_NO_SUFFIX;
if (*fmt == '%') {
const char *ext_unit = "";
- Coord value[10];
+ pcb_coord_t value[10];
int count, i;
gds_truncate(&spec, 0);
@@ -464,15 +464,15 @@ int pcb_append_vprintf(gds_t *string, const char *fmt, va_list args)
/* Get our sub-specifiers */
if (*fmt == '#') {
- mask = ALLOW_CMIL; /* This must be pcb's base unit */
+ mask = PCB_UNIT_ALLOW_CMIL; /* This must be pcb's base unit */
fmt++;
}
if (*fmt == '$') {
- suffix = SUFFIX;
+ suffix = PCB_UNIT_SUFFIX;
fmt++;
if (*fmt == '$') {
fmt++;
- suffix = FILE_MODE;
+ suffix = PCB_UNIT_FILE_MODE;
}
}
/* Tack full specifier onto specifier */
@@ -551,61 +551,61 @@ int pcb_append_vprintf(gds_t *string, const char *fmt, va_list args)
if (*fmt == '*')
ext_unit = va_arg(args, const char *);
if (*fmt != '+' && *fmt != 'a' && *fmt != 'A')
- value[0] = va_arg(args, Coord);
+ value[0] = va_arg(args, pcb_coord_t);
count = 1;
switch (*fmt) {
case 'I':
- if (CoordsToString(string, value, 1, &spec, ALLOW_NM, NO_SUFFIX) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, PCB_UNIT_ALLOW_NM, PCB_UNIT_NO_SUFFIX) != 0) goto err;
break;
case 's':
- if (CoordsToString(string, value, 1, &spec, ALLOW_MM | ALLOW_MIL, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, PCB_UNIT_ALLOW_MM | PCB_UNIT_ALLOW_MIL, suffix) != 0) goto err;
break;
case 'S':
- if (CoordsToString(string, value, 1, &spec, mask & ALLOW_NATURAL, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, mask & PCB_UNIT_ALLOW_NATURAL, suffix) != 0) goto err;
break;
case 'H':
if (CoordsToHumanString(string, value[0], &spec, suffix) != 0) goto err;
break;
case 'M':
- if (CoordsToString(string, value, 1, &spec, mask & ALLOW_METRIC, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, mask & PCB_UNIT_ALLOW_METRIC, suffix) != 0) goto err;
break;
case 'L':
- if (CoordsToString(string, value, 1, &spec, mask & ALLOW_IMPERIAL, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, mask & PCB_UNIT_ALLOW_IMPERIAL, suffix) != 0) goto err;
break;
case 'k':
- if (CoordsToString(string, value, 1, &spec, mask & ALLOW_DMIL, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, mask & PCB_UNIT_ALLOW_DMIL, suffix) != 0) goto err;
break;
case 'r':
- if (CoordsToString(string, value, 1, &spec, ALLOW_READABLE, NO_SUFFIX) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, PCB_UNIT_ALLOW_READABLE, PCB_UNIT_NO_SUFFIX) != 0) goto err;
break;
/* All these fallthroughs are deliberate */
case '9':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '8':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '7':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '6':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '5':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '4':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '3':
- value[count++] = va_arg(args, Coord);
+ value[count++] = va_arg(args, pcb_coord_t);
case '2':
case 'D':
- value[count++] = va_arg(args, Coord);
- if (CoordsToString(string, value, count, &spec, mask & ALLOW_ALL, suffix) != 0) goto err;
+ value[count++] = va_arg(args, pcb_coord_t);
+ if (CoordsToString(string, value, count, &spec, mask & PCB_UNIT_ALLOW_ALL, suffix) != 0) goto err;
break;
case 'd':
- value[1] = va_arg(args, Coord);
- if (CoordsToString(string, value, 2, &spec, ALLOW_MM | ALLOW_MIL, suffix) != 0) goto err;
+ value[1] = va_arg(args, pcb_coord_t);
+ if (CoordsToString(string, value, 2, &spec, PCB_UNIT_ALLOW_MM | PCB_UNIT_ALLOW_MIL, suffix) != 0) goto err;
break;
case '*':
{
int found = 0;
- for (i = 0; i < get_n_units(); ++i) {
+ for (i = 0; i < pcb_get_n_units(); ++i) {
if (strcmp(ext_unit, Units[i].suffix) == 0) {
if (CoordsToString(string, value, 1, &spec, Units[i].allow, suffix) != 0) goto err;
found = 1;
@@ -613,30 +613,30 @@ int pcb_append_vprintf(gds_t *string, const char *fmt, va_list args)
}
}
if (!found)
- if (CoordsToString(string, value, 1, &spec, mask & ALLOW_ALL, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, mask & PCB_UNIT_ALLOW_ALL, suffix) != 0) goto err;
}
break;
case 'a':
if (gds_append_len(&spec, ".0f", 3) != 0) goto err;
- if (suffix == SUFFIX)
+ if (suffix == PCB_UNIT_SUFFIX)
if (gds_append_len(&spec, " deg", 4) != 0) goto err;
- tmplen = sprintf(tmp, spec.array, (double) va_arg(args, Angle));
+ tmplen = sprintf(tmp, spec.array, (double) va_arg(args, pcb_angle_t));
if (gds_append_len(string, tmp, tmplen) != 0) goto err;
break;
case 'A':
if (gds_append_len(&spec, ".0f", 3) != 0) goto err;
- /* if (suffix == SUFFIX)
+ /* if (suffix == PCB_UNIT_SUFFIX)
if (gds_append_len(&spec, " deg", 4) != 0) goto err;*/
- tmplen = sprintf(tmp, spec.array, 10*((double) va_arg(args, Angle))); /* kicad legacy needs decidegrees */
+ tmplen = sprintf(tmp, spec.array, 10*((double) va_arg(args, pcb_angle_t))); /* kicad legacy needs decidegrees */
if (gds_append_len(string, tmp, tmplen) != 0) goto err;
break;
case '+':
- mask = va_arg(args, enum e_allow);
+ mask = va_arg(args, enum pcb_allow_e);
break;
default:
{
int found = 0;
- for (i = 0; i < get_n_units(); ++i) {
+ for (i = 0; i < pcb_get_n_units(); ++i) {
if (*fmt == Units[i].printf_code) {
if (CoordsToString(string, value, 1, &spec, Units[i].allow, suffix) != 0) goto err;
found = 1;
@@ -644,7 +644,7 @@ int pcb_append_vprintf(gds_t *string, const char *fmt, va_list args)
}
}
if (!found)
- if (CoordsToString(string, value, 1, &spec, ALLOW_ALL, suffix) != 0) goto err;
+ if (CoordsToString(string, value, 1, &spec, PCB_UNIT_ALLOW_ALL, suffix) != 0) goto err;
}
break;
}
@@ -718,6 +718,21 @@ int pcb_snprintf(char *string, size_t len, const char *fmt, ...)
return str.used;
}
+int pcb_vsnprintf(char *string, size_t len, const char *fmt, va_list args)
+{
+ gds_t str;
+
+ gds_init(&str);
+
+ str.array = string;
+ str.alloced = len;
+ str.no_realloc = 1;
+
+ pcb_append_vprintf(&str, fmt, args);
+
+ return str.used;
+}
+
/* \brief Wrapper for pcb_append_vprintf that outputs to a file
*
* \param [in] fh File to output to
@@ -843,7 +858,7 @@ int pcb_append_printf(gds_t *str, const char *fmt, ...)
}
-char *pcb_strdup_subst(const char *template, int (*cb)(gds_t *s, const char **input))
+char *pcb_strdup_subst(const char *template, int (*cb)(void *ctx, gds_t *s, const char **input), void *ctx)
{
gds_t s;
const char *curr, *next;
@@ -864,7 +879,7 @@ char *pcb_strdup_subst(const char *template, int (*cb)(gds_t *s, const char **in
curr = next+1;
break;
default:
- if (cb(&s, &next) != 0) {
+ if (cb(ctx, &s, &next) != 0) {
/* keep the directive intact */
gds_append(&s, '%');
}
diff --git a/src/pcb-printf.h b/src/pcb-printf.h
index 1a8808c..d9ad855 100644
--- a/src/pcb-printf.h
+++ b/src/pcb-printf.h
@@ -26,7 +26,7 @@
*/
/* This file defines a wrapper around sprintf, that
- * defines new specifiers that take pcb Coord objects
+ * defines new specifiers that take pcb_coord_t objects
* as input.
*
* There is a fair bit of nasty (repetitious) code in
@@ -80,15 +80,15 @@
#define PCB_PCB_PRINTF_H
#include <stdio.h>
+#include <stdarg.h>
#include <genvector/gds_char.h>
#include "unit.h"
-void initialize_units();
-
int pcb_fprintf(FILE * f, const char *fmt, ...);
int pcb_vfprintf(FILE * f, const char *fmt, va_list args);
int pcb_sprintf(char *string, const char *fmt, ...);
int pcb_snprintf(char *string, size_t len, const char *fmt, ...);
+int pcb_vsnprintf(char *string, size_t len, const char *fmt, va_list args);
int pcb_printf(const char *fmt, ...);
char *pcb_strdup_printf(const char *fmt, ...);
char *pcb_strdup_vprintf(const char *fmt, va_list args);
@@ -118,9 +118,9 @@ extern const char *pcb_printf_slot[PCB_PRINTF_SLOT_max];
function needs to recognize the directive at **input (pointing to the byte
after the %) and append the substitution to s and increase *input to point
beyond the format directive. The callback returns 0 on success or -1
- on unknown directive (whcih will be copied verbatim). %% will always
+ on unknown directive (which will be copied verbatim). %% will always
be translated into a single %, without calling cb.
*/
-char *pcb_strdup_subst(const char *template, int (*cb)(gds_t *s, const char **input));
+char *pcb_strdup_subst(const char *template, int (*cb)(void *ctx, gds_t *s, const char **input), void *ctx);
#endif
diff --git a/src/plug_footprint.c b/src/plug_footprint.c
index f7bf28c..88b77c8 100644
--- a/src/plug_footprint.c
+++ b/src/plug_footprint.c
@@ -32,14 +32,13 @@
#include <genht/htsp.h>
#include <genht/hash.h>
#include "conf_core.h"
-#include "plugins.h"
#include "error.h"
#include "compat_misc.h"
-plug_fp_t *plug_fp_chain = NULL;
-library_t library;
+pcb_plug_fp_t *pcb_plug_fp_chain = NULL;
+pcb_fplibrary_t pcb_library;
-int fp_dupname(const char *name, char **basename, char **params)
+int pcb_fp_dupname(const char *name, char **basename, char **params)
{
char *newname, *s;
@@ -64,7 +63,7 @@ int fp_dupname(const char *name, char **basename, char **params)
static htsp_t *fp_tags = NULL;
-const void *fp_tag(const char *tag, int alloc)
+const void *pcb_fp_tag(const char *tag, int alloc)
{
htsp_entry_t *e;
static char *counter = NULL;
@@ -80,16 +79,16 @@ const void *fp_tag(const char *tag, int alloc)
return e == NULL ? NULL : e->key;
}
-void fp_init()
+void pcb_fp_init()
{
- library.type = LIB_DIR;
- library.name = pcb_strdup("/"); /* All names are eventually free()'d */
+ pcb_library.type = LIB_DIR;
+ pcb_library.name = pcb_strdup("/"); /* All names are eventually free()'d */
}
-void fp_uninit()
+void pcb_fp_uninit()
{
htsp_entry_t *e;
- fp_free_children(&library);
+ pcb_fp_free_children(&pcb_library);
if (fp_tags != NULL) {
for (e = htsp_first(fp_tags); e; e = htsp_next(fp_tags, e))
free(e->key);
@@ -98,30 +97,30 @@ void fp_uninit()
}
}
-const char *fp_tagname(const void *tagid)
+const char *pcb_fp_tagname(const void *tagid)
{
return (char *) tagid;
}
-FILE *fp_fopen(const char *path, const char *name, fp_fopen_ctx_t *fctx)
+FILE *pcb_fp_fopen(const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx)
{
FILE *res = NULL;
- HOOK_CALL(plug_fp_t, plug_fp_chain, fopen, res, != NULL, (self, path, name, fctx));
+ PCB_HOOK_CALL(pcb_plug_fp_t, pcb_plug_fp_chain, fopen, res, != NULL, (self, path, name, fctx));
return res;
}
-void fp_fclose(FILE * f, fp_fopen_ctx_t *fctx)
+void pcb_fp_fclose(FILE * f, pcb_fp_fopen_ctx_t *fctx)
{
if (fctx->backend->fclose != NULL)
fctx->backend->fclose(fctx->backend, f, fctx);
}
-library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type, void *tags[])
+pcb_fplibrary_t *pcb_fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[])
{
- library_t *entry; /* Pointer to individual menu entry */
+ pcb_fplibrary_t *entry; /* Pointer to individual menu entry */
assert(parent->type == LIB_DIR);
- entry = get_library_memory(parent);
+ entry = pcb_get_library_memory(parent);
if (entry == NULL)
return NULL;
@@ -144,9 +143,9 @@ library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type,
return entry;
}
-library_t *fp_lib_search_len(library_t *dir, const char *name, int name_len)
+pcb_fplibrary_t *fp_lib_search_len(pcb_fplibrary_t *dir, const char *name, int name_len)
{
- library_t *l;
+ pcb_fplibrary_t *l;
int n;
if (dir->type != LIB_DIR)
@@ -159,9 +158,9 @@ library_t *fp_lib_search_len(library_t *dir, const char *name, int name_len)
return NULL;
}
-library_t *fp_lib_search(library_t *dir, const char *name)
+pcb_fplibrary_t *pcb_fp_lib_search(pcb_fplibrary_t *dir, const char *name)
{
- library_t *l;
+ pcb_fplibrary_t *l;
int n;
if (dir->type != LIB_DIR)
@@ -175,9 +174,9 @@ library_t *fp_lib_search(library_t *dir, const char *name)
}
-library_t *fp_mkdir_len(library_t *parent, const char *name, int name_len)
+pcb_fplibrary_t *pcb_fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len)
{
- library_t *l = get_library_memory(parent);
+ pcb_fplibrary_t *l = pcb_get_library_memory(parent);
if (name_len > 0)
l->name = pcb_strndup(name, name_len);
@@ -189,18 +188,18 @@ library_t *fp_mkdir_len(library_t *parent, const char *name, int name_len)
return l;
}
-library_t *fp_mkdir_p(const char *path)
+pcb_fplibrary_t *pcb_fp_mkdir_p(const char *path)
{
- library_t *l, *parent = NULL;
+ pcb_fplibrary_t *l, *parent = NULL;
const char *next;
/* search for the last existing dir in the path */
while(*path == '/') path++;
- for(parent = l = &library; l != NULL; parent = l,path = next) {
+ for(parent = l = &pcb_library; l != NULL; parent = l,path = next) {
next = strchr(path, '/');
if (next == NULL)
- l = fp_lib_search(l, path);
+ l = pcb_fp_lib_search(l, path);
else
l = fp_lib_search_len(l, path, next-path);
@@ -225,7 +224,7 @@ library_t *fp_mkdir_p(const char *path)
/* by now path points to the first non-existing dir, under parent */
for(;path != NULL; path = next) {
next = strchr(path, '/');
- parent = fp_mkdir_len(parent, path, next-path);
+ parent = pcb_fp_mkdir_len(parent, path, next-path);
if (next != NULL) {
while(*next == '/') next++;
if (*next == '\0')
@@ -236,7 +235,7 @@ library_t *fp_mkdir_p(const char *path)
return parent;
}
-void fp_sort_children(library_t *parent)
+void pcb_fp_sort_children(pcb_fplibrary_t *parent)
{
/* int i;
qsort(lib->Menu, lib->MenuN, sizeof(lib->Menu[0]), netlist_sort);
@@ -244,11 +243,11 @@ void fp_sort_children(library_t *parent)
qsort(lib->Menu[i].Entry, lib->Menu[i].EntryN, sizeof(lib->Menu[i].Entry[0]), netnode_sort);*/
}
-void fp_free_entry(library_t *l)
+void fp_free_entry(pcb_fplibrary_t *l)
{
switch(l->type) {
case LIB_DIR:
- fp_free_children(l);
+ pcb_fp_free_children(l);
vtlib_uninit(&(l->data.dir.children));
break;
case LIB_FOOTPRINT:
@@ -266,10 +265,10 @@ void fp_free_entry(library_t *l)
l->type = LIB_INVALID;
}
-void fp_free_children(library_t *parent)
+void pcb_fp_free_children(pcb_fplibrary_t *parent)
{
int n;
- library_t *l;
+ pcb_fplibrary_t *l;
assert(parent->type == LIB_DIR);
@@ -280,9 +279,9 @@ void fp_free_children(library_t *parent)
}
-void fp_rmdir(library_t *dir)
+void pcb_fp_rmdir(pcb_fplibrary_t *dir)
{
- library_t *l, *parent = dir->parent;
+ pcb_fplibrary_t *l, *parent = dir->parent;
int n;
fp_free_entry(dir);
if (parent != NULL) {
@@ -296,9 +295,9 @@ void fp_rmdir(library_t *dir)
}
/* Debug functions */
-void fp_dump_dir(library_t *dir, int level)
+void fp_dump_dir(pcb_fplibrary_t *dir, int level)
{
- library_t *l;
+ pcb_fplibrary_t *l;
int n, p;
for(n = 0, l = dir->data.dir.children.array; n < dir->data.dir.children.used; n++, l++) {
@@ -317,7 +316,7 @@ void fp_dump_dir(library_t *dir, int level)
void fp_dump()
{
- fp_dump_dir(&library, 0);
+ fp_dump_dir(&pcb_library, 0);
}
/* This function loads the newlib footprints into the Library.
@@ -330,7 +329,7 @@ void fp_dump()
*/
static int fp_read_lib_all_(const char *searchpath)
{
- char toppath[MAXPATHLEN + 1]; /* String holding abs path to top level library dir */
+ char toppath[PCB_PATH_MAX + 1]; /* String holding abs path to top level library dir */
char *libpaths; /* String holding list of library paths to search */
char *p; /* Helper string used in iteration */
int n_footprints = 0; /* Running count of footprints found */
@@ -353,11 +352,11 @@ static int fp_read_lib_all_(const char *searchpath)
/* Next read in any footprints in the top level dir */
res = -1;
- HOOK_CALL(plug_fp_t, plug_fp_chain, load_dir, res, >= 0, (self, toppath));
+ PCB_HOOK_CALL(pcb_plug_fp_t, pcb_plug_fp_chain, load_dir, res, >= 0, (self, toppath));
if (res >= 0)
n_footprints += res;
else
- Message(PCB_MSG_DEFAULT, "Warning: footprint library list error on %s\n", toppath);
+ pcb_message(PCB_MSG_WARNING, "Warning: footprint library list error on %s\n", toppath);
}
#ifdef DEBUG
@@ -371,35 +370,35 @@ static int fp_read_lib_all_(const char *searchpath)
static gds_t fpds_paths;
static int fpds_inited = 0;
-const char *fp_default_search_path(void)
+const char *pcb_fp_default_search_path(void)
{
return conf_concat_strlist(&conf_core.rc.library_search_paths, &fpds_paths, &fpds_inited, ':');
}
-int fp_host_uninit(void)
+int pcb_fp_host_uninit(void)
{
if (fpds_inited)
gds_uninit(&fpds_paths);
return 0;
}
-int fp_read_lib_all(void)
+int pcb_fp_read_lib_all(void)
{
FILE *resultFP = NULL;
/* List all footprint libraries. Then sort the whole
* library.
*/
- if (fp_read_lib_all_(fp_default_search_path()) > 0 || resultFP != NULL) {
- fp_sort_children(&library);
+ if (fp_read_lib_all_(pcb_fp_default_search_path()) > 0 || resultFP != NULL) {
+ pcb_fp_sort_children(&pcb_library);
return 0;
}
return (1);
}
-int fp_rehash(void)
+int pcb_fp_rehash(void)
{
- fp_free_children(&library);
- return fp_read_lib_all();
+ pcb_fp_free_children(&pcb_library);
+ return pcb_fp_read_lib_all();
}
diff --git a/src/plug_footprint.h b/src/plug_footprint.h
index 98db060..2ec7a4d 100644
--- a/src/plug_footprint.h
+++ b/src/plug_footprint.h
@@ -4,87 +4,87 @@
#include <stdio.h>
#include "vtlibrary.h"
-typedef struct plug_fp_s plug_fp_t;
+typedef struct pcb_plug_fp_s pcb_plug_fp_t;
typedef struct {
- plug_fp_t *backend;
+ pcb_plug_fp_t *backend;
union {
int i;
void *p;
} field[4];
-} fp_fopen_ctx_t;
+} pcb_fp_fopen_ctx_t;
/* hook bindings, see below */
-FILE *fp_fopen(const char *path, const char *name, fp_fopen_ctx_t *fctx);
-void fp_fclose(FILE * f, fp_fopen_ctx_t *fctx);
+FILE *pcb_fp_fopen(const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx);
+void pcb_fp_fclose(FILE * f, pcb_fp_fopen_ctx_t *fctx);
/* duplicates the name and splits it into a basename and params;
params is NULL if the name is not parametric (and "" if parameter list is empty)
returns 1 if name is parametric, 0 if file element.
The caller shall free only *basename at the end.
*/
-int fp_dupname(const char *name, char **basename, char **params);
+int pcb_fp_dupname(const char *name, char **basename, char **params);
/**** tag management ****/
/* Resolve a tag name to an unique void * ID; create unknown tag if alloc != 0 */
-const void *fp_tag(const char *tag, int alloc);
+const void *pcb_fp_tag(const char *tag, int alloc);
/* Resolve a tag ID to a tag name */
-const char *fp_tagname(const void *tagid);
+const char *pcb_fp_tagname(const void *tagid);
/* init/uninit the footprint lib, free tag key memory */
-void fp_init();
-void fp_uninit();
+void pcb_fp_init();
+void pcb_fp_uninit();
/**************************** API definition *********************************/
-struct plug_fp_s {
- plug_fp_t *next;
+struct pcb_plug_fp_s {
+ pcb_plug_fp_t *next;
void *plugin_data;
/* returns the number of footprints loaded into the library or -1 on
error; next in chain is run only on error. */
- int (*load_dir)(plug_fp_t *ctx, const char *path);
+ int (*load_dir)(pcb_plug_fp_t *ctx, const char *path);
/* Open a footprint for reading; if the footprint is parametric, it's run
prefixed with libshell (or executed directly, if libshell is NULL).
If name is not an absolute path, search_path is searched for the first match.
- The user has to supply a state integer that will be used by pcb_fp_fclose().
+ The user has to supply a state integer that will be used by pcb_pcb_fp_fclose().
Must fill in fctx->backend, may use any other field of fctx as well.
*/
- FILE *(*fopen)(plug_fp_t *ctx, const char *path, const char *name, fp_fopen_ctx_t *fctx);
+ FILE *(*fopen)(pcb_plug_fp_t *ctx, const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx);
-/* Close the footprint file opened by pcb_fp_fopen(). */
- void (*fclose)(plug_fp_t *ctx, FILE * f, fp_fopen_ctx_t *fctx);
+/* Close the footprint file opened by pcb_pcb_fp_fopen(). */
+ void (*fclose)(pcb_plug_fp_t *ctx, FILE * f, pcb_fp_fopen_ctx_t *fctx);
};
-extern plug_fp_t *plug_fp_chain;
+extern pcb_plug_fp_t *pcb_plug_fp_chain;
/* Optional pcb-rnd-side glue for some implementations */
-extern library_t library; /* the footprint library */
+extern pcb_fplibrary_t pcb_library; /* the footprint library */
-#define get_library_memory(parent) vtlib_alloc_append(((parent) == NULL ? &library.data.dir.children : &(parent)->data.dir.children), 1);
+#define pcb_get_library_memory(parent) vtlib_alloc_append(((parent) == NULL ? &pcb_library.data.dir.children : &(parent)->data.dir.children), 1);
-void fp_free_children(library_t *parent);
-void fp_sort_children(library_t *parent);
-void fp_rmdir(library_t *dir);
-library_t *fp_mkdir_p(const char *path);
-library_t *fp_mkdir_len(library_t *parent, const char *name, int name_len);
-library_t *fp_lib_search(library_t *dir, const char *name);
+void pcb_fp_free_children(pcb_fplibrary_t *parent);
+void pcb_fp_sort_children(pcb_fplibrary_t *parent);
+void pcb_fp_rmdir(pcb_fplibrary_t *dir);
+pcb_fplibrary_t *pcb_fp_mkdir_p(const char *path);
+pcb_fplibrary_t *pcb_fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len);
+pcb_fplibrary_t *pcb_fp_lib_search(pcb_fplibrary_t *dir, const char *name);
/* Append a menu entry in the tree */
-library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type, void *tags[]);
+pcb_fplibrary_t *pcb_fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[]);
/* walk through all lib paths and build the library menu */
-int fp_read_lib_all(void);
+int pcb_fp_read_lib_all(void);
-const char *fp_default_search_path(void);
+const char *pcb_fp_default_search_path(void);
-int fp_host_uninit(void);
+int pcb_fp_host_uninit(void);
/* rescan/reload all footprints in the library cache */
-int fp_rehash(void);
+int pcb_fp_rehash(void);
#endif
diff --git a/src/plug_footprint_act.c b/src/plug_footprint_act.c
index 9ceaddc..8379364 100644
--- a/src/plug_footprint_act.c
+++ b/src/plug_footprint_act.c
@@ -24,22 +24,21 @@
*/
#include "config.h"
-#include "global.h"
#include "hid.h"
#include "plug_footprint.h"
-static const char fp_rehash_syntax[] = "fp_rehash()" ;
-static const char fp_rehash_help[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session.";
-static int Action_fp_rehash(int argc, const char **argv, Coord x, Coord y)
+static const char pcb_acts_fp_rehash[] = "fp_rehash()" ;
+static const char pcb_acth_fp_rehash[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session.";
+static int pcb_act_fp_rehash(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- fp_rehash();
+ pcb_fp_rehash();
return 0;
}
-HID_Action conf_plug_footprint_list[] = {
- {"fp_rehash", 0, Action_fp_rehash,
- fp_rehash_help, fp_rehash_syntax}
+pcb_hid_action_t conf_plug_footprint_list[] = {
+ {"fp_rehash", 0, pcb_act_fp_rehash,
+ pcb_acth_fp_rehash, pcb_acts_fp_rehash}
};
-REGISTER_ACTIONS(conf_plug_footprint_list, NULL)
+PCB_REGISTER_ACTIONS(conf_plug_footprint_list, NULL)
diff --git a/src/plug_import.c b/src/plug_import.c
index 0968beb..16ed93c 100644
--- a/src/plug_import.c
+++ b/src/plug_import.c
@@ -31,11 +31,7 @@
#include "conf_core.h"
#include <locale.h>
-
-#include "global.h"
-
#include <time.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -45,15 +41,15 @@
#include "error.h"
-plug_import_t *plug_import_chain = NULL;
+pcb_plug_import_t *pcb_plug_import_chain = NULL;
typedef struct {
- plug_import_t *plug;
+ pcb_plug_import_t *plug;
int prio;
} find_t;
/* Find the plugin that offers the highest write prio for the format */
-static plug_import_t *find_importer(unsigned int aspects, FILE *f, const char *filename)
+static pcb_plug_import_t *find_importer(unsigned int aspects, FILE *f, const char *filename)
{
find_t available[32]; /* wish we had more than 32 import plugins... */
int n, len = 0, best = 0, bestidx = -1;
@@ -68,7 +64,7 @@ static plug_import_t *find_importer(unsigned int aspects, FILE *f, const char *f
} \
} while(0)
- HOOK_CALL_ALL(plug_import_t, plug_import_chain, fmt_support_prio, cb_append, (self, aspects, f, filename));
+ PCB_HOOK_CALL_ALL(pcb_plug_import_t, pcb_plug_import_chain, fmt_support_prio, cb_append, (self, aspects, f, filename));
if (len == 0)
return NULL;
@@ -89,11 +85,11 @@ static plug_import_t *find_importer(unsigned int aspects, FILE *f, const char *f
int pcb_import(char *filename, unsigned int aspect)
{
- plug_import_t *plug;
+ pcb_plug_import_t *plug;
FILE *fp;
if (!filename) {
- Message(PCB_MSG_DEFAULT, "Error: need a file name for ImportNetlist()\n");
+ pcb_message(PCB_MSG_ERROR, "Error: need a file name for pcb_import_netlist()\n");
return (1); /* nothing to do */
}
fp = fopen(filename, "r");
@@ -101,11 +97,11 @@ int pcb_import(char *filename, unsigned int aspect)
plug = find_importer(aspect, fp, filename);
if (plug == NULL) {
if (fp != NULL) {
- Message(PCB_MSG_DEFAULT, "Error: can't find a suitable netlist parser for %s\n", filename);
+ pcb_message(PCB_MSG_ERROR, "Error: can't find a suitable netlist parser for %s\n", filename);
fclose(fp);
}
else
- Message(PCB_MSG_DEFAULT, "Error: can't find a suitable netlist parser for %s - might be related: can't open %s for reading\n", filename, filename);
+ pcb_message(PCB_MSG_ERROR, "Error: can't find a suitable netlist parser for %s - might be related: can't open %s for reading\n", filename, filename);
return 1;
}
@@ -115,7 +111,7 @@ int pcb_import(char *filename, unsigned int aspect)
return plug->import(plug, aspect, filename);
}
-int ImportNetlist(char *filename)
+int pcb_import_netlist(char *filename)
{
return pcb_import(filename, IMPORT_ASPECT_NETLIST);
}
diff --git a/src/plug_import.h b/src/plug_import.h
index 941c3d5..80250fb 100644
--- a/src/plug_import.h
+++ b/src/plug_import.h
@@ -28,35 +28,35 @@
#ifndef PCB_PLUG_IMPORT_H
#define PCB_PLUG_IMPORT_H
-#include "global.h"
+#include "config.h"
#include "conf.h"
/**************************** API definition *********************************/
-typedef enum plug_import_aspect_e { /* bitfield of aspects that can be imported */
+typedef enum pcb_plug_import_aspect_e { /* bitfield of aspects that can be imported */
IMPORT_ASPECT_NETLIST = 1
-} plug_import_aspect_t;
+} pcb_plug_import_aspect_t;
-typedef struct plug_import_s plug_import_t;
-struct plug_import_s {
- plug_import_t *next;
+typedef struct pcb_plug_import_s pcb_plug_import_t;
+struct pcb_plug_import_s {
+ pcb_plug_import_t *next;
void *plugin_data;
/* Check if the plugin supports format fmt. Return 0 if not supported or
an integer priority if supported. The higher the prio is the more likely
the plugin gets the next operation on the file. Base prio should be 100
for native formats. Return non-0 only if all aspects are supported. */
- int (*fmt_support_prio)(plug_import_t *ctx, unsigned int aspects, FILE *f, const char *filename);
+ int (*fmt_support_prio)(pcb_plug_import_t *ctx, unsigned int aspects, FILE *f, const char *filename);
/* Perform the import; return 0 on success */
- int (*import)(plug_import_t *ctx, unsigned int aspects, const char *fn);
+ int (*import)(pcb_plug_import_t *ctx, unsigned int aspects, const char *fn);
};
-extern plug_import_t *plug_import_chain;
+extern pcb_plug_import_t *pcb_plug_import_chain;
/********** hook wrappers **********/
int pcb_import(char *filename, unsigned int aspect);
-int ImportNetlist(char *);
+int pcb_import_netlist(char *);
#endif
diff --git a/src/plug_io.c b/src/plug_io.c
index 352356c..10567b6 100644
--- a/src/plug_io.c
+++ b/src/plug_io.c
@@ -42,24 +42,16 @@
#include "conf_core.h"
#include <locale.h>
-#include "global.h"
-
#include <dirent.h>
-#include <time.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "buffer.h"
#include "change.h"
-#include "create.h"
#include "data.h"
#include "error.h"
#include "plug_io.h"
-#include "misc.h"
#include "remove.h"
-#include "set.h"
#include "paths.h"
#include "rats_patch.h"
#include "hid_actions.h"
@@ -70,11 +62,13 @@
#include "compat_misc.h"
#include "route_style.h"
#include "compat_fs.h"
+#include "compat_nls.h"
+#include "layer_vis.h"
/* for opendir */
#include "compat_inc.h"
-plug_io_t *plug_io_chain = NULL;
+pcb_plug_io_t *pcb_plug_io_chain = NULL;
int pcb_io_err_inhibit = 0;
static void plug_io_err(int res, const char *what, const char *filename)
@@ -83,7 +77,7 @@ static void plug_io_err(int res, const char *what, const char *filename)
return;
if (res != 0) {
const char *reason = "", *comment = "";
- if (plug_io_chain != NULL) {
+ if (pcb_plug_io_chain != NULL) {
if (filename == NULL) {
reason = "none of io plugins could successfully write the file";
filename = "";
@@ -105,65 +99,107 @@ static void plug_io_err(int res, const char *what, const char *filename)
if (filename == NULL)
filename = "";
}
- Message(PCB_MSG_DEFAULT, "IO error during %s: %s %s %s\n", what, reason, filename, comment);
+ pcb_message(PCB_MSG_ERROR, "IO error during %s: %s %s %s\n", what, reason, filename, comment);
}
}
-int ParsePCB(PCBTypePtr Ptr, const char *Filename, const char *fmt, int load_settings)
+int pcb_parse_pcb(pcb_board_t *Ptr, const char *Filename, const char *fmt, int load_settings, int ignore_missing)
{
- int res = -1;
+ int res = -1, len, n;
+ pcb_find_io_t available[PCB_IO_MAX_FORMATS];
+ int accepts[PCB_IO_MAX_FORMATS]; /* test-parse output */
+ FILE *ft;
+ int accept_total = 0;
+
+ ft = fopen(Filename, "r");
+ if (ft == NULL) {
+ if (!ignore_missing)
+ pcb_message(PCB_MSG_ERROR, "Error: can't open %s for reading (format is %s)\n", Filename, fmt);
+ return -1;
+ }
if (load_settings)
- event(EVENT_LOAD_PRE, "s", Filename);
+ pcb_event(PCB_EVENT_LOAD_PRE, "s", Filename);
Ptr->Data->loader = NULL;
+ len = pcb_find_io(available, sizeof(available)/sizeof(available[0]), PCB_IOT_PCB, 0, fmt);
if (fmt != NULL) {
- pcb_find_io_t available[PCB_IO_MAX_FORMATS];
- int len, n;
- len = pcb_find_io(available, sizeof(available)/sizeof(available[0]), PCB_IOT_PCB, 0, fmt);
- if (len <= 0) {
- Message(PCB_MSG_DEFAULT, "Error: can't find a IO_ plugin to load a PCB using format %s\n", fmt);
+ /* explicit format */
+ for(n = 0; n < len; n++) {
+ if (available[n].plug->parse_pcb != NULL) {
+ accepts[n] = 1; /* force-accept - if it can handle the format, and the user explicitly wanted this format, let's try it */
+ accept_total++;
+ }
+ }
+
+ if (accept_total <= 0) {
+ pcb_message(PCB_MSG_ERROR, "can't find a IO_ plugin to load a PCB using format %s\n", fmt);
+ fclose(ft);
return -1;
}
+
+ if (accept_total > 1) {
+ pcb_message(PCB_MSG_INFO, "multiple IO_ plugins can handle format %s - I'm going to try them all, but you may want to be more specific next time; formats found:\n", fmt);
+ for(n = 0; n < len; n++)
+ pcb_message(PCB_MSG_INFO, " %s\n", available[n].plug->description);
+ }
+ }
+ else {
+ /* test-parse with all plugins to see who can handle the syntax */
for(n = 0; n < len; n++) {
- if (available[0].plug->parse_pcb == NULL)
- continue;
- res = available[0].plug->parse_pcb(available[0].plug, Ptr, Filename, load_settings);
- if (res == 0) {
- Ptr->Data->loader = available[0].plug;
- break;
+ if ((available[n].plug->test_parse_pcb == NULL) || (available[n].plug->test_parse_pcb(available[n].plug, Ptr, Filename, ft))) {
+ accepts[n] = 1;
+ accept_total++;
+ rewind(ft);
}
+ else
+ accepts[n] = 0;
+ }
+ }
+ fclose(ft);
+
+ if (accept_total == 0) {
+ pcb_message(PCB_MSG_ERROR, "none of the IO_ plugin recognized the file format of %s - it's either not a valid board file or does not match the format specified\n", Filename);
+ return -1;
+ }
+
+ /* try all plugins that said it could handle the file */
+ for(n = 0; n < len; n++) {
+ if ((available[n].plug->parse_pcb == NULL) || (!accepts[n])) /* can't parse or doesn't want to parse this file */
+ continue;
+ res = available[n].plug->parse_pcb(available[n].plug, Ptr, Filename, load_settings);
+ if (res == 0) {
+ Ptr->Data->loader = available[n].plug;
+ break;
}
}
- else /* try all parsers until we find one that works */
- HOOK_CALL_DO(plug_io_t, plug_io_chain, parse_pcb, res, == 0, (self, Ptr, Filename, load_settings), if (Ptr->Data->loader == NULL) Ptr->Data->loader = self);
if ((res == 0) && (load_settings))
conf_load_project(NULL, Filename);
if (load_settings)
- event(EVENT_LOAD_POST, "si", Filename, res);
+ pcb_event(PCB_EVENT_LOAD_POST, "si", Filename, res);
plug_io_err(res, "load pcb", Filename);
return res;
}
-int ParseElement(DataTypePtr Ptr, const char *name)
+int pcb_parse_element(pcb_data_t *Ptr, const char *name)
{
int res = -1;
Ptr->loader = NULL;
- HOOK_CALL_DO(plug_io_t, plug_io_chain, parse_element, res, == 0, (self, Ptr, name), Ptr->loader = self);
+ PCB_HOOK_CALL_DO(pcb_plug_io_t, pcb_plug_io_chain, parse_element, res, == 0, (self, Ptr, name), Ptr->loader = self);
plug_io_err(res, "load element", name);
return res;
}
-int ParseFont(FontTypePtr Ptr, char *Filename)
+int pcb_parse_font(pcb_font_t *Ptr, char *Filename)
{
int res = -1;
- HOOK_CALL(plug_io_t, plug_io_chain, parse_font, res, == 0, (self, Ptr, Filename));
+ PCB_HOOK_CALL(pcb_plug_io_t, pcb_plug_io_chain, parse_font, res, == 0, (self, Ptr, Filename));
plug_io_err(res, "load font", Filename);
return res;
@@ -177,7 +213,7 @@ static int find_prio_cmp(const void *p1, const void *p2)
return -1;
}
-int pcb_find_io(pcb_find_io_t *available, int avail_len, plug_iot_t typ, int is_wr, const char *fmt)
+int pcb_find_io(pcb_find_io_t *available, int avail_len, pcb_plug_iot_t typ, int is_wr, const char *fmt)
{
int len = 0;
@@ -194,7 +230,7 @@ int pcb_find_io(pcb_find_io_t *available, int avail_len, plug_iot_t typ, int is_
} \
} while(0)
- HOOK_CALL_ALL(plug_io_t, plug_io_chain, fmt_support_prio, cb_append, (self, typ, is_wr, (fmt == NULL ? self->default_fmt : fmt)));
+ PCB_HOOK_CALL_ALL(pcb_plug_io_t, pcb_plug_io_chain, fmt_support_prio, cb_append, (self, typ, is_wr, (fmt == NULL ? self->default_fmt : fmt)));
if (len > 0)
qsort(available, len, sizeof(available[0]), find_prio_cmp);
@@ -204,14 +240,34 @@ int pcb_find_io(pcb_find_io_t *available, int avail_len, plug_iot_t typ, int is_
}
/* Find the plugin that offers the highest write prio for the format */
-static plug_io_t *find_writer(plug_iot_t typ, const char *fmt)
+static pcb_plug_io_t *find_writer(pcb_plug_iot_t typ, const char *fmt)
{
pcb_find_io_t available[PCB_IO_MAX_FORMATS];
int len;
if (fmt == NULL) {
-#warning TODO: make this configurable, default to lihata
- fmt = "pcb";
+ if (PCB->Filename != NULL) { /* have a file name, guess from extension */
+ int fn_len = strlen(PCB->Filename);
+ const char *end = PCB->Filename + fn_len;
+ pcb_plug_io_t *n;
+ for(n = pcb_plug_io_chain; n != NULL; n = n->next) {
+ if (n->default_extension != NULL) {
+ int elen = strlen(n->default_extension);
+ if ((elen < fn_len) && (strcmp(end-elen, n->default_extension) == 0))
+ return n;
+ }
+ }
+ }
+ /* no file name or format hint, or file name not recognized: choose the ultimate default */
+ fmt = conf_core.rc.save_final_fallback_fmt;
+ if (fmt == NULL) {
+ pcb_message(PCB_MSG_WARNING, "Saving a file with unknown format: failed to guess format from file name, no value configured in rc/save_final_fallback_fmt - CAN NOT SAVE FILE, try save as.\n");
+ return NULL;
+ }
+ else {
+ if (PCB->Filename != NULL)
+ pcb_message(PCB_MSG_WARNING, "Saving a file with unknown format: failed to guess format from file name, falling back to %s as configured in rc/save_final_fallback_fmt\n", fmt);
+ }
}
len = pcb_find_io(available, sizeof(available)/sizeof(available[0]), typ, 1, fmt);
@@ -223,10 +279,10 @@ static plug_io_t *find_writer(plug_iot_t typ, const char *fmt)
}
-int WriteBuffer(FILE *f, BufferType *buff, const char *fmt)
+int pcb_write_buffer(FILE *f, pcb_buffer_t *buff, const char *fmt)
{
int res, newfmt = 0;
- plug_io_t *p = find_writer(PCB_IOT_BUFFER, fmt);
+ pcb_plug_io_t *p = find_writer(PCB_IOT_BUFFER, fmt);
if (p != NULL) {
res = p->write_buffer(p, f, buff);
@@ -240,10 +296,10 @@ int WriteBuffer(FILE *f, BufferType *buff, const char *fmt)
return res;
}
-int WriteElementData(FILE *f, DataTypePtr e, const char *fmt)
+int pcb_write_element_data(FILE *f, pcb_data_t *e, const char *fmt)
{
int res, newfmt = 0;
- plug_io_t *p = e->loader;
+ pcb_plug_io_t *p = e->loader;
if ((p == NULL) || ((fmt != NULL) && (*fmt != '\0'))) {
p = find_writer(PCB_IOT_FOOTPRINT, fmt);
@@ -263,7 +319,7 @@ int WriteElementData(FILE *f, DataTypePtr e, const char *fmt)
static int pcb_write_pcb(FILE *f, const char *old_filename, const char *new_filename, const char *fmt, pcb_bool emergency)
{
int res, newfmt = 0;
- plug_io_t *p = PCB->Data->loader;
+ pcb_plug_io_t *p = PCB->Data->loader;
if ((p == NULL) || ((fmt != NULL) && (*fmt != '\0'))) {
p = find_writer(PCB_IOT_PCB, fmt);
@@ -271,9 +327,9 @@ static int pcb_write_pcb(FILE *f, const char *old_filename, const char *new_file
}
if (p != NULL) {
- event(EVENT_SAVE_PRE, "s", fmt);
+ pcb_event(PCB_EVENT_SAVE_PRE, "s", fmt);
res = p->write_pcb(p, f, old_filename, new_filename, emergency);
- event(EVENT_SAVE_POST, "si", fmt, res);
+ pcb_event(PCB_EVENT_SAVE_POST, "si", fmt, res);
}
if ((res == 0) && (newfmt))
@@ -289,14 +345,14 @@ static int pcb_write_pcb(FILE *f, const char *old_filename, const char *new_file
* if successful, update some other stuff
*
* If revert is pcb_true, we pass "revert" as a parameter
- * to the HID's PCBChanged action.
+ * to the pcb changed event.
*/
static int real_load_pcb(const char *Filename, const char *fmt, pcb_bool revert, pcb_bool require_font, int how)
{
const char *unit_suffix;
char *new_filename;
- PCBTypePtr newPCB = CreateNewPCB_(pcb_false);
- PCBTypePtr oldPCB;
+ pcb_board_t *newPCB = pcb_board_new_(pcb_false);
+ pcb_board_t *oldPCB;
conf_role_t settings_dest;
#ifdef DEBUG
double elapsed;
@@ -305,7 +361,7 @@ static int real_load_pcb(const char *Filename, const char *fmt, pcb_bool revert,
start = clock();
#endif
- resolve_path(Filename, &new_filename, 0);
+ pcb_path_resolve(Filename, &new_filename, 0);
oldPCB = PCB;
PCB = newPCB;
@@ -313,7 +369,7 @@ static int real_load_pcb(const char *Filename, const char *fmt, pcb_bool revert,
/* mark the default font invalid to know if the file has one */
newPCB->Font.Valid = pcb_false;
- switch(how) {
+ switch(how & 0x0F) {
case 0: settings_dest = CFR_DESIGN; break;
case 1: settings_dest = CFR_DEFAULTPCB; break;
case 2: settings_dest = CFR_invalid; break;
@@ -321,61 +377,57 @@ static int real_load_pcb(const char *Filename, const char *fmt, pcb_bool revert,
}
/* new data isn't added to the undo list */
- if (!ParsePCB(PCB, new_filename, fmt, settings_dest)) {
- RemovePCB(oldPCB);
+ if (!pcb_parse_pcb(PCB, new_filename, fmt, settings_dest, how & 0x10)) {
+ pcb_board_remove(oldPCB);
- CreateNewPCBPost(PCB, 0);
- ResetStackAndVisibility();
+ pcb_board_new_postproc(PCB, 0);
+ pcb_layervis_reset_stack();
if (how == 0) {
/* update cursor location */
- Crosshair.X = PCB_CLAMP(PCB->CursorX, 0, PCB->MaxWidth);
- Crosshair.Y = PCB_CLAMP(PCB->CursorY, 0, PCB->MaxHeight);
+ pcb_crosshair.X = PCB_CLAMP(PCB->CursorX, 0, PCB->MaxWidth);
+ pcb_crosshair.Y = PCB_CLAMP(PCB->CursorY, 0, PCB->MaxHeight);
/* update cursor confinement and output area (scrollbars) */
- ChangePCBSize(PCB->MaxWidth, PCB->MaxHeight);
+ pcb_board_resize(PCB->MaxWidth, PCB->MaxHeight);
}
/* enable default font if necessary */
if (!PCB->Font.Valid) {
- if (require_font)
- Message(PCB_MSG_DEFAULT, _("File '%s' has no font information, using default font\n"), new_filename);
+ if ((require_font) && (!PCB->is_footprint))
+ pcb_message(PCB_MSG_WARNING, _("File '%s' has no font information, using default font\n"), new_filename);
PCB->Font.Valid = pcb_true;
}
/* clear 'changed flag' */
- SetChangedFlag(pcb_false);
+ pcb_board_set_changed_flag(pcb_false);
PCB->Filename = new_filename;
/* just in case a bad file saved file is loaded */
/* Use attribute PCB::grid::unit as unit, if we can */
- unit_suffix = AttributeGet(PCB, "PCB::grid::unit");
+ unit_suffix = pcb_attrib_get(PCB, "PCB::grid::unit");
if (unit_suffix && *unit_suffix) {
- const Unit *new_unit = get_unit_struct(unit_suffix);
+ const pcb_unit_t *new_unit = get_unit_struct(unit_suffix);
if (new_unit)
conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE);
}
- AttributePut(PCB, "PCB::grid::unit", conf_core.editor.grid_unit->suffix);
+ pcb_attrib_put(PCB, "PCB::grid::unit", conf_core.editor.grid_unit->suffix);
pcb_sort_netlist();
- rats_patch_make_edited(PCB);
+ pcb_ratspatch_make_edited(PCB);
/* set route style to the first one, if the current one doesn't
happen to match any. This way, "revert" won't change the route style. */
- if (hid_get_flag("GetStyle()") < 0)
+ if (pcb_hid_get_flag("GetStyle()") < 0)
pcb_use_route_style_idx(&PCB->RouteStyle, 0);
- if (((how == 0) || (revert)) && (gui != NULL)) {
- if (revert)
- hid_actionl("PCBChanged", "revert", NULL);
- else
- hid_action("PCBChanged");
- }
+ if ((how == 0) || (revert))
+ pcb_board_changed(revert);
#ifdef DEBUG
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
- gui->log("Loading file %s took %f seconds of CPU time\n", new_filename, elapsed);
+ pcb_gui->log("Loading file %s took %f seconds of CPU time\n", new_filename, elapsed);
#endif
return (0);
@@ -384,18 +436,17 @@ static int real_load_pcb(const char *Filename, const char *fmt, pcb_bool revert,
PCB = oldPCB;
if (PCB == NULL) {
/* bozo: we are trying to revert back to a non-existing pcb... create one to avoid a segfault */
- PCB = CreateNewPCB_(pcb_false);
+ PCB = pcb_board_new_(pcb_false);
if (PCB == NULL) {
- Message(PCB_MSG_DEFAULT, "FATAL: can't create a new empty pcb!");
+ pcb_message(PCB_MSG_ERROR, "FATAL: can't create a new empty pcb!");
exit(1);
}
}
- if (gui != NULL)
- hid_action("PCBChanged");
+ pcb_board_changed(0);
/* release unused memory */
- RemovePCB(newPCB);
+ pcb_board_remove(newPCB);
return (1);
}
@@ -412,7 +463,7 @@ static char *TMPFilename = NULL;
* Flag helper functions
*/
-#define F2S(OBJ, TYPE) flags_to_string ((OBJ)->Flags, TYPE)
+#define F2S(OBJ, TYPE) pcb_strflg_f2s((OBJ)->Flags, TYPE)
/* --------------------------------------------------------------------------- */
@@ -445,8 +496,8 @@ static int netlist_sort_offset = 0;
static int netlist_sort(const void *va, const void *vb)
{
- const LibraryMenuType *am = (const LibraryMenuType *) va;
- const LibraryMenuType *bm = (const LibraryMenuType *) vb;
+ const pcb_lib_menu_t *am = (const pcb_lib_menu_t *) va;
+ const pcb_lib_menu_t *bm = (const pcb_lib_menu_t *) vb;
const char *a = am->Name;
const char *b = bm->Name;
if (*a == '~')
@@ -458,14 +509,14 @@ static int netlist_sort(const void *va, const void *vb)
static int netnode_sort(const void *va, const void *vb)
{
- const LibraryEntryType *am = (const LibraryEntryType *) va;
- const LibraryEntryType *bm = (const LibraryEntryType *) vb;
+ const pcb_lib_entry_t *am = (const pcb_lib_entry_t *) va;
+ const pcb_lib_entry_t *bm = (const pcb_lib_entry_t *) vb;
const char *a = am->ListEntry;
const char *b = bm->ListEntry;
return string_cmp(a, b);
}
-void sort_library(LibraryTypePtr lib)
+void pcb_library_sort(pcb_lib_t *lib)
{
int i;
qsort(lib->Menu, lib->MenuN, sizeof(lib->Menu[0]), netlist_sort);
@@ -476,18 +527,18 @@ void sort_library(LibraryTypePtr lib)
void pcb_sort_netlist()
{
netlist_sort_offset = 2;
- sort_library(&(PCB->NetlistLib[NETLIST_INPUT]));
+ pcb_library_sort(&(PCB->NetlistLib[PCB_NETLIST_INPUT]));
netlist_sort_offset = 0;
}
/* ---------------------------------------------------------------------------
* opens a file and check if it exists
*/
-FILE *CheckAndOpenFile(const char *Filename, pcb_bool Confirm, pcb_bool AllButton, pcb_bool * WasAllButton, pcb_bool * WasCancelButton)
+FILE *pcb_check_and_open_file(const char *Filename, pcb_bool Confirm, pcb_bool AllButton, pcb_bool * WasAllButton, pcb_bool * WasCancelButton)
{
FILE *fp = NULL;
struct stat buffer;
- char message[MAXPATHLEN + 80];
+ char message[PCB_PATH_MAX + 80];
int response;
if (Filename && *Filename) {
@@ -498,9 +549,9 @@ FILE *CheckAndOpenFile(const char *Filename, pcb_bool Confirm, pcb_bool AllButto
if (WasCancelButton)
*WasCancelButton = pcb_false;
if (AllButton)
- response = gui->confirm_dialog(message, "Cancel", "Ok", AllButton ? "Sequence OK" : 0);
+ response = pcb_gui->confirm_dialog(message, "Cancel", "Ok", AllButton ? "Sequence OK" : 0);
else
- response = gui->confirm_dialog(message, "Cancel", "Ok", "Sequence OK");
+ response = pcb_gui->confirm_dialog(message, "Cancel", "Ok", "Sequence OK");
switch (response) {
case 2:
@@ -513,7 +564,7 @@ FILE *CheckAndOpenFile(const char *Filename, pcb_bool Confirm, pcb_bool AllButto
}
}
if ((fp = fopen(Filename, "w")) == NULL)
- OpenErrorMessage(Filename);
+ pcb_open_error_message(Filename);
}
return (fp);
}
@@ -521,7 +572,7 @@ FILE *CheckAndOpenFile(const char *Filename, pcb_bool Confirm, pcb_bool AllButto
/* ---------------------------------------------------------------------------
* opens a file for saving connection data
*/
-FILE *OpenConnectionDataFile(void)
+FILE *pcb_open_connection_file(void)
{
char *fname;
FILE *fp;
@@ -529,7 +580,7 @@ FILE *OpenConnectionDataFile(void)
pcb_bool result; /* not used */
/* CheckAndOpenFile deals with the case where fname already exists */
- fname = gui->fileselect(_("Save Connection Data As ..."),
+ fname = pcb_gui->fileselect(_("Save Connection Data As ..."),
_("Choose a file to save all connection data to."), default_file, ".net", "connection_data", 0);
if (fname == NULL)
return NULL;
@@ -542,7 +593,7 @@ FILE *OpenConnectionDataFile(void)
if (fname && *fname)
default_file = pcb_strdup(fname);
- fp = CheckAndOpenFile(fname, pcb_true, pcb_false, &result, NULL);
+ fp = pcb_check_and_open_file(fname, pcb_true, pcb_false, &result, NULL);
free(fname);
return fp;
@@ -551,31 +602,31 @@ FILE *OpenConnectionDataFile(void)
/* ---------------------------------------------------------------------------
* save elements in the current buffer
*/
-int SaveBufferElements(const char *Filename, const char *fmt)
+int pcb_save_buffer_elements(const char *Filename, const char *fmt)
{
int result;
- if (SWAP_IDENT)
- pcb_swap_buffers();
- result = WritePipe(Filename, pcb_false, fmt);
- if (SWAP_IDENT)
- pcb_swap_buffers();
+ if (PCB_SWAP_IDENT)
+ pcb_buffers_flip_side();
+ result = pcb_write_pipe(Filename, pcb_false, fmt);
+ if (PCB_SWAP_IDENT)
+ pcb_buffers_flip_side();
return (result);
}
/* ---------------------------------------------------------------------------
* save PCB
*/
-int SavePCB(const char *file, const char *fmt)
+int pcb_save_pcb(const char *file, const char *fmt)
{
int retcode;
- if (gui->notify_save_pcb == NULL)
- return WritePipe(file, pcb_true, fmt);
+ if (pcb_gui->notify_save_pcb == NULL)
+ return pcb_write_pipe(file, pcb_true, fmt);
- gui->notify_save_pcb(file, pcb_false);
- retcode = WritePipe(file, pcb_true, fmt);
- gui->notify_save_pcb(file, pcb_true);
+ pcb_gui->notify_save_pcb(file, pcb_false);
+ retcode = pcb_write_pipe(file, pcb_true, fmt);
+ pcb_gui->notify_save_pcb(file, pcb_true);
return retcode;
}
@@ -584,7 +635,7 @@ int SavePCB(const char *file, const char *fmt)
/* ---------------------------------------------------------------------------
* Load PCB
*/
-int LoadPCB(const char *file, const char *fmt, pcb_bool require_font, int how)
+int pcb_load_pcb(const char *file, const char *fmt, pcb_bool require_font, int how)
{
return real_load_pcb(file, fmt, pcb_false, require_font, how);
}
@@ -592,15 +643,15 @@ int LoadPCB(const char *file, const char *fmt, pcb_bool require_font, int how)
/* ---------------------------------------------------------------------------
* Revert PCB
*/
-int RevertPCB(void)
+int pcb_revert_pcb(void)
{
- return real_load_pcb(PCB->Filename, NULL, pcb_true, pcb_true, pcb_true);
+ return real_load_pcb(PCB->Filename, NULL, pcb_true, pcb_true, 1);
}
/* ---------------------------------------------------------------------------
* writes the quoted string created by another subroutine
*/
-void PrintQuotedString(FILE * FP, const char *S)
+void pcb_print_quoted_string(FILE * FP, const char *S)
{
const char *start;
@@ -626,33 +677,33 @@ void PrintQuotedString(FILE * FP, const char *S)
* this is used for fatal errors and does not call the program specified
* in 'saveCommand' for safety reasons
*/
-void SaveInTMP(void)
+void pcb_save_in_tmp(void)
{
char filename[256];
/* memory might have been released before this function is called */
if (PCB && PCB->Changed && (conf_core.rc.emergency_name != NULL) && (*conf_core.rc.emergency_name != '\0')) {
sprintf(filename, conf_core.rc.emergency_name, (long int)pcb_getpid());
- Message(PCB_MSG_DEFAULT, _("Trying to save your layout in '%s'\n"), filename);
- WritePCBFile(filename, pcb_true, DEFAULT_FMT, pcb_true);
+ pcb_message(PCB_MSG_INFO, _("Trying to save your layout in '%s'\n"), filename);
+ pcb_write_pcb_file(filename, pcb_true, DEFAULT_FMT, pcb_true);
}
}
/* ---------------------------------------------------------------------------
- * front-end for 'SaveInTMP()'
+ * front-end for 'pcb_save_in_tmp()'
* just makes sure that the routine is only called once
*/
static pcb_bool dont_save_any_more = pcb_false;
-void EmergencySave(void)
+void pcb_emergency_save(void)
{
if (!dont_save_any_more) {
dont_save_any_more = pcb_true;
- SaveInTMP();
+ pcb_save_in_tmp();
}
}
-void DisableEmergencySave(void)
+void pcb_disable_emergency_save(void)
{
dont_save_any_more = pcb_true;
}
@@ -661,92 +712,35 @@ void DisableEmergencySave(void)
* Callback for the autosave
*/
-static hidval backup_timer;
+static pcb_hidval_t backup_timer;
/*
* If the backup interval is > 0 then set another timer. Otherwise
- * we do nothing and it is up to the GUI to call EnableAutosave()
+ * we do nothing and it is up to the GUI to call pcb_enable_autosave()
* after setting conf_core.rc.backup_interval > 0 again.
*/
-static void backup_cb(hidval data)
+static void backup_cb(pcb_hidval_t data)
{
backup_timer.ptr = NULL;
- Backup();
- if (conf_core.rc.backup_interval > 0 && gui->add_timer)
- backup_timer = gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, data);
+ pcb_backup();
+ if (conf_core.rc.backup_interval > 0 && pcb_gui->add_timer)
+ backup_timer = pcb_gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, data);
}
-void EnableAutosave(void)
+void pcb_enable_autosave(void)
{
- hidval x;
+ pcb_hidval_t x;
x.ptr = NULL;
/* If we already have a timer going, then cancel it out */
- if (backup_timer.ptr != NULL && gui->stop_timer)
- gui->stop_timer(backup_timer);
+ if (backup_timer.ptr != NULL && pcb_gui->stop_timer)
+ pcb_gui->stop_timer(backup_timer);
backup_timer.ptr = NULL;
/* Start up a new timer */
- if (conf_core.rc.backup_interval > 0 && gui->add_timer)
- backup_timer = gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, x);
-}
-
-int pcb_build_fn_cb(gds_t *s, const char **input)
-{
- char buff[20];
-
- switch(**input) {
- case 'P':
- sprintf(buff, "%.8i", pcb_getpid());
- gds_append_str(s, buff);
- (*input)++;
- return 0;
- case 'F':
- gds_append_str(s, (PCB->Filename != NULL) ? PCB->Filename : "no_file_name");
- (*input)++;
- return 0;
- case 'B':
- if (PCB->Filename != NULL) {
- char *bn = strrchr(PCB->Filename, '/');
- if (bn != NULL)
- bn++;
- else
- bn = PCB->Filename;
- gds_append_str(s, bn);
- }
- else
- gds_append_str(s, "no_file_name");
- (*input)++;
- return 0;
- case 'D':
- if (PCB->Filename != NULL) {
- char *bn = strrchr(PCB->Filename, '/');
- if (bn != NULL)
- gds_append_len(s, PCB->Filename, bn-PCB->Filename+1);
- else
- gds_append_str(s, "./");
- }
- else
- gds_append_str(s, "./");
- (*input)++;
- return 0;
- case 'N':
- gds_append_str(s, (PCB->Name != NULL) ? PCB->Name : "no_name");
- (*input)++;
- return 0;
- case 'T':
- sprintf(buff, "%lu", (unsigned long int)time(NULL));
- gds_append_str(s, buff);
- (*input)++;
- return 0;
- }
- return -1;
-}
-
-static char *build_fn(const char *template)
-{
- return pcb_strdup_subst(template, pcb_build_fn_cb);
+ if (conf_core.rc.backup_interval > 0 && pcb_gui->add_timer)
+ backup_timer = pcb_gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, x);
}
/* ---------------------------------------------------------------------------
@@ -754,28 +748,28 @@ static char *build_fn(const char *template)
* a "-" appended (like "foo.pcb-") and if we don't have a pcb file name
* then use the template in conf_core.rc.backup_name
*/
-void Backup(void)
+void pcb_backup(void)
{
char *filename = NULL;
if (PCB && PCB->Filename) {
filename = (char *) malloc(sizeof(char) * (strlen(PCB->Filename) + 2));
if (filename == NULL) {
- fprintf(stderr, "Backup(): malloc failed\n");
+ fprintf(stderr, "pcb_backup(): malloc failed\n");
exit(1);
}
sprintf(filename, "%s-", PCB->Filename);
}
else {
/* conf_core.rc.backup_name has %.8i which will be replaced by the process ID */
- filename = build_fn(conf_core.rc.backup_name);
+ filename = pcb_build_fn(conf_core.rc.backup_name);
if (filename == NULL) {
- fprintf(stderr, "Backup(): can't build file name for a backup\n");
+ fprintf(stderr, "pcb_backup(): can't build file name for a backup\n");
exit(1);
}
}
- WritePCBFile(filename, pcb_true, DEFAULT_FMT, pcb_true);
+ pcb_write_pcb_file(filename, pcb_true, NULL, pcb_true);
free(filename);
}
@@ -786,10 +780,10 @@ void Backup(void)
* before LEX and YACC functions are called because they are able to abort
* the program.
*/
-void SaveTMPData(void)
+void pcb_tmp_data_save(void)
{
- char *fn = build_fn(conf_core.rc.emergency_name);
- WritePCBFile(fn, pcb_true, DEFAULT_FMT, pcb_true);
+ char *fn = pcb_build_fn(conf_core.rc.emergency_name);
+ pcb_write_pcb_file(fn, pcb_true, NULL, pcb_true);
if (TMPFilename != NULL)
free(TMPFilename);
TMPFilename = fn;
@@ -798,7 +792,7 @@ void SaveTMPData(void)
/* ---------------------------------------------------------------------------
* removes the temporary copy of the data file
*/
-void RemoveTMPData(void)
+void pcb_tmp_data_remove(void)
{
if (TMPFilename != NULL)
unlink(TMPFilename);
@@ -810,16 +804,16 @@ static int pcb_write_file(FILE *fp, pcb_bool thePcb, const char *old_path, const
{
if (thePcb) {
if (PCB->is_footprint)
- return WriteElementData(fp, PCB->Data, fmt);
+ return pcb_write_element_data(fp, PCB->Data, fmt);
return pcb_write_pcb(fp, old_path, new_path, fmt, emergency);
}
- return WriteBuffer(fp, PASTEBUFFER, fmt);
+ return pcb_write_buffer(fp, PCB_PASTEBUFFER, fmt);
}
/* ---------------------------------------------------------------------------
* writes PCB to file
*/
-int WritePCBFile(const char *Filename, pcb_bool thePcb, const char *fmt, pcb_bool emergency)
+int pcb_write_pcb_file(const char *Filename, pcb_bool thePcb, const char *fmt, pcb_bool emergency)
{
FILE *fp;
int result, overwrite;
@@ -838,15 +832,15 @@ int WritePCBFile(const char *Filename, pcb_bool thePcb, const char *fmt, pcb_boo
Filename = fn_tmp;
}
else {
- Message(PCB_MSG_ERROR, "Can't rename %s to %s before save\n", Filename, fn_tmp);
+ pcb_message(PCB_MSG_ERROR, "Can't rename %s to %s before save\n", Filename, fn_tmp);
return -1;
}
}
}
if ((fp = fopen(Filename, "w")) == NULL) {
- OpenErrorMessage(Filename);
- return (STATUS_ERROR);
+ pcb_open_error_message(Filename);
+ return (-1);
}
result = pcb_write_file(fp, thePcb, fn_tmp, Filename, fmt, emergency);
@@ -865,15 +859,15 @@ int WritePCBFile(const char *Filename, pcb_bool thePcb, const char *fmt, pcb_boo
* writes to pipe using the command defined by conf_core.rc.save_command
* %f are replaced by the passed filename
*/
-int WritePipe(const char *Filename, pcb_bool thePcb, const char *fmt)
+int pcb_write_pipe(const char *Filename, pcb_bool thePcb, const char *fmt)
{
FILE *fp;
int result;
const char *p;
static gds_t command;
- if (EMPTY_STRING_P(conf_core.rc.save_command))
- return WritePCBFile(Filename, thePcb, fmt, pcb_false);
+ if (PCB_EMPTY_STRING_P(conf_core.rc.save_command))
+ return pcb_write_pcb_file(Filename, thePcb, fmt, pcb_false);
/* setup commandline */
gds_truncate(&command,0);
@@ -890,17 +884,17 @@ int WritePipe(const char *Filename, pcb_bool thePcb, const char *fmt)
}
printf("write to pipe \"%s\"\n", command.array);
if ((fp = popen(command.array, "w")) == NULL) {
- PopenErrorMessage(command.array);
- return (STATUS_ERROR);
+ pcb_popen_error_message(command.array);
+ return (-1);
}
result = pcb_write_file(fp, thePcb, NULL, NULL, fmt, pcb_false);
- return (pclose(fp) ? STATUS_ERROR : result);
+ return (pclose(fp) ? (-1) : result);
}
-int pcb_io_list(pcb_io_formats_t *out, plug_iot_t typ, int wr, int do_digest)
+int pcb_io_list(pcb_io_formats_t *out, pcb_plug_iot_t typ, int wr, int do_digest, pcb_io_list_ext_t ext)
{
pcb_find_io_t available[PCB_IO_MAX_FORMATS];
int n;
@@ -911,14 +905,21 @@ int pcb_io_list(pcb_io_formats_t *out, plug_iot_t typ, int wr, int do_digest)
if (out->len == 0)
return 0;
- for(n = 0; n < out->len; n++)
+ for(n = 0; n < out->len; n++) {
out->plug[n] = available[n].plug;
+ switch(ext) {
+ case PCB_IOL_EXT_NONE: out->extension[n] = NULL; break;
+ case PCB_IOL_EXT_BOARD: out->extension[n] = out->plug[n]->default_extension; break;
+ case PCB_IOL_EXT_FP: out->extension[n] = out->plug[n]->fp_extension; break;
+ }
+ }
if (do_digest) {
for(n = 0; n < out->len; n++)
out->digest[n] = pcb_strdup_printf("%s (%s)", out->plug[n]->default_fmt, out->plug[n]->description);
out->digest[n] = NULL;
}
+
return out->len;
}
diff --git a/src/plug_io.h b/src/plug_io.h
index d28c08c..3f3fa87 100644
--- a/src/plug_io.h
+++ b/src/plug_io.h
@@ -28,7 +28,8 @@
#ifndef PCB_PLUG_IO_H
#define PCB_PLUG_IO_H
-#include "global.h"
+#include "library.h"
+#include "global_typedefs.h"
#include "conf.h"
typedef enum { /* I/O type bitmask; each bit is one thing to save or load, not all formats support all things */
@@ -36,11 +37,11 @@ typedef enum { /* I/O type bitmask; each bit is one thing to save or load, not a
PCB_IOT_FOOTPRINT = 2,
PCB_IOT_FONT = 4,
PCB_IOT_BUFFER = 8
-} plug_iot_t;
+} pcb_plug_iot_t;
/**************************** API definition *********************************/
-struct plug_io_s {
- plug_io_t *next;
+struct pcb_plug_io_s {
+ pcb_plug_io_t *next;
void *plugin_data;
/* Check if the plugin supports format fmt, for writing (if wr != 0) or for
@@ -52,26 +53,34 @@ struct plug_io_s {
one; for ordering plugins in that case, the format-neutral
save_preference_prio field is used.
*/
- int (*fmt_support_prio)(plug_io_t *ctx, plug_iot_t typ, int wr, const char *fmt);
+ int (*fmt_support_prio)(pcb_plug_io_t *ctx, pcb_plug_iot_t typ, int wr, const char *fmt);
+
+ /* Test if the given board is readable by the plugin. The plugin should return
+ 1 if it can handle the file or 0 if it can not. This check is not a deep
+ syntax analysis; the plugin should read barely enough headers to decide if
+ the file contains a the format it expect, then return error from parse_pcb
+ if there are syntax errors later. The file is open for read and positioned
+ to file begin in f */
+ int (*test_parse_pcb)(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, FILE *f);
/* Attempt to load a pcb design from Filename to Ptr.
Conf subtree at settings_dest is replaced by settings loaded from the
file unless it's CFR_invalid.
Return 0 on success. */
- int (*parse_pcb)(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest);
+ int (*parse_pcb)(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest);
/* Attempt to load an element from Filename to Ptr. Return 0 on success. */
- int (*parse_element)(plug_io_t *ctx, DataTypePtr Ptr, const char *name);
+ int (*parse_element)(pcb_plug_io_t *ctx, pcb_data_t *Ptr, const char *name);
/* Attempt to load fonts from a file. Return 0 on success. */
- int (*parse_font)(plug_io_t *ctx, FontTypePtr Ptr, const char *Filename);
+ int (*parse_font)(pcb_plug_io_t *ctx, pcb_font_t *Ptr, const char *Filename);
/* Write the buffer to a file. Return 0 on success. */
- int (*write_buffer)(plug_io_t *ctx, FILE *f, BufferType *buff);
+ int (*write_buffer)(pcb_plug_io_t *ctx, FILE *f, pcb_buffer_t *buff);
/* Write element data to a file. Return 0 on success. */
- int (*write_element)(plug_io_t *ctx, FILE *f, DataTypePtr e);
+ int (*write_element)(pcb_plug_io_t *ctx, FILE *f, pcb_data_t *e);
/* Write PCB to f; there's a copy of the file we are going to
"overwrite", named in old_filename and the new file name we are
@@ -79,45 +88,48 @@ struct plug_io_s {
into a pipe. If emergency is true, do the safest save possible,
don't mind formatting and extras.
Return 0 on success. */
- int (*write_pcb)(plug_io_t *ctx, FILE *f, const char *old_filename, const char *new_filename, pcb_bool emergency);
+ int (*write_pcb)(pcb_plug_io_t *ctx, FILE *f, const char *old_filename, const char *new_filename, pcb_bool emergency);
const char *default_fmt;
const char *description;
+ const char *default_extension; /* used to generate save-as filename */
+ const char *fp_extension; /* used to generate save-as filename for footprints */
+ const char *mime_type;
int save_preference_prio; /* all available save plugins are sorted by this before presenting them to the user to choose one */
};
-extern plug_io_t *plug_io_chain;
+extern pcb_plug_io_t *pcb_plug_io_chain;
/********** hook wrappers **********/
-int ParsePCB(PCBTypePtr Ptr, const char *Filename, const char *fmt, int load_settings);
-int ParseElement(DataTypePtr Ptr, const char *name);
-int ParseFont(FontTypePtr Ptr, char *Filename);
-int WriteBuffer(FILE *f, BufferType *buff, const char *fmt);
-int WriteElementData(FILE *f, DataTypePtr e, const char *fmt);
+int pcb_parse_pcb(pcb_board_t *Ptr, const char *Filename, const char *fmt, int load_settings, int ignore_missing);
+int pcb_parse_element(pcb_data_t *Ptr, const char *name);
+int pcb_parse_font(pcb_font_t *Ptr, char *Filename);
+int pcb_write_buffer(FILE *f, pcb_buffer_t *buff, const char *fmt);
+int pcb_write_element_data(FILE *f, pcb_data_t *e, const char *fmt);
/********** common function used to be part of file.[ch] and friends **********/
-FILE *CheckAndOpenFile(const char *, pcb_bool, pcb_bool, pcb_bool *, pcb_bool *);
-FILE *OpenConnectionDataFile(void);
-int SavePCB(const char *, const char *fmt);
-int LoadPCB(const char *name, const char *fmt, pcb_bool, int how); /* how: 0=normal pcb; 1=default.pcb, 2=misc (do not load settings) */
-void EnableAutosave(void);
-void Backup(void);
-void SaveInTMP(void);
-void EmergencySave(void);
-void DisableEmergencySave(void);
-int RevertPCB(void);
-int SaveBufferElements(const char *, const char *fmt);
+FILE *pcb_check_and_open_file(const char *, pcb_bool, pcb_bool, pcb_bool *, pcb_bool *);
+FILE *pcb_open_connection_file(void);
+int pcb_save_pcb(const char *, const char *fmt);
+int pcb_load_pcb(const char *name, const char *fmt, pcb_bool, int how); /* how: 0=normal pcb; 1=default.pcb, 2=misc (do not load settings) | 0x10: ignore missing file */
+void pcb_enable_autosave(void);
+void pcb_backup(void);
+void pcb_save_in_tmp(void);
+void pcb_emergency_save(void);
+void pcb_disable_emergency_save(void);
+int pcb_revert_pcb(void);
+int pcb_save_buffer_elements(const char *, const char *fmt);
void pcb_sort_netlist(void);
-void PrintQuotedString(FILE *, const char *);
-void sort_library(LibraryTypePtr lib);
-void set_some_route_style();
-int WritePCBFile(const char *Filename, pcb_bool thePcb, const char *fmt, pcb_bool emergency);
-int WritePipe(const char *, pcb_bool, const char *fmt);
+void pcb_print_quoted_string(FILE *, const char *);
+void pcb_library_sort(pcb_lib_t *lib);
+void pcb_set_some_route_style();
+int pcb_write_pcb_file(const char *Filename, pcb_bool thePcb, const char *fmt, pcb_bool emergency);
+int pcb_write_pipe(const char *, pcb_bool, const char *fmt);
#ifndef HAS_ATEXIT
-void SaveTMPData(void);
-void RemoveTMPData(void);
+void pcb_tmp_data_save(void);
+void pcb_tmp_data_remove(void);
#endif
/********** helpers **********/
@@ -128,15 +140,22 @@ void RemoveTMPData(void);
/* A list of format plugins available for a given purpose */
typedef struct {
int len;
- const plug_io_t *plug[PCB_IO_MAX_FORMATS+1];
- char *digest[PCB_IO_MAX_FORMATS+1]; /* string that contains the format identifier and the description */
+ const pcb_plug_io_t *plug[PCB_IO_MAX_FORMATS+1];
+ char *digest[PCB_IO_MAX_FORMATS+1]; /* string that contains the format identifier and the description (strdup'd) */
+ const char *extension[PCB_IO_MAX_FORMATS+1]; /* default file extension, with the leading . (not strdup'd) */
} pcb_io_formats_t;
+typedef enum {
+ PCB_IOL_EXT_NONE,
+ PCB_IOL_EXT_BOARD,
+ PCB_IOL_EXT_FP
+} pcb_io_list_ext_t;
+
/* Search all io plugins to see if typ/wr is supported. Return an ordered
list in out. If do_digest is non-zero, fill in the digest field. Returns
number of suitable io plugins. Call pcb_io_list_free() on out when it is not
needed anymore. */
-int pcb_io_list(pcb_io_formats_t *out, plug_iot_t typ, int wr, int do_digest);
+int pcb_io_list(pcb_io_formats_t *out, pcb_plug_iot_t typ, int wr, int do_digest, pcb_io_list_ext_t ext);
void pcb_io_list_free(pcb_io_formats_t *out);
extern int pcb_io_err_inhibit;
@@ -151,20 +170,9 @@ do { \
highest prio first. If fmt is NULL, use the default fmt for each plugin.
Return the length of the array. */
typedef struct {
- plug_io_t *plug;
+ pcb_plug_io_t *plug;
int prio;
} pcb_find_io_t;
-int pcb_find_io(pcb_find_io_t *available, int avail_len, plug_iot_t typ, int is_wr, const char *fmt);
-
-
-/* generic file name template substitution callbacks for pcb_strdup_subst:
- %P pid
- %F load-time file name of the current pcb
- %B basename (load-time file name of the current pcb without path)
- %D dirname (load-time file path of the current pcb, without file name, with trailing slash, might be ./)
- %N name of the current pcb
- %T wall time (Epoch)
-*/
-int pcb_build_fn_cb(gds_t *s, const char **input);
+int pcb_find_io(pcb_find_io_t *available, int avail_len, pcb_plug_iot_t typ, int is_wr, const char *fmt);
#endif
diff --git a/src/plugins.c b/src/plugins.c
index 0208493..9302040 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -28,44 +28,46 @@
#include "plugins.h"
/* for the action */
-#include "global.h"
#include "config.h"
#include "genvector/gds_char.h"
#include "compat_misc.h"
+#include "hid.h"
-plugin_info_t *plugins = NULL;
+pcb_plugin_info_t *plugins = NULL;
-plugin_info_t *plugin_find(const char *name)
+pcb_plugin_info_t *plugin_find(const char *name)
{
- plugin_info_t *i;
+ pcb_plugin_info_t *i;
for(i = plugins; i != NULL; i = i->next)
if (strcmp(i->name, name) == 0)
return i;
return NULL;
}
-void plugin_register(const char *name, const char *path, void *handle, int dynamic_loaded, void (*uninit)(void))
+pcb_plugin_info_t *pcb_plugin_register(const char *name, const char *path, void *handle, int dynamic_loaded, void (*uninit)(void))
{
- plugin_info_t *i = malloc(sizeof(plugin_info_t));
+ pcb_plugin_info_t *i = malloc(sizeof(pcb_plugin_info_t));
i->name = pcb_strdup(name);
i->path = pcb_strdup(path);
i->handle = handle;
i->dynamic_loaded = dynamic_loaded;
i->uninit = uninit;
+ i->hash = 0;
i->next = plugins;
plugins = i;
+ return i;
}
-void plugins_init(void)
+void pcb_plugins_init(void)
{
}
-void plugins_uninit(void)
+void pcb_plugins_uninit(void)
{
- plugin_info_t *i, *next;
+ pcb_plugin_info_t *i, *next;
for(i = plugins; i != NULL; i = next) {
next = i->next;
free(i->name);
@@ -80,13 +82,13 @@ void plugins_uninit(void)
/* ---------------------------------------------------------------- */
-static const char manageplugins_syntax[] = "ManagePlugins()\n";
+static const char pcb_acts_ManagePlugins[] = "ManagePlugins()\n";
-static const char manageplugins_help[] = "Manage plugins dialog.";
+static const char pcb_acth_ManagePlugins[] = "Manage plugins dialog.";
-static int ActionManagePlugins(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ManagePlugins(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- plugin_info_t *i;
+ pcb_plugin_info_t *i;
int nump = 0, numb = 0;
gds_t str;
@@ -127,15 +129,15 @@ static int ActionManagePlugins(int argc, const char **argv, Coord x, Coord y)
gds_append_str(&str, " (none)\n");
gds_append_str(&str, "\n\nNOTE: this is the alpha version, can only list plugins/buildins\n");
- gui->report_dialog("Manage plugins", str.array);
+ pcb_gui->report_dialog("Manage plugins", str.array);
gds_uninit(&str);
return 0;
}
-HID_Action plugins_action_list[] = {
- {"ManagePlugins", 0, ActionManagePlugins,
- manageplugins_help, manageplugins_syntax}
+pcb_hid_action_t plugins_action_list[] = {
+ {"ManagePlugins", 0, pcb_act_ManagePlugins,
+ pcb_acth_ManagePlugins, pcb_acts_ManagePlugins}
};
-REGISTER_ACTIONS(plugins_action_list, NULL)
+PCB_REGISTER_ACTIONS(plugins_action_list, NULL)
diff --git a/src/plugins.h b/src/plugins.h
index 0838d69..de000fe 100644
--- a/src/plugins.h
+++ b/src/plugins.h
@@ -26,38 +26,39 @@
#ifndef PCB_RND_PLUGINS_H
#define PCB_RND_PLUGINS_H
-typedef struct plugin_info_s plugin_info_t;
+typedef struct pcb_plugin_info_s pcb_plugin_info_t;
typedef void (*pcb_uninit_t)(void);
-struct plugin_info_s {
+struct pcb_plugin_info_s {
char *name;
char *path;
void *handle;
int dynamic_loaded;
+ unsigned int hash;
pcb_uninit_t uninit;
- plugin_info_t *next;
+ pcb_plugin_info_t *next;
};
-extern plugin_info_t *plugins;
+extern pcb_plugin_info_t *plugins;
/* Init the plugin system */
-void plugins_init(void);
+void pcb_plugins_init(void);
/* Uninit each plugin then uninit the plugin system */
-void plugins_uninit(void);
+void pcb_plugins_uninit(void);
/* Register a new plugin (or buildin) */
-void plugin_register(const char *name, const char *path, void *handle, int dynamic, pcb_uninit_t uninit);
+pcb_plugin_info_t *pcb_plugin_register(const char *name, const char *path, void *handle, int dynamic, pcb_uninit_t uninit);
/* Find a plugin by name */
-plugin_info_t *plugin_find(const char *name);
+pcb_plugin_info_t *plugin_find(const char *name);
/* Hook based plugin generics; plugins that implement a common API should use
HOOK_REGISTER with an api struct. The core should run the plugins using
HOOK_CALL */
-#define HOOK_CALL_DO(chain_type, chain, func, res, accept, funcargs, do_on_success) \
+#define PCB_HOOK_CALL_DO(chain_type, chain, func, res, accept, funcargs, do_on_success) \
do { \
chain_type *self; \
for(self = (chain); self != NULL; self = self->next) { \
@@ -71,10 +72,10 @@ do { \
} \
} while(0)
-#define HOOK_CALL(chain_type, chain, func, res, accept, funcargs) \
- HOOK_CALL_DO(chain_type, chain, func, res, accept, funcargs, (void)0)
+#define PCB_HOOK_CALL(chain_type, chain, func, res, accept, funcargs) \
+ PCB_HOOK_CALL_DO(chain_type, chain, func, res, accept, funcargs, (void)0)
-#define HOOK_CALL_ALL(chain_type, chain, func, cb, funcargs) \
+#define PCB_HOOK_CALL_ALL(chain_type, chain, func, cb, funcargs) \
do { \
chain_type *self; \
for(self = (chain); self != NULL; self = self->next) { \
@@ -86,14 +87,14 @@ do { \
} \
} while(0)
-#define HOOK_REGISTER(chain_type, chain, hstruct) \
+#define PCB_HOOK_REGISTER(chain_type, chain, hstruct) \
do { \
(hstruct)->next = chain; \
chain = (hstruct); \
} while(0)
-#define HOOK_UNREGISTER(chain_type, chain, hstruct) \
+#define PCB_HOOK_UNREGISTER(chain_type, chain, hstruct) \
do { \
chain_type *__n__, *__prev__ = NULL, *__h__ = (hstruct); \
for(__n__ = chain; __n__ != NULL; __n__ = __n__->next) { \
diff --git a/src/polyarea.h b/src/polyarea.h
index fa0801f..817352e 100644
--- a/src/polyarea.h
+++ b/src/polyarea.h
@@ -25,18 +25,9 @@
#ifndef PCB_POLYAREA_H
#define PCB_POLYAREA_H
-typedef int BOOLp;
-
-#ifndef FALSE
-enum {
- FALSE = 0,
- TRUE = 1
-};
-#endif
-
-#define PLF_DIR 1
-#define PLF_INV 0
-#define PLF_MARK 1
+#define PCB_PLF_DIR 1
+#define PCB_PLF_INV 0
+#define PCB_PLF_MARK 1
#ifndef min
#define min(x, y) ((x) < (y) ? (x) : (y))
@@ -47,98 +38,98 @@ enum {
#endif
-typedef Coord vertex[2]; /* longing point representation of
+typedef pcb_coord_t pcb_vertex_t[2]; /* longing point representation of
coordinates */
-typedef vertex Vector;
+typedef pcb_vertex_t pcb_vector_t;
-#define VertexEqu(a,b) (memcmp((a),(b),sizeof(Vector))==0)
-#define VertexCpy(a,b) memcpy((a),(b),sizeof(Vector))
+#define pcb_vertex_equ(a,b) (memcmp((a),(b),sizeof(pcb_vector_t))==0)
+#define pcb_vertex_cpy(a,b) memcpy((a),(b),sizeof(pcb_vector_t))
-extern Vector vect_zero;
+extern pcb_vector_t vect_zero;
enum {
- err_no_memory = 2,
- err_bad_parm = 3,
- err_ok = 0
+ pcb_err_no_memory = 2,
+ pcb_err_bad_parm = 3,
+ pcb_err_ok = 0
};
-typedef struct CVCList CVCList;
-typedef struct VNODE VNODE;
-struct CVCList {
+typedef struct pcb_cvc_list_s pcb_cvc_list_t;
+typedef struct pcb_vnode_s pcb_vnode_t;
+struct pcb_cvc_list_s {
double angle;
- VNODE *parent;
- CVCList *prev, *next, *head;
+ pcb_vnode_t *parent;
+ pcb_cvc_list_t *prev, *next, *head;
char poly, side;
};
-struct VNODE {
- VNODE *next, *prev, *shared;
+struct pcb_vnode_s {
+ pcb_vnode_t *next, *prev, *shared;
struct {
unsigned int status:3;
unsigned int mark:1;
} Flags;
- CVCList *cvc_prev;
- CVCList *cvc_next;
- Vector point;
+ pcb_cvc_list_t *cvc_prev;
+ pcb_cvc_list_t *cvc_next;
+ pcb_vector_t point;
};
-typedef struct PLINE PLINE;
-struct PLINE {
- Coord xmin, ymin, xmax, ymax;
- PLINE *next;
- VNODE head;
+typedef struct pcb_pline_s pcb_pline_t;
+struct pcb_pline_s {
+ pcb_coord_t xmin, ymin, xmax, ymax;
+ pcb_pline_t *next;
+ pcb_vnode_t head;
unsigned int Count;
double area;
- rtree_t *tree;
+ pcb_rtree_t *tree;
pcb_bool is_round;
- Coord cx, cy;
- Coord radius;
+ pcb_coord_t cx, cy;
+ pcb_coord_t radius;
struct {
unsigned int status:3;
unsigned int orient:1;
} Flags;
};
-PLINE *poly_NewContour(Vector v);
+pcb_pline_t *pcb_poly_contour_new(pcb_vector_t v);
-void poly_IniContour(PLINE * c);
-void poly_ClrContour(PLINE * c); /* clears list of vertices */
-void poly_DelContour(PLINE ** c);
+void pcb_poly_contour_init(pcb_pline_t * c);
+void pcb_poly_contour_clear(pcb_pline_t * c); /* clears list of vertices */
+void pcb_poly_contour_del(pcb_pline_t ** c);
-BOOLp poly_CopyContour(PLINE ** dst, PLINE * src);
+pcb_bool pcb_poly_contour_copy(pcb_pline_t ** dst, pcb_pline_t * src);
-void poly_PreContour(PLINE * c, BOOLp optimize); /* prepare contour */
-void poly_InvContour(PLINE * c); /* invert contour */
+void pcb_poly_contour_pre(pcb_pline_t * c, pcb_bool optimize); /* prepare contour */
+void pcb_poly_contour_inv(pcb_pline_t * c); /* invert contour */
-VNODE *poly_CreateNode(Vector v);
+pcb_vnode_t *pcb_poly_node_create(pcb_vector_t v);
-void poly_InclVertex(VNODE * after, VNODE * node);
-void poly_ExclVertex(VNODE * node);
+void pcb_poly_vertex_include(pcb_vnode_t * after, pcb_vnode_t * node);
+void pcb_poly_vertex_exclude(pcb_vnode_t * node);
/**********************************************************************/
-typedef struct POLYAREA POLYAREA;
-struct POLYAREA {
- POLYAREA *f, *b;
- PLINE *contours;
- rtree_t *contour_tree;
+typedef struct pcb_polyarea_s pcb_polyarea_t;
+struct pcb_polyarea_s {
+ pcb_polyarea_t *f, *b;
+ pcb_pline_t *contours;
+ pcb_rtree_t *contour_tree;
};
-BOOLp poly_M_Copy0(POLYAREA ** dst, const POLYAREA * srcfst);
-void poly_M_Incl(POLYAREA ** list, POLYAREA * a);
+pcb_bool pcb_polyarea_m_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * srcfst);
+void pcb_polyarea_m_include(pcb_polyarea_t ** list, pcb_polyarea_t * a);
-BOOLp poly_Copy0(POLYAREA ** dst, const POLYAREA * src);
-BOOLp poly_Copy1(POLYAREA * dst, const POLYAREA * src);
+pcb_bool pcb_polyarea_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * src);
+pcb_bool pcb_polyarea_copy1(pcb_polyarea_t * dst, const pcb_polyarea_t * src);
-BOOLp poly_InclContour(POLYAREA * p, PLINE * c);
-BOOLp poly_ExclContour(POLYAREA * p, PLINE * c);
+pcb_bool pcb_polyarea_contour_include(pcb_polyarea_t * p, pcb_pline_t * c);
+pcb_bool pcb_polyarea_contour_exclide(pcb_polyarea_t * p, pcb_pline_t * c);
-BOOLp poly_ChkContour(PLINE * a);
+pcb_bool pcb_polyarea_contour_check(pcb_pline_t * a);
-BOOLp poly_CheckInside(POLYAREA * c, Vector v0);
-BOOLp Touching(POLYAREA * p1, POLYAREA * p2);
+pcb_bool pcb_polyarea_contour_inside(pcb_polyarea_t * c, pcb_vector_t v0);
+pcb_bool pcb_polyarea_touching(pcb_polyarea_t * p1, pcb_polyarea_t * p2);
/**********************************************************************/
@@ -147,34 +138,34 @@ BOOLp Touching(POLYAREA * p1, POLYAREA * p2);
/* checks whether point lies within contour
independently of its orientation */
-int poly_InsideContour(PLINE * c, Vector v);
-int poly_ContourInContour(PLINE * poly, PLINE * inner);
-POLYAREA *poly_Create(void);
+int pcb_poly_contour_inside(pcb_pline_t * c, pcb_vector_t v);
+int pcb_poly_contour_in_contour(pcb_pline_t * poly, pcb_pline_t * inner);
+pcb_polyarea_t *pcb_polyarea_create(void);
-void poly_Free(POLYAREA ** p);
-void poly_Init(POLYAREA * p);
-void poly_FreeContours(PLINE ** pl);
-BOOLp poly_Valid(POLYAREA * p);
+void pcb_polyarea_free(pcb_polyarea_t ** p);
+void pcb_polyarea_init(pcb_polyarea_t * p);
+void pcb_poly_contours_free(pcb_pline_t ** pl);
+pcb_bool pcb_poly_valid(pcb_polyarea_t * p);
-enum PolygonBooleanOperation {
- PBO_UNITE,
- PBO_ISECT,
- PBO_SUB,
- PBO_XOR
+enum pcb_poly_bool_op_e {
+ PCB_PBO_UNITE,
+ PCB_PBO_ISECT,
+ PCB_PBO_SUB,
+ PCB_PBO_XOR
};
-double vect_dist2(Vector v1, Vector v2);
-double vect_det2(Vector v1, Vector v2);
-double vect_len2(Vector v1);
+double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2);
+double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2);
+double pcb_vect_len2(pcb_vector_t v1);
-int vect_inters2(Vector A, Vector B, Vector C, Vector D, Vector S1, Vector S2);
+int pcb_vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2);
-int poly_Boolean(const POLYAREA * a, const POLYAREA * b, POLYAREA ** res, int action);
-int poly_Boolean_free(POLYAREA * a, POLYAREA * b, POLYAREA ** res, int action);
-int poly_AndSubtract_free(POLYAREA * a, POLYAREA * b, POLYAREA ** aandb, POLYAREA ** aminusb);
-int SavePOLYAREA(POLYAREA * PA, char *fname);
+int pcb_polyarea_boolean(const pcb_polyarea_t * a, const pcb_polyarea_t * b, pcb_polyarea_t ** res, int action);
+int pcb_polyarea_boolean_free(pcb_polyarea_t * a, pcb_polyarea_t * b, pcb_polyarea_t ** res, int action);
+int pcb_polyarea_and_subtract_free(pcb_polyarea_t * a, pcb_polyarea_t * b, pcb_polyarea_t ** aandb, pcb_polyarea_t ** aminusb);
+int pcb_polyarea_save(pcb_polyarea_t * PA, char *fname);
-/* calculate the bounding box of a POLYAREA and save result in b */
-void poly_bbox(POLYAREA * p, BoxType * b);
+/* calculate the bounding box of a pcb_polyarea_t and save result in b */
+void pcb_polyarea_bbox(pcb_polyarea_t * p, pcb_box_t * b);
#endif /* PCB_POLYAREA_H */
diff --git a/src/polygon.c b/src/polygon.c
index 1b3f86c..8f2b756 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -30,35 +30,35 @@
Here's a brief tour of the data and life of a polygon, courtesy of Ben
Jackson:
-A PCB PolygonType contains an array of points outlining the polygon.
+A PCB pcb_polygon_t contains an array of points outlining the polygon.
This is what is manipulated by the UI and stored in the saved PCB.
-A PolygonType also contains a POLYAREA called 'Clipped' which is
+A pcb_polygon_t also contains a pcb_polyarea_t called 'Clipped' which is
computed dynamically by InitClip every time a board is loaded. The
-point array is converted to a POLYAREA by original_poly and then holes
+point array is converted to a pcb_polyarea_t by original_poly and then holes
are cut in it by clearPoly. After that it is maintained dynamically
as parts are added, moved or removed (this is why sometimes bugs can
be fixed by just re-loading the board).
-A POLYAREA consists of a linked list of PLINE structures. The head of
-that list is POLYAREA.contours. The first contour is an outline of a
-filled region. All of the subsequent PLINEs are holes cut out of that
-first contour. POLYAREAs are in a doubly-linked list and each member
+A pcb_polyarea_t consists of a linked list of pcb_pline_t structures. The head of
+that list is pcb_polyarea_t.contours. The first contour is an outline of a
+filled region. All of the subsequent pcb_pline_ts are holes cut out of that
+first contour. pcb_polyarea_ts are in a doubly-linked list and each member
of the list is an independent (non-overlapping) area with its own
-outline and holes. The function biggest() finds the largest POLYAREA
-so that PolygonType.Clipped points to that shape. The rest of the
+outline and holes. The function biggest() finds the largest pcb_polyarea_t
+so that pcb_polygon_t.Clipped points to that shape. The rest of the
polygon still exists, it's just ignored when turning the polygon into
copper.
-The first POLYAREA in PolygonType.Clipped is what is used for the vast
+The first pcb_polyarea_t in pcb_polygon_t.Clipped is what is used for the vast
majority of Polygon related tests. The basic logic for an
-intersection is "is the target shape inside POLYAREA.contours and NOT
-fully enclosed in any of POLYAREA.contours.next... (the holes)".
+intersection is "is the target shape inside pcb_polyarea_t.contours and NOT
+fully enclosed in any of pcb_polyarea_t.contours.next... (the holes)".
The polygon dicer (NoHolesPolygonDicer and r_NoHolesPolygonDicer)
-emits a series of "simple" PLINE shapes. That is, the PLINE isn't
-linked to any other "holes" oulines). That's the meaning of the first
-test in r_NoHolesPolygonDicer. It is testing to see if the PLINE
+emits a series of "simple" pcb_pline_t shapes. That is, the pcb_pline_t isn't
+linked to any other "holes" outlines). That's the meaning of the first
+test in r_NoHolesPolygonDicer. It is testing to see if the pcb_pline_t
contour (the first, making it a solid outline) has a valid next
pointer (which would point to one or more holes). The dicer works by
recursively chopping the polygon in half through the first hole it
@@ -79,21 +79,20 @@ dicer output is used for HIDs which cannot render things with holes
#include <memory.h>
#include <setjmp.h>
+#include "board.h"
#include "box.h"
-#include "create.h"
-#include "crosshair.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "polygon.h"
#include "remove.h"
-#include "rtree.h"
#include "search.h"
-#include "set.h"
-#include "thermal.h"
+#include "obj_pinvia_therm.h"
#include "undo.h"
-#include "misc.h"
#include "layer.h"
+#include "compat_nls.h"
+#include "obj_all.h"
+#include "obj_poly_draw.h"
#define ROUND(x) ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5)))
@@ -103,10 +102,10 @@ dicer output is used for HIDs which cannot render things with holes
static double rotate_circle_seg[4];
-void polygon_init(void)
+void pcb_polygon_init(void)
{
- double cos_ang = cos(2.0 * M_PI / POLY_CIRC_SEGS_F);
- double sin_ang = sin(2.0 * M_PI / POLY_CIRC_SEGS_F);
+ double cos_ang = cos(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F);
+ double sin_ang = sin(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F);
rotate_circle_seg[0] = cos_ang;
rotate_circle_seg[1] = -sin_ang;
@@ -114,15 +113,15 @@ void polygon_init(void)
rotate_circle_seg[3] = cos_ang;
}
-pcb_cardinal_t polygon_point_idx(PolygonTypePtr polygon, PointTypePtr point)
+pcb_cardinal_t pcb_poly_point_idx(pcb_polygon_t *polygon, pcb_point_t *point)
{
assert(point >= polygon->Points);
assert(point <= polygon->Points + polygon->PointN);
- return ((char *) point - (char *) polygon->Points) / sizeof(PointType);
+ return ((char *) point - (char *) polygon->Points) / sizeof(pcb_point_t);
}
/* Find contour number: 0 for outer, 1 for first hole etc.. */
-pcb_cardinal_t polygon_point_contour(PolygonTypePtr polygon, pcb_cardinal_t point)
+pcb_cardinal_t pcb_poly_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point)
{
pcb_cardinal_t i;
pcb_cardinal_t contour = 0;
@@ -133,13 +132,13 @@ pcb_cardinal_t polygon_point_contour(PolygonTypePtr polygon, pcb_cardinal_t poin
return contour;
}
-pcb_cardinal_t next_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point)
+pcb_cardinal_t pcb_poly_contour_next_point(pcb_polygon_t *polygon, pcb_cardinal_t point)
{
pcb_cardinal_t contour;
pcb_cardinal_t this_contour_start;
pcb_cardinal_t next_contour_start;
- contour = polygon_point_contour(polygon, point);
+ contour = pcb_poly_contour_point(polygon, point);
this_contour_start = (contour == 0) ? 0 : polygon->HoleIndex[contour - 1];
next_contour_start = (contour == polygon->HoleIndexN) ? polygon->PointN : polygon->HoleIndex[contour];
@@ -151,13 +150,13 @@ pcb_cardinal_t next_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point)
return point;
}
-pcb_cardinal_t prev_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point)
+pcb_cardinal_t pcb_poly_contour_prev_point(pcb_polygon_t *polygon, pcb_cardinal_t point)
{
pcb_cardinal_t contour;
pcb_cardinal_t prev_contour_end;
pcb_cardinal_t this_contour_end;
- contour = polygon_point_contour(polygon, point);
+ contour = pcb_poly_contour_point(polygon, point);
prev_contour_end = (contour == 0) ? 0 : polygon->HoleIndex[contour - 1];
this_contour_end = (contour == polygon->HoleIndexN) ? polygon->PointN - 1 : polygon->HoleIndex[contour] - 1;
@@ -171,30 +170,30 @@ pcb_cardinal_t prev_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point)
return point;
}
-static void add_noholes_polyarea(PLINE * pline, void *user_data)
+static void add_noholes_polyarea(pcb_pline_t * pline, void *user_data)
{
- PolygonType *poly = (PolygonType *) user_data;
+ pcb_polygon_t *poly = (pcb_polygon_t *) user_data;
/* Prepend the pline into the NoHoles linked list */
pline->next = poly->NoHoles;
poly->NoHoles = pline;
}
-void ComputeNoHoles(PolygonType * poly)
+void pcb_poly_compute_no_holes(pcb_polygon_t * poly)
{
- poly_FreeContours(&poly->NoHoles);
+ pcb_poly_contours_free(&poly->NoHoles);
if (poly->Clipped)
- NoHolesPolygonDicer(poly, NULL, add_noholes_polyarea, poly);
+ pcb_poly_no_holes_dicer(poly, NULL, add_noholes_polyarea, poly);
else
printf("Compute_noholes caught poly->Clipped = NULL\n");
poly->NoHolesValid = 1;
}
-static POLYAREA *biggest(POLYAREA * p)
+static pcb_polyarea_t *biggest(pcb_polyarea_t * p)
{
- POLYAREA *n, *top = NULL;
- PLINE *pl;
- rtree_t *tree;
+ pcb_polyarea_t *n, *top = NULL;
+ pcb_pline_t *pl;
+ pcb_rtree_t *tree;
double big = -1;
if (!p)
return NULL;
@@ -204,7 +203,7 @@ static POLYAREA *biggest(POLYAREA * p)
if (n->contours->area < PCB->IsleArea) {
n->b->f = n->f;
n->f->b = n->b;
- poly_DelContour(&n->contours);
+ pcb_poly_contour_del(&n->contours);
if (n == p)
p = n->f;
n = n->f;
@@ -235,27 +234,27 @@ static POLYAREA *biggest(POLYAREA * p)
return p;
}
-POLYAREA *ContourToPoly(PLINE * contour)
+pcb_polyarea_t *pcb_poly_from_contour(pcb_pline_t * contour)
{
- POLYAREA *p;
- poly_PreContour(contour, TRUE);
- assert(contour->Flags.orient == PLF_DIR);
- if (!(p = poly_Create()))
+ pcb_polyarea_t *p;
+ pcb_poly_contour_pre(contour, pcb_true);
+ assert(contour->Flags.orient == PCB_PLF_DIR);
+ if (!(p = pcb_polyarea_create()))
return NULL;
- poly_InclContour(p, contour);
- assert(poly_Valid(p));
+ pcb_polyarea_contour_include(p, contour);
+ assert(pcb_poly_valid(p));
return p;
}
-static POLYAREA *original_poly(PolygonType * p)
+static pcb_polyarea_t *original_poly(pcb_polygon_t * p)
{
- PLINE *contour = NULL;
- POLYAREA *np = NULL;
+ pcb_pline_t *contour = NULL;
+ pcb_polyarea_t *np = NULL;
pcb_cardinal_t n;
- Vector v;
+ pcb_vector_t v;
int hole = 0;
- if ((np = poly_Create()) == NULL)
+ if ((np = pcb_polyarea_create()) == NULL)
return NULL;
/* first make initial polygon contour */
@@ -266,25 +265,25 @@ static POLYAREA *original_poly(PolygonType * p)
v[0] = p->Points[n].X;
v[1] = p->Points[n].Y;
if (contour == NULL) {
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return NULL;
}
else {
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
}
/* Is current point last in contour? If so process it. */
if (n == p->PointN - 1 || (hole < p->HoleIndexN && n == p->HoleIndex[hole] - 1)) {
- poly_PreContour(contour, TRUE);
+ pcb_poly_contour_pre(contour, pcb_true);
/* make sure it is a positive contour (outer) or negative (hole) */
- if (contour->Flags.orient != (hole ? PLF_INV : PLF_DIR))
- poly_InvContour(contour);
- assert(contour->Flags.orient == (hole ? PLF_INV : PLF_DIR));
+ if (contour->Flags.orient != (hole ? PCB_PLF_INV : PCB_PLF_DIR))
+ pcb_poly_contour_inv(contour);
+ assert(contour->Flags.orient == (hole ? PCB_PLF_INV : PCB_PLF_DIR));
- poly_InclContour(np, contour);
+ pcb_polyarea_contour_include(np, contour);
contour = NULL;
- assert(poly_Valid(np));
+ assert(pcb_poly_valid(np));
hole++;
}
@@ -292,15 +291,15 @@ static POLYAREA *original_poly(PolygonType * p)
return biggest(np);
}
-POLYAREA *PolygonToPoly(PolygonType * p)
+pcb_polyarea_t *pcb_poly_from_poly(pcb_polygon_t * p)
{
return original_poly(p);
}
-POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2)
+pcb_polyarea_t *pcb_poly_from_rect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2)
{
- PLINE *contour = NULL;
- Vector v;
+ pcb_pline_t *contour = NULL;
+ pcb_vector_t v;
/* Return NULL for zero or negatively sized rectangles */
if (x2 <= x1 || y2 <= y1)
@@ -308,22 +307,22 @@ POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2)
v[0] = x1;
v[1] = y1;
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return NULL;
v[0] = x2;
v[1] = y1;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
v[0] = x2;
v[1] = y2;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
v[0] = x1;
v[1] = y2;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- return ContourToPoly(contour);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ return pcb_poly_from_contour(contour);
}
/* set up x and y multiplier for an octa poly, depending on square pin style */
-void square_pin_factors(int style, double *xm, double *ym)
+void pcb_poly_square_pin_factors(int style, double *xm, double *ym)
{
int i;
const double factor = 2.0;
@@ -346,49 +345,49 @@ void square_pin_factors(int style, double *xm, double *ym)
}
-POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style)
+pcb_polyarea_t *pcb_poly_from_octagon(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style)
{
- PLINE *contour = NULL;
- Vector v;
+ pcb_pline_t *contour = NULL;
+ pcb_vector_t v;
double xm[8], ym[8];
- square_pin_factors(style, xm, ym);
+ pcb_poly_square_pin_factors(style, xm, ym);
#warning TODO: rewrite this to use the same table as the square/oct pin draw function
/* point 7 */
v[0] = x + ROUND(radius * 0.5) * xm[7];
v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[7];
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return NULL;
/* point 6 */
v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[6];
v[1] = y + ROUND(radius * 0.5) * ym[6];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
/* point 5 */
v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[5];
v[1] = y + ROUND(radius * 0.5) * ym[5];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
/* point 4 */
v[0] = x - ROUND(radius * 0.5) * xm[4];
v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[4];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
/* point 3 */
v[0] = x - ROUND(radius * 0.5) * xm[3];
v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[3];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
/* point 2 */
v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[2];
v[1] = y - ROUND(radius * 0.5) * ym[2];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
/* point 1 */
v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[1];
v[1] = y - ROUND(radius * 0.5) * ym[1];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
/* point 0 */
v[0] = x + ROUND(radius * 0.5) * xm[0];
v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[0];
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- return ContourToPoly(contour);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ return pcb_poly_from_contour(contour);
}
/* add vertices in a fractional-circle starting from v
@@ -398,18 +397,18 @@ POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style)
* 2 for a half circle
* or 4 for a quarter circle
*/
-void frac_circle(PLINE * c, Coord X, Coord Y, Vector v, int range)
+void pcb_poly_frac_cicle(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range)
{
double e1, e2, t1;
int i;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
/* move vector to origin */
- e1 = (v[0] - X) * POLY_CIRC_RADIUS_ADJ;
- e2 = (v[1] - Y) * POLY_CIRC_RADIUS_ADJ;
+ e1 = (v[0] - X) * PCB_POLY_CIRC_RADIUS_ADJ;
+ e2 = (v[1] - Y) * PCB_POLY_CIRC_RADIUS_ADJ;
/* NB: the caller adds the last vertex, hence the -1 */
- range = POLY_CIRC_SEGS / range - 1;
+ range = PCB_POLY_CIRC_SEGS / range - 1;
for (i = 0; i < range; i++) {
/* rotate the vector */
t1 = rotate_circle_seg[0] * e1 + rotate_circle_seg[1] * e2;
@@ -417,65 +416,65 @@ void frac_circle(PLINE * c, Coord X, Coord Y, Vector v, int range)
e1 = t1;
v[0] = X + ROUND(e1);
v[1] = Y + ROUND(e2);
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(c->head.prev, pcb_poly_node_create(v));
}
}
/* create a circle approximation from lines */
-POLYAREA *CirclePoly(Coord x, Coord y, Coord radius)
+pcb_polyarea_t *pcb_poly_from_circle(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius)
{
- PLINE *contour;
- Vector v;
+ pcb_pline_t *contour;
+ pcb_vector_t v;
if (radius <= 0)
return NULL;
v[0] = x + radius;
v[1] = y;
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return NULL;
- frac_circle(contour, x, y, v, 1);
- contour->is_round = TRUE;
+ pcb_poly_frac_cicle(contour, x, y, v, 1);
+ contour->is_round = pcb_true;
contour->cx = x;
contour->cy = y;
contour->radius = radius;
- return ContourToPoly(contour);
+ return pcb_poly_from_contour(contour);
}
/* make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle */
-POLYAREA *RoundRect(Coord x1, Coord x2, Coord y1, Coord y2, Coord t)
+pcb_polyarea_t *RoundRect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2, pcb_coord_t t)
{
- PLINE *contour = NULL;
- Vector v;
+ pcb_pline_t *contour = NULL;
+ pcb_vector_t v;
assert(x2 > x1);
assert(y2 > y1);
v[0] = x1 - t;
v[1] = y1;
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return NULL;
- frac_circle(contour, x1, y1, v, 4);
+ pcb_poly_frac_cicle(contour, x1, y1, v, 4);
v[0] = x2;
v[1] = y1 - t;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- frac_circle(contour, x2, y1, v, 4);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ pcb_poly_frac_cicle(contour, x2, y1, v, 4);
v[0] = x2 + t;
v[1] = y2;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- frac_circle(contour, x2, y2, v, 4);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ pcb_poly_frac_cicle(contour, x2, y2, v, 4);
v[0] = x1;
v[1] = y2 + t;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- frac_circle(contour, x1, y2, v, 4);
- return ContourToPoly(contour);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ pcb_poly_frac_cicle(contour, x1, y2, v, 4);
+ return pcb_poly_from_contour(contour);
}
#define ARC_ANGLE 5
-static POLYAREA *ArcPolyNoIntersect(ArcType * a, Coord thick)
+static pcb_polyarea_t *ArcPolyNoIntersect(pcb_arc_t * a, pcb_coord_t thick)
{
- PLINE *contour = NULL;
- POLYAREA *np = NULL;
- Vector v;
- BoxType *ends;
+ pcb_pline_t *contour = NULL;
+ pcb_polyarea_t *np = NULL;
+ pcb_vector_t v;
+ pcb_box_t ends;
int i, segs;
double ang, da, rx, ry;
long half;
@@ -488,14 +487,17 @@ static POLYAREA *ArcPolyNoIntersect(ArcType * a, Coord thick)
a->Delta = -a->Delta;
}
half = (thick + 1) / 2;
- ends = GetArcEnds(a);
+
+ pcb_arc_get_end(a, 0, &ends.X1, &ends.Y1);
+ pcb_arc_get_end(a, 1, &ends.X2, &ends.Y2);
+
/* start with inner radius */
rx = MAX(a->Width - half, 0);
ry = MAX(a->Height - half, 0);
segs = 1;
if (thick > 0)
segs = MAX(segs, a->Delta * M_PI / 360 *
- sqrt(sqrt((double) rx * rx + (double) ry * ry) / POLY_ARC_MAX_DEVIATION / 2 / thick));
+ sqrt(sqrt((double) rx * rx + (double) ry * ry) / PCB_POLY_ARC_MAX_DEVIATION / 2 / thick));
segs = MAX(segs, a->Delta / ARC_ANGLE);
ang = a->StartAngle;
@@ -503,20 +505,20 @@ static POLYAREA *ArcPolyNoIntersect(ArcType * a, Coord thick)
radius_adj = (M_PI * da / 360) * (M_PI * da / 360) / 2;
v[0] = a->X - rx * cos(ang * PCB_M180);
v[1] = a->Y + ry * sin(ang * PCB_M180);
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return 0;
for (i = 0; i < segs - 1; i++) {
ang += da;
v[0] = a->X - rx * cos(ang * PCB_M180);
v[1] = a->Y + ry * sin(ang * PCB_M180);
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
}
/* find last point */
ang = a->StartAngle + a->Delta;
v[0] = a->X - rx * cos(ang * PCB_M180) * (1 - radius_adj);
v[1] = a->Y + ry * sin(ang * PCB_M180) * (1 - radius_adj);
/* add the round cap at the end */
- frac_circle(contour, ends->X2, ends->Y2, v, 2);
+ pcb_poly_frac_cicle(contour, ends.X2, ends.Y2, v, 2);
/* and now do the outer arc (going backwards) */
rx = (a->Width + half) * (1 + radius_adj);
ry = (a->Width + half) * (1 + radius_adj);
@@ -524,26 +526,26 @@ static POLYAREA *ArcPolyNoIntersect(ArcType * a, Coord thick)
for (i = 0; i < segs; i++) {
v[0] = a->X - rx * cos(ang * PCB_M180);
v[1] = a->Y + ry * sin(ang * PCB_M180);
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
ang += da;
}
/* now add other round cap */
ang = a->StartAngle;
v[0] = a->X - rx * cos(ang * PCB_M180) * (1 - radius_adj);
v[1] = a->Y + ry * sin(ang * PCB_M180) * (1 - radius_adj);
- frac_circle(contour, ends->X1, ends->Y1, v, 2);
+ pcb_poly_frac_cicle(contour, ends.X1, ends.Y1, v, 2);
/* now we have the whole contour */
- if (!(np = ContourToPoly(contour)))
+ if (!(np = pcb_poly_from_contour(contour)))
return NULL;
return np;
}
#define MIN_CLEARANCE_BEFORE_BISECT 10.
-POLYAREA *ArcPoly(ArcType * a, Coord thick)
+pcb_polyarea_t *pcb_poly_from_arc(pcb_arc_t * a, pcb_coord_t thick)
{
double delta;
- ArcType seg1, seg2;
- POLYAREA *tmp1, *tmp2, *res;
+ pcb_arc_t seg1, seg2;
+ pcb_polyarea_t *tmp1, *tmp2, *res;
delta = (a->Delta < 0) ? -a->Delta : a->Delta;
@@ -560,29 +562,29 @@ POLYAREA *ArcPoly(ArcType * a, Coord thick)
tmp1 = ArcPolyNoIntersect(&seg1, thick);
tmp2 = ArcPolyNoIntersect(&seg2, thick);
- poly_Boolean_free(tmp1, tmp2, &res, PBO_UNITE);
+ pcb_polyarea_boolean_free(tmp1, tmp2, &res, PCB_PBO_UNITE);
return res;
}
return ArcPolyNoIntersect(a, thick);
}
-POLYAREA *LinePoly(LineType * L, Coord thick)
+pcb_polyarea_t *pcb_poly_from_line(pcb_line_t * L, pcb_coord_t thick)
{
- PLINE *contour = NULL;
- POLYAREA *np = NULL;
- Vector v;
+ pcb_pline_t *contour = NULL;
+ pcb_polyarea_t *np = NULL;
+ pcb_vector_t v;
double d, dx, dy;
long half;
- LineType _l = *L, *l = &_l;
+ pcb_line_t _l = *L, *l = &_l;
if (thick <= 0)
return NULL;
half = (thick + 1) / 2;
- d = sqrt(SQUARE(l->Point1.X - l->Point2.X) + SQUARE(l->Point1.Y - l->Point2.Y));
- if (!TEST_FLAG(PCB_FLAG_SQUARE, l))
+ d = sqrt(PCB_SQUARE(l->Point1.X - l->Point2.X) + PCB_SQUARE(l->Point1.Y - l->Point2.Y));
+ if (!PCB_FLAG_TEST(PCB_FLAG_SQUARE, l))
if (d == 0) /* line is a point */
- return CirclePoly(l->Point1.X, l->Point1.Y, half);
+ return pcb_poly_from_circle(l->Point1.X, l->Point1.Y, half);
if (d != 0) {
d = half / d;
dx = (l->Point1.Y - l->Point2.Y) * d;
@@ -592,7 +594,7 @@ POLYAREA *LinePoly(LineType * L, Coord thick)
dx = half;
dy = 0;
}
- if (TEST_FLAG(PCB_FLAG_SQUARE, l)) { /* take into account the ends */
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, l)) { /* take into account the ends */
l->Point1.X -= dy;
l->Point1.Y += dx;
l->Point2.X += dy;
@@ -600,44 +602,44 @@ POLYAREA *LinePoly(LineType * L, Coord thick)
}
v[0] = l->Point1.X - dx;
v[1] = l->Point1.Y - dy;
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return 0;
v[0] = l->Point2.X - dx;
v[1] = l->Point2.Y - dy;
- if (TEST_FLAG(PCB_FLAG_SQUARE, l))
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, l))
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
else
- frac_circle(contour, l->Point2.X, l->Point2.Y, v, 2);
+ pcb_poly_frac_cicle(contour, l->Point2.X, l->Point2.Y, v, 2);
v[0] = l->Point2.X + dx;
v[1] = l->Point2.Y + dy;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
v[0] = l->Point1.X + dx;
v[1] = l->Point1.Y + dy;
- if (TEST_FLAG(PCB_FLAG_SQUARE, l))
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, l))
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
else
- frac_circle(contour, l->Point1.X, l->Point1.Y, v, 2);
+ pcb_poly_frac_cicle(contour, l->Point1.X, l->Point1.Y, v, 2);
/* now we have the line contour */
- if (!(np = ContourToPoly(contour)))
+ if (!(np = pcb_poly_from_contour(contour)))
return NULL;
return np;
}
/* make a rounded-corner rectangle */
-POLYAREA *SquarePadPoly(PadType * pad, Coord clear)
+pcb_polyarea_t *SquarePadPoly(pcb_pad_t * pad, pcb_coord_t clear)
{
- PLINE *contour = NULL;
- POLYAREA *np = NULL;
- Vector v;
+ pcb_pline_t *contour = NULL;
+ pcb_polyarea_t *np = NULL;
+ pcb_vector_t v;
double d;
double tx, ty;
double cx, cy;
- PadType _t = *pad, *t = &_t;
- PadType _c = *pad, *c = &_c;
+ pcb_pad_t _t = *pad, *t = &_t;
+ pcb_pad_t _c = *pad, *c = &_c;
int halfthick = (pad->Thickness + 1) / 2;
int halfclear = (clear + 1) / 2;
- d = sqrt(SQUARE(pad->Point1.X - pad->Point2.X) + SQUARE(pad->Point1.Y - pad->Point2.Y));
+ d = sqrt(PCB_SQUARE(pad->Point1.X - pad->Point2.X) + PCB_SQUARE(pad->Point1.Y - pad->Point2.Y));
if (d != 0) {
double a = halfthick / d;
tx = (t->Point1.Y - t->Point2.Y) * a;
@@ -669,55 +671,55 @@ POLYAREA *SquarePadPoly(PadType * pad, Coord clear)
v[0] = c->Point1.X - tx;
v[1] = c->Point1.Y - ty;
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return 0;
- frac_circle(contour, (t->Point1.X - tx), (t->Point1.Y - ty), v, 4);
+ pcb_poly_frac_cicle(contour, (t->Point1.X - tx), (t->Point1.Y - ty), v, 4);
v[0] = t->Point2.X - cx;
v[1] = t->Point2.Y - cy;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- frac_circle(contour, (t->Point2.X - tx), (t->Point2.Y - ty), v, 4);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ pcb_poly_frac_cicle(contour, (t->Point2.X - tx), (t->Point2.Y - ty), v, 4);
v[0] = c->Point2.X + tx;
v[1] = c->Point2.Y + ty;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- frac_circle(contour, (t->Point2.X + tx), (t->Point2.Y + ty), v, 4);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ pcb_poly_frac_cicle(contour, (t->Point2.X + tx), (t->Point2.Y + ty), v, 4);
v[0] = t->Point1.X + cx;
v[1] = t->Point1.Y + cy;
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
- frac_circle(contour, (t->Point1.X + tx), (t->Point1.Y + ty), v, 4);
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
+ pcb_poly_frac_cicle(contour, (t->Point1.X + tx), (t->Point1.Y + ty), v, 4);
/* now we have the line contour */
- if (!(np = ContourToPoly(contour)))
+ if (!(np = pcb_poly_from_contour(contour)))
return NULL;
return np;
}
/* clear np1 from the polygon */
-static int Subtract(POLYAREA * np1, PolygonType * p, pcb_bool fnp)
+static int Subtract(pcb_polyarea_t * np1, pcb_polygon_t * p, pcb_bool fnp)
{
- POLYAREA *merged = NULL, *np = np1;
+ pcb_polyarea_t *merged = NULL, *np = np1;
int x;
assert(np);
assert(p);
if (!p->Clipped) {
if (fnp)
- poly_Free(&np);
+ pcb_polyarea_free(&np);
return 1;
}
- assert(poly_Valid(p->Clipped));
- assert(poly_Valid(np));
+ assert(pcb_poly_valid(p->Clipped));
+ assert(pcb_poly_valid(np));
if (fnp)
- x = poly_Boolean_free(p->Clipped, np, &merged, PBO_SUB);
+ x = pcb_polyarea_boolean_free(p->Clipped, np, &merged, PCB_PBO_SUB);
else {
- x = poly_Boolean(p->Clipped, np, &merged, PBO_SUB);
- poly_Free(&p->Clipped);
+ x = pcb_polyarea_boolean(p->Clipped, np, &merged, PCB_PBO_SUB);
+ pcb_polyarea_free(&p->Clipped);
}
- assert(!merged || poly_Valid(merged));
- if (x != err_ok) {
- fprintf(stderr, "Error while clipping PBO_SUB: %d\n", x);
- poly_Free(&merged);
+ assert(!merged || pcb_poly_valid(merged));
+ if (x != pcb_err_ok) {
+ fprintf(stderr, "Error while clipping PCB_PBO_SUB: %d\n", x);
+ pcb_polyarea_free(&merged);
p->Clipped = NULL;
if (p->NoHoles)
printf("Just leaked in Subtract\n");
@@ -725,66 +727,66 @@ static int Subtract(POLYAREA * np1, PolygonType * p, pcb_bool fnp)
return -1;
}
p->Clipped = biggest(merged);
- assert(!p->Clipped || poly_Valid(p->Clipped));
+ assert(!p->Clipped || pcb_poly_valid(p->Clipped));
if (!p->Clipped)
- Message(PCB_MSG_DEFAULT, "Polygon cleared out of existence near (%d, %d)\n",
+ pcb_message(PCB_MSG_WARNING, "Polygon cleared out of existence near (%d, %d)\n",
(p->BoundingBox.X1 + p->BoundingBox.X2) / 2, (p->BoundingBox.Y1 + p->BoundingBox.Y2) / 2);
return 1;
}
/* create a polygon of the pin clearance */
-POLYAREA *PinPoly(PinType * pin, Coord thick, Coord clear)
+pcb_polyarea_t *pcb_poly_from_pin(pcb_pin_t * pin, pcb_coord_t thick, pcb_coord_t clear)
{
int size;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
- if (GET_SQUARE(pin) <= 1) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
+ if (PCB_FLAG_SQUARE_GET(pin) <= 1) {
size = (thick + 1) / 2;
return RoundRect(pin->X - size, pin->X + size, pin->Y - size, pin->Y + size, (clear + 1) / 2);
}
else {
size = (thick + clear + 1) / 2;
- return OctagonPoly(pin->X, pin->Y, size + size, GET_SQUARE(pin));
+ return pcb_poly_from_octagon(pin->X, pin->Y, size + size, PCB_FLAG_SQUARE_GET(pin));
}
}
else {
size = (thick + clear + 1) / 2;
- if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) {
- return OctagonPoly(pin->X, pin->Y, size + size, GET_SQUARE(pin));
+ if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pin)) {
+ return pcb_poly_from_octagon(pin->X, pin->Y, size + size, PCB_FLAG_SQUARE_GET(pin));
}
}
- return CirclePoly(pin->X, pin->Y, size);
+ return pcb_poly_from_circle(pin->X, pin->Y, size);
}
-POLYAREA *BoxPolyBloated(BoxType * box, Coord bloat)
+pcb_polyarea_t *pcb_poly_from_box_bloated(pcb_box_t * box, pcb_coord_t bloat)
{
- return RectPoly(box->X1 - bloat, box->X2 + bloat, box->Y1 - bloat, box->Y2 + bloat);
+ return pcb_poly_from_rect(box->X1 - bloat, box->X2 + bloat, box->Y1 - bloat, box->Y2 + bloat);
}
/* return the clearance polygon for a pin */
-static POLYAREA *pin_clearance_poly(pcb_cardinal_t layernum, PCBTypePtr pcb, PinType * pin)
+static pcb_polyarea_t *pin_clearance_poly(pcb_cardinal_t layernum, pcb_board_t *pcb, pcb_pin_t * pin)
{
- POLYAREA *np;
- if (TEST_THERM(layernum, pin))
+ pcb_polyarea_t *np;
+ if (PCB_FLAG_THERM_TEST(layernum, pin))
np = ThermPoly(pcb, pin, layernum);
else
- np = PinPoly(pin, PIN_SIZE(pin), pin->Clearance);
+ np = pcb_poly_from_pin(pin, PIN_SIZE(pin), pin->Clearance);
return np;
}
/* remove the pin clearance from the polygon */
-static int SubtractPin(DataType * d, PinType * pin, LayerType * l, PolygonType * p)
+static int SubtractPin(pcb_data_t * d, pcb_pin_t * pin, pcb_layer_t * l, pcb_polygon_t * p)
{
- POLYAREA *np;
- pcb_cardinal_t i;
+ pcb_polyarea_t *np;
+ pcb_layer_id_t i;
if (pin->Clearance == 0)
return 0;
- i = GetLayerNumber(d, l);
+ i = pcb_layer_id(d, l);
np = pin_clearance_poly(i, d->pcb, pin);
- if (TEST_THERM(i, pin)) {
+ if (PCB_FLAG_THERM_TEST(i, pin)) {
if (!np)
return 0;
}
@@ -793,72 +795,72 @@ static int SubtractPin(DataType * d, PinType * pin, LayerType * l, PolygonType *
return -1;
}
- return Subtract(np, p, TRUE);
+ return Subtract(np, p, pcb_true);
}
-static int SubtractLine(LineType * line, PolygonType * p)
+static int SubtractLine(pcb_line_t * line, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, line))
return 0;
- if (!(np = LinePoly(line, line->Thickness + line->Clearance)))
+ if (!(np = pcb_poly_from_line(line, line->Thickness + line->Clearance)))
return -1;
return Subtract(np, p, pcb_true);
}
-static int SubtractArc(ArcType * arc, PolygonType * p)
+static int SubtractArc(pcb_arc_t * arc, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, arc))
return 0;
- if (!(np = ArcPoly(arc, arc->Thickness + arc->Clearance)))
+ if (!(np = pcb_poly_from_arc(arc, arc->Thickness + arc->Clearance)))
return -1;
return Subtract(np, p, pcb_true);
}
-static int SubtractText(TextType * text, PolygonType * p)
+static int SubtractText(pcb_text_t * text, pcb_polygon_t * p)
{
- POLYAREA *np;
- const BoxType *b = &text->BoundingBox;
+ pcb_polyarea_t *np;
+ const pcb_box_t *b = &text->BoundingBox;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, text))
return 0;
if (!(np = RoundRect(b->X1 + PCB->Bloat, b->X2 - PCB->Bloat, b->Y1 + PCB->Bloat, b->Y2 - PCB->Bloat, PCB->Bloat)))
return -1;
return Subtract(np, p, pcb_true);
}
-static int SubtractPad(PadType * pad, PolygonType * p)
+static int SubtractPad(pcb_pad_t * pad, pcb_polygon_t * p)
{
- POLYAREA *np = NULL;
+ pcb_polyarea_t *np = NULL;
if (pad->Clearance == 0)
return 0;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) {
if (!(np = SquarePadPoly(pad, pad->Thickness + pad->Clearance)))
return -1;
}
else {
- if (!(np = LinePoly((LineType *) pad, pad->Thickness + pad->Clearance)))
+ if (!(np = pcb_poly_from_line((pcb_line_t *) pad, pad->Thickness + pad->Clearance)))
return -1;
}
return Subtract(np, p, pcb_true);
}
struct cpInfo {
- const BoxType *other;
- DataType *data;
- LayerType *layer;
- PolygonType *polygon;
+ const pcb_box_t *other;
+ pcb_data_t *data;
+ pcb_layer_t *layer;
+ pcb_polygon_t *polygon;
pcb_bool solder;
- POLYAREA *accumulate;
+ pcb_polyarea_t *accumulate;
int batch_size;
jmp_buf env;
};
-static void subtract_accumulated(struct cpInfo *info, PolygonTypePtr polygon)
+static void subtract_accumulated(struct cpInfo *info, pcb_polygon_t *polygon)
{
if (info->accumulate == NULL)
return;
@@ -867,35 +869,35 @@ static void subtract_accumulated(struct cpInfo *info, PolygonTypePtr polygon)
info->batch_size = 0;
}
-static r_dir_t pin_sub_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pin_sub_callback(const pcb_box_t * b, void *cl)
{
- PinTypePtr pin = (PinTypePtr) b;
+ pcb_pin_t *pin = (pcb_pin_t *) b;
struct cpInfo *info = (struct cpInfo *) cl;
- PolygonTypePtr polygon;
- POLYAREA *np;
- POLYAREA *merged;
- pcb_cardinal_t i;
+ pcb_polygon_t *polygon;
+ pcb_polyarea_t *np;
+ pcb_polyarea_t *merged;
+ pcb_layer_id_t i;
/* don't subtract the object that was put back! */
if (b == info->other)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
polygon = info->polygon;
if (pin->Clearance == 0)
- return R_DIR_NOT_FOUND;
- i = GetLayerNumber(info->data, info->layer);
- if (TEST_THERM(i, pin)) {
- np = ThermPoly((PCBTypePtr) (info->data->pcb), pin, i);
+ return PCB_R_DIR_NOT_FOUND;
+ i = pcb_layer_id(info->data, info->layer);
+ if (PCB_FLAG_THERM_TEST(i, pin)) {
+ np = ThermPoly((pcb_board_t *) (info->data->pcb), pin, i);
if (!np)
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
else {
- np = PinPoly(pin, PIN_SIZE(pin), pin->Clearance);
+ np = pcb_poly_from_pin(pin, PIN_SIZE(pin), pin->Clearance);
if (!np)
longjmp(info->env, 1);
}
- poly_Boolean_free(info->accumulate, np, &merged, PBO_UNITE);
+ pcb_polyarea_boolean_free(info->accumulate, np, &merged, PCB_PBO_UNITE);
info->accumulate = merged;
info->batch_size++;
@@ -903,145 +905,145 @@ static r_dir_t pin_sub_callback(const BoxType * b, void *cl)
if (info->batch_size == SUBTRACT_PIN_VIA_BATCH_SIZE)
subtract_accumulated(info, polygon);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static r_dir_t arc_sub_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t arc_sub_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
struct cpInfo *info = (struct cpInfo *) cl;
- PolygonTypePtr polygon;
+ pcb_polygon_t *polygon;
/* don't subtract the object that was put back! */
if (b == info->other)
- return R_DIR_NOT_FOUND;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc))
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, arc))
+ return PCB_R_DIR_NOT_FOUND;
polygon = info->polygon;
if (SubtractArc(arc, polygon) < 0)
longjmp(info->env, 1);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static r_dir_t pad_sub_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pad_sub_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct cpInfo *info = (struct cpInfo *) cl;
- PolygonTypePtr polygon;
+ pcb_polygon_t *polygon;
/* don't subtract the object that was put back! */
if (b == info->other)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (pad->Clearance == 0)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
polygon = info->polygon;
- if (XOR(TEST_FLAG(PCB_FLAG_ONSOLDER, pad), !info->solder)) {
+ if (PCB_XOR(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad), !info->solder)) {
if (SubtractPad(pad, polygon) < 0)
longjmp(info->env, 1);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t line_sub_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t line_sub_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct cpInfo *info = (struct cpInfo *) cl;
- PolygonTypePtr polygon;
- POLYAREA *np;
- POLYAREA *merged;
+ pcb_polygon_t *polygon;
+ pcb_polyarea_t *np;
+ pcb_polyarea_t *merged;
/* don't subtract the object that was put back! */
if (b == info->other)
- return R_DIR_NOT_FOUND;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line))
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, line))
+ return PCB_R_DIR_NOT_FOUND;
polygon = info->polygon;
- if (!(np = LinePoly(line, line->Thickness + line->Clearance)))
+ if (!(np = pcb_poly_from_line(line, line->Thickness + line->Clearance)))
longjmp(info->env, 1);
- poly_Boolean_free(info->accumulate, np, &merged, PBO_UNITE);
+ pcb_polyarea_boolean_free(info->accumulate, np, &merged, PCB_PBO_UNITE);
info->accumulate = merged;
info->batch_size++;
if (info->batch_size == SUBTRACT_LINE_BATCH_SIZE)
subtract_accumulated(info, polygon);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static r_dir_t text_sub_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t text_sub_callback(const pcb_box_t * b, void *cl)
{
- TextTypePtr text = (TextTypePtr) b;
+ pcb_text_t *text = (pcb_text_t *) b;
struct cpInfo *info = (struct cpInfo *) cl;
- PolygonTypePtr polygon;
+ pcb_polygon_t *polygon;
/* don't subtract the object that was put back! */
if (b == info->other)
- return R_DIR_NOT_FOUND;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text))
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, text))
+ return PCB_R_DIR_NOT_FOUND;
polygon = info->polygon;
if (SubtractText(text, polygon) < 0)
longjmp(info->env, 1);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static int Group(DataTypePtr Data, pcb_cardinal_t layer)
+static int Group(pcb_data_t *Data, pcb_layer_id_t layer)
{
pcb_cardinal_t i, j;
- for (i = 0; i < max_group; i++)
- for (j = 0; j < ((PCBType *) (Data->pcb))->LayerGroups.Number[i]; j++)
- if (layer == ((PCBType *) (Data->pcb))->LayerGroups.Entries[i][j])
+ for (i = 0; i < pcb_max_group; i++)
+ for (j = 0; j < ((pcb_board_t *) (Data->pcb))->LayerGroups.Number[i]; j++)
+ if (layer == ((pcb_board_t *) (Data->pcb))->LayerGroups.Entries[i][j])
return i;
return i;
}
-static int clearPoly(DataTypePtr Data, LayerTypePtr Layer, PolygonType * polygon, const BoxType * here, Coord expand)
+static int clearPoly(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t * polygon, const pcb_box_t * here, pcb_coord_t expand)
{
int r = 0, seen;
- BoxType region;
+ pcb_box_t region;
struct cpInfo info;
pcb_cardinal_t group;
- if (!TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon)
- || GetLayerNumber(Data, Layer) >= max_copper_layer)
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon)
+ || pcb_layer_id(Data, Layer) >= pcb_max_copper_layer)
return 0;
- group = Group(Data, GetLayerNumber(Data, Layer));
- info.solder = (group == Group(Data, solder_silk_layer));
+ group = Group(Data, pcb_layer_id(Data, Layer));
+ info.solder = (group == Group(Data, pcb_solder_silk_layer));
info.data = Data;
info.other = here;
info.layer = Layer;
info.polygon = polygon;
if (here)
- region = clip_box(here, &polygon->BoundingBox);
+ region = pcb_clip_box(here, &polygon->BoundingBox);
else
region = polygon->BoundingBox;
- region = bloat_box(®ion, expand);
+ region = pcb_bloat_box(®ion, expand);
if (setjmp(info.env) == 0) {
r = 0;
info.accumulate = NULL;
info.batch_size = 0;
- if (info.solder || group == Group(Data, component_silk_layer)) {
- r_search(Data->pad_tree, ®ion, NULL, pad_sub_callback, &info, &seen);
+ if (info.solder || group == Group(Data, pcb_component_silk_layer)) {
+ pcb_r_search(Data->pad_tree, ®ion, NULL, pad_sub_callback, &info, &seen);
r += seen;
}
GROUP_LOOP(Data, group);
{
- r_search(layer->line_tree, ®ion, NULL, line_sub_callback, &info, &seen);
+ pcb_r_search(layer->line_tree, ®ion, NULL, line_sub_callback, &info, &seen);
r += seen;
subtract_accumulated(&info, polygon);
- r_search(layer->arc_tree, ®ion, NULL, arc_sub_callback, &info, &seen);
+ pcb_r_search(layer->arc_tree, ®ion, NULL, arc_sub_callback, &info, &seen);
r += seen;
- r_search(layer->text_tree, ®ion, NULL, text_sub_callback, &info, &seen);
+ pcb_r_search(layer->text_tree, ®ion, NULL, text_sub_callback, &info, &seen);
r += seen;
}
- END_LOOP;
- r_search(Data->via_tree, ®ion, NULL, pin_sub_callback, &info, &seen);
+ PCB_END_LOOP;
+ pcb_r_search(Data->via_tree, ®ion, NULL, pin_sub_callback, &info, &seen);
r += seen;
- r_search(Data->pin_tree, ®ion, NULL, pin_sub_callback, &info, &seen);
+ pcb_r_search(Data->pin_tree, ®ion, NULL, pin_sub_callback, &info, &seen);
r += seen;
subtract_accumulated(&info, polygon);
}
@@ -1049,31 +1051,31 @@ static int clearPoly(DataTypePtr Data, LayerTypePtr Layer, PolygonType * polygon
return r;
}
-static int Unsubtract(POLYAREA * np1, PolygonType * p)
+static int Unsubtract(pcb_polyarea_t * np1, pcb_polygon_t * p)
{
- POLYAREA *merged = NULL, *np = np1;
- POLYAREA *orig_poly, *clipped_np;
+ pcb_polyarea_t *merged = NULL, *np = np1;
+ pcb_polyarea_t *orig_poly, *clipped_np;
int x;
assert(np);
assert(p && p->Clipped);
orig_poly = original_poly(p);
- x = poly_Boolean_free(np, orig_poly, &clipped_np, PBO_ISECT);
- if (x != err_ok) {
- fprintf(stderr, "Error while clipping PBO_ISECT: %d\n", x);
- poly_Free(&clipped_np);
+ x = pcb_polyarea_boolean_free(np, orig_poly, &clipped_np, PCB_PBO_ISECT);
+ if (x != pcb_err_ok) {
+ fprintf(stderr, "Error while clipping PCB_PBO_ISECT: %d\n", x);
+ pcb_polyarea_free(&clipped_np);
goto fail;
}
- x = poly_Boolean_free(p->Clipped, clipped_np, &merged, PBO_UNITE);
- if (x != err_ok) {
- fprintf(stderr, "Error while clipping PBO_UNITE: %d\n", x);
- poly_Free(&merged);
+ x = pcb_polyarea_boolean_free(p->Clipped, clipped_np, &merged, PCB_PBO_UNITE);
+ if (x != pcb_err_ok) {
+ fprintf(stderr, "Error while clipping PCB_PBO_UNITE: %d\n", x);
+ pcb_polyarea_free(&merged);
goto fail;
}
p->Clipped = biggest(merged);
- assert(!p->Clipped || poly_Valid(p->Clipped));
+ assert(!p->Clipped || pcb_poly_valid(p->Clipped));
return 1;
fail:
@@ -1084,105 +1086,105 @@ fail:
return 0;
}
-static int UnsubtractPin(PinType * pin, LayerType * l, PolygonType * p)
+static int UnsubtractPin(pcb_pin_t * pin, pcb_layer_t * l, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
/* overlap a bit to prevent gaps from rounding errors */
- np = BoxPolyBloated(&pin->BoundingBox, UNSUBTRACT_BLOAT * 400000);
+ np = pcb_poly_from_box_bloated(&pin->BoundingBox, UNSUBTRACT_BLOAT * 400000);
if (!np)
return 0;
if (!Unsubtract(np, p))
return 0;
- clearPoly(PCB->Data, l, p, (const BoxType *) pin, 2 * UNSUBTRACT_BLOAT * 400000);
+ clearPoly(PCB->Data, l, p, (const pcb_box_t *) pin, 2 * UNSUBTRACT_BLOAT * 400000);
return 1;
}
-static int UnsubtractArc(ArcType * arc, LayerType * l, PolygonType * p)
+static int UnsubtractArc(pcb_arc_t * arc, pcb_layer_t * l, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, arc))
return 0;
/* overlap a bit to prevent gaps from rounding errors */
- np = BoxPolyBloated(&arc->BoundingBox, UNSUBTRACT_BLOAT);
+ np = pcb_poly_from_box_bloated(&arc->BoundingBox, UNSUBTRACT_BLOAT);
if (!np)
return 0;
if (!Unsubtract(np, p))
return 0;
- clearPoly(PCB->Data, l, p, (const BoxType *) arc, 2 * UNSUBTRACT_BLOAT);
+ clearPoly(PCB->Data, l, p, (const pcb_box_t *) arc, 2 * UNSUBTRACT_BLOAT);
return 1;
}
-static int UnsubtractLine(LineType * line, LayerType * l, PolygonType * p)
+static int UnsubtractLine(pcb_line_t * line, pcb_layer_t * l, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, line))
return 0;
/* overlap a bit to prevent notches from rounding errors */
- np = BoxPolyBloated(&line->BoundingBox, UNSUBTRACT_BLOAT);
+ np = pcb_poly_from_box_bloated(&line->BoundingBox, UNSUBTRACT_BLOAT);
if (!np)
return 0;
if (!Unsubtract(np, p))
return 0;
- clearPoly(PCB->Data, l, p, (const BoxType *) line, 2 * UNSUBTRACT_BLOAT);
+ clearPoly(PCB->Data, l, p, (const pcb_box_t *) line, 2 * UNSUBTRACT_BLOAT);
return 1;
}
-static int UnsubtractText(TextType * text, LayerType * l, PolygonType * p)
+static int UnsubtractText(pcb_text_t * text, pcb_layer_t * l, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, text))
return 0;
/* overlap a bit to prevent notches from rounding errors */
- np = BoxPolyBloated(&text->BoundingBox, UNSUBTRACT_BLOAT);
+ np = pcb_poly_from_box_bloated(&text->BoundingBox, UNSUBTRACT_BLOAT);
if (!np)
return -1;
if (!Unsubtract(np, p))
return 0;
- clearPoly(PCB->Data, l, p, (const BoxType *) text, 2 * UNSUBTRACT_BLOAT);
+ clearPoly(PCB->Data, l, p, (const pcb_box_t *) text, 2 * UNSUBTRACT_BLOAT);
return 1;
}
-static int UnsubtractPad(PadType * pad, LayerType * l, PolygonType * p)
+static int UnsubtractPad(pcb_pad_t * pad, pcb_layer_t * l, pcb_polygon_t * p)
{
- POLYAREA *np;
+ pcb_polyarea_t *np;
/* overlap a bit to prevent notches from rounding errors */
- np = BoxPolyBloated(&pad->BoundingBox, UNSUBTRACT_BLOAT);
+ np = pcb_poly_from_box_bloated(&pad->BoundingBox, UNSUBTRACT_BLOAT);
if (!np)
return 0;
if (!Unsubtract(np, p))
return 0;
- clearPoly(PCB->Data, l, p, (const BoxType *) pad, 2 * UNSUBTRACT_BLOAT);
+ clearPoly(PCB->Data, l, p, (const pcb_box_t *) pad, 2 * UNSUBTRACT_BLOAT);
return 1;
}
static pcb_bool inhibit = pcb_false;
-int InitClip(DataTypePtr Data, LayerTypePtr layer, PolygonType * p)
+int pcb_poly_init_clip(pcb_data_t *Data, pcb_layer_t *layer, pcb_polygon_t * p)
{
if (inhibit)
return 0;
if (p->Clipped)
- poly_Free(&p->Clipped);
+ pcb_polyarea_free(&p->Clipped);
p->Clipped = original_poly(p);
- poly_FreeContours(&p->NoHoles);
+ pcb_poly_contours_free(&p->NoHoles);
if (!p->Clipped)
return 0;
- assert(poly_Valid(p->Clipped));
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, p))
+ assert(pcb_poly_valid(p->Clipped));
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, p))
clearPoly(Data, layer, p, NULL, 0);
else
p->NoHolesValid = 0;
@@ -1194,26 +1196,26 @@ int InitClip(DataTypePtr Data, LayerTypePtr layer, PolygonType * p)
* line between the points on either side of it is redundant.
* returns pcb_true if any points are removed
*/
-pcb_bool RemoveExcessPolygonPoints(LayerTypePtr Layer, PolygonTypePtr Polygon)
+pcb_bool pcb_poly_remove_excess_points(pcb_layer_t *Layer, pcb_polygon_t *Polygon)
{
- PointTypePtr p;
+ pcb_point_t *p;
pcb_cardinal_t n, prev, next;
- LineType line;
+ pcb_line_t line;
pcb_bool changed = pcb_false;
- if (Undoing())
+ if (pcb_undoing())
return (pcb_false);
for (n = 0; n < Polygon->PointN; n++) {
- prev = prev_contour_point(Polygon, n);
- next = next_contour_point(Polygon, n);
+ prev = pcb_poly_contour_prev_point(Polygon, n);
+ next = pcb_poly_contour_next_point(Polygon, n);
p = &Polygon->Points[n];
line.Point1 = Polygon->Points[prev];
line.Point2 = Polygon->Points[next];
line.Thickness = 0;
- if (IsPointOnLine(p->X, p->Y, 0.0, &line)) {
- RemoveObject(PCB_TYPE_POLYGON_POINT, Layer, Polygon, p);
+ if (pcb_is_point_on_line(p->X, p->Y, 0.0, &line)) {
+ pcb_remove_object(PCB_TYPE_POLYGON_POINT, Layer, Polygon, p);
changed = pcb_true;
}
}
@@ -1225,10 +1227,10 @@ pcb_bool RemoveExcessPolygonPoints(LayerTypePtr Layer, PolygonTypePtr Polygon)
* point of the segment with the lowest distance to the passed
* coordinates
*/
-pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr Polygon, Coord X, Coord Y)
+pcb_cardinal_t pcb_poly_get_lowest_distance_point(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y)
{
- double mindistance = (double) MAX_COORD * MAX_COORD;
- PointTypePtr ptr1, ptr2;
+ double mindistance = (double) PCB_MAX_COORD * PCB_MAX_COORD;
+ pcb_point_t *ptr1, *ptr2;
pcb_cardinal_t n, result = 0;
/* we calculate the distance to each segment and choose the
@@ -1240,7 +1242,7 @@ pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr Polygon, Coord X, Co
for (n = 0; n < Polygon->PointN; n++) {
double u, dx, dy;
- ptr1 = &Polygon->Points[prev_contour_point(Polygon, n)];
+ ptr1 = &Polygon->Points[pcb_poly_contour_prev_point(Polygon, n)];
ptr2 = &Polygon->Points[n];
dx = ptr2->X - ptr1->X;
@@ -1250,13 +1252,13 @@ pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr Polygon, Coord X, Co
u = ((X - ptr1->X) * dx + (Y - ptr1->Y) * dy) / (dx * dx + dy * dy);
if (u < 0.0) { /* ptr1 is closest point */
- u = SQUARE(X - ptr1->X) + SQUARE(Y - ptr1->Y);
+ u = PCB_SQUARE(X - ptr1->X) + PCB_SQUARE(Y - ptr1->Y);
}
else if (u > 1.0) { /* ptr2 is closest point */
- u = SQUARE(X - ptr2->X) + SQUARE(Y - ptr2->Y);
+ u = PCB_SQUARE(X - ptr2->X) + PCB_SQUARE(Y - ptr2->Y);
}
else { /* projected intersection is closest point */
- u = SQUARE(X - ptr1->X * (1.0 - u) - u * ptr2->X) + SQUARE(Y - ptr1->Y * (1.0 - u) - u * ptr2->Y);
+ u = PCB_SQUARE(X - ptr1->X * (1.0 - u) - u * ptr2->X) + PCB_SQUARE(Y - ptr1->Y * (1.0 - u) - u * ptr2->Y);
}
if (u < mindistance) {
mindistance = u;
@@ -1270,29 +1272,29 @@ pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr Polygon, Coord X, Co
/* ---------------------------------------------------------------------------
* go back to the previous point of the polygon
*/
-void GoToPreviousPoint(void)
+void pcb_polygon_go_to_prev_point(void)
{
- switch (Crosshair.AttachedPolygon.PointN) {
+ switch (pcb_crosshair.AttachedPolygon.PointN) {
/* do nothing if mode has just been entered */
case 0:
break;
/* reset number of points and 'PCB_MODE_LINE' state */
case 1:
- Crosshair.AttachedPolygon.PointN = 0;
- Crosshair.AttachedLine.State = STATE_FIRST;
- addedLines = 0;
+ pcb_crosshair.AttachedPolygon.PointN = 0;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ pcb_added_lines = 0;
break;
/* back-up one point */
default:
{
- PointTypePtr points = Crosshair.AttachedPolygon.Points;
- pcb_cardinal_t n = Crosshair.AttachedPolygon.PointN - 2;
+ pcb_point_t *points = pcb_crosshair.AttachedPolygon.Points;
+ pcb_cardinal_t n = pcb_crosshair.AttachedPolygon.PointN - 2;
- Crosshair.AttachedPolygon.PointN--;
- Crosshair.AttachedLine.Point1.X = points[n].X;
- Crosshair.AttachedLine.Point1.Y = points[n].Y;
+ pcb_crosshair.AttachedPolygon.PointN--;
+ pcb_crosshair.AttachedLine.Point1.X = points[n].X;
+ pcb_crosshair.AttachedLine.Point1.Y = points[n].Y;
break;
}
}
@@ -1301,9 +1303,9 @@ void GoToPreviousPoint(void)
/* ---------------------------------------------------------------------------
* close polygon if possible
*/
-void ClosePolygon(void)
+void pcb_polygon_close_poly(void)
{
- pcb_cardinal_t n = Crosshair.AttachedPolygon.PointN;
+ pcb_cardinal_t n = pcb_crosshair.AttachedPolygon.PointN;
/* check number of points */
if (n >= 3) {
@@ -1311,54 +1313,54 @@ void ClosePolygon(void)
* if closing the polygon makes sense
*/
if (!conf_core.editor.all_direction_lines) {
- Coord dx, dy;
+ pcb_coord_t dx, dy;
- dx = coord_abs(Crosshair.AttachedPolygon.Points[n - 1].X - Crosshair.AttachedPolygon.Points[0].X);
- dy = coord_abs(Crosshair.AttachedPolygon.Points[n - 1].Y - Crosshair.AttachedPolygon.Points[0].Y);
+ dx = coord_abs(pcb_crosshair.AttachedPolygon.Points[n - 1].X - pcb_crosshair.AttachedPolygon.Points[0].X);
+ dy = coord_abs(pcb_crosshair.AttachedPolygon.Points[n - 1].Y - pcb_crosshair.AttachedPolygon.Points[0].Y);
if (!(dx == 0 || dy == 0 || dx == dy)) {
- Message(PCB_MSG_ERROR, _("Cannot close polygon because 45 degree lines are requested.\n"));
+ pcb_message(PCB_MSG_ERROR, _("Cannot close polygon because 45 degree lines are requested.\n"));
return;
}
}
- CopyAttachedPolygonToLayer();
- Draw();
+ pcb_polygon_copy_attached_to_layer();
+ pcb_draw();
}
else
- Message(PCB_MSG_DEFAULT, _("A polygon has to have at least 3 points\n"));
+ pcb_message(PCB_MSG_ERROR, _("A polygon has to have at least 3 points\n"));
}
/* ---------------------------------------------------------------------------
* moves the data of the attached (new) polygon to the current layer
*/
-void CopyAttachedPolygonToLayer(void)
+void pcb_polygon_copy_attached_to_layer(void)
{
- PolygonTypePtr polygon;
+ pcb_polygon_t *polygon;
int saveID;
/* move data to layer and clear attached struct */
- polygon = CreateNewPolygon(CURRENT, NoFlags());
+ polygon = pcb_poly_new(CURRENT, pcb_no_flags());
saveID = polygon->ID;
- *polygon = Crosshair.AttachedPolygon;
+ *polygon = pcb_crosshair.AttachedPolygon;
polygon->ID = saveID;
- SET_FLAG(PCB_FLAG_CLEARPOLY, polygon);
+ PCB_FLAG_SET(PCB_FLAG_CLEARPOLY, polygon);
if (conf_core.editor.full_poly)
- SET_FLAG(PCB_FLAG_FULLPOLY, polygon);
- memset(&Crosshair.AttachedPolygon, 0, sizeof(PolygonType));
- SetPolygonBoundingBox(polygon);
+ PCB_FLAG_SET(PCB_FLAG_FULLPOLY, polygon);
+ memset(&pcb_crosshair.AttachedPolygon, 0, sizeof(pcb_polygon_t));
+ pcb_poly_bbox(polygon);
if (!CURRENT->polygon_tree)
- CURRENT->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(CURRENT->polygon_tree, (BoxType *) polygon, 0);
- InitClip(PCB->Data, CURRENT, polygon);
+ CURRENT->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(CURRENT->polygon_tree, (pcb_box_t *) polygon, 0);
+ pcb_poly_init_clip(PCB->Data, CURRENT, polygon);
DrawPolygon(CURRENT, polygon);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
/* reset state of attached line */
- Crosshair.AttachedLine.State = STATE_FIRST;
- addedLines = 0;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ pcb_added_lines = 0;
/* add to undo list */
- AddObjectToCreateUndoList(PCB_TYPE_POLYGON, CURRENT, polygon, polygon);
- IncrementUndoSerialNumber();
+ pcb_undo_add_obj_to_create(PCB_TYPE_POLYGON, CURRENT, polygon, polygon);
+ pcb_undo_inc_serial();
}
/* find polygon holes in range, then call the callback function for
@@ -1366,10 +1368,10 @@ void CopyAttachedPolygonToLayer(void)
* the search.
*/
int
-PolygonHoles(PolygonType * polygon, const BoxType * range, int (*callback) (PLINE * contour, void *user_data), void *user_data)
+pcb_poly_holes(pcb_polygon_t * polygon, const pcb_box_t * range, int (*callback) (pcb_pline_t * contour, void *user_data), void *user_data)
{
- POLYAREA *pa = polygon->Clipped;
- PLINE *pl;
+ pcb_polyarea_t *pa = polygon->Clipped;
+ pcb_pline_t *pl;
/* If this hole is so big the polygon doesn't exist, then it's not
* really a hole.
*/
@@ -1388,79 +1390,79 @@ PolygonHoles(PolygonType * polygon, const BoxType * range, int (*callback) (PLIN
struct plow_info {
int type;
void *ptr1, *ptr2;
- LayerTypePtr layer;
- DataTypePtr data;
- r_dir_t (*callback) (DataTypePtr, LayerTypePtr, PolygonTypePtr, int, void *, void *);
+ pcb_layer_t *layer;
+ pcb_data_t *data;
+ pcb_r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, pcb_polygon_t *, int, void *, void *);
};
-static r_dir_t subtract_plow(DataTypePtr Data, LayerTypePtr Layer, PolygonTypePtr Polygon, int type, void *ptr1, void *ptr2)
+static pcb_r_dir_t subtract_plow(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t *Polygon, int type, void *ptr1, void *ptr2)
{
if (!Polygon->Clipped)
return 0;
switch (type) {
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
- SubtractPin(Data, (PinTypePtr) ptr2, Layer, Polygon);
+ SubtractPin(Data, (pcb_pin_t *) ptr2, Layer, Polygon);
Polygon->NoHolesValid = 0;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_LINE:
- SubtractLine((LineTypePtr) ptr2, Polygon);
+ SubtractLine((pcb_line_t *) ptr2, Polygon);
Polygon->NoHolesValid = 0;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_ARC:
- SubtractArc((ArcTypePtr) ptr2, Polygon);
+ SubtractArc((pcb_arc_t *) ptr2, Polygon);
Polygon->NoHolesValid = 0;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_PAD:
- SubtractPad((PadTypePtr) ptr2, Polygon);
+ SubtractPad((pcb_pad_t *) ptr2, Polygon);
Polygon->NoHolesValid = 0;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_TEXT:
- SubtractText((TextTypePtr) ptr2, Polygon);
+ SubtractText((pcb_text_t *) ptr2, Polygon);
Polygon->NoHolesValid = 0;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t add_plow(DataTypePtr Data, LayerTypePtr Layer, PolygonTypePtr Polygon, int type, void *ptr1, void *ptr2)
+static pcb_r_dir_t add_plow(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t *Polygon, int type, void *ptr1, void *ptr2)
{
switch (type) {
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
- UnsubtractPin((PinTypePtr) ptr2, Layer, Polygon);
- return R_DIR_FOUND_CONTINUE;
+ UnsubtractPin((pcb_pin_t *) ptr2, Layer, Polygon);
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_LINE:
- UnsubtractLine((LineTypePtr) ptr2, Layer, Polygon);
- return R_DIR_FOUND_CONTINUE;
+ UnsubtractLine((pcb_line_t *) ptr2, Layer, Polygon);
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_ARC:
- UnsubtractArc((ArcTypePtr) ptr2, Layer, Polygon);
- return R_DIR_FOUND_CONTINUE;
+ UnsubtractArc((pcb_arc_t *) ptr2, Layer, Polygon);
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_PAD:
- UnsubtractPad((PadTypePtr) ptr2, Layer, Polygon);
- return R_DIR_FOUND_CONTINUE;
+ UnsubtractPad((pcb_pad_t *) ptr2, Layer, Polygon);
+ return PCB_R_DIR_FOUND_CONTINUE;
case PCB_TYPE_TEXT:
- UnsubtractText((TextTypePtr) ptr2, Layer, Polygon);
- return R_DIR_FOUND_CONTINUE;
+ UnsubtractText((pcb_text_t *) ptr2, Layer, Polygon);
+ return PCB_R_DIR_FOUND_CONTINUE;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t plow_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t plow_callback(const pcb_box_t * b, void *cl)
{
struct plow_info *plow = (struct plow_info *) cl;
- PolygonTypePtr polygon = (PolygonTypePtr) b;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) b;
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon))
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon))
return plow->callback(plow->data, plow->layer, polygon, plow->type, plow->ptr1, plow->ptr2);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
int
-PlowsPolygon(DataType * Data, int type, void *ptr1, void *ptr2,
- r_dir_t (*call_back) (DataTypePtr data, LayerTypePtr lay, PolygonTypePtr poly, int type, void *ptr1, void *ptr2))
+pcb_poly_plows(pcb_data_t * Data, int type, void *ptr1, void *ptr2,
+ pcb_r_dir_t (*call_back) (pcb_data_t *data, pcb_layer_t *lay, pcb_polygon_t *poly, int type, void *ptr1, void *ptr2))
{
- BoxType sb = ((PinTypePtr) ptr2)->BoundingBox;
+ pcb_box_t sb = ((pcb_pin_t *) ptr2)->BoundingBox;
int r = 0, seen;
struct plow_info info;
@@ -1473,201 +1475,201 @@ PlowsPolygon(DataType * Data, int type, void *ptr1, void *ptr2,
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
if (type == PCB_TYPE_PIN || ptr1 == ptr2 || ptr1 == NULL) {
- LAYER_LOOP(Data, max_copper_layer);
+ LAYER_LOOP(Data, pcb_max_copper_layer);
{
info.layer = layer;
- r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
+ pcb_r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
r += seen;
}
- END_LOOP;
+ PCB_END_LOOP;
}
else {
- GROUP_LOOP(Data, GetLayerGroupNumberByNumber(GetLayerNumber(Data, ((LayerTypePtr) ptr1))));
+ GROUP_LOOP(Data, pcb_layer_get_group(pcb_layer_id(Data, ((pcb_layer_t *) ptr1))));
{
info.layer = layer;
- r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
+ pcb_r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
r += seen;
}
- END_LOOP;
+ PCB_END_LOOP;
}
break;
case PCB_TYPE_LINE:
case PCB_TYPE_ARC:
case PCB_TYPE_TEXT:
/* the cast works equally well for lines and arcs */
- if (!TEST_FLAG(PCB_FLAG_CLEARLINE, (LineTypePtr) ptr2))
+ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, (pcb_line_t *) ptr2))
return 0;
/* silk doesn't plow */
- if (GetLayerNumber(Data, (LayerTypePtr) ptr1) >= max_copper_layer)
+ if (pcb_layer_id(Data, (pcb_layer_t *) ptr1) >= pcb_max_copper_layer)
return 0;
- GROUP_LOOP(Data, GetLayerGroupNumberByNumber(GetLayerNumber(Data, ((LayerTypePtr) ptr1))));
+ GROUP_LOOP(Data, pcb_layer_get_group(pcb_layer_id(Data, ((pcb_layer_t *) ptr1))));
{
info.layer = layer;
- r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
+ pcb_r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
r += seen;
}
- END_LOOP;
+ PCB_END_LOOP;
break;
case PCB_TYPE_PAD:
{
- pcb_cardinal_t group = GetLayerGroupNumberByNumber(TEST_FLAG(PCB_FLAG_ONSOLDER, (PadType *) ptr2) ?
- solder_silk_layer : component_silk_layer);
+ pcb_layergrp_id_t group = pcb_layer_get_group(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (pcb_pad_t *) ptr2) ?
+ pcb_solder_silk_layer : pcb_component_silk_layer);
GROUP_LOOP(Data, group);
{
info.layer = layer;
- r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
+ pcb_r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen);
r += seen;
}
- END_LOOP;
+ PCB_END_LOOP;
}
break;
case PCB_TYPE_ELEMENT:
{
- PIN_LOOP((ElementType *) ptr1);
+ PCB_PIN_LOOP((pcb_element_t *) ptr1);
{
- PlowsPolygon(Data, PCB_TYPE_PIN, ptr1, pin, call_back);
+ pcb_poly_plows(Data, PCB_TYPE_PIN, ptr1, pin, call_back);
}
- END_LOOP;
- PAD_LOOP((ElementType *) ptr1);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP((pcb_element_t *) ptr1);
{
- PlowsPolygon(Data, PCB_TYPE_PAD, ptr1, pad, call_back);
+ pcb_poly_plows(Data, PCB_TYPE_PAD, ptr1, pad, call_back);
}
- END_LOOP;
+ PCB_END_LOOP;
}
break;
}
return r;
}
-void RestoreToPolygon(DataType * Data, int type, void *ptr1, void *ptr2)
+void pcb_poly_restore_to_poly(pcb_data_t * Data, int type, void *ptr1, void *ptr2)
{
if (type == PCB_TYPE_POLYGON)
- InitClip(PCB->Data, (LayerTypePtr) ptr1, (PolygonTypePtr) ptr2);
+ pcb_poly_init_clip(PCB->Data, (pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2);
else
- PlowsPolygon(Data, type, ptr1, ptr2, add_plow);
+ pcb_poly_plows(Data, type, ptr1, ptr2, add_plow);
}
-void ClearFromPolygon(DataType * Data, int type, void *ptr1, void *ptr2)
+void pcb_poly_clear_from_poly(pcb_data_t * Data, int type, void *ptr1, void *ptr2)
{
if (type == PCB_TYPE_POLYGON)
- InitClip(PCB->Data, (LayerTypePtr) ptr1, (PolygonTypePtr) ptr2);
+ pcb_poly_init_clip(PCB->Data, (pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2);
else
- PlowsPolygon(Data, type, ptr1, ptr2, subtract_plow);
+ pcb_poly_plows(Data, type, ptr1, ptr2, subtract_plow);
}
-pcb_bool isects(POLYAREA * a, PolygonTypePtr p, pcb_bool fr)
+pcb_bool pcb_poly_isects_poly(pcb_polyarea_t * a, pcb_polygon_t *p, pcb_bool fr)
{
- POLYAREA *x;
+ pcb_polyarea_t *x;
pcb_bool ans;
- ans = Touching(a, p->Clipped);
+ ans = pcb_polyarea_touching(a, p->Clipped);
/* argument may be register, so we must copy it */
x = a;
if (fr)
- poly_Free(&x);
+ pcb_polyarea_free(&x);
return ans;
}
-pcb_bool IsPointInPolygon(Coord X, Coord Y, Coord r, PolygonTypePtr p)
+pcb_bool pcb_poly_is_point_in_p(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t r, pcb_polygon_t *p)
{
- POLYAREA *c;
- Vector v;
+ pcb_polyarea_t *c;
+ pcb_vector_t v;
v[0] = X;
v[1] = Y;
- if (poly_CheckInside(p->Clipped, v))
+ if (pcb_polyarea_contour_inside(p->Clipped, v))
return pcb_true;
- if (TEST_FLAG(PCB_FLAG_FULLPOLY, p)) {
- PolygonType tmp = *p;
+ if (PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, p)) {
+ pcb_polygon_t tmp = *p;
/* Check all clipped-away regions that are now drawn because of full-poly */
for (tmp.Clipped = p->Clipped->f; tmp.Clipped != p->Clipped; tmp.Clipped = tmp.Clipped->f)
- if (poly_CheckInside(tmp.Clipped, v))
+ if (pcb_polyarea_contour_inside(tmp.Clipped, v))
return pcb_true;
}
if (r < 1)
return pcb_false;
- if (!(c = CirclePoly(X, Y, r)))
+ if (!(c = pcb_poly_from_circle(X, Y, r)))
return pcb_false;
- return isects(c, p, pcb_true);
+ return pcb_poly_isects_poly(c, p, pcb_true);
}
-pcb_bool IsPointInPolygonIgnoreHoles(Coord X, Coord Y, PolygonTypePtr p)
+pcb_bool pcb_poly_is_point_in_p_ignore_holes(pcb_coord_t X, pcb_coord_t Y, pcb_polygon_t *p)
{
- Vector v;
+ pcb_vector_t v;
v[0] = X;
v[1] = Y;
- return poly_InsideContour(p->Clipped->contours, v);
+ return pcb_poly_contour_inside(p->Clipped->contours, v);
}
-pcb_bool IsRectangleInPolygon(Coord X1, Coord Y1, Coord X2, Coord Y2, PolygonTypePtr p)
+pcb_bool pcb_poly_is_rect_in_p(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_polygon_t *p)
{
- POLYAREA *s;
- if (!(s = RectPoly(min(X1, X2), max(X1, X2), min(Y1, Y2), max(Y1, Y2))))
+ pcb_polyarea_t *s;
+ if (!(s = pcb_poly_from_rect(min(X1, X2), max(X1, X2), min(Y1, Y2), max(Y1, Y2))))
return pcb_false;
- return isects(s, p, pcb_true);
+ return pcb_poly_isects_poly(s, p, pcb_true);
}
-/* NB: This function will free the passed POLYAREA.
- * It must only be passed a single POLYAREA (pa->f == pa->b == pa)
+/* NB: This function will free the passed pcb_polyarea_t.
+ * It must only be passed a single pcb_polyarea_t (pa->f == pa->b == pa)
*/
-static void r_NoHolesPolygonDicer(POLYAREA * pa, void (*emit) (PLINE *, void *), void *user_data)
+static void r_NoHolesPolygonDicer(pcb_polyarea_t * pa, void (*emit) (pcb_pline_t *, void *), void *user_data)
{
- PLINE *p = pa->contours;
+ pcb_pline_t *p = pa->contours;
if (!pa->contours->next) { /* no holes */
pa->contours = NULL; /* The callback now owns the contour */
- /* Don't bother removing it from the POLYAREA's rtree
- since we're going to free the POLYAREA below anyway */
+ /* Don't bother removing it from the pcb_polyarea_t's rtree
+ since we're going to free the pcb_polyarea_t below anyway */
emit(p, user_data);
- poly_Free(&pa);
+ pcb_polyarea_free(&pa);
return;
}
else {
- POLYAREA *poly2, *left, *right;
+ pcb_polyarea_t *poly2, *left, *right;
/* make a rectangle of the left region slicing through the middle of the first hole */
- poly2 = RectPoly(p->xmin, (p->next->xmin + p->next->xmax) / 2, p->ymin, p->ymax);
- poly_AndSubtract_free(pa, poly2, &left, &right);
+ poly2 = pcb_poly_from_rect(p->xmin, (p->next->xmin + p->next->xmax) / 2, p->ymin, p->ymax);
+ pcb_polyarea_and_subtract_free(pa, poly2, &left, &right);
if (left) {
- POLYAREA *cur, *next;
+ pcb_polyarea_t *cur, *next;
cur = left;
do {
next = cur->f;
cur->f = cur->b = cur; /* Detach this polygon piece */
r_NoHolesPolygonDicer(cur, emit, user_data);
- /* NB: The POLYAREA was freed by its use in the recursive dicer */
+ /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */
}
while ((cur = next) != left);
}
if (right) {
- POLYAREA *cur, *next;
+ pcb_polyarea_t *cur, *next;
cur = right;
do {
next = cur->f;
cur->f = cur->b = cur; /* Detach this polygon piece */
r_NoHolesPolygonDicer(cur, emit, user_data);
- /* NB: The POLYAREA was freed by its use in the recursive dicer */
+ /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */
}
while ((cur = next) != right);
}
}
}
-void NoHolesPolygonDicer(PolygonTypePtr p, const BoxType * clip, void (*emit) (PLINE *, void *), void *user_data)
+void pcb_poly_no_holes_dicer(pcb_polygon_t *p, const pcb_box_t * clip, void (*emit) (pcb_pline_t *, void *), void *user_data)
{
- POLYAREA *main_contour, *cur, *next;
+ pcb_polyarea_t *main_contour, *cur, *next;
- main_contour = poly_Create();
+ main_contour = pcb_polyarea_create();
/* copy the main poly only */
- poly_Copy1(main_contour, p->Clipped);
+ pcb_polyarea_copy1(main_contour, p->Clipped);
/* clip to the bounding box */
if (clip) {
- POLYAREA *cbox = RectPoly(clip->X1, clip->X2, clip->Y1, clip->Y2);
- poly_Boolean_free(main_contour, cbox, &main_contour, PBO_ISECT);
+ pcb_polyarea_t *cbox = pcb_poly_from_rect(clip->X1, clip->X2, clip->Y1, clip->Y2);
+ pcb_polyarea_boolean_free(main_contour, cbox, &main_contour, PCB_PBO_ISECT);
}
if (main_contour == NULL)
return;
@@ -1679,19 +1681,19 @@ void NoHolesPolygonDicer(PolygonTypePtr p, const BoxType * clip, void (*emit) (P
next = cur->f;
cur->f = cur->b = cur; /* Detach this polygon piece */
r_NoHolesPolygonDicer(cur, emit, user_data);
- /* NB: The POLYAREA was freed by its use in the recursive dicer */
+ /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */
}
while ((cur = next) != main_contour);
}
/* make a polygon split into multiple parts into multiple polygons */
-pcb_bool MorphPolygon(LayerTypePtr layer, PolygonTypePtr poly)
+pcb_bool pcb_poly_morph(pcb_layer_t *layer, pcb_polygon_t *poly)
{
- POLYAREA *p, *start;
+ pcb_polyarea_t *p, *start;
pcb_bool many = pcb_false;
- FlagType flags;
+ pcb_flag_t flags;
- if (!poly->Clipped || TEST_FLAG(PCB_FLAG_LOCK, poly))
+ if (!poly->Clipped || PCB_FLAG_TEST(PCB_FLAG_LOCK, poly))
return pcb_false;
if (poly->Clipped->f == poly->Clipped)
return pcb_false;
@@ -1699,7 +1701,7 @@ pcb_bool MorphPolygon(LayerTypePtr layer, PolygonTypePtr poly)
start = p = poly->Clipped;
/* This is ugly. The creation of the new polygons can cause
* all of the polygon pointers (including the one we're called
- * with to change if there is a realloc in GetPolygonMemory().
+ * with to change if there is a realloc in pcb_poly_alloc().
* That will invalidate our original "poly" argument, potentially
* inside the loop. We need to steal the Clipped pointer and
* hide it from the Remove call so that it still exists while
@@ -1710,49 +1712,49 @@ pcb_bool MorphPolygon(LayerTypePtr layer, PolygonTypePtr poly)
printf("Just leaked in MorpyPolygon\n");
poly->NoHoles = NULL;
flags = poly->Flags;
- RemovePolygon(layer, poly);
+ pcb_poly_remove(layer, poly);
inhibit = pcb_true;
do {
- VNODE *v;
- PolygonTypePtr newone;
+ pcb_vnode_t *v;
+ pcb_polygon_t *newone;
if (p->contours->area > PCB->IsleArea) {
- newone = CreateNewPolygon(layer, flags);
+ newone = pcb_poly_new(layer, flags);
if (!newone)
return pcb_false;
many = pcb_true;
v = &p->contours->head;
- CreateNewPointInPolygon(newone, v->point[0], v->point[1]);
+ pcb_poly_point_new(newone, v->point[0], v->point[1]);
for (v = v->next; v != &p->contours->head; v = v->next)
- CreateNewPointInPolygon(newone, v->point[0], v->point[1]);
+ pcb_poly_point_new(newone, v->point[0], v->point[1]);
newone->BoundingBox.X1 = p->contours->xmin;
newone->BoundingBox.X2 = p->contours->xmax + 1;
newone->BoundingBox.Y1 = p->contours->ymin;
newone->BoundingBox.Y2 = p->contours->ymax + 1;
- AddObjectToCreateUndoList(PCB_TYPE_POLYGON, layer, newone, newone);
+ pcb_undo_add_obj_to_create(PCB_TYPE_POLYGON, layer, newone, newone);
newone->Clipped = p;
p = p->f; /* go to next pline */
newone->Clipped->b = newone->Clipped->f = newone->Clipped; /* unlink from others */
- r_insert_entry(layer->polygon_tree, (BoxType *) newone, 0);
+ pcb_r_insert_entry(layer->polygon_tree, (pcb_box_t *) newone, 0);
DrawPolygon(layer, newone);
}
else {
- POLYAREA *t = p;
+ pcb_polyarea_t *t = p;
p = p->f;
- poly_DelContour(&t->contours);
+ pcb_poly_contour_del(&t->contours);
free(t);
}
}
while (p != start);
inhibit = pcb_false;
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return many;
}
-void debug_pline(PLINE * pl)
+void debug_pline(pcb_pline_t * pl)
{
- VNODE *v;
+ pcb_vnode_t *v;
pcb_fprintf(stderr, "\txmin %#mS xmax %#mS ymin %#mS ymax %#mS\n", pl->xmin, pl->xmax, pl->ymin, pl->ymax);
v = &pl->head;
while (v) {
@@ -1763,19 +1765,19 @@ void debug_pline(PLINE * pl)
}
}
-void debug_polyarea(POLYAREA * p)
+void debug_polyarea(pcb_polyarea_t * p)
{
- PLINE *pl;
+ pcb_pline_t *pl;
- fprintf(stderr, "POLYAREA %p\n", (void *)p);
+ fprintf(stderr, "pcb_polyarea_t %p\n", (void *)p);
for (pl = p->contours; pl; pl = pl->next)
debug_pline(pl);
}
-void debug_polygon(PolygonType * p)
+void debug_polygon(pcb_polygon_t * p)
{
pcb_cardinal_t i;
- POLYAREA *pa;
+ pcb_polyarea_t *pa;
fprintf(stderr, "POLYGON %p %d pts\n", (void *)p, p->PointN);
for (i = 0; i < p->PointN; i++)
pcb_fprintf(stderr, "\t%d: %#mD\n", i, p->Points[i].X, p->Points[i].Y);
@@ -1795,15 +1797,15 @@ void debug_polygon(PolygonType * p)
}
}
-/* Convert a POLYAREA (and all linked POLYAREA) to
+/* Convert a pcb_polyarea_t (and all linked pcb_polyarea_t) to
* raw PCB polygons on the given layer.
*/
-void PolyToPolygonsOnLayer(DataType * Destination, LayerType * Layer, POLYAREA * Input, FlagType Flags)
+void pcb_poly_to_polygons_on_layer(pcb_data_t * Destination, pcb_layer_t * Layer, pcb_polyarea_t * Input, pcb_flag_t Flags)
{
- PolygonType *Polygon;
- POLYAREA *pa;
- PLINE *pline;
- VNODE *node;
+ pcb_polygon_t *Polygon;
+ pcb_polyarea_t *pa;
+ pcb_pline_t *pline;
+ pcb_vnode_t *node;
pcb_bool outer;
if (Input == NULL)
@@ -1811,36 +1813,36 @@ void PolyToPolygonsOnLayer(DataType * Destination, LayerType * Layer, POLYAREA *
pa = Input;
do {
- Polygon = CreateNewPolygon(Layer, Flags);
+ Polygon = pcb_poly_new(Layer, Flags);
pline = pa->contours;
outer = pcb_true;
do {
if (!outer)
- CreateNewHoleInPolygon(Polygon);
+ pcb_poly_hole_new(Polygon);
outer = pcb_false;
node = &pline->head;
do {
- CreateNewPointInPolygon(Polygon, node->point[0], node->point[1]);
+ pcb_poly_point_new(Polygon, node->point[0], node->point[1]);
}
while ((node = node->next) != &pline->head);
}
while ((pline = pline->next) != NULL);
- InitClip(Destination, Layer, Polygon);
- SetPolygonBoundingBox(Polygon);
+ pcb_poly_init_clip(Destination, Layer, Polygon);
+ pcb_poly_bbox(Polygon);
if (!Layer->polygon_tree)
- Layer->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
+ Layer->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
DrawPolygon(Layer, Polygon);
/* add to undo list */
- AddObjectToCreateUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
+ pcb_undo_add_obj_to_create(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
}
while ((pa = pa->f) != Input);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
diff --git a/src/polygon.h b/src/polygon.h
index 35562b8..e6b1906 100644
--- a/src/polygon.h
+++ b/src/polygon.h
@@ -29,62 +29,68 @@
#ifndef PCB_POLYGON_H
#define PCB_POLYGON_H
-#include "global.h"
+#include "config.h"
+#include "flag.h"
#include "rtree.h"
+#include "math_helper.h"
+#include "polyarea.h"
/* Implementation constants */
-#define POLY_CIRC_SEGS 40
-#define POLY_CIRC_SEGS_F ((float)POLY_CIRC_SEGS)
+#define PCB_POLY_CIRC_SEGS 40
+#define PCB_POLY_CIRC_SEGS_F ((float)PCB_POLY_CIRC_SEGS)
/* adjustment to make the segments outline the circle rather than connect
* points on the circle: 1 - cos (\alpha / 2) < (\alpha / 2) ^ 2 / 2
*/
-#define POLY_CIRC_RADIUS_ADJ (1.0 + M_PI / POLY_CIRC_SEGS_F * \
- M_PI / POLY_CIRC_SEGS_F / 2.0)
+#define PCB_POLY_CIRC_RADIUS_ADJ (1.0 + M_PI / PCB_POLY_CIRC_SEGS_F * \
+ M_PI / PCB_POLY_CIRC_SEGS_F / 2.0)
/* polygon diverges from modelled arc no more than MAX_ARC_DEVIATION * thick */
-#define POLY_ARC_MAX_DEVIATION 0.02
+#define PCB_POLY_ARC_MAX_DEVIATION 0.02
/* Prototypes */
-void polygon_init(void);
-pcb_cardinal_t polygon_point_idx(PolygonTypePtr polygon, PointTypePtr point);
-pcb_cardinal_t polygon_point_contour(PolygonTypePtr polygon, pcb_cardinal_t point);
-pcb_cardinal_t prev_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point);
-pcb_cardinal_t next_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point);
-pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr, Coord, Coord);
-pcb_bool RemoveExcessPolygonPoints(LayerTypePtr, PolygonTypePtr);
-void GoToPreviousPoint(void);
-void ClosePolygon(void);
-void CopyAttachedPolygonToLayer(void);
-int PolygonHoles(PolygonType * ptr, const BoxType * range, int (*callback) (PLINE *, void *user_data), void *user_data);
-int PlowsPolygon(DataType *, int, void *, void *,
- r_dir_t (*callback) (DataTypePtr, LayerTypePtr, PolygonTypePtr, int, void *, void *));
-void ComputeNoHoles(PolygonType * poly);
-POLYAREA *ContourToPoly(PLINE *);
-POLYAREA *PolygonToPoly(PolygonType *);
-POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2);
-POLYAREA *CirclePoly(Coord x, Coord y, Coord radius);
-POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style);
-POLYAREA *LinePoly(LineType * l, Coord thick);
-POLYAREA *ArcPoly(ArcType * l, Coord thick);
-POLYAREA *PinPoly(PinType * l, Coord thick, Coord clear);
-POLYAREA *BoxPolyBloated(BoxType * box, Coord radius);
-void frac_circle(PLINE *, Coord, Coord, Vector, int);
-int InitClip(DataType * d, LayerType * l, PolygonType * p);
-void RestoreToPolygon(DataType *, int, void *, void *);
-void ClearFromPolygon(DataType *, int, void *, void *);
+void pcb_polygon_init(void);
+pcb_cardinal_t pcb_poly_point_idx(pcb_polygon_t *polygon, pcb_point_t *point);
+pcb_cardinal_t pcb_poly_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point);
+pcb_cardinal_t pcb_poly_contour_prev_point(pcb_polygon_t *polygon, pcb_cardinal_t point);
+pcb_cardinal_t pcb_poly_contour_next_point(pcb_polygon_t *polygon, pcb_cardinal_t point);
+pcb_cardinal_t pcb_poly_get_lowest_distance_point(pcb_polygon_t *, pcb_coord_t, pcb_coord_t);
+pcb_bool pcb_poly_remove_excess_points(pcb_layer_t *, pcb_polygon_t *);
+void pcb_polygon_go_to_prev_point(void);
+void pcb_polygon_close_poly(void);
+void pcb_polygon_copy_attached_to_layer(void);
+int pcb_poly_holes(pcb_polygon_t * ptr, const pcb_box_t * range, int (*callback) (pcb_pline_t *, void *user_data), void *user_data);
+int pcb_poly_plows(pcb_data_t *, int, void *, void *,
+ pcb_r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, pcb_polygon_t *, int, void *, void *));
+void pcb_poly_compute_no_holes(pcb_polygon_t * poly);
-pcb_bool IsPointInPolygon(Coord, Coord, Coord, PolygonTypePtr);
-pcb_bool IsPointInPolygonIgnoreHoles(Coord, Coord, PolygonTypePtr);
-pcb_bool IsRectangleInPolygon(Coord, Coord, Coord, Coord, PolygonTypePtr);
-pcb_bool isects(POLYAREA *, PolygonTypePtr, pcb_bool);
-pcb_bool MorphPolygon(LayerTypePtr, PolygonTypePtr);
-void NoHolesPolygonDicer(PolygonType * p, const BoxType * clip, void (*emit) (PLINE *, void *), void *user_data);
-void PolyToPolygonsOnLayer(DataType *, LayerType *, POLYAREA *, FlagType);
+/* helpers: create complex shaped polygons */
+pcb_polyarea_t *pcb_poly_from_contour(pcb_pline_t *);
+pcb_polyarea_t *pcb_poly_from_poly(pcb_polygon_t *);
+pcb_polyarea_t *pcb_poly_from_rect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2);
+pcb_polyarea_t *pcb_poly_from_circle(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius);
+pcb_polyarea_t *pcb_poly_from_octagon(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style);
+pcb_polyarea_t *pcb_poly_from_line(pcb_line_t * l, pcb_coord_t thick);
+pcb_polyarea_t *pcb_poly_from_arc(pcb_arc_t * l, pcb_coord_t thick);
+pcb_polyarea_t *pcb_poly_from_pin(pcb_pin_t * l, pcb_coord_t thick, pcb_coord_t clear);
+pcb_polyarea_t *pcb_poly_from_box_bloated(pcb_box_t * box, pcb_coord_t radius);
-void square_pin_factors(int style, double *xm, double *ym);
+void pcb_poly_frac_cicle(pcb_pline_t *, pcb_coord_t, pcb_coord_t, pcb_vector_t, int);
+int pcb_poly_init_clip(pcb_data_t * d, pcb_layer_t * l, pcb_polygon_t * p);
+void pcb_poly_restore_to_poly(pcb_data_t *, int, void *, void *);
+void pcb_poly_clear_from_poly(pcb_data_t *, int, void *, void *);
+
+pcb_bool pcb_poly_is_point_in_p(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_polygon_t *);
+pcb_bool pcb_poly_is_point_in_p_ignore_holes(pcb_coord_t, pcb_coord_t, pcb_polygon_t *);
+pcb_bool pcb_poly_is_rect_in_p(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_polygon_t *);
+pcb_bool pcb_poly_isects_poly(pcb_polyarea_t *, pcb_polygon_t *, pcb_bool);
+pcb_bool pcb_poly_morph(pcb_layer_t *, pcb_polygon_t *);
+void pcb_poly_no_holes_dicer(pcb_polygon_t * p, const pcb_box_t * clip, void (*emit) (pcb_pline_t *, void *), void *user_data);
+void pcb_poly_to_polygons_on_layer(pcb_data_t *, pcb_layer_t *, pcb_polyarea_t *, pcb_flag_t);
+
+void pcb_poly_square_pin_factors(int style, double *xm, double *ym);
#endif
diff --git a/src/polygon1.c b/src/polygon1.c
index c78e656..48007c4 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -43,12 +43,18 @@
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
-#include <math.h>
#include <string.h>
+#include "config.h"
#include "rtree.h"
+#include "math_helper.h"
#include "heap.h"
+#include "compat_cc.h"
#include "pcb-printf.h"
+#include "polyarea.h"
+#include "obj_common.h"
+#include "macro.h"
+
#define ROUND(a) (long)((a) > 0 ? ((a) + 0.5) : ((a) - 0.5))
@@ -60,18 +66,18 @@
/*********************************************************************/
#define Vcopy(a,b) {(a)[0]=(b)[0];(a)[1]=(b)[1];}
-int vect_equal(Vector v1, Vector v2);
-void vect_init(Vector v, double x, double y);
-void vect_sub(Vector res, Vector v2, Vector v3);
+int vect_equal(pcb_vector_t v1, pcb_vector_t v2);
+void vect_init(pcb_vector_t v, double x, double y);
+void vect_sub(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3);
-void vect_min(Vector res, Vector v2, Vector v3);
-void vect_max(Vector res, Vector v2, Vector v3);
+void vect_min(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3);
+void vect_max(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3);
-double vect_dist2(Vector v1, Vector v2);
-double vect_det2(Vector v1, Vector v2);
-double vect_len2(Vector v1);
+double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2);
+double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2);
+double pcb_vect_len2(pcb_vector_t v1);
-int vect_inters2(Vector A, Vector B, Vector C, Vector D, Vector S1, Vector S2);
+int pcb_vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2);
/* note that a vertex v's Flags.status represents the edge defined by
* v to v->next (i.e. the edge is forward of v)
@@ -91,8 +97,8 @@ int vect_inters2(Vector A, Vector B, Vector C, Vector D, Vector S1, Vector S2);
#define error(code) longjmp(*(e), code)
#define MemGet(ptr, type) \
- if (UNLIKELY (((ptr) = (type *)malloc(sizeof(type))) == NULL)) \
- error(err_no_memory);
+ if (PCB_UNLIKELY(((ptr) = (type *)malloc(sizeof(type))) == NULL)) \
+ error(pcb_err_no_memory);
#undef DEBUG_LABEL
#undef DEBUG_ALL_LABELS
@@ -129,11 +135,11 @@ static void DEBUGP(const char *fmt, ...) { }
}
#ifdef DEBUG
-static char *theState(VNODE * v);
+static char *theState(pcb_vnode_t * v);
-static void pline_dump(VNODE * v)
+static void pline_dump(pcb_vnode_t * v)
{
- VNODE *s, *n;
+ pcb_vnode_t *s, *n;
s = v;
do {
@@ -144,16 +150,16 @@ static void pline_dump(VNODE * v)
while ((v = v->next) != s);
}
-static void poly_dump(POLYAREA * p)
+static void poly_dump(pcb_polyarea_t * p)
{
- POLYAREA *f = p;
- PLINE *pl;
+ pcb_polyarea_t *f = p;
+ pcb_pline_t *pl;
do {
pl = p->contours;
do {
pline_dump(&pl->head);
- fprintf(stderr, "NEXT PLINE\n");
+ fprintf(stderr, "NEXT pcb_pline_t\n");
}
while ((pl = pl->next) != NULL);
fprintf(stderr, "NEXT POLY\n");
@@ -176,15 +182,15 @@ node_add
1 means a new node was created and inserted
4 means the intersection was not on the dest point
*/
-static VNODE *node_add_single(VNODE * dest, Vector po)
+static pcb_vnode_t *node_add_single(pcb_vnode_t * dest, pcb_vector_t po)
{
- VNODE *p;
+ pcb_vnode_t *p;
if (vect_equal(po, dest->point))
return dest;
if (vect_equal(po, dest->next->point))
return dest->next;
- p = poly_CreateNode(po);
+ p = pcb_poly_node_create(po);
if (p == NULL)
return NULL;
p->cvc_prev = p->cvc_next = NULL;
@@ -200,10 +206,10 @@ static VNODE *node_add_single(VNODE * dest, Vector po)
new_descriptor
(C) 2006 harry eaton
*/
-static CVCList *new_descriptor(VNODE * a, char poly, char side)
+static pcb_cvc_list_t *new_descriptor(pcb_vnode_t * a, char poly, char side)
{
- CVCList *l = (CVCList *) malloc(sizeof(CVCList));
- Vector v;
+ pcb_cvc_list_t *l = (pcb_cvc_list_t *) malloc(sizeof(pcb_cvc_list_t));
+ pcb_vector_t v;
register double ang, dx, dy;
if (!l)
@@ -223,15 +229,15 @@ static CVCList *new_descriptor(VNODE * a, char poly, char side)
*/
if (vect_equal(v, vect_zero)) {
if (side == 'P') {
- if (a->prev->cvc_prev == (CVCList *) - 1)
+ if (a->prev->cvc_prev == (pcb_cvc_list_t *) - 1)
a->prev->cvc_prev = a->prev->cvc_next = NULL;
- poly_ExclVertex(a->prev);
+ pcb_poly_vertex_exclude(a->prev);
vect_sub(v, a->prev->point, a->point);
}
else {
- if (a->next->cvc_prev == (CVCList *) - 1)
+ if (a->next->cvc_prev == (pcb_cvc_list_t *) - 1)
a->next->cvc_prev = a->next->cvc_next = NULL;
- poly_ExclVertex(a->next);
+ pcb_poly_vertex_exclude(a->next);
vect_sub(v, a->next->point, a->point);
}
}
@@ -264,13 +270,13 @@ insert_descriptor
'N' for next.
argument start is the head of the list of cvclists
*/
-static CVCList *insert_descriptor(VNODE * a, char poly, char side, CVCList * start)
+static pcb_cvc_list_t *insert_descriptor(pcb_vnode_t * a, char poly, char side, pcb_cvc_list_t * start)
{
- CVCList *l, *newone, *big, *small;
+ pcb_cvc_list_t *l, *newone, *big, *small;
if (!(newone = new_descriptor(a, poly, side)))
return NULL;
- /* search for the CVCList for this point */
+ /* search for the pcb_cvc_list_t for this point */
if (!start) {
start = newone; /* return is also new, so we know where start is */
start->head = newone; /* circular list */
@@ -281,7 +287,7 @@ static CVCList *insert_descriptor(VNODE * a, char poly, char side, CVCList * sta
do {
assert(l->head);
if (l->parent->point[0] == a->point[0]
- && l->parent->point[1] == a->point[1]) { /* this CVCList is at our point */
+ && l->parent->point[1] == a->point[1]) { /* this pcb_cvc_list_t is at our point */
start = l;
newone->head = l->head;
break;
@@ -337,16 +343,16 @@ node_add_point
return 1 if new node in b, 2 if new node in a and 3 if new node in both
*/
-static VNODE *node_add_single_point(VNODE * a, Vector p)
+static pcb_vnode_t *node_add_single_point(pcb_vnode_t * a, pcb_vector_t p)
{
- VNODE *next_a, *new_node;
+ pcb_vnode_t *next_a, *new_node;
next_a = a->next;
new_node = node_add_single(a, p);
assert(new_node != NULL);
- new_node->cvc_prev = new_node->cvc_next = (CVCList *) - 1;
+ new_node->cvc_prev = new_node->cvc_next = (pcb_cvc_list_t *) - 1;
if (new_node == a || new_node == next_a)
return NULL;
@@ -358,9 +364,9 @@ static VNODE *node_add_single_point(VNODE * a, Vector p)
node_label
(C) 2006 harry eaton
*/
-static unsigned int node_label(VNODE * pn)
+static unsigned int node_label(pcb_vnode_t * pn)
{
- CVCList *first_l, *l;
+ pcb_cvc_list_t *first_l, *l;
char this_poly;
int region = UNKNWN;
@@ -425,13 +431,13 @@ static unsigned int node_label(VNODE * pn)
add_descriptors
(C) 2006 harry eaton
*/
-static CVCList *add_descriptors(PLINE * pl, char poly, CVCList * list)
+static pcb_cvc_list_t *add_descriptors(pcb_pline_t * pl, char poly, pcb_cvc_list_t * list)
{
- VNODE *node = &pl->head;
+ pcb_vnode_t *node = &pl->head;
do {
if (node->cvc_prev) {
- assert(node->cvc_prev == (CVCList *) - 1 && node->cvc_next == (CVCList *) - 1);
+ assert(node->cvc_prev == (pcb_cvc_list_t *) - 1 && node->cvc_next == (pcb_cvc_list_t *) - 1);
list = node->cvc_prev = insert_descriptor(node, poly, 'P', list);
if (!node->cvc_prev)
return NULL;
@@ -444,7 +450,7 @@ static CVCList *add_descriptors(PLINE * pl, char poly, CVCList * list)
return list;
}
-static inline void cntrbox_adjust(PLINE * c, Vector p)
+static inline void cntrbox_adjust(pcb_pline_t * c, pcb_vector_t p)
{
c->xmin = min(c->xmin, p[0]);
c->xmax = max(c->xmax, p[0] + 1);
@@ -455,9 +461,9 @@ static inline void cntrbox_adjust(PLINE * c, Vector p)
/* some structures for handling segment intersections using the rtrees */
typedef struct seg {
- BoxType box;
- VNODE *v;
- PLINE *p;
+ pcb_box_t box;
+ pcb_vnode_t *v;
+ pcb_pline_t *p;
int intersected;
} seg;
@@ -466,13 +472,13 @@ typedef struct _insert_node_task insert_node_task;
struct _insert_node_task {
insert_node_task *next;
seg *node_seg;
- VNODE *new_node;
+ pcb_vnode_t *new_node;
};
typedef struct info {
double m, b;
- rtree_t *tree;
- VNODE *v;
+ pcb_rtree_t *tree;
+ pcb_vnode_t *v;
struct seg *s;
jmp_buf *env, sego, *touch;
int need_restart;
@@ -480,7 +486,7 @@ typedef struct info {
} info;
typedef struct contour_info {
- PLINE *pa;
+ pcb_pline_t *pa;
jmp_buf restart;
jmp_buf *getout;
int need_restart;
@@ -494,7 +500,7 @@ typedef struct contour_info {
* This replaces the segment in the tree with the two new segments after
* a vertex has been added
*/
-static int adjust_tree(rtree_t * tree, struct seg *s)
+static int adjust_tree(pcb_rtree_t * tree, struct seg *s)
{
struct seg *q;
@@ -508,7 +514,7 @@ static int adjust_tree(rtree_t * tree, struct seg *s)
q->box.X2 = max(q->v->point[0], q->v->next->point[0]) + 1;
q->box.Y1 = min(q->v->point[1], q->v->next->point[1]);
q->box.Y2 = max(q->v->point[1], q->v->next->point[1]) + 1;
- r_insert_entry(tree, (const BoxType *) q, 1);
+ pcb_r_insert_entry(tree, (const pcb_box_t *) q, 1);
q = (seg *) malloc(sizeof(struct seg));
if (!q)
return 1;
@@ -519,8 +525,8 @@ static int adjust_tree(rtree_t * tree, struct seg *s)
q->box.X2 = max(q->v->point[0], q->v->next->point[0]) + 1;
q->box.Y1 = min(q->v->point[1], q->v->next->point[1]);
q->box.Y2 = max(q->v->point[1], q->v->next->point[1]) + 1;
- r_insert_entry(tree, (const BoxType *) q, 1);
- r_delete_entry(tree, (const BoxType *) s);
+ pcb_r_insert_entry(tree, (const pcb_box_t *) q, 1);
+ pcb_r_delete_entry(tree, (const pcb_box_t *) s);
return 0;
}
@@ -529,24 +535,24 @@ static int adjust_tree(rtree_t * tree, struct seg *s)
* (C) 2006, harry eaton
* This prunes the search for boxes that don't intersect the segment.
*/
-static r_dir_t seg_in_region(const BoxType * b, void *cl)
+static pcb_r_dir_t seg_in_region(const pcb_box_t * b, void *cl)
{
struct info *i = (struct info *) cl;
double y1, y2;
/* for zero slope the search is aligned on the axis so it is already pruned */
if (i->m == 0.)
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
y1 = i->m * b->X1 + i->b;
y2 = i->m * b->X2 + i->b;
if (min(y1, y2) >= b->Y2)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (max(y1, y2) < b->Y1)
- return R_DIR_NOT_FOUND;
- return R_DIR_FOUND_CONTINUE; /* might intersect */
+ return PCB_R_DIR_NOT_FOUND;
+ return PCB_R_DIR_FOUND_CONTINUE; /* might intersect */
}
/* Prepend a deferred node-insertion task to a list */
-static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg * seg, VNODE * new_node)
+static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg * seg, pcb_vnode_t * new_node)
{
insert_node_task *task = (insert_node_task *) malloc(sizeof(*task));
task->node_seg = seg;
@@ -566,24 +572,24 @@ static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg *
* problem. There are efficient algorithms for finding intersections with snap
* rounding, but I don't have time to implement them right now.
*/
-static r_dir_t seg_in_seg(const BoxType * b, void *cl)
+static pcb_r_dir_t seg_in_seg(const pcb_box_t * b, void *cl)
{
struct info *i = (struct info *) cl;
struct seg *s = (struct seg *) b;
- Vector s1, s2;
+ pcb_vector_t s1, s2;
int cnt;
- VNODE *new_node;
+ pcb_vnode_t *new_node;
/* When new nodes are added at the end of a pass due to an intersection
* the segments may be altered. If either segment we're looking at has
* already been intersected this pass, skip it until the next pass.
*/
if (s->intersected || i->s->intersected)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
- cnt = vect_inters2(s->v->point, s->v->next->point, i->v->point, i->v->next->point, s1, s2);
+ cnt = pcb_vect_inters2(s->v->point, s->v->next->point, i->v->point, i->v->next->point, s1, s2);
if (!cnt)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (i->touch) /* if checking touches one find and we're done */
longjmp(*i->touch, TOUCHES);
i->s->p->Flags.status = ISECTED;
@@ -606,7 +612,7 @@ static r_dir_t seg_in_seg(const BoxType * b, void *cl)
#endif
i->node_insert_list = prepend_insert_node_task(i->node_insert_list, s, new_node);
s->intersected = 1;
- return R_DIR_NOT_FOUND; /* Keep looking for intersections with segment "i" */
+ return PCB_R_DIR_NOT_FOUND; /* Keep looking for intersections with segment "i" */
}
/* Skip any remaining r_search hits against segment i, as any further
* intersections will be rejected until the next pass anyway.
@@ -614,14 +620,14 @@ static r_dir_t seg_in_seg(const BoxType * b, void *cl)
if (done_insert_on_i)
longjmp(*i->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static void *make_edge_tree(PLINE * pb)
+static void *make_edge_tree(pcb_pline_t * pb)
{
struct seg *s;
- VNODE *bv;
- rtree_t *ans = r_create_tree(NULL, 0, 0);
+ pcb_vnode_t *bv;
+ pcb_rtree_t *ans = pcb_r_create_tree(NULL, 0, 0);
bv = &pb->head;
do {
s = (seg *) malloc(sizeof(struct seg));
@@ -644,21 +650,21 @@ static void *make_edge_tree(PLINE * pb)
}
s->v = bv;
s->p = pb;
- r_insert_entry(ans, (const BoxType *) s, 1);
+ pcb_r_insert_entry(ans, (const pcb_box_t *) s, 1);
}
while ((bv = bv->next) != &pb->head);
return (void *) ans;
}
-static r_dir_t get_seg(const BoxType * b, void *cl)
+static pcb_r_dir_t get_seg(const pcb_box_t * b, void *cl)
{
struct info *i = (struct info *) cl;
struct seg *s = (struct seg *) b;
if (i->v == s->v) {
i->s = s;
- return R_DIR_CANCEL; /* found */
+ return PCB_R_DIR_CANCEL; /* found */
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/*
@@ -679,16 +685,16 @@ static r_dir_t get_seg(const BoxType * b, void *cl)
*
*/
-static r_dir_t contour_bounds_touch(const BoxType * b, void *cl)
+static pcb_r_dir_t contour_bounds_touch(const pcb_box_t * b, void *cl)
{
contour_info *c_info = (contour_info *) cl;
- PLINE *pa = c_info->pa;
- PLINE *pb = (PLINE *) b;
- PLINE *rtree_over;
- PLINE *looping_over;
- VNODE *av; /* node iterators */
+ pcb_pline_t *pa = c_info->pa;
+ pcb_pline_t *pb = (pcb_pline_t *) b;
+ pcb_pline_t *rtree_over;
+ pcb_pline_t *looping_over;
+ pcb_vnode_t *av; /* node iterators */
struct info info;
- BoxType box;
+ pcb_box_t box;
jmp_buf restart;
/* Have seg_in_seg return to our desired location if it touches */
@@ -712,7 +718,7 @@ static r_dir_t contour_bounds_touch(const BoxType * b, void *cl)
av = &looping_over->head;
do { /* Loop over the nodes in the smaller contour */
- r_dir_t rres;
+ pcb_r_dir_t rres;
/* check this edge for any insertions */
double dx;
info.v = av;
@@ -728,8 +734,8 @@ static r_dir_t contour_bounds_touch(const BoxType * b, void *cl)
box.Y2 = (box.Y1 = av->point[1]) + 1;
/* fill in the segment in info corresponding to this node */
- rres = r_search(looping_over->tree, &box, NULL, get_seg, &info, NULL);
- assert(rres == R_DIR_CANCEL);
+ rres = pcb_r_search(looping_over->tree, &box, NULL, get_seg, &info, NULL);
+ assert(rres == PCB_R_DIR_CANCEL);
/* If we're going to have another pass anyway, skip this */
if (info.s->intersected && info.node_insert_list != NULL)
@@ -742,8 +748,8 @@ static r_dir_t contour_bounds_touch(const BoxType * b, void *cl)
info.tree = rtree_over->tree;
if (info.tree) {
int seen;
- r_search(info.tree, &info.s->box, seg_in_region, seg_in_seg, &info, &seen);
- if (UNLIKELY(seen))
+ pcb_r_search(info.tree, &info.s->box, seg_in_region, seg_in_seg, &info, &seen);
+ if (PCB_UNLIKELY(seen))
assert(0); /* XXX: Memory allocation failure */
}
}
@@ -752,13 +758,13 @@ static r_dir_t contour_bounds_touch(const BoxType * b, void *cl)
c_info->node_insert_list = info.node_insert_list;
if (info.need_restart)
c_info->need_restart = 1;
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static int intersect_impl(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
+static int intersect_impl(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add)
{
- POLYAREA *t;
- PLINE *pa;
+ pcb_polyarea_t *t;
+ pcb_pline_t *pa;
contour_info c_info;
int need_restart = 0;
insert_node_task *task;
@@ -774,8 +780,8 @@ static int intersect_impl(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
a = t;
}
- for (pa = a->contours; pa; pa = pa->next) { /* Loop over the contours of POLYAREA "a" */
- BoxType sb;
+ for (pa = a->contours; pa; pa = pa->next) { /* Loop over the contours of pcb_polyarea_t "a" */
+ pcb_box_t sb;
jmp_buf out;
int retval;
@@ -797,7 +803,7 @@ static int intersect_impl(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
sb.X2 = pa->xmax + 1;
sb.Y2 = pa->ymax + 1;
- r_search(b->contour_tree, &sb, NULL, contour_bounds_touch, &c_info, NULL);
+ pcb_r_search(b->contour_tree, &sb, NULL, contour_bounds_touch, &c_info, NULL);
if (c_info.need_restart)
need_restart = 1;
}
@@ -827,7 +833,7 @@ static int intersect_impl(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
return need_restart;
}
-static int intersect(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
+static int intersect(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add)
{
int call_count = 1;
while (intersect_impl(jb, b, a, add))
@@ -835,29 +841,29 @@ static int intersect(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
return 0;
}
-static void M_POLYAREA_intersect(jmp_buf * e, POLYAREA * afst, POLYAREA * bfst, int add)
+static void M_pcb_polyarea_t_intersect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t * bfst, int add)
{
- POLYAREA *a = afst, *b = bfst;
- PLINE *curcA, *curcB;
- CVCList *the_list = NULL;
+ pcb_polyarea_t *a = afst, *b = bfst;
+ pcb_pline_t *curcA, *curcB;
+ pcb_cvc_list_t *the_list = NULL;
if (a == NULL || b == NULL)
- error(err_bad_parm);
+ error(pcb_err_bad_parm);
do {
do {
if (a->contours->xmax >= b->contours->xmin &&
a->contours->ymax >= b->contours->ymin &&
a->contours->xmin <= b->contours->xmax && a->contours->ymin <= b->contours->ymax) {
- if (UNLIKELY(intersect(e, a, b, add)))
- error(err_no_memory);
+ if (PCB_UNLIKELY(intersect(e, a, b, add)))
+ error(pcb_err_no_memory);
}
}
while (add && (a = a->f) != afst);
for (curcB = b->contours; curcB != NULL; curcB = curcB->next)
if (curcB->Flags.status == ISECTED) {
the_list = add_descriptors(curcB, 'B', the_list);
- if (UNLIKELY(the_list == NULL))
- error(err_no_memory);
+ if (PCB_UNLIKELY(the_list == NULL))
+ error(pcb_err_no_memory);
}
}
while (add && (b = b->f) != bfst);
@@ -865,14 +871,14 @@ static void M_POLYAREA_intersect(jmp_buf * e, POLYAREA * afst, POLYAREA * bfst,
for (curcA = a->contours; curcA != NULL; curcA = curcA->next)
if (curcA->Flags.status == ISECTED) {
the_list = add_descriptors(curcA, 'A', the_list);
- if (UNLIKELY(the_list == NULL))
- error(err_no_memory);
+ if (PCB_UNLIKELY(the_list == NULL))
+ error(pcb_err_no_memory);
}
}
while (add && (a = a->f) != afst);
-} /* M_POLYAREA_intersect */
+} /* M_pcb_polyarea_t_intersect */
-static inline int cntrbox_inside(PLINE * c1, PLINE * c2)
+static inline int cntrbox_inside(pcb_pline_t * c1, pcb_pline_t * c2)
{
assert(c1 != NULL && c2 != NULL);
return ((c1->xmin >= c2->xmin) && (c1->ymin >= c2->ymin) && (c1->xmax <= c2->xmax) && (c1->ymax <= c2->ymax));
@@ -881,30 +887,30 @@ static inline int cntrbox_inside(PLINE * c1, PLINE * c2)
/*****************************************************************/
/* Routines for making labels */
-static r_dir_t count_contours_i_am_inside(const BoxType * b, void *cl)
+static pcb_r_dir_t count_contours_i_am_inside(const pcb_box_t * b, void *cl)
{
- PLINE *me = (PLINE *) cl;
- PLINE *check = (PLINE *) b;
+ pcb_pline_t *me = (pcb_pline_t *) cl;
+ pcb_pline_t *check = (pcb_pline_t *) b;
- if (poly_ContourInContour(check, me))
- return R_DIR_FOUND_CONTINUE;
- return R_DIR_NOT_FOUND;
+ if (pcb_poly_contour_in_contour(check, me))
+ return PCB_R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_NOT_FOUND;
}
-/* cntr_in_M_POLYAREA
-returns poly is inside outfst ? TRUE : FALSE */
-static int cntr_in_M_POLYAREA(PLINE * poly, POLYAREA * outfst, BOOLp test)
+/* cntr_in_M_pcb_polyarea_t
+returns poly is inside outfst ? pcb_true : pcb_false */
+static int cntr_in_M_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * outfst, pcb_bool test)
{
- POLYAREA *outer = outfst;
- heap_t *heap;
+ pcb_polyarea_t *outer = outfst;
+ pcb_heap_t *heap;
assert(poly != NULL);
assert(outer != NULL);
- heap = heap_create();
+ heap = pcb_heap_create();
do {
if (cntrbox_inside(poly, outer->contours))
- heap_insert(heap, outer->contours->area, (void *) outer);
+ pcb_heap_insert(heap, outer->contours->area, (void *) outer);
}
/* if checking touching, use only the first polygon */
while (!test && (outer = outer->f) != outfst);
@@ -914,33 +920,33 @@ static int cntr_in_M_POLYAREA(PLINE * poly, POLYAREA * outfst, BOOLp test)
do {
int cnt;
- if (heap_is_empty(heap))
+ if (pcb_heap_is_empty(heap))
break;
- outer = (POLYAREA *) heap_remove_smallest(heap);
+ outer = (pcb_polyarea_t *) pcb_heap_remove_smallest(heap);
- r_search(outer->contour_tree, (BoxType *) poly, NULL, count_contours_i_am_inside, poly, &cnt);
+ pcb_r_search(outer->contour_tree, (pcb_box_t *) poly, NULL, count_contours_i_am_inside, poly, &cnt);
switch (cnt) {
case 0: /* Didn't find anything in this piece, Keep looking */
break;
case 1: /* Found we are inside this piece, and not any of its holes */
- heap_destroy(&heap);
- return TRUE;
+ pcb_heap_destroy(&heap);
+ return pcb_true;
case 2: /* Found inside a hole in the smallest polygon so far. No need to check the other polygons */
- heap_destroy(&heap);
- return FALSE;
+ pcb_heap_destroy(&heap);
+ return pcb_false;
default:
printf("Something strange here\n");
break;
}
}
while (1);
- heap_destroy(&heap);
- return FALSE;
-} /* cntr_in_M_POLYAREA */
+ pcb_heap_destroy(&heap);
+ return pcb_false;
+} /* cntr_in_M_pcb_polyarea_t */
#ifdef DEBUG
-static char *theState(VNODE * v)
+static char *theState(pcb_vnode_t * v)
{
static char u[] = "UNKNOWN";
static char i[] = "INSIDE";
@@ -963,9 +969,9 @@ static char *theState(VNODE * v)
}
#ifdef DEBUG_ALL_LABELS
-static void print_labels(PLINE * a)
+static void print_labels(pcb_pline_t * a)
{
- VNODE *c = &a->head;
+ pcb_vnode_t *c = &a->head;
do {
DEBUGP("%#mD->%#mD labeled %s\n", c->point[0], c->point[1], c->next->point[0], c->next->point[1], theState(c));
@@ -982,10 +988,10 @@ label_contour
(C) 1997 Alexey Nikitin, Michael Leonov
*/
-static BOOLp label_contour(PLINE * a)
+static pcb_bool label_contour(pcb_pline_t * a)
{
- VNODE *cur = &a->head;
- VNODE *first_labelled = NULL;
+ pcb_vnode_t *cur = &a->head;
+ pcb_vnode_t *first_labelled = NULL;
int label = UNKNWN;
do {
@@ -1008,18 +1014,18 @@ static BOOLp label_contour(PLINE * a)
print_labels(a);
DEBUGP("\n\n");
#endif
- return FALSE;
+ return pcb_false;
} /* label_contour */
-static BOOLp cntr_label_POLYAREA(PLINE * poly, POLYAREA * ppl, BOOLp test)
+static pcb_bool cntr_label_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * ppl, pcb_bool test)
{
assert(ppl != NULL && ppl->contours != NULL);
if (poly->Flags.status == ISECTED) {
- label_contour(poly); /* should never get here when BOOLp is pcb_true */
+ label_contour(poly); /* should never get here when pcb_bool is pcb_true */
}
- else if (cntr_in_M_POLYAREA(poly, ppl, test)) {
+ else if (cntr_in_M_pcb_polyarea_t(poly, ppl, test)) {
if (test)
- return TRUE;
+ return pcb_true;
poly->Flags.status = INSIDE;
}
else {
@@ -1027,72 +1033,72 @@ static BOOLp cntr_label_POLYAREA(PLINE * poly, POLYAREA * ppl, BOOLp test)
return pcb_false;
poly->Flags.status = OUTSIDE;
}
- return FALSE;
-} /* cntr_label_POLYAREA */
+ return pcb_false;
+} /* cntr_label_pcb_polyarea_t */
-static BOOLp M_POLYAREA_label_separated(PLINE * afst, POLYAREA * b, BOOLp touch)
+static pcb_bool M_pcb_polyarea_t_label_separated(pcb_pline_t * afst, pcb_polyarea_t * b, pcb_bool touch)
{
- PLINE *curc = afst;
+ pcb_pline_t *curc = afst;
for (curc = afst; curc != NULL; curc = curc->next) {
- if (cntr_label_POLYAREA(curc, b, touch) && touch)
- return TRUE;
+ if (cntr_label_pcb_polyarea_t(curc, b, touch) && touch)
+ return pcb_true;
}
- return FALSE;
+ return pcb_false;
}
-static BOOLp M_POLYAREA_label(POLYAREA * afst, POLYAREA * b, BOOLp touch)
+static pcb_bool M_pcb_polyarea_t_label(pcb_polyarea_t * afst, pcb_polyarea_t * b, pcb_bool touch)
{
- POLYAREA *a = afst;
- PLINE *curc;
+ pcb_polyarea_t *a = afst;
+ pcb_pline_t *curc;
assert(a != NULL);
do {
for (curc = a->contours; curc != NULL; curc = curc->next)
- if (cntr_label_POLYAREA(curc, b, touch)) {
+ if (cntr_label_pcb_polyarea_t(curc, b, touch)) {
if (touch)
- return TRUE;
+ return pcb_true;
}
}
while (!touch && (a = a->f) != afst);
- return FALSE;
+ return pcb_false;
}
/****************************************************************/
/* routines for temporary storing resulting contours */
-static void InsCntr(jmp_buf * e, PLINE * c, POLYAREA ** dst)
+static void InsCntr(jmp_buf * e, pcb_pline_t * c, pcb_polyarea_t ** dst)
{
- POLYAREA *newp;
+ pcb_polyarea_t *newp;
if (*dst == NULL) {
- MemGet(*dst, POLYAREA);
+ MemGet(*dst, pcb_polyarea_t);
(*dst)->f = (*dst)->b = *dst;
newp = *dst;
}
else {
- MemGet(newp, POLYAREA);
+ MemGet(newp, pcb_polyarea_t);
newp->f = *dst;
newp->b = (*dst)->b;
newp->f->b = newp->b->f = newp;
}
newp->contours = c;
- newp->contour_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(newp->contour_tree, (BoxTypePtr) c, 0);
+ newp->contour_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(newp->contour_tree, (pcb_box_t *) c, 0);
c->next = NULL;
} /* InsCntr */
static void
-PutContour(jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes,
- POLYAREA * owner, POLYAREA * parent, PLINE * parent_contour)
+PutContour(jmp_buf * e, pcb_pline_t * cntr, pcb_polyarea_t ** contours, pcb_pline_t ** holes,
+ pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour)
{
assert(cntr != NULL);
assert(cntr->Count > 2);
cntr->next = NULL;
- if (cntr->Flags.orient == PLF_DIR) {
+ if (cntr->Flags.orient == PCB_PLF_DIR) {
if (owner != NULL)
- r_delete_entry(owner->contour_tree, (BoxType *) cntr);
+ pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr);
InsCntr(e, cntr, contours);
}
/* put hole into temporary list */
@@ -1103,8 +1109,8 @@ PutContour(jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes,
parent_contour->next = cntr;
if (owner != parent) {
if (owner != NULL)
- r_delete_entry(owner->contour_tree, (BoxType *) cntr);
- r_insert_entry(parent->contour_tree, (BoxType *) cntr, 0);
+ pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr);
+ pcb_r_insert_entry(parent->contour_tree, (pcb_box_t *) cntr, 0);
}
}
else {
@@ -1113,12 +1119,12 @@ PutContour(jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes,
/* We don't insert the holes into an r-tree,
* they just form a linked list */
if (owner != NULL)
- r_delete_entry(owner->contour_tree, (BoxType *) cntr);
+ pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr);
}
}
} /* PutContour */
-static inline void remove_contour(POLYAREA * piece, PLINE * prev_contour, PLINE * contour, int remove_rtree_entry)
+static inline void remove_contour(pcb_polyarea_t * piece, pcb_pline_t * prev_contour, pcb_pline_t * contour, int remove_rtree_entry)
{
if (piece->contours == contour)
piece->contours = contour->next;
@@ -1130,53 +1136,53 @@ static inline void remove_contour(POLYAREA * piece, PLINE * prev_contour, PLINE
contour->next = NULL;
if (remove_rtree_entry)
- r_delete_entry(piece->contour_tree, (BoxType *) contour);
+ pcb_r_delete_entry(piece->contour_tree, (pcb_box_t *) contour);
}
struct polyarea_info {
- BoxType BoundingBox;
- POLYAREA *pa;
+ pcb_box_t BoundingBox;
+ pcb_polyarea_t *pa;
};
-static r_dir_t heap_it(const BoxType * b, void *cl)
+static pcb_r_dir_t heap_it(const pcb_box_t * b, void *cl)
{
- heap_t *heap = (heap_t *) cl;
+ pcb_heap_t *heap = (pcb_heap_t *) cl;
struct polyarea_info *pa_info = (struct polyarea_info *) b;
- PLINE *p = pa_info->pa->contours;
+ pcb_pline_t *p = pa_info->pa->contours;
if (p->Count == 0)
- return R_DIR_NOT_FOUND; /* how did this happen? */
- heap_insert(heap, p->area, pa_info);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_NOT_FOUND; /* how did this happen? */
+ pcb_heap_insert(heap, p->area, pa_info);
+ return PCB_R_DIR_FOUND_CONTINUE;
}
struct find_inside_info {
jmp_buf jb;
- PLINE *want_inside;
- PLINE *result;
+ pcb_pline_t *want_inside;
+ pcb_pline_t *result;
};
-static r_dir_t find_inside(const BoxType * b, void *cl)
+static pcb_r_dir_t find_inside(const pcb_box_t * b, void *cl)
{
struct find_inside_info *info = (struct find_inside_info *) cl;
- PLINE *check = (PLINE *) b;
+ pcb_pline_t *check = (pcb_pline_t *) b;
/* Do test on check to see if it inside info->want_inside */
/* If it is: */
- if (check->Flags.orient == PLF_DIR) {
- return R_DIR_NOT_FOUND;
+ if (check->Flags.orient == PCB_PLF_DIR) {
+ return PCB_R_DIR_NOT_FOUND;
}
- if (poly_ContourInContour(info->want_inside, check)) {
+ if (pcb_poly_contour_in_contour(info->want_inside, check)) {
info->result = check;
longjmp(info->jb, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
+static void InsertHoles(jmp_buf * e, pcb_polyarea_t * dest, pcb_pline_t ** src)
{
- POLYAREA *curc;
- PLINE *curh, *container;
- heap_t *heap;
- rtree_t *tree;
+ pcb_polyarea_t *curc;
+ pcb_pline_t *curh, *container;
+ pcb_heap_t *heap;
+ pcb_rtree_t *tree;
int i;
int num_polyareas = 0;
struct polyarea_info *all_pa_info, *pa_info;
@@ -1184,7 +1190,7 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
if (*src == NULL)
return; /* empty hole list */
if (dest == NULL)
- error(err_bad_parm); /* empty contour list */
+ error(pcb_err_bad_parm); /* empty contour list */
/* Count dest polyareas */
curc = dest;
@@ -1196,7 +1202,7 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
/* make a polyarea info table */
/* make an rtree of polyarea info table */
all_pa_info = (struct polyarea_info *) malloc(sizeof(struct polyarea_info) * num_polyareas);
- tree = r_create_tree(NULL, 0, 0);
+ tree = pcb_r_create_tree(NULL, 0, 0);
i = 0;
curc = dest;
do {
@@ -1205,7 +1211,7 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
all_pa_info[i].BoundingBox.X2 = curc->contours->xmax;
all_pa_info[i].BoundingBox.Y2 = curc->contours->ymax;
all_pa_info[i].pa = curc;
- r_insert_entry(tree, (const BoxType *) &all_pa_info[i], 0);
+ pcb_r_insert_entry(tree, (const pcb_box_t *) &all_pa_info[i], 0);
i++;
}
while ((curc = curc->f) != dest);
@@ -1216,39 +1222,39 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
container = NULL;
/* build a heap of all of the polys that the hole is inside its bounding box */
- heap = heap_create();
- r_search(tree, (BoxType *) curh, NULL, heap_it, heap, NULL);
- if (heap_is_empty(heap)) {
+ heap = pcb_heap_create();
+ pcb_r_search(tree, (pcb_box_t *) curh, NULL, heap_it, heap, NULL);
+ if (pcb_heap_is_empty(heap)) {
#ifndef NDEBUG
#ifdef DEBUG
poly_dump(dest);
#endif
#endif
- poly_DelContour(&curh);
- error(err_bad_parm);
+ pcb_poly_contour_del(&curh);
+ error(pcb_err_bad_parm);
}
/* Now search the heap for the container. If there was only one item
* in the heap, assume it is the container without the expense of
* proving it.
*/
- pa_info = (struct polyarea_info *) heap_remove_smallest(heap);
- if (heap_is_empty(heap)) { /* only one possibility it must be the right one */
- assert(poly_ContourInContour(pa_info->pa->contours, curh));
+ pa_info = (struct polyarea_info *) pcb_heap_remove_smallest(heap);
+ if (pcb_heap_is_empty(heap)) { /* only one possibility it must be the right one */
+ assert(pcb_poly_contour_in_contour(pa_info->pa->contours, curh));
container = pa_info->pa->contours;
}
else {
do {
- if (poly_ContourInContour(pa_info->pa->contours, curh)) {
+ if (pcb_poly_contour_in_contour(pa_info->pa->contours, curh)) {
container = pa_info->pa->contours;
break;
}
- if (heap_is_empty(heap))
+ if (pcb_heap_is_empty(heap))
break;
- pa_info = (struct polyarea_info *) heap_remove_smallest(heap);
+ pa_info = (struct polyarea_info *) pcb_heap_remove_smallest(heap);
}
while (1);
}
- heap_destroy(&heap);
+ pcb_heap_destroy(&heap);
if (container == NULL) {
/* bad input polygons were given */
#ifndef NDEBUG
@@ -1257,14 +1263,14 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
#endif
#endif
curh->next = NULL;
- poly_DelContour(&curh);
- error(err_bad_parm);
+ pcb_poly_contour_del(&curh);
+ error(pcb_err_bad_parm);
}
else {
/* Need to check if this new hole means we need to kick out any old ones for reprocessing */
while (1) {
struct find_inside_info info;
- PLINE *prev;
+ pcb_pline_t *prev;
info.want_inside = curh;
@@ -1276,7 +1282,7 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
info.result = NULL;
/* Rtree search, calling back a routine to longjmp back with data about any hole inside the added one */
/* Be sure not to bother jumping back to report the main contour! */
- r_search(pa_info->pa->contour_tree, (BoxType *) curh, NULL, find_inside, &info, NULL);
+ pcb_r_search(pa_info->pa->contour_tree, (pcb_box_t *) curh, NULL, find_inside, &info, NULL);
/* Nothing found? */
break;
@@ -1289,7 +1295,7 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
}
/* Remove hole from the contour */
- remove_contour(pa_info->pa, prev, info.result, TRUE);
+ remove_contour(pa_info->pa, prev, info.result, pcb_true);
/* Add hole as the next on the list to be processed in this very function */
info.result->next = *src;
@@ -1300,11 +1306,11 @@ static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src)
/* link at front of hole list */
curh->next = container->next;
container->next = curh;
- r_insert_entry(pa_info->pa->contour_tree, (BoxTypePtr) curh, 0);
+ pcb_r_insert_entry(pa_info->pa->contour_tree, (pcb_box_t *) curh, 0);
}
}
- r_destroy_tree(&tree);
+ pcb_r_destroy_tree(&tree);
free(all_pa_info);
} /* InsertHoles */
@@ -1317,85 +1323,85 @@ typedef enum {
} DIRECTION;
/* Start Rule */
-typedef int (*S_Rule) (VNODE *, DIRECTION *);
+typedef int (*S_Rule) (pcb_vnode_t *, DIRECTION *);
/* Jump Rule */
-typedef int (*J_Rule) (char, VNODE *, DIRECTION *);
+typedef int (*J_Rule) (char, pcb_vnode_t *, DIRECTION *);
-static int UniteS_Rule(VNODE * cur, DIRECTION * initdir)
+static int UniteS_Rule(pcb_vnode_t * cur, DIRECTION * initdir)
{
*initdir = FORW;
return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED);
}
-static int IsectS_Rule(VNODE * cur, DIRECTION * initdir)
+static int IsectS_Rule(pcb_vnode_t * cur, DIRECTION * initdir)
{
*initdir = FORW;
return (NODE_LABEL(cur) == INSIDE) || (NODE_LABEL(cur) == SHARED);
}
-static int SubS_Rule(VNODE * cur, DIRECTION * initdir)
+static int SubS_Rule(pcb_vnode_t * cur, DIRECTION * initdir)
{
*initdir = FORW;
return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED2);
}
-static int XorS_Rule(VNODE * cur, DIRECTION * initdir)
+static int XorS_Rule(pcb_vnode_t * cur, DIRECTION * initdir)
{
if (cur->Flags.status == INSIDE) {
*initdir = BACKW;
- return TRUE;
+ return pcb_true;
}
if (cur->Flags.status == OUTSIDE) {
*initdir = FORW;
- return TRUE;
+ return pcb_true;
}
- return FALSE;
+ return pcb_false;
}
-static int IsectJ_Rule(char p, VNODE * v, DIRECTION * cdir)
+static int IsectJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir)
{
assert(*cdir == FORW);
return (v->Flags.status == INSIDE || v->Flags.status == SHARED);
}
-static int UniteJ_Rule(char p, VNODE * v, DIRECTION * cdir)
+static int UniteJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir)
{
assert(*cdir == FORW);
return (v->Flags.status == OUTSIDE || v->Flags.status == SHARED);
}
-static int XorJ_Rule(char p, VNODE * v, DIRECTION * cdir)
+static int XorJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir)
{
if (v->Flags.status == INSIDE) {
*cdir = BACKW;
- return TRUE;
+ return pcb_true;
}
if (v->Flags.status == OUTSIDE) {
*cdir = FORW;
- return TRUE;
+ return pcb_true;
}
- return FALSE;
+ return pcb_false;
}
-static int SubJ_Rule(char p, VNODE * v, DIRECTION * cdir)
+static int SubJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir)
{
if (p == 'B' && v->Flags.status == INSIDE) {
*cdir = BACKW;
- return TRUE;
+ return pcb_true;
}
if (p == 'A' && v->Flags.status == OUTSIDE) {
*cdir = FORW;
- return TRUE;
+ return pcb_true;
}
if (v->Flags.status == SHARED2) {
if (p == 'A')
*cdir = FORW;
else
*cdir = BACKW;
- return TRUE;
+ return pcb_true;
}
- return FALSE;
+ return pcb_false;
}
/* return the edge that comes next.
@@ -1404,16 +1410,16 @@ static int SubJ_Rule(char p, VNODE * v, DIRECTION * cdir)
*
* returns pcb_true if an edge is found, pcb_false otherwise
*/
-static int jump(VNODE ** cur, DIRECTION * cdir, J_Rule rule)
+static int jump(pcb_vnode_t ** cur, DIRECTION * cdir, J_Rule rule)
{
- CVCList *d, *start;
- VNODE *e;
+ pcb_cvc_list_t *d, *start;
+ pcb_vnode_t *e;
DIRECTION newone;
if (!(*cur)->cvc_prev) { /* not a cross-vertex */
if (*cdir == FORW ? (*cur)->Flags.mark : (*cur)->prev->Flags.mark)
- return FALSE;
- return TRUE;
+ return pcb_false;
+ return pcb_true;
}
#ifdef DEBUG_JUMP
DEBUGP("jump entering node at %$mD\n", (*cur)->point[0], (*cur)->point[1]);
@@ -1438,17 +1444,17 @@ static int jump(VNODE ** cur, DIRECTION * cdir, J_Rule rule)
#endif
*cur = d->parent;
*cdir = newone;
- return TRUE;
+ return pcb_true;
}
}
}
while ((d = d->prev) != start);
- return FALSE;
+ return pcb_false;
}
-static int Gather(VNODE * start, PLINE ** result, J_Rule v_rule, DIRECTION initdir)
+static int Gather(pcb_vnode_t * start, pcb_pline_t ** result, J_Rule v_rule, DIRECTION initdir)
{
- VNODE *cur = start, *newn;
+ pcb_vnode_t *cur = start, *newn;
DIRECTION dir = initdir;
#ifdef DEBUG_GATHER
DEBUGP("gather direction = %d\n", dir);
@@ -1460,14 +1466,14 @@ static int Gather(VNODE * start, PLINE ** result, J_Rule v_rule, DIRECTION initd
break;
/* add edge to polygon */
if (!*result) {
- *result = poly_NewContour(cur->point);
+ *result = pcb_poly_contour_new(cur->point);
if (*result == NULL)
- return err_no_memory;
+ return pcb_err_no_memory;
}
else {
- if ((newn = poly_CreateNode(cur->point)) == NULL)
- return err_no_memory;
- poly_InclVertex((*result)->head.prev, newn);
+ if ((newn = pcb_poly_node_create(cur->point)) == NULL)
+ return pcb_err_no_memory;
+ pcb_poly_vertex_include((*result)->head.prev, newn);
}
#ifdef DEBUG_GATHER
DEBUGP("gather vertex at %#mD\n", cur->point[0], cur->point[1]);
@@ -1483,21 +1489,21 @@ static int Gather(VNODE * start, PLINE ** result, J_Rule v_rule, DIRECTION initd
cur = (dir == FORW ? cur->next : cur->prev);
}
while (1);
- return err_ok;
+ return pcb_err_ok;
} /* Gather */
-static void Collect1(jmp_buf * e, VNODE * cur, DIRECTION dir, POLYAREA ** contours, PLINE ** holes, J_Rule j_rule)
+static void Collect1(jmp_buf * e, pcb_vnode_t * cur, DIRECTION dir, pcb_polyarea_t ** contours, pcb_pline_t ** holes, J_Rule j_rule)
{
- PLINE *p = NULL; /* start making contour */
- int errc = err_ok;
- if ((errc = Gather(dir == FORW ? cur : cur->next, &p, j_rule, dir)) != err_ok) {
+ pcb_pline_t *p = NULL; /* start making contour */
+ int errc = pcb_err_ok;
+ if ((errc = Gather(dir == FORW ? cur : cur->next, &p, j_rule, dir)) != pcb_err_ok) {
if (p != NULL)
- poly_DelContour(&p);
+ pcb_poly_contour_del(&p);
error(errc);
}
if (!p)
return;
- poly_PreContour(p, TRUE);
+ pcb_poly_contour_pre(p, pcb_true);
if (p->Count > 2) {
#ifdef DEBUG_GATHER
DEBUGP("adding contour with %d vertices and direction %c\n", p->Count, p->Flags.orient ? 'F' : 'B');
@@ -1509,13 +1515,13 @@ static void Collect1(jmp_buf * e, VNODE * cur, DIRECTION dir, POLYAREA ** contou
#ifdef DEBUG_GATHER
DEBUGP("Bad contour! Not enough points!!\n");
#endif
- poly_DelContour(&p);
+ pcb_poly_contour_del(&p);
}
}
-static void Collect(jmp_buf * e, PLINE * a, POLYAREA ** contours, PLINE ** holes, S_Rule s_rule, J_Rule j_rule)
+static void Collect(jmp_buf * e, pcb_pline_t * a, pcb_polyarea_t ** contours, pcb_pline_t ** holes, S_Rule s_rule, J_Rule j_rule)
{
- VNODE *cur, *other;
+ pcb_vnode_t *cur, *other;
DIRECTION dir;
cur = &a->head;
@@ -1531,70 +1537,70 @@ static void Collect(jmp_buf * e, PLINE * a, POLYAREA ** contours, PLINE ** holes
static int
-cntr_Collect(jmp_buf * e, PLINE ** A, POLYAREA ** contours, PLINE ** holes,
- int action, POLYAREA * owner, POLYAREA * parent, PLINE * parent_contour)
+cntr_Collect(jmp_buf * e, pcb_pline_t ** A, pcb_polyarea_t ** contours, pcb_pline_t ** holes,
+ int action, pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour)
{
- PLINE *tmprev;
+ pcb_pline_t *tmprev;
if ((*A)->Flags.status == ISECTED) {
switch (action) {
- case PBO_UNITE:
+ case PCB_PBO_UNITE:
Collect(e, *A, contours, holes, UniteS_Rule, UniteJ_Rule);
break;
- case PBO_ISECT:
+ case PCB_PBO_ISECT:
Collect(e, *A, contours, holes, IsectS_Rule, IsectJ_Rule);
break;
- case PBO_XOR:
+ case PCB_PBO_XOR:
Collect(e, *A, contours, holes, XorS_Rule, XorJ_Rule);
break;
- case PBO_SUB:
+ case PCB_PBO_SUB:
Collect(e, *A, contours, holes, SubS_Rule, SubJ_Rule);
break;
};
}
else {
switch (action) {
- case PBO_ISECT:
+ case PCB_PBO_ISECT:
if ((*A)->Flags.status == INSIDE) {
tmprev = *A;
/* disappear this contour (rtree entry removed in PutContour) */
*A = tmprev->next;
tmprev->next = NULL;
PutContour(e, tmprev, contours, holes, owner, NULL, NULL);
- return TRUE;
+ return pcb_true;
}
break;
- case PBO_XOR:
+ case PCB_PBO_XOR:
if ((*A)->Flags.status == INSIDE) {
tmprev = *A;
/* disappear this contour (rtree entry removed in PutContour) */
*A = tmprev->next;
tmprev->next = NULL;
- poly_InvContour(tmprev);
+ pcb_poly_contour_inv(tmprev);
PutContour(e, tmprev, contours, holes, owner, NULL, NULL);
- return TRUE;
+ return pcb_true;
}
/* break; *//* Fall through (I think this is correct! pcjc2) */
- case PBO_UNITE:
- case PBO_SUB:
+ case PCB_PBO_UNITE:
+ case PCB_PBO_SUB:
if ((*A)->Flags.status == OUTSIDE) {
tmprev = *A;
/* disappear this contour (rtree entry removed in PutContour) */
*A = tmprev->next;
tmprev->next = NULL;
PutContour(e, tmprev, contours, holes, owner, parent, parent_contour);
- return TRUE;
+ return pcb_true;
}
break;
}
}
- return FALSE;
+ return pcb_false;
} /* cntr_Collect */
-static void M_B_AREA_Collect(jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours, PLINE ** holes, int action)
+static void M_B_AREA_Collect(jmp_buf * e, pcb_polyarea_t * bfst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action)
{
- POLYAREA *b = bfst;
- PLINE **cur, **next, *tmp;
+ pcb_polyarea_t *b = bfst;
+ pcb_pline_t **cur, **next, *tmp;
assert(b != NULL);
do {
@@ -1605,10 +1611,10 @@ static void M_B_AREA_Collect(jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
if ((*cur)->Flags.status == INSIDE)
switch (action) {
- case PBO_XOR:
- case PBO_SUB:
- poly_InvContour(*cur);
- case PBO_ISECT:
+ case PCB_PBO_XOR:
+ case PCB_PBO_SUB:
+ pcb_poly_contour_inv(*cur);
+ case PCB_PBO_ISECT:
tmp = *cur;
*cur = tmp->next;
next = cur;
@@ -1616,13 +1622,13 @@ static void M_B_AREA_Collect(jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
tmp->Flags.status = UNKNWN;
PutContour(e, tmp, contours, holes, b, NULL, NULL);
break;
- case PBO_UNITE:
+ case PCB_PBO_UNITE:
break; /* nothing to do - already included */
}
else if ((*cur)->Flags.status == OUTSIDE)
switch (action) {
- case PBO_XOR:
- case PBO_UNITE:
+ case PCB_PBO_XOR:
+ case PCB_PBO_UNITE:
/* include */
tmp = *cur;
*cur = tmp->next;
@@ -1631,8 +1637,8 @@ static void M_B_AREA_Collect(jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
tmp->Flags.status = UNKNWN;
PutContour(e, tmp, contours, holes, b, NULL, NULL);
break;
- case PBO_ISECT:
- case PBO_SUB:
+ case PCB_PBO_ISECT:
+ case PCB_PBO_SUB:
break; /* do nothing, not included */
}
}
@@ -1641,19 +1647,19 @@ static void M_B_AREA_Collect(jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
}
-static inline int contour_is_first(POLYAREA * a, PLINE * cur)
+static inline int contour_is_first(pcb_polyarea_t * a, pcb_pline_t * cur)
{
return (a->contours == cur);
}
-static inline int contour_is_last(PLINE * cur)
+static inline int contour_is_last(pcb_pline_t * cur)
{
return (cur->next == NULL);
}
-static inline void remove_polyarea(POLYAREA ** list, POLYAREA * piece)
+static inline void remove_polyarea(pcb_polyarea_t ** list, pcb_polyarea_t * piece)
{
/* If this item was the start of the list, advance that pointer */
if (*list == piece)
@@ -1668,11 +1674,11 @@ static inline void remove_polyarea(POLYAREA ** list, POLYAREA * piece)
piece->f = piece->b = piece;
}
-static void M_POLYAREA_separate_isected(jmp_buf * e, POLYAREA ** pieces, PLINE ** holes, PLINE ** isected)
+static void M_pcb_polyarea_separate_isected(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, pcb_pline_t ** isected)
{
- POLYAREA *a = *pieces;
- POLYAREA *anext;
- PLINE *curc, *next, *prev;
+ pcb_polyarea_t *a = *pieces;
+ pcb_polyarea_t *anext;
+ pcb_pline_t *curc, *next, *prev;
int finished;
if (a == NULL)
@@ -1720,7 +1726,7 @@ static void M_POLYAREA_separate_isected(jmp_buf * e, POLYAREA ** pieces, PLINE *
if (is_first && is_last) {
remove_polyarea(pieces, a);
- poly_Free(&a); /* NB: Sets a to NULL */
+ pcb_polyarea_free(&a); /* NB: Sets a to NULL */
}
}
@@ -1746,35 +1752,35 @@ static void M_POLYAREA_separate_isected(jmp_buf * e, POLYAREA ** pieces, PLINE *
struct find_inside_m_pa_info {
jmp_buf jb;
- POLYAREA *want_inside;
- PLINE *result;
+ pcb_polyarea_t *want_inside;
+ pcb_pline_t *result;
};
-static r_dir_t find_inside_m_pa(const BoxType * b, void *cl)
+static pcb_r_dir_t find_inside_m_pa(const pcb_box_t * b, void *cl)
{
struct find_inside_m_pa_info *info = (struct find_inside_m_pa_info *) cl;
- PLINE *check = (PLINE *) b;
+ pcb_pline_t *check = (pcb_pline_t *) b;
/* Don't report for the main contour */
- if (check->Flags.orient == PLF_DIR)
- return R_DIR_NOT_FOUND;
+ if (check->Flags.orient == PCB_PLF_DIR)
+ return PCB_R_DIR_NOT_FOUND;
/* Don't look at contours marked as being intersected */
if (check->Flags.status == ISECTED)
- return R_DIR_NOT_FOUND;
- if (cntr_in_M_POLYAREA(check, info->want_inside, FALSE)) {
+ return PCB_R_DIR_NOT_FOUND;
+ if (cntr_in_M_pcb_polyarea_t(check, info->want_inside, pcb_false)) {
info->result = check;
longjmp(info->jb, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE ** holes, int action, POLYAREA * bpa)
+static void M_pcb_polyarea_t_update_primary(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, int action, pcb_polyarea_t * bpa)
{
- POLYAREA *a = *pieces;
- POLYAREA *b;
- POLYAREA *anext;
- PLINE *curc, *next, *prev;
- BoxType box;
+ pcb_polyarea_t *a = *pieces;
+ pcb_polyarea_t *b;
+ pcb_polyarea_t *anext;
+ pcb_pline_t *curc, *next, *prev;
+ pcb_box_t box;
/* int inv_inside = 0; */
int del_inside = 0;
int del_outside = 0;
@@ -1784,27 +1790,27 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
return;
switch (action) {
- case PBO_ISECT:
+ case PCB_PBO_ISECT:
del_outside = 1;
break;
- case PBO_UNITE:
- case PBO_SUB:
+ case PCB_PBO_UNITE:
+ case PCB_PBO_SUB:
del_inside = 1;
break;
- case PBO_XOR: /* NOT IMPLEMENTED OR USED */
+ case PCB_PBO_XOR: /* NOT IMPLEMENTED OR USED */
/* inv_inside = 1; */
assert(0);
break;
}
- box = *((BoxType *) bpa->contours);
+ box = *((pcb_box_t *) bpa->contours);
b = bpa;
while ((b = b->f) != bpa) {
- BoxType *b_box = (BoxType *) b->contours;
- MAKEMIN(box.X1, b_box->X1);
- MAKEMIN(box.Y1, b_box->Y1);
- MAKEMAX(box.X2, b_box->X2);
- MAKEMAX(box.Y2, b_box->Y2);
+ pcb_box_t *b_box = (pcb_box_t *) b->contours;
+ PCB_MAKE_MIN(box.X1, b_box->X1);
+ PCB_MAKE_MIN(box.Y1, b_box->Y1);
+ PCB_MAKE_MAX(box.X2, b_box->X2);
+ PCB_MAKE_MAX(box.Y2, b_box->Y2);
}
if (del_inside) {
@@ -1822,15 +1828,15 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
&& (a->contours->xmax <= box.X2)
&& (a->contours->ymax <= box.Y2)) &&
/* Then test properly */
- cntr_in_M_POLYAREA(a->contours, bpa, FALSE)) {
+ cntr_in_M_pcb_polyarea_t(a->contours, bpa, pcb_false)) {
/* Delete this contour, all children -> holes queue */
/* Delete the outer contour */
curc = a->contours;
- remove_contour(a, NULL, curc, FALSE); /* Rtree deleted in poly_Free below */
+ remove_contour(a, NULL, curc, pcb_false); /* Rtree deleted in poly_Free below */
/* a->contours now points to the remaining holes */
- poly_DelContour(&curc);
+ pcb_poly_contour_del(&curc);
if (a->contours != NULL) {
/* Find the end of the list of holes */
@@ -1845,7 +1851,7 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
}
remove_polyarea(pieces, a);
- poly_Free(&a); /* NB: Sets a to NULL */
+ pcb_polyarea_free(&a); /* NB: Sets a to NULL */
continue;
}
@@ -1853,7 +1859,7 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
/* Loop whilst we find INSIDE contours to delete */
while (1) {
struct find_inside_m_pa_info info;
- PLINE *prev;
+ pcb_pline_t *prev;
info.want_inside = bpa;
@@ -1867,7 +1873,7 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
* data about any hole inside the B polygon.
* NB: Does not jump back to report the main contour!
*/
- r_search(a->contour_tree, &box, NULL, find_inside_m_pa, &info, NULL);
+ pcb_r_search(a->contour_tree, &box, NULL, find_inside_m_pa, &info, NULL);
/* Nothing found? */
break;
@@ -1880,8 +1886,8 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
}
/* Remove hole from the contour */
- remove_contour(a, prev, info.result, TRUE);
- poly_DelContour(&info.result);
+ remove_contour(a, prev, info.result, pcb_true);
+ pcb_poly_contour_del(&info.result);
}
/* End check for deleted holes */
@@ -1911,7 +1917,7 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
next = curc->next;
if (del_outside)
- del_contour = curc->Flags.status != ISECTED && !cntr_in_M_POLYAREA(curc, bpa, FALSE);
+ del_contour = curc->Flags.status != ISECTED && !cntr_in_M_pcb_polyarea_t(curc, bpa, pcb_false);
/* Skip intersected contours */
if (curc->Flags.status == ISECTED) {
@@ -1928,7 +1934,7 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
if (del_contour) {
/* Delete the contour */
- poly_DelContour(&curc); /* NB: Sets curc to NULL */
+ pcb_poly_contour_del(&curc); /* NB: Sets curc to NULL */
}
else if (hole_contour) {
/* Link into the list of holes */
@@ -1941,7 +1947,7 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
if (is_first && is_last) {
remove_polyarea(pieces, a);
- poly_Free(&a); /* NB: Sets a to NULL */
+ pcb_polyarea_free(&a); /* NB: Sets a to NULL */
}
}
@@ -1965,9 +1971,9 @@ static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE **
}
static void
-M_POLYAREA_Collect_separated(jmp_buf * e, PLINE * afst, POLYAREA ** contours, PLINE ** holes, int action, BOOLp maybe)
+M_pcb_polyarea_t_Collect_separated(jmp_buf * e, pcb_pline_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe)
{
- PLINE **cur, **next;
+ pcb_pline_t **cur, **next;
for (cur = &afst; *cur != NULL; cur = next) {
next = &((*cur)->next);
@@ -1977,11 +1983,11 @@ M_POLYAREA_Collect_separated(jmp_buf * e, PLINE * afst, POLYAREA ** contours, PL
}
}
-static void M_POLYAREA_Collect(jmp_buf * e, POLYAREA * afst, POLYAREA ** contours, PLINE ** holes, int action, BOOLp maybe)
+static void M_pcb_polyarea_t_Collect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe)
{
- POLYAREA *a = afst;
- POLYAREA *parent = NULL; /* Quiet compiler warning */
- PLINE **cur, **next, *parent_contour;
+ pcb_polyarea_t *a = afst;
+ pcb_polyarea_t *parent = NULL; /* Quiet compiler warning */
+ pcb_pline_t **cur, **next, *parent_contour;
assert(a != NULL);
while ((a = a->f) != afst);
@@ -2018,47 +2024,47 @@ static void M_POLYAREA_Collect(jmp_buf * e, POLYAREA * afst, POLYAREA ** contour
}
/* determine if two polygons touch or overlap */
-BOOLp Touching(POLYAREA * a, POLYAREA * b)
+pcb_bool pcb_polyarea_touching(pcb_polyarea_t * a, pcb_polyarea_t * b)
{
jmp_buf e;
int code;
if ((code = setjmp(e)) == 0) {
#ifdef DEBUG
- if (!poly_Valid(a))
+ if (!pcb_poly_valid(a))
return -1;
- if (!poly_Valid(b))
+ if (!pcb_poly_valid(b))
return -1;
#endif
- M_POLYAREA_intersect(&e, a, b, pcb_false);
+ M_pcb_polyarea_t_intersect(&e, a, b, pcb_false);
- if (M_POLYAREA_label(a, b, TRUE))
- return TRUE;
- if (M_POLYAREA_label(b, a, TRUE))
- return TRUE;
+ if (M_pcb_polyarea_t_label(a, b, pcb_true))
+ return pcb_true;
+ if (M_pcb_polyarea_t_label(b, a, pcb_true))
+ return pcb_true;
}
else if (code == TOUCHES)
- return TRUE;
- return FALSE;
+ return pcb_true;
+ return pcb_false;
}
/* the main clipping routines */
-int poly_Boolean(const POLYAREA * a_org, const POLYAREA * b_org, POLYAREA ** res, int action)
+int pcb_polyarea_boolean(const pcb_polyarea_t * a_org, const pcb_polyarea_t * b_org, pcb_polyarea_t ** res, int action)
{
- POLYAREA *a = NULL, *b = NULL;
+ pcb_polyarea_t *a = NULL, *b = NULL;
- if (!poly_M_Copy0(&a, a_org) || !poly_M_Copy0(&b, b_org))
- return err_no_memory;
+ if (!pcb_polyarea_m_copy0(&a, a_org) || !pcb_polyarea_m_copy0(&b, b_org))
+ return pcb_err_no_memory;
- return poly_Boolean_free(a, b, res, action);
+ return pcb_polyarea_boolean_free(a, b, res, action);
} /* poly_Boolean */
/* just like poly_Boolean but frees the input polys */
-int poly_Boolean_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
+int pcb_polyarea_boolean_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** res, int action)
{
- POLYAREA *a = ai, *b = bi;
- PLINE *a_isected = NULL;
- PLINE *p, *holes = NULL;
+ pcb_polyarea_t *a = ai, *b = bi;
+ pcb_pline_t *a_isected = NULL;
+ pcb_pline_t *p, *holes = NULL;
jmp_buf e;
int code;
@@ -2066,56 +2072,56 @@ int poly_Boolean_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
if (!a) {
switch (action) {
- case PBO_XOR:
- case PBO_UNITE:
+ case PCB_PBO_XOR:
+ case PCB_PBO_UNITE:
*res = bi;
- return err_ok;
- case PBO_SUB:
- case PBO_ISECT:
+ return pcb_err_ok;
+ case PCB_PBO_SUB:
+ case PCB_PBO_ISECT:
if (b != NULL)
- poly_Free(&b);
- return err_ok;
+ pcb_polyarea_free(&b);
+ return pcb_err_ok;
}
}
if (!b) {
switch (action) {
- case PBO_SUB:
- case PBO_XOR:
- case PBO_UNITE:
+ case PCB_PBO_SUB:
+ case PCB_PBO_XOR:
+ case PCB_PBO_UNITE:
*res = ai;
- return err_ok;
- case PBO_ISECT:
+ return pcb_err_ok;
+ case PCB_PBO_ISECT:
if (a != NULL)
- poly_Free(&a);
- return err_ok;
+ pcb_polyarea_free(&a);
+ return pcb_err_ok;
}
}
if ((code = setjmp(e)) == 0) {
#ifdef DEBUG
- assert(poly_Valid(a));
- assert(poly_Valid(b));
+ assert(pcb_poly_valid(a));
+ assert(pcb_poly_valid(b));
#endif
/* intersect needs to make a list of the contours in a and b which are intersected */
- M_POLYAREA_intersect(&e, a, b, TRUE);
+ M_pcb_polyarea_t_intersect(&e, a, b, pcb_true);
/* We could speed things up a lot here if we only processed the relevant contours */
/* NB: Relevant parts of a are labeled below */
- M_POLYAREA_label(b, a, FALSE);
+ M_pcb_polyarea_t_label(b, a, pcb_false);
*res = a;
- M_POLYAREA_update_primary(&e, res, &holes, action, b);
- M_POLYAREA_separate_isected(&e, res, &holes, &a_isected);
- M_POLYAREA_label_separated(a_isected, b, FALSE);
- M_POLYAREA_Collect_separated(&e, a_isected, res, &holes, action, FALSE);
+ M_pcb_polyarea_t_update_primary(&e, res, &holes, action, b);
+ M_pcb_polyarea_separate_isected(&e, res, &holes, &a_isected);
+ M_pcb_polyarea_t_label_separated(a_isected, b, pcb_false);
+ M_pcb_polyarea_t_Collect_separated(&e, a_isected, res, &holes, action, pcb_false);
M_B_AREA_Collect(&e, b, res, &holes, action);
- poly_Free(&b);
+ pcb_polyarea_free(&b);
/* free a_isected */
while ((p = a_isected) != NULL) {
a_isected = p->next;
- poly_DelContour(&p);
+ pcb_poly_contour_del(&p);
}
InsertHoles(&e, *res, &holes);
@@ -2123,22 +2129,22 @@ int poly_Boolean_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
/* delete holes if any left */
while ((p = holes) != NULL) {
holes = p->next;
- poly_DelContour(&p);
+ pcb_poly_contour_del(&p);
}
if (code) {
- poly_Free(res);
+ pcb_polyarea_free(res);
return code;
}
- assert(!*res || poly_Valid(*res));
+ assert(!*res || pcb_poly_valid(*res));
return code;
} /* poly_Boolean_free */
-static void clear_marks(POLYAREA * p)
+static void clear_marks(pcb_polyarea_t * p)
{
- POLYAREA *n = p;
- PLINE *c;
- VNODE *v;
+ pcb_polyarea_t *n = p;
+ pcb_pline_t *c;
+ pcb_vnode_t *v;
do {
for (c = n->contours; c; c = c->next) {
@@ -2155,10 +2161,10 @@ static void clear_marks(POLYAREA * p)
/* compute the intersection and subtraction (divides "a" into two pieces)
* and frees the input polys. This assumes that bi is a single simple polygon.
*/
-int poly_AndSubtract_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** aandb, POLYAREA ** aminusb)
+int pcb_polyarea_and_subtract_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** aandb, pcb_polyarea_t ** aminusb)
{
- POLYAREA *a = ai, *b = bi;
- PLINE *p, *holes = NULL;
+ pcb_polyarea_t *a = ai, *b = bi;
+ pcb_pline_t *p, *holes = NULL;
jmp_buf e;
int code;
@@ -2168,100 +2174,100 @@ int poly_AndSubtract_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** aandb, POLYA
if ((code = setjmp(e)) == 0) {
#ifdef DEBUG
- if (!poly_Valid(a))
+ if (!pcb_poly_valid(a))
return -1;
- if (!poly_Valid(b))
+ if (!pcb_poly_valid(b))
return -1;
#endif
- M_POLYAREA_intersect(&e, a, b, TRUE);
+ M_pcb_polyarea_t_intersect(&e, a, b, pcb_true);
- M_POLYAREA_label(a, b, FALSE);
- M_POLYAREA_label(b, a, FALSE);
+ M_pcb_polyarea_t_label(a, b, pcb_false);
+ M_pcb_polyarea_t_label(b, a, pcb_false);
- M_POLYAREA_Collect(&e, a, aandb, &holes, PBO_ISECT, FALSE);
+ M_pcb_polyarea_t_Collect(&e, a, aandb, &holes, PCB_PBO_ISECT, pcb_false);
InsertHoles(&e, *aandb, &holes);
- assert(poly_Valid(*aandb));
+ assert(pcb_poly_valid(*aandb));
/* delete holes if any left */
while ((p = holes) != NULL) {
holes = p->next;
- poly_DelContour(&p);
+ pcb_poly_contour_del(&p);
}
holes = NULL;
clear_marks(a);
clear_marks(b);
- M_POLYAREA_Collect(&e, a, aminusb, &holes, PBO_SUB, FALSE);
+ M_pcb_polyarea_t_Collect(&e, a, aminusb, &holes, PCB_PBO_SUB, pcb_false);
InsertHoles(&e, *aminusb, &holes);
- poly_Free(&a);
- poly_Free(&b);
- assert(poly_Valid(*aminusb));
+ pcb_polyarea_free(&a);
+ pcb_polyarea_free(&b);
+ assert(pcb_poly_valid(*aminusb));
}
/* delete holes if any left */
while ((p = holes) != NULL) {
holes = p->next;
- poly_DelContour(&p);
+ pcb_poly_contour_del(&p);
}
if (code) {
- poly_Free(aandb);
- poly_Free(aminusb);
+ pcb_polyarea_free(aandb);
+ pcb_polyarea_free(aminusb);
return code;
}
- assert(!*aandb || poly_Valid(*aandb));
- assert(!*aminusb || poly_Valid(*aminusb));
+ assert(!*aandb || pcb_poly_valid(*aandb));
+ assert(!*aminusb || pcb_poly_valid(*aminusb));
return code;
} /* poly_AndSubtract_free */
-static inline int cntrbox_pointin(PLINE * c, Vector p)
+static inline int cntrbox_pointin(pcb_pline_t * c, pcb_vector_t p)
{
return (p[0] >= c->xmin && p[1] >= c->ymin && p[0] <= c->xmax && p[1] <= c->ymax);
}
-static inline int node_neighbours(VNODE * a, VNODE * b)
+static inline int node_neighbours(pcb_vnode_t * a, pcb_vnode_t * b)
{
return (a == b) || (a->next == b) || (b->next == a) || (a->next == b->next);
}
-VNODE *poly_CreateNode(Vector v)
+pcb_vnode_t *pcb_poly_node_create(pcb_vector_t v)
{
- VNODE *res;
- Coord *c;
+ pcb_vnode_t *res;
+ pcb_coord_t *c;
assert(v);
- res = (VNODE *) calloc(1, sizeof(VNODE));
+ res = (pcb_vnode_t *) calloc(1, sizeof(pcb_vnode_t));
if (res == NULL)
return NULL;
- /* bzero (res, sizeof (VNODE) - sizeof(Vector)); */
+ /* bzero (res, sizeof (pcb_vnode_t) - sizeof(pcb_vector_t)); */
c = res->point;
*c++ = *v++;
*c = *v;
return res;
}
-void poly_IniContour(PLINE * c)
+void pcb_poly_contour_init(pcb_pline_t * c)
{
if (c == NULL)
return;
- /* bzero (c, sizeof(PLINE)); */
+ /* bzero (c, sizeof(pcb_pline_t)); */
c->head.next = c->head.prev = &c->head;
c->xmin = c->ymin = 0x7fffffff;
c->xmax = c->ymax = 0x80000000;
- c->is_round = FALSE;
+ c->is_round = pcb_false;
c->cx = 0;
c->cy = 0;
c->radius = 0;
}
-PLINE *poly_NewContour(Vector v)
+pcb_pline_t *pcb_poly_contour_new(pcb_vector_t v)
{
- PLINE *res;
+ pcb_pline_t *res;
- res = (PLINE *) calloc(1, sizeof(PLINE));
+ res = (pcb_pline_t *) calloc(1, sizeof(pcb_pline_t));
if (res == NULL)
return NULL;
- poly_IniContour(res);
+ pcb_poly_contour_init(res);
if (v != NULL) {
Vcopy(res->head.point, v);
@@ -2271,21 +2277,21 @@ PLINE *poly_NewContour(Vector v)
return res;
}
-void poly_ClrContour(PLINE * c)
+void pcb_poly_contour_clear(pcb_pline_t * c)
{
- VNODE *cur;
+ pcb_vnode_t *cur;
assert(c != NULL);
while ((cur = c->head.next) != &c->head) {
- poly_ExclVertex(cur);
+ pcb_poly_vertex_exclude(cur);
free(cur);
}
- poly_IniContour(c);
+ pcb_poly_contour_init(c);
}
-void poly_DelContour(PLINE ** c)
+void pcb_poly_contour_del(pcb_pline_t ** c)
{
- VNODE *cur, *prev;
+ pcb_vnode_t *cur, *prev;
if (*c == NULL)
return;
@@ -2303,17 +2309,17 @@ void poly_DelContour(PLINE ** c)
}
/* FIXME -- strict aliasing violation. */
if ((*c)->tree) {
- rtree_t *r = (*c)->tree;
- r_destroy_tree(&r);
+ pcb_rtree_t *r = (*c)->tree;
+ pcb_r_destroy_tree(&r);
}
free(*c), *c = NULL;
}
-void poly_PreContour(PLINE * C, BOOLp optimize)
+void pcb_poly_contour_pre(pcb_pline_t * C, pcb_bool optimize)
{
double area = 0;
- VNODE *p, *c;
- Vector p1, p2;
+ pcb_vnode_t *p, *c;
+ pcb_vector_t p1, p2;
assert(C != NULL);
@@ -2328,8 +2334,8 @@ void poly_PreContour(PLINE * C, BOOLp optimize)
* So, remove the point c
*/
- if (vect_det2(p1, p2) == 0) {
- poly_ExclVertex(c);
+ if (pcb_vect_det2(p1, p2) == 0) {
+ pcb_poly_vertex_exclude(c);
free(c);
c = p;
}
@@ -2351,20 +2357,20 @@ void poly_PreContour(PLINE * C, BOOLp optimize)
}
C->area = PCB_ABS(area);
if (C->Count > 2)
- C->Flags.orient = ((area < 0) ? PLF_INV : PLF_DIR);
- C->tree = (rtree_t *) make_edge_tree(C);
+ C->Flags.orient = ((area < 0) ? PCB_PLF_INV : PCB_PLF_DIR);
+ C->tree = (pcb_rtree_t *) make_edge_tree(C);
} /* poly_PreContour */
-static r_dir_t flip_cb(const BoxType * b, void *cl)
+static pcb_r_dir_t flip_cb(const pcb_box_t * b, void *cl)
{
struct seg *s = (struct seg *) b;
s->v = s->v->prev;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-void poly_InvContour(PLINE * c)
+void pcb_poly_contour_inv(pcb_pline_t * c)
{
- VNODE *cur, *next;
+ pcb_vnode_t *cur, *next;
int r;
assert(c != NULL);
@@ -2378,12 +2384,12 @@ void poly_InvContour(PLINE * c)
while ((cur = next) != &c->head);
c->Flags.orient ^= 1;
if (c->tree) {
- r_search(c->tree, NULL, NULL, flip_cb, NULL, &r);
+ pcb_r_search(c->tree, NULL, NULL, flip_cb, NULL, &r);
assert(r == c->Count);
}
}
-void poly_ExclVertex(VNODE * node)
+void pcb_poly_vertex_exclude(pcb_vnode_t * node)
{
assert(node != NULL);
if (node->cvc_next) {
@@ -2394,7 +2400,7 @@ void poly_ExclVertex(VNODE * node)
node->next->prev = node->prev;
}
-void poly_InclVertex(VNODE * after, VNODE * node)
+void pcb_poly_vertex_include(pcb_vnode_t * after, pcb_vnode_t * node)
{
double a, b;
assert(after != NULL);
@@ -2411,22 +2417,22 @@ void poly_InclVertex(VNODE * after, VNODE * node)
b = (node->point[0] - node->prev->prev->point[0]);
b *= (node->prev->point[1] - node->prev->prev->point[1]);
if (fabs(a - b) < EPSILON) {
- VNODE *t = node->prev;
+ pcb_vnode_t *t = node->prev;
t->prev->next = node;
node->prev = t->prev;
free(t);
}
}
-BOOLp poly_CopyContour(PLINE ** dst, PLINE * src)
+pcb_bool pcb_poly_contour_copy(pcb_pline_t ** dst, pcb_pline_t * src)
{
- VNODE *cur, *newnode;
+ pcb_vnode_t *cur, *newnode;
assert(src != NULL);
*dst = NULL;
- *dst = poly_NewContour(src->head.point);
+ *dst = pcb_poly_contour_new(src->head.point);
if (*dst == NULL)
- return FALSE;
+ return pcb_false;
(*dst)->Count = src->Count;
(*dst)->Flags.orient = src->Flags.orient;
@@ -2435,47 +2441,47 @@ BOOLp poly_CopyContour(PLINE ** dst, PLINE * src)
(*dst)->area = src->area;
for (cur = src->head.next; cur != &src->head; cur = cur->next) {
- if ((newnode = poly_CreateNode(cur->point)) == NULL)
- return FALSE;
+ if ((newnode = pcb_poly_node_create(cur->point)) == NULL)
+ return pcb_false;
/* newnode->Flags = cur->Flags; */
- poly_InclVertex((*dst)->head.prev, newnode);
+ pcb_poly_vertex_include((*dst)->head.prev, newnode);
}
- (*dst)->tree = (rtree_t *) make_edge_tree(*dst);
- return TRUE;
+ (*dst)->tree = (pcb_rtree_t *) make_edge_tree(*dst);
+ return pcb_true;
}
/**********************************************************************/
/* polygon routines */
-BOOLp poly_Copy0(POLYAREA ** dst, const POLYAREA * src)
+pcb_bool pcb_polyarea_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * src)
{
*dst = NULL;
if (src != NULL)
- *dst = (POLYAREA *) calloc(1, sizeof(POLYAREA));
+ *dst = (pcb_polyarea_t *) calloc(1, sizeof(pcb_polyarea_t));
if (*dst == NULL)
- return FALSE;
- (*dst)->contour_tree = r_create_tree(NULL, 0, 0);
+ return pcb_false;
+ (*dst)->contour_tree = pcb_r_create_tree(NULL, 0, 0);
- return poly_Copy1(*dst, src);
+ return pcb_polyarea_copy1(*dst, src);
}
-BOOLp poly_Copy1(POLYAREA * dst, const POLYAREA * src)
+pcb_bool pcb_polyarea_copy1(pcb_polyarea_t * dst, const pcb_polyarea_t * src)
{
- PLINE *cur, **last = &dst->contours;
+ pcb_pline_t *cur, **last = &dst->contours;
*last = NULL;
dst->f = dst->b = dst;
for (cur = src->contours; cur != NULL; cur = cur->next) {
- if (!poly_CopyContour(last, cur))
- return FALSE;
- r_insert_entry(dst->contour_tree, (BoxTypePtr) * last, 0);
+ if (!pcb_poly_contour_copy(last, cur))
+ return pcb_false;
+ pcb_r_insert_entry(dst->contour_tree, (pcb_box_t *) * last, 0);
last = &(*last)->next;
}
- return TRUE;
+ return pcb_true;
}
-void poly_M_Incl(POLYAREA ** list, POLYAREA * a)
+void pcb_polyarea_m_include(pcb_polyarea_t ** list, pcb_polyarea_t * a)
{
if (*list == NULL)
a->f = a->b = a, *list = a;
@@ -2486,61 +2492,61 @@ void poly_M_Incl(POLYAREA ** list, POLYAREA * a)
}
}
-BOOLp poly_M_Copy0(POLYAREA ** dst, const POLYAREA * srcfst)
+pcb_bool pcb_polyarea_m_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * srcfst)
{
- const POLYAREA *src = srcfst;
- POLYAREA *di;
+ const pcb_polyarea_t *src = srcfst;
+ pcb_polyarea_t *di;
*dst = NULL;
if (src == NULL)
- return FALSE;
+ return pcb_false;
do {
- if ((di = poly_Create()) == NULL || !poly_Copy1(di, src))
- return FALSE;
- poly_M_Incl(dst, di);
+ if ((di = pcb_polyarea_create()) == NULL || !pcb_polyarea_copy1(di, src))
+ return pcb_false;
+ pcb_polyarea_m_include(dst, di);
}
while ((src = src->f) != srcfst);
- return TRUE;
+ return pcb_true;
}
-BOOLp poly_InclContour(POLYAREA * p, PLINE * c)
+pcb_bool pcb_polyarea_contour_include(pcb_polyarea_t * p, pcb_pline_t * c)
{
- PLINE *tmp;
+ pcb_pline_t *tmp;
if ((c == NULL) || (p == NULL))
- return FALSE;
- if (c->Flags.orient == PLF_DIR) {
+ return pcb_false;
+ if (c->Flags.orient == PCB_PLF_DIR) {
if (p->contours != NULL)
- return FALSE;
+ return pcb_false;
p->contours = c;
}
else {
if (p->contours == NULL)
- return FALSE;
+ return pcb_false;
/* link at front of hole list */
tmp = p->contours->next;
p->contours->next = c;
c->next = tmp;
}
- r_insert_entry(p->contour_tree, (BoxTypePtr) c, 0);
- return TRUE;
+ pcb_r_insert_entry(p->contour_tree, (pcb_box_t *) c, 0);
+ return pcb_true;
}
typedef struct pip {
int f;
- Vector p;
+ pcb_vector_t p;
jmp_buf env;
} pip;
-static r_dir_t crossing(const BoxType * b, void *cl)
+static pcb_r_dir_t crossing(const pcb_box_t * b, void *cl)
{
struct seg *s = (struct seg *) b;
struct pip *p = (struct pip *) cl;
if (s->v->point[1] <= p->p[1]) {
if (s->v->next->point[1] > p->p[1]) {
- Vector v1, v2;
+ pcb_vector_t v1, v2;
pcb_long64_t cross;
Vsub2(v1, s->v->next->point, s->v->point);
Vsub2(v2, p->p, s->v->point);
@@ -2555,7 +2561,7 @@ static r_dir_t crossing(const BoxType * b, void *cl)
}
else {
if (s->v->next->point[1] <= p->p[1]) {
- Vector v1, v2;
+ pcb_vector_t v1, v2;
pcb_long64_t cross;
Vsub2(v1, s->v->next->point, s->v->point);
Vsub2(v2, p->p, s->v->point);
@@ -2568,67 +2574,67 @@ static r_dir_t crossing(const BoxType * b, void *cl)
p->f -= 1;
}
}
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-int poly_InsideContour(PLINE * c, Vector p)
+int pcb_poly_contour_inside(pcb_pline_t * c, pcb_vector_t p)
{
struct pip info;
- BoxType ray;
+ pcb_box_t ray;
if (!cntrbox_pointin(c, p))
- return FALSE;
+ return pcb_false;
info.f = 0;
info.p[0] = ray.X1 = p[0];
info.p[1] = ray.Y1 = p[1];
ray.X2 = 0x7fffffff;
ray.Y2 = p[1] + 1;
if (setjmp(info.env) == 0)
- r_search(c->tree, &ray, NULL, crossing, &info, NULL);
+ pcb_r_search(c->tree, &ray, NULL, crossing, &info, NULL);
return info.f;
}
-BOOLp poly_CheckInside(POLYAREA * p, Vector v0)
+pcb_bool pcb_polyarea_contour_inside(pcb_polyarea_t * p, pcb_vector_t v0)
{
- PLINE *cur;
+ pcb_pline_t *cur;
if ((p == NULL) || (v0 == NULL) || (p->contours == NULL))
- return FALSE;
+ return pcb_false;
cur = p->contours;
- if (poly_InsideContour(cur, v0)) {
+ if (pcb_poly_contour_inside(cur, v0)) {
for (cur = cur->next; cur != NULL; cur = cur->next)
- if (poly_InsideContour(cur, v0))
- return FALSE;
- return TRUE;
+ if (pcb_poly_contour_inside(cur, v0))
+ return pcb_false;
+ return pcb_true;
}
- return FALSE;
+ return pcb_false;
}
-BOOLp poly_M_CheckInside(POLYAREA * p, Vector v0)
+pcb_bool poly_M_CheckInside(pcb_polyarea_t * p, pcb_vector_t v0)
{
- POLYAREA *cur;
+ pcb_polyarea_t *cur;
if ((p == NULL) || (v0 == NULL))
- return FALSE;
+ return pcb_false;
cur = p;
do {
- if (poly_CheckInside(cur, v0))
- return TRUE;
+ if (pcb_polyarea_contour_inside(cur, v0))
+ return pcb_true;
}
while ((cur = cur->f) != p);
- return FALSE;
+ return pcb_false;
}
-static double dot(Vector A, Vector B)
+static double dot(pcb_vector_t A, pcb_vector_t B)
{
return (double) A[0] * (double) B[0] + (double) A[1] * (double) B[1];
}
/* Compute whether point is inside a triangle formed by 3 other pints */
/* Algorithm from http://www.blackpawn.com/texts/pointinpoly/default.html */
-static int point_in_triangle(Vector A, Vector B, Vector C, Vector P)
+static int point_in_triangle(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t P)
{
- Vector v0, v1, v2;
+ pcb_vector_t v0, v1, v2;
double dot00, dot01, dot02, dot11, dot12;
double invDenom;
double u, v;
@@ -2658,13 +2664,13 @@ static int point_in_triangle(Vector A, Vector B, Vector C, Vector P)
}
-/* Returns the dot product of Vector A->B, and a vector
- * orthogonal to Vector C->D. The result is not normalised, so will be
+/* Returns the dot product of pcb_vector_t A->B, and a vector
+ * orthogonal to pcb_vector_t C->D. The result is not normalised, so will be
* weighted by the magnitude of the C->D vector.
*/
-static double dot_orthogonal_to_direction(Vector A, Vector B, Vector C, Vector D)
+static double dot_orthogonal_to_direction(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D)
{
- Vector l1, l2, l3;
+ pcb_vector_t l1, l2, l3;
l1[0] = B[0] - A[0];
l1[1] = B[1] - A[1];
l2[0] = D[0] - C[0];
@@ -2693,13 +2699,13 @@ static double dot_orthogonal_to_direction(Vector A, Vector B, Vector C, Vector D
* Joseph O'Rourke, Cambridge University Press 1998,
* ISBN 0-521-64010-5 Pbk, ISBN 0-521-64976-5 Hbk
*/
-static void poly_ComputeInteriorPoint(PLINE * poly, Vector v)
+static void poly_ComputeInteriorPoint(pcb_pline_t * poly, pcb_vector_t v)
{
- VNODE *pt1, *pt2, *pt3, *q;
- VNODE *min_q = NULL;
+ pcb_vnode_t *pt1, *pt2, *pt3, *q;
+ pcb_vnode_t *min_q = NULL;
double dist;
double min_dist = 0.0;
- double dir = (poly->Flags.orient == PLF_DIR) ? 1. : -1;
+ double dir = (poly->Flags.orient == PCB_PLF_DIR) ? 1. : -1;
/* Find a convex node on the polygon */
pt1 = &poly->head;
@@ -2753,71 +2759,71 @@ static void poly_ComputeInteriorPoint(PLINE * poly, Vector v)
* common points between their contours. (Identical contours
* are treated as being inside each other).
*/
-int poly_ContourInContour(PLINE * poly, PLINE * inner)
+int pcb_poly_contour_in_contour(pcb_pline_t * poly, pcb_pline_t * inner)
{
- Vector point;
+ pcb_vector_t point;
assert(poly != NULL);
assert(inner != NULL);
if (cntrbox_inside(inner, poly)) {
/* We need to prove the "inner" contour is not outside
* "poly" contour. If it is outside, we can return.
*/
- if (!poly_InsideContour(poly, inner->head.point))
+ if (!pcb_poly_contour_inside(poly, inner->head.point))
return 0;
poly_ComputeInteriorPoint(inner, point);
- return poly_InsideContour(poly, point);
+ return pcb_poly_contour_inside(poly, point);
}
return 0;
}
-void poly_Init(POLYAREA * p)
+void pcb_polyarea_init(pcb_polyarea_t * p)
{
p->f = p->b = p;
p->contours = NULL;
- p->contour_tree = r_create_tree(NULL, 0, 0);
+ p->contour_tree = pcb_r_create_tree(NULL, 0, 0);
}
-POLYAREA *poly_Create(void)
+pcb_polyarea_t *pcb_polyarea_create(void)
{
- POLYAREA *res;
+ pcb_polyarea_t *res;
- if ((res = (POLYAREA *) malloc(sizeof(POLYAREA))) != NULL)
- poly_Init(res);
+ if ((res = (pcb_polyarea_t *) malloc(sizeof(pcb_polyarea_t))) != NULL)
+ pcb_polyarea_init(res);
return res;
}
-void poly_FreeContours(PLINE ** pline)
+void pcb_poly_contours_free(pcb_pline_t ** pline)
{
- PLINE *pl;
+ pcb_pline_t *pl;
while ((pl = *pline) != NULL) {
*pline = pl->next;
- poly_DelContour(&pl);
+ pcb_poly_contour_del(&pl);
}
}
-void poly_Free(POLYAREA ** p)
+void pcb_polyarea_free(pcb_polyarea_t ** p)
{
- POLYAREA *cur;
+ pcb_polyarea_t *cur;
if (*p == NULL)
return;
for (cur = (*p)->f; cur != *p; cur = (*p)->f) {
- poly_FreeContours(&cur->contours);
- r_destroy_tree(&cur->contour_tree);
+ pcb_poly_contours_free(&cur->contours);
+ pcb_r_destroy_tree(&cur->contour_tree);
cur->f->b = cur->b;
cur->b->f = cur->f;
free(cur);
}
- poly_FreeContours(&cur->contours);
- r_destroy_tree(&cur->contour_tree);
+ pcb_poly_contours_free(&cur->contours);
+ pcb_r_destroy_tree(&cur->contour_tree);
free(*p), *p = NULL;
}
-static BOOLp inside_sector(VNODE * pn, Vector p2)
+static pcb_bool inside_sector(pcb_vnode_t * pn, pcb_vector_t p2)
{
- Vector cdir, ndir, pdir;
+ pcb_vector_t cdir, ndir, pdir;
int p_c, n_c, p_n;
assert(pn != NULL);
@@ -2825,21 +2831,21 @@ static BOOLp inside_sector(VNODE * pn, Vector p2)
vect_sub(pdir, pn->point, pn->prev->point);
vect_sub(ndir, pn->next->point, pn->point);
- p_c = vect_det2(pdir, cdir) >= 0;
- n_c = vect_det2(ndir, cdir) >= 0;
- p_n = vect_det2(pdir, ndir) >= 0;
+ p_c = pcb_vect_det2(pdir, cdir) >= 0;
+ n_c = pcb_vect_det2(ndir, cdir) >= 0;
+ p_n = pcb_vect_det2(pdir, ndir) >= 0;
if ((p_n && p_c && n_c) || ((!p_n) && (p_c || n_c)))
- return TRUE;
+ return pcb_true;
else
- return FALSE;
+ return pcb_false;
} /* inside_sector */
-/* returns TRUE if bad contour */
-BOOLp poly_ChkContour(PLINE * a)
+/* returns pcb_true if bad contour */
+pcb_bool pcb_polyarea_contour_check(pcb_pline_t * a)
{
- VNODE *a1, *a2, *hit1, *hit2;
- Vector i1, i2;
+ pcb_vnode_t *a1, *a2, *hit1, *hit2;
+ pcb_vector_t i1, i2;
int icnt;
assert(a != NULL);
@@ -2847,58 +2853,58 @@ BOOLp poly_ChkContour(PLINE * a)
do {
a2 = a1;
do {
- if (!node_neighbours(a1, a2) && (icnt = vect_inters2(a1->point, a1->next->point, a2->point, a2->next->point, i1, i2)) > 0) {
+ if (!node_neighbours(a1, a2) && (icnt = pcb_vect_inters2(a1->point, a1->next->point, a2->point, a2->next->point, i1, i2)) > 0) {
if (icnt > 1)
- return TRUE;
+ return pcb_true;
- if (vect_dist2(i1, a1->point) < EPSILON)
+ if (pcb_vect_dist2(i1, a1->point) < EPSILON)
hit1 = a1;
- else if (vect_dist2(i1, a1->next->point) < EPSILON)
+ else if (pcb_vect_dist2(i1, a1->next->point) < EPSILON)
hit1 = a1->next;
else
hit1 = NULL;
- if (vect_dist2(i1, a2->point) < EPSILON)
+ if (pcb_vect_dist2(i1, a2->point) < EPSILON)
hit2 = a2;
- else if (vect_dist2(i1, a2->next->point) < EPSILON)
+ else if (pcb_vect_dist2(i1, a2->next->point) < EPSILON)
hit2 = a2->next;
else
hit2 = NULL;
if ((hit1 == NULL) && (hit2 == NULL)) {
/* If the intersection didn't land on an end-point of either
- * line, we know the lines cross and we return TRUE.
+ * line, we know the lines cross and we return pcb_true.
*/
- return TRUE;
+ return pcb_true;
}
else if (hit1 == NULL) {
/* An end-point of the second line touched somewhere along the
length of the first line. Check where the second line leads. */
if (inside_sector(hit2, a1->point) != inside_sector(hit2, a1->next->point))
- return TRUE;
+ return pcb_true;
}
else if (hit2 == NULL) {
/* An end-point of the first line touched somewhere along the
length of the second line. Check where the first line leads. */
if (inside_sector(hit1, a2->point) != inside_sector(hit1, a2->next->point))
- return TRUE;
+ return pcb_true;
}
else {
/* Both lines intersect at an end-point. Check where they lead. */
if (inside_sector(hit1, hit2->prev->point) != inside_sector(hit1, hit2->next->point))
- return TRUE;
+ return pcb_true;
}
}
}
while ((a2 = a2->next) != &a->head);
}
while ((a1 = a1->next) != &a->head);
- return FALSE;
+ return pcb_false;
}
-void poly_bbox(POLYAREA * p, BoxType * b)
+void pcb_polyarea_bbox(pcb_polyarea_t * p, pcb_box_t * b)
{
- PLINE *n;
+ pcb_pline_t *n;
/*int cnt;*/
n = p->contours;
@@ -2920,20 +2926,20 @@ void poly_bbox(POLYAREA * p, BoxType * b)
}
-BOOLp poly_Valid(POLYAREA * p)
+pcb_bool pcb_poly_valid(pcb_polyarea_t * p)
{
- PLINE *c;
+ pcb_pline_t *c;
if ((p == NULL) || (p->contours == NULL))
- return FALSE;
+ return pcb_false;
- if (p->contours->Flags.orient == PLF_INV || poly_ChkContour(p->contours)) {
+ if (p->contours->Flags.orient == PCB_PLF_INV || pcb_polyarea_contour_check(p->contours)) {
#ifndef NDEBUG
- VNODE *v, *n;
- DEBUGP("Invalid Outer PLINE\n");
- if (p->contours->Flags.orient == PLF_INV)
+ pcb_vnode_t *v, *n;
+ DEBUGP("Invalid Outer pcb_pline_t\n");
+ if (p->contours->Flags.orient == PCB_PLF_INV)
DEBUGP("failed orient\n");
- if (poly_ChkContour(p->contours))
+ if (pcb_polyarea_contour_check(p->contours))
DEBUGP("failed self-intersection\n");
v = &p->contours->head;
do {
@@ -2942,18 +2948,18 @@ BOOLp poly_Valid(POLYAREA * p)
}
while ((v = v->next) != &p->contours->head);
#endif
- return FALSE;
+ return pcb_false;
}
for (c = p->contours->next; c != NULL; c = c->next) {
- if (c->Flags.orient == PLF_DIR || poly_ChkContour(c) || !poly_ContourInContour(p->contours, c)) {
+ if (c->Flags.orient == PCB_PLF_DIR || pcb_polyarea_contour_check(c) || !pcb_poly_contour_in_contour(p->contours, c)) {
#ifndef NDEBUG
- VNODE *v, *n;
- DEBUGP("Invalid Inner PLINE orient = %d\n", c->Flags.orient);
- if (c->Flags.orient == PLF_DIR)
+ pcb_vnode_t *v, *n;
+ DEBUGP("Invalid Inner pcb_pline_t orient = %d\n", c->Flags.orient);
+ if (c->Flags.orient == PCB_PLF_DIR)
DEBUGP("failed orient\n");
- if (poly_ChkContour(c))
+ if (pcb_polyarea_contour_check(c))
DEBUGP("failed self-intersection\n");
- if (!poly_ContourInContour(p->contours, c))
+ if (!pcb_poly_contour_in_contour(p->contours, c))
DEBUGP("failed containment\n");
v = &c->head;
do {
@@ -2962,20 +2968,20 @@ BOOLp poly_Valid(POLYAREA * p)
}
while ((v = v->next) != &c->head);
#endif
- return FALSE;
+ return pcb_false;
}
}
- return TRUE;
+ return pcb_true;
}
-Vector vect_zero = { (long) 0, (long) 0 };
+pcb_vector_t vect_zero = { (long) 0, (long) 0 };
/*********************************************************************/
/* L o n g V e c t o r S t u f f */
/*********************************************************************/
-void vect_init(Vector v, double x, double y)
+void vect_init(pcb_vector_t v, double x, double y)
{
v[0] = (long) x;
v[1] = (long) y;
@@ -2985,34 +2991,34 @@ void vect_init(Vector v, double x, double y)
#define Vsub(a,b,c) {(a)[0]=(b)[0]-(c)[0];(a)[1]=(b)[1]-(c)[1];}
-int vect_equal(Vector v1, Vector v2)
+int vect_equal(pcb_vector_t v1, pcb_vector_t v2)
{
return (v1[0] == v2[0] && v1[1] == v2[1]);
} /* vect_equal */
-void vect_sub(Vector res, Vector v1, Vector v2)
+void vect_sub(pcb_vector_t res, pcb_vector_t v1, pcb_vector_t v2)
{
Vsub(res, v1, v2)} /* vect_sub */
-void vect_min(Vector v1, Vector v2, Vector v3)
+void vect_min(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3)
{
v1[0] = (v2[0] < v3[0]) ? v2[0] : v3[0];
v1[1] = (v2[1] < v3[1]) ? v2[1] : v3[1];
} /* vect_min */
-void vect_max(Vector v1, Vector v2, Vector v3)
+void vect_max(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3)
{
v1[0] = (v2[0] > v3[0]) ? v2[0] : v3[0];
v1[1] = (v2[1] > v3[1]) ? v2[1] : v3[1];
} /* vect_max */
-double vect_len2(Vector v)
+double pcb_vect_len2(pcb_vector_t v)
{
return ((double) v[0] * v[0] + (double) v[1] * v[1]); /* why sqrt? only used for compares */
}
-double vect_dist2(Vector v1, Vector v2)
+double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2)
{
double dx = v1[0] - v2[0];
double dy = v1[1] - v2[1];
@@ -3021,12 +3027,12 @@ double vect_dist2(Vector v1, Vector v2)
}
/* value has sign of angle between vectors */
-double vect_det2(Vector v1, Vector v2)
+double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2)
{
return (((double) v1[0] * v2[1]) - ((double) v2[0] * v1[1]));
}
-static double vect_m_dist(Vector v1, Vector v2)
+static double vect_m_dist(pcb_vector_t v1, pcb_vector_t v2)
{
double dx = v1[0] - v2[0];
double dy = v1[1] - v2[1];
@@ -3047,7 +3053,7 @@ vect_inters2
(C) 1997 Michael Leonov, Alexey Nikitin
*/
-int vect_inters2(Vector p1, Vector p2, Vector q1, Vector q2, Vector S1, Vector S2)
+int pcb_vect_inters2(pcb_vector_t p1, pcb_vector_t p2, pcb_vector_t q1, pcb_vector_t q2, pcb_vector_t S1, pcb_vector_t S2)
{
double s, t, deel;
double rpx, rpy, rqx, rqy;
@@ -3069,14 +3075,14 @@ int vect_inters2(Vector p1, Vector p2, Vector q1, Vector q2, Vector S1, Vector S
if (deel == 0) { /* parallel */
double dc1, dc2, d1, d2, h; /* Check to see whether p1-p2 and q1-q2 are on the same line */
- Vector hp1, hq1, hp2, hq2, q1p1, q1q2;
+ pcb_vector_t hp1, hq1, hp2, hq2, q1p1, q1q2;
Vsub2(q1p1, q1, p1);
Vsub2(q1q2, q1, q2);
/* If this product is not zero then p1-p2 and q1-q2 are not on same line! */
- if (vect_det2(q1p1, q1q2) != 0)
+ if (pcb_vect_det2(q1p1, q1q2) != 0)
return 0;
dc1 = 0; /* m_len(p1 - p1) */
diff --git a/src/polygon_act.c b/src/polygon_act.c
index 0a5fa09..13fc6ec 100644
--- a/src/polygon_act.c
+++ b/src/polygon_act.c
@@ -27,6 +27,7 @@
#include "config.h"
#include "conf_core.h"
+#include "board.h"
#include "data.h"
#include "action_helper.h"
#include "undo.h"
@@ -36,12 +37,15 @@
#include "draw.h"
#include "search.h"
#include "crosshair.h"
+#include "compat_nls.h"
+
+#include "obj_poly.h"
/* --------------------------------------------------------------------------- */
-static const char morphpolygon_syntax[] = "MorphPolygon(Object|Selected)";
+static const char morphpcb_polygon_syntax[] = "pcb_poly_morph(Object|Selected)";
-static const char morphpolygon_help[] = "Converts dead polygon islands into separate polygons.";
+static const char pcb_acth_MorphPolygon[] = "Converts dead polygon islands into separate polygons.";
/* %start-doc actions MorphPolygon
@@ -53,34 +57,34 @@ off are automatically deleted.
%end-doc */
-static int ActionMorphPolygon(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_MorphPolygon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Object:
{
int type;
void *ptr1, *ptr2, *ptr3;
- gui->get_coords(_("Select an Object"), &x, &y);
- if ((type = SearchScreen(x, y, PCB_TYPE_POLYGON, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
- MorphPolygon((LayerType *) ptr1, (PolygonType *) ptr3);
- Draw();
- IncrementUndoSerialNumber();
+ pcb_gui->get_coords(_("Select an Object"), &x, &y);
+ if ((type = pcb_search_screen(x, y, PCB_TYPE_POLYGON, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
+ pcb_poly_morph((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr3);
+ pcb_draw();
+ pcb_undo_inc_serial();
}
break;
}
case F_Selected:
case F_SelectedObjects:
- ALLPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, polygon))
- MorphPolygon(layer, polygon);
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon))
+ pcb_poly_morph(layer, polygon);
}
- ENDALL_LOOP;
- Draw();
- IncrementUndoSerialNumber();
+ PCB_ENDALL_LOOP;
+ pcb_draw();
+ pcb_undo_inc_serial();
break;
}
}
@@ -89,9 +93,9 @@ static int ActionMorphPolygon(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char polygon_syntax[] = "Polygon(Close|PreviousPoint)";
+static const char pcb_polygon_syntax[] = "Polygon(Close|PreviousPoint)";
-static const char polygon_help[] = "Some polygon related stuff.";
+static const char pcb_acth_Polygon[] = "Some polygon related stuff.";
/* %start-doc actions Polygon
@@ -111,34 +115,34 @@ will call Polygon(PreviousPoint) when appropriate to do so.
%end-doc */
-static int ActionPolygon(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Polygon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function && conf_core.editor.mode == PCB_MODE_POLYGON) {
- notify_crosshair_change(pcb_false);
- switch (funchash_get(function, NULL)) {
+ pcb_notify_crosshair_change(pcb_false);
+ switch (pcb_funchash_get(function, NULL)) {
/* close open polygon if possible */
case F_Close:
- ClosePolygon();
+ pcb_polygon_close_poly();
break;
/* go back to the previous point */
case F_PreviousPoint:
- GoToPreviousPoint();
+ pcb_polygon_go_to_prev_point();
break;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
}
return 0;
}
-HID_Action polygon_action_list[] = {
- {"MorphPolygon", 0, ActionMorphPolygon,
- morphpolygon_help, morphpolygon_syntax}
+pcb_hid_action_t polygon_action_list[] = {
+ {"MorphPolygon", 0, pcb_act_MorphPolygon,
+ pcb_acth_MorphPolygon, morphpcb_polygon_syntax}
,
- {"Polygon", 0, ActionPolygon,
- polygon_help, polygon_syntax}
+ {"Polygon", 0, pcb_act_Polygon,
+ pcb_acth_Polygon, pcb_polygon_syntax}
};
-REGISTER_ACTIONS(polygon_action_list, NULL)
+PCB_REGISTER_ACTIONS(polygon_action_list, NULL)
diff --git a/src/rats.c b/src/rats.c
index efad7a1..5c162c5 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -28,17 +28,14 @@
#include "config.h"
#include "conf_core.h"
-#include <math.h>
#include <stdio.h>
#include <assert.h>
-#include "create.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "find.h"
-#include "misc.h"
-#include "layer.h"
#include "polygon.h"
#include "rats.h"
#include "search.h"
@@ -47,6 +44,11 @@
#include "route_style.h"
#include "compat_misc.h"
#include "netlist.h"
+#include "compat_nls.h"
+#include "vtptr.h"
+#include "obj_rat_draw.h"
+
+#define STEP_POINT 100
#define TRIEDFIRST 0x1
#define BESTFOUND 0x2
@@ -54,19 +56,19 @@
/* ---------------------------------------------------------------------------
* some forward declarations
*/
-static pcb_bool FindPad(const char *, const char *, ConnectionType *, pcb_bool);
+static pcb_bool FindPad(const char *, const char *, pcb_connection_t *, pcb_bool);
static pcb_bool ParseConnection(const char *, char *, char *);
-static pcb_bool DrawShortestRats(NetListTypePtr,
- void (*)(register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr));
-static pcb_bool GatherSubnets(NetListTypePtr, pcb_bool, pcb_bool);
-static pcb_bool CheckShorts(LibraryMenuTypePtr);
-static void TransferNet(NetListTypePtr, NetTypePtr, NetTypePtr);
+static pcb_bool DrawShortestRats(pcb_netlist_t *,
+ void (*)(register pcb_connection_t *, register pcb_connection_t *, register pcb_route_style_t *));
+static pcb_bool GatherSubnets(pcb_netlist_t *, pcb_bool, pcb_bool);
+static pcb_bool CheckShorts(pcb_lib_menu_t *);
+static void TransferNet(pcb_netlist_t *, pcb_net_t *, pcb_net_t *);
/* ---------------------------------------------------------------------------
* some local identifiers
*/
static pcb_bool badnet = pcb_false;
-static pcb_cardinal_t SLayer, CLayer; /* layer group holding solder/component side */
+static pcb_layergrp_id_t SLayer, CLayer; /* layer group holding solder/component side */
/* ---------------------------------------------------------------------------
* parse a connection description from a string
@@ -92,7 +94,7 @@ static pcb_bool ParseConnection(const char *InString, char *ElementName, char *P
}
else {
ElementName[j] = '\0';
- Message(PCB_MSG_DEFAULT, _("Bad net-list format encountered near: \"%s\"\n"), ElementName);
+ pcb_message(PCB_MSG_ERROR, _("Bad net-list format encountered near: \"%s\"\n"), ElementName);
return (pcb_true);
}
}
@@ -100,24 +102,24 @@ static pcb_bool ParseConnection(const char *InString, char *ElementName, char *P
/* ---------------------------------------------------------------------------
* Find a particular pad from an element name and pin number
*/
-static pcb_bool FindPad(const char *ElementName, const char *PinNum, ConnectionType * conn, pcb_bool Same)
+static pcb_bool FindPad(const char *ElementName, const char *PinNum, pcb_connection_t * conn, pcb_bool Same)
{
- ElementTypePtr element;
+ pcb_element_t *element;
gdl_iterator_t it;
- PadType *pad;
- PinType *pin;
+ pcb_pad_t *pad;
+ pcb_pin_t *pin;
- if ((element = SearchElementByName(PCB->Data, ElementName)) == NULL)
+ if ((element = pcb_search_elem_by_name(PCB->Data, ElementName)) == NULL)
return pcb_false;
padlist_foreach(&element->Pad, &it, pad) {
- if (NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !TEST_FLAG(PCB_FLAG_DRC, pad))) {
+ if (PCB_NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !PCB_FLAG_TEST(PCB_FLAG_DRC, pad))) {
conn->type = PCB_TYPE_PAD;
conn->ptr1 = element;
conn->ptr2 = pad;
- conn->group = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer;
+ conn->group = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer;
- if (TEST_FLAG(PCB_FLAG_EDGE2, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_EDGE2, pad)) {
conn->X = pad->Point2.X;
conn->Y = pad->Point2.Y;
}
@@ -130,7 +132,7 @@ static pcb_bool FindPad(const char *ElementName, const char *PinNum, ConnectionT
}
padlist_foreach(&element->Pin, &it, pin) {
- if (!TEST_FLAG(PCB_FLAG_HOLE, pin) && pin->Number && NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !TEST_FLAG(PCB_FLAG_DRC, pin))) {
+ if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) && pin->Number && PCB_NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !PCB_FLAG_TEST(PCB_FLAG_DRC, pin))) {
conn->type = PCB_TYPE_PIN;
conn->ptr1 = element;
conn->ptr2 = pin;
@@ -148,7 +150,7 @@ static pcb_bool FindPad(const char *ElementName, const char *PinNum, ConnectionT
* parse a netlist menu entry and locate the corresponding pad
* returns pcb_true if found, and fills in Connection information
*/
-pcb_bool SeekPad(LibraryEntryType * entry, ConnectionType * conn, pcb_bool Same)
+pcb_bool pcb_rat_seek_pad(pcb_lib_entry_t * entry, pcb_connection_t * conn, pcb_bool Same)
{
int j;
char ElementName[256];
@@ -158,7 +160,7 @@ pcb_bool SeekPad(LibraryEntryType * entry, ConnectionType * conn, pcb_bool Same)
return (pcb_false);
for (j = 0; PinNum[j] != '\0'; j++);
if (j == 0) {
- Message(PCB_MSG_DEFAULT, _("Error! Netlist file is missing pin!\n" "white space after \"%s-\"\n"), ElementName);
+ pcb_message(PCB_MSG_ERROR, _("Error! Netlist file is missing pin!\n" "white space after \"%s-\"\n"), ElementName);
badnet = pcb_true;
}
else {
@@ -167,11 +169,11 @@ pcb_bool SeekPad(LibraryEntryType * entry, ConnectionType * conn, pcb_bool Same)
if (Same)
return (pcb_false);
if (PinNum[j - 1] < '0' || PinNum[j - 1] > '9') {
- Message(PCB_MSG_DEFAULT, "WARNING! Pin number ending with '%c'"
+ pcb_message(PCB_MSG_WARNING, "WARNING! Pin number ending with '%c'"
" encountered in netlist file\n" "Probably a bad netlist file format\n", PinNum[j - 1]);
}
}
- Message(PCB_MSG_DEFAULT, _("Can't find %s pin %s called for in netlist.\n"), ElementName, PinNum);
+ pcb_message(PCB_MSG_WARNING, _("Can't find %s pin %s called for in netlist.\n"), ElementName, PinNum);
return (pcb_false);
}
@@ -179,44 +181,44 @@ pcb_bool SeekPad(LibraryEntryType * entry, ConnectionType * conn, pcb_bool Same)
* Read the library-netlist build a pcb_true Netlist structure
*/
-NetListTypePtr ProcNetlist(LibraryTypePtr net_menu)
+pcb_netlist_t *pcb_rat_proc_netlist(pcb_lib_t *net_menu)
{
- ConnectionTypePtr connection;
- ConnectionType LastPoint;
- NetTypePtr net;
- static NetListTypePtr Wantlist = NULL;
+ pcb_connection_t *connection;
+ pcb_connection_t LastPoint;
+ pcb_net_t *net;
+ static pcb_netlist_t *Wantlist = NULL;
if (!net_menu->MenuN)
return (NULL);
- FreeNetListMemory(Wantlist);
+ pcb_netlist_free(Wantlist);
free(Wantlist);
badnet = pcb_false;
/* find layer groups of the component side and solder side */
- SLayer = GetLayerGroupNumberByNumber(solder_silk_layer);
- CLayer = GetLayerGroupNumberByNumber(component_silk_layer);
+ SLayer = pcb_layer_get_group(pcb_solder_silk_layer);
+ CLayer = pcb_layer_get_group(pcb_component_silk_layer);
- Wantlist = (NetListTypePtr) calloc(1, sizeof(NetListType));
+ Wantlist = (pcb_netlist_t *) calloc(1, sizeof(pcb_netlist_t));
if (Wantlist) {
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
pin->Spare = NULL;
- CLEAR_FLAG(PCB_FLAG_DRC, pin);
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, pin);
}
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
pad->Spare = NULL;
- CLEAR_FLAG(PCB_FLAG_DRC, pad);
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, pad);
}
- ENDALL_LOOP;
- MENU_LOOP(net_menu);
+ PCB_ENDALL_LOOP;
+ PCB_MENU_LOOP(net_menu);
{
if (menu->Name[0] == '*' || menu->flag == 0) {
badnet = pcb_true;
continue;
}
- net = GetNetMemory(Wantlist);
+ net = pcb_net_new(Wantlist);
if (menu->Style) {
int idx = pcb_route_style_lookup(&PCB->RouteStyle, 0, 0, 0, 0, menu->Style);
if (idx >= 0)
@@ -224,59 +226,59 @@ NetListTypePtr ProcNetlist(LibraryTypePtr net_menu)
}
else /* default to NULL if none found */
net->Style = NULL;
- ENTRY_LOOP(menu);
+ PCB_ENTRY_LOOP(menu);
{
- if (SeekPad(entry, &LastPoint, pcb_false)) {
- if (TEST_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2))
- Message(PCB_MSG_DEFAULT, _
+ if (pcb_rat_seek_pad(entry, &LastPoint, pcb_false)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, (pcb_pin_t *) LastPoint.ptr2))
+ pcb_message(PCB_MSG_ERROR, _
("Error! Element %s pin %s appears multiple times in the netlist file.\n"),
- NAMEONPCB_NAME((ElementTypePtr) LastPoint.ptr1),
+ PCB_ELEM_NAME_REFDES((pcb_element_t *) LastPoint.ptr1),
(LastPoint.type ==
- PCB_TYPE_PIN) ? ((PinTypePtr) LastPoint.ptr2)->Number : ((PadTypePtr) LastPoint.ptr2)->Number);
+ PCB_TYPE_PIN) ? ((pcb_pin_t *) LastPoint.ptr2)->Number : ((pcb_pad_t *) LastPoint.ptr2)->Number);
else {
- connection = GetConnectionMemory(net);
+ connection = pcb_rat_connection_alloc(net);
*connection = LastPoint;
/* indicate expect net */
connection->menu = menu;
/* mark as visited */
- SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2);
+ PCB_FLAG_SET(PCB_FLAG_DRC, (pcb_pin_t *) LastPoint.ptr2);
if (LastPoint.type == PCB_TYPE_PIN)
- ((PinTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
+ ((pcb_pin_t *) LastPoint.ptr2)->Spare = (void *) menu;
else
- ((PadTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
+ ((pcb_pad_t *) LastPoint.ptr2)->Spare = (void *) menu;
}
}
else
badnet = pcb_true;
/* check for more pins with the same number */
- for (; SeekPad(entry, &LastPoint, pcb_true);) {
- connection = GetConnectionMemory(net);
+ for (; pcb_rat_seek_pad(entry, &LastPoint, pcb_true);) {
+ connection = pcb_rat_connection_alloc(net);
*connection = LastPoint;
/* indicate expect net */
connection->menu = menu;
/* mark as visited */
- SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2);
+ PCB_FLAG_SET(PCB_FLAG_DRC, (pcb_pin_t *) LastPoint.ptr2);
if (LastPoint.type == PCB_TYPE_PIN)
- ((PinTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
+ ((pcb_pin_t *) LastPoint.ptr2)->Spare = (void *) menu;
else
- ((PadTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
+ ((pcb_pad_t *) LastPoint.ptr2)->Spare = (void *) menu;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* clear all visit marks */
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- CLEAR_FLAG(PCB_FLAG_DRC, pin);
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, pin);
}
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- CLEAR_FLAG(PCB_FLAG_DRC, pad);
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, pad);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
return (Wantlist);
}
@@ -284,100 +286,100 @@ NetListTypePtr ProcNetlist(LibraryTypePtr net_menu)
* copy all connections from one net into another
* and then remove the first net from its netlist
*/
-static void TransferNet(NetListTypePtr Netl, NetTypePtr SourceNet, NetTypePtr DestNet)
+static void TransferNet(pcb_netlist_t *Netl, pcb_net_t *SourceNet, pcb_net_t *DestNet)
{
- ConnectionTypePtr conn;
+ pcb_connection_t *conn;
/* It would be worth checking if SourceNet is NULL here to avoid a segfault. Seb James. */
- CONNECTION_LOOP(SourceNet);
+ PCB_CONNECTION_LOOP(SourceNet);
{
- conn = GetConnectionMemory(DestNet);
+ conn = pcb_rat_connection_alloc(DestNet);
*conn = *connection;
}
- END_LOOP;
+ PCB_END_LOOP;
DestNet->Style = SourceNet->Style;
/* free the connection memory */
- FreeNetMemory(SourceNet);
+ pcb_net_free(SourceNet);
/* remove SourceNet from its netlist */
*SourceNet = Netl->Net[--(Netl->NetN)];
/* zero out old garbage */
- memset(&Netl->Net[Netl->NetN], 0, sizeof(NetType));
+ memset(&Netl->Net[Netl->NetN], 0, sizeof(pcb_net_t));
}
-static pcb_bool CheckShorts(LibraryMenuTypePtr theNet)
+static pcb_bool CheckShorts(pcb_lib_menu_t *theNet)
{
pcb_bool newone, warn = pcb_false;
- PointerListTypePtr generic = (PointerListTypePtr) calloc(1, sizeof(PointerListType));
+ int i;
+ vtptr_t generic;
/* the first connection was starting point so
* the menu is always non-null
*/
- void **menu = GetPointerMemory(generic);
+ void **menu;
+ vtptr_init(&generic);
+ menu = vtptr_alloc_append(&generic, 1);
*menu = theNet;
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- ElementType *e = pin->Element;
-/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pin->Element)*/
- if ((TEST_FLAG(PCB_FLAG_DRC, pin)) && (!(e->Flags.f & PCB_FLAG_NONETLIST))) {
+ pcb_element_t *e = pin->Element;
+/* TODO: should be: !PCB_FLAG_TEST(PCB_FLAG_NONETLIST, (pcb_element_t *)pin->Element)*/
+ if ((PCB_FLAG_TEST(PCB_FLAG_DRC, pin)) && (!(e->Flags.f & PCB_FLAG_NONETLIST))) {
warn = pcb_true;
if (!pin->Spare) {
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to %s pin %s\n"),
- &theNet->Name[2], UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(pin->Number));
- stub_rat_found_short(pin, NULL, &theNet->Name[2]);
+ pcb_message(PCB_MSG_WARNING, _("Warning! Net \"%s\" is shorted to %s pin %s\n"),
+ &theNet->Name[2], PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), PCB_UNKNOWN(pin->Number));
+ pcb_stub_rat_found_short(pin, NULL, &theNet->Name[2]);
continue;
}
newone = pcb_true;
- POINTER_LOOP(generic);
- {
- if (*ptr == pin->Spare) {
+ for(i = 0; i < vtptr_len(&generic); i++) {
+ if (generic.array[i] == pin->Spare) {
newone = pcb_false;
break;
}
}
- END_LOOP;
+
if (newone) {
- menu = GetPointerMemory(generic);
+ menu = vtptr_alloc_append(&generic, 1);
*menu = pin->Spare;
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"),
- &theNet->Name[2], &((LibraryMenuTypePtr) (pin->Spare))->Name[2]);
- stub_rat_found_short(pin, NULL, &theNet->Name[2]);
+ pcb_message(PCB_MSG_WARNING, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"),
+ &theNet->Name[2], &((pcb_lib_menu_t *) (pin->Spare))->Name[2]);
+ pcb_stub_rat_found_short(pin, NULL, &theNet->Name[2]);
}
}
}
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- ElementType *e = pad->Element;
-/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pad->Element)*/
- if ((TEST_FLAG(PCB_FLAG_DRC, pad)) && (!(e->Flags.f & PCB_FLAG_NONETLIST)) && (!(e->Name->Flags.f & PCB_FLAG_NONETLIST))) {
+ pcb_element_t *e = pad->Element;
+/* TODO: should be: !PCB_FLAG_TEST(PCB_FLAG_NONETLIST, (pcb_element_t *)pad->Element)*/
+ if ((PCB_FLAG_TEST(PCB_FLAG_DRC, pad)) && (!(e->Flags.f & PCB_FLAG_NONETLIST)) && (!(e->Name->Flags.f & PCB_FLAG_NONETLIST))) {
warn = pcb_true;
if (!pad->Spare) {
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to %s pad %s\n"),
- &theNet->Name[2], UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(pad->Number));
- stub_rat_found_short(NULL, pad, &theNet->Name[2]);
+ pcb_message(PCB_MSG_WARNING, _("Warning! Net \"%s\" is shorted to %s pad %s\n"),
+ &theNet->Name[2], PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), PCB_UNKNOWN(pad->Number));
+ pcb_stub_rat_found_short(NULL, pad, &theNet->Name[2]);
continue;
}
newone = pcb_true;
- POINTER_LOOP(generic);
- {
- if (*ptr == pad->Spare) {
+ for(i = 0; i < vtptr_len(&generic); i++) {
+ if (generic.array[i] == pad->Spare) {
newone = pcb_false;
break;
}
}
- END_LOOP;
+
if (newone) {
- menu = GetPointerMemory(generic);
+ menu = vtptr_alloc_append(&generic, 1);
*menu = pad->Spare;
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"),
- &theNet->Name[2], &((LibraryMenuTypePtr) (pad->Spare))->Name[2]);
- stub_rat_found_short(NULL, pad, &theNet->Name[2]);
+ pcb_message(PCB_MSG_WARNING, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"),
+ &theNet->Name[2], &((pcb_lib_menu_t *) (pad->Spare))->Name[2]);
+ pcb_stub_rat_found_short(NULL, pad, &theNet->Name[2]);
}
}
}
- ENDALL_LOOP;
- FreePointerListMemory(generic);
- free(generic);
+ PCB_ENDALL_LOOP;
+ vtptr_uninit(&generic);
return (warn);
}
@@ -388,25 +390,25 @@ static pcb_bool CheckShorts(LibraryMenuTypePtr theNet)
* initially the netlist has each connection in its own individual net
* afterwards there can be many fewer nets with multiple connections each
*/
-static pcb_bool GatherSubnets(NetListTypePtr Netl, pcb_bool NoWarn, pcb_bool AndRats)
+static pcb_bool GatherSubnets(pcb_netlist_t *Netl, pcb_bool NoWarn, pcb_bool AndRats)
{
- NetTypePtr a, b;
- ConnectionTypePtr conn;
+ pcb_net_t *a, *b;
+ pcb_connection_t *conn;
pcb_cardinal_t m, n;
pcb_bool Warned = pcb_false;
for (m = 0; Netl->NetN > 0 && m < Netl->NetN; m++) {
a = &Netl->Net[m];
- ResetConnections(pcb_false);
- RatFindHook(a->Connection[0].type, a->Connection[0].ptr1, a->Connection[0].ptr2, a->Connection[0].ptr2, pcb_false, AndRats);
+ pcb_reset_conns(pcb_false);
+ pcb_rat_find_hook(a->Connection[0].type, a->Connection[0].ptr1, a->Connection[0].ptr2, a->Connection[0].ptr2, pcb_false, AndRats);
/* now anybody connected to the first point has PCB_FLAG_DRC set */
/* so move those to this subnet */
- CLEAR_FLAG(PCB_FLAG_DRC, (PinTypePtr) a->Connection[0].ptr2);
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, (pcb_pin_t *) a->Connection[0].ptr2);
for (n = m + 1; n < Netl->NetN; n++) {
b = &Netl->Net[n];
/* There can be only one connection in net b */
- if (TEST_FLAG(PCB_FLAG_DRC, (PinTypePtr) b->Connection[0].ptr2)) {
- CLEAR_FLAG(PCB_FLAG_DRC, (PinTypePtr) b->Connection[0].ptr2);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, (pcb_pin_t *) b->Connection[0].ptr2)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, (pcb_pin_t *) b->Connection[0].ptr2);
TransferNet(Netl, b, a);
/* back up since new subnet is now at old index */
n--;
@@ -415,50 +417,50 @@ static pcb_bool GatherSubnets(NetListTypePtr Netl, pcb_bool NoWarn, pcb_bool And
/* now add other possible attachment points to the subnet */
/* e.g. line end-points and vias */
/* don't add non-manhattan lines, the auto-router can't route to them */
- ALLLINE_LOOP(PCB->Data);
+ PCB_LINE_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_DRC, line)
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, line)
&& ((line->Point1.X == line->Point2.X)
|| (line->Point1.Y == line->Point2.Y))) {
- conn = GetConnectionMemory(a);
+ conn = pcb_rat_connection_alloc(a);
conn->X = line->Point1.X;
conn->Y = line->Point1.Y;
conn->type = PCB_TYPE_LINE;
conn->ptr1 = layer;
conn->ptr2 = line;
- conn->group = GetLayerGroupNumberByPointer(layer);
+ conn->group = pcb_layer_get_group_(layer);
conn->menu = NULL; /* agnostic view of where it belongs */
- conn = GetConnectionMemory(a);
+ conn = pcb_rat_connection_alloc(a);
conn->X = line->Point2.X;
conn->Y = line->Point2.Y;
conn->type = PCB_TYPE_LINE;
conn->ptr1 = layer;
conn->ptr2 = line;
- conn->group = GetLayerGroupNumberByPointer(layer);
+ conn->group = pcb_layer_get_group_(layer);
conn->menu = NULL;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* add polygons so the auto-router can see them as targets */
- ALLPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_DRC, polygon)) {
- conn = GetConnectionMemory(a);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, polygon)) {
+ conn = pcb_rat_connection_alloc(a);
/* make point on a vertex */
conn->X = polygon->Clipped->contours->head.point[0];
conn->Y = polygon->Clipped->contours->head.point[1];
conn->type = PCB_TYPE_POLYGON;
conn->ptr1 = layer;
conn->ptr2 = polygon;
- conn->group = GetLayerGroupNumberByPointer(layer);
+ conn->group = pcb_layer_get_group_(layer);
conn->menu = NULL; /* agnostic view of where it belongs */
}
}
- ENDALL_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_DRC, via)) {
- conn = GetConnectionMemory(a);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, via)) {
+ conn = pcb_rat_connection_alloc(a);
conn->X = via->X;
conn->Y = via->Y;
conn->type = PCB_TYPE_VIA;
@@ -467,11 +469,11 @@ static pcb_bool GatherSubnets(NetListTypePtr Netl, pcb_bool NoWarn, pcb_bool And
conn->group = SLayer;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (!NoWarn)
Warned |= CheckShorts(a->Connection[0].menu);
}
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
return (Warned);
}
@@ -486,17 +488,17 @@ static pcb_bool GatherSubnets(NetListTypePtr Netl, pcb_bool NoWarn, pcb_bool And
*/
static pcb_bool
-DrawShortestRats(NetListTypePtr Netl,
- void (*funcp) (register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr))
+DrawShortestRats(pcb_netlist_t *Netl,
+ void (*funcp) (register pcb_connection_t *, register pcb_connection_t *, register pcb_route_style_t *))
{
- RatTypePtr line;
+ pcb_rat_t *line;
register float distance, temp;
- register ConnectionTypePtr conn1, conn2, firstpoint, secondpoint;
- PolygonTypePtr polygon;
+ register pcb_connection_t *conn1, *conn2, *firstpoint, *secondpoint;
+ pcb_polygon_t *polygon;
pcb_bool changed = pcb_false;
pcb_bool havepoints;
pcb_cardinal_t n, m, j;
- NetTypePtr next, subnet, theSubnet = NULL;
+ pcb_net_t *next, *subnet, *theSubnet = NULL;
/* This is just a sanity check, to make sure we're passed
* *something*.
@@ -564,9 +566,9 @@ DrawShortestRats(NetListTypePtr Netl,
* via in the Net to make that connection.
*/
if (conn1->type == PCB_TYPE_POLYGON &&
- (polygon = (PolygonTypePtr) conn1->ptr2) &&
+ (polygon = (pcb_polygon_t *) conn1->ptr2) &&
!(distance == 0 &&
- firstpoint && firstpoint->type == PCB_TYPE_VIA) && IsPointInPolygonIgnoreHoles(conn2->X, conn2->Y, polygon)) {
+ firstpoint && firstpoint->type == PCB_TYPE_VIA) && pcb_poly_is_point_in_p_ignore_holes(conn2->X, conn2->Y, polygon)) {
distance = 0;
firstpoint = conn2;
secondpoint = conn1;
@@ -574,16 +576,16 @@ DrawShortestRats(NetListTypePtr Netl,
havepoints = pcb_true;
}
else if (conn2->type == PCB_TYPE_POLYGON &&
- (polygon = (PolygonTypePtr) conn2->ptr2) &&
+ (polygon = (pcb_polygon_t *) conn2->ptr2) &&
!(distance == 0 &&
- firstpoint && firstpoint->type == PCB_TYPE_VIA) && IsPointInPolygonIgnoreHoles(conn1->X, conn1->Y, polygon)) {
+ firstpoint && firstpoint->type == PCB_TYPE_VIA) && pcb_poly_is_point_in_p_ignore_holes(conn1->X, conn1->Y, polygon)) {
distance = 0;
firstpoint = conn1;
secondpoint = conn2;
theSubnet = next;
havepoints = pcb_true;
}
- else if ((temp = SQUARE(conn1->X - conn2->X) + SQUARE(conn1->Y - conn2->Y)) < distance || !firstpoint) {
+ else if ((temp = PCB_SQUARE(conn1->X - conn2->X) + PCB_SQUARE(conn1->Y - conn2->Y)) < distance || !firstpoint) {
distance = temp;
firstpoint = conn1;
secondpoint = conn2;
@@ -604,13 +606,13 @@ DrawShortestRats(NetListTypePtr Netl,
}
else {
/* found the shortest distance subnet, draw the rat */
- if ((line = CreateNewRat(PCB->Data,
+ if ((line = pcb_rat_new(PCB->Data,
firstpoint->X, firstpoint->Y,
secondpoint->X, secondpoint->Y,
- firstpoint->group, secondpoint->group, conf_core.appearance.rat_thickness, NoFlags())) != NULL) {
+ firstpoint->group, secondpoint->group, conf_core.appearance.rat_thickness, pcb_no_flags())) != NULL) {
if (distance == 0)
- SET_FLAG(PCB_FLAG_VIA, line);
- AddObjectToCreateUndoList(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_SET(PCB_FLAG_VIA, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_RATLINE, line, line, line);
DrawRat(line);
changed = pcb_true;
}
@@ -623,12 +625,12 @@ DrawShortestRats(NetListTypePtr Netl,
/* presently nothing to do with the new subnet */
/* so we throw it away and free the space */
- FreeNetMemory(&Netl->Net[--(Netl->NetN)]);
+ pcb_net_free(&Netl->Net[--(Netl->NetN)]);
/* Sadly adding a rat line messes up the sorted arrays in connection finder */
/* hace: perhaps not necessarily now that they aren't stored in normal layers */
if (changed) {
- FreeConnectionLookupMemory();
- InitConnectionLookup();
+ pcb_conn_lookup_uninit();
+ pcb_conn_lookup_init();
}
return (changed);
}
@@ -639,12 +641,12 @@ DrawShortestRats(NetListTypePtr Netl,
* if SelectedOnly is pcb_true, it will only draw rats to selected pins and pads
*/
pcb_bool
-AddAllRats(pcb_bool SelectedOnly,
- void (*funcp) (register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr))
+pcb_rat_add_all(pcb_bool SelectedOnly,
+ void (*funcp) (register pcb_connection_t *, register pcb_connection_t *, register pcb_route_style_t *))
{
- NetListTypePtr Nets, Wantlist;
- NetTypePtr lonesome;
- ConnectionTypePtr onepin;
+ pcb_netlist_t *Nets, *Wantlist;
+ pcb_net_t *lonesome;
+ pcb_connection_t *onepin;
pcb_bool changed, Warned = pcb_false;
/* the netlist library has the text form
@@ -652,16 +654,16 @@ AddAllRats(pcb_bool SelectedOnly,
* structure the way the final routing
* is supposed to look
*/
- Wantlist = ProcNetlist(&(PCB->NetlistLib[NETLIST_EDITED]));
+ Wantlist = pcb_rat_proc_netlist(&(PCB->NetlistLib[PCB_NETLIST_EDITED]));
if (!Wantlist) {
- Message(PCB_MSG_DEFAULT, _("Can't add rat lines because no netlist is loaded.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Can't add rat lines because no netlist is loaded.\n"));
return (pcb_false);
}
changed = pcb_false;
/* initialize finding engine */
- InitConnectionLookup();
- SaveFindFlag(PCB_FLAG_DRC);
- Nets = (NetListTypePtr) calloc(1, sizeof(NetListType));
+ pcb_conn_lookup_init();
+ pcb_save_find_flag(PCB_FLAG_DRC);
+ Nets = (pcb_netlist_t *) calloc(1, sizeof(pcb_netlist_t));
/* now we build another netlist (Nets) for each
* net in Wantlist that shows how it actually looks now,
* then fill in any missing connections with rat lines.
@@ -674,50 +676,50 @@ AddAllRats(pcb_bool SelectedOnly,
* from Nets, so *Nets is empty after the
* DrawShortestRats call
*/
- NET_LOOP(Wantlist);
+ PCB_NET_LOOP(Wantlist);
{
- CONNECTION_LOOP(net);
+ PCB_CONNECTION_LOOP(net);
{
- if (!SelectedOnly || TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) connection->ptr2)) {
- lonesome = GetNetMemory(Nets);
- onepin = GetConnectionMemory(lonesome);
+ if (!SelectedOnly || PCB_FLAG_TEST(PCB_FLAG_SELECTED, (pcb_pin_t *) connection->ptr2)) {
+ lonesome = pcb_net_new(Nets);
+ onepin = pcb_rat_connection_alloc(lonesome);
*onepin = *connection;
lonesome->Style = net->Style;
}
}
- END_LOOP;
+ PCB_END_LOOP;
Warned |= GatherSubnets(Nets, SelectedOnly, pcb_true);
if (Nets->NetN > 0)
changed |= DrawShortestRats(Nets, funcp);
}
- END_LOOP;
- FreeNetListMemory(Nets);
+ PCB_END_LOOP;
+ pcb_netlist_free(Nets);
free(Nets);
- FreeConnectionLookupMemory();
- RestoreFindFlag();
+ pcb_conn_lookup_uninit();
+ pcb_restore_find_flag();
if (funcp)
return (pcb_true);
if (Warned || changed) {
- stub_rat_proc_shorts();
- Draw();
+ pcb_stub_rat_proc_shorts();
+ pcb_draw();
}
if (Warned)
conf_core.temp.rat_warn = pcb_true;
if (changed) {
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
if (ratlist_length(&PCB->Data->Rat) > 0) {
- Message(PCB_MSG_DEFAULT, "%d rat line%s remaining\n", ratlist_length(&PCB->Data->Rat), ratlist_length(&PCB->Data->Rat) > 1 ? "s" : "");
+ pcb_message(PCB_MSG_WARNING, "%d rat line%s remaining\n", ratlist_length(&PCB->Data->Rat), ratlist_length(&PCB->Data->Rat) > 1 ? "s" : "");
}
return (pcb_true);
}
if (!SelectedOnly && !Warned) {
if (!ratlist_length(&PCB->Data->Rat) && !badnet)
- Message(PCB_MSG_DEFAULT, _("Congratulations!!\n" "The layout is complete and has no shorted nets.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Congratulations!!\n" "The layout is complete and has no shorted nets.\n"));
else
- Message(PCB_MSG_DEFAULT, _("Nothing more to add, but there are\n"
+ pcb_message(PCB_MSG_WARNING, _("Nothing more to add, but there are\n"
"either rat-lines in the layout, disabled nets\n" "in the net-list, or missing components\n"));
}
return (pcb_false);
@@ -726,26 +728,26 @@ AddAllRats(pcb_bool SelectedOnly,
/* XXX: This is copied in large part from AddAllRats above; for
* maintainability, AddAllRats probably wants to be tweaked to use this
* version of the code so that we don't have duplication. */
-NetListListType CollectSubnets(pcb_bool SelectedOnly)
+pcb_netlist_list_t pcb_rat_collect_subnets(pcb_bool SelectedOnly)
{
- NetListListType result = { 0, 0, NULL };
- NetListTypePtr Nets, Wantlist;
- NetTypePtr lonesome;
- ConnectionTypePtr onepin;
+ pcb_netlist_list_t result = { 0, 0, NULL };
+ pcb_netlist_t *Nets, *Wantlist;
+ pcb_net_t *lonesome;
+ pcb_connection_t *onepin;
/* the netlist library has the text form
* ProcNetlist fills in the Netlist
* structure the way the final routing
* is supposed to look
*/
- Wantlist = ProcNetlist(&(PCB->NetlistLib[NETLIST_EDITED]));
+ Wantlist = pcb_rat_proc_netlist(&(PCB->NetlistLib[PCB_NETLIST_EDITED]));
if (!Wantlist) {
- Message(PCB_MSG_DEFAULT, _("Can't add rat lines because no netlist is loaded.\n"));
+ pcb_message(PCB_MSG_WARNING, _("Can't add rat lines because no netlist is loaded.\n"));
return result;
}
/* initialize finding engine */
- InitConnectionLookup();
- SaveFindFlag(PCB_FLAG_DRC);
+ pcb_conn_lookup_init();
+ pcb_save_find_flag(PCB_FLAG_DRC);
/* now we build another netlist (Nets) for each
* net in Wantlist that shows how it actually looks now,
* then fill in any missing connections with rat lines.
@@ -758,25 +760,25 @@ NetListListType CollectSubnets(pcb_bool SelectedOnly)
* from Nets, so *Nets is empty after the
* DrawShortestRats call
*/
- NET_LOOP(Wantlist);
+ PCB_NET_LOOP(Wantlist);
{
- Nets = GetNetListMemory(&result);
- CONNECTION_LOOP(net);
+ Nets = pcb_netlist_new(&result);
+ PCB_CONNECTION_LOOP(net);
{
- if (!SelectedOnly || TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) connection->ptr2)) {
- lonesome = GetNetMemory(Nets);
- onepin = GetConnectionMemory(lonesome);
+ if (!SelectedOnly || PCB_FLAG_TEST(PCB_FLAG_SELECTED, (pcb_pin_t *) connection->ptr2)) {
+ lonesome = pcb_net_new(Nets);
+ onepin = pcb_rat_connection_alloc(lonesome);
*onepin = *connection;
lonesome->Style = net->Style;
}
}
- END_LOOP;
- /* Note that AndRats is *FALSE* here! */
+ PCB_END_LOOP;
+ /* Note that AndRats is *pcb_false* here! */
GatherSubnets(Nets, SelectedOnly, pcb_false);
}
- END_LOOP;
- FreeConnectionLookupMemory();
- RestoreFindFlag();
+ PCB_END_LOOP;
+ pcb_conn_lookup_uninit();
+ pcb_restore_find_flag();
return result;
}
@@ -789,12 +791,12 @@ static int rat_used(char *name)
if (name == NULL)
return -1;
- MENU_LOOP(&(PCB->NetlistLib[NETLIST_EDITED]));
+ PCB_MENU_LOOP(&(PCB->NetlistLib[PCB_NETLIST_EDITED]));
{
if (menu->Name && (strcmp(menu->Name, name) == 0))
return 1;
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
@@ -802,7 +804,7 @@ static int rat_used(char *name)
/* These next two functions moved from the original netlist.c as part of the
| gui code separation for the Gtk port.
*/
-RatTypePtr AddNet(void)
+pcb_rat_t *pcb_rat_add_net(void)
{
static int ratDrawn = 0;
char name1[256], *name2;
@@ -810,49 +812,49 @@ RatTypePtr AddNet(void)
char ratname[20];
int found;
void *ptr1, *ptr2, *ptr3;
- LibraryMenuTypePtr menu;
- LibraryEntryTypePtr entry;
+ pcb_lib_menu_t *menu;
+ pcb_lib_entry_t *entry;
- if (Crosshair.AttachedLine.Point1.X == Crosshair.AttachedLine.Point2.X
- && Crosshair.AttachedLine.Point1.Y == Crosshair.AttachedLine.Point2.Y)
+ if (pcb_crosshair.AttachedLine.Point1.X == pcb_crosshair.AttachedLine.Point2.X
+ && pcb_crosshair.AttachedLine.Point1.Y == pcb_crosshair.AttachedLine.Point2.Y)
return (NULL);
- found = SearchObjectByLocation(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3,
- Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, 5);
+ found = pcb_search_obj_by_location(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3,
+ pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, 5);
if (found == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, _("No pad/pin under rat line\n"));
+ pcb_message(PCB_MSG_ERROR, _("No pad/pin under rat line\n"));
return (NULL);
}
- if (NAMEONPCB_NAME((ElementTypePtr) ptr1) == NULL || *NAMEONPCB_NAME((ElementTypePtr) ptr1) == 0) {
- Message(PCB_MSG_DEFAULT, _("You must name the starting element first\n"));
+ if (PCB_ELEM_NAME_REFDES((pcb_element_t *) ptr1) == NULL || *PCB_ELEM_NAME_REFDES((pcb_element_t *) ptr1) == 0) {
+ pcb_message(PCB_MSG_ERROR, _("You must name the starting element first\n"));
return (NULL);
}
/* will work for pins to since the FLAG is common */
- group1 = (TEST_FLAG(PCB_FLAG_ONSOLDER, (PadTypePtr) ptr2) ?
- GetLayerGroupNumberByNumber(solder_silk_layer) : GetLayerGroupNumberByNumber(component_silk_layer));
- strcpy(name1, ConnectionName(found, ptr1, ptr2));
- found = SearchObjectByLocation(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3,
- Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, 5);
+ group1 = (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (pcb_pad_t *) ptr2) ?
+ pcb_layer_get_group(pcb_solder_silk_layer) : pcb_layer_get_group(pcb_component_silk_layer));
+ strcpy(name1, pcb_connection_name(found, ptr1, ptr2));
+ found = pcb_search_obj_by_location(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3,
+ pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y, 5);
if (found == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, _("No pad/pin under rat line\n"));
+ pcb_message(PCB_MSG_ERROR, _("No pad/pin under rat line\n"));
return (NULL);
}
- if (NAMEONPCB_NAME((ElementTypePtr) ptr1) == NULL || *NAMEONPCB_NAME((ElementTypePtr) ptr1) == 0) {
- Message(PCB_MSG_DEFAULT, _("You must name the ending element first\n"));
+ if (PCB_ELEM_NAME_REFDES((pcb_element_t *) ptr1) == NULL || *PCB_ELEM_NAME_REFDES((pcb_element_t *) ptr1) == 0) {
+ pcb_message(PCB_MSG_ERROR, _("You must name the ending element first\n"));
return (NULL);
}
- group2 = (TEST_FLAG(PCB_FLAG_ONSOLDER, (PadTypePtr) ptr2) ?
- GetLayerGroupNumberByNumber(solder_silk_layer) : GetLayerGroupNumberByNumber(component_silk_layer));
- name2 = ConnectionName(found, ptr1, ptr2);
+ group2 = (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (pcb_pad_t *) ptr2) ?
+ pcb_layer_get_group(pcb_solder_silk_layer) : pcb_layer_get_group(pcb_component_silk_layer));
+ name2 = pcb_connection_name(found, ptr1, ptr2);
menu = pcb_netnode_to_netname(name1);
if (menu) {
if (pcb_netnode_to_netname(name2)) {
- Message(PCB_MSG_DEFAULT, _("Both connections already in netlist - cannot merge nets\n"));
+ pcb_message(PCB_MSG_ERROR, _("Both connections already in netlist - cannot merge nets\n"));
return (NULL);
}
- entry = GetLibraryEntryMemory(menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(name2);
entry->ListEntry_dontfree = 0;
pcb_netnode_to_netname(name2);
@@ -861,7 +863,7 @@ RatTypePtr AddNet(void)
/* ok, the first name did not belong to a net */
menu = pcb_netnode_to_netname(name2);
if (menu) {
- entry = GetLibraryEntryMemory(menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(name1);
entry->ListEntry_dontfree = 0;
pcb_netnode_to_netname(name1);
@@ -879,43 +881,60 @@ RatTypePtr AddNet(void)
sprintf(ratname, " ratDrawn%i", ++ratDrawn);
}
- menu = GetLibraryMenuMemory(&(PCB->NetlistLib[NETLIST_EDITED]), NULL);
+ menu = pcb_lib_menu_new(&(PCB->NetlistLib[PCB_NETLIST_EDITED]), NULL);
menu->Name = pcb_strdup(ratname);
- entry = GetLibraryEntryMemory(menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(name1);
entry->ListEntry_dontfree = 0;
- entry = GetLibraryEntryMemory(menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(name2);
entry->ListEntry_dontfree = 0;
menu->flag = 1;
ratIt:
pcb_netlist_changed(0);
- return (CreateNewRat(PCB->Data, Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
- Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y, group1, group2, conf_core.appearance.rat_thickness, NoFlags()));
+ return (pcb_rat_new(PCB->Data, pcb_crosshair.AttachedLine.Point1.X,
+ pcb_crosshair.AttachedLine.Point1.Y,
+ pcb_crosshair.AttachedLine.Point2.X,
+ pcb_crosshair.AttachedLine.Point2.Y, group1, group2, conf_core.appearance.rat_thickness, pcb_no_flags()));
}
-char *ConnectionName(int type, void *ptr1, void *ptr2)
+char *pcb_connection_name(int type, void *ptr1, void *ptr2)
{
static char name[256];
char *num;
switch (type) {
case PCB_TYPE_PIN:
- num = ((PinTypePtr) ptr2)->Number;
+ num = ((pcb_pin_t *) ptr2)->Number;
break;
case PCB_TYPE_PAD:
- num = ((PadTypePtr) ptr2)->Number;
+ num = ((pcb_pad_t *) ptr2)->Number;
break;
default:
return (NULL);
}
- strcpy(name, UNKNOWN(NAMEONPCB_NAME((ElementTypePtr) ptr1)));
+ strcpy(name, PCB_UNKNOWN(PCB_ELEM_NAME_REFDES((pcb_element_t *) ptr1)));
strcat(name, "-");
- strcat(name, UNKNOWN(num));
+ strcat(name, PCB_UNKNOWN(num));
return (name);
}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a connection, allocates memory if necessary
+ */
+pcb_connection_t *pcb_rat_connection_alloc(pcb_net_t *Net)
+{
+ pcb_connection_t *con = Net->Connection;
+
+ /* realloc new memory if necessary and clear it */
+ if (Net->ConnectionN >= Net->ConnectionMax) {
+ Net->ConnectionMax += STEP_POINT;
+ con = (pcb_connection_t *) realloc(con, Net->ConnectionMax * sizeof(pcb_connection_t));
+ Net->Connection = con;
+ memset(con + Net->ConnectionN, 0, STEP_POINT * sizeof(pcb_connection_t));
+ }
+ return (con + Net->ConnectionN++);
+}
diff --git a/src/rats.h b/src/rats.h
index 7629721..67bf991 100644
--- a/src/rats.h
+++ b/src/rats.h
@@ -28,18 +28,47 @@
/* prototypes for rats routines */
-#ifndef PCB_RATS_H
-#define PCB_RATS_H
+#ifndef PCB_RATS_H
+#define PCB_RATS_H
-#include "global.h"
+#include "config.h"
+#include "netlist.h"
+#include "layer.h"
-RatTypePtr AddNet(void);
-char *ConnectionName(int, void *, void *);
+/* ---------------------------------------------------------------------------
+ * structure used by device drivers
+ */
+
+
+struct pcb_connection_s { /* holds a connection (rat) */
+ pcb_coord_t X, Y; /* coordinate of connection */
+ long int type; /* type of object in ptr1 - 3 */
+ void *ptr1, *ptr2; /* the object of the connection */
+ pcb_layergrp_id_t group; /* the layer group of the connection */
+ pcb_lib_menu_t *menu; /* the netmenu this *SHOULD* belong too */
+};
+
+pcb_rat_t *pcb_rat_add_net(void);
+char *pcb_connection_name(int, void *, void *);
+
+pcb_bool pcb_rat_add_all(pcb_bool, void (*)(register pcb_connection_t *, register pcb_connection_t *, register pcb_route_style_t *));
+pcb_bool pcb_rat_seek_pad(pcb_lib_entry_t *, pcb_connection_t *, pcb_bool);
+
+pcb_netlist_t *pcb_rat_proc_netlist(pcb_lib_t *);
+pcb_netlist_list_t pcb_rat_collect_subnets(pcb_bool);
+pcb_connection_t *pcb_rat_connection_alloc(pcb_net_t *);
+
+#define PCB_CONNECTION_LOOP(net) do { \
+ pcb_cardinal_t n; \
+ pcb_connection_t * connection; \
+ for (n = (net)->ConnectionN-1; n != -1; n--) \
+ { \
+ connection = & (net)->Connection[n]
-pcb_bool AddAllRats(pcb_bool, void (*)(register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr));
-pcb_bool SeekPad(LibraryEntryTypePtr, ConnectionTypePtr, pcb_bool);
+#define PCB_RAT_LOOP(top) do { \
+ pcb_rat_t *line; \
+ gdl_iterator_t __it__; \
+ ratlist_foreach(&(top)->Rat, &__it__, line) {
-NetListTypePtr ProcNetlist(LibraryTypePtr);
-NetListListType CollectSubnets(pcb_bool);
#endif
diff --git a/src/rats_act.c b/src/rats_act.c
index b870af2..f1a8529 100644
--- a/src/rats_act.c
+++ b/src/rats_act.c
@@ -27,24 +27,27 @@
#include "config.h"
#include "conf_core.h"
+#include "board.h"
#include "data.h"
#include "action_helper.h"
#include "error.h"
#include "undo.h"
-#include "set.h"
-#include "misc.h"
#include "find.h"
#include "remove.h"
#include "funchash_core.h"
+#include "compat_nls.h"
+#include "obj_rat.h"
#include "rats.h"
#include "draw.h"
+#include "obj_rat_draw.h"
+
/* --------------------------------------------------------------------------- */
-static const char addrats_syntax[] = "AddRats(AllRats|SelectedRats|Close)";
+static const char pcb_acts_AddRats[] = "AddRats(AllRats|SelectedRats|Close)";
-static const char addrats_help[] = "Add one or more rat lines to the board.";
+static const char pcb_acth_AddRats[] = "Add one or more rat lines to the board.";
/* %start-doc actions AddRats
@@ -65,45 +68,45 @@ Selects the shortest unselected rat on the board.
%end-doc */
-static int ActionAddRats(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_AddRats(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- RatTypePtr shorty;
+ const char *function = PCB_ACTION_ARG(0);
+ pcb_rat_t *shorty;
float len, small;
if (function) {
if (conf_core.temp.rat_warn)
- ClearWarnings();
- switch (funchash_get(function, NULL)) {
+ pcb_clear_warnings();
+ switch (pcb_funchash_get(function, NULL)) {
case F_AllRats:
- if (AddAllRats(pcb_false, NULL))
- SetChangedFlag(pcb_true);
+ if (pcb_rat_add_all(pcb_false, NULL))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedRats:
case F_Selected:
- if (AddAllRats(pcb_true, NULL))
- SetChangedFlag(pcb_true);
+ if (pcb_rat_add_all(pcb_true, NULL))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_Close:
- small = SQUARE(MAX_COORD);
+ small = PCB_SQUARE(PCB_MAX_COORD);
shorty = NULL;
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, line))
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line))
continue;
- len = SQUARE(line->Point1.X - line->Point2.X) + SQUARE(line->Point1.Y - line->Point2.Y);
+ len = PCB_SQUARE(line->Point1.X - line->Point2.X) + PCB_SQUARE(line->Point1.Y - line->Point2.Y);
if (len < small) {
small = len;
shorty = line;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (shorty) {
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, shorty, shorty, shorty);
- SET_FLAG(PCB_FLAG_SELECTED, shorty);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, shorty, shorty, shorty);
+ PCB_FLAG_SET(PCB_FLAG_SELECTED, shorty);
DrawRat(shorty);
- Draw();
- CenterDisplay((shorty->Point2.X + shorty->Point1.X) / 2, (shorty->Point2.Y + shorty->Point1.Y) / 2);
+ pcb_draw();
+ pcb_center_display((shorty->Point2.X + shorty->Point1.X) / 2, (shorty->Point2.Y + shorty->Point1.Y) / 2);
}
break;
}
@@ -113,9 +116,9 @@ static int ActionAddRats(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char connection_syntax[] = "Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset)";
+static const char pcb_acts_Connection[] = "Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset)";
-static const char connection_help[] = "Searches connections of the object at the cursor position.";
+static const char pcb_acth_Connection[] = "Searches connections of the object at the cursor position.";
/* %start-doc actions Connection
@@ -140,70 +143,70 @@ All ``found'' objects are marked ``not found''.
%end-doc */
-static int ActionConnection(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Connection(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
case F_Find:
{
- gui->get_coords(_("Click on a connection"), &x, &y);
- LookupConnection(x, y, pcb_true, 1, PCB_FLAG_FOUND);
+ pcb_gui->get_coords(_("Click on a connection"), &x, &y);
+ pcb_lookup_conn(x, y, pcb_true, 1, PCB_FLAG_FOUND);
break;
}
case F_ResetLinesAndPolygons:
- if (ResetFoundLinesAndPolygons(pcb_true)) {
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_reset_found_lines_polys(pcb_true)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
}
break;
case F_ResetPinsViasAndPads:
- if (ResetFoundPinsViasAndPads(pcb_true)) {
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_reset_found_pins_vias_pads(pcb_true)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
}
break;
case F_Reset:
- if (ResetConnections(pcb_true)) {
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_reset_conns(pcb_true)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
}
break;
}
return 0;
}
- AFAIL(connection);
+ PCB_ACT_FAIL(Connection);
}
/* --------------------------------------------------------------------------- */
-static const char deleterats_syntax[] = "DeleteRats(AllRats|Selected|SelectedRats)";
+static const char pcb_acts_DeleteRats[] = "DeleteRats(AllRats|Selected|SelectedRats)";
-static const char deleterats_help[] = "Delete rat lines.";
+static const char pcb_acth_DeleteRats[] = "Delete rat lines.";
/* %start-doc actions DeleteRats
%end-doc */
-static int ActionDeleteRats(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DeleteRats(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
if (conf_core.temp.rat_warn)
- ClearWarnings();
- switch (funchash_get(function, NULL)) {
+ pcb_clear_warnings();
+ switch (pcb_funchash_get(function, NULL)) {
case F_AllRats:
- if (DeleteRats(pcb_false))
- SetChangedFlag(pcb_true);
+ if (pcb_rats_destroy(pcb_false))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedRats:
case F_Selected:
- if (DeleteRats(pcb_true))
- SetChangedFlag(pcb_true);
+ if (pcb_rats_destroy(pcb_true))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
}
@@ -211,15 +214,15 @@ static int ActionDeleteRats(int argc, const char **argv, Coord x, Coord y)
}
-HID_Action rats_action_list[] = {
- {"AddRats", 0, ActionAddRats,
- addrats_help, addrats_syntax}
+pcb_hid_action_t rats_action_list[] = {
+ {"AddRats", 0, pcb_act_AddRats,
+ pcb_acth_AddRats, pcb_acts_AddRats}
,
- {"Connection", 0, ActionConnection,
- connection_help, connection_syntax}
+ {"Connection", 0, pcb_act_Connection,
+ pcb_acth_Connection, pcb_acts_Connection}
,
- {"DeleteRats", 0, ActionDeleteRats,
- deleterats_help, deleterats_syntax}
+ {"DeleteRats", 0, pcb_act_DeleteRats,
+ pcb_acth_DeleteRats, pcb_acts_DeleteRats}
};
-REGISTER_ACTIONS(rats_action_list, NULL)
+PCB_REGISTER_ACTIONS(rats_action_list, NULL)
diff --git a/src/rats_patch.c b/src/rats_patch.c
index 878eb40..3c6cffe 100644
--- a/src/rats_patch.c
+++ b/src/rats_patch.c
@@ -26,28 +26,26 @@
#include "rats_patch.h"
#include "genht/htsp.h"
#include "genht/hash.h"
-#include "create.h"
#include "config.h"
#include "data.h"
#include "error.h"
-#include "buffer.h"
-#include "remove.h"
#include "copy.h"
#include "compat_misc.h"
+#include "compat_nls.h"
-static void rats_patch_remove(PCBTypePtr pcb, rats_patch_line_t * n, int do_free);
+static void rats_patch_remove(pcb_board_t *pcb, pcb_ratspatch_line_t * n, int do_free);
-const char *pcb_netlist_names[NUM_NETLISTS] = {
+const char *pcb_netlist_names[PCB_NUM_NETLISTS] = {
"input",
"edited"
};
-void rats_patch_append(PCBTypePtr pcb, rats_patch_op_t op, const char *id, const char *a1, const char *a2)
+void pcb_ratspatch_append(pcb_board_t *pcb, pcb_rats_patch_op_t op, const char *id, const char *a1, const char *a2)
{
- rats_patch_line_t *n;
+ pcb_ratspatch_line_t *n;
- n = malloc(sizeof(rats_patch_line_t));
+ n = malloc(sizeof(pcb_ratspatch_line_t));
n->op = op;
n->id = pcb_strdup(id);
@@ -68,7 +66,7 @@ void rats_patch_append(PCBTypePtr pcb, rats_patch_op_t op, const char *id, const
n->next = NULL;
}
-static void rats_patch_free_fields(rats_patch_line_t *n)
+static void rats_patch_free_fields(pcb_ratspatch_line_t *n)
{
if (n->id != NULL)
free(n->id);
@@ -78,9 +76,9 @@ static void rats_patch_free_fields(rats_patch_line_t *n)
free(n->arg2.attrib_val);
}
-void rats_patch_destroy(PCBTypePtr pcb)
+void pcb_ratspatch_destroy(pcb_board_t *pcb)
{
- rats_patch_line_t *n, *next;
+ pcb_ratspatch_line_t *n, *next;
for(n = pcb->NetlistPatches; n != NULL; n = next) {
next = n->next;
@@ -89,10 +87,10 @@ void rats_patch_destroy(PCBTypePtr pcb)
}
}
-void rats_patch_append_optimize(PCBTypePtr pcb, rats_patch_op_t op, const char *id, const char *a1, const char *a2)
+void pcb_ratspatch_append_optimize(pcb_board_t *pcb, pcb_rats_patch_op_t op, const char *id, const char *a1, const char *a2)
{
- rats_patch_op_t seek_op;
- rats_patch_line_t *n;
+ pcb_rats_patch_op_t seek_op;
+ pcb_ratspatch_line_t *n;
switch (op) {
case RATP_ADD_CONN:
@@ -126,11 +124,11 @@ void rats_patch_append_optimize(PCBTypePtr pcb, rats_patch_op_t op, const char *
}
quit:;
- rats_patch_append(pcb, op, id, a1, a2);
+ pcb_ratspatch_append(pcb, op, id, a1, a2);
}
/* Unlink n from the list; if do_free is non-zero, also free fields and n */
-static void rats_patch_remove(PCBTypePtr pcb, rats_patch_line_t * n, int do_free)
+static void rats_patch_remove(pcb_board_t *pcb, pcb_ratspatch_line_t * n, int do_free)
{
/* if we are the first or last... */
if (n == pcb->NetlistPatches)
@@ -150,7 +148,7 @@ static void rats_patch_remove(PCBTypePtr pcb, rats_patch_line_t * n, int do_free
}
}
-static void netlist_free(LibraryTypePtr dst)
+static void netlist_free(pcb_lib_t *dst)
{
int n, p;
@@ -158,10 +156,10 @@ static void netlist_free(LibraryTypePtr dst)
return;
for (n = 0; n < dst->MenuN; n++) {
- LibraryMenuTypePtr dmenu = &dst->Menu[n];
+ pcb_lib_menu_t *dmenu = &dst->Menu[n];
free(dmenu->Name);
for (p = 0; p < dmenu->EntryN; p++) {
- LibraryEntryTypePtr dentry = &dmenu->Entry[p];
+ pcb_lib_entry_t *dentry = &dmenu->Entry[p];
free((char*)dentry->ListEntry);
}
free(dmenu->Entry);
@@ -170,24 +168,24 @@ static void netlist_free(LibraryTypePtr dst)
dst->Menu = NULL;
}
-static void netlist_copy(LibraryTypePtr dst, LibraryTypePtr src)
+static void netlist_copy(pcb_lib_t *dst, pcb_lib_t *src)
{
int n, p;
dst->MenuMax = dst->MenuN = src->MenuN;
if (src->MenuN != 0) {
- dst->Menu = calloc(sizeof(LibraryMenuType), dst->MenuN);
+ dst->Menu = calloc(sizeof(pcb_lib_menu_t), dst->MenuN);
for (n = 0; n < src->MenuN; n++) {
- LibraryMenuTypePtr smenu = &src->Menu[n];
- LibraryMenuTypePtr dmenu = &dst->Menu[n];
+ pcb_lib_menu_t *smenu = &src->Menu[n];
+ pcb_lib_menu_t *dmenu = &dst->Menu[n];
/* fprintf(stderr, "Net %d name='%s': ", n, smenu->Name+2);*/
dmenu->Name = pcb_strdup(smenu->Name);
dmenu->EntryMax = dmenu->EntryN = smenu->EntryN;
- dmenu->Entry = calloc(sizeof(LibraryEntryType), dmenu->EntryN);
+ dmenu->Entry = calloc(sizeof(pcb_lib_entry_t), dmenu->EntryN);
dmenu->flag = smenu->flag;
dmenu->internal = smenu->internal;
for (p = 0; p < smenu->EntryN; p++) {
- LibraryEntryTypePtr sentry = &smenu->Entry[p];
- LibraryEntryTypePtr dentry = &dmenu->Entry[p];
+ pcb_lib_entry_t *sentry = &smenu->Entry[p];
+ pcb_lib_entry_t *dentry = &dmenu->Entry[p];
dentry->ListEntry = pcb_strdup(sentry->ListEntry);
dentry->ListEntry_dontfree = 0;
/* fprintf (stderr, " '%s'/%p", dentry->ListEntry, dentry->ListEntry);*/
@@ -200,21 +198,21 @@ static void netlist_copy(LibraryTypePtr dst, LibraryTypePtr src)
}
-int rats_patch_apply_conn(PCBTypePtr pcb, rats_patch_line_t * patch, int del)
+int rats_patch_apply_conn(pcb_board_t *pcb, pcb_ratspatch_line_t * patch, int del)
{
int n;
- for (n = 0; n < pcb->NetlistLib[NETLIST_EDITED].MenuN; n++) {
- LibraryMenuTypePtr menu = &pcb->NetlistLib[NETLIST_EDITED].Menu[n];
+ for (n = 0; n < pcb->NetlistLib[PCB_NETLIST_EDITED].MenuN; n++) {
+ pcb_lib_menu_t *menu = &pcb->NetlistLib[PCB_NETLIST_EDITED].Menu[n];
if (strcmp(menu->Name + 2, patch->arg1.net_name) == 0) {
int p;
for (p = 0; p < menu->EntryN; p++) {
- LibraryEntryTypePtr entry = &menu->Entry[p];
+ pcb_lib_entry_t *entry = &menu->Entry[p];
/* fprintf (stderr, "C'%s'/%p '%s'/%p\n", entry->ListEntry, entry->ListEntry, patch->id, patch->id);*/
if (strcmp(entry->ListEntry, patch->id) == 0) {
if (del) {
/* want to delete and it's on the list */
- memmove(&menu->Entry[p], &menu->Entry[p + 1], (menu->EntryN - p - 1) * sizeof(LibraryEntryType));
+ memmove(&menu->Entry[p], &menu->Entry[p + 1], (menu->EntryN - p - 1) * sizeof(pcb_lib_entry_t));
menu->EntryN--;
return 0;
}
@@ -227,24 +225,24 @@ int rats_patch_apply_conn(PCBTypePtr pcb, rats_patch_line_t * patch, int del)
return 1;
/* Wanted to add, let's add it */
- CreateNewConnection(menu, (char *) patch->id);
+ pcb_lib_conn_new(menu, (char *) patch->id);
return 0;
}
}
/* couldn't find the net: create it */
{
- LibraryMenuType *net = NULL;
- net = CreateNewNet(&pcb->NetlistLib[NETLIST_EDITED], patch->arg1.net_name, NULL);
+ pcb_lib_menu_t *net = NULL;
+ net = pcb_lib_net_new(&pcb->NetlistLib[PCB_NETLIST_EDITED], patch->arg1.net_name, NULL);
if (net == NULL)
return 1;
- CreateNewConnection(net, (char *) patch->id);
+ pcb_lib_conn_new(net, (char *) patch->id);
}
return 0;
}
-int rats_patch_apply(PCBTypePtr pcb, rats_patch_line_t * patch)
+int pcb_ratspatch_apply(pcb_board_t *pcb, pcb_ratspatch_line_t * patch)
{
switch (patch->op) {
case RATP_ADD_CONN:
@@ -258,31 +256,31 @@ int rats_patch_apply(PCBTypePtr pcb, rats_patch_line_t * patch)
return 0;
}
-void rats_patch_make_edited(PCBTypePtr pcb)
+void pcb_ratspatch_make_edited(pcb_board_t *pcb)
{
- rats_patch_line_t *n;
+ pcb_ratspatch_line_t *n;
- netlist_free(&(pcb->NetlistLib[NETLIST_EDITED]));
- netlist_copy(&(pcb->NetlistLib[NETLIST_EDITED]), &(pcb->NetlistLib[NETLIST_INPUT]));
+ netlist_free(&(pcb->NetlistLib[PCB_NETLIST_EDITED]));
+ netlist_copy(&(pcb->NetlistLib[PCB_NETLIST_EDITED]), &(pcb->NetlistLib[PCB_NETLIST_INPUT]));
for (n = pcb->NetlistPatches; n != NULL; n = n->next)
- rats_patch_apply(pcb, n);
+ pcb_ratspatch_apply(pcb, n);
}
-static LibraryMenuTypePtr rats_patch_find_net(PCBTypePtr pcb, const char *netname, int listidx)
+static pcb_lib_menu_t *rats_patch_find_net(pcb_board_t *pcb, const char *netname, int listidx)
{
int n;
for (n = 0; n < pcb->NetlistLib[listidx].MenuN; n++) {
- LibraryMenuTypePtr menu = &pcb->NetlistLib[listidx].Menu[n];
+ pcb_lib_menu_t *menu = &pcb->NetlistLib[listidx].Menu[n];
if (strcmp(menu->Name + 2, netname) == 0)
return menu;
}
return NULL;
}
-int rats_patch_export(PCBType *pcb, rats_patch_line_t *pat, pcb_bool need_info_lines, void (*cb)(void *ctx, pcb_rats_patch_export_ev_t ev, const char *netn, const char *key, const char *val), void *ctx)
+int rats_patch_export(pcb_board_t *pcb, pcb_ratspatch_line_t *pat, pcb_bool need_info_lines, void (*cb)(void *ctx, pcb_rats_patch_export_ev_t ev, const char *netn, const char *key, const char *val), void *ctx)
{
- rats_patch_line_t *n;
+ pcb_ratspatch_line_t *n;
if (need_info_lines) {
htsp_t *seen;
@@ -294,16 +292,16 @@ int rats_patch_export(PCBType *pcb, rats_patch_line_t *pat, pcb_bool need_info_l
case RATP_ADD_CONN:
case RATP_DEL_CONN:
if (htsp_get(seen, n->arg1.net_name) == NULL) {
- LibraryMenuTypePtr net;
+ pcb_lib_menu_t *net;
int p;
- net = rats_patch_find_net(pcb, n->arg1.net_name, NETLIST_INPUT);
+ net = rats_patch_find_net(pcb, n->arg1.net_name, PCB_NETLIST_INPUT);
/* printf("net: '%s' %p\n", n->arg1.net_name, (void *)net);*/
if (net != NULL) {
htsp_set(seen, n->arg1.net_name, net);
cb(ctx, PCB_RPE_INFO_BEGIN, n->arg1.net_name, NULL, NULL);
for (p = 0; p < net->EntryN; p++) {
- LibraryEntryTypePtr entry = &net->Entry[p];
+ pcb_lib_entry_t *entry = &net->Entry[p];
cb(ctx, PCB_RPE_INFO_TERMINAL, n->arg1.net_name, NULL, entry->ListEntry);
}
cb(ctx, PCB_RPE_INFO_END, n->arg1.net_name, NULL, NULL);
@@ -358,7 +356,7 @@ static void fexport_cb(void *ctx_, pcb_rats_patch_export_ev_t ev, const char *ne
}
}
-int rats_patch_fexport(PCBTypePtr pcb, FILE *f, int fmt_pcb)
+int pcb_ratspatch_fexport(pcb_board_t *pcb, FILE *f, int fmt_pcb)
{
fexport_t ctx;
if (fmt_pcb) {
@@ -379,36 +377,36 @@ int rats_patch_fexport(PCBTypePtr pcb, FILE *f, int fmt_pcb)
/* ---------------------------------------------------------------- */
-static const char replacefootprint_syntax[] = "ReplaceFootprint()\n";
+static const char pcb_acts_ReplaceFootprint[] = "ReplaceFootprint()\n";
-static const char replacefootprint_help[] = "Replace the footprint of the selected components with the footprint specified.";
+static const char pcb_acth_ReplaceFootprint[] = "Replace the footprint of the selected components with the footprint specified.";
-static int ActionReplaceFootprint(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_ReplaceFootprint(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *a[4];
const char *fpname;
int found = 0;
/* check if we have elements selected and quit if not */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, element)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) {
found = 1;
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (!(found)) {
- Message(PCB_MSG_DEFAULT, "ReplaceFootprint works on selected elements, please select elements first!\n");
+ pcb_message(PCB_MSG_ERROR, "ReplaceFootprint works on selected elements, please select elements first!\n");
return 1;
}
/* fetch the name of the new footprint */
if (argc == 0) {
- fpname = gui->prompt_for("Footprint name", "");
+ fpname = pcb_gui->prompt_for("Footprint name", "");
if (fpname == NULL) {
- Message(PCB_MSG_DEFAULT, "No footprint name supplied\n");
+ pcb_message(PCB_MSG_ERROR, "No footprint name supplied\n");
return 1;
}
}
@@ -418,38 +416,38 @@ static int ActionReplaceFootprint(int argc, const char **argv, Coord x, Coord y)
/* check if the footprint is available */
a[0] = fpname;
a[1] = NULL;
- if (LoadFootprint(1, a, x, y) != 0) {
- Message(PCB_MSG_DEFAULT, "Can't load footprint %s\n", fpname);
+ if (pcb_act_LoadFootprint(1, a, x, y) != 0) {
+ pcb_message(PCB_MSG_ERROR, "Can't load footprint %s\n", fpname);
return 1;
}
/* action: replace selected elements */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, element)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) {
a[0] = fpname;
a[1] = element->Name[1].TextString;
a[2] = element->Name[2].TextString;
a[3] = NULL;
- LoadFootprint(3, a, element->MarkX, element->MarkY);
- CopyPastebufferToLayout(element->MarkX, element->MarkY);
- rats_patch_append_optimize(PCB, RATP_CHANGE_ATTRIB, a[1], "footprint", fpname);
- RemoveElement(element);
+ pcb_act_LoadFootprint(3, a, element->MarkX, element->MarkY);
+ pcb_buffer_copy_to_layout(element->MarkX, element->MarkY);
+ pcb_ratspatch_append_optimize(PCB, RATP_CHANGE_ATTRIB, a[1], "footprint", fpname);
+ pcb_element_remove(element);
}
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
-static const char savepatch_syntax[] = "SavePatch(filename)";
+static const char pcb_acts_SavePatch[] = "SavePatch(filename)";
-static const char savepatch_help[] = "Save netlist patch for back annotation.";
+static const char pcb_acth_SavePatch[] = "Save netlist patch for back annotation.";
/* %start-doc actions SavePatch
Save netlist patch for back annotation.
%end-doc */
-static int ActionSavePatch(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_SavePatch(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *fn;
FILE *f;
@@ -464,14 +462,14 @@ static int ActionSavePatch(int argc, const char **argv, Coord x, Coord y)
default_file = malloc(len + 8);
memcpy(default_file, PCB->Filename, len + 1);
end = strrchr(default_file, '.');
- if ((end == NULL) || (strcasecmp(end, ".pcb") != 0))
+ if ((end == NULL) || (pcb_strcasecmp(end, ".pcb") != 0))
end = default_file + len;
strcpy(end, ".bap");
}
else
default_file = pcb_strdup("unnamed.bap");
- fn = gui->fileselect(_("Save netlist patch as ..."),
+ fn = pcb_gui->fileselect(_("Save netlist patch as ..."),
_("Choose a file to save netlist patch to\n"
"for back annotation\n"), default_file, ".bap", "patch", 0);
@@ -481,20 +479,20 @@ static int ActionSavePatch(int argc, const char **argv, Coord x, Coord y)
fn = argv[0];
f = fopen(fn, "w");
if (f == NULL) {
- Message(PCB_MSG_DEFAULT, "Can't open netlist patch file %s for writing\n", fn);
+ pcb_message(PCB_MSG_ERROR, "Can't open netlist patch file %s for writing\n", fn);
return 1;
}
- rats_patch_fexport(PCB, f, 0);
+ pcb_ratspatch_fexport(PCB, f, 0);
fclose(f);
return 0;
}
-HID_Action rats_patch_action_list[] = {
- {"ReplaceFootprint", 0, ActionReplaceFootprint,
- replacefootprint_help, replacefootprint_syntax}
+pcb_hid_action_t rats_patch_action_list[] = {
+ {"ReplaceFootprint", 0, pcb_act_ReplaceFootprint,
+ pcb_acth_ReplaceFootprint, pcb_acts_ReplaceFootprint}
,
- {"SavePatch", 0, ActionSavePatch,
- savepatch_help, savepatch_syntax}
+ {"SavePatch", 0, pcb_act_SavePatch,
+ pcb_acth_SavePatch, pcb_acts_SavePatch}
};
-REGISTER_ACTIONS(rats_patch_action_list, NULL)
+PCB_REGISTER_ACTIONS(rats_patch_action_list, NULL)
diff --git a/src/rats_patch.h b/src/rats_patch.h
index cb97fe3..8dbf679 100644
--- a/src/rats_patch.h
+++ b/src/rats_patch.h
@@ -23,40 +23,59 @@
*
*/
-/* Change History:
- * Started 6/10/97
- * Added support for minimum length rat lines 6/13/97
- * rat lines to nearest line/via 8/29/98
- * support for netlist window 10/24/98
- */
+#ifndef PCB_RATS_PATCH_H
+#define PCB_RATS_PATCH_H
+
+#include <stdio.h>
+#include "board.h"
+
+typedef enum {
+ RATP_ADD_CONN,
+ RATP_DEL_CONN,
+ RATP_CHANGE_ATTRIB
+} pcb_rats_patch_op_t;
+
+struct pcb_ratspatch_line_s {
+ pcb_rats_patch_op_t op;
+ char *id;
+ union {
+ char *net_name;
+ char *attrib_name;
+ } arg1;
+ union {
+ char *attrib_val;
+ } arg2;
+
+ pcb_ratspatch_line_t *prev, *next;
+};
+
-#include "global.h"
/* Single-word netlist class names */
-const char *pcb_netlist_names[NUM_NETLISTS];
+const char *pcb_netlist_names[PCB_NUM_NETLISTS];
/* Allocate and append a patch line to the patch list */
-void rats_patch_append(PCBTypePtr pcb, rats_patch_op_t op, const char *id, const char *a1, const char *a2);
+void pcb_ratspatch_append(pcb_board_t *pcb, pcb_rats_patch_op_t op, const char *id, const char *a1, const char *a2);
/* Free the patch list and all memory claimed by patch list items */
-void rats_patch_destroy(PCBTypePtr pcb);
+void pcb_ratspatch_destroy(pcb_board_t *pcb);
-/* Same as rats_patch_append() but also optimize previous entries so that
+/* Same as pcb_ratspatch_append() but also optimize previous entries so that
redundant entries are removed */
-void rats_patch_append_optimize(PCBTypePtr pcb, rats_patch_op_t op, const char *id, const char *a1, const char *a2);
+void pcb_ratspatch_append_optimize(pcb_board_t *pcb, pcb_rats_patch_op_t op, const char *id, const char *a1, const char *a2);
-/* Create [NETLIST_EDITED] from [NETLIST_INPUT] applying the patch */
-void rats_patch_make_edited(PCBTypePtr pcb);
+/* Create [PCB_NETLIST_EDITED] from [PCB_NETLIST_INPUT] applying the patch */
+void pcb_ratspatch_make_edited(pcb_board_t *pcb);
-/* apply a single patch record on [NETLIST_EDITED]; returns non-zero on failure */
-int rats_patch_apply(PCBTypePtr pcb, rats_patch_line_t * patch);
+/* apply a single patch record on [PCB_NETLIST_EDITED]; returns non-zero on failure */
+int pcb_ratspatch_apply(pcb_board_t *pcb, pcb_ratspatch_line_t * patch);
/**** exporter ****/
/* Special text exporter:
save all patch lines as an ordered list of text lines
if fmt is non-zero, generate pcb savefile compatible lines, else generate a back annotation patch */
-int rats_patch_fexport(PCBTypePtr pcb, FILE * f, int fmt_pcb);
+int pcb_ratspatch_fexport(pcb_board_t *pcb, FILE * f, int fmt_pcb);
/* Generic, callback based exporter: */
@@ -73,4 +92,6 @@ typedef enum { /* netn is always the net name, unless specified other
/* Call cb() for each item to output; PCB_PTRE_INFO* is calculated/called only
if need_info_lines is true; the pcb pointer is used for looking up connections */
-int rats_patch_export(PCBType *pcb, rats_patch_line_t *pat, pcb_bool need_info_lines, void (*cb)(void *ctx, pcb_rats_patch_export_ev_t ev, const char *netn, const char *key, const char *val), void *ctx);
+int rats_patch_export(pcb_board_t *pcb, pcb_ratspatch_line_t *pat, pcb_bool need_info_lines, void (*cb)(void *ctx, pcb_rats_patch_export_ev_t ev, const char *netn, const char *key, const char *val), void *ctx);
+
+#endif
diff --git a/src/remove.c b/src/remove.c
index e81f9c2..30ff2a7 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -29,55 +29,33 @@
#include "config.h"
#include "conf_core.h"
-#include <setjmp.h>
-#include <memory.h>
-
-#include "data.h"
+#include "board.h"
#include "draw.h"
-#include "misc.h"
-#include "move.h"
-#include "polygon.h"
#include "remove.h"
-#include "rtree.h"
#include "select.h"
#include "undo.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *DestroyVia(PinTypePtr);
-static void *DestroyRat(RatTypePtr);
-static void *DestroyLine(LayerTypePtr, LineTypePtr);
-static void *DestroyArc(LayerTypePtr, ArcTypePtr);
-static void *DestroyText(LayerTypePtr, TextTypePtr);
-static void *DestroyPolygon(LayerTypePtr, PolygonTypePtr);
-static void *DestroyElement(ElementTypePtr);
-static void *RemoveVia(PinTypePtr);
-static void *RemoveRat(RatTypePtr);
-static void *DestroyPolygonPoint(LayerTypePtr, PolygonTypePtr, PointTypePtr);
-static void *RemovePolygonContour(LayerTypePtr, PolygonTypePtr, pcb_cardinal_t);
-static void *RemovePolygonPoint(LayerTypePtr, PolygonTypePtr, PointTypePtr);
-static void *RemoveLinePoint(LayerTypePtr, LineTypePtr, PointTypePtr);
+#include "obj_all_op.h"
/* ---------------------------------------------------------------------------
* some local types
*/
-static ObjectFunctionType RemoveFunctions = {
- RemoveLine,
- RemoveText,
- RemovePolygon,
+static pcb_opfunc_t RemoveFunctions = {
+ RemoveLine_op,
+ RemoveText_op,
+ RemovePolygon_op,
RemoveVia,
- RemoveElement,
+ RemoveElement_op,
NULL,
NULL,
NULL,
RemoveLinePoint,
RemovePolygonPoint,
- RemoveArc,
- RemoveRat
+ RemoveArc_op,
+ RemoveRat,
+ NULL
};
-static ObjectFunctionType DestroyFunctions = {
+static pcb_opfunc_t DestroyFunctions = {
DestroyLine,
DestroyText,
DestroyPolygon,
@@ -89,429 +67,27 @@ static ObjectFunctionType DestroyFunctions = {
NULL,
DestroyPolygonPoint,
DestroyArc,
- DestroyRat
+ DestroyRat,
+ NULL
};
-static DataTypePtr DestroyTarget;
-static pcb_bool Bulk = pcb_false;
-
-/* ---------------------------------------------------------------------------
- * remove PCB
- */
-void RemovePCB(PCBTypePtr Ptr)
-{
- ClearUndoList(pcb_true);
- FreePCBMemory(Ptr);
- free(Ptr);
-}
-
-/* ---------------------------------------------------------------------------
- * destroys a via
- */
-static void *DestroyVia(PinTypePtr Via)
-{
- r_delete_entry(DestroyTarget->via_tree, (BoxTypePtr) Via);
- free(Via->Name);
-
- RemoveFreeVia(Via);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * destroys a line from a layer
- */
-static void *DestroyLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- r_delete_entry(Layer->line_tree, (BoxTypePtr) Line);
- free(Line->Number);
-
- RemoveFreeLine(Line);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * destroys an arc from a layer
- */
-static void *DestroyArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) Arc);
-
- RemoveFreeArc(Arc);
-
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * destroys a polygon from a layer
- */
-static void *DestroyPolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- r_delete_entry(Layer->polygon_tree, (BoxTypePtr) Polygon);
- FreePolygonMemory(Polygon);
-
- RemoveFreePolygon(Polygon);
-
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a polygon-point from a polygon and destroys the data
- */
-static void *DestroyPolygonPoint(LayerTypePtr Layer, PolygonTypePtr Polygon, PointTypePtr Point)
-{
- pcb_cardinal_t point_idx;
- pcb_cardinal_t i;
- pcb_cardinal_t contour;
- pcb_cardinal_t contour_start, contour_end, contour_points;
-
- point_idx = polygon_point_idx(Polygon, Point);
- contour = polygon_point_contour(Polygon, point_idx);
- contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
- contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN : Polygon->HoleIndex[contour];
- contour_points = contour_end - contour_start;
-
- if (contour_points <= 3)
- return RemovePolygonContour(Layer, Polygon, contour);
-
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
-
- /* remove point from list, keep point order */
- for (i = point_idx; i < Polygon->PointN - 1; i++)
- Polygon->Points[i] = Polygon->Points[i + 1];
- Polygon->PointN--;
-
- /* Shift down indices of any holes */
- for (i = 0; i < Polygon->HoleIndexN; i++)
- if (Polygon->HoleIndex[i] > point_idx)
- Polygon->HoleIndex[i]--;
-
- SetPolygonBoundingBox(Polygon);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- InitClip(PCB->Data, Layer, Polygon);
- return (Polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * destroys a text from a layer
- */
-static void *DestroyText(LayerTypePtr Layer, TextTypePtr Text)
-{
- free(Text->TextString);
- r_delete_entry(Layer->text_tree, (BoxTypePtr) Text);
-
- RemoveFreeText(Text);
-
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * destroys a element
- */
-static void *DestroyElement(ElementTypePtr Element)
-{
- if (DestroyTarget->element_tree)
- r_delete_entry(DestroyTarget->element_tree, (BoxType *) Element);
- if (DestroyTarget->pin_tree) {
- PIN_LOOP(Element);
- {
- r_delete_entry(DestroyTarget->pin_tree, (BoxType *) pin);
- }
- END_LOOP;
- }
- if (DestroyTarget->pad_tree) {
- PAD_LOOP(Element);
- {
- r_delete_entry(DestroyTarget->pad_tree, (BoxType *) pad);
- }
- END_LOOP;
- }
- ELEMENTTEXT_LOOP(Element);
- {
- if (DestroyTarget->name_tree[n])
- r_delete_entry(DestroyTarget->name_tree[n], (BoxType *) text);
- }
- END_LOOP;
- FreeElementMemory(Element);
-
- RemoveFreeElement(Element);
-
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * destroys a rat
- */
-static void *DestroyRat(RatTypePtr Rat)
-{
- if (DestroyTarget->rat_tree)
- r_delete_entry(DestroyTarget->rat_tree, &Rat->BoundingBox);
-
- RemoveFreeRat(Rat);
- return NULL;
-}
-
-
-/* ---------------------------------------------------------------------------
- * removes a via
- */
-static void *RemoveVia(PinTypePtr Via)
-{
- /* erase from screen and memory */
- if (PCB->ViaOn) {
- EraseVia(Via);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_VIA, Via, Via, Via);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a rat
- */
-static void *RemoveRat(RatTypePtr Rat)
-{
- /* erase from screen and memory */
- if (PCB->RatOn) {
- EraseRat(Rat);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, Rat, Rat, Rat);
- return NULL;
-}
-
-struct rlp_info {
- jmp_buf env;
- LineTypePtr line;
- PointTypePtr point;
-};
-static r_dir_t remove_point(const BoxType * b, void *cl)
-{
- LineType *line = (LineType *) b;
- struct rlp_info *info = (struct rlp_info *) cl;
- if (line == info->line)
- return R_DIR_NOT_FOUND;
- if ((line->Point1.X == info->point->X)
- && (line->Point1.Y == info->point->Y)) {
- info->line = line;
- info->point = &line->Point1;
- longjmp(info->env, 1);
- }
- else if ((line->Point2.X == info->point->X)
- && (line->Point2.Y == info->point->Y)) {
- info->line = line;
- info->point = &line->Point2;
- longjmp(info->env, 1);
- }
- return R_DIR_NOT_FOUND;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a line point, or a line if the selected point is the end
- */
-static void *RemoveLinePoint(LayerTypePtr Layer, LineTypePtr Line, PointTypePtr Point)
-{
- PointType other;
- struct rlp_info info;
- if (&Line->Point1 == Point)
- other = Line->Point2;
- else
- other = Line->Point1;
- info.line = Line;
- info.point = Point;
- if (setjmp(info.env) == 0) {
- r_search(Layer->line_tree, (const BoxType *) Point, NULL, remove_point, &info, NULL);
- return RemoveLine(Layer, Line);
- }
- MoveObject(PCB_TYPE_LINE_POINT, Layer, info.line, info.point, other.X - Point->X, other.Y - Point->Y);
- return (RemoveLine(Layer, Line));
-}
-
-/* ---------------------------------------------------------------------------
- * removes a line from a layer
- */
-void *RemoveLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- /* erase from screen */
- if (Layer->On) {
- EraseLine(Line);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_LINE, Layer, Line, Line);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes an arc from a layer
- */
-void *RemoveArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- /* erase from screen */
- if (Layer->On) {
- EraseArc(Arc);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a text from a layer
- */
-void *RemoveText(LayerTypePtr Layer, TextTypePtr Text)
-{
- /* erase from screen */
- if (Layer->On) {
- EraseText(Layer, Text);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_TEXT, Layer, Text, Text);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a polygon from a layer
- */
-void *RemovePolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- /* erase from screen */
- if (Layer->On) {
- ErasePolygon(Polygon);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a contour from a polygon.
- * If removing the outer contour, it removes the whole polygon.
- */
-static void *RemovePolygonContour(LayerTypePtr Layer, PolygonTypePtr Polygon, pcb_cardinal_t contour)
-{
- pcb_cardinal_t contour_start, contour_end, contour_points;
- pcb_cardinal_t i;
-
- if (contour == 0)
- return RemovePolygon(Layer, Polygon);
-
- if (Layer->On) {
- ErasePolygon(Polygon);
- if (!Bulk)
- Draw();
- }
-
- /* Copy the polygon to the undo list */
- AddObjectToRemoveContourUndoList(PCB_TYPE_POLYGON, Layer, Polygon);
-
- contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
- contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN : Polygon->HoleIndex[contour];
- contour_points = contour_end - contour_start;
-
- /* remove points from list, keep point order */
- for (i = contour_start; i < Polygon->PointN - contour_points; i++)
- Polygon->Points[i] = Polygon->Points[i + contour_points];
- Polygon->PointN -= contour_points;
-
- /* remove hole from list and shift down remaining indices */
- for (i = contour; i < Polygon->HoleIndexN; i++)
- Polygon->HoleIndex[i - 1] = Polygon->HoleIndex[i] - contour_points;
- Polygon->HoleIndexN--;
-
- InitClip(PCB->Data, Layer, Polygon);
- /* redraw polygon if necessary */
- if (Layer->On) {
- DrawPolygon(Layer, Polygon);
- if (!Bulk)
- Draw();
- }
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes a polygon-point from a polygon
- */
-static void *RemovePolygonPoint(LayerTypePtr Layer, PolygonTypePtr Polygon, PointTypePtr Point)
-{
- pcb_cardinal_t point_idx;
- pcb_cardinal_t i;
- pcb_cardinal_t contour;
- pcb_cardinal_t contour_start, contour_end, contour_points;
-
- point_idx = polygon_point_idx(Polygon, Point);
- contour = polygon_point_contour(Polygon, point_idx);
- contour_start = (contour == 0) ? 0 : Polygon->HoleIndex[contour - 1];
- contour_end = (contour == Polygon->HoleIndexN) ? Polygon->PointN : Polygon->HoleIndex[contour];
- contour_points = contour_end - contour_start;
-
- if (contour_points <= 3)
- return RemovePolygonContour(Layer, Polygon, contour);
-
- if (Layer->On)
- ErasePolygon(Polygon);
-
- /* insert the polygon-point into the undo list */
- AddObjectToRemovePointUndoList(PCB_TYPE_POLYGON_POINT, Layer, Polygon, point_idx);
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
-
- /* remove point from list, keep point order */
- for (i = point_idx; i < Polygon->PointN - 1; i++)
- Polygon->Points[i] = Polygon->Points[i + 1];
- Polygon->PointN--;
-
- /* Shift down indices of any holes */
- for (i = 0; i < Polygon->HoleIndexN; i++)
- if (Polygon->HoleIndex[i] > point_idx)
- Polygon->HoleIndex[i]--;
-
- SetPolygonBoundingBox(Polygon);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- RemoveExcessPolygonPoints(Layer, Polygon);
- InitClip(PCB->Data, Layer, Polygon);
-
- /* redraw polygon if necessary */
- if (Layer->On) {
- DrawPolygon(Layer, Polygon);
- if (!Bulk)
- Draw();
- }
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------
- * removes an element
- */
-void *RemoveElement(ElementTypePtr Element)
-{
- /* erase from screen */
- if ((PCB->ElementOn || PCB->PinOn) && (FRONT(Element) || PCB->InvisibleObjectsOn)) {
- EraseElement(Element);
- if (!Bulk)
- Draw();
- }
- MoveObjectToRemoveUndoList(PCB_TYPE_ELEMENT, Element, Element, Element);
- return NULL;
-}
-
/* ----------------------------------------------------------------------
* removes all selected and visible objects
* returns pcb_true if any objects have been removed
*/
-pcb_bool RemoveSelected(void)
+pcb_bool pcb_remove_selected(void)
{
- Bulk = pcb_true;
- if (SelectedOperation(&RemoveFunctions, pcb_false, PCB_TYPEMASK_ALL)) {
- IncrementUndoSerialNumber();
- Draw();
- Bulk = pcb_false;
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_true;
+ ctx.remove.destroy_target = NULL;
+
+ if (pcb_selected_operation(&RemoveFunctions, &ctx, pcb_false, PCB_TYPEMASK_ALL)) {
+ pcb_undo_inc_serial();
+ pcb_draw();
return (pcb_true);
}
- Bulk = pcb_false;
return (pcb_false);
}
@@ -519,43 +95,30 @@ pcb_bool RemoveSelected(void)
* remove object as referred by pointers and type,
* allocated memory is passed to the 'remove undo' list
*/
-void *RemoveObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void *pcb_remove_object(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- void *ptr = ObjectOperation(&RemoveFunctions, Type, Ptr1, Ptr2, Ptr3);
- return (ptr);
-}
+ pcb_opctx_t ctx;
+ void *ptr;
-/* ---------------------------------------------------------------------------
- * DeleteRats - deletes rat lines only
- * can delete all rat lines, or only selected one
- */
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = NULL;
-pcb_bool DeleteRats(pcb_bool selected)
-{
- pcb_bool changed = pcb_false;
- Bulk = pcb_true;
- RAT_LOOP(PCB->Data);
- {
- if ((!selected) || TEST_FLAG(PCB_FLAG_SELECTED, line)) {
- changed = pcb_true;
- RemoveRat(line);
- }
- }
- END_LOOP;
- Bulk = pcb_false;
- if (changed) {
- Draw();
- IncrementUndoSerialNumber();
- }
- return (changed);
+ ptr = pcb_object_operation(&RemoveFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3);
+ return (ptr);
}
/* ---------------------------------------------------------------------------
* remove object as referred by pointers and type
* allocated memory is destroyed assumed to already be erased
*/
-void *DestroyObject(DataTypePtr Target, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void *pcb_destroy_object(pcb_data_t *Target, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
- DestroyTarget = Target;
- return (ObjectOperation(&DestroyFunctions, Type, Ptr1, Ptr2, Ptr3));
+ pcb_opctx_t ctx;
+
+ ctx.remove.pcb = PCB;
+ ctx.remove.bulk = pcb_false;
+ ctx.remove.destroy_target = Target;
+
+ return (pcb_object_operation(&DestroyFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3));
}
diff --git a/src/remove.h b/src/remove.h
index 5d04d85..be46cf4 100644
--- a/src/remove.h
+++ b/src/remove.h
@@ -29,25 +29,17 @@
#ifndef PCB_REMOVE_H
#define PCB_REMOVE_H
-#include "global.h"
+#include "config.h"
/* ---------------------------------------------------------------------------
* some constants
*/
-#define REMOVE_TYPES \
- (PCB_TYPE_VIA | PCB_TYPE_LINE_POINT | PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT | \
- PCB_TYPE_POLYGON_POINT | PCB_TYPE_POLYGON | PCB_TYPE_RATLINE | PCB_TYPE_ARC)
+#define PCB_REMOVE_TYPES \
+ (PCB_TYPE_VIA | PCB_TYPE_LINE_POINT | PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT | \
+ PCB_TYPE_POLYGON_POINT | PCB_TYPE_POLYGON | PCB_TYPE_RATLINE | PCB_TYPE_ARC | PCB_TYPE_ARC_POINT)
-void *RemoveLine(LayerTypePtr, LineTypePtr);
-void *RemoveArc(LayerTypePtr, ArcTypePtr);
-void *RemovePolygon(LayerTypePtr, PolygonTypePtr);
-void *RemoveText(LayerTypePtr, TextTypePtr);
-void *RemoveElement(ElementTypePtr);
-void ClearRemoveList(void);
-void RemovePCB(PCBTypePtr);
-pcb_bool RemoveSelected(void);
-pcb_bool DeleteRats(pcb_bool);
-void *RemoveObject(int, void *, void *, void *);
-void *DestroyObject(DataTypePtr, int, void *, void *, void *);
+pcb_bool pcb_remove_selected(void);
+void *pcb_remove_object(int, void *, void *, void *);
+void *pcb_destroy_object(pcb_data_t *, int, void *, void *, void *);
#endif
diff --git a/src/remove_act.c b/src/remove_act.c
index c0657d2..916d70c 100644
--- a/src/remove_act.c
+++ b/src/remove_act.c
@@ -24,53 +24,54 @@
* haceaton at aplcomm.jhuapl.edu
*
*/
+#include "const.h"
#include "config.h"
#include "data.h"
#include "action_helper.h"
-#include "set.h"
#include "remove.h"
+#include "board.h"
#include "funchash_core.h"
/* --------------------------------------------------------------------------- */
-static const char delete_syntax[] = "Delete(Object|Selected)\n" "Delete(AllRats|SelectedRats)";
+static const char pcb_acts_Delete[] = "Delete(Object|Selected)\n" "Delete(AllRats|SelectedRats)";
-static const char delete_help[] = "Delete stuff.";
+static const char pcb_acth_Delete[] = "Delete stuff.";
/* %start-doc actions Delete
%end-doc */
-static int ActionDelete(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Delete(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- int id = funchash_get(function, NULL);
+ const char *function = PCB_ACTION_ARG(0);
+ int id = pcb_funchash_get(function, NULL);
- Note.X = Crosshair.X;
- Note.Y = Crosshair.Y;
+ Note.X = pcb_crosshair.X;
+ Note.Y = pcb_crosshair.Y;
if (id == -1) { /* no arg */
- if (RemoveSelected() == pcb_false)
+ if (pcb_remove_selected() == pcb_false)
id = F_Object;
}
switch (id) {
case F_Object:
- SaveMode();
- SetMode(PCB_MODE_REMOVE);
- NotifyMode();
- RestoreMode();
+ pcb_crosshair_save_mode();
+ pcb_crosshair_set_mode(PCB_MODE_REMOVE);
+ pcb_notify_mode();
+ pcb_crosshair_restore_mode();
break;
case F_Selected:
- RemoveSelected();
+ pcb_remove_selected();
break;
case F_AllRats:
- if (DeleteRats(pcb_false))
- SetChangedFlag(pcb_true);
+ if (pcb_rats_destroy(pcb_false))
+ pcb_board_set_changed_flag(pcb_true);
break;
case F_SelectedRats:
- if (DeleteRats(pcb_true))
- SetChangedFlag(pcb_true);
+ if (pcb_rats_destroy(pcb_true))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
@@ -79,29 +80,29 @@ static int ActionDelete(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char removeselected_syntax[] = "RemoveSelected()";
+static const char pcb_acts_RemoveSelected[] = "pcb_remove_selected()";
-static const char removeselected_help[] = "Removes any selected objects.";
+static const char pcb_acth_RemoveSelected[] = "Removes any selected objects.";
/* %start-doc actions RemoveSelected
%end-doc */
-static int ActionRemoveSelected(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_RemoveSelected(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- if (RemoveSelected())
- SetChangedFlag(pcb_true);
+ if (pcb_remove_selected())
+ pcb_board_set_changed_flag(pcb_true);
return 0;
}
-HID_Action remove_action_list[] = {
- {"Delete", 0, ActionDelete,
- delete_help, delete_syntax}
+pcb_hid_action_t remove_action_list[] = {
+ {"Delete", 0, pcb_act_Delete,
+ pcb_acth_Delete, pcb_acts_Delete}
,
- {"RemoveSelected", 0, ActionRemoveSelected,
- removeselected_help, removeselected_syntax}
+ {"RemoveSelected", 0, pcb_act_RemoveSelected,
+ pcb_acth_RemoveSelected, pcb_acts_RemoveSelected}
,
};
-REGISTER_ACTIONS(remove_action_list, NULL)
+PCB_REGISTER_ACTIONS(remove_action_list, NULL)
diff --git a/src/rotate.c b/src/rotate.c
index a54e51d..c76484a 100644
--- a/src/rotate.c
+++ b/src/rotate.c
@@ -32,358 +32,93 @@
#include <stdlib.h>
+#include "board.h"
#include "data.h"
#include "draw.h"
#include "error.h"
-#include "misc.h"
#include "polygon.h"
#include "rotate.h"
-#include "rtree.h"
-#include "rubberband.h"
#include "search.h"
#include "select.h"
-#include "set.h"
#include "undo.h"
+#include "event.h"
#include "conf_core.h"
+#include "compat_nls.h"
+#include "obj_all_op.h"
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *RotateText(LayerTypePtr, TextTypePtr);
-static void *RotateArc(LayerTypePtr, ArcTypePtr);
-static void *RotateElement(ElementTypePtr);
-static void *RotateElementName(ElementTypePtr);
-static void *RotateLinePoint(LayerTypePtr, LineTypePtr, PointTypePtr);
+#include "obj_line_draw.h"
+#include "obj_rat_draw.h"
/* ----------------------------------------------------------------------
* some local identifiers
*/
-static Coord CenterX, CenterY; /* center of rotation */
-static unsigned Number; /* number of rotations */
-static ObjectFunctionType RotateFunctions = {
+static pcb_opfunc_t Rotate90Functions = {
+ Rotate90Line,
+ Rotate90Text,
NULL,
- RotateText,
NULL,
+ Rotate90Element,
+ Rotate90ElementName,
NULL,
- RotateElement,
- RotateElementName,
NULL,
+ Rotate90LinePoint,
NULL,
- RotateLinePoint,
+ Rotate90Arc,
NULL,
- RotateArc,
NULL
};
/* ---------------------------------------------------------------------------
* rotates a point in 90 degree steps
*/
-void RotatePointLowLevel(PointTypePtr Point, Coord X, Coord Y, unsigned Number)
-{
- ROTATE(Point->X, Point->Y, X, Y, Number);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates a line in 90 degree steps
- */
-void RotateLineLowLevel(LineTypePtr Line, Coord X, Coord Y, unsigned Number)
-{
- ROTATE(Line->Point1.X, Line->Point1.Y, X, Y, Number);
- ROTATE(Line->Point2.X, Line->Point2.Y, X, Y, Number);
- /* keep horizontal, vertical Point2 > Point1 */
- if (Line->Point1.X == Line->Point2.X) {
- if (Line->Point1.Y > Line->Point2.Y) {
- Coord t;
- t = Line->Point1.Y;
- Line->Point1.Y = Line->Point2.Y;
- Line->Point2.Y = t;
- }
- }
- else if (Line->Point1.Y == Line->Point2.Y) {
- if (Line->Point1.X > Line->Point2.X) {
- Coord t;
- t = Line->Point1.X;
- Line->Point1.X = Line->Point2.X;
- Line->Point2.X = t;
- }
- }
- /* instead of rotating the bounding box, the call updates both end points too */
- SetLineBoundingBox(Line);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates a text in 90 degree steps
- * only the bounding box is rotated, text rotation itself
- * is done by the drawing routines
- */
-void RotateTextLowLevel(TextTypePtr Text, Coord X, Coord Y, unsigned Number)
-{
- pcb_uint8_t number;
-
- number = TEST_FLAG(PCB_FLAG_ONSOLDER, Text) ? (4 - Number) & 3 : Number;
- RotateBoxLowLevel(&Text->BoundingBox, X, Y, Number);
- ROTATE(Text->X, Text->Y, X, Y, Number);
-
- /* set new direction, 0..3,
- * 0-> to the right, 1-> straight up,
- * 2-> to the left, 3-> straight down
- */
- Text->Direction = ((Text->Direction + number) & 0x03);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates a polygon in 90 degree steps
- */
-void RotatePolygonLowLevel(PolygonTypePtr Polygon, Coord X, Coord Y, unsigned Number)
+void pcb_point_rotate90(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number)
{
- POLYGONPOINT_LOOP(Polygon);
- {
- ROTATE(point->X, point->Y, X, Y, Number);
- }
- END_LOOP;
- RotateBoxLowLevel(&Polygon->BoundingBox, X, Y, Number);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates a text object and redraws it
- */
-static void *RotateText(LayerTypePtr Layer, TextTypePtr Text)
-{
- EraseText(Layer, Text);
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- r_delete_entry(Layer->text_tree, (BoxTypePtr) Text);
- RotateTextLowLevel(Text, CenterX, CenterY, Number);
- r_insert_entry(Layer->text_tree, (BoxTypePtr) Text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- DrawText(Layer, Text);
- Draw();
- return (Text);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates an arc
- */
-void RotateArcLowLevel(ArcTypePtr Arc, Coord X, Coord Y, unsigned Number)
-{
- Coord save;
-
- /* add Number*90 degrees (i.e., Number quarter-turns) */
- Arc->StartAngle = NormalizeAngle(Arc->StartAngle + Number * 90);
- ROTATE(Arc->X, Arc->Y, X, Y, Number);
-
- /* now change width and height */
- if (Number == 1 || Number == 3) {
- save = Arc->Width;
- Arc->Width = Arc->Height;
- Arc->Height = save;
- }
- RotateBoxLowLevel(&Arc->BoundingBox, X, Y, Number);
-}
-
-/* ---------------------------------------------------------------------------
- * rotate an element in 90 degree steps
- */
-void RotateElementLowLevel(DataTypePtr Data, ElementTypePtr Element, Coord X, Coord Y, unsigned Number)
-{
- /* solder side objects need a different orientation */
-
- /* the text subroutine decides by itself if the direction
- * is to be corrected
- */
- ELEMENTTEXT_LOOP(Element);
- {
- if (Data && Data->name_tree[n])
- r_delete_entry(Data->name_tree[n], (BoxType *) text);
- RotateTextLowLevel(text, X, Y, Number);
- }
- END_LOOP;
- ELEMENTLINE_LOOP(Element);
- {
- RotateLineLowLevel(line, X, Y, Number);
- }
- END_LOOP;
- PIN_LOOP(Element);
- {
- /* pre-delete the pins from the pin-tree before their coordinates change */
- if (Data)
- r_delete_entry(Data->pin_tree, (BoxType *) pin);
- RestoreToPolygon(Data, PCB_TYPE_PIN, Element, pin);
- ROTATE_PIN_LOWLEVEL(pin, X, Y, Number);
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- /* pre-delete the pads before their coordinates change */
- if (Data)
- r_delete_entry(Data->pad_tree, (BoxType *) pad);
- RestoreToPolygon(Data, PCB_TYPE_PAD, Element, pad);
- ROTATE_PAD_LOWLEVEL(pad, X, Y, Number);
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- RotateArcLowLevel(arc, X, Y, Number);
- }
- END_LOOP;
- ROTATE(Element->MarkX, Element->MarkY, X, Y, Number);
- /* SetElementBoundingBox reenters the rtree data */
- SetElementBoundingBox(Data, Element, &PCB->Font);
- ClearFromPolygon(Data, PCB_TYPE_ELEMENT, Element, Element);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates a line's point
- */
-static void *RotateLinePoint(LayerTypePtr Layer, LineTypePtr Line, PointTypePtr Point)
-{
- EraseLine(Line);
- if (Layer) {
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- r_delete_entry(Layer->line_tree, (BoxTypePtr) Line);
- }
- else
- r_delete_entry(PCB->Data->rat_tree, (BoxTypePtr) Line);
- RotatePointLowLevel(Point, CenterX, CenterY, Number);
- SetLineBoundingBox(Line);
- if (Layer) {
- r_insert_entry(Layer->line_tree, (BoxTypePtr) Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- DrawLine(Layer, Line);
- }
- else {
- r_insert_entry(PCB->Data->rat_tree, (BoxTypePtr) Line, 0);
- DrawRat((RatTypePtr) Line);
- }
- Draw();
- return (Line);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates an arc
- */
-static void *RotateArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- EraseArc(Arc);
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) Arc);
- RotateArcLowLevel(Arc, CenterX, CenterY, Number);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) Arc, 0);
- DrawArc(Layer, Arc);
- Draw();
- return (Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates an element
- */
-static void *RotateElement(ElementTypePtr Element)
-{
- EraseElement(Element);
- RotateElementLowLevel(PCB->Data, Element, CenterX, CenterY, Number);
- DrawElement(Element);
- Draw();
- return (Element);
-}
-
-/* ----------------------------------------------------------------------
- * rotates the name of an element
- */
-static void *RotateElementName(ElementTypePtr Element)
-{
- EraseElementName(Element);
- ELEMENTTEXT_LOOP(Element);
- {
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- RotateTextLowLevel(text, CenterX, CenterY, Number);
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- DrawElementName(Element);
- Draw();
- return (Element);
-}
-
-/* ---------------------------------------------------------------------------
- * rotates a box in 90 degree steps
- */
-void RotateBoxLowLevel(BoxTypePtr Box, Coord X, Coord Y, unsigned Number)
-{
- Coord x1 = Box->X1, y1 = Box->Y1, x2 = Box->X2, y2 = Box->Y2;
-
- ROTATE(x1, y1, X, Y, Number);
- ROTATE(x2, y2, X, Y, Number);
- Box->X1 = MIN(x1, x2);
- Box->Y1 = MIN(y1, y2);
- Box->X2 = MAX(x1, x2);
- Box->Y2 = MAX(y1, y2);
+ PCB_COORD_ROTATE90(Point->X, Point->Y, X, Y, Number);
}
/* ----------------------------------------------------------------------
* rotates an objects at the cursor position as identified by its ID
* the center of rotation is determined by the current cursor location
*/
-void *RotateObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord X, Coord Y, unsigned Steps)
+void *pcb_obj_rotate90(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t X, pcb_coord_t Y, unsigned Steps)
{
- RubberbandTypePtr ptr;
void *ptr2;
- pcb_bool changed = pcb_false;
+ int changed = 0;
+ pcb_opctx_t ctx;
/* setup default global identifiers */
- Number = Steps;
- CenterX = X;
- CenterY = Y;
+ ctx.rotate.pcb = PCB;
+ ctx.rotate.number = Steps;
+ ctx.rotate.center_x = X;
+ ctx.rotate.center_y = Y;
- /* move all the rubberband lines... and reset the counter */
- ptr = Crosshair.AttachedObject.Rubberband;
- while (Crosshair.AttachedObject.RubberbandN) {
- changed = pcb_true;
- CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line);
- AddObjectToRotateUndoList(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, CenterX, CenterY, Steps);
- EraseLine(ptr->Line);
- if (ptr->Layer) {
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, ptr->Layer, ptr->Line);
- r_delete_entry(ptr->Layer->line_tree, (BoxType *) ptr->Line);
- }
- else
- r_delete_entry(PCB->Data->rat_tree, (BoxType *) ptr->Line);
- RotatePointLowLevel(ptr->MovedPoint, CenterX, CenterY, Steps);
- SetLineBoundingBox(ptr->Line);
- if (ptr->Layer) {
- r_insert_entry(ptr->Layer->line_tree, (BoxType *) ptr->Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, ptr->Layer, ptr->Line);
- DrawLine(ptr->Layer, ptr->Line);
- }
- else {
- r_insert_entry(PCB->Data->rat_tree, (BoxType *) ptr->Line, 0);
- DrawRat((RatTypePtr) ptr->Line);
- }
- Crosshair.AttachedObject.RubberbandN--;
- ptr++;
- }
- AddObjectToRotateUndoList(Type, Ptr1, Ptr2, Ptr3, CenterX, CenterY, Number);
- ptr2 = ObjectOperation(&RotateFunctions, Type, Ptr1, Ptr2, Ptr3);
+ pcb_event(PCB_EVENT_RUBBER_ROTATE90, "ipppccip", Type, Ptr1, Ptr2, Ptr2, ctx.rotate.center_x, ctx.rotate.center_y, ctx.rotate.number, &changed);
+
+ pcb_undo_add_obj_to_rotate(Type, Ptr1, Ptr2, Ptr3, ctx.rotate.center_x, ctx.rotate.center_y, ctx.rotate.number);
+ ptr2 = pcb_object_operation(&Rotate90Functions, &ctx, Type, Ptr1, Ptr2, Ptr3);
changed |= (ptr2 != NULL);
if (changed) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
return (ptr2);
}
-void RotateScreenObject(Coord X, Coord Y, unsigned Steps)
+void pcb_screen_obj_rotate90(pcb_coord_t X, pcb_coord_t Y, unsigned Steps)
{
int type;
void *ptr1, *ptr2, *ptr3;
- if ((type = SearchScreen(X, Y, ROTATE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
- if (TEST_FLAG(PCB_FLAG_LOCK, (ArcTypePtr) ptr2)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
+ if ((type = pcb_search_screen(X, Y, PCB_ROTATE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) {
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_arc_t *) ptr2)) {
+ pcb_message(PCB_MSG_WARNING, _("Sorry, the object is locked\n"));
return;
}
- Crosshair.AttachedObject.RubberbandN = 0;
+ pcb_event(PCB_EVENT_RUBBER_RESET, NULL);
if (conf_core.editor.rubber_band_mode)
- LookupRubberbandLines(type, ptr1, ptr2, ptr3);
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_LINES, "ippp", type, ptr1, ptr2, ptr3);
if (type == PCB_TYPE_ELEMENT)
- LookupRatLines(type, ptr1, ptr2, ptr3);
- RotateObject(type, ptr1, ptr2, ptr3, X, Y, Steps);
- SetChangedFlag(pcb_true);
+ pcb_event(PCB_EVENT_RUBBER_LOOKUP_RATS, "ippp", type, ptr1, ptr2, ptr3);
+ pcb_obj_rotate90(type, ptr1, ptr2, ptr3, X, Y, Steps);
+ pcb_board_set_changed_flag(pcb_true);
}
}
diff --git a/src/rotate.h b/src/rotate.h
index 5c75b3b..ad4998f 100644
--- a/src/rotate.h
+++ b/src/rotate.h
@@ -29,14 +29,15 @@
#ifndef PCB_ROTATE_H
#define PCB_ROTATE_H
-#include "global.h"
+#include "config.h"
+#include "global_typedefs.h"
/* ---------------------------------------------------------------------------
* some useful transformation macros and constants
*/
-#define ROTATE(x,y,x0,y0,n) \
- { \
- Coord dx = (x)-(x0), \
+#define PCB_COORD_ROTATE90(x,y,x0,y0,n) \
+ do { \
+ pcb_coord_t dx = (x)-(x0), \
dy = (y)-(y0); \
\
switch(n & 0x03) \
@@ -49,55 +50,25 @@
break; \
default: break; \
} \
- }
+ } while(0)
-/* Rotate pin shape style by n_in * 90 degrees */
-#define PIN_ROTATE(p,n_in) \
-do { \
- int _n_; \
- for(_n_ = n_in;_n_>0;_n_--) { \
- int _old_, _nw_ = 0; \
- _old_ = GET_SQUARE(p); \
- if ((_old_ > 1) && (_old_ < 17)) { \
- _old_--; \
- if (_old_ & 1) \
- _nw_ |= 8; \
- if (_old_ & 8) \
- _nw_ |= 2; \
- if (_old_ & 2) \
- _nw_ |= 4; \
- if (_old_ & 4) \
- _nw_ |= 1; \
- GET_SQUARE(p) = _nw_+1; \
- } \
- } \
-} while(0)
+#define PCB_ROTATE_TYPES (PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ARC | PCB_TYPE_LINE_POINT | PCB_TYPE_LINE)
-#define ROTATE_VIA_LOWLEVEL(v,x0,y0,n) \
-do { \
- ROTATE((v)->X,(v)->Y,(x0),(y0),(n)); \
- PIN_ROTATE(v, (n)); \
-} while(0)
+void *pcb_obj_rotate90(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, unsigned);
+void pcb_screen_obj_rotate90(pcb_coord_t, pcb_coord_t, unsigned);
+void pcb_point_rotate90(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number);
-#define ROTATE_PIN_LOWLEVEL(p,x0,y0,n) \
-do { \
- ROTATE((p)->X,(p)->Y,(x0),(y0),(n)); \
- PIN_ROTATE((p), (n)); \
-} while(0)
+static inline PCB_FUNC_UNUSED void pcb_rotate(pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t cx, pcb_coord_t cy, double cosa, double sina)
+{
+ double nx, ny;
+ pcb_coord_t px = *x - cx;
+ pcb_coord_t py = *y - cy;
-#define ROTATE_PAD_LOWLEVEL(p,x0,y0,n) \
- RotateLineLowLevel(((LineTypePtr) (p)),(x0),(y0),(n))
+ nx = px * cosa + py * sina;
+ ny = py * cosa - px * sina;
-#define ROTATE_TYPES (PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ARC)
-
-
-void RotateLineLowLevel(LineTypePtr, Coord, Coord, unsigned);
-void RotateArcLowLevel(ArcTypePtr, Coord, Coord, unsigned);
-void RotateBoxLowLevel(BoxTypePtr, Coord, Coord, unsigned);
-void RotateTextLowLevel(TextTypePtr, Coord, Coord, unsigned);
-void RotatePolygonLowLevel(PolygonTypePtr, Coord, Coord, unsigned);
-void RotateElementLowLevel(DataTypePtr, ElementTypePtr, Coord, Coord, unsigned);
-void *RotateObject(int, void *, void *, void *, Coord, Coord, unsigned);
-void RotateScreenObject(Coord, Coord, unsigned);
+ *x = nx + cx;
+ *y = ny + cy;
+}
#endif
diff --git a/src/route_style.c b/src/route_style.c
index 8ea0b97..76c81d7 100644
--- a/src/route_style.c
+++ b/src/route_style.c
@@ -24,24 +24,28 @@
* Thomas.Nau at rz.uni-ulm.de
*
*/
+#include <ctype.h>
#include "config.h"
-#include "global.h"
#include "pcb-printf.h"
#include "genvector/gds_char.h"
#include "route_style.h"
-#include "misc.h"
#include "error.h"
#include "conf.h"
+#include "misc_util.h"
+#include "board.h"
+#include "funchash_core.h"
+#include "conf_core.h"
+#include "compat_nls.h"
-RouteStyleType pcb_custom_route_style;
+pcb_route_style_t pcb_custom_route_style;
/*! \brief Serializes the route style list
* \par Function Description
* Right now n_styles should always be set to NUM_STYLES,
- * since that is the number of route styles ParseRouteString()
+ * since that is the number of route styles pcb_route_string_parse()
* expects to parse.
*/
-char *make_route_string(vtroutestyle_t *styles)
+char *pcb_route_string_make(vtroutestyle_t *styles)
{
gds_t str;
int i;
@@ -62,7 +66,7 @@ char *make_route_string(vtroutestyle_t *styles)
* comma separated Name, Dimension, Dimension, Dimension, Dimension
* e.g. Signal,20,40,20,10:Power,40,60,28,10:...
*/
-int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *default_unit)
+int pcb_route_string_parse1(char **str, pcb_route_style_t *routeStyle, const char *default_unit)
{
char *s = *str;
char Name[256];
@@ -77,13 +81,13 @@ int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *de
if (len > sizeof(routeStyle->name)-1) {
memcpy(routeStyle->name, Name, sizeof(routeStyle->name)-1);
routeStyle->name[sizeof(routeStyle->name)-1] = '\0';
- Message(PCB_MSG_DEFAULT, "Route style name '%s' too long, truncated to '%s'\n", Name, routeStyle->name);
+ pcb_message(PCB_MSG_WARNING, "Route style name '%s' too long, truncated to '%s'\n", Name, routeStyle->name);
}
else
strcpy(routeStyle->name, Name);
if (!isdigit((int) *++s))
goto error;
- routeStyle->Thick = GetNum(&s, default_unit);
+ routeStyle->Thick = pcb_get_num(&s, default_unit);
while (*s && isspace((int) *s))
s++;
if (*s++ != ',')
@@ -92,7 +96,7 @@ int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *de
s++;
if (!isdigit((int) *s))
goto error;
- routeStyle->Diameter = GetNum(&s, default_unit);
+ routeStyle->Diameter = pcb_get_num(&s, default_unit);
while (*s && isspace((int) *s))
s++;
if (*s++ != ',')
@@ -101,7 +105,7 @@ int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *de
s++;
if (!isdigit((int) *s))
goto error;
- routeStyle->Hole = GetNum(&s, default_unit);
+ routeStyle->Hole = pcb_get_num(&s, default_unit);
/* for backwards-compatibility, we use a 10-mil default
* for styles which omit the clearance specification. */
if (*s != ',')
@@ -112,7 +116,7 @@ int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *de
s++;
if (!isdigit((int) *s))
goto error;
- routeStyle->Clearance = GetNum(&s, default_unit);
+ routeStyle->Clearance = pcb_get_num(&s, default_unit);
while (*s && isspace((int) *s))
s++;
}
@@ -124,14 +128,14 @@ int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *de
return -1;
}
-int ParseRouteString(char *s, vtroutestyle_t *styles, const char *default_unit)
+int pcb_route_string_parse(char *s, vtroutestyle_t *styles, const char *default_unit)
{
int n;
vtroutestyle_truncate(styles, 0);
for(n = 0;;n++) {
vtroutestyle_enlarge(styles, n+1);
- if (ParseRoutingString1(&s, &styles->array[n], default_unit) != 0) {
+ if (pcb_route_string_parse1(&s, &styles->array[n], default_unit) != 0) {
n--;
break;
}
@@ -148,12 +152,13 @@ int ParseRouteString(char *s, vtroutestyle_t *styles, const char *default_unit)
return 0;
}
-void pcb_use_route_style(RouteStyleType * rst)
+void pcb_use_route_style(pcb_route_style_t * rst)
{
conf_set_design("design/line_thickness", "%$mS", rst->Thick);
conf_set_design("design/via_thickness", "%$mS", rst->Diameter);
conf_set_design("design/via_drilling_hole", "%$mS", rst->Hole);
conf_set_design("design/clearance", "%$mS", rst->Clearance);
+ PCB->pen_attr = &rst->attr;
}
int pcb_use_route_style_idx(vtroutestyle_t *styles, int idx)
@@ -166,7 +171,7 @@ int pcb_use_route_style_idx(vtroutestyle_t *styles, int idx)
#define cmp(a,b) (((a) != 0) && (coord_abs((a)-(b)) > 32))
#define cmps(a,b) (((a) != NULL) && (strcmp((a), (b)) != 0))
-int pcb_route_style_lookup(vtroutestyle_t *styles, Coord Thick, Coord Diameter, Coord Hole, Coord Clearance, char *Name)
+int pcb_route_style_lookup(vtroutestyle_t *styles, pcb_coord_t Thick, pcb_coord_t Diameter, pcb_coord_t Hole, pcb_coord_t Clearance, char *Name)
{
int n;
for (n = 0; n < vtroutestyle_len(styles); n++) {
@@ -181,3 +186,51 @@ int pcb_route_style_lookup(vtroutestyle_t *styles, Coord Thick, Coord Diameter,
}
#undef cmp
+
+int pcb_get_style_size(int funcid, pcb_coord_t * out, int type, int size_id)
+{
+ switch (funcid) {
+ case F_Object:
+ switch (type) {
+ case PCB_TYPE_ELEMENT: /* we'd set pin/pad properties, so fall thru */
+ case PCB_TYPE_VIA:
+ case PCB_TYPE_PIN:
+ return pcb_get_style_size(F_SelectedVias, out, 0, size_id);
+ case PCB_TYPE_PAD:
+ return pcb_get_style_size(F_SelectedPads, out, 0, size_id);
+ case PCB_TYPE_LINE:
+ return pcb_get_style_size(F_SelectedLines, out, 0, size_id);
+ case PCB_TYPE_ARC:
+ return pcb_get_style_size(F_SelectedArcs, out, 0, size_id);
+ }
+ pcb_message(PCB_MSG_ERROR, _("Sorry, can't fetch the style of that object type (%x)\n"), type);
+ return -1;
+ case F_SelectedPads:
+ if (size_id != 2) /* don't mess with pad size */
+ return -1;
+ case F_SelectedVias:
+ case F_SelectedPins:
+ case F_SelectedObjects:
+ case F_Selected:
+ case F_SelectedElements:
+ if (size_id == 0)
+ *out = conf_core.design.via_thickness;
+ else if (size_id == 1)
+ *out = conf_core.design.via_drilling_hole;
+ else
+ *out = conf_core.design.clearance;
+ break;
+ case F_SelectedArcs:
+ case F_SelectedLines:
+ if (size_id == 2)
+ *out = conf_core.design.clearance;
+ else
+ *out = conf_core.design.line_thickness;
+ return 0;
+ case F_SelectedTexts:
+ case F_SelectedNames:
+ pcb_message(PCB_MSG_ERROR, _("Sorry, can't change style of every selected object\n"));
+ return -1;
+ }
+ return 0;
+}
diff --git a/src/route_style.h b/src/route_style.h
index 6657c03..2ddf87a 100644
--- a/src/route_style.h
+++ b/src/route_style.h
@@ -25,18 +25,20 @@
*
*/
-/* Parse a single route string into one RouteStyleTypePtr slot. Returns 0 on success. */
-int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *default_unit);
+#include "vtroutestyle.h"
+
+/* Parse a single route string into one pcb_route_style_t *slot. Returns 0 on success. */
+int pcb_route_string_parse1(char **str, pcb_route_style_t *routeStyle, const char *default_unit);
/* Parse a ':' separated list of route strings into a styles vector
The vector is initialized before the call. On error the vector is left empty
(but still initialized). Returns 0 on success. */
-int ParseRouteString(char *s, vtroutestyle_t *styles, const char *default_unit);
+int pcb_route_string_parse(char *s, vtroutestyle_t *styles, const char *default_unit);
-char *make_route_string(vtroutestyle_t *styles);
+char *pcb_route_string_make(vtroutestyle_t *styles);
/* Set design configuration (the pen we draw with) to a given route style */
-void pcb_use_route_style(RouteStyleType *rst);
+void pcb_use_route_style(pcb_route_style_t *rst);
/* Same as pcb_use_route_style() but uses one of the styles in a vector;
returns -1 if idx is out of bounds, 0 on success. */
@@ -45,6 +47,10 @@ int pcb_use_route_style_idx(vtroutestyle_t *styles, int idx);
/* Compare supplied parameters to each style in the vector and return the index
of the first matching style. All non-0 parameters need to match to accept
a style. Return -1 on no match. */
-int pcb_route_style_lookup(vtroutestyle_t *styles, Coord Thick, Coord Diameter, Coord Hole, Coord Clearance, char *Name);
+int pcb_route_style_lookup(vtroutestyle_t *styles, pcb_coord_t Thick, pcb_coord_t Diameter, pcb_coord_t Hole, pcb_coord_t Clearance, char *Name);
+
+extern pcb_route_style_t pcb_custom_route_style;
-extern RouteStyleType pcb_custom_route_style;
+/* helper: get route style size for a function and selected object type.
+ size_id: 0=main size; 1=2nd size (drill); 2=clearance */
+int pcb_get_style_size(int funcid, pcb_coord_t * out, int type, int size_id);
diff --git a/src/rtree.c b/src/rtree.c
index 308abd4..017a7ab 100644
--- a/src/rtree.c
+++ b/src/rtree.c
@@ -36,10 +36,16 @@
*/
#include "config.h"
+#include <stdlib.h>
+#include <stdio.h>
#include <assert.h>
#include <setjmp.h>
+#include "math_helper.h"
+#include "compat_cc.h"
#include "rtree.h"
+#include "obj_common.h"
+#include "macro.h"
#define SLOW_ASSERTS
/* All rectangles are closed on the bottom left and open on the
@@ -61,12 +67,12 @@
#define DELETE_BY_POINTER
typedef struct {
- const BoxType *bptr; /* pointer to the box */
- BoxType bounds; /* copy of the box for locality of reference */
+ const pcb_box_t *bptr; /* pointer to the box */
+ pcb_box_t bounds; /* copy of the box for locality of reference */
} Rentry;
struct rtree_node {
- BoxType box; /* bounds rectangle of this node */
+ pcb_box_t box; /* bounds rectangle of this node */
struct rtree_node *parent; /* parent of this node, NULL = root */
struct {
unsigned is_leaf:1; /* this is a leaf node */
@@ -187,7 +193,7 @@ static pcb_bool __r_tree_is_good(struct rtree_node *node)
#ifndef NDEBUG
/* print out the tree */
-void __r_dump_tree(struct rtree_node *node, int depth)
+void pcb_r_dump_tree(struct rtree_node *node, int depth)
{
int i, j;
static int count;
@@ -224,7 +230,7 @@ void __r_dump_tree(struct rtree_node *node, int depth)
}
for (i = 0; i < M_SIZE; i++)
if (node->u.kids[i])
- __r_dump_tree(node->u.kids[i], depth + 1);
+ pcb_r_dump_tree(node->u.kids[i], depth + 1);
if (depth == 0)
printf("average box area is %g\n", area / count);
}
@@ -234,7 +240,7 @@ void __r_dump_tree(struct rtree_node *node, int depth)
* according to the largest side.
*/
#ifdef SORT
-static int cmp_box(const BoxType * a, const BoxType * b)
+static int cmp_box(const pcb_box_t * a, const pcb_box_t * b)
{
/* compare two box coordinates so that the __r_search
* will fail at the earliest comparison possible.
@@ -311,10 +317,10 @@ static void adjust_bounds(struct rtree_node *node)
for (i = 1; i < M_SIZE + 1; i++) {
if (!node->u.rects[i].bptr)
return;
- MAKEMIN(node->box.X1, node->u.rects[i].bounds.X1);
- MAKEMAX(node->box.X2, node->u.rects[i].bounds.X2);
- MAKEMIN(node->box.Y1, node->u.rects[i].bounds.Y1);
- MAKEMAX(node->box.Y2, node->u.rects[i].bounds.Y2);
+ PCB_MAKE_MIN(node->box.X1, node->u.rects[i].bounds.X1);
+ PCB_MAKE_MAX(node->box.X2, node->u.rects[i].bounds.X2);
+ PCB_MAKE_MIN(node->box.Y1, node->u.rects[i].bounds.Y1);
+ PCB_MAKE_MAX(node->box.Y2, node->u.rects[i].bounds.Y2);
}
}
else {
@@ -322,10 +328,10 @@ static void adjust_bounds(struct rtree_node *node)
for (i = 1; i < M_SIZE + 1; i++) {
if (!node->u.kids[i])
return;
- MAKEMIN(node->box.X1, node->u.kids[i]->box.X1);
- MAKEMAX(node->box.X2, node->u.kids[i]->box.X2);
- MAKEMIN(node->box.Y1, node->u.kids[i]->box.Y1);
- MAKEMAX(node->box.Y2, node->u.kids[i]->box.Y2);
+ PCB_MAKE_MIN(node->box.X1, node->u.kids[i]->box.X1);
+ PCB_MAKE_MAX(node->box.X2, node->u.kids[i]->box.X2);
+ PCB_MAKE_MIN(node->box.Y1, node->u.kids[i]->box.Y1);
+ PCB_MAKE_MAX(node->box.Y2, node->u.kids[i]->box.Y2);
}
}
}
@@ -335,14 +341,14 @@ static void adjust_bounds(struct rtree_node *node)
* it, so don't free the box list until you've called r_destroy_tree.
* if you set 'manage' to pcb_true, r_destroy_tree will free your boxlist.
*/
-rtree_t *r_create_tree(const BoxType * boxlist[], int N, int manage)
+pcb_rtree_t *pcb_r_create_tree(const pcb_box_t * boxlist[], int N, int manage)
{
- rtree_t *rtree;
+ pcb_rtree_t *rtree;
struct rtree_node *node;
int i;
assert(N >= 0);
- rtree = (rtree_t *) calloc(1, sizeof(*rtree));
+ rtree = (pcb_rtree_t *) calloc(1, sizeof(*rtree));
/* start with a single empty leaf node */
node = (struct rtree_node *) calloc(1, sizeof(*node));
node->flags.is_leaf = 1;
@@ -351,7 +357,7 @@ rtree_t *r_create_tree(const BoxType * boxlist[], int N, int manage)
/* simple, just insert all of the boxes! */
for (i = 0; i < N; i++) {
assert(boxlist[i]);
- r_insert_entry(rtree, boxlist[i], manage);
+ pcb_r_insert_entry(rtree, boxlist[i], manage);
}
#ifdef SLOW_ASSERTS
assert(__r_tree_is_good(rtree->root));
@@ -381,7 +387,7 @@ static void __r_destroy_tree(struct rtree_node *node)
}
/* free the memory associated with an rtree. */
-void r_destroy_tree(rtree_t ** rtree)
+void pcb_r_destroy_tree(pcb_rtree_t ** rtree)
{
__r_destroy_tree((*rtree)->root);
@@ -390,8 +396,8 @@ void r_destroy_tree(rtree_t ** rtree)
}
typedef struct {
- r_dir_t (*check_it) (const BoxType * region, void *cl);
- r_dir_t (*found_it) (const BoxType * box, void *cl);
+ pcb_r_dir_t (*check_it) (const pcb_box_t * region, void *cl);
+ pcb_r_dir_t (*found_it) (const pcb_box_t * box, void *cl);
void *closure;
int cancel;
} r_arg;
@@ -400,9 +406,9 @@ typedef struct {
* so some careful thought has been given to maximizing the speed
*
*/
-int __r_search(struct rtree_node *node, const BoxType * query, r_arg * arg)
+int __r_search(struct rtree_node *node, const pcb_box_t * query, r_arg * arg)
{
- r_dir_t res;
+ pcb_r_dir_t res;
assert(node);
/** assert that starting_region is well formed */
@@ -426,11 +432,11 @@ int __r_search(struct rtree_node *node, const BoxType * query, r_arg * arg)
(node->u.rects[i].bounds.Y1 < query->Y2) &&
(node->u.rects[i].bounds.Y2 > query->Y1)) {
res = arg->found_it(node->u.rects[i].bptr, arg->closure);
- if (res == R_DIR_CANCEL) {
+ if (res == PCB_R_DIR_CANCEL) {
arg->cancel = 1;
return seen;
}
- if (res != R_DIR_NOT_FOUND)
+ if (res != PCB_R_DIR_NOT_FOUND)
seen++;
}
}
@@ -458,7 +464,7 @@ int __r_search(struct rtree_node *node, const BoxType * query, r_arg * arg)
(*n)->box.Y1 >= query->Y2 || (*n)->box.Y2 <= query->Y1)
continue;
res = arg->check_it(&(*n)->box, arg->closure);
- if (res == R_DIR_CANCEL) {
+ if (res == PCB_R_DIR_CANCEL) {
arg->cancel = 1;
return seen;
}
@@ -491,10 +497,10 @@ int __r_search(struct rtree_node *node, const BoxType * query, r_arg * arg)
* to see whether deeper searching is desired
* Returns how the search ended.
*/
-r_dir_t
-r_search(rtree_t * rtree, const BoxType * query,
- r_dir_t (*check_region) (const BoxType * region, void *cl),
- r_dir_t (*found_rectangle) (const BoxType * box, void *cl), void *cl,
+pcb_r_dir_t
+pcb_r_search(pcb_rtree_t * rtree, const pcb_box_t * query,
+ pcb_r_dir_t (*check_region) (const pcb_box_t * region, void *cl),
+ pcb_r_dir_t (*found_rectangle) (const pcb_box_t * box, void *cl), void *cl,
int *num_found)
{
r_arg arg;
@@ -533,28 +539,28 @@ ret:;
if (num_found != NULL)
*num_found = res;
if (arg.cancel)
- return R_DIR_CANCEL;
+ return PCB_R_DIR_CANCEL;
if (res == 0)
- return R_DIR_NOT_FOUND;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_NOT_FOUND;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
/*------ r_region_is_empty ------*/
-static r_dir_t __r_region_is_empty_rect_in_reg(const BoxType * box, void *cl)
+static pcb_r_dir_t __r_region_is_empty_rect_in_reg(const pcb_box_t * box, void *cl)
{
jmp_buf *envp = (jmp_buf *) cl;
longjmp(*envp, 1); /* found one! */
}
/* return 0 if there are any rectangles in the given region. */
-int r_region_is_empty(rtree_t * rtree, const BoxType * region)
+int pcb_r_region_is_empty(pcb_rtree_t * rtree, const pcb_box_t * region)
{
jmp_buf env;
int r;
if (setjmp(env))
return 0;
- r_search(rtree, region, NULL, __r_region_is_empty_rect_in_reg, &env, &r);
+ pcb_r_search(rtree, region, NULL, __r_region_is_empty_rect_in_reg, &env, &r);
assert(r == 0); /* otherwise longjmp would have been called */
return 1; /* no rectangles found */
}
@@ -576,7 +582,7 @@ struct rtree_node *find_clusters(struct rtree_node *node)
int a_manage = 0, b_manage = 0;
int i, old_ax, old_ay, old_bx, old_by;
struct rtree_node *new_node;
- BoxType *b;
+ pcb_box_t *b;
for (i = 0; i < M_SIZE + 1; i++) {
if (node->flags.is_leaf)
@@ -608,8 +614,8 @@ struct rtree_node *find_clusters(struct rtree_node *node)
for (i = 0; i < M_SIZE + 1; i++) {
float dist1, dist2;
- dist1 = SQUARE(a_X - center[i].x) + SQUARE(a_Y - center[i].y);
- dist2 = SQUARE(b_X - center[i].x) + SQUARE(b_Y - center[i].y);
+ dist1 = PCB_SQUARE(a_X - center[i].x) + PCB_SQUARE(a_Y - center[i].y);
+ dist2 = PCB_SQUARE(b_X - center[i].x) + PCB_SQUARE(b_Y - center[i].y);
if (dist1 * (clust_a + M_SIZE / 2) < dist2 * (clust_b + M_SIZE / 2)) {
belong[i] = pcb_true;
clust_a++;
@@ -748,7 +754,7 @@ static void split_node(struct rtree_node *node)
split_node(node->parent);
}
-static inline int contained(struct rtree_node *node, const BoxType * query)
+static inline int contained(struct rtree_node *node, const pcb_box_t * query)
{
if (node->box.X1 > query->X1 || node->box.X2 < query->X2 || node->box.Y1 > query->Y1 || node->box.Y2 < query->Y2)
return 0;
@@ -756,7 +762,7 @@ static inline int contained(struct rtree_node *node, const BoxType * query)
}
-static inline double penalty(struct rtree_node *node, const BoxType * query)
+static inline double penalty(struct rtree_node *node, const pcb_box_t * query)
{
double score;
@@ -770,7 +776,7 @@ static inline double penalty(struct rtree_node *node, const BoxType * query)
return score;
}
-static void __r_insert_node(struct rtree_node *node, const BoxType * query, int manage, pcb_bool force)
+static void __r_insert_node(struct rtree_node *node, const pcb_box_t * query, int manage, pcb_bool force)
{
#ifdef SLOW_ASSERTS
@@ -784,7 +790,7 @@ static void __r_insert_node(struct rtree_node *node, const BoxType * query, int
if (node->flags.is_leaf) {
register int i;
- if (UNLIKELY(manage)) {
+ if (PCB_UNLIKELY(manage)) {
register int flag = 1;
for (i = 0; i < M_SIZE; i++) {
@@ -806,10 +812,10 @@ static void __r_insert_node(struct rtree_node *node, const BoxType * query, int
if (i == 0)
node->box = *query;
else if (force) {
- MAKEMIN(node->box.X1, query->X1);
- MAKEMAX(node->box.X2, query->X2);
- MAKEMIN(node->box.Y1, query->Y1);
- MAKEMAX(node->box.Y2, query->Y2);
+ PCB_MAKE_MIN(node->box.X1, query->X1);
+ PCB_MAKE_MAX(node->box.X2, query->X2);
+ PCB_MAKE_MIN(node->box.Y1, query->Y1);
+ PCB_MAKE_MAX(node->box.Y2, query->Y2);
}
if (i < M_SIZE) {
sort_node(node);
@@ -825,10 +831,10 @@ static void __r_insert_node(struct rtree_node *node, const BoxType * query, int
double score, best_score;
if (force) {
- MAKEMIN(node->box.X1, query->X1);
- MAKEMAX(node->box.X2, query->X2);
- MAKEMIN(node->box.Y1, query->Y1);
- MAKEMAX(node->box.Y2, query->Y2);
+ PCB_MAKE_MIN(node->box.X1, query->X1);
+ PCB_MAKE_MAX(node->box.X2, query->X2);
+ PCB_MAKE_MIN(node->box.Y1, query->Y1);
+ PCB_MAKE_MAX(node->box.Y2, query->Y2);
}
/* this node encloses it, but it's not a leaf, so descend the tree */
@@ -855,7 +861,7 @@ static void __r_insert_node(struct rtree_node *node, const BoxType * query, int
new_node->u.rects[0].bptr = query;
new_node->u.rects[0].bounds = *query;
new_node->box = *query;
- if (UNLIKELY(manage))
+ if (PCB_UNLIKELY(manage))
new_node->flags.manage = 1;
sort_node(node);
return;
@@ -879,7 +885,7 @@ static void __r_insert_node(struct rtree_node *node, const BoxType * query, int
}
}
-void r_insert_entry(rtree_t * rtree, const BoxType * which, int man)
+void pcb_r_insert_entry(pcb_rtree_t * rtree, const pcb_box_t * which, int man)
{
assert(which);
assert(which->X1 <= which->X2);
@@ -892,7 +898,7 @@ void r_insert_entry(rtree_t * rtree, const BoxType * which, int man)
rtree->size++;
}
-pcb_bool __r_delete(struct rtree_node *node, const BoxType * query)
+pcb_bool __r_delete(struct rtree_node *node, const pcb_box_t * query)
{
int i, flag, mask, a;
@@ -983,7 +989,7 @@ pcb_bool __r_delete(struct rtree_node *node, const BoxType * query)
return pcb_true;
}
-pcb_bool r_delete_entry(rtree_t * rtree, const BoxType * box)
+pcb_bool pcb_r_delete_entry(pcb_rtree_t * rtree, const pcb_box_t * box)
{
pcb_bool r;
diff --git a/src/rtree.h b/src/rtree.h
index f4d48a2..42437eb 100644
--- a/src/rtree.h
+++ b/src/rtree.h
@@ -28,32 +28,34 @@
*
*/
-
-
-/* prototypes for r-tree routines.
- */
+/* r-tree: efficient lookup of screenobjects */
#ifndef PCB_RTREE_H
#define PCB_RTREE_H
-#include "global.h"
+#include "global_typedefs.h"
+
+struct pcb_rtree_s {
+ struct rtree_node *root;
+ int size; /* number of entries in tree */
+};
/* callback direction to the search engine */
-typedef enum r_dir_e {
- R_DIR_NOT_FOUND = 0, /* object not found or not accepted */
- R_DIR_FOUND_CONTINUE = 1, /* object found or accepted, go on searching */
- R_DIR_CANCEL /* cancel the search and return immediately */
-} r_dir_t;
+typedef enum pcb_r_dir_e {
+ PCB_R_DIR_NOT_FOUND = 0, /* object not found or not accepted */
+ PCB_R_DIR_FOUND_CONTINUE = 1, /* object found or accepted, go on searching */
+ PCB_R_DIR_CANCEL /* cancel the search and return immediately */
+} pcb_r_dir_t;
/* create an rtree from the list of boxes. if 'manage' is pcb_true, then
* the tree will take ownership of 'boxlist' and free it when the tree
* is destroyed. */
-rtree_t *r_create_tree(const BoxType * boxlist[], int N, int manage);
+pcb_rtree_t *pcb_r_create_tree(const pcb_box_t * boxlist[], int N, int manage);
/* destroy an rtree */
-void r_destroy_tree(rtree_t ** rtree);
+void pcb_r_destroy_tree(pcb_rtree_t ** rtree);
-pcb_bool r_delete_entry(rtree_t * rtree, const BoxType * which);
-void r_insert_entry(rtree_t * rtree, const BoxType * which, int manage);
+pcb_bool pcb_r_delete_entry(pcb_rtree_t * rtree, const pcb_box_t * which);
+void pcb_r_insert_entry(pcb_rtree_t * rtree, const pcb_box_t * which, int manage);
/* generic search routine */
/* region_in_search should return pcb_true if "what you're looking for" is
@@ -64,20 +66,20 @@ void r_insert_entry(rtree_t * rtree, const BoxType * which, int manage);
* The search will find all rectangles matching the criteria given
* by region_in_search and rectangle_in_region and return a count of
* how many things rectangle_in_region returned pcb_true for. closure is
- * used to abort the search if desired from within rectangel_in_region
+ * used to abort the search if desired from within rectangle_in_region
* Look at the implementation of r_region_is_empty for how to
* abort the search if that is the desired behavior.
*/
-r_dir_t r_search(rtree_t * rtree, const BoxType * starting_region,
- r_dir_t (*region_in_search) (const BoxType * region, void *cl),
- r_dir_t (*rectangle_in_region) (const BoxType * box, void *cl), void *closure,
+pcb_r_dir_t pcb_r_search(pcb_rtree_t * rtree, const pcb_box_t * starting_region,
+ pcb_r_dir_t (*region_in_search) (const pcb_box_t * region, void *cl),
+ pcb_r_dir_t (*rectangle_in_region) (const pcb_box_t * box, void *cl), void *closure,
int *num_found);
/* -- special-purpose searches build upon r_search -- */
/* return 0 if there are any rectangles in the given region. */
-int r_region_is_empty(rtree_t * rtree, const BoxType * region);
+int pcb_r_region_is_empty(pcb_rtree_t * rtree, const pcb_box_t * region);
-void __r_dump_tree(struct rtree_node *, int);
+void pcb_r_dump_tree(struct rtree_node *, int);
#endif
diff --git a/src/rubberband.c b/src/rubberband.c
deleted file mode 100644
index 14a9512..0000000
--- a/src/rubberband.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-
-/* functions used by 'rubberband moves' */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <memory.h>
-#include <math.h>
-
-#include "create.h"
-#include "data.h"
-#include "error.h"
-#include "misc.h"
-#include "layer.h"
-#include "polygon.h"
-#include "rtree.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void CheckPadForRubberbandConnection(PadTypePtr);
-static void CheckPinForRubberbandConnection(PinTypePtr);
-static void CheckLinePointForRubberbandConnection(LayerTypePtr, LineTypePtr, PointTypePtr, pcb_bool);
-static void CheckPolygonForRubberbandConnection(LayerTypePtr, PolygonTypePtr);
-static void CheckLinePointForRat(LayerTypePtr, PointTypePtr);
-static r_dir_t rubber_callback(const BoxType * b, void *cl);
-
-struct rubber_info {
- Coord radius;
- Coord X, Y;
- LineTypePtr line;
- BoxType box;
- LayerTypePtr layer;
-};
-
-static r_dir_t rubber_callback(const BoxType * b, void *cl)
-{
- LineTypePtr line = (LineTypePtr) b;
- struct rubber_info *i = (struct rubber_info *) cl;
- double x, y, rad, dist1, dist2;
- Coord t;
- int touches = 0;
-
- t = line->Thickness / 2;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, line))
- return R_DIR_NOT_FOUND;
- if (line == i->line)
- return R_DIR_NOT_FOUND;
- /*
- * Check to see if the line touches a rectangular region.
- * To do this we need to look for the intersection of a circular
- * region and a rectangular region.
- */
- if (i->radius == 0) {
- int found = 0;
-
- if (line->Point1.X + t >= i->box.X1 && line->Point1.X - t <= i->box.X2
- && line->Point1.Y + t >= i->box.Y1 && line->Point1.Y - t <= i->box.Y2) {
- if (((i->box.X1 <= line->Point1.X) &&
- (line->Point1.X <= i->box.X2)) || ((i->box.Y1 <= line->Point1.Y) && (line->Point1.Y <= i->box.Y2))) {
- /*
- * The circle is positioned such that the closest point
- * on the rectangular region boundary is not at a corner
- * of the rectangle. i.e. the shortest line from circle
- * center to rectangle intersects the rectangle at 90
- * degrees. In this case our first test is sufficient
- */
- touches = 1;
- }
- else {
- /*
- * Now we must check the distance from the center of the
- * circle to the corners of the rectangle since the
- * closest part of the rectangular region is the corner.
- */
- x = MIN(coord_abs(i->box.X1 - line->Point1.X), coord_abs(i->box.X2 - line->Point1.X));
- x *= x;
- y = MIN(coord_abs(i->box.Y1 - line->Point1.Y), coord_abs(i->box.Y2 - line->Point1.Y));
- y *= y;
- x = x + y - (t * t);
-
- if (x <= 0)
- touches = 1;
- }
- if (touches) {
- CreateNewRubberbandEntry(i->layer, line, &line->Point1);
- found++;
- }
- }
- if (line->Point2.X + t >= i->box.X1 && line->Point2.X - t <= i->box.X2
- && line->Point2.Y + t >= i->box.Y1 && line->Point2.Y - t <= i->box.Y2) {
- if (((i->box.X1 <= line->Point2.X) &&
- (line->Point2.X <= i->box.X2)) || ((i->box.Y1 <= line->Point2.Y) && (line->Point2.Y <= i->box.Y2))) {
- touches = 1;
- }
- else {
- x = MIN(coord_abs(i->box.X1 - line->Point2.X), coord_abs(i->box.X2 - line->Point2.X));
- x *= x;
- y = MIN(coord_abs(i->box.Y1 - line->Point2.Y), coord_abs(i->box.Y2 - line->Point2.Y));
- y *= y;
- x = x + y - (t * t);
-
- if (x <= 0)
- touches = 1;
- }
- if (touches) {
- CreateNewRubberbandEntry(i->layer, line, &line->Point2);
- found++;
- }
- }
- return found ? R_DIR_FOUND_CONTINUE : R_DIR_NOT_FOUND;
- }
- /* circular search region */
- if (i->radius < 0)
- rad = 0; /* require exact match */
- else
- rad = SQUARE(i->radius + t);
-
- x = (i->X - line->Point1.X);
- x *= x;
- y = (i->Y - line->Point1.Y);
- y *= y;
- dist1 = x + y - rad;
-
- x = (i->X - line->Point2.X);
- x *= x;
- y = (i->Y - line->Point2.Y);
- y *= y;
- dist2 = x + y - rad;
-
- if (dist1 > 0 && dist2 > 0)
- return R_DIR_NOT_FOUND;
-
-#ifdef CLOSEST_ONLY /* keep this to remind me */
- if (dist1 < dist2)
- CreateNewRubberbandEntry(i->layer, line, &line->Point1);
- else
- CreateNewRubberbandEntry(i->layer, line, &line->Point2);
-#else
- if (dist1 <= 0)
- CreateNewRubberbandEntry(i->layer, line, &line->Point1);
- if (dist2 <= 0)
- CreateNewRubberbandEntry(i->layer, line, &line->Point2);
-#endif
- return R_DIR_FOUND_CONTINUE;
-}
-
-/* ---------------------------------------------------------------------------
- * checks all visible lines which belong to the same layergroup as the
- * passed pad. If one of the endpoints of the line lays inside the pad,
- * the line is added to the 'rubberband' list
- */
-static void CheckPadForRubberbandConnection(PadTypePtr Pad)
-{
- Coord half = Pad->Thickness / 2;
- pcb_cardinal_t i, group;
- struct rubber_info info;
-
- info.box.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - half;
- info.box.Y1 = MIN(Pad->Point1.Y, Pad->Point2.Y) - half;
- info.box.X2 = MAX(Pad->Point1.X, Pad->Point2.X) + half;
- info.box.Y2 = MAX(Pad->Point1.Y, Pad->Point2.Y) + half;
- info.radius = 0;
- info.line = NULL;
- i = TEST_FLAG(PCB_FLAG_ONSOLDER, Pad) ? solder_silk_layer : component_silk_layer;
- group = GetLayerGroupNumberByNumber(i);
-
- /* check all visible layers in the same group */
- GROUP_LOOP(PCB->Data, group);
- {
- /* check all visible lines of the group member */
- info.layer = layer;
- if (info.layer->On) {
- r_search(info.layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
- }
- }
- END_LOOP;
-}
-
-struct rinfo {
- int type;
- pcb_cardinal_t group;
- PinTypePtr pin;
- PadTypePtr pad;
- PointTypePtr point;
-};
-
-static r_dir_t rat_callback(const BoxType * box, void *cl)
-{
- RatTypePtr rat = (RatTypePtr) box;
- struct rinfo *i = (struct rinfo *) cl;
-
- switch (i->type) {
- case PCB_TYPE_PIN:
- if (rat->Point1.X == i->pin->X && rat->Point1.Y == i->pin->Y)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point1);
- else if (rat->Point2.X == i->pin->X && rat->Point2.Y == i->pin->Y)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point2);
- break;
- case PCB_TYPE_PAD:
- if (rat->Point1.X == i->pad->Point1.X && rat->Point1.Y == i->pad->Point1.Y && rat->group1 == i->group)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point1);
- else if (rat->Point2.X == i->pad->Point1.X && rat->Point2.Y == i->pad->Point1.Y && rat->group2 == i->group)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point2);
- else if (rat->Point1.X == i->pad->Point2.X && rat->Point1.Y == i->pad->Point2.Y && rat->group1 == i->group)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point1);
- else if (rat->Point2.X == i->pad->Point2.X && rat->Point2.Y == i->pad->Point2.Y && rat->group2 == i->group)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point2);
- else
- if (rat->Point1.X == (i->pad->Point1.X + i->pad->Point2.X) / 2 &&
- rat->Point1.Y == (i->pad->Point1.Y + i->pad->Point2.Y) / 2 && rat->group1 == i->group)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point1);
- else
- if (rat->Point2.X == (i->pad->Point1.X + i->pad->Point2.X) / 2 &&
- rat->Point2.Y == (i->pad->Point1.Y + i->pad->Point2.Y) / 2 && rat->group2 == i->group)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point2);
- break;
- case PCB_TYPE_LINE_POINT:
- if (rat->group1 == i->group && rat->Point1.X == i->point->X && rat->Point1.Y == i->point->Y)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point1);
- else if (rat->group2 == i->group && rat->Point2.X == i->point->X && rat->Point2.Y == i->point->Y)
- CreateNewRubberbandEntry(NULL, (LineTypePtr) rat, &rat->Point2);
- break;
- default:
- Message(PCB_MSG_DEFAULT, "hace: bad rubber-rat lookup callback\n");
- }
- return R_DIR_NOT_FOUND;
-}
-
-static void CheckPadForRat(PadTypePtr Pad)
-{
- struct rinfo info;
- pcb_cardinal_t i;
-
- i = TEST_FLAG(PCB_FLAG_ONSOLDER, Pad) ? solder_silk_layer : component_silk_layer;
- info.group = GetLayerGroupNumberByNumber(i);
- info.pad = Pad;
- info.type = PCB_TYPE_PAD;
-
- r_search(PCB->Data->rat_tree, &Pad->BoundingBox, NULL, rat_callback, &info, NULL);
-}
-
-static void CheckPinForRat(PinTypePtr Pin)
-{
- struct rinfo info;
-
- info.type = PCB_TYPE_PIN;
- info.pin = Pin;
- r_search(PCB->Data->rat_tree, &Pin->BoundingBox, NULL, rat_callback, &info, NULL);
-}
-
-static void CheckLinePointForRat(LayerTypePtr Layer, PointTypePtr Point)
-{
- struct rinfo info;
- info.group = GetLayerGroupNumberByPointer(Layer);
- info.point = Point;
- info.type = PCB_TYPE_LINE_POINT;
-
- r_search(PCB->Data->rat_tree, (BoxType *) Point, NULL, rat_callback, &info, NULL);
-}
-
-/* ---------------------------------------------------------------------------
- * checks all visible lines. If one of the endpoints of the line lays
- * inside the pin, the line is added to the 'rubberband' list
- *
- * Square pins are handled as if they were round. Speed
- * and readability is more important then the few %
- * of failures that are immediately recognized
- */
-static void CheckPinForRubberbandConnection(PinTypePtr Pin)
-{
- struct rubber_info info;
- pcb_cardinal_t n;
- Coord t = Pin->Thickness / 2;
-
- info.box.X1 = Pin->X - t;
- info.box.X2 = Pin->X + t;
- info.box.Y1 = Pin->Y - t;
- info.box.Y2 = Pin->Y + t;
- info.line = NULL;
- if (TEST_FLAG(PCB_FLAG_SQUARE, Pin))
- info.radius = 0;
- else {
- info.radius = t;
- info.X = Pin->X;
- info.Y = Pin->Y;
- }
-
- for (n = 0; n < max_copper_layer; n++) {
- info.layer = LAYER_PTR(n);
- r_search(info.layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * checks all visible lines which belong to the same group as the passed line.
- * If one of the endpoints of the line lays * inside the passed line,
- * the scanned line is added to the 'rubberband' list
- */
-static void CheckLinePointForRubberbandConnection(LayerTypePtr Layer, LineTypePtr Line, PointTypePtr LinePoint, pcb_bool Exact)
-{
- pcb_cardinal_t group;
- struct rubber_info info;
- Coord t = Line->Thickness / 2;
-
- /* lookup layergroup and check all visible lines in this group */
- info.radius = Exact ? -1 : MAX(Line->Thickness / 2, 1);
- info.box.X1 = LinePoint->X - t;
- info.box.X2 = LinePoint->X + t;
- info.box.Y1 = LinePoint->Y - t;
- info.box.Y2 = LinePoint->Y + t;
- info.line = Line;
- info.X = LinePoint->X;
- info.Y = LinePoint->Y;
- group = GetLayerGroupNumberByPointer(Layer);
- GROUP_LOOP(PCB->Data, group);
- {
- /* check all visible lines of the group member */
- if (layer->On) {
- info.layer = layer;
- r_search(layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
- }
- }
- END_LOOP;
-}
-
-/* ---------------------------------------------------------------------------
- * checks all visible lines which belong to the same group as the passed polygon.
- * If one of the endpoints of the line lays inside the passed polygon,
- * the scanned line is added to the 'rubberband' list
- */
-static void CheckPolygonForRubberbandConnection(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- pcb_cardinal_t group;
-
- /* lookup layergroup and check all visible lines in this group */
- group = GetLayerGroupNumberByPointer(Layer);
- GROUP_LOOP(PCB->Data, group);
- {
- if (layer->On) {
- Coord thick;
-
- /* the following code just stupidly compares the endpoints
- * of the lines
- */
- LINE_LOOP(layer);
- {
- if (TEST_FLAG(PCB_FLAG_LOCK, line))
- continue;
- if (TEST_FLAG(PCB_FLAG_CLEARLINE, line))
- continue;
- thick = (line->Thickness + 1) / 2;
- if (IsPointInPolygon(line->Point1.X, line->Point1.Y, thick, Polygon))
- CreateNewRubberbandEntry(layer, line, &line->Point1);
- if (IsPointInPolygon(line->Point2.X, line->Point2.Y, thick, Polygon))
- CreateNewRubberbandEntry(layer, line, &line->Point2);
- }
- END_LOOP;
- }
- }
- END_LOOP;
-}
-
-/* ---------------------------------------------------------------------------
- * lookup all lines that are connected to an object and save the
- * data to 'Crosshair.AttachedObject.Rubberband'
- * lookup is only done for visible layers
- */
-void LookupRubberbandLines(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
-{
-
- /* the function is only supported for some types
- * check all visible lines;
- * it is only necessary to check if one of the endpoints
- * is connected
- */
- switch (Type) {
- case PCB_TYPE_ELEMENT:
- {
- ElementTypePtr element = (ElementTypePtr) Ptr1;
-
- /* square pins are handled as if they are round. Speed
- * and readability is more important then the few %
- * of failures that are immediately recognized
- */
- PIN_LOOP(element);
- {
- CheckPinForRubberbandConnection(pin);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- CheckPadForRubberbandConnection(pad);
- }
- END_LOOP;
- break;
- }
-
- case PCB_TYPE_LINE:
- {
- LayerTypePtr layer = (LayerTypePtr) Ptr1;
- LineTypePtr line = (LineTypePtr) Ptr2;
- if (GetLayerNumber(PCB->Data, layer) < max_copper_layer) {
- CheckLinePointForRubberbandConnection(layer, line, &line->Point1, pcb_false);
- CheckLinePointForRubberbandConnection(layer, line, &line->Point2, pcb_false);
- }
- break;
- }
-
- case PCB_TYPE_LINE_POINT:
- if (GetLayerNumber(PCB->Data, (LayerTypePtr) Ptr1) < max_copper_layer)
- CheckLinePointForRubberbandConnection((LayerTypePtr) Ptr1, (LineTypePtr) Ptr2, (PointTypePtr) Ptr3, pcb_true);
- break;
-
- case PCB_TYPE_VIA:
- CheckPinForRubberbandConnection((PinTypePtr) Ptr1);
- break;
-
- case PCB_TYPE_POLYGON:
- if (GetLayerNumber(PCB->Data, (LayerTypePtr) Ptr1) < max_copper_layer)
- CheckPolygonForRubberbandConnection((LayerTypePtr) Ptr1, (PolygonTypePtr) Ptr2);
- break;
- }
-}
-
-void LookupRatLines(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
-{
- switch (Type) {
- case PCB_TYPE_ELEMENT:
- {
- ElementTypePtr element = (ElementTypePtr) Ptr1;
-
- PIN_LOOP(element);
- {
- CheckPinForRat(pin);
- }
- END_LOOP;
- PAD_LOOP(element);
- {
- CheckPadForRat(pad);
- }
- END_LOOP;
- break;
- }
-
- case PCB_TYPE_LINE:
- {
- LayerTypePtr layer = (LayerTypePtr) Ptr1;
- LineTypePtr line = (LineTypePtr) Ptr2;
-
- CheckLinePointForRat(layer, &line->Point1);
- CheckLinePointForRat(layer, &line->Point2);
- break;
- }
-
- case PCB_TYPE_LINE_POINT:
- CheckLinePointForRat((LayerTypePtr) Ptr1, (PointTypePtr) Ptr3);
- break;
-
- case PCB_TYPE_VIA:
- CheckPinForRat((PinTypePtr) Ptr1);
- break;
- }
-}
diff --git a/src/rubberband.h b/src/rubberband.h
deleted file mode 100644
index d0e04d3..0000000
--- a/src/rubberband.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for rubberband routines
- */
-
-#ifndef PCB_RUBBERBAND_H
-#define PCB_RUBBERBAND_H
-
-#include "global.h"
-
-void LookupRubberbandLines(int, void *, void *, void *);
-void LookupRatLines(int, void *, void *, void *);
-
-#endif
diff --git a/src/search.c b/src/search.c
index 0a654ae..95b07af 100644
--- a/src/search.c
+++ b/src/search.c
@@ -34,40 +34,38 @@
#include <math.h>
-#include "box.h"
+#include "board.h"
#include "data.h"
#include "error.h"
#include "find.h"
#include "polygon.h"
-#include "rtree.h"
#include "search.h"
-#include "misc.h"
-#include "layer.h"
/* ---------------------------------------------------------------------------
* some local identifiers
*/
static double PosX, PosY; /* search position for subroutines */
-static Coord SearchRadius;
-static BoxType SearchBox;
-static LayerTypePtr SearchLayer;
+static pcb_coord_t SearchRadius;
+static pcb_box_t SearchBox;
+static pcb_layer_t *SearchLayer;
/* ---------------------------------------------------------------------------
* some local prototypes. The first parameter includes PCB_TYPE_LOCKED if we
* want to include locked types in the search.
*/
-static pcb_bool SearchLineByLocation(int, LayerTypePtr *, LineTypePtr *, LineTypePtr *);
-static pcb_bool SearchArcByLocation(int, LayerTypePtr *, ArcTypePtr *, ArcTypePtr *);
-static pcb_bool SearchRatLineByLocation(int, RatTypePtr *, RatTypePtr *, RatTypePtr *);
-static pcb_bool SearchTextByLocation(int, LayerTypePtr *, TextTypePtr *, TextTypePtr *);
-static pcb_bool SearchPolygonByLocation(int, LayerTypePtr *, PolygonTypePtr *, PolygonTypePtr *);
-static pcb_bool SearchPinByLocation(int, ElementTypePtr *, PinTypePtr *, PinTypePtr *);
-static pcb_bool SearchPadByLocation(int, ElementTypePtr *, PadTypePtr *, PadTypePtr *, pcb_bool);
-static pcb_bool SearchViaByLocation(int, PinTypePtr *, PinTypePtr *, PinTypePtr *);
-static pcb_bool SearchElementNameByLocation(int, ElementTypePtr *, TextTypePtr *, TextTypePtr *, pcb_bool);
-static pcb_bool SearchLinePointByLocation(int, LayerTypePtr *, LineTypePtr *, PointTypePtr *);
-static pcb_bool SearchPointByLocation(int, LayerTypePtr *, PolygonTypePtr *, PointTypePtr *);
-static pcb_bool SearchElementByLocation(int, ElementTypePtr *, ElementTypePtr *, ElementTypePtr *, pcb_bool);
+static pcb_bool SearchLineByLocation(int, pcb_layer_t **, pcb_line_t **, pcb_line_t **);
+static pcb_bool SearchArcByLocation(int, pcb_layer_t **, pcb_arc_t **, pcb_arc_t **);
+static pcb_bool SearchRatLineByLocation(int, pcb_rat_t **, pcb_rat_t **, pcb_rat_t **);
+static pcb_bool SearchTextByLocation(int, pcb_layer_t **, pcb_text_t **, pcb_text_t **);
+static pcb_bool SearchPolygonByLocation(int, pcb_layer_t **, pcb_polygon_t **, pcb_polygon_t **);
+static pcb_bool SearchPinByLocation(int, pcb_element_t **, pcb_pin_t **, pcb_pin_t **);
+static pcb_bool SearchPadByLocation(int, pcb_element_t **, pcb_pad_t **, pcb_pad_t **, pcb_bool);
+static pcb_bool SearchViaByLocation(int, pcb_pin_t **, pcb_pin_t **, pcb_pin_t **);
+static pcb_bool SearchElementNameByLocation(int, pcb_element_t **, pcb_text_t **, pcb_text_t **, pcb_bool);
+static pcb_bool SearchLinePointByLocation(int, pcb_layer_t **, pcb_line_t **, pcb_point_t **);
+static pcb_bool SearchArcPointByLocation(int, pcb_layer_t **, pcb_arc_t **, int **);
+static pcb_bool SearchPointByLocation(int, pcb_layer_t **, pcb_polygon_t **, pcb_point_t **);
+static pcb_bool SearchElementByLocation(int, pcb_element_t **, pcb_element_t **, pcb_element_t **, pcb_bool);
/* ---------------------------------------------------------------------------
* searches a via
@@ -79,23 +77,23 @@ struct ans_info {
int locked; /* This will be zero or PCB_FLAG_LOCK */
};
-static r_dir_t pinorvia_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t pinorvia_callback(const pcb_box_t * box, void *cl)
{
struct ans_info *i = (struct ans_info *) cl;
- PinTypePtr pin = (PinTypePtr) box;
- AnyObjectType *ptr1 = pin->Element ? pin->Element : pin;
+ pcb_pin_t *pin = (pcb_pin_t *) box;
+ pcb_any_obj_t *ptr1 = pin->Element ? pin->Element : pin;
- if (TEST_FLAG(i->locked, ptr1))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, ptr1))
+ return PCB_R_DIR_NOT_FOUND;
- if (!IsPointOnPin(PosX, PosY, SearchRadius, pin))
- return R_DIR_NOT_FOUND;
+ if (!pcb_is_point_in_pin(PosX, PosY, SearchRadius, pin))
+ return PCB_R_DIR_NOT_FOUND;
*i->ptr1 = ptr1;
*i->ptr2 = *i->ptr3 = pin;
- return R_DIR_CANCEL; /* found, stop searching */
+ return PCB_R_DIR_CANCEL; /* found, stop searching */
}
-static pcb_bool SearchViaByLocation(int locked, PinTypePtr * Via, PinTypePtr * Dummy1, PinTypePtr * Dummy2)
+static pcb_bool SearchViaByLocation(int locked, pcb_pin_t ** Via, pcb_pin_t ** Dummy1, pcb_pin_t ** Dummy2)
{
struct ans_info info;
@@ -108,7 +106,7 @@ static pcb_bool SearchViaByLocation(int locked, PinTypePtr * Via, PinTypePtr * D
info.ptr3 = (void **) Dummy2;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(PCB->Data->via_tree, &SearchBox, NULL, pinorvia_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(PCB->Data->via_tree, &SearchBox, NULL, pinorvia_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
@@ -117,7 +115,7 @@ static pcb_bool SearchViaByLocation(int locked, PinTypePtr * Via, PinTypePtr * D
* searches a pin
* starts with the newest element
*/
-static pcb_bool SearchPinByLocation(int locked, ElementTypePtr * Element, PinTypePtr * Pin, PinTypePtr * Dummy)
+static pcb_bool SearchPinByLocation(int locked, pcb_element_t ** Element, pcb_pin_t ** Pin, pcb_pin_t ** Dummy)
{
struct ans_info info;
@@ -129,35 +127,35 @@ static pcb_bool SearchPinByLocation(int locked, ElementTypePtr * Element, PinTyp
info.ptr3 = (void **) Dummy;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(PCB->Data->pin_tree, &SearchBox, NULL, pinorvia_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(PCB->Data->pin_tree, &SearchBox, NULL, pinorvia_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
-static r_dir_t pad_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t pad_callback(const pcb_box_t * b, void *cl)
{
- PadTypePtr pad = (PadTypePtr) b;
+ pcb_pad_t *pad = (pcb_pad_t *) b;
struct ans_info *i = (struct ans_info *) cl;
- AnyObjectType *ptr1 = pad->Element;
+ pcb_any_obj_t *ptr1 = pad->Element;
- if (TEST_FLAG(i->locked, ptr1))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, ptr1))
+ return PCB_R_DIR_NOT_FOUND;
- if (FRONT(pad) || i->BackToo) {
- if (IsPointInPad(PosX, PosY, SearchRadius, pad)) {
+ if (PCB_FRONT(pad) || i->BackToo) {
+ if (pcb_is_point_in_pad(PosX, PosY, SearchRadius, pad)) {
*i->ptr1 = ptr1;
*i->ptr2 = *i->ptr3 = pad;
- return R_DIR_CANCEL; /* found */
+ return PCB_R_DIR_CANCEL; /* found */
}
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
* searches a pad
* starts with the newest element
*/
-static pcb_bool SearchPadByLocation(int locked, ElementTypePtr * Element, PadTypePtr * Pad, PadTypePtr * Dummy, pcb_bool BackToo)
+static pcb_bool SearchPadByLocation(int locked, pcb_element_t ** Element, pcb_pad_t ** Pad, pcb_pad_t ** Dummy, pcb_bool BackToo)
{
struct ans_info info;
@@ -169,7 +167,7 @@ static pcb_bool SearchPadByLocation(int locked, ElementTypePtr * Element, PadTyp
info.ptr3 = (void **) Dummy;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
info.BackToo = (BackToo && PCB->InvisibleObjectsOn);
- if (r_search(PCB->Data->pad_tree, &SearchBox, NULL, pad_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(PCB->Data->pad_tree, &SearchBox, NULL, pad_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
@@ -179,65 +177,65 @@ static pcb_bool SearchPadByLocation(int locked, ElementTypePtr * Element, PadTyp
*/
struct line_info {
- LineTypePtr *Line;
- PointTypePtr *Point;
+ pcb_line_t **Line;
+ pcb_point_t **Point;
double least;
int locked;
};
-static r_dir_t line_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t line_callback(const pcb_box_t * box, void *cl)
{
struct line_info *i = (struct line_info *) cl;
- LineTypePtr l = (LineTypePtr) box;
+ pcb_line_t *l = (pcb_line_t *) box;
- if (TEST_FLAG(i->locked, l))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, l))
+ return PCB_R_DIR_NOT_FOUND;
- if (!IsPointInPad(PosX, PosY, SearchRadius, (PadTypePtr) l))
- return R_DIR_NOT_FOUND;
+ if (!pcb_is_point_in_pad(PosX, PosY, SearchRadius, (pcb_pad_t *) l))
+ return PCB_R_DIR_NOT_FOUND;
*i->Line = l;
- *i->Point = (PointTypePtr) l;
+ *i->Point = (pcb_point_t *) l;
- return R_DIR_CANCEL; /* found what we were looking for */
+ return PCB_R_DIR_CANCEL; /* found what we were looking for */
}
-static pcb_bool SearchLineByLocation(int locked, LayerTypePtr * Layer, LineTypePtr * Line, LineTypePtr * Dummy)
+static pcb_bool SearchLineByLocation(int locked, pcb_layer_t ** Layer, pcb_line_t ** Line, pcb_line_t ** Dummy)
{
struct line_info info;
info.Line = Line;
- info.Point = (PointTypePtr *) Dummy;
+ info.Point = (pcb_point_t **) Dummy;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
*Layer = SearchLayer;
- if (r_search(SearchLayer->line_tree, &SearchBox, NULL, line_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(SearchLayer->line_tree, &SearchBox, NULL, line_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
-static r_dir_t rat_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t rat_callback(const pcb_box_t * box, void *cl)
{
- LineTypePtr line = (LineTypePtr) box;
+ pcb_line_t *line = (pcb_line_t *) box;
struct ans_info *i = (struct ans_info *) cl;
- if (TEST_FLAG(i->locked, line))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, line))
+ return PCB_R_DIR_NOT_FOUND;
- if (TEST_FLAG(PCB_FLAG_VIA, line) ?
- (Distance(line->Point1.X, line->Point1.Y, PosX, PosY) <=
- line->Thickness * 2 + SearchRadius) : IsPointOnLine(PosX, PosY, SearchRadius, line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_VIA, line) ?
+ (pcb_distance(line->Point1.X, line->Point1.Y, PosX, PosY) <=
+ line->Thickness * 2 + SearchRadius) : pcb_is_point_on_line(PosX, PosY, SearchRadius, line)) {
*i->ptr1 = *i->ptr2 = *i->ptr3 = line;
- return R_DIR_CANCEL;
+ return PCB_R_DIR_CANCEL;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
* searches rat lines if they are visible
*/
-static pcb_bool SearchRatLineByLocation(int locked, RatTypePtr * Line, RatTypePtr * Dummy1, RatTypePtr * Dummy2)
+static pcb_bool SearchRatLineByLocation(int locked, pcb_rat_t ** Line, pcb_rat_t ** Dummy1, pcb_rat_t ** Dummy2)
{
struct ans_info info;
@@ -246,7 +244,7 @@ static pcb_bool SearchRatLineByLocation(int locked, RatTypePtr * Line, RatTypePt
info.ptr3 = (void **) Dummy2;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(PCB->Data->rat_tree, &SearchBox, NULL, rat_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(PCB->Data->rat_tree, &SearchBox, NULL, rat_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
@@ -255,27 +253,29 @@ static pcb_bool SearchRatLineByLocation(int locked, RatTypePtr * Line, RatTypePt
* searches arc on the SearchLayer
*/
struct arc_info {
- ArcTypePtr *Arc, *Dummy;
+ pcb_arc_t **Arc, **Dummy;
int locked;
+ int **arc_pt; /* 0=start, 1=end (start+delta) */
+ double least;
};
-static r_dir_t arc_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t arc_callback(const pcb_box_t * box, void *cl)
{
struct arc_info *i = (struct arc_info *) cl;
- ArcTypePtr a = (ArcTypePtr) box;
+ pcb_arc_t *a = (pcb_arc_t *) box;
- if (TEST_FLAG(i->locked, a))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, a))
+ return PCB_R_DIR_NOT_FOUND;
- if (!IsPointOnArc(PosX, PosY, SearchRadius, a))
+ if (!pcb_is_point_on_arc(PosX, PosY, SearchRadius, a))
return 0;
*i->Arc = a;
*i->Dummy = a;
- return R_DIR_CANCEL; /* found */
+ return PCB_R_DIR_CANCEL; /* found */
}
-static pcb_bool SearchArcByLocation(int locked, LayerTypePtr * Layer, ArcTypePtr * Arc, ArcTypePtr * Dummy)
+static pcb_bool SearchArcByLocation(int locked, pcb_layer_t ** Layer, pcb_arc_t ** Arc, pcb_arc_t ** Dummy)
{
struct arc_info info;
@@ -284,30 +284,30 @@ static pcb_bool SearchArcByLocation(int locked, LayerTypePtr * Layer, ArcTypePtr
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
*Layer = SearchLayer;
- if (r_search(SearchLayer->arc_tree, &SearchBox, NULL, arc_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(SearchLayer->arc_tree, &SearchBox, NULL, arc_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
-static r_dir_t text_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t text_callback(const pcb_box_t * box, void *cl)
{
- TextTypePtr text = (TextTypePtr) box;
+ pcb_text_t *text = (pcb_text_t *) box;
struct ans_info *i = (struct ans_info *) cl;
- if (TEST_FLAG(i->locked, text))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, text))
+ return PCB_R_DIR_NOT_FOUND;
- if (POINT_IN_BOX(PosX, PosY, &text->BoundingBox)) {
+ if (PCB_POINT_IN_BOX(PosX, PosY, &text->BoundingBox)) {
*i->ptr2 = *i->ptr3 = text;
- return R_DIR_CANCEL; /* found */
+ return PCB_R_DIR_CANCEL; /* found */
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
* searches text on the SearchLayer
*/
-static pcb_bool SearchTextByLocation(int locked, LayerTypePtr * Layer, TextTypePtr * Text, TextTypePtr * Dummy)
+static pcb_bool SearchTextByLocation(int locked, pcb_layer_t ** Layer, pcb_text_t ** Text, pcb_text_t ** Dummy)
{
struct ans_info info;
@@ -316,31 +316,31 @@ static pcb_bool SearchTextByLocation(int locked, LayerTypePtr * Layer, TextTypeP
info.ptr3 = (void **) Dummy;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(SearchLayer->text_tree, &SearchBox, NULL, text_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(SearchLayer->text_tree, &SearchBox, NULL, text_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
-static r_dir_t polygon_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t polygon_callback(const pcb_box_t * box, void *cl)
{
- PolygonTypePtr polygon = (PolygonTypePtr) box;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) box;
struct ans_info *i = (struct ans_info *) cl;
- if (TEST_FLAG(i->locked, polygon))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, polygon))
+ return PCB_R_DIR_NOT_FOUND;
- if (IsPointInPolygon(PosX, PosY, SearchRadius, polygon)) {
+ if (pcb_poly_is_point_in_p(PosX, PosY, SearchRadius, polygon)) {
*i->ptr2 = *i->ptr3 = polygon;
- return R_DIR_CANCEL; /* found */
+ return PCB_R_DIR_CANCEL; /* found */
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
* searches a polygon on the SearchLayer
*/
-static pcb_bool SearchPolygonByLocation(int locked, LayerTypePtr * Layer, PolygonTypePtr * Polygon, PolygonTypePtr * Dummy)
+static pcb_bool SearchPolygonByLocation(int locked, pcb_layer_t ** Layer, pcb_polygon_t ** Polygon, pcb_polygon_t ** Dummy)
{
struct ans_info info;
@@ -349,36 +349,70 @@ static pcb_bool SearchPolygonByLocation(int locked, LayerTypePtr * Layer, Polygo
info.ptr3 = (void **) Dummy;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(SearchLayer->polygon_tree, &SearchBox, NULL, polygon_callback, &info, NULL) != R_DIR_NOT_FOUND)
+ if (pcb_r_search(SearchLayer->polygon_tree, &SearchBox, NULL, polygon_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND)
return pcb_true;
return pcb_false;
}
-static r_dir_t linepoint_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t linepoint_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
struct line_info *i = (struct line_info *) cl;
- r_dir_t ret_val = R_DIR_NOT_FOUND;
+ pcb_r_dir_t ret_val = PCB_R_DIR_NOT_FOUND;
double d;
- if (TEST_FLAG(i->locked, line))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, line))
+ return PCB_R_DIR_NOT_FOUND;
/* some stupid code to check both points */
- d = Distance(PosX, PosY, line->Point1.X, line->Point1.Y);
+ d = pcb_distance(PosX, PosY, line->Point1.X, line->Point1.Y);
if (d < i->least) {
i->least = d;
*i->Line = line;
*i->Point = &line->Point1;
- ret_val = R_DIR_FOUND_CONTINUE;
+ ret_val = PCB_R_DIR_FOUND_CONTINUE;
}
- d = Distance(PosX, PosY, line->Point2.X, line->Point2.Y);
+ d = pcb_distance(PosX, PosY, line->Point2.X, line->Point2.Y);
if (d < i->least) {
i->least = d;
*i->Line = line;
*i->Point = &line->Point2;
- ret_val = R_DIR_FOUND_CONTINUE;
+ ret_val = PCB_R_DIR_FOUND_CONTINUE;
+ }
+ return ret_val;
+}
+
+static pcb_r_dir_t arcpoint_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_box_t ab;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
+ struct arc_info *i = (struct arc_info *) cl;
+ pcb_r_dir_t ret_val = PCB_R_DIR_NOT_FOUND;
+ double d;
+
+
+ if (PCB_FLAG_TEST(i->locked, arc))
+ return PCB_R_DIR_NOT_FOUND;
+
+ /* some stupid code to check both points */
+ pcb_arc_get_end(arc, 0, &ab.X1, &ab.Y1);
+ pcb_arc_get_end(arc, 1, &ab.X2, &ab.Y2);
+
+ d = pcb_distance(PosX, PosY, ab.X1, ab.Y1);
+ if (d < i->least) {
+ i->least = d;
+ *i->Arc = arc;
+ *i->arc_pt = pcb_arc_start_ptr;
+ ret_val = PCB_R_DIR_FOUND_CONTINUE;
+ }
+
+ d = pcb_distance(PosX, PosY, ab.X2, ab.Y2);
+ if (d < i->least) {
+ i->least = d;
+ *i->Arc = arc;
+ *i->arc_pt = pcb_arc_end_ptr;
+ ret_val = PCB_R_DIR_FOUND_CONTINUE;
}
return ret_val;
}
@@ -386,16 +420,33 @@ static r_dir_t linepoint_callback(const BoxType * b, void *cl)
/* ---------------------------------------------------------------------------
* searches a line-point on all the search layer
*/
-static pcb_bool SearchLinePointByLocation(int locked, LayerTypePtr * Layer, LineTypePtr * Line, PointTypePtr * Point)
+static pcb_bool SearchLinePointByLocation(int locked, pcb_layer_t ** Layer, pcb_line_t ** Line, pcb_point_t ** Point)
{
struct line_info info;
*Layer = SearchLayer;
info.Line = Line;
info.Point = Point;
*Point = NULL;
- info.least = MAX_LINE_POINT_DISTANCE + SearchRadius;
+ info.least = PCB_MAX_LINE_POINT_DISTANCE + SearchRadius;
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(SearchLayer->line_tree, &SearchBox, NULL, linepoint_callback, &info, NULL))
+ if (pcb_r_search(SearchLayer->line_tree, &SearchBox, NULL, linepoint_callback, &info, NULL))
+ return pcb_true;
+ return pcb_false;
+}
+
+/* ---------------------------------------------------------------------------
+ * searches a line-point on all the search layer
+ */
+static pcb_bool SearchArcPointByLocation(int locked, pcb_layer_t ** Layer, pcb_arc_t ** Arc, int **Point)
+{
+ struct arc_info info;
+ *Layer = SearchLayer;
+ info.Arc = Arc;
+ info.arc_pt = Point;
+ *Point = NULL;
+ info.least = PCB_MAX_LINE_POINT_DISTANCE + SearchRadius;
+ info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
+ if (pcb_r_search(SearchLayer->arc_tree, &SearchBox, NULL, arcpoint_callback, &info, NULL))
return pcb_true;
return pcb_false;
}
@@ -404,18 +455,18 @@ static pcb_bool SearchLinePointByLocation(int locked, LayerTypePtr * Layer, Line
* searches a polygon-point on all layers that are switched on
* in layerstack order
*/
-static pcb_bool SearchPointByLocation(int locked, LayerTypePtr * Layer, PolygonTypePtr * Polygon, PointTypePtr * Point)
+static pcb_bool SearchPointByLocation(int locked, pcb_layer_t ** Layer, pcb_polygon_t ** Polygon, pcb_point_t ** Point)
{
double d, least;
pcb_bool found = pcb_false;
- least = SearchRadius + MAX_POLYGON_POINT_DISTANCE;
+ least = SearchRadius + PCB_MAX_POLYGON_POINT_DISTANCE;
*Layer = SearchLayer;
- POLYGON_LOOP(*Layer);
+ PCB_POLY_LOOP(*Layer);
{
- POLYGONPOINT_LOOP(polygon);
+ PCB_POLY_POINT_LOOP(polygon);
{
- d = Distance(point->X, point->Y, PosX, PosY);
+ d = pcb_distance(point->X, point->Y, PosX, PosY);
if (d < least) {
least = d;
*Polygon = polygon;
@@ -423,25 +474,25 @@ static pcb_bool SearchPointByLocation(int locked, LayerTypePtr * Layer, PolygonT
found = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
if (found)
return (pcb_true);
return (pcb_false);
}
-static r_dir_t name_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t name_callback(const pcb_box_t * box, void *cl)
{
- TextTypePtr text = (TextTypePtr) box;
+ pcb_text_t *text = (pcb_text_t *) box;
struct ans_info *i = (struct ans_info *) cl;
- ElementTypePtr element = (ElementTypePtr) text->Element;
+ pcb_element_t *element = (pcb_element_t *) text->Element;
double newarea;
- if (TEST_FLAG(i->locked, text))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, text))
+ return PCB_R_DIR_NOT_FOUND;
- if ((FRONT(element) || i->BackToo) && !TEST_FLAG(PCB_FLAG_HIDENAME, element) && POINT_IN_BOX(PosX, PosY, &text->BoundingBox)) {
+ if ((PCB_FRONT(element) || i->BackToo) && !PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element) && PCB_POINT_IN_BOX(PosX, PosY, &text->BoundingBox)) {
/* use the text with the smallest bounding box */
newarea = (text->BoundingBox.X2 - text->BoundingBox.X1) * (double) (text->BoundingBox.Y2 - text->BoundingBox.Y1);
if (newarea < i->area) {
@@ -449,9 +500,9 @@ static r_dir_t name_callback(const BoxType * box, void *cl)
*i->ptr1 = element;
*i->ptr2 = *i->ptr3 = text;
}
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -459,7 +510,7 @@ static r_dir_t name_callback(const BoxType * box, void *cl)
* the search starts with the last element and goes back to the beginning
*/
static pcb_bool
-SearchElementNameByLocation(int locked, ElementTypePtr * Element, TextTypePtr * Text, TextTypePtr * Dummy, pcb_bool BackToo)
+SearchElementNameByLocation(int locked, pcb_element_t ** Element, pcb_text_t ** Text, pcb_text_t ** Dummy, pcb_bool BackToo)
{
struct ans_info info;
@@ -468,34 +519,34 @@ SearchElementNameByLocation(int locked, ElementTypePtr * Element, TextTypePtr *
info.ptr1 = (void **) Element;
info.ptr2 = (void **) Text;
info.ptr3 = (void **) Dummy;
- info.area = SQUARE(MAX_COORD);
+ info.area = PCB_SQUARE(PCB_MAX_COORD);
info.BackToo = (BackToo && PCB->InvisibleObjectsOn);
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(PCB->Data->name_tree[NAME_INDEX()], &SearchBox, NULL, name_callback, &info, NULL))
+ if (pcb_r_search(PCB->Data->name_tree[PCB_ELEMNAME_IDX_VISIBLE()], &SearchBox, NULL, name_callback, &info, NULL))
return pcb_true;
}
return (pcb_false);
}
-static r_dir_t element_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t element_callback(const pcb_box_t * box, void *cl)
{
- ElementTypePtr element = (ElementTypePtr) box;
+ pcb_element_t *element = (pcb_element_t *) box;
struct ans_info *i = (struct ans_info *) cl;
double newarea;
- if (TEST_FLAG(i->locked, element))
- return R_DIR_NOT_FOUND;
+ if (PCB_FLAG_TEST(i->locked, element))
+ return PCB_R_DIR_NOT_FOUND;
- if ((FRONT(element) || i->BackToo) && POINT_IN_BOX(PosX, PosY, &element->VBox)) {
+ if ((PCB_FRONT(element) || i->BackToo) && PCB_POINT_IN_BOX(PosX, PosY, &element->VBox)) {
/* use the element with the smallest bounding box */
newarea = (element->VBox.X2 - element->VBox.X1) * (double) (element->VBox.Y2 - element->VBox.Y1);
if (newarea < i->area) {
i->area = newarea;
*i->ptr1 = *i->ptr2 = *i->ptr3 = element;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* ---------------------------------------------------------------------------
@@ -504,7 +555,7 @@ static r_dir_t element_callback(const BoxType * box, void *cl)
* if more than one element matches, the smallest one is taken
*/
static pcb_bool
-SearchElementByLocation(int locked, ElementTypePtr * Element, ElementTypePtr * Dummy1, ElementTypePtr * Dummy2, pcb_bool BackToo)
+SearchElementByLocation(int locked, pcb_element_t ** Element, pcb_element_t ** Dummy1, pcb_element_t ** Dummy2, pcb_bool BackToo)
{
struct ans_info info;
@@ -513,10 +564,10 @@ SearchElementByLocation(int locked, ElementTypePtr * Element, ElementTypePtr * D
info.ptr1 = (void **) Element;
info.ptr2 = (void **) Dummy1;
info.ptr3 = (void **) Dummy2;
- info.area = SQUARE(MAX_COORD);
+ info.area = PCB_SQUARE(PCB_MAX_COORD);
info.BackToo = (BackToo && PCB->InvisibleObjectsOn);
info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK;
- if (r_search(PCB->Data->element_tree, &SearchBox, NULL, element_callback, &info, NULL))
+ if (pcb_r_search(PCB->Data->element_tree, &SearchBox, NULL, element_callback, &info, NULL))
return pcb_true;
}
return pcb_false;
@@ -525,20 +576,20 @@ SearchElementByLocation(int locked, ElementTypePtr * Element, ElementTypePtr * D
/* ---------------------------------------------------------------------------
* checks if a point is on a pin
*/
-pcb_bool IsPointOnPin(Coord X, Coord Y, Coord Radius, PinTypePtr pin)
+pcb_bool pcb_is_point_in_pin(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_pin_t *pin)
{
- Coord t = PIN_SIZE(pin) / 2;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
- BoxType b;
+ pcb_coord_t t = PIN_SIZE(pin) / 2;
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
+ pcb_box_t b;
b.X1 = pin->X - t;
b.X2 = pin->X + t;
b.Y1 = pin->Y - t;
b.Y2 = pin->Y + t;
- if (IsPointInBox(X, Y, &b, Radius))
+ if (pcb_is_point_in_box(X, Y, &b, Radius))
return pcb_true;
}
- else if (Distance(pin->X, pin->Y, X, Y) <= Radius + t)
+ else if (pcb_distance(pin->X, pin->Y, X, Y) <= Radius + t)
return pcb_true;
return pcb_false;
}
@@ -546,7 +597,7 @@ pcb_bool IsPointOnPin(Coord X, Coord Y, Coord Radius, PinTypePtr pin)
/* ---------------------------------------------------------------------------
* checks if a rat-line end is on a PV
*/
-pcb_bool IsPointOnLineEnd(Coord X, Coord Y, RatTypePtr Line)
+pcb_bool pcb_is_point_on_line_end(pcb_coord_t X, pcb_coord_t Y, pcb_rat_t *Line)
{
if (((X == Line->Point1.X) && (Y == Line->Point1.Y)) || ((X == Line->Point2.X) && (Y == Line->Point2.Y)))
return (pcb_true);
@@ -585,14 +636,14 @@ pcb_bool IsPointOnLineEnd(Coord X, Coord Y, RatTypePtr Line)
* Finally, D1 and D2 are orthogonal, so we can sum them easily
* by Pythagorean theorem.
*/
-pcb_bool IsPointOnLine(Coord X, Coord Y, Coord Radius, LineTypePtr Line)
+pcb_bool pcb_is_point_on_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_line_t *Line)
{
double D1, D2, L;
/* Get length of segment */
- L = Distance(Line->Point1.X, Line->Point1.Y, Line->Point2.X, Line->Point2.Y);
+ L = pcb_distance(Line->Point1.X, Line->Point1.Y, Line->Point2.X, Line->Point2.Y);
if (L < 0.1)
- return Distance(X, Y, Line->Point1.X, Line->Point1.Y) < Radius + Line->Thickness / 2;
+ return pcb_distance(X, Y, Line->Point1.X, Line->Point1.Y) < Radius + Line->Thickness / 2;
/* Get distance from (X1, Y1) to Q (on the line) */
D1 = ((double) (Y - Line->Point1.Y) * (Line->Point2.Y - Line->Point1.Y)
@@ -611,24 +662,24 @@ pcb_bool IsPointOnLine(Coord X, Coord Y, Coord Radius, LineTypePtr Line)
return sqrt(D1 * D1 + D2 * D2) <= Radius + Line->Thickness / 2;
}
-static int is_point_on_line(Coord px, Coord py, Coord lx1, Coord ly1, Coord lx2, Coord ly2)
+static int is_point_on_line(pcb_coord_t px, pcb_coord_t py, pcb_coord_t lx1, pcb_coord_t ly1, pcb_coord_t lx2, pcb_coord_t ly2)
{
/* ohh well... let's hope the optimizer does something clever with inlining... */
- LineType l;
+ pcb_line_t l;
l.Point1.X = lx1;
l.Point1.Y = ly1;
l.Point2.X = lx2;
l.Point2.Y = ly2;
l.Thickness = 1;
- return IsPointOnLine(px, py, 1, &l);
+ return pcb_is_point_on_line(px, py, 1, &l);
}
/* ---------------------------------------------------------------------------
* checks if a line crosses a rectangle
*/
-pcb_bool IsLineInRectangle(Coord X1, Coord Y1, Coord X2, Coord Y2, LineTypePtr Line)
+pcb_bool pcb_is_line_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_line_t *Line)
{
- LineType line;
+ pcb_line_t line;
/* first, see if point 1 is inside the rectangle */
/* in case the whole line is inside the rectangle */
@@ -636,42 +687,42 @@ pcb_bool IsLineInRectangle(Coord X1, Coord Y1, Coord X2, Coord Y2, LineTypePtr L
return (pcb_true);
/* construct a set of dummy lines and check each of them */
line.Thickness = 0;
- line.Flags = NoFlags();
+ line.Flags = pcb_no_flags();
/* upper-left to upper-right corner */
line.Point1.Y = line.Point2.Y = Y1;
line.Point1.X = X1;
line.Point2.X = X2;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
/* upper-right to lower-right corner */
line.Point1.X = X2;
line.Point1.Y = Y1;
line.Point2.Y = Y2;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
/* lower-right to lower-left corner */
line.Point1.Y = Y2;
line.Point1.X = X1;
line.Point2.X = X2;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
/* lower-left to upper-left corner */
line.Point2.X = X1;
line.Point1.Y = Y1;
line.Point2.Y = Y2;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
return (pcb_false);
}
-static int /*checks if a point (of null radius) is in a slanted rectangle */ IsPointInQuadrangle(PointType p[4], PointTypePtr l)
+static int /*checks if a point (of null radius) is in a slanted rectangle */ IsPointInQuadrangle(pcb_point_t p[4], pcb_point_t *l)
{
- Coord dx, dy, x, y;
+ pcb_coord_t dx, dy, x, y;
double prod0, prod1;
dx = p[1].X - p[0].X;
@@ -696,12 +747,12 @@ static int /*checks if a point (of null radius) is in a slanted rectangle */ IsP
}
/* ---------------------------------------------------------------------------
- * checks if a line crosses a quadrangle: almost copied from IsLineInRectangle()
+ * checks if a line crosses a quadrangle: almost copied from pcb_is_line_in_rectangle()
* Note: actually this quadrangle is a slanted rectangle
*/
-pcb_bool IsLineInQuadrangle(PointType p[4], LineTypePtr Line)
+pcb_bool pcb_is_line_in_quadrangle(pcb_point_t p[4], pcb_line_t *Line)
{
- LineType line;
+ pcb_line_t line;
/* first, see if point 1 is inside the rectangle */
/* in case the whole line is inside the rectangle */
@@ -711,32 +762,32 @@ pcb_bool IsLineInQuadrangle(PointType p[4], LineTypePtr Line)
return pcb_true;
/* construct a set of dummy lines and check each of them */
line.Thickness = 0;
- line.Flags = NoFlags();
+ line.Flags = pcb_no_flags();
/* upper-left to upper-right corner */
line.Point1.X = p[0].X;
line.Point1.Y = p[0].Y;
line.Point2.X = p[1].X;
line.Point2.Y = p[1].Y;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
/* upper-right to lower-right corner */
line.Point1.X = p[2].X;
line.Point1.Y = p[2].Y;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
/* lower-right to lower-left corner */
line.Point2.X = p[3].X;
line.Point2.Y = p[3].Y;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
/* lower-left to upper-left corner */
line.Point1.X = p[0].X;
line.Point1.Y = p[0].Y;
- if (LineLineIntersect(&line, Line))
+ if (pcb_intersect_line_line(&line, Line))
return (pcb_true);
return (pcb_false);
@@ -745,40 +796,40 @@ pcb_bool IsLineInQuadrangle(PointType p[4], LineTypePtr Line)
/* ---------------------------------------------------------------------------
* checks if an arc crosses a square
*/
-pcb_bool IsArcInRectangle(Coord X1, Coord Y1, Coord X2, Coord Y2, ArcTypePtr Arc)
+pcb_bool pcb_is_arc_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_arc_t *Arc)
{
- LineType line;
+ pcb_line_t line;
/* construct a set of dummy lines and check each of them */
line.Thickness = 0;
- line.Flags = NoFlags();
+ line.Flags = pcb_no_flags();
/* upper-left to upper-right corner */
line.Point1.Y = line.Point2.Y = Y1;
line.Point1.X = X1;
line.Point2.X = X2;
- if (LineArcIntersect(&line, Arc))
+ if (pcb_intersect_line_arc(&line, Arc))
return (pcb_true);
/* upper-right to lower-right corner */
line.Point1.X = line.Point2.X = X2;
line.Point1.Y = Y1;
line.Point2.Y = Y2;
- if (LineArcIntersect(&line, Arc))
+ if (pcb_intersect_line_arc(&line, Arc))
return (pcb_true);
/* lower-right to lower-left corner */
line.Point1.Y = line.Point2.Y = Y2;
line.Point1.X = X1;
line.Point2.X = X2;
- if (LineArcIntersect(&line, Arc))
+ if (pcb_intersect_line_arc(&line, Arc))
return (pcb_true);
/* lower-left to upper-left corner */
line.Point1.X = line.Point2.X = X1;
line.Point1.Y = Y1;
line.Point2.Y = Y2;
- if (LineArcIntersect(&line, Arc))
+ if (pcb_intersect_line_arc(&line, Arc))
return (pcb_true);
return (pcb_false);
@@ -788,15 +839,15 @@ pcb_bool IsArcInRectangle(Coord X1, Coord Y1, Coord X2, Coord Y2, ArcTypePtr Arc
* Check if a circle of Radius with center at (X, Y) intersects a Pad.
* Written to enable arbitrary pad directions; for rounded pads, too.
*/
-pcb_bool IsPointInPad(Coord X, Coord Y, Coord Radius, PadTypePtr Pad)
+pcb_bool pcb_is_point_in_pad(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_pad_t *Pad)
{
double r, Sin, Cos;
- Coord x;
+ pcb_coord_t x;
/* Also used from line_callback with line type smaller than pad type;
use the smallest common subset; ->Thickness is still ok. */
- Coord t2 = (Pad->Thickness + 1) / 2, range;
- AnyLineObjectType pad = *(AnyLineObjectType *) Pad;
+ pcb_coord_t t2 = (Pad->Thickness + 1) / 2, range;
+ pcb_any_line_t pad = *(pcb_any_line_t *) Pad;
/* series of transforms saving range */
@@ -809,7 +860,7 @@ pcb_bool IsPointInPad(Coord X, Coord Y, Coord Radius, PadTypePtr Pad)
/* so, pad.Point1.X = pad.Point1.Y = 0; */
/* rotate round (0, 0) so that Point2 coordinates be (r, 0) */
- r = Distance(0, 0, pad.Point2.X, pad.Point2.Y);
+ r = pcb_distance(0, 0, pad.Point2.X, pad.Point2.Y);
if (r < .1) {
Cos = 1;
Sin = 0;
@@ -824,25 +875,25 @@ pcb_bool IsPointInPad(Coord X, Coord Y, Coord Radius, PadTypePtr Pad)
/* now pad.Point2.X = r; pad.Point2.Y = 0; */
/* take into account the ends */
- if (TEST_FLAG(PCB_FLAG_SQUARE, Pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pad)) {
r += Pad->Thickness;
X += t2;
}
if (Y < 0)
Y = -Y; /* range value is evident now */
- if (TEST_FLAG(PCB_FLAG_SQUARE, Pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pad)) {
if (X <= 0) {
if (Y <= t2)
range = -X;
else
- return Radius > Distance(0, t2, X, Y);
+ return Radius > pcb_distance(0, t2, X, Y);
}
else if (X >= r) {
if (Y <= t2)
range = X - r;
else
- return Radius > Distance(r, t2, X, Y);
+ return Radius > pcb_distance(r, t2, X, Y);
}
else
range = Y - t2;
@@ -850,18 +901,18 @@ pcb_bool IsPointInPad(Coord X, Coord Y, Coord Radius, PadTypePtr Pad)
else { /*Rounded pad: even more simple */
if (X <= 0)
- return (Radius + t2) > Distance(0, 0, X, Y);
+ return (Radius + t2) > pcb_distance(0, 0, X, Y);
else if (X >= r)
- return (Radius + t2) > Distance(r, 0, X, Y);
+ return (Radius + t2) > pcb_distance(r, 0, X, Y);
else
range = Y - t2;
}
return range < Radius;
}
-pcb_bool IsPointInBox(Coord X, Coord Y, BoxTypePtr box, Coord Radius)
+pcb_bool pcb_is_point_in_box(pcb_coord_t X, pcb_coord_t Y, pcb_box_t *box, pcb_coord_t Radius)
{
- Coord width, height, range;
+ pcb_coord_t width, height, range;
/* NB: Assumes box has point1 with numerically lower X and Y coordinates */
@@ -874,17 +925,17 @@ pcb_bool IsPointInBox(Coord X, Coord Y, BoxTypePtr box, Coord Radius)
if (X <= 0) {
if (Y < 0)
- return Radius > Distance(0, 0, X, Y);
+ return Radius > pcb_distance(0, 0, X, Y);
else if (Y > height)
- return Radius > Distance(0, height, X, Y);
+ return Radius > pcb_distance(0, height, X, Y);
else
range = -X;
}
else if (X >= width) {
if (Y < 0)
- return Radius > Distance(width, 0, X, Y);
+ return Radius > pcb_distance(width, 0, X, Y);
else if (Y > height)
- return Radius > Distance(width, height, X, Y);
+ return Radius > pcb_distance(width, height, X, Y);
else
range = X - width;
}
@@ -904,22 +955,24 @@ pcb_bool IsPointInBox(Coord X, Coord Y, BoxTypePtr box, Coord Radius)
* and in the case that the arc thickness is greater than
* the radius.
*/
-pcb_bool IsPointOnArc(Coord X, Coord Y, Coord Radius, ArcTypePtr Arc)
+pcb_bool pcb_is_point_on_arc(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_arc_t *Arc)
{
/* Calculate angle of point from arc center */
- double p_dist = Distance(X, Y, Arc->X, Arc->Y);
+ double p_dist = pcb_distance(X, Y, Arc->X, Arc->Y);
double p_cos = (X - Arc->X) / p_dist;
- Angle p_ang = acos(p_cos) * PCB_RAD_TO_DEG;
- Angle ang1, ang2;
+ pcb_angle_t p_ang = acos(p_cos) * PCB_RAD_TO_DEG;
+ pcb_angle_t ang1, ang2;
+#define angle_in_range(r1, r2, ang) (((ang) >= (r1)) && ((ang) <= (r2)))
+
/* Convert StartAngle, Delta into bounding angles in [0, 720) */
if (Arc->Delta > 0) {
- ang1 = NormalizeAngle(Arc->StartAngle);
- ang2 = NormalizeAngle(Arc->StartAngle + Arc->Delta);
+ ang1 = pcb_normalize_angle(Arc->StartAngle);
+ ang2 = pcb_normalize_angle(Arc->StartAngle + Arc->Delta);
}
else {
- ang1 = NormalizeAngle(Arc->StartAngle + Arc->Delta);
- ang2 = NormalizeAngle(Arc->StartAngle);
+ ang1 = pcb_normalize_angle(Arc->StartAngle + Arc->Delta);
+ ang2 = pcb_normalize_angle(Arc->StartAngle);
}
if (ang1 > ang2)
ang2 += 360;
@@ -931,23 +984,28 @@ pcb_bool IsPointOnArc(Coord X, Coord Y, Coord Radius, ArcTypePtr Arc)
p_ang = -p_ang;
p_ang += 180;
- /* Check point is outside arc range, check distance from endpoints */
- if (ang1 >= p_ang || ang2 <= p_ang) {
- Coord ArcX, ArcY;
+ /* Check point is outside arc range, check distance from endpoints
+ Need to check p_ang+360 too, because after the angle swaps above ang2
+ might be larger than 360 and that section of the arc shouldn't be missed
+ either. */
+ if (!angle_in_range(ang1, ang2, p_ang) && !angle_in_range(ang1, ang2, p_ang+360)) {
+ pcb_coord_t ArcX, ArcY;
ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + 180) / PCB_RAD_TO_DEG);
ArcY = Arc->Y - Arc->Width * sin((Arc->StartAngle + 180) / PCB_RAD_TO_DEG);
- if (Distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2)
+ if (pcb_distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2)
return pcb_true;
ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + Arc->Delta + 180) / PCB_RAD_TO_DEG);
ArcY = Arc->Y - Arc->Width * sin((Arc->StartAngle + Arc->Delta + 180) / PCB_RAD_TO_DEG);
- if (Distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2)
+ if (pcb_distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2)
return pcb_true;
return pcb_false;
}
+
/* If point is inside the arc range, just compare it to the arc */
- return fabs(Distance(X, Y, Arc->X, Arc->Y) - Arc->Width) < Radius + Arc->Thickness / 2;
+ return fabs(pcb_distance(X, Y, Arc->X, Arc->Y) - Arc->Width) < Radius + Arc->Thickness / 2;
+#undef angle_in_range
}
/* ---------------------------------------------------------------------------
@@ -964,7 +1022,7 @@ pcb_bool IsPointOnArc(Coord X, Coord Y, Coord Radius, ArcTypePtr Arc)
* Note that if Type includes PCB_TYPE_LOCKED, then the search includes
* locked items. Otherwise, locked items are ignored.
*/
-int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void **Result3, Coord X, Coord Y, Coord Radius)
+int pcb_search_obj_by_location(unsigned Type, void **Result1, void **Result2, void **Result3, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius)
{
void *r1, *r2, *r3;
void **pr1 = &r1, **pr2 = &r2, **pr3 = &r3;
@@ -983,7 +1041,7 @@ int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void *
SearchBox.Y2 = Y + Radius;
}
else {
- SearchBox = point_box(X, Y);
+ SearchBox = pcb_point_box(X, Y);
}
if (conf_core.editor.lock_names) {
@@ -1000,37 +1058,37 @@ int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void *
}
if (Type & PCB_TYPE_RATLINE && PCB->RatOn &&
- SearchRatLineByLocation(locked, (RatTypePtr *) Result1, (RatTypePtr *) Result2, (RatTypePtr *) Result3))
+ SearchRatLineByLocation(locked, (pcb_rat_t **) Result1, (pcb_rat_t **) Result2, (pcb_rat_t **) Result3))
return (PCB_TYPE_RATLINE);
- if (Type & PCB_TYPE_VIA && SearchViaByLocation(locked, (PinTypePtr *) Result1, (PinTypePtr *) Result2, (PinTypePtr *) Result3))
+ if (Type & PCB_TYPE_VIA && SearchViaByLocation(locked, (pcb_pin_t **) Result1, (pcb_pin_t **) Result2, (pcb_pin_t **) Result3))
return (PCB_TYPE_VIA);
- if (Type & PCB_TYPE_PIN && SearchPinByLocation(locked, (ElementTypePtr *) pr1, (PinTypePtr *) pr2, (PinTypePtr *) pr3))
+ if (Type & PCB_TYPE_PIN && SearchPinByLocation(locked, (pcb_element_t **) pr1, (pcb_pin_t **) pr2, (pcb_pin_t **) pr3))
HigherAvail = PCB_TYPE_PIN;
if (!HigherAvail && Type & PCB_TYPE_PAD &&
- SearchPadByLocation(locked, (ElementTypePtr *) pr1, (PadTypePtr *) pr2, (PadTypePtr *) pr3, pcb_false))
+ SearchPadByLocation(locked, (pcb_element_t **) pr1, (pcb_pad_t **) pr2, (pcb_pad_t **) pr3, pcb_false))
HigherAvail = PCB_TYPE_PAD;
if (!HigherAvail && Type & PCB_TYPE_ELEMENT_NAME &&
- SearchElementNameByLocation(locked, (ElementTypePtr *) pr1, (TextTypePtr *) pr2, (TextTypePtr *) pr3, pcb_false)) {
- BoxTypePtr box = &((TextTypePtr) r2)->BoundingBox;
+ SearchElementNameByLocation(locked, (pcb_element_t **) pr1, (pcb_text_t **) pr2, (pcb_text_t **) pr3, pcb_false)) {
+ pcb_box_t *box = &((pcb_text_t *) r2)->BoundingBox;
HigherBound = (double) (box->X2 - box->X1) * (double) (box->Y2 - box->Y1);
HigherAvail = PCB_TYPE_ELEMENT_NAME;
}
if (!HigherAvail && Type & PCB_TYPE_ELEMENT &&
- SearchElementByLocation(locked, (ElementTypePtr *) pr1, (ElementTypePtr *) pr2, (ElementTypePtr *) pr3, pcb_false)) {
- BoxTypePtr box = &((ElementTypePtr) r1)->BoundingBox;
+ SearchElementByLocation(locked, (pcb_element_t **) pr1, (pcb_element_t **) pr2, (pcb_element_t **) pr3, pcb_false)) {
+ pcb_box_t *box = &((pcb_element_t *) r1)->BoundingBox;
HigherBound = (double) (box->X2 - box->X1) * (double) (box->Y2 - box->Y1);
HigherAvail = PCB_TYPE_ELEMENT;
}
- for (i = -1; i < max_copper_layer + 1; i++) {
+ for (i = -1; i < pcb_max_copper_layer + 1; i++) {
if (i < 0)
SearchLayer = &PCB->Data->SILKLAYER;
- else if (i < max_copper_layer)
+ else if (i < pcb_max_copper_layer)
SearchLayer = LAYER_ON_STACK(i);
else {
SearchLayer = &PCB->Data->BACKSILKLAYER;
@@ -1040,30 +1098,35 @@ int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void *
if (SearchLayer->On) {
if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 &&
Type & PCB_TYPE_POLYGON_POINT &&
- SearchPointByLocation(locked, (LayerTypePtr *) Result1, (PolygonTypePtr *) Result2, (PointTypePtr *) Result3))
+ SearchPointByLocation(locked, (pcb_layer_t **) Result1, (pcb_polygon_t **) Result2, (pcb_point_t **) Result3))
return (PCB_TYPE_POLYGON_POINT);
if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 &&
Type & PCB_TYPE_LINE_POINT &&
- SearchLinePointByLocation(locked, (LayerTypePtr *) Result1, (LineTypePtr *) Result2, (PointTypePtr *) Result3))
+ SearchLinePointByLocation(locked, (pcb_layer_t **) Result1, (pcb_line_t **) Result2, (pcb_point_t **) Result3))
return (PCB_TYPE_LINE_POINT);
+ if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 &&
+ Type & PCB_TYPE_ARC_POINT &&
+ SearchArcPointByLocation(locked, (pcb_layer_t **) Result1, (pcb_arc_t **) Result2, (int **) Result3))
+ return (PCB_TYPE_ARC_POINT);
+
if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 && Type & PCB_TYPE_LINE
- && SearchLineByLocation(locked, (LayerTypePtr *) Result1, (LineTypePtr *) Result2, (LineTypePtr *) Result3))
+ && SearchLineByLocation(locked, (pcb_layer_t **) Result1, (pcb_line_t **) Result2, (pcb_line_t **) Result3))
return (PCB_TYPE_LINE);
if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 && Type & PCB_TYPE_ARC &&
- SearchArcByLocation(locked, (LayerTypePtr *) Result1, (ArcTypePtr *) Result2, (ArcTypePtr *) Result3))
+ SearchArcByLocation(locked, (pcb_layer_t **) Result1, (pcb_arc_t **) Result2, (pcb_arc_t **) Result3))
return (PCB_TYPE_ARC);
if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 && Type & PCB_TYPE_TEXT
- && SearchTextByLocation(locked, (LayerTypePtr *) Result1, (TextTypePtr *) Result2, (TextTypePtr *) Result3))
+ && SearchTextByLocation(locked, (pcb_layer_t **) Result1, (pcb_text_t **) Result2, (pcb_text_t **) Result3))
return (PCB_TYPE_TEXT);
if (Type & PCB_TYPE_POLYGON &&
- SearchPolygonByLocation(locked, (LayerTypePtr *) Result1, (PolygonTypePtr *) Result2, (PolygonTypePtr *) Result3)) {
+ SearchPolygonByLocation(locked, (pcb_layer_t **) Result1, (pcb_polygon_t **) Result2, (pcb_polygon_t **) Result3)) {
if (HigherAvail) {
- BoxTypePtr box = &(*(PolygonTypePtr *) Result2)->BoundingBox;
+ pcb_box_t *box = &(*(pcb_polygon_t **) Result2)->BoundingBox;
double area = (double) (box->X2 - box->X1) * (double) (box->X2 - box->X1);
if (HigherBound < area)
break;
@@ -1109,15 +1172,15 @@ int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void *
return (PCB_TYPE_NONE);
if (Type & PCB_TYPE_PAD &&
- SearchPadByLocation(locked, (ElementTypePtr *) Result1, (PadTypePtr *) Result2, (PadTypePtr *) Result3, pcb_true))
+ SearchPadByLocation(locked, (pcb_element_t **) Result1, (pcb_pad_t **) Result2, (pcb_pad_t **) Result3, pcb_true))
return (PCB_TYPE_PAD);
if (Type & PCB_TYPE_ELEMENT_NAME &&
- SearchElementNameByLocation(locked, (ElementTypePtr *) Result1, (TextTypePtr *) Result2, (TextTypePtr *) Result3, pcb_true))
+ SearchElementNameByLocation(locked, (pcb_element_t **) Result1, (pcb_text_t **) Result2, (pcb_text_t **) Result3, pcb_true))
return (PCB_TYPE_ELEMENT_NAME);
if (Type & PCB_TYPE_ELEMENT &&
- SearchElementByLocation(locked, (ElementTypePtr *) Result1, (ElementTypePtr *) Result2, (ElementTypePtr *) Result3, pcb_true))
+ SearchElementByLocation(locked, (pcb_element_t **) Result1, (pcb_element_t **) Result2, (pcb_element_t **) Result3, pcb_true))
return (PCB_TYPE_ELEMENT);
return (PCB_TYPE_NONE);
@@ -1131,10 +1194,10 @@ int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void *
* the results.
* A type value is returned too which is PCB_TYPE_NONE if no objects has been found.
*/
-int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Result3, int ID, int type)
+int pcb_search_obj_by_id(pcb_data_t *Base, void **Result1, void **Result2, void **Result3, int ID, int type)
{
if (type == PCB_TYPE_LINE || type == PCB_TYPE_LINE_POINT) {
- ALLLINE_LOOP(Base);
+ PCB_LINE_ALL_LOOP(Base);
{
if (line->ID == ID) {
*Result1 = (void *) layer;
@@ -1154,10 +1217,10 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_LINE_POINT);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
- if (type == PCB_TYPE_ARC) {
- ALLARC_LOOP(Base);
+ if (type == PCB_TYPE_ARC || type == PCB_TYPE_ARC_POINT) {
+ PCB_ARC_ALL_LOOP(Base);
{
if (arc->ID == ID) {
*Result1 = (void *) layer;
@@ -1165,11 +1228,11 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_ARC);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (type == PCB_TYPE_TEXT) {
- ALLTEXT_LOOP(Base);
+ PCB_TEXT_ALL_LOOP(Base);
{
if (text->ID == ID) {
*Result1 = (void *) layer;
@@ -1177,11 +1240,11 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_TEXT);
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (type == PCB_TYPE_POLYGON || type == PCB_TYPE_POLYGON_POINT) {
- ALLPOLYGON_LOOP(Base);
+ PCB_POLY_ALL_LOOP(Base);
{
if (polygon->ID == ID) {
*Result1 = (void *) layer;
@@ -1189,7 +1252,7 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_POLYGON);
}
if (type == PCB_TYPE_POLYGON_POINT)
- POLYGONPOINT_LOOP(polygon);
+ PCB_POLY_POINT_LOOP(polygon);
{
if (point->ID == ID) {
*Result1 = (void *) layer;
@@ -1198,23 +1261,23 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_POLYGON_POINT);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (type == PCB_TYPE_VIA) {
- VIA_LOOP(Base);
+ PCB_VIA_LOOP(Base);
{
if (via->ID == ID) {
*Result1 = *Result2 = *Result3 = (void *) via;
return (PCB_TYPE_VIA);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (type == PCB_TYPE_RATLINE || type == PCB_TYPE_LINE_POINT) {
- RAT_LOOP(Base);
+ PCB_RAT_LOOP(Base);
{
if (line->ID == ID) {
*Result1 = *Result2 = *Result3 = (void *) line;
@@ -1233,20 +1296,20 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_LINE_POINT);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (type == PCB_TYPE_ELEMENT || type == PCB_TYPE_PAD || type == PCB_TYPE_PIN
|| type == PCB_TYPE_ELEMENT_LINE || type == PCB_TYPE_ELEMENT_NAME || type == PCB_TYPE_ELEMENT_ARC)
/* check pins and elementnames too */
- ELEMENT_LOOP(Base);
+ PCB_ELEMENT_LOOP(Base);
{
if (element->ID == ID) {
*Result1 = *Result2 = *Result3 = (void *) element;
return (PCB_TYPE_ELEMENT);
}
if (type == PCB_TYPE_ELEMENT_LINE)
- ELEMENTLINE_LOOP(element);
+ PCB_ELEMENT_PCB_LINE_LOOP(element);
{
if (line->ID == ID) {
*Result1 = (void *) element;
@@ -1254,9 +1317,9 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_ELEMENT_LINE);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (type == PCB_TYPE_ELEMENT_ARC)
- ARC_LOOP(element);
+ PCB_ARC_LOOP(element);
{
if (arc->ID == ID) {
*Result1 = (void *) element;
@@ -1264,9 +1327,9 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_ELEMENT_ARC);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (type == PCB_TYPE_ELEMENT_NAME)
- ELEMENTTEXT_LOOP(element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
if (text->ID == ID) {
*Result1 = (void *) element;
@@ -1274,9 +1337,9 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_ELEMENT_NAME);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (type == PCB_TYPE_PIN)
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
if (pin->ID == ID) {
*Result1 = (void *) element;
@@ -1284,9 +1347,9 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_PIN);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (type == PCB_TYPE_PAD)
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
if (pad->ID == ID) {
*Result1 = (void *) element;
@@ -1294,11 +1357,11 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
return (PCB_TYPE_PAD);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
- Message(PCB_MSG_DEFAULT, "hace: Internal error, search for ID %d failed\n", ID);
+ pcb_message(PCB_MSG_ERROR, "hace: Internal error, search for ID %d failed\n", ID);
return (PCB_TYPE_NONE);
}
@@ -1306,46 +1369,43 @@ int SearchObjectByID(DataTypePtr Base, void **Result1, void **Result2, void **Re
* searches for an element by its board name.
* The function returns a pointer to the element, NULL if not found
*/
-ElementTypePtr SearchElementByName(DataTypePtr Base, const char *Name)
+pcb_element_t *pcb_search_elem_by_name(pcb_data_t *Base, const char *Name)
{
- ElementTypePtr result = NULL;
+ pcb_element_t *result = NULL;
- ELEMENT_LOOP(Base);
+ PCB_ELEMENT_LOOP(Base);
{
- if (element->Name[1].TextString && NSTRCMP(element->Name[1].TextString, Name) == 0) {
+ if (element->Name[1].TextString && PCB_NSTRCMP(element->Name[1].TextString, Name) == 0) {
result = element;
return (result);
}
}
- END_LOOP;
+ PCB_END_LOOP;
return result;
}
/* ---------------------------------------------------------------------------
* searches the cursor position for the type
*/
-int SearchScreen(Coord X, Coord Y, int Type, void **Result1, void **Result2, void **Result3)
+int pcb_search_screen(pcb_coord_t X, pcb_coord_t Y, int Type, void **Result1, void **Result2, void **Result3)
{
- int ans;
-
- ans = SearchObjectByLocation(Type, Result1, Result2, Result3, X, Y, SLOP * pixel_slop);
- return (ans);
+ return pcb_search_obj_by_location(Type, Result1, Result2, Result3, X, Y, PCB_SLOP * pcb_pixel_slop);
}
/* ---------------------------------------------------------------------------
* searches the cursor position for the type
*/
-int SearchScreenGridSlop(Coord X, Coord Y, int Type, void **Result1, void **Result2, void **Result3)
+int pcb_search_grid_slop(pcb_coord_t X, pcb_coord_t Y, int Type, void **Result1, void **Result2, void **Result3)
{
int ans;
- ans = SearchObjectByLocation(Type, Result1, Result2, Result3, X, Y, PCB->Grid / 2);
+ ans = pcb_search_obj_by_location(Type, Result1, Result2, Result3, X, Y, PCB->Grid / 2);
return (ans);
}
-int lines_intersect(Coord ax1, Coord ay1, Coord ax2, Coord ay2, Coord bx1, Coord by1, Coord bx2, Coord by2)
+int pcb_lines_intersect(pcb_coord_t ax1, pcb_coord_t ay1, pcb_coord_t ax2, pcb_coord_t ay2, pcb_coord_t bx1, pcb_coord_t by1, pcb_coord_t bx2, pcb_coord_t by2)
{
-/* TODO: this should be long double if Coord is 64 bits */
+/* TODO: this should be long double if pcb_coord_t is 64 bits */
double ua, xi, yi, X1, Y1, X2, Y2, X3, Y3, X4, Y4, tmp;
int is_a_pt, is_b_pt;
@@ -1373,6 +1433,18 @@ int lines_intersect(Coord ax1, Coord ay1, Coord ax2, Coord ay2, Coord bx1, Coord
Y4 = by2;
tmp = ((Y4 - Y3) * (X2 - X1) - (X4 - X3) * (Y2 - Y1));
+
+ if (tmp == 0) {
+ /* Corner case: parallel lines; intersect only if the endpoint of either line
+ is on the other line */
+ return
+ is_point_on_line(ax1, ay1, bx1, by1, bx2, by2) ||
+ is_point_on_line(ax2, ay2, bx1, by1, bx2, by2) ||
+ is_point_on_line(bx1, by1, ax1, ay1, ax2, ay2) ||
+ is_point_on_line(bx2, by2, ax1, ay1, ax2, ay2);
+ }
+
+
ua = ((X4 - X3) * (Y1 - Y3) - (Y4 - Y3) * (X1 - X3)) / tmp;
/* ub = ((X2 - X1) * (Y1 - Y3) - (Y2 - Y1) * (X1 - X3)) / tmp;*/
xi = X1 + ua * (X2 - X1);
diff --git a/src/search.h b/src/search.h
index e7f0aaf..ac86c14 100644
--- a/src/search.h
+++ b/src/search.h
@@ -29,134 +29,136 @@
#ifndef PCB_SEARCH_H
#define PCB_SEARCH_H
-#include "global.h"
+#include "obj_common.h"
+#include "rats.h"
#include "misc_util.h"
-int lines_intersect(Coord ax1, Coord ay1, Coord ax2, Coord ay2, Coord bx1, Coord by1, Coord bx2, Coord by2);
+int pcb_lines_intersect(pcb_coord_t ax1, pcb_coord_t ay1, pcb_coord_t ax2, pcb_coord_t ay2, pcb_coord_t bx1, pcb_coord_t by1, pcb_coord_t bx2, pcb_coord_t by2);
-#define SLOP 5
+#define PCB_SLOP 5
/* ---------------------------------------------------------------------------
* some useful macros
*/
/* ---------------------------------------------------------------------------
* some define to check for 'type' in box
*/
-#define POINT_IN_BOX(x,y,b) \
- (IS_BOX_NEGATIVE(b) ? \
+#define PCB_POINT_IN_BOX(x,y,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? \
((x) >= (b)->X2 && (x) <= (b)->X1 && (y) >= (b)->Y2 && (y) <= (b)->Y1) \
: \
((x) >= (b)->X1 && (x) <= (b)->X2 && (y) >= (b)->Y1 && (y) <= (b)->Y2))
-#define VIA_OR_PIN_IN_BOX(v,b) \
- POINT_IN_BOX((v)->X,(v)->Y,(b))
+#define PCB_VIA_OR_PIN_IN_BOX(v,b) \
+ PCB_POINT_IN_BOX((v)->X,(v)->Y,(b))
-#define LINE_IN_BOX(l,b) \
- (POINT_IN_BOX((l)->Point1.X,(l)->Point1.Y,(b)) && \
- POINT_IN_BOX((l)->Point2.X,(l)->Point2.Y,(b)))
+#define PCB_LINE_IN_BOX(l,b) \
+ (PCB_POINT_IN_BOX((l)->Point1.X,(l)->Point1.Y,(b)) && \
+ PCB_POINT_IN_BOX((l)->Point2.X,(l)->Point2.Y,(b)))
-#define PAD_IN_BOX(p,b) LINE_IN_BOX((LineTypePtr)(p),(b))
+#define PCB_PAD_IN_BOX(p,b) PCB_LINE_IN_BOX((pcb_line_t *)(p),(b))
-#define BOX_IN_BOX(b1,b) \
+#define PCB_BOX_IN_BOX(b1,b) \
((b1)->X1 >= (b)->X1 && (b1)->X2 <= (b)->X2 && \
((b1)->Y1 >= (b)->Y1 && (b1)->Y2 <= (b)->Y2))
-#define TEXT_IN_BOX(t,b) \
- (BOX_IN_BOX(&((t)->BoundingBox), (b)))
+#define PCB_TEXT_IN_BOX(t,b) \
+ (PCB_BOX_IN_BOX(&((t)->BoundingBox), (b)))
-#define POLYGON_IN_BOX(p,b) \
- (BOX_IN_BOX(&((p)->BoundingBox), (b)))
+#define PCB_POLYGON_IN_BOX(p,b) \
+ (PCB_BOX_IN_BOX(&((p)->BoundingBox), (b)))
-#define ELEMENT_IN_BOX(e,b) \
- (BOX_IN_BOX(&((e)->BoundingBox), (b)))
+#define PCB_ELEMENT_IN_BOX(e,b) \
+ (PCB_BOX_IN_BOX(&((e)->BoundingBox), (b)))
-#define ARC_IN_BOX(a,b) \
- (BOX_IN_BOX(&((a)->BoundingBox), (b)))
+#define PCB_ARC_IN_BOX(a,b) \
+ (PCB_BOX_IN_BOX(&((a)->BoundingBox), (b)))
/* == the same but accept if any part of the object touches the box == */
-#define POINT_IN_CIRCLE(x, y, cx, cy, r) \
- (Distance2(x, y, cx, cy) <= (double)(r) * (double)(r))
+#define PCB_POINT_IN_CIRCLE(x, y, cx, cy, r) \
+ (pcb_distance2(x, y, cx, cy) <= (double)(r) * (double)(r))
-#define CIRCLE_TOUCHES_BOX(cx, cy, r, b) \
- ( POINT_IN_BOX((cx)-(r),(cy),(b)) || POINT_IN_BOX((cx)+(r),(cy),(b)) || POINT_IN_BOX((cx),(cy)-(r),(b)) || POINT_IN_BOX((cx),(cy)+(r),(b)) \
- || POINT_IN_CIRCLE((b)->X1, (b)->Y1, (cx), (cy), (r)) || POINT_IN_CIRCLE((b)->X2, (b)->Y1, (cx), (cy), (r)) || POINT_IN_CIRCLE((b)->X1, (b)->Y2, (cx), (cy), (r)) || POINT_IN_CIRCLE((b)->X2, (b)->Y2, (cx), (cy), (r)))
+#define PCB_CIRCLE_TOUCHES_BOX(cx, cy, r, b) \
+ ( PCB_POINT_IN_BOX((cx)-(r),(cy),(b)) || PCB_POINT_IN_BOX((cx)+(r),(cy),(b)) || PCB_POINT_IN_BOX((cx),(cy)-(r),(b)) || PCB_POINT_IN_BOX((cx),(cy)+(r),(b)) \
+ || PCB_POINT_IN_CIRCLE((b)->X1, (b)->Y1, (cx), (cy), (r)) || PCB_POINT_IN_CIRCLE((b)->X2, (b)->Y1, (cx), (cy), (r)) || PCB_POINT_IN_CIRCLE((b)->X1, (b)->Y2, (cx), (cy), (r)) || PCB_POINT_IN_CIRCLE((b)->X2, (b)->Y2, (cx), (cy), (r)))
-#define VIA_OR_PIN_TOUCHES_BOX(v,b) \
- CIRCLE_TOUCHES_BOX((v)->X,(v)->Y,((v)->Thickness + (v)->DrillingHole/2),(b))
+#define PCB_VIA_OR_PIN_TOUCHES_BOX(v,b) \
+ PCB_CIRCLE_TOUCHES_BOX((v)->X,(v)->Y,((v)->Thickness + (v)->DrillingHole/2),(b))
-#define LINE_TOUCHES_BOX(l,b) \
- ( lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X1, (b)->Y1, (b)->X2, (b)->Y1) \
- || lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X1, (b)->Y1, (b)->X1, (b)->Y2) \
- || lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X2, (b)->Y2, (b)->X1, (b)->Y2) \
- || lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X2, (b)->Y2, (b)->X2, (b)->Y1) \
- || LINE_IN_BOX((l), (b)))
+#define PCB_LINE_TOUCHES_BOX(l,b) \
+ ( pcb_lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X1, (b)->Y1, (b)->X2, (b)->Y1) \
+ || pcb_lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X1, (b)->Y1, (b)->X1, (b)->Y2) \
+ || pcb_lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X2, (b)->Y2, (b)->X1, (b)->Y2) \
+ || pcb_lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X2, (b)->Y2, (b)->X2, (b)->Y1) \
+ || PCB_LINE_IN_BOX((l), (b)))
-#define PAD_TOUCHES_BOX(p,b) LINE_TOUCHES_BOX((LineTypePtr)(p),(b))
+#define PCB_PAD_TOUCHES_BOX(p,b) PCB_LINE_TOUCHES_BOX((pcb_line_t *)(p),(b))
/* a corner of either box is within the other, or edges cross */
-#define BOX_TOUCHES_BOX(b1,b2) \
- ( POINT_IN_BOX((b1)->X1,(b1)->Y1,b2) || POINT_IN_BOX((b1)->X1,(b1)->Y2,b2) || POINT_IN_BOX((b1)->X2,(b1)->Y1,b2) || POINT_IN_BOX((b1)->X2,(b1)->Y2,b2) \
- || POINT_IN_BOX((b2)->X1,(b2)->Y1,b1) || POINT_IN_BOX((b2)->X1,(b2)->Y2,b1) || POINT_IN_BOX((b2)->X2,(b2)->Y1,b1) || POINT_IN_BOX((b2)->X2,(b2)->Y2,b1) \
- || lines_intersect((b1)->X1,(b1)->Y1, (b1)->X2,(b1)->Y1, (b2)->X1,(b2)->Y1, (b2)->X1,(b2)->Y2) \
- || lines_intersect((b2)->X1,(b2)->Y1, (b2)->X2,(b2)->Y1, (b1)->X1,(b1)->Y1, (b1)->X1,(b1)->Y2))
+#define PCB_BOX_TOUCHES_BOX(b1,b2) \
+ ( PCB_POINT_IN_BOX((b1)->X1,(b1)->Y1,b2) || PCB_POINT_IN_BOX((b1)->X1,(b1)->Y2,b2) || PCB_POINT_IN_BOX((b1)->X2,(b1)->Y1,b2) || PCB_POINT_IN_BOX((b1)->X2,(b1)->Y2,b2) \
+ || PCB_POINT_IN_BOX((b2)->X1,(b2)->Y1,b1) || PCB_POINT_IN_BOX((b2)->X1,(b2)->Y2,b1) || PCB_POINT_IN_BOX((b2)->X2,(b2)->Y1,b1) || PCB_POINT_IN_BOX((b2)->X2,(b2)->Y2,b1) \
+ || pcb_lines_intersect((b1)->X1,(b1)->Y1, (b1)->X2,(b1)->Y1, (b2)->X1,(b2)->Y1, (b2)->X1,(b2)->Y2) \
+ || pcb_lines_intersect((b2)->X1,(b2)->Y1, (b2)->X2,(b2)->Y1, (b1)->X1,(b1)->Y1, (b1)->X1,(b1)->Y2))
-#define TEXT_TOUCHES_BOX(t,b) \
- (BOX_TOUCHES_BOX(&((t)->BoundingBox), (b)))
+#define PCB_TEXT_TOUCHES_BOX(t,b) \
+ (PCB_BOX_TOUCHES_BOX(&((t)->BoundingBox), (b)))
-#define POLYGON_TOUCHES_BOX(p,b) \
- (BOX_TOUCHES_BOX(&((p)->BoundingBox), (b)))
+#define PCB_POLYGON_TOUCHES_BOX(p,b) \
+ (PCB_BOX_TOUCHES_BOX(&((p)->BoundingBox), (b)))
-#define ELEMENT_TOUCHES_BOX(e,b) \
- (BOX_TOUCHES_BOX(&((e)->BoundingBox), (b)))
+#define PCB_ELEMENT_TOUCHES_BOX(e,b) \
+ (PCB_BOX_TOUCHES_BOX(&((e)->BoundingBox), (b)))
-#define ARC_TOUCHES_BOX(a,b) \
- (BOX_TOUCHES_BOX(&((a)->BoundingBox), (b)))
+#define PCB_ARC_TOUCHES_BOX(a,b) \
+ (PCB_BOX_TOUCHES_BOX(&((a)->BoundingBox), (b)))
/* == the combination of *_IN_* and *_TOUCHES_*: use IN for positive boxes == */
-#define IS_BOX_NEGATIVE(b) (((b)->X2 < (b)->X1) || ((b)->Y2 < (b)->Y1))
+#define PCB_IS_BOX_NEGATIVE(b) (((b)->X2 < (b)->X1) || ((b)->Y2 < (b)->Y1))
-#define BOX_NEAR_BOX(b1,b) \
- (IS_BOX_NEGATIVE(b) ? BOX_TOUCHES_BOX(b1,b) : BOX_IN_BOX(b1,b))
+#define PCB_BOX_NEAR_BOX(b1,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_BOX_TOUCHES_BOX(b1,b) : PCB_BOX_IN_BOX(b1,b))
-#define VIA_OR_PIN_NEAR_BOX(v,b) \
- (IS_BOX_NEGATIVE(b) ? VIA_OR_PIN_TOUCHES_BOX(v,b) : VIA_OR_PIN_IN_BOX(v,b))
+#define PCB_VIA_OR_PIN_NEAR_BOX(v,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_VIA_OR_PIN_TOUCHES_BOX(v,b) : PCB_VIA_OR_PIN_IN_BOX(v,b))
-#define LINE_NEAR_BOX(l,b) \
- (IS_BOX_NEGATIVE(b) ? LINE_TOUCHES_BOX(l,b) : LINE_IN_BOX(l,b))
+#define PCB_LINE_NEAR_BOX(l,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_LINE_TOUCHES_BOX(l,b) : PCB_LINE_IN_BOX(l,b))
-#define PAD_NEAR_BOX(p,b) \
- (IS_BOX_NEGATIVE(b) ? PAD_TOUCHES_BOX(p,b) : PAD_IN_BOX(p,b))
+#define PCB_PAD_NEAR_BOX(p,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_PAD_TOUCHES_BOX(p,b) : PCB_PAD_IN_BOX(p,b))
-#define TEXT_NEAR_BOX(t,b) \
- (IS_BOX_NEGATIVE(b) ? TEXT_TOUCHES_BOX(t,b) : TEXT_IN_BOX(t,b))
+#define PCB_TEXT_NEAR_BOX(t,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_TEXT_TOUCHES_BOX(t,b) : PCB_TEXT_IN_BOX(t,b))
-#define POLYGON_NEAR_BOX(p,b) \
- (IS_BOX_NEGATIVE(b) ? POLYGON_TOUCHES_BOX(p,b) : POLYGON_IN_BOX(p,b))
+#define PCB_POLYGON_NEAR_BOX(p,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_POLYGON_TOUCHES_BOX(p,b) : PCB_POLYGON_IN_BOX(p,b))
-#define ELEMENT_NEAR_BOX(e,b) \
- (IS_BOX_NEGATIVE(b) ? ELEMENT_TOUCHES_BOX(e,b) : ELEMENT_IN_BOX(e,b))
+#define PCB_ELEMENT_NEAR_BOX(e,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_ELEMENT_TOUCHES_BOX(e,b) : PCB_ELEMENT_IN_BOX(e,b))
-#define ARC_NEAR_BOX(a,b) \
- (IS_BOX_NEGATIVE(b) ? ARC_TOUCHES_BOX(a,b) : ARC_IN_BOX(a,b))
+#define PCB_ARC_NEAR_BOX(a,b) \
+ (PCB_IS_BOX_NEGATIVE(b) ? PCB_ARC_TOUCHES_BOX(a,b) : PCB_ARC_IN_BOX(a,b))
/* ---------------------------------------------------------------------------
* prototypes
*/
-pcb_bool IsPointOnLine(Coord, Coord, Coord, LineTypePtr);
-pcb_bool IsPointOnPin(Coord, Coord, Coord, PinTypePtr);
-pcb_bool IsPointOnArc(Coord, Coord, Coord, ArcTypePtr);
-pcb_bool IsPointOnLineEnd(Coord, Coord, RatTypePtr);
-pcb_bool IsLineInRectangle(Coord, Coord, Coord, Coord, LineTypePtr);
-pcb_bool IsLineInQuadrangle(PointType p[4], LineTypePtr Line);
-pcb_bool IsArcInRectangle(Coord, Coord, Coord, Coord, ArcTypePtr);
-pcb_bool IsPointInPad(Coord, Coord, Coord, PadTypePtr);
-pcb_bool IsPointInBox(Coord, Coord, BoxTypePtr, Coord);
-int SearchObjectByLocation(unsigned, void **, void **, void **, Coord, Coord, Coord);
-int SearchScreen(Coord, Coord, int, void **, void **, void **);
-int SearchScreenGridSlop(Coord, Coord, int, void **, void **, void **);
-int SearchObjectByID(DataTypePtr, void **, void **, void **, int, int);
-ElementTypePtr SearchElementByName(DataTypePtr, const char *);
+pcb_bool pcb_is_point_on_line(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_line_t *);
+pcb_bool pcb_is_point_in_pin(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_pin_t *);
+pcb_bool pcb_is_point_on_arc(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_arc_t *);
+pcb_bool pcb_is_point_on_line_end(pcb_coord_t, pcb_coord_t, pcb_rat_t *);
+pcb_bool pcb_is_line_in_rectangle(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_line_t *);
+pcb_bool pcb_is_line_in_quadrangle(pcb_point_t p[4], pcb_line_t *Line);
+pcb_bool pcb_is_arc_in_rectangle(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_arc_t *);
+pcb_bool pcb_is_point_in_pad(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_pad_t *);
+pcb_bool pcb_is_point_in_box(pcb_coord_t, pcb_coord_t, pcb_box_t *, pcb_coord_t);
+
+int pcb_search_obj_by_location(unsigned, void **, void **, void **, pcb_coord_t, pcb_coord_t, pcb_coord_t);
+int pcb_search_screen(pcb_coord_t, pcb_coord_t, int, void **, void **, void **);
+int pcb_search_grid_slop(pcb_coord_t, pcb_coord_t, int, void **, void **, void **);
+int pcb_search_obj_by_id(pcb_data_t *, void **, void **, void **, int, int);
+pcb_element_t *pcb_search_elem_by_name(pcb_data_t *, const char *);
#endif
diff --git a/src/select.c b/src/select.c
index 75dcbfe..8b78a52 100644
--- a/src/select.c
+++ b/src/select.c
@@ -31,46 +31,54 @@
#include "config.h"
#include "conf_core.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "search.h"
#include "select.h"
#include "undo.h"
-#include "rats.h"
-#include "misc.h"
#include "find.h"
-#include "layer.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+
+#include "obj_elem_draw.h"
+#include "obj_pad_draw.h"
+#include "obj_arc_draw.h"
+#include "obj_pinvia_draw.h"
+#include "obj_line_draw.h"
+#include "obj_poly_draw.h"
+#include "obj_text_draw.h"
+#include "obj_rat_draw.h"
#include <genregex/regex_sei.h>
-void pcb_select_element(ElementType *element, pcb_change_flag_t how, int redraw)
+void pcb_select_element(pcb_element_t *element, pcb_change_flag_t how, int redraw)
{
/* select all pins and names of the element */
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- CHANGE_FLAG(how, PCB_FLAG_SELECTED, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, pin);
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- CHANGE_FLAG(how, PCB_FLAG_SELECTED, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, pad);
}
- END_LOOP;
- ELEMENTTEXT_LOOP(element);
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text);
- CHANGE_FLAG(how, PCB_FLAG_SELECTED, text);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT_NAME, element, text, text);
+ PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, text);
}
- END_LOOP;
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element);
- CHANGE_FLAG(how, PCB_FLAG_SELECTED, element);
+ PCB_END_LOOP;
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT, element, element, element);
+ PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, element);
if (redraw) {
- if (PCB->ElementOn && ((TEST_FLAG(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn))
+ if (PCB->ElementOn && ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) != 0) == PCB_SWAP_IDENT || PCB->InvisibleObjectsOn))
if (PCB->ElementOn) {
DrawElementName(element);
DrawElementPackage(element);
@@ -80,15 +88,15 @@ void pcb_select_element(ElementType *element, pcb_change_flag_t how, int redraw)
}
}
-void pcb_select_element_name(ElementType *element, pcb_change_flag_t how, int redraw)
+void pcb_select_element_name(pcb_element_t *element, pcb_change_flag_t how, int redraw)
{
/* select all names of the element */
- ELEMENTTEXT_LOOP(element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text);
- CHANGE_FLAG(how, PCB_FLAG_SELECTED, text);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT_NAME, element, text, text);
+ PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, text);
}
- END_LOOP;
+ PCB_END_LOOP;
if (redraw)
DrawElementName(element);
@@ -99,101 +107,101 @@ void pcb_select_element_name(ElementType *element, pcb_change_flag_t how, int re
* toggles the selection of any kind of object
* the different types are defined by search.h
*/
-pcb_bool SelectObject(void)
+pcb_bool pcb_select_object(void)
{
void *ptr1, *ptr2, *ptr3;
- LayerTypePtr layer;
+ pcb_layer_t *layer;
int type;
pcb_bool changed = pcb_true;
- type = SearchScreen(Crosshair.X, Crosshair.Y, SELECT_TYPES, &ptr1, &ptr2, &ptr3);
- if (type == PCB_TYPE_NONE || TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2))
+ type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_SELECT_TYPES, &ptr1, &ptr2, &ptr3);
+ if (type == PCB_TYPE_NONE || PCB_FLAG_TEST(PCB_FLAG_LOCK, (pcb_pin_t *) ptr2))
return (pcb_false);
switch (type) {
case PCB_TYPE_VIA:
- AddObjectToFlagUndoList(PCB_TYPE_VIA, ptr1, ptr1, ptr1);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) ptr1);
- DrawVia((PinTypePtr) ptr1);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, ptr1, ptr1, ptr1);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, (pcb_pin_t *) ptr1);
+ DrawVia((pcb_pin_t *) ptr1);
break;
case PCB_TYPE_LINE:
{
- LineType *line = (LineTypePtr) ptr2;
+ pcb_line_t *line = (pcb_line_t *) ptr2;
- layer = (LayerTypePtr) ptr1;
- AddObjectToFlagUndoList(PCB_TYPE_LINE, ptr1, ptr2, ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, line);
+ layer = (pcb_layer_t *) ptr1;
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, ptr1, ptr2, ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, line);
DrawLine(layer, line);
break;
}
case PCB_TYPE_RATLINE:
{
- RatTypePtr rat = (RatTypePtr) ptr2;
+ pcb_rat_t *rat = (pcb_rat_t *) ptr2;
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, ptr1, ptr1, ptr1);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, rat);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, ptr1, ptr1, ptr1);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, rat);
DrawRat(rat);
break;
}
case PCB_TYPE_ARC:
{
- ArcType *arc = (ArcTypePtr) ptr2;
+ pcb_arc_t *arc = (pcb_arc_t *) ptr2;
- layer = (LayerTypePtr) ptr1;
- AddObjectToFlagUndoList(PCB_TYPE_ARC, ptr1, ptr2, ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, arc);
+ layer = (pcb_layer_t *) ptr1;
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, ptr1, ptr2, ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, arc);
DrawArc(layer, arc);
break;
}
case PCB_TYPE_TEXT:
{
- TextType *text = (TextTypePtr) ptr2;
+ pcb_text_t *text = (pcb_text_t *) ptr2;
- layer = (LayerTypePtr) ptr1;
- AddObjectToFlagUndoList(PCB_TYPE_TEXT, ptr1, ptr2, ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, text);
+ layer = (pcb_layer_t *) ptr1;
+ pcb_undo_add_obj_to_flag(PCB_TYPE_TEXT, ptr1, ptr2, ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, text);
DrawText(layer, text);
break;
}
case PCB_TYPE_POLYGON:
{
- PolygonType *poly = (PolygonTypePtr) ptr2;
+ pcb_polygon_t *poly = (pcb_polygon_t *) ptr2;
- layer = (LayerTypePtr) ptr1;
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, ptr1, ptr2, ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, poly);
+ layer = (pcb_layer_t *) ptr1;
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, ptr1, ptr2, ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, poly);
DrawPolygon(layer, poly);
/* changing memory order no longer effects draw order */
break;
}
case PCB_TYPE_PIN:
- AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, ptr2, ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) ptr2);
- DrawPin((PinTypePtr) ptr2);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, ptr1, ptr2, ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, (pcb_pin_t *) ptr2);
+ DrawPin((pcb_pin_t *) ptr2);
break;
case PCB_TYPE_PAD:
- AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, ptr2, ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, (PadTypePtr) ptr2);
- DrawPad((PadTypePtr) ptr2);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, ptr1, ptr2, ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, (pcb_pad_t *) ptr2);
+ DrawPad((pcb_pad_t *) ptr2);
break;
case PCB_TYPE_ELEMENT_NAME:
- pcb_select_element_name((ElementType *) ptr1, PCB_CHGFLG_TOGGLE, 1);
+ pcb_select_element_name((pcb_element_t *) ptr1, PCB_CHGFLG_TOGGLE, 1);
break;
case PCB_TYPE_ELEMENT:
- pcb_select_element((ElementType *) ptr1, PCB_CHGFLG_TOGGLE, 1);
+ pcb_select_element((pcb_element_t *) ptr1, PCB_CHGFLG_TOGGLE, 1);
break;
}
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
return (changed);
}
@@ -206,18 +214,58 @@ pcb_bool SelectObject(void)
* returns a list of object IDs matched the search and loads len with the
* length of the list. Returns NULL on no match.
*/
-static long int *ListBlock_(BoxTypePtr Box, pcb_bool Flag, int *len)
+static long int *ListBlock_(pcb_box_t *Box, pcb_bool Flag, int *len)
{
int changed = 0;
int used = 0, alloced = 0;
long int *list = NULL;
+#define swap(a,b) \
+do { \
+ pcb_coord_t tmp; \
+ tmp = a; \
+ a = b; \
+ b = tmp; \
+} while(0)
+
+ /* If board view is flipped, box coords need to be flipped too to reflect
+ the on-screen direction of draw */
+ if (conf_core.editor.view.flip_x)
+ swap(Box->X1, Box->X2);
+ if (conf_core.editor.view.flip_y)
+ swap(Box->Y1, Box->Y2);
+
+ if (conf_core.editor.selection.disable_negative) {
+ if (Box->X1 > Box->X2)
+ swap(Box->X1, Box->X2);
+ if (Box->Y1 > Box->Y2)
+ swap(Box->Y1, Box->Y2);
+ }
+ else {
+ if (conf_core.editor.selection.symmetric_negative) {
+ if (Box->Y1 > Box->Y2)
+ swap(Box->Y1, Box->Y2);
+ }
+ /* Make sure our negative box is canonical: always from bottom-right to top-left
+ This limits all possible box coordinate orders to two, one for positive and
+ one for negative. */
+ if (PCB_IS_BOX_NEGATIVE(Box)) {
+ if (Box->X1 < Box->X2)
+ swap(Box->X1, Box->X2);
+ if (Box->Y1 < Box->Y2)
+ swap(Box->Y1, Box->Y2);
+ }
+ }
+#undef swap
+
+/*pcb_printf("box: %mm %mm - %mm %mm [ %d ] %d %d\n", Box->X1, Box->Y1, Box->X2, Box->Y2, PCB_IS_BOX_NEGATIVE(Box), conf_core.editor.view.flip_x, conf_core.editor.view.flip_y);*/
+
/* append an object to the return list OR set the flag if there's no list */
#define append(undo_type, p1, obj) \
do { \
if (len == NULL) { \
- AddObjectToFlagUndoList (undo_type, p1, obj, obj); \
- ASSIGN_FLAG (PCB_FLAG_SELECTED, Flag, obj); \
+ pcb_undo_add_obj_to_flag(undo_type, p1, obj, obj); \
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, obj); \
} \
else { \
if (used >= alloced) { \
@@ -230,25 +278,25 @@ do { \
changed = 1; \
} while(0)
- if (IS_BOX_NEGATIVE(Box) && ((Box->X1 == Box->X2) || (Box->Y2 == Box->Y1))) {
+ if (PCB_IS_BOX_NEGATIVE(Box) && ((Box->X1 == Box->X2) || (Box->Y2 == Box->Y1))) {
if (len != NULL)
*len = 0;
return NULL;
}
if (PCB->RatOn || !Flag)
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (LINE_NEAR_BOX((LineTypePtr) line, Box) && !TEST_FLAG(PCB_FLAG_LOCK, line) && TEST_FLAG(PCB_FLAG_SELECTED, line) != Flag) {
+ if (PCB_LINE_NEAR_BOX((pcb_line_t *) line, Box) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line) && PCB_FLAG_TEST(PCB_FLAG_SELECTED, line) != Flag) {
append(PCB_TYPE_RATLINE, line, line);
if (PCB->RatOn)
DrawRat(line);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* check layers */
- LAYER_LOOP(PCB->Data, max_copper_layer + 2);
+ LAYER_LOOP(PCB->Data, pcb_max_copper_layer + 2);
{
if (layer == &PCB->Data->SILKLAYER) {
if (!(PCB->ElementOn || !Flag))
@@ -261,144 +309,144 @@ do { \
else if (!(layer->On || !Flag))
continue;
- LINE_LOOP(layer);
+ PCB_LINE_LOOP(layer);
{
- if (LINE_NEAR_BOX(line, Box)
- && !TEST_FLAG(PCB_FLAG_LOCK, line)
- && TEST_FLAG(PCB_FLAG_SELECTED, line) != Flag) {
+ if (PCB_LINE_NEAR_BOX(line, Box)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, line) != Flag) {
append(PCB_TYPE_LINE, layer, line);
if (layer->On)
DrawLine(layer, line);
}
}
- END_LOOP;
- ARC_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(layer);
{
- if (ARC_NEAR_BOX(arc, Box)
- && !TEST_FLAG(PCB_FLAG_LOCK, arc)
- && TEST_FLAG(PCB_FLAG_SELECTED, arc) != Flag) {
+ if (PCB_ARC_NEAR_BOX(arc, Box)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, arc)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, arc) != Flag) {
append(PCB_TYPE_ARC, layer, arc);
if (layer->On)
DrawArc(layer, arc);
}
}
- END_LOOP;
- TEXT_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_TEXT_LOOP(layer);
{
- if (!Flag || TEXT_IS_VISIBLE(PCB, layer, text)) {
- if (TEXT_NEAR_BOX(text, Box)
- && !TEST_FLAG(PCB_FLAG_LOCK, text)
- && TEST_FLAG(PCB_FLAG_SELECTED, text) != Flag) {
+ if (!Flag || pcb_text_is_visible(PCB, layer, text)) {
+ if (PCB_TEXT_NEAR_BOX(text, Box)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, text)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, text) != Flag) {
append(PCB_TYPE_TEXT, layer, text);
- if (TEXT_IS_VISIBLE(PCB, layer, text))
+ if (pcb_text_is_visible(PCB, layer, text))
DrawText(layer, text);
}
}
}
- END_LOOP;
- POLYGON_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_POLY_LOOP(layer);
{
- if (POLYGON_NEAR_BOX(polygon, Box)
- && !TEST_FLAG(PCB_FLAG_LOCK, polygon)
- && TEST_FLAG(PCB_FLAG_SELECTED, polygon) != Flag) {
+ if (PCB_POLYGON_NEAR_BOX(polygon, Box)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, polygon)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon) != Flag) {
append(PCB_TYPE_POLYGON, layer, polygon);
if (layer->On)
DrawPolygon(layer, polygon);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
/* elements */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
{
pcb_bool gotElement = pcb_false;
if ((PCB->ElementOn || !Flag)
- && !TEST_FLAG(PCB_FLAG_LOCK, element)
- && ((TEST_FLAG(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)) {
- if (BOX_NEAR_BOX(&ELEMENT_TEXT(PCB, element).BoundingBox, Box)
- && !TEST_FLAG(PCB_FLAG_LOCK, &ELEMENT_TEXT(PCB, element))
- && TEST_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element)) != Flag) {
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, element)
+ && ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) != 0) == PCB_SWAP_IDENT || PCB->InvisibleObjectsOn)) {
+ if (PCB_BOX_NEAR_BOX(&PCB_ELEM_TEXT_VISIBLE(PCB, element).BoundingBox, Box)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, &PCB_ELEM_TEXT_VISIBLE(PCB, element))
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, &PCB_ELEM_TEXT_VISIBLE(PCB, element)) != Flag) {
/* select all names of element */
- ELEMENTTEXT_LOOP(element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
append(PCB_TYPE_ELEMENT_NAME, element, text);
}
- END_LOOP;
+ PCB_END_LOOP;
if (PCB->ElementOn)
DrawElementName(element);
}
- if ((PCB->PinOn || !Flag) && ELEMENT_NEAR_BOX(element, Box))
- if (TEST_FLAG(PCB_FLAG_SELECTED, element) != Flag) {
+ if ((PCB->PinOn || !Flag) && PCB_ELEMENT_NEAR_BOX(element, Box))
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element) != Flag) {
append(PCB_TYPE_ELEMENT, element, element);
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pin) != Flag) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pin) != Flag) {
append(PCB_TYPE_PIN, element, pin);
if (PCB->PinOn)
DrawPin(pin);
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pad) != Flag) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad) != Flag) {
append(PCB_TYPE_PAD, element, pad);
if (PCB->PinOn)
DrawPad(pad);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (PCB->PinOn)
DrawElement(element);
gotElement = pcb_true;
}
}
- if ((PCB->PinOn || !Flag) && !TEST_FLAG(PCB_FLAG_LOCK, element) && !gotElement) {
- PIN_LOOP(element);
+ if ((PCB->PinOn || !Flag) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, element) && !gotElement) {
+ PCB_PIN_LOOP(element);
{
- if ((VIA_OR_PIN_NEAR_BOX(pin, Box)
- && TEST_FLAG(PCB_FLAG_SELECTED, pin) != Flag)) {
+ if ((PCB_VIA_OR_PIN_NEAR_BOX(pin, Box)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, pin) != Flag)) {
append(PCB_TYPE_PIN, element, pin);
if (PCB->PinOn)
DrawPin(pin);
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (PAD_NEAR_BOX(pad, Box)
- && TEST_FLAG(PCB_FLAG_SELECTED, pad) != Flag
- && (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == SWAP_IDENT || PCB->InvisibleObjectsOn || !Flag)) {
+ if (PCB_PAD_NEAR_BOX(pad, Box)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad) != Flag
+ && (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) == PCB_SWAP_IDENT || PCB->InvisibleObjectsOn || !Flag)) {
append(PCB_TYPE_PAD, element, pad);
if (PCB->PinOn)
DrawPad(pad);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* end with vias */
if (PCB->ViaOn || !Flag)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (VIA_OR_PIN_NEAR_BOX(via, Box)
- && !TEST_FLAG(PCB_FLAG_LOCK, via)
- && TEST_FLAG(PCB_FLAG_SELECTED, via) != Flag) {
+ if (PCB_VIA_OR_PIN_NEAR_BOX(via, Box)
+ && !PCB_FLAG_TEST(PCB_FLAG_LOCK, via)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, via) != Flag) {
append(PCB_TYPE_VIA, via, via);
if (PCB->ViaOn)
DrawVia(via);
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (changed) {
- Draw();
- IncrementUndoSerialNumber();
+ pcb_draw();
+ pcb_undo_inc_serial();
}
if (len == NULL) {
@@ -418,7 +466,7 @@ do { \
* Flag determines if the block is to be selected or unselected
* returns pcb_true if the state of any object has changed
*/
-pcb_bool SelectBlock(BoxTypePtr Box, pcb_bool Flag)
+pcb_bool pcb_select_block(pcb_box_t *Box, pcb_bool Flag)
{
/* do not list, set flag */
return (ListBlock_(Box, Flag, NULL) == NULL) ? pcb_false : pcb_true;
@@ -427,7 +475,7 @@ pcb_bool SelectBlock(BoxTypePtr Box, pcb_bool Flag)
/* ----------------------------------------------------------------------
* List all visible objects within the passed box
*/
-long int *ListBlock(BoxTypePtr Box, int *len)
+long int *pcb_list_block(pcb_box_t *Box, int *len)
{
return ListBlock_(Box, 1, len);
}
@@ -435,67 +483,73 @@ long int *ListBlock(BoxTypePtr Box, int *len)
/* ----------------------------------------------------------------------
* performs several operations on the passed object
*/
-void *ObjectOperation(ObjectFunctionTypePtr F, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+#warning TODO: maybe move this to operation.c
+void *pcb_object_operation(pcb_opfunc_t *F, pcb_opctx_t *ctx, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
switch (Type) {
case PCB_TYPE_LINE:
if (F->Line)
- return (F->Line((LayerTypePtr) Ptr1, (LineTypePtr) Ptr2));
+ return (F->Line(ctx, (pcb_layer_t *) Ptr1, (pcb_line_t *) Ptr2));
break;
case PCB_TYPE_ARC:
if (F->Arc)
- return (F->Arc((LayerTypePtr) Ptr1, (ArcTypePtr) Ptr2));
+ return (F->Arc(ctx, (pcb_layer_t *) Ptr1, (pcb_arc_t *) Ptr2));
break;
case PCB_TYPE_LINE_POINT:
if (F->LinePoint)
- return (F->LinePoint((LayerTypePtr) Ptr1, (LineTypePtr) Ptr2, (PointTypePtr) Ptr3));
+ return (F->LinePoint(ctx, (pcb_layer_t *) Ptr1, (pcb_line_t *) Ptr2, (pcb_point_t *) Ptr3));
+ break;
+
+ case PCB_TYPE_ARC_POINT:
+ if (F->ArcPoint)
+ return (F->ArcPoint(ctx, (pcb_layer_t *) Ptr1, (pcb_line_t *) Ptr2, (int *) Ptr3));
break;
case PCB_TYPE_TEXT:
if (F->Text)
- return (F->Text((LayerTypePtr) Ptr1, (TextTypePtr) Ptr2));
+ return (F->Text(ctx, (pcb_layer_t *) Ptr1, (pcb_text_t *) Ptr2));
break;
case PCB_TYPE_POLYGON:
if (F->Polygon)
- return (F->Polygon((LayerTypePtr) Ptr1, (PolygonTypePtr) Ptr2));
+ return (F->Polygon(ctx, (pcb_layer_t *) Ptr1, (pcb_polygon_t *) Ptr2));
break;
case PCB_TYPE_POLYGON_POINT:
if (F->Point)
- return (F->Point((LayerTypePtr) Ptr1, (PolygonTypePtr) Ptr2, (PointTypePtr) Ptr3));
+ return (F->Point(ctx, (pcb_layer_t *) Ptr1, (pcb_polygon_t *) Ptr2, (pcb_point_t *) Ptr3));
break;
case PCB_TYPE_VIA:
if (F->Via)
- return (F->Via((PinTypePtr) Ptr1));
+ return (F->Via(ctx, (pcb_pin_t *) Ptr1));
break;
case PCB_TYPE_ELEMENT:
if (F->Element)
- return (F->Element((ElementTypePtr) Ptr1));
+ return (F->Element(ctx, (pcb_element_t *) Ptr1));
break;
case PCB_TYPE_PIN:
if (F->Pin)
- return (F->Pin((ElementTypePtr) Ptr1, (PinTypePtr) Ptr2));
+ return (F->Pin(ctx, (pcb_element_t *) Ptr1, (pcb_pin_t *) Ptr2));
break;
case PCB_TYPE_PAD:
if (F->Pad)
- return (F->Pad((ElementTypePtr) Ptr1, (PadTypePtr) Ptr2));
+ return (F->Pad(ctx, (pcb_element_t *) Ptr1, (pcb_pad_t *) Ptr2));
break;
case PCB_TYPE_ELEMENT_NAME:
if (F->ElementName)
- return (F->ElementName((ElementTypePtr) Ptr1));
+ return (F->ElementName(ctx, (pcb_element_t *) Ptr1));
break;
case PCB_TYPE_RATLINE:
if (F->Rat)
- return (F->Rat((RatTypePtr) Ptr1));
+ return (F->Rat(ctx, (pcb_rat_t *) Ptr1));
break;
}
return (NULL);
@@ -507,164 +561,164 @@ void *ObjectOperation(ObjectFunctionTypePtr F, int Type, void *Ptr1, void *Ptr2,
* resets the selected flag if requested
* returns pcb_true if anything has changed
*/
-pcb_bool SelectedOperation(ObjectFunctionTypePtr F, pcb_bool Reset, int type)
+pcb_bool pcb_selected_operation(pcb_opfunc_t *F, pcb_opctx_t *ctx, pcb_bool Reset, int type)
{
pcb_bool changed = pcb_false;
/* check lines */
if (type & PCB_TYPE_LINE && F->Line)
- VISIBLELINE_LOOP(PCB->Data);
+ PCB_LINE_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line);
- CLEAR_FLAG(PCB_FLAG_SELECTED, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, layer, line, line);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, line);
}
- F->Line(layer, line);
+ F->Line(ctx, layer, line);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* check arcs */
if (type & PCB_TYPE_ARC && F->Arc)
- VISIBLEARC_LOOP(PCB->Data);
+ PCB_ARC_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, arc)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, arc)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc);
- CLEAR_FLAG(PCB_FLAG_SELECTED, arc);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, layer, arc, arc);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, arc);
}
- F->Arc(layer, arc);
+ F->Arc(ctx, layer, arc);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* check text */
if (type & PCB_TYPE_TEXT && F->Text)
- ALLTEXT_LOOP(PCB->Data);
+ PCB_TEXT_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, text) && TEXT_IS_VISIBLE(PCB, layer, text)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, text) && pcb_text_is_visible(PCB, layer, text)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_TEXT, layer, text, text);
- CLEAR_FLAG(PCB_FLAG_SELECTED, text);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_TEXT, layer, text, text);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, text);
}
- F->Text(layer, text);
+ F->Text(ctx, layer, text);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* check polygons */
if (type & PCB_TYPE_POLYGON && F->Polygon)
- VISIBLEPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, polygon)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon);
- CLEAR_FLAG(PCB_FLAG_SELECTED, polygon);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, layer, polygon, polygon);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, polygon);
}
- F->Polygon(layer, polygon);
+ F->Polygon(ctx, layer, polygon);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* elements silkscreen */
if (type & PCB_TYPE_ELEMENT && PCB->ElementOn && F->Element)
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, element)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element);
- CLEAR_FLAG(PCB_FLAG_SELECTED, element);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT, element, element, element);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, element);
}
- F->Element(element);
+ F->Element(ctx, element);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (type & PCB_TYPE_ELEMENT_NAME && PCB->ElementOn && F->ElementName)
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element))) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, &PCB_ELEM_TEXT_VISIBLE(PCB, element))) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, &ELEMENT_TEXT(PCB, element), &ELEMENT_TEXT(PCB, element));
- CLEAR_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element));
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT_NAME, element, &PCB_ELEM_TEXT_VISIBLE(PCB, element), &PCB_ELEM_TEXT_VISIBLE(PCB, element));
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, &PCB_ELEM_TEXT_VISIBLE(PCB, element));
}
- F->ElementName(element);
+ F->ElementName(ctx, element);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (type & PCB_TYPE_PIN && PCB->PinOn && F->Pin)
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pin)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- CLEAR_FLAG(PCB_FLAG_SELECTED, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, pin);
}
- F->Pin(element, pin);
+ F->Pin(ctx, element, pin);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
if (type & PCB_TYPE_PAD && PCB->PinOn && F->Pad)
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- CLEAR_FLAG(PCB_FLAG_SELECTED, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, pad);
}
- F->Pad(element, pad);
+ F->Pad(ctx, element, pad);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
/* process vias */
if (type & PCB_TYPE_VIA && PCB->ViaOn && F->Via)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, via)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, via)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- CLEAR_FLAG(PCB_FLAG_SELECTED, via);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, via);
}
- F->Via(via);
+ F->Via(ctx, via);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* and rat-lines */
if (type & PCB_TYPE_RATLINE && PCB->RatOn && F->Rat)
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) {
if (Reset) {
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line);
- CLEAR_FLAG(PCB_FLAG_SELECTED, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, line);
}
- F->Rat(line);
+ F->Rat(ctx, line);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (Reset && changed)
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return (changed);
}
@@ -675,87 +729,87 @@ pcb_bool SelectedOperation(ObjectFunctionTypePtr F, pcb_bool Reset, int type)
*
* text objects and elements cannot be selected by this routine
*/
-pcb_bool SelectConnection(pcb_bool Flag)
+pcb_bool pcb_select_connection(pcb_bool Flag)
{
pcb_bool changed = pcb_false;
if (PCB->RatOn)
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, line)) {
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, line)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, line);
DrawRat(line);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
- VISIBLELINE_LOOP(PCB->Data);
+ PCB_LINE_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, line) && !TEST_FLAG(PCB_FLAG_LOCK, line)) {
- AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, line) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, layer, line, line);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, line);
DrawLine(layer, line);
changed = pcb_true;
}
}
- ENDALL_LOOP;
- VISIBLEARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc)) {
- AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, arc) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, arc)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, layer, arc, arc);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, arc);
DrawArc(layer, arc);
changed = pcb_true;
}
}
- ENDALL_LOOP;
- VISIBLEPOLYGON_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, polygon) && !TEST_FLAG(PCB_FLAG_LOCK, polygon)) {
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, polygon);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, polygon) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, polygon)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, layer, polygon, polygon);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, polygon);
DrawPolygon(layer, polygon);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->PinOn && PCB->ElementOn) {
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, element) && TEST_FLAG(PCB_FLAG_FOUND, pin)) {
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pin);
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, element) && PCB_FLAG_TEST(PCB_FLAG_FOUND, pin)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, pin);
DrawPin(pin);
changed = pcb_true;
}
}
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, element) && TEST_FLAG(PCB_FLAG_FOUND, pad)) {
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pad);
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, element) && PCB_FLAG_TEST(PCB_FLAG_FOUND, pad)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, pad);
DrawPad(pad);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
if (PCB->ViaOn)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, via) && !TEST_FLAG(PCB_FLAG_LOCK, via)) {
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, via);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, via) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, via)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, via);
DrawVia(via);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
return (changed);
}
@@ -765,7 +819,7 @@ pcb_bool SelectConnection(pcb_bool Flag)
* returns pcb_true if any object has been selected
*/
#define REGEXEC(arg) \
- (method == SM_REGEX ? regexec_match_all(regex, (arg)) : strlst_match(pat, (arg)))
+ (method == PCB_SM_REGEX ? regexec_match_all(regex, (arg)) : strlst_match(pat, (arg)))
static int regexec_match_all(re_sei_t *preg, const char *string)
{
@@ -777,23 +831,23 @@ static int regexec_match_all(re_sei_t *preg, const char *string)
static int strlst_match(const char **pat, const char *name)
{
for (; *pat != NULL; pat++)
- if (strcasecmp(*pat, name) == 0)
+ if (pcb_strcasecmp(*pat, name) == 0)
return 1;
return 0;
}
-pcb_bool SelectObjectByName(int Type, const char *name_pattern, pcb_bool Flag, search_method_t method)
+pcb_bool pcb_select_object_by_name(int Type, const char *name_pattern, pcb_bool Flag, pcb_search_method_t method)
{
pcb_bool changed = pcb_false;
const char **pat = NULL;
char *pattern_copy = NULL;
re_sei_t *regex;
- if (method == SM_REGEX) {
+ if (method == PCB_SM_REGEX) {
/* compile the regular expression */
regex = re_sei_comp(name_pattern);
if (re_sei_errno(regex) != 0) {
- Message(PCB_MSG_DEFAULT, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
+ pcb_message(PCB_MSG_ERROR, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
re_sei_free(regex);
return (pcb_false);
}
@@ -837,124 +891,124 @@ pcb_bool SelectObjectByName(int Type, const char *name_pattern, pcb_bool Flag, s
/* loop over all visible objects with names */
if (Type & PCB_TYPE_TEXT)
- ALLTEXT_LOOP(PCB->Data);
+ PCB_TEXT_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, text)
- && TEXT_IS_VISIBLE(PCB, layer, text)
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, text)
+ && pcb_text_is_visible(PCB, layer, text)
&& text->TextString && REGEXEC(text->TextString)
- && TEST_FLAG(PCB_FLAG_SELECTED, text) != Flag) {
- AddObjectToFlagUndoList(PCB_TYPE_TEXT, layer, text, text);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, text);
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, text) != Flag) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_TEXT, layer, text, text);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, text);
DrawText(layer, text);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->ElementOn && (Type & PCB_TYPE_ELEMENT))
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, element)
- && ((TEST_FLAG(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)
- && TEST_FLAG(PCB_FLAG_SELECTED, element) != Flag) {
- const char* name = ELEMENT_NAME(PCB, element);
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, element)
+ && ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) != 0) == PCB_SWAP_IDENT || PCB->InvisibleObjectsOn)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, element) != Flag) {
+ const char* name = PCB_ELEM_NAME_VISIBLE(PCB, element);
if (name && REGEXEC(name)) {
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, element);
- PIN_LOOP(element);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT, element, element, element);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, element);
+ PCB_PIN_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pin);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, pin);
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, pad);
}
- END_LOOP;
- ELEMENTTEXT_LOOP(element);
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
- AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, text);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ELEMENT_NAME, element, text, text);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, text);
}
- END_LOOP;
+ PCB_END_LOOP;
DrawElementName(element);
DrawElement(element);
changed = pcb_true;
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (PCB->PinOn && (Type & PCB_TYPE_PIN))
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, element)
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, element)
&& pin->Name && REGEXEC(pin->Name)
- && TEST_FLAG(PCB_FLAG_SELECTED, pin) != Flag) {
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pin);
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, pin) != Flag) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, pin);
DrawPin(pin);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->PinOn && (Type & PCB_TYPE_PAD))
- ALLPAD_LOOP(PCB->Data);
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, element)
- && ((TEST_FLAG(PCB_FLAG_ONSOLDER, pad) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)
- && TEST_FLAG(PCB_FLAG_SELECTED, pad) != Flag)
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, element)
+ && ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) != 0) == PCB_SWAP_IDENT || PCB->InvisibleObjectsOn)
+ && PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad) != Flag)
if (pad->Name && REGEXEC(pad->Name)) {
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pad);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, pad);
DrawPad(pad);
changed = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->ViaOn && (Type & PCB_TYPE_VIA))
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_LOCK, via)
- && via->Name && REGEXEC(via->Name) && TEST_FLAG(PCB_FLAG_SELECTED, via) != Flag) {
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, via);
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, via)
+ && via->Name && REGEXEC(via->Name) && PCB_FLAG_TEST(PCB_FLAG_SELECTED, via) != Flag) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, Flag, via);
DrawVia(via);
changed = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (Type & PCB_TYPE_NET) {
- InitConnectionLookup();
- changed = ResetConnections(pcb_true) || changed;
+ pcb_conn_lookup_init();
+ changed = pcb_reset_conns(pcb_true) || changed;
- MENU_LOOP(&(PCB->NetlistLib[NETLIST_EDITED]));
+ PCB_MENU_LOOP(&(PCB->NetlistLib[PCB_NETLIST_EDITED]));
{
pcb_cardinal_t i;
- LibraryEntryType *entry;
- ConnectionType conn;
+ pcb_lib_entry_t *entry;
+ pcb_connection_t conn;
/* Name[0] and Name[1] are special purpose, not the actual name */
if (menu->Name && menu->Name[0] != '\0' && menu->Name[1] != '\0' && REGEXEC(menu->Name + 2)) {
for (i = menu->EntryN, entry = menu->Entry; i; i--, entry++)
- if (SeekPad(entry, &conn, pcb_false))
- RatFindHook(conn.type, conn.ptr1, conn.ptr2, conn.ptr2, pcb_true, pcb_true);
+ if (pcb_rat_seek_pad(entry, &conn, pcb_false))
+ pcb_rat_find_hook(conn.type, conn.ptr1, conn.ptr2, conn.ptr2, pcb_true, pcb_true);
}
}
- END_LOOP;
+ PCB_END_LOOP;
- changed = SelectConnection(Flag) || changed;
- changed = ResetConnections(pcb_false) || changed;
- FreeConnectionLookupMemory();
+ changed = pcb_select_connection(Flag) || changed;
+ changed = pcb_reset_conns(pcb_false) || changed;
+ pcb_conn_lookup_uninit();
}
- if (method == SM_REGEX)
+ if (method == PCB_SM_REGEX)
re_sei_free(regex);
if (changed) {
- IncrementUndoSerialNumber();
- Draw();
+ pcb_undo_inc_serial();
+ pcb_draw();
}
if (pat != NULL)
free(pat);
diff --git a/src/select.h b/src/select.h
index 1dcf424..baed042 100644
--- a/src/select.h
+++ b/src/select.h
@@ -29,30 +29,34 @@
#ifndef PCB_SELECT_H
#define PCB_SELECT_H
-#include "global.h"
+#include "config.h"
+#include "operation.h"
-#define SELECT_TYPES \
+#define PCB_SELECT_TYPES \
(PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_POLYGON | PCB_TYPE_ELEMENT | \
PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_RATLINE | PCB_TYPE_ARC)
-pcb_bool SelectObject(void);
-pcb_bool SelectBlock(BoxTypePtr, pcb_bool);
-long int *ListBlock(BoxTypePtr Box, int *len);
-pcb_bool SelectedOperation(ObjectFunctionTypePtr, pcb_bool, int);
-void *ObjectOperation(ObjectFunctionTypePtr, int, void *, void *, void *);
-pcb_bool SelectConnection(pcb_bool);
+pcb_bool pcb_select_object(void);
+pcb_bool pcb_select_block(pcb_box_t *, pcb_bool);
+long int *pcb_list_block(pcb_box_t *Box, int *len);
+
+void *pcb_object_operation(pcb_opfunc_t *F, pcb_opctx_t *ctx, int Type, void *Ptr1, void *Ptr2, void *Ptr3);
+pcb_bool pcb_selected_operation(pcb_opfunc_t *F, pcb_opctx_t *ctx, pcb_bool Reset, int type);
+
+pcb_bool pcb_select_connection(pcb_bool);
+
typedef enum {
- SM_REGEX = 0,
- SM_LIST = 1
-} search_method_t;
+ PCB_SM_REGEX = 0,
+ PCB_SM_LIST = 1
+} pcb_search_method_t;
-pcb_bool SelectObjectByName(int, const char *, pcb_bool, search_method_t);
+pcb_bool pcb_select_object_by_name(int, const char *, pcb_bool, pcb_search_method_t);
/* New API */
/* Change the selection of an element or element name (these have side effects) */
-void pcb_select_element(ElementType *element, pcb_change_flag_t how, int redraw);
-void pcb_select_element_name(ElementType *element, pcb_change_flag_t how, int redraw);
+void pcb_select_element(pcb_element_t *element, pcb_change_flag_t how, int redraw);
+void pcb_select_element_name(pcb_element_t *element, pcb_change_flag_t how, int redraw);
#endif
diff --git a/src/select_act.c b/src/select_act.c
index 35e7ff0..37f1883 100644
--- a/src/select_act.c
+++ b/src/select_act.c
@@ -27,6 +27,7 @@
#include "config.h"
#include "conf_core.h"
+#include "board.h"
#include "data.h"
#include "action_helper.h"
#include "error.h"
@@ -34,23 +35,21 @@
#include "funchash_core.h"
#include "select.h"
-#include "crosshair.h"
-#include "set.h"
-#include "buffer.h"
#include "draw.h"
#include "remove.h"
#include "copy.h"
#include "hid_attrib.h"
#include "compat_misc.h"
+#include "compat_nls.h"
/* --------------------------------------------------------------------------- */
/* Ask the user for a search pattern */
-static char *gui_get_pat(search_method_t * method)
+static char *gui_get_pat(pcb_search_method_t * method)
{
const char *methods[] = { "regexp", "list of names", NULL };
- HID_Attribute attrs[2];
+ pcb_hid_attribute_t attrs[2];
#define nattr sizeof(attrs)/sizeof(attrs[0])
- static HID_Attr_Val results[nattr] = { 0 };
+ static pcb_hid_attr_val_t results[nattr] = { 0 };
memset(attrs, 0, sizeof(attrs));
@@ -65,7 +64,7 @@ static char *gui_get_pat(search_method_t * method)
attrs[1].enumerations = methods;
attrs[1].default_val.int_value = results[1].int_value;
- gui->attribute_dialog(attrs, nattr, results, "Find element", "Find element by name");
+ pcb_gui->attribute_dialog(attrs, nattr, results, "Find element", "Find element by name");
*method = results[1].int_value;
if (results[0].str_value == NULL)
@@ -77,14 +76,14 @@ static char *gui_get_pat(search_method_t * method)
/* --------------------------------------------------------------------------- */
-static const char select_syntax[] =
+static const char pcb_acts_Select[] =
"Select(Object|ToggleObject)\n"
"Select(All|Block|Connection)\n"
"Select(ElementByName|ObjectByName|PadByName|PinByName)\n"
"Select(ElementByName|ObjectByName|PadByName|PinByName, Name)\n"
"Select(TextByName|ViaByName|NetByName)\n" "Select(TextByName|ViaByName|NetByName, Name)\n" "Select(Convert)";
-static const char select_help[] = "Toggles or sets the selection.";
+static const char pcb_acth_Select[] = "Toggles or sets the selection.";
/* %start-doc actions Select
@@ -124,13 +123,13 @@ numbered paste buffer.
%end-doc */
-static int ActionSelect(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Select(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
int type;
- switch (funchash_get(function, NULL)) { /* select objects by their names */
+ switch (pcb_funchash_get(function, NULL)) { /* select objects by their names */
case F_ElementByName:
type = PCB_TYPE_ELEMENT;
goto commonByName;
@@ -155,13 +154,13 @@ static int ActionSelect(int argc, const char **argv, Coord x, Coord y)
commonByName:
{
- const char *pattern = ACTION_ARG(1);
- search_method_t method = SM_REGEX;
+ const char *pattern = PCB_ACTION_ARG(1);
+ pcb_search_method_t method = PCB_SM_REGEX;
if (pattern || (pattern = gui_get_pat(&method)) != NULL) {
- if (SelectObjectByName(type, pattern, pcb_true, method))
- SetChangedFlag(pcb_true);
- if (ACTION_ARG(1) == NULL)
+ if (pcb_select_object_by_name(type, pattern, pcb_true, method))
+ pcb_board_set_changed_flag(pcb_true);
+ if (PCB_ACTION_ARG(1) == NULL)
free((char*)pattern);
}
break;
@@ -170,73 +169,73 @@ static int ActionSelect(int argc, const char **argv, Coord x, Coord y)
/* select a single object */
case F_ToggleObject:
case F_Object:
- if (SelectObject())
- SetChangedFlag(pcb_true);
+ if (pcb_select_object())
+ pcb_board_set_changed_flag(pcb_true);
break;
/* all objects in block */
case F_Block:
{
- BoxType box;
-
- box.X1 = MIN(Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point2.X);
- box.Y1 = MIN(Crosshair.AttachedBox.Point1.Y, Crosshair.AttachedBox.Point2.Y);
- box.X2 = MAX(Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point2.X);
- box.Y2 = MAX(Crosshair.AttachedBox.Point1.Y, Crosshair.AttachedBox.Point2.Y);
- notify_crosshair_change(pcb_false);
- NotifyBlock();
- if (Crosshair.AttachedBox.State == STATE_THIRD && SelectBlock(&box, pcb_true)) {
- SetChangedFlag(pcb_true);
- Crosshair.AttachedBox.State = STATE_FIRST;
+ pcb_box_t box;
+
+ box.X1 = MIN(pcb_crosshair.AttachedBox.Point1.X, pcb_crosshair.AttachedBox.Point2.X);
+ box.Y1 = MIN(pcb_crosshair.AttachedBox.Point1.Y, pcb_crosshair.AttachedBox.Point2.Y);
+ box.X2 = MAX(pcb_crosshair.AttachedBox.Point1.X, pcb_crosshair.AttachedBox.Point2.X);
+ box.Y2 = MAX(pcb_crosshair.AttachedBox.Point1.Y, pcb_crosshair.AttachedBox.Point2.Y);
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_notify_block();
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_THIRD && pcb_select_block(&box, pcb_true)) {
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
}
/* select all visible objects */
case F_All:
{
- BoxType box;
-
- box.X1 = -MAX_COORD;
- box.Y1 = -MAX_COORD;
- box.X2 = MAX_COORD;
- box.Y2 = MAX_COORD;
- if (SelectBlock(&box, pcb_true))
- SetChangedFlag(pcb_true);
+ pcb_box_t box;
+
+ box.X1 = -PCB_MAX_COORD;
+ box.Y1 = -PCB_MAX_COORD;
+ box.X2 = PCB_MAX_COORD;
+ box.Y2 = PCB_MAX_COORD;
+ if (pcb_select_block(&box, pcb_true))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
/* all found connections */
case F_Connection:
- if (SelectConnection(pcb_true)) {
- Draw();
- IncrementUndoSerialNumber();
- SetChangedFlag(pcb_true);
+ if (pcb_select_connection(pcb_true)) {
+ pcb_draw();
+ pcb_undo_inc_serial();
+ pcb_board_set_changed_flag(pcb_true);
}
break;
case F_Convert:
{
- Coord x, y;
+ pcb_coord_t x, y;
Note.Buffer = conf_core.editor.buffer_number;
- SetBufferNumber(MAX_BUFFER - 1);
- ClearBuffer(PASTEBUFFER);
- gui->get_coords(_("Select the Element's Mark Location"), &x, &y);
- x = GridFit(x, PCB->Grid, PCB->GridOffsetX);
- y = GridFit(y, PCB->Grid, PCB->GridOffsetY);
- AddSelectedToBuffer(PASTEBUFFER, x, y, pcb_true);
- SaveUndoSerialNumber();
- RemoveSelected();
- ConvertBufferToElement(PASTEBUFFER);
- RestoreUndoSerialNumber();
- CopyPastebufferToLayout(x, y);
- SetBufferNumber(Note.Buffer);
+ pcb_buffer_set_number(PCB_MAX_BUFFER - 1);
+ pcb_buffer_clear(PCB_PASTEBUFFER);
+ pcb_gui->get_coords(_("Select the Element's Mark Location"), &x, &y);
+ x = pcb_grid_fit(x, PCB->Grid, PCB->GridOffsetX);
+ y = pcb_grid_fit(y, PCB->Grid, PCB->GridOffsetY);
+ pcb_buffer_add_selected(PCB_PASTEBUFFER, x, y, pcb_true);
+ pcb_undo_save_serial();
+ pcb_remove_selected();
+ pcb_element_convert_from_buffer(PCB_PASTEBUFFER);
+ pcb_undo_restore_serial();
+ pcb_buffer_copy_to_layout(x, y);
+ pcb_buffer_set_number(Note.Buffer);
}
break;
default:
- AFAIL(select);
+ PCB_ACT_FAIL(Select);
break;
}
}
@@ -245,13 +244,13 @@ static int ActionSelect(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char unselect_syntax[] =
+static const char pcb_acts_Unselect[] =
"Unselect(All|Block|Connection)\n"
"Unselect(ElementByName|ObjectByName|PadByName|PinByName)\n"
"Unselect(ElementByName|ObjectByName|PadByName|PinByName, Name)\n"
"Unselect(TextByName|ViaByName)\n" "Unselect(TextByName|ViaByName, Name)\n";
-static const char unselect_help[] = "Unselects the object at the pointer location or the specified objects.";
+static const char pcb_acth_Unselect[] = "Unselects the object at the pointer location or the specified objects.";
/* %start-doc actions Unselect
@@ -283,12 +282,12 @@ type specified are unselected.
%end-doc */
-static int ActionUnselect(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Unselect(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (function) {
int type;
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
/* select objects by their names */
case F_ElementByName:
type = PCB_TYPE_ELEMENT;
@@ -314,13 +313,13 @@ static int ActionUnselect(int argc, const char **argv, Coord x, Coord y)
commonByName:
{
- const char *pattern = ACTION_ARG(1);
- search_method_t method = SM_REGEX;
+ const char *pattern = PCB_ACTION_ARG(1);
+ pcb_search_method_t method = PCB_SM_REGEX;
if (pattern || (pattern = gui_get_pat(&method)) != NULL) {
- if (SelectObjectByName(type, pattern, pcb_false, method))
- SetChangedFlag(pcb_true);
- if (ACTION_ARG(1) == NULL)
+ if (pcb_select_object_by_name(type, pattern, pcb_false, method))
+ pcb_board_set_changed_flag(pcb_true);
+ if (PCB_ACTION_ARG(1) == NULL)
free((char*)pattern);
}
break;
@@ -329,47 +328,47 @@ static int ActionUnselect(int argc, const char **argv, Coord x, Coord y)
/* all objects in block */
case F_Block:
{
- BoxType box;
-
- box.X1 = MIN(Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point2.X);
- box.Y1 = MIN(Crosshair.AttachedBox.Point1.Y, Crosshair.AttachedBox.Point2.Y);
- box.X2 = MAX(Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point2.X);
- box.Y2 = MAX(Crosshair.AttachedBox.Point1.Y, Crosshair.AttachedBox.Point2.Y);
- notify_crosshair_change(pcb_false);
- NotifyBlock();
- if (Crosshair.AttachedBox.State == STATE_THIRD && SelectBlock(&box, pcb_false)) {
- SetChangedFlag(pcb_true);
- Crosshair.AttachedBox.State = STATE_FIRST;
+ pcb_box_t box;
+
+ box.X1 = MIN(pcb_crosshair.AttachedBox.Point1.X, pcb_crosshair.AttachedBox.Point2.X);
+ box.Y1 = MIN(pcb_crosshair.AttachedBox.Point1.Y, pcb_crosshair.AttachedBox.Point2.Y);
+ box.X2 = MAX(pcb_crosshair.AttachedBox.Point1.X, pcb_crosshair.AttachedBox.Point2.X);
+ box.Y2 = MAX(pcb_crosshair.AttachedBox.Point1.Y, pcb_crosshair.AttachedBox.Point2.Y);
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_notify_block();
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_THIRD && pcb_select_block(&box, pcb_false)) {
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
}
/* unselect all visible objects */
case F_All:
{
- BoxType box;
-
- box.X1 = -MAX_COORD;
- box.Y1 = -MAX_COORD;
- box.X2 = MAX_COORD;
- box.Y2 = MAX_COORD;
- if (SelectBlock(&box, pcb_false))
- SetChangedFlag(pcb_true);
+ pcb_box_t box;
+
+ box.X1 = -PCB_MAX_COORD;
+ box.Y1 = -PCB_MAX_COORD;
+ box.X2 = PCB_MAX_COORD;
+ box.Y2 = PCB_MAX_COORD;
+ if (pcb_select_block(&box, pcb_false))
+ pcb_board_set_changed_flag(pcb_true);
break;
}
/* all found connections */
case F_Connection:
- if (SelectConnection(pcb_false)) {
- Draw();
- IncrementUndoSerialNumber();
- SetChangedFlag(pcb_true);
+ if (pcb_select_connection(pcb_false)) {
+ pcb_draw();
+ pcb_undo_inc_serial();
+ pcb_board_set_changed_flag(pcb_true);
}
break;
default:
- AFAIL(unselect);
+ PCB_ACT_FAIL(Unselect);
break;
}
@@ -377,12 +376,12 @@ static int ActionUnselect(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-HID_Action select_action_list[] = {
- {"Select", 0, ActionSelect,
- select_help, select_syntax}
+pcb_hid_action_t select_action_list[] = {
+ {"Select", 0, pcb_act_Select,
+ pcb_acth_Select, pcb_acts_Select}
,
- {"Unselect", 0, ActionUnselect,
- unselect_help, unselect_syntax}
+ {"Unselect", 0, pcb_act_Unselect,
+ pcb_acth_Unselect, pcb_acts_Unselect}
};
-REGISTER_ACTIONS(select_action_list, NULL)
+PCB_REGISTER_ACTIONS(select_action_list, NULL)
diff --git a/src/set.c b/src/set.c
deleted file mode 100644
index 225adbf..0000000
--- a/src/set.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-
-/* routines to update widgets and global settings
- * (except output window and dialogs)
- */
-
-#include "config.h"
-#include "conf_core.h"
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "action_helper.h"
-#include "buffer.h"
-#include "crosshair.h"
-#include "data.h"
-#include "draw.h"
-#include "error.h"
-#include "find.h"
-#include "set.h"
-#include "undo.h"
-#include "hid_actions.h"
-#include "route_style.h"
-
-static int mode_position = 0;
-static int mode_stack[MAX_MODESTACK_DEPTH];
-
-/* ---------------------------------------------------------------------------
- * sets cursor grid with respect to grid offset values
- */
-void SetGrid(Coord Grid, pcb_bool align)
-{
- if (Grid >= 1 && Grid <= MAX_GRID) {
- if (align) {
- PCB->GridOffsetX = Crosshair.X % Grid;
- PCB->GridOffsetY = Crosshair.Y % Grid;
- }
- PCB->Grid = Grid;
- conf_set_design("editor/grid", "%$mS", Grid);
- if (conf_core.editor.draw_grid)
- Redraw();
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets a new line thickness
- */
-void SetLineSize(Coord Size)
-{
- if (Size >= MIN_LINESIZE && Size <= MAX_LINESIZE) {
- conf_set_design("design/line_thickness", "%$mS", Size);
- if (conf_core.editor.auto_drc)
- FitCrosshairIntoGrid(Crosshair.X, Crosshair.Y);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets a new via thickness
- */
-void SetViaSize(Coord Size, pcb_bool Force)
-{
- if (Force || (Size <= MAX_PINORVIASIZE && Size >= MIN_PINORVIASIZE && Size >= conf_core.design.via_drilling_hole + MIN_PINORVIACOPPER)) {
- conf_set_design("design/via_thickness", "%$mS", Size);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets a new via drilling hole
- */
-void SetViaDrillingHole(Coord Size, pcb_bool Force)
-{
- if (Force || (Size <= MAX_PINORVIASIZE && Size >= MIN_PINORVIAHOLE && Size <= conf_core.design.via_thickness - MIN_PINORVIACOPPER)) {
- conf_set_design("design/via_drilling_hole", "%$mS", Size);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets a clearance width
- */
-void SetClearanceWidth(Coord Width)
-{
- if (Width <= MAX_LINESIZE) {
- conf_set_design("design/clearance", "%$mS", Width);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets a text scaling
- */
-void SetTextScale(int Scale)
-{
- if (Scale <= MAX_TEXTSCALE && Scale >= MIN_TEXTSCALE) {
- conf_set_design("design/text_scale", "%d", Scale);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets or resets changed flag and redraws status
- */
-void SetChangedFlag(pcb_bool New)
-{
- if (PCB->Changed != New) {
- PCB->Changed = New;
-
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets the crosshair range to the current buffer extents
- */
-void SetCrosshairRangeToBuffer(void)
-{
- if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER) {
- SetBufferBoundingBox(PASTEBUFFER);
- SetCrosshairRange(PASTEBUFFER->X - PASTEBUFFER->BoundingBox.X1,
- PASTEBUFFER->Y - PASTEBUFFER->BoundingBox.Y1,
- PCB->MaxWidth -
- (PASTEBUFFER->BoundingBox.X2 - PASTEBUFFER->X),
- PCB->MaxHeight - (PASTEBUFFER->BoundingBox.Y2 - PASTEBUFFER->Y));
- }
-}
-
-/* ---------------------------------------------------------------------------
- * sets a new buffer number
- */
-void SetBufferNumber(int Number)
-{
- if (Number >= 0 && Number < MAX_BUFFER) {
- conf_set_design("editor/buffer_number", "%d", Number);
-
- /* do an update on the crosshair range */
- SetCrosshairRangeToBuffer();
- }
-}
-
-/* ---------------------------------------------------------------------------
- */
-
-void SaveMode(void)
-{
- mode_stack[mode_position] = conf_core.editor.mode;
- if (mode_position < MAX_MODESTACK_DEPTH - 1)
- mode_position++;
-}
-
-void RestoreMode(void)
-{
- if (mode_position == 0) {
- Message(PCB_MSG_DEFAULT, "hace: underflow of restore mode\n");
- return;
- }
- SetMode(mode_stack[--mode_position]);
-}
-
-
-/* ---------------------------------------------------------------------------
- * set a new mode and update X cursor
- */
-void SetMode(int Mode)
-{
- char sMode[32];
- static pcb_bool recursing = pcb_false;
- /* protect the cursor while changing the mode
- * perform some additional stuff depending on the new mode
- * reset 'state' of attached objects
- */
- if (recursing)
- return;
- recursing = pcb_true;
- notify_crosshair_change(pcb_false);
- addedLines = 0;
- Crosshair.AttachedObject.Type = PCB_TYPE_NONE;
- Crosshair.AttachedObject.State = STATE_FIRST;
- Crosshair.AttachedPolygon.PointN = 0;
- if (PCB->RatDraw) {
- if (Mode == PCB_MODE_ARC || Mode == PCB_MODE_RECTANGLE ||
- Mode == PCB_MODE_VIA || Mode == PCB_MODE_POLYGON ||
- Mode == PCB_MODE_POLYGON_HOLE || Mode == PCB_MODE_TEXT || Mode == PCB_MODE_INSERT_POINT || Mode == PCB_MODE_THERMAL) {
- Message(PCB_MSG_DEFAULT, _("That mode is NOT allowed when drawing ratlines!\n"));
- Mode = PCB_MODE_NO;
- }
- }
- if (conf_core.editor.mode == PCB_MODE_LINE && Mode == PCB_MODE_ARC && Crosshair.AttachedLine.State != STATE_FIRST) {
- Crosshair.AttachedLine.State = STATE_FIRST;
- Crosshair.AttachedBox.State = STATE_SECOND;
- Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = Crosshair.AttachedLine.Point1.X;
- Crosshair.AttachedBox.Point1.Y = Crosshair.AttachedBox.Point2.Y = Crosshair.AttachedLine.Point1.Y;
- AdjustAttachedObjects();
- }
- else if (conf_core.editor.mode == PCB_MODE_ARC && Mode == PCB_MODE_LINE && Crosshair.AttachedBox.State != STATE_FIRST) {
- Crosshair.AttachedBox.State = STATE_FIRST;
- Crosshair.AttachedLine.State = STATE_SECOND;
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = Crosshair.AttachedBox.Point1.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = Crosshair.AttachedBox.Point1.Y;
- sprintf(sMode, "%d", Mode);
- conf_set(CFR_DESIGN, "editor/mode", -1, sMode, POL_OVERWRITE);
- AdjustAttachedObjects();
- }
- else {
- if (conf_core.editor.mode == PCB_MODE_ARC || conf_core.editor.mode == PCB_MODE_LINE)
- SetLocalRef(0, 0, pcb_false);
- Crosshair.AttachedBox.State = STATE_FIRST;
- Crosshair.AttachedLine.State = STATE_FIRST;
- if (Mode == PCB_MODE_LINE && conf_core.editor.auto_drc) {
- if (ResetConnections(pcb_true)) {
- IncrementUndoSerialNumber();
- Draw();
- }
- }
- }
-
- sprintf(sMode, "%d", Mode);
- conf_set(CFR_DESIGN, "editor/mode", -1, sMode, POL_OVERWRITE);
-
- if (Mode == PCB_MODE_PASTE_BUFFER)
- /* do an update on the crosshair range */
- SetCrosshairRangeToBuffer();
- else
- SetCrosshairRange(0, 0, PCB->MaxWidth, PCB->MaxHeight);
-
- recursing = pcb_false;
-
- /* force a crosshair grid update because the valid range
- * may have changed
- */
- MoveCrosshairRelative(0, 0);
- notify_crosshair_change(pcb_true);
-}
-
-void SetLocalRef(Coord X, Coord Y, pcb_bool Showing)
-{
- static MarkType old;
- static int count = 0;
-
- if (Showing) {
- notify_mark_change(pcb_false);
- if (count == 0)
- old = Marked;
- Marked.X = X;
- Marked.Y = Y;
- Marked.status = pcb_true;
- count++;
- notify_mark_change(pcb_true);
- }
- else if (count > 0) {
- notify_mark_change(pcb_false);
- count = 0;
- Marked = old;
- notify_mark_change(pcb_true);
- }
-}
diff --git a/src/set.h b/src/set.h
deleted file mode 100644
index 39518bd..0000000
--- a/src/set.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for update routines */
-
-#ifndef PCB_SET_H
-#define PCB_SET_H
-
-#include "global.h"
-
-void SetTextScale(int);
-void SetGrid(Coord, pcb_bool);
-void SetZoom(double);
-void SetLineSize(Coord);
-void SetViaSize(Coord, pcb_bool);
-void SetViaDrillingHole(Coord, pcb_bool);
-void SetClearanceWidth(Coord);
-void SetChangedFlag(pcb_bool);
-void SetBufferNumber(int);
-void SetMode(int);
-void SetCrosshairRangeToBuffer(void);
-void SetLocalRef(Coord, Coord, pcb_bool);
-void RedrawZoom(Coord, Coord);
-void SaveMode(void);
-void RestoreMode(void);
-
-#endif
diff --git a/src/strflags.c b/src/strflags.c
deleted file mode 100644
index f86efce..0000000
--- a/src/strflags.c
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 2005 DJ Delorie
- *
- * 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:
- * DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA
- * dj at delorie.com
- *
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "global.h"
-#include "strflags.h"
-#include "compat_misc.h"
-
-/* Because all the macros expect it, that's why. */
-typedef struct {
- FlagType Flags;
-} FlagHolder;
-
-/* Be careful to list more specific flags first, followed by general
- * flags, when two flags use the same bit. For example, "onsolder" is
- * for elements only, while "auto" is for everything else. They use
- * the same bit, but onsolder is listed first so that elements will
- * use it and not auto.
- *
- * Thermals are handled separately, as they're layer-selective.
- */
-
-#define N(x) x, sizeof(x)-1
-FlagBitsType pcb_object_flagbits[] = {
- {PCB_FLAG_PIN, N("pin"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_VIA, N("via"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_FOUND, N("found"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_HOLE, N("hole"), PCB_TYPEMASK_PIN},
- {PCB_FLAG_RAT, N("rat"), PCB_TYPE_RATLINE},
- {PCB_FLAG_PININPOLY, N("pininpoly"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
- {PCB_FLAG_CLEARPOLY, N("clearpoly"), PCB_TYPE_POLYGON},
- {PCB_FLAG_HIDENAME, N("hidename"), PCB_TYPE_ELEMENT},
- {PCB_FLAG_DISPLAYNAME, N("showname"), PCB_TYPE_ELEMENT},
- {PCB_FLAG_CLEARLINE, N("clearline"), PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_TEXT},
- {PCB_FLAG_SELECTED, N("selected"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_ONSOLDER, N("onsolder"), PCB_TYPE_ELEMENT | PCB_TYPE_PAD | PCB_TYPE_TEXT},
- {PCB_FLAG_AUTO, N("auto"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_SQUARE, N("square"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
- {PCB_FLAG_RUBBEREND, N("rubberend"), PCB_TYPE_LINE | PCB_TYPE_ARC},
- {PCB_FLAG_WARN, N("warn"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
- {PCB_FLAG_USETHERMAL, N("usetherm"), PCB_TYPEMASK_PIN | PCB_TYPE_LINE | PCB_TYPE_ARC},
- {PCB_FLAG_OCTAGON, N("octagon"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD},
- {PCB_FLAG_DRC, N("drc"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_LOCK, N("lock"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_EDGE2, N("edge2"), PCB_TYPEMASK_ALL},
- {PCB_FLAG_FULLPOLY, N("fullpoly"), PCB_TYPE_POLYGON},
- {PCB_FLAG_NOPASTE, N("nopaste"), PCB_TYPE_PAD},
- {PCB_FLAG_NONETLIST, N("nonetlist"), PCB_TYPEMASK_ALL}
-};
-#undef N
-
-const int pcb_object_flagbits_len = ENTRIES(pcb_object_flagbits);
-
-
-/*
- * This helper function maintains a small list of buffers which are
- * used by flags_to_string(). Each buffer is allocated from the heap,
- * but the caller must not free them (they get realloced when they're
- * reused, but never completely freed).
- */
-
-static struct {
- char *ptr;
- int len;
-} buffers[10];
-static int bufptr = 0;
-static char *alloc_buf(int len)
-{
-#define B buffers[bufptr]
- len++;
- bufptr = (bufptr + 1) % 10;
- if (B.len < len) {
- if (B.ptr)
- B.ptr = (char *) realloc(B.ptr, len);
- else
- B.ptr = (char *) malloc(len);
- B.len = len;
- }
- return B.ptr;
-#undef B
-}
-
-void uninit_strflags_buf(void)
-{
- int n;
- for(n = 0; n < 10; n++) {
- if (buffers[n].ptr != NULL) {
- free(buffers[n].ptr);
- buffers[n].ptr = NULL;
- }
- }
-}
-
-/*
- * This set of routines manages a list of layer-specific flags.
- * Callers should call grow_layer_list(0) to reset the list, and
- * set_layer_list(layer,1) to set bits in the layer list. The results
- * are stored in layers[], which has num_layers valid entries.
- */
-
-static char *layers = 0;
-static int max_layers = 0, num_layers = 0;
-
-static void grow_layer_list(int num)
-{
- if (layers == 0) {
- layers = (char *) calloc(num > 0 ? num : 1, 1);
- max_layers = num;
- }
- else if (num > max_layers) {
- max_layers = num;
- layers = (char *) realloc(layers, max_layers);
- }
- if (num > num_layers)
- memset(layers + num_layers, 0, num - num_layers - 1);
- num_layers = num;
- return;
-}
-
-void uninit_strflags_layerlist(void)
-{
- if (layers != NULL) {
- free(layers);
- layers = NULL;
- num_layers = max_layers = 0;
- }
-}
-
-static inline void set_layer_list(int layer, int v)
-{
- if (layer >= num_layers)
- grow_layer_list(layer + 1);
- layers[layer] = v;
-}
-
-/*
- * These next two convert between layer lists and strings.
- * parse_layer_list() is passed a pointer to a string, and parses a
- * list of integer which reflect layers to be flagged. It returns a
- * pointer to the first character following the list. The syntax of
- * the list is a paren-surrounded, comma-separated list of integers
- * and/or pairs of integers separated by a dash (like "(1,2,3-7)").
- * Spaces and other punctuation are not allowed. The results are
- * stored in layers[] defined above.
- *
- * print_layer_list() does the opposite - it uses the flags set in
- * layers[] to build a string that represents them, using the syntax
- * above.
- *
- */
-
-/* Returns a pointer to the first character past the list. */
-static const char *parse_layer_list(const char *bp, int (*error) (const char *))
-{
- const char *orig_bp = bp;
- int l = 0, range = -1;
- int value = 1;
-
- grow_layer_list(0);
- while (*bp) {
- if (*bp == '+')
- value = 2;
- else if (*bp == 'S')
- value = 3;
- else if (*bp == 'X')
- value = 4;
- else if (*bp == 't')
- value = 5;
- else if (*bp == ')' || *bp == ',' || *bp == '-') {
- if (range == -1)
- range = l;
- while (range <= l)
- set_layer_list(range++, value);
- if (*bp == '-')
- range = l;
- else
- range = -1;
- value = 1;
- l = 0;
- }
-
- else if (isdigit((int) *bp))
- l = l * 10 + (*bp - '0');
-
- else if (error) {
- const char *fmt = "Syntax error parsing layer list \"%.*s\" at %c";
- char *msg = alloc_buf(strlen(fmt) + strlen(orig_bp));
- sprintf(msg, fmt, bp - orig_bp + 5, orig_bp, *bp);
- error(msg);
- error = NULL;
- }
-
- if (*bp == ')')
- return bp + 1;
-
- bp++;
- }
- return bp;
-}
-
-/* Number of character the value "i" requires when printed. */
-static int printed_int_length(int i, int j)
-{
- int rv;
-
- if (i < 10)
- return 1 + (j ? 1 : 0);
- if (i < 100)
- return 2 + (j ? 1 : 0);
-
- for (rv = 1; i >= 10; rv++)
- i /= 10;
- return rv + (j ? 1 : 0);
-}
-
-/* Returns a pointer to an internal buffer which is overwritten with
- each new call. */
-static char *print_layer_list()
-{
- static char *buf = 0;
- static int buflen = 0;
- int len, i, j;
- char *bp;
-
- len = 2;
- for (i = 0; i < num_layers; i++)
- if (layers[i])
- len += 1 + printed_int_length(i, layers[i]);
- if (buflen < len) {
- if (buf)
- buf = (char *) realloc(buf, len);
- else
- buf = (char *) malloc(len);
- buflen = len;
- }
-
- bp = buf;
- *bp++ = '(';
-
- for (i = 0; i < num_layers; i++)
- if (layers[i]) {
- /* 0 0 1 1 1 0 0 */
- /* i j */
- for (j = i + 1; j < num_layers && layers[j] == 1; j++);
- if (j > i + 2) {
- sprintf(bp, "%d-%d,", i, j - 1);
- i = j - 1;
- }
- else
- switch (layers[i]) {
- case 1:
- sprintf(bp, "%d,", i);
- break;
- case 2:
- sprintf(bp, "%d+,", i);
- break;
- case 3:
- sprintf(bp, "%dS,", i);
- break;
- case 4:
- sprintf(bp, "%dX,", i);
- break;
- case 5:
- default:
- sprintf(bp, "%dt,", i);
- break;
- }
- bp += strlen(bp);
- }
- bp[-1] = ')';
- *bp = 0;
- return buf;
-}
-
-/*
- * Ok, now the two entry points to this file. The first, string_to_flags,
- * is passed a string (usually from parse_y.y) and returns a "set of flags".
- * In theory, this can be anything, but for now it's just an integer. Later
- * it might be a structure, for example.
- *
- * Currently, there is no error handling :-P
- */
-
-static int error_ignore(const char *msg)
-{ /* do nothing */
- return 0;
-}
-
-static FlagType empty_flags;
-
-FlagType
-common_string_to_flags(const char *flagstring, int (*error) (const char *msg), FlagBitsType * flagbits, int n_flagbits)
-{
- const char *fp, *ep;
- int flen;
- FlagHolder rv;
- int i;
-
- rv.Flags = empty_flags;
-
- if (error == 0)
- error = error_ignore;
-
- if (flagstring == NULL)
- return empty_flags;
-
- fp = ep = flagstring;
-
- if (*fp == '"')
- ep = ++fp;
-
- while (*ep && *ep != '"') {
- int found = 0;
-
- for (ep = fp; *ep && *ep != ',' && *ep != '"' && *ep != '('; ep++);
- flen = ep - fp;
- if (*ep == '(')
- ep = parse_layer_list(ep + 1, error);
-
- if (flen == 7 && memcmp(fp, "thermal", 7) == 0) {
- for (i = 0; i < MAX_LAYER && i < num_layers; i++)
- if (layers[i])
- ASSIGN_THERM(i, layers[i], &rv);
- }
- else if (flen == 5 && memcmp(fp, "shape", 5) == 0) {
- rv.Flags.q = atoi(fp + 6);
- }
- else if (flen == 7 && memcmp(fp, "intconn", 7) == 0) {
- rv.Flags.int_conn_grp = atoi(fp + 8);
- }
- else {
- for (i = 0; i < n_flagbits; i++)
- if (flagbits[i].nlen == flen && memcmp(flagbits[i].name, fp, flen) == 0) {
- found = 1;
- SET_FLAG(flagbits[i].mask, &rv);
- break;
- }
- if (!found) {
- const char *fmt = "Unknown flag: \"%.*s\" ignored";
- unknown_flag_t *u;
- char *msg;
- const char *s;
-
- /* include () */
- s = fp + flen;
- if (*s == '(') {
- while (*s != ')') {
- flen++;
- s++;
- }
- }
- if (*s == ')')
- flen++;
-
- msg = alloc_buf(strlen(fmt) + flen);
- sprintf(msg, fmt, flen, fp);
- error(msg);
-
- u = malloc(sizeof(unknown_flag_t));
- u->str = pcb_strndup(fp, flen);
- u->next = NULL;
- /* need to append, to keep order of flags */
- if (rv.Flags.unknowns != NULL) {
- unknown_flag_t *n;
- for (n = rv.Flags.unknowns; n->next != NULL; n = n->next);
- n->next = u;
- }
- else
- rv.Flags.unknowns = u;
- }
- }
- fp = ep + 1;
- }
- return rv.Flags;
-}
-
-FlagType string_to_flags(const char *flagstring, int (*error) (const char *msg))
-{
- return common_string_to_flags(flagstring, error, pcb_object_flagbits, ENTRIES(pcb_object_flagbits));
-}
-
-
-/*
- * Given a set of flags for a given type of object, return a string
- * which reflects those flags. The only requirement is that this
- * string be parseable by string_to_flags.
- *
- * Note that this function knows a little about what kinds of flags
- * will be automatically set by parsing, so it won't (for example)
- * include the "via" flag for PCB_TYPE_VIAs because it knows those get
- * forcibly set when vias are parsed.
- */
-
-char *common_flags_to_string(FlagType flags, int object_type, FlagBitsType * flagbits, int n_flagbits)
-{
- int len;
- int i;
- FlagHolder fh, savef;
- char *buf, *bp;
- unknown_flag_t *u;
-
- fh.Flags = flags;
-
-#ifndef FLAG_TEST
- switch (object_type) {
- case PCB_TYPE_VIA:
- CLEAR_FLAG(PCB_FLAG_VIA, &fh);
- break;
- case PCB_TYPE_RATLINE:
- CLEAR_FLAG(PCB_FLAG_RAT, &fh);
- break;
- case PCB_TYPE_PIN:
- CLEAR_FLAG(PCB_FLAG_PIN, &fh);
- break;
- }
-#endif
-
- savef = fh;
-
- len = 3; /* for "()\0" */
-
- for (i = 0; i < n_flagbits; i++)
-
- if ((flagbits[i].object_types & object_type)
- && (TEST_FLAG(flagbits[i].mask, &fh))) {
-
- len += flagbits[i].nlen + 1;
- CLEAR_FLAG(flagbits[i].mask, &fh);
- }
-
- if (TEST_ANY_THERMS(&fh)) {
- len += sizeof("thermal()");
- for (i = 0; i < MAX_LAYER; i++)
- if (TEST_THERM(i, &fh))
- len += printed_int_length(i, GET_THERM(i, &fh)) + 1;
- }
-
- if (flags.q > 0) {
- len += sizeof("shape(.)");
- if (flags.q > 9)
- len += 2;
- }
-
- if (flags.int_conn_grp > 0) {
- len += sizeof("intconn(.)");
- if (flags.q > 9)
- len++;
- if (flags.q > 99)
- len++;
- }
-
- for (u = flags.unknowns; u != NULL; u = u->next)
- len += strlen(u->str) + 1;
-
- bp = buf = alloc_buf(len + 2);
-
- *bp++ = '"';
-
- fh = savef;
- for (i = 0; i < n_flagbits; i++)
- if (flagbits[i].object_types & object_type && (TEST_FLAG(flagbits[i].mask, &fh))) {
- if (bp != buf + 1)
- *bp++ = ',';
- strcpy(bp, flagbits[i].name);
- bp += flagbits[i].nlen;
- CLEAR_FLAG(flagbits[i].mask, &fh);
- }
-
- if (TEST_ANY_THERMS(&fh)) {
- if (bp != buf + 1)
- *bp++ = ',';
- strcpy(bp, "thermal");
- bp += strlen("thermal");
- grow_layer_list(0);
- for (i = 0; i < MAX_LAYER; i++)
- if (TEST_THERM(i, &fh))
- set_layer_list(i, GET_THERM(i, &fh));
- strcpy(bp, print_layer_list());
- bp += strlen(bp);
- }
-
- if (flags.q > 0) {
- if (bp != buf + 1)
- *bp++ = ',';
- bp += sprintf(bp, "shape(%d)", flags.q);
- }
-
- if (flags.int_conn_grp > 0) {
- if (bp != buf + 1)
- *bp++ = ',';
- bp += sprintf(bp, "intconn(%d)", flags.int_conn_grp);
- }
-
- for (u = flags.unknowns; u != NULL; u = u->next) {
- int len;
- len = strlen(u->str);
- if (bp != buf + 1)
- *bp++ = ',';
- memcpy(bp, u->str, len);
- bp += len;
- }
-
- *bp++ = '"';
- *bp = 0;
- return buf;
-}
-
-char *flags_to_string(FlagType flags, int object_type)
-{
- return common_flags_to_string(flags, object_type, pcb_object_flagbits, ENTRIES(pcb_object_flagbits));
-}
diff --git a/src/strflags.h b/src/strflags.h
deleted file mode 100644
index d7a6664..0000000
--- a/src/strflags.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 2005 DJ Delorie
- *
- * 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:
- * DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA
- * dj at delorie.com
- *
- */
-
-#ifndef PCB_STRFLAGS_H
-#define PCB_STRFLAGS_H
-
-/* for flagtype */
-#include "global_objs.h"
-
-typedef struct {
-
- /* This is the bit that we're setting. */
- int mask;
-
- /* The name used in the output file. */
- const char *name;
- int nlen;
-
- /* If set, this entry won't be output unless the object type is one
- of these. */
- int object_types;
-
-} FlagBitsType;
-
-/* All flags natively known by the core */
-extern FlagBitsType pcb_object_flagbits[];
-extern const int pcb_object_flagbits_len;
-
-/* The purpose of this interface is to make the file format able to
- handle more than 32 flags, and to hide the internal details of
- flags from the file format. */
-
-/* When passed a string, parse it and return an appropriate set of
- flags. Errors cause error() to be called with a suitable message;
- if error is NULL, errors are ignored. */
-FlagType string_to_flags(const char *flagstring, int (*error) (const char *msg));
-
-/* Given a set of flags for a given object type, return a string which
- can be output to a file. The returned pointer must not be
- freed. */
-char *flags_to_string(FlagType flags, int object_type);
-
-/* Same as above, but for pcb flags. */
-FlagType string_to_pcbflags(const char *flagstring, int (*error) (const char *msg));
-char *pcbflags_to_string(FlagType flags);
-
-void uninit_strflags_buf(void);
-void uninit_strflags_layerlist(void);
-
-/* io_pcb() needs this for historic reasons */
-FlagType common_string_to_flags(const char *flagstring, int (*error) (const char *msg), FlagBitsType * flagbits, int n_flagbits);
-char *common_flags_to_string(FlagType flags, int object_type, FlagBitsType * flagbits, int n_flagbits);
-
-#endif
diff --git a/src/stub_draw_fab.c b/src/stub_draw_fab.c
new file mode 100644
index 0000000..436d420
--- /dev/null
+++ b/src/stub_draw_fab.c
@@ -0,0 +1,50 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+#include "config.h"
+#include "stub_draw_fab.h"
+#include "obj_text.h"
+#include "obj_text_draw.h"
+
+int dummy_DrawFab_overhang(void)
+{
+ return 0;
+}
+
+void dummy_DrawFab(pcb_hid_gc_t gc)
+{
+ pcb_text_t t;
+ t.X = 0;
+ t.Y = 0;
+ t.TextString = "Can't render the fab layer: the draw_fab plugin is not compiled and/or not loaded";
+ t.Direction = 0;
+ t.Scale = 150;
+ t.Flags = pcb_no_flags();
+ DrawTextLowLevel(&t, 0);
+}
+
+int (*pcb_stub_draw_fab_overhang)(void) = dummy_DrawFab_overhang;
+void (*pcb_stub_draw_fab)(pcb_hid_gc_t gc) = dummy_DrawFab;
+
diff --git a/src/stub_draw_fab.h b/src/stub_draw_fab.h
new file mode 100644
index 0000000..49ae620
--- /dev/null
+++ b/src/stub_draw_fab.h
@@ -0,0 +1,37 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* drawing the fab layer is a plugin now */
+
+#ifndef PCB_STUB_DRAW_FAB_H
+#define PCB_STUB_DRAW_FAB_H
+
+#include "hid.h"
+
+extern int (*pcb_stub_draw_fab_overhang)(void);
+extern void (*pcb_stub_draw_fab)(pcb_hid_gc_t gc);
+
+#endif
diff --git a/src/stub_mincut.c b/src/stub_mincut.c
index 2704ba0..2afcb02 100644
--- a/src/stub_mincut.c
+++ b/src/stub_mincut.c
@@ -21,23 +21,25 @@
*/
#include "config.h"
-#include "global.h"
+#include <stdlib.h>
#include "stub_mincut.h"
+#include "obj_pinvia.h"
+#include "obj_pad.h"
static void stub_rat_proc_shorts_dummy(void)
{
}
-static void stub_rat_found_short_dummy(PinType * pin, PadType * pad, const char *with_net)
+static void stub_rat_found_short_dummy(pcb_pin_t * pin, pcb_pad_t * pad, const char *with_net)
{
/* original behavior: just warn at random pins/pads */
if (pin != NULL)
- SET_FLAG(PCB_FLAG_WARN, pin);
+ PCB_FLAG_SET(PCB_FLAG_WARN, pin);
if (pad != NULL)
- SET_FLAG(PCB_FLAG_WARN, pad);
+ PCB_FLAG_SET(PCB_FLAG_WARN, pad);
stub_rat_proc_shorts_dummy();
}
-void (*stub_rat_found_short)(PinType * pin, PadType * pad, const char *with_net) = stub_rat_found_short_dummy;
-void (*stub_rat_proc_shorts)(void) = stub_rat_proc_shorts_dummy;
+void (*pcb_stub_rat_found_short)(pcb_pin_t * pin, pcb_pad_t * pad, const char *with_net) = stub_rat_found_short_dummy;
+void (*pcb_stub_rat_proc_shorts)(void) = stub_rat_proc_shorts_dummy;
diff --git a/src/stub_mincut.h b/src/stub_mincut.h
index fe53425..55afc66 100644
--- a/src/stub_mincut.h
+++ b/src/stub_mincut.h
@@ -20,6 +20,8 @@
*
*/
-extern void (*stub_rat_found_short)(PinType * pin, PadType * pad, const char *with_net);
-extern void (*stub_rat_proc_shorts)(void);
+#include "global_typedefs.h"
+
+extern void (*pcb_stub_rat_found_short)(pcb_pin_t * pin, pcb_pad_t * pad, const char *with_net);
+extern void (*pcb_stub_rat_proc_shorts)(void);
diff --git a/src/stub_stroke.c b/src/stub_stroke.c
index d026b9b..7cea221 100644
--- a/src/stub_stroke.c
+++ b/src/stub_stroke.c
@@ -20,9 +20,10 @@
*
*/
#include "error.h"
+#include "config.h"
#include "pcb_bool.h"
-pcb_bool mid_stroke = pcb_false;
+pcb_bool pcb_mid_stroke = pcb_false;
static void stub_stroke_record_dummy(int ev_x, int ev_y)
{
@@ -30,9 +31,9 @@ static void stub_stroke_record_dummy(int ev_x, int ev_y)
static void stub_stroke_start_dummy(void)
{
- Message(PCB_MSG_DEFAULT, "Can not use libstroke: not compiled as a buildin and not loaded as a plugin\n");
+ pcb_message(PCB_MSG_WARNING, "Can not use libstroke: not compiled as a buildin and not loaded as a plugin\n");
}
-void (*stub_stroke_record)(int ev_x, int ev_y) = stub_stroke_record_dummy;
-void (*stub_stroke_start)(void) = stub_stroke_start_dummy;
-void (*stub_stroke_finish)(void) = stub_stroke_start_dummy;
+void (*pcb_stub_stroke_record)(int ev_x, int ev_y) = stub_stroke_record_dummy;
+void (*pcb_stub_stroke_start)(void) = stub_stroke_start_dummy;
+void (*pcb_stub_stroke_finish)(void) = stub_stroke_start_dummy;
diff --git a/src/stub_stroke.h b/src/stub_stroke.h
index 3325306..770a5d8 100644
--- a/src/stub_stroke.h
+++ b/src/stub_stroke.h
@@ -20,7 +20,7 @@
*
*/
-extern pcb_bool mid_stroke;
-extern void (*stub_stroke_record)(int ev_x, int ev_y);
-extern void (*stub_stroke_start)(void);
-extern void (*stub_stroke_finish)(void);
+extern pcb_bool pcb_mid_stroke;
+extern void (*pcb_stub_stroke_record)(int ev_x, int ev_y);
+extern void (*pcb_stub_stroke_start)(void);
+extern void (*pcb_stub_stroke_finish)(void);
diff --git a/src/stub_vendor.c b/src/stub_vendor.c
index 3a93544..b8b590a 100644
--- a/src/stub_vendor.c
+++ b/src/stub_vendor.c
@@ -20,6 +20,7 @@
*
*/
+#include "config.h"
#include "stub_vendor.h"
static int stub_vendorDrillMap_dummy(int dia)
@@ -27,12 +28,12 @@ static int stub_vendorDrillMap_dummy(int dia)
return dia;
}
-static pcb_bool stub_vendorIsElementMappable_dummy(ElementTypePtr e)
+static pcb_bool stub_vendorIsElementMappable_dummy(pcb_element_t *e)
{
return pcb_false;
}
-int (*stub_vendorDrillMap)(int) = stub_vendorDrillMap_dummy;
-pcb_bool (*stub_vendorIsElementMappable)(ElementTypePtr) = stub_vendorIsElementMappable_dummy;
+int (*pcb_stub_vendor_drill_map)(int) = stub_vendorDrillMap_dummy;
+pcb_bool (*pcb_stub_vendor_is_element_mappable)(pcb_element_t *) = stub_vendorIsElementMappable_dummy;
diff --git a/src/stub_vendor.h b/src/stub_vendor.h
index 7772374..765917a 100644
--- a/src/stub_vendor.h
+++ b/src/stub_vendor.h
@@ -24,9 +24,9 @@
#define PCB_STUB_VENDOR_H
#include "config.h"
-#include "global.h"
+#include "global_typedefs.h"
-extern int (*stub_vendorDrillMap)(int);
-extern pcb_bool (*stub_vendorIsElementMappable)(ElementTypePtr);
+extern int (*pcb_stub_vendor_drill_map)(int);
+extern pcb_bool (*pcb_stub_vendor_is_element_mappable)(pcb_element_t *);
#endif /* __VENDOR_H__ */
diff --git a/src/thermal.c b/src/thermal.c
deleted file mode 100644
index be022e2..0000000
--- a/src/thermal.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau
- *
- * this file, thermal.c was written by and is
- * (C) Copyright 2006, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau at rz.uni-ulm.de
- *
- */
-
-/* negative thermal finger polygons */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <math.h>
-
-#include "misc.h"
-#include "polygon.h"
-#include "thermal.h"
-
-static PCBTypePtr pcb;
-
-struct cent {
- Coord x, y;
- Coord s, c;
- char style;
- POLYAREA *p;
-};
-
-static POLYAREA *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt)
-{
- PLINE *c;
- Vector v;
- Coord x1, x2, y1, y2;
-
- if (rt) {
- x1 = (l - w) * M_SQRT1_2;
- x2 = (l + w) * M_SQRT1_2;
- y1 = x1;
- y2 = x2;
- }
- else {
- x2 = -(l - w) * M_SQRT1_2;
- x1 = -(l + w) * M_SQRT1_2;
- y1 = -x1;
- y2 = -x2;
- }
-
- v[0] = X + x1;
- v[1] = Y + y2;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = X - x2;
- v[1] = Y - y1;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = X - x1;
- v[1] = Y - y2;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = X + x2;
- v[1] = Y + y1;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- return ContourToPoly(c);
-}
-
-static POLYAREA *square_therm(PinTypePtr pin, pcb_cardinal_t style)
-{
- POLYAREA *p, *p2;
- PLINE *c;
- Vector v;
- Coord d, in, out;
-
- switch (style) {
- case 1:
- d = pcb->ThermScale * pin->Clearance * M_SQRT1_2;
- out = (pin->Thickness + pin->Clearance) / 2;
- in = pin->Thickness / 2;
- /* top (actually bottom since +y is down) */
- v[0] = pin->X - in + d;
- v[1] = pin->Y + in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X + in - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + out - d;
- v[1] = pin->Y + out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - out + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p = ContourToPoly(c);
- /* right */
- v[0] = pin->X + in;
- v[1] = pin->Y + in - d;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y - in + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + out;
- v[1] = pin->Y - out + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y + out - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p2 = ContourToPoly(c);
- p->f = p2;
- p2->b = p;
- /* left */
- v[0] = pin->X - in;
- v[1] = pin->Y - in + d;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y + in - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - out;
- v[1] = pin->Y + out - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y - out + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p2 = ContourToPoly(c);
- p->f->f = p2;
- p2->b = p->f;
- /* bottom (actually top since +y is down) */
- v[0] = pin->X + in - d;
- v[1] = pin->Y - in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X - in + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - out + d;
- v[1] = pin->Y - out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + out - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p2 = ContourToPoly(c);
- p->f->f->f = p2;
- p2->f = p;
- p2->b = p->f->f;
- p->b = p2;
- return p;
- case 4:
- {
- LineType l;
- l.Flags = NoFlags();
- d = pin->Thickness / 2 - pcb->ThermScale * pin->Clearance;
- out = pin->Thickness / 2 + pin->Clearance / 4;
- in = pin->Clearance / 2;
- /* top */
- l.Point1.X = pin->X - d;
- l.Point2.Y = l.Point1.Y = pin->Y + out;
- l.Point2.X = pin->X + d;
- p = LinePoly(&l, in);
- /* right */
- l.Point1.X = l.Point2.X = pin->X + out;
- l.Point1.Y = pin->Y - d;
- l.Point2.Y = pin->Y + d;
- p2 = LinePoly(&l, in);
- p->f = p2;
- p2->b = p;
- /* bottom */
- l.Point1.X = pin->X - d;
- l.Point2.Y = l.Point1.Y = pin->Y - out;
- l.Point2.X = pin->X + d;
- p2 = LinePoly(&l, in);
- p->f->f = p2;
- p2->b = p->f;
- /* left */
- l.Point1.X = l.Point2.X = pin->X - out;
- l.Point1.Y = pin->Y - d;
- l.Point2.Y = pin->Y + d;
- p2 = LinePoly(&l, in);
- p->f->f->f = p2;
- p2->b = p->f->f;
- p->b = p2;
- p2->f = p;
- return p;
- }
- default: /* style 2 and 5 */
- d = 0.5 * pcb->ThermScale * pin->Clearance;
- if (style == 5)
- d += d;
- out = (pin->Thickness + pin->Clearance) / 2;
- in = pin->Thickness / 2;
- /* topright */
- v[0] = pin->X + in;
- v[1] = pin->Y + in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[0] = pin->X + out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2);
- v[1] = pin->Y + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point */
- frac_circle(c, pin->X + in, pin->Y + in, v, 4);
- v[0] = pin->X + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2);
- p = ContourToPoly(c);
- /* bottom right */
- v[0] = pin->X + in;
- v[1] = pin->Y - d;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[1] = pin->Y - out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2);
- v[0] = pin->X + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point */
- frac_circle(c, pin->X + in, pin->Y - in, v, 4);
- v[1] = pin->Y - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 5)
- frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2);
- p2 = ContourToPoly(c);
- p->f = p2;
- p2->b = p;
- /* bottom left */
- v[0] = pin->X - d;
- v[1] = pin->Y - in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[0] = pin->X - out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2);
- v[1] = pin->Y - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point */
- frac_circle(c, pin->X - in, pin->Y - in, v, 4);
- v[0] = pin->X - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 5)
- frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2);
- p2 = ContourToPoly(c);
- p->f->f = p2;
- p2->b = p->f;
- /* top left */
- v[0] = pin->X - d;
- v[1] = pin->Y + out;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point (x-out, y+in) */
- frac_circle(c, pin->X - in, pin->Y + in, v, 4);
- v[1] = pin->Y + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[0] = pin->X - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2);
- v[1] = pin->Y + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 5)
- frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2);
- p2 = ContourToPoly(c);
- p->f->f->f = p2;
- p2->f = p;
- p2->b = p->f->f;
- p->b = p2;
- return p;
- }
-}
-
-static POLYAREA *oct_therm(PinTypePtr pin, pcb_cardinal_t style)
-{
- POLYAREA *p, *p2, *m;
- Coord t = 0.5 * pcb->ThermScale * pin->Clearance;
- Coord w = pin->Thickness + pin->Clearance;
-
- p = OctagonPoly(pin->X, pin->Y, w, GET_SQUARE(pin));
- p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, GET_SQUARE(pin));
- /* make full clearance ring */
- poly_Boolean_free(p, p2, &m, PBO_SUB);
- switch (style) {
- default:
- case 1:
- p = diag_line(pin->X, pin->Y, w, t, pcb_true);
- poly_Boolean_free(m, p, &p2, PBO_SUB);
- p = diag_line(pin->X, pin->Y, w, t, pcb_false);
- poly_Boolean_free(p2, p, &m, PBO_SUB);
- return m;
- case 2:
- p = RectPoly(pin->X - t, pin->X + t, pin->Y - w, pin->Y + w);
- poly_Boolean_free(m, p, &p2, PBO_SUB);
- p = RectPoly(pin->X - w, pin->X + w, pin->Y - t, pin->Y + t);
- poly_Boolean_free(p2, p, &m, PBO_SUB);
- return m;
- /* fix me add thermal style 4 */
- case 5:
- {
- Coord t = pin->Thickness / 2;
- POLYAREA *q;
- /* cheat by using the square therm's rounded parts */
- p = square_therm(pin, style);
- q = RectPoly(pin->X - t, pin->X + t, pin->Y - t, pin->Y + t);
- poly_Boolean_free(p, q, &p2, PBO_UNITE);
- poly_Boolean_free(m, p2, &p, PBO_ISECT);
- return p;
- }
- }
-}
-
-/* ThermPoly returns a POLYAREA having all of the clearance that when
- * subtracted from the plane create the desired thermal fingers.
- * Usually this is 4 disjoint regions.
- *
- */
-POLYAREA *ThermPoly(PCBTypePtr p, PinTypePtr pin, pcb_cardinal_t laynum)
-{
- ArcType a;
- POLYAREA *pa, *arc;
- pcb_cardinal_t style = GET_THERM(laynum, pin);
-
- if (style == 3)
- return NULL; /* solid connection no clearance */
- pcb = p;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin))
- return square_therm(pin, style);
- if (TEST_FLAG(PCB_FLAG_OCTAGON, pin))
- return oct_therm(pin, style);
- /* must be circular */
- switch (style) {
- case 1:
- case 2:
- {
- POLYAREA *m;
- Coord t = (pin->Thickness + pin->Clearance) / 2;
- Coord w = 0.5 * pcb->ThermScale * pin->Clearance;
- pa = CirclePoly(pin->X, pin->Y, t);
- arc = CirclePoly(pin->X, pin->Y, pin->Thickness / 2);
- /* create a thin ring */
- poly_Boolean_free(pa, arc, &m, PBO_SUB);
- /* fix me needs error checking */
- if (style == 2) {
- /* t is the theoretically required length, but we use twice that
- * to avoid descritisation errors in our circle approximation.
- */
- pa = RectPoly(pin->X - t * 2, pin->X + t * 2, pin->Y - w, pin->Y + w);
- poly_Boolean_free(m, pa, &arc, PBO_SUB);
- pa = RectPoly(pin->X - w, pin->X + w, pin->Y - t * 2, pin->Y + t * 2);
- }
- else {
- /* t is the theoretically required length, but we use twice that
- * to avoid descritisation errors in our circle approximation.
- */
- pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_true);
- poly_Boolean_free(m, pa, &arc, PBO_SUB);
- pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_false);
- }
- poly_Boolean_free(arc, pa, &m, PBO_SUB);
- return m;
- }
-
-
- default:
- a.X = pin->X;
- a.Y = pin->Y;
- a.Height = a.Width = pin->Thickness / 2 + pin->Clearance / 4;
- a.Thickness = 1;
- a.Clearance = pin->Clearance / 2;
- a.Flags = NoFlags();
- a.Delta = 90 - (a.Clearance * (1. + 2. * pcb->ThermScale) * 180) / (M_PI * a.Width);
- a.StartAngle = 90 - a.Delta / 2 + (style == 4 ? 0 : 45);
- pa = ArcPoly(&a, a.Clearance);
- if (!pa)
- return NULL;
- a.StartAngle += 90;
- arc = ArcPoly(&a, a.Clearance);
- if (!arc)
- return NULL;
- pa->f = arc;
- arc->b = pa;
- a.StartAngle += 90;
- arc = ArcPoly(&a, a.Clearance);
- if (!arc)
- return NULL;
- pa->f->f = arc;
- arc->b = pa->f;
- a.StartAngle += 90;
- arc = ArcPoly(&a, a.Clearance);
- if (!arc)
- return NULL;
- pa->b = arc;
- pa->f->f->f = arc;
- arc->b = pa->f->f;
- arc->f = pa;
- pa->b = arc;
- return pa;
- }
-}
diff --git a/src/thermal.h b/src/thermal.h
deleted file mode 100644
index 35480e2..0000000
--- a/src/thermal.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996,2006 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 at rz.uni-ulm.de
- *
- */
-
-/* prototypes for thermal routines
- *
- * Thermals are normal lines on the layout. The only thing unique
- * about them is that they have the PCB_FLAG_USETHERMAL set so that they
- * can be identified as thermals. It is handy for pcb to automatically
- * make adjustments to the thermals when the user performs certain
- * operations, and the functions in thermal.h help implement that.
- */
-
-#ifndef PCB_THERMAL_H
-#define PCB_THERMAL_H
-
-#include <stdlib.h>
-#include "global.h"
-#include "mymem.h"
-
-POLYAREA *ThermPoly(PCBTypePtr, PinTypePtr, pcb_cardinal_t);
-
-#endif
diff --git a/src/undo.c b/src/undo.c
index 39a214d..786a406 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -43,30 +43,29 @@
#include "config.h"
#include <assert.h>
-#include <memory.h>
-#include "buffer.h"
+#include "board.h"
#include "change.h"
-#include "create.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "insert.h"
-#include "layer.h"
-#include "misc.h"
-#include "mirror.h"
-#include "move.h"
#include "polygon.h"
#include "remove.h"
#include "rotate.h"
-#include "rtree.h"
#include "search.h"
-#include "set.h"
#include "undo.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "conf_core.h"
#include "compat_misc.h"
-#include "netlist.h"
+#include "compat_nls.h"
+
+#include "obj_elem_draw.h"
+#include "obj_poly_draw.h"
+
+#define STEP_REMOVELIST 500
+#define STEP_UNDOLIST 500
+
static pcb_bool between_increment_and_restore = pcb_false;
static pcb_bool added_undo_between_increment_and_restore = pcb_false;
@@ -79,24 +78,24 @@ typedef struct { /* information about a change command */
} ChangeNameType, *ChangeNameTypePtr;
typedef struct { /* information about a move command */
- Coord DX, DY; /* movement vector */
+ pcb_coord_t DX, DY; /* movement vector */
} MoveType, *MoveTypePtr;
typedef struct { /* information about removed polygon points */
- Coord X, Y; /* data */
+ pcb_coord_t X, Y; /* data */
int ID;
pcb_cardinal_t Index; /* index in a polygons array of points */
pcb_bool last_in_contour; /* Whether the point was the last in its contour */
} RemovedPointType, *RemovedPointTypePtr;
typedef struct { /* information about rotation */
- Coord CenterX, CenterY; /* center of rotation */
+ pcb_coord_t CenterX, CenterY; /* center of rotation */
pcb_cardinal_t Steps; /* number of steps */
} RotateType, *RotateTypePtr;
typedef struct { /* information about moves between layers */
pcb_cardinal_t OriginalLayer; /* the index of the original layer */
-} MoveToLayerType, *MoveToLayerTypePtr;
+} MoveToLayer;
typedef struct { /* information about layer changes */
int old_index;
@@ -105,16 +104,16 @@ typedef struct { /* information about layer changes */
typedef struct { /* information about poly clear/restore */
pcb_bool Clear; /* pcb_true was clear, pcb_false was restore */
- LayerTypePtr Layer;
+ pcb_layer_t *Layer;
} ClearPolyType, *ClearPolyTypePtr;
typedef struct {
- Angle angle[2];
+ pcb_angle_t angle[2];
} AngleChangeType;
typedef struct { /* information about netlist lib changes */
- LibraryTypePtr old;
- LibraryTypePtr lib;
+ pcb_lib_t *old;
+ pcb_lib_t *lib;
} NetlistChangeType, *NetlistChangeTypePtr;
typedef struct { /* holds information about an operation */
@@ -127,9 +126,9 @@ typedef struct { /* holds information about an operation */
MoveType Move;
RemovedPointType RemovedPoint;
RotateType Rotate;
- MoveToLayerType MoveToLayer;
- FlagType Flags;
- Coord Size;
+ MoveToLayer MoveToLayer;
+ pcb_flag_t Flags;
+ pcb_coord_t Size;
LayerChangeType LayerChange;
ClearPolyType ClearPoly;
NetlistChangeType NetlistChange;
@@ -141,7 +140,7 @@ typedef struct { /* holds information about an operation */
/* ---------------------------------------------------------------------------
* some local variables
*/
-static DataTypePtr RemoveList = NULL; /* list of removed objects */
+static pcb_data_t *RemoveList = NULL; /* list of removed objects */
static UndoListTypePtr UndoList = NULL; /* list of operations */
static int Serial = 1, /* serial number */
SavedSerial;
@@ -189,8 +188,8 @@ static UndoListTypePtr GetUndoSlot(int CommandType, int ID, int Kind)
size_t limit = ((size_t)conf_core.editor.undo_warning_size) * 1024;
#ifdef DEBUG_ID
- if (SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, ID, Kind) == PCB_TYPE_NONE)
- Message(PCB_MSG_DEFAULT, "hace: ID (%d) and Type (%x) mismatch in AddObject...\n", ID, Kind);
+ if (pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, ID, Kind) == PCB_TYPE_NONE)
+ pcb_message(PCB_MSG_ERROR, "hace: ID (%d) and Type (%x) mismatch in AddObject...\n", ID, Kind);
#endif
/* allocate memory */
@@ -206,7 +205,7 @@ static UndoListTypePtr GetUndoSlot(int CommandType, int ID, int Kind)
if (size > limit) {
size_t l2;
l2 = (size / limit + 1) * limit;
- Message(PCB_MSG_DEFAULT, _("Size of 'undo-list' exceeds %li kb\n"), (long) (l2 >> 10));
+ pcb_message(PCB_MSG_INFO, _("Size of 'undo-list' exceeds %li kb\n"), (long) (l2 >> 10));
}
}
@@ -214,14 +213,14 @@ static UndoListTypePtr GetUndoSlot(int CommandType, int ID, int Kind)
for (ptr = &UndoList[UndoN]; RedoN; ptr++, RedoN--)
switch (ptr->Type) {
- case UNDO_CHANGENAME:
- case UNDO_CHANGEPINNUM:
+ case PCB_UNDO_CHANGENAME:
+ case PCB_UNDO_CHANGEPINNUM:
free(ptr->Data.ChangeName.Name);
break;
- case UNDO_REMOVE:
- type = SearchObjectByID(RemoveList, &ptr1, &ptr2, &ptr3, ptr->ID, ptr->Kind);
+ case PCB_UNDO_REMOVE:
+ type = pcb_search_obj_by_id(RemoveList, &ptr1, &ptr2, &ptr3, ptr->ID, ptr->Kind);
if (type != PCB_TYPE_NONE) {
- DestroyObject(RemoveList, type, ptr1, ptr2, ptr3);
+ pcb_destroy_object(RemoveList, type, ptr1, ptr2, ptr3);
}
break;
default:
@@ -246,13 +245,13 @@ static UndoListTypePtr GetUndoSlot(int CommandType, int ID, int Kind)
static void DrawRecoveredObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
if (Type & (PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_POLYGON | PCB_TYPE_ARC)) {
- LayerTypePtr layer;
+ pcb_layer_t *layer;
- layer = LAYER_PTR(GetLayerNumber(RemoveList, (LayerTypePtr) Ptr1));
- DrawObject(Type, (void *) layer, Ptr2);
+ layer = LAYER_PTR(pcb_layer_id(RemoveList, (pcb_layer_t *) Ptr1));
+ pcb_draw_obj(Type, (void *) layer, Ptr2);
}
else
- DrawObject(Type, Ptr1, Ptr2);
+ pcb_draw_obj(Type, Ptr1, Ptr2);
}
/* ---------------------------------------------------------------------------
@@ -265,9 +264,9 @@ static pcb_bool UndoRotate(UndoListTypePtr Entry)
int type;
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- RotateObject(type, ptr1, ptr2, ptr3,
+ pcb_obj_rotate90(type, ptr1, ptr2, ptr3,
Entry->Data.Rotate.CenterX, Entry->Data.Rotate.CenterY, (4 - Entry->Data.Rotate.Steps) & 0x03);
Entry->Data.Rotate.Steps = (4 - Entry->Data.Rotate.Steps) & 0x03;
return (pcb_true);
@@ -284,12 +283,12 @@ static pcb_bool UndoClearPoly(UndoListTypePtr Entry)
void *ptr1, *ptr2, *ptr3;
int type;
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
if (Entry->Data.ClearPoly.Clear)
- RestoreToPolygon(PCB->Data, type, Entry->Data.ClearPoly.Layer, ptr3);
+ pcb_poly_restore_to_poly(PCB->Data, type, Entry->Data.ClearPoly.Layer, ptr3);
else
- ClearFromPolygon(PCB->Data, type, Entry->Data.ClearPoly.Layer, ptr3);
+ pcb_poly_clear_from_poly(PCB->Data, type, Entry->Data.ClearPoly.Layer, ptr3);
Entry->Data.ClearPoly.Clear = !Entry->Data.ClearPoly.Clear;
return pcb_true;
}
@@ -306,9 +305,9 @@ static pcb_bool UndoChangeName(UndoListTypePtr Entry)
int type;
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- Entry->Data.ChangeName.Name = (char *) (ChangeObjectName(type, ptr1, ptr2, ptr3, Entry->Data.ChangeName.Name));
+ Entry->Data.ChangeName.Name = (char *) (pcb_chg_obj_name(type, ptr1, ptr2, ptr3, Entry->Data.ChangeName.Name));
return (pcb_true);
}
return (pcb_false);
@@ -324,9 +323,9 @@ static pcb_bool UndoChangePinnum(UndoListTypePtr Entry)
int type;
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- Entry->Data.ChangeName.Name = (char *) (ChangeObjectPinnum(type, ptr1, ptr2, ptr3, Entry->Data.ChangeName.Name));
+ Entry->Data.ChangeName.Name = (char *) (pcb_chg_obj_pinnum(type, ptr1, ptr2, ptr3, Entry->Data.ChangeName.Name));
return (pcb_true);
}
return (pcb_false);
@@ -339,17 +338,17 @@ static pcb_bool UndoChange2ndSize(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3;
int type;
- Coord swap;
+ pcb_coord_t swap;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- swap = ((PinTypePtr) ptr2)->DrillingHole;
+ swap = ((pcb_pin_t *) ptr2)->DrillingHole;
if (andDraw)
- EraseObject(type, ptr1, ptr2);
- ((PinTypePtr) ptr2)->DrillingHole = Entry->Data.Size;
+ pcb_erase_obj(type, ptr1, ptr2);
+ ((pcb_pin_t *) ptr2)->DrillingHole = Entry->Data.Size;
Entry->Data.Size = swap;
- DrawObject(type, ptr1, ptr2);
+ pcb_draw_obj(type, ptr1, ptr2);
return (pcb_true);
}
return (pcb_false);
@@ -365,22 +364,22 @@ static pcb_bool UndoChangeAngles(UndoListTypePtr Entry)
double old_sa, old_da;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type == PCB_TYPE_ARC) {
- LayerTypePtr Layer = (LayerTypePtr) ptr1;
- ArcTypePtr a = (ArcTypePtr) ptr2;
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) a);
+ pcb_layer_t *Layer = (pcb_layer_t *) ptr1;
+ pcb_arc_t *a = (pcb_arc_t *) ptr2;
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) a);
old_sa = a->StartAngle;
old_da = a->Delta;
if (andDraw)
- EraseObject(type, Layer, a);
+ pcb_erase_obj(type, Layer, a);
a->StartAngle = Entry->Data.AngleChange.angle[0];
a->Delta = Entry->Data.AngleChange.angle[1];
- SetArcBoundingBox(a);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) a, 0);
+ pcb_arc_bbox(a);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) a, 0);
Entry->Data.AngleChange.angle[0] = old_sa;
Entry->Data.AngleChange.angle[1] = old_da;
- DrawObject(type, ptr1, a);
+ pcb_draw_obj(type, ptr1, a);
return (pcb_true);
}
return (pcb_false);
@@ -393,25 +392,25 @@ static pcb_bool UndoChangeRadii(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3;
int type;
- Coord old_w, old_h;
+ pcb_coord_t old_w, old_h;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type == PCB_TYPE_ARC) {
- LayerTypePtr Layer = (LayerTypePtr) ptr1;
- ArcTypePtr a = (ArcTypePtr) ptr2;
- r_delete_entry(Layer->arc_tree, (BoxTypePtr) a);
+ pcb_layer_t *Layer = (pcb_layer_t *) ptr1;
+ pcb_arc_t *a = (pcb_arc_t *) ptr2;
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) a);
old_w = a->Width;
old_h = a->Height;
if (andDraw)
- EraseObject(type, Layer, a);
+ pcb_erase_obj(type, Layer, a);
a->Width = Entry->Data.Move.DX;
a->Height = Entry->Data.Move.DY;
- SetArcBoundingBox(a);
- r_insert_entry(Layer->arc_tree, (BoxTypePtr) a, 0);
+ pcb_arc_bbox(a);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) a, 0);
Entry->Data.Move.DX = old_w;
Entry->Data.Move.DY = old_h;
- DrawObject(type, ptr1, a);
+ pcb_draw_obj(type, ptr1, a);
return (pcb_true);
}
return (pcb_false);
@@ -424,20 +423,20 @@ static pcb_bool UndoChangeClearSize(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3;
int type;
- Coord swap;
+ pcb_coord_t swap;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- swap = ((PinTypePtr) ptr2)->Clearance;
- RestoreToPolygon(PCB->Data, type, ptr1, ptr2);
+ swap = ((pcb_pin_t *) ptr2)->Clearance;
+ pcb_poly_restore_to_poly(PCB->Data, type, ptr1, ptr2);
if (andDraw)
- EraseObject(type, ptr1, ptr2);
- ((PinTypePtr) ptr2)->Clearance = Entry->Data.Size;
- ClearFromPolygon(PCB->Data, type, ptr1, ptr2);
+ pcb_erase_obj(type, ptr1, ptr2);
+ ((pcb_pin_t *) ptr2)->Clearance = Entry->Data.Size;
+ pcb_poly_clear_from_poly(PCB->Data, type, ptr1, ptr2);
Entry->Data.Size = swap;
if (andDraw)
- DrawObject(type, ptr1, ptr2);
+ pcb_draw_obj(type, ptr1, ptr2);
return (pcb_true);
}
return (pcb_false);
@@ -450,21 +449,21 @@ static pcb_bool UndoChangeMaskSize(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3;
int type;
- Coord swap;
+ pcb_coord_t swap;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type & (PCB_TYPE_VIA | PCB_TYPE_PIN | PCB_TYPE_PAD)) {
- swap = (type == PCB_TYPE_PAD ? ((PadTypePtr) ptr2)->Mask : ((PinTypePtr) ptr2)->Mask);
+ swap = (type == PCB_TYPE_PAD ? ((pcb_pad_t *) ptr2)->Mask : ((pcb_pin_t *) ptr2)->Mask);
if (andDraw)
- EraseObject(type, ptr1, ptr2);
+ pcb_erase_obj(type, ptr1, ptr2);
if (type == PCB_TYPE_PAD)
- ((PadTypePtr) ptr2)->Mask = Entry->Data.Size;
+ ((pcb_pad_t *) ptr2)->Mask = Entry->Data.Size;
else
- ((PinTypePtr) ptr2)->Mask = Entry->Data.Size;
+ ((pcb_pin_t *) ptr2)->Mask = Entry->Data.Size;
Entry->Data.Size = swap;
if (andDraw)
- DrawObject(type, ptr1, ptr2);
+ pcb_draw_obj(type, ptr1, ptr2);
return (pcb_true);
}
return (pcb_false);
@@ -478,10 +477,10 @@ static pcb_bool UndoChangeSize(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3, *ptr1e;
int type;
- Coord swap;
+ pcb_coord_t swap;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type == PCB_TYPE_ELEMENT_NAME)
ptr1e = NULL;
else
@@ -490,15 +489,15 @@ static pcb_bool UndoChangeSize(UndoListTypePtr Entry)
if (type != PCB_TYPE_NONE) {
/* Wow! can any object be treated as a pin type for size change?? */
/* pins, vias, lines, and arcs can. Text can't but it has it's own mechanism */
- swap = ((PinTypePtr) ptr2)->Thickness;
- RestoreToPolygon(PCB->Data, type, ptr1, ptr2);
+ swap = ((pcb_pin_t *) ptr2)->Thickness;
+ pcb_poly_restore_to_poly(PCB->Data, type, ptr1, ptr2);
if ((andDraw) && (ptr1e != NULL))
- EraseObject(type, ptr1e, ptr2);
- ((PinTypePtr) ptr2)->Thickness = Entry->Data.Size;
+ pcb_erase_obj(type, ptr1e, ptr2);
+ ((pcb_pin_t *) ptr2)->Thickness = Entry->Data.Size;
Entry->Data.Size = swap;
- ClearFromPolygon(PCB->Data, type, ptr1, ptr2);
+ pcb_poly_clear_from_poly(PCB->Data, type, ptr1, ptr2);
if (andDraw)
- DrawObject(type, ptr1, ptr2);
+ pcb_draw_obj(type, ptr1, ptr2);
return (pcb_true);
}
return (pcb_false);
@@ -511,14 +510,14 @@ static pcb_bool UndoFlag(UndoListTypePtr Entry)
{
void *ptr1, *ptr1e, *ptr2, *ptr3;
int type;
- FlagType swap;
+ pcb_flag_t swap;
int must_redraw;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- FlagType f1, f2;
- PinTypePtr pin = (PinTypePtr) ptr2;
+ pcb_flag_t f1, f2;
+ pcb_pin_t *pin = (pcb_pin_t *) ptr2;
if ((type == PCB_TYPE_ELEMENT) || (type == PCB_TYPE_ELEMENT_NAME))
ptr1e = NULL;
@@ -528,25 +527,25 @@ static pcb_bool UndoFlag(UndoListTypePtr Entry)
swap = pin->Flags;
must_redraw = 0;
- f1 = MaskFlags(pin->Flags, ~DRAW_FLAGS);
- f2 = MaskFlags(Entry->Data.Flags, ~DRAW_FLAGS);
+ f1 = pcb_flag_mask(pin->Flags, ~DRAW_FLAGS);
+ f2 = pcb_flag_mask(Entry->Data.Flags, ~DRAW_FLAGS);
- if (!FLAGS_EQUAL(f1, f2))
+ if (!PCB_FLAG_EQ(f1, f2))
must_redraw = 1;
if (andDraw && must_redraw && (ptr1e != NULL))
- EraseObject(type, ptr1e, ptr2);
+ pcb_erase_obj(type, ptr1e, ptr2);
pin->Flags = Entry->Data.Flags;
Entry->Data.Flags = swap;
if (andDraw && must_redraw)
- DrawObject(type, ptr1, ptr2);
+ pcb_draw_obj(type, ptr1, ptr2);
return (pcb_true);
}
- Message(PCB_MSG_DEFAULT, "hace Internal error: Can't find ID %d type %08x\n", Entry->ID, Entry->Kind);
- Message(PCB_MSG_DEFAULT, "for UndoFlag Operation. Previous flags: %s\n", flags_to_string(Entry->Data.Flags, 0));
+ pcb_message(PCB_MSG_ERROR, "hace Internal error: Can't find ID %d type %08x\n", Entry->ID, Entry->Kind);
+ pcb_message(PCB_MSG_ERROR, "for UndoFlag Operation. Previous flags: %s\n", pcb_strflg_f2s(Entry->Data.Flags, 0));
return (pcb_false);
}
@@ -560,17 +559,17 @@ static pcb_bool UndoMirror(UndoListTypePtr Entry)
int type;
/* lookup entry by ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type == PCB_TYPE_ELEMENT) {
- ElementTypePtr element = (ElementTypePtr) ptr3;
+ pcb_element_t *element = (pcb_element_t *) ptr3;
if (andDraw)
EraseElement(element);
- MirrorElementCoordinates(PCB->Data, element, Entry->Data.Move.DY);
+ pcb_element_mirror(PCB->Data, element, Entry->Data.Move.DY);
if (andDraw)
DrawElement(element);
return (pcb_true);
}
- Message(PCB_MSG_DEFAULT, "hace Internal error: UndoMirror on object type %d\n", type);
+ pcb_message(PCB_MSG_ERROR, "hace Internal error: UndoMirror on object type %d\n", type);
return (pcb_false);
}
@@ -584,15 +583,15 @@ static pcb_bool UndoCopyOrCreate(UndoListTypePtr Entry)
int type;
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
if (!RemoveList)
- RemoveList = CreateNewBuffer();
+ RemoveList = pcb_buffer_new();
if (andDraw)
- EraseObject(type, ptr1, ptr2);
+ pcb_erase_obj(type, ptr1, ptr2);
/* in order to make this re-doable we move it to the RemoveList */
- MoveObjectToBuffer(RemoveList, PCB->Data, type, ptr1, ptr2, ptr3);
- Entry->Type = UNDO_REMOVE;
+ pcb_move_obj_to_buffer(RemoveList, PCB->Data, type, ptr1, ptr2, ptr3);
+ Entry->Type = PCB_UNDO_REMOVE;
return (pcb_true);
}
return (pcb_false);
@@ -608,9 +607,9 @@ static pcb_bool UndoMove(UndoListTypePtr Entry)
int type;
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- MoveObject(type, ptr1, ptr2, ptr3, -Entry->Data.Move.DX, -Entry->Data.Move.DY);
+ pcb_move_obj(type, ptr1, ptr2, ptr3, -Entry->Data.Move.DX, -Entry->Data.Move.DY);
Entry->Data.Move.DX *= -1;
Entry->Data.Move.DY *= -1;
return (pcb_true);
@@ -628,12 +627,12 @@ static pcb_bool UndoRemove(UndoListTypePtr Entry)
int type;
/* lookup entry by it's ID */
- type = SearchObjectByID(RemoveList, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(RemoveList, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
if (andDraw)
DrawRecoveredObject(type, ptr1, ptr2, ptr3);
- MoveObjectToBuffer(PCB->Data, RemoveList, type, ptr1, ptr2, ptr3);
- Entry->Type = UNDO_CREATE;
+ pcb_move_obj_to_buffer(PCB->Data, RemoveList, type, ptr1, ptr2, ptr3);
+ Entry->Type = PCB_UNDO_CREATE;
return (pcb_true);
}
return (pcb_false);
@@ -646,13 +645,14 @@ static pcb_bool UndoRemove(UndoListTypePtr Entry)
static pcb_bool UndoMoveToLayer(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3;
- int type, swap;
+ int type;
+ pcb_layer_id_t swap;
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind);
if (type != PCB_TYPE_NONE) {
- swap = GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1);
- MoveObjectToLayer(type, ptr1, ptr2, ptr3, LAYER_PTR(Entry->Data.MoveToLayer.OriginalLayer), pcb_true);
+ swap = pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1);
+ pcb_move_obj_to_layer(type, ptr1, ptr2, ptr3, LAYER_PTR(Entry->Data.MoveToLayer.OriginalLayer), pcb_true);
Entry->Data.MoveToLayer.OriginalLayer = swap;
return (pcb_true);
}
@@ -665,21 +665,21 @@ static pcb_bool UndoMoveToLayer(UndoListTypePtr Entry)
*/
static pcb_bool UndoRemovePoint(UndoListTypePtr Entry)
{
- LayerTypePtr layer;
- PolygonTypePtr polygon;
+ pcb_layer_t *layer;
+ pcb_polygon_t *polygon;
void *ptr3;
int type;
/* lookup entry (polygon not point was saved) by it's ID */
assert(Entry->Kind == PCB_TYPE_POLYGON);
- type = SearchObjectByID(PCB->Data, (void **) &layer, (void **) &polygon, &ptr3, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, (void **) &layer, (void **) &polygon, &ptr3, Entry->ID, Entry->Kind);
switch (type) {
case PCB_TYPE_POLYGON: /* restore the removed point */
{
/* recover the point */
if (andDraw && layer->On)
ErasePolygon(polygon);
- InsertPointIntoObject(PCB_TYPE_POLYGON, layer, polygon,
+ pcb_insert_point_in_object(PCB_TYPE_POLYGON, layer, polygon,
&Entry->Data.RemovedPoint.Index,
Entry->Data.RemovedPoint.X,
Entry->Data.RemovedPoint.Y, pcb_true, Entry->Data.RemovedPoint.last_in_contour);
@@ -687,7 +687,7 @@ static pcb_bool UndoRemovePoint(UndoListTypePtr Entry)
polygon->Points[Entry->Data.RemovedPoint.Index].ID = Entry->Data.RemovedPoint.ID;
if (andDraw && layer->On)
DrawPolygon(layer, polygon);
- Entry->Type = UNDO_INSERT_POINT;
+ Entry->Type = PCB_UNDO_INSERT_POINT;
Entry->ID = Entry->Data.RemovedPoint.ID;
Entry->Kind = PCB_TYPE_POLYGON_POINT;
return (pcb_true);
@@ -704,9 +704,9 @@ static pcb_bool UndoRemovePoint(UndoListTypePtr Entry)
*/
static pcb_bool UndoInsertPoint(UndoListTypePtr Entry)
{
- LayerTypePtr layer;
- PolygonTypePtr polygon;
- PointTypePtr pnt;
+ pcb_layer_t *layer;
+ pcb_polygon_t *polygon;
+ pcb_point_t *pnt;
int type;
pcb_cardinal_t point_idx;
pcb_cardinal_t hole;
@@ -714,7 +714,7 @@ static pcb_bool UndoInsertPoint(UndoListTypePtr Entry)
assert(Entry->Kind == PCB_TYPE_POLYGON_POINT);
/* lookup entry by it's ID */
- type = SearchObjectByID(PCB->Data, (void **) &layer, (void **) &polygon, (void **) &pnt, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, (void **) &layer, (void **) &polygon, (void **) &pnt, Entry->ID, Entry->Kind);
switch (type) {
case PCB_TYPE_POLYGON_POINT: /* removes an inserted polygon point */
{
@@ -725,7 +725,7 @@ static pcb_bool UndoInsertPoint(UndoListTypePtr Entry)
* If so, we need to flag as such when re-adding the point
* so it goes back in the correct place
*/
- point_idx = polygon_point_idx(polygon, pnt);
+ point_idx = pcb_poly_point_idx(polygon, pnt);
for (hole = 0; hole < polygon->HoleIndexN; hole++)
if (point_idx == polygon->HoleIndex[hole] - 1)
last_in_contour = pcb_true;
@@ -738,9 +738,9 @@ static pcb_bool UndoInsertPoint(UndoListTypePtr Entry)
Entry->Data.RemovedPoint.ID = pnt->ID;
Entry->ID = polygon->ID;
Entry->Kind = PCB_TYPE_POLYGON;
- Entry->Type = UNDO_REMOVE_POINT;
+ Entry->Type = PCB_UNDO_REMOVE_POINT;
Entry->Data.RemovedPoint.Index = point_idx;
- DestroyObject(PCB->Data, PCB_TYPE_POLYGON_POINT, layer, polygon, pnt);
+ pcb_destroy_object(PCB->Data, PCB_TYPE_POLYGON_POINT, layer, polygon, pnt);
if (andDraw && layer->On)
DrawPolygon(layer, polygon);
return (pcb_true);
@@ -755,34 +755,34 @@ static pcb_bool UndoSwapCopiedObject(UndoListTypePtr Entry)
{
void *ptr1, *ptr2, *ptr3;
void *ptr1b, *ptr2b, *ptr3b;
- AnyObjectType *obj, *obj2;
+ pcb_any_obj_t *obj, *obj2;
int type;
long int swap_id;
/* lookup entry by it's ID */
- type = SearchObjectByID(RemoveList, &ptr1, &ptr2, &ptr3, Entry->Data.CopyID, Entry->Kind);
+ type = pcb_search_obj_by_id(RemoveList, &ptr1, &ptr2, &ptr3, Entry->Data.CopyID, Entry->Kind);
if (type == PCB_TYPE_NONE)
return pcb_false;
- type = SearchObjectByID(PCB->Data, &ptr1b, &ptr2b, &ptr3b, Entry->ID, Entry->Kind);
+ type = pcb_search_obj_by_id(PCB->Data, &ptr1b, &ptr2b, &ptr3b, Entry->ID, Entry->Kind);
if (type == PCB_TYPE_NONE)
- return FALSE;
+ return pcb_false;
- obj = (AnyObjectType *) ptr2;
- obj2 = (AnyObjectType *) ptr2b;
+ obj = (pcb_any_obj_t *) ptr2;
+ obj2 = (pcb_any_obj_t *) ptr2b;
swap_id = obj->ID;
obj->ID = obj2->ID;
obj2->ID = swap_id;
- MoveObjectToBuffer(RemoveList, PCB->Data, type, ptr1b, ptr2b, ptr3b);
+ pcb_move_obj_to_buffer(RemoveList, PCB->Data, type, ptr1b, ptr2b, ptr3b);
if (andDraw)
DrawRecoveredObject(Entry->Kind, ptr1, ptr2, ptr3);
- obj = (AnyObjectType *) MoveObjectToBuffer(PCB->Data, RemoveList, type, ptr1, ptr2, ptr3);
+ obj = (pcb_any_obj_t *) pcb_move_obj_to_buffer(PCB->Data, RemoveList, type, ptr1, ptr2, ptr3);
if (Entry->Kind == PCB_TYPE_POLYGON)
- InitClip(PCB->Data, (LayerTypePtr) ptr1b, (PolygonType *) obj);
+ pcb_poly_init_clip(PCB->Data, (pcb_layer_t *) ptr1b, (pcb_polygon_t *) obj);
return (pcb_true);
}
@@ -810,7 +810,7 @@ static pcb_bool UndoInsertContour(UndoListTypePtr Entry)
* undo a layer change
* returns pcb_true on success
*/
-static pcb_bool UndoLayerChange(UndoListTypePtr Entry)
+static pcb_bool UndoLayerMove(UndoListTypePtr Entry)
{
LayerChangeTypePtr l = &Entry->Data.LayerChange;
int tmp;
@@ -819,7 +819,7 @@ static pcb_bool UndoLayerChange(UndoListTypePtr Entry)
l->new_index = l->old_index;
l->old_index = tmp;
- if (MoveLayer(l->old_index, l->new_index))
+ if (pcb_layer_move(l->old_index, l->new_index))
return pcb_false;
else
return pcb_true;
@@ -833,7 +833,7 @@ static pcb_bool UndoNetlistChange(UndoListTypePtr Entry)
{
NetlistChangeTypePtr l = &Entry->Data.NetlistChange;
unsigned int i, j;
- LibraryTypePtr lib, saved;
+ pcb_lib_t *lib, *saved;
lib = l->lib;
saved = l->old;
@@ -868,7 +868,7 @@ static pcb_bool UndoNetlistChange(UndoListTypePtr Entry)
*
* returns the bitfield for the types of operations that were undone
*/
-int Undo(pcb_bool draw)
+int pcb_undo(pcb_bool draw)
{
UndoListTypePtr ptr;
int Types = 0;
@@ -881,12 +881,12 @@ int Undo(pcb_bool draw)
andDraw = draw;
if (Serial == 0) {
- Message(PCB_MSG_DEFAULT, _("ERROR: Attempt to Undo() with Serial == 0\n" " Please save your work and report this bug.\n"));
+ pcb_message(PCB_MSG_ERROR, _("ERROR: Attempt to pcb_undo() with Serial == 0\n" " Please save your work and report this bug.\n"));
return 0;
}
if (UndoN == 0) {
- Message(PCB_MSG_DEFAULT, _("Nothing to undo - buffer is empty\n"));
+ pcb_message(PCB_MSG_INFO, _("Nothing to undo - buffer is empty\n"));
return 0;
}
@@ -895,11 +895,11 @@ int Undo(pcb_bool draw)
ptr = &UndoList[UndoN - 1];
if (ptr->Serial > Serial) {
- Message(PCB_MSG_DEFAULT, _("ERROR: Bad undo serial number %d in undo stack - expecting %d or lower\n"
+ pcb_message(PCB_MSG_ERROR, _("ERROR: Bad undo serial number %d in undo stack - expecting %d or lower\n"
" Please save your work and report this bug.\n"), ptr->Serial, Serial);
/* It is likely that the serial number got corrupted through some bad
- * use of the SaveUndoSerialNumber() / RestoreUndoSerialNumber() APIs.
+ * use of the pcb_undo_save_serial() / pcb_undo_restore_serial() APIs.
*
* Reset the serial number to be consistent with that of the last
* operation on the undo stack in the hope that this might clear
@@ -909,7 +909,7 @@ int Undo(pcb_bool draw)
return 0;
}
- LockUndo(); /* lock undo module to prevent from loops */
+ pcb_undo_lock(); /* lock undo module to prevent from loops */
/* Loop over all entries with the correct serial number */
for (; UndoN && ptr->Serial == Serial; ptr--, UndoN--, RedoN++) {
@@ -919,13 +919,13 @@ int Undo(pcb_bool draw)
Types |= undid;
}
- UnlockUndo();
+ pcb_undo_unlock();
if (error_undoing)
- Message(PCB_MSG_DEFAULT, _("ERROR: Failed to undo some operations\n"));
+ pcb_message(PCB_MSG_ERROR, _("ERROR: Failed to undo some operations\n"));
if (Types && andDraw)
- Draw();
+ pcb_draw();
/* restore the unique flag setting */
conf_force_set_bool(conf_core.editor.unique_names, unique);
@@ -936,114 +936,114 @@ int Undo(pcb_bool draw)
static int PerformUndo(UndoListTypePtr ptr)
{
switch (ptr->Type) {
- case UNDO_CHANGENAME:
+ case PCB_UNDO_CHANGENAME:
if (UndoChangeName(ptr))
- return (UNDO_CHANGENAME);
+ return (PCB_UNDO_CHANGENAME);
break;
- case UNDO_CHANGEPINNUM:
+ case PCB_UNDO_CHANGEPINNUM:
if (UndoChangePinnum(ptr))
- return (UNDO_CHANGEPINNUM);
+ return (PCB_UNDO_CHANGEPINNUM);
break;
- case UNDO_CREATE:
+ case PCB_UNDO_CREATE:
if (UndoCopyOrCreate(ptr))
- return (UNDO_CREATE);
+ return (PCB_UNDO_CREATE);
break;
- case UNDO_MOVE:
+ case PCB_UNDO_MOVE:
if (UndoMove(ptr))
- return (UNDO_MOVE);
+ return (PCB_UNDO_MOVE);
break;
- case UNDO_REMOVE:
+ case PCB_UNDO_REMOVE:
if (UndoRemove(ptr))
- return (UNDO_REMOVE);
+ return (PCB_UNDO_REMOVE);
break;
- case UNDO_REMOVE_POINT:
+ case PCB_UNDO_REMOVE_POINT:
if (UndoRemovePoint(ptr))
- return (UNDO_REMOVE_POINT);
+ return (PCB_UNDO_REMOVE_POINT);
break;
- case UNDO_INSERT_POINT:
+ case PCB_UNDO_INSERT_POINT:
if (UndoInsertPoint(ptr))
- return (UNDO_INSERT_POINT);
+ return (PCB_UNDO_INSERT_POINT);
break;
- case UNDO_REMOVE_CONTOUR:
+ case PCB_UNDO_REMOVE_CONTOUR:
if (UndoRemoveContour(ptr))
- return (UNDO_REMOVE_CONTOUR);
+ return (PCB_UNDO_REMOVE_CONTOUR);
break;
- case UNDO_INSERT_CONTOUR:
+ case PCB_UNDO_INSERT_CONTOUR:
if (UndoInsertContour(ptr))
- return (UNDO_INSERT_CONTOUR);
+ return (PCB_UNDO_INSERT_CONTOUR);
break;
- case UNDO_ROTATE:
+ case PCB_UNDO_ROTATE:
if (UndoRotate(ptr))
- return (UNDO_ROTATE);
+ return (PCB_UNDO_ROTATE);
break;
- case UNDO_CLEAR:
+ case PCB_UNDO_CLEAR:
if (UndoClearPoly(ptr))
- return (UNDO_CLEAR);
+ return (PCB_UNDO_CLEAR);
break;
- case UNDO_MOVETOLAYER:
+ case PCB_UNDO_MOVETOLAYER:
if (UndoMoveToLayer(ptr))
- return (UNDO_MOVETOLAYER);
+ return (PCB_UNDO_MOVETOLAYER);
break;
- case UNDO_FLAG:
+ case PCB_UNDO_FLAG:
if (UndoFlag(ptr))
- return (UNDO_FLAG);
+ return (PCB_UNDO_FLAG);
break;
- case UNDO_CHANGESIZE:
+ case PCB_UNDO_CHANGESIZE:
if (UndoChangeSize(ptr))
- return (UNDO_CHANGESIZE);
+ return (PCB_UNDO_CHANGESIZE);
break;
- case UNDO_CHANGECLEARSIZE:
+ case PCB_UNDO_CHANGECLEARSIZE:
if (UndoChangeClearSize(ptr))
- return (UNDO_CHANGECLEARSIZE);
+ return (PCB_UNDO_CHANGECLEARSIZE);
break;
- case UNDO_CHANGEMASKSIZE:
+ case PCB_UNDO_CHANGEMASKSIZE:
if (UndoChangeMaskSize(ptr))
- return (UNDO_CHANGEMASKSIZE);
+ return (PCB_UNDO_CHANGEMASKSIZE);
break;
- case UNDO_CHANGE2NDSIZE:
+ case PCB_UNDO_CHANGE2NDSIZE:
if (UndoChange2ndSize(ptr))
- return (UNDO_CHANGE2NDSIZE);
+ return (PCB_UNDO_CHANGE2NDSIZE);
break;
- case UNDO_CHANGEANGLES:
+ case PCB_UNDO_CHANGEANGLES:
if (UndoChangeAngles(ptr))
- return (UNDO_CHANGEANGLES);
+ return (PCB_UNDO_CHANGEANGLES);
break;
- case UNDO_CHANGERADII:
+ case PCB_UNDO_CHANGERADII:
if (UndoChangeRadii(ptr))
- return (UNDO_CHANGERADII);
+ return (PCB_UNDO_CHANGERADII);
break;
- case UNDO_LAYERCHANGE:
- if (UndoLayerChange(ptr))
- return (UNDO_LAYERCHANGE);
+ case PCB_UNDO_LAYERMOVE:
+ if (UndoLayerMove(ptr))
+ return (PCB_UNDO_LAYERMOVE);
break;
- case UNDO_NETLISTCHANGE:
+ case PCB_UNDO_NETLISTCHANGE:
if (UndoNetlistChange(ptr))
- return (UNDO_NETLISTCHANGE);
+ return (PCB_UNDO_NETLISTCHANGE);
break;
- case UNDO_MIRROR:
+ case PCB_UNDO_MIRROR:
if (UndoMirror(ptr))
- return (UNDO_MIRROR);
+ return (PCB_UNDO_MIRROR);
break;
}
return 0;
@@ -1054,7 +1054,7 @@ static int PerformUndo(UndoListTypePtr ptr)
*
* returns the number of operations redone
*/
-int Redo(pcb_bool draw)
+int pcb_redo(pcb_bool draw)
{
UndoListTypePtr ptr;
int Types = 0;
@@ -1063,18 +1063,18 @@ int Redo(pcb_bool draw)
andDraw = draw;
if (RedoN == 0) {
- Message(PCB_MSG_DEFAULT, _("Nothing to redo. Perhaps changes have been made since last undo\n"));
+ pcb_message(PCB_MSG_INFO, _("Nothing to redo. Perhaps changes have been made since last undo\n"));
return 0;
}
ptr = &UndoList[UndoN];
if (ptr->Serial < Serial) {
- Message(PCB_MSG_DEFAULT, _("ERROR: Bad undo serial number %d in redo stack - expecting %d or higher\n"
+ pcb_message(PCB_MSG_ERROR, _("ERROR: Bad undo serial number %d in redo stack - expecting %d or higher\n"
" Please save your work and report this bug.\n"), ptr->Serial, Serial);
/* It is likely that the serial number got corrupted through some bad
- * use of the SaveUndoSerialNumber() / RestoreUndoSerialNumber() APIs.
+ * use of the pcb_undo_save_serial() / pcb_undo_restore_serial() APIs.
*
* Reset the serial number to be consistent with that of the first
* operation on the redo stack in the hope that this might clear
@@ -1084,7 +1084,7 @@ int Redo(pcb_bool draw)
return 0;
}
- LockUndo(); /* lock undo module to prevent from loops */
+ pcb_undo_lock(); /* lock undo module to prevent from loops */
/* and loop over all entries with the correct serial number */
for (; RedoN && ptr->Serial == Serial; ptr++, UndoN++, RedoN--) {
@@ -1097,13 +1097,13 @@ int Redo(pcb_bool draw)
/* Make next serial number current */
Serial++;
- UnlockUndo();
+ pcb_undo_unlock();
if (error_undoing)
- Message(PCB_MSG_DEFAULT, _("ERROR: Failed to redo some operations\n"));
+ pcb_message(PCB_MSG_ERROR, _("ERROR: Failed to redo some operations\n"));
if (Types && andDraw)
- Draw();
+ pcb_draw();
return Types;
}
@@ -1111,10 +1111,10 @@ int Redo(pcb_bool draw)
/* ---------------------------------------------------------------------------
* restores the serial number of the undo list
*/
-void RestoreUndoSerialNumber(void)
+void pcb_undo_restore_serial(void)
{
if (added_undo_between_increment_and_restore)
- Message(PCB_MSG_DEFAULT, _("ERROR: Operations were added to the Undo stack with an incorrect serial number\n"));
+ pcb_message(PCB_MSG_ERROR, _("ERROR: Operations were added to the Undo stack with an incorrect serial number\n"));
between_increment_and_restore = pcb_false;
added_undo_between_increment_and_restore = pcb_false;
Serial = SavedSerial;
@@ -1123,9 +1123,9 @@ void RestoreUndoSerialNumber(void)
/* ---------------------------------------------------------------------------
* saves the serial number of the undo list
*/
-void SaveUndoSerialNumber(void)
+void pcb_undo_save_serial(void)
{
- Bumped = pcb_false;
+ pcb_bumped = pcb_false;
between_increment_and_restore = pcb_false;
added_undo_between_increment_and_restore = pcb_false;
SavedSerial = Serial;
@@ -1136,14 +1136,14 @@ void SaveUndoSerialNumber(void)
* it's not done automatically because some operations perform more
* than one request with the same serial #
*/
-void IncrementUndoSerialNumber(void)
+void pcb_undo_inc_serial(void)
{
if (!Locked) {
/* Set the changed flag if anything was added prior to this bump */
if (UndoN > 0 && UndoList[UndoN - 1].Serial == Serial)
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
Serial++;
- Bumped = pcb_true;
+ pcb_bumped = pcb_true;
between_increment_and_restore = pcb_true;
}
}
@@ -1151,20 +1151,20 @@ void IncrementUndoSerialNumber(void)
/* ---------------------------------------------------------------------------
* releases memory of the undo- and remove list
*/
-void ClearUndoList(pcb_bool Force)
+void pcb_undo_clear_list(pcb_bool Force)
{
UndoListTypePtr undo;
- if (UndoN && (Force || gui->confirm_dialog("OK to clear 'undo' buffer?", 0))) {
+ if (UndoN && (Force || pcb_gui->confirm_dialog("OK to clear 'undo' buffer?", 0))) {
/* release memory allocated by objects in undo list */
for (undo = UndoList; UndoN; undo++, UndoN--) {
- if ((undo->Type == UNDO_CHANGENAME) || (undo->Type == UNDO_CHANGEPINNUM))
+ if ((undo->Type == PCB_UNDO_CHANGENAME) || (undo->Type == PCB_UNDO_CHANGEPINNUM))
free(undo->Data.ChangeName.Name);
}
free(UndoList);
UndoList = NULL;
if (RemoveList) {
- FreeDataMemory(RemoveList);
+ pcb_data_free(RemoveList);
free(RemoveList);
RemoveList = NULL;
}
@@ -1180,26 +1180,26 @@ void ClearUndoList(pcb_bool Force)
/* ---------------------------------------------------------------------------
* adds an object to the list of clearpoly objects
*/
-void AddObjectToClearPolyUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_bool clear)
+void pcb_undo_add_obj_to_clear_poly(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_bool clear)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CLEAR, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_CLEAR, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.ClearPoly.Clear = clear;
- undo->Data.ClearPoly.Layer = (LayerTypePtr) Ptr1;
+ undo->Data.ClearPoly.Layer = (pcb_layer_t *) Ptr1;
}
}
/* ---------------------------------------------------------------------------
* adds an object to the list of mirrored objects
*/
-void AddObjectToMirrorUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord yoff)
+void pcb_undo_add_obj_to_mirror(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t yoff)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_MIRROR, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_MIRROR, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.Move.DY = yoff;
}
}
@@ -1207,12 +1207,12 @@ void AddObjectToMirrorUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coo
/* ---------------------------------------------------------------------------
* adds an object to the list of rotated objects
*/
-void AddObjectToRotateUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord CenterX, Coord CenterY, pcb_uint8_t Steps)
+void pcb_undo_add_obj_to_rotate(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t CenterX, pcb_coord_t CenterY, pcb_uint8_t Steps)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_ROTATE, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_ROTATE, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.Rotate.CenterX = CenterX;
undo->Data.Rotate.CenterY = CenterY;
undo->Data.Rotate.Steps = Steps;
@@ -1223,25 +1223,25 @@ void AddObjectToRotateUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coo
* adds an object to the list of removed objects and removes it from
* the current PCB
*/
-void MoveObjectToRemoveUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_move_obj_to_remove(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
if (Locked)
return;
if (!RemoveList)
- RemoveList = CreateNewBuffer();
+ RemoveList = pcb_buffer_new();
- GetUndoSlot(UNDO_REMOVE, OBJECT_ID(Ptr3), Type);
- MoveObjectToBuffer(RemoveList, PCB->Data, Type, Ptr1, Ptr2, Ptr3);
+ GetUndoSlot(PCB_UNDO_REMOVE, PCB_OBJECT_ID(Ptr3), Type);
+ pcb_move_obj_to_buffer(RemoveList, PCB->Data, Type, Ptr1, Ptr2, Ptr3);
}
/* ---------------------------------------------------------------------------
* adds an object to the list of removed polygon/... points
*/
-void AddObjectToRemovePointUndoList(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t index)
+void pcb_undo_add_obj_to_remove_point(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t index)
{
UndoListTypePtr undo;
- PolygonTypePtr polygon = (PolygonTypePtr) Ptr2;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) Ptr2;
pcb_cardinal_t hole;
pcb_bool last_in_contour = pcb_false;
@@ -1252,7 +1252,7 @@ void AddObjectToRemovePointUndoList(int Type, void *Ptr1, void *Ptr2, pcb_cardin
/* save the ID of the parent object; else it will be
* impossible to recover the point
*/
- undo = GetUndoSlot(UNDO_REMOVE_POINT, OBJECT_ID(polygon), PCB_TYPE_POLYGON);
+ undo = GetUndoSlot(PCB_UNDO_REMOVE_POINT, PCB_OBJECT_ID(polygon), PCB_TYPE_POLYGON);
undo->Data.RemovedPoint.X = polygon->Points[index].X;
undo->Data.RemovedPoint.Y = polygon->Points[index].Y;
undo->Data.RemovedPoint.ID = polygon->Points[index].ID;
@@ -1277,25 +1277,25 @@ void AddObjectToRemovePointUndoList(int Type, void *Ptr1, void *Ptr2, pcb_cardin
/* ---------------------------------------------------------------------------
* adds an object to the list of inserted polygon/... points
*/
-void AddObjectToInsertPointUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_add_obj_to_insert_point(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
if (!Locked)
- GetUndoSlot(UNDO_INSERT_POINT, OBJECT_ID(Ptr3), Type);
+ GetUndoSlot(PCB_UNDO_INSERT_POINT, PCB_OBJECT_ID(Ptr3), Type);
}
static void CopyObjectToUndoList(int undo_type, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
UndoListTypePtr undo;
- AnyObjectType *copy;
+ pcb_any_obj_t *copy;
if (Locked)
return;
if (!RemoveList)
- RemoveList = CreateNewBuffer();
+ RemoveList = pcb_buffer_new();
- undo = GetUndoSlot(undo_type, OBJECT_ID(Ptr2), Type);
- copy = (AnyObjectType *) CopyObjectToBuffer(RemoveList, PCB->Data, Type, Ptr1, Ptr2, Ptr3);
+ undo = GetUndoSlot(undo_type, PCB_OBJECT_ID(Ptr2), Type);
+ copy = (pcb_any_obj_t *) pcb_copy_obj_to_buffer(RemoveList, PCB->Data, Type, Ptr1, Ptr2, Ptr3);
undo->Data.CopyID = copy->ID;
}
@@ -1303,29 +1303,29 @@ static void CopyObjectToUndoList(int undo_type, int Type, void *Ptr1, void *Ptr2
* adds an object to the list of removed contours
* (Actually just takes a copy of the whole polygon to restore)
*/
-void AddObjectToRemoveContourUndoList(int Type, LayerType * Layer, PolygonType * Polygon)
+void pcb_undo_add_obj_to_remove_contour(int Type, pcb_layer_t * Layer, pcb_polygon_t * Polygon)
{
- CopyObjectToUndoList(UNDO_REMOVE_CONTOUR, Type, Layer, Polygon, NULL);
+ CopyObjectToUndoList(PCB_UNDO_REMOVE_CONTOUR, Type, Layer, Polygon, NULL);
}
/* ---------------------------------------------------------------------------
* adds an object to the list of insert contours
* (Actually just takes a copy of the whole polygon to restore)
*/
-void AddObjectToInsertContourUndoList(int Type, LayerType * Layer, PolygonType * Polygon)
+void pcb_undo_add_obj_to_insert_contour(int Type, pcb_layer_t * Layer, pcb_polygon_t * Polygon)
{
- CopyObjectToUndoList(UNDO_INSERT_CONTOUR, Type, Layer, Polygon, NULL);
+ CopyObjectToUndoList(PCB_UNDO_INSERT_CONTOUR, Type, Layer, Polygon, NULL);
}
/* ---------------------------------------------------------------------------
* adds an object to the list of moved objects
*/
-void AddObjectToMoveUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
+void pcb_undo_add_obj_to_move(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_MOVE, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_MOVE, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.Move.DX = DX;
undo->Data.Move.DY = DY;
}
@@ -1334,12 +1334,12 @@ void AddObjectToMoveUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with changed names
*/
-void AddObjectToChangeNameUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *OldName)
+void pcb_undo_add_obj_to_change_name(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *OldName)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGENAME, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGENAME, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.ChangeName.Name = OldName;
}
}
@@ -1347,12 +1347,12 @@ void AddObjectToChangeNameUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3,
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with changed pinnums
*/
-void AddObjectToChangePinnumUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *OldName)
+void pcb_undo_add_obj_to_change_pinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *OldName)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGEPINNUM, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGEPINNUM, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.ChangeName.Name = OldName;
}
}
@@ -1360,67 +1360,67 @@ void AddObjectToChangePinnumUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr
/* ---------------------------------------------------------------------------
* adds an object to the list of objects moved to another layer
*/
-void AddObjectToMoveToLayerUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_add_obj_to_move_to_layer(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_MOVETOLAYER, OBJECT_ID(Ptr3), Type);
- undo->Data.MoveToLayer.OriginalLayer = GetLayerNumber(PCB->Data, (LayerTypePtr) Ptr1);
+ undo = GetUndoSlot(PCB_UNDO_MOVETOLAYER, PCB_OBJECT_ID(Ptr3), Type);
+ undo->Data.MoveToLayer.OriginalLayer = pcb_layer_id(PCB->Data, (pcb_layer_t *) Ptr1);
}
}
/* ---------------------------------------------------------------------------
* adds an object to the list of created objects
*/
-void AddObjectToCreateUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_add_obj_to_create(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
if (!Locked)
- GetUndoSlot(UNDO_CREATE, OBJECT_ID(Ptr3), Type);
- ClearFromPolygon(PCB->Data, Type, Ptr1, Ptr2);
+ GetUndoSlot(PCB_UNDO_CREATE, PCB_OBJECT_ID(Ptr3), Type);
+ pcb_poly_clear_from_poly(PCB->Data, Type, Ptr1, Ptr2);
}
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with flags changed
*/
-void AddObjectToFlagUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_add_obj_to_flag(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_FLAG, OBJECT_ID(Ptr2), Type);
- undo->Data.Flags = ((PinTypePtr) Ptr2)->Flags;
+ undo = GetUndoSlot(PCB_UNDO_FLAG, PCB_OBJECT_ID(Ptr2), Type);
+ undo->Data.Flags = ((pcb_pin_t *) Ptr2)->Flags;
}
}
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with Size changes
*/
-void AddObjectToSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
+void pcb_undo_add_obj_to_size(int Type, void *ptr1, void *ptr2, void *ptr3)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGESIZE, OBJECT_ID(ptr2), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGESIZE, PCB_OBJECT_ID(ptr2), Type);
switch (Type) {
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
- undo->Data.Size = ((PinTypePtr) ptr2)->Thickness;
+ undo->Data.Size = ((pcb_pin_t *) ptr2)->Thickness;
break;
case PCB_TYPE_LINE:
case PCB_TYPE_ELEMENT_LINE:
- undo->Data.Size = ((LineTypePtr) ptr2)->Thickness;
+ undo->Data.Size = ((pcb_line_t *) ptr2)->Thickness;
break;
case PCB_TYPE_TEXT:
case PCB_TYPE_ELEMENT_NAME:
- undo->Data.Size = ((TextTypePtr) ptr2)->Scale;
+ undo->Data.Size = ((pcb_text_t *) ptr2)->Scale;
break;
case PCB_TYPE_PAD:
- undo->Data.Size = ((PadTypePtr) ptr2)->Thickness;
+ undo->Data.Size = ((pcb_pad_t *) ptr2)->Thickness;
break;
case PCB_TYPE_ARC:
case PCB_TYPE_ELEMENT_ARC:
- undo->Data.Size = ((ArcTypePtr) ptr2)->Thickness;
+ undo->Data.Size = ((pcb_arc_t *) ptr2)->Thickness;
break;
}
}
@@ -1429,25 +1429,25 @@ void AddObjectToSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with Size changes
*/
-void AddObjectToClearSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
+void pcb_undo_add_obj_to_clear_size(int Type, void *ptr1, void *ptr2, void *ptr3)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGECLEARSIZE, OBJECT_ID(ptr2), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGECLEARSIZE, PCB_OBJECT_ID(ptr2), Type);
switch (Type) {
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
- undo->Data.Size = ((PinTypePtr) ptr2)->Clearance;
+ undo->Data.Size = ((pcb_pin_t *) ptr2)->Clearance;
break;
case PCB_TYPE_LINE:
- undo->Data.Size = ((LineTypePtr) ptr2)->Clearance;
+ undo->Data.Size = ((pcb_line_t *) ptr2)->Clearance;
break;
case PCB_TYPE_PAD:
- undo->Data.Size = ((PadTypePtr) ptr2)->Clearance;
+ undo->Data.Size = ((pcb_pad_t *) ptr2)->Clearance;
break;
case PCB_TYPE_ARC:
- undo->Data.Size = ((ArcTypePtr) ptr2)->Clearance;
+ undo->Data.Size = ((pcb_arc_t *) ptr2)->Clearance;
break;
}
}
@@ -1456,19 +1456,19 @@ void AddObjectToClearSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with Size changes
*/
-void AddObjectToMaskSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
+void pcb_undo_add_obj_to_mask_size(int Type, void *ptr1, void *ptr2, void *ptr3)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGEMASKSIZE, OBJECT_ID(ptr2), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGEMASKSIZE, PCB_OBJECT_ID(ptr2), Type);
switch (Type) {
case PCB_TYPE_PIN:
case PCB_TYPE_VIA:
- undo->Data.Size = ((PinTypePtr) ptr2)->Mask;
+ undo->Data.Size = ((pcb_pin_t *) ptr2)->Mask;
break;
case PCB_TYPE_PAD:
- undo->Data.Size = ((PadTypePtr) ptr2)->Mask;
+ undo->Data.Size = ((pcb_pad_t *) ptr2)->Mask;
break;
}
}
@@ -1477,14 +1477,14 @@ void AddObjectToMaskSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
/* ---------------------------------------------------------------------------
* adds an object to the list of objects with 2ndSize changes
*/
-void AddObjectTo2ndSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
+void pcb_undo_add_obj_to_2nd_size(int Type, void *ptr1, void *ptr2, void *ptr3)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGE2NDSIZE, OBJECT_ID(ptr2), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGE2NDSIZE, PCB_OBJECT_ID(ptr2), Type);
if (Type == PCB_TYPE_PIN || Type == PCB_TYPE_VIA)
- undo->Data.Size = ((PinTypePtr) ptr2)->DrillingHole;
+ undo->Data.Size = ((pcb_pin_t *) ptr2)->DrillingHole;
}
}
@@ -1492,13 +1492,13 @@ void AddObjectTo2ndSizeUndoList(int Type, void *ptr1, void *ptr2, void *ptr3)
* adds an object to the list of changed angles. Note that you must
* call this before changing the angles, passing the new start/delta.
*/
-void AddObjectToChangeAnglesUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_add_obj_to_change_angles(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
UndoListTypePtr undo;
- ArcTypePtr a = (ArcTypePtr) Ptr3;
+ pcb_arc_t *a = (pcb_arc_t *) Ptr3;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGEANGLES, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGEANGLES, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.AngleChange.angle[0] = a->StartAngle;
undo->Data.AngleChange.angle[1] = a->Delta;
}
@@ -1508,13 +1508,13 @@ void AddObjectToChangeAnglesUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr
* adds an object to the list of changed radii. Note that you must
* call this before changing the radii, passing the new width/height.
*/
-void AddObjectToChangeRadiiUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+void pcb_undo_add_obj_to_change_radii(int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
UndoListTypePtr undo;
- ArcTypePtr a = (ArcTypePtr) Ptr3;
+ pcb_arc_t *a = (pcb_arc_t *) Ptr3;
if (!Locked) {
- undo = GetUndoSlot(UNDO_CHANGERADII, OBJECT_ID(Ptr3), Type);
+ undo = GetUndoSlot(PCB_UNDO_CHANGERADII, PCB_OBJECT_ID(Ptr3), Type);
undo->Data.Move.DX = a->Width;
undo->Data.Move.DY = a->Height;
}
@@ -1523,12 +1523,12 @@ void AddObjectToChangeRadiiUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3
/* ---------------------------------------------------------------------------
* adds a layer change (new, delete, move) to the undo list.
*/
-void AddLayerChangeToUndoList(int old_index, int new_index)
+void pcb_undo_add_layer_move(int old_index, int new_index)
{
UndoListTypePtr undo;
if (!Locked) {
- undo = GetUndoSlot(UNDO_LAYERCHANGE, 0, 0);
+ undo = GetUndoSlot(PCB_UNDO_LAYERMOVE, 0, 0);
undo->Data.LayerChange.old_index = old_index;
undo->Data.LayerChange.new_index = new_index;
}
@@ -1537,23 +1537,23 @@ void AddLayerChangeToUndoList(int old_index, int new_index)
/* ---------------------------------------------------------------------------
* adds a netlist change to the undo list
*/
-void AddNetlistLibToUndoList(LibraryTypePtr lib)
+void pcb_undo_add_netlist_lib(pcb_lib_t *lib)
{
UndoListTypePtr undo;
unsigned int i, j;
- LibraryTypePtr old;
+ pcb_lib_t *old;
if (!Locked) {
- undo = GetUndoSlot(UNDO_NETLISTCHANGE, 0, 0);
+ undo = GetUndoSlot(PCB_UNDO_NETLISTCHANGE, 0, 0);
/* keep track of where the data needs to go */
undo->Data.NetlistChange.lib = lib;
/* and what the old data is that we'll need to restore */
- undo->Data.NetlistChange.old = (LibraryTypePtr) malloc(sizeof(LibraryTypePtr));
+ undo->Data.NetlistChange.old = (pcb_lib_t *) malloc(sizeof(pcb_lib_t *));
old = undo->Data.NetlistChange.old;
old->MenuN = lib->MenuN;
old->MenuMax = lib->MenuMax;
- old->Menu = (LibraryMenuTypePtr) malloc(old->MenuMax * sizeof(LibraryMenuType));
+ old->Menu = (pcb_lib_menu_t *) malloc(old->MenuMax * sizeof(pcb_lib_menu_t));
if (old->Menu == NULL) {
fprintf(stderr, "malloc() failed in AddNetlistLibToUndoList\n");
exit(1);
@@ -1571,7 +1571,7 @@ void AddNetlistLibToUndoList(LibraryTypePtr lib)
old->Menu[i].Style = lib->Menu[i].Style ? pcb_strdup(lib->Menu[i].Style) : NULL;
- old->Menu[i].Entry = (LibraryEntryTypePtr) malloc(old->Menu[i].EntryMax * sizeof(LibraryEntryType));
+ old->Menu[i].Entry = (pcb_lib_entry_t *) malloc(old->Menu[i].EntryMax * sizeof(pcb_lib_entry_t));
if (old->Menu[i].Entry == NULL) {
fprintf(stderr, "malloc() failed in AddNetlistLibToUndoList\n");
exit(1);
@@ -1600,7 +1600,7 @@ void AddNetlistLibToUndoList(LibraryTypePtr lib)
/* ---------------------------------------------------------------------------
* set lock flag
*/
-void LockUndo(void)
+void pcb_undo_lock(void)
{
Locked = pcb_true;
}
@@ -1608,7 +1608,7 @@ void LockUndo(void)
/* ---------------------------------------------------------------------------
* reset lock flag
*/
-void UnlockUndo(void)
+void pcb_undo_unlock(void)
{
Locked = pcb_false;
}
@@ -1616,7 +1616,7 @@ void UnlockUndo(void)
/* ---------------------------------------------------------------------------
* return undo lock state
*/
-pcb_bool Undoing(void)
+pcb_bool pcb_undoing(void)
{
return (Locked);
}
@@ -1626,28 +1626,28 @@ static const char *undo_type2str(int type)
{
static char buff[32];
switch(type) {
- case UNDO_CHANGENAME: return "changename";
- case UNDO_MOVE: return "move";
- case UNDO_REMOVE: return "remove";
- case UNDO_REMOVE_POINT: return "remove_point";
- case UNDO_INSERT_POINT: return "insert_point";
- case UNDO_REMOVE_CONTOUR: return "remove_contour";
- case UNDO_INSERT_CONTOUR: return "insert_contour";
- case UNDO_ROTATE: return "rotate";
- case UNDO_CREATE: return "create";
- case UNDO_MOVETOLAYER: return "movetolayer";
- case UNDO_FLAG: return "flag";
- case UNDO_CHANGESIZE: return "changesize";
- case UNDO_CHANGE2NDSIZE: return "change2ndsize";
- case UNDO_MIRROR: return "mirror";
- case UNDO_CHANGECLEARSIZE: return "chngeclearsize";
- case UNDO_CHANGEMASKSIZE: return "changemasksize";
- case UNDO_CHANGEANGLES: return "changeangles";
- case UNDO_CHANGERADII: return "changeradii";
- case UNDO_LAYERCHANGE: return "layerchange";
- case UNDO_CLEAR: return "clear";
- case UNDO_NETLISTCHANGE: return "netlistchange";
- case UNDO_CHANGEPINNUM: return "changepinnum";
+ case PCB_UNDO_CHANGENAME: return "changename";
+ case PCB_UNDO_MOVE: return "move";
+ case PCB_UNDO_REMOVE: return "remove";
+ case PCB_UNDO_REMOVE_POINT: return "remove_point";
+ case PCB_UNDO_INSERT_POINT: return "insert_point";
+ case PCB_UNDO_REMOVE_CONTOUR: return "remove_contour";
+ case PCB_UNDO_INSERT_CONTOUR: return "insert_contour";
+ case PCB_UNDO_ROTATE: return "rotate";
+ case PCB_UNDO_CREATE: return "create";
+ case PCB_UNDO_MOVETOLAYER: return "movetolayer";
+ case PCB_UNDO_FLAG: return "flag";
+ case PCB_UNDO_CHANGESIZE: return "changesize";
+ case PCB_UNDO_CHANGE2NDSIZE: return "change2ndsize";
+ case PCB_UNDO_MIRROR: return "mirror";
+ case PCB_UNDO_CHANGECLEARSIZE: return "chngeclearsize";
+ case PCB_UNDO_CHANGEMASKSIZE: return "changemasksize";
+ case PCB_UNDO_CHANGEANGLES: return "changeangles";
+ case PCB_UNDO_CHANGERADII: return "changeradii";
+ case PCB_UNDO_LAYERMOVE: return "layermove";
+ case PCB_UNDO_CLEAR: return "clear";
+ case PCB_UNDO_NETLISTCHANGE: return "netlistchange";
+ case PCB_UNDO_CHANGEPINNUM: return "changepinnum";
}
sprintf(buff, "Unknown %d", type);
return buff;
diff --git a/src/undo.h b/src/undo.h
index d09c35a..64ca3cb 100644
--- a/src/undo.h
+++ b/src/undo.h
@@ -29,48 +29,79 @@
#ifndef PCB_UNDO_H
#define PCB_UNDO_H
-#include "global.h"
+#include "library.h"
#define DRAW_FLAGS (PCB_FLAG_RAT | PCB_FLAG_SELECTED \
| PCB_FLAG_HIDENAME | PCB_FLAG_HOLE | PCB_FLAG_OCTAGON | PCB_FLAG_FOUND | PCB_FLAG_CLEARLINE)
- /* different layers */
+/* different layers */
-int Undo(pcb_bool);
-int Redo(pcb_bool);
-void IncrementUndoSerialNumber(void);
-void SaveUndoSerialNumber(void);
-void RestoreUndoSerialNumber(void);
-void ClearUndoList(pcb_bool);
-void MoveObjectToRemoveUndoList(int, void *, void *, void *);
-void AddObjectToRemovePointUndoList(int, void *, void *, pcb_cardinal_t);
-void AddObjectToInsertPointUndoList(int, void *, void *, void *);
-void AddObjectToRemoveContourUndoList(int, LayerType *, PolygonType *);
-void AddObjectToInsertContourUndoList(int, LayerType *, PolygonType *);
-void AddObjectToMoveUndoList(int, void *, void *, void *, Coord, Coord);
-void AddObjectToChangeNameUndoList(int, void *, void *, void *, char *);
-void AddObjectToChangePinnumUndoList(int, void *, void *, void *, char *);
-void AddObjectToRotateUndoList(int, void *, void *, void *, Coord, Coord, pcb_uint8_t);
-void AddObjectToCreateUndoList(int, void *, void *, void *);
-void AddObjectToMirrorUndoList(int, void *, void *, void *, Coord);
-void AddObjectToMoveToLayerUndoList(int, void *, void *, void *);
-void AddObjectToFlagUndoList(int, void *, void *, void *);
-void AddObjectToSizeUndoList(int, void *, void *, void *);
-void AddObjectTo2ndSizeUndoList(int, void *, void *, void *);
-void AddObjectToClearSizeUndoList(int, void *, void *, void *);
-void AddObjectToMaskSizeUndoList(int, void *, void *, void *);
-void AddObjectToChangeAnglesUndoList(int, void *, void *, void *);
-void AddObjectToChangeRadiiUndoList(int, void *, void *, void *);
-void AddObjectToClearPolyUndoList(int, void *, void *, void *, pcb_bool);
-void AddLayerChangeToUndoList(int, int);
-void AddNetlistLibToUndoList(LibraryTypePtr);
-void LockUndo(void);
-void UnlockUndo(void);
-pcb_bool Undoing(void);
+int pcb_undo(pcb_bool);
+int pcb_redo(pcb_bool);
+void pcb_undo_inc_serial(void);
+void pcb_undo_save_serial(void);
+void pcb_undo_restore_serial(void);
+void pcb_undo_clear_list(pcb_bool);
+
+void pcb_undo_move_obj_to_remove(int, void *, void *, void *);
+void pcb_undo_add_obj_to_remove_point(int, void *, void *, pcb_cardinal_t);
+void pcb_undo_add_obj_to_insert_point(int, void *, void *, void *);
+void pcb_undo_add_obj_to_remove_contour(int, pcb_layer_t *, pcb_polygon_t *);
+void pcb_undo_add_obj_to_insert_contour(int, pcb_layer_t *, pcb_polygon_t *);
+void pcb_undo_add_obj_to_move(int, void *, void *, void *, pcb_coord_t, pcb_coord_t);
+void pcb_undo_add_obj_to_change_name(int, void *, void *, void *, char *);
+void pcb_undo_add_obj_to_change_pinnum(int, void *, void *, void *, char *);
+void pcb_undo_add_obj_to_rotate(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, pcb_uint8_t);
+void pcb_undo_add_obj_to_create(int, void *, void *, void *);
+void pcb_undo_add_obj_to_mirror(int, void *, void *, void *, pcb_coord_t);
+void pcb_undo_add_obj_to_move_to_layer(int, void *, void *, void *);
+void pcb_undo_add_obj_to_flag(int, void *, void *, void *);
+void pcb_undo_add_obj_to_size(int, void *, void *, void *);
+void pcb_undo_add_obj_to_2nd_size(int, void *, void *, void *);
+void pcb_undo_add_obj_to_clear_size(int, void *, void *, void *);
+void pcb_undo_add_obj_to_mask_size(int, void *, void *, void *);
+void pcb_undo_add_obj_to_change_angles(int, void *, void *, void *);
+void pcb_undo_add_obj_to_change_radii(int, void *, void *, void *);
+void pcb_undo_add_obj_to_clear_poly(int, void *, void *, void *, pcb_bool);
+void pcb_undo_add_layer_move(int, int);
+void pcb_undo_add_netlist_lib(pcb_lib_t *);
+
+void pcb_undo_lock(void);
+void pcb_undo_unlock(void);
+pcb_bool pcb_undoing(void);
/* Publish actions - these may be useful for other actions */
-int ActionUndo(int argc, const char **argv, Coord x, Coord y);
-int ActionRedo(int argc, const char **argv, Coord x, Coord y);
-int ActionAtomic(int argc, const char **argv, Coord x, Coord y);
+int pcb_act_Undo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
+int pcb_act_Redo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
+int pcb_act_Atomic(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
+
+/* ---------------------------------------------------------------------------
+ * define supported types of undo operations
+ * note these must be separate bits now
+ */
+typedef enum {
+ PCB_UNDO_CHANGENAME = 0x000001, /* change of names */
+ PCB_UNDO_MOVE = 0x000002, /* moving objects */
+ PCB_UNDO_REMOVE = 0x000004, /* removing objects */
+ PCB_UNDO_REMOVE_POINT = 0x000008, /* removing polygon/... points */
+ PCB_UNDO_INSERT_POINT = 0x000010, /* inserting polygon/... points */
+ PCB_UNDO_REMOVE_CONTOUR = 0x000020, /* removing a contour from a polygon */
+ PCB_UNDO_INSERT_CONTOUR = 0x000040, /* inserting a contour from a polygon */
+ PCB_UNDO_ROTATE = 0x000080, /* rotations */
+ PCB_UNDO_CREATE = 0x000100, /* creation of objects */
+ PCB_UNDO_MOVETOLAYER = 0x000200, /* moving objects to */
+ PCB_UNDO_FLAG = 0x000400, /* toggling SELECTED flag */
+ PCB_UNDO_CHANGESIZE = 0x000800, /* change size of object */
+ PCB_UNDO_CHANGE2NDSIZE = 0x001000, /* change 2ndSize of object */
+ PCB_UNDO_MIRROR = 0x002000, /* change side of board */
+ PCB_UNDO_CHANGECLEARSIZE = 0x004000, /* change clearance size */
+ PCB_UNDO_CHANGEMASKSIZE = 0x008000, /* change mask size */
+ PCB_UNDO_CHANGEANGLES = 0x010000, /* change arc angles */
+ PCB_UNDO_LAYERMOVE = 0x020000, /* layer new/delete/move */
+ PCB_UNDO_CLEAR = 0x040000, /* clear/restore to polygons */
+ PCB_UNDO_NETLISTCHANGE = 0x080000, /* netlist change */
+ PCB_UNDO_CHANGEPINNUM = 0x100000, /* change of pin number */
+ PCB_UNDO_CHANGERADII = 0x200000 /* change arc radii */
+} pcb_undo_op_t;
#endif
diff --git a/src/undo_act.c b/src/undo_act.c
index 8ec715c..4ddca93 100644
--- a/src/undo_act.c
+++ b/src/undo_act.c
@@ -27,25 +27,23 @@
#include "config.h"
#include "conf_core.h"
+#include "board.h"
#include "data.h"
#include "action_helper.h"
#include "error.h"
#include "funchash_core.h"
-#include "crosshair.h"
#include "undo.h"
#include "polygon.h"
-#include "set.h"
#include "search.h"
-#include "draw.h"
-#include "misc.h"
-#include "layer.h"
+
+#include "obj_line_draw.h"
/* --------------------------------------------------------------------------- */
-static const char atomic_syntax[] = "Atomic(Save|Restore|Close|Block)";
+static const char pcb_acts_Atomic[] = "Atomic(Save|Restore|Close|Block)";
-static const char atomic_help[] = "Save or restore the undo serial number.";
+static const char pcb_acth_Atomic[] = "Save or restore the undo serial number.";
/* %start-doc actions Atomic
@@ -79,26 +77,26 @@ Does a Restore if there was nothing to undo, else does a Close.
%end-doc */
-int ActionAtomic(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_Atomic(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (argc != 1)
- AFAIL(atomic);
+ PCB_ACT_FAIL(Atomic);
- switch (funchash_get(argv[0], NULL)) {
+ switch (pcb_funchash_get(argv[0], NULL)) {
case F_Save:
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
break;
case F_Restore:
- RestoreUndoSerialNumber();
+ pcb_undo_restore_serial();
break;
case F_Close:
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
break;
case F_Block:
- RestoreUndoSerialNumber();
- if (Bumped)
- IncrementUndoSerialNumber();
+ pcb_undo_restore_serial();
+ if (pcb_bumped)
+ pcb_undo_inc_serial();
break;
}
return 0;
@@ -106,15 +104,15 @@ int ActionAtomic(int argc, const char **argv, Coord x, Coord y)
/* --------------------------------------------------------------------------- */
-static const char undo_syntax[] = "Undo()\n" "Undo(ClearList)";
+static const char pcb_acts_Undo[] = "pcb_undo()\n" "pcb_undo(ClearList)";
-static const char undo_help[] = "Undo recent changes.";
+static const char pcb_acth_Undo[] = "Undo recent changes.";
/* %start-doc actions Undo
The unlimited undo feature of @code{Pcb} allows you to recover from
most operations that materially affect you work. Calling
- at code{Undo()} without any parameter recovers from the last (non-undo)
+ at code{pcb_undo()} without any parameter recovers from the last (non-undo)
operation. @code{ClearList} is used to release the allocated
memory. @code{ClearList} is called whenever a new layout is started or
loaded. See also @code{Redo} and @code{Atomic}.
@@ -125,130 +123,129 @@ same serial number will be undone (or redone) as a group. See
%end-doc */
-int ActionUndo(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_Undo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
+ const char *function = PCB_ACTION_ARG(0);
if (!function || !*function) {
/* don't allow undo in the middle of an operation */
- if (conf_core.editor.mode != PCB_MODE_POLYGON_HOLE && Crosshair.AttachedObject.State != STATE_FIRST)
+ if (conf_core.editor.mode != PCB_MODE_POLYGON_HOLE && pcb_crosshair.AttachedObject.State != PCB_CH_STATE_FIRST)
return 1;
- if (Crosshair.AttachedBox.State != STATE_FIRST && conf_core.editor.mode != PCB_MODE_ARC)
+ if (pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST && conf_core.editor.mode != PCB_MODE_ARC)
return 1;
/* undo the last operation */
- notify_crosshair_change(pcb_false);
- if ((conf_core.editor.mode == PCB_MODE_POLYGON || conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && Crosshair.AttachedPolygon.PointN) {
- GoToPreviousPoint();
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_false);
+ if ((conf_core.editor.mode == PCB_MODE_POLYGON || conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && pcb_crosshair.AttachedPolygon.PointN) {
+ pcb_polygon_go_to_prev_point();
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
/* move anchor point if undoing during line creation */
if (conf_core.editor.mode == PCB_MODE_LINE) {
- if (Crosshair.AttachedLine.State == STATE_SECOND) {
+ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_SECOND) {
if (conf_core.editor.auto_drc)
- Undo(pcb_true); /* undo the connection find */
- Crosshair.AttachedLine.State = STATE_FIRST;
- SetLocalRef(0, 0, pcb_false);
- notify_crosshair_change(pcb_true);
+ pcb_undo(pcb_true); /* undo the connection find */
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair_set_local_ref(0, 0, pcb_false);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
- if (Crosshair.AttachedLine.State == STATE_THIRD) {
+ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_THIRD) {
int type;
void *ptr1, *ptr3, *ptrtmp;
- LineTypePtr ptr2;
+ pcb_line_t *ptr2;
/* this search is guaranteed to succeed */
- SearchObjectByLocation(PCB_TYPE_LINE | PCB_TYPE_RATLINE, &ptr1,
- &ptrtmp, &ptr3, Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, 0);
- ptr2 = (LineTypePtr) ptrtmp;
+ pcb_search_obj_by_location(PCB_TYPE_LINE | PCB_TYPE_RATLINE, &ptr1,
+ &ptrtmp, &ptr3, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, 0);
+ ptr2 = (pcb_line_t *) ptrtmp;
/* save both ends of line */
- Crosshair.AttachedLine.Point2.X = ptr2->Point1.X;
- Crosshair.AttachedLine.Point2.Y = ptr2->Point1.Y;
- if ((type = Undo(pcb_true)))
- SetChangedFlag(pcb_true);
+ pcb_crosshair.AttachedLine.Point2.X = ptr2->Point1.X;
+ pcb_crosshair.AttachedLine.Point2.Y = ptr2->Point1.Y;
+ if ((type = pcb_undo(pcb_true)))
+ pcb_board_set_changed_flag(pcb_true);
/* check that the undo was of the right type */
- if ((type & UNDO_CREATE) == 0) {
+ if ((type & PCB_UNDO_CREATE) == 0) {
/* wrong undo type, restore anchor points */
- Crosshair.AttachedLine.Point2.X = Crosshair.AttachedLine.Point1.X;
- Crosshair.AttachedLine.Point2.Y = Crosshair.AttachedLine.Point1.Y;
- notify_crosshair_change(pcb_true);
+ pcb_crosshair.AttachedLine.Point2.X = pcb_crosshair.AttachedLine.Point1.X;
+ pcb_crosshair.AttachedLine.Point2.Y = pcb_crosshair.AttachedLine.Point1.Y;
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
/* move to new anchor */
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y;
/* check if an intermediate point was removed */
- if (type & UNDO_REMOVE) {
+ if (type & PCB_UNDO_REMOVE) {
/* this search should find the restored line */
- SearchObjectByLocation(PCB_TYPE_LINE | PCB_TYPE_RATLINE, &ptr1,
- &ptrtmp, &ptr3, Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, 0);
- ptr2 = (LineTypePtr) ptrtmp;
+ pcb_search_obj_by_location(PCB_TYPE_LINE | PCB_TYPE_RATLINE, &ptr1,
+ &ptrtmp, &ptr3, pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y, 0);
+ ptr2 = (pcb_line_t *) ptrtmp;
if (conf_core.editor.auto_drc) {
/* undo loses PCB_FLAG_FOUND */
- SET_FLAG(PCB_FLAG_FOUND, ptr2);
+ PCB_FLAG_SET(PCB_FLAG_FOUND, ptr2);
DrawLine(CURRENT, ptr2);
}
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = ptr2->Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = ptr2->Point2.Y;
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = ptr2->Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = ptr2->Point2.Y;
}
- FitCrosshairIntoGrid(Crosshair.X, Crosshair.Y);
- AdjustAttachedObjects();
- if (--addedLines == 0) {
- Crosshair.AttachedLine.State = STATE_SECOND;
+ pcb_crosshair_grid_fit(pcb_crosshair.X, pcb_crosshair.Y);
+ pcb_adjust_attached_objects();
+ if (--pcb_added_lines == 0) {
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_SECOND;
lastLayer = CURRENT;
}
else {
/* this search is guaranteed to succeed too */
- SearchObjectByLocation(PCB_TYPE_LINE | PCB_TYPE_RATLINE, &ptr1,
- &ptrtmp, &ptr3, Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, 0);
- ptr2 = (LineTypePtr) ptrtmp;
- lastLayer = (LayerTypePtr) ptr1;
+ pcb_search_obj_by_location(PCB_TYPE_LINE | PCB_TYPE_RATLINE, &ptr1,
+ &ptrtmp, &ptr3, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, 0);
+ ptr2 = (pcb_line_t *) ptrtmp;
+ lastLayer = (pcb_layer_t *) ptr1;
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
}
if (conf_core.editor.mode == PCB_MODE_ARC) {
- if (Crosshair.AttachedBox.State == STATE_SECOND) {
- Crosshair.AttachedBox.State = STATE_FIRST;
- notify_crosshair_change(pcb_true);
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_SECOND) {
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
- if (Crosshair.AttachedBox.State == STATE_THIRD) {
+ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_THIRD) {
void *ptr1, *ptr2, *ptr3;
- BoxTypePtr bx;
/* guaranteed to succeed */
- SearchObjectByLocation(PCB_TYPE_ARC, &ptr1, &ptr2, &ptr3,
- Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point1.Y, 0);
- bx = GetArcEnds((ArcTypePtr) ptr2);
- Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = bx->X1;
- Crosshair.AttachedBox.Point1.Y = Crosshair.AttachedBox.Point2.Y = bx->Y1;
- AdjustAttachedObjects();
- if (--addedLines == 0)
- Crosshair.AttachedBox.State = STATE_SECOND;
+ pcb_search_obj_by_location(PCB_TYPE_ARC, &ptr1, &ptr2, &ptr3,
+ pcb_crosshair.AttachedBox.Point1.X, pcb_crosshair.AttachedBox.Point1.Y, 0);
+ pcb_arc_get_end((pcb_arc_t *) ptr2, 0, &pcb_crosshair.AttachedBox.Point2.X, &pcb_crosshair.AttachedBox.Point2.Y);
+ pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X;
+ pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y;
+ pcb_adjust_attached_objects();
+ if (--pcb_added_lines == 0)
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_SECOND;
}
}
/* undo the last destructive operation */
- if (Undo(pcb_true))
- SetChangedFlag(pcb_true);
+ if (pcb_undo(pcb_true))
+ pcb_board_set_changed_flag(pcb_true);
}
else if (function) {
- switch (funchash_get(function, NULL)) {
+ switch (pcb_funchash_get(function, NULL)) {
/* clear 'undo objects' list */
case F_ClearList:
- ClearUndoList(pcb_false);
+ pcb_undo_clear_list(pcb_false);
break;
}
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char redo_syntax[] = "Redo()";
+static const char pcb_acts_Redo[] = "pcb_redo()";
-static const char redo_help[] = "Redo recent \"undo\" operations.";
+static const char pcb_acth_Redo[] = "Redo recent \"undo\" operations.";
/* %start-doc actions Redo
@@ -265,35 +262,35 @@ three "undone" lines.
%end-doc */
-int ActionRedo(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_Redo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (((conf_core.editor.mode == PCB_MODE_POLYGON ||
- conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && Crosshair.AttachedPolygon.PointN) || Crosshair.AttachedLine.State == STATE_SECOND)
+ conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && pcb_crosshair.AttachedPolygon.PointN) || pcb_crosshair.AttachedLine.State == PCB_CH_STATE_SECOND)
return 1;
- notify_crosshair_change(pcb_false);
- if (Redo(pcb_true)) {
- SetChangedFlag(pcb_true);
- if (conf_core.editor.mode == PCB_MODE_LINE && Crosshair.AttachedLine.State != STATE_FIRST) {
- LineType *line = linelist_last(&CURRENT->Line);
- Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = line->Point2.X;
- Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = line->Point2.Y;
- addedLines++;
+ pcb_notify_crosshair_change(pcb_false);
+ if (pcb_redo(pcb_true)) {
+ pcb_board_set_changed_flag(pcb_true);
+ if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) {
+ pcb_line_t *line = linelist_last(&CURRENT->Line);
+ pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = line->Point2.X;
+ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = line->Point2.Y;
+ pcb_added_lines++;
}
}
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
return 0;
}
-HID_Action undo_action_list[] = {
- {"Atomic", 0, ActionAtomic,
- atomic_help, atomic_syntax}
+pcb_hid_action_t undo_action_list[] = {
+ {"Atomic", 0, pcb_act_Atomic,
+ pcb_acth_Atomic, pcb_acts_Atomic}
,
- {"Undo", 0, ActionUndo,
- undo_help, undo_syntax}
+ {"Undo", 0, pcb_act_Undo,
+ pcb_acth_Undo, pcb_acts_Undo}
,
- {"Redo", 0, ActionRedo,
- redo_help, redo_syntax}
+ {"Redo", 0, pcb_act_Redo,
+ pcb_acth_Redo, pcb_acts_Redo}
};
-REGISTER_ACTIONS(undo_action_list, NULL)
+PCB_REGISTER_ACTIONS(undo_action_list, NULL)
diff --git a/src/unit.c b/src/unit.c
index 563ef77..0a835d7 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -26,9 +26,10 @@
*/
#include "config.h"
#include <stdlib.h>
-#include <locale.h>
-#include "global.h"
+#include <string.h>
+#include <ctype.h>
#include "compat_misc.h"
+#include "compat_nls.h"
#include "unit.h"
/* Helper macros for tables */
@@ -42,36 +43,36 @@
/* These should be kept in order of smallest scale_factor
* to largest -- the code uses this ordering when finding
* the best scale to use for a group of measures */
-Unit Units[] = {
- {0, "km", NULL, 'k', 0.000001, METRIC, ALLOW_KM, 5,
+pcb_unit_t Units[] = {
+ {0, "km", NULL, 'k', 0.000001, PCB_UNIT_METRIC, PCB_UNIT_ALLOW_KM, 5,
0.00005, 0.0005, 0.0025, 0.05, 0.25,
{""}},
- {0, "m", NULL, 'f', 0.001, METRIC, ALLOW_M, 5,
+ {0, "m", NULL, 'f', 0.001, PCB_UNIT_METRIC, PCB_UNIT_ALLOW_M, 5,
0.0005, 0.005, 0.025, 0.5, 2.5,
{""}},
- {0, "cm", NULL, 'e', 0.1, METRIC, ALLOW_CM, 5,
+ {0, "cm", NULL, 'e', 0.1, PCB_UNIT_METRIC, PCB_UNIT_ALLOW_CM, 5,
0.005, 0.05, 0.25, 5, 25,
{""}},
- {0, "mm", NULL, 'm', 1, METRIC, ALLOW_MM, 4,
+ {0, "mm", NULL, 'm', 1, PCB_UNIT_METRIC, PCB_UNIT_ALLOW_MM, 4,
0.005, 0.05, 0.25, 5, 25,
{""}},
- {0, "um", NULL, 'u', 1000, METRIC, ALLOW_UM, 2,
+ {0, "um", NULL, 'u', 1000, PCB_UNIT_METRIC, PCB_UNIT_ALLOW_UM, 2,
0.005, 0.05, 0.25, 5, 25,
{""}},
- {0, "nm", NULL, 'n', 1000000, METRIC, ALLOW_NM, 0,
+ {0, "nm", NULL, 'n', 1000000, PCB_UNIT_METRIC, PCB_UNIT_ALLOW_NM, 0,
5, 50, 2500, 5000, 25000,
{""}},
- {0, "in", NULL, 'i', 0.001, IMPERIAL, ALLOW_IN, 5,
+ {0, "in", NULL, 'i', 0.001, PCB_UNIT_IMPERIAL, PCB_UNIT_ALLOW_IN, 5,
0.1, 1.0, 5.0, 25, 100,
{"inch"}},
- {0, "mil", NULL, 'l', 1, IMPERIAL, ALLOW_MIL, 2,
+ {0, "mil", NULL, 'l', 1, PCB_UNIT_IMPERIAL, PCB_UNIT_ALLOW_MIL, 2,
0.1, 1.0, 10, 100, 1000,
{""}},
- {0, "dmil", NULL, 'k', 10, IMPERIAL, ALLOW_DMIL, 1, /* kicad legacy decimil unit */
+ {0, "dmil", NULL, 'k', 10, PCB_UNIT_IMPERIAL, PCB_UNIT_ALLOW_DMIL, 1, /* kicad legacy decimil unit */
0.1, 1.0, 10, 100, 1000, /* wild guess at factors */
{""}},
- {0, "cmil", NULL, 'c', 100, IMPERIAL, ALLOW_CMIL, 0,
+ {0, "cmil", NULL, 'c', 100, PCB_UNIT_IMPERIAL, PCB_UNIT_ALLOW_CMIL, 0,
1, 10, 100, 1000, 10000,
{"pcb"}}
};
@@ -83,7 +84,7 @@ Unit Units[] = {
* main units array, and internationalize the units for GUI
* display.
*/
-void initialize_units()
+void pcb_units_init(void)
{
int i;
for (i = 0; i < N_UNITS; ++i) {
@@ -95,7 +96,7 @@ void initialize_units()
/* This list -must- contain all printable units from the above list */
/* For now I have just copy/pasted the same values for all metric
* units and the same values for all imperial ones */
-Increments increments[] = {
+pcb_increments_t increments[] = {
/* TABLE FORMAT | default | min | max
* grid | | |
* size | | |
@@ -155,9 +156,9 @@ Increments increments[] = {
*
* \param [in] const_suffix The suffix to look up
*
- * \return A const pointer to the Unit struct, or NULL if none was found
+ * \return A const pointer to the pcb_unit_t struct, or NULL if none was found
*/
-const Unit *get_unit_struct(const char *suffix)
+const pcb_unit_t *get_unit_struct(const char *suffix)
{
int i;
int s_len = 0;
@@ -185,7 +186,7 @@ const Unit *get_unit_struct(const char *suffix)
return NULL;
}
-const Unit *get_unit_struct_by_allow(enum e_allow allow)
+const pcb_unit_t *get_unit_struct_by_allow(enum pcb_allow_e allow)
{
int i;
for (i = 0; i < N_UNITS; ++i)
@@ -197,13 +198,13 @@ const Unit *get_unit_struct_by_allow(enum e_allow allow)
/* ACCESSORS */
/* \brief Returns the master unit list. This may not be modified. */
-const Unit *get_unit_list(void)
+const pcb_unit_t *get_unit_list(void)
{
return Units;
}
/* \brief Returns the unit by its index */
-const Unit *get_unit_by_idx(int idx)
+const pcb_unit_t *get_unit_by_idx(int idx)
{
if ((idx < 0) || (idx >= N_UNITS))
return NULL;
@@ -211,7 +212,7 @@ const Unit *get_unit_by_idx(int idx)
}
/* \brief Returns the length of the master unit list. */
-int get_n_units(void)
+int pcb_get_n_units(void)
{
return N_UNITS;
}
@@ -223,12 +224,12 @@ int get_n_units(void)
*
* \return The converted measure
*/
-double coord_to_unit(const Unit * unit, Coord x)
+double pcb_coord_to_unit(const pcb_unit_t * unit, pcb_coord_t x)
{
double base;
if (unit == NULL)
return -1;
- base = unit->family == METRIC ? PCB_COORD_TO_MM(1)
+ base = unit->family == PCB_UNIT_METRIC ? PCB_COORD_TO_MM(1)
: PCB_COORD_TO_MIL(1);
return x * unit->scale_factor * base;
}
@@ -240,12 +241,12 @@ double coord_to_unit(const Unit * unit, Coord x)
*
* \return The converted measure
*/
-Coord unit_to_coord(const Unit * unit, double x)
+pcb_coord_t pcb_unit_to_coord(const pcb_unit_t * unit, double x)
{
double base;
if (unit == NULL)
return -1;
- base = unit->family == METRIC ? PCB_MM_TO_COORD(x)
+ base = unit->family == PCB_UNIT_METRIC ? PCB_MM_TO_COORD(x)
: PCB_MIL_TO_COORD(x);
return pcb_round(base/unit->scale_factor);
}
@@ -256,9 +257,9 @@ Coord unit_to_coord(const Unit * unit, double x)
*
* \return The converted measure
*/
-double unit_to_factor(const Unit * unit)
+double pcb_unit_to_factor(const pcb_unit_t * unit)
{
- return 1.0 / coord_to_unit(unit, 1);
+ return 1.0 / pcb_coord_to_unit(unit, 1);
}
/* \brief Obtain an increment object from its suffix
@@ -268,9 +269,9 @@ double unit_to_factor(const Unit * unit)
*
* \param [in] suffix The suffix to look up
*
- * \return A const pointer to the Increments struct, or NULL if none was found
+ * \return A const pointer to the pcb_increments_t struct, or NULL if none was found
*/
-Increments *get_increments_struct(const char *suffix)
+pcb_increments_t *pcb_get_increments_struct(const char *suffix)
{
int i;
/* Do lookup */
@@ -279,3 +280,13 @@ Increments *get_increments_struct(const char *suffix)
return &increments[i];
return NULL;
}
+
+/* Bring an angle into [0, 360) range */
+pcb_angle_t pcb_normalize_angle(pcb_angle_t a)
+{
+ while (a < 0)
+ a += 360.0;
+ while (a >= 360.0)
+ a -= 360.0;
+ return a;
+}
diff --git a/src/unit.h b/src/unit.h
index e79ee50..7bd9014 100644
--- a/src/unit.h
+++ b/src/unit.h
@@ -30,50 +30,50 @@
#include "config.h"
-/* typedef ... Coord; pcb base unit, typedef'd in config.h */
-typedef double Angle; /* degrees */
-
-enum e_allow {
- NO_PRINT = 0, /* suffixes we can read but not print (i.e., "inch") */
- ALLOW_NM = 1,
- ALLOW_UM = 2,
- ALLOW_MM = 4,
- ALLOW_CM = 8,
- ALLOW_M = 16,
- ALLOW_KM = 32,
-
- ALLOW_CMIL = 1024,
- ALLOW_MIL = 2048,
- ALLOW_IN = 4096,
-
- ALLOW_DMIL = 8192, /* for kicad legacy decimil units */
-
- ALLOW_METRIC = ALLOW_NM | ALLOW_UM | ALLOW_MM | ALLOW_CM | ALLOW_M | ALLOW_KM,
- ALLOW_IMPERIAL = ALLOW_DMIL | ALLOW_CMIL | ALLOW_MIL | ALLOW_IN,
+/* typedef ... pcb_coord_t; pcb base unit, typedef'd in config.h */
+typedef double pcb_angle_t; /* degrees */
+
+enum pcb_allow_e {
+ PCB_UNIT_NO_PRINT = 0, /* suffixes we can read but not print (i.e., "inch") */
+ PCB_UNIT_ALLOW_NM = 1,
+ PCB_UNIT_ALLOW_UM = 2,
+ PCB_UNIT_ALLOW_MM = 4,
+ PCB_UNIT_ALLOW_CM = 8,
+ PCB_UNIT_ALLOW_M = 16,
+ PCB_UNIT_ALLOW_KM = 32,
+
+ PCB_UNIT_ALLOW_CMIL = 1024,
+ PCB_UNIT_ALLOW_MIL = 2048,
+ PCB_UNIT_ALLOW_IN = 4096,
+
+ PCB_UNIT_ALLOW_DMIL = 8192, /* for kicad legacy decimil units */
+
+ PCB_UNIT_ALLOW_METRIC = PCB_UNIT_ALLOW_NM | PCB_UNIT_ALLOW_UM | PCB_UNIT_ALLOW_MM | PCB_UNIT_ALLOW_CM | PCB_UNIT_ALLOW_M | PCB_UNIT_ALLOW_KM,
+ PCB_UNIT_ALLOW_IMPERIAL = PCB_UNIT_ALLOW_DMIL | PCB_UNIT_ALLOW_CMIL | PCB_UNIT_ALLOW_MIL | PCB_UNIT_ALLOW_IN,
/* This is all units allowed in parse_l.l */
#if 0
- ALLOW_READABLE = ALLOW_NM | ALLOW_UM | ALLOW_MM | ALLOW_M | ALLOW_KM | ALLOW_CMIL | ALLOW_MIL | ALLOW_IN,
+ PCB_UNIT_ALLOW_READABLE = PCB_UNIT_ALLOW_NM | PCB_UNIT_ALLOW_UM | PCB_UNIT_ALLOW_MM | PCB_UNIT_ALLOW_M | PCB_UNIT_ALLOW_KM | PCB_UNIT_ALLOW_CMIL | PCB_UNIT_ALLOW_MIL | PCB_UNIT_ALLOW_IN,
#else
- ALLOW_READABLE = ALLOW_CMIL,
+ PCB_UNIT_ALLOW_READABLE = PCB_UNIT_ALLOW_CMIL,
#endif
/* Used for pcb-printf %mS - should not include unusual units like km, cmil and dmil */
- ALLOW_NATURAL = ALLOW_NM | ALLOW_UM | ALLOW_MM | ALLOW_M | ALLOW_MIL | ALLOW_IN,
+ PCB_UNIT_ALLOW_NATURAL = PCB_UNIT_ALLOW_NM | PCB_UNIT_ALLOW_UM | PCB_UNIT_ALLOW_MM | PCB_UNIT_ALLOW_M | PCB_UNIT_ALLOW_MIL | PCB_UNIT_ALLOW_IN,
- ALLOW_ALL = ~0
+ PCB_UNIT_ALLOW_ALL = ~0
};
-enum e_family { METRIC, IMPERIAL };
-enum e_suffix { NO_SUFFIX, SUFFIX, FILE_MODE };
+enum pcb_family_e { PCB_UNIT_METRIC, PCB_UNIT_IMPERIAL };
+enum pcb_suffix_e { PCB_UNIT_NO_SUFFIX, PCB_UNIT_SUFFIX, PCB_UNIT_FILE_MODE };
-struct unit {
+struct pcb_unit_s {
int index; /* Index into Unit[] list */
const char *suffix;
const char *in_suffix; /* internationalized suffix */
char printf_code;
double scale_factor;
- enum e_family family;
- enum e_allow allow;
+ enum pcb_family_e family;
+ enum pcb_allow_e allow;
int default_prec;
/* used for gui spinboxes */
double step_tiny;
@@ -85,40 +85,55 @@ struct unit {
const char *alias[1];
};
-struct increments {
+struct pcb_increments_s {
const char *suffix;
/* key g and <shift>g value */
- Coord grid;
- Coord grid_min;
- Coord grid_max;
+ pcb_coord_t grid;
+ pcb_coord_t grid_min;
+ pcb_coord_t grid_max;
/* key s and <shift>s value */
- Coord size;
- Coord size_min;
- Coord size_max;
+ pcb_coord_t size;
+ pcb_coord_t size_min;
+ pcb_coord_t size_max;
/* key l and <shift>l value */
- Coord line;
- Coord line_min;
- Coord line_max;
+ pcb_coord_t line;
+ pcb_coord_t line_min;
+ pcb_coord_t line_max;
/* key k and <shift>k value */
- Coord clear;
- Coord clear_min;
- Coord clear_max;
+ pcb_coord_t clear;
+ pcb_coord_t clear_min;
+ pcb_coord_t clear_max;
};
-typedef struct unit Unit;
-typedef struct increments Increments;
-extern Unit Units[];
-extern Increments increments[];
-
-const Unit *get_unit_struct(const char *suffix);
-const Unit *get_unit_struct_by_allow(enum e_allow allow);
-const Unit *get_unit_list(void);
-const Unit *get_unit_by_idx(int idx);
-int get_n_units(void);
-double coord_to_unit(const Unit *, Coord);
-double unit_to_factor(const Unit * unit);
-Coord unit_to_coord(const Unit *, double);
-Increments *get_increments_struct(const char *suffix);
-
+typedef struct pcb_unit_s pcb_unit_t;
+typedef struct pcb_increments_s pcb_increments_t;
+extern pcb_unit_t Units[];
+extern pcb_increments_t increments[];
+
+const pcb_unit_t *get_unit_struct(const char *suffix);
+const pcb_unit_t *get_unit_struct_by_allow(enum pcb_allow_e allow);
+const pcb_unit_t *get_unit_list(void);
+const pcb_unit_t *get_unit_by_idx(int idx);
+int pcb_get_n_units(void);
+double pcb_coord_to_unit(const pcb_unit_t *, pcb_coord_t);
+double pcb_unit_to_factor(const pcb_unit_t * unit);
+pcb_coord_t pcb_unit_to_coord(const pcb_unit_t *, double);
+pcb_increments_t *pcb_get_increments_struct(const char *suffix);
+pcb_angle_t pcb_normalize_angle(pcb_angle_t a);
+
+void pcb_units_init(void);
+
+/* PCB/physical unit conversions */
+#define PCB_COORD_TO_MIL(n) ((n) / 25400.0)
+#define PCB_MIL_TO_COORD(n) ((n) * 25400.0)
+#define PCB_COORD_TO_MM(n) ((n) / 1000000.0)
+#define PCB_MM_TO_COORD(n) ((n) * 1000000.0)
+#define PCB_COORD_TO_INCH(n) (PCB_COORD_TO_MIL(n) / 1000.0)
+#define PCB_INCH_TO_COORD(n) (PCB_MIL_TO_COORD(n) * 1000.0)
+#define PCB_COORD_TO_DECIMIL(n) (PCB_COORD_TO_MIL(n) * 10.0)
+#define PCB_DECIMIL_TO_COORD(n) (PCB_MIL_TO_COORD(n) / 10.0)
+
+#define PCB_SWAP_ANGLE(a) (-(a))
+#define PCB_SWAP_DELTA(d) (-(d))
#endif
diff --git a/src/vtlibrary.h b/src/vtlibrary.h
index 8e6ea71..828c69b 100644
--- a/src/vtlibrary.h
+++ b/src/vtlibrary.h
@@ -1,22 +1,21 @@
#include <stdlib.h>
#include <string.h>
-#include "global_objs.h"
typedef enum {
LIB_INVALID,
LIB_DIR,
LIB_FOOTPRINT
-} library_type_t;
+} pcb_fplibrary_type_t;
typedef enum {
PCB_FP_INVALID,
PCB_FP_DIR, /* used temporarily during the mapping - a finalized tree wouldn't have this */
PCB_FP_FILE,
PCB_FP_PARAMETRIC
-} fp_type_t;
+} pcb_fptype_t;
-typedef struct library_s library_t;
+typedef struct pcb_fplibrary_s pcb_fplibrary_t;
/* Elem=library_t; init=none */
@@ -24,7 +23,7 @@ typedef struct library_s library_t;
#define GVT(x) vtlib_ ## x
/* Array elem type - see vt_t(7) */
-#define GVT_ELEM_TYPE library_t
+#define GVT_ELEM_TYPE pcb_fplibrary_t
/* Type that represents array lengths - see vt_t(7) */
#define GVT_SIZE_TYPE size_t
@@ -54,10 +53,10 @@ typedef struct library_s library_t;
#include <genvector/genvector_undef.h>
/* An element of a library: either a directory or a footprint */
-struct library_s {
+struct pcb_fplibrary_s {
char *name; /* visible name */
- library_type_t type;
- library_t *parent;
+ pcb_fplibrary_type_t type;
+ pcb_fplibrary_t *parent;
union {
struct { /* type == LIB_DIR */
@@ -66,7 +65,7 @@ struct library_s {
struct { /* type == LIB_FOOTPRINT */
char *loc_info;
void *backend_data;
- fp_type_t type;
+ pcb_fptype_t type;
void **tags; /* an array of void * tag IDs; last tag ID is NULL */
} fp;
} data;
diff --git a/src/vtonpoint.c b/src/vtonpoint.c
index fdff202..bb484b5 100644
--- a/src/vtonpoint.c
+++ b/src/vtonpoint.c
@@ -1,3 +1,6 @@
#define GVT_DONT_UNDEF
+
+#warning TODO: this should be replaced with pcb_obj_t
+
#include "vtonpoint.h"
#include <genvector/genvector_impl.c>
diff --git a/src/vtonpoint.h b/src/vtonpoint.h
index db9d352..4040054 100644
--- a/src/vtonpoint.h
+++ b/src/vtonpoint.h
@@ -1,14 +1,26 @@
+#ifndef PCB_VTOP_H
+#define PCB_VTOP_H
+
#include <stdlib.h>
#include <string.h>
-#include "global_objs.h"
+#include "global_typedefs.h"
+
+typedef struct pcb_onpoint_st {
+ int type;
+ union {
+ void *any;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ } obj;
+} pcb_onpoint_t;
-/* Elem=OnpointType; init=none */
+/* Elem=pcb_onpoint_t; init=none */
/* all public symbols are wrapped in GVT() - see vt_t(7) */
#define GVT(x) vtop_ ## x
/* Array elem type - see vt_t(7) */
-#define GVT_ELEM_TYPE OnpointType
+#define GVT_ELEM_TYPE pcb_onpoint_t
/* Type that represents array lengths - see vt_t(7) */
#define GVT_SIZE_TYPE size_t
@@ -62,3 +74,5 @@
/* clean up #defines */
#include <genvector/genvector_undef.h>
+
+#endif
diff --git a/src/vtptr.h b/src/vtptr.h
index a940a8b..671067a 100644
--- a/src/vtptr.h
+++ b/src/vtptr.h
@@ -1,8 +1,7 @@
#include <stdlib.h>
#include <string.h>
-#include "global_objs.h"
-typedef void *ptr_t;
+typedef void *pcb_ptr_t;
/* Elem=void *; init=none */
@@ -10,7 +9,7 @@ typedef void *ptr_t;
#define GVT(x) vtptr_ ## x
/* Array elem type - see vt_t(7) */
-#define GVT_ELEM_TYPE ptr_t
+#define GVT_ELEM_TYPE pcb_ptr_t
/* Type that represents array lengths - see vt_t(7) */
#define GVT_SIZE_TYPE size_t
diff --git a/src/vtroutestyle.h b/src/vtroutestyle.h
index 0dcaeb6..e9f8e48 100644
--- a/src/vtroutestyle.h
+++ b/src/vtroutestyle.h
@@ -1,24 +1,27 @@
+#ifndef PCB_VTROUTESTYLE_H
+#define PCB_VTROUTESTYLE_H
#include <stdlib.h>
#include <string.h>
#include "unit.h"
+#include "attrib.h"
/* Elem=RouteStyle; init=0 */
typedef struct {
- Coord Thick, /* line thickness */
+ pcb_coord_t Thick, /* line thickness */
Diameter, /* via diameter */
Hole, /* via drill hole */
Clearance; /* min. separation from other nets */
char name[32]; /* fixed length name to save malloc/free */
-/* int index;*/
-} RouteStyleType, *RouteStyleTypePtr;
+ pcb_attribute_list_t attr;
+} pcb_route_style_t;
/* all public symbols are wrapped in GVT() - see vt_t(7) */
#define GVT(x) vtroutestyle_ ## x
#define HAVE_VTROUTESTYLE_T
/* Array elem type - see vt_t(7) */
-#define GVT_ELEM_TYPE RouteStyleType
+#define GVT_ELEM_TYPE pcb_route_style_t
/* Type that represents array lengths - see vt_t(7) */
#define GVT_SIZE_TYPE size_t
@@ -72,3 +75,5 @@ typedef struct {
/* clean up #defines */
#include <genvector/genvector_undef.h>
+
+#endif
diff --git a/src_3rd/liblhtpers/lhtpers.c b/src_3rd/liblhtpers/lhtpers.c
index 088df91..5ba5948 100644
--- a/src_3rd/liblhtpers/lhtpers.c
+++ b/src_3rd/liblhtpers/lhtpers.c
@@ -142,7 +142,7 @@ typedef struct {
typedef struct lht_pers_s {
unsigned finished:1;
unsigned error:1;
-
+
lht_perstyle_t *curr;
FILE *outf;
const lhtpers_ev_t *events;
@@ -576,7 +576,7 @@ static void pers_event(lht_parse_t *ctx, lht_event_t ev, lht_node_type_t nt, con
{
char *end;
end = sp->text_data + strlen(sp->text_data) - 1;
-
+
while((end >= sp->text_data) && ((*end == ' ') || (*end == '\t'))) {
pb_insert(&sp->buff[LHT_LOC_VAL_POST], *end);
*end = '\0';
diff --git a/src_3rd/liblhtpers/output.c b/src_3rd/liblhtpers/output.c
index 6005d36..088d0b6 100644
--- a/src_3rd/liblhtpers/output.c
+++ b/src_3rd/liblhtpers/output.c
@@ -343,7 +343,7 @@ static void export_subtree_by_rule(lht_pers_t *p, const char *ind, lht_node_t *s
{
lht_perstyle_t sp, *isp;
int hash_order = 0;
-
+
if (rule == NULL) {
isp = p->events->output_default_style[subtree->type];
if (isp == NULL) {
diff --git a/src_3rd/liblhtpers/tests/roundtrip/test.sh b/src_3rd/liblhtpers/tests/roundtrip/test.sh
index 9632817..db49ec2 100755
--- a/src_3rd/liblhtpers/tests/roundtrip/test.sh
+++ b/src_3rd/liblhtpers/tests/roundtrip/test.sh
@@ -1,7 +1,7 @@
for lht in $*
do
../perstest $lht
- diff -u $lht $lht.out
+ diff -u $lht $lht.out
if test $? = 0
then
rm $lht.out
diff --git a/src_3rd/liblihata/dom.c b/src_3rd/liblihata/dom.c
index 3dbfd6f..f151c55 100644
--- a/src_3rd/liblihata/dom.c
+++ b/src_3rd/liblihata/dom.c
@@ -652,12 +652,15 @@ static int lht_dom_loc_move_(lht_doc_t *doc, lht_node_t *node)
if (doc != NULL) {
if (node->file_name != NULL) {
- local_name = htsp_get(doc->file_names, (char *)node->file_name);
- if (local_name == NULL) {
+ htsp_entry_t *ent;
+ ent = htsp_getentry(doc->file_names, (char *)node->file_name);
+ if (ent == NULL) {
local_name = lht_strdup(node->file_name);
htsp_set(doc->file_names, (char *)local_name, doc);
new_fn = 1;
}
+ else
+ local_name = ent->key;
node->file_name = local_name;
}
}
@@ -797,5 +800,5 @@ lht_node_t *lht_dom_duptree(lht_node_t *src)
break;
}
- return dst;
+ return dst;
}
diff --git a/src_3rd/liblihata/regression/dom_load.tts b/src_3rd/liblihata/regression/dom_load.tts
index 3a4bacb..e9b03b2 100644
--- a/src_3rd/liblihata/regression/dom_load.tts
+++ b/src_3rd/liblihata/regression/dom_load.tts
@@ -1,4 +1,4 @@
-dom_load D1
+dom_load D1
print_doc D1
echo -
dom_load D2 table.lht
diff --git a/src_3rd/liblihata/regression/quoting.lht b/src_3rd/liblihata/regression/quoting.lht
new file mode 100644
index 0000000..097c483
--- /dev/null
+++ b/src_3rd/liblihata/regression/quoting.lht
@@ -0,0 +1,12 @@
+li:root {
+ {te:te:brace} = foo
+ {TE:text node} = {this has TE: in name}
+ {te:text node} = {hello world}
+ {sy:sym link} = {hello world}
+ {li:list node} = {hello; world}
+ {ha:hash node} = {1=hello; 2=world}
+ {ta:table spc} = {
+ {a; b}
+ {1; 2}
+ }
+}
\ No newline at end of file
diff --git a/src_3rd/liblihata/regression/ta_ins_r2.tts b/src_3rd/liblihata/regression/ta_ins_r2.tts
index 78993c4..ce71bf1 100644
--- a/src_3rd/liblihata/regression/ta_ins_r2.tts
+++ b/src_3rd/liblihata/regression/ta_ins_r2.tts
@@ -1,7 +1,7 @@
# use table_ins_row to test lihata 'insert new row' functionality
# test cases:
# insert new row to table contains one row with parameter 0 and 1 (and row count) and 0
-# table contains two row with parameter 0 and 1 and row count
+# table contains two row with parameter 0 and 1 and row count
echo -----test 1-----
echo insert one row to table (parameter 0)
diff --git a/src_3rd/liblihata/test_tree.c b/src_3rd/liblihata/test_tree.c
index cbacdf5..2a848d5 100644
--- a/src_3rd/liblihata/test_tree.c
+++ b/src_3rd/liblihata/test_tree.c
@@ -817,7 +817,6 @@ void cmd_tree_del(char *args)
void cmd_tree_dup(char *args)
{
lht_node_t **dst, **src;
- lht_err_t err;
dst = shift_node(&args);
if (dst == NULL) {
diff --git a/src_3rd/liblihata/tree.h b/src_3rd/liblihata/tree.h
index dfcb180..3c9f578 100644
--- a/src_3rd/liblihata/tree.h
+++ b/src_3rd/liblihata/tree.h
@@ -22,7 +22,7 @@ lht_err_t lht_tree_detach(lht_node_t *node);
/* Detach the node from under its parent; the node is left floating:
not being part of any document. Put (already detached) newn
in the same place in parent - this means:
- - same place in list (order will not change)
+ - same place in list (order will not change)
- same row:col in table
- in hash node will be detached and newn will be added (there's no order in hash)
*/
diff --git a/src_3rd/qparse/qparse.c b/src_3rd/qparse/qparse.c
index c0d9895..4466226 100644
--- a/src_3rd/qparse/qparse.c
+++ b/src_3rd/qparse/qparse.c
@@ -19,10 +19,11 @@
#include <stdlib.h>
#include <string.h>
+#include "qparse.h"
typedef enum qp_state_e {
qp_normal,
- qp_dquote,
+ qp_dquote
} qp_state_t;
#define qpush(chr) \
@@ -56,7 +57,7 @@ typedef enum qp_state_e {
argv = realloc(argv, sizeof(char *) * allocated); \
} \
buff[buff_used] = '\0'; \
- argv[argc] = strdup(buff); \
+ argv[argc] = qparse_strdup(buff); \
argc++; \
*buff = '\0'; \
buff_used = 0; \
@@ -140,3 +141,12 @@ void qparse_free(int argc, char **argv_ret[])
free(*argv_ret);
*argv_ret = NULL;
}
+
+char *qparse_strdup(const char *s)
+{
+ int l = strlen(s);
+ char *o;
+ o = malloc(l+1);
+ memcpy(o, s, l+1);
+ return o;
+}
diff --git a/src_3rd/qparse/qparse.h b/src_3rd/qparse/qparse.h
index 21e65e3..d5f830e 100644
--- a/src_3rd/qparse/qparse.h
+++ b/src_3rd/qparse/qparse.h
@@ -7,3 +7,5 @@ int qparse(const char *input, char **argv_ret[]);
/* Free an argv_ret array allocated by qparse. */
void qparse_free(int argc, char **argv_ret[]);
+/* for C89 - that doesn't have strdup()*/
+char *qparse_strdup(const char *s);
diff --git a/src_plugins/Buildin.tmpasm b/src_plugins/Buildin.tmpasm
index 7002ad2..f820e5e 100644
--- a/src_plugins/Buildin.tmpasm
+++ b/src_plugins/Buildin.tmpasm
@@ -9,7 +9,7 @@ append /local/pcb/buildin_init_extern [@extern pcb_uninit_t hid_@/local/pcb/m
append /local/pcb/buildin_init_code [@
uninit_func = hid_@/local/pcb/mod at _init();
- plugin_register("@/local/pcb/mod@", "<@/local/pcb/mod@>", NULL, 0, uninit_func);
+ pcb_plugin_register("@/local/pcb/mod@", "<@/local/pcb/mod@>", NULL, 0, uninit_func);
@] {\n}
append /local/pcb/OBJS ?/local/pcb/mod/OBJS
diff --git a/src_plugins/Common_enabled.tmpasm b/src_plugins/Common_enabled.tmpasm
index 25f4d15..be8dbe4 100644
--- a/src_plugins/Common_enabled.tmpasm
+++ b/src_plugins/Common_enabled.tmpasm
@@ -64,6 +64,7 @@ switch /local/pcb/mod/CONF
put /local/pcb/mod/CONFOUT /local/pcb/mod/CONF
sub {/local/pcb/mod/CONFOUT} {.h$} {_fields.h}
append /local/pcb/CLEANFILES /local/pcb/mod/CONFOUT
+ append /local/pcb/CLEANFILES ?/local/pcb/mod/CLEANFILES
append /local/pcb/RULES [@
# conf generation for @/local/pcb/mod@ '@/local/pcb/mod/CONF@'
@/local/pcb/mod/CONFOUT@: @/local/pcb/mod/CONF@
@@ -102,6 +103,8 @@ switch ?/local/pcb/mod/SPHASH
@/local/bn at _sphash.c @/local/bn at _sphash.h: $(SPHASH) @/local/n@
$(SPHASH) @/local/aux@ --prefix @/local/pcb/mod at _@/local/pr@ --out @/local/bn at _sphash < @/local/n@
@]
+ append /local/pcb/CLEANFILES [@@/local/bn at _sphash.c@]
+ append /local/pcb/CLEANFILES [@@/local/bn at _sphash.h@]
end
end
end
diff --git a/src_plugins/Plugin.tmpasm b/src_plugins/Plugin.tmpasm
index f1be523..cd5fd39 100644
--- a/src_plugins/Plugin.tmpasm
+++ b/src_plugins/Plugin.tmpasm
@@ -22,7 +22,7 @@ append /local/pcb/all [@ $(PLUGIDIR)/@/local/pcb/mod at .so @]
append /local/pcb/rules/install_ [@
$(CPC) "`pwd`/$(PLUGDIR)/@/local/pcb/mod@/@/local/pcb/mod at .so" "$(LIBDIR)/plugins/@/local/pcb/mod at .so"@]
-append /local/pcb/CLEANFILES [@ $(PLUGDIR)/@/local/pcb/mod@/@/local/pcb/mod at .so @/local/pcb/mod/OBJS@ @/local/pcb/mod/OBJS_C99@ @]
+append /local/pcb/CLEANFILES [@ $(PLUGDIR)/@/local/pcb/mod@/@/local/pcb/mod at .so $(PLUGIDIR)/@/local/pcb/mod at .so @/local/pcb/mod/OBJS@ @/local/pcb/mod/OBJS_C99@ @]
append /local/pcb/RULES [@
diff --git a/src_plugins/acompnet/Makefile b/src_plugins/acompnet/Makefile
new file mode 100644
index 0000000..4221eca
--- /dev/null
+++ b/src_plugins/acompnet/Makefile
@@ -0,0 +1,5 @@
+all:
+ cd ../../src && $(MAKE) mod_acompnet
+
+clean:
+ rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/acompnet/Plug.tmpasm b/src_plugins/acompnet/Plug.tmpasm
new file mode 100644
index 0000000..9c4abfb
--- /dev/null
+++ b/src_plugins/acompnet/Plug.tmpasm
@@ -0,0 +1,8 @@
+put /local/pcb/mod {acompnet}
+put /local/pcb/mod/OBJS [@ $(PLUGDIR)/acompnet/acompnet.o @]
+
+switch /local/pcb/acompnet/controls
+ case {buildin} include /local/pcb/tmpasm/buildin; end;
+ case {plugin} include /local/pcb/tmpasm/plugin; end;
+ case {disable} include /local/pcb/tmpasm/disable; end;
+end
diff --git a/src_plugins/acompnet/README b/src_plugins/acompnet/README
new file mode 100644
index 0000000..9982317
--- /dev/null
+++ b/src_plugins/acompnet/README
@@ -0,0 +1,5 @@
+Auto-complete the current network. A very limited autorouter/assistant.
+
+#state: WIP
+#default: disable
+#implements: (feature)
diff --git a/src_plugins/acompnet/acompnet.c b/src_plugins/acompnet/acompnet.c
new file mode 100644
index 0000000..9c96390
--- /dev/null
+++ b/src_plugins/acompnet/acompnet.c
@@ -0,0 +1,118 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * This module, debug, was written and is Copyright (C) 2016 by Tibor Palinkas
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+#include "config.h"
+#include "board.h"
+#include "data.h"
+#include "layer.h"
+#include "layer_ui.h"
+/*#include "acompnet_conf.h"*/
+#include "action_helper.h"
+#include "hid_actions.h"
+#include "plugins.h"
+#include "conf.h"
+#include "conf_core.h"
+#include "compat_misc.h"
+#include "error.h"
+
+#include "obj_all.h"
+
+
+static pcb_layer_t *ly;
+
+pcb_flag_t flg_mesh_pt;
+static void acompnet_mesh_addpt(double x, double y, int score)
+{
+ x = pcb_round(x);
+ y = pcb_round(y);
+
+ pcb_line_new(ly, x, y, x, y, conf_core.design.line_thickness, PCB->Bloat, flg_mesh_pt);
+}
+
+static void acompnet_mesh()
+{
+ double sep = conf_core.design.line_thickness + PCB->Bloat;
+ int n;
+
+ PCB_LINE_LOOP(CURRENT) {
+ double len, vx, vy, x1, y1, x2, y2, nx, ny;
+ x1 = line->Point1.X;
+ x2 = line->Point2.X;
+ y1 = line->Point1.Y;
+ y2 = line->Point2.Y;
+ vx = x2 - x1;
+ vy = y2 - y1;
+ len = sqrt(vx*vx + vy*vy);
+ vx = vx/len;
+ vy = vy/len;
+ nx = vy;
+ ny = -vx;
+
+ for(n = 1; n <= 2; n++) {
+ acompnet_mesh_addpt(x1 - n*vx*sep, y1 - n*vy*sep, n-1);
+ acompnet_mesh_addpt(x1 - n*vx*sep + nx*sep, y1 - n*vy*sep + ny*sep, n);
+ acompnet_mesh_addpt(x1 - n*vx*sep - nx*sep, y1 - n*vy*sep - ny*sep, n);
+
+ acompnet_mesh_addpt(x2 + n*vx*sep, y2 + n*vy*sep, n-1);
+ acompnet_mesh_addpt(x2 + n*vx*sep + nx*sep, y2 + n*vy*sep + ny*sep, n);
+ acompnet_mesh_addpt(x2 + n*vx*sep - nx*sep, y2 + n*vy*sep - ny*sep, n);
+ }
+ }
+ PCB_END_LOOP;
+}
+
+
+static const char pcb_acts_acompnet[] = "acompnet()\n" ;
+static const char pcb_acth_acompnet[] = "Attempt to auto-complete the current network";
+
+static int pcb_act_acompnet(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ acompnet_mesh();
+ return 0;
+}
+
+pcb_hid_action_t acompnet_action_list[] = {
+ {"acompnet", 0, pcb_act_acompnet,
+ pcb_acth_acompnet, pcb_acts_acompnet},
+};
+
+static const char *acompnet_cookie = "acompnet plugin";
+
+PCB_REGISTER_ACTIONS(acompnet_action_list, acompnet_cookie)
+
+static void hid_acompnet_uninit(void)
+{
+ pcb_hid_remove_actions_by_cookie(acompnet_cookie);
+ pcb_uilayer_free_all_cookie(acompnet_cookie);
+}
+
+#include "dolists.h"
+pcb_uninit_t hid_acompnet_init(void)
+{
+ PCB_REGISTER_ACTIONS(acompnet_action_list, acompnet_cookie)
+ ly = pcb_uilayer_alloc(acompnet_cookie, "autocomp-net", "#c09920");
+
+ return hid_acompnet_uninit;
+}
diff --git a/src_plugins/autocrop/Makefile b/src_plugins/autocrop/Makefile
index a41e18e..60e9e38 100644
--- a/src_plugins/autocrop/Makefile
+++ b/src_plugins/autocrop/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_autocrop
+ cd ../../src && $(MAKE) mod_autocrop
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/autocrop/autocrop.c b/src_plugins/autocrop/autocrop.c
index 2cea1a1..138a16b 100644
--- a/src_plugins/autocrop/autocrop.c
+++ b/src_plugins/autocrop/autocrop.c
@@ -47,83 +47,82 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "move.h"
#include "draw.h"
-#include "set.h"
#include "polygon.h"
#include "plugins.h"
+#include "obj_all.h"
+#include "box.h"
#include "hid_actions.h"
-static void *MyMoveViaLowLevel(DataType * Data, PinType * Via, Coord dx, Coord dy)
+static void *MyMoveViaLowLevel(pcb_data_t * Data, pcb_pin_t * Via, pcb_coord_t dx, pcb_coord_t dy)
{
if (Data) {
- RestoreToPolygon(Data, PCB_TYPE_VIA, Via, Via);
- r_delete_entry(Data->via_tree, (BoxType *) Via);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_VIA, Via, Via);
+ pcb_r_delete_entry(Data->via_tree, (pcb_box_t *) Via);
}
- MOVE_VIA_LOWLEVEL(Via, dx, dy);
+ pcb_via_move(Via, dx, dy);
if (Data) {
- r_insert_entry(Data->via_tree, (BoxType *) Via, 0);
- ClearFromPolygon(Data, PCB_TYPE_VIA, Via, Via);
+ pcb_r_insert_entry(Data->via_tree, (pcb_box_t *) Via, 0);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_VIA, Via, Via);
}
return Via;
}
-static void *MyMoveLineLowLevel(DataType * Data, LayerType * Layer, LineType * Line, Coord dx, Coord dy)
+static void *MyMoveLineLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_line_t * Line, pcb_coord_t dx, pcb_coord_t dy)
{
if (Data) {
- RestoreToPolygon(Data, PCB_TYPE_LINE, Layer, Line);
- r_delete_entry(Layer->line_tree, (BoxType *) Line);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_LINE, Layer, Line);
+ pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line);
}
- MOVE_LINE_LOWLEVEL(Line, dx, dy);
+ pcb_line_move(Line, dx, dy);
if (Data) {
- r_insert_entry(Layer->line_tree, (BoxType *) Line, 0);
- ClearFromPolygon(Data, PCB_TYPE_LINE, Layer, Line);
+ pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_LINE, Layer, Line);
}
return Line;
}
-static void *MyMoveArcLowLevel(DataType * Data, LayerType * Layer, ArcType * Arc, Coord dx, Coord dy)
+static void *MyMoveArcLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_arc_t * Arc, pcb_coord_t dx, pcb_coord_t dy)
{
if (Data) {
- RestoreToPolygon(Data, PCB_TYPE_ARC, Layer, Arc);
- r_delete_entry(Layer->arc_tree, (BoxType *) Arc);
+ pcb_poly_restore_to_poly(Data, PCB_TYPE_ARC, Layer, Arc);
+ pcb_r_delete_entry(Layer->arc_tree, (pcb_box_t *) Arc);
}
- MOVE_ARC_LOWLEVEL(Arc, dx, dy);
+ pcb_arc_move(Arc, dx, dy);
if (Data) {
- r_insert_entry(Layer->arc_tree, (BoxType *) Arc, 0);
- ClearFromPolygon(Data, PCB_TYPE_ARC, Layer, Arc);
+ pcb_r_insert_entry(Layer->arc_tree, (pcb_box_t *) Arc, 0);
+ pcb_poly_clear_from_poly(Data, PCB_TYPE_ARC, Layer, Arc);
}
return Arc;
}
-static void *MyMovePolygonLowLevel(DataType * Data, LayerType * Layer, PolygonType * Polygon, Coord dx, Coord dy)
+static void *Mypcb_poly_move(pcb_data_t * Data, pcb_layer_t * Layer, pcb_polygon_t * Polygon, pcb_coord_t dx, pcb_coord_t dy)
{
if (Data) {
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
+ pcb_r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon);
}
/* move.c actually only moves points, note no Data/Layer args */
- MovePolygonLowLevel(Polygon, dx, dy);
+ pcb_poly_move(Polygon, dx, dy);
if (Data) {
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- InitClip(Data, Layer, Polygon);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
+ pcb_poly_init_clip(Data, Layer, Polygon);
}
return Polygon;
}
-static void *MyMoveTextLowLevel(LayerType * Layer, TextType * Text, Coord dx, Coord dy)
+static void *MyMoveTextLowLevel(pcb_layer_t * Layer, pcb_text_t * Text, pcb_coord_t dx, pcb_coord_t dy)
{
if (Layer)
- r_delete_entry(Layer->text_tree, (BoxType *) Text);
- MOVE_TEXT_LOWLEVEL(Text, dx, dy);
+ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text);
+ pcb_text_move(Text, dx, dy);
if (Layer)
- r_insert_entry(Layer->text_tree, (BoxType *) Text, 0);
+ pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0);
return Text;
}
@@ -135,57 +134,57 @@ static void *MyMoveTextLowLevel(LayerType * Layer, TextType * Text, Coord dx, Co
* element move re-clears the poly, followed by the polys moving and
* re-clearing everything again.
*/
-static void MoveAll(Coord dx, Coord dy)
+static void MoveAll(pcb_coord_t dx, pcb_coord_t dy)
{
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- MoveElementLowLevel(PCB->Data, element, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
+ pcb_element_move(PCB->Data, element, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
}
- END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
MyMoveViaLowLevel(PCB->Data, via, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_VIA, NULL, NULL, via, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_VIA, NULL, NULL, via, dx, dy);
}
- END_LOOP;
- ALLLINE_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_LINE_ALL_LOOP(PCB->Data);
{
MyMoveLineLowLevel(PCB->Data, layer, line, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_LINE, NULL, NULL, line, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_LINE, NULL, NULL, line, dx, dy);
}
- ENDALL_LOOP;
- ALLARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_ALL_LOOP(PCB->Data);
{
MyMoveArcLowLevel(PCB->Data, layer, arc, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_ARC, NULL, NULL, arc, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_ARC, NULL, NULL, arc, dx, dy);
}
- ENDALL_LOOP;
- ALLTEXT_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_TEXT_ALL_LOOP(PCB->Data);
{
MyMoveTextLowLevel(layer, text, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_TEXT, NULL, NULL, text, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_TEXT, NULL, NULL, text, dx, dy);
}
- ENDALL_LOOP;
- ALLPOLYGON_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_ALL_LOOP(PCB->Data);
{
/*
* XXX MovePolygonLowLevel does not mean "no gui" like
* XXX MoveElementLowLevel, it doesn't even handle layer
* XXX tree activity.
*/
- MyMovePolygonLowLevel(PCB->Data, layer, polygon, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_POLYGON, NULL, NULL, polygon, dx, dy);
+ Mypcb_poly_move(PCB->Data, layer, polygon, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_POLYGON, NULL, NULL, polygon, dx, dy);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
}
-static int autocrop(int argc, const char **argv, Coord x, Coord y)
+static int autocrop(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- Coord dx, dy, pad;
- BoxType *box;
+ pcb_coord_t dx, dy, pad;
+ pcb_box_t tmp, *box;
- box = GetDataBoundingBox(PCB->Data); /* handy! */
+ box = pcb_data_bbox(&tmp, PCB->Data); /* handy! */
if (!box || (box->X1 == box->X2 || box->Y1 == box->Y2)) {
/* board would become degenerate */
return 0;
@@ -220,28 +219,28 @@ static int autocrop(int argc, const char **argv, Coord x, Coord y)
PCB->MaxWidth = box->X2;
PCB->MaxHeight = box->Y2;
MoveAll(dx, dy);
- IncrementUndoSerialNumber();
- Redraw();
- SetChangedFlag(1);
+ pcb_undo_inc_serial();
+ pcb_redraw();
+ pcb_board_set_changed_flag(1);
return 0;
}
-static HID_Action autocrop_action_list[] = {
+static pcb_hid_action_t autocrop_action_list[] = {
{"autocrop", NULL, autocrop, NULL, NULL}
};
char *autocrop_cookie = "autocrop plugin";
-REGISTER_ACTIONS(autocrop_action_list, autocrop_cookie)
+PCB_REGISTER_ACTIONS(autocrop_action_list, autocrop_cookie)
static void hid_autocrop_uninit(void)
{
- hid_remove_actions_by_cookie(autocrop_cookie);
+ pcb_hid_remove_actions_by_cookie(autocrop_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_autocrop_init()
{
- REGISTER_ACTIONS(autocrop_action_list, autocrop_cookie);
+ PCB_REGISTER_ACTIONS(autocrop_action_list, autocrop_cookie);
return hid_autocrop_uninit;
}
diff --git a/src_plugins/autoplace/Makefile b/src_plugins/autoplace/Makefile
index dfcba41..f7c508f 100644
--- a/src_plugins/autoplace/Makefile
+++ b/src_plugins/autoplace/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_autoplace
+ cd ../../src && $(MAKE) mod_autoplace
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/autoplace/action.c b/src_plugins/autoplace/action.c
index 0f1e87d..d5f6b67 100644
--- a/src_plugins/autoplace/action.c
+++ b/src_plugins/autoplace/action.c
@@ -26,11 +26,12 @@
*/
#include "config.h"
-#include "global.h"
#include "autoplace.h"
#include "plugins.h"
-#include "set.h"
#include "hid_actions.h"
+#include "compat_nls.h"
+#include "board.h"
+#include "event.h"
static const char autoplace_syntax[] = "AutoPlaceSelected()";
@@ -43,34 +44,34 @@ connecting them are minimized. Note that you cannot undo this.
%end-doc */
-static int ActionAutoPlaceSelected(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_AutoPlaceSelected(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- hid_action("Busy");
- if (gui->confirm_dialog(_("Auto-placement can NOT be undone.\n" "Do you want to continue anyway?\n"), 0)) {
+ pcb_event(PCB_EVENT_BUSY, NULL);
+ if (pcb_gui->confirm_dialog(_("Auto-placement can NOT be undone.\n" "Do you want to continue anyway?\n"), 0)) {
if (AutoPlaceSelected())
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
return 0;
}
static const char *autoplace_cookie = "autoplace plugin";
-HID_Action autoplace_action_list[] = {
- {"AutoPlaceSelected", 0, ActionAutoPlaceSelected,
+pcb_hid_action_t autoplace_action_list[] = {
+ {"AutoPlaceSelected", 0, pcb_act_AutoPlaceSelected,
autoplace_help, autoplace_syntax}
,
};
-REGISTER_ACTIONS(autoplace_action_list, autoplace_cookie)
+PCB_REGISTER_ACTIONS(autoplace_action_list, autoplace_cookie)
static void hid_autoplace_uninit(void)
{
- hid_remove_actions_by_cookie(autoplace_cookie);
+ pcb_hid_remove_actions_by_cookie(autoplace_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_autoplace_init(void)
{
- REGISTER_ACTIONS(autoplace_action_list, autoplace_cookie)
+ PCB_REGISTER_ACTIONS(autoplace_action_list, autoplace_cookie)
return hid_autoplace_uninit;
}
diff --git a/src_plugins/autoplace/autoplace.c b/src_plugins/autoplace/autoplace.c
index 14086ed..66bc6a4 100644
--- a/src_plugins/autoplace/autoplace.c
+++ b/src_plugins/autoplace/autoplace.c
@@ -40,11 +40,11 @@
#include <memory.h>
#include <stdlib.h>
-#include "global.h"
-
+#include "board.h"
#include "autoplace.h"
#include "box.h"
#include "compat_misc.h"
+#include "compat_nls.h"
#include "data.h"
#include "draw.h"
#include "error.h"
@@ -52,13 +52,15 @@
#include "intersect.h"
#include "rtree.h"
#include "macro.h"
-#include "mirror.h"
-#include "misc.h"
#include "move.h"
-#include "mymem.h"
#include "rats.h"
#include "remove.h"
#include "rotate.h"
+#include "obj_pinvia.h"
+#include "obj_rat.h"
+#include "board.h"
+#include "vtptr.h"
+
#define EXPANDRECTXY(r1, x1, y1, x2, y2) { \
r1->X1=MIN(r1->X1, x1); r1->Y1=MIN(r1->Y1, y1); \
@@ -69,7 +71,7 @@
/* ---------------------------------------------------------------------------
* some local prototypes
*/
-static double ComputeCost(NetListTypePtr Nets, double T0, double T);
+static double ComputeCost(pcb_netlist_t *Nets, double T0, double T);
/* ---------------------------------------------------------------------------
* some local types
@@ -92,8 +94,8 @@ const struct {
double gamma; /* annealing schedule constant */
int good_ratio; /* ratio of moves to good moves for halting */
pcb_bool fast; /* ignore SMD/pin conflicts */
- Coord large_grid_size; /* snap perturbations to this grid when T is high */
- Coord small_grid_size; /* snap to this grid when T is small. */
+ pcb_coord_t large_grid_size; /* snap perturbations to this grid when T is high */
+ pcb_coord_t small_grid_size; /* snap to this grid when T is small. */
}
/* wire cost is manhattan distance (in mils), thus 1 inch = 1000 */ CostParameter =
{
@@ -115,18 +117,18 @@ const struct {
};
typedef struct {
- ElementTypePtr *element;
+ pcb_element_t **element;
pcb_cardinal_t elementN;
} ElementPtrListType;
enum ewhich { SHIFT, ROTATE, EXCHANGE };
typedef struct {
- ElementTypePtr element;
+ pcb_element_t *element;
enum ewhich which;
- Coord DX, DY; /* for shift */
+ pcb_coord_t DX, DY; /* for shift */
unsigned rotate; /* for rotate/flip */
- ElementTypePtr other; /* for exchange */
+ pcb_element_t *other; /* for exchange */
} PerturbationType;
/* ---------------------------------------------------------------------------
@@ -137,31 +139,31 @@ typedef struct {
* Update the X, Y and group position information stored in the NetList after
* elements have possibly been moved, rotated, flipped, etc.
*/
-static void UpdateXY(NetListTypePtr Nets)
+static void UpdateXY(pcb_netlist_t *Nets)
{
- pcb_cardinal_t SLayer, CLayer;
+ pcb_layergrp_id_t SLayer, CLayer;
pcb_cardinal_t i, j;
/* find layer groups of the component side and solder side */
- SLayer = GetLayerGroupNumberByNumber(solder_silk_layer);
- CLayer = GetLayerGroupNumberByNumber(component_silk_layer);
+ SLayer = pcb_layer_get_group(pcb_solder_silk_layer);
+ CLayer = pcb_layer_get_group(pcb_component_silk_layer);
/* update all nets */
for (i = 0; i < Nets->NetN; i++) {
for (j = 0; j < Nets->Net[i].ConnectionN; j++) {
- ConnectionTypePtr c = &(Nets->Net[i].Connection[j]);
+ pcb_connection_t *c = &(Nets->Net[i].Connection[j]);
switch (c->type) {
case PCB_TYPE_PAD:
- c->group = TEST_FLAG(PCB_FLAG_ONSOLDER, (ElementTypePtr) c->ptr1)
+ c->group = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (pcb_element_t *) c->ptr1)
? SLayer : CLayer;
- c->X = ((PadTypePtr) c->ptr2)->Point1.X;
- c->Y = ((PadTypePtr) c->ptr2)->Point1.Y;
+ c->X = ((pcb_pad_t *) c->ptr2)->Point1.X;
+ c->Y = ((pcb_pad_t *) c->ptr2)->Point1.Y;
break;
case PCB_TYPE_PIN:
c->group = SLayer; /* any layer will do */
- c->X = ((PinTypePtr) c->ptr2)->X;
- c->Y = ((PinTypePtr) c->ptr2)->Y;
+ c->X = ((pcb_pin_t *) c->ptr2)->X;
+ c->Y = ((pcb_pin_t *) c->ptr2)->Y;
break;
default:
- Message(PCB_MSG_DEFAULT, "Odd connection type encountered in " "UpdateXY");
+ pcb_message(PCB_MSG_ERROR, "Odd connection type encountered in " "UpdateXY");
break;
}
}
@@ -171,32 +173,33 @@ static void UpdateXY(NetListTypePtr Nets)
/* ---------------------------------------------------------------------------
* Create a list of selected elements.
*/
-static PointerListType collectSelectedElements()
+static vtptr_t collectSelectedElements()
{
- PointerListType list = { 0, 0, NULL };
- ELEMENT_LOOP(PCB->Data);
+ vtptr_t list;
+
+ vtptr_init(&list);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, element)) {
- ElementTypePtr *epp = (ElementTypePtr *) GetPointerMemory(&list);
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) {
+ pcb_element_t **epp = (pcb_element_t **)vtptr_alloc_append(&list, 1);
*epp = element;
}
}
- END_LOOP;
+ PCB_END_LOOP;
return list;
}
#if 0 /* only for debugging box lists */
-#include "create.h"
/* makes a line on the solder layer surrounding all boxes in blist */
-static void showboxes(BoxListTypePtr blist)
+static void showboxes(pcb_box_list_t *blist)
{
pcb_cardinal_t i;
- LayerTypePtr SLayer = &(PCB->Data->Layer[solder_silk_layer]);
+ pcb_layer_t *SLayer = &(PCB->Data->Layer[pcb_solder_silk_layer]);
for (i = 0; i < blist->BoxN; i++) {
- CreateNewLineOnLayer(SLayer, blist->Box[i].X1, blist->Box[i].Y1, blist->Box[i].X2, blist->Box[i].Y1, 1, 1, 0);
- CreateNewLineOnLayer(SLayer, blist->Box[i].X1, blist->Box[i].Y2, blist->Box[i].X2, blist->Box[i].Y2, 1, 1, 0);
- CreateNewLineOnLayer(SLayer, blist->Box[i].X1, blist->Box[i].Y1, blist->Box[i].X1, blist->Box[i].Y2, 1, 1, 0);
- CreateNewLineOnLayer(SLayer, blist->Box[i].X2, blist->Box[i].Y1, blist->Box[i].X2, blist->Box[i].Y2, 1, 1, 0);
+ pcb_line_new(SLayer, blist->Box[i].X1, blist->Box[i].Y1, blist->Box[i].X2, blist->Box[i].Y1, 1, 1, 0);
+ pcb_line_new(SLayer, blist->Box[i].X1, blist->Box[i].Y2, blist->Box[i].X2, blist->Box[i].Y2, 1, 1, 0);
+ pcb_line_new(SLayer, blist->Box[i].X1, blist->Box[i].Y1, blist->Box[i].X1, blist->Box[i].Y2, 1, 1, 0);
+ pcb_line_new(SLayer, blist->Box[i].X2, blist->Box[i].Y1, blist->Box[i].X2, blist->Box[i].Y2, 1, 1, 0);
}
}
#endif
@@ -208,21 +211,21 @@ static void showboxes(BoxListTypePtr blist)
*/
/*------ r_find_neighbor ------*/
struct r_neighbor_info {
- const BoxType *neighbor;
- BoxType trap;
- direction_t search_dir;
+ const pcb_box_t *neighbor;
+ pcb_box_t trap;
+ pcb_direction_t search_dir;
};
-#define ROTATEBOX(box) { Coord t;\
+#define ROTATEBOX(box) { pcb_coord_t t;\
t = (box).X1; (box).X1 = - (box).Y1; (box).Y1 = t;\
t = (box).X2; (box).X2 = - (box).Y2; (box).Y2 = t;\
t = (box).X1; (box).X1 = (box).X2; (box).X2 = t;\
}
/* helper methods for __r_find_neighbor */
-static r_dir_t __r_find_neighbor_reg_in_sea(const BoxType * region, void *cl)
+static pcb_r_dir_t __r_find_neighbor_reg_in_sea(const pcb_box_t * region, void *cl)
{
struct r_neighbor_info *ni = (struct r_neighbor_info *) cl;
- BoxType query = *region;
- ROTATEBOX_TO_NORTH(query, ni->search_dir);
+ pcb_box_t query = *region;
+ PCB_BOX_ROTATE_TO_NORTH(query, ni->search_dir);
/* ______________ __ trap.y1 __
* \ / |__| query rect.
* \__________/ __ trap.y2
@@ -230,16 +233,16 @@ static r_dir_t __r_find_neighbor_reg_in_sea(const BoxType * region, void *cl)
* trap.x1 trap.x2 sides at 45-degree angle
*/
if ((query.Y2 > ni->trap.Y1) && (query.Y1 < ni->trap.Y2) && (query.X2 + ni->trap.Y2 > ni->trap.X1 + query.Y1) && (query.X1 + query.Y1 < ni->trap.X2 + ni->trap.Y2))
- return R_DIR_FOUND_CONTINUE;
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t __r_find_neighbor_rect_in_reg(const BoxType * box, void *cl)
+static pcb_r_dir_t __r_find_neighbor_rect_in_reg(const pcb_box_t * box, void *cl)
{
struct r_neighbor_info *ni = (struct r_neighbor_info *) cl;
- BoxType query = *box;
+ pcb_box_t query = *box;
int r;
- ROTATEBOX_TO_NORTH(query, ni->search_dir);
+ PCB_BOX_ROTATE_TO_NORTH(query, ni->search_dir);
/* ______________ __ trap.y1 __
* \ / |__| query rect.
* \__________/ __ trap.y2
@@ -253,15 +256,15 @@ static r_dir_t __r_find_neighbor_rect_in_reg(const BoxType * box, void *cl)
ni->trap.Y1 = query.Y2;
ni->neighbor = box;
}
- return r ? R_DIR_FOUND_CONTINUE : R_DIR_NOT_FOUND;
+ return r ? PCB_R_DIR_FOUND_CONTINUE : PCB_R_DIR_NOT_FOUND;
}
/* main r_find_neighbor routine. Returns NULL if no neighbor in the
* requested direction. */
-static const BoxType *r_find_neighbor(rtree_t * rtree, const BoxType * box, direction_t search_direction)
+static const pcb_box_t *r_find_neighbor(pcb_rtree_t * rtree, const pcb_box_t * box, pcb_direction_t search_direction)
{
struct r_neighbor_info ni;
- BoxType bbox;
+ pcb_box_t bbox;
ni.neighbor = NULL;
ni.trap = *box;
@@ -271,13 +274,13 @@ static const BoxType *r_find_neighbor(rtree_t * rtree, const BoxType * box, dire
bbox.X2 = PCB->MaxWidth;
bbox.Y2 = PCB->MaxHeight;
/* rotate so that we can use the 'north' case for everything */
- ROTATEBOX_TO_NORTH(bbox, search_direction);
- ROTATEBOX_TO_NORTH(ni.trap, search_direction);
+ PCB_BOX_ROTATE_TO_NORTH(bbox, search_direction);
+ PCB_BOX_ROTATE_TO_NORTH(ni.trap, search_direction);
/* shift Y's such that trap contains full bounds of trapezoid */
ni.trap.Y2 = ni.trap.Y1;
ni.trap.Y1 = bbox.Y1;
/* do the search! */
- r_search(rtree, NULL, __r_find_neighbor_reg_in_sea, __r_find_neighbor_rect_in_reg, &ni, NULL);
+ pcb_r_search(rtree, NULL, __r_find_neighbor_reg_in_sea, __r_find_neighbor_rect_in_reg, &ni, NULL);
return ni.neighbor;
}
@@ -290,7 +293,7 @@ static const BoxType *r_find_neighbor(rtree_t * rtree, const BoxType * box, dire
* "Placement and Routing of Electronic Modules" edited by Michael Pecht
* Marcel Dekker, Inc. 1993. ISBN: 0-8247-8916-4 TK7868.P7.P57 1993
*/
-static double ComputeCost(NetListTypePtr Nets, double T0, double T)
+static double ComputeCost(pcb_netlist_t *Nets, double T0, double T)
{
double W = 0; /* wire cost */
double delta1 = 0; /* wire congestion penalty function */
@@ -299,12 +302,12 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
double delta4 = 0; /* alignment bonus */
double delta5 = 0; /* total area penalty */
pcb_cardinal_t i, j;
- Coord minx, maxx, miny, maxy;
+ pcb_coord_t minx, maxx, miny, maxy;
pcb_bool allpads, allsameside;
pcb_cardinal_t thegroup;
- BoxListType bounds = { 0, 0, NULL }; /* save bounding rectangles here */
- BoxListType solderside = { 0, 0, NULL }; /* solder side component bounds */
- BoxListType componentside = { 0, 0, NULL }; /* component side bounds */
+ pcb_box_list_t bounds = { 0, 0, NULL }; /* save bounding rectangles here */
+ pcb_box_list_t solderside = { 0, 0, NULL }; /* solder side component bounds */
+ pcb_box_list_t componentside = { 0, 0, NULL }; /* component side bounds */
/* make sure the NetList have the proper updated X and Y coords */
UpdateXY(Nets);
/* wire length term. approximated by half-perimeter of minimum
@@ -312,7 +315,7 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
* all-SMD nets by making the rectangle a cube and weighting
* the "layer height" of the net. */
for (i = 0; i < Nets->NetN; i++) {
- NetTypePtr n = &Nets->Net[i];
+ pcb_net_t *n = &Nets->Net[i];
if (n->ConnectionN < 2)
continue; /* no cost to go nowhere */
minx = maxx = n->Connection[0].X;
@@ -321,11 +324,11 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
allpads = (n->Connection[0].type == PCB_TYPE_PAD);
allsameside = pcb_true;
for (j = 1; j < n->ConnectionN; j++) {
- ConnectionTypePtr c = &(n->Connection[j]);
- MAKEMIN(minx, c->X);
- MAKEMAX(maxx, c->X);
- MAKEMIN(miny, c->Y);
- MAKEMAX(maxy, c->Y);
+ pcb_connection_t *c = &(n->Connection[j]);
+ PCB_MAKE_MIN(minx, c->X);
+ PCB_MAKE_MAX(maxx, c->X);
+ PCB_MAKE_MIN(miny, c->Y);
+ PCB_MAKE_MAX(maxy, c->Y);
if (c->type != PCB_TYPE_PAD)
allpads = pcb_false;
if (c->group != thegroup)
@@ -333,7 +336,7 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
}
/* save bounding rectangle */
{
- BoxTypePtr box = GetBoxMemory(&bounds);
+ pcb_box_t *box = pcb_box_new(&bounds);
box->X1 = minx;
box->Y1 = miny;
box->X2 = maxx;
@@ -345,24 +348,24 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
/* now compute penalty function Wc which is proportional to
* amount of overlap and congestion. */
/* delta1 is congestion penalty function */
- delta1 = CostParameter.congestion_penalty * sqrt(fabs(ComputeIntersectionArea(&bounds)));
+ delta1 = CostParameter.congestion_penalty * sqrt(fabs(pcb_intersect_box_box(&bounds)));
#if 0
- printf("Wire Congestion Area: %f\n", ComputeIntersectionArea(&bounds));
+ printf("Wire Congestion Area: %f\n", pcb_intersect_box_box(&bounds));
#endif
/* free bounding rectangles */
- FreeBoxListMemory(&bounds);
+ pcb_box_free(&bounds);
/* now collect module areas (bounding rect of pins/pads) */
/* two lists for solder side / component side. */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- BoxListTypePtr thisside;
- BoxListTypePtr otherside;
- BoxTypePtr box;
- BoxTypePtr lastbox = NULL;
- Coord thickness;
- Coord clearance;
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, element)) {
+ pcb_box_list_t *thisside;
+ pcb_box_list_t *otherside;
+ pcb_box_t *box;
+ pcb_box_t *lastbox = NULL;
+ pcb_coord_t thickness;
+ pcb_coord_t clearance;
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element)) {
thisside = &solderside;
otherside = &componentside;
}
@@ -370,25 +373,25 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
thisside = &componentside;
otherside = &solderside;
}
- box = GetBoxMemory(thisside);
+ box = pcb_box_new(thisside);
/* protect against elements with no pins/pads */
if (pinlist_length(&element->Pin) == 0 && padlist_length(&element->Pad) == 0)
continue;
/* initialize box so that it will take the dimensions of
* the first pin/pad */
- box->X1 = MAX_COORD;
- box->Y1 = MAX_COORD;
- box->X2 = -MAX_COORD;
- box->Y2 = -MAX_COORD;
- PIN_LOOP(element);
+ box->X1 = PCB_MAX_COORD;
+ box->Y1 = PCB_MAX_COORD;
+ box->X2 = -PCB_MAX_COORD;
+ box->Y2 = -PCB_MAX_COORD;
+ PCB_PIN_LOOP(element);
{
thickness = pin->Thickness / 2;
clearance = pin->Clearance * 2;
EXPANDRECTXY(box,
pin->X - (thickness + clearance),
pin->Y - (thickness + clearance), pin->X + (thickness + clearance), pin->Y + (thickness + clearance))}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
thickness = pad->Thickness / 2;
clearance = pad->Clearance * 2;
@@ -401,13 +404,13 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
clearance),
MAX(pad->Point1.X,
pad->Point2.X) + (thickness + clearance), MAX(pad->Point1.Y, pad->Point2.Y) + (thickness + clearance))}
- END_LOOP;
+ PCB_END_LOOP;
/* add a box for each pin to the "opposite side":
* surface mount components can't sit on top of pins */
if (!CostParameter.fast)
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- box = GetBoxMemory(otherside);
+ box = pcb_box_new(otherside);
thickness = pin->Thickness / 2;
clearance = pin->Clearance * 2;
/* we ignore clearance here */
@@ -431,43 +434,44 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
else
lastbox = box;
}
- END_LOOP;
+ PCB_END_LOOP;
/* assess out of bounds penalty */
if (element->VBox.X1 < 0 || element->VBox.Y1 < 0 || element->VBox.X2 > PCB->MaxWidth || element->VBox.Y2 > PCB->MaxHeight)
delta3 += CostParameter.out_of_bounds_penalty;
}
- END_LOOP;
+ PCB_END_LOOP;
/* compute intersection area of module areas box list */
- delta2 = sqrt(fabs(ComputeIntersectionArea(&solderside) +
- ComputeIntersectionArea(&componentside))) *
+ delta2 = sqrt(fabs(pcb_intersect_box_box(&solderside) +
+ pcb_intersect_box_box(&componentside))) *
(CostParameter.overlap_penalty_min + (1 - (T / T0)) * CostParameter.overlap_penalty_max);
#if 0
- printf("Module Overlap Area (solder): %f\n", ComputeIntersectionArea(&solderside));
- printf("Module Overlap Area (component): %f\n", ComputeIntersectionArea(&componentside));
+ printf("Module Overlap Area (solder): %f\n", pcb_intersect_box_box(&solderside));
+ printf("Module Overlap Area (component): %f\n", pcb_intersect_box_box(&componentside));
#endif
- FreeBoxListMemory(&solderside);
- FreeBoxListMemory(&componentside);
+ pcb_box_free(&solderside);
+ pcb_box_free(&componentside);
/* reward pin/pad x/y alignment */
/* score higher if pins/pads belong to same *type* of component */
/* XXX: subkey should be *distance* from thing aligned with, so that
* aligning to something far away isn't profitable */
{
/* create r tree */
- PointerListType seboxes = { 0, 0, NULL }
- , ceboxes = {
- 0, 0, NULL};
+ vtptr_t seboxes, ceboxes;
struct ebox {
- BoxType box;
- ElementTypePtr element;
+ pcb_box_t box;
+ pcb_element_t *element;
};
- direction_t dir[4] = { NORTH, EAST, SOUTH, WEST };
+ pcb_direction_t dir[4] = { PCB_NORTH, PCB_EAST, PCB_SOUTH, PCB_WEST };
struct ebox **boxpp, *boxp;
- rtree_t *rt_s, *rt_c;
+ pcb_rtree_t *rt_s, *rt_c;
int factor;
- ELEMENT_LOOP(PCB->Data);
+
+ vtptr_init(&seboxes);
+ vtptr_init(&ceboxes);
+
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- boxpp = (struct ebox **)
- GetPointerMemory(TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? &seboxes : &ceboxes);
+ boxpp = (struct ebox **) vtptr_alloc_append(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? &seboxes : &ceboxes, 1);
*boxpp = (struct ebox *) malloc(sizeof(**boxpp));
if (*boxpp == NULL) {
fprintf(stderr, "malloc() failed in ComputeCost\n");
@@ -477,24 +481,24 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
(*boxpp)->box = element->VBox;
(*boxpp)->element = element;
}
- END_LOOP;
- rt_s = r_create_tree((const BoxType **) seboxes.Ptr, seboxes.PtrN, 1);
- rt_c = r_create_tree((const BoxType **) ceboxes.Ptr, ceboxes.PtrN, 1);
- FreePointerListMemory(&seboxes);
- FreePointerListMemory(&ceboxes);
+ PCB_END_LOOP;
+ rt_s = pcb_r_create_tree((const pcb_box_t **) seboxes.array, vtptr_len(&seboxes), 1);
+ rt_c = pcb_r_create_tree((const pcb_box_t **) ceboxes.array, vtptr_len(&ceboxes), 1);
+ vtptr_uninit(&seboxes);
+ vtptr_uninit(&ceboxes);
/* now, for each element, find its neighbor on all four sides */
delta4 = 0;
for (i = 0; i < 4; i++)
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
boxp = (struct ebox *)
- r_find_neighbor(TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? rt_s : rt_c, &element->VBox, dir[i]);
+ r_find_neighbor(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? rt_s : rt_c, &element->VBox, dir[i]);
/* score bounding box alignments */
if (!boxp)
continue;
factor = 1;
if (element->Name[0].TextString &&
- boxp->element->Name[0].TextString && 0 == NSTRCMP(element->Name[0].TextString, boxp->element->Name[0].TextString)) {
+ boxp->element->Name[0].TextString && 0 == PCB_NSTRCMP(element->Name[0].TextString, boxp->element->Name[0].TextString)) {
delta4 += CostParameter.matching_neighbor_bonus;
factor++;
}
@@ -509,23 +513,23 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
element->VBox.Y2 == boxp->element->VBox.Y1 || element->VBox.Y2 == boxp->element->VBox.Y2)
delta4 += factor * CostParameter.aligned_neighbor_bonus;
}
- END_LOOP;
+ PCB_END_LOOP;
/* free k-d tree memory */
- r_destroy_tree(&rt_s);
- r_destroy_tree(&rt_c);
+ pcb_r_destroy_tree(&rt_s);
+ pcb_r_destroy_tree(&rt_c);
}
/* penalize total area used by this layout */
{
- Coord minX = MAX_COORD, minY = MAX_COORD;
- Coord maxX = -MAX_COORD, maxY = -MAX_COORD;
- ELEMENT_LOOP(PCB->Data);
+ pcb_coord_t minX = PCB_MAX_COORD, minY = PCB_MAX_COORD;
+ pcb_coord_t maxX = -PCB_MAX_COORD, maxY = -PCB_MAX_COORD;
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- MAKEMIN(minX, element->VBox.X1);
- MAKEMIN(minY, element->VBox.Y1);
- MAKEMAX(maxX, element->VBox.X2);
- MAKEMAX(maxY, element->VBox.Y2);
+ PCB_MAKE_MIN(minX, element->VBox.X1);
+ PCB_MAKE_MIN(minY, element->VBox.Y1);
+ PCB_MAKE_MAX(maxX, element->VBox.X2);
+ PCB_MAKE_MAX(maxY, element->VBox.Y2);
}
- END_LOOP;
+ PCB_END_LOOP;
if (minX < maxX && minY < maxY)
delta5 = CostParameter.overall_area_penalty * sqrt(PCB_COORD_TO_MIL(maxX - minX) * PCB_COORD_TO_MIL(maxY - minY));
}
@@ -546,16 +550,16 @@ static double ComputeCost(NetListTypePtr Nets, double T0, double T)
* (magnitude of shift decreases over time)
* -- Only perturb selected elements (need count/list of selected?) --
*/
-PerturbationType createPerturbation(PointerListTypePtr selected, double T)
+PerturbationType createPerturbation(vtptr_t *selected, double T)
{
PerturbationType pt = { 0 };
/* pick element to perturb */
- pt.element = (ElementTypePtr) selected->Ptr[pcb_rand() % selected->PtrN];
+ pt.element = (pcb_element_t *) selected->array[pcb_rand() % vtptr_len(selected)];
/* exchange, flip/rotate or shift? */
- switch (pcb_rand() % ((selected->PtrN > 1) ? 3 : 2)) {
+ switch (pcb_rand() % ((vtptr_len(selected) > 1) ? 3 : 2)) {
case 0:
{ /* shift! */
- Coord grid;
+ pcb_coord_t grid;
double scaleX = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->MaxWidth / 3);
double scaleY = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->MaxHeight / 3);
pt.which = SHIFT;
@@ -586,15 +590,15 @@ PerturbationType createPerturbation(PointerListTypePtr selected, double T)
case 2:
{ /* exchange! */
pt.which = EXCHANGE;
- pt.other = (ElementTypePtr)
- selected->Ptr[pcb_rand() % (selected->PtrN - 1)];
+ pt.other = (pcb_element_t *)
+ selected->array[pcb_rand() % (vtptr_len(selected) - 1)];
if (pt.other == pt.element)
- pt.other = (ElementTypePtr) selected->Ptr[selected->PtrN - 1];
+ pt.other = (pcb_element_t *) selected->array[vtptr_len(selected) - 1];
/* don't allow exchanging a solderside-side SMD component
* with a non-SMD component. */
if ((pinlist_length(&(pt.element->Pin)) != 0 /* non-SMD */ &&
- TEST_FLAG(PCB_FLAG_ONSOLDER, pt.other)) || (pinlist_length(&pt.other->Pin) != 0 /* non-SMD */ &&
- TEST_FLAG(PCB_FLAG_ONSOLDER, pt.element)))
+ PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pt.other)) || (pinlist_length(&pt.other->Pin) != 0 /* non-SMD */ &&
+ PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pt.element)))
return createPerturbation(selected, T);
break;
}
@@ -606,7 +610,7 @@ PerturbationType createPerturbation(PointerListTypePtr selected, double T)
void doPerturb(PerturbationType * pt, pcb_bool undo)
{
- Coord bbcx, bbcy;
+ pcb_coord_t bbcx, bbcy;
/* compute center of element bounding box */
bbcx = (pt->element->VBox.X1 + pt->element->VBox.X2) / 2;
bbcy = (pt->element->VBox.Y1 + pt->element->VBox.Y2) / 2;
@@ -614,12 +618,12 @@ void doPerturb(PerturbationType * pt, pcb_bool undo)
switch (pt->which) {
case SHIFT:
{
- Coord DX = pt->DX, DY = pt->DY;
+ pcb_coord_t DX = pt->DX, DY = pt->DY;
if (undo) {
DX = -DX;
DY = -DY;
}
- MoveElementLowLevel(PCB->Data, pt->element, DX, DY);
+ pcb_element_move(PCB->Data, pt->element, DX, DY);
return;
}
case ROTATE:
@@ -629,26 +633,26 @@ void doPerturb(PerturbationType * pt, pcb_bool undo)
b = (4 - b) & 3;
/* 0 - flip; 1-3, rotate. */
if (b)
- RotateElementLowLevel(PCB->Data, pt->element, bbcx, bbcy, b);
+ pcb_element_rotate90(PCB->Data, pt->element, bbcx, bbcy, b);
else {
- Coord y = pt->element->VBox.Y1;
- MirrorElementCoordinates(PCB->Data, pt->element, 0);
+ pcb_coord_t y = pt->element->VBox.Y1;
+ pcb_element_mirror(PCB->Data, pt->element, 0);
/* mirroring moves the element. move it back. */
- MoveElementLowLevel(PCB->Data, pt->element, 0, y - pt->element->VBox.Y1);
+ pcb_element_move(PCB->Data, pt->element, 0, y - pt->element->VBox.Y1);
}
return;
}
case EXCHANGE:
{
/* first exchange positions */
- Coord x1 = pt->element->VBox.X1;
- Coord y1 = pt->element->VBox.Y1;
- Coord x2 = pt->other->BoundingBox.X1;
- Coord y2 = pt->other->BoundingBox.Y1;
- MoveElementLowLevel(PCB->Data, pt->element, x2 - x1, y2 - y1);
- MoveElementLowLevel(PCB->Data, pt->other, x1 - x2, y1 - y2);
+ pcb_coord_t x1 = pt->element->VBox.X1;
+ pcb_coord_t y1 = pt->element->VBox.Y1;
+ pcb_coord_t x2 = pt->other->BoundingBox.X1;
+ pcb_coord_t y2 = pt->other->BoundingBox.Y1;
+ pcb_element_move(PCB->Data, pt->element, x2 - x1, y2 - y1);
+ pcb_element_move(PCB->Data, pt->other, x1 - x2, y1 - y2);
/* then flip both elements if they are on opposite sides */
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pt->element) != TEST_FLAG(PCB_FLAG_ONSOLDER, pt->other)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pt->element) != PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pt->other)) {
PerturbationType mypt;
mypt.element = pt->element;
mypt.which = ROTATE;
@@ -670,27 +674,29 @@ void doPerturb(PerturbationType * pt, pcb_bool undo)
*/
pcb_bool AutoPlaceSelected(void)
{
- NetListTypePtr Nets;
- PointerListType Selected = { 0, 0, NULL };
+ pcb_netlist_t *Nets;
+ vtptr_t Selected;
PerturbationType pt;
double C0, T0;
pcb_bool changed = pcb_false;
+ vtptr_init(&Selected);
+
/* (initial netlist processing copied from AddAllRats) */
/* the netlist library has the text form
* ProcNetlist fills in the Netlist
* structure the way the final routing
* is supposed to look
*/
- Nets = ProcNetlist(&(PCB->NetlistLib[NETLIST_EDITED]));
+ Nets = pcb_rat_proc_netlist(&(PCB->NetlistLib[PCB_NETLIST_EDITED]));
if (!Nets) {
- Message(PCB_MSG_DEFAULT, _("Can't add rat lines because no netlist is loaded.\n"));
+ pcb_message(PCB_MSG_ERROR, _("Can't add rat lines because no netlist is loaded.\n"));
goto done;
}
Selected = collectSelectedElements();
- if (Selected.PtrN == 0) {
- Message(PCB_MSG_DEFAULT, _("No elements selected to autoplace.\n"));
+ if (vtptr_len(&Selected) == 0) {
+ pcb_message(PCB_MSG_ERROR, _("No elements selected to autoplace.\n"));
goto done;
}
@@ -715,7 +721,7 @@ pcb_bool AutoPlaceSelected(void)
double T = T0;
long steps = 0;
int good_moves = 0, moves = 0;
- const int good_move_cutoff = CostParameter.m * Selected.PtrN;
+ const int good_move_cutoff = CostParameter.m * vtptr_len(&Selected);
const int move_cutoff = 2 * good_move_cutoff;
printf("Starting cost is %.0f\n", ComputeCost(Nets, T0, 5));
C0 = ComputeCost(Nets, T0, T);
@@ -754,10 +760,10 @@ pcb_bool AutoPlaceSelected(void)
}
done:
if (changed) {
- DeleteRats(pcb_false);
- AddAllRats(pcb_false, NULL);
- Redraw();
+ pcb_rats_destroy(pcb_false);
+ pcb_rat_add_all(pcb_false, NULL);
+ pcb_redraw();
}
- FreePointerListMemory(&Selected);
+ vtptr_uninit(&Selected);
return (changed);
}
diff --git a/src_plugins/autoplace/autoplace.h b/src_plugins/autoplace/autoplace.h
index 19b894f..fe80c75 100644
--- a/src_plugins/autoplace/autoplace.h
+++ b/src_plugins/autoplace/autoplace.h
@@ -33,7 +33,7 @@
#ifndef PCB_AUTOPLACE_H
#define PCB_AUTOPLACE_H
-#include "global.h"
+#include "global_typedefs.h"
pcb_bool AutoPlaceSelected(void);
diff --git a/src_plugins/autoroute/Makefile b/src_plugins/autoroute/Makefile
index 380ab39..e12353d 100644
--- a/src_plugins/autoroute/Makefile
+++ b/src_plugins/autoroute/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_autoroute
+ cd ../../src && $(MAKE) mod_autoroute
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/autoroute/action.c b/src_plugins/autoroute/action.c
index b5eccac..f1d9cd5 100644
--- a/src_plugins/autoroute/action.c
+++ b/src_plugins/autoroute/action.c
@@ -26,19 +26,18 @@
*/
#include "config.h"
-#include "global.h"
#include "autoroute.h"
#include "action_helper.h"
#include "plugins.h"
-#include "set.h"
#include "hid_actions.h"
+#include "event.h"
/* action routines for the autorouter
*/
-static const char autoroute_syntax[] = "AutoRoute(AllRats|SelectedRats)";
+static const char pcb_acts_AutoRoute[] = "AutoRoute(AllRats|SelectedRats)";
-static const char autoroute_help[] = "Auto-route some or all rat lines.";
+static const char pcb_acth_AutoRoute[] = "Auto-route some or all rat lines.";
/* %start-doc actions AutoRoute
@@ -63,18 +62,18 @@ responsive.
%end-doc */
-static int ActionAutoRoute(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_AutoRoute(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const char *function = ACTION_ARG(0);
- hid_action("Busy");
+ const char *function = PCB_ACTION_ARG(0);
+ pcb_event(PCB_EVENT_BUSY, NULL);
if (function) { /* one parameter */
if (strcmp(function, "AllRats") == 0) {
if (AutoRoute(pcb_false))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
else if ((strcmp(function, "SelectedRats") == 0) || (strcmp(function, "Selected") == 0)) {
if (AutoRoute(pcb_true))
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
}
}
return 0;
@@ -82,22 +81,22 @@ static int ActionAutoRoute(int argc, const char **argv, Coord x, Coord y)
static const char *autoroute_cookie = "autoroute plugin";
-HID_Action autoroute_action_list[] = {
- {"AutoRoute", 0, ActionAutoRoute,
- autoroute_help, autoroute_syntax}
+pcb_hid_action_t autoroute_action_list[] = {
+ {"AutoRoute", 0, pcb_act_AutoRoute,
+ pcb_acth_AutoRoute, pcb_acts_AutoRoute}
,
};
-REGISTER_ACTIONS(autoroute_action_list, autoroute_cookie)
+PCB_REGISTER_ACTIONS(autoroute_action_list, autoroute_cookie)
static void hid_autoroute_uninit(void)
{
- hid_remove_actions_by_cookie(autoroute_cookie);
+ pcb_hid_remove_actions_by_cookie(autoroute_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_autoroute_init(void)
{
- REGISTER_ACTIONS(autoroute_action_list, autoroute_cookie)
+ PCB_REGISTER_ACTIONS(autoroute_action_list, autoroute_cookie)
return hid_autoroute_uninit;
}
diff --git a/src_plugins/autoroute/autoroute.c b/src_plugins/autoroute/autoroute.c
index e7f7c54..9033ee9 100644
--- a/src_plugins/autoroute/autoroute.c
+++ b/src_plugins/autoroute/autoroute.c
@@ -53,8 +53,6 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
-
#include <assert.h>
#include <setjmp.h>
@@ -62,24 +60,27 @@
#include "macro.h"
#include "autoroute.h"
#include "box.h"
-#include "create.h"
#include "draw.h"
#include "error.h"
#include "find.h"
#include "heap.h"
#include "rtree.h"
-#include "misc.h"
#include "mtspace.h"
-#include "mymem.h"
#include "polygon.h"
#include "rats.h"
#include "remove.h"
-#include "thermal.h"
+#include "obj_pinvia_therm.h"
#include "undo.h"
#include "vector.h"
#include "pcb-printf.h"
-#include "set.h"
#include "layer.h"
+#include "compat_nls.h"
+#include "vtptr.h"
+#include "obj_all.h"
+
+#include "obj_line_draw.h"
+#include "obj_pinvia_draw.h"
+
/* #defines to enable some debugging output */
/*
@@ -97,43 +98,43 @@
//#define DEBUG_SHOW_ZIGZAG
*/
-static direction_t directionIncrement(direction_t dir)
+static pcb_direction_t directionIncrement(pcb_direction_t dir)
{
switch (dir) {
- case NORTH:
- dir = EAST;
+ case PCB_NORTH:
+ dir = PCB_EAST;
break;
- case EAST:
- dir = SOUTH;
+ case PCB_EAST:
+ dir = PCB_SOUTH;
break;
- case SOUTH:
- dir = WEST;
+ case PCB_SOUTH:
+ dir = PCB_WEST;
break;
- case WEST:
- dir = NE;
+ case PCB_WEST:
+ dir = PCB_NE;
break;
- case NE:
- dir = SE;
+ case PCB_NE:
+ dir = PCB_SE;
break;
- case SE:
- dir = SW;
+ case PCB_SE:
+ dir = PCB_SW;
break;
- case SW:
- dir = NW;
+ case PCB_SW:
+ dir = PCB_NW;
break;
- case NW:
- dir = ALL;
+ case PCB_NW:
+ dir = PCB_ANY_DIR;
break;
- case ALL:
- dir = NORTH;
+ case PCB_ANY_DIR:
+ dir = PCB_NORTH;
break;
}
return dir;
}
#ifdef ROUTE_DEBUG
-HID *ddraw = NULL;
-static hidGC ar_gc = 0;
+pcb_hid_t *ddraw = NULL;
+static pcb_hid_gc_t ar_gc = 0;
#endif
#define EXPENSIVE 3e28
@@ -174,20 +175,20 @@ static hidGC ar_gc = 0;
/* fail-fast: check subnet_processed flags */\
LIST_LOOP(net, same_net, p); \
assert(!p->flags.subnet_processed);\
- END_LOOP;\
+ PCB_END_LOOP;\
/* iterate through *distinct* subnets */\
LIST_LOOP(net, same_net, p); \
if (!p->flags.subnet_processed) {\
LIST_LOOP(p, same_subnet, _pp_);\
_pp_->flags.subnet_processed=1;\
- END_LOOP
+ PCB_END_LOOP
#define END_FOREACH(net, p) \
}; \
- END_LOOP;\
+ PCB_END_LOOP;\
/* reset subnet_processed flags */\
LIST_LOOP(net, same_net, p); \
p->flags.subnet_processed=0;\
- END_LOOP;\
+ PCB_END_LOOP;\
} while (0)
#define SWAP(t, f, s) do { t a=s; s=f; f=a; } while (0)
/* notes:
@@ -217,14 +218,14 @@ typedef struct routebox_list {
typedef enum etype { PAD, PIN, VIA, VIA_SHADOW, LINE, OTHER, EXPANSION_AREA, PLANE, THERMAL } etype;
typedef struct routebox {
- BoxType box, sbox;
+ pcb_box_t box, sbox;
union {
- PadTypePtr pad;
- PinTypePtr pin;
- PinTypePtr via;
+ pcb_pad_t *pad;
+ pcb_pin_t *pin;
+ pcb_pin_t *via;
struct routebox *via_shadow; /* points to the via in r-tree which
- * points to the PinType in the PCB. */
- LineTypePtr line;
+ * points to the pcb_pin_t in the PCB. */
+ pcb_line_t *line;
void *generic; /* 'other' is polygon, arc, text */
struct routebox *expansion_area; /* previous expansion area in search */
} parent;
@@ -270,8 +271,8 @@ typedef struct routebox {
unsigned is_thermal;
} flags;
/* indicate the direction an expansion box came from */
- cost_t cost;
- CheapPointType cost_point;
+ pcb_cost_t cost;
+ pcb_cheap_point_t cost_point;
/* reference count for homeless routeboxes; free when refcount==0 */
int refcount;
/* when routing with conflicts, we keep a record of what we're
@@ -279,46 +280,46 @@ typedef struct routebox {
*/
vector_t *conflicts_with;
/* route style of the net associated with this routebox */
- RouteStyleType *style;
+ pcb_route_style_t *style;
/* congestion values for the edges of an expansion box */
unsigned char n, e, s, w;
/* what pass this this track was laid down on */
unsigned char pass;
/* the direction this came from, if any */
- direction_t came_from;
+ pcb_direction_t came_from;
/* circular lists with connectivity information. */
routebox_list same_net, same_subnet, original_subnet, different_net;
union {
- PinType *via;
- LineType *line;
+ pcb_pin_t *via;
+ pcb_line_t *line;
} livedraw_obj;
} routebox_t;
typedef struct routedata {
int max_styles;
/* one rtree per layer *group */
- rtree_t *layergrouptree[MAX_LAYER]; /* no silkscreen layers here =) */
+ pcb_rtree_t *layergrouptree[PCB_MAX_LAYERGRP]; /* no silkscreen layers here =) */
/* root pointer into connectivity information */
routebox_t *first_net;
/* default routing style */
- RouteStyleType defaultstyle;
+ pcb_route_style_t defaultstyle;
/* style structures */
- RouteStyleType **styles; /* [max_styles+1] */
+ pcb_route_style_t **styles; /* [max_styles+1] */
/* what is the maximum bloat (clearance+line half-width or
* clearance+via_radius) for any style we've seen? */
- Coord max_bloat;
- Coord max_keep;
+ pcb_coord_t max_bloat;
+ pcb_coord_t max_keep;
mtspace_t *mtspace;
} routedata_t;
typedef struct edge_struct {
routebox_t *rb; /* path expansion edges are real routeboxen. */
- CheapPointType cost_point;
- cost_t cost_to_point; /* from source */
- cost_t cost; /* cached edge cost */
- routebox_t *mincost_target; /* minimum cost from cost_point to any target */
+ pcb_cheap_point_t cost_point;
+ pcb_cost_t pcb_cost_to_point; /* from source */
+ pcb_cost_t cost; /* cached edge cost */
+ routebox_t *minpcb_cost_target; /* minimum cost from cost_point to any target */
vetting_t *work; /* for via search edges */
- direction_t expand_dir;
+ pcb_direction_t expand_dir;
struct {
/* this indicates that this 'edge' is a via candidate. */
unsigned is_via:1;
@@ -336,11 +337,11 @@ typedef struct edge_struct {
static struct {
/* net style parameters */
- RouteStyleType *style;
+ pcb_route_style_t *style;
/* the present bloat */
- Coord bloat;
+ pcb_coord_t bloat;
/* cost parameters */
- cost_t ViaCost, /* additional "length" cost for using a via */
+ pcb_cost_t ViaCost, /* additional "length" cost for using a via */
LastConflictPenalty, /* length mult. for routing over last pass' trace */
ConflictPenalty, /* length multiplier for routing over another trace */
JogPenalty, /* additional "length" cost for changing direction */
@@ -365,28 +366,28 @@ static struct {
struct routeone_state {
/* heap of all candidate expansion edges */
- heap_t *workheap;
+ pcb_heap_t *workheap;
/* information about the best path found so far. */
routebox_t *best_path, *best_target;
- cost_t best_cost;
+ pcb_cost_t best_cost;
};
/* ---------------------------------------------------------------------------
* some local prototypes
*/
-static routebox_t *CreateExpansionArea(const BoxType * area, pcb_cardinal_t group,
+static routebox_t *CreateExpansionArea(const pcb_box_t * area, pcb_cardinal_t group,
routebox_t * parent, pcb_bool relax_edge_requirements, edge_t * edge);
-static cost_t edge_cost(const edge_t * e, const cost_t too_big);
+static pcb_cost_t edge_cost(const edge_t * e, const pcb_cost_t too_big);
static void best_path_candidate(struct routeone_state *s, edge_t * e, routebox_t * best_target);
-static BoxType edge_to_box(const routebox_t * rb, direction_t expand_dir);
+static pcb_box_t edge_to_box(const routebox_t * rb, pcb_direction_t expand_dir);
static void add_or_destroy_edge(struct routeone_state *s, edge_t * e);
static void
-RD_DrawThermal(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad);
+RD_DrawThermal(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad);
static void ResetSubnet(routebox_t * net);
#ifdef ROUTE_DEBUG
static int showboxen = -2;
@@ -398,10 +399,10 @@ static void showroutebox(routebox_t * rb);
* some local identifiers
*/
/* group number of groups that hold surface mount pads */
-static pcb_cardinal_t front, back;
-static pcb_bool usedGroup[MAX_LAYER];
-static int x_cost[MAX_LAYER], y_cost[MAX_LAYER];
-static pcb_bool is_layer_group_active[MAX_LAYER];
+static pcb_layergrp_id_t front, back;
+static pcb_bool usedGroup[PCB_MAX_LAYERGRP];
+static int x_cost[PCB_MAX_LAYERGRP], y_cost[PCB_MAX_LAYERGRP];
+static pcb_bool is_layer_group_active[PCB_MAX_LAYERGRP];
static int ro = 0;
static int smoothes = 1;
static int passes = 12;
@@ -411,9 +412,9 @@ static int total_via_count = 0;
/* assertion helper for routeboxen */
#ifndef NDEBUG
-static int __routebox_is_good(routebox_t * rb)
+static int __routepcb_box_is_good(routebox_t * rb)
{
- assert(rb && (rb->group < max_group) &&
+ assert(rb && (rb->group < pcb_max_group) &&
(rb->box.X1 <= rb->box.X2) && (rb->box.Y1 <= rb->box.Y2) &&
(rb->flags.homeless ?
(rb->box.X1 != rb->box.X2) || (rb->box.Y1 != rb->box.Y2) : (rb->box.X1 != rb->box.X2) && (rb->box.Y1 != rb->box.Y2)));
@@ -442,18 +443,18 @@ static int __routebox_is_good(routebox_t * rb)
static int __edge_is_good(edge_t * e)
{
- assert(e && e->rb && __routebox_is_good(e->rb));
+ assert(e && e->rb && __routepcb_box_is_good(e->rb));
assert((e->rb->flags.homeless ? e->rb->refcount > 0 : 1));
assert((0 <= e->expand_dir) && (e->expand_dir < 9)
- && (e->flags.is_interior ? (e->expand_dir == ALL && e->rb->conflicts_with) : 1));
+ && (e->flags.is_interior ? (e->expand_dir == PCB_ANY_DIR && e->rb->conflicts_with) : 1));
assert((e->flags.is_via ? e->rb->flags.is_via : 1)
&& (e->flags.via_conflict_level >= 0 && e->flags.via_conflict_level <= 2)
&& (e->flags.via_conflict_level != 0 ? e->flags.is_via : 1));
- assert((e->cost_to_point >= 0) && e->cost >= 0);
+ assert((e->pcb_cost_to_point >= 0) && e->cost >= 0);
return 1;
}
-int no_planes(const BoxType * b, void *cl)
+int no_planes(const pcb_box_t * b, void *cl)
{
routebox_t *rb = (routebox_t *) b;
if (rb->type == PLANE)
@@ -538,16 +539,16 @@ static void RemoveFromNet(routebox_t * a, enum boxlist which)
return;
}
-static void init_const_box(routebox_t * rb, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord clearance)
+static void init_const_box(routebox_t * rb, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t clearance)
{
- BoxType *bp = (BoxType *) & rb->box; /* note discarding const! */
+ pcb_box_t *bp = (pcb_box_t *) & rb->box; /* note discarding const! */
assert(!rb->flags.inited);
assert(X1 <= X2 && Y1 <= Y2);
bp->X1 = X1 - clearance;
bp->Y1 = Y1 - clearance;
bp->X2 = X2 + clearance;
bp->Y2 = Y2 + clearance;
- bp = (BoxType *) & rb->sbox;
+ bp = (pcb_box_t *) & rb->sbox;
bp->X1 = X1;
bp->Y1 = Y1;
bp->X2 = X2;
@@ -555,39 +556,39 @@ static void init_const_box(routebox_t * rb, Coord X1, Coord Y1, Coord X2, Coord
rb->flags.inited = 1;
}
-static inline BoxType shrink_routebox(const routebox_t * rb)
+static inline pcb_box_t shrink_routebox(const routebox_t * rb)
{
return rb->sbox;
}
-static inline cost_t box_area(const BoxType b)
+static inline pcb_cost_t box_area(const pcb_box_t b)
{
- cost_t ans = b.X2 - b.X1;
+ pcb_cost_t ans = b.X2 - b.X1;
return ans * (b.Y2 - b.Y1);
}
-static inline CheapPointType closest_point_in_routebox(const CheapPointType * from, const routebox_t * rb)
+static inline pcb_cheap_point_t closest_point_in_routebox(const pcb_cheap_point_t * from, const routebox_t * rb)
{
- return closest_point_in_box(from, &rb->sbox);
+ return pcb_closest_pcb_point_in_box(from, &rb->sbox);
}
-static inline pcb_bool point_in_shrunk_box(const routebox_t * box, Coord X, Coord Y)
+static inline pcb_bool point_in_shrunk_box(const routebox_t * box, pcb_coord_t X, pcb_coord_t Y)
{
- BoxType b = shrink_routebox(box);
- return point_in_box(&b, X, Y);
+ pcb_box_t b = shrink_routebox(box);
+ return pcb_point_in_box(&b, X, Y);
}
/*---------------------------------------------------------------------
* routedata initialization functions.
*/
-static routebox_t *AddPin(PointerListType layergroupboxes[], PinTypePtr pin, pcb_bool is_via, RouteStyleType * style)
+static routebox_t *AddPin(vtptr_t layergroupboxes[], pcb_pin_t *pin, pcb_bool is_via, pcb_route_style_t * style)
{
routebox_t **rbpp, *lastrb = NULL;
int i, ht;
/* a pin cuts through every layer group */
- for (i = 0; i < max_group; i++) {
- rbpp = (routebox_t **) GetPointerMemory(&layergroupboxes[i]);
+ for (i = 0; i < pcb_max_group; i++) {
+ rbpp = (routebox_t **)vtptr_alloc_append(&layergroupboxes[i], 1);
*rbpp = (routebox_t *) malloc(sizeof(**rbpp));
memset((void *) *rbpp, 0, sizeof(**rbpp));
(*rbpp)->group = i;
@@ -607,9 +608,9 @@ static routebox_t *AddPin(PointerListType layergroupboxes[], PinTypePtr pin, pcb
(*rbpp)->parent.pin = pin;
}
(*rbpp)->flags.fixed = 1;
- (*rbpp)->came_from = ALL;
+ (*rbpp)->came_from = PCB_ANY_DIR;
(*rbpp)->style = style;
- (*rbpp)->flags.circular = !TEST_FLAG(PCB_FLAG_SQUARE, pin);
+ (*rbpp)->flags.circular = !PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin);
/* circular lists */
InitLists(*rbpp);
/* link together */
@@ -623,14 +624,14 @@ static routebox_t *AddPin(PointerListType layergroupboxes[], PinTypePtr pin, pcb
return lastrb;
}
-static routebox_t *AddPad(PointerListType layergroupboxes[], ElementTypePtr element, PadTypePtr pad, RouteStyleType * style)
+static routebox_t *AddPad(vtptr_t layergroupboxes[], pcb_element_t *element, pcb_pad_t *pad, pcb_route_style_t * style)
{
- Coord halfthick;
+ pcb_coord_t halfthick;
routebox_t **rbpp;
- int layergroup = (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? back : front);
- assert(0 <= layergroup && layergroup < max_group);
+ int layergroup = (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? back : front);
+ assert(0 <= layergroup && layergroup < pcb_max_group);
assert(PCB->LayerGroups.Number[layergroup] > 0);
- rbpp = (routebox_t **) GetPointerMemory(&layergroupboxes[layergroup]);
+ rbpp = (routebox_t **) vtptr_alloc_append(&layergroupboxes[layergroup], 1);
assert(rbpp);
*rbpp = (routebox_t *) malloc(sizeof(**rbpp));
assert(*rbpp);
@@ -650,22 +651,22 @@ static routebox_t *AddPad(PointerListType layergroupboxes[], ElementTypePtr elem
(*rbpp)->type = PAD;
(*rbpp)->parent.pad = pad;
(*rbpp)->flags.fixed = 1;
- (*rbpp)->came_from = ALL;
+ (*rbpp)->came_from = PCB_ANY_DIR;
(*rbpp)->style = style;
/* circular lists */
InitLists(*rbpp);
return *rbpp;
}
-static routebox_t *AddLine(PointerListType layergroupboxes[], int layergroup, LineTypePtr line,
- LineTypePtr ptr, RouteStyleType * style)
+static routebox_t *AddLine(vtptr_t layergroupboxes[], int layergroup, pcb_line_t *line,
+ pcb_line_t *ptr, pcb_route_style_t * style)
{
routebox_t **rbpp;
assert(layergroupboxes && line);
- assert(0 <= layergroup && layergroup < max_group);
+ assert(0 <= layergroup && layergroup < pcb_max_group);
assert(PCB->LayerGroups.Number[layergroup] > 0);
- rbpp = (routebox_t **) GetPointerMemory(&layergroupboxes[layergroup]);
+ rbpp = (routebox_t **) vtptr_alloc_append(&layergroupboxes[layergroup], 1);
*rbpp = (routebox_t *) malloc(sizeof(**rbpp));
memset(*rbpp, 0, sizeof(**rbpp));
(*rbpp)->group = layergroup;
@@ -691,25 +692,25 @@ static routebox_t *AddLine(PointerListType layergroupboxes[], int layergroup, Li
(*rbpp)->type = LINE;
(*rbpp)->parent.line = ptr;
(*rbpp)->flags.fixed = 1;
- (*rbpp)->came_from = ALL;
+ (*rbpp)->came_from = PCB_ANY_DIR;
(*rbpp)->style = style;
/* circular lists */
InitLists(*rbpp);
return *rbpp;
}
-static routebox_t *AddIrregularObstacle(PointerListType layergroupboxes[],
- Coord X1, Coord Y1,
- Coord X2, Coord Y2, pcb_cardinal_t layergroup, void *parent, RouteStyleType * style)
+static routebox_t *AddIrregularObstacle(vtptr_t layergroupboxes[],
+ pcb_coord_t X1, pcb_coord_t Y1,
+ pcb_coord_t X2, pcb_coord_t Y2, pcb_cardinal_t layergroup, void *parent, pcb_route_style_t * style)
{
routebox_t **rbpp;
- Coord keep = style->Clearance;
+ pcb_coord_t keep = style->Clearance;
assert(layergroupboxes && parent);
assert(X1 <= X2 && Y1 <= Y2);
- assert(0 <= layergroup && layergroup < max_group);
+ assert(0 <= layergroup && layergroup < pcb_max_group);
assert(PCB->LayerGroups.Number[layergroup] > 0);
- rbpp = (routebox_t **) GetPointerMemory(&layergroupboxes[layergroup]);
+ rbpp = (routebox_t **) vtptr_alloc_append(&layergroupboxes[layergroup], 1);
*rbpp = (routebox_t *) malloc(sizeof(**rbpp));
memset(*rbpp, 0, sizeof(**rbpp));
(*rbpp)->group = layergroup;
@@ -724,12 +725,12 @@ static routebox_t *AddIrregularObstacle(PointerListType layergroupboxes[],
return *rbpp;
}
-static routebox_t *AddPolygon(PointerListType layergroupboxes[], pcb_cardinal_t layer, PolygonTypePtr polygon, RouteStyleType * style)
+static routebox_t *AddPolygon(vtptr_t layergroupboxes[], pcb_cardinal_t layer, pcb_polygon_t *polygon, pcb_route_style_t * style)
{
int is_not_rectangle = 1;
- int layergroup = GetLayerGroupNumberByNumber(layer);
+ pcb_layergrp_id_t layergroup = pcb_layer_get_group(layer);
routebox_t *rb;
- assert(0 <= layergroup && layergroup < max_group);
+ assert(0 <= layergroup && layergroup < pcb_max_group);
rb = AddIrregularObstacle(layergroupboxes,
polygon->BoundingBox.X1,
polygon->BoundingBox.Y1,
@@ -746,8 +747,8 @@ static routebox_t *AddPolygon(PointerListType layergroupboxes[], pcb_cardinal_t
is_not_rectangle = 0;
rb->flags.nonstraight = is_not_rectangle;
rb->layer = layer;
- rb->came_from = ALL;
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon)) {
+ rb->came_from = PCB_ANY_DIR;
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon)) {
rb->flags.clear_poly = 1;
if (!is_not_rectangle)
rb->type = PLANE;
@@ -755,14 +756,14 @@ static routebox_t *AddPolygon(PointerListType layergroupboxes[], pcb_cardinal_t
return rb;
}
-static void AddText(PointerListType layergroupboxes[], pcb_cardinal_t layergroup, TextTypePtr text, RouteStyleType * style)
+static void AddText(vtptr_t layergroupboxes[], pcb_cardinal_t layergroup, pcb_text_t *text, pcb_route_style_t * style)
{
AddIrregularObstacle(layergroupboxes,
text->BoundingBox.X1, text->BoundingBox.Y1,
text->BoundingBox.X2, text->BoundingBox.Y2, layergroup, text, style);
}
-static routebox_t *AddArc(PointerListType layergroupboxes[], pcb_cardinal_t layergroup, ArcTypePtr arc, RouteStyleType * style)
+static routebox_t *AddArc(vtptr_t layergroupboxes[], pcb_cardinal_t layergroup, pcb_arc_t *arc, pcb_route_style_t * style)
{
return AddIrregularObstacle(layergroupboxes,
arc->BoundingBox.X1, arc->BoundingBox.Y1,
@@ -770,36 +771,36 @@ static routebox_t *AddArc(PointerListType layergroupboxes[], pcb_cardinal_t laye
}
struct rb_info {
- BoxType query;
+ pcb_box_t query;
routebox_t *winner;
jmp_buf env;
};
-static r_dir_t __found_one_on_lg(const BoxType * box, void *cl)
+static pcb_r_dir_t __found_one_on_lg(const pcb_box_t * box, void *cl)
{
struct rb_info *inf = (struct rb_info *) cl;
routebox_t *rb = (routebox_t *) box;
- BoxType sb;
+ pcb_box_t sb;
if (rb->flags.nonstraight)
- return R_DIR_NOT_FOUND;
- sb = shrink_box(&rb->box, rb->style->Clearance);
+ return PCB_R_DIR_NOT_FOUND;
+ sb = pcb_shrink_box(&rb->box, rb->style->Clearance);
if (inf->query.X1 >= sb.X2 || inf->query.X2 <= sb.X1 || inf->query.Y1 >= sb.Y2 || inf->query.Y2 <= sb.Y1)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
inf->winner = rb;
if (rb->type == PLANE)
- return R_DIR_FOUND_CONTINUE; /* keep looking for something smaller if a plane was found */
+ return PCB_R_DIR_FOUND_CONTINUE; /* keep looking for something smaller if a plane was found */
longjmp(inf->env, 1);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static routebox_t *FindRouteBoxOnLayerGroup(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t layergroup)
+static routebox_t *FindRouteBoxOnLayerGroup(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_cardinal_t layergroup)
{
struct rb_info info;
info.winner = NULL;
- info.query = point_box(X, Y);
+ info.query = pcb_point_box(X, Y);
if (setjmp(info.env) == 0)
- r_search(rd->layergrouptree[layergroup], &info.query, NULL, __found_one_on_lg, &info, NULL);
+ pcb_r_search(rd->layergrouptree[layergroup], &info.query, NULL, __found_one_on_lg, &info, NULL);
return info.winner;
}
@@ -848,18 +849,18 @@ static void DumpRouteBox(routebox_t * rb)
static routedata_t *CreateRouteData()
{
- NetListListType Nets;
- PointerListType layergroupboxes[MAX_LAYER];
- BoxType bbox;
+ pcb_netlist_list_t Nets;
+ vtptr_t layergroupboxes[PCB_MAX_LAYERGRP];
+ pcb_box_t bbox;
routedata_t *rd;
int group, i;
/* check which layers are active first */
routing_layers = 0;
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
for (i = 0; i < PCB->LayerGroups.Number[group]; i++)
- /* layer must be 1) not silk (ie, < max_copper_layer) and 2) on */
- if ((PCB->LayerGroups.Entries[group][i] < max_copper_layer) && PCB->Data->Layer[PCB->LayerGroups.Entries[group][i]].On) {
+ /* layer must be 1) not silk (ie, < pcb_max_copper_layer) and 2) on */
+ if ((PCB->LayerGroups.Entries[group][i] < pcb_max_copper_layer) && PCB->Data->Layer[PCB->LayerGroups.Entries[group][i]].On) {
routing_layers++;
is_layer_group_active[group] = pcb_true;
break;
@@ -869,10 +870,10 @@ static routedata_t *CreateRouteData()
}
/* if via visibility is turned off, don't use them */
AutoRouteParameters.use_vias = routing_layers > 1 && PCB->ViaOn;
- front = GetLayerGroupNumberByNumber(component_silk_layer);
- back = GetLayerGroupNumberByNumber(solder_silk_layer);
+ front = pcb_layer_get_group(pcb_component_silk_layer);
+ back = pcb_layer_get_group(pcb_solder_silk_layer);
/* determine preferred routing direction on each group */
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
if (i != back && i != front) {
x_cost[i] = (i & 1) ? 2 : 1;
y_cost[i] = (i & 1) ? 1 : 2;
@@ -906,15 +907,13 @@ static routedata_t *CreateRouteData()
bbox.X2 = PCB->MaxWidth;
bbox.Y2 = PCB->MaxHeight;
for (i = 0; i < rd->max_styles + 1; i++) {
- RouteStyleType *style = (i < rd->max_styles) ? &PCB->RouteStyle.array[i] : &rd->defaultstyle;
+ pcb_route_style_t *style = (i < rd->max_styles) ? &PCB->RouteStyle.array[i] : &rd->defaultstyle;
rd->styles[i] = style;
}
- /* initialize pointerlisttype */
- for (i = 0; i < max_group; i++) {
- layergroupboxes[i].Ptr = NULL;
- layergroupboxes[i].PtrN = 0;
- layergroupboxes[i].PtrMax = 0;
+ /* initialize pointer vectors */
+ for (i = 0; i < pcb_max_group; i++) {
+ vtptr_init(&layergroupboxes[i]);
GROUP_LOOP(PCB->Data, i);
{
if (linelist_length(&layer->Line) || arclist_length(&layer->Arc))
@@ -922,7 +921,7 @@ static routedata_t *CreateRouteData()
else
usedGroup[i] = pcb_false;
}
- END_LOOP;
+ PCB_END_LOOP;
}
usedGroup[front] = pcb_true;
usedGroup[back] = pcb_true;
@@ -932,14 +931,14 @@ static routedata_t *CreateRouteData()
* this saves on searching the trees to find the nets
*/
/* use the PCB_FLAG_DRC to mark objects as they are entered */
- ResetConnections(pcb_false);
- Nets = CollectSubnets(pcb_false);
+ pcb_reset_conns(pcb_false);
+ Nets = pcb_rat_collect_subnets(pcb_false);
{
routebox_t *last_net = NULL;
- NETLIST_LOOP(&Nets);
+ PCB_NETLIST_LOOP(&Nets);
{
routebox_t *last_in_net = NULL;
- NET_LOOP(netlist);
+ PCB_NET_LOOP(netlist);
{
routebox_t *last_in_subnet = NULL;
int j;
@@ -947,12 +946,12 @@ static routedata_t *CreateRouteData()
for (j = 0; j < rd->max_styles; j++)
if (net->Style == rd->styles[j])
break;
- CONNECTION_LOOP(net);
+ PCB_CONNECTION_LOOP(net);
{
routebox_t *rb = NULL;
- SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) connection->ptr2);
+ PCB_FLAG_SET(PCB_FLAG_DRC, (pcb_pin_t *) connection->ptr2);
if (connection->type == PCB_TYPE_LINE) {
- LineType *line = (LineType *) connection->ptr2;
+ pcb_line_t *line = (pcb_line_t *) connection->ptr2;
/* lines are listed at each end, so skip one */
/* this should probably by a macro named "BUMP_LOOP" */
@@ -960,9 +959,9 @@ static routedata_t *CreateRouteData()
/* dice up non-straight lines into many tiny obstacles */
if (line->Point1.X != line->Point2.X && line->Point1.Y != line->Point2.Y) {
- LineType fake_line = *line;
- Coord dx = (line->Point2.X - line->Point1.X);
- Coord dy = (line->Point2.Y - line->Point1.Y);
+ pcb_line_t fake_line = *line;
+ pcb_coord_t dx = (line->Point2.X - line->Point1.X);
+ pcb_coord_t dy = (line->Point2.Y - line->Point1.Y);
int segs = MAX(PCB_ABS(dx),
PCB_ABS(dy)) / (4 * BLOAT(rd->styles[j]) + 1);
int qq;
@@ -992,19 +991,19 @@ static routedata_t *CreateRouteData()
else
switch (connection->type) {
case PCB_TYPE_PAD:
- rb = AddPad(layergroupboxes, (ElementType *) connection->ptr1, (PadType *) connection->ptr2, rd->styles[j]);
+ rb = AddPad(layergroupboxes, (pcb_element_t *) connection->ptr1, (pcb_pad_t *) connection->ptr2, rd->styles[j]);
break;
case PCB_TYPE_PIN:
- rb = AddPin(layergroupboxes, (PinType *) connection->ptr2, pcb_false, rd->styles[j]);
+ rb = AddPin(layergroupboxes, (pcb_pin_t *) connection->ptr2, pcb_false, rd->styles[j]);
break;
case PCB_TYPE_VIA:
- rb = AddPin(layergroupboxes, (PinType *) connection->ptr2, pcb_true, rd->styles[j]);
+ rb = AddPin(layergroupboxes, (pcb_pin_t *) connection->ptr2, pcb_true, rd->styles[j]);
break;
case PCB_TYPE_POLYGON:
rb =
AddPolygon(layergroupboxes,
- GetLayerNumber(PCB->Data, (LayerType *) connection->ptr1),
- (struct polygon_st *) connection->ptr2, rd->styles[j]);
+ pcb_layer_id(PCB->Data, (pcb_layer_t *) connection->ptr1),
+ (struct pcb_polygon_s *) connection->ptr2, rd->styles[j]);
break;
}
assert(rb);
@@ -1017,67 +1016,67 @@ static routedata_t *CreateRouteData()
rd->max_bloat = MAX(rd->max_bloat, BLOAT(rb->style));
rd->max_keep = MAX(rd->max_keep, rb->style->Clearance);
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
if (last_net && last_in_net)
MergeNets(last_net, last_in_net, DIFFERENT_NET);
last_net = last_in_net;
}
- END_LOOP;
+ PCB_END_LOOP;
rd->first_net = last_net;
}
- FreeNetListListMemory(&Nets);
+ pcb_netlist_list_free(&Nets);
/* reset all nets to "original" connectivity (which we just set) */
{
routebox_t *net;
LIST_LOOP(rd->first_net, different_net, net);
ResetSubnet(net);
- END_LOOP;
+ PCB_END_LOOP;
}
/* add pins and pads of elements */
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_DRC, pin))
- CLEAR_FLAG(PCB_FLAG_DRC, pin);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, pin))
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, pin);
else
AddPin(layergroupboxes, pin, pcb_false, rd->styles[rd->max_styles]);
}
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_DRC, pad))
- CLEAR_FLAG(PCB_FLAG_DRC, pad);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, pad))
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, pad);
else
AddPad(layergroupboxes, element, pad, rd->styles[rd->max_styles]);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* add all vias */
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_DRC, via))
- CLEAR_FLAG(PCB_FLAG_DRC, via);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, via))
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, via);
else
AddPin(layergroupboxes, via, pcb_true, rd->styles[rd->max_styles]);
}
- END_LOOP;
+ PCB_END_LOOP;
- for (i = 0; i < max_copper_layer; i++) {
- int layergroup = GetLayerGroupNumberByNumber(i);
+ for (i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layergrp_id_t layergroup = pcb_layer_get_group(i);
/* add all (non-rat) lines */
- LINE_LOOP(LAYER_PTR(i));
+ PCB_LINE_LOOP(LAYER_PTR(i));
{
- if (TEST_FLAG(PCB_FLAG_DRC, line)) {
- CLEAR_FLAG(PCB_FLAG_DRC, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, line)) {
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, line);
continue;
}
/* dice up non-straight lines into many tiny obstacles */
if (line->Point1.X != line->Point2.X && line->Point1.Y != line->Point2.Y) {
- LineType fake_line = *line;
- Coord dx = (line->Point2.X - line->Point1.X);
- Coord dy = (line->Point2.Y - line->Point1.Y);
+ pcb_line_t fake_line = *line;
+ pcb_coord_t dx = (line->Point2.X - line->Point1.X);
+ pcb_coord_t dy = (line->Point2.Y - line->Point1.Y);
int segs = MAX(PCB_ABS(dx), PCB_ABS(dy)) / (4 * rd->max_bloat + 1);
int qq;
segs = PCB_CLAMP(segs, 1, 32); /* don't go too crazy */
@@ -1098,34 +1097,34 @@ static routedata_t *CreateRouteData()
AddLine(layergroupboxes, layergroup, line, line, rd->styles[rd->max_styles]);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* add all polygons */
- POLYGON_LOOP(LAYER_PTR(i));
+ PCB_POLY_LOOP(LAYER_PTR(i));
{
- if (TEST_FLAG(PCB_FLAG_DRC, polygon))
- CLEAR_FLAG(PCB_FLAG_DRC, polygon);
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, polygon))
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, polygon);
else
AddPolygon(layergroupboxes, i, polygon, rd->styles[rd->max_styles]);
}
- END_LOOP;
+ PCB_END_LOOP;
/* add all copper text */
- TEXT_LOOP(LAYER_PTR(i));
+ PCB_TEXT_LOOP(LAYER_PTR(i));
{
AddText(layergroupboxes, layergroup, text, rd->styles[rd->max_styles]);
}
- END_LOOP;
+ PCB_END_LOOP;
/* add all arcs */
- ARC_LOOP(LAYER_PTR(i));
+ PCB_ARC_LOOP(LAYER_PTR(i));
{
AddArc(layergroupboxes, layergroup, arc, rd->styles[rd->max_styles]);
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* create r-trees from pointer lists */
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
/* create the r-tree */
- rd->layergrouptree[i] = r_create_tree((const BoxType **) layergroupboxes[i].Ptr, layergroupboxes[i].PtrN, 1);
+ rd->layergrouptree[i] = pcb_r_create_tree((const pcb_box_t **) layergroupboxes[i].array, vtptr_len(&layergroupboxes[i]), 1);
}
if (AutoRouteParameters.use_vias) {
@@ -1133,19 +1132,19 @@ static routedata_t *CreateRouteData()
/* create "empty-space" structures for via placement (now that we know
* appropriate clearances for all the fixed elements) */
- for (i = 0; i < max_group; i++) {
- POINTER_LOOP(&layergroupboxes[i]);
- {
+ for (i = 0; i < pcb_max_group; i++) {
+ int ip;
+ for(ip = 0; ip < vtptr_len(&layergroupboxes[i]); ip++) {
+ void **ptr = &layergroupboxes[i].array[ip];
routebox_t *rb = (routebox_t *) * ptr;
if (!rb->flags.clear_poly)
mtspace_add(rd->mtspace, &rb->box, FIXED, rb->style->Clearance);
}
- END_LOOP;
}
}
/* free pointer lists */
- for (i = 0; i < max_group; i++)
- FreePointerListMemory(&layergroupboxes[i]);
+ for (i = 0; i < pcb_max_group; i++)
+ vtptr_uninit(&layergroupboxes[i]);
/* done! */
return rd;
}
@@ -1153,8 +1152,8 @@ static routedata_t *CreateRouteData()
void DestroyRouteData(routedata_t ** rd)
{
int i;
- for (i = 0; i < max_group; i++)
- r_destroy_tree(&(*rd)->layergrouptree[i]);
+ for (i = 0; i < pcb_max_group; i++)
+ pcb_r_destroy_tree(&(*rd)->layergrouptree[i]);
if (AutoRouteParameters.use_vias)
mtspace_destroy(&(*rd)->mtspace);
/* free((*rd)->layergrouptree);*/
@@ -1198,12 +1197,12 @@ static void ResetSubnet(routebox_t * net)
/* reset connectivity of everything on this net */
LIST_LOOP(net, same_net, rb);
rb->same_subnet = rb->original_subnet;
- END_LOOP;
+ PCB_END_LOOP;
}
-static inline cost_t cost_to_point_on_layer(const CheapPointType * p1, const CheapPointType * p2, pcb_cardinal_t point_layer)
+static inline pcb_cost_t pcb_cost_to_point_on_layer(const pcb_cheap_point_t * p1, const pcb_cheap_point_t * p2, pcb_cardinal_t point_layer)
{
- cost_t x_dist = p1->X - p2->X, y_dist = p1->Y - p2->Y, r;
+ pcb_cost_t x_dist = p1->X - p2->X, y_dist = p1->Y - p2->Y, r;
x_dist *= x_cost[point_layer];
y_dist *= y_cost[point_layer];
/* cost is proportional to orthogonal distance. */
@@ -1213,9 +1212,9 @@ static inline cost_t cost_to_point_on_layer(const CheapPointType * p1, const Che
return r;
}
-static cost_t cost_to_point(const CheapPointType * p1, pcb_cardinal_t point_layer1, const CheapPointType * p2, pcb_cardinal_t point_layer2)
+static pcb_cost_t pcb_cost_to_point(const pcb_cheap_point_t * p1, pcb_cardinal_t point_layer1, const pcb_cheap_point_t * p2, pcb_cardinal_t point_layer2)
{
- cost_t r = cost_to_point_on_layer(p1, p2, point_layer1);
+ pcb_cost_t r = pcb_cost_to_point_on_layer(p1, p2, point_layer1);
/* apply via cost penalty if layers differ */
if (point_layer1 != point_layer2)
r += AutoRouteParameters.ViaCost;
@@ -1225,10 +1224,10 @@ static cost_t cost_to_point(const CheapPointType * p1, pcb_cardinal_t point_laye
/* return the minimum *cost* from a point to a box on any layer.
* It's safe to return a smaller than minimum cost
*/
-static cost_t cost_to_layerless_box(const CheapPointType * p, pcb_cardinal_t point_layer, const BoxType * b)
+static pcb_cost_t pcb_cost_to_layerless_box(const pcb_cheap_point_t * p, pcb_cardinal_t point_layer, const pcb_box_t * b)
{
- CheapPointType p2 = closest_point_in_box(p, b);
- register cost_t c1, c2;
+ pcb_cheap_point_t p2 = pcb_closest_pcb_point_in_box(p, b);
+ register pcb_cost_t c1, c2;
c1 = p2.X - p->X;
c2 = p2.Y - p->Y;
@@ -1242,7 +1241,7 @@ static cost_t cost_to_layerless_box(const CheapPointType * p, pcb_cardinal_t poi
}
/* get to actual pins/pad target coordinates */
-pcb_bool TargetPoint(CheapPointType * nextpoint, const routebox_t * target)
+pcb_bool TargetPoint(pcb_cheap_point_t * nextpoint, const routebox_t * target)
{
if (target->type == PIN) {
nextpoint->X = target->parent.pin->X;
@@ -1261,8 +1260,8 @@ pcb_bool TargetPoint(CheapPointType * nextpoint, const routebox_t * target)
return pcb_true;
}
else {
- nextpoint->X = CENTER_X(target->sbox);
- nextpoint->Y = CENTER_Y(target->sbox);
+ nextpoint->X = PCB_BOX_CENTER_X(target->sbox);
+ nextpoint->Y = PCB_BOX_CENTER_Y(target->sbox);
}
return pcb_false;
}
@@ -1271,16 +1270,16 @@ pcb_bool TargetPoint(CheapPointType * nextpoint, const routebox_t * target)
* via costs if the route box is on a different layer.
* assume routbox is bloated unless it is an expansion area
*/
-static cost_t cost_to_routebox(const CheapPointType * p, pcb_cardinal_t point_layer, const routebox_t * rb)
+static pcb_cost_t pcb_cost_to_routebox(const pcb_cheap_point_t * p, pcb_cardinal_t point_layer, const routebox_t * rb)
{
- register cost_t trial = 0;
- CheapPointType p2 = closest_point_in_routebox(p, rb);
+ register pcb_cost_t trial = 0;
+ pcb_cheap_point_t p2 = closest_point_in_routebox(p, rb);
if (!usedGroup[point_layer] || !usedGroup[rb->group])
trial = AutoRouteParameters.NewLayerPenalty;
if ((p2.X - p->X) * (p2.Y - p->Y) != 0)
trial += AutoRouteParameters.JogPenalty;
/* special case for defered via searching */
- if (point_layer > max_group || point_layer == rb->group)
+ if (point_layer > pcb_max_group || point_layer == rb->group)
return trial + PCB_ABS(p2.X - p->X) + PCB_ABS(p2.Y - p->Y);
/* if this target is only a via away, then the via is cheaper than the congestion */
if (p->X == p2.X && p->Y == p2.Y)
@@ -1291,11 +1290,11 @@ static cost_t cost_to_routebox(const CheapPointType * p, pcb_cardinal_t point_la
}
-static BoxType bloat_routebox(routebox_t * rb)
+static pcb_box_t bloat_routebox(routebox_t * rb)
{
- BoxType r;
- Coord clearance;
- assert(__routebox_is_good(rb));
+ pcb_box_t r;
+ pcb_coord_t clearance;
+ assert(__routepcb_box_is_good(rb));
if (rb->flags.nobloat)
return rb->sbox;
@@ -1304,7 +1303,7 @@ static BoxType bloat_routebox(routebox_t * rb)
* the two required clearances plus half the track width.
*/
clearance = MAX(AutoRouteParameters.style->Clearance, rb->style->Clearance);
- r = bloat_box(&rb->sbox, clearance + HALF_THICK(AutoRouteParameters.style->Thick));
+ r = pcb_bloat_box(&rb->sbox, clearance + HALF_THICK(AutoRouteParameters.style->Thick));
return r;
}
@@ -1313,10 +1312,10 @@ static BoxType bloat_routebox(routebox_t * rb)
typedef short pcb_dimension_t;
/* makes a line on the solder layer silk surrounding the box */
-static void showbox(BoxType b, pcb_dimension_t thickness, int group)
+static void showbox(pcb_box_t b, pcb_dimension_t thickness, int group)
{
- LineTypePtr line;
- LayerTypePtr SLayer = LAYER_PTR(group);
+ pcb_line_t *line;
+ pcb_layer_t *SLayer = LAYER_PTR(group);
if (showboxen < -1)
return;
if (showboxen != -1 && showboxen != group)
@@ -1336,17 +1335,17 @@ static void showbox(BoxType b, pcb_dimension_t thickness, int group)
#if 1
if (b.Y1 == b.Y2 || b.X1 == b.X2)
thickness = 5;
- line = CreateNewLineOnLayer(LAYER_PTR(component_silk_layer), b.X1, b.Y1, b.X2, b.Y1, thickness, 0, MakeFlags(0));
- AddObjectToCreateUndoList(PCB_TYPE_LINE, LAYER_PTR(component_silk_layer), line, line);
+ line = pcb_line_new(LAYER_PTR(pcb_component_silk_layer), b.X1, b.Y1, b.X2, b.Y1, thickness, 0, pcb_flag_make(0));
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, LAYER_PTR(pcb_component_silk_layer), line, line);
if (b.Y1 != b.Y2) {
- line = CreateNewLineOnLayer(LAYER_PTR(component_silk_layer), b.X1, b.Y2, b.X2, b.Y2, thickness, 0, MakeFlags(0));
- AddObjectToCreateUndoList(PCB_TYPE_LINE, LAYER_PTR(component_silk_layer), line, line);
+ line = pcb_line_new(LAYER_PTR(pcb_component_silk_layer), b.X1, b.Y2, b.X2, b.Y2, thickness, 0, pcb_flag_make(0));
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, LAYER_PTR(pcb_component_silk_layer), line, line);
}
- line = CreateNewLineOnLayer(LAYER_PTR(component_silk_layer), b.X1, b.Y1, b.X1, b.Y2, thickness, 0, MakeFlags(0));
- AddObjectToCreateUndoList(PCB_TYPE_LINE, LAYER_PTR(component_silk_layer), line, line);
+ line = pcb_line_new(LAYER_PTR(pcb_component_silk_layer), b.X1, b.Y1, b.X1, b.Y2, thickness, 0, pcb_flag_make(0));
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, LAYER_PTR(pcb_component_silk_layer), line, line);
if (b.X1 != b.X2) {
- line = CreateNewLineOnLayer(LAYER_PTR(component_silk_layer), b.X2, b.Y1, b.X2, b.Y2, thickness, 0, MakeFlags(0));
- AddObjectToCreateUndoList(PCB_TYPE_LINE, LAYER_PTR(component_silk_layer), line, line);
+ line = pcb_line_new(LAYER_PTR(pcb_component_silk_layer), b.X2, b.Y1, b.X2, b.Y2, thickness, 0, pcb_flag_make(0));
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, LAYER_PTR(pcb_component_silk_layer), line, line);
}
#endif
}
@@ -1355,7 +1354,7 @@ static void showbox(BoxType b, pcb_dimension_t thickness, int group)
#if defined(ROUTE_DEBUG)
static void showedge(edge_t * e)
{
- BoxType *b = (BoxType *) e->rb;
+ pcb_box_t *b = (pcb_box_t *) e->rb;
if (ddraw == NULL)
return;
@@ -1365,16 +1364,16 @@ static void showedge(edge_t * e)
ddraw->set_color(ar_gc, Settings.MaskColor);
switch (e->expand_dir) {
- case NORTH:
+ case PCB_NORTH:
ddraw->draw_line(ar_gc, b->X1, b->Y1, b->X2, b->Y1);
break;
- case SOUTH:
+ case PCB_SOUTH:
ddraw->draw_line(ar_gc, b->X1, b->Y2, b->X2, b->Y2);
break;
- case WEST:
+ case PCB_WEST:
ddraw->draw_line(ar_gc, b->X1, b->Y1, b->X1, b->Y2);
break;
- case EAST:
+ case PCB_EAST:
ddraw->draw_line(ar_gc, b->X2, b->Y1, b->X2, b->Y2);
break;
default:
@@ -1386,7 +1385,7 @@ static void showedge(edge_t * e)
#if defined(ROUTE_DEBUG)
static void showroutebox(routebox_t * rb)
{
- showbox(rb->sbox, rb->flags.source ? 20 : (rb->flags.target ? 10 : 1), rb->flags.is_via ? component_silk_layer : rb->group);
+ showbox(rb->sbox, rb->flags.source ? 20 : (rb->flags.target ? 10 : 1), rb->flags.is_via ? pcb_component_silk_layer : rb->group);
}
#endif
@@ -1444,7 +1443,7 @@ static void touch_conflicts(vector_t * conflicts, int touch)
LIST_LOOP(rb, same_net, p);
if (!p->flags.fixed)
p->flags.touched = touch;
- END_LOOP;
+ PCB_END_LOOP;
}
if (!touch) {
last = NULL;
@@ -1464,70 +1463,70 @@ static routebox_t *nonhomeless_parent(routebox_t * rb)
/* some routines to find the minimum *cost* from a cost point to
* a target (any target) */
-struct mincost_target_closure {
- const CheapPointType *CostPoint;
+struct minpcb_cost_target_closure {
+ const pcb_cheap_point_t *CostPoint;
pcb_cardinal_t CostPointLayer;
routebox_t *nearest;
- cost_t nearest_cost;
+ pcb_cost_t nearest_cost;
};
-static r_dir_t __region_within_guess(const BoxType * region, void *cl)
+static pcb_r_dir_t __region_within_guess(const pcb_box_t * region, void *cl)
{
- struct mincost_target_closure *mtc = (struct mincost_target_closure *) cl;
- cost_t cost_to_region;
+ struct minpcb_cost_target_closure *mtc = (struct minpcb_cost_target_closure *) cl;
+ pcb_cost_t pcb_cost_to_region;
if (mtc->nearest == NULL)
- return R_DIR_FOUND_CONTINUE;
- cost_to_region = cost_to_layerless_box(mtc->CostPoint, mtc->CostPointLayer, region);
- assert(cost_to_region >= 0);
+ return PCB_R_DIR_FOUND_CONTINUE;
+ pcb_cost_to_region = pcb_cost_to_layerless_box(mtc->CostPoint, mtc->CostPointLayer, region);
+ assert(pcb_cost_to_region >= 0);
/* if no guess yet, all regions are "close enough" */
/* note that cost is *strictly more* than minimum distance, so we'll
* always search a region large enough. */
- return (cost_to_region < mtc->nearest_cost) ? R_DIR_FOUND_CONTINUE : R_DIR_NOT_FOUND;
+ return (pcb_cost_to_region < mtc->nearest_cost) ? PCB_R_DIR_FOUND_CONTINUE : PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t __found_new_guess(const BoxType * box, void *cl)
+static pcb_r_dir_t __found_new_guess(const pcb_box_t * box, void *cl)
{
- struct mincost_target_closure *mtc = (struct mincost_target_closure *) cl;
+ struct minpcb_cost_target_closure *mtc = (struct minpcb_cost_target_closure *) cl;
routebox_t *guess = (routebox_t *) box;
- cost_t cost_to_guess = cost_to_routebox(mtc->CostPoint, mtc->CostPointLayer, guess);
- assert(cost_to_guess >= 0);
+ pcb_cost_t pcb_cost_to_guess = pcb_cost_to_routebox(mtc->CostPoint, mtc->CostPointLayer, guess);
+ assert(pcb_cost_to_guess >= 0);
/* if this is cheaper than previous guess... */
- if (cost_to_guess < mtc->nearest_cost) {
+ if (pcb_cost_to_guess < mtc->nearest_cost) {
mtc->nearest = guess;
- mtc->nearest_cost = cost_to_guess; /* this is our new guess! */
- return R_DIR_FOUND_CONTINUE;
+ mtc->nearest_cost = pcb_cost_to_guess; /* this is our new guess! */
+ return PCB_R_DIR_FOUND_CONTINUE;
}
else
- return R_DIR_NOT_FOUND; /* not less expensive than our last guess */
+ return PCB_R_DIR_NOT_FOUND; /* not less expensive than our last guess */
}
/* target_guess is our guess at what the nearest target is, or NULL if we
* just plum don't have a clue. */
-static routebox_t *mincost_target_to_point(const CheapPointType * CostPoint,
- pcb_cardinal_t CostPointLayer, rtree_t * targets, routebox_t * target_guess)
+static routebox_t *minpcb_cost_target_to_point(const pcb_cheap_point_t * CostPoint,
+ pcb_cardinal_t CostPointLayer, pcb_rtree_t * targets, routebox_t * target_guess)
{
- struct mincost_target_closure mtc;
+ struct minpcb_cost_target_closure mtc;
assert(target_guess == NULL || target_guess->flags.target); /* this is a target, right? */
mtc.CostPoint = CostPoint;
mtc.CostPointLayer = CostPointLayer;
mtc.nearest = target_guess;
if (mtc.nearest)
- mtc.nearest_cost = cost_to_routebox(mtc.CostPoint, mtc.CostPointLayer, mtc.nearest);
+ mtc.nearest_cost = pcb_cost_to_routebox(mtc.CostPoint, mtc.CostPointLayer, mtc.nearest);
else
mtc.nearest_cost = EXPENSIVE;
- r_search(targets, NULL, __region_within_guess, __found_new_guess, &mtc, NULL);
+ pcb_r_search(targets, NULL, __region_within_guess, __found_new_guess, &mtc, NULL);
assert(mtc.nearest != NULL && mtc.nearest_cost >= 0);
assert(mtc.nearest->flags.target); /* this is a target, right? */
return mtc.nearest;
}
/* create edge from field values */
-/* mincost_target_guess can be NULL */
+/* minpcb_cost_target_guess can be NULL */
static edge_t *CreateEdge(routebox_t * rb,
- Coord CostPointX, Coord CostPointY,
- cost_t cost_to_point, routebox_t * mincost_target_guess, direction_t expand_dir, rtree_t * targets)
+ pcb_coord_t CostPointX, pcb_coord_t CostPointY,
+ pcb_cost_t pcb_cost_to_point, routebox_t * minpcb_cost_target_guess, pcb_direction_t expand_dir, pcb_rtree_t * targets)
{
edge_t *e;
- assert(__routebox_is_good(rb));
+ assert(__routepcb_box_is_good(rb));
e = (edge_t *) malloc(sizeof(*e));
memset((void *) e, 0, sizeof(*e));
assert(e);
@@ -1536,25 +1535,25 @@ static edge_t *CreateEdge(routebox_t * rb,
RB_up_count(rb);
e->cost_point.X = CostPointX;
e->cost_point.Y = CostPointY;
- e->cost_to_point = cost_to_point;
+ e->pcb_cost_to_point = pcb_cost_to_point;
e->flags.via_search = 0;
/* if this edge is created in response to a target, use it */
if (targets)
- e->mincost_target = mincost_target_to_point(&e->cost_point, rb->group, targets, mincost_target_guess);
+ e->minpcb_cost_target = minpcb_cost_target_to_point(&e->cost_point, rb->group, targets, minpcb_cost_target_guess);
else
- e->mincost_target = mincost_target_guess;
+ e->minpcb_cost_target = minpcb_cost_target_guess;
e->expand_dir = expand_dir;
- assert(e->rb && e->mincost_target); /* valid edge? */
- assert(!e->flags.is_via || e->expand_dir == ALL);
+ assert(e->rb && e->minpcb_cost_target); /* valid edge? */
+ assert(!e->flags.is_via || e->expand_dir == PCB_ANY_DIR);
/* cost point should be on edge (unless this is a plane/via/conflict edge) */
#if 0
assert(rb->type == PLANE || rb->conflicts_with != NULL || rb->flags.is_via
|| rb->flags.is_thermal
- || ((expand_dir == NORTH || expand_dir == SOUTH) ? rb->sbox.X1 <=
- CostPointX && CostPointX < rb->sbox.X2 && CostPointY == (expand_dir == NORTH ? rb->sbox.Y1 : rb->sbox.Y2 - 1) :
+ || ((expand_dir == PCB_NORTH || expand_dir == PCB_SOUTH) ? rb->sbox.X1 <=
+ CostPointX && CostPointX < rb->sbox.X2 && CostPointY == (expand_dir == PCB_NORTH ? rb->sbox.Y1 : rb->sbox.Y2 - 1) :
/* expand_dir==EAST || expand_dir==WEST */
rb->sbox.Y1 <= CostPointY && CostPointY < rb->sbox.Y2 &&
- CostPointX == (expand_dir == EAST ? rb->sbox.X2 - 1 : rb->sbox.X1)));
+ CostPointX == (expand_dir == PCB_EAST ? rb->sbox.X2 - 1 : rb->sbox.X1)));
#endif
assert(__edge_is_good(e));
/* done */
@@ -1563,83 +1562,83 @@ static edge_t *CreateEdge(routebox_t * rb,
/* create edge, using previous edge to fill in defaults. */
/* most of the work here is in determining a new cost point */
-static edge_t *CreateEdge2(routebox_t * rb, direction_t expand_dir,
- edge_t * previous_edge, rtree_t * targets, routebox_t * guess)
+static edge_t *CreateEdge2(routebox_t * rb, pcb_direction_t expand_dir,
+ edge_t * previous_edge, pcb_rtree_t * targets, routebox_t * guess)
{
- BoxType thisbox;
- CheapPointType thiscost, prevcost;
- cost_t d;
+ pcb_box_t thisbox;
+ pcb_cheap_point_t thiscost, prevcost;
+ pcb_cost_t d;
assert(rb && previous_edge);
/* okay, find cheapest costpoint to costpoint of previous edge */
thisbox = edge_to_box(rb, expand_dir);
prevcost = previous_edge->cost_point;
/* find point closest to target */
- thiscost = closest_point_in_box(&prevcost, &thisbox);
+ thiscost = pcb_closest_pcb_point_in_box(&prevcost, &thisbox);
/* compute cost-to-point */
- d = cost_to_point_on_layer(&prevcost, &thiscost, rb->group);
+ d = pcb_cost_to_point_on_layer(&prevcost, &thiscost, rb->group);
/* add in jog penalty */
if (previous_edge->expand_dir != expand_dir)
d += AutoRouteParameters.JogPenalty;
/* okay, new edge! */
return CreateEdge(rb, thiscost.X, thiscost.Y,
- previous_edge->cost_to_point + d, guess ? guess : previous_edge->mincost_target, expand_dir, targets);
+ previous_edge->pcb_cost_to_point + d, guess ? guess : previous_edge->minpcb_cost_target, expand_dir, targets);
}
/* create via edge, using previous edge to fill in defaults. */
-static edge_t *CreateViaEdge(const BoxType * area, pcb_cardinal_t group,
+static edge_t *CreateViaEdge(const pcb_box_t * area, pcb_cardinal_t group,
routebox_t * parent, edge_t * previous_edge,
- conflict_t to_site_conflict, conflict_t through_site_conflict, rtree_t * targets)
+ conflict_t to_site_conflict, conflict_t through_site_conflict, pcb_rtree_t * targets)
{
routebox_t *rb;
- CheapPointType costpoint;
- cost_t d;
+ pcb_cheap_point_t costpoint;
+ pcb_cost_t d;
edge_t *ne;
- cost_t scale[3];
+ pcb_cost_t scale[3];
scale[0] = 1;
scale[1] = AutoRouteParameters.LastConflictPenalty;
scale[2] = AutoRouteParameters.ConflictPenalty;
- assert(box_is_good(area));
+ assert(pcb_box_is_good(area));
assert(AutoRouteParameters.with_conflicts || (to_site_conflict == NO_CONFLICT && through_site_conflict == NO_CONFLICT));
rb = CreateExpansionArea(area, group, parent, pcb_true, previous_edge);
rb->flags.is_via = 1;
- rb->came_from = ALL;
+ rb->came_from = PCB_ANY_DIR;
#if defined(ROUTE_DEBUG) && defined(DEBUG_SHOW_VIA_BOXES)
showroutebox(rb);
#endif /* ROUTE_DEBUG && DEBUG_SHOW_VIA_BOXES */
/* for planes, choose a point near the target */
if (previous_edge->flags.in_plane) {
routebox_t *target;
- CheapPointType pnt;
+ pcb_cheap_point_t pnt;
/* find a target near this via box */
- pnt.X = CENTER_X(*area);
- pnt.Y = CENTER_Y(*area);
- target = mincost_target_to_point(&pnt, rb->group, targets, previous_edge->mincost_target);
+ pnt.X = PCB_BOX_CENTER_X(*area);
+ pnt.Y = PCB_BOX_CENTER_Y(*area);
+ target = minpcb_cost_target_to_point(&pnt, rb->group, targets, previous_edge->minpcb_cost_target);
/* now find point near the target */
- pnt.X = CENTER_X(target->box);
- pnt.Y = CENTER_Y(target->box);
+ pnt.X = PCB_BOX_CENTER_X(target->box);
+ pnt.Y = PCB_BOX_CENTER_Y(target->box);
costpoint = closest_point_in_routebox(&pnt, rb);
/* we moved from the previous cost point through the plane which is free travel */
- d = (scale[through_site_conflict] * cost_to_point(&costpoint, group, &costpoint, previous_edge->rb->group));
- ne = CreateEdge(rb, costpoint.X, costpoint.Y, previous_edge->cost_to_point + d, target, ALL, NULL);
- ne->mincost_target = target;
+ d = (scale[through_site_conflict] * pcb_cost_to_point(&costpoint, group, &costpoint, previous_edge->rb->group));
+ ne = CreateEdge(rb, costpoint.X, costpoint.Y, previous_edge->pcb_cost_to_point + d, target, PCB_ANY_DIR, NULL);
+ ne->minpcb_cost_target = target;
}
else {
routebox_t *target;
- target = previous_edge->mincost_target;
+ target = previous_edge->minpcb_cost_target;
costpoint = closest_point_in_routebox(&previous_edge->cost_point, rb);
d =
(scale[to_site_conflict] *
- cost_to_point_on_layer(&costpoint, &previous_edge->cost_point,
+ pcb_cost_to_point_on_layer(&costpoint, &previous_edge->cost_point,
previous_edge->rb->group)) +
- (scale[through_site_conflict] * cost_to_point(&costpoint, group, &costpoint, previous_edge->rb->group));
+ (scale[through_site_conflict] * pcb_cost_to_point(&costpoint, group, &costpoint, previous_edge->rb->group));
/* if the target is just this via away, then this via is cheaper */
if (target->group == group && point_in_shrunk_box(target, costpoint.X, costpoint.Y))
d -= AutoRouteParameters.ViaCost / 2;
ne =
- CreateEdge(rb, costpoint.X, costpoint.Y, previous_edge->cost_to_point + d, previous_edge->mincost_target, ALL, targets);
+ CreateEdge(rb, costpoint.X, costpoint.Y, previous_edge->pcb_cost_to_point + d, previous_edge->minpcb_cost_target, PCB_ANY_DIR, targets);
}
ne->flags.is_via = 1;
ne->flags.via_conflict_level = to_site_conflict;
@@ -1653,13 +1652,13 @@ static edge_t *CreateViaEdge(const BoxType * area, pcb_cardinal_t group,
* it will become available if the conflict is elliminated.
* That is why we ignore the interior_edge argument.
*/
-static edge_t *CreateEdgeWithConflicts(const BoxType * interior_edge,
+static edge_t *CreateEdgeWithConflicts(const pcb_box_t * interior_edge,
routebox_t * container, edge_t * previous_edge,
- cost_t cost_penalty_to_box, rtree_t * targets)
+ pcb_cost_t cost_penalty_to_box, pcb_rtree_t * targets)
{
routebox_t *rb;
- CheapPointType costpoint;
- cost_t d;
+ pcb_cheap_point_t costpoint;
+ pcb_cost_t d;
edge_t *ne;
assert(interior_edge && container && previous_edge && targets);
assert(!container->flags.homeless);
@@ -1669,11 +1668,11 @@ static edge_t *CreateEdgeWithConflicts(const BoxType * interior_edge,
/* use the caller's idea of what this box should be */
rb = CreateExpansionArea(interior_edge, previous_edge->rb->group, previous_edge->rb, pcb_true, previous_edge);
path_conflicts(rb, container, pcb_true); /* crucial! */
- costpoint = closest_point_in_box(&previous_edge->cost_point, interior_edge);
- d = cost_to_point_on_layer(&costpoint, &previous_edge->cost_point, previous_edge->rb->group);
+ costpoint = pcb_closest_pcb_point_in_box(&previous_edge->cost_point, interior_edge);
+ d = pcb_cost_to_point_on_layer(&costpoint, &previous_edge->cost_point, previous_edge->rb->group);
d *= cost_penalty_to_box;
- d += previous_edge->cost_to_point;
- ne = CreateEdge(rb, costpoint.X, costpoint.Y, d, NULL, ALL, targets);
+ d += previous_edge->pcb_cost_to_point;
+ ne = CreateEdge(rb, costpoint.X, costpoint.Y, d, NULL, PCB_ANY_DIR, targets);
ne->flags.is_interior = 1;
assert(__edge_is_good(ne));
return ne;
@@ -1698,36 +1697,36 @@ static void DestroyEdge(edge_t ** e)
}
/* cost function for an edge. */
-static cost_t edge_cost(const edge_t * e, const cost_t too_big)
+static pcb_cost_t edge_cost(const edge_t * e, const pcb_cost_t too_big)
{
- cost_t penalty = e->cost_to_point;
+ pcb_cost_t penalty = e->pcb_cost_to_point;
if (e->rb->flags.is_thermal || e->rb->type == PLANE)
return penalty; /* thermals are cheap */
if (penalty > too_big)
return penalty;
- /* cost_to_routebox adds in our via correction, too. */
- return penalty + cost_to_routebox(&e->cost_point, e->rb->group, e->mincost_target);
+ /* pcb_cost_to_routebox adds in our via correction, too. */
+ return penalty + pcb_cost_to_routebox(&e->cost_point, e->rb->group, e->minpcb_cost_target);
}
/* given an edge of a box, return a box containing exactly the points on that
* edge. Note that the return box is treated as closed; that is, the bottom and
* right "edges" consist of points (just barely) not in the (half-open) box. */
-static BoxType edge_to_box(const routebox_t * rb, direction_t expand_dir)
+static pcb_box_t edge_to_box(const routebox_t * rb, pcb_direction_t expand_dir)
{
- BoxType b = shrink_routebox(rb);
+ pcb_box_t b = shrink_routebox(rb);
/* narrow box down to just the appropriate edge */
switch (expand_dir) {
- case NORTH:
+ case PCB_NORTH:
b.Y2 = b.Y1 + 1;
break;
- case EAST:
+ case PCB_EAST:
b.X1 = b.X2 - 1;
break;
- case SOUTH:
+ case PCB_SOUTH:
b.Y1 = b.Y2 - 1;
break;
- case WEST:
+ case PCB_WEST:
b.X2 = b.X1 + 1;
break;
default:
@@ -1738,21 +1737,21 @@ static BoxType edge_to_box(const routebox_t * rb, direction_t expand_dir)
}
struct broken_boxes {
- BoxType left, center, right;
+ pcb_box_t left, center, right;
pcb_bool is_valid_left, is_valid_center, is_valid_right;
};
-static struct broken_boxes break_box_edge(const BoxType * original, direction_t which_edge, routebox_t * breaker)
+static struct broken_boxes break_box_edge(const pcb_box_t * original, pcb_direction_t which_edge, routebox_t * breaker)
{
- BoxType origbox, breakbox;
+ pcb_box_t origbox, breakbox;
struct broken_boxes result;
assert(original && breaker);
origbox = *original;
breakbox = bloat_routebox(breaker);
- ROTATEBOX_TO_NORTH(origbox, which_edge);
- ROTATEBOX_TO_NORTH(breakbox, which_edge);
+ PCB_BOX_ROTATE_TO_NORTH(origbox, which_edge);
+ PCB_BOX_ROTATE_TO_NORTH(breakbox, which_edge);
result.right.Y1 = result.center.Y1 = result.left.Y1 = origbox.Y1;
result.right.Y2 = result.center.Y2 = result.left.Y2 = origbox.Y1 + 1;
/* validity of breaker is not important because the boxes are marked invalid */
@@ -1771,15 +1770,15 @@ static struct broken_boxes break_box_edge(const BoxType * original, direction_t
result.is_valid_center = (result.center.X1 < result.center.X2);
result.is_valid_right = (result.right.X1 < result.right.X2);
/* rotate back */
- ROTATEBOX_FROM_NORTH(result.left, which_edge);
- ROTATEBOX_FROM_NORTH(result.center, which_edge);
- ROTATEBOX_FROM_NORTH(result.right, which_edge);
+ PCB_BOX_ROTATE_FROM_NORTH(result.left, which_edge);
+ PCB_BOX_ROTATE_FROM_NORTH(result.center, which_edge);
+ PCB_BOX_ROTATE_FROM_NORTH(result.right, which_edge);
/* done */
return result;
}
#ifndef NDEBUG
-static int share_edge(const BoxType * child, const BoxType * parent)
+static int share_edge(const pcb_box_t * child, const pcb_box_t * parent)
{
return
(child->X1 == parent->X2 || child->X2 == parent->X1 ||
@@ -1787,7 +1786,7 @@ static int share_edge(const BoxType * child, const BoxType * parent)
((parent->X1 <= child->X1 && child->X2 <= parent->X2) || (parent->Y1 <= child->Y1 && child->Y2 <= parent->Y2));
}
-static int edge_intersect(const BoxType * child, const BoxType * parent)
+static int edge_intersect(const pcb_box_t * child, const pcb_box_t * parent)
{
return (child->X1 <= parent->X2) && (child->X2 >= parent->X1) && (child->Y1 <= parent->Y2) && (child->Y2 >= parent->Y1);
}
@@ -1797,7 +1796,7 @@ static int edge_intersect(const BoxType * child, const BoxType * parent)
* immediately preceding expansion area, for backtracing. 'lastarea' is
* the last expansion area created, we string these together in a loop
* so we can remove them all easily at the end. */
-static routebox_t *CreateExpansionArea(const BoxType * area, pcb_cardinal_t group,
+static routebox_t *CreateExpansionArea(const pcb_box_t * area, pcb_cardinal_t group,
routebox_t * parent, pcb_bool relax_edge_requirements, edge_t * src_edge)
{
routebox_t *rb = (routebox_t *) malloc(sizeof(*rb));
@@ -1807,13 +1806,13 @@ static routebox_t *CreateExpansionArea(const BoxType * area, pcb_cardinal_t grou
rb->group = group;
rb->type = EXPANSION_AREA;
/* should always share edge or overlap with parent */
- assert(relax_edge_requirements ? box_intersect(&rb->sbox, &parent->sbox)
+ assert(relax_edge_requirements ? pcb_box_intersect(&rb->sbox, &parent->sbox)
: share_edge(&rb->sbox, &parent->sbox));
rb->parent.expansion_area = route_parent(parent);
- rb->cost_point = closest_point_in_box(&rb->parent.expansion_area->cost_point, area);
+ rb->cost_point = pcb_closest_pcb_point_in_box(&rb->parent.expansion_area->cost_point, area);
rb->cost =
rb->parent.expansion_area->cost +
- cost_to_point_on_layer(&rb->parent.expansion_area->cost_point, &rb->cost_point, rb->group);
+ pcb_cost_to_point_on_layer(&rb->parent.expansion_area->cost_point, &rb->cost_point, rb->group);
assert(relax_edge_requirements ? edge_intersect(&rb->sbox, &parent->sbox)
: share_edge(&rb->sbox, &parent->sbox));
if (rb->parent.expansion_area->flags.homeless)
@@ -1836,8 +1835,8 @@ static routebox_t *CreateExpansionArea(const BoxType * area, pcb_cardinal_t grou
struct E_result {
routebox_t *parent;
routebox_t *n, *e, *s, *w;
- Coord keep, bloat;
- BoxType inflated, orig;
+ pcb_coord_t keep, bloat;
+ pcb_box_t inflated, orig;
int done;
};
@@ -1847,16 +1846,16 @@ struct E_result {
* like it wouldn't be seen. We do this while keep the inflated
* box as large as possible.
*/
-static r_dir_t __Expand_this_rect(const BoxType * box, void *cl)
+static pcb_r_dir_t __Expand_this_rect(const pcb_box_t * box, void *cl)
{
struct E_result *res = (struct E_result *) cl;
routebox_t *rb = (routebox_t *) box;
- BoxType rbox;
- Coord dn, de, ds, dw, bloat;
+ pcb_box_t rbox;
+ pcb_coord_t dn, de, ds, dw, bloat;
/* we don't see conflicts already encountered */
if (rb->flags.touched)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
/* The inflated box outer edges include its own
* track width plus its own clearance.
@@ -1874,23 +1873,23 @@ static r_dir_t __Expand_this_rect(const BoxType * box, void *cl)
bloat = res->bloat;
if (rbox.X2 <= res->inflated.X1 + bloat ||
rbox.X1 >= res->inflated.X2 - bloat || rbox.Y1 >= res->inflated.Y2 - bloat || rbox.Y2 <= res->inflated.Y1 + bloat)
- return R_DIR_NOT_FOUND; /* doesn't touch */
+ return PCB_R_DIR_NOT_FOUND; /* doesn't touch */
}
else {
if (rb->style->Clearance > res->keep)
- rbox = bloat_box(&rb->sbox, rb->style->Clearance - res->keep);
+ rbox = pcb_bloat_box(&rb->sbox, rb->style->Clearance - res->keep);
else
rbox = rb->sbox;
if (rbox.X2 <= res->inflated.X1 || rbox.X1 >= res->inflated.X2
|| rbox.Y1 >= res->inflated.Y2 || rbox.Y2 <= res->inflated.Y1)
- return R_DIR_NOT_FOUND; /* doesn't touch */
+ return PCB_R_DIR_NOT_FOUND; /* doesn't touch */
bloat = 0;
}
/* this is an intersecting box; it has to jump through a few more hoops */
if (rb == res->parent || rb->parent.expansion_area == res->parent)
- return R_DIR_NOT_FOUND; /* don't see what we came from */
+ return PCB_R_DIR_NOT_FOUND; /* don't see what we came from */
/* if we are expanding a source edge, don't let other sources
* or their expansions stop us.
@@ -1898,7 +1897,7 @@ static r_dir_t __Expand_this_rect(const BoxType * box, void *cl)
#if 1
if (res->parent->flags.source)
if (rb->flags.source || (rb->type == EXPANSION_AREA && rb->parent.expansion_area->flags.source))
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
#endif
/* we ignore via expansion boxes because maybe its
@@ -1906,12 +1905,12 @@ static r_dir_t __Expand_this_rect(const BoxType * box, void *cl)
* the path we're exploring now.
*/
if (rb->flags.is_via && rb->type == EXPANSION_AREA)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (rb->type == PLANE) { /* expanding inside a plane is not good */
if (rbox.X1 < res->orig.X1 && rbox.X2 > res->orig.X2 && rbox.Y1 < res->orig.Y1 && rbox.Y2 > res->orig.Y2) {
- res->inflated = bloat_box(&res->orig, res->bloat);
- return R_DIR_FOUND_CONTINUE;
+ res->inflated = pcb_bloat_box(&res->orig, res->bloat);
+ return PCB_R_DIR_FOUND_CONTINUE;
}
}
/* calculate the distances from original box to this blocker */
@@ -1925,7 +1924,7 @@ static r_dir_t __Expand_this_rect(const BoxType * box, void *cl)
if (!(res->done & _WEST) && rbox.X1 <= res->orig.X1 && rbox.X2 > res->inflated.X1)
dw = res->orig.X1 - rbox.X2;
if (dn <= 0 && de <= 0 && ds <= 0 && dw <= 0)
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
/* now shrink the inflated box to the largest blocking direction */
if (dn >= de && dn >= ds && dn >= dw) {
res->inflated.Y1 = rbox.Y2 - bloat;
@@ -1943,12 +1942,12 @@ static r_dir_t __Expand_this_rect(const BoxType * box, void *cl)
res->inflated.X1 = rbox.X2 - bloat;
res->w = rb;
}
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static pcb_bool boink_box(routebox_t * rb, struct E_result *res, direction_t dir)
+static pcb_bool boink_box(routebox_t * rb, struct E_result *res, pcb_direction_t dir)
{
- Coord bloat;
+ pcb_coord_t bloat;
if (rb->style->Clearance > res->keep)
bloat = res->keep - rb->style->Clearance;
else
@@ -1956,13 +1955,13 @@ static pcb_bool boink_box(routebox_t * rb, struct E_result *res, direction_t dir
if (rb->flags.nobloat)
bloat = res->bloat;
switch (dir) {
- case NORTH:
- case SOUTH:
+ case PCB_NORTH:
+ case PCB_SOUTH:
if (rb->sbox.X2 <= res->inflated.X1 + bloat || rb->sbox.X1 >= res->inflated.X2 - bloat)
return pcb_false;
return pcb_true;
- case EAST:
- case WEST:
+ case PCB_EAST:
+ case PCB_WEST:
if (rb->sbox.Y1 >= res->inflated.Y2 - bloat || rb->sbox.Y2 <= res->inflated.Y1 + bloat)
return pcb_false;
return pcb_true;
@@ -1987,7 +1986,7 @@ static pcb_bool boink_box(routebox_t * rb, struct E_result *res, direction_t dir
* looks past the clearance to see these targets even though they
* weren't actually touched in the expansion.
*/
-struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
+struct E_result *Expand(pcb_rtree_t * rtree, edge_t * e, const pcb_box_t * box)
{
static struct E_result ans;
int noshrink; /* bit field of which edges to not shrink */
@@ -2002,23 +2001,23 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
* clearance so we are guaranteed to honor that.
*/
switch (e->expand_dir) {
- case ALL:
- ans.inflated.X1 = (e->rb->came_from == EAST ? ans.orig.X1 : 0);
- ans.inflated.Y1 = (e->rb->came_from == SOUTH ? ans.orig.Y1 : 0);
- ans.inflated.X2 = (e->rb->came_from == WEST ? ans.orig.X2 : PCB->MaxWidth);
- ans.inflated.Y2 = (e->rb->came_from == NORTH ? ans.orig.Y2 : PCB->MaxHeight);
- if (e->rb->came_from == NORTH)
+ case PCB_ANY_DIR:
+ ans.inflated.X1 = (e->rb->came_from == PCB_EAST ? ans.orig.X1 : 0);
+ ans.inflated.Y1 = (e->rb->came_from == PCB_SOUTH ? ans.orig.Y1 : 0);
+ ans.inflated.X2 = (e->rb->came_from == PCB_WEST ? ans.orig.X2 : PCB->MaxWidth);
+ ans.inflated.Y2 = (e->rb->came_from == PCB_NORTH ? ans.orig.Y2 : PCB->MaxHeight);
+ if (e->rb->came_from == PCB_NORTH)
ans.done = noshrink = _SOUTH;
- else if (e->rb->came_from == EAST)
+ else if (e->rb->came_from == PCB_EAST)
ans.done = noshrink = _WEST;
- else if (e->rb->came_from == SOUTH)
+ else if (e->rb->came_from == PCB_SOUTH)
ans.done = noshrink = _NORTH;
- else if (e->rb->came_from == WEST)
+ else if (e->rb->came_from == PCB_WEST)
ans.done = noshrink = _EAST;
else
ans.done = noshrink = 0;
break;
- case NORTH:
+ case PCB_NORTH:
ans.done = _SOUTH + _EAST + _WEST;
noshrink = _SOUTH;
ans.inflated.X1 = box->X1 - ans.bloat;
@@ -2026,7 +2025,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.Y2 = box->Y2;
ans.inflated.Y1 = 0; /* far north */
break;
- case NE:
+ case PCB_NE:
ans.done = _SOUTH + _WEST;
noshrink = 0;
ans.inflated.X1 = box->X1 - ans.bloat;
@@ -2034,7 +2033,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.Y2 = box->Y2 + ans.bloat;
ans.inflated.Y1 = 0;
break;
- case EAST:
+ case PCB_EAST:
ans.done = _NORTH + _SOUTH + _WEST;
noshrink = _WEST;
ans.inflated.Y1 = box->Y1 - ans.bloat;
@@ -2042,7 +2041,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.X1 = box->X1;
ans.inflated.X2 = PCB->MaxWidth;
break;
- case SE:
+ case PCB_SE:
ans.done = _NORTH + _WEST;
noshrink = 0;
ans.inflated.X1 = box->X1 - ans.bloat;
@@ -2050,7 +2049,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.Y2 = PCB->MaxHeight;
ans.inflated.Y1 = box->Y1 - ans.bloat;
break;
- case SOUTH:
+ case PCB_SOUTH:
ans.done = _NORTH + _EAST + _WEST;
noshrink = _NORTH;
ans.inflated.X1 = box->X1 - ans.bloat;
@@ -2058,7 +2057,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.Y1 = box->Y1;
ans.inflated.Y2 = PCB->MaxHeight;
break;
- case SW:
+ case PCB_SW:
ans.done = _NORTH + _EAST;
noshrink = 0;
ans.inflated.X1 = 0;
@@ -2066,7 +2065,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.Y2 = PCB->MaxHeight;
ans.inflated.Y1 = box->Y1 - ans.bloat;
break;
- case WEST:
+ case PCB_WEST:
ans.done = _NORTH + _SOUTH + _EAST;
noshrink = _EAST;
ans.inflated.Y1 = box->Y1 - ans.bloat;
@@ -2074,7 +2073,7 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
ans.inflated.X1 = 0;
ans.inflated.X2 = box->X2;
break;
- case NW:
+ case PCB_NW:
ans.done = _SOUTH + _EAST;
noshrink = 0;
ans.inflated.X1 = 0;
@@ -2088,29 +2087,29 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
}
ans.keep = e->rb->style->Clearance;
ans.parent = nonhomeless_parent(e->rb);
- r_search(rtree, &ans.inflated, NULL, __Expand_this_rect, &ans, NULL);
+ pcb_r_search(rtree, &ans.inflated, NULL, __Expand_this_rect, &ans, NULL);
/* because the overlaping boxes are found in random order, some blockers
* may have limited edges prematurely, so we check if the blockers realy
* are blocking, and make another try if not
*/
- if (ans.n && !boink_box(ans.n, &ans, NORTH))
+ if (ans.n && !boink_box(ans.n, &ans, PCB_NORTH))
ans.inflated.Y1 = 0;
else
ans.done |= _NORTH;
- if (ans.e && !boink_box(ans.e, &ans, EAST))
+ if (ans.e && !boink_box(ans.e, &ans, PCB_EAST))
ans.inflated.X2 = PCB->MaxWidth;
else
ans.done |= _EAST;
- if (ans.s && !boink_box(ans.s, &ans, SOUTH))
+ if (ans.s && !boink_box(ans.s, &ans, PCB_SOUTH))
ans.inflated.Y2 = PCB->MaxHeight;
else
ans.done |= _SOUTH;
- if (ans.w && !boink_box(ans.w, &ans, WEST))
+ if (ans.w && !boink_box(ans.w, &ans, PCB_WEST))
ans.inflated.X1 = 0;
else
ans.done |= _WEST;
if (ans.done != _NORTH + _EAST + _SOUTH + _WEST) {
- r_search(rtree, &ans.inflated, NULL, __Expand_this_rect, &ans, NULL);
+ pcb_r_search(rtree, &ans.inflated, NULL, __Expand_this_rect, &ans, NULL);
}
if ((noshrink & _NORTH) == 0)
ans.inflated.Y1 += ans.bloat;
@@ -2129,30 +2128,30 @@ struct E_result *Expand(rtree_t * rtree, edge_t * e, const BoxType * box)
* It returns 1 for any fixed blocker that is not part
* of this net and zero otherwise.
*/
-static int blocker_to_heap(heap_t * heap, routebox_t * rb, BoxType * box, direction_t dir)
+static int blocker_to_heap(pcb_heap_t * heap, routebox_t * rb, pcb_box_t * box, pcb_direction_t dir)
{
- BoxType b = rb->sbox;
+ pcb_box_t b = rb->sbox;
if (rb->style->Clearance > AutoRouteParameters.style->Clearance)
- b = bloat_box(&b, rb->style->Clearance - AutoRouteParameters.style->Clearance);
- b = clip_box(&b, box);
- assert(box_is_good(&b));
+ b = pcb_bloat_box(&b, rb->style->Clearance - AutoRouteParameters.style->Clearance);
+ b = pcb_clip_box(&b, box);
+ assert(pcb_box_is_good(&b));
/* we want to look at the blockers clockwise around the box */
switch (dir) {
/* we need to use the other coordinate fraction to resolve
* ties since we want the shorter of the furthest
* first.
*/
- case NORTH:
- heap_insert(heap, b.X1 - b.X1 / (b.X2 + 1.0), rb);
+ case PCB_NORTH:
+ pcb_heap_insert(heap, b.X1 - b.X1 / (b.X2 + 1.0), rb);
break;
- case EAST:
- heap_insert(heap, b.Y1 - b.Y1 / (b.Y2 + 1.0), rb);
+ case PCB_EAST:
+ pcb_heap_insert(heap, b.Y1 - b.Y1 / (b.Y2 + 1.0), rb);
break;
- case SOUTH:
- heap_insert(heap, -(b.X2 + b.X1 / (b.X2 + 1.0)), rb);
+ case PCB_SOUTH:
+ pcb_heap_insert(heap, -(b.X2 + b.X1 / (b.X2 + 1.0)), rb);
break;
- case WEST:
- heap_insert(heap, -(b.Y2 + b.Y1 / (b.Y2 + 1.0)), rb);
+ case PCB_WEST:
+ pcb_heap_insert(heap, -(b.Y2 + b.Y1 / (b.Y2 + 1.0)), rb);
break;
default:
assert(0);
@@ -2166,7 +2165,7 @@ static int blocker_to_heap(heap_t * heap, routebox_t * rb, BoxType * box, direct
* (more commonly) create a supper-thin box to provide a
* home for an expansion edge.
*/
-static routebox_t *CreateBridge(const BoxType * area, routebox_t * parent, direction_t dir)
+static routebox_t *CreateBridge(const pcb_box_t * area, routebox_t * parent, pcb_direction_t dir)
{
routebox_t *rb = (routebox_t *) malloc(sizeof(*rb));
memset((void *) rb, 0, sizeof(*rb));
@@ -2175,8 +2174,8 @@ static routebox_t *CreateBridge(const BoxType * area, routebox_t * parent, direc
rb->group = parent->group;
rb->type = EXPANSION_AREA;
rb->came_from = dir;
- rb->cost_point = closest_point_in_box(&parent->cost_point, area);
- rb->cost = parent->cost + cost_to_point_on_layer(&parent->cost_point, &rb->cost_point, rb->group);
+ rb->cost_point = pcb_closest_pcb_point_in_box(&parent->cost_point, area);
+ rb->cost = parent->cost + pcb_cost_to_point_on_layer(&parent->cost_point, &rb->cost_point, rb->group);
rb->parent.expansion_area = route_parent(parent);
if (rb->parent.expansion_area->flags.homeless)
RB_up_count(rb->parent.expansion_area);
@@ -2194,13 +2193,13 @@ static routebox_t *CreateBridge(const BoxType * area, routebox_t * parent, direc
* starting box, direction and blocker if any.
*/
void
-moveable_edge(vector_t * result, const BoxType * box, direction_t dir,
+moveable_edge(vector_t * result, const pcb_box_t * box, pcb_direction_t dir,
routebox_t * rb,
- routebox_t * blocker, edge_t * e, rtree_t * targets,
- struct routeone_state *s, rtree_t * tree, vector_t * area_vec)
+ routebox_t * blocker, edge_t * e, pcb_rtree_t * targets,
+ struct routeone_state *s, pcb_rtree_t * tree, vector_t * area_vec)
{
- BoxType b;
- assert(box_is_good(box));
+ pcb_box_t b;
+ assert(pcb_box_is_good(box));
b = *box;
/* for the cardinal directions, move the box to overlap the
* the parent by 1 unit. Corner expansions overlap more
@@ -2210,61 +2209,61 @@ moveable_edge(vector_t * result, const BoxType * box, direction_t dir,
switch (dir) {
default:
break;
- case NORTH:
+ case PCB_NORTH:
b.Y2 = b.Y1;
b.Y1--;
if (b.Y1 <= AutoRouteParameters.bloat)
return; /* off board edge */
break;
- case EAST:
+ case PCB_EAST:
b.X1 = b.X2;
b.X2++;
if (b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat)
return; /* off board edge */
break;
- case SOUTH:
+ case PCB_SOUTH:
b.Y1 = b.Y2;
b.Y2++;
if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat)
return; /* off board edge */
break;
- case WEST:
+ case PCB_WEST:
b.X2 = b.X1;
b.X1--;
if (b.X1 <= AutoRouteParameters.bloat)
return; /* off board edge */
break;
- case NE:
+ case PCB_NE:
if (b.Y1 <= AutoRouteParameters.bloat + 1 && b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1)
return; /* off board edge */
if (b.Y1 <= AutoRouteParameters.bloat + 1)
- dir = EAST; /* north off board edge */
+ dir = PCB_EAST; /* north off board edge */
if (b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1)
- dir = NORTH; /* east off board edge */
+ dir = PCB_NORTH; /* east off board edge */
break;
- case SE:
+ case PCB_SE:
if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1 && b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1)
return; /* off board edge */
if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1)
- dir = EAST; /* south off board edge */
+ dir = PCB_EAST; /* south off board edge */
if (b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1)
- dir = SOUTH; /* east off board edge */
+ dir = PCB_SOUTH; /* east off board edge */
break;
- case SW:
+ case PCB_SW:
if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1 && b.X1 <= AutoRouteParameters.bloat + 1)
return; /* off board edge */
if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1)
- dir = WEST; /* south off board edge */
+ dir = PCB_WEST; /* south off board edge */
if (b.X1 <= AutoRouteParameters.bloat + 1)
- dir = SOUTH; /* west off board edge */
+ dir = PCB_SOUTH; /* west off board edge */
break;
- case NW:
+ case PCB_NW:
if (b.Y1 <= AutoRouteParameters.bloat + 1 && b.X1 <= AutoRouteParameters.bloat + 1)
return; /* off board edge */
if (b.Y1 <= AutoRouteParameters.bloat + 1)
- dir = WEST; /* north off board edge */
+ dir = PCB_WEST; /* north off board edge */
if (b.X1 <= AutoRouteParameters.bloat + 1)
- dir = NORTH; /* west off board edge */
+ dir = PCB_NORTH; /* west off board edge */
break;
}
@@ -2274,11 +2273,11 @@ moveable_edge(vector_t * result, const BoxType * box, direction_t dir,
/* move the cost point in corner expansions
* these boxes are bigger, so move close to the target
*/
- if (dir == NE || dir == SE || dir == SW || dir == NW) {
- CheapPointType p;
- p = closest_point_in_box(&nrb->cost_point, &e->mincost_target->sbox);
- p = closest_point_in_box(&p, &b);
- nrb->cost += cost_to_point_on_layer(&p, &nrb->cost_point, nrb->group);
+ if (dir == PCB_NE || dir == PCB_SE || dir == PCB_SW || dir == PCB_NW) {
+ pcb_cheap_point_t p;
+ p = pcb_closest_pcb_point_in_box(&nrb->cost_point, &e->minpcb_cost_target->sbox);
+ p = pcb_closest_pcb_point_in_box(&p, &b);
+ nrb->cost += pcb_cost_to_point_on_layer(&p, &nrb->cost_point, nrb->group);
nrb->cost_point = p;
}
ne = CreateEdge(nrb, nrb->cost_point.X, nrb->cost_point.Y, nrb->cost, NULL, dir, targets);
@@ -2292,42 +2291,42 @@ moveable_edge(vector_t * result, const BoxType * box, direction_t dir,
* in all directions from there
*/
switch (dir) {
- case NORTH:
+ case PCB_NORTH:
b.Y1 = blocker->sbox.Y2 - 1;
break;
- case EAST:
+ case PCB_EAST:
b.X2 = blocker->sbox.X1 + 1;
break;
- case SOUTH:
+ case PCB_SOUTH:
b.Y2 = blocker->sbox.Y1 + 1;
break;
- case WEST:
+ case PCB_WEST:
b.X1 = blocker->sbox.X2 - 1;
break;
default:
assert(0);
}
- if (!box_is_good(&b))
+ if (!pcb_box_is_good(&b))
return; /* how did this happen ? */
nrb = CreateBridge(&b, rb, dir);
- r_insert_entry(tree, &nrb->box, 1);
+ pcb_r_insert_entry(tree, &nrb->box, 1);
vector_append(area_vec, nrb);
nrb->flags.homeless = 0; /* not homeless any more */
/* mark this one as conflicted */
path_conflicts(nrb, blocker, pcb_true);
/* and make an expansion edge */
- nrb->cost_point = closest_point_in_box(&nrb->cost_point, &blocker->sbox);
+ nrb->cost_point = pcb_closest_pcb_point_in_box(&nrb->cost_point, &blocker->sbox);
nrb->cost +=
- cost_to_point_on_layer(&nrb->parent.expansion_area->cost_point, &nrb->cost_point, nrb->group) * CONFLICT_PENALTY(blocker);
+ pcb_cost_to_point_on_layer(&nrb->parent.expansion_area->cost_point, &nrb->cost_point, nrb->group) * CONFLICT_PENALTY(blocker);
- ne = CreateEdge(nrb, nrb->cost_point.X, nrb->cost_point.Y, nrb->cost, NULL, ALL, targets);
+ ne = CreateEdge(nrb, nrb->cost_point.X, nrb->cost_point.Y, nrb->cost, NULL, PCB_ANY_DIR, targets);
ne->flags.is_interior = 1;
vector_append(result, ne);
}
#if 1
else if (blocker->type == EXPANSION_AREA) {
if (blocker->cost < rb->cost || blocker->cost <= rb->cost +
- cost_to_point_on_layer(&blocker->cost_point, &rb->cost_point, rb->group))
+ pcb_cost_to_point_on_layer(&blocker->cost_point, &rb->cost_point, rb->group))
return;
if (blocker->conflicts_with || rb->conflicts_with)
return;
@@ -2342,30 +2341,30 @@ moveable_edge(vector_t * result, const BoxType * box, direction_t dir,
else if (blocker->flags.target) {
routebox_t *nrb;
edge_t *ne;
- b = bloat_box(&b, 1);
- if (!box_intersect(&b, &blocker->sbox)) {
+ b = pcb_bloat_box(&b, 1);
+ if (!pcb_box_intersect(&b, &blocker->sbox)) {
/* if the expansion edge stopped before touching, expand the bridge */
switch (dir) {
- case NORTH:
+ case PCB_NORTH:
b.Y1 -= AutoRouteParameters.bloat + 1;
break;
- case EAST:
+ case PCB_EAST:
b.X2 += AutoRouteParameters.bloat + 1;
break;
- case SOUTH:
+ case PCB_SOUTH:
b.Y2 += AutoRouteParameters.bloat + 1;
break;
- case WEST:
+ case PCB_WEST:
b.X1 -= AutoRouteParameters.bloat + 1;
break;
default:
assert(0);
}
}
- assert(box_intersect(&b, &blocker->sbox));
- b = shrink_box(&b, 1);
+ assert(pcb_box_intersect(&b, &blocker->sbox));
+ b = pcb_shrink_box(&b, 1);
nrb = CreateBridge(&b, rb, dir);
- r_insert_entry(tree, &nrb->box, 1);
+ pcb_r_insert_entry(tree, &nrb->box, 1);
vector_append(area_vec, nrb);
nrb->flags.homeless = 0; /* not homeless any more */
ne = CreateEdge(nrb, nrb->cost_point.X, nrb->cost_point.Y, nrb->cost, blocker, dir, NULL);
@@ -2375,52 +2374,52 @@ moveable_edge(vector_t * result, const BoxType * box, direction_t dir,
}
struct break_info {
- heap_t *heap;
+ pcb_heap_t *heap;
routebox_t *parent;
- BoxType box;
- direction_t dir;
+ pcb_box_t box;
+ pcb_direction_t dir;
pcb_bool ignore_source;
};
-static r_dir_t __GatherBlockers(const BoxType * box, void *cl)
+static pcb_r_dir_t __GatherBlockers(const pcb_box_t * box, void *cl)
{
routebox_t *rb = (routebox_t *) box;
struct break_info *bi = (struct break_info *) cl;
- BoxType b;
+ pcb_box_t b;
if (bi->parent == rb || rb->flags.touched || bi->parent->parent.expansion_area == rb)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (rb->flags.source && bi->ignore_source)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
b = rb->sbox;
if (rb->style->Clearance > AutoRouteParameters.style->Clearance)
- b = bloat_box(&b, rb->style->Clearance - AutoRouteParameters.style->Clearance);
+ b = pcb_bloat_box(&b, rb->style->Clearance - AutoRouteParameters.style->Clearance);
if (b.X2 <= bi->box.X1 || b.X1 >= bi->box.X2 || b.Y1 >= bi->box.Y2 || b.Y2 <= bi->box.Y1)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (blocker_to_heap(bi->heap, rb, &bi->box, bi->dir))
- return R_DIR_FOUND_CONTINUE;
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_NOT_FOUND;
}
/* shrink the box to the last limit for the previous direction,
* i.e. if dir is SOUTH, then this means fixing up an EAST leftover
* edge, which would be the southern most edge for that example.
*/
-static inline BoxType previous_edge(Coord last, direction_t i, const BoxType * b)
+static inline pcb_box_t previous_edge(pcb_coord_t last, pcb_direction_t i, const pcb_box_t * b)
{
- BoxType db = *b;
+ pcb_box_t db = *b;
switch (i) {
- case EAST:
+ case PCB_EAST:
db.X1 = last;
break;
- case SOUTH:
+ case PCB_SOUTH:
db.Y1 = last;
break;
- case WEST:
+ case PCB_WEST:
db.X2 = last;
break;
default:
- Message(PCB_MSG_DEFAULT, "previous edge bogus direction!");
+ pcb_message(PCB_MSG_ERROR, "previous edge bogus direction!");
assert(0);
}
return db;
@@ -2430,15 +2429,15 @@ static inline BoxType previous_edge(Coord last, direction_t i, const BoxType * b
* targets as they are found, and putting any moveable edges
* in the return vector.
*/
-vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t * tree,
+vector_t *BreakManyEdges(struct routeone_state * s, pcb_rtree_t * targets, pcb_rtree_t * tree,
vector_t * area_vec, struct E_result * ans, routebox_t * rb, edge_t * e)
{
struct break_info bi;
vector_t *edges;
- heap_t *heap[4];
- Coord first, last;
- Coord bloat;
- direction_t dir;
+ pcb_heap_t *heap[4];
+ pcb_coord_t first, last;
+ pcb_coord_t bloat;
+ pcb_direction_t dir;
routebox_t fake;
edges = vector_create();
@@ -2460,8 +2459,8 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
* to prevent expansion back where we came from since
* we still need to break portions of all 4 edges
*/
- if (e->expand_dir == NE || e->expand_dir == SE || e->expand_dir == SW || e->expand_dir == NW) {
- BoxType *fb = (BoxType *) & fake.sbox;
+ if (e->expand_dir == PCB_NE || e->expand_dir == PCB_SE || e->expand_dir == PCB_SW || e->expand_dir == PCB_NW) {
+ pcb_box_t *fb = (pcb_box_t *) & fake.sbox;
memset(&fake, 0, sizeof(fake));
*fb = e->rb->sbox;
fake.flags.fixed = 1; /* this stops expansion there */
@@ -2470,7 +2469,7 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
#ifndef NDEBUG
/* the routbox_is_good checker wants a lot more! */
fake.flags.inited = 1;
- fb = (BoxType *) & fake.box;
+ fb = (pcb_box_t *) & fake.box;
*fb = e->rb->sbox;
fake.same_net.next = fake.same_net.prev = &fake;
fake.same_subnet.next = fake.same_subnet.prev = &fake;
@@ -2482,64 +2481,64 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
* in clockwise order, which allows finding corners that can
* be expanded.
*/
- for (dir = NORTH; dir <= WEST; dir = directionIncrement(dir)) {
+ for (dir = PCB_NORTH; dir <= PCB_WEST; dir = directionIncrement(dir)) {
int tmp;
/* don't break the edge we came from */
if (e->expand_dir != ((dir + 2) % 4)) {
- heap[dir] = heap_create();
- bi.box = bloat_box(&rb->sbox, bloat);
+ heap[dir] = pcb_heap_create();
+ bi.box = pcb_bloat_box(&rb->sbox, bloat);
bi.heap = heap[dir];
bi.dir = dir;
/* convert to edge */
switch (dir) {
- case NORTH:
+ case PCB_NORTH:
bi.box.Y2 = bi.box.Y1 + bloat + 1;
/* for corner expansion, block the start edges and
* limit the blocker search to only the new edge segment
*/
- if (e->expand_dir == SE || e->expand_dir == SW)
+ if (e->expand_dir == PCB_SE || e->expand_dir == PCB_SW)
blocker_to_heap(heap[dir], &fake, &bi.box, dir);
- if (e->expand_dir == SE)
+ if (e->expand_dir == PCB_SE)
bi.box.X1 = e->rb->sbox.X2;
- if (e->expand_dir == SW)
+ if (e->expand_dir == PCB_SW)
bi.box.X2 = e->rb->sbox.X1;
- r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
+ pcb_r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
rb->n = tmp;
break;
- case EAST:
+ case PCB_EAST:
bi.box.X1 = bi.box.X2 - bloat - 1;
/* corner, same as above */
- if (e->expand_dir == SW || e->expand_dir == NW)
+ if (e->expand_dir == PCB_SW || e->expand_dir == PCB_NW)
blocker_to_heap(heap[dir], &fake, &bi.box, dir);
- if (e->expand_dir == SW)
+ if (e->expand_dir == PCB_SW)
bi.box.Y1 = e->rb->sbox.Y2;
- if (e->expand_dir == NW)
+ if (e->expand_dir == PCB_NW)
bi.box.Y2 = e->rb->sbox.Y1;
- r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
+ pcb_r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
rb->e = tmp;
break;
- case SOUTH:
+ case PCB_SOUTH:
bi.box.Y1 = bi.box.Y2 - bloat - 1;
/* corner, same as above */
- if (e->expand_dir == NE || e->expand_dir == NW)
+ if (e->expand_dir == PCB_NE || e->expand_dir == PCB_NW)
blocker_to_heap(heap[dir], &fake, &bi.box, dir);
- if (e->expand_dir == NE)
+ if (e->expand_dir == PCB_NE)
bi.box.X1 = e->rb->sbox.X2;
- if (e->expand_dir == NW)
+ if (e->expand_dir == PCB_NW)
bi.box.X2 = e->rb->sbox.X1;
- r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
+ pcb_r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
rb->s = tmp;
break;
- case WEST:
+ case PCB_WEST:
bi.box.X2 = bi.box.X1 + bloat + 1;
/* corner, same as above */
- if (e->expand_dir == NE || e->expand_dir == SE)
+ if (e->expand_dir == PCB_NE || e->expand_dir == PCB_SE)
blocker_to_heap(heap[dir], &fake, &bi.box, dir);
- if (e->expand_dir == SE)
+ if (e->expand_dir == PCB_SE)
bi.box.Y1 = e->rb->sbox.Y2;
- if (e->expand_dir == NE)
+ if (e->expand_dir == PCB_NE)
bi.box.Y2 = e->rb->sbox.Y1;
- r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
+ pcb_r_search(tree, &bi.box, NULL, __GatherBlockers, &bi, &tmp);
rb->w = tmp;
break;
default:
@@ -2559,13 +2558,13 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
* moveable as possible.
*/
first = last = -1;
- for (dir = NORTH; dir <= WEST; dir = directionIncrement(dir)) {
- if (heap[dir] && !heap_is_empty(heap[dir])) {
+ for (dir = PCB_NORTH; dir <= PCB_WEST; dir = directionIncrement(dir)) {
+ if (heap[dir] && !pcb_heap_is_empty(heap[dir])) {
/* pull the very first one out of the heap outside of the
* heap loop because it is special; it can be part of a corner
*/
- routebox_t *blk = (routebox_t *) heap_remove_smallest(heap[dir]);
- BoxType b = rb->sbox;
+ routebox_t *blk = (routebox_t *) pcb_heap_remove_smallest(heap[dir]);
+ pcb_box_t b = rb->sbox;
struct broken_boxes broke = break_box_edge(&b, dir, blk);
if (broke.is_valid_left) {
/* if last > 0, then the previous edge had a segment
@@ -2573,19 +2572,19 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
*/
if (last > 0) {
/* make a corner expansion */
- BoxType db = b;
+ pcb_box_t db = b;
switch (dir) {
- case EAST:
+ case PCB_EAST:
/* possible NE expansion */
db.X1 = last;
db.Y2 = MIN(db.Y2, broke.left.Y2);
break;
- case SOUTH:
+ case PCB_SOUTH:
/* possible SE expansion */
db.Y1 = last;
db.X1 = MAX(db.X1, broke.left.X1);
break;
- case WEST:
+ case PCB_WEST:
/* possible SW expansion */
db.X2 = last;
db.Y1 = MAX(db.Y1, broke.left.Y1);
@@ -2594,9 +2593,9 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
assert(0);
break;
}
- moveable_edge(edges, &db, (direction_t) (dir + 3), rb, NULL, e, targets, s, NULL, NULL);
+ moveable_edge(edges, &db, (pcb_direction_t) (dir + 3), rb, NULL, e, targets, s, NULL, NULL);
}
- else if (dir == NORTH) { /* north is start, so nothing "before" it */
+ else if (dir == PCB_NORTH) { /* north is start, so nothing "before" it */
/* save for a possible corner once we've
* finished circling the box
*/
@@ -2615,8 +2614,8 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
* in the direction of the previous edge,
* which it belongs to.
*/
- BoxType db = previous_edge(last, dir, &rb->sbox);
- moveable_edge(edges, &db, (direction_t) (dir - 1), rb, NULL, e, targets, s, NULL, NULL);
+ pcb_box_t db = previous_edge(last, dir, &rb->sbox);
+ moveable_edge(edges, &db, (pcb_direction_t) (dir - 1), rb, NULL, e, targets, s, NULL, NULL);
}
if (broke.is_valid_center && !blk->flags.source)
moveable_edge(edges, &broke.center, dir, rb, blk, e, targets, s, tree, area_vec);
@@ -2627,24 +2626,24 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
while (broke.is_valid_right) {
/* move the box edge to the next potential free point */
switch (dir) {
- case NORTH:
+ case PCB_NORTH:
last = b.X1 = MAX(broke.right.X1, b.X1);
break;
- case EAST:
+ case PCB_EAST:
last = b.Y1 = MAX(broke.right.Y1, b.Y1);
break;
- case SOUTH:
+ case PCB_SOUTH:
last = b.X2 = MIN(broke.right.X2, b.X2);
break;
- case WEST:
+ case PCB_WEST:
last = b.Y2 = MIN(broke.right.Y2, b.Y2);
break;
default:
assert(0);
}
- if (heap_is_empty(heap[dir]))
+ if (pcb_heap_is_empty(heap[dir]))
break;
- blk = (routebox_t *) heap_remove_smallest(heap[dir]);
+ blk = (routebox_t *) pcb_heap_remove_smallest(heap[dir]);
broke = break_box_edge(&b, dir, blk);
if (broke.is_valid_left)
moveable_edge(edges, &broke.left, dir, rb, NULL, e, targets, s, NULL, NULL);
@@ -2662,42 +2661,42 @@ vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t *
* for this case (of hitting nothing) we give up trying for corner
* expansions because it is likely that they're not possible anyway
*/
- if ((e->expand_dir == ALL ? e->rb->came_from : e->expand_dir) != ((dir + 2) % 4)) {
+ if ((e->expand_dir == PCB_ANY_DIR ? e->rb->came_from : e->expand_dir) != ((dir + 2) % 4)) {
/* ok, we are not going back on ourselves, and the whole edge seems free */
moveable_edge(edges, &rb->sbox, dir, rb, NULL, e, targets, s, NULL, NULL);
}
if (last > 0) {
/* expand the leftover from the prior direction */
- BoxType db = previous_edge(last, dir, &rb->sbox);
- moveable_edge(edges, &db, (direction_t) (dir - 1), rb, NULL, e, targets, s, NULL, NULL);
+ pcb_box_t db = previous_edge(last, dir, &rb->sbox);
+ moveable_edge(edges, &db, (pcb_direction_t) (dir - 1), rb, NULL, e, targets, s, NULL, NULL);
}
last = -1;
}
} /* for loop */
/* finally, check for the NW corner now that we've come full circle */
if (first > 0 && last > 0) {
- BoxType db = rb->sbox;
+ pcb_box_t db = rb->sbox;
db.X2 = first;
db.Y2 = last;
- moveable_edge(edges, &db, NW, rb, NULL, e, targets, s, NULL, NULL);
+ moveable_edge(edges, &db, PCB_NW, rb, NULL, e, targets, s, NULL, NULL);
}
else {
if (first > 0) {
- BoxType db = rb->sbox;
+ pcb_box_t db = rb->sbox;
db.X2 = first;
- moveable_edge(edges, &db, NORTH, rb, NULL, e, targets, s, NULL, NULL);
+ moveable_edge(edges, &db, PCB_NORTH, rb, NULL, e, targets, s, NULL, NULL);
}
else if (last > 0) {
- BoxType db = rb->sbox;
+ pcb_box_t db = rb->sbox;
db.Y2 = last;
- moveable_edge(edges, &db, WEST, rb, NULL, e, targets, s, NULL, NULL);
+ moveable_edge(edges, &db, PCB_WEST, rb, NULL, e, targets, s, NULL, NULL);
}
}
/* done with all expansion edges of this box */
- for (dir = NORTH; dir <= WEST; dir = directionIncrement(dir)) {
+ for (dir = PCB_NORTH; dir <= PCB_WEST; dir = directionIncrement(dir)) {
if (heap[dir])
- heap_destroy(&heap[dir]);
+ pcb_heap_destroy(&heap[dir]);
}
return edges;
}
@@ -2715,99 +2714,99 @@ static routebox_t *rb_source(routebox_t * rb)
/* ------------ */
struct foib_info {
- const BoxType *box;
+ const pcb_box_t *box;
routebox_t *intersect;
jmp_buf env;
};
-static r_dir_t foib_rect_in_reg(const BoxType * box, void *cl)
+static pcb_r_dir_t foib_rect_in_reg(const pcb_box_t * box, void *cl)
{
struct foib_info *foib = (struct foib_info *) cl;
- BoxType rbox;
+ pcb_box_t rbox;
routebox_t *rb = (routebox_t *) box;
if (rb->flags.touched)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
/* if (rb->type == EXPANSION_AREA && !rb->flags.is_via)*/
- /* return R_DIR_NOT_FOUND; */
+ /* return PCB_R_DIR_NOT_FOUND; */
rbox = bloat_routebox(rb);
- if (!box_intersect(&rbox, foib->box))
- return R_DIR_NOT_FOUND;
+ if (!pcb_box_intersect(&rbox, foib->box))
+ return PCB_R_DIR_NOT_FOUND;
/* this is an intersector! */
foib->intersect = (routebox_t *) box;
longjmp(foib->env, 1); /* skip to the end! */
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static routebox_t *FindOneInBox(rtree_t * rtree, routebox_t * rb)
+static routebox_t *FindOneInBox(pcb_rtree_t * rtree, routebox_t * rb)
{
struct foib_info foib;
- BoxType r;
+ pcb_box_t r;
r = rb->sbox;
foib.box = &r;
foib.intersect = NULL;
if (setjmp(foib.env) == 0)
- r_search(rtree, &r, NULL, foib_rect_in_reg, &foib, NULL);
+ pcb_r_search(rtree, &r, NULL, foib_rect_in_reg, &foib, NULL);
return foib.intersect;
}
struct therm_info {
routebox_t *plane;
- BoxType query;
+ pcb_box_t query;
jmp_buf env;
};
-static r_dir_t ftherm_rect_in_reg(const BoxType * box, void *cl)
+static pcb_r_dir_t ftherm_rect_in_reg(const pcb_box_t * box, void *cl)
{
routebox_t *rbox = (routebox_t *) box;
struct therm_info *ti = (struct therm_info *) cl;
- BoxType sq, sb;
+ pcb_box_t sq, sb;
if (rbox->type != PIN && rbox->type != VIA && rbox->type != VIA_SHADOW)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (rbox->group != ti->plane->group)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
sb = shrink_routebox(rbox);
switch (rbox->type) {
case PIN:
- sq = shrink_box(&ti->query, rbox->parent.pin->Thickness);
- if (!box_intersect(&sb, &sq))
- return R_DIR_NOT_FOUND;
+ sq = pcb_shrink_box(&ti->query, rbox->parent.pin->Thickness);
+ if (!pcb_box_intersect(&sb, &sq))
+ return PCB_R_DIR_NOT_FOUND;
sb.X1 = rbox->parent.pin->X;
sb.Y1 = rbox->parent.pin->Y;
break;
case VIA:
if (rbox->flags.fixed) {
- sq = shrink_box(&ti->query, rbox->parent.via->Thickness);
+ sq = pcb_shrink_box(&ti->query, rbox->parent.via->Thickness);
sb.X1 = rbox->parent.pin->X;
sb.Y1 = rbox->parent.pin->Y;
}
else {
- sq = shrink_box(&ti->query, rbox->style->Diameter);
- sb.X1 = CENTER_X(sb);
- sb.Y1 = CENTER_Y(sb);
+ sq = pcb_shrink_box(&ti->query, rbox->style->Diameter);
+ sb.X1 = PCB_BOX_CENTER_X(sb);
+ sb.Y1 = PCB_BOX_CENTER_Y(sb);
}
- if (!box_intersect(&sb, &sq))
- return R_DIR_NOT_FOUND;
+ if (!pcb_box_intersect(&sb, &sq))
+ return PCB_R_DIR_NOT_FOUND;
break;
case VIA_SHADOW:
- sq = shrink_box(&ti->query, rbox->style->Diameter);
- if (!box_intersect(&sb, &sq))
- return R_DIR_NOT_FOUND;
- sb.X1 = CENTER_X(sb);
- sb.Y1 = CENTER_Y(sb);
+ sq = pcb_shrink_box(&ti->query, rbox->style->Diameter);
+ if (!pcb_box_intersect(&sb, &sq))
+ return PCB_R_DIR_NOT_FOUND;
+ sb.X1 = PCB_BOX_CENTER_X(sb);
+ sb.Y1 = PCB_BOX_CENTER_Y(sb);
break;
default:
assert(0);
}
ti->plane = rbox;
longjmp(ti->env, 1);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
/* check for a pin or via target that a polygon can just use a thermal to connect to */
-routebox_t *FindThermable(rtree_t * rtree, routebox_t * rb)
+routebox_t *FindThermable(pcb_rtree_t * rtree, routebox_t * rb)
{
struct therm_info info;
@@ -2815,7 +2814,7 @@ routebox_t *FindThermable(rtree_t * rtree, routebox_t * rb)
info.query = shrink_routebox(rb);
if (setjmp(info.env) == 0) {
- r_search(rtree, &info.query, NULL, ftherm_rect_in_reg, &info, NULL);
+ pcb_r_search(rtree, &info.query, NULL, ftherm_rect_in_reg, &info, NULL);
return NULL;
}
return info.plane;
@@ -2825,7 +2824,7 @@ routebox_t *FindThermable(rtree_t * rtree, routebox_t * rb)
* Route-tracing code: once we've got a path of expansion boxes, trace
* a line through them to actually create the connection.
*/
-static void RD_DrawThermal(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad)
+static void RD_DrawThermal(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad)
{
routebox_t *rb;
rb = (routebox_t *) malloc(sizeof(*rb));
@@ -2843,26 +2842,26 @@ static void RD_DrawThermal(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t gr
MergeNets(rb, subnet, NET);
MergeNets(rb, subnet, SUBNET);
/* add it to the r-tree, this may be the whole route! */
- r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1);
+ pcb_r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1);
rb->flags.homeless = 0;
}
-static void RD_DrawVia(routedata_t * rd, Coord X, Coord Y, Coord radius, routebox_t * subnet, pcb_bool is_bad)
+static void RD_DrawVia(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t radius, routebox_t * subnet, pcb_bool is_bad)
{
routebox_t *rb, *first_via = NULL;
int i;
int ka = AutoRouteParameters.style->Clearance;
- PinType *live_via = NULL;
+ pcb_pin_t *live_via = NULL;
if (conf_core.editor.live_routing) {
- live_via = CreateNewVia(PCB->Data, X, Y, radius * 2,
- 2 * AutoRouteParameters.style->Clearance, 0, AutoRouteParameters.style->Hole, NULL, MakeFlags(0));
+ live_via = pcb_via_new(PCB->Data, X, Y, radius * 2,
+ 2 * AutoRouteParameters.style->Clearance, 0, AutoRouteParameters.style->Hole, NULL, pcb_flag_make(0));
if (live_via != NULL)
DrawVia(live_via);
}
/* a via cuts through every layer group */
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
if (!is_layer_group_active[i])
continue;
rb = (routebox_t *) malloc(sizeof(*rb));
@@ -2874,7 +2873,7 @@ static void RD_DrawVia(routedata_t * rd, Coord X, Coord Y, Coord radius, routebo
rb->flags.fixed = 0; /* indicates that not on PCB yet */
rb->flags.is_odd = AutoRouteParameters.is_odd;
rb->flags.is_bad = is_bad;
- rb->came_from = ALL;
+ rb->came_from = PCB_ANY_DIR;
rb->flags.circular = pcb_true;
rb->style = AutoRouteParameters.style;
rb->pass = AutoRouteParameters.pass;
@@ -2893,9 +2892,9 @@ static void RD_DrawVia(routedata_t * rd, Coord X, Coord Y, Coord radius, routebo
/* add these to proper subnet. */
MergeNets(rb, subnet, NET);
MergeNets(rb, subnet, SUBNET);
- assert(__routebox_is_good(rb));
+ assert(__routepcb_box_is_good(rb));
/* and add it to the r-tree! */
- r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1);
+ pcb_r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1);
rb->flags.homeless = 0; /* not homeless anymore */
rb->livedraw_obj.via = live_via;
}
@@ -2903,22 +2902,22 @@ static void RD_DrawVia(routedata_t * rd, Coord X, Coord Y, Coord radius, routebo
static void
RD_DrawLine(routedata_t * rd,
- Coord X1, Coord Y1, Coord X2,
- Coord Y2, Coord halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool is_45)
+ pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2,
+ pcb_coord_t Y2, pcb_coord_t halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool is_45)
{
/* we hold the line in a queue to concatenate segments that
* ajoin one another. That reduces the number of things in
* the trees and allows conflict boxes to be larger, both of
* which are really useful.
*/
- static Coord qX1 = -1, qY1, qX2, qY2;
- static Coord qhthick;
+ static pcb_coord_t qX1 = -1, qY1, qX2, qY2;
+ static pcb_coord_t qhthick;
static pcb_cardinal_t qgroup;
static pcb_bool qis_45, qis_bad;
static routebox_t *qsn;
routebox_t *rb;
- Coord ka = AutoRouteParameters.style->Clearance;
+ pcb_coord_t ka = AutoRouteParameters.style->Clearance;
/* don't draw zero-length segments. */
if (X1 == X2 && Y1 == Y2)
@@ -2966,7 +2965,7 @@ RD_DrawLine(routedata_t * rd,
rb->flags.fixed = 0; /* indicates that not on PCB yet */
rb->flags.is_odd = AutoRouteParameters.is_odd;
rb->flags.is_bad = qis_bad;
- rb->came_from = ALL;
+ rb->came_from = PCB_ANY_DIR;
rb->flags.homeless = 0; /* we're putting this in the tree */
rb->flags.nonstraight = qis_45;
rb->flags.bl_to_ur = ((qX2 >= qX1 && qY2 <= qY1)
@@ -2977,14 +2976,14 @@ RD_DrawLine(routedata_t * rd,
/* add these to proper subnet. */
MergeNets(rb, qsn, NET);
MergeNets(rb, qsn, SUBNET);
- assert(__routebox_is_good(rb));
+ assert(__routepcb_box_is_good(rb));
/* and add it to the r-tree! */
- r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1);
+ pcb_r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1);
if (conf_core.editor.live_routing) {
- LayerType *layer = LAYER_PTR(PCB->LayerGroups.Entries[rb->group][0]);
- LineType *line = CreateNewLineOnLayer(layer, qX1, qY1, qX2, qY2,
- 2 * qhthick, 0, MakeFlags(0));
+ pcb_layer_t *layer = LAYER_PTR(PCB->LayerGroups.Entries[rb->group][0]);
+ pcb_line_t *line = pcb_line_new(layer, qX1, qY1, qX2, qY2,
+ 2 * qhthick, 0, pcb_flag_make(0));
rb->livedraw_obj.line = line;
if (line != NULL)
DrawLine(layer, line);
@@ -3008,11 +3007,11 @@ RD_DrawLine(routedata_t * rd,
static pcb_bool
RD_DrawManhattanLine(routedata_t * rd,
- const BoxType * box1, const BoxType * box2,
- CheapPointType start, CheapPointType end,
- Coord halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool last_was_x)
+ const pcb_box_t * box1, const pcb_box_t * box2,
+ pcb_cheap_point_t start, pcb_cheap_point_t end,
+ pcb_coord_t halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool last_was_x)
{
- CheapPointType knee = start;
+ pcb_cheap_point_t knee = start;
if (end.X == start.X) {
RD_DrawLine(rd, start.X, start.Y, end.X, end.Y, halfthick, group, subnet, is_bad, pcb_false);
return pcb_false;
@@ -3022,8 +3021,8 @@ RD_DrawManhattanLine(routedata_t * rd,
return pcb_true;
}
/* find where knee belongs */
- if (point_in_box(box1, end.X, start.Y)
- || point_in_box(box2, end.X, start.Y)) {
+ if (pcb_point_in_box(box1, end.X, start.Y)
+ || pcb_point_in_box(box2, end.X, start.Y)) {
knee.X = end.X;
knee.Y = start.Y;
}
@@ -3031,13 +3030,13 @@ RD_DrawManhattanLine(routedata_t * rd,
knee.X = start.X;
knee.Y = end.Y;
}
- if ((knee.X == end.X && !last_was_x) && (point_in_box(box1, start.X, end.Y)
- || point_in_box(box2, start.X, end.Y))) {
+ if ((knee.X == end.X && !last_was_x) && (pcb_point_in_box(box1, start.X, end.Y)
+ || pcb_point_in_box(box2, start.X, end.Y))) {
knee.X = start.X;
knee.Y = end.Y;
}
- assert(AutoRouteParameters.is_smoothing || point_in_closed_box(box1, knee.X, knee.Y)
- || point_in_closed_box(box2, knee.X, knee.Y));
+ assert(AutoRouteParameters.is_smoothing || pcb_point_in_closed_box(box1, knee.X, knee.Y)
+ || pcb_point_in_closed_box(box2, knee.X, knee.Y));
if (1 || !AutoRouteParameters.is_smoothing) {
/* draw standard manhattan paths */
@@ -3046,8 +3045,8 @@ RD_DrawManhattanLine(routedata_t * rd,
}
else {
/* draw 45-degree path across knee */
- Coord len45 = MIN(PCB_ABS(start.X - end.X), PCB_ABS(start.Y - end.Y));
- CheapPointType kneestart = knee, kneeend = knee;
+ pcb_coord_t len45 = MIN(PCB_ABS(start.X - end.X), PCB_ABS(start.Y - end.Y));
+ pcb_cheap_point_t kneestart = knee, kneeend = knee;
if (kneestart.X == start.X)
kneestart.Y += (kneestart.Y > start.Y) ? -len45 : len45;
else
@@ -3065,7 +3064,7 @@ RD_DrawManhattanLine(routedata_t * rd,
/* for smoothing, don't pack traces to min clearance gratuitously */
#if 0
-static void add_clearance(CheapPointType * nextpoint, const BoxType * b)
+static void add_clearance(pcb_cheap_point_t * nextpoint, const pcb_box_t * b)
{
if (nextpoint->X == b->X1) {
if (nextpoint->X + AutoRouteParameters.style->Clearance < (b->X1 + b->X2) / 2)
@@ -3109,11 +3108,11 @@ static void add_clearance(CheapPointType * nextpoint, const BoxType * b)
static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * target, routebox_t * subnet, pcb_bool is_bad)
{
pcb_bool last_x = pcb_false;
- Coord halfwidth = HALF_THICK(AutoRouteParameters.style->Thick);
- Coord radius = HALF_THICK(AutoRouteParameters.style->Diameter);
- CheapPointType lastpoint, nextpoint;
+ pcb_coord_t halfwidth = HALF_THICK(AutoRouteParameters.style->Thick);
+ pcb_coord_t radius = HALF_THICK(AutoRouteParameters.style->Diameter);
+ pcb_cheap_point_t lastpoint, nextpoint;
routebox_t *lastpath;
- BoxType b;
+ pcb_box_t b;
assert(subnet->style == AutoRouteParameters.style);
/*XXX: because we round up odd thicknesses, there's the possibility that
@@ -3130,13 +3129,13 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
* is where we're utlimately headed on this path. However, it
* must reside in the plane as well as the via area too.
*/
- nextpoint.X = CENTER_X(path->sbox);
- nextpoint.Y = CENTER_Y(path->sbox);
+ nextpoint.X = PCB_BOX_CENTER_X(path->sbox);
+ nextpoint.Y = PCB_BOX_CENTER_Y(path->sbox);
if (path->parent.expansion_area->flags.is_via) {
TargetPoint(&nextpoint, rb_source(path));
/* nextpoint is the middle of the source terminal now */
- b = clip_box(&path->sbox, &path->parent.expansion_area->sbox);
- nextpoint = closest_point_in_box(&nextpoint, &b);
+ b = pcb_clip_box(&path->sbox, &path->parent.expansion_area->sbox);
+ nextpoint = pcb_closest_pcb_point_in_box(&nextpoint, &b);
/* now it's in the via and plane near the source */
}
else { /* no via coming, target must have been a pin */
@@ -3144,22 +3143,22 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
assert(target->type == PIN);
TargetPoint(&nextpoint, target);
}
- assert(point_in_box(&path->sbox, nextpoint.X, nextpoint.Y));
+ assert(pcb_point_in_box(&path->sbox, nextpoint.X, nextpoint.Y));
RD_DrawThermal(rd, nextpoint.X, nextpoint.Y, path->group, path->layer, subnet, is_bad);
}
else {
/* start from best place of target box */
- lastpoint.X = CENTER_X(target->sbox);
- lastpoint.Y = CENTER_Y(target->sbox);
+ lastpoint.X = PCB_BOX_CENTER_X(target->sbox);
+ lastpoint.Y = PCB_BOX_CENTER_Y(target->sbox);
TargetPoint(&lastpoint, target);
- if (AutoRouteParameters.last_smooth && box_in_box(&path->sbox, &target->sbox))
+ if (AutoRouteParameters.last_smooth && pcb_box_in_box(&path->sbox, &target->sbox))
path = path->parent.expansion_area;
b = path->sbox;
if (path->flags.circular)
- b = shrink_box(&b, MIN(b.X2 - b.X1, b.Y2 - b.Y1) / 5);
- nextpoint = closest_point_in_box(&lastpoint, &b);
+ b = pcb_shrink_box(&b, MIN(b.X2 - b.X1, b.Y2 - b.Y1) / 5);
+ nextpoint = pcb_closest_pcb_point_in_box(&lastpoint, &b);
if (AutoRouteParameters.last_smooth)
- RD_DrawLine(rd, lastpoint.X, lastpoint.Y, nextpoint.X, nextpoint.Y, halfwidth, path->group, subnet, is_bad, TRUE);
+ RD_DrawLine(rd, lastpoint.X, lastpoint.Y, nextpoint.X, nextpoint.Y, halfwidth, path->group, subnet, is_bad, pcb_true);
else
last_x = RD_DrawManhattanLine(rd, &target->sbox, &path->sbox,
lastpoint, nextpoint, halfwidth, path->group, subnet, is_bad, last_x);
@@ -3178,11 +3177,11 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
path = path->parent.expansion_area;
b = path->sbox;
if (path->flags.circular)
- b = shrink_box(&b, MIN(b.X2 - b.X1, b.Y2 - b.Y1) / 5);
+ b = pcb_shrink_box(&b, MIN(b.X2 - b.X1, b.Y2 - b.Y1) / 5);
assert(b.X1 != b.X2 && b.Y1 != b.Y2); /* need someplace to put line! */
/* find point on path perimeter closest to last point */
/* if source terminal, try to hit a good place */
- nextpoint = closest_point_in_box(&lastpoint, &b);
+ nextpoint = pcb_closest_pcb_point_in_box(&lastpoint, &b);
#if 0
/* leave more clearance if this is a smoothing pass */
if (AutoRouteParameters.is_smoothing && (nextpoint.X != lastpoint.X || nextpoint.Y != lastpoint.Y))
@@ -3190,8 +3189,8 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
#endif
if (path->flags.source && path->type != PLANE)
TargetPoint(&nextpoint, path);
- assert(point_in_box(&lastpath->box, lastpoint.X, lastpoint.Y));
- assert(point_in_box(&path->box, nextpoint.X, nextpoint.Y));
+ assert(pcb_point_in_box(&lastpath->box, lastpoint.X, lastpoint.Y));
+ assert(pcb_point_in_box(&path->box, nextpoint.X, nextpoint.Y));
#if defined(ROUTE_DEBUG_VERBOSE)
printf("TRACEPATH: ");
DumpRouteBox(path);
@@ -3203,7 +3202,7 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
/* knee is placed in lastpath box */
/* should never cause line to leave union of lastpath/path boxes */
if (AutoRouteParameters.last_smooth)
- RD_DrawLine(rd, lastpoint.X, lastpoint.Y, nextpoint.X, nextpoint.Y, halfwidth, path->group, subnet, is_bad, TRUE);
+ RD_DrawLine(rd, lastpoint.X, lastpoint.Y, nextpoint.X, nextpoint.Y, halfwidth, path->group, subnet, is_bad, pcb_true);
else
last_x = RD_DrawManhattanLine(rd, &lastpath->sbox, &path->sbox,
lastpoint, nextpoint, halfwidth, path->group, subnet, is_bad, last_x);
@@ -3211,7 +3210,7 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
#ifdef ROUTE_VERBOSE
printf(" (vias)");
#endif
- assert(point_in_box(&path->box, nextpoint.X, nextpoint.Y));
+ assert(pcb_point_in_box(&path->box, nextpoint.X, nextpoint.Y));
RD_DrawVia(rd, nextpoint.X, nextpoint.Y, radius, subnet, is_bad);
}
@@ -3234,7 +3233,7 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
add_clearance(&lastpoint, &b);
#else
if (AutoRouteParameters.last_smooth)
- RD_DrawLine(rd, lastpoint.X, lastpoint.Y, nextpoint.X, nextpoint.Y, halfwidth, path->group, subnet, is_bad, TRUE);
+ RD_DrawLine(rd, lastpoint.X, lastpoint.Y, nextpoint.X, nextpoint.Y, halfwidth, path->group, subnet, is_bad, pcb_true);
else
#endif
last_x = RD_DrawManhattanLine(rd, &b, &b, nextpoint, lastpoint, halfwidth, path->group, subnet, is_bad, last_x);
@@ -3255,7 +3254,7 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
RD_DrawLine(rd, -1, 0, 0, 0, 0, 0, NULL, pcb_false, pcb_false);
if (conf_core.editor.live_routing)
- Draw();
+ pcb_draw();
#ifdef ROUTE_DEBUG
if (ddraw != NULL)
@@ -3266,20 +3265,20 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * ta
/* create a fake "edge" used to defer via site searching. */
static void
CreateSearchEdge(struct routeone_state *s, vetting_t * work, edge_t * parent,
- routebox_t * rb, conflict_t conflict, rtree_t * targets, pcb_bool in_plane)
+ routebox_t * rb, conflict_t conflict, pcb_rtree_t * targets, pcb_bool in_plane)
{
routebox_t *target;
- BoxType b;
- cost_t cost;
- assert(__routebox_is_good(rb));
+ pcb_box_t b;
+ pcb_cost_t cost;
+ assert(__routepcb_box_is_good(rb));
/* find the cheapest target */
#if 0
- target = mincost_target_to_point(&parent->cost_point, max_group + 1, targets, parent->mincost_target);
+ target = minpcb_cost_target_to_point(&parent->cost_point, pcb_max_group + 1, targets, parent->minpcb_cost_target);
#else
- target = parent->mincost_target;
+ target = parent->minpcb_cost_target;
#endif
b = shrink_routebox(target);
- cost = parent->cost_to_point + AutoRouteParameters.ViaCost + cost_to_layerless_box(&rb->cost_point, 0, &b);
+ cost = parent->pcb_cost_to_point + AutoRouteParameters.ViaCost + pcb_cost_to_layerless_box(&rb->cost_point, 0, &b);
if (cost < s->best_cost) {
edge_t *ne;
ne = (edge_t *) malloc(sizeof(*ne));
@@ -3291,12 +3290,12 @@ CreateSearchEdge(struct routeone_state *s, vetting_t * work, edge_t * parent,
if (rb->flags.homeless)
RB_up_count(rb);
ne->work = work;
- ne->mincost_target = target;
+ ne->minpcb_cost_target = target;
ne->flags.via_conflict_level = conflict;
- ne->cost_to_point = parent->cost_to_point;
+ ne->pcb_cost_to_point = parent->pcb_cost_to_point;
ne->cost_point = parent->cost_point;
ne->cost = cost;
- heap_insert(s->workheap, ne->cost, ne);
+ pcb_heap_insert(s->workheap, ne->cost, ne);
}
else {
mtsFreeWork(&work);
@@ -3309,7 +3308,7 @@ static void add_or_destroy_edge(struct routeone_state *s, edge_t * e)
assert(__edge_is_good(e));
assert(is_layer_group_active[e->rb->group]);
if (e->cost < s->best_cost)
- heap_insert(s->workheap, e->cost, e);
+ pcb_heap_insert(s->workheap, e->cost, e);
else
DestroyEdge(&e);
}
@@ -3346,12 +3345,12 @@ void
add_via_sites(struct routeone_state *s,
struct routeone_via_site_state *vss,
mtspace_t * mtspace, routebox_t * within,
- conflict_t within_conflict_level, edge_t * parent_edge, rtree_t * targets, Coord shrink, pcb_bool in_plane)
+ conflict_t within_conflict_level, edge_t * parent_edge, pcb_rtree_t * targets, pcb_coord_t shrink, pcb_bool in_plane)
{
- Coord radius, clearance;
+ pcb_coord_t radius, clearance;
vetting_t *work;
- BoxType region = shrink_routebox(within);
- shrink_box(®ion, shrink);
+ pcb_box_t region = shrink_routebox(within);
+ pcb_shrink_box(®ion, shrink);
radius = HALF_THICK(AutoRouteParameters.style->Diameter);
clearance = AutoRouteParameters.style->Clearance;
@@ -3372,10 +3371,10 @@ add_via_sites(struct routeone_state *s,
void
do_via_search(edge_t * search, struct routeone_state *s,
- struct routeone_via_site_state *vss, mtspace_t * mtspace, rtree_t * targets)
+ struct routeone_via_site_state *vss, mtspace_t * mtspace, pcb_rtree_t * targets)
{
int i, j, count = 0;
- Coord radius, clearance;
+ pcb_coord_t radius, clearance;
vetting_t *work;
routebox_t *within;
conflict_t within_conflict_level;
@@ -3394,19 +3393,19 @@ do_via_search(edge_t * search, struct routeone_state *s,
i == LO_CONFLICT ? vss->lo_conflict_space_vec : i == HI_CONFLICT ? vss->hi_conflict_space_vec : NULL);
assert(v);
while (!vector_is_empty(v)) {
- BoxType cliparea;
- BoxType *area = (BoxType *) vector_remove_last(v);
+ pcb_box_t cliparea;
+ pcb_box_t *area = (pcb_box_t *) vector_remove_last(v);
if (!(i == NO_CONFLICT || AutoRouteParameters.with_conflicts)) {
free(area);
continue;
}
/* answers are bloated by radius + clearance */
- cliparea = shrink_box(area, radius + clearance);
- close_box(&cliparea);
+ cliparea = pcb_shrink_box(area, radius + clearance);
+ pcb_close_box(&cliparea);
free(area);
- assert(box_is_good(&cliparea));
+ assert(pcb_box_is_good(&cliparea));
count++;
- for (j = 0; j < max_group; j++) {
+ for (j = 0; j < pcb_max_group; j++) {
edge_t *ne;
if (j == within->group || !is_layer_group_active[j])
continue;
@@ -3463,7 +3462,7 @@ static pcb_bool net_id(routebox_t * rb, long int id)
LIST_LOOP(rb, same_net, p);
if (p->flags.source && p->parent.pad->ID == id)
return pcb_true;
- END_LOOP;
+ PCB_END_LOOP;
return pcb_false;
}
@@ -3506,36 +3505,36 @@ static void show_sources(routebox_t * rb)
LIST_LOOP(rb, same_net, p);
if (p->flags.source)
show_one(p);
- END_LOOP;
+ PCB_END_LOOP;
}
#endif
-static r_dir_t __conflict_source(const BoxType * box, void *cl)
+static pcb_r_dir_t __conflict_source(const pcb_box_t * box, void *cl)
{
routebox_t *rb = (routebox_t *) box;
if (rb->flags.touched || rb->flags.fixed)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
else {
routebox_t *dis = (routebox_t *) cl;
path_conflicts(dis, rb, pcb_false);
touch_conflicts(dis->conflicts_with, 1);
}
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static void source_conflicts(rtree_t * tree, routebox_t * rb)
+static void source_conflicts(pcb_rtree_t * tree, routebox_t * rb)
{
if (!AutoRouteParameters.with_conflicts)
return;
- r_search(tree, &rb->sbox, NULL, __conflict_source, rb, NULL);
+ pcb_r_search(tree, &rb->sbox, NULL, __conflict_source, rb, NULL);
touch_conflicts(NULL, 1);
}
struct routeone_status {
pcb_bool found_route;
int route_had_conflicts;
- cost_t best_route_cost;
+ pcb_cost_t best_route_cost;
pcb_bool net_completely_routed;
};
@@ -3545,9 +3544,9 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
struct routeone_status result;
routebox_t *p;
int seen, i;
- const BoxType **target_list;
+ const pcb_box_t **target_list;
int num_targets;
- rtree_t *targets;
+ pcb_rtree_t *targets;
/* vector of source edges for filtering */
vector_t *source_vec;
/* working vector */
@@ -3561,12 +3560,12 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/* no targets on to/from net need clearance areas */
LIST_LOOP(from, same_net, p);
p->flags.nobloat = 1;
- END_LOOP;
+ PCB_END_LOOP;
/* set 'source' flags */
LIST_LOOP(from, same_subnet, p);
if (!p->flags.nonstraight)
p->flags.source = 1;
- END_LOOP;
+ PCB_END_LOOP;
/* count up the targets */
num_targets = 0;
@@ -3582,7 +3581,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
LIST_LOOP(from, same_net, p);
if (p == to)
seen = 1;
- END_LOOP;
+ PCB_END_LOOP;
#endif
assert(seen); /* otherwise from and to are on different nets! */
/* set target flags only on 'to's subnet */
@@ -3591,7 +3590,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
p->flags.target = 1;
num_targets++;
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
else {
@@ -3602,14 +3601,14 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
p->flags.target = 1;
num_targets++;
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* if no targets, then net is done! reset flags and return. */
if (num_targets == 0) {
LIST_LOOP(from, same_net, p);
p->flags.source = p->flags.target = p->flags.nobloat = 0;
- END_LOOP;
+ PCB_END_LOOP;
result.found_route = pcb_false;
result.net_completely_routed = pcb_true;
result.best_route_cost = 0;
@@ -3623,7 +3622,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
assert(!from->flags.target);
assert(num_targets > 0);
/* create list of target pointers and from that a r-tree of targets */
- target_list = (const BoxType **) malloc(num_targets * sizeof(*target_list));
+ target_list = (const pcb_box_t **) malloc(num_targets * sizeof(*target_list));
i = 0;
LIST_LOOP(from, same_net, p);
if (p->flags.target) {
@@ -3632,8 +3631,8 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
showroutebox(p);
#endif
}
- END_LOOP;
- targets = r_create_tree((const BoxType **) target_list, i, 0);
+ PCB_END_LOOP;
+ targets = pcb_r_create_tree((const pcb_box_t **) target_list, i, 0);
assert(i <= num_targets);
free(target_list);
@@ -3641,14 +3640,14 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/* touch the source subnet to prepare check for conflictors */
LIST_LOOP(from, same_subnet, p);
p->flags.touched = 1;
- END_LOOP;
+ PCB_END_LOOP;
LIST_LOOP(from, same_subnet, p);
{
/* we need the test for 'source' because this box may be nonstraight */
if (p->flags.source && is_layer_group_active[p->group]) {
- CheapPointType cp;
+ pcb_cheap_point_t cp;
edge_t *e;
- BoxType b = shrink_routebox(p);
+ pcb_box_t b = shrink_routebox(p);
#if defined(ROUTE_DEBUG) && defined(DEBUG_SHOW_SOURCES)
showroutebox(p);
@@ -3656,33 +3655,33 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/* may expand in all directions from source; center edge cost point. */
/* note that planes shouldn't really expand, but we need an edge */
- cp.X = CENTER_X(b);
- cp.Y = CENTER_Y(b);
- e = CreateEdge(p, cp.X, cp.Y, 0, NULL, ALL, targets);
- cp = closest_point_in_box(&cp, &e->mincost_target->sbox);
- cp = closest_point_in_box(&cp, &b);
+ cp.X = PCB_BOX_CENTER_X(b);
+ cp.Y = PCB_BOX_CENTER_Y(b);
+ e = CreateEdge(p, cp.X, cp.Y, 0, NULL, PCB_ANY_DIR, targets);
+ cp = pcb_closest_pcb_point_in_box(&cp, &e->minpcb_cost_target->sbox);
+ cp = pcb_closest_pcb_point_in_box(&cp, &b);
e->cost_point = cp;
p->cost_point = cp;
source_conflicts(rd->layergrouptree[p->group], p);
vector_append(source_vec, e);
}
}
- END_LOOP;
+ PCB_END_LOOP;
LIST_LOOP(from, same_subnet, p);
p->flags.touched = 0;
- END_LOOP;
+ PCB_END_LOOP;
/* break source edges; some edges may be too near obstacles to be able
* to exit from. */
/* okay, main expansion-search routing loop. */
/* set up the initial activity heap */
- s.workheap = heap_create();
+ s.workheap = pcb_heap_create();
assert(s.workheap);
while (!vector_is_empty(source_vec)) {
edge_t *e = (edge_t *) vector_remove_last(source_vec);
assert(is_layer_group_active[e->rb->group]);
e->cost = edge_cost(e, EXPENSIVE);
- heap_insert(s.workheap, e->cost, e);
+ pcb_heap_insert(s.workheap, e->cost, e);
}
vector_destroy(&source_vec);
/* okay, process items from heap until it is empty! */
@@ -3693,8 +3692,8 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
vss.free_space_vec = vector_create();
vss.lo_conflict_space_vec = vector_create();
vss.hi_conflict_space_vec = vector_create();
- while (!heap_is_empty(s.workheap)) {
- edge_t *e = (edge_t *) heap_remove_smallest(s.workheap);
+ while (!pcb_heap_is_empty(s.workheap)) {
+ edge_t *e = (edge_t *) pcb_heap_remove_smallest(s.workheap);
#ifdef ROUTE_DEBUG
if (aabort)
goto dontexpand;
@@ -3702,7 +3701,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/* don't bother expanding this edge if the minimum possible edge cost
* is already larger than the best edge cost we've found. */
if (s.best_path && e->cost >= s.best_cost) {
- heap_free(s.workheap, KillEdge);
+ pcb_heap_free(s.workheap, KillEdge);
goto dontexpand; /* skip this edge */
}
/* surprisingly it helps to give up and not try too hard to find
@@ -3724,14 +3723,14 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/*showedge (e); */
#endif
if (e->rb->flags.is_thermal) {
- best_path_candidate(&s, e, e->mincost_target);
+ best_path_candidate(&s, e, e->minpcb_cost_target);
goto dontexpand;
}
/* for a plane, look for quick connections with thermals or vias */
if (e->rb->type == PLANE) {
routebox_t *pin = FindThermable(targets, e->rb);
if (pin) {
- BoxType b = shrink_routebox(pin);
+ pcb_box_t b = shrink_routebox(pin);
edge_t *ne;
routebox_t *nrb;
assert(pin->flags.target);
@@ -3751,7 +3750,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
routebox_t *nrb = CreateExpansionArea(&e->rb->sbox, e->rb->group, e->rb,
pcb_true, e);
edge_t *ne = CreateEdge2(nrb, e->expand_dir, e, NULL,
- e->mincost_target);
+ e->minpcb_cost_target);
nrb->flags.is_thermal = 1;
add_via_sites(&s, &vss, rd->mtspace, nrb, NO_CONFLICT, ne, targets, e->rb->style->Diameter, pcb_true);
}
@@ -3761,7 +3760,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
if (e->flags.is_via) { /* special case via */
routebox_t *intersecting;
assert(AutoRouteParameters.use_vias);
- assert(e->expand_dir == ALL);
+ assert(e->expand_dir == PCB_ANY_DIR);
assert(vector_is_empty(edge_vec));
/* if there is already something here on this layer (like an
* EXPANSION_AREA), then we don't want to expand from here
@@ -3774,9 +3773,9 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/* we have hit a plane */
edge_t *ne;
routebox_t *nrb;
- BoxType b = shrink_routebox(e->rb);
+ pcb_box_t b = shrink_routebox(e->rb);
/* limit via region to that inside the plane */
- clip_box(&b, &intersecting->sbox);
+ pcb_clip_box(&b, &intersecting->sbox);
nrb = CreateExpansionArea(&b, e->rb->group, e->rb, pcb_true, e);
nrb->flags.is_thermal = 1;
ne = CreateEdge2(nrb, e->expand_dir, e, NULL, intersecting);
@@ -3788,10 +3787,10 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
/* this via candidate is in an open area; add it to r-tree as
* an expansion area */
assert(e->rb->type == EXPANSION_AREA && e->rb->flags.is_via);
- /*assert (!r_search (rd->layergrouptree[e->rb->group],
+ /*assert (!pcb_r_search(rd->layergrouptree[e->rb->group],
&e->rb->box, NULL, no_planes,0));
*/
- r_insert_entry(rd->layergrouptree[e->rb->group], &e->rb->box, 1);
+ pcb_r_insert_entry(rd->layergrouptree[e->rb->group], &e->rb->box, 1);
e->rb->flags.homeless = 0; /* not homeless any more */
/* add to vector of all expansion areas in r-tree */
vector_append(area_vec, e->rb);
@@ -3803,7 +3802,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
goto dontexpand;
else if (0) { /* XXX: disabling this causes no via
collisions. */
- BoxType a = bloat_routebox(intersecting), b;
+ pcb_box_t a = bloat_routebox(intersecting), b;
edge_t *ne;
int i, j;
/* something intersects this via candidate. split via candidate
@@ -3876,7 +3875,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
if (1) {
routebox_t *nrb;
struct E_result *ans;
- BoxType b;
+ pcb_box_t b;
vector_t *broken;
if (e->flags.is_interior) {
assert(AutoRouteParameters.with_conflicts); /* no interior edges unless
@@ -3884,24 +3883,24 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
assert(e->rb->conflicts_with);
b = e->rb->sbox;
switch (e->rb->came_from) {
- case NORTH:
+ case PCB_NORTH:
b.Y2 = b.Y1 + 1;
- b.X1 = CENTER_X(b);
+ b.X1 = PCB_BOX_CENTER_X(b);
b.X2 = b.X1 + 1;
break;
- case EAST:
+ case PCB_EAST:
b.X1 = b.X2 - 1;
- b.Y1 = CENTER_Y(b);
+ b.Y1 = PCB_BOX_CENTER_Y(b);
b.Y2 = b.Y1 + 1;
break;
- case SOUTH:
+ case PCB_SOUTH:
b.Y1 = b.Y2 - 1;
- b.X1 = CENTER_X(b);
+ b.X1 = PCB_BOX_CENTER_X(b);
b.X2 = b.X1 + 1;
break;
- case WEST:
+ case PCB_WEST:
b.X2 = b.X1 + 1;
- b.Y1 = CENTER_Y(b);
+ b.Y1 = PCB_BOX_CENTER_Y(b);
b.Y2 = b.Y1 + 1;
break;
default:
@@ -3912,11 +3911,11 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
* adjacent blockers.
*/
else if (e->rb->flags.source)
- b = box_center(&e->rb->sbox);
+ b = pcb_box_center(&e->rb->sbox);
else
b = e->rb->sbox;
ans = Expand(rd->layergrouptree[e->rb->group], e, &b);
- if (!box_intersect(&ans->inflated, &ans->orig))
+ if (!pcb_box_intersect(&ans->inflated, &ans->orig))
goto dontexpand;
#if 0
/* skip if it didn't actually expand */
@@ -3925,10 +3924,10 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
goto dontexpand;
#endif
- if (!box_is_good(&ans->inflated))
+ if (!pcb_box_is_good(&ans->inflated))
goto dontexpand;
nrb = CreateExpansionArea(&ans->inflated, e->rb->group, e->rb, pcb_true, e);
- r_insert_entry(rd->layergrouptree[nrb->group], &nrb->box, 1);
+ pcb_r_insert_entry(rd->layergrouptree[nrb->group], &nrb->box, 1);
vector_append(area_vec, nrb);
nrb->flags.homeless = 0; /* not homeless any more */
broken = BreakManyEdges(&s, targets, rd->layergrouptree[nrb->group], area_vec, ans, nrb, e);
@@ -3947,8 +3946,8 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
DestroyEdge(&e);
}
touch_conflicts(NULL, 1);
- heap_destroy(&s.workheap);
- r_destroy_tree(&targets);
+ pcb_heap_destroy(&s.workheap);
+ pcb_r_destroy_tree(&targets);
assert(vector_is_empty(edge_vec));
vector_destroy(&edge_vec);
@@ -4001,7 +4000,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
assert(!rb->flags.homeless);
if (rb->conflicts_with && rb->parent.expansion_area->conflicts_with != rb->conflicts_with)
vector_destroy(&rb->conflicts_with);
- r_delete_entry(rd->layergrouptree[rb->group], &rb->box);
+ pcb_r_delete_entry(rd->layergrouptree[rb->group], &rb->box);
}
vector_destroy(&area_vec);
/* clean up; remove all 'source', 'target', and 'nobloat' flags */
@@ -4009,7 +4008,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
if (p->flags.source && p->conflicts_with)
vector_destroy(&p->conflicts_with);
p->flags.touched = p->flags.source = p->flags.target = p->flags.nobloat = 0;
- END_LOOP;
+ PCB_END_LOOP;
vector_destroy(&vss.free_space_vec);
vector_destroy(&vss.lo_conflict_space_vec);
@@ -4018,7 +4017,7 @@ static struct routeone_status RouteOne(routedata_t * rd, routebox_t * from, rout
return result;
}
-static void InitAutoRouteParameters(int pass, RouteStyleType * style, pcb_bool with_conflicts, pcb_bool is_smoothing, pcb_bool lastpass)
+static void InitAutoRouteParameters(int pass, pcb_route_style_t * style, pcb_bool with_conflicts, pcb_bool is_smoothing, pcb_bool lastpass)
{
int i;
/* routing style */
@@ -4031,7 +4030,7 @@ static void InitAutoRouteParameters(int pass, RouteStyleType * style, pcb_bool w
AutoRouteParameters.JogPenalty = 1000 * (is_smoothing ? 20 : 4);
AutoRouteParameters.CongestionPenalty = 1e6;
AutoRouteParameters.MinPenalty = EXPENSIVE;
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
if (is_layer_group_active[i]) {
AutoRouteParameters.MinPenalty = MIN(x_cost[i], AutoRouteParameters.MinPenalty);
AutoRouteParameters.MinPenalty = MIN(y_cost[i], AutoRouteParameters.MinPenalty);
@@ -4049,24 +4048,24 @@ static void InitAutoRouteParameters(int pass, RouteStyleType * style, pcb_bool w
}
#ifndef NDEBUG
-r_dir_t bad_boy(const BoxType * b, void *cl)
+pcb_r_dir_t bad_boy(const pcb_box_t * b, void *cl)
{
routebox_t *box = (routebox_t *) b;
if (box->type == EXPANSION_AREA)
- return R_DIR_FOUND_CONTINUE;
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_NOT_FOUND;
}
pcb_bool no_expansion_boxes(routedata_t * rd)
{
int i;
- BoxType big;
+ pcb_box_t big;
big.X1 = 0;
- big.X2 = MAX_COORD;
+ big.X2 = PCB_MAX_COORD;
big.Y1 = 0;
- big.Y2 = MAX_COORD;
- for (i = 0; i < max_group; i++) {
- if (r_search(rd->layergrouptree[i], &big, NULL, bad_boy, NULL, NULL))
+ big.Y2 = PCB_MAX_COORD;
+ for (i = 0; i < pcb_max_group; i++) {
+ if (pcb_r_search(rd->layergrouptree[i], &big, NULL, bad_boy, NULL, NULL))
return pcb_false;
}
return pcb_true;
@@ -4076,23 +4075,23 @@ pcb_bool no_expansion_boxes(routedata_t * rd)
static void ripout_livedraw_obj(routebox_t * rb)
{
if (rb->type == LINE && rb->livedraw_obj.line) {
- LayerType *layer = LAYER_PTR(PCB->LayerGroups.Entries[rb->group][0]);
+ pcb_layer_t *layer = LAYER_PTR(PCB->LayerGroups.Entries[rb->group][0]);
EraseLine(rb->livedraw_obj.line);
- DestroyObject(PCB->Data, PCB_TYPE_LINE, layer, rb->livedraw_obj.line, NULL);
+ pcb_destroy_object(PCB->Data, PCB_TYPE_LINE, layer, rb->livedraw_obj.line, NULL);
rb->livedraw_obj.line = NULL;
}
if (rb->type == VIA && rb->livedraw_obj.via) {
EraseVia(rb->livedraw_obj.via);
- DestroyObject(PCB->Data, PCB_TYPE_VIA, rb->livedraw_obj.via, NULL, NULL);
+ pcb_destroy_object(PCB->Data, PCB_TYPE_VIA, rb->livedraw_obj.via, NULL, NULL);
rb->livedraw_obj.via = NULL;
}
}
-static r_dir_t ripout_livedraw_obj_cb(const BoxType * b, void *cl)
+static pcb_r_dir_t ripout_livedraw_obj_cb(const pcb_box_t * b, void *cl)
{
routebox_t *box = (routebox_t *) b;
ripout_livedraw_obj(box);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
struct routeall_status {
@@ -4127,11 +4126,11 @@ struct routeall_status RouteAll(routedata_t * rd)
pcb_bool rip;
int request_cancel;
#ifdef NET_HEAP
- heap_t *net_heap;
+ pcb_heap_t *net_heap;
#endif
- heap_t *this_pass, *next_pass, *tmp;
+ pcb_heap_t *this_pass, *next_pass, *tmp;
routebox_t *net, *p, *pp;
- cost_t total_net_cost, last_cost = 0, this_cost = 0;
+ pcb_cost_t total_net_cost, last_cost = 0, this_cost = 0;
int i;
int this_heap_size;
int this_heap_item;
@@ -4139,27 +4138,27 @@ struct routeall_status RouteAll(routedata_t * rd)
/* initialize heap for first pass;
* do smallest area first; that makes
* the subsequent costs more representative */
- this_pass = heap_create();
- next_pass = heap_create();
+ this_pass = pcb_heap_create();
+ next_pass = pcb_heap_create();
#ifdef NET_HEAP
- net_heap = heap_create();
+ net_heap = pcb_heap_create();
#endif
LIST_LOOP(rd->first_net, different_net, net);
{
double area;
- BoxType bb = shrink_routebox(net);
+ pcb_box_t bb = shrink_routebox(net);
LIST_LOOP(net, same_net, p);
{
- MAKEMIN(bb.X1, p->sbox.X1);
- MAKEMIN(bb.Y1, p->sbox.Y1);
- MAKEMAX(bb.X2, p->sbox.X2);
- MAKEMAX(bb.Y2, p->sbox.Y2);
+ PCB_MAKE_MIN(bb.X1, p->sbox.X1);
+ PCB_MAKE_MIN(bb.Y1, p->sbox.Y1);
+ PCB_MAKE_MAX(bb.X2, p->sbox.X2);
+ PCB_MAKE_MAX(bb.Y2, p->sbox.Y2);
}
- END_LOOP;
+ PCB_END_LOOP;
area = (double) (bb.X2 - bb.X1) * (bb.Y2 - bb.Y1);
- heap_insert(this_pass, area, net);
+ pcb_heap_insert(this_pass, area, net);
}
- END_LOOP;
+ PCB_END_LOOP;
ras.total_nets_routed = 0;
/* refinement/finishing passes */
@@ -4171,15 +4170,15 @@ struct routeall_status RouteAll(routedata_t * rd)
printf("--------- STARTING SMOOTHING PASS %d -------------\n", i - passes);
#endif
ras.total_subnets = ras.routed_subnets = ras.conflict_subnets = ras.failed = ras.ripped = 0;
- assert(heap_is_empty(next_pass));
+ assert(pcb_heap_is_empty(next_pass));
- this_heap_size = heap_size(this_pass);
- for (this_heap_item = 0; !heap_is_empty(this_pass); this_heap_item++) {
+ this_heap_size = pcb_heap_size(this_pass);
+ for (this_heap_item = 0; !pcb_heap_is_empty(this_pass); this_heap_item++) {
#ifdef ROUTE_DEBUG
if (aabort)
break;
#endif
- net = (routebox_t *) heap_remove_smallest(this_pass);
+ net = (routebox_t *) pcb_heap_remove_smallest(this_pass);
InitAutoRouteParameters(i, net->style, i < passes, i > passes, i == passes + smoothes);
if (i > 0) {
/* rip up all unfixed traces in this net ? */
@@ -4192,7 +4191,7 @@ struct routeall_status RouteAll(routedata_t * rd)
rip = pcb_true;
break;
}
- END_LOOP;
+ PCB_END_LOOP;
}
LIST_LOOP(net, same_net, p);
@@ -4217,7 +4216,7 @@ struct routeall_status RouteAll(routedata_t * rd)
#ifndef NDEBUG
del =
#endif
- r_delete_entry(rd->layergrouptree[p->group], &p->box);
+ pcb_r_delete_entry(rd->layergrouptree[p->group], &p->box);
#ifndef NDEBUG
assert(del);
#endif
@@ -4226,16 +4225,16 @@ struct routeall_status RouteAll(routedata_t * rd)
p->flags.is_odd = AutoRouteParameters.is_odd;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (conf_core.editor.live_routing)
- Draw();
+ pcb_draw();
/* reset to original connectivity */
if (rip) {
ras.ripped++;
ResetSubnet(net);
}
else {
- heap_insert(next_pass, 0, net);
+ pcb_heap_insert(next_pass, 0, net);
continue;
}
}
@@ -4254,7 +4253,7 @@ struct routeall_status RouteAll(routedata_t * rd)
if (ras.total_subnets == 0)
#endif
{
- heap_insert(next_pass, 0, net);
+ pcb_heap_insert(next_pass, 0, net);
continue;
}
@@ -4263,19 +4262,19 @@ struct routeall_status RouteAll(routedata_t * rd)
LIST_LOOP(net, same_net, p);
{
#ifdef NET_HEAP
- BoxType b = shrink_routebox(p);
+ pcb_box_t b = shrink_routebox(p);
/* using a heap allows us to start from smaller objects and
* end at bigger ones. also prefer to start at planes, then pads */
- heap_insert(net_heap, (float) (b.X2 - b.X1) *
+ pcb_heap_insert(net_heap, (float) (b.X2 - b.X1) *
#if defined(ROUTE_RANDOMIZED)
(0.3 + pcb_rand() / (RAND_MAX + 1.0)) *
#endif
(b.Y2 - b.Y1) * (p->type == PLANE ? -1 : (p->type == PAD ? 1 : 10)), p);
}
- END_LOOP;
+ PCB_END_LOOP;
ros.net_completely_routed = 0;
- while (!heap_is_empty(net_heap)) {
- p = (routebox_t *) heap_remove_smallest(net_heap);
+ while (!pcb_heap_is_empty(net_heap)) {
+ p = (routebox_t *) pcb_heap_remove_smallest(net_heap);
#endif
if (!p->flags.fixed || p->flags.subnet_processed || p->type == OTHER)
continue;
@@ -4303,7 +4302,7 @@ struct routeall_status RouteAll(routedata_t * rd)
/* don't bother trying any other source in this subnet */
LIST_LOOP(p, same_subnet, pp);
pp->flags.subnet_processed = 1;
- END_LOOP;
+ PCB_END_LOOP;
break;
}
/* note that we can infer nothing about ras.total_subnets based
@@ -4311,17 +4310,17 @@ struct routeall_status RouteAll(routedata_t * rd)
* to route a net from a particular starting point, but perfectly
* able to route it from some other. */
percent = calculate_progress(this_heap_item, this_heap_size, &ras);
- request_cancel = gui->progress(percent * 100., 100, _("Autorouting tracks"));
+ request_cancel = pcb_gui->progress(percent * 100., 100, _("Autorouting tracks"));
if (request_cancel) {
ras.total_nets_routed = 0;
ras.conflict_subnets = 0;
- Message(PCB_MSG_DEFAULT, "Autorouting cancelled\n");
+ pcb_message(PCB_MSG_INFO, "Autorouting cancelled\n");
goto out;
}
}
}
#ifndef NET_HEAP
- END_LOOP;
+ PCB_END_LOOP;
#endif
if (!ros.net_completely_routed)
net->flags.is_bad = 1; /* don't skip this the next round */
@@ -4332,7 +4331,7 @@ struct routeall_status RouteAll(routedata_t * rd)
* but it will do no good to rip it up and try it again
* without first changing any of the other routes
*/
- heap_insert(next_pass, total_net_cost, net);
+ pcb_heap_insert(next_pass, total_net_cost, net);
if (total_net_cost < EXPENSIVE)
this_cost += total_net_cost;
/* reset subnet_processed flags */
@@ -4340,11 +4339,11 @@ struct routeall_status RouteAll(routedata_t * rd)
{
p->flags.subnet_processed = 0;
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* swap this_pass and next_pass and do it all over again! */
ro = 0;
- assert(heap_is_empty(this_pass));
+ assert(pcb_heap_is_empty(this_pass));
tmp = this_pass;
this_pass = next_pass;
next_pass = tmp;
@@ -4367,13 +4366,13 @@ struct routeall_status RouteAll(routedata_t * rd)
this_cost = 0;
}
- Message(PCB_MSG_DEFAULT, "%d of %d nets successfully routed.\n", ras.routed_subnets, ras.total_subnets);
+ pcb_message(PCB_MSG_INFO, "%d of %d nets successfully routed.\n", ras.routed_subnets, ras.total_subnets);
out:
- heap_destroy(&this_pass);
- heap_destroy(&next_pass);
+ pcb_heap_destroy(&this_pass);
+ pcb_heap_destroy(&next_pass);
#ifdef NET_HEAP
- heap_destroy(&net_heap);
+ pcb_heap_destroy(&net_heap);
#endif
/* no conflicts should be left at the end of the process. */
@@ -4383,23 +4382,23 @@ out:
}
struct fpin_info {
- PinTypePtr pin;
- Coord X, Y;
+ pcb_pin_t *pin;
+ pcb_coord_t X, Y;
jmp_buf env;
};
-static r_dir_t fpin_rect(const BoxType * b, void *cl)
+static pcb_r_dir_t fpin_rect(const pcb_box_t * b, void *cl)
{
- PinTypePtr pin = (PinTypePtr) b;
+ pcb_pin_t *pin = (pcb_pin_t *) b;
struct fpin_info *info = (struct fpin_info *) cl;
if (pin->X == info->X && pin->Y == info->Y) {
- info->pin = (PinTypePtr) b;
+ info->pin = (pcb_pin_t *) b;
longjmp(info->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static int FindPin(const BoxType * box, PinTypePtr * pin)
+static int FindPin(const pcb_box_t * box, pcb_pin_t ** pin)
{
struct fpin_info info;
@@ -4407,13 +4406,13 @@ static int FindPin(const BoxType * box, PinTypePtr * pin)
info.X = box->X1;
info.Y = box->Y1;
if (setjmp(info.env) == 0)
- r_search(PCB->Data->pin_tree, box, NULL, fpin_rect, &info, NULL);
+ pcb_r_search(PCB->Data->pin_tree, box, NULL, fpin_rect, &info, NULL);
else {
*pin = info.pin;
return PCB_TYPE_PIN;
}
if (setjmp(info.env) == 0)
- r_search(PCB->Data->via_tree, box, NULL, fpin_rect, &info, NULL);
+ pcb_r_search(PCB->Data->via_tree, box, NULL, fpin_rect, &info, NULL);
else {
*pin = info.pin;
return PCB_TYPE_VIA;
@@ -4428,7 +4427,7 @@ static int FindPin(const BoxType * box, PinTypePtr * pin)
pcb_bool IronDownAllUnfixedPaths(routedata_t * rd)
{
pcb_bool changed = pcb_false;
- LayerTypePtr layer;
+ pcb_layer_t *layer;
routebox_t *net, *p;
int i;
LIST_LOOP(rd->first_net, different_net, net);
@@ -4447,51 +4446,51 @@ pcb_bool IronDownAllUnfixedPaths(routedata_t * rd)
assert(layer && layer->On); /*at least one layer must be on in this group! */
assert(p->type != EXPANSION_AREA);
if (p->type == LINE) {
- Coord halfwidth = HALF_THICK(p->style->Thick);
+ pcb_coord_t halfwidth = HALF_THICK(p->style->Thick);
double th = halfwidth * 2 + 1;
- BoxType b;
+ pcb_box_t b;
assert(p->parent.line == NULL);
/* orthogonal; thickness is 2*halfwidth */
/* flip coordinates, if bl_to_ur */
b = p->sbox;
total_wire_length += sqrt((b.X2 - b.X1 - th) * (b.X2 - b.X1 - th) + (b.Y2 - b.Y1 - th) * (b.Y2 - b.Y1 - th));
- b = shrink_box(&b, halfwidth);
+ b = pcb_shrink_box(&b, halfwidth);
if (b.X2 == b.X1 + 1)
b.X2 = b.X1;
if (b.Y2 == b.Y1 + 1)
b.Y2 = b.Y1;
if (p->flags.bl_to_ur) {
- Coord t;
+ pcb_coord_t t;
t = b.X1;
b.X1 = b.X2;
b.X2 = t;
}
/* using CreateDrawn instead of CreateNew concatenates sequential lines */
- p->parent.line = CreateDrawnLineOnLayer
+ p->parent.line = pcb_line_new_merge
(layer, b.X1, b.Y1, b.X2, b.Y2,
- p->style->Thick, p->style->Clearance * 2, MakeFlags(PCB_FLAG_AUTO | (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)));
+ p->style->Thick, p->style->Clearance * 2, pcb_flag_make(PCB_FLAG_AUTO | (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)));
if (p->parent.line) {
- AddObjectToCreateUndoList(PCB_TYPE_LINE, layer, p->parent.line, p->parent.line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, layer, p->parent.line, p->parent.line);
changed = pcb_true;
}
}
else if (p->type == VIA || p->type == VIA_SHADOW) {
routebox_t *pp = (p->type == VIA_SHADOW) ? p->parent.via_shadow : p;
- Coord radius = HALF_THICK(pp->style->Diameter);
- BoxType b = shrink_routebox(p);
+ pcb_coord_t radius = HALF_THICK(pp->style->Diameter);
+ pcb_box_t b = shrink_routebox(p);
total_via_count++;
assert(pp->type == VIA);
if (pp->parent.via == NULL) {
assert(b.X1 + radius == b.X2 - radius);
assert(b.Y1 + radius == b.Y2 - radius);
pp->parent.via =
- CreateNewVia(PCB->Data, b.X1 + radius,
+ pcb_via_new(PCB->Data, b.X1 + radius,
b.Y1 + radius,
- pp->style->Diameter, 2 * pp->style->Clearance, 0, pp->style->Hole, NULL, MakeFlags(PCB_FLAG_AUTO));
+ pp->style->Diameter, 2 * pp->style->Clearance, 0, pp->style->Hole, NULL, pcb_flag_make(PCB_FLAG_AUTO));
assert(pp->parent.via);
if (pp->parent.via) {
- AddObjectToCreateUndoList(PCB_TYPE_VIA, pp->parent.via, pp->parent.via, pp->parent.via);
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, pp->parent.via, pp->parent.via, pp->parent.via);
changed = pcb_true;
}
}
@@ -4507,28 +4506,28 @@ pcb_bool IronDownAllUnfixedPaths(routedata_t * rd)
assert(0);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* loop again to place all the thermals now that the vias are down */
LIST_LOOP(net, same_net, p);
{
if (p->type == THERMAL) {
- PinTypePtr pin = NULL;
+ pcb_pin_t *pin = NULL;
/* thermals are alread a single point search, no need to shrink */
int type = FindPin(&p->box, &pin);
if (pin) {
- AddObjectToClearPolyUndoList(type, pin->Element ? pin->Element : pin, pin, pin, pcb_false);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, LAYER_PTR(p->layer), pin);
- AddObjectToFlagUndoList(type, pin->Element ? pin->Element : pin, pin, pin);
- ASSIGN_THERM(p->layer, PCB->ThermStyle, pin);
- AddObjectToClearPolyUndoList(type, pin->Element ? pin->Element : pin, pin, pin, pcb_true);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, LAYER_PTR(p->layer), pin);
+ pcb_undo_add_obj_to_clear_poly(type, pin->Element ? pin->Element : pin, pin, pin, pcb_false);
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_VIA, LAYER_PTR(p->layer), pin);
+ pcb_undo_add_obj_to_flag(type, pin->Element ? pin->Element : pin, pin, pin);
+ PCB_FLAG_THERM_ASSIGN(p->layer, PCB->ThermStyle, pin);
+ pcb_undo_add_obj_to_clear_poly(type, pin->Element ? pin->Element : pin, pin, pin, pcb_true);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_VIA, LAYER_PTR(p->layer), pin);
changed = pcb_true;
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
return changed;
}
@@ -4542,7 +4541,7 @@ pcb_bool AutoRoute(pcb_bool selected)
total_via_count = 0;
#ifdef ROUTE_DEBUG
- ddraw = gui->request_debug_draw();
+ ddraw = pcb_gui->request_debug_draw();
if (ddraw != NULL) {
ar_gc = ddraw->make_gc();
ddraw->set_line_cap(ar_gc, Round_Cap);
@@ -4552,25 +4551,25 @@ pcb_bool AutoRoute(pcb_bool selected)
for (i = 0; i < vtroutestyle_len(&PCB->RouteStyle); i++) {
if (PCB->RouteStyle.array[i].Thick == 0 ||
PCB->RouteStyle.array[i].Diameter == 0 || PCB->RouteStyle.array[i].Hole == 0 || PCB->RouteStyle.array[i].Clearance == 0) {
- Message(PCB_MSG_DEFAULT, "You must define proper routing styles\n" "before auto-routing.\n");
+ pcb_message(PCB_MSG_ERROR, "You must define proper routing styles\n" "before auto-routing.\n");
return (pcb_false);
}
}
if (ratlist_length(&PCB->Data->Rat) == 0)
return (pcb_false);
- SaveFindFlag(PCB_FLAG_DRC);
+ pcb_save_find_flag(PCB_FLAG_DRC);
rd = CreateRouteData();
if (1) {
routebox_t *net, *rb, *last;
int i = 0;
/* count number of rats selected */
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
{
- if (!selected || TEST_FLAG(PCB_FLAG_SELECTED, line))
+ if (!selected || PCB_FLAG_TEST(PCB_FLAG_SELECTED, line))
i++;
}
- END_LOOP;
+ PCB_END_LOOP;
#ifdef ROUTE_VERBOSE
printf("%d nets!\n", i);
#endif
@@ -4578,8 +4577,8 @@ pcb_bool AutoRoute(pcb_bool selected)
goto donerouting; /* nothing to do here */
/* if only one rat selected, do things the quick way. =) */
if (i == 1) {
- RAT_LOOP(PCB->Data);
- if (!selected || TEST_FLAG(PCB_FLAG_SELECTED, line)) {
+ PCB_RAT_LOOP(PCB->Data);
+ if (!selected || PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) {
/* look up the end points of this rat line */
routebox_t *a;
routebox_t *b;
@@ -4601,7 +4600,7 @@ pcb_bool AutoRoute(pcb_bool selected)
changed = RouteOne(rd, a, b, 150000).found_route || changed;
goto donerouting;
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* otherwise, munge the netlists so that only the selected rats
* get connected. */
@@ -4624,18 +4623,18 @@ pcb_bool AutoRoute(pcb_bool selected)
{
rb->same_net = rb->same_subnet;
}
- END_LOOP;
+ PCB_END_LOOP;
/* at this point all nets are equal to their subnets */
}
- END_LOOP;
+ PCB_END_LOOP;
if (last) {
last->different_net.next = rd->first_net;
rd->first_net->different_net.prev = last;
}
/* now merge only those subnets connected by a rat line */
- RAT_LOOP(PCB->Data);
- if (!selected || TEST_FLAG(PCB_FLAG_SELECTED, line)) {
+ PCB_RAT_LOOP(PCB->Data);
+ if (!selected || PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) {
/* look up the end points of this rat line */
routebox_t *a;
routebox_t *b;
@@ -4643,29 +4642,29 @@ pcb_bool AutoRoute(pcb_bool selected)
b = FindRouteBoxOnLayerGroup(rd, line->Point2.X, line->Point2.Y, line->group2);
if (!a || !b) {
#ifdef DEBUG_STALE_RATS
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line);
- ASSIGN_FLAG(PCB_FLAG_SELECTED, pcb_true, line);
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_ASSIGN(PCB_FLAG_SELECTED, pcb_true, line);
DrawRat(line, 0);
#endif /* DEBUG_STALE_RATS */
- Message(PCB_MSG_DEFAULT, "The rats nest is stale! Aborting autoroute...\n");
+ pcb_message(PCB_MSG_ERROR, "The rats nest is stale! Aborting autoroute...\n");
goto donerouting;
}
/* merge subnets into a net! */
MergeNets(a, b, NET);
}
- END_LOOP;
+ PCB_END_LOOP;
/* now 'different_net' may point to too many different nets. Reset. */
LIST_LOOP(rd->first_net, different_net, net);
{
if (!net->flags.touched) {
LIST_LOOP(net, same_net, rb);
rb->flags.touched = 1;
- END_LOOP;
+ PCB_END_LOOP;
}
else /* this is not a "different net"! */
RemoveFromNet(net, DIFFERENT_NET);
}
- END_LOOP;
+ PCB_END_LOOP;
/* reset "touched" flag */
LIST_LOOP(rd->first_net, different_net, net);
{
@@ -4674,20 +4673,20 @@ pcb_bool AutoRoute(pcb_bool selected)
assert(rb->flags.touched);
rb->flags.touched = 0;
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
}
/* okay, rd's idea of netlist now corresponds to what we want routed */
/* auto-route all nets */
changed = (RouteAll(rd).total_nets_routed > 0) || changed;
donerouting:
- gui->progress(0, 0, NULL);
+ pcb_gui->progress(0, 0, NULL);
if (conf_core.editor.live_routing) {
int i;
- BoxType big = { 0, 0, MAX_COORD, MAX_COORD };
- for (i = 0; i < max_group; i++) {
- r_search(rd->layergrouptree[i], &big, NULL, ripout_livedraw_obj_cb, NULL, NULL);
+ pcb_box_t big = { 0, 0, PCB_MAX_COORD, PCB_MAX_COORD };
+ for (i = 0; i < pcb_max_group; i++) {
+ pcb_r_search(rd->layergrouptree[i], &big, NULL, ripout_livedraw_obj_cb, NULL, NULL);
}
}
#ifdef ROUTE_DEBUG
@@ -4697,22 +4696,22 @@ donerouting:
if (changed)
changed = IronDownAllUnfixedPaths(rd);
- Message(PCB_MSG_DEFAULT, "Total added wire length = %$mS, %d vias added\n", (Coord) total_wire_length, total_via_count);
+ pcb_message(PCB_MSG_INFO, "Total added wire length = %$mS, %d vias added\n", (pcb_coord_t) total_wire_length, total_via_count);
DestroyRouteData(&rd);
if (changed) {
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
/* optimize rats, we've changed connectivity a lot. */
- DeleteRats(pcb_false /*all rats */ );
- RestoreUndoSerialNumber();
- AddAllRats(pcb_false /*all rats */ , NULL);
- RestoreUndoSerialNumber();
+ pcb_rats_destroy(pcb_false /*all rats */ );
+ pcb_undo_restore_serial();
+ pcb_rat_add_all(pcb_false /*all rats */ , NULL);
+ pcb_undo_restore_serial();
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
- Redraw();
+ pcb_redraw();
}
- RestoreFindFlag();
+ pcb_restore_find_flag();
#if defined (ROUTE_DEBUG)
aabort = 0;
#endif
diff --git a/src_plugins/autoroute/autoroute.h b/src_plugins/autoroute/autoroute.h
index fef51f5..c0dcdb0 100644
--- a/src_plugins/autoroute/autoroute.h
+++ b/src_plugins/autoroute/autoroute.h
@@ -35,7 +35,8 @@
#ifndef PCB_AUTOROUTE_H
#define PCB_AUTOROUTE_H
-#include "global.h"
+#include "config.h"
+#include "board.h"
pcb_bool AutoRoute(pcb_bool);
diff --git a/src_plugins/autoroute/mtspace.c b/src_plugins/autoroute/mtspace.c
index 30ad953..73c7150 100644
--- a/src_plugins/autoroute/mtspace.c
+++ b/src_plugins/autoroute/mtspace.c
@@ -36,8 +36,6 @@
#include "config.h"
-#include "global.h"
-
#include <assert.h>
#include <setjmp.h>
@@ -54,20 +52,20 @@
*/
typedef struct mtspacebox {
- const BoxType box;
- Coord clearance; /* the smallest clearance around this box */
+ const pcb_box_t box;
+ pcb_coord_t clearance; /* the smallest clearance around this box */
} mtspacebox_t;
/* this is an mtspace_t */
struct mtspace {
/* rtrees keeping track of regions expanded by their required clearance. */
/* one for fixed, even, and odd */
- rtree_t *ftree, *etree, *otree;
+ pcb_rtree_t *ftree, *etree, *otree;
};
typedef union {
vector_t *v;
- heap_t *h;
+ pcb_heap_t *h;
} heap_or_vector;
/* this is a vetting_t */
@@ -76,22 +74,22 @@ struct vetting {
heap_or_vector no_fix;
heap_or_vector no_hi;
heap_or_vector hi_candidate;
- Coord radius;
- Coord clearance;
- CheapPointType desired;
+ pcb_coord_t radius;
+ pcb_coord_t clearance;
+ pcb_cheap_point_t desired;
};
#define SPECIAL 823157
-mtspacebox_t *mtspace_create_box(const BoxType * box, Coord clearance)
+mtspacebox_t *mtspace_create_box(const pcb_box_t * box, pcb_coord_t clearance)
{
mtspacebox_t *mtsb;
- assert(box_is_good(box));
+ assert(pcb_box_is_good(box));
mtsb = (mtspacebox_t *) malloc(sizeof(*mtsb));
/* the box was sent to us pre-bloated by the clearance amount */
- *((BoxTypePtr) & mtsb->box) = *box;
+ *((pcb_box_t *) & mtsb->box) = *box;
mtsb->clearance = clearance;
- assert(box_is_good(&mtsb->box));
+ assert(pcb_box_is_good(&mtsb->box));
return mtsb;
}
@@ -102,9 +100,9 @@ mtspace_t *mtspace_create(void)
/* create mtspace data structure */
mtspace = (mtspace_t *) malloc(sizeof(*mtspace));
- mtspace->ftree = r_create_tree(NULL, 0, 0);
- mtspace->etree = r_create_tree(NULL, 0, 0);
- mtspace->otree = r_create_tree(NULL, 0, 0);
+ mtspace->ftree = pcb_r_create_tree(NULL, 0, 0);
+ mtspace->etree = pcb_r_create_tree(NULL, 0, 0);
+ mtspace->otree = pcb_r_create_tree(NULL, 0, 0);
/* done! */
return mtspace;
}
@@ -113,21 +111,21 @@ mtspace_t *mtspace_create(void)
void mtspace_destroy(mtspace_t ** mtspacep)
{
assert(mtspacep);
- r_destroy_tree(&(*mtspacep)->ftree);
- r_destroy_tree(&(*mtspacep)->etree);
- r_destroy_tree(&(*mtspacep)->otree);
+ pcb_r_destroy_tree(&(*mtspacep)->ftree);
+ pcb_r_destroy_tree(&(*mtspacep)->etree);
+ pcb_r_destroy_tree(&(*mtspacep)->otree);
free(*mtspacep);
*mtspacep = NULL;
}
struct mts_info {
- Coord clearance;
- BoxType box;
- rtree_t *tree;
+ pcb_coord_t clearance;
+ pcb_box_t box;
+ pcb_rtree_t *tree;
jmp_buf env;
};
-static r_dir_t mts_remove_one(const BoxType * b, void *cl)
+static pcb_r_dir_t mts_remove_one(const pcb_box_t * b, void *cl)
{
struct mts_info *info = (struct mts_info *) cl;
mtspacebox_t *box = (mtspacebox_t *) b;
@@ -136,13 +134,13 @@ static r_dir_t mts_remove_one(const BoxType * b, void *cl)
/* the info box is pre-bloated, so just check equality */
if (b->X1 == info->box.X1 && b->X2 == info->box.X2 &&
b->Y1 == info->box.Y1 && b->Y2 == info->box.Y2 && box->clearance == info->clearance) {
- r_delete_entry(info->tree, b);
+ pcb_r_delete_entry(info->tree, b);
longjmp(info->env, 1);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-rtree_t *which_tree(mtspace_t * mtspace, mtspace_type_t which)
+pcb_rtree_t *which_tree(mtspace_t * mtspace, mtspace_type_t which)
{
switch (which) {
case FIXED:
@@ -155,47 +153,47 @@ rtree_t *which_tree(mtspace_t * mtspace, mtspace_type_t which)
}
/* add a space-filler to the empty space representation. */
-void mtspace_add(mtspace_t * mtspace, const BoxType * box, mtspace_type_t which, Coord clearance)
+void mtspace_add(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance)
{
mtspacebox_t *filler = mtspace_create_box(box, clearance);
- r_insert_entry(which_tree(mtspace, which), (const BoxType *) filler, 1);
+ pcb_r_insert_entry(which_tree(mtspace, which), (const pcb_box_t *) filler, 1);
}
/* remove a space-filler from the empty space representation. */
-void mtspace_remove(mtspace_t * mtspace, const BoxType * box, mtspace_type_t which, Coord clearance)
+void mtspace_remove(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance)
{
struct mts_info cl;
- BoxType small_search;
+ pcb_box_t small_search;
cl.clearance = clearance;
cl.box = *box;
cl.tree = which_tree(mtspace, which);
- small_search = box_center(box);
+ small_search = pcb_box_center(box);
if (setjmp(cl.env) == 0) {
- r_search(cl.tree, &small_search, NULL, mts_remove_one, &cl, NULL);
+ pcb_r_search(cl.tree, &small_search, NULL, mts_remove_one, &cl, NULL);
assert(0); /* didn't find it?? */
}
}
struct query_closure {
- BoxType *cbox;
+ pcb_box_t *cbox;
heap_or_vector checking;
heap_or_vector touching;
- CheapPointType *desired;
- Coord radius, clearance;
+ pcb_cheap_point_t *desired;
+ pcb_coord_t radius, clearance;
jmp_buf env;
pcb_bool touch_is_vec;
};
-static inline void heap_append(heap_t * heap, CheapPointType * desired, BoxType * newone)
+static inline void heap_append(pcb_heap_t * heap, pcb_cheap_point_t * desired, pcb_box_t * newone)
{
- CheapPointType p = *desired;
+ pcb_cheap_point_t p = *desired;
assert(desired);
- closest_point_in_box(&p, newone);
- heap_insert(heap, PCB_ABS(p.X - desired->X) + (p.Y - desired->Y), newone);
+ pcb_closest_pcb_point_in_box(&p, newone);
+ pcb_heap_insert(heap, PCB_ABS(p.X - desired->X) + (p.Y - desired->Y), newone);
}
-static inline void append(struct query_closure *qc, BoxType * newone)
+static inline void append(struct query_closure *qc, pcb_box_t * newone)
{
if (qc->desired)
heap_append(qc->checking.h, qc->desired, newone);
@@ -207,12 +205,12 @@ static inline void append(struct query_closure *qc, BoxType * newone)
* First check if it does intersect, then break it into
* overlaping regions that don't intersect this box.
*/
-static r_dir_t query_one(const BoxType * box, void *cl)
+static pcb_r_dir_t query_one(const pcb_box_t * box, void *cl)
{
struct query_closure *qc = (struct query_closure *) cl;
mtspacebox_t *mtsb = (mtspacebox_t *) box;
- Coord shrink;
- assert(box_intersect(qc->cbox, &mtsb->box));
+ pcb_coord_t shrink;
+ assert(pcb_box_intersect(qc->cbox, &mtsb->box));
/* we need to satisfy the larger of the two clearances */
if (qc->clearance > mtsb->clearance)
shrink = mtsb->clearance;
@@ -222,13 +220,13 @@ static r_dir_t query_one(const BoxType * box, void *cl)
* then we didn't actually touch this box */
if (qc->cbox->X1 + shrink >= mtsb->box.X2 ||
qc->cbox->X2 - shrink <= mtsb->box.X1 || qc->cbox->Y1 + shrink >= mtsb->box.Y2 || qc->cbox->Y2 - shrink <= mtsb->box.Y1)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
/* ok, we do touch this box, now create up to 4 boxes that don't */
if (mtsb->box.Y1 > qc->cbox->Y1 + shrink) { /* top region exists */
- Coord Y1 = qc->cbox->Y1;
- Coord Y2 = mtsb->box.Y1 + shrink;
+ pcb_coord_t Y1 = qc->cbox->Y1;
+ pcb_coord_t Y2 = mtsb->box.Y1 + shrink;
if (Y2 - Y1 >= 2 * (qc->radius + qc->clearance)) {
- BoxType *newone = (BoxType *) malloc(sizeof(BoxType));
+ pcb_box_t *newone = (pcb_box_t *) malloc(sizeof(pcb_box_t));
newone->X1 = qc->cbox->X1;
newone->X2 = qc->cbox->X2;
newone->Y1 = Y1;
@@ -238,10 +236,10 @@ static r_dir_t query_one(const BoxType * box, void *cl)
}
}
if (mtsb->box.Y2 < qc->cbox->Y2 - shrink) { /* bottom region exists */
- Coord Y1 = mtsb->box.Y2 - shrink;
- Coord Y2 = qc->cbox->Y2;
+ pcb_coord_t Y1 = mtsb->box.Y2 - shrink;
+ pcb_coord_t Y2 = qc->cbox->Y2;
if (Y2 - Y1 >= 2 * (qc->radius + qc->clearance)) {
- BoxType *newone = (BoxType *) malloc(sizeof(BoxType));
+ pcb_box_t *newone = (pcb_box_t *) malloc(sizeof(pcb_box_t));
newone->X1 = qc->cbox->X1;
newone->X2 = qc->cbox->X2;
newone->Y2 = qc->cbox->Y2;
@@ -251,11 +249,11 @@ static r_dir_t query_one(const BoxType * box, void *cl)
}
}
if (mtsb->box.X1 > qc->cbox->X1 + shrink) { /* left region exists */
- Coord X1 = qc->cbox->X1;
- Coord X2 = mtsb->box.X1 + shrink;
+ pcb_coord_t X1 = qc->cbox->X1;
+ pcb_coord_t X2 = mtsb->box.X1 + shrink;
if (X2 - X1 >= 2 * (qc->radius + qc->clearance)) {
- BoxType *newone;
- newone = (BoxType *) malloc(sizeof(BoxType));
+ pcb_box_t *newone;
+ newone = (pcb_box_t *) malloc(sizeof(pcb_box_t));
newone->Y1 = qc->cbox->Y1;
newone->Y2 = qc->cbox->Y2;
newone->X1 = qc->cbox->X1;
@@ -265,10 +263,10 @@ static r_dir_t query_one(const BoxType * box, void *cl)
}
}
if (mtsb->box.X2 < qc->cbox->X2 - shrink) { /* right region exists */
- Coord X1 = mtsb->box.X2 - shrink;
- Coord X2 = qc->cbox->X2;
+ pcb_coord_t X1 = mtsb->box.X2 - shrink;
+ pcb_coord_t X2 = qc->cbox->X2;
if (X2 - X1 >= 2 * (qc->radius + qc->clearance)) {
- BoxType *newone = (BoxType *) malloc(sizeof(BoxType));
+ pcb_box_t *newone = (pcb_box_t *) malloc(sizeof(pcb_box_t));
newone->Y1 = qc->cbox->Y1;
newone->Y2 = qc->cbox->Y2;
newone->X2 = qc->cbox->X2;
@@ -286,7 +284,7 @@ static r_dir_t query_one(const BoxType * box, void *cl)
else
free(qc->cbox); /* done with this one */
longjmp(qc->env, 1);
- return R_DIR_FOUND_CONTINUE; /* never reached */
+ return PCB_R_DIR_FOUND_CONTINUE; /* never reached */
}
/* qloop takes a vector (or heap) of regions to check (checking) if they don't intersect
@@ -297,17 +295,17 @@ static r_dir_t query_one(const BoxType * box, void *cl)
* it returns pcb_true if it has exhausted the region vector/heap and never
* found an empty area.
*/
-static void qloop(struct query_closure *qc, rtree_t * tree, heap_or_vector res, pcb_bool is_vec)
+static void qloop(struct query_closure *qc, pcb_rtree_t * tree, heap_or_vector res, pcb_bool is_vec)
{
- BoxType *cbox;
+ pcb_box_t *cbox;
int n;
- while (!(qc->desired ? heap_is_empty(qc->checking.h) : vector_is_empty(qc->checking.v))) {
- cbox = qc->desired ? (BoxTypePtr) heap_remove_smallest(qc->checking.h) : (BoxTypePtr) vector_remove_last(qc->checking.v);
+ while (!(qc->desired ? pcb_heap_is_empty(qc->checking.h) : vector_is_empty(qc->checking.v))) {
+ cbox = qc->desired ? (pcb_box_t *) pcb_heap_remove_smallest(qc->checking.h) : (pcb_box_t *) vector_remove_last(qc->checking.v);
if (setjmp(qc->env) == 0) {
- assert(box_is_good(cbox));
+ assert(pcb_box_is_good(cbox));
qc->cbox = cbox;
- r_search(tree, cbox, NULL, query_one, qc, &n);
+ pcb_r_search(tree, cbox, NULL, query_one, qc, &n);
assert(n == 0);
/* nothing intersected with this tree, put it in the result vector */
if (is_vec)
@@ -328,14 +326,14 @@ void mtsFreeWork(vetting_t ** w)
{
vetting_t *work = (*w);
if (work->desired.X != -SPECIAL || work->desired.Y != -SPECIAL) {
- heap_free(work->untested.h, free);
- heap_destroy(&work->untested.h);
- heap_free(work->no_fix.h, free);
- heap_destroy(&work->no_fix.h);
- heap_free(work->no_hi.h, free);
- heap_destroy(&work->no_hi.h);
- heap_free(work->hi_candidate.h, free);
- heap_destroy(&work->hi_candidate.h);
+ pcb_heap_free(work->untested.h, free);
+ pcb_heap_destroy(&work->untested.h);
+ pcb_heap_free(work->no_fix.h, free);
+ pcb_heap_destroy(&work->no_fix.h);
+ pcb_heap_free(work->no_hi.h, free);
+ pcb_heap_destroy(&work->no_hi.h);
+ pcb_heap_free(work->hi_candidate.h, free);
+ pcb_heap_destroy(&work->hi_candidate.h);
}
else {
while (!vector_is_empty(work->untested.v))
@@ -371,12 +369,12 @@ void mtsFreeWork(vetting_t ** w)
* to search harder for such regions if the computation becomes
* necessary.
*/
-vetting_t *mtspace_query_rect(mtspace_t * mtspace, const BoxType * region,
- Coord radius, Coord clearance,
+vetting_t *mtspace_query_rect(mtspace_t * mtspace, const pcb_box_t * region,
+ pcb_coord_t radius, pcb_coord_t clearance,
vetting_t * work,
vector_t * free_space_vec,
vector_t * lo_conflict_space_vec,
- vector_t * hi_conflict_space_vec, pcb_bool is_odd, pcb_bool with_conflicts, CheapPointType * desired)
+ vector_t * hi_conflict_space_vec, pcb_bool is_odd, pcb_bool with_conflicts, pcb_cheap_point_t * desired)
{
struct query_closure qc;
@@ -386,24 +384,24 @@ vetting_t *mtspace_query_rect(mtspace_t * mtspace, const BoxType * region,
assert(hi_conflict_space_vec);
/* search out to anything that might matter */
if (region) {
- BoxType *cbox;
+ pcb_box_t *cbox;
assert(work == NULL);
- assert(box_is_good(region));
+ assert(pcb_box_is_good(region));
assert(vector_is_empty(free_space_vec));
assert(vector_is_empty(lo_conflict_space_vec));
assert(vector_is_empty(hi_conflict_space_vec));
work = (vetting_t *) malloc(sizeof(vetting_t));
work->clearance = clearance;
work->radius = radius;
- cbox = (BoxType *) malloc(sizeof(BoxType));
- *cbox = bloat_box(region, clearance + radius);
+ cbox = (pcb_box_t *) malloc(sizeof(pcb_box_t));
+ *cbox = pcb_bloat_box(region, clearance + radius);
if (desired) {
- work->untested.h = heap_create();
- work->no_fix.h = heap_create();
- work->hi_candidate.h = heap_create();
- work->no_hi.h = heap_create();
+ work->untested.h = pcb_heap_create();
+ work->no_fix.h = pcb_heap_create();
+ work->hi_candidate.h = pcb_heap_create();
+ work->no_hi.h = pcb_heap_create();
assert(work->untested.h && work->no_fix.h && work->no_hi.h && work->hi_candidate.h);
- heap_insert(work->untested.h, 0, cbox);
+ pcb_heap_insert(work->untested.h, 0, cbox);
work->desired = *desired;
}
else {
@@ -455,7 +453,7 @@ vetting_t *mtspace_query_rect(mtspace_t * mtspace, const BoxType * region,
/* qloop (&qc, is_odd ? mtspace->etree : mtspace->otree, (heap_or_vector)free_space_vec, pcb_true); */
if (!vector_is_empty(free_space_vec)) {
if (qc.desired) {
- if (heap_is_empty(work->untested.h))
+ if (pcb_heap_is_empty(work->untested.h))
break;
}
else {
@@ -480,9 +478,9 @@ vetting_t *mtspace_query_rect(mtspace_t * mtspace, const BoxType * region,
/* (heap_or_vector)hi_conflict_space_vec, pcb_true); */
}
}
- while (!(qc.desired ? heap_is_empty(work->untested.h) : vector_is_empty(work->untested.v)));
+ while (!(qc.desired ? pcb_heap_is_empty(work->untested.h) : vector_is_empty(work->untested.v)));
if (qc.desired) {
- if (heap_is_empty(work->no_fix.h) && heap_is_empty(work->no_hi.h) && heap_is_empty(work->hi_candidate.h)) {
+ if (pcb_heap_is_empty(work->no_fix.h) && pcb_heap_is_empty(work->no_hi.h) && pcb_heap_is_empty(work->hi_candidate.h)) {
mtsFreeWork(&work);
return NULL;
}
diff --git a/src_plugins/autoroute/mtspace.h b/src_plugins/autoroute/mtspace.h
index 6f62dc5..fef47ee 100644
--- a/src_plugins/autoroute/mtspace.h
+++ b/src_plugins/autoroute/mtspace.h
@@ -38,7 +38,7 @@
/* mtspace data structures are built on r-trees. */
-#include "global.h"
+#include "config.h"
#include "vector.h" /* for vector_t in mtspace_query_rect prototype */
typedef struct mtspace mtspace_t;
@@ -56,20 +56,20 @@ void mtspace_destroy(mtspace_t ** mtspacep);
* should *not* be bloated; it should be "true". The feature will fill
* *at least* a radius of clearance around it;
*/
-void mtspace_add(mtspace_t * mtspace, const BoxType * box, mtspace_type_t which, Coord clearance);
+void mtspace_add(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance);
/* remove a space-filler from the empty space representation. The given box
* should *not* be bloated; it should be "true". The feature will fill
* *at least* a radius of clearance around it;
*/
-void mtspace_remove(mtspace_t * mtspace, const BoxType * box, mtspace_type_t which, Coord clearance);
+void mtspace_remove(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance);
-vetting_t *mtspace_query_rect(mtspace_t * mtspace, const BoxType * region,
- Coord radius, Coord clearance,
+vetting_t *mtspace_query_rect(mtspace_t * mtspace, const pcb_box_t * region,
+ pcb_coord_t radius, pcb_coord_t clearance,
vetting_t * work,
vector_t * free_space_vec,
vector_t * lo_conflict_space_vec,
- vector_t * hi_conflict_space_vec, pcb_bool is_odd, pcb_bool with_conflicts, CheapPointType * desired);
+ vector_t * hi_conflict_space_vec, pcb_bool is_odd, pcb_bool with_conflicts, pcb_cheap_point_t * desired);
void mtsFreeWork(vetting_t **);
int mtsBoxCount(vetting_t *);
diff --git a/src_plugins/autoroute/vector.c b/src_plugins/autoroute/vector.c
index 5bc3158..1df798a 100644
--- a/src_plugins/autoroute/vector.c
+++ b/src_plugins/autoroute/vector.c
@@ -36,8 +36,9 @@
#include <stdlib.h>
#include <string.h>
-#include "global.h"
+#include "math_helper.h"
#include "vector.h"
+#include "macro.h"
/* ---------------------------------------------------------------------------
* some local prototypes
diff --git a/src_plugins/boardflip/Makefile b/src_plugins/boardflip/Makefile
index 03c3cbd..da1ec3a 100644
--- a/src_plugins/boardflip/Makefile
+++ b/src_plugins/boardflip/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_boardflip
+ cd ../../src && $(MAKE) mod_boardflip
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/boardflip/boardflip.c b/src_plugins/boardflip/boardflip.c
index 83ae8c7..465af74 100644
--- a/src_plugins/boardflip/boardflip.c
+++ b/src_plugins/boardflip/boardflip.c
@@ -28,15 +28,17 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
+#include "rats.h"
+#include "polygon.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "plugins.h"
+#include "obj_all.h"
#include "hid_actions.h"
+#include "compat_misc.h"
/* Things that need to be flipped:
@@ -57,127 +59,127 @@
#define FLIP(y) (y) = h - (y)
#define NEG(y) (y) = - (y)
-static int boardflip(int argc, const char **argv, Coord x, Coord y)
+static int boardflip(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int h = PCB->MaxHeight;
int sides = 0;
- if (argc > 0 && strcasecmp(argv[0], "sides") == 0)
+ if (argc > 0 && pcb_strcasecmp(argv[0], "sides") == 0)
sides = 1;
printf("argc %d argv %s sides %d\n", argc, argc > 0 ? argv[0] : "", sides);
- LAYER_LOOP(PCB->Data, max_copper_layer + 2);
+ LAYER_LOOP(PCB->Data, pcb_max_copper_layer + 2);
{
- LINE_LOOP(layer);
+ PCB_LINE_LOOP(layer);
{
FLIP(line->Point1.Y);
FLIP(line->Point2.Y);
}
- END_LOOP;
- TEXT_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_TEXT_LOOP(layer);
{
FLIP(text->Y);
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, text);
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, text);
}
- END_LOOP;
- POLYGON_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_POLY_LOOP(layer);
{
int i, j;
- POLYGONPOINT_LOOP(polygon);
+ PCB_POLY_POINT_LOOP(polygon);
{
FLIP(point->Y);
}
- END_LOOP;
+ PCB_END_LOOP;
i = 0;
j = polygon->PointN - 1;
while (i < j) {
- PointType p = polygon->Points[i];
+ pcb_point_t p = polygon->Points[i];
polygon->Points[i] = polygon->Points[j];
polygon->Points[j] = p;
i++;
j--;
}
- InitClip(PCB->Data, layer, polygon);
+ pcb_poly_init_clip(PCB->Data, layer, polygon);
}
- END_LOOP;
- ARC_LOOP(layer);
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(layer);
{
FLIP(arc->Y);
NEG(arc->StartAngle);
NEG(arc->Delta);
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
{
FLIP(via->Y);
}
- END_LOOP;
- ELEMENT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_ELEMENT_LOOP(PCB->Data);
{
FLIP(element->MarkY);
if (sides)
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, element);
- ELEMENTTEXT_LOOP(element);
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, element);
+ PCB_ELEMENT_PCB_TEXT_LOOP(element);
{
FLIP(text->Y);
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, text);
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, text);
}
- END_LOOP;
- ELEMENTLINE_LOOP(element);
+ PCB_END_LOOP;
+ PCB_ELEMENT_PCB_LINE_LOOP(element);
{
FLIP(line->Point1.Y);
FLIP(line->Point2.Y);
}
- END_LOOP;
- ELEMENTARC_LOOP(element);
+ PCB_END_LOOP;
+ PCB_ELEMENT_ARC_LOOP(element);
{
FLIP(arc->Y);
NEG(arc->StartAngle);
NEG(arc->Delta);
}
- END_LOOP;
- PIN_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PIN_LOOP(element);
{
FLIP(pin->Y);
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
FLIP(pad->Point1.Y);
FLIP(pad->Point2.Y);
if (sides)
- TOGGLE_FLAG(PCB_FLAG_ONSOLDER, pad);
+ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, pad);
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
- RAT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_RAT_LOOP(PCB->Data);
{
FLIP(line->Point1.Y);
FLIP(line->Point2.Y);
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
-static HID_Action boardflip_action_list[] = {
+static pcb_hid_action_t boardflip_action_list[] = {
{"BoardFlip", NULL, boardflip, NULL, NULL}
};
char *boardflip_cookie = "boardflip plugin";
-REGISTER_ACTIONS(boardflip_action_list, boardflip_cookie)
+PCB_REGISTER_ACTIONS(boardflip_action_list, boardflip_cookie)
static void hid_boardflip_uninit(void)
{
- hid_remove_actions_by_cookie(boardflip_cookie);
+ pcb_hid_remove_actions_by_cookie(boardflip_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_boardflip_init()
{
- REGISTER_ACTIONS(boardflip_action_list, boardflip_cookie);
+ PCB_REGISTER_ACTIONS(boardflip_action_list, boardflip_cookie);
return hid_boardflip_uninit;
}
diff --git a/src_plugins/dbus/Makefile b/src_plugins/dbus/Makefile
index 61529b2..9dc4e57 100644
--- a/src_plugins/dbus/Makefile
+++ b/src_plugins/dbus/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_dbus
+ cd ../../src && $(MAKE) mod_dbus
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/dbus/dbus-pcbmain.c b/src_plugins/dbus/dbus-pcbmain.c
index fc318c4..5a76ccd 100644
--- a/src_plugins/dbus/dbus-pcbmain.c
+++ b/src_plugins/dbus/dbus-pcbmain.c
@@ -29,26 +29,26 @@
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus.h>
#include <stdio.h>
-
-#include "global.h"
+#include <stdlib.h>
#include "dbus-pcbmain.h"
+#include "hid.h"
typedef struct _IOWatchHandler IOWatchHandler;
typedef struct _TimeoutHandler TimeoutHandler;
struct _IOWatchHandler {
DBusWatch *dbus_watch;
- hidval pcb_watch;
+ pcb_hidval_t pcb_watch;
};
struct _TimeoutHandler {
DBusTimeout *dbus_timeout;
- hidval pcb_timer;
+ pcb_hidval_t pcb_timer;
int interval;
};
-static void block_hook_cb(hidval data)
+static void block_hook_cb(pcb_hidval_t data)
{
DBusConnection *connection = (DBusConnection *) data.ptr;
if (dbus_connection_get_dispatch_status(connection) != DBUS_DISPATCH_DATA_REMAINS)
@@ -70,13 +70,13 @@ static void io_watch_handler_dbus_freed(void *data)
handler = (IOWatchHandler *) data;
/* Remove the watch registered with the HID */
- if (gui != NULL)
- gui->unwatch_file(handler->pcb_watch);
+ if (pcb_gui != NULL)
+ pcb_gui->unwatch_file(handler->pcb_watch);
free(handler);
}
-void io_watch_handler_cb(hidval pcb_watch, int fd, unsigned int condition, hidval data)
+void io_watch_handler_cb(pcb_hidval_t pcb_watch, int fd, unsigned int condition, pcb_hidval_t data)
{
IOWatchHandler *handler;
unsigned int dbus_condition = 0;
@@ -115,12 +115,12 @@ static void timeout_handler_dbus_freed(void *data)
handler = (TimeoutHandler *) data;
/* Remove the timeout registered with the HID */
- gui->stop_timer(handler->pcb_timer);
+ pcb_gui->stop_timer(handler->pcb_timer);
free(handler);
}
-void timeout_handler_cb(hidval data)
+void timeout_handler_cb(pcb_hidval_t data)
{
TimeoutHandler *handler;
handler = (TimeoutHandler *) data.ptr;
@@ -128,7 +128,7 @@ void timeout_handler_cb(hidval data)
/* Re-add the timeout, as PCB will remove the current one
Do this before calling to dbus, incase DBus removes the timeout.
We can't touch handler after libdbus has been run for this reason. */
- handler->pcb_timer = gui->add_timer(timeout_handler_cb, handler->interval, data);
+ handler->pcb_timer = pcb_gui->add_timer(timeout_handler_cb, handler->interval, data);
dbus_timeout_handle(handler->dbus_timeout);
}
@@ -140,7 +140,7 @@ static dbus_bool_t watch_add(DBusWatch * dbus_watch, void *data)
int fd;
unsigned int pcb_condition;
unsigned int dbus_flags;
- hidval temp;
+ pcb_hidval_t temp;
/* We won't create a watch until it becomes enabled. */
if (!dbus_watch_get_enabled(dbus_watch))
@@ -163,7 +163,7 @@ static dbus_bool_t watch_add(DBusWatch * dbus_watch, void *data)
handler = (IOWatchHandler *) malloc(sizeof(IOWatchHandler));
temp.ptr = (void *) handler;
handler->dbus_watch = dbus_watch;
- handler->pcb_watch = gui->watch_file(fd, pcb_condition, io_watch_handler_cb, temp);
+ handler->pcb_watch = pcb_gui->watch_file(fd, pcb_condition, io_watch_handler_cb, temp);
dbus_watch_set_data(dbus_watch, handler, io_watch_handler_dbus_freed);
return TRUE;
@@ -188,10 +188,10 @@ static void watch_toggled(DBusWatch * dbus_watch, void *data)
static dbus_bool_t timeout_add(DBusTimeout * timeout, void *data)
{
TimeoutHandler *handler;
- hidval temp;
+ pcb_hidval_t temp;
/* We can't create a timeout without a GUI */
- if (gui == NULL)
+ if (pcb_gui == NULL)
return TRUE;
/* We won't create a timeout until it becomes enabled. */
@@ -206,7 +206,7 @@ static dbus_bool_t timeout_add(DBusTimeout * timeout, void *data)
temp.ptr = (void *) handler;
handler->dbus_timeout = timeout;
handler->interval = dbus_timeout_get_interval(timeout);
- handler->pcb_timer = gui->add_timer(timeout_handler_cb, handler->interval, temp);
+ handler->pcb_timer = pcb_gui->add_timer(timeout_handler_cb, handler->interval, temp);
dbus_timeout_set_data(timeout, handler, timeout_handler_dbus_freed);
return TRUE;
@@ -248,7 +248,7 @@ void dispatch_status_changed(DBusConnection * conn, DBusDispatchStatus new_statu
void pcb_dbus_connection_setup_with_mainloop(DBusConnection * connection)
{
/* ConnectionSetup *cs; */
- hidval temp;
+ pcb_hidval_t temp;
/* FIXME we never free the slot, so its refcount just keeps growing,
* which is kind of broken.
@@ -277,7 +277,7 @@ void pcb_dbus_connection_setup_with_mainloop(DBusConnection * connection)
/* Register a new mainloop hook to mop up any unfinished IO. */
temp.ptr = (void *) connection;
- gui->add_block_hook(block_hook_cb, temp);
+ pcb_gui->add_block_hook(block_hook_cb, temp);
return;
nomem:
diff --git a/src_plugins/dbus/dbus.c b/src_plugins/dbus/dbus.c
index e305ba9..7fa3401 100644
--- a/src_plugins/dbus/dbus.c
+++ b/src_plugins/dbus/dbus.c
@@ -34,12 +34,14 @@
#include "dbus-pcbmain.h"
#include "dbus-introspect.h"
-#include "global.h"
+#include "board.h"
+#include "config.h"
#include "data.h"
#include "plugins.h"
#include "hid_actions.h"
#include "event.h"
#include "compat_misc.h"
+#include "hid.h"
/* For lrealpath */
#include "compat_lrealpath.h"
@@ -73,7 +75,7 @@ static DBusHandlerResult handle_get_filename(DBusConnection * connection, DBusMe
dbus_message_iter_init_append(reply, &iter);
if (PCB->Filename)
- filename = lrealpath(PCB->Filename);
+ filename = pcb_lrealpath(PCB->Filename);
else
filename = NULL;
@@ -150,7 +152,7 @@ static DBusHandlerResult handle_exec_action(DBusConnection * connection, DBusMes
#endif
/* TODO: Proper return value from actions */
- hid_actionv(action_name, argc, (const char**)argv);
+ pcb_hid_actionv(action_name, argc, (const char**)argv);
retval = 0;
dbus_free_string_array(argv);
@@ -361,7 +363,7 @@ static void pcb_dbus_finish(void)
dbus_shutdown();
}
-static void dbus_gui_init(void *user_data, int argc, event_arg_t * argv[])
+static void dbus_gui_init(void *user_data, int argc, pcb_event_arg_t argv[])
{
/* this can not be done from init, before the gui starts, as it needs
@@ -374,14 +376,14 @@ static void dbus_gui_init(void *user_data, int argc, event_arg_t * argv[])
static void hid_dbus_uninit(void)
{
pcb_dbus_finish();
- event_unbind_allcookie(dbus_cookie);
-/* hid_remove_actions_by_cookie(dbus_cookie);*/
+ pcb_event_unbind_allcookie(dbus_cookie);
+/* pcb_hid_remove_actions_by_cookie(dbus_cookie);*/
}
#include "dolists.h"
pcb_uninit_t hid_dbus_init(void)
{
-/* REGISTER_ACTIONS(debug_action_list, dbus_cookie)*/
- event_bind(EVENT_GUI_INIT, dbus_gui_init, NULL, dbus_cookie);
+/* PCB_REGISTER_ACTIONS(debug_action_list, dbus_cookie)*/
+ pcb_event_bind(PCB_EVENT_GUI_INIT, dbus_gui_init, NULL, dbus_cookie);
return hid_dbus_uninit;
}
diff --git a/src_plugins/diag/Makefile b/src_plugins/diag/Makefile
index 91238a7..391b937 100644
--- a/src_plugins/diag/Makefile
+++ b/src_plugins/diag/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_diag
+ cd ../../src && $(MAKE) mod_diag
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/diag/diag.c b/src_plugins/diag/diag.c
index 1430f0b..97e7c3f 100644
--- a/src_plugins/diag/diag.c
+++ b/src_plugins/diag/diag.c
@@ -4,7 +4,7 @@
* pcb-rnd, interactive printed circuit board design
* Copyright (C) 2016 Tibor 'Igor2' Palinkas
*
- * This module, debug, was written and is Copyright (C) 2016 by Tibor Palinkas
+ * This module, diag, was written and is Copyright (C) 2016 by Tibor Palinkas
* this module is also subject to the GNU GPL as described below
*
* This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "layer.h"
#include "diag_conf.h"
@@ -43,11 +43,11 @@ static const char dump_conf_syntax[] =
static const char dump_conf_help[] = "Perform various operations on the configuration tree.";
extern lht_doc_t *conf_root[];
-static int ActionDumpConf(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DumpConf(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *cmd = argc > 0 ? argv[0] : NULL;
- if (NSTRCMP(cmd, "native") == 0) {
+ if (PCB_NSTRCMP(cmd, "native") == 0) {
int verbose;
const char *prefix = "";
if (argc > 1)
@@ -57,16 +57,16 @@ static int ActionDumpConf(int argc, const char **argv, Coord x, Coord y)
conf_dump(stdout, prefix, verbose, NULL);
}
- else if (NSTRCMP(cmd, "lihata") == 0) {
+ else if (PCB_NSTRCMP(cmd, "lihata") == 0) {
conf_role_t role;
const char *prefix = "";
if (argc <= 1) {
- Message(PCB_MSG_DEFAULT, "conf(dumplht) needs a role");
+ pcb_message(PCB_MSG_ERROR, "conf(dumplht) needs a role");
return 1;
}
role = conf_role_parse(argv[1]);
if (role == CFR_invalid) {
- Message(PCB_MSG_DEFAULT, "Invalid role: '%s'", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", argv[1]);
return 1;
}
if (argc > 2)
@@ -78,7 +78,7 @@ static int ActionDumpConf(int argc, const char **argv, Coord x, Coord y)
}
else {
- Message(PCB_MSG_ERROR, "Invalid conf command '%s'\n", argv[0]);
+ pcb_message(PCB_MSG_ERROR, "Invalid conf command '%s'\n", argv[0]);
return 1;
}
return 0;
@@ -90,20 +90,20 @@ static const char eval_conf_syntax[] =
static const char eval_conf_help[] = "Perform various operations on the configuration tree.";
-static int ActionEvalConf(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_EvalConf(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *path = argc > 0 ? argv[0] : NULL;
conf_native_t *nat;
int role;
if (path == NULL) {
- Message(PCB_MSG_ERROR, "EvalConf needs a path\n");
+ pcb_message(PCB_MSG_ERROR, "EvalConf needs a path\n");
return 1;
}
nat = conf_get_field(path);
if (nat == NULL) {
- Message(PCB_MSG_ERROR, "EvalConf: invalid path %s - no such config setting\n", path);
+ pcb_message(PCB_MSG_ERROR, "EvalConf: invalid path %s - no such config setting\n", path);
return 1;
}
@@ -144,33 +144,38 @@ static const char dump_layers_syntax[] =
static const char dump_layers_help[] = "Print info about each layer";
extern lht_doc_t *conf_root[];
-static int ActionDumpLayers(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DumpLayers(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- int g, n, used, arr[128]; /* WARNING: this assumes we won't have more than 128 layers */
+ int g, n, used;
+ pcb_layer_id_t arr[128]; /* WARNING: this assumes we won't have more than 128 layers */
+ pcb_layergrp_id_t garr[128]; /* WARNING: this assumes we won't have more than 128 layers */
- printf("Max: theoretical=%d current_board=%d\n", MAX_LAYER+2, max_copper_layer);
- for(n = 0; n < MAX_LAYER+2; n++) {
- int grp = GetGroupOfLayer(n);
- printf(" [%d] %04x group=%d %s\n", n, pcb_layer_flags(n), grp, PCB->Data->Layer[n].Name);
+
+ printf("Max: theoretical=%d current_board=%d\n", PCB_MAX_LAYER+2, pcb_max_copper_layer);
+ used = pcb_layer_list_any(PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, arr, sizeof(arr)/sizeof(arr[0]));
+ for(n = 0; n < used; n++) {
+ pcb_layer_id_t layer_id = arr[n];
+ pcb_layergrp_id_t grp = pcb_layer_get_group(layer_id);
+ printf(" [%lx] %04x group=%d %s\n", layer_id, pcb_layer_flags(layer_id), grp, pcb_layer_name(layer_id));
}
/* query by logical layer: any bottom copper */
used = pcb_layer_list(PCB_LYT_COPPER | PCB_LYT_BOTTOM, arr, sizeof(arr)/sizeof(arr[0]));
printf("All %d bottom copper layers are:\n", used);
for(n = 0; n < used; n++) {
- int layer_id = arr[n];
- printf(" [%d] %s \n", layer_id, PCB->Data->Layer[layer_id].Name);
+ pcb_layer_id_t layer_id = arr[n];
+ printf(" [%lx] %s \n", layer_id, PCB->Data->Layer[layer_id].Name);
}
/* query by groups (physical layers): any copper in group */
- used = pcb_layer_group_list(PCB_LYT_COPPER, arr, sizeof(arr)/sizeof(arr[0]));
+ used = pcb_layer_group_list(PCB_LYT_COPPER, garr, sizeof(garr)/sizeof(garr[0]));
printf("All %d groups containing copper layers are:\n", used);
for(g = 0; g < used; g++) {
- int group_id = arr[g];
+ int group_id = garr[g];
printf(" group %d\n", group_id);
for(n = 0; n < PCB->LayerGroups.Number[group_id]; n++) {
int layer_id = PCB->LayerGroups.Entries[group_id][n];
- printf(" [%d] %s\n", layer_id, PCB->Data->Layer[layer_id].Name);
+ printf(" [%lx] %s\n", layer_id, PCB->Data->Layer[layer_id].Name);
}
}
@@ -178,27 +183,27 @@ static int ActionDumpLayers(int argc, const char **argv, Coord x, Coord y)
}
-HID_Action diag_action_list[] = {
- {"dumpconf", 0, ActionDumpConf,
+pcb_hid_action_t diag_action_list[] = {
+ {"dumpconf", 0, pcb_act_DumpConf,
dump_conf_help, dump_conf_syntax},
- {"dumplayers", 0, ActionDumpLayers,
+ {"dumplayers", 0, pcb_act_DumpLayers,
dump_layers_help, dump_layers_syntax},
- {"EvalConf", 0, ActionEvalConf,
+ {"EvalConf", 0, pcb_act_EvalConf,
eval_conf_help, eval_conf_syntax}
};
-static const char *diag_cookie = "debug plugin";
+static const char *diag_cookie = "diag plugin";
-REGISTER_ACTIONS(diag_action_list, diag_cookie)
+PCB_REGISTER_ACTIONS(diag_action_list, diag_cookie)
static void hid_diag_uninit(void)
{
- hid_remove_actions_by_cookie(diag_cookie);
+ pcb_hid_remove_actions_by_cookie(diag_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_diag_init(void)
{
- REGISTER_ACTIONS(diag_action_list, diag_cookie)
+ PCB_REGISTER_ACTIONS(diag_action_list, diag_cookie)
return hid_diag_uninit;
}
diff --git a/src_plugins/diag/diag_conf.c b/src_plugins/diag/diag_conf.c
index 43f7933..8d4d75c 100644
--- a/src_plugins/diag/diag_conf.c
+++ b/src_plugins/diag/diag_conf.c
@@ -20,6 +20,7 @@
*
*/
+#include "config.h"
#include "conf.h"
void conf_dump(FILE *f, const char *prefix, int verbose, const char *match_prefix)
diff --git a/src_plugins/distalign/Makefile b/src_plugins/distalign/Makefile
index d547c2a..811c2b6 100644
--- a/src_plugins/distalign/Makefile
+++ b/src_plugins/distalign/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_distalign
+ cd ../../src && $(MAKE) mod_distalign
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/distalign/distalign.c b/src_plugins/distalign/distalign.c
index ce340dd..f608c5c 100644
--- a/src_plugins/distalign/distalign.c
+++ b/src_plugins/distalign/distalign.c
@@ -47,7 +47,7 @@
* of their top edges and let them wander off the grid to exactly the
* average of their tops.
* </td></tr><tr><td>
- * :Align(X,Marks,Crosshair)
+ * :Align(X,Marks,pcb_crosshair)
* </td><td>
* None of the objects are where you want them, so you move the
* crosshair to a likely spot and cause them all to move their X
@@ -69,7 +69,7 @@
* Objects are spread out evenly from the first (uppermost) to last
* using their marks as the reference point.
* </td></tr><tr><td>
- * :Distribute(X,Lefts,Crosshair,Last)
+ * :Distribute(X,Lefts,pcb_crosshair,Last)
* </td><td>
* You move your crosshair to the left edge of the target area, which
* will be the leftmost edge of the leftmost object. The objects are
@@ -82,7 +82,7 @@
* their centers being spread out evenly, you want the space (or "gaps")
* to be even.
*
- * You get tricky and bind `Align(X,Marks,Crosshair)' to a key.
+ * You get tricky and bind `Align(X,Marks,pcb_crosshair)' to a key.
* Now you can select an object and hit your key and the object will
* warp to the same X coordinate as your cursor.
*
@@ -100,29 +100,28 @@
#include <stdio.h>
#include <math.h>
+#include "board.h"
#include "config.h"
-#include "global.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "rats.h"
#include "error.h"
#include "move.h"
#include "draw.h"
-#include "set.h"
#include "plugins.h"
+#include "action_helper.h"
#include "hid_actions.h"
+#include "compat_misc.h"
#define ARG(n) (argc > (n) ? argv[n] : 0)
static const char align_syntax[] =
- "Align(X/Y, [Lefts/Rights/Tops/Bottoms/Centers/Marks, [First/Last/Crosshair/Average[, Gridless]]])";
+ "Align(X/Y, [Lefts/Rights/Tops/Bottoms/Centers/Marks, [First/Last/pcb_crosshair/Average[, Gridless]]])";
static const char distribute_syntax[] =
- "Distribute(Y, [Lefts/Rights/Tops/Bottoms/Centers/Marks/Gaps, [First/Last/Crosshair, First/Last/Crosshair[, Gridless]]])";
+ "Distribute(Y, [Lefts/Rights/Tops/Bottoms/Centers/Marks/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]])";
enum {
K_X,
@@ -157,7 +156,7 @@ static const char *keywords[] = {
/*[K_First] */ "First",
/*[K_Last] */ "Last",
/*[K_Average] */ "Average",
- /*[K_Crosshair] */ "Crosshair",
+ /*[K_Crosshair] */ "pcb_crosshair",
/*[K_Gridless] */ "Gridless",
};
@@ -168,8 +167,8 @@ static int keyword(const char *s)
if (!s) {
return K_none;
}
- for (i = 0; i < ENTRIES(keywords); ++i) {
- if (keywords[i] && strcasecmp(s, keywords[i]) == 0)
+ for (i = 0; i < PCB_ENTRIES(keywords); ++i) {
+ if (keywords[i] && pcb_strcasecmp(s, keywords[i]) == 0)
return i;
}
return -1;
@@ -178,8 +177,8 @@ static int keyword(const char *s)
/* this macro produces a function in X or Y that switches on 'point' */
#define COORD(DIR) \
-static inline Coord \
-coord ## DIR(ElementType *element, int point) \
+static inline pcb_coord_t \
+coord ## DIR(pcb_element_t *element, int point) \
{ \
switch (point) { \
case K_Marks: \
@@ -202,7 +201,7 @@ COORD(X)
COORD(Y)
/* return the element coordinate associated with the given internal point */
- static Coord coord(ElementType * element, int dir, int point)
+ static pcb_coord_t coord(pcb_element_t * element, int dir, int point)
{
if (dir == K_X)
return coordX(element, point);
@@ -211,9 +210,9 @@ COORD(X)
}
static struct element_by_pos {
- ElementType *element;
- Coord pos;
- Coord width;
+ pcb_element_t *element;
+ pcb_coord_t pos;
+ pcb_coord_t width;
} *elements_by_pos;
static int nelements_by_pos;
@@ -245,26 +244,26 @@ static int sort_elements_by_pos(int op, int dir, int point)
return nelements_by_pos;
if (op == K_align)
dir = dir == K_X ? K_Y : K_X; /* see above */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, element))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))
continue;
nsel++;
}
- END_LOOP;
+ PCB_END_LOOP;
if (!nsel)
return 0;
elements_by_pos = malloc(nsel * sizeof(*elements_by_pos));
nelements_by_pos = nsel;
nsel = 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, element))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))
continue;
elements_by_pos[nsel].element = element;
elements_by_pos[nsel++].pos = coord(element, dir, point);
}
- END_LOOP;
+ PCB_END_LOOP;
qsort(elements_by_pos, nelements_by_pos, sizeof(*elements_by_pos), cmp_ebp);
return nelements_by_pos;
}
@@ -282,9 +281,9 @@ static void free_elements_by_pos(void)
* \brief Find the reference coordinate from the specified points of all
* selected elements.
*/
-static Coord reference_coord(int op, int x, int y, int dir, int point, int reference)
+static pcb_coord_t reference_coord(int op, int x, int y, int dir, int point, int reference)
{
- Coord q;
+ pcb_coord_t q;
int nsel;
q = 0;
@@ -298,14 +297,14 @@ static Coord reference_coord(int op, int x, int y, int dir, int point, int refer
case K_Average: /* the average among selected elements */
nsel = 0;
q = 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, element))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))
continue;
q += coord(element, dir, point);
nsel++;
}
- END_LOOP;
+ PCB_END_LOOP;
if (nsel)
q /= nsel;
break;
@@ -327,32 +326,32 @@ static Coord reference_coord(int op, int x, int y, int dir, int point, int refer
}
/*!
- * Align(X, [Lefts/Rights/Centers/Marks, [First/Last/Crosshair/Average[, Gridless]]])\n
- * Align(Y, [Tops/Bottoms/Centers/Marks, [First/Last/Crosshair/Average[, Gridless]]])
+ * Align(X, [Lefts/Rights/Centers/Marks, [First/Last/pcb_crosshair/Average[, Gridless]]])\n
+ * Align(Y, [Tops/Bottoms/Centers/Marks, [First/Last/pcb_crosshair/Average[, Gridless]]])
*
* X or Y - Select which axis will move, other is untouched. \n
* Lefts, Rights, \n
* Tops, Bottoms, \n
* Centers, Marks - Pick alignment point within each element. \n
* First, Last, \n
- * Crosshair, \n
+ * pcb_crosshair, \n
* Average - Alignment reference, First=Topmost/Leftmost, \n
- * Last=Bottommost/Rightmost, Average or Crosshair point \n
+ * Last=Bottommost/Rightmost, Average or pcb_crosshair point \n
* Gridless - Do not force results to align to prevailing grid. \n
*
* Defaults are Marks, First.
*/
-static int align(int argc, const char **argv, Coord x, Coord y)
+static int align(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int dir;
int point;
int reference;
int gridless;
- Coord q;
+ pcb_coord_t q;
int changed = 0;
if (argc < 1 || argc > 4) {
- AFAIL(align);
+ PCB_AFAIL(align);
}
/* parse direction arg */
switch ((dir = keyword(ARG(0)))) {
@@ -360,7 +359,7 @@ static int align(int argc, const char **argv, Coord x, Coord y)
case K_Y:
break;
default:
- AFAIL(align);
+ PCB_AFAIL(align);
}
/* parse point (within each element) which will be aligned */
switch ((point = keyword(ARG(1)))) {
@@ -370,20 +369,20 @@ static int align(int argc, const char **argv, Coord x, Coord y)
case K_Lefts:
case K_Rights:
if (dir == K_Y) {
- AFAIL(align);
+ PCB_AFAIL(align);
}
break;
case K_Tops:
case K_Bottoms:
if (dir == K_X) {
- AFAIL(align);
+ PCB_AFAIL(align);
}
break;
case K_none:
point = K_Marks; /* default value */
break;
default:
- AFAIL(align);
+ PCB_AFAIL(align);
}
/* parse reference which will determine alignment coordinates */
switch ((reference = keyword(ARG(2)))) {
@@ -396,7 +395,7 @@ static int align(int argc, const char **argv, Coord x, Coord y)
reference = K_First; /* default value */
break;
default:
- AFAIL(align);
+ PCB_AFAIL(align);
}
/* optionally work off the grid (solar cells!) */
switch (keyword(ARG(3))) {
@@ -407,16 +406,16 @@ static int align(int argc, const char **argv, Coord x, Coord y)
gridless = 0;
break;
default:
- AFAIL(align);
+ PCB_AFAIL(align);
}
/* find the final alignment coordinate using the above options */
- q = reference_coord(K_align, Crosshair.X, Crosshair.Y, dir, point, reference);
+ q = reference_coord(K_align, pcb_crosshair.X, pcb_crosshair.Y, dir, point, reference);
/* move all selected elements to the new coordinate */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- Coord p, dp, dx, dy;
+ pcb_coord_t p, dp, dx, dy;
- if (!TEST_FLAG(PCB_FLAG_SELECTED, element))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))
continue;
/* find delta from reference point to reference point */
p = coord(element, dir, point);
@@ -432,30 +431,30 @@ static int align(int argc, const char **argv, Coord x, Coord y)
dy = 0;
else
dx = 0;
- MoveElementLowLevel(PCB->Data, element, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
+ pcb_element_move(PCB->Data, element, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
changed = 1;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (changed) {
- IncrementUndoSerialNumber();
- Redraw();
- SetChangedFlag(1);
+ pcb_undo_inc_serial();
+ pcb_redraw();
+ pcb_board_set_changed_flag(1);
}
free_elements_by_pos();
return 0;
}
/*!
- * Distribute(X, [Lefts/Rights/Centers/Marks/Gaps, [First/Last/Crosshair, First/Last/Crosshair[, Gridless]]]) \n
- * Distribute(Y, [Tops/Bottoms/Centers/Marks/Gaps, [First/Last/Crosshair, First/Last/Crosshair[, Gridless]]]) \n
+ * Distribute(X, [Lefts/Rights/Centers/Marks/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]]) \n
+ * Distribute(Y, [Tops/Bottoms/Centers/Marks/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]]) \n
* \n
* As with align, plus: \n
* \n
* Gaps - Make gaps even rather than spreading points evenly. \n
* First, Last, \n
- * Crosshair - Two arguments specifying both ends of the distribution,
+ * pcb_crosshair - Two arguments specifying both ends of the distribution,
* they can't both be the same. \n
* \n
* Defaults are Marks, First, Last \n
@@ -463,19 +462,19 @@ static int align(int argc, const char **argv, Coord x, Coord y)
* Distributed elements always retain the same relative order they had
* before they were distributed. \n
*/
-static int distribute(int argc, const char **argv, Coord x, Coord y)
+static int distribute(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int dir;
int point;
int refa, refb;
int gridless;
- Coord s, e, slack;
+ pcb_coord_t s, e, slack;
int divisor;
int changed = 0;
int i;
if (argc < 1 || argc == 3 || argc > 4) {
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
/* parse direction arg */
switch ((dir = keyword(ARG(0)))) {
@@ -483,7 +482,7 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
case K_Y:
break;
default:
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
/* parse point (within each element) which will be distributed */
switch ((point = keyword(ARG(1)))) {
@@ -494,20 +493,20 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
case K_Lefts:
case K_Rights:
if (dir == K_Y) {
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
break;
case K_Tops:
case K_Bottoms:
if (dir == K_X) {
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
break;
case K_none:
point = K_Marks; /* default value */
break;
default:
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
/* parse reference which will determine first distribution coordinate */
switch ((refa = keyword(ARG(2)))) {
@@ -520,7 +519,7 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
refa = K_First; /* default value */
break;
default:
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
/* parse reference which will determine final distribution coordinate */
switch ((refb = keyword(ARG(3)))) {
@@ -533,10 +532,10 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
refb = K_Last; /* default value */
break;
default:
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
if (refa == refb) {
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
/* optionally work off the grid (solar cells!) */
switch (keyword(ARG(4))) {
@@ -547,7 +546,7 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
gridless = 0;
break;
default:
- AFAIL(distribute);
+ PCB_AFAIL(distribute);
}
/* build list of elements in orthogonal axis order */
sort_elements_by_pos(K_distribute, dir, point);
@@ -560,11 +559,11 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
/* even the gaps instead of the edges or whatnot */
/* find the "slack" in the row */
if (point == K_Gaps) {
- Coord w;
+ pcb_coord_t w;
/* subtract all the "widths" from the slack */
for (i = 0; i < nelements_by_pos; ++i) {
- ElementType *element = elements_by_pos[i].element;
+ pcb_element_t *element = elements_by_pos[i].element;
/* coord doesn't care if I mix Lefts/Tops */
w = elements_by_pos[i].width = coord(element, dir, K_Rights) - coord(element, dir, K_Lefts);
/* Gaps distribution is on centers, so half of
@@ -578,8 +577,8 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
}
/* move all selected elements to the new coordinate */
for (i = 0; i < nelements_by_pos; ++i) {
- ElementType *element = elements_by_pos[i].element;
- Coord p, q, dp, dx, dy;
+ pcb_element_t *element = elements_by_pos[i].element;
+ pcb_coord_t p, q, dp, dx, dy;
/* find reference point for this element */
q = s + slack * i / divisor;
@@ -597,8 +596,8 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
dy = 0;
else
dx = 0;
- MoveElementLowLevel(PCB->Data, element, dx, dy);
- AddObjectToMoveUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
+ pcb_element_move(PCB->Data, element, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
changed = 1;
}
/* in gaps mode, accumulate part widths */
@@ -611,32 +610,32 @@ static int distribute(int argc, const char **argv, Coord x, Coord y)
}
}
if (changed) {
- IncrementUndoSerialNumber();
- Redraw();
- SetChangedFlag(1);
+ pcb_undo_inc_serial();
+ pcb_redraw();
+ pcb_board_set_changed_flag(1);
}
free_elements_by_pos();
return 0;
}
-static HID_Action distalign_action_list[] = {
+static pcb_hid_action_t distalign_action_list[] = {
{"distribute", NULL, distribute, "Distribute Elements", distribute_syntax},
{"align", NULL, align, "Align Elements", align_syntax}
};
static char *distalign_cookie = "distalign plugin";
-REGISTER_ACTIONS(distalign_action_list, distalign_cookie)
+PCB_REGISTER_ACTIONS(distalign_action_list, distalign_cookie)
static void hid_distalign_uninit(void)
{
- hid_remove_actions_by_cookie(distalign_cookie);
+ pcb_hid_remove_actions_by_cookie(distalign_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_distalign_init()
{
- REGISTER_ACTIONS(distalign_action_list, distalign_cookie);
+ PCB_REGISTER_ACTIONS(distalign_action_list, distalign_cookie);
return hid_distalign_uninit;
}
diff --git a/src_plugins/distaligntext/Makefile b/src_plugins/distaligntext/Makefile
index c76b4db..e133e1b 100644
--- a/src_plugins/distaligntext/Makefile
+++ b/src_plugins/distaligntext/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_distaligntext
+ cd ../../src && $(MAKE) mod_distaligntext
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/distaligntext/distaligntext.c b/src_plugins/distaligntext/distaligntext.c
index 41d113e..3239ebd 100644
--- a/src_plugins/distaligntext/distaligntext.c
+++ b/src_plugins/distaligntext/distaligntext.c
@@ -23,29 +23,29 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "rats.h"
#include "error.h"
#include "move.h"
#include "draw.h"
-#include "set.h"
#include "plugins.h"
+#include "action_helper.h"
#include "hid_actions.h"
#include "conf_core.h"
+#include "box.h"
+#include "compat_misc.h"
#define ARG(n) (argc > (n) ? argv[n] : 0)
static const char aligntext_syntax[] =
- "AlignText(X/Y, [Lefts/Rights/Tops/Bottoms/Centers, [First/Last/Crosshair/Average[, Gridless]]])";
+ "AlignText(X/Y, [Lefts/Rights/Tops/Bottoms/Centers, [First/Last/pcb_crosshair/Average[, Gridless]]])";
static const char distributetext_syntax[] =
- "DistributeText(Y, [Lefts/Rights/Tops/Bottoms/Centers/Gaps, [First/Last/Crosshair, First/Last/Crosshair[, Gridless]]])";
+ "DistributeText(Y, [Lefts/Rights/Tops/Bottoms/Centers/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]])";
enum {
K_X,
@@ -78,7 +78,7 @@ static const char *keywords[] = {
/* [K_First] */ "First",
/* [K_Last] */ "Last",
/* [K_Average] */ "Average",
- /* [K_Crosshair] */ "Crosshair",
+ /* [K_Crosshair] */ "pcb_crosshair",
/* [K_Gridless] */ "Gridless",
};
@@ -89,8 +89,8 @@ static int keyword(const char *s)
if (!s) {
return K_none;
}
- for (i = 0; i < ENTRIES(keywords); ++i) {
- if (keywords[i] && strcasecmp(s, keywords[i]) == 0)
+ for (i = 0; i < PCB_ENTRIES(keywords); ++i) {
+ if (keywords[i] && pcb_strcasecmp(s, keywords[i]) == 0)
return i;
}
return -1;
@@ -99,8 +99,8 @@ static int keyword(const char *s)
/* this macro produces a function in X or Y that switches on 'point' */
#define COORD(DIR) \
-static inline Coord \
-coord ## DIR(TextType *text, int point) \
+static inline pcb_coord_t \
+coord ## DIR(pcb_text_t *text, int point) \
{ \
switch (point) { \
case K_Lefts: \
@@ -123,7 +123,7 @@ COORD(X)
/*!
* Return the text coordinate associated with the given internal point.
*/
- static Coord coord(TextType * text, int dir, int point)
+ static pcb_coord_t coord(pcb_text_t * text, int dir, int point)
{
if (dir == K_X)
return coordX(text, point);
@@ -132,9 +132,9 @@ COORD(X)
}
static struct text_by_pos {
- TextType *text;
- Coord pos;
- Coord width;
+ pcb_text_t *text;
+ pcb_coord_t pos;
+ pcb_coord_t width;
int type;
} *texts_by_pos;
@@ -167,47 +167,47 @@ static int sort_texts_by_pos(int op, int dir, int point)
return ntexts_by_pos;
if (op == K_aligntext)
dir = dir == K_X ? K_Y : K_X; /* see above */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- TextType *text;
- text = &(element)->Name[NAME_INDEX()];
- if (!TEST_FLAG(PCB_FLAG_SELECTED, text))
+ pcb_text_t *text;
+ text = &(element)->Name[PCB_ELEMNAME_IDX_VISIBLE()];
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, text))
continue;
nsel++;
}
- END_LOOP;
- ALLTEXT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_TEXT_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, text))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, text))
continue;
nsel++;
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (!nsel)
return 0;
texts_by_pos = malloc(nsel * sizeof(*texts_by_pos));
ntexts_by_pos = nsel;
nsel = 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- TextType *text;
- text = &(element)->Name[NAME_INDEX()];
- if (!TEST_FLAG(PCB_FLAG_SELECTED, text))
+ pcb_text_t *text;
+ text = &(element)->Name[PCB_ELEMNAME_IDX_VISIBLE()];
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, text))
continue;
texts_by_pos[nsel].text = text;
texts_by_pos[nsel].type = PCB_TYPE_ELEMENT_NAME;
texts_by_pos[nsel++].pos = coord(text, dir, point);
}
- END_LOOP;
- ALLTEXT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_TEXT_ALL_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, text))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, text))
continue;
texts_by_pos[nsel].text = text;
texts_by_pos[nsel].type = PCB_TYPE_TEXT;
texts_by_pos[nsel++].pos = coord(text, dir, point);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
qsort(texts_by_pos, ntexts_by_pos, sizeof(*texts_by_pos), cmp_tbp);
return ntexts_by_pos;
}
@@ -226,9 +226,9 @@ static void free_texts_by_pos(void)
* Find the reference coordinate from the specified points of all
* selected text.
*/
-static Coord reference_coord(int op, int x, int y, int dir, int point, int reference)
+static pcb_coord_t reference_coord(int op, int x, int y, int dir, int point, int reference)
{
- Coord q;
+ pcb_coord_t q;
int i, nsel;
q = 0;
@@ -266,8 +266,8 @@ static Coord reference_coord(int op, int x, int y, int dir, int point, int refer
/*!
- * AlignText(X, [Lefts/Rights/Centers, [First/Last/Crosshair/Average[, Gridless]]])\n
- * AlignText(Y, [Tops/Bottoms/Centers, [First/Last/Crosshair/Average[, Gridless]]])
+ * AlignText(X, [Lefts/Rights/Centers, [First/Last/pcb_crosshair/Average[, Gridless]]])\n
+ * AlignText(Y, [Tops/Bottoms/Centers, [First/Last/pcb_crosshair/Average[, Gridless]]])
*
* X or Y - Select which axis will move, other is untouched. \n
* Lefts, Rights, \n
@@ -275,25 +275,25 @@ static Coord reference_coord(int op, int x, int y, int dir, int point, int refer
* Centers - Pick alignment point within each element. \n
* NB: text objects have no Mark. \n
* First, Last, \n
- * Crosshair, \n
+ * pcb_crosshair, \n
* Average - Alignment reference, First=Topmost/Leftmost, \n
- * Last=Bottommost/Rightmost, Average or Crosshair point \n
+ * Last=Bottommost/Rightmost, Average or pcb_crosshair point \n
* Gridless - Do not force results to align to prevailing grid. \n
*
* Defaults are Lefts/Tops, First
*/
-static int aligntext(int argc, const char **argv, Coord x, Coord y)
+static int aligntext(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int dir;
int point;
int reference;
int gridless;
- Coord q;
- Coord p, dp, dx, dy;
+ pcb_coord_t q;
+ pcb_coord_t p, dp, dx, dy;
int changed = 0;
if (argc < 1 || argc > 4) {
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
/* parse direction arg */
switch ((dir = keyword(ARG(0)))) {
@@ -301,7 +301,7 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
case K_Y:
break;
default:
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
/* parse point (within each element) which will be aligned */
switch ((point = keyword(ARG(1)))) {
@@ -310,13 +310,13 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
case K_Lefts:
case K_Rights:
if (dir == K_Y) {
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
break;
case K_Tops:
case K_Bottoms:
if (dir == K_X) {
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
break;
case K_none: /* default value */
@@ -328,7 +328,7 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
}
break;
default:
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
/* parse reference which will determine alignment coordinates */
switch ((reference = keyword(ARG(2)))) {
@@ -341,7 +341,7 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
reference = K_First; /* default value */
break;
default:
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
/* optionally work off the grid (solar cells!) */
switch (keyword(ARG(3))) {
@@ -352,18 +352,18 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
gridless = 0;
break;
default:
- AFAIL(aligntext);
+ PCB_AFAIL(aligntext);
}
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
/* find the final alignment coordinate using the above options */
- q = reference_coord(K_aligntext, Crosshair.X, Crosshair.Y, dir, point, reference);
+ q = reference_coord(K_aligntext, pcb_crosshair.X, pcb_crosshair.Y, dir, point, reference);
/* move all selected elements to the new coordinate */
/* selected text part of an element */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- TextType *text;
- text = &(element)->Name[NAME_INDEX()];
- if (!TEST_FLAG(PCB_FLAG_SELECTED, text))
+ pcb_text_t *text;
+ text = &(element)->Name[PCB_ELEMNAME_IDX_VISIBLE()];
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, text))
continue;
/* find delta from reference point to reference point */
p = coord(text, dir, point);
@@ -382,15 +382,15 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
dy = 0;
else
dx = 0;
- MoveObject(PCB_TYPE_ELEMENT_NAME, element, text, text, dx, dy);
+ pcb_move_obj(PCB_TYPE_ELEMENT_NAME, element, text, text, dx, dy);
changed = 1;
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* Selected bare text objects */
- ALLTEXT_LOOP(PCB->Data);
+ PCB_TEXT_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, text)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, text)) {
/* find delta from reference point to reference point */
p = coord(text, dir, point);
dp = q - p;
@@ -408,31 +408,31 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
dy = 0;
else
dx = 0;
- MoveObject(PCB_TYPE_TEXT, layer, text, text, dx, dy);
+ pcb_move_obj(PCB_TYPE_TEXT, layer, text, text, dx, dy);
changed = 1;
}
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (changed) {
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
- Redraw();
- SetChangedFlag(pcb_true);
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
+ pcb_redraw();
+ pcb_board_set_changed_flag(pcb_true);
}
free_texts_by_pos();
return 0;
}
/*!
- * DistributeText(X, [Lefts/Rights/Centers/Gaps, [First/Last/Crosshair, First/Last/Crosshair[, Gridless]]]) \n
- * DistributeText(Y, [Tops/Bottoms/Centers/Gaps, [First/Last/Crosshair, First/Last/Crosshair[, Gridless]]]) \n
+ * DistributeText(X, [Lefts/Rights/Centers/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]]) \n
+ * DistributeText(Y, [Tops/Bottoms/Centers/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]]) \n
* \n
* As with align, plus: \n
* \n
* Gaps - Make gaps even rather than spreading points evenly. \n
* First, Last, \n
- * Crosshair - Two arguments specifying both ends of the distribution,
+ * pcb_crosshair - Two arguments specifying both ends of the distribution,
* they can't both be the same. \n
* \n
* Defaults are Lefts/Tops, First, Last \n
@@ -440,19 +440,19 @@ static int aligntext(int argc, const char **argv, Coord x, Coord y)
* Distributed texts always retain the same relative order they had
* before they were distributed. \n
*/
-static int distributetext(int argc, const char **argv, Coord x, Coord y)
+static int distributetext(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int dir;
int point;
int refa, refb;
int gridless;
- Coord s, e, slack;
+ pcb_coord_t s, e, slack;
int divisor;
int changed = 0;
int i;
if (argc < 1 || argc == 3 || argc > 4) {
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
/* parse direction arg */
switch ((dir = keyword(ARG(0)))) {
@@ -460,7 +460,7 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
case K_Y:
break;
default:
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
/* parse point (within each element) which will be distributed */
switch ((point = keyword(ARG(1)))) {
@@ -470,13 +470,13 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
case K_Lefts:
case K_Rights:
if (dir == K_Y) {
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
break;
case K_Tops:
case K_Bottoms:
if (dir == K_X) {
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
break;
case K_none: /* default value */
@@ -488,7 +488,7 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
}
break;
default:
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
/* parse reference which will determine first distribution coordinate */
switch ((refa = keyword(ARG(2)))) {
@@ -501,7 +501,7 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
refa = K_First; /* default value */
break;
default:
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
/* parse reference which will determine final distribution coordinate */
switch ((refb = keyword(ARG(3)))) {
@@ -514,10 +514,10 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
refb = K_Last; /* default value */
break;
default:
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
if (refa == refb) {
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
/* optionally work off the grid (solar cells!) */
switch (keyword(ARG(4))) {
@@ -528,9 +528,9 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
gridless = 0;
break;
default:
- AFAIL(distributetext);
+ PCB_AFAIL(distributetext);
}
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
/* build list of texts in orthogonal axis order */
sort_texts_by_pos(K_distributetext, dir, point);
/* find the endpoints given the above options */
@@ -542,11 +542,11 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
/* even the gaps instead of the edges or whatnot */
/* find the "slack" in the row */
if (point == K_Gaps) {
- Coord w;
+ pcb_coord_t w;
/* subtract all the "widths" from the slack */
for (i = 0; i < ntexts_by_pos; ++i) {
- TextType *text = texts_by_pos[i].text;
+ pcb_text_t *text = texts_by_pos[i].text;
/* coord doesn't care if I mix Lefts/Tops */
w = texts_by_pos[i].width = coord(text, dir, K_Rights) - coord(text, dir, K_Lefts);
@@ -561,9 +561,9 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
}
/* move all selected texts to the new coordinate */
for (i = 0; i < ntexts_by_pos; ++i) {
- TextType *text = texts_by_pos[i].text;
+ pcb_text_t *text = texts_by_pos[i].text;
int type = texts_by_pos[i].type;
- Coord p, q, dp, dx, dy;
+ pcb_coord_t p, q, dp, dx, dy;
/* find reference point for this text */
q = s + slack * i / divisor;
@@ -589,11 +589,11 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
* element is also PCB_TYPE_ELEMENT_NAME. For undo, this is
* significant in search.c: SearchObjectByID.
*
- * MoveObject() is better as in aligntext(), but we
+ * pcb_move_obj() is better as in aligntext(), but we
* didn't keep the element reference when sorting.
*/
- MOVE_TEXT_LOWLEVEL(text, dx, dy);
- AddObjectToMoveUndoList(type, NULL, NULL, text, dx, dy);
+ pcb_text_move(text, dx, dy);
+ pcb_undo_add_obj_to_move(type, NULL, NULL, text, dx, dy);
changed = 1;
}
/* in gaps mode, accumulate part widths */
@@ -606,32 +606,32 @@ static int distributetext(int argc, const char **argv, Coord x, Coord y)
}
}
if (changed) {
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
- Redraw();
- SetChangedFlag(pcb_true);
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
+ pcb_redraw();
+ pcb_board_set_changed_flag(pcb_true);
}
free_texts_by_pos();
return 0;
}
-static HID_Action distaligntext_action_list[] = {
+static pcb_hid_action_t distaligntext_action_list[] = {
{"distributetext", NULL, distributetext, "Distribute Text Elements", distributetext_syntax},
{"aligntext", NULL, aligntext, "Align Text Elements", aligntext_syntax}
};
char *distaligntext_cookie = "distaligntext plugin";
-REGISTER_ACTIONS(distaligntext_action_list, distaligntext_cookie)
+PCB_REGISTER_ACTIONS(distaligntext_action_list, distaligntext_cookie)
static void hid_distaligntext_uninit(void)
{
- hid_remove_actions_by_cookie(distaligntext_cookie);
+ pcb_hid_remove_actions_by_cookie(distaligntext_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_distaligntext_init()
{
- REGISTER_ACTIONS(distaligntext_action_list, distaligntext_cookie);
+ PCB_REGISTER_ACTIONS(distaligntext_action_list, distaligntext_cookie);
return hid_distaligntext_uninit;
}
diff --git a/src_plugins/djopt/Makefile b/src_plugins/djopt/Makefile
index 5751c57..3e14264 100644
--- a/src_plugins/djopt/Makefile
+++ b/src_plugins/djopt/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_djopt
+ cd ../../src && $(MAKE) mod_djopt
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/djopt/djopt.c b/src_plugins/djopt/djopt.c
index a8a0fa6..00bb577 100644
--- a/src_plugins/djopt/djopt.c
+++ b/src_plugins/djopt/djopt.c
@@ -26,40 +26,38 @@
#include "config.h"
#include "conf_core.h"
-
-#include "global.h"
+#include "board.h"
#include <memory.h>
#include <limits.h>
#include "data.h"
-#include "create.h"
#include "remove.h"
#include "move.h"
#include "draw.h"
#include "undo.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "find.h"
#include "layer.h"
#include "pcb-printf.h"
+#include "compat_misc.h"
#include "plugins.h"
#include "hid_flags.h"
#include "hid_actions.h"
#include "djopt_conf.h"
+#include "obj_line.h"
+#include "obj_pinvia.h"
+#include "event.h"
conf_djopt_t conf_djopt;
static const char *djopt_cookie = "djopt";
-#ifndef HAVE_RINT
-#define rint(x) (ceil((x) - 0.5))
-#endif
-
#define dprintf if(0)pcb_printf
-#define selected(x) TEST_FLAG (PCB_FLAG_SELECTED, (x))
-#define autorouted(x) TEST_FLAG (PCB_FLAG_AUTO, (x))
+#define selected(x) PCB_FLAG_TEST(PCB_FLAG_SELECTED, (x))
+#define autorouted(x) PCB_FLAG_TEST(PCB_FLAG_AUTO, (x))
#define SB (PCB->Bloat+1)
@@ -86,9 +84,9 @@ typedef struct corner_s {
struct corner_s *next;
int x, y;
int net;
- PinType *via;
- PadType *pad;
- PinType *pin;
+ pcb_pin_t *via;
+ pcb_pad_t *pad;
+ pcb_pin_t *pin;
int miter;
int n_lines;
struct line_s **lines;
@@ -98,7 +96,7 @@ typedef struct line_s {
int layer;
struct line_s *next;
corner_s *s, *e;
- LineType *line;
+ pcb_line_t *line;
char is_pad;
} line_s;
@@ -112,29 +110,29 @@ typedef struct rect_s {
static corner_s *corners, *next_corner = 0;
static line_s *lines;
-static int layer_groupings[MAX_LAYER];
-static char layer_type[MAX_LAYER];
+static int layer_groupings[PCB_MAX_LAYERGRP];
+static char layer_type[PCB_MAX_LAYER];
#define LT_COMPONENT 1
#define LT_SOLDER 2
static const char *element_name_for(corner_s * c)
{
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
if (pin == c->pin)
return element->Name[1].TextString;
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
if (pad == c->pad)
return element->Name[1].TextString;
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
return "unknown";
}
@@ -238,7 +236,7 @@ static void check2(int srcline, corner_s * c, line_s * l)
#define SWAP(a,b) { a^=b; b^=a; a^=b; }
-static int gridsnap(Coord n)
+static int gridsnap(pcb_coord_t n)
{
if (n <= 0)
return 0;
@@ -277,7 +275,7 @@ static int dist(int x1, int y1, int x2, int y2)
dy2 = (double) y2;
d = sqrt((dx1 - dx2) * (dx1 - dx2) + (dy1 - dy2) * (dy1 - dy2));
- d = rint(d);
+ d = pcb_round(d);
return (int) d;
}
@@ -327,7 +325,7 @@ static int dist_line_to_point(line_s * l, corner_s * c)
if (l->s->y == l->e->y)
return dist_ltp2(l->s->y - c->y, c->x, l->s->x, l->e->x);
- /* Do it the hard way. See comments for IsPointOnLine() in search.c */
+ /* Do it the hard way. See comments for pcb_is_point_on_line() in search.c */
len = sqrt(sqr(l->s->x - l->e->x) + sqr(l->s->y - l->e->y));
if (len == 0)
return dist(l->s->x, l->s->y, c->x, c->y);
@@ -444,15 +442,15 @@ static void add_line_to_corner(line_s * l, corner_s * c)
dprintf("add_line_to_corner %#mD\n", c->x, c->y);
}
-static LineType *create_pcb_line(int layer, int x1, int y1, int x2, int y2, int thick, int clear, FlagType flags)
+static pcb_line_t *create_pcb_line(int layer, int x1, int y1, int x2, int y2, int thick, int clear, pcb_flag_t flags)
{
char *from, *to;
- LineType *nl;
- LayerType *lyr = LAYER_PTR(layer);
+ pcb_line_t *nl;
+ pcb_layer_t *lyr = LAYER_PTR(layer);
from = (char *) linelist_first(&lyr->Line);
- nl = CreateNewLineOnLayer(PCB->Data->Layer + layer, x1, y1, x2, y2, thick, clear, flags);
- AddObjectToCreateUndoList(PCB_TYPE_LINE, lyr, nl, nl);
+ nl = pcb_line_new(PCB->Data->Layer + layer, x1, y1, x2, y2, thick, clear, flags);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, lyr, nl, nl);
to = (char *) linelist_first(&lyr->Line);
if (from != to) {
@@ -460,18 +458,18 @@ static LineType *create_pcb_line(int layer, int x1, int y1, int x2, int y2, int
for (lp = lines; lp; lp = lp->next) {
if (DELETED(lp))
continue;
- if ((char *) (lp->line) >= from && (char *) (lp->line) <= from + linelist_length(&lyr->Line) * sizeof(LineType))
- lp->line = (LineType *) ((char *) (lp->line) + (to - from));
+ if ((char *) (lp->line) >= from && (char *) (lp->line) <= from + linelist_length(&lyr->Line) * sizeof(pcb_line_t))
+ lp->line = (pcb_line_t *) ((char *) (lp->line) + (to - from));
}
}
return nl;
}
-static void new_line(corner_s * s, corner_s * e, int layer, LineType * example)
+static void new_line(corner_s * s, corner_s * e, int layer, pcb_line_t * example)
{
line_s *ls;
- if (layer >= max_copper_layer)
+ if (layer >= pcb_max_copper_layer)
dj_abort("layer %d\n", layer);
if (example == NULL)
@@ -495,10 +493,10 @@ static void new_line(corner_s * s, corner_s * e, int layer, LineType * example)
else
#endif
{
- LineType *nl;
+ pcb_line_t *nl;
dprintf
("New line \033[35m%#mD to %#mD from l%d t%#mS c%#mS f%s\033[0m\n",
- s->x, s->y, e->x, e->y, layer, example->Thickness, example->Clearance, flags_to_string(example->Flags, PCB_TYPE_LINE));
+ s->x, s->y, e->x, e->y, layer, example->Thickness, example->Clearance, pcb_strflg_f2s(example->Flags, PCB_TYPE_LINE));
nl = create_pcb_line(layer, s->x, s->y, e->x, e->y, example->Thickness, example->Clearance, example->Flags);
if (!nl)
@@ -651,12 +649,12 @@ static void add_corner_to_rect_if(rect_s * rect, corner_s * c, rect_s * e)
static void remove_line(line_s * l)
{
int i, j;
- LayerType *layer = &(PCB->Data->Layer[l->layer]);
+ pcb_layer_t *layer = &(PCB->Data->Layer[l->layer]);
check(0, 0);
if (l->line)
- RemoveLine(layer, l->line);
+ pcb_line_destroy(layer, l->line);
DELETE(l);
@@ -674,18 +672,18 @@ static void remove_line(line_s * l)
static void move_line_to_layer(line_s * l, int layer)
{
- LayerType *ls, *ld;
+ pcb_layer_t *ls, *ld;
ls = LAYER_PTR(l->layer);
ld = LAYER_PTR(layer);
- MoveObjectToLayer(PCB_TYPE_LINE, ls, l->line, 0, ld, 0);
+ pcb_move_obj_to_layer(PCB_TYPE_LINE, ls, l->line, 0, ld, 0);
l->layer = layer;
}
static void remove_via_at(corner_s * c)
{
- RemoveObject(PCB_TYPE_VIA, c->via, 0, 0);
+ pcb_remove_object(PCB_TYPE_VIA, c->via, 0, 0);
c->via = 0;
}
@@ -737,7 +735,7 @@ static void merge_corners(corner_s * c1, corner_s * c2)
static void move_corner(corner_s * c, int x, int y)
{
- PinType *via;
+ pcb_pin_t *via;
int i;
corner_s *pad;
@@ -750,17 +748,17 @@ static void move_corner(corner_s * c, int x, int y)
c->y = y;
via = c->via;
if (via) {
- MoveObject(PCB_TYPE_VIA, via, via, via, x - via->X, y - via->Y);
+ pcb_move_obj(PCB_TYPE_VIA, via, via, via, x - via->X, y - via->Y);
dprintf("via move %#mD to %#mD\n", via->X, via->Y, x, y);
}
for (i = 0; i < c->n_lines; i++) {
- LineTypePtr tl = c->lines[i]->line;
+ pcb_line_t *tl = c->lines[i]->line;
if (tl) {
if (c->lines[i]->s == c) {
- MoveObject(PCB_TYPE_LINE_POINT, LAYER_PTR(c->lines[i]->layer), tl, &tl->Point1, x - (tl->Point1.X), y - (tl->Point1.Y));
+ pcb_move_obj(PCB_TYPE_LINE_POINT, LAYER_PTR(c->lines[i]->layer), tl, &tl->Point1, x - (tl->Point1.X), y - (tl->Point1.Y));
}
else {
- MoveObject(PCB_TYPE_LINE_POINT, LAYER_PTR(c->lines[i]->layer), tl, &tl->Point2, x - (tl->Point2.X), y - (tl->Point2.Y));
+ pcb_move_obj(PCB_TYPE_LINE_POINT, LAYER_PTR(c->lines[i]->layer), tl, &tl->Point2, x - (tl->Point2.X), y - (tl->Point2.Y));
}
dprintf("Line %p moved to %#mD %#mD\n", (void *) tl, tl->Point1.X, tl->Point1.Y, tl->Point2.X, tl->Point2.Y);
}
@@ -781,7 +779,7 @@ static void move_corner(corner_s * c, int x, int y)
break;
}
}
- gui->progress(0, 0, 0);
+ pcb_gui->progress(0, 0, 0);
check(c, 0);
}
@@ -814,7 +812,7 @@ static int canonicalize_line(line_s * l);
static int split_line(line_s * l, corner_s * c)
{
int i;
- LineType *pcbline;
+ pcb_line_t *pcbline;
line_s *ls;
if (!intersecting_layers(l->layer, c->layer))
@@ -852,7 +850,7 @@ static int split_line(line_s * l, corner_s * c)
add_line_to_corner(l, c);
add_line_to_corner(ls, c);
- MoveObject(PCB_TYPE_LINE_POINT, LAYER_PTR(l->layer), l->line, &l->line->Point2,
+ pcb_move_obj(PCB_TYPE_LINE_POINT, LAYER_PTR(l->layer), l->line, &l->line->Point2,
c->x - (l->line->Point2.X), c->y - (l->line->Point2.Y));
return 1;
@@ -941,7 +939,7 @@ static int canonicalize_line(line_s * l)
int th = c->pin ? c->pin->Thickness : c->via->Thickness;
th /= 2;
if (dist(l->s->x, l->s->y, c->x, c->y) > th
- && dist(l->e->x, l->e->y, c->x, c->y) > th && PinLineIntersect(c->pin ? c->pin : c->via, l->line)) {
+ && dist(l->e->x, l->e->y, c->x, c->y) > th && pcb_intersect_line_pin(c->pin ? c->pin : c->via, l->line)) {
return split_line(l, c);
}
}
@@ -982,7 +980,7 @@ static int simple_optimize_corner(corner_s * c)
dprintf("via check: line[0] layer %d at %#mD nl %d\n", c->lines[0]->layer, c->x, c->y, c->n_lines);
/* We can't delete vias that connect to power planes, or vias
that aren't tented (assume they're test points). */
- if (!TEST_ANY_THERMS(c->via)
+ if (!PCB_FLAG_THERM_TEST_ANY(c->via)
&& c->via->Mask == 0) {
for (i = 1; i < c->n_lines; i++) {
if (selected(c->via))
@@ -1009,9 +1007,9 @@ static int simple_optimize_corner(corner_s * c)
if (o == line_orient(c->lines[1], c2) && o != DIAGONAL) {
dprintf("straight %#mD to %#mD to %#mD\n", c0->x, c0->y, c->x, c->y, c2->x, c2->y);
if (selected(c->lines[0]->line))
- SET_FLAG(PCB_FLAG_SELECTED, c->lines[1]->line);
+ PCB_FLAG_SET(PCB_FLAG_SELECTED, c->lines[1]->line);
if (selected(c->lines[1]->line))
- SET_FLAG(PCB_FLAG_SELECTED, c->lines[0]->line);
+ PCB_FLAG_SET(PCB_FLAG_SELECTED, c->lines[0]->line);
move_corner(c, c2->x, c2->y);
}
}
@@ -1715,8 +1713,8 @@ static int vianudge()
int rv = 0;
corner_s *c, *c2, *c3;
line_s *l;
- unsigned char directions[MAX_LAYER];
- unsigned char counts[MAX_LAYER];
+ unsigned char directions[PCB_MAX_LAYER];
+ unsigned char counts[PCB_MAX_LAYER];
memset(directions, 0, sizeof(directions));
memset(counts, 0, sizeof(counts));
@@ -1739,7 +1737,7 @@ static int vianudge()
counts[c->lines[i]->layer]++;
directions[c->lines[i]->layer] |= o;
}
- for (o = 0, i = 0; i < max_copper_layer; i++)
+ for (o = 0, i = 0; i < pcb_max_copper_layer; i++)
if (counts[i] == 1) {
o = directions[i];
break;
@@ -1756,7 +1754,7 @@ static int vianudge()
default:
continue;
}
- for (i = 0; i < max_copper_layer; i++)
+ for (i = 0; i < pcb_max_copper_layer; i++)
if (counts[i] && directions[i] != o && directions[i] != oboth)
goto vianudge_continue;
@@ -2174,9 +2172,9 @@ static line_s *choose_example_line(corner_s * c1, corner_s * c2)
c[ci]->lines[li]->s->x, c[ci]->lines[li]->s->y,
c[ci]->lines[li]->e->x, c[ci]->lines[li]->e->y,
c[ci]->lines[li]->line->Thickness,
- c[ci]->lines[li]->line->Clearance, flags_to_string(c[ci]->lines[li]->line->Flags, PCB_TYPE_LINE));
+ c[ci]->lines[li]->line->Clearance, pcb_strflg_f2s(c[ci]->lines[li]->line->Flags, PCB_TYPE_LINE));
/* Pads are disqualified, as we want to mimic a trace line. */
- if (c[ci]->lines[li]->line == (LineTypePtr) c[ci]->pad) {
+ if (c[ci]->lines[li]->line == (pcb_line_t *) c[ci]->pad) {
dprintf(" bad, pad\n");
continue;
}
@@ -2196,7 +2194,7 @@ static int connect_corners(corner_s * c1, corner_s * c2)
{
int layer;
line_s *ex = choose_example_line(c1, c2);
- LineType *example = ex->line;
+ pcb_line_t *example = ex->line;
dprintf
("connect_corners \033[32m%#mD to %#mD, example line %#mD to %#mD l%d\033[0m\n",
@@ -2233,11 +2231,11 @@ static int connect_corners(corner_s * c1, corner_s * c2)
static void pinsnap()
{
corner_s *c;
- int best_dist[MAX_LAYER + 1];
- corner_s *best_c[MAX_LAYER + 1];
+ int best_dist[PCB_MAX_LAYER + 1];
+ corner_s *best_c[PCB_MAX_LAYER + 1];
int l, got_one;
int left = 0, right = 0, top = 0, bottom = 0;
- PinType *pin;
+ pcb_pin_t *pin;
int again = 1;
int close = 0;
@@ -2290,7 +2288,7 @@ static void pinsnap()
}
dprintf("%s x %#mS-%#mS y %#mS-%#mS\n", corner_name(c), left, right, bottom, top);
- for (l = 0; l <= max_copper_layer; l++) {
+ for (l = 0; l <= pcb_max_copper_layer; l++) {
best_dist[l] = close * 2;
best_c[l] = 0;
}
@@ -2323,10 +2321,10 @@ static void pinsnap()
}
}
if (!got_one && c->n_lines == (c->pad ? 1 : 0)) {
- for (l = 0; l <= max_copper_layer; l++)
+ for (l = 0; l <= pcb_max_copper_layer; l++)
if (best_c[l])
dprintf("best[%d] = %s\n", l, corner_name(best_c[l]));
- for (l = 0; l <= max_copper_layer; l++)
+ for (l = 0; l <= pcb_max_copper_layer; l++)
if (best_c[l]) {
dprintf("move %s to %s\n", corner_name(best_c[l]), corner_name(c));
connect_corners(best_c[l], c);
@@ -2402,7 +2400,7 @@ static void pinsnap()
}
}
-static int pad_orient(PadType * p)
+static int pad_orient(pcb_pad_t * p)
{
if (p->Point1.X == p->Point2.X)
return O_VERT;
@@ -2433,9 +2431,9 @@ static void padcleaner()
if (l->s->pad && l->s->pad == l->e->pad)
continue;
- ALLPAD_LOOP(PCB->Data);
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- int layerflag = TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? LT_SOLDER : LT_COMPONENT;
+ int layerflag = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? LT_SOLDER : LT_COMPONENT;
if (layer_type[l->layer] != layerflag)
continue;
@@ -2455,7 +2453,7 @@ static void padcleaner()
goto next_line;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
next_line:;
}
}
@@ -2463,23 +2461,23 @@ static void padcleaner()
static void grok_layer_groups()
{
int i, j, f;
- LayerGroupType *l = &(PCB->LayerGroups);
+ pcb_layer_group_t *l = &(PCB->LayerGroups);
solder_layer = component_layer = -1;
- for (i = 0; i < max_copper_layer; i++) {
+ for (i = 0; i < pcb_max_copper_layer; i++) {
layer_type[i] = 0;
layer_groupings[i] = 0;
}
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
f = 0;
for (j = 0; j < l->Number[i]; j++) {
- if (l->Entries[i][j] == solder_silk_layer)
+ if (l->Entries[i][j] == pcb_solder_silk_layer)
f |= LT_SOLDER;
- if (l->Entries[i][j] == component_silk_layer)
+ if (l->Entries[i][j] == pcb_component_silk_layer)
f |= LT_COMPONENT;
}
for (j = 0; j < l->Number[i]; j++) {
- if (l->Entries[i][j] < max_copper_layer) {
+ if (l->Entries[i][j] < pcb_max_copper_layer) {
layer_type[l->Entries[i][j]] |= f;
layer_groupings[l->Entries[i][j]] = i;
if (solder_layer == -1 && f == LT_SOLDER)
@@ -2491,10 +2489,10 @@ static void grok_layer_groups()
}
}
-static const char djopt_syntax[] =
+static const char pcb_acts_DJopt[] =
"djopt(debumpify|unjaggy|simple|vianudge|viatrim|orthopull)\n" "djopt(auto) - all of the above\n" "djopt(miter)";
-static const char djopt_help[] = "Perform various optimizations on the current board.";
+static const char pcb_acth_DJopt[] = "Perform various optimizations on the current board.";
/* %start-doc actions djopt
@@ -2546,7 +2544,7 @@ RF losses and trace length.
%end-doc */
-static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DJopt(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *arg = argc > 0 ? argv[0] : NULL;
int layn, saved = 0;
@@ -2556,23 +2554,23 @@ static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
SwitchDrawingWindow(PCB->Zoom, Output.drawing_area->window, conf_core.editor.show_solder_side, pcb_false);
#endif
- hid_action("Busy");
+ pcb_event(PCB_EVENT_BUSY, NULL);
lines = 0;
corners = 0;
grok_layer_groups();
- ELEMENT_LOOP(PCB->Data);
- PIN_LOOP(element);
+ PCB_ELEMENT_LOOP(PCB->Data);
+ PCB_PIN_LOOP(element);
{
c = find_corner(pin->X, pin->Y, -1);
c->pin = pin;
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- int layern = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? solder_layer : component_layer;
+ int layern = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? solder_layer : component_layer;
line_s *ls = (line_s *) malloc(sizeof(line_s));
ls->next = lines;
lines = ls;
@@ -2582,35 +2580,35 @@ static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
ls->e = find_corner(pad->Point2.X, pad->Point2.Y, layern);
ls->e->pad = pad;
ls->layer = layern;
- ls->line = (LineTypePtr) pad;
+ ls->line = (pcb_line_t *) pad;
add_line_to_corner(ls, ls->s);
add_line_to_corner(ls, ls->e);
}
- END_LOOP;
- END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_END_LOOP;
+ PCB_VIA_LOOP(PCB->Data);
/* hace don't mess with vias that have thermals */
/* but then again don't bump into them
- if (!TEST_FLAG(ALLTHERMFLAGS, via))
+ if (!PCB_FLAG_TEST(ALLTHERMFLAGS, via))
*/
{
c = find_corner(via->X, via->Y, -1);
c->via = via;
}
- END_LOOP;
+ PCB_END_LOOP;
check(0, 0);
- if (NSTRCMP(arg, "splitlines") == 0) {
+ if (PCB_NSTRCMP(arg, "splitlines") == 0) {
if (canonicalize_lines())
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return 0;
}
- for (layn = 0; layn < max_copper_layer; layn++) {
- LayerType *layer = LAYER_PTR(layn);
+ for (layn = 0; layn < pcb_max_copper_layer; layn++) {
+ pcb_layer_t *layer = LAYER_PTR(layn);
- LINE_LOOP(layer);
+ PCB_LINE_LOOP(layer);
{
line_s *ls;
@@ -2618,11 +2616,11 @@ static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
continue;
/* don't mess with thermals */
- if (TEST_FLAG(PCB_FLAG_USETHERMAL, line))
+ if (PCB_FLAG_TEST(PCB_FLAG_USETHERMAL, line))
continue;
if (line->Point1.X == line->Point2.X && line->Point1.Y == line->Point2.Y) {
- RemoveLine(layer, line);
+ pcb_line_destroy(layer, line);
continue;
}
@@ -2637,7 +2635,7 @@ static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
add_line_to_corner(ls, ls->e);
ls->layer = layn;
}
- END_LOOP;
+ PCB_END_LOOP;
}
check(0, 0);
@@ -2648,21 +2646,21 @@ static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
/*dump_all(); */
check(0, 0);
- if (NSTRCMP(arg, "debumpify") == 0)
+ if (PCB_NSTRCMP(arg, "debumpify") == 0)
saved += debumpify();
- else if (NSTRCMP(arg, "unjaggy") == 0)
+ else if (PCB_NSTRCMP(arg, "unjaggy") == 0)
saved += unjaggy();
- else if (NSTRCMP(arg, "simple") == 0)
+ else if (PCB_NSTRCMP(arg, "simple") == 0)
saved += simple_optimizations();
- else if (NSTRCMP(arg, "vianudge") == 0)
+ else if (PCB_NSTRCMP(arg, "vianudge") == 0)
saved += vianudge();
- else if (NSTRCMP(arg, "viatrim") == 0)
+ else if (PCB_NSTRCMP(arg, "viatrim") == 0)
saved += viatrim();
- else if (NSTRCMP(arg, "orthopull") == 0)
+ else if (PCB_NSTRCMP(arg, "orthopull") == 0)
saved += orthopull();
- else if (NSTRCMP(arg, "auto") == 0)
+ else if (PCB_NSTRCMP(arg, "auto") == 0)
saved += automagic();
- else if (NSTRCMP(arg, "miter") == 0)
+ else if (PCB_NSTRCMP(arg, "miter") == 0)
saved += miter();
else {
printf("unknown command: %s\n", arg);
@@ -2673,20 +2671,20 @@ static int ActionDJopt(int argc, const char **argv, Coord x, Coord y)
check(0, 0);
if (saved)
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return 0;
}
-HID_Action djopt_action_list[] = {
- {"djopt", 0, ActionDJopt,
- djopt_help, djopt_syntax}
+pcb_hid_action_t djopt_action_list[] = {
+ {"djopt", 0, pcb_act_DJopt,
+ pcb_acth_DJopt, pcb_acts_DJopt}
};
-REGISTER_ACTIONS(djopt_action_list, djopt_cookie)
+PCB_REGISTER_ACTIONS(djopt_action_list, djopt_cookie)
static void hid_djopt_uninit(void)
{
- hid_remove_actions_by_cookie(djopt_cookie);
+ pcb_hid_remove_actions_by_cookie(djopt_cookie);
conf_unreg_fields("plugins/djopt/");
}
@@ -2697,6 +2695,6 @@ pcb_uninit_t hid_djopt_init(void)
conf_reg_field(conf_djopt, field,isarray,type_name,cpath,cname,desc,flags);
#include "djopt_conf_fields.h"
- REGISTER_ACTIONS(djopt_action_list, djopt_cookie)
+ PCB_REGISTER_ACTIONS(djopt_action_list, djopt_cookie)
return hid_djopt_uninit;
}
diff --git a/src_plugins/djopt/djopt.h b/src_plugins/djopt/djopt.h
index d5d09ac..3edd467 100644
--- a/src_plugins/djopt/djopt.h
+++ b/src_plugins/djopt/djopt.h
@@ -27,8 +27,8 @@
#ifndef PCB_DJOPT_H
#define PCB_DJOPT_H
-#include "global.h"
+#include "config.h"
-int ActionDJopt(int, char **, Coord, Coord);
-int djopt_set_auto_only(int, char **, Coord, Coord);
+int pcb_act_DJopt(int, char **, pcb_coord_t, pcb_coord_t);
+int djopt_set_auto_only(int, char **, pcb_coord_t, pcb_coord_t);
#endif
diff --git a/src_plugins/draw_fab/Makefile b/src_plugins/draw_fab/Makefile
new file mode 100644
index 0000000..f59ed47
--- /dev/null
+++ b/src_plugins/draw_fab/Makefile
@@ -0,0 +1,6 @@
+all:
+ cd ../../src && $(MAKE) mod_draw_fab
+
+clean:
+ rm *.o *.so 2>/dev/null ; true
+
diff --git a/src_plugins/draw_fab/Plug.tmpasm b/src_plugins/draw_fab/Plug.tmpasm
new file mode 100644
index 0000000..81d44d1
--- /dev/null
+++ b/src_plugins/draw_fab/Plug.tmpasm
@@ -0,0 +1,11 @@
+put /local/pcb/mod {draw_fab}
+append /local/pcb/mod/OBJS [@
+ $(PLUGDIR)/draw_fab/draw_fab.o
+@]
+put /local/pcb/mod/CONF {$(PLUGDIR)/draw_fab/draw_fab_conf.h}
+
+switch /local/pcb/draw_fab/controls
+ case {buildin} include /local/pcb/tmpasm/buildin; end;
+ case {plugin} include /local/pcb/tmpasm/plugin; end;
+ case {disable} include /local/pcb/tmpasm/disable; end;
+end
diff --git a/src_plugins/draw_fab/README b/src_plugins/draw_fab/README
new file mode 100644
index 0000000..1347ec6
--- /dev/null
+++ b/src_plugins/draw_fab/README
@@ -0,0 +1,5 @@
+Draw the fab layer (for various exporters).
+
+#state: works
+#default: buildin
+#implements: (feature)
diff --git a/src_plugins/draw_fab/draw_fab.c b/src_plugins/draw_fab/draw_fab.c
new file mode 100644
index 0000000..cad2d69
--- /dev/null
+++ b/src_plugins/draw_fab/draw_fab.c
@@ -0,0 +1,314 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996, 2003 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 at rz.uni-ulm.de
+ *
+ */
+
+/* printing routines */
+#include "config.h"
+
+#include <time.h>
+
+#include "board.h"
+#include "build_run.h"
+#include "data.h"
+#include "draw.h"
+#include "../report/drill.h"
+#include "obj_all.h"
+#include "plugins.h"
+#include "stub_draw_fab.h"
+#include "draw_fab_conf.h"
+
+#include "obj_text_draw.h"
+
+
+conf_draw_fab_t conf_draw_fab;
+
+/* ---------------------------------------------------------------------------
+ * prints a FAB drawing.
+ */
+
+#define TEXT_SIZE PCB_MIL_TO_COORD(150)
+#define TEXT_LINE PCB_MIL_TO_COORD(150)
+#define DRILL_MARK_SIZE PCB_MIL_TO_COORD(16)
+#define FAB_LINE_W PCB_MIL_TO_COORD(8)
+
+static void fab_line(pcb_hid_gc_t gc, int x1, int y1, int x2, int y2)
+{
+ pcb_gui->draw_line(gc, x1, y1, x2, y2);
+}
+
+static void fab_circle(pcb_hid_gc_t gc, int x, int y, int r)
+{
+ pcb_gui->draw_arc(gc, x, y, r, r, 0, 180);
+ pcb_gui->draw_arc(gc, x, y, r, r, 180, 180);
+}
+
+/* align is 0=left, 1=center, 2=right, add 8 for underline */
+static void text_at(pcb_hid_gc_t gc, int x, int y, int align, const char *fmt, ...)
+{
+ char tmp[512];
+ int w = 0, i;
+ pcb_text_t t;
+ va_list a;
+ pcb_font_t *font = &PCB->Font;
+ va_start(a, fmt);
+ vsprintf(tmp, fmt, a);
+ va_end(a);
+ t.Direction = 0;
+ t.TextString = tmp;
+ t.Scale = PCB_COORD_TO_MIL(TEXT_SIZE); /* pcnt of 100mil base height */
+ t.Flags = pcb_no_flags();
+ t.X = x;
+ t.Y = y;
+ for (i = 0; tmp[i]; i++)
+ w += (font->Symbol[(int) tmp[i]].Width + font->Symbol[(int) tmp[i]].Delta);
+ w = PCB_SCALE_TEXT(w, t.Scale);
+ t.X -= w * (align & 3) / 2;
+ if (t.X < 0)
+ t.X = 0;
+ DrawTextLowLevel(&t, 0);
+ if (align & 8)
+ fab_line(gc, t.X,
+ t.Y + PCB_SCALE_TEXT(font->MaxHeight, t.Scale) + PCB_MIL_TO_COORD(10),
+ t.X + w, t.Y + PCB_SCALE_TEXT(font->MaxHeight, t.Scale) + PCB_MIL_TO_COORD(10));
+}
+
+/* Y, +, X, circle, square */
+static void drill_sym(pcb_hid_gc_t gc, int idx, int x, int y)
+{
+ int type = idx % 5;
+ int size = idx / 5;
+ int s2 = (size + 1) * DRILL_MARK_SIZE;
+ int i;
+ switch (type) {
+ case 0: /* Y */ ;
+ fab_line(gc, x, y, x, y + s2);
+ fab_line(gc, x, y, x + s2 * 13 / 15, y - s2 / 2);
+ fab_line(gc, x, y, x - s2 * 13 / 15, y - s2 / 2);
+ for (i = 1; i <= size; i++)
+ fab_circle(gc, x, y, i * DRILL_MARK_SIZE);
+ break;
+ case 1: /* + */
+ ;
+ fab_line(gc, x, y - s2, x, y + s2);
+ fab_line(gc, x - s2, y, x + s2, y);
+ for (i = 1; i <= size; i++) {
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE);
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ fab_line(gc, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ }
+ break;
+ case 2: /* X */ ;
+ fab_line(gc, x - s2 * 3 / 4, y - s2 * 3 / 4, x + s2 * 3 / 4, y + s2 * 3 / 4);
+ fab_line(gc, x - s2 * 3 / 4, y + s2 * 3 / 4, x + s2 * 3 / 4, y - s2 * 3 / 4);
+ for (i = 1; i <= size; i++) {
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE);
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ fab_line(gc, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ }
+ break;
+ case 3: /* circle */ ;
+ for (i = 0; i <= size; i++)
+ fab_circle(gc, x, y, (i + 1) * DRILL_MARK_SIZE - DRILL_MARK_SIZE / 2);
+ break;
+ case 4: /* square */
+ for (i = 1; i <= size + 1; i++) {
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE);
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ fab_line(gc, x - i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ fab_line(gc, x + i * DRILL_MARK_SIZE, y - i * DRILL_MARK_SIZE, x + i * DRILL_MARK_SIZE, y + i * DRILL_MARK_SIZE);
+ }
+ break;
+ }
+}
+
+static int count_drill_lines(DrillInfoTypePtr AllDrills)
+{
+ int n, ds = 0;
+ for (n = AllDrills->DrillN - 1; n >= 0; n--) {
+ DrillTypePtr drill = &(AllDrills->Drill[n]);
+ if (drill->PinCount + drill->ViaCount > drill->UnplatedCount)
+ ds++;
+ if (drill->UnplatedCount)
+ ds++;
+ }
+ return ds;
+}
+
+
+static int DrawFab_overhang(void)
+{
+ DrillInfoTypePtr AllDrills = GetDrillInfo(PCB->Data);
+ int ds = count_drill_lines(AllDrills);
+ if (ds < 4)
+ ds = 4;
+ return (ds + 2) * TEXT_LINE;
+}
+
+static void DrawFab(pcb_hid_gc_t gc)
+{
+ DrillInfoTypePtr AllDrills;
+ int i, n, yoff, total_drills = 0, ds = 0;
+ char utcTime[64];
+ AllDrills = GetDrillInfo(PCB->Data);
+ RoundDrillInfo(AllDrills, PCB_MIL_TO_COORD(1));
+ yoff = -TEXT_LINE;
+
+ /* count how many drill description lines will be needed */
+ ds = count_drill_lines(AllDrills);
+
+ /*
+ * When we only have a few drill sizes we need to make sure the
+ * drill table header doesn't fall on top of the board info
+ * section.
+ */
+ if (ds < 4) {
+ yoff -= (4 - ds) * TEXT_LINE;
+ }
+
+ pcb_gui->set_line_width(gc, FAB_LINE_W);
+
+ for (n = AllDrills->DrillN - 1; n >= 0; n--) {
+ int plated_sym = -1, unplated_sym = -1;
+ DrillTypePtr drill = &(AllDrills->Drill[n]);
+ if (drill->PinCount + drill->ViaCount > drill->UnplatedCount)
+ plated_sym = --ds;
+ if (drill->UnplatedCount)
+ unplated_sym = --ds;
+ pcb_gui->set_color(gc, PCB->PinColor);
+ for (i = 0; i < drill->PinN; i++)
+ drill_sym(gc, PCB_FLAG_TEST(PCB_FLAG_HOLE, drill->Pin[i]) ? unplated_sym : plated_sym, drill->Pin[i]->X, drill->Pin[i]->Y);
+ if (plated_sym != -1) {
+ drill_sym(gc, plated_sym, TEXT_SIZE, yoff + TEXT_SIZE / 4);
+ text_at(gc, PCB_MIL_TO_COORD(1350), yoff, PCB_MIL_TO_COORD(2), "YES");
+ text_at(gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->PinCount + drill->ViaCount - drill->UnplatedCount);
+
+ if (unplated_sym != -1)
+ yoff -= TEXT_LINE;
+ }
+ if (unplated_sym != -1) {
+ drill_sym(gc, unplated_sym, TEXT_SIZE, yoff + TEXT_SIZE / 4);
+ text_at(gc, PCB_MIL_TO_COORD(1400), yoff, PCB_MIL_TO_COORD(2), "NO");
+ text_at(gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->UnplatedCount);
+ }
+ pcb_gui->set_color(gc, PCB->ElementColor);
+ text_at(gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize) + 0.0004);
+ if (plated_sym != -1 && unplated_sym != -1)
+ text_at(gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize) + 0.0004);
+ yoff -= TEXT_LINE;
+ total_drills += drill->PinCount;
+ total_drills += drill->ViaCount;
+ }
+
+ pcb_gui->set_color(gc, PCB->ElementColor);
+ text_at(gc, 0, yoff, PCB_MIL_TO_COORD(9), "Symbol");
+ text_at(gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (Inch)");
+ text_at(gc, PCB_MIL_TO_COORD(950), yoff, PCB_MIL_TO_COORD(9), "Count");
+ text_at(gc, PCB_MIL_TO_COORD(1300), yoff, PCB_MIL_TO_COORD(9), "Plated?");
+ yoff -= TEXT_LINE;
+ text_at(gc, 0, yoff, 0,
+ "There are %d different drill sizes used in this layout, %d holes total", AllDrills->DrillN, total_drills);
+ /* Create a portable timestamp. */
+
+ if (!conf_draw_fab.plugins.draw_fab.omit_date) {
+ const char *fmt = "%c UTC";
+ time_t currenttime = time(NULL);
+ strftime(utcTime, sizeof utcTime, fmt, gmtime(¤ttime));
+ }
+ else
+ strcpy(utcTime, "<date>");
+
+ yoff = -TEXT_LINE;
+ for (i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layer_t *l = LAYER_PTR(i);
+ if (l->Name && (linelist_length(&l->Line) || arclist_length(&l->Arc))) {
+ if (strcmp("route", l->Name) == 0)
+ break;
+ if (strcmp("outline", l->Name) == 0)
+ break;
+ }
+ }
+ if (i == pcb_max_copper_layer) {
+ pcb_gui->set_line_width(gc, PCB_MIL_TO_COORD(10));
+ pcb_gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0);
+ pcb_gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight);
+ pcb_gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight);
+ /*FPrintOutline (); */
+ pcb_gui->set_line_width(gc, FAB_LINE_W);
+ text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0,
+ "Maximum Dimensions: %f mils wide, %f mils high", PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight));
+ text_at(gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1,
+ "Board outline is the centerline of this %f mil"
+ " rectangle - 0,0 to %f,%f mils",
+ PCB_COORD_TO_MIL(FAB_LINE_W), PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight));
+ }
+ else {
+ pcb_layer_t *layer = LAYER_PTR(i);
+ pcb_gui->set_line_width(gc, PCB_MIL_TO_COORD(10));
+ PCB_LINE_LOOP(layer);
+ {
+ pcb_gui->draw_line(gc, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y);
+ }
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(layer);
+ {
+ pcb_gui->draw_arc(gc, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta);
+ }
+ PCB_END_LOOP;
+ PCB_TEXT_LOOP(layer);
+ {
+ DrawTextLowLevel(text, 0);
+ }
+ PCB_END_LOOP;
+ pcb_gui->set_line_width(gc, FAB_LINE_W);
+ text_at(gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1, "Board outline is the centerline of this path");
+ }
+ yoff -= TEXT_LINE;
+
+ text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Date: %s", utcTime);
+ yoff -= TEXT_LINE;
+ text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Author: %s", pcb_author());
+ yoff -= TEXT_LINE;
+ text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Title: %s - Fabrication Drawing", PCB_UNKNOWN(PCB->Name));
+}
+
+static void hid_draw_fab_uninit(void)
+{
+}
+
+pcb_uninit_t hid_draw_fab_init(void)
+{
+ pcb_stub_draw_fab = DrawFab;
+ pcb_stub_draw_fab_overhang = DrawFab_overhang;
+
+#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \
+ conf_reg_field(conf_draw_fab, field,isarray,type_name,cpath,cname,desc,flags);
+#include "draw_fab_conf_fields.h"
+
+
+ return hid_draw_fab_uninit;
+}
diff --git a/src_plugins/draw_fab/draw_fab_conf.h b/src_plugins/draw_fab/draw_fab_conf.h
new file mode 100644
index 0000000..4b187c0
--- /dev/null
+++ b/src_plugins/draw_fab/draw_fab_conf.h
@@ -0,0 +1,14 @@
+#ifndef PCB_DRAW_FAB_CONF_H
+#define PCB_DRAW_FAB_CONF_H
+
+#include "conf.h"
+
+typedef struct {
+ const struct plugins {
+ const struct draw_fab {
+ CFT_BOOLEAN omit_date; /* do not draw date (useful for testing) */
+ } draw_fab;
+ } plugins;
+} conf_draw_fab_t;
+
+#endif
diff --git a/src_plugins/export_bboard/Makefile b/src_plugins/export_bboard/Makefile
index 9fc5059..1f56325 100644
--- a/src_plugins/export_bboard/Makefile
+++ b/src_plugins/export_bboard/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_bboard
+ cd ../../src && $(MAKE) mod_export_bboard
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_bboard/bboard.c b/src_plugins/export_bboard/bboard.c
index 896df2b..6e9d0db 100644
--- a/src_plugins/export_bboard/bboard.c
+++ b/src_plugins/export_bboard/bboard.c
@@ -34,20 +34,20 @@
#include <math.h>
#include <dirent.h>
#include <sys/stat.h>
-
#include <time.h>
+#include "math_helper.h"
+#include "board.h"
#include "config.h"
-#include "global.h"
#include "data.h"
-#include "misc.h"
#include "error.h"
#include "buffer.h"
-#include "create.h"
#include "layer.h"
#include "plugins.h"
#include "compat_misc.h"
+#include "compat_fs.h"
#include "misc_util.h"
+#include "obj_all.h"
#include "hid.h"
#include "hid_attrib.h"
@@ -75,7 +75,7 @@ static cairo_t *bboard_cairo_ctx;
* Breadboard export filter parameters and options
****************************************************************************************************/
-static HID bboard_hid;
+static pcb_hid_t bboard_hid;
static struct {
int draw;
@@ -83,7 +83,7 @@ static struct {
float z_offset;
int solder;
int component;
-} group_data[MAX_LAYER];
+} group_data[PCB_MAX_LAYERGRP];
#define HA_bboardfile 0
@@ -91,7 +91,7 @@ static struct {
#define HA_skipsolder 2
#define HA_antialias 3
-static HID_Attribute bboard_options[] = {
+static pcb_hid_attribute_t bboard_options[] = {
/*
%start-doc options "Breadboard Export"
@ftable @code
@@ -144,13 +144,13 @@ Connections are antialiased. Antialiasing applies only to wires, models are not
#define NUM_OPTIONS (sizeof(bboard_options)/sizeof(bboard_options[0]))
-static HID_Attr_Val bboard_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t bboard_values[NUM_OPTIONS];
/****************************************************************************************************/
static const char *bboard_filename = 0;
static const char *bboard_bgcolor = 0;
-Coord bboard_scale_coord(Coord x)
+pcb_coord_t bboard_scale_coord(pcb_coord_t x)
{
return ((x * DPI_SCALE / 254 / 10000) + 0) / 10;
}
@@ -160,11 +160,11 @@ Coord bboard_scale_coord(Coord x)
* Export filter implementation starts here
********************************************/
-static HID_Attribute *bboard_get_export_options(int *n)
+static pcb_hid_attribute_t *bboard_get_export_options(int *n)
{
static char *last_made_filename = 0;
if (PCB)
- derive_default_filename(PCB->Filename, &bboard_options[HA_bboardfile], ".png", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &bboard_options[HA_bboardfile], ".png", &last_made_filename);
bboard_options[HA_bgcolor].default_val.str_value = pcb_strdup("#FFFFFF");
@@ -173,30 +173,15 @@ static HID_Attribute *bboard_get_export_options(int *n)
return bboard_options;
}
-static int bboard_validate_layer(const char *name, int group, int skipsolder)
+static int bboard_validate_layer(unsigned long flags, int group, int skipsolder)
{
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
-
- if (name == 0)
- name = PCB->Data->Layer[idx].Name;
-
- if (strcmp(name, "invisible") == 0)
- return 0;
-
- if (SL_TYPE(idx) == SL_ASSY)
- return 0;
-
- if (strcmp(name, "route") == 0)
- return 0;
-
- if (strcmp(name, "outline") == 0)
+ if ((flags & PCB_LYT_INVIS) || (flags & PCB_LYT_ASSY) || (flags & PCB_LYT_OUTLINE))
return 0;
if (group_data[group].solder && skipsolder)
return 0;
-
- if (group >= 0 && group < max_group) {
+ if (group >= 0 && group < pcb_max_group) {
if (!group_data[group].draw)
return 0;
group_data[group].exp = 1;
@@ -206,12 +191,12 @@ static int bboard_validate_layer(const char *name, int group, int skipsolder)
return 0;
}
-static void bboard_get_layer_color(LayerType * layer, int *clr_r, int *clr_g, int *clr_b)
+static void bboard_get_layer_color(pcb_layer_t * layer, int *clr_r, int *clr_g, int *clr_b)
{
char *clr;
unsigned int r, g, b;
- if ((clr = AttributeGetFromList(&(layer->Attributes), "BBoard::LayerColor")) != NULL) {
+ if ((clr = pcb_attribute_get(&(layer->Attributes), "BBoard::LayerColor")) != NULL) {
if (clr[0] == '#') {
if (sscanf(&(clr[1]), "%02x%02x%02x", &r, &g, &b) == 3)
goto ok;
@@ -245,7 +230,7 @@ static void bboard_set_color_cairo(int r, int g, int b)
}
-static void bboard_draw_line_cairo(Coord x1, Coord y1, Coord x2, Coord y2, Coord thickness)
+static void bboard_draw_line_cairo(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thickness)
{
ASSERT_CAIRO;
@@ -258,10 +243,7 @@ static void bboard_draw_line_cairo(Coord x1, Coord y1, Coord x2, Coord y2, Coord
cairo_stroke(bboard_cairo_ctx);
}
-#warning TODO: remove x1;y1;x2;y2
-static void
-bboard_draw_arc_cairo(/*Coord x1, Coord y1, Coord x2, Coord y2,*/ Coord x,
- Coord y, Coord w, Coord h, Angle sa, Angle a, Coord thickness)
+static void bboard_draw_arc_cairo(pcb_coord_t x, pcb_coord_t y, pcb_coord_t w, pcb_coord_t h, pcb_angle_t sa, pcb_angle_t a, pcb_coord_t thickness)
{
ASSERT_CAIRO;
@@ -282,7 +264,7 @@ bboard_draw_arc_cairo(/*Coord x1, Coord y1, Coord x2, Coord y2,*/ Coord x,
cairo_stroke(bboard_cairo_ctx);
}
-static pcb_bool bboard_init_board_cairo(Coord x1, Coord y1, const char *color, int antialias)
+static pcb_bool bboard_init_board_cairo(pcb_coord_t x1, pcb_coord_t y1, const char *color, int antialias)
{
unsigned int r, g, b;
float tr = 1.; /* background transparency */
@@ -295,7 +277,7 @@ static pcb_bool bboard_init_board_cairo(Coord x1, Coord y1, const char *color, i
else {
if ((color[0] != '#')
|| sscanf(&(color[1]), "%02x%02x%02x", &r, &g, &b) != 3) {
- Message(PCB_MSG_ERROR, "BBExport: Invalid background color \"%s\"", color);
+ pcb_message(PCB_MSG_ERROR, "BBExport: Invalid background color \"%s\"", color);
r = g = b = 0xff;
}
@@ -340,14 +322,14 @@ static char *bboard_get_model_filename(char *basename, char *value, pcb_bool nes
char *s;
/*
- s = Concat(pcblibdir, PCB_DIR_SEPARATOR_S, MODELBASE, PCB_DIR_SEPARATOR_S,
+ s = pcb_concat(pcblibdir, PCB_DIR_SEPARATOR_S, MODELBASE, PCB_DIR_SEPARATOR_S,
BBOARDBASE, PCB_DIR_SEPARATOR_S, basename, (value
&& nested) ?
PCB_DIR_SEPARATOR_S : "", (value && nested) ? basename : "", (value) ? "-" : "", (value) ? value : "", BBEXT, NULL);
*/
s = pcb_strdup("TODO_fn1");
if (s != NULL) {
- if (!FileExists(s)) {
+ if (!pcb_file_readable(s)) {
free(s);
s = NULL;
}
@@ -356,19 +338,19 @@ static char *bboard_get_model_filename(char *basename, char *value, pcb_bool nes
}
-static int bboard_parse_offset(char *s, Coord * ox, Coord * oy)
+static int bboard_parse_offset(char *s, pcb_coord_t * ox, pcb_coord_t * oy)
{
- Coord xx = 0, yy = 0;
+ pcb_coord_t xx = 0, yy = 0;
int n = 0, ln = 0;
char val[32];
while (sscanf(s, "%30s%n", val, &ln) >= 1) {
switch (n) {
case 0:
- xx = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ xx = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 1:
- yy = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ yy = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
}
s = s + ln;
@@ -386,19 +368,19 @@ static int bboard_parse_offset(char *s, Coord * ox, Coord * oy)
}
-static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder)
+static void bboard_export_element_cairo(pcb_element_t * element, pcb_bool onsolder)
{
cairo_surface_t *sfc;
- Coord ex, ey;
- Coord ox = 0, oy = 0;
+ pcb_coord_t ex, ey;
+ pcb_coord_t ox = 0, oy = 0;
int w, h;
- Angle tmp_angle = 0.0;
+ pcb_angle_t tmp_angle = 0.0;
char *model_angle, *s = 0, *s1, *s2, *fname = NULL;
pcb_bool offset_in_model = pcb_false;
ASSERT_CAIRO;
- s1 = AttributeGetFromList(&(element->Attributes), "BBoard::Model");
+ s1 = pcb_attribute_get(&(element->Attributes), "BBoard::Model");
if (s1) {
s = pcb_strdup(s1);
if (!s)
@@ -408,10 +390,10 @@ static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder
*s2 = 0;
offset_in_model = bboard_parse_offset(s2 + 1, &ox, &oy);
}
- if (!EMPTY_STRING_P(VALUE_NAME(element))) {
- fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_true);
+ if (!PCB_EMPTY_STRING_P(PCB_ELEM_NAME_VALUE(element))) {
+ fname = bboard_get_model_filename(s, PCB_ELEM_NAME_VALUE(element), pcb_true);
if (!fname)
- fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_false);
+ fname = bboard_get_model_filename(s, PCB_ELEM_NAME_VALUE(element), pcb_false);
}
if (!fname)
fname = bboard_get_model_filename(s, NULL, pcb_false);
@@ -423,28 +405,28 @@ static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder
/* invalidate offset from BBoard::Model, if such model does not exist */
offset_in_model = pcb_false;
- s = AttributeGetFromList(&(element->Attributes), "Footprint::File");
+ s = pcb_attribute_get(&(element->Attributes), "Footprint::File");
if (s) {
- if (!EMPTY_STRING_P(VALUE_NAME(element))) {
- fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_true);
+ if (!PCB_EMPTY_STRING_P(PCB_ELEM_NAME_VALUE(element))) {
+ fname = bboard_get_model_filename(s, PCB_ELEM_NAME_VALUE(element), pcb_true);
if (!fname)
- fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_false);
+ fname = bboard_get_model_filename(s, PCB_ELEM_NAME_VALUE(element), pcb_false);
}
if (!fname)
fname = bboard_get_model_filename(s, NULL, pcb_false);
}
}
if (!fname) {
- s = DESCRIPTION_NAME(element);
- if (!EMPTY_STRING_P(DESCRIPTION_NAME(element))) {
- if (!EMPTY_STRING_P(VALUE_NAME(element))) {
- fname = bboard_get_model_filename(DESCRIPTION_NAME(element), VALUE_NAME(element), pcb_true);
+ s = PCB_ELEM_NAME_DESCRIPTION(element);
+ if (!PCB_EMPTY_STRING_P(PCB_ELEM_NAME_DESCRIPTION(element))) {
+ if (!PCB_EMPTY_STRING_P(PCB_ELEM_NAME_VALUE(element))) {
+ fname = bboard_get_model_filename(PCB_ELEM_NAME_DESCRIPTION(element), PCB_ELEM_NAME_VALUE(element), pcb_true);
if (!fname)
- fname = bboard_get_model_filename(DESCRIPTION_NAME(element), VALUE_NAME(element), pcb_false);
+ fname = bboard_get_model_filename(PCB_ELEM_NAME_DESCRIPTION(element), PCB_ELEM_NAME_VALUE(element), pcb_false);
}
if (!fname)
- fname = bboard_get_model_filename(DESCRIPTION_NAME(element), NULL, pcb_false);
+ fname = bboard_get_model_filename(PCB_ELEM_NAME_DESCRIPTION(element), NULL, pcb_false);
}
}
@@ -461,7 +443,7 @@ static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder
/* read offest from attribute */
if (!offset_in_model) {
- s = AttributeGetFromList(&(element->Attributes), "BBoard::Offset");
+ s = pcb_attribute_get(&(element->Attributes), "BBoard::Offset");
/* Parse values with units... */
if (s) {
@@ -473,13 +455,13 @@ static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder
cairo_save(bboard_cairo_ctx);
- if ((model_angle = AttributeGetFromList(&(element->Attributes), "Footprint::RotationTracking")) != NULL) {
+ if ((model_angle = pcb_attribute_get(&(element->Attributes), "Footprint::RotationTracking")) != NULL) {
sscanf(model_angle, "%lf", &tmp_angle);
}
cairo_translate(bboard_cairo_ctx, ex, ey);
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) {
cairo_scale(bboard_cairo_ctx, 1, -1);
}
cairo_rotate(bboard_cairo_ctx, -tmp_angle * M_PI / 180.);
@@ -493,11 +475,11 @@ static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder
}
-static void bboard_do_export(HID_Attr_Val * options)
+static void bboard_do_export(pcb_hid_attr_val_t * options)
{
int i;
int clr_r, clr_g, clr_b;
- LayerType *layer;
+ pcb_layer_t *layer;
if (!options) {
@@ -515,55 +497,50 @@ static void bboard_do_export(HID_Attr_Val * options)
bboard_bgcolor = "FFFFFF";
memset(group_data, 0, sizeof(group_data));
-#ifdef SOLDER_LAYER
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + SOLDER_LAYER)].solder = 1;
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + COMPONENT_LAYER)].component = 1;
-#else
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + BOTTOM_SIDE)].solder = 1;
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + TOP_SIDE)].component = 1;
-#endif
+ group_data[pcb_layer_get_group(pcb_max_copper_layer + PCB_SOLDER_SIDE)].solder = 1;
+ group_data[pcb_layer_get_group(pcb_max_copper_layer + PCB_COMPONENT_SIDE)].component = 1;
- for (i = 0; i < max_copper_layer; i++) {
+ for (i = 0; i < pcb_max_copper_layer; i++) {
layer = PCB->Data->Layer + i;
if (linelist_length(&layer->Line) > 0)
- group_data[GetLayerGroupNumberByNumber(i)].draw = 1;
+ group_data[pcb_layer_get_group(i)].draw = 1;
}
bboard_init_board_cairo(PCB->MaxWidth, PCB->MaxHeight, bboard_bgcolor, options[HA_antialias].int_value);
/* write out components on solder side */
- ELEMENT_LOOP(PCB->Data);
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) {
+ PCB_ELEMENT_LOOP(PCB->Data);
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) {
bboard_export_element_cairo(element, 1);
}
- END_LOOP;
+ PCB_END_LOOP;
/* write out components on component side */
- ELEMENT_LOOP(PCB->Data);
- if (!TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) {
+ PCB_ELEMENT_LOOP(PCB->Data);
+ if (!PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) {
bboard_export_element_cairo(element, 0);
}
- END_LOOP;
+ PCB_END_LOOP;
/* draw all wires from all valid layers */
- for (i = max_copper_layer - 1; i >= 0; i--) {
- if (bboard_validate_layer(PCB->Data->Layer[i].Name, GetLayerGroupNumberByNumber(i), options[HA_skipsolder].int_value)) {
+ for (i = pcb_max_copper_layer - 1; i >= 0; i--) {
+ if (bboard_validate_layer(pcb_layer_flags(i), pcb_layer_get_group(i), options[HA_skipsolder].int_value)) {
bboard_get_layer_color(&(PCB->Data->Layer[i]), &clr_r, &clr_g, &clr_b);
bboard_set_color_cairo(clr_r, clr_g, clr_b);
- LINE_LOOP(&(PCB->Data->Layer[i]));
+ PCB_LINE_LOOP(&(PCB->Data->Layer[i]));
{
bboard_draw_line_cairo(line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y, line->Thickness);
}
- END_LOOP;
- ARC_LOOP(&(PCB->Data->Layer[i]));
+ PCB_END_LOOP;
+ PCB_ARC_LOOP(&(PCB->Data->Layer[i]));
{
#warning TODO: remove x1;y1;x2;y2
bboard_draw_arc_cairo(/*arc->Point1.X, arc->Point1.Y,
arc->Point2.X, arc->Point2.Y,*/
arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta, arc->Thickness);
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
@@ -573,7 +550,7 @@ static void bboard_do_export(HID_Attr_Val * options)
static void bboard_parse_arguments(int *argc, char ***argv)
{
- hid_parse_command_line(argc, argv);
+ pcb_hid_parse_command_line(argc, argv);
}
@@ -587,14 +564,14 @@ static void bboard_set_crosshair(int x, int y, int action)
{
}
-static HID bboard_hid;
+static pcb_hid_t bboard_hid;
pcb_uninit_t hid_export_bboard_init()
{
memset(&bboard_hid, 0, sizeof(bboard_hid));
- common_nogui_init(&bboard_hid);
+ pcb_hid_nogui_init(&bboard_hid);
bboard_hid.struct_size = sizeof(bboard_hid);
bboard_hid.name = "bboard";
@@ -606,9 +583,9 @@ pcb_uninit_t hid_export_bboard_init()
bboard_hid.parse_arguments = bboard_parse_arguments;
bboard_hid.calibrate = bboard_calibrate;
bboard_hid.set_crosshair = bboard_set_crosshair;
- hid_register_hid(&bboard_hid);
+ pcb_hid_register_hid(&bboard_hid);
- hid_register_attributes(bboard_options, sizeof(bboard_options) / sizeof(bboard_options[0]), bboard_cookie, 0);
+ pcb_hid_register_attributes(bboard_options, sizeof(bboard_options) / sizeof(bboard_options[0]), bboard_cookie, 0);
return NULL;
}
diff --git a/src_plugins/export_bom/Makefile b/src_plugins/export_bom/Makefile
index cafd8e5..cb2252e 100644
--- a/src_plugins/export_bom/Makefile
+++ b/src_plugins/export_bom/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_bom
+ cd ../../src && $(MAKE) mod_export_bom
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_bom/bom.c b/src_plugins/export_bom/bom.c
index 313c9f7..e0414ea 100644
--- a/src_plugins/export_bom/bom.c
+++ b/src_plugins/export_bom/bom.c
@@ -7,10 +7,10 @@
#include <string.h>
#include <time.h>
-#include "global.h"
+#include "build_run.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "plugins.h"
#include "compat_misc.h"
@@ -23,7 +23,7 @@
const char *bom_cookie = "bom HID";
-static HID_Attribute bom_options[] = {
+static pcb_hid_attribute_t bom_options[] = {
/* %start-doc options "8 BOM Creation"
@ftable @code
@item --bomfile <string>
@@ -45,7 +45,7 @@ Name of the XY output file.
#define NUM_OPTIONS (sizeof(bom_options)/sizeof(bom_options[0]))
-static HID_Attr_Val bom_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t bom_values[NUM_OPTIONS];
static const char *bom_filename;
@@ -62,12 +62,12 @@ typedef struct _BomList {
struct _BomList *next;
} BomList;
-static HID_Attribute *bom_get_export_options(int *n)
+static pcb_hid_attribute_t *bom_get_export_options(int *n)
{
static char *last_bom_filename = NULL;
if (PCB)
- derive_default_filename(PCB->Filename, &bom_options[HA_bomfile], ".bom", &last_bom_filename);
+ pcb_derive_default_filename(PCB->Filename, &bom_options[HA_bomfile], ".bom", &last_bom_filename);
if (n)
*n = NUM_OPTIONS;
@@ -156,7 +156,7 @@ static BomList *bom_insert(char *refdes, char *descr, char *value, BomList * bom
components */
cur = bom;
while (cur != NULL) {
- if ((NSTRCMP(descr, cur->descr) == 0) && (NSTRCMP(value, cur->value) == 0)) {
+ if ((PCB_NSTRCMP(descr, cur->descr) == 0) && (PCB_NSTRCMP(value, cur->value) == 0)) {
cur->num++;
cur->refdes = string_insert(refdes, cur->refdes);
break;
@@ -237,17 +237,17 @@ static int PrintBOM(void)
}
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/* insert this component into the bill of materials list */
- bom = bom_insert((char *) UNKNOWN(NAMEONPCB_NAME(element)),
- (char *) UNKNOWN(DESCRIPTION_NAME(element)), (char *) UNKNOWN(VALUE_NAME(element)), bom);
+ bom = bom_insert((char *) PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)),
+ (char *) PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)), (char *) PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)), bom);
}
- END_LOOP;
+ PCB_END_LOOP;
fp = fopen(bom_filename, "w");
if (!fp) {
- gui->log("Cannot open file %s for writing\n", bom_filename);
+ pcb_gui->log("Cannot open file %s for writing\n", bom_filename);
print_and_free(NULL, bom);
return 1;
}
@@ -257,7 +257,7 @@ static int PrintBOM(void)
fprintf(fp, "# PcbBOM Version 1.0\n");
fprintf(fp, "# Date: %s\n", utcTime);
fprintf(fp, "# Author: %s\n", pcb_author());
- fprintf(fp, "# Title: %s - PCB BOM\n", UNKNOWN(PCB->Name));
+ fprintf(fp, "# Title: %s - PCB BOM\n", PCB_UNKNOWN(PCB->Name));
fprintf(fp, "# Quantity, Description, Value, RefDes\n");
fprintf(fp, "# --------------------------------------------\n");
@@ -268,7 +268,7 @@ static int PrintBOM(void)
return (0);
}
-static void bom_do_export(HID_Attr_Val * options)
+static void bom_do_export(pcb_hid_attr_val_t * options)
{
int i;
@@ -289,7 +289,7 @@ static void bom_do_export(HID_Attr_Val * options)
static int bom_usage(const char *topic)
{
fprintf(stderr, "\nbom exporter command line arguments:\n\n");
- hid_usage(bom_options, sizeof(bom_options) / sizeof(bom_options[0]));
+ pcb_hid_usage(bom_options, sizeof(bom_options) / sizeof(bom_options[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x bom foo.pcb [bom_options]\n\n");
return 0;
}
@@ -297,19 +297,19 @@ static int bom_usage(const char *topic)
static void bom_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(bom_options, sizeof(bom_options) / sizeof(bom_options[0]), bom_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(bom_options, sizeof(bom_options) / sizeof(bom_options[0]), bom_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-HID bom_hid;
+pcb_hid_t bom_hid;
pcb_uninit_t hid_export_bom_init()
{
- memset(&bom_hid, 0, sizeof(HID));
+ memset(&bom_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&bom_hid);
+ pcb_hid_nogui_init(&bom_hid);
- bom_hid.struct_size = sizeof(HID);
+ bom_hid.struct_size = sizeof(pcb_hid_t);
bom_hid.name = "bom";
bom_hid.description = "Exports a Bill of Materials";
bom_hid.exporter = 1;
@@ -320,6 +320,6 @@ pcb_uninit_t hid_export_bom_init()
bom_hid.usage = bom_usage;
- hid_register_hid(&bom_hid);
+ pcb_hid_register_hid(&bom_hid);
return NULL;
}
diff --git a/src_plugins/export_dsn/Makefile b/src_plugins/export_dsn/Makefile
index 484a0ad..ad9ac5c 100644
--- a/src_plugins/export_dsn/Makefile
+++ b/src_plugins/export_dsn/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_dsn
+ cd ../../src && $(MAKE) mod_export_dsn
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_dsn/dsn.c b/src_plugins/export_dsn/dsn.c
index c118a5b..04e607e 100644
--- a/src_plugins/export_dsn/dsn.c
+++ b/src_plugins/export_dsn/dsn.c
@@ -38,18 +38,15 @@ By Josh Jordan and Dan McMahill, modified from bom.c
#include <glib.h>
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "rats.h"
#include "buffer.h"
#include "change.h"
#include "draw.h"
-#include "set.h"
#include "undo.h"
#include "pcb-printf.h"
-#include "create.h"
#include "polygon.h"
#include "compat_misc.h"
#include "layer.h"
@@ -62,17 +59,19 @@ By Josh Jordan and Dan McMahill, modified from bom.c
#include "hid_attrib.h"
#include "hid_helper.h"
#include "plugins.h"
+#include "obj_line.h"
+#include "obj_pinvia.h"
static const char *dsn_cookie = "dsn exporter";
-static Coord trackwidth = 8; /* user options defined in export dialog */
-static Coord clearance = 8;
-static Coord viawidth = 45;
-static Coord viadrill = 25;
+static pcb_coord_t trackwidth = 8; /* user options defined in export dialog */
+static pcb_coord_t clearance = 8;
+static pcb_coord_t viawidth = 45;
+static pcb_coord_t viadrill = 25;
-static HID dsn_hid;
+static pcb_hid_t dsn_hid;
-static HID_Attribute dsn_options[] = {
+static pcb_hid_attribute_t dsn_options[] = {
{"dsnfile", "SPECCTRA output file",
HID_String, 0, 0, {0, 0, 0}, 0, 0},
#define HA_dsnfile 0
@@ -93,17 +92,17 @@ static HID_Attribute dsn_options[] = {
};
#define NUM_OPTIONS (sizeof(dsn_options)/sizeof(dsn_options[0]))
-REGISTER_ATTRIBUTES(dsn_options, dsn_cookie)
+PCB_REGISTER_ATTRIBUTES(dsn_options, dsn_cookie)
-static HID_Attr_Val dsn_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t dsn_values[NUM_OPTIONS];
static const char *dsn_filename;
-static HID_Attribute *dsn_get_export_options(int *n)
+static pcb_hid_attribute_t *dsn_get_export_options(int *n)
{
static char *last_dsn_filename = 0;
if (PCB) {
- derive_default_filename(PCB->Filename, &dsn_options[HA_dsnfile], ".dsn", &last_dsn_filename);
+ pcb_derive_default_filename(PCB->Filename, &dsn_options[HA_dsnfile], ".dsn", &last_dsn_filename);
}
if (n)
*n = NUM_OPTIONS;
@@ -112,27 +111,27 @@ static HID_Attribute *dsn_get_export_options(int *n)
/* this function is mostly ripped from bom.c */
-static PointType get_centroid(ElementType * element)
+static pcb_point_t get_centroid(pcb_element_t * element)
{
- PointType centroid;
+ pcb_point_t centroid;
double sumx = 0.0, sumy = 0.0;
int pin_cnt = 0;
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
sumx += (double) pin->X;
sumy += (double) pin->Y;
pin_cnt++;
}
- END_LOOP;
+ PCB_END_LOOP;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
sumx += (pad->Point1.X + pad->Point2.X) / 2.0;
sumy += (pad->Point1.Y + pad->Point2.Y) / 2.0;
pin_cnt++;
}
- END_LOOP;
+ PCB_END_LOOP;
if (pin_cnt > 0) {
centroid.X = sumx / (double) pin_cnt;
@@ -164,12 +163,12 @@ static void print_structure(FILE * fp)
layerlist = g_list_append(layerlist, &PCB->Data->Layer[top_layer]);
}
else {
- gui->log("WARNING! DSN export does not include the top layer. "
+ pcb_gui->log("WARNING! DSN export does not include the top layer. "
"Router will consider an inner layer to be the \"top\" layer.\n");
}
- for (group = 0; group < max_group; group++) {
- LayerType *first_layer;
+ for (group = 0; group < pcb_max_group; group++) {
+ pcb_layer_t *first_layer;
if (group == top_group || group == bot_group)
continue;
@@ -183,43 +182,43 @@ static void print_structure(FILE * fp)
layerlist = g_list_append(layerlist, first_layer);
if (group < top_group) {
- gui->log("WARNING! DSN export moved layer group with the \"%s\" layer "
+ pcb_gui->log("WARNING! DSN export moved layer group with the \"%s\" layer "
"after the top layer group. DSN files must have the top " "layer first.\n", first_layer->Name);
}
if (group > bot_group) {
- gui->log("WARNING! DSN export moved layer group with the \"%s\" layer "
+ pcb_gui->log("WARNING! DSN export moved layer group with the \"%s\" layer "
"before the bottom layer group. DSN files must have the " "bottom layer last.\n", first_layer->Name);
}
GROUP_LOOP(PCB->Data, group);
{
if (entry > 0) {
- gui->log("WARNING! DSN export squashed layer \"%s\" into layer "
+ pcb_gui->log("WARNING! DSN export squashed layer \"%s\" into layer "
"\"%s\", DSN files do not have layer groups.", layer->Name, first_layer->Name);
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
if (PCB->Data->Layer[bot_layer].On) {
layerlist = g_list_append(layerlist, &PCB->Data->Layer[bot_layer]);
}
else {
- gui->log("WARNING! DSN export does not include the bottom layer. "
+ pcb_gui->log("WARNING! DSN export does not include the bottom layer. "
"Router will consider an inner layer to be the \"bottom\" layer.\n");
}
fprintf(fp, " (structure\n");
for (GList * iter = layerlist; iter; iter = g_list_next(iter)) {
- LayerType *layer = iter->data;
+ pcb_layer_t *layer = iter->data;
char *layeropts = pcb_strdup("(type signal)");
/* see if layer has same name as a net and make it a power layer */
/* loop thru all nets */
- for (int ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) {
+ for (int ni = 0; ni < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; ni++) {
char *nname;
- nname = PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2;
+ nname = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Name + 2;
if (!strcmp(layer->Name, nname)) {
g_free(layeropts);
layeropts = pcb_strdup_printf("(type power) (use_net \"%s\")", layer->Name);
@@ -251,12 +250,12 @@ static void print_structure(FILE * fp)
static void print_placement(FILE * fp)
{
fprintf(fp, " (placement\n");
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
char *ename;
- PointType ecentroid = get_centroid(element);
- char *side = TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? "back" : "front";
- ename = NAMEONPCB_NAME(element);
+ pcb_point_t ecentroid = get_centroid(element);
+ char *side = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? "back" : "front";
+ ename = PCB_ELEM_NAME_REFDES(element);
if (ename != NULL)
ename = pcb_strdup(ename);
else
@@ -266,15 +265,15 @@ static void print_placement(FILE * fp)
pcb_fprintf(fp, " )\n");
g_free(ename);
}
- END_LOOP;
+ PCB_END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{ /* add mounting holes */
pcb_fprintf(fp, " (component %d\n", via->ID);
pcb_fprintf(fp, " (place %d %.6mm %.6mm %s 0 (PN 0))\n", via->ID, via->X, (PCB->MaxHeight - via->Y), "front");
pcb_fprintf(fp, " )\n");
}
- END_LOOP;
+ PCB_END_LOOP;
fprintf(fp, " )\n");
}
@@ -283,21 +282,21 @@ static void print_library(FILE * fp)
GList *pads = NULL, *iter; /* contain unique pad names */
gchar *padstack;
fprintf(fp, " (library\n");
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- int partside = TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? g_list_length(layerlist) - 1 : 0;
- int partsidesign = TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? -1 : 1;
- PointType centroid = get_centroid(element);
+ int partside = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? g_list_length(layerlist) - 1 : 0;
+ int partsidesign = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? -1 : 1;
+ pcb_point_t centroid = get_centroid(element);
fprintf(fp, " (image %ld\n", element->ID); /* map every element by ID */
/* loop thru pins and pads to add to image */
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- Coord ty;
- Coord pinthickness;
- Coord lx, ly; /* hold local pin coordinates */
+ pcb_coord_t ty;
+ pcb_coord_t pinthickness;
+ pcb_coord_t lx, ly; /* hold local pin coordinates */
ty = PCB->MaxHeight - pin->Y;
pinthickness = pin->Thickness;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin))
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin))
padstack = pcb_strdup_printf("Th_square_%mI", pinthickness);
else
padstack = pcb_strdup_printf("Th_round_%mI", pinthickness);
@@ -306,7 +305,7 @@ static void print_library(FILE * fp)
if (!pin->Number) { /* if pin is null just make it a keepout */
for (GList * iter = layerlist; iter; iter = g_list_next(iter)) {
- LayerType *lay = iter->data;
+ pcb_layer_t *lay = iter->data;
pcb_fprintf(fp, " (keepout \"\" (circle \"%s\" %.6mm %.6mm %.6mm))\n", lay->Name, pinthickness, lx, ly);
}
}
@@ -319,12 +318,12 @@ static void print_library(FILE * fp)
else
g_free(padstack);
}
- END_LOOP;
+ PCB_END_LOOP;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
- Coord xlen, ylen, xc, yc, p1y, p2y;
- Coord lx, ly; /* store local coordinates for pins */
+ pcb_coord_t xlen, ylen, xc, yc, p1y, p2y;
+ pcb_coord_t lx, ly; /* store local coordinates for pins */
p1y = PCB->MaxHeight - pad->Point1.Y;
p2y = PCB->MaxHeight - pad->Point2.Y;
/* pad dimensions are unusual-
@@ -345,7 +344,7 @@ static void print_library(FILE * fp)
padstack = pcb_strdup_printf("Smd_rect_%mIx%mI", xlen, ylen);
if (!pad->Number) { /* if pad is null just make it a keepout */
- LayerType *lay;
+ pcb_layer_t *lay;
lay = g_list_nth_data(layerlist, partside);
pcb_fprintf(fp, " (keepout \"\" (rect \"%s\" %.6mm %.6mm %.6mm %.6mm))\n",
lay->Name, lx - xlen / 2, ly - ylen / 2, lx + xlen / 2, ly + ylen / 2);
@@ -358,12 +357,12 @@ static void print_library(FILE * fp)
else
g_free(padstack);
}
- END_LOOP;
+ PCB_END_LOOP;
fprintf(fp, " )\n");
}
- END_LOOP;
+ PCB_END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{ /* add mounting holes and vias */
fprintf(fp, " (image %ld\n", via->ID); /* map every via by ID */
/* for mounting holes, clearance is added to thickness for higher total clearance */
@@ -375,25 +374,30 @@ static void print_library(FILE * fp)
else
g_free(padstack);
}
- END_LOOP;
+ PCB_END_LOOP;
/* loop thru padstacks and define them all */
for (iter = pads; iter; iter = g_list_next(iter)) {
- Coord dim1, dim2;
+ pcb_coord_t dim1, dim2;
+ long int dim1l, dim2l;
padstack = iter->data;
fprintf(fp, " (padstack %s\n", padstack);
/* print info about pad here */
- if (sscanf(padstack, "Smd_rect_%ldx%ld", &dim1, &dim2) == 2) { /* then pad is smd */
+ if (sscanf(padstack, "Smd_rect_%ldx%ld", &dim1l, &dim2l) == 2) { /* then pad is smd */
+ dim1 = dim1l;
+ dim2 = dim2l;
pcb_fprintf(fp,
" (shape (rect \"%s\" %.6mm %.6mm %.6mm %.6mm))\n",
- ((LayerType *) (g_list_first(layerlist)->data))->Name, dim1 / -2, dim2 / -2, dim1 / 2, dim2 / 2);
+ ((pcb_layer_t *) (g_list_first(layerlist)->data))->Name, dim1 / -2, dim2 / -2, dim1 / 2, dim2 / 2);
}
- else if (sscanf(padstack, "Th_square_%ld", &dim1) == 1) {
+ else if (sscanf(padstack, "Th_square_%ld", &dim1l) == 1) {
+ dim1 = dim1l;
pcb_fprintf(fp, " (shape (rect signal %.6mm %.6mm %.6mm %.6mm))\n", dim1 / -2, dim1 / -2, dim1 / 2, dim1 / 2);
}
else {
- sscanf(padstack, "Th_round_%ld", &dim1);
+ sscanf(padstack, "Th_round_%ld", &dim1l);
+ dim1 = dim1l;
pcb_fprintf(fp, " (shape (circle signal %.6mm))\n", dim1);
}
fprintf(fp, " (attach off)\n");
@@ -430,18 +434,18 @@ static void print_network(FILE * fp)
{
int ni, nei;
fprintf(fp, " (network\n");
- for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) {
- fprintf(fp, " (net \"%s\"\n", PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2);
+ for (ni = 0; ni < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; ni++) {
+ fprintf(fp, " (net \"%s\"\n", PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Name + 2);
fprintf(fp, " (pins");
- for (nei = 0; nei < PCB->NetlistLib[NETLIST_EDITED].Menu[ni].EntryN; nei++)
- print_quoted_pin(fp, PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry);
+ for (nei = 0; nei < PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].EntryN; nei++)
+ print_quoted_pin(fp, PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry);
fprintf(fp, ")\n");
fprintf(fp, " )\n");
}
fprintf(fp, " (class geda_default");
- for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) {
- fprintf(fp, " \"%s\"", PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2);
+ for (ni = 0; ni < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; ni++) {
+ fprintf(fp, " \"%s\"", PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Name + 2);
}
pcb_fprintf(fp, "\n");
pcb_fprintf(fp, " (circuit\n");
@@ -453,12 +457,12 @@ static void print_network(FILE * fp)
static void print_wires(FILE * fp)
{
GList *iter;
- LayerType *lay;
+ pcb_layer_t *lay;
fprintf(fp, " (wiring\n");
for (iter = layerlist; iter; iter = g_list_next(iter)) {
lay = iter->data;
- LINE_LOOP(lay);
+ PCB_LINE_LOOP(lay);
{
pcb_fprintf(fp,
" (wire (path %s %.6mm %.6mm %.6mm %.6mm %.6mm)\n",
@@ -466,7 +470,7 @@ static void print_wires(FILE * fp)
(PCB->MaxHeight - line->Point1.Y), line->Point2.X, (PCB->MaxHeight - line->Point2.Y));
fprintf(fp, " (type protect))\n");
}
- END_LOOP;
+ PCB_END_LOOP;
}
fprintf(fp, "\n )\n)\n"); /* close all braces */
}
@@ -477,7 +481,7 @@ static int PrintSPECCTRA(void)
/* Print out the dsn .dsn file. */
fp = fopen(dsn_filename, "w");
if (!fp) {
- gui->log("Cannot open file %s for writing\n", dsn_filename);
+ pcb_gui->log("Cannot open file %s for writing\n", dsn_filename);
return 1;
}
@@ -538,7 +542,7 @@ static int PrintSPECCTRA(void)
}
-static void dsn_do_export(HID_Attr_Val * options)
+static void dsn_do_export(pcb_hid_attr_val_t * options)
{
int i;
if (!options) {
@@ -560,7 +564,7 @@ static void dsn_do_export(HID_Attr_Val * options)
static void dsn_parse_arguments(int *argc, char ***argv)
{
- hid_parse_command_line(argc, argv);
+ pcb_hid_parse_command_line(argc, argv);
}
static void hid_dsn_uninit()
@@ -571,19 +575,19 @@ static void hid_dsn_uninit()
#include "dolists.h"
pcb_uninit_t hid_export_dsn_init()
{
- memset(&dsn_hid, 0, sizeof(HID));
- common_nogui_init(&dsn_hid);
+ memset(&dsn_hid, 0, sizeof(pcb_hid_t));
+ pcb_hid_nogui_init(&dsn_hid);
- dsn_hid.struct_size = sizeof(HID);
+ dsn_hid.struct_size = sizeof(pcb_hid_t);
dsn_hid.name = "dsn";
dsn_hid.description = "Exports DSN format";
dsn_hid.exporter = 1;
dsn_hid.get_export_options = dsn_get_export_options;
dsn_hid.do_export = dsn_do_export;
dsn_hid.parse_arguments = dsn_parse_arguments;
- hid_register_hid(&dsn_hid);
+ pcb_hid_register_hid(&dsn_hid);
- hid_register_attributes(dsn_options, sizeof(dsn_options) / sizeof(dsn_options[0]), dsn_cookie, 0);
+ pcb_hid_register_attributes(dsn_options, sizeof(dsn_options) / sizeof(dsn_options[0]), dsn_cookie, 0);
return hid_dsn_uninit;
}
diff --git a/src_plugins/export_dxf/Makefile b/src_plugins/export_dxf/Makefile
index c6da93f..34aaaf2 100644
--- a/src_plugins/export_dxf/Makefile
+++ b/src_plugins/export_dxf/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_dxf
+ cd ../../src && $(MAKE) mod_export_dxf
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_dxf/dxf.c b/src_plugins/export_dxf/dxf.c
index b700c4b..d2b1775 100644
--- a/src_plugins/export_dxf/dxf.c
+++ b/src_plugins/export_dxf/dxf.c
@@ -169,9 +169,7 @@
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include <stdio.h>
#include <stdarg.h>
@@ -180,11 +178,11 @@
#include <time.h>
#include <unistd.h>
-#include "config.h"
+#include "math_helper.h"
#include "macro.h"
-#include "global.h"
+#include "board.h"
+#include "config.h"
#include "data.h"
-#include "misc.h"
#include "error.h"
#include "draw.h"
#include "hid_draw_helpers.h"
@@ -195,9 +193,9 @@
#include "hid_flags.h"
#include "hid_helper.h"
#include "hid.h"
-#include "draw.h"
#include "hid_init.h"
#include "plugins.h"
+#include "obj_pinvia.h"
/*!
* \brief List with string data.
@@ -242,32 +240,31 @@ typedef struct _DxfList {
static void dxf_beep(void);
static void dxf_calibrate(double xval, double yval);
static char *dxf_clean_string(char *in);
-static void dxf_destroy_gc(hidGC gc);
-static void dxf_do_export(HID_Attr_Val * options);
-static void dxf_draw_arc(hidGC gc, int cx, int cy, int width, int height, int start_angle, int delta_angle);
-static void dxf_draw_line(hidGC gc, int x1, int y1, int x2, int y2);
-static void dxf_draw_rect(hidGC gc, int x1, int y1, int x2, int y2);
+static void dxf_destroy_gc(pcb_hid_gc_t gc);
+static void dxf_do_export(pcb_hid_attr_val_t * options);
+static void dxf_draw_arc(pcb_hid_gc_t gc, int cx, int cy, int width, int height, int start_angle, int delta_angle);
+static void dxf_draw_line(pcb_hid_gc_t gc, int x1, int y1, int x2, int y2);
+static void dxf_draw_rect(pcb_hid_gc_t gc, int x1, int y1, int x2, int y2);
static int dxf_drill_sort(const void *va, const void *vb);
static int dxf_export_xref_file(void);
-static void dxf_fill_circle(hidGC gc, int cx, int cy, int radius);
-static void dxf_fill_polygon(hidGC gc, int n_coords, int *x, int *y);
-static void dxf_fill_rect(hidGC gc, int x1, int y1, int x2, int y2);
-static HID_Attribute *dxf_get_export_options(int *n);
-static int dxf_group_for_layer(int l);
+static void dxf_fill_circle(pcb_hid_gc_t gc, int cx, int cy, int radius);
+static void dxf_fill_polygon(pcb_hid_gc_t gc, int n_coords, int *x, int *y);
+static void dxf_fill_rect(pcb_hid_gc_t gc, int x1, int y1, int x2, int y2);
+static pcb_hid_attribute_t *dxf_get_export_options(int *n);
+static pcb_layergrp_id_t dxf_group_for_layer(int l);
static DxfList *dxf_insert(char *refdes, char *descr, char *value, DxfList * dxf);
static int dxf_layer_sort(const void *va, const void *vb);
-static hidGC dxf_make_gc(void);
+static pcb_hid_gc_t dxf_make_gc(void);
static void dxf_maybe_close_file();
static void dxf_parse_arguments(int *argc, char ***argv);
static void dxf_progress(int dxf_so_far, int dxf_total, const char *dxf_message);
-static void dxf_set_color(hidGC gc, const char *name);
+static void dxf_set_color(pcb_hid_gc_t gc, const char *name);
static void dxf_set_crosshair(int x, int y);
-static int dxf_set_layer(const char *name, int group);
-static void dxf_set_line_cap(hidGC gc, EndCapStyle style);
-static void dxf_set_line_width(hidGC gc, int width);
+static void dxf_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style);
+static void dxf_set_line_width(pcb_hid_gc_t gc, int width);
static void dxf_show_item(void *item);
static StringList *dxf_string_insert(char *str, StringList * list);
-static void dxf_use_gc(hidGC gc, int radius);
+static void dxf_use_gc(pcb_hid_gc_t gc, int radius);
static void dxf_use_mask(int use_it);
static void dxf_write_block(FILE * fp, int id_code, char *xref_name,
char *block_name, char *linetype, char *layer, double x0,
@@ -539,7 +536,7 @@ static int dxf_id_code = 0;
/*!
* \brief Record with all values of the DXF HID.
*/
-static HID dxf_hid;
+static pcb_hid_t dxf_hid;
/*!
* \brief Drill (hole) properties.
@@ -605,8 +602,8 @@ int dxf_max_pending_drills = 0;
* endpoint of a line, this doesn't solve the problem for other aperture
* shapes, and is thus not yet implemented.
*/
-typedef struct hid_gc_struct {
- EndCapStyle cap;
+typedef struct hid_gc_s {
+ pcb_cap_style_t cap;
/*!< end cap style. */
int width;
/*!< width. */
@@ -616,13 +613,13 @@ typedef struct hid_gc_struct {
/*!< erase. */
int drill;
/*!< drill. */
-} hid_gc_struct;
+} hid_gc_s;
/*!
* \brief Definition of options the user can select in the DXF exporter
* dialog.
*/
-static HID_Attribute dxf_options[] = {
+static pcb_hid_attribute_t dxf_options[] = {
/*
%start-doc options "DXF Export"
@ftable @code
@@ -718,7 +715,7 @@ Export all layers.
* HID_Label just shows the default str_value.\n
* HID_Mixed is a real_value followed by an enum, like 0.5in or 100mm.
*/
-static HID_Attr_Val dxf_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t dxf_values[NUM_OPTIONS];
static int pagecount = 0;
@@ -730,8 +727,6 @@ static int lastcap = -1;
static int lastcolor = -1;
-static int print_layer[MAX_LAYER];
-
/*!
* \brief The last X coordinate.
*/
@@ -745,12 +740,12 @@ static int dxf_lastY;
/*!
* \brief Find a group for a given layer ??.
*/
-static int dxf_group_for_layer(int l) {
- if ((l < max_copper_layer + 2) && (l >= 0)) {
- return GetLayerGroupNumberByNumber(l);
+static pcb_layergrp_id_t dxf_group_for_layer(int l) {
+ if ((l < pcb_max_copper_layer + 2) && (l >= 0)) {
+ return pcb_layer_get_group(l);
}
/* else something unique */
- return max_group + 3 + l;
+ return pcb_max_group + 3 + l;
}
/*!
@@ -788,7 +783,7 @@ static double dxf_xy_to_angle(double x, double y) {
theta = 270.0;
else {
theta = 0.0;
- Message(PCB_MSG_WARNING, "DXF: in dxf_xy_to_angle ():\n"
+ pcb_message(PCB_MSG_WARNING, "DXF: in dxf_xy_to_angle ():\n"
" unable to figure out angle of element\n"
" because the pin is at the centroid of the part.\n"
" This is a BUG!!!\n" " Setting to %g degrees\n", theta);
@@ -814,7 +809,7 @@ static char *dxf_clean_string(char *in) {
fprintf(stderr, "[File: %s: line: %d] Entering dxf_clean_string () function.\n", __FILE__, __LINE__);
#endif
if ((out = malloc((strlen(in) + 1) * sizeof(char))) == NULL) {
- Message(PCB_MSG_ERROR, "DXF: in dxf_clean_string (): malloc () failed.\n");
+ pcb_message(PCB_MSG_ERROR, "DXF: in dxf_clean_string (): malloc () failed.\n");
exit(1);
}
for (i = 0; i <= strlen(in); i++) {
@@ -848,7 +843,7 @@ static StringList *dxf_string_insert(char *str, StringList * list) {
fprintf(stderr, "[File: %s: line: %d] Entering dxf_string_insert () function.\n", __FILE__, __LINE__);
#endif
if ((new = (StringList *) malloc(sizeof(StringList))) == NULL) {
- Message(PCB_MSG_ERROR, "DXF: in dxf_string_insert (): malloc () failed.\n");
+ pcb_message(PCB_MSG_ERROR, "DXF: in dxf_string_insert (): malloc () failed.\n");
exit(1);
}
new->next = NULL;
@@ -2577,7 +2572,6 @@ static void dxf_write_header_metric_new()
static void dxf_write_header()
{
FILE *f_temp;
- char *temp = NULL;
static char *dxf_header_filename;
@@ -2594,18 +2588,20 @@ static void dxf_write_header()
* read-only */
f_temp = fopen(dxf_header_filename, "r");
if (f_temp) {
+ char buff[1024];
/* do until EOF of the template file:
* copy line by line from template file (f_temp) to
* destination file (fp) */
while (!feof(f_temp)) {
- fscanf(f_temp, "%s", temp);
- fprintf(fp, "%s", temp);
+ int len = fread(buff, 1, sizeof(buff), f_temp);
+ if (len > 0)
+ fwrite(buff, 1, len, fp);
}
/* when we're done close the template file */
fclose(f_temp);
}
else {
- gui->log("Error in dxf_write_header_from_template (): cannot open file %s for reading.\n", dxf_header_filename);
+ pcb_gui->log("Error in dxf_write_header_from_template (): cannot open file %s for reading.\n", dxf_header_filename);
if (dxf_metric) {
dxf_write_header_metric_new();
}
@@ -3213,7 +3209,7 @@ static void dxf_write_footer()
fclose(f_temp);
}
else {
- gui->log("Error in dxf_write_footer (): cannot open file %s for reading.\n", dxf_footer_filename);
+ pcb_gui->log("Error in dxf_write_footer (): cannot open file %s for reading.\n", dxf_footer_filename);
if (dxf_metric) {
dxf_write_footer_metric_new();
}
@@ -3762,7 +3758,7 @@ static void dxf_write_vertex(FILE * fp,
* In command line mode, these are used to interpret command line options.\n
* If n_ret is non-NULL, the number of attributes is stored there.
*/
-static HID_Attribute *dxf_get_export_options(int *n)
+static pcb_hid_attribute_t *dxf_get_export_options(int *n)
{
static char *last_dxf_filename;
static char *last_dxf_xref_filename;
@@ -3773,8 +3769,8 @@ static HID_Attribute *dxf_get_export_options(int *n)
last_dxf_filename = 0;
last_dxf_xref_filename = 0;
if (PCB) {
- derive_default_filename(PCB->Filename, &dxf_options[HA_dxffile], "", &last_dxf_filename);
- derive_default_filename(PCB->Filename, &dxf_options[HA_xreffile], "", &last_dxf_xref_filename);
+ pcb_derive_default_filename(PCB->Filename, &dxf_options[HA_dxffile], "", &last_dxf_filename);
+ pcb_derive_default_filename(PCB->Filename, &dxf_options[HA_xreffile], "", &last_dxf_xref_filename);
}
if (n) {
*n = NUM_OPTIONS;
@@ -3826,7 +3822,7 @@ static DxfList *dxf_insert(char *refdes,
*/
cur = dxf;
while (cur != NULL) {
- if ((NSTRCMP(descr, cur->descr) == 0) && (NSTRCMP(value, cur->value) == 0)) {
+ if ((PCB_NSTRCMP(descr, cur->descr) == 0) && (PCB_NSTRCMP(value, cur->value) == 0)) {
cur->num++;
cur->refdes = dxf_string_insert(refdes, cur->refdes);
break;
@@ -3927,7 +3923,7 @@ static int dxf_export_xref_file(void)
fp = fopen(dxf_xref_filename, "w");
if (!fp) {
- gui->log("Error in dxf.c|dxf_export_xref_file (): cannot open file %s for writing.\n", dxf_xref_filename);
+ pcb_gui->log("Error in dxf.c|dxf_export_xref_file (): cannot open file %s for writing.\n", dxf_xref_filename);
return 1;
}
/*
@@ -3937,7 +3933,7 @@ static int dxf_export_xref_file(void)
strftime(utcTime, sizeof(utcTime), "%c UTC", gmtime(¤ttime));
if (dxf_verbose) {
/* report at the beginning of each file */
- fprintf(stderr, "DXF: Board Name: %s, %s \n", UNKNOWN(PCB->Name), UNKNOWN(name));
+ fprintf(stderr, "DXF: Board Name: %s, %s \n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(name));
fprintf(stderr, "DXF: Created by: %s.\n", PCB_DXF_HID_VERSION);
fprintf(stderr, "DXF: Creation date: %s \n", utcTime);
fprintf(stderr, "DXF: File Format according to: AutoCAD R14.\n");
@@ -3960,14 +3956,14 @@ static int dxf_export_xref_file(void)
/*
* lookup all elements on pcb and insert element in the list of elements.
*/
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/*
* insert the elements into the dxf list.
*/
- dxf = dxf_insert(UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(DESCRIPTION_NAME(element)), UNKNOWN(VALUE_NAME(element)), dxf);
+ dxf = dxf_insert(PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)), PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)), dxf);
}
- END_LOOP; /* End of ELEMENT_LOOP */
+ PCB_END_LOOP; /* End of ELEMENT_LOOP */
/*
* now write a single block definition for every unique element to
* the BLOCKS section of the DXF file.
@@ -4003,7 +3999,7 @@ static int dxf_export_xref_file(void)
* for each element we calculate the centroid of the footprint.
* in addition, we need to extract some notion of rotation.
*/
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/*
* initialize our pin count and our totals for finding the
@@ -4020,31 +4016,31 @@ static int dxf_export_xref_file(void)
* While we're at it, store the location of pin/pad #1 and #2
* if we can find them.
*/
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
sumx += (double) pin->X;
sumy += (double) pin->Y;
pin_cnt++;
- if (NSTRCMP(pin->Number, "1") == 0) {
+ if (PCB_NSTRCMP(pin->Number, "1") == 0) {
pin1x = (double) pin->X;
pin1y = (double) pin->Y;
pin1angle = 0.0;
found_pin1 = 1;
}
- else if (NSTRCMP(pin->Number, "2") == 0) {
+ else if (PCB_NSTRCMP(pin->Number, "2") == 0) {
pin2x = (double) pin->X;
pin2y = (double) pin->Y;
pin2angle = 0.0;
found_pin2 = 1;
}
}
- END_LOOP; /* End of PIN_LOOP */
- PAD_LOOP(element);
+ PCB_END_LOOP; /* End of PIN_LOOP */
+ PCB_PAD_LOOP(element);
{
sumx += (pad->Point1.X + pad->Point2.X) / 2.0;
sumy += (pad->Point1.Y + pad->Point2.Y) / 2.0;
pin_cnt++;
- if (NSTRCMP(pad->Number, "1") == 0) {
+ if (PCB_NSTRCMP(pad->Number, "1") == 0) {
pin1x = (double) (pad->Point1.X + pad->Point2.X) / 2.0;
pin1y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0;
/*
@@ -4058,14 +4054,14 @@ static int dxf_export_xref_file(void)
pin1angle = (180.0 / M_PI) * atan2(pad->Point1.Y - pad->Point2.Y, pad->Point2.X - pad->Point1.X);
found_pin1 = 1;
}
- else if (NSTRCMP(pad->Number, "2") == 0) {
+ else if (PCB_NSTRCMP(pad->Number, "2") == 0) {
pin2x = (double) (pad->Point1.X + pad->Point2.X) / 2.0;
pin2y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0;
pin2angle = (180.0 / M_PI) * atan2(pad->Point1.Y - pad->Point2.Y, pad->Point2.X - pad->Point1.X);
found_pin2 = 1;
}
}
- END_LOOP; /* End of PAD_LOOP */
+ PCB_END_LOOP; /* End of PAD_LOOP */
if (pin_cnt > 0) {
x = sumx / (double) pin_cnt;
y = sumy / (double) pin_cnt;
@@ -4089,11 +4085,11 @@ static int dxf_export_xref_file(void)
if (found_pin2)
theta = dxf_xy_to_angle(pin2x, pin2y);
else {
- Message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n"
+ pcb_message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n"
" unable to figure out angle of element\n"
" %s because pin #1 is at the centroid of the part\n"
" and I could not find pin #2's location.\n"
- " Setting to %g degrees.\n", UNKNOWN(NAMEONPCB_NAME(element)), theta);
+ " Setting to %g degrees.\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), theta);
}
}
else
@@ -4103,12 +4099,12 @@ static int dxf_export_xref_file(void)
/* we did not find pin #1 */
else {
theta = 0.0;
- Message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n"
+ pcb_message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n"
" unable to figure out angle because I could\n"
" not find pin #1 of element %s.\n"
- " Setting to %g degrees.\n", UNKNOWN(NAMEONPCB_NAME(element)), theta);
+ " Setting to %g degrees.\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), theta);
}
- dxf_block_name = pcb_strdup(dxf_clean_string(UNKNOWN(DESCRIPTION_NAME(element))));
+ dxf_block_name = pcb_strdup(dxf_clean_string(PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element))));
if (dxf_metric) {
/* convert mils to mm */
dxf_x0 = PCB_COORD_TO_MM(x);
@@ -4147,10 +4143,10 @@ static int dxf_export_xref_file(void)
dxf_rot_angle = 180.0;
else {
dxf_rot_angle = 0.0;
- Message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n"
+ pcb_message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n"
" unable to figure out angle of dxf block\n"
" %s because pcb angle theta is not Cardinal [0.0, 90.0, 180.0, 270.0].\n"
- " Setting dxf_rot_angle to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), dxf_rot_angle);
+ " Setting dxf_rot_angle to %g degrees\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), dxf_rot_angle);
}
#endif
dxf_write_insert(fp, dxf_id_code, dxf_block_name, DXF_DEFAULT_LINETYPE, /* dxf_linetype, */
@@ -4171,7 +4167,7 @@ static int dxf_export_xref_file(void)
}
dxf_id_code++;
}
- END_LOOP; /* End of ELEMENT_LOOP */
+ PCB_END_LOOP; /* End of ELEMENT_LOOP */
/*
* write an ENDSEC marker to the DXF file.
*/
@@ -4225,14 +4221,13 @@ static void dxf_maybe_close_file()
* <li>Export a DXF file for every PCB layer.\n
* </ul>
*/
-static void dxf_do_export(HID_Attr_Val * options)
+static void dxf_do_export(pcb_hid_attr_val_t * options)
{
const char *dxf_fnbase;
int i;
- static int saved_layer_stack[MAX_LAYER];
- BoxType region;
- int save_ons[MAX_LAYER + 2];
- int tmp[128], len;
+ static int saved_layer_stack[PCB_MAX_LAYER];
+ pcb_box_t region;
+ int save_ons[PCB_MAX_LAYER + 2];
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_do_export () function.\n", __FILE__, __LINE__);
@@ -4293,19 +4288,13 @@ static void dxf_do_export(HID_Attr_Val * options)
strcpy(dxf_filename, dxf_fnbase);
strcat(dxf_filename, "_");
dxf_filesuffix = dxf_filename + strlen(dxf_filename);
- memset(print_layer, 0, sizeof(print_layer));
/*
* use this to temporarily enable all layers.
*/
- hid_save_and_show_layer_ons(save_ons);
-
- len = pcb_layer_list(PCB_LYT_SILK | PCB_LYT_COPPER, tmp, sizeof(tmp));
- for(i = 0; i < len; i++)
- if (!IsLayerNumEmpty(tmp[i]))
- print_layer[tmp[i]] = 1;
+ pcb_hid_save_and_show_layer_ons(save_ons);
- memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack));
- qsort(LayerStack, max_copper_layer, sizeof(LayerStack[0]), dxf_layer_sort);
+ memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack));
+ qsort(pcb_layer_stack, pcb_max_copper_layer, sizeof(pcb_layer_stack[0]), dxf_layer_sort);
linewidth = -1;
lastcap = -1;
lastgroup = -1;
@@ -4319,13 +4308,13 @@ static void dxf_do_export(HID_Attr_Val * options)
lastgroup = -1;
c_layerapps = 0;
dxf_finding_apertures = 1;
- hid_expose_callback(&dxf_hid, ®ion, 0);
+ pcb_hid_expose_callback(&dxf_hid, ®ion, 0);
c_layerapps = 0;
dxf_finding_apertures = 0;
- hid_expose_callback(&dxf_hid, ®ion, 0);
- memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack));
+ pcb_hid_expose_callback(&dxf_hid, ®ion, 0);
+ memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack));
dxf_maybe_close_file();
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Leaving dxf_do_export () function.\n", __FILE__, __LINE__);
#endif
@@ -4346,7 +4335,7 @@ static void dxf_parse_arguments(int *argc, char ***argv)
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_parse_arguments () function.\n", __FILE__, __LINE__);
#endif
- hid_parse_command_line(argc, argv);
+ pcb_hid_parse_command_line(argc, argv);
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Leaving dxf_parse_arguments () function.\n", __FILE__, __LINE__);
#endif
@@ -4385,8 +4374,6 @@ static int dxf_drill_sort(const void *va, const void *vb) {
* the drawing functions should be called.\n
* If it returns true (nonzero), the items in that layer [group] should be
* drawn using the various drawing functions.\n
- * In addition to the MAX_LAYERS copper layer groups, you may select layers
- * indicated by the macros SL_* defined, or any others with an index of -1.\n
* For copper layer groups, you may pass NULL for name to have a name fetched
* from the PCB struct.\n
* \n
@@ -4399,44 +4386,45 @@ static int dxf_drill_sort(const void *va, const void *vb) {
* <li>Layers without exportable items are not set for DXF export.
* </ul>
*/
-static int dxf_set_layer(const char *name, int group) {
+static int dxf_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
+{
char *cp;
- int idx;
const char *fmt;
+ char tmp_ln[PCB_PATH_MAX];
+ const char *name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed);
+
+ if (flags & PCB_LYT_UI)
+ return 0;
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_set_layer () function.\n", __FILE__, __LINE__);
#endif
- idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
- if (name == 0) {
- /* if none given, get the layer name from pcb */
- name = PCB->Data->Layer[idx].Name;
- }
if (dxf_verbose) {
- fprintf(stderr, "DXF: now processing Layer %s group %d\n", name, group);
+ fprintf(stderr, "DXF: now processing Layer group %ld, flags %x\n", group, flags);
}
if (dxf_export_all_layers) {
/* do nothing here to export all layers */
}
else {
- if (idx >= 0 && idx < max_copper_layer && !print_layer[idx]) {
+ if (pcb_is_layergrp_empty(group)) {
/* do not export empty layers */
if (dxf_verbose) {
- fprintf(stderr, "DXF: Warning, Layer %s contains no exportable items and is not set.\n", name);
+ fprintf(stderr, "DXF: Warning, Layer %ld contains no exportable items and is not set.\n", group);
fprintf(stderr, "[File: %s: line: %d] Leaving dxf_set_layer () function.\n", __FILE__, __LINE__);
}
return 0;
}
- if (strcmp(name, "invisible") == 0) {
+ if (flags & PCB_LYT_INVIS) {
/* do not export the layer with the name "invisible" */
if (dxf_verbose) {
- fprintf(stderr, "DXF: Warning, Layer %s not set.\n", name);
+ fprintf(stderr, "DXF: Warning, Layer %ld not set.\n", group);
fprintf(stderr, "[File: %s: line: %d] Leaving dxf_set_layer () function.\n", __FILE__, __LINE__);
}
return 0;
}
- if (strcmp(name, "keepout") == 0) {
+#if 0
+ if (flags & PCB_LYT_KEEPOUT) {
/* do not export the layer with the name "keepout" */
if (dxf_verbose) {
fprintf(stderr, "DXF: Warning, Layer %s not set.\n", name);
@@ -4444,15 +4432,20 @@ static int dxf_set_layer(const char *name, int group) {
}
return 0;
}
- if (SL_TYPE(idx) == SL_ASSY) {
- /* do not export the layers with the type SL_ASSY */
+#endif
+ if (flags & PCB_LYT_ASSY) {
+ /* do not export the layers with the type ASSY */
if (dxf_verbose) {
- fprintf(stderr, "DXF: Warning, Layer %s with type SL_ASSY not set.\n", name);
+ fprintf(stderr, "DXF: Warning, Layer %ld with type ASSY not set.\n", group);
fprintf(stderr, "[File: %s: line: %d] Leaving dxf_set_layer () function.\n", __FILE__, __LINE__);
}
return 0;
}
}
+
+ is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ is_mask = !!(flags & PCB_LYT_MASK);
+
if (is_drill && dxf_n_pending_drills) {
int i;
/* dump pending drills in sequence */
@@ -4473,15 +4466,13 @@ static int dxf_set_layer(const char *name, int group) {
* \todo this output should go to file in
* whatever form instead of being put on stderr.
*/
- fprintf(stderr, "DXF: X:%06d Y:%06ld\n", DXF_X(PCB, dxf_pending_drills[i].x), DXF_Y(PCB, dxf_pending_drills[i].y));
+ fprintf(stderr, "DXF: X:%06d Y:%06d\n", DXF_X(PCB, dxf_pending_drills[i].x), DXF_Y(PCB, dxf_pending_drills[i].y));
}
}
free(dxf_pending_drills);
dxf_n_pending_drills = dxf_max_pending_drills = 0;
dxf_pending_drills = 0;
}
- is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- is_mask = (SL_TYPE(idx) == SL_MASK);
current_mask = 0;
if (group < 0 || group != lastgroup) {
time_t currenttime;
@@ -4504,19 +4495,14 @@ static int dxf_set_layer(const char *name, int group) {
}*/
dxf_maybe_close_file();
pagecount++;
- switch (idx) {
- case SL(PDRILL, 0):
- sext = ".dxf";
- break;
- case SL(UDRILL, 0):
+ if (is_drill)
sext = ".dxf";
- break;
- }
- strcpy(dxf_filesuffix, layer_type_to_file_name(idx, FNS_first));
+ strcpy(dxf_filesuffix, name);
strcat(dxf_filesuffix, sext);
+printf("SET LAYER: %s\n", dxf_filename);
fp = fopen(dxf_filename, "w");
if (fp == NULL) {
- Message(PCB_MSG_ERROR, "DXF: could not open %s for writing.\n", dxf_filename);
+ pcb_message(PCB_MSG_ERROR, "DXF: could not open %s for writing.\n", dxf_filename);
return 1;
}
/* write version info as a dxf comment */
@@ -4531,7 +4517,7 @@ static int dxf_set_layer(const char *name, int group) {
* whatever form instead of being put on stderr.
*/
if (dxf_verbose) {
- fprintf(stderr, "DXF: Start of page %d for group %d idx %d\n", pagecount, group, idx);
+ fprintf(stderr, "DXF: Start of page %d for group %ld flags %x\n", pagecount, group, flags);
}
if (group < 0 || group != lastgroup) {
/* create a portable timestamp */
@@ -4542,7 +4528,7 @@ static int dxf_set_layer(const char *name, int group) {
}
if (dxf_verbose) {
/* report at the beginning of each file */
- fprintf(stderr, "DXF: Board Name: %s, %s \n", UNKNOWN(PCB->Name), UNKNOWN(name));
+ fprintf(stderr, "DXF: Board Name: %s, %s \n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(name));
fprintf(stderr, "DXF: Created by: %s.\n", PCB_DXF_HID_VERSION);
fprintf(stderr, "DXF: Creation date: %s \n", utcTime);
fprintf(stderr, "DXF: File Format according to: AutoCAD R14.\n");
@@ -4555,7 +4541,7 @@ static int dxf_set_layer(const char *name, int group) {
pcb_fprintf(stderr, "PCB Dimensions: %.0ml x %.0ml.\n", PCB->MaxWidth, PCB->MaxHeight);
}
fprintf(stderr, "PCB Coordinate Origin: lower left.\n");
- fprintf(stderr, "DXF: Now processing Layer %s group %d drill %d mask %d\n", name, group, is_drill, is_mask);
+ fprintf(stderr, "DXF: Now processing Layer %s group %ld drill %d mask %d\n", name, group, is_drill, is_mask);
}
/* build a legal identifier */
if (dxf_layername) {
@@ -4588,14 +4574,14 @@ static int dxf_set_layer(const char *name, int group) {
/*!
* \brief Constructor for the graphic context.
*/
-static hidGC dxf_make_gc(void)
+static pcb_hid_gc_t dxf_make_gc(void)
{
- hidGC rv;
+ pcb_hid_gc_t rv;
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_make_gc () function.\n", __FILE__, __LINE__);
#endif
- rv = (hidGC) calloc(1, sizeof(hid_gc_struct));
+ rv = (pcb_hid_gc_t) calloc(1, sizeof(hid_gc_s));
rv->cap = Trace_Cap;
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Leaving dxf_make_gc () function.\n", __FILE__, __LINE__);
@@ -4607,7 +4593,7 @@ static hidGC dxf_make_gc(void)
/*!
* \brief Destructor for the graphic context.
*/
-static void dxf_destroy_gc(hidGC gc)
+static void dxf_destroy_gc(pcb_hid_gc_t gc)
{
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_destroy_gc () function.\n", __FILE__, __LINE__);
@@ -4659,7 +4645,7 @@ static void dxf_use_mask(int use_it) {
* You may assume this is cheap enough to call inside the redraw callback,
* but not cheap enough to call for each item drawn.
*/
-static void dxf_set_color(hidGC gc, /*!< graphic context */
+static void dxf_set_color(pcb_hid_gc_t gc, /*!< graphic context */
const char *name) {
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_set_color () function.\n", __FILE__, __LINE__);
@@ -4692,7 +4678,7 @@ static void dxf_set_color(hidGC gc, /*!< graphic context */
* While calling this is cheap, calling it with different values each time
* may be expensive, so grouping items by line style is helpful.
*/
-static void dxf_set_line_cap(hidGC gc, EndCapStyle style) {
+static void dxf_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style) {
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_set_line_cap () function.\n", __FILE__, __LINE__);
#endif
@@ -4710,7 +4696,7 @@ static void dxf_set_line_cap(hidGC gc, EndCapStyle style) {
* While calling this is cheap, calling it with different values each time
* may be expensive, so grouping items by line width is helpful.
*/
-static void dxf_set_line_width(hidGC gc, int width) {
+static void dxf_set_line_width(pcb_hid_gc_t gc, int width) {
#if DEBUG
fprintf(stderr, "[File: %s: line: %d] Entering dxf_set_line_width () function.\n", __FILE__, __LINE__);
#endif
@@ -4721,7 +4707,7 @@ static void dxf_set_line_width(hidGC gc, int width) {
}
-static void dxf_set_draw_xor(hidGC gc, int xor_)
+static void dxf_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
@@ -4730,7 +4716,7 @@ static void dxf_set_draw_xor(hidGC gc, int xor_)
/*!
* \brief Use the graphic context.
*/
-static void dxf_use_gc(hidGC gc, int radius) {
+static void dxf_use_gc(pcb_hid_gc_t gc, int radius) {
int c;
#if DEBUG
@@ -4810,7 +4796,7 @@ static void dxf_use_gc(hidGC gc, int radius) {
* contains the top right corner values. \n
* The rectangle is not filled, use dxf_fill_rect () for a filled rectangle.
*/
-static void dxf_draw_rect(hidGC gc,
+static void dxf_draw_rect(pcb_hid_gc_t gc,
/*!< graphic context */
int x1,
/*!< X-value bottom left ?? point */
@@ -5002,7 +4988,7 @@ static void dxf_draw_rect(hidGC gc,
* to check if the layer didn't change since the last trace segment was
* drawn.\n
*/
-static void dxf_draw_line(hidGC gc,
+static void dxf_draw_line(pcb_hid_gc_t gc,
/*!< graphic context */
int x1,
/*!< X-value start point */
@@ -5295,7 +5281,7 @@ static void dxf_draw_line(hidGC gc,
* \todo The end cap style has to be implemented at the start and end point of
* a trace.
*/
-static void dxf_draw_arc(hidGC gc,
+static void dxf_draw_arc(pcb_hid_gc_t gc,
/*!< graphic context */
int cx,
/*!< X-value center point */
@@ -5349,10 +5335,10 @@ static void dxf_draw_arc(hidGC gc,
return;
}
dxf_use_gc(gc, 0);
- arcStartX = cx - width * cos(TO_RADIANS(start_angle));
- arcStartY = cy + height * sin(TO_RADIANS(start_angle));
- arcStopX = cx - width * cos(TO_RADIANS(start_angle + delta_angle));
- arcStopY = cy + height * sin(TO_RADIANS(start_angle + delta_angle));
+ arcStartX = cx - width * cos(PCB_TO_RADIANS(start_angle));
+ arcStartY = cy + height * sin(PCB_TO_RADIANS(start_angle));
+ arcStopX = cx - width * cos(PCB_TO_RADIANS(start_angle + delta_angle));
+ arcStopY = cy + height * sin(PCB_TO_RADIANS(start_angle + delta_angle));
if (dxf_metric) {
/* use metric (mm) */
dxf_x0 = PCB_COORD_TO_MM(DXF_X(PCB, cx));
@@ -5428,8 +5414,8 @@ static void dxf_draw_arc(hidGC gc,
* in the pcb universe 0 degrees (the negative X-axis) is to the left,
* and in the dxf universe 0 degrees is to the right.
*/
- dxf_start_angle = TO_RADIANS(start_angle + 180);
- dxf_end_angle = TO_RADIANS(start_angle + delta_angle + 180);
+ dxf_start_angle = PCB_TO_RADIANS(start_angle + 180);
+ dxf_end_angle = PCB_TO_RADIANS(start_angle + delta_angle + 180);
if (dxf_start_angle >= (2 * M_PI)) {
dxf_start_angle = dxf_start_angle - (2 * M_PI);
}
@@ -5586,7 +5572,7 @@ static void dxf_draw_arc(hidGC gc,
* fill to a zero-width outline.\n
* \todo Implement a donut (polyline) instead of a circle.
*/
-static void dxf_fill_circle(hidGC gc,
+static void dxf_fill_circle(pcb_hid_gc_t gc,
/*!< graphic context. */
int cx,
/*!< X-value center point. */
@@ -5681,7 +5667,7 @@ static void dxf_fill_circle(hidGC gc,
* (select a hatch pattern, create a boundary path, apply a scale and all the
* other stuff that is needed).
*/
-static void dxf_fill_polygon(hidGC gc,
+static void dxf_fill_polygon(pcb_hid_gc_t gc,
/*!< graphic context. */
int n_coords,
/*!< number of XY-coordinates. */
@@ -5785,7 +5771,7 @@ static void dxf_fill_polygon(hidGC gc,
* "draw" means to use segments of the given width, whereas "fill" means to
* fill to a zero-width outline.\n
*/
-static void dxf_fill_rect(hidGC gc,
+static void dxf_fill_rect(pcb_hid_gc_t gc,
/*!< graphic context. */
int x1,
/*!< X-value bottom left ?? point. */
@@ -5932,11 +5918,11 @@ const char *dxf_cookie = "dxf exporter";
*/
pcb_uninit_t hid_export_dxf_init()
{
- memset(&dxf_hid, 0, sizeof(HID));
+ memset(&dxf_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&dxf_hid);
- common_draw_helpers_init(&dxf_hid);
- dxf_hid.struct_size = sizeof(HID);
+ pcb_hid_nogui_init(&dxf_hid);
+ pcb_dhlp_draw_helpers_init(&dxf_hid);
+ dxf_hid.struct_size = sizeof(pcb_hid_t);
dxf_hid.name = "dxf";
dxf_hid.description = "DXF export";
dxf_hid.exporter = 1;
@@ -5945,7 +5931,7 @@ pcb_uninit_t hid_export_dxf_init()
dxf_hid.get_export_options = dxf_get_export_options;
dxf_hid.do_export = dxf_do_export;
dxf_hid.parse_arguments = dxf_parse_arguments;
- dxf_hid.set_layer = dxf_set_layer;
+ dxf_hid.set_layer_group = dxf_set_layer_group;
dxf_hid.calibrate = dxf_calibrate;
dxf_hid.set_crosshair = dxf_set_crosshair;
dxf_hid.show_item = dxf_show_item;
@@ -5966,9 +5952,9 @@ pcb_uninit_t hid_export_dxf_init()
dxf_hid.fill_polygon = dxf_fill_polygon;
dxf_hid.fill_rect = dxf_fill_rect;
- hid_register_hid(&dxf_hid);
+ pcb_hid_register_hid(&dxf_hid);
- hid_register_attributes(dxf_options, sizeof(dxf_options) / sizeof(dxf_options[0]), dxf_cookie, 0);
+ pcb_hid_register_attributes(dxf_options, sizeof(dxf_options) / sizeof(dxf_options[0]), dxf_cookie, 0);
/* return hid_dxf_uninit();*/
return NULL;
diff --git a/src_plugins/export_gcode/Makefile b/src_plugins/export_gcode/Makefile
index 2c43ef0..0fbc7e6 100644
--- a/src_plugins/export_gcode/Makefile
+++ b/src_plugins/export_gcode/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_gcode
+ cd ../../src && $(MAKE) mod_export_gcode
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_gcode/curve.c b/src_plugins/export_gcode/curve.c
index b89c790..36528a5 100644
--- a/src_plugins/export_gcode/curve.c
+++ b/src_plugins/export_gcode/curve.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
+#include "config.h"
#include "potracelib.h"
#include "lists.h"
#include "curve.h"
diff --git a/src_plugins/export_gcode/decompose.c b/src_plugins/export_gcode/decompose.c
index f63d5b3..10dd243 100644
--- a/src_plugins/export_gcode/decompose.c
+++ b/src_plugins/export_gcode/decompose.c
@@ -9,6 +9,7 @@
#include <string.h>
#include <limits.h>
+#include "config.h"
#include "potracelib.h"
#include "curve.h"
#include "lists.h"
diff --git a/src_plugins/export_gcode/gcode.c b/src_plugins/export_gcode/gcode.c
index 95ca52c..2197ec3 100644
--- a/src_plugins/export_gcode/gcode.c
+++ b/src_plugins/export_gcode/gcode.c
@@ -44,10 +44,9 @@
#include <time.h>
-#include "global.h"
-#include "error.h" /* Message(PCB_MSG_DEFAULT, ) */
+#include "board.h"
+#include "error.h"
#include "data.h"
-#include "misc.h"
#include "rats.h"
#include "hid_helper.h"
#include "layer.h"
@@ -82,9 +81,9 @@ struct color_struct {
unsigned int r, g, b;
};
-struct hid_gc_struct {
- HID *me_pointer;
- EndCapStyle cap;
+struct hid_gc_s {
+ pcb_hid_t *me_pointer;
+ pcb_cap_style_t cap;
int width;
unsigned char r, g, b;
int erase;
@@ -110,7 +109,7 @@ static int is_solder;
* Which groups of layers to export into PNG layer masks. 1 means export, 0
* means do not export.
*/
-static int gcode_export_group[MAX_LAYER];
+static int gcode_export_group[PCB_MAX_LAYERGRP];
/* Group that is currently exported. */
static int gcode_cur_group;
@@ -143,7 +142,7 @@ static const char *units[] = {
NULL
};
-HID_Attribute gcode_attribute_list[] = {
+pcb_hid_attribute_t gcode_attribute_list[] = {
/* other HIDs expect this to be first. */
{"basename", "File name prefix",
HID_String, 0, 0, {0, 0, 0}, 0, 0},
@@ -177,8 +176,8 @@ HID_Attribute gcode_attribute_list[] = {
#define NUM_OPTIONS (sizeof(gcode_attribute_list)/sizeof(gcode_attribute_list[0]))
-REGISTER_ATTRIBUTES(gcode_attribute_list, gcode_cookie)
- static HID_Attr_Val gcode_values[NUM_OPTIONS];
+PCB_REGISTER_ATTRIBUTES(gcode_attribute_list, gcode_cookie)
+ static pcb_hid_attr_val_t gcode_values[NUM_OPTIONS];
/* *** Utility funcions **************************************************** */
@@ -223,11 +222,11 @@ struct drill_struct *sort_drill(struct drill_struct *drill, int n_drill)
static void gcode_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(gcode_attribute_list, sizeof(gcode_attribute_list) / sizeof(gcode_attribute_list[0]), gcode_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(gcode_attribute_list, sizeof(gcode_attribute_list) / sizeof(gcode_attribute_list[0]), gcode_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-static HID_Attribute *gcode_get_export_options(int *n)
+static pcb_hid_attribute_t *gcode_get_export_options(int *n)
{
static char *last_made_filename = 0;
static int last_unit_value = -1;
@@ -241,7 +240,7 @@ static HID_Attribute *gcode_get_export_options(int *n)
}
if (PCB) {
- derive_default_filename(PCB->Filename, &gcode_attribute_list[HA_basename], ".gcode", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &gcode_attribute_list[HA_basename], ".gcode", &last_made_filename);
}
if (n) {
*n = NUM_OPTIONS;
@@ -253,15 +252,16 @@ static HID_Attribute *gcode_get_export_options(int *n)
void gcode_choose_groups()
{
int n, m;
- LayerType *layer;
+ pcb_layer_t *layer;
/* Set entire array to 0 (don't export any layer groups by default */
memset(gcode_export_group, 0, sizeof(gcode_export_group));
- for (n = 0; n < max_copper_layer; n++) {
+ for (n = 0; n < pcb_max_copper_layer; n++) {
+ unsigned int flags = pcb_layer_flags(n);
layer = &PCB->Data->Layer[n];
- if (!LAYER_IS_EMPTY(layer)) {
+ if (!PCB_LAYER_IS_EMPTY(layer)) {
/* layer isn't empty */
/*
@@ -269,9 +269,8 @@ void gcode_choose_groups()
* layers have negative indexes?
*/
- if (SL_TYPE(n) == 0) {
- /* layer is a copper layer */
- m = GetLayerGroupNumberByNumber(n);
+ if ((flags & PCB_LYT_COPPER) || (flags & PCB_LYT_OUTLINE)) {
+ m = pcb_layer_get_group(n);
/* the export layer */
gcode_export_group[m] = 1;
@@ -320,7 +319,7 @@ static void gcode_finish_png()
#ifdef HAVE_GDIMAGEPNG
gdImagePng(gcode_im, gcode_f);
#else
- Message(PCB_MSG_DEFAULT, "GCODE: PNG not supported by gd. Can't write layer mask.\n");
+ pcb_message(PCB_MSG_WARNING, "GCODE: PNG not supported by gd. Can't write layer mask.\n");
#endif
gdImageDestroy(gcode_im);
fclose(gcode_f);
@@ -334,7 +333,7 @@ static void gcode_finish_png()
void gcode_start_png_export()
{
- BoxType region;
+ pcb_box_t region;
region.X1 = 0;
region.Y1 = 0;
@@ -345,15 +344,15 @@ void gcode_start_png_export()
lastbrush = (gdImagePtr) ((void *) -1);
lastcolor = -1;
- hid_expose_callback(&gcode_hid, ®ion, 0);
+ pcb_hid_expose_callback(&gcode_hid, ®ion, 0);
}
-static void gcode_do_export(HID_Attr_Val * options)
+static void gcode_do_export(pcb_hid_attr_val_t * options)
{
- int save_ons[MAX_LAYER + 2];
+ int save_ons[PCB_MAX_LAYER + 2];
int i, idx;
time_t t;
- const Unit *unit;
+ const pcb_unit_t *unit;
double scale = 0, d = 0;
int r, c, v, p, metric;
char *filename;
@@ -390,9 +389,9 @@ static void gcode_do_export(HID_Attr_Val * options)
return;
}
unit = &(get_unit_list()[options[HA_unit].int_value]);
- metric = (unit->family == METRIC);
- scale = metric ? 1.0 / coord_to_unit(unit, PCB_MM_TO_COORD(1.0))
- : 1.0 / coord_to_unit(unit, PCB_INCH_TO_COORD(1.0));
+ metric = (unit->family == PCB_UNIT_METRIC);
+ scale = metric ? 1.0 / pcb_coord_to_unit(unit, PCB_MM_TO_COORD(1.0))
+ : 1.0 / pcb_coord_to_unit(unit, PCB_INCH_TO_COORD(1.0));
gcode_cutdepth = options[HA_cutdepth].real_value * scale;
gcode_drilldepth = options[HA_drilldepth].real_value * scale;
@@ -401,25 +400,26 @@ static void gcode_do_export(HID_Attr_Val * options)
: PCB_INCH_TO_COORD(options[HA_toolradius].real_value * scale);
gcode_choose_groups();
- for (i = 0; i < MAX_LAYER; i++) {
+ for (i = 0; i < PCB_MAX_LAYERGRP; i++) {
if (gcode_export_group[i]) {
-
+ char tmp_ln[PCB_PATH_MAX];
+ const char *name = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed);
gcode_cur_group = i;
/* magic */
- idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i;
- printf("idx=%d %s\n", idx, layer_type_to_file_name(idx, FNS_fixed));
- is_solder = (GetLayerGroupNumberByNumber(idx) == GetLayerGroupNumberByNumber(solder_silk_layer)) ? 1 : 0;
+ idx = (i >= 0 && i < pcb_max_group) ? PCB->LayerGroups.Entries[i][0] : i;
+ printf("idx=%d %s\n", idx, name);
+ is_solder = (pcb_layer_get_group(idx) == pcb_layer_get_group(pcb_solder_silk_layer)) ? 1 : 0;
save_drill = is_solder; /* save drills for one layer only */
- gcode_start_png(gcode_basename, layer_type_to_file_name(idx, FNS_fixed));
- hid_save_and_show_layer_ons(save_ons);
+ gcode_start_png(gcode_basename, name);
+ pcb_hid_save_and_show_layer_ons(save_ons);
gcode_start_png_export();
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
/* ***************** gcode conversion *************************** */
/* potrace uses a different kind of bitmap; for simplicity gcode_im is copied to this format */
bm = bm_new(gdImageSX(gcode_im), gdImageSY(gcode_im));
- filename = (char *) malloc(MAXPATHLEN);
+ filename = (char *) malloc(PCB_PATH_MAX);
plist = NULL;
if (is_solder) { /* only for back layer */
gdImagePtr temp_im = gdImageCreate(gdImageSX(gcode_im), gdImageSY(gcode_im));
@@ -431,7 +431,7 @@ static void gcode_do_export(HID_Attr_Val * options)
}
gdImageDestroy(temp_im);
}
- sprintf(filename, "%s.%s.cnc", gcode_basename, layer_type_to_file_name(idx, FNS_fixed));
+ sprintf(filename, "%s.%s.cnc", gcode_basename, name);
for (r = 0; r < gdImageSX(gcode_im); r++) {
for (c = 0; c < gdImageSY(gcode_im); c++) {
v = gdImageGetPixel(gcode_im, r, gdImageSY(gcode_im) - 1 - c);
@@ -537,18 +537,19 @@ static void gcode_do_export(HID_Attr_Val * options)
/* *** PNG export (slightly modified code from PNG export HID) ************* */
-static int gcode_set_layer(const char *name, int group, int empty)
+static int gcode_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
+ if (flags & PCB_LYT_UI)
+ return 0;
- if (name == 0) {
- name = PCB->Data->Layer[idx].Name;
- }
- if (strcmp(name, "invisible") == 0) {
+ if (flags & PCB_LYT_INVIS)
return 0;
- }
- is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- is_mask = (SL_TYPE(idx) == SL_MASK);
+
+ if ((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK)
+ return 0;
+
+ is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ is_mask = !!(flags & PCB_LYT_MASK);
if (is_mask) {
/* Don't print masks */
@@ -567,9 +568,9 @@ static int gcode_set_layer(const char *name, int group, int empty)
return 0;
}
-static hidGC gcode_make_gc(void)
+static pcb_hid_gc_t gcode_make_gc(void)
{
- hidGC rv = (hidGC) malloc(sizeof(struct hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) malloc(sizeof(struct hid_gc_s));
rv->me_pointer = &gcode_hid;
rv->cap = Trace_Cap;
rv->width = 1;
@@ -579,7 +580,7 @@ static hidGC gcode_make_gc(void)
return rv;
}
-static void gcode_destroy_gc(hidGC gc)
+static void gcode_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -589,7 +590,7 @@ static void gcode_use_mask(int use_it)
/* does nothing */
}
-static void gcode_set_color(hidGC gc, const char *name)
+static void gcode_set_color(pcb_hid_gc_t gc, const char *name)
{
if (gcode_im == NULL) {
return;
@@ -613,27 +614,27 @@ static void gcode_set_color(hidGC gc, const char *name)
return;
}
-static void gcode_set_line_cap(hidGC gc, EndCapStyle style)
+static void gcode_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void gcode_set_line_width(hidGC gc, Coord width)
+static void gcode_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void gcode_set_draw_xor(hidGC gc, int xor_)
+static void gcode_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
-static void gcode_set_draw_faded(hidGC gc, int faded)
+static void gcode_set_draw_faded(pcb_hid_gc_t gc, int faded)
{
gc->faded = faded;
}
-static void use_gc(hidGC gc)
+static void use_gc(pcb_hid_gc_t gc)
{
int need_brush = 0;
@@ -654,7 +655,7 @@ static void use_gc(hidGC gc)
}
if (lastbrush != gc->brush || need_brush) {
static void *bcache = 0;
- hidval bval;
+ pcb_hidval_t bval;
char name[256];
char type;
int r;
@@ -673,7 +674,7 @@ static void use_gc(hidGC gc)
}
sprintf(name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g, gc->color->b, type, r);
- if (hid_cache_color(0, name, &bval, &bcache)) {
+ if (pcb_hid_cache_color(0, name, &bval, &bcache)) {
gc->brush = (gdImagePtr) bval.ptr;
}
else {
@@ -699,7 +700,7 @@ static void use_gc(hidGC gc)
gdImageFilledRectangle(gc->brush, 0, 0, r, r, fg);
}
bval.ptr = gc->brush;
- hid_cache_color(1, name, &bval, &bcache);
+ pcb_hid_cache_color(1, name, &bval, &bcache);
}
gdImageSetBrush(gcode_im, gc->brush);
@@ -735,7 +736,7 @@ static void use_gc(hidGC gc)
}
}
-static void gcode_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void gcode_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
gdImageRectangle(gcode_im,
@@ -745,7 +746,7 @@ static void gcode_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
/* printf("Rect %d %d %d %d\n",x1,y1,x2,y2); */
}
-static void gcode_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void gcode_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
gdImageSetThickness(gcode_im, 0);
@@ -757,10 +758,10 @@ static void gcode_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
/* printf("FillRect %d %d %d %d\n",x1,y1,x2,y2); */
}
-static void gcode_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void gcode_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
if (x1 == x2 && y1 == y2) {
- Coord w = gc->width / 2;
+ pcb_coord_t w = gc->width / 2;
gcode_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w);
return;
}
@@ -771,9 +772,9 @@ static void gcode_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
gdImageLine(gcode_im, pcb_to_gcode(x1), pcb_to_gcode(y1), pcb_to_gcode(x2), pcb_to_gcode(y2), gdBrushed);
}
-static void gcode_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void gcode_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- Angle sa, ea;
+ pcb_angle_t sa, ea;
/*
* in gdImageArc, 0 degrees is to the right and +90 degrees is down
@@ -794,8 +795,8 @@ static void gcode_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord heig
* make sure we start between 0 and 360 otherwise gd does strange
* things
*/
- sa = NormalizeAngle(sa);
- ea = NormalizeAngle(ea);
+ sa = pcb_normalize_angle(sa);
+ ea = pcb_normalize_angle(ea);
#if 0
printf("draw_arc %d,%d %dx%d %d..%d %d..%d\n", cx, cy, width, height, start_angle, delta_angle, sa, ea);
@@ -810,7 +811,7 @@ static void gcode_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord heig
pcb_to_gcode(2 * height + gcode_toolradius * 2), sa, ea, gdBrushed);
}
-static void gcode_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void gcode_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
use_gc(gc);
@@ -831,7 +832,7 @@ static void gcode_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
}
}
-static void gcode_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void gcode_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
gdPoint *points;
@@ -865,7 +866,7 @@ static void gcode_set_crosshair(int x, int y, int a)
static int gcode_usage(const char *topic)
{
fprintf(stderr, "\ngcode exporter command line arguments:\n\n");
- hid_usage(gcode_attribute_list, sizeof(gcode_attribute_list) / sizeof(gcode_attribute_list[0]));
+ pcb_hid_usage(gcode_attribute_list, sizeof(gcode_attribute_list) / sizeof(gcode_attribute_list[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x gcode foo.pcb [gcode options]\n\n");
return 0;
}
@@ -874,16 +875,16 @@ static int gcode_usage(const char *topic)
#include "dolists.h"
-HID gcode_hid;
+pcb_hid_t gcode_hid;
pcb_uninit_t hid_export_gcode_init()
{
- memset(&gcode_hid, 0, sizeof(HID));
+ memset(&gcode_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&gcode_hid);
- common_draw_helpers_init(&gcode_hid);
+ pcb_hid_nogui_init(&gcode_hid);
+ pcb_dhlp_draw_helpers_init(&gcode_hid);
- gcode_hid.struct_size = sizeof(HID);
+ gcode_hid.struct_size = sizeof(pcb_hid_t);
gcode_hid.name = "gcode";
gcode_hid.description = "G-CODE export";
gcode_hid.exporter = 1;
@@ -892,7 +893,7 @@ pcb_uninit_t hid_export_gcode_init()
gcode_hid.get_export_options = gcode_get_export_options;
gcode_hid.do_export = gcode_do_export;
gcode_hid.parse_arguments = gcode_parse_arguments;
- gcode_hid.set_layer = gcode_set_layer;
+ gcode_hid.set_layer_group = gcode_set_layer_group;
gcode_hid.make_gc = gcode_make_gc;
gcode_hid.destroy_gc = gcode_destroy_gc;
gcode_hid.use_mask = gcode_use_mask;
@@ -912,7 +913,7 @@ pcb_uninit_t hid_export_gcode_init()
gcode_hid.usage = gcode_usage;
- hid_register_hid(&gcode_hid);
+ pcb_hid_register_hid(&gcode_hid);
return NULL;
}
diff --git a/src_plugins/export_gcode/gcode.h b/src_plugins/export_gcode/gcode.h
index 0e95475..dd9d2a0 100644
--- a/src_plugins/export_gcode/gcode.h
+++ b/src_plugins/export_gcode/gcode.h
@@ -1,3 +1,3 @@
/* $Id: nelma.h,v 1.2 2007/04/20 11:31:15 danmc Exp $ */
extern const char *gcode_cookie;
-extern HID gcode_hid;
+extern pcb_hid_t gcode_hid;
diff --git a/src_plugins/export_gcode/trace.c b/src_plugins/export_gcode/trace.c
index c067920..ebe3b8e 100644
--- a/src_plugins/export_gcode/trace.c
+++ b/src_plugins/export_gcode/trace.c
@@ -12,12 +12,13 @@
#include <stdlib.h>
#include <string.h>
-#include "global.h"
+#include "config.h"
#include "potracelib.h"
#include "curve.h"
#include "lists.h"
#include "auxiliary.h"
#include "trace.h"
+#include "compat_cc.h"
/*#include "progress.h"*/
#define INFTY 10000000 /* it suffices that this is longer than any
@@ -859,7 +860,7 @@ malloc_error:
/* Always succeeds and returns 0 */
static int
-ATTRIBUTE_UNUSED smooth(privcurve_t * curve, int sign, double alphamax)
+PCB_ATTRIBUTE_UNUSED smooth(privcurve_t * curve, int sign, double alphamax)
{
int m = curve->n;
@@ -1082,7 +1083,7 @@ static int opti_penalty(privpath_t * pp, int i, int j, opti_t * res, double optt
single segment when possible. Return 0 on success, 1 with errno set
on failure. */
static int
-ATTRIBUTE_UNUSED opticurve(privpath_t * pp, double opttolerance)
+PCB_ATTRIBUTE_UNUSED opticurve(privpath_t * pp, double opttolerance)
{
int m = pp->curve.n;
int *pt = NULL; /* pt[m+1] */
diff --git a/src_plugins/export_gerber/Makefile b/src_plugins/export_gerber/Makefile
index 14bcdf0..730f76a 100644
--- a/src_plugins/export_gerber/Makefile
+++ b/src_plugins/export_gerber/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_gerber
+ cd ../../src && $(MAKE) mod_export_gerber
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_gerber/gerber.c b/src_plugins/export_gerber/gerber.c
index e594320..9645aa5 100644
--- a/src_plugins/export_gerber/gerber.c
+++ b/src_plugins/export_gerber/gerber.c
@@ -10,10 +10,10 @@
#include <time.h>
+#include "math_helper.h"
+#include "board.h"
#include "config.h"
-#include "global.h"
#include "data.h"
-#include "misc.h"
#include "error.h"
#include "draw.h"
#include "layer.h"
@@ -38,39 +38,38 @@ const char *gerber_cookie = "gerber HID";
/* Function prototypes */
/*----------------------------------------------------------------------------*/
-static HID_Attribute *gerber_get_export_options(int *n);
-static void gerber_do_export(HID_Attr_Val * options);
+static pcb_hid_attribute_t *gerber_get_export_options(int *n);
+static void gerber_do_export(pcb_hid_attr_val_t * options);
static void gerber_parse_arguments(int *argc, char ***argv);
-static int gerber_set_layer(const char *name, int group, int empty);
-static hidGC gerber_make_gc(void);
-static void gerber_destroy_gc(hidGC gc);
+static pcb_hid_gc_t gerber_make_gc(void);
+static void gerber_destroy_gc(pcb_hid_gc_t gc);
static void gerber_use_mask(int use_it);
-static void gerber_set_color(hidGC gc, const char *name);
-static void gerber_set_line_cap(hidGC gc, EndCapStyle style);
-static void gerber_set_line_width(hidGC gc, Coord width);
-static void gerber_set_draw_xor(hidGC gc, int _xor);
-static void gerber_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle);
-static void gerber_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void gerber_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
-static void gerber_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
+static void gerber_set_color(pcb_hid_gc_t gc, const char *name);
+static void gerber_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style);
+static void gerber_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width);
+static void gerber_set_draw_xor(pcb_hid_gc_t gc, int _xor);
+static void gerber_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void gerber_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle);
+static void gerber_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void gerber_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
+static void gerber_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
static void gerber_calibrate(double xval, double yval);
static void gerber_set_crosshair(int x, int y, int action);
-static void gerber_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y);
+static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y);
/*----------------------------------------------------------------------------*/
/* Utility routines */
/*----------------------------------------------------------------------------*/
/* These are for films */
-#define gerberX(pcb, x) ((Coord) (x))
-#define gerberY(pcb, y) ((Coord) ((pcb)->MaxHeight - (y)))
-#define gerberXOffset(pcb, x) ((Coord) (x))
-#define gerberYOffset(pcb, y) ((Coord) (-(y)))
+#define gerberX(pcb, x) ((pcb_coord_t) (x))
+#define gerberY(pcb, y) ((pcb_coord_t) ((pcb)->MaxHeight - (y)))
+#define gerberXOffset(pcb, x) ((pcb_coord_t) (x))
+#define gerberYOffset(pcb, y) ((pcb_coord_t) (-(y)))
/* These are for drills (printed as mils but are really 1/10th mil) */
-#define gerberDrX(pcb, x) ((Coord) (x) * 10)
-#define gerberDrY(pcb, y) ((Coord) ((pcb)->MaxHeight - (y)) * 10)
+#define gerberDrX(pcb, x) ((pcb_coord_t) (x) * 10)
+#define gerberDrY(pcb, y) ((pcb_coord_t) ((pcb)->MaxHeight - (y)) * 10)
/*----------------------------------------------------------------------------*/
/* Private data structures */
@@ -84,7 +83,7 @@ static int current_mask;
static int flash_drills;
static int copy_outline_mode;
static int name_style;
-static LayerTypePtr outline_layer;
+static pcb_layer_t *outline_layer;
enum ApertureShape {
ROUND, /* Shaped like a circle */
@@ -102,7 +101,7 @@ typedef enum ApertureShape ApertureShape;
typedef struct aperture {
int dCode; /* The RS-274X D code */
- Coord width; /* Size in pcb units */
+ pcb_coord_t width; /* Size in pcb units */
ApertureShape shape; /* ROUND/SQUARE etc */
struct aperture *next;
} Aperture;
@@ -118,9 +117,9 @@ static int layer_list_max;
static int layer_list_idx;
typedef struct {
- Coord diam;
- Coord x;
- Coord y;
+ pcb_coord_t diam;
+ pcb_coord_t x;
+ pcb_coord_t y;
} PendingDrills;
PendingDrills *pending_drills = NULL;
int n_pending_drills = 0, max_pending_drills = 0;
@@ -166,7 +165,7 @@ static void resetApertures()
}
/* Create and add a new aperture to the list */
-static Aperture *addAperture(ApertureList * list, Coord width, ApertureShape shape)
+static Aperture *addAperture(ApertureList * list, pcb_coord_t width, ApertureShape shape)
{
static int aperture_count;
@@ -187,7 +186,7 @@ static Aperture *addAperture(ApertureList * list, Coord width, ApertureShape sha
/* Fetch an aperture from the list with the specified
* width/shape, creating a new one if none exists */
-static Aperture *findAperture(ApertureList * list, Coord width, ApertureShape shape)
+static Aperture *findAperture(ApertureList * list, pcb_coord_t width, ApertureShape shape)
{
Aperture *search;
@@ -216,7 +215,7 @@ static void fprintAperture(FILE * f, Aperture * aptr)
break;
case OCTAGON:
pcb_fprintf(f, "%%AMOCT%d*5,0,8,0,0,%.4mi,22.5*%%\r\n"
- "%%ADD%dOCT%d*%%\r\n", aptr->dCode, (Coord) ((double) aptr->width / PCB_COS_22_5_DEGREE), aptr->dCode, aptr->dCode);
+ "%%ADD%dOCT%d*%%\r\n", aptr->dCode, (pcb_coord_t) ((double) aptr->width / PCB_COS_22_5_DEGREE), aptr->dCode, aptr->dCode);
break;
#if 0
case THERMAL:
@@ -255,15 +254,15 @@ static ApertureList *setLayerApertureList(int layer_idx)
/* --------------------------------------------------------------------------- */
-static HID gerber_hid;
+static pcb_hid_t gerber_hid;
-typedef struct hid_gc_struct {
- EndCapStyle cap;
+typedef struct hid_gc_s {
+ pcb_cap_style_t cap;
int width;
int color;
int erase;
int drill;
-} hid_gc_struct;
+} hid_gc_s;
static FILE *f = NULL;
static char *filename = NULL;
@@ -274,11 +273,9 @@ static int lncount = 0;
static int finding_apertures = 0;
static int pagecount = 0;
static int linewidth = -1;
-static int lastgroup = -1;
+static pcb_layergrp_id_t lastgroup = -1;
static int lastcap = -1;
static int lastcolor = -1;
-static int print_group[MAX_LAYER];
-static int print_layer[MAX_LAYER];
static int lastX, lastY; /* the last X and Y coordinate */
static const char *copy_outline_names[] = {
@@ -305,7 +302,7 @@ static const char *name_style_names[] = {
NULL
};
-static HID_Attribute gerber_options[] = {
+static pcb_hid_attribute_t gerber_options[] = {
/* %start-doc options "90 Gerber Export"
@ftable @code
@@ -349,25 +346,25 @@ Print file names and aperture counts on stdout.
#define NUM_OPTIONS (sizeof(gerber_options)/sizeof(gerber_options[0]))
-static HID_Attr_Val gerber_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t gerber_values[NUM_OPTIONS];
-static HID_Attribute *gerber_get_export_options(int *n)
+static pcb_hid_attribute_t *gerber_get_export_options(int *n)
{
static char *last_made_filename = NULL;
if (PCB)
- derive_default_filename(PCB->Filename, &gerber_options[HA_gerberfile], "", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &gerber_options[HA_gerberfile], "", &last_made_filename);
if (n)
*n = NUM_OPTIONS;
return gerber_options;
}
-static int group_for_layer(int l)
+static pcb_layergrp_id_t group_for_layer(int l)
{
- if (l < max_copper_layer + 2 && l >= 0)
- return GetLayerGroupNumberByNumber(l);
+ if (l < pcb_max_copper_layer + 2 && l >= 0)
+ return pcb_layer_get_group(l);
/* else something unique */
- return max_group + 3 + l;
+ return pcb_max_group + 3 + l;
}
static int layer_sort(const void *va, const void *vb)
@@ -391,79 +388,56 @@ static void maybe_close_f(FILE * f)
}
}
-static BoxType region;
+static pcb_box_t region;
-/* Very similar to layer_type_to_file_name() but appends only a
+/* Very similar to pcb_layer_to_file_name() but appends only a
three-character suffix compatible with Eagle's defaults. */
-static void assign_eagle_file_suffix(char *dest, int idx)
+static void assign_eagle_file_suffix(char *dest, pcb_layer_id_t lid, unsigned int flags)
{
- int group;
- int nlayers;
const char *suff = "out";
- switch (idx) {
- case SL(SILK, TOP):
+#define fmatch(flags, bits) (((flags) & (bits)) == (bits))
+ if (fmatch(flags, PCB_LYT_TOP | PCB_LYT_SILK))
suff = "plc";
- break;
- case SL(SILK, BOTTOM):
+ else if (fmatch(flags, PCB_LYT_BOTTOM | PCB_LYT_SILK))
suff = "pls";
- break;
- case SL(MASK, TOP):
+ else if (fmatch(flags, PCB_LYT_TOP | PCB_LYT_MASK))
suff = "stc";
- break;
- case SL(MASK, BOTTOM):
+ else if (fmatch(flags, PCB_LYT_BOTTOM | PCB_LYT_MASK))
suff = "sts";
- break;
- case SL(PDRILL, 0):
+ else if (fmatch(flags, PCB_LYT_PDRILL))
suff = "drd";
- break;
- case SL(UDRILL, 0):
+ else if (fmatch(flags, PCB_LYT_UDRILL))
suff = "dru";
- break;
- case SL(PASTE, TOP):
+ else if (fmatch(flags, PCB_LYT_TOP | PCB_LYT_PASTE))
suff = "crc";
- break;
- case SL(PASTE, BOTTOM):
+ else if (fmatch(flags, PCB_LYT_BOTTOM | PCB_LYT_PASTE))
suff = "crs";
- break;
- case SL(INVISIBLE, 0):
+ else if (fmatch(flags, PCB_LYT_INVIS))
suff = "inv";
- break;
- case SL(FAB, 0):
+ else if (fmatch(flags, PCB_LYT_FAB))
suff = "fab";
- break;
- case SL(ASSY, TOP):
+ else if (fmatch(flags, PCB_LYT_TOP | PCB_LYT_ASSY))
suff = "ast";
- break;
- case SL(ASSY, BOTTOM):
+ else if (fmatch(flags, PCB_LYT_BOTTOM | PCB_LYT_ASSY))
suff = "asb";
- break;
-
- default:
- group = GetLayerGroupNumberByNumber(idx);
- nlayers = PCB->LayerGroups.Number[group];
- if (group == GetLayerGroupNumberByNumber(component_silk_layer)) {
- suff = "cmp";
- }
- else if (group == GetLayerGroupNumberByNumber(solder_silk_layer)) {
- suff = "sol";
- }
- else if (nlayers == 1
- && (strcmp(PCB->Data->Layer[idx].Name, "route") == 0 || strcmp(PCB->Data->Layer[idx].Name, "outline") == 0)) {
- suff = "oln";
- }
- else {
- static char buf[20];
- sprintf(buf, "ly%d", group);
- suff = buf;
- }
- break;
+ else if (fmatch(flags, PCB_LYT_TOP | PCB_LYT_COPPER))
+ suff = "cmp";
+ else if (fmatch(flags, PCB_LYT_BOTTOM | PCB_LYT_COPPER))
+ suff = "sol";
+ else if (fmatch(flags, PCB_LYT_OUTLINE))
+ suff = "oln";
+ else {
+ static char buf[20];
+ pcb_layergrp_id_t group = pcb_layer_lookup_group(lid);
+ sprintf(buf, "ly%ld", group);
+ suff = buf;
}
-
+#undef fmatch
strcpy(dest, suff);
}
-static void assign_file_suffix(char *dest, int idx)
+static void assign_file_suffix(char *dest, pcb_layer_id_t lid, unsigned int flags)
{
int fns_style;
const char *sext = ".gbr";
@@ -471,38 +445,31 @@ static void assign_file_suffix(char *dest, int idx)
switch (name_style) {
default:
case NAME_STYLE_FIXED:
- fns_style = FNS_fixed;
+ fns_style = PCB_FNS_fixed;
break;
case NAME_STYLE_SINGLE:
- fns_style = FNS_single;
+ fns_style = PCB_FNS_single;
break;
case NAME_STYLE_FIRST:
- fns_style = FNS_first;
+ fns_style = PCB_FNS_first;
break;
case NAME_STYLE_EAGLE:
- assign_eagle_file_suffix(dest, idx);
+ assign_eagle_file_suffix(dest, lid, flags);
return;
}
- switch (idx) {
- case SL(PDRILL, 0):
+ if ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL))
sext = ".cnc";
- break;
- case SL(UDRILL, 0):
- sext = ".cnc";
- break;
- }
-
- strcpy(dest, layer_type_to_file_name(idx, fns_style));
+ pcb_layer_to_file_name(dest, lid, flags, fns_style);
strcat(dest, sext);
}
-static void gerber_do_export(HID_Attr_Val * options)
+static void gerber_do_export(pcb_hid_attr_val_t * options)
{
const char *fnbase;
int i;
- static int saved_layer_stack[MAX_LAYER];
- int save_ons[MAX_LAYER + 2];
+ static int saved_layer_stack[PCB_MAX_LAYER];
+ int save_ons[PCB_MAX_LAYER + 2];
conf_force_set_bool(conf_core.editor.thin_draw, 0);
conf_force_set_bool(conf_core.editor.thin_draw_poly, 0);
@@ -527,8 +494,8 @@ static void gerber_do_export(HID_Attr_Val * options)
outline_layer = NULL;
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *layer = PCB->Data->Layer + i;
+ for (i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layer_t *layer = PCB->Data->Layer + i;
if (strcmp(layer->Name, "outline") == 0 || strcmp(layer->Name, "route") == 0) {
outline_layer = layer;
}
@@ -540,29 +507,10 @@ static void gerber_do_export(HID_Attr_Val * options)
strcat(filename, ".");
filesuff = filename + strlen(filename);
- if (all_layers) {
- memset(print_group, 1, sizeof(print_group));
- memset(print_layer, 1, sizeof(print_layer));
- }
- else {
- memset(print_group, 0, sizeof(print_group));
- memset(print_layer, 0, sizeof(print_layer));
- }
+ pcb_hid_save_and_show_layer_ons(save_ons);
- hid_save_and_show_layer_ons(save_ons);
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *layer = PCB->Data->Layer + i;
- if (!LAYER_IS_EMPTY(layer))
- print_group[GetLayerGroupNumberByNumber(i)] = 1;
- }
- print_group[GetLayerGroupNumberByNumber(solder_silk_layer)] = 1;
- print_group[GetLayerGroupNumberByNumber(component_silk_layer)] = 1;
- for (i = 0; i < max_copper_layer; i++)
- if (print_group[GetLayerGroupNumberByNumber(i)])
- print_layer[i] = 1;
-
- memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack));
- qsort(LayerStack, max_copper_layer, sizeof(LayerStack[0]), layer_sort);
+ memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack));
+ qsort(pcb_layer_stack, pcb_max_copper_layer, sizeof(pcb_layer_stack[0]), layer_sort);
linewidth = -1;
lastcap = -1;
lastgroup = -1;
@@ -579,24 +527,24 @@ static void gerber_do_export(HID_Attr_Val * options)
lastgroup = -1;
layer_list_idx = 0;
finding_apertures = 1;
- hid_expose_callback(&gerber_hid, ®ion, 0);
+ pcb_hid_expose_callback(&gerber_hid, ®ion, 0);
layer_list_idx = 0;
finding_apertures = 0;
- hid_expose_callback(&gerber_hid, ®ion, 0);
+ pcb_hid_expose_callback(&gerber_hid, ®ion, 0);
- memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack));
+ memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack));
maybe_close_f(f);
f = NULL;
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
conf_update(NULL); /* resotre forced sets */
}
static void gerber_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(gerber_options, NUM_OPTIONS, gerber_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(gerber_options, NUM_OPTIONS, gerber_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
static int drill_sort(const void *va, const void *vb)
@@ -610,25 +558,34 @@ static int drill_sort(const void *va, const void *vb)
return b->y - b->y;
}
-static int gerber_set_layer(const char *name, int group, int empty)
+static int gerber_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
int want_outline;
char *cp;
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
+ const char *group_name;
- if (name == NULL)
- name = PCB->Data->Layer[idx].Name;
-
- if (idx >= 0 && idx < max_copper_layer && !print_layer[idx])
+ if (flags & PCB_LYT_UI)
return 0;
- if (strcmp(name, "invisible") == 0)
- return 0;
- if (SL_TYPE(idx) == SL_ASSY)
+#if 0
+ printf(" Layer %s group %lx drill %d mask %d flags=%lx\n", pcb_layer_name(layer), group, is_drill, is_mask, flags);
+#endif
+
+
+ if (!all_layers)
+ if ((group >= 0) && pcb_is_layergrp_empty(group))
+ return 0;
+
+ if ((flags & PCB_LYT_INVIS) || (flags & PCB_LYT_ASSY)) {
+/* printf(" nope: invis %d or assy %d\n", (flags & PCB_LYT_INVIS), (flags & PCB_LYT_ASSY));*/
return 0;
+ }
+
+#warning TODO
+ group_name = "TODO:group_name";
flash_drills = 0;
- if (strcmp(name, "outline") == 0 || strcmp(name, "route") == 0)
+ if (flags & PCB_LYT_OUTLINE)
flash_drills = 1;
if (is_drill && n_pending_drills) {
@@ -647,13 +604,9 @@ static int gerber_set_layer(const char *name, int group, int empty)
pending_drills = NULL;
}
- is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- is_mask = (SL_TYPE(idx) == SL_MASK);
+ is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ is_mask = !!(flags & PCB_LYT_MASK);
current_mask = 0;
-#if 0
- printf("Layer %s group %d drill %d mask %d\n", name, group, is_drill, is_mask);
-#endif
-
if (group < 0 || group != lastgroup) {
time_t currenttime;
char utcTime[64];
@@ -679,10 +632,10 @@ static int gerber_set_layer(const char *name, int group, int empty)
f = NULL;
pagecount++;
- assign_file_suffix(filesuff, idx);
+ assign_file_suffix(filesuff, layer, flags);
f = fopen(filename, "wb"); /* Binary needed to force CR-LF */
if (f == NULL) {
- Message(PCB_MSG_DEFAULT, "Error: Could not open %s for writing.\n", filename);
+ pcb_message(PCB_MSG_ERROR, "Error: Could not open %s for writing.\n", filename);
return 1;
}
@@ -704,7 +657,7 @@ static int gerber_set_layer(const char *name, int group, int empty)
return 1;
}
- fprintf(f, "G04 start of page %d for group %d idx %d *\r\n", pagecount, group, idx);
+ fprintf(f, "G04 start of page %d for group %ld layer_idx %ld *\r\n", pagecount, group, layer);
/* Create a portable timestamp. */
currenttime = time(NULL);
@@ -714,12 +667,12 @@ static int gerber_set_layer(const char *name, int group, int empty)
strftime(utcTime, sizeof utcTime, fmt, gmtime(¤ttime));
}
/* Print a cute file header at the beginning of each file. */
- fprintf(f, "G04 Title: %s, %s *\r\n", UNKNOWN(PCB->Name), UNKNOWN(name));
+ fprintf(f, "G04 Title: %s, %s *\r\n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(group_name));
fprintf(f, "G04 Creator: pcb-rnd " VERSION " *\r\n");
fprintf(f, "G04 CreationDate: %s *\r\n", utcTime);
/* ID the user. */
- fprintf(f, "G04 For: %s *\r\n", get_user_name());
+ fprintf(f, "G04 For: %s *\r\n", pcb_get_user_name());
fprintf(f, "G04 Format: Gerber/RS-274X *\r\n");
pcb_fprintf(f, "G04 PCB-Dimensions: %.0mc %.0mc *\r\n", PCB->MaxWidth, PCB->MaxHeight);
@@ -760,47 +713,44 @@ emit_outline:
and we want to "print outlines", and we have an outline layer,
print the outline layer on this layer also. */
want_outline = 0;
- if (copy_outline_mode == COPY_OUTLINE_MASK && SL_TYPE(idx) == SL_MASK)
+ if (copy_outline_mode == COPY_OUTLINE_MASK && (flags & PCB_LYT_MASK))
want_outline = 1;
- if (copy_outline_mode == COPY_OUTLINE_SILK && SL_TYPE(idx) == SL_SILK)
+ if (copy_outline_mode == COPY_OUTLINE_SILK && (flags & PCB_LYT_SILK))
want_outline = 1;
- if (copy_outline_mode == COPY_OUTLINE_ALL
- && (SL_TYPE(idx) == SL_SILK
- || SL_TYPE(idx) == SL_MASK || SL_TYPE(idx) == SL_FAB || SL_TYPE(idx) == SL_ASSY || SL_TYPE(idx) == 0))
+
+ if (copy_outline_mode == COPY_OUTLINE_ALL && ((flags & PCB_LYT_SILK) || (flags & PCB_LYT_MASK) || (flags & PCB_LYT_FAB) || (flags & PCB_LYT_ASSY)))
want_outline = 1;
- if (want_outline && strcmp(name, "outline")
- && strcmp(name, "route")) {
- if (outline_layer && outline_layer != PCB->Data->Layer + idx)
- DrawLayer(outline_layer, ®ion);
+ if (want_outline && !(flags & PCB_LYT_OUTLINE)) {
+ if (outline_layer && outline_layer != PCB->Data->Layer + layer)
+ pcb_draw_layer(outline_layer, ®ion);
else if (!outline_layer) {
- hidGC gc = gui->make_gc();
- printf("name %s idx %d\n", name, idx);
- if (SL_TYPE(idx) == SL_SILK)
- gui->set_line_width(gc, PCB->minSlk);
+ pcb_hid_gc_t gc = pcb_gui->make_gc();
+ if (flags & PCB_LYT_SILK)
+ pcb_gui->set_line_width(gc, PCB->minSlk);
else if (group >= 0)
- gui->set_line_width(gc, PCB->minWid);
+ pcb_gui->set_line_width(gc, PCB->minWid);
else
- gui->set_line_width(gc, AUTO_OUTLINE_WIDTH);
- gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0);
- gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight);
- gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
- gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight);
- gui->destroy_gc(gc);
+ pcb_gui->set_line_width(gc, AUTO_OUTLINE_WIDTH);
+ pcb_gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0);
+ pcb_gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight);
+ pcb_gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_gui->destroy_gc(gc);
}
}
return 1;
}
-static hidGC gerber_make_gc(void)
+static pcb_hid_gc_t gerber_make_gc(void)
{
- hidGC rv = (hidGC) calloc(1, sizeof(*rv));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) calloc(1, sizeof(*rv));
rv->cap = Trace_Cap;
return rv;
}
-static void gerber_destroy_gc(hidGC gc)
+static void gerber_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -810,7 +760,7 @@ static void gerber_use_mask(int use_it)
current_mask = use_it;
}
-static void gerber_set_color(hidGC gc, const char *name)
+static void gerber_set_color(pcb_hid_gc_t gc, const char *name)
{
if (strcmp(name, "erase") == 0) {
gc->color = 1;
@@ -829,22 +779,22 @@ static void gerber_set_color(hidGC gc, const char *name)
}
}
-static void gerber_set_line_cap(hidGC gc, EndCapStyle style)
+static void gerber_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void gerber_set_line_width(hidGC gc, Coord width)
+static void gerber_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void gerber_set_draw_xor(hidGC gc, int xor_)
+static void gerber_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
-static void use_gc(hidGC gc, int radius)
+static void use_gc(pcb_hid_gc_t gc, int radius)
{
if (radius) {
radius *= 2;
@@ -902,7 +852,7 @@ static void use_gc(hidGC gc, int radius)
#endif
}
-static void gerber_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void gerber_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
gerber_draw_line(gc, x1, y1, x1, y2);
gerber_draw_line(gc, x1, y1, x2, y1);
@@ -910,12 +860,12 @@ static void gerber_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
gerber_draw_line(gc, x2, y1, x2, y2);
}
-static void gerber_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void gerber_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
pcb_bool m = pcb_false;
if (x1 != x2 && y1 != y2 && gc->cap == Square_Cap) {
- Coord x[5], y[5];
+ pcb_coord_t x[5], y[5];
double tx, ty, theta;
theta = atan2(y2 - y1, x2 - x1);
@@ -973,7 +923,7 @@ static void gerber_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
-static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void gerber_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
pcb_bool m = pcb_false;
double arcStartX, arcStopX, arcStartY, arcStopY;
@@ -986,8 +936,35 @@ static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord hei
if (!f)
return;
- arcStartX = cx - width * cos(TO_RADIANS(start_angle));
- arcStartY = cy + height * sin(TO_RADIANS(start_angle));
+ /* full circle is full.... truncate so that the arc split code never needs to
+ do more than 180 deg */
+ if (delta_angle < -360.0)
+ delta_angle = -360.0;
+ if (delta_angle > +360.0)
+ delta_angle = +360.0;
+
+
+ /* some gerber interpreters (gerbv for one) have hard time dealing with
+ full-circle arcs - split large arcs up into 2 smaller ones */
+ if (delta_angle < -180.0) {
+ gerber_draw_arc(gc, cx, cy, width, height, start_angle, -180.0);
+ gerber_draw_arc(gc, cx, cy, width, height, start_angle-180, delta_angle+180.0);
+ return;
+ }
+ if (delta_angle > +180.0) {
+ gerber_draw_arc(gc, cx, cy, width, height, start_angle, 180.0);
+ gerber_draw_arc(gc, cx, cy, width, height, start_angle+180, delta_angle-180.0);
+ return;
+ }
+
+
+ arcStartX = cx - width * cos(PCB_TO_RADIANS(start_angle));
+ arcStartY = cy + height * sin(PCB_TO_RADIANS(start_angle));
+
+ if (fabs(delta_angle) < 0.01) {
+ gerber_draw_line(gc, arcStartX, arcStartY, arcStartX, arcStartY);
+ return;
+ }
/* I checked three different gerber viewers, and they all disagreed
on how ellipses should be drawn. The spec just calls G74/G75
@@ -996,10 +973,10 @@ static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord hei
segments. Note that most arcs in pcb are circles anyway. */
if (width != height) {
double step, angle;
- Coord max = width > height ? width : height;
- Coord minr = max - gc->width / 10;
+ pcb_coord_t max = width > height ? width : height;
+ pcb_coord_t minr = max - gc->width / 10;
int nsteps;
- Coord x0, y0, x1, y1;
+ pcb_coord_t x0, y0, x1, y1;
if (minr >= max)
minr = max - 1;
@@ -1014,8 +991,8 @@ static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord hei
angle = start_angle;
while (nsteps > 0) {
nsteps--;
- x1 = cx - width * cos(TO_RADIANS(angle + step));
- y1 = cy + height * sin(TO_RADIANS(angle + step));
+ x1 = cx - width * cos(PCB_TO_RADIANS(angle + step));
+ y1 = cy + height * sin(PCB_TO_RADIANS(angle + step));
gerber_draw_line(gc, x0, y0, x1, y1);
x0 = x1;
y0 = y1;
@@ -1024,8 +1001,8 @@ static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord hei
return;
}
- arcStopX = cx - width * cos(TO_RADIANS(start_angle + delta_angle));
- arcStopY = cy + height * sin(TO_RADIANS(start_angle + delta_angle));
+ arcStopX = cx - width * cos(PCB_TO_RADIANS(start_angle + delta_angle));
+ arcStopY = cy + height * sin(PCB_TO_RADIANS(start_angle + delta_angle));
if (arcStartX != lastX) {
m = pcb_true;
lastX = arcStartX;
@@ -1047,7 +1024,7 @@ static void gerber_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord hei
lastY = arcStopY;
}
-static void gerber_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void gerber_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
if (radius <= 0)
return;
@@ -1080,12 +1057,12 @@ static void gerber_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
fprintf(f, "D03*\r\n");
}
-static void gerber_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
pcb_bool m = pcb_false;
int i;
int firstTime = 1;
- Coord startX = 0, startY = 0;
+ pcb_coord_t startX = 0, startY = 0;
if (is_mask && current_mask == HID_MASK_BEFORE)
return;
@@ -1131,10 +1108,10 @@ static void gerber_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
fprintf(f, "G37*\r\n");
}
-static void gerber_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void gerber_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- Coord x[5];
- Coord y[5];
+ pcb_coord_t x[5];
+ pcb_coord_t y[5];
x[0] = x[4] = x1;
y[0] = y[4] = y1;
x[1] = x1;
@@ -1154,7 +1131,7 @@ static void gerber_calibrate(double xval, double yval)
static int gerber_usage(const char *topic)
{
fprintf(stderr, "\ngerber exporter command line arguments:\n\n");
- hid_usage(gerber_options, sizeof(gerber_options) / sizeof(gerber_options[0]));
+ pcb_hid_usage(gerber_options, sizeof(gerber_options) / sizeof(gerber_options[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x gerber foo.pcb [gerber options]\n\n");
return 0;
}
@@ -1167,8 +1144,8 @@ pcb_uninit_t hid_export_gerber_init()
{
memset(&gerber_hid, 0, sizeof(gerber_hid));
- common_nogui_init(&gerber_hid);
- common_draw_helpers_init(&gerber_hid);
+ pcb_hid_nogui_init(&gerber_hid);
+ pcb_dhlp_draw_helpers_init(&gerber_hid);
gerber_hid.struct_size = sizeof(gerber_hid);
gerber_hid.name = "gerber";
@@ -1178,7 +1155,7 @@ pcb_uninit_t hid_export_gerber_init()
gerber_hid.get_export_options = gerber_get_export_options;
gerber_hid.do_export = gerber_do_export;
gerber_hid.parse_arguments = gerber_parse_arguments;
- gerber_hid.set_layer = gerber_set_layer;
+ gerber_hid.set_layer_group = gerber_set_layer_group;
gerber_hid.make_gc = gerber_make_gc;
gerber_hid.destroy_gc = gerber_destroy_gc;
gerber_hid.use_mask = gerber_use_mask;
@@ -1196,6 +1173,6 @@ pcb_uninit_t hid_export_gerber_init()
gerber_hid.set_crosshair = gerber_set_crosshair;
gerber_hid.usage = gerber_usage;
- hid_register_hid(&gerber_hid);
+ pcb_hid_register_hid(&gerber_hid);
return NULL;
}
diff --git a/src_plugins/export_ipcd356/Makefile b/src_plugins/export_ipcd356/Makefile
index f816b9f..e69e6b9 100644
--- a/src_plugins/export_ipcd356/Makefile
+++ b/src_plugins/export_ipcd356/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_ipcd356
+ cd ../../src && $(MAKE) mod_export_ipcd356
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_ipcd356/ipcd356.c b/src_plugins/export_ipcd356/ipcd356.c
index de3042b..dde60df 100644
--- a/src_plugins/export_ipcd356/ipcd356.c
+++ b/src_plugins/export_ipcd356/ipcd356.c
@@ -39,16 +39,15 @@
#include <string.h>
#include <time.h>
+#include "board.h"
#include "data.h"
-#include "config.h"
-#include "global.h"
#include "rats.h"
#include "error.h"
#include "find.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "netlist.h"
#include "conf_core.h"
+#include "obj_pinvia.h"
#include "hid.h"
#include "hid_nogui.h"
@@ -59,7 +58,7 @@
static const char *ipcd356_cookie = "ipcd356 exporter";
-static HID_Attribute IPCD356_options[] = {
+static pcb_hid_attribute_t IPCD356_options[] = {
/* %start-doc options "8 IPC-D-356 Netlist Export"
@ftable @code
@item --netlist-file <string>
@@ -77,7 +76,7 @@ Name of the IPC-D-356 Netlist output file.
#define NUM_OPTIONS (sizeof(IPCD356_options)/sizeof(IPCD356_options[0]))
-static HID_Attr_Val IPCD356_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t IPCD356_values[NUM_OPTIONS];
const char *IPCD356_filename;
@@ -102,12 +101,12 @@ IPCD356_AliasList *CreateAliasList(void);
IPCD356_AliasList *AddAliasToList(IPCD356_AliasList *);
int IPCD356_SanityCheck(void);
-static HID_Attribute *IPCD356_get_export_options(int *n)
+static pcb_hid_attribute_t *IPCD356_get_export_options(int *n)
{
static char *last_IPCD356_filename = 0;
if (PCB) {
- derive_default_filename(PCB->Filename, &IPCD356_options[HA_IPCD356_filename], ".net", &last_IPCD356_filename);
+ pcb_derive_default_filename(PCB->Filename, &IPCD356_options[HA_IPCD356_filename], ".net", &last_IPCD356_filename);
}
if (n)
@@ -176,15 +175,15 @@ void IPCD356_WriteNet(FILE * fd, char *net)
{
int padx, pady, tmp;
- ELEMENT_LOOP(PCB->Data);
- PAD_LOOP(element);
- if (TEST_FLAG(PCB_FLAG_FOUND, pad)) {
+ PCB_ELEMENT_LOOP(PCB->Data);
+ PCB_PAD_LOOP(element);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, pad)) {
fprintf(fd, "327%-17.14s", net); /* Net Name. */
fprintf(fd, "%-6.6s", element->Name[1].TextString); /* Refdes. */
fprintf(fd, "-%-4.4s", pad->Number); /* pin number. */
fprintf(fd, " "); /*! \todo Midpoint indicator (M). */
fprintf(fd, " "); /* Drilled hole Id (blank for pads). */
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == pcb_true) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) == pcb_true) {
fprintf(fd, "A02"); /*! \todo Put actual layer # for bottom side. */
}
else {
@@ -221,7 +220,7 @@ void IPCD356_WriteNet(FILE * fd, char *net)
fprintf(fd, "R000"); /* Rotation (0 degrees). */
fprintf(fd, " "); /* Column 72 should be left blank. */
if (pad->Mask > 0) {
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == pcb_true) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) == pcb_true) {
fprintf(fd, "S2"); /* Soldermask on bottom side. */
}
else {
@@ -233,13 +232,13 @@ void IPCD356_WriteNet(FILE * fd, char *net)
}
fprintf(fd, " "); /* Padding. */
fprintf(fd, "\n");
- SET_FLAG(PCB_FLAG_VISIT, pad);
+ PCB_FLAG_SET(PCB_FLAG_VISIT, pad);
}
- END_LOOP; /* Pad. */
- PIN_LOOP(element);
- if (TEST_FLAG(PCB_FLAG_FOUND, pin)) {
- if (TEST_FLAG(PCB_FLAG_HOLE, pin)) { /* Non plated? */
+ PCB_END_LOOP; /* Pad. */
+ PCB_PIN_LOOP(element);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)) { /* Non plated? */
fprintf(fd, "367%-17.14s", net); /* Net Name. */
}
else {
@@ -256,7 +255,7 @@ void IPCD356_WriteNet(FILE * fd, char *net)
tmp = tmp / 1000; /* 0.001 mm. */
}
- if (TEST_FLAG(PCB_FLAG_HOLE, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin)) {
fprintf(fd, "D%-4.4dU", tmp); /* Unplated Drilled hole Id. */
}
else {
@@ -288,7 +287,7 @@ void IPCD356_WriteNet(FILE * fd, char *net)
}
fprintf(fd, "X%4.4d", padx); /* Pad dimension X. */
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
fprintf(fd, "Y%4.4d", padx); /* Pad dimension Y. */
}
else {
@@ -306,16 +305,16 @@ void IPCD356_WriteNet(FILE * fd, char *net)
fprintf(fd, "\n");
- SET_FLAG(PCB_FLAG_VISIT, pin);
+ PCB_FLAG_SET(PCB_FLAG_VISIT, pin);
}
- END_LOOP; /* Pin. */
- END_LOOP; /* Element */
+ PCB_END_LOOP; /* Pin. */
+ PCB_END_LOOP; /* Element */
- VIA_LOOP(PCB->Data);
- if (TEST_FLAG(PCB_FLAG_FOUND, via)) {
- if (TEST_FLAG(PCB_FLAG_HOLE, via)) { /* Non plated ? */
+ PCB_VIA_LOOP(PCB->Data);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, via)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, via)) { /* Non plated ? */
fprintf(fd, "367%-17.14s", net); /* Net Name. */
}
else {
@@ -332,7 +331,7 @@ void IPCD356_WriteNet(FILE * fd, char *net)
tmp = tmp / 1000; /* 0.001 mm. */
}
- if (TEST_FLAG(PCB_FLAG_HOLE, via)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, via)) {
fprintf(fd, "D%-4.4dU", tmp); /* Unplated Drilled hole Id. */
}
else {
@@ -375,10 +374,10 @@ void IPCD356_WriteNet(FILE * fd, char *net)
}
fprintf(fd, " "); /* Padding. */
fprintf(fd, "\n");
- SET_FLAG(PCB_FLAG_VISIT, via);
+ PCB_FLAG_SET(PCB_FLAG_VISIT, via);
}
- END_LOOP; /* Via. */
+ PCB_END_LOOP; /* Via. */
}
@@ -392,11 +391,11 @@ int IPCD356_Netlist(void)
FILE *fp;
char nodename[256];
char net[256];
- LibraryMenuType *netname;
+ pcb_lib_menu_t *netname;
IPCD356_AliasList *aliaslist;
if (IPCD356_SanityCheck()) { /* Check for invalid names + numbers. */
- Message(PCB_MSG_ERROR, "IPCD356: aborting on the sanity check.\n");
+ pcb_message(PCB_MSG_ERROR, "IPCD356: aborting on the sanity check.\n");
return (1);
}
@@ -406,7 +405,7 @@ int IPCD356_Netlist(void)
fp = fopen(IPCD356_filename, "w+");
if (fp == NULL) {
- Message(PCB_MSG_ERROR, "error opening %s\n", IPCD356_filename);
+ pcb_message(PCB_MSG_ERROR, "error opening %s\n", IPCD356_filename);
return 1;
}
/* free (IPCD356_filename); */
@@ -416,25 +415,25 @@ int IPCD356_Netlist(void)
aliaslist = CreateAliasList();
if (aliaslist == NULL) {
- Message(PCB_MSG_ERROR, "Error Aloccating memory for IPC-D-356 AliasList\n");
+ pcb_message(PCB_MSG_ERROR, "Error Aloccating memory for IPC-D-356 AliasList\n");
return 1;
}
if (IPCD356_WriteAliases(fp, aliaslist)) {
- Message(PCB_MSG_ERROR, "Error Writing IPC-D-356 AliasList\n");
+ pcb_message(PCB_MSG_ERROR, "Error Writing IPC-D-356 AliasList\n");
return 1;
}
- ELEMENT_LOOP(PCB->Data);
- PIN_LOOP(element);
- if (!TEST_FLAG(PCB_FLAG_VISIT, pin)) {
- ClearFlagOnLinesAndPolygons(pcb_true, PCB_FLAG_FOUND);
- ClearFlagOnPinsViasAndPads(pcb_true, PCB_FLAG_FOUND);
- LookupConnectionByPin(PCB_TYPE_PIN, pin);
+ PCB_ELEMENT_LOOP(PCB->Data);
+ PCB_PIN_LOOP(element);
+ if (!PCB_FLAG_TEST(PCB_FLAG_VISIT, pin)) {
+ pcb_clear_flag_on_lines_polys(pcb_true, PCB_FLAG_FOUND);
+ pcb_clear_flag_on_pins_vias_pads(pcb_true, PCB_FLAG_FOUND);
+ pcb_lookup_conn_by_pin(PCB_TYPE_PIN, pin);
sprintf(nodename, "%s-%s", element->Name[1].TextString, pin->Number);
netname = pcb_netnode_to_netname(nodename);
-/* Message(PCB_MSG_INFO, "Netname: %s\n", netname->Name +2); */
+/* pcb_message(PCB_MSG_INFO, "Netname: %s\n", netname->Name +2); */
if (netname) {
strcpy(net, &netname->Name[2]);
CheckNetLength(net, aliaslist);
@@ -444,15 +443,15 @@ int IPCD356_Netlist(void)
}
IPCD356_WriteNet(fp, net);
}
- END_LOOP; /* Pin. */
- PAD_LOOP(element);
- if (!TEST_FLAG(PCB_FLAG_VISIT, pad)) {
- ClearFlagOnLinesAndPolygons(pcb_true, PCB_FLAG_FOUND);
- ClearFlagOnPinsViasAndPads(pcb_true, PCB_FLAG_FOUND);
- LookupConnectionByPin(PCB_TYPE_PAD, pad);
+ PCB_END_LOOP; /* Pin. */
+ PCB_PAD_LOOP(element);
+ if (!PCB_FLAG_TEST(PCB_FLAG_VISIT, pad)) {
+ pcb_clear_flag_on_lines_polys(pcb_true, PCB_FLAG_FOUND);
+ pcb_clear_flag_on_pins_vias_pads(pcb_true, PCB_FLAG_FOUND);
+ pcb_lookup_conn_by_pin(PCB_TYPE_PAD, pad);
sprintf(nodename, "%s-%s", element->Name[1].TextString, pad->Number);
netname = pcb_netnode_to_netname(nodename);
-/* Message(PCB_MSG_INFO, "Netname: %s\n", netname->Name +2); */
+/* pcb_message(PCB_MSG_INFO, "Netname: %s\n", netname->Name +2); */
if (netname) {
strcpy(net, &netname->Name[2]);
CheckNetLength(net, aliaslist);
@@ -462,26 +461,26 @@ int IPCD356_Netlist(void)
}
IPCD356_WriteNet(fp, net);
}
- END_LOOP; /* Pad. */
+ PCB_END_LOOP; /* Pad. */
- END_LOOP; /* Element. */
+ PCB_END_LOOP; /* Element. */
- VIA_LOOP(PCB->Data);
- if (!TEST_FLAG(PCB_FLAG_VISIT, via)) {
- ClearFlagOnLinesAndPolygons(pcb_true, PCB_FLAG_FOUND);
- ClearFlagOnPinsViasAndPads(pcb_true, PCB_FLAG_FOUND);
- LookupConnectionByPin(PCB_TYPE_PIN, via);
+ PCB_VIA_LOOP(PCB->Data);
+ if (!PCB_FLAG_TEST(PCB_FLAG_VISIT, via)) {
+ pcb_clear_flag_on_lines_polys(pcb_true, PCB_FLAG_FOUND);
+ pcb_clear_flag_on_pins_vias_pads(pcb_true, PCB_FLAG_FOUND);
+ pcb_lookup_conn_by_pin(PCB_TYPE_PIN, via);
strcpy(net, "N/C");
IPCD356_WriteNet(fp, net);
}
- END_LOOP; /* Via. */
+ PCB_END_LOOP; /* Via. */
IPCD356_End(fp);
fclose(fp);
free(aliaslist);
ResetVisitPinsViasAndPads();
- ClearFlagOnLinesAndPolygons(pcb_true, PCB_FLAG_FOUND);
- ClearFlagOnPinsViasAndPads(pcb_true, PCB_FLAG_FOUND);
+ pcb_clear_flag_on_lines_polys(pcb_true, PCB_FLAG_FOUND);
+ pcb_clear_flag_on_pins_vias_pads(pcb_true, PCB_FLAG_FOUND);
return 0;
}
@@ -492,17 +491,17 @@ void IPCD356_End(FILE * fd)
void ResetVisitPinsViasAndPads()
{
- VIA_LOOP(PCB->Data);
- CLEAR_FLAG(PCB_FLAG_VISIT, via);
- END_LOOP; /* Via. */
- ELEMENT_LOOP(PCB->Data);
- PIN_LOOP(element);
- CLEAR_FLAG(PCB_FLAG_VISIT, pin);
- END_LOOP; /* Pin. */
- PAD_LOOP(element);
- CLEAR_FLAG(PCB_FLAG_VISIT, pad);
- END_LOOP; /* Pad. */
- END_LOOP; /* Element. */
+ PCB_VIA_LOOP(PCB->Data);
+ PCB_FLAG_CLEAR(PCB_FLAG_VISIT, via);
+ PCB_END_LOOP; /* Via. */
+ PCB_ELEMENT_LOOP(PCB->Data);
+ PCB_PIN_LOOP(element);
+ PCB_FLAG_CLEAR(PCB_FLAG_VISIT, pin);
+ PCB_END_LOOP; /* Pin. */
+ PCB_PAD_LOOP(element);
+ PCB_FLAG_CLEAR(PCB_FLAG_VISIT, pad);
+ PCB_END_LOOP; /* Pad. */
+ PCB_END_LOOP; /* Element. */
}
int IPCD356_WriteAliases(FILE * fd, IPCD356_AliasList * aliaslist)
@@ -512,8 +511,8 @@ int IPCD356_WriteAliases(FILE * fd, IPCD356_AliasList * aliaslist)
index = 1;
- for (i = 0; i < PCB->NetlistLib[NETLIST_EDITED].MenuN; i++) {
- if (strlen(PCB->NetlistLib[NETLIST_EDITED].Menu[i].Name + 2) > 14) {
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; i++) {
+ if (strlen(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i].Name + 2) > 14) {
if (index == 1) {
fprintf(fd, "C Netname Aliases Section\n");
}
@@ -522,7 +521,7 @@ int IPCD356_WriteAliases(FILE * fd, IPCD356_AliasList * aliaslist)
return 1;
}
sprintf(aliaslist->Alias[index].NName, "NNAME%-5.5d", index);
- strcpy(aliaslist->Alias[index].NetName, PCB->NetlistLib[NETLIST_EDITED].Menu[i].Name + 2);
+ strcpy(aliaslist->Alias[index].NetName, PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i].Name + 2);
fprintf(fd, "P %s %-58.58s\n", aliaslist->Alias[index].NName, aliaslist->Alias[index].NetName);
index++;
@@ -568,16 +567,16 @@ void CheckNetLength(char *net, IPCD356_AliasList * aliaslist)
int IPCD356_SanityCheck()
{
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
if (element->Name[1].TextString == '\0') {
- Message(PCB_MSG_ERROR, "Error: Found unnamed element. All elements need to be named to create an IPC-D-356 netlist.\n");
+ pcb_message(PCB_MSG_ERROR, "Error: Found unnamed element. All elements need to be named to create an IPC-D-356 netlist.\n");
return (1);
}
- END_LOOP; /* Element. */
+ PCB_END_LOOP; /* Element. */
return (0);
}
-static void IPCD356_do_export(HID_Attr_Val * options)
+static void IPCD356_do_export(pcb_hid_attr_val_t * options)
{
int i;
@@ -599,18 +598,18 @@ static void IPCD356_do_export(HID_Attr_Val * options)
static void IPCD356_parse_arguments(int *argc, char ***argv)
{
- hid_parse_command_line(argc, argv);
+ pcb_hid_parse_command_line(argc, argv);
}
-HID IPCD356_hid;
+pcb_hid_t IPCD356_hid;
pcb_uninit_t *hid_export_ipcd356_init()
{
- memset(&IPCD356_hid, 0, sizeof(HID));
+ memset(&IPCD356_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&IPCD356_hid);
+ pcb_hid_nogui_init(&IPCD356_hid);
- IPCD356_hid.struct_size = sizeof(HID);
+ IPCD356_hid.struct_size = sizeof(pcb_hid_t);
IPCD356_hid.name = "IPC-D-356";
IPCD356_hid.description = "Exports a IPC-D-356 Netlist";
IPCD356_hid.exporter = 1;
@@ -619,9 +618,9 @@ pcb_uninit_t *hid_export_ipcd356_init()
IPCD356_hid.do_export = IPCD356_do_export;
IPCD356_hid.parse_arguments = IPCD356_parse_arguments;
- hid_register_hid(&IPCD356_hid);
+ pcb_hid_register_hid(&IPCD356_hid);
- hid_register_attributes(IPCD356_options, sizeof(IPCD356_options) / sizeof(IPCD356_options[0]), ipcd356_cookie, 0);
+ pcb_hid_register_attributes(IPCD356_options, sizeof(IPCD356_options) / sizeof(IPCD356_options[0]), ipcd356_cookie, 0);
return NULL;
}
diff --git a/src_plugins/export_lpr/Makefile b/src_plugins/export_lpr/Makefile
index bbf5342..6d7ba00 100644
--- a/src_plugins/export_lpr/Makefile
+++ b/src_plugins/export_lpr/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_lpr
+ cd ../../src && $(MAKE) mod_export_lpr
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_lpr/lpr.c b/src_plugins/export_lpr/lpr.c
index 7383232..d6a911d 100644
--- a/src_plugins/export_lpr/lpr.c
+++ b/src_plugins/export_lpr/lpr.c
@@ -10,9 +10,7 @@
#include <string.h>
#include <assert.h>
-#include "global.h"
#include "data.h"
-#include "misc.h"
#include "plugins.h"
#include "compat_misc.h"
@@ -25,7 +23,7 @@
const char *lpr_cookie = "lpr HID";
-static HID_Attribute base_lpr_options[] = {
+static pcb_hid_attribute_t base_lpr_options[] = {
/* %start-doc options "98 lpr Printing Options"
@ftable @code
@@ -44,11 +42,11 @@ PDF output with a virtual PDF printer. Example: @*
#define NUM_OPTIONS (sizeof(lpr_options)/sizeof(lpr_options[0]))
-static HID_Attribute *lpr_options = 0;
+static pcb_hid_attribute_t *lpr_options = 0;
static int num_lpr_options = 0;
-static HID_Attr_Val *lpr_values;
+static pcb_hid_attr_val_t *lpr_values;
-static HID_Attribute *lpr_get_export_options(int *n)
+static pcb_hid_attribute_t *lpr_get_export_options(int *n)
{
/*
* We initialize the default value in this manner because the GUI
@@ -60,18 +58,18 @@ static HID_Attribute *lpr_get_export_options(int *n)
}
if (lpr_options == 0) {
- HID_Attribute *ps_opts = ps_hid.get_export_options(&num_lpr_options);
- lpr_options = (HID_Attribute *) calloc(num_lpr_options, sizeof(HID_Attribute));
- memcpy(lpr_options, ps_opts, num_lpr_options * sizeof(HID_Attribute));
+ pcb_hid_attribute_t *ps_opts = ps_hid.get_export_options(&num_lpr_options);
+ lpr_options = (pcb_hid_attribute_t *) calloc(num_lpr_options, sizeof(pcb_hid_attribute_t));
+ memcpy(lpr_options, ps_opts, num_lpr_options * sizeof(pcb_hid_attribute_t));
memcpy(lpr_options, base_lpr_options, sizeof(base_lpr_options));
- lpr_values = (HID_Attr_Val *) calloc(num_lpr_options, sizeof(HID_Attr_Val));
+ lpr_values = (pcb_hid_attr_val_t *) calloc(num_lpr_options, sizeof(pcb_hid_attr_val_t));
}
if (n)
*n = num_lpr_options;
return lpr_options;
}
-static void lpr_do_export(HID_Attr_Val * options)
+static void lpr_do_export(pcb_hid_attr_val_t * options)
{
FILE *f;
int i;
@@ -101,8 +99,8 @@ static void lpr_do_export(HID_Attr_Val * options)
static void lpr_parse_arguments(int *argc, char ***argv)
{
lpr_get_export_options(0);
- hid_register_attributes(lpr_options, num_lpr_options, lpr_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(lpr_options, num_lpr_options, lpr_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
static void lpr_calibrate(double xval, double yval)
@@ -110,29 +108,29 @@ static void lpr_calibrate(double xval, double yval)
ps_calibrate_1(xval, yval, 1);
}
-static HID lpr_hid;
+static pcb_hid_t lpr_hid;
static int lpr_usage(const char *topic)
{
fprintf(stderr, "\nlpr exporter command line arguments:\n\n");
- hid_usage(base_lpr_options, sizeof(base_lpr_options) / sizeof(base_lpr_options[0]));
+ pcb_hid_usage(base_lpr_options, sizeof(base_lpr_options) / sizeof(base_lpr_options[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x lpr foo.pcb [lpr options]\n\n");
return 0;
}
static void plugin_lpr_uninit(void)
{
- hid_remove_actions_by_cookie(lpr_cookie);
+ pcb_hid_remove_actions_by_cookie(lpr_cookie);
}
pcb_uninit_t hid_export_lpr_init()
{
- memset(&lpr_hid, 0, sizeof(HID));
+ memset(&lpr_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&lpr_hid);
+ pcb_hid_nogui_init(&lpr_hid);
ps_ps_init(&lpr_hid);
- lpr_hid.struct_size = sizeof(HID);
+ lpr_hid.struct_size = sizeof(pcb_hid_t);
lpr_hid.name = "lpr";
lpr_hid.description = "Postscript print";
lpr_hid.printer = 1;
@@ -145,7 +143,7 @@ pcb_uninit_t hid_export_lpr_init()
lpr_hid.usage = lpr_usage;
- hid_register_hid(&lpr_hid);
+ pcb_hid_register_hid(&lpr_hid);
return plugin_lpr_uninit;
}
diff --git a/src_plugins/export_nelma/Makefile b/src_plugins/export_nelma/Makefile
index 3b6a322..f9afca3 100644
--- a/src_plugins/export_nelma/Makefile
+++ b/src_plugins/export_nelma/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_nelma
+ cd ../../src && $(MAKE) mod_export_nelma
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_nelma/nelma.c b/src_plugins/export_nelma/nelma.c
index b51e8ea..a889093 100644
--- a/src_plugins/export_nelma/nelma.c
+++ b/src_plugins/export_nelma/nelma.c
@@ -61,11 +61,10 @@
#include <time.h>
-#include "global.h"
-#include "error.h" /* Message(PCB_MSG_DEFAULT, ) */
+#include "board.h"
+#include "error.h"
#include "data.h"
#include "layer.h"
-#include "misc.h"
#include "rats.h"
#include "plugins.h"
#include "hid_helper.h"
@@ -95,10 +94,10 @@ struct color_struct {
unsigned int r, g, b;
};
-struct hid_gc_struct {
- HID *me_pointer;
- EndCapStyle cap;
- Coord width;
+struct hid_gc_s {
+ pcb_hid_t *me_pointer;
+ pcb_cap_style_t cap;
+ pcb_coord_t width;
unsigned char r, g, b;
int erase;
int faded;
@@ -106,10 +105,10 @@ struct hid_gc_struct {
gdImagePtr brush;
};
-static HID nelma_hid;
+static pcb_hid_t nelma_hid;
static struct color_struct *black = NULL, *white = NULL;
-static Coord linewidth = -1;
+static pcb_coord_t linewidth = -1;
static gdImagePtr lastbrush = (gdImagePtr) ((void *) -1);
static int lastcolor = -1;
@@ -124,7 +123,7 @@ static int is_drill;
* Which groups of layers to export into PNG layer masks. 1 means export, 0
* means do not export.
*/
-static int nelma_export_group[MAX_LAYER];
+static int nelma_export_group[PCB_MAX_LAYERGRP];
/* Group that is currently exported. */
static int nelma_cur_group;
@@ -150,7 +149,7 @@ static double nelma_substratee = -1;
/* Permittivity of empty space (As/Vm) */
static const double nelma_air_epsilon = 8.85e-12;
-HID_Attribute nelma_attribute_list[] = {
+pcb_hid_attribute_t nelma_attribute_list[] = {
/* other HIDs expect this to be first. */
/* %start-doc options "nelma Options"
@@ -211,13 +210,13 @@ Substrate relative epsilon.
#define NUM_OPTIONS (sizeof(nelma_attribute_list)/sizeof(nelma_attribute_list[0]))
-REGISTER_ATTRIBUTES(nelma_attribute_list, nelma_cookie)
- static HID_Attr_Val nelma_values[NUM_OPTIONS];
+PCB_REGISTER_ATTRIBUTES(nelma_attribute_list, nelma_cookie)
+ static pcb_hid_attr_val_t nelma_values[NUM_OPTIONS];
/* *** Utility funcions **************************************************** */
/* convert from default PCB units to nelma units */
- static int pcb_to_nelma(Coord pcb)
+ static int pcb_to_nelma(pcb_coord_t pcb)
{
return PCB_COORD_TO_INCH(pcb) * nelma_dpi;
}
@@ -240,10 +239,7 @@ static char *nelma_get_png_name(const char *basename, const char *suffix)
static void nelma_write_space(FILE * out)
{
double xh, zh;
-
- int z;
- int i, idx;
- const char *ext;
+ int z, i;
xh = 2.54e-2 / ((double) nelma_dpi);
zh = nelma_copperh * 1e-6;
@@ -258,10 +254,10 @@ static void nelma_write_space(FILE * out)
fprintf(out, "\t\t\"air-bottom\"");
z = 10;
- for (i = 0; i < MAX_LAYER; i++)
+ for (i = 0; i < PCB_MAX_LAYERGRP; i++)
if (nelma_export_group[i]) {
- idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx, FNS_fixed);
+ char tmp_ln[PCB_PATH_MAX];
+ const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed);
if (z != 10) {
fprintf(out, ",\n");
@@ -298,15 +294,13 @@ static void nelma_write_materials(FILE * out)
static void nelma_write_nets(FILE * out)
{
- LibraryType netlist;
- LibraryMenuTypePtr net;
- LibraryEntryTypePtr pin;
-
- int n, m, i, idx;
+ pcb_lib_t netlist;
+ pcb_lib_menu_t *net;
+ pcb_lib_entry_t *pin;
- const char *ext;
+ int n, m, i;
- netlist = PCB->NetlistLib[NETLIST_EDITED];
+ netlist = PCB->NetlistLib[PCB_NETLIST_EDITED];
fprintf(out, "\n/* **** Nets **** */\n\n");
@@ -323,10 +317,10 @@ static void nelma_write_nets(FILE * out)
/* pcb_pin_name_to_xy(pin, &x, &y); */
- for (i = 0; i < MAX_LAYER; i++)
+ for (i = 0; i < PCB_MAX_LAYERGRP; i++)
if (nelma_export_group[i]) {
- idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx, FNS_fixed);
+ char tmp_ln[PCB_PATH_MAX];
+ const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed);
if (m != 0 || i != 0)
fprintf(out, ",\n");
@@ -342,9 +336,9 @@ static void nelma_write_nets(FILE * out)
static void nelma_write_layer(FILE * out, int z, int h, const char *name, int full, const char *mat)
{
- LibraryType netlist;
- LibraryMenuTypePtr net;
- LibraryEntryTypePtr pin;
+ pcb_lib_t netlist;
+ pcb_lib_menu_t *net;
+ pcb_lib_entry_t *pin;
int n, m;
@@ -355,7 +349,7 @@ static void nelma_write_layer(FILE * out, int z, int h, const char *name, int fu
if (full) {
fprintf(out, "\tobjects = {\n");
- netlist = PCB->NetlistLib[NETLIST_EDITED];
+ netlist = PCB->NetlistLib[PCB_NETLIST_EDITED];
for (n = 0; n < netlist.MenuN; n++) {
net = &netlist.Menu[n];
@@ -376,14 +370,9 @@ static void nelma_write_layer(FILE * out, int z, int h, const char *name, int fu
static void nelma_write_layers(FILE * out)
{
- int i, idx;
- int z;
-
- const char *ext;
+ int i, subh, z;
char buf[100];
- int subh;
-
subh = nelma_substrateh / nelma_copperh;
fprintf(out, "\n/* **** Layers **** */\n\n");
@@ -394,10 +383,10 @@ static void nelma_write_layers(FILE * out)
nelma_write_layer(out, 1000, 2 * subh, "air-bottom", 0, "air");
z = 10;
- for (i = 0; i < MAX_LAYER; i++)
+ for (i = 0; i < PCB_MAX_LAYERGRP; i++)
if (nelma_export_group[i]) {
- idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx, FNS_fixed);
+ char tmp_ln[PCB_PATH_MAX];
+ const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed);
if (z != 10) {
sprintf(buf, "substrate-%d", z);
@@ -414,24 +403,21 @@ static void nelma_write_layers(FILE * out)
}
}
-static void nelma_write_object(FILE * out, LibraryEntryTypePtr pin)
+static void nelma_write_object(FILE * out, pcb_lib_entry_t *pin)
{
- int i, idx;
- Coord px = 0, py = 0;
- int x, y;
-
+ pcb_coord_t px = 0, py = 0;
+ int x, y, i;
char *f;
- const char *ext;
pcb_pin_name_to_xy(pin, &px, &py);
x = pcb_to_nelma(px);
y = pcb_to_nelma(py);
- for (i = 0; i < MAX_LAYER; i++)
+ for (i = 0; i < PCB_MAX_LAYERGRP; i++)
if (nelma_export_group[i]) {
- idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx, FNS_fixed);
+ char tmp_ln[PCB_PATH_MAX];
+ const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed);
fprintf(out, "object %s-%s {\n", pin->ListEntry, ext);
fprintf(out, "\tposition = { 0, 0 }\n");
@@ -452,13 +438,13 @@ static void nelma_write_object(FILE * out, LibraryEntryTypePtr pin)
static void nelma_write_objects(FILE * out)
{
- LibraryType netlist;
- LibraryMenuTypePtr net;
- LibraryEntryTypePtr pin;
+ pcb_lib_t netlist;
+ pcb_lib_menu_t *net;
+ pcb_lib_entry_t *pin;
int n, m;
- netlist = PCB->NetlistLib[NETLIST_EDITED];
+ netlist = PCB->NetlistLib[PCB_NETLIST_EDITED];
fprintf(out, "\n/* **** Objects **** */\n\n");
@@ -477,16 +463,16 @@ static void nelma_write_objects(FILE * out)
static void nelma_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(nelma_attribute_list, sizeof(nelma_attribute_list) / sizeof(nelma_attribute_list[0]), nelma_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(nelma_attribute_list, sizeof(nelma_attribute_list) / sizeof(nelma_attribute_list[0]), nelma_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-static HID_Attribute *nelma_get_export_options(int *n)
+static pcb_hid_attribute_t *nelma_get_export_options(int *n)
{
static char *last_made_filename = 0;
if (PCB) {
- derive_default_filename(PCB->Filename, &nelma_attribute_list[HA_basename], ".nelma", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &nelma_attribute_list[HA_basename], ".nelma", &last_made_filename);
}
if (n) {
*n = NUM_OPTIONS;
@@ -498,15 +484,16 @@ static HID_Attribute *nelma_get_export_options(int *n)
void nelma_choose_groups()
{
int n, m;
- LayerType *layer;
+ pcb_layer_t *layer;
/* Set entire array to 0 (don't export any layer groups by default */
memset(nelma_export_group, 0, sizeof(nelma_export_group));
- for (n = 0; n < max_copper_layer; n++) {
+ for (n = 0; n < pcb_max_copper_layer; n++) {
+ unsigned int flags = pcb_layer_flags(n);
layer = &PCB->Data->Layer[n];
- if (!LAYER_IS_EMPTY(layer)) {
+ if (!PCB_LAYER_IS_EMPTY(layer)) {
/* layer isn't empty */
/*
@@ -514,9 +501,9 @@ void nelma_choose_groups()
* layers have negative indexes?
*/
- if (SL_TYPE(n) == 0) {
+ if ((flags & PCB_LYT_COPPER) || (flags & PCB_LYT_OUTLINE)) {
/* layer is a copper layer */
- m = GetLayerGroupNumberByNumber(n);
+ m = pcb_layer_get_group(n);
/* the export layer */
nelma_export_group[m] = 1;
@@ -567,7 +554,7 @@ static void nelma_finish_png()
#ifdef HAVE_GDIMAGEPNG
gdImagePng(nelma_im, nelma_f);
#else
- Message(PCB_MSG_DEFAULT, "NELMA: PNG not supported by gd. Can't write layer mask.\n");
+ pcb_message(PCB_MSG_WARNING, "NELMA: PNG not supported by gd. Can't write layer mask.\n");
#endif
gdImageDestroy(nelma_im);
fclose(nelma_f);
@@ -581,7 +568,7 @@ static void nelma_finish_png()
void nelma_start_png_export()
{
- BoxType region;
+ pcb_box_t region;
region.X1 = 0;
region.Y1 = 0;
@@ -592,17 +579,15 @@ void nelma_start_png_export()
lastbrush = (gdImagePtr) ((void *) -1);
lastcolor = -1;
- hid_expose_callback(&nelma_hid, ®ion, 0);
+ pcb_hid_expose_callback(&nelma_hid, ®ion, 0);
}
-static void nelma_do_export(HID_Attr_Val * options)
+static void nelma_do_export(pcb_hid_attr_val_t * options)
{
- int save_ons[MAX_LAYER + 2];
- int i, idx;
+ int save_ons[PCB_MAX_LAYER + 2];
+ int i, len;
FILE *nelma_config;
char *buf;
- int len;
-
time_t t;
if (!options) {
@@ -627,19 +612,18 @@ static void nelma_do_export(HID_Attr_Val * options)
nelma_choose_groups();
- for (i = 0; i < MAX_LAYER; i++) {
+ for (i = 0; i < PCB_MAX_LAYERGRP; i++) {
if (nelma_export_group[i]) {
+ char tmp_ln[PCB_PATH_MAX];
+ const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed);
nelma_cur_group = i;
- /* magic */
- idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i;
-
- nelma_start_png(nelma_basename, layer_type_to_file_name(idx, FNS_fixed));
+ nelma_start_png(nelma_basename, ext);
- hid_save_and_show_layer_ons(save_ons);
+ pcb_hid_save_and_show_layer_ons(save_ons);
nelma_start_png_export();
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
nelma_finish_png();
}
@@ -668,18 +652,16 @@ static void nelma_do_export(HID_Attr_Val * options)
/* *** PNG export (slightly modified code from PNG export HID) ************* */
-static int nelma_set_layer(const char *name, int group, int empty)
+static int nelma_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
+ if (flags & PCB_LYT_INVIS)
+ return 0;
- if (name == 0) {
- name = PCB->Data->Layer[idx].Name;
- }
- if (strcmp(name, "invisible") == 0) {
+ if ((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK)
return 0;
- }
- is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- is_mask = (SL_TYPE(idx) == SL_MASK);
+
+ is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ is_mask = !!(flags & PCB_LYT_MASK);
if (is_mask) {
/* Don't print masks */
@@ -698,9 +680,9 @@ static int nelma_set_layer(const char *name, int group, int empty)
return 0;
}
-static hidGC nelma_make_gc(void)
+static pcb_hid_gc_t nelma_make_gc(void)
{
- hidGC rv = (hidGC) malloc(sizeof(struct hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) malloc(sizeof(struct hid_gc_s));
rv->me_pointer = &nelma_hid;
rv->cap = Trace_Cap;
rv->width = 1;
@@ -710,7 +692,7 @@ static hidGC nelma_make_gc(void)
return rv;
}
-static void nelma_destroy_gc(hidGC gc)
+static void nelma_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -720,7 +702,7 @@ static void nelma_use_mask(int use_it)
/* does nothing */
}
-static void nelma_set_color(hidGC gc, const char *name)
+static void nelma_set_color(pcb_hid_gc_t gc, const char *name)
{
if (nelma_im == NULL) {
return;
@@ -744,27 +726,27 @@ static void nelma_set_color(hidGC gc, const char *name)
return;
}
-static void nelma_set_line_cap(hidGC gc, EndCapStyle style)
+static void nelma_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void nelma_set_line_width(hidGC gc, Coord width)
+static void nelma_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void nelma_set_draw_xor(hidGC gc, int xor_)
+static void nelma_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
-static void nelma_set_draw_faded(hidGC gc, int faded)
+static void nelma_set_draw_faded(pcb_hid_gc_t gc, int faded)
{
gc->faded = faded;
}
-static void use_gc(hidGC gc)
+static void use_gc(pcb_hid_gc_t gc)
{
int need_brush = 0;
@@ -785,7 +767,7 @@ static void use_gc(hidGC gc)
}
if (lastbrush != gc->brush || need_brush) {
static void *bcache = 0;
- hidval bval;
+ pcb_hidval_t bval;
char name[256];
char type;
int r;
@@ -804,7 +786,7 @@ static void use_gc(hidGC gc)
}
sprintf(name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g, gc->color->b, type, r);
- if (hid_cache_color(0, name, &bval, &bcache)) {
+ if (pcb_hid_cache_color(0, name, &bval, &bcache)) {
gc->brush = (gdImagePtr) bval.ptr;
}
else {
@@ -830,7 +812,7 @@ static void use_gc(hidGC gc)
gdImageFilledRectangle(gc->brush, 0, 0, r, r, fg);
}
bval.ptr = gc->brush;
- hid_cache_color(1, name, &bval, &bcache);
+ pcb_hid_cache_color(1, name, &bval, &bcache);
}
gdImageSetBrush(nelma_im, gc->brush);
@@ -866,13 +848,13 @@ static void use_gc(hidGC gc)
}
}
-static void nelma_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void nelma_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
gdImageRectangle(nelma_im, pcb_to_nelma(x1), pcb_to_nelma(y1), pcb_to_nelma(x2), pcb_to_nelma(y2), gc->color->c);
}
-static void nelma_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void nelma_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
gdImageSetThickness(nelma_im, 0);
@@ -880,10 +862,10 @@ static void nelma_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
gdImageFilledRectangle(nelma_im, pcb_to_nelma(x1), pcb_to_nelma(y1), pcb_to_nelma(x2), pcb_to_nelma(y2), gc->color->c);
}
-static void nelma_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void nelma_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
if (x1 == x2 && y1 == y2) {
- Coord w = gc->width / 2;
+ pcb_coord_t w = gc->width / 2;
nelma_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w);
return;
}
@@ -894,9 +876,9 @@ static void nelma_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
gdImageLine(nelma_im, pcb_to_nelma(x1), pcb_to_nelma(y1), pcb_to_nelma(x2), pcb_to_nelma(y2), gdBrushed);
}
-static void nelma_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void nelma_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- Angle sa, ea;
+ pcb_angle_t sa, ea;
/*
* in gdImageArc, 0 degrees is to the right and +90 degrees is down
@@ -917,8 +899,8 @@ static void nelma_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord heig
* make sure we start between 0 and 360 otherwise gd does strange
* things
*/
- sa = NormalizeAngle(sa);
- ea = NormalizeAngle(ea);
+ sa = pcb_normalize_angle(sa);
+ ea = pcb_normalize_angle(ea);
#if 0
printf("draw_arc %d,%d %dx%d %d..%d %d..%d\n", cx, cy, width, height, start_angle, delta_angle, sa, ea);
@@ -932,7 +914,7 @@ static void nelma_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord heig
pcb_to_nelma(2 * width), pcb_to_nelma(2 * height), sa, ea, gdBrushed);
}
-static void nelma_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void nelma_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
use_gc(gc);
@@ -943,7 +925,7 @@ static void nelma_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
}
-static void nelma_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void nelma_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
gdPoint *points;
@@ -976,7 +958,7 @@ static void nelma_set_crosshair(int x, int y, int a)
static int nelma_usage(const char *topic)
{
fprintf(stderr, "\nnelma exporter command line arguments:\n\n");
- hid_usage(nelma_attribute_list, sizeof(nelma_attribute_list) / sizeof(nelma_attribute_list[0]));
+ pcb_hid_usage(nelma_attribute_list, sizeof(nelma_attribute_list) / sizeof(nelma_attribute_list[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x nelma foo.pcb [nelma options]\n\n");
return 0;
}
@@ -987,12 +969,12 @@ static int nelma_usage(const char *topic)
pcb_uninit_t hid_export_nelma_init()
{
- memset(&nelma_hid, 0, sizeof(HID));
+ memset(&nelma_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&nelma_hid);
- common_draw_helpers_init(&nelma_hid);
+ pcb_hid_nogui_init(&nelma_hid);
+ pcb_dhlp_draw_helpers_init(&nelma_hid);
- nelma_hid.struct_size = sizeof(HID);
+ nelma_hid.struct_size = sizeof(pcb_hid_t);
nelma_hid.name = "nelma";
nelma_hid.description = "Numerical analysis package export";
nelma_hid.exporter = 1;
@@ -1001,7 +983,7 @@ pcb_uninit_t hid_export_nelma_init()
nelma_hid.get_export_options = nelma_get_export_options;
nelma_hid.do_export = nelma_do_export;
nelma_hid.parse_arguments = nelma_parse_arguments;
- nelma_hid.set_layer = nelma_set_layer;
+ nelma_hid.set_layer_group = nelma_set_layer_group;
nelma_hid.make_gc = nelma_make_gc;
nelma_hid.destroy_gc = nelma_destroy_gc;
nelma_hid.use_mask = nelma_use_mask;
@@ -1021,6 +1003,6 @@ pcb_uninit_t hid_export_nelma_init()
nelma_hid.usage = nelma_usage;
- hid_register_hid(&nelma_hid);
+ pcb_hid_register_hid(&nelma_hid);
return NULL;
}
diff --git a/src_plugins/export_openscad/Makefile b/src_plugins/export_openscad/Makefile
index c77f26b..0708b15 100644
--- a/src_plugins/export_openscad/Makefile
+++ b/src_plugins/export_openscad/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_openscad
+ cd ../../src && $(MAKE) mod_export_openscad
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_openscad/scad.c b/src_plugins/export_openscad/scad.c
index d29d06c..16833d2 100644
--- a/src_plugins/export_openscad/scad.c
+++ b/src_plugins/export_openscad/scad.c
@@ -37,13 +37,11 @@
#include <time.h>
-#include "config.h"
-#include "global.h"
+#include "board.h"
+#include "math_helper.h"
#include "data.h"
-#include "misc.h"
#include "error.h"
#include "buffer.h"
-#include "create.h"
#include "conf_core.h"
#include "layer.h"
#include "plugins.h"
@@ -110,9 +108,9 @@ static char *finish_color_table[] = {
-static HID scad_hid;
+static pcb_hid_t scad_hid;
-static int silk_layer, drill_layer, outline_layer, mask_layer;
+static int drill_layer, outline_layer, mask_layer;
static int layer_open, fresh_layer;
static char layer_id[64];
@@ -122,7 +120,7 @@ static struct {
float z_offset;
int solder;
int component;
-} group_data[MAX_LAYER];
+} group_data[PCB_MAX_LAYERGRP];
#define HA_scadfile 0
@@ -136,7 +134,7 @@ static struct {
#define HA_minimal_drill 9
#define HA_board_cut 10
-static HID_Attribute scad_options[] = {
+static pcb_hid_attribute_t scad_options[] = {
/*
%start-doc options "Advanced OpenSCAD Export"
@ftable @code
@@ -276,7 +274,7 @@ Type of board cut. Values: @samp{All}, @samp{Top}, @samp{Top only}, @samp{Bottom
#define NUM_OPTIONS (sizeof(scad_options)/sizeof(scad_options[0]))
-static HID_Attr_Val scad_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t scad_values[NUM_OPTIONS];
/****************************************************************************************************/
@@ -291,7 +289,7 @@ static int opt_exp_copper;
static int opt_outline_type;
static int opt_copper_color;
static int opt_mask_color;
-static Coord opt_minimal_drill;
+static pcb_coord_t opt_minimal_drill;
static int opt_board_cut;
static int lastseq = 0;
@@ -302,8 +300,8 @@ static float scaled_layer_thickness;
static int n_alloc_outline_segments, n_outline_segments;
static t_outline_segment *outline_segments;
-static void scad_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y);
-static void scad_emit_polygon(hidGC gc, int n_coords, Coord * x, Coord * y, float thickness);
+static void scad_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y);
+static void scad_emit_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y, float thickness);
/* scaling function - all output is in milimeters */
@@ -336,11 +334,11 @@ static void scad_close_layer()
* Export filter implementation starts here
********************************************/
-static HID_Attribute *scad_get_export_options(int *n)
+static pcb_hid_attribute_t *scad_get_export_options(int *n)
{
static char *last_made_filename = 0;
if (PCB)
- derive_default_filename(PCB->Filename, &scad_options[HA_scadfile], ".scad", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &scad_options[HA_scadfile], ".scad", &last_made_filename);
/* scad_options[HA_minimal_drill].coord_value = scad_options[HA_minimal_drill].*/
if (n)
@@ -367,13 +365,13 @@ static void init_outline()
n_outline_segments = 0;
}
-static void add_outline_segment(Coord x1, Coord y1, Coord x2, Coord y2)
+static void add_outline_segment(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
if (!n_alloc_outline_segments) {
outline_segments = (t_outline_segment *) malloc(sizeof(t_outline_segment) * 50);
n_alloc_outline_segments = 50;
if (!outline_segments) {
- Message(PCB_MSG_ERROR, "openscad: cannot allocate memory for board outline. Board outline cannot be created.\n");
+ pcb_message(PCB_MSG_ERROR, "openscad: cannot allocate memory for board outline. Board outline cannot be created.\n");
return;
}
}
@@ -387,7 +385,7 @@ static void add_outline_segment(Coord x1, Coord y1, Coord x2, Coord y2)
n_alloc_outline_segments = n_alloc_outline_segments + 50;
}
else {
- Message(PCB_MSG_ERROR, "openscad: cannot allocate more memory for board outline. Board outline will be incomplete.\n");
+ pcb_message(PCB_MSG_ERROR, "openscad: cannot allocate more memory for board outline. Board outline will be incomplete.\n");
return;
}
}
@@ -403,12 +401,12 @@ static void add_outline_segment(Coord x1, Coord y1, Coord x2, Coord y2)
typedef struct {
- Coord x;
- Coord y;
+ pcb_coord_t x;
+ pcb_coord_t y;
int marker;
} t_OutlinePoint;
-static int is_same_point(Coord x1, Coord y1, Coord x2, Coord y2)
+static int is_same_point(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
return (abs(x1 - x2) < SCAD_MIN_OUTLINE_DIST)
&& (abs(y1 - y2) < SCAD_MIN_OUTLINE_DIST);
@@ -490,7 +488,7 @@ void scad_process_outline()
fprintf(scad_output, "}\n\n");
}
else {
- Message(PCB_MSG_ERROR, "openscad: cannot allocate more memory for board outline. Board outline will be incomplete.\n");
+ pcb_message(PCB_MSG_ERROR, "openscad: cannot allocate more memory for board outline. Board outline will be incomplete.\n");
}
if (op)
free(op);
@@ -498,13 +496,13 @@ void scad_process_outline()
}
}
-static void scad_do_export(HID_Attr_Val * options)
+static void scad_do_export(pcb_hid_attr_val_t * options)
{
int i;
int inner_layers;
float layer_spacing, layer_offset, cut_offset = 0.;
- BoxType region;
- LayerType *layer;
+ pcb_box_t region;
+ pcb_layer_t *layer;
conf_force_set_bool(conf_core.editor.thin_draw, 0);
conf_force_set_bool(conf_core.editor.thin_draw_poly, 0);
@@ -531,28 +529,23 @@ static void scad_do_export(HID_Attr_Val * options)
scad_output = fopen(scad_filename, "w");
if (scad_output == NULL) {
- Message(PCB_MSG_ERROR, "openscad: could not open %s for writing.\n", scad_filename);
+ pcb_message(PCB_MSG_ERROR, "openscad: could not open %s for writing.\n", scad_filename);
goto quit;
}
scad_write_prologue(PCB->Filename);
memset(group_data, 0, sizeof(group_data));
-#ifdef SOLDER_LAYER
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + SOLDER_LAYER)].solder = 1;
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + COMPONENT_LAYER)].component = 1;
-#else
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + BOTTOM_SIDE)].solder = 1;
- group_data[GetLayerGroupNumberByNumber(max_copper_layer + TOP_SIDE)].component = 1;
-#endif
- for (i = 0; i < max_copper_layer; i++) {
+ group_data[pcb_layer_get_group(pcb_max_copper_layer + PCB_SOLDER_SIDE)].solder = 1;
+ group_data[pcb_layer_get_group(pcb_max_copper_layer + PCB_COMPONENT_SIDE)].component = 1;
+ for (i = 0; i < pcb_max_copper_layer; i++) {
layer = PCB->Data->Layer + i;
- if (!IsLayerEmpty(layer))
- group_data[GetLayerGroupNumberByNumber(i)].draw = 1;
+ if (!pcb_layer_is_empty_(layer))
+ group_data[pcb_layer_get_group(i)].draw = 1;
}
inner_layers = 0;
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
if (group_data[i].draw && !(group_data[i].component || group_data[i].solder)) {
inner_layers++;
}
@@ -560,7 +553,7 @@ static void scad_do_export(HID_Attr_Val * options)
layer_spacing = BOARD_THICKNESS / ((float) inner_layers + 1);
layer_offset = BOARD_THICKNESS / 2. - layer_spacing;
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
if (group_data[i].component) {
group_data[i].z_offset = (BOARD_THICKNESS / 2.) + (OUTER_COPPER_THICKNESS / 2.);
}
@@ -580,7 +573,7 @@ static void scad_do_export(HID_Attr_Val * options)
layer_open = 0;
- hid_expose_callback(&scad_hid, ®ion, 0);
+ pcb_hid_expose_callback(&scad_hid, ®ion, 0);
/* And now .... Board outlines */
@@ -636,7 +629,7 @@ static void scad_do_export(HID_Attr_Val * options)
}
if (opt_exp_copper) {
- for (i = 0; i < max_group; i++) {
+ for (i = 0; i < pcb_max_group; i++) {
if (group_data[i].exp) {
/* printf("%d\n",i); */
@@ -724,48 +717,36 @@ static void scad_do_export(HID_Attr_Val * options)
static void scad_parse_arguments(int *argc, char ***argv)
{
- hid_parse_command_line(argc, argv);
+ pcb_hid_parse_command_line(argc, argv);
}
-static int scad_set_layer(const char *name, int group, int empty)
+static int scad_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
int layer_ok;
if (layer_open) {
scad_close_layer();
}
-
-
- if (name == 0)
- name = PCB->Data->Layer[idx].Name;
-
-/* printf("%s\n",name); */
-
- silk_layer = 0;
drill_layer = 0;
mask_layer = 0;
outline_layer = 0;
fresh_layer = 1;
- if (strcmp(name, "invisible") == 0)
- return 0;
-
- if (SL_TYPE(idx) == SL_ASSY)
+ if (flags & PCB_LYT_UI)
return 0;
- if (strcmp(name, "route") == 0)
+ if ((flags & PCB_LYT_INVIS) || (flags & PCB_LYT_ASSY))
return 0;
- if (group >= 0 && group < max_group) {
+ if (flags & PCB_LYT_COPPER) {
layer_ok = (opt_exp_inner_layers || group_data[group].component || group_data[group].solder) && opt_exp_copper;
}
else {
layer_ok = 1;
}
- if (strcmp(name, "outline") == 0) {
+ if ((flags & PCB_LYT_OUTLINE)) {
if (opt_outline_type == SCAD_OUTLINE_OUTLINE) {
outline_layer = 1;
layer_ok = 1;
@@ -780,43 +761,41 @@ static int scad_set_layer(const char *name, int group, int empty)
if (!layer_ok)
return 0;
- if (group >= 0 && group < max_group) {
+ if (group >= 0 && group < pcb_max_group) {
if (!group_data[group].draw)
return 0;
scaled_layer_thickness = (group_data[group].solder
|| group_data[group].component) ? OUTER_COPPER_THICKNESS : INNER_COPPER_THICKNESS;
- sprintf(layer_id, "layer_%02d", group);
+ sprintf(layer_id, "layer_%02ld", group);
if (!outline_layer) {
group_data[group].exp = 1;
}
}
else {
- if (SL_TYPE(group) == SL_PDRILL) {
- drill_layer = SL_TYPE(group);
+ if (flags & PCB_LYT_PDRILL) {
+ drill_layer = 1;
strcpy(layer_id, "layer_pdrill");
}
- else if (SL_TYPE(group) == SL_UDRILL) {
- drill_layer = SL_TYPE(group);
+ else if (flags & PCB_LYT_UDRILL) {
+ drill_layer = 1;
strcpy(layer_id, "layer_udrill");
}
- else if (SL_TYPE(group) == SL_SILK) {
+ else if ((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK) {
if (!opt_exp_silk)
return 0;
scaled_layer_thickness = SILK_LAYER_THICKNESS;
- silk_layer = SL_TYPE(group);
- if (SL_SIDE(group) == SL_TOP_SIDE) {
+ if (flags & PCB_LYT_TOP) {
strcpy(layer_id, "layer_topsilk");
}
else {
strcpy(layer_id, "layer_bottomsilk");
}
}
- else if (SL_TYPE(group) == SL_MASK) {
+ else if (flags & PCB_LYT_MASK) {
if (opt_mask_color == SCAD_MASK_NONE || opt_outline_type == SCAD_OUTLINE_NONE)
return 0;
scaled_layer_thickness = MASK_THICKNESS * 2.;
- silk_layer = SL_TYPE(group);
- if (SL_SIDE(group) == SL_TOP_SIDE) {
+ if ((flags & PCB_LYT_TOP)) {
strcpy(layer_id, "layer_topmask");
}
else {
@@ -831,6 +810,8 @@ static int scad_set_layer(const char *name, int group, int empty)
layer_open = 1;
if (!outline_layer) {
+ char tmp_ln[PCB_PATH_MAX];
+ const char *name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed);
fprintf(scad_output, "// START_OF_LAYER: %s\n", name);
if (drill_layer) {
fprintf(scad_output, "%s_list=[\n", layer_id);
@@ -842,15 +823,15 @@ static int scad_set_layer(const char *name, int group, int empty)
return 1;
}
-static hidGC scad_make_gc(void)
+static pcb_hid_gc_t scad_make_gc(void)
{
- hidGC rv = (hidGC) calloc(1, sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) calloc(1, sizeof(hid_gc_s));
rv->cap = Trace_Cap;
rv->seq = lastseq++;
return rv;
}
-static void scad_destroy_gc(hidGC gc)
+static void scad_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -860,7 +841,7 @@ static void scad_use_mask(int use_it)
current_mask = use_it;
}
-static void scad_set_color(hidGC gc, const char *name)
+static void scad_set_color(pcb_hid_gc_t gc, const char *name)
{
if (strcmp(name, "erase") == 0) {
gc->erase = 1;
@@ -874,7 +855,7 @@ static void scad_set_color(hidGC gc, const char *name)
if (name[0] == '#') {
unsigned int r, g, b;
if (sscanf(name + 1, "%02x%02x%02x", &r, &g, &b) != 3)
- Message(PCB_MSG_ERROR, "Invalid color format: %s\n", name);
+ pcb_message(PCB_MSG_ERROR, "Invalid color format: %s\n", name);
gc->r = r;
gc->g = g;
gc->b = b;
@@ -889,25 +870,25 @@ static void scad_set_color(hidGC gc, const char *name)
}
}
-static void scad_set_line_cap(hidGC gc, EndCapStyle style)
+static void scad_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void scad_set_line_width(hidGC gc, Coord width)
+static void scad_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void scad_set_draw_xor(hidGC gc, int xor)
+static void scad_set_draw_xor(pcb_hid_gc_t gc, int xor)
{
}
-static void scad_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void scad_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- Coord x[5];
- Coord y[5];
+ pcb_coord_t x[5];
+ pcb_coord_t y[5];
x[0] = x[4] = x1;
y[0] = y[4] = y1;
x[1] = x1;
@@ -926,7 +907,7 @@ static void scad_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
* -- on polyline segment cap is drawn only on beginning
*/
-static void scad_emit_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2, int mode)
+static void scad_emit_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, int mode)
{
int zero_length;
float angle = 0., length = 0.;
@@ -980,7 +961,7 @@ static void scad_emit_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2, int
}
-static void scad_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void scad_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
if (drill_layer)
return;
@@ -989,7 +970,7 @@ static void scad_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
-static void scad_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void scad_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
int i, n_steps, x, y, ox = 0, oy = 0, sa;
float angle;
@@ -1026,7 +1007,7 @@ static void scad_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord heigh
* - as plated or unplated drills it creates vector of holes
* - otherwise it is drawn as simple
*/
-static void scad_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void scad_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
/* int i; */
if (outline_layer)
@@ -1060,7 +1041,7 @@ static void scad_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
* Helper function - creates extruded polygon
*/
-static void scad_emit_polygon(hidGC gc, int n_coords, Coord * x, Coord * y, float thickness)
+static void scad_emit_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y, float thickness)
{
int i, n;
/* int cw, cx; */
@@ -1093,7 +1074,7 @@ static void scad_emit_polygon(hidGC gc, int n_coords, Coord * x, Coord * y, floa
}
-static void scad_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void scad_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
if (outline_layer)
return;
@@ -1101,10 +1082,10 @@ static void scad_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
scad_emit_polygon(gc, n_coords, x, y, scaled_layer_thickness);
}
-static void scad_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void scad_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- Coord x[5];
- Coord y[5];
+ pcb_coord_t x[5];
+ pcb_coord_t y[5];
if (scad_output)
fprintf(scad_output, "// Fill rect\n");
@@ -1134,14 +1115,14 @@ static void scad_set_crosshair(int x, int y, int action)
static const char *openscad_cookie = "openscad exporter";
-static HID scad_hid;
+static pcb_hid_t scad_hid;
pcb_uninit_t hid_export_openscad_init()
{
memset(&scad_hid, 0, sizeof(scad_hid));
- common_nogui_init(&scad_hid);
- common_draw_helpers_init(&scad_hid);
+ pcb_hid_nogui_init(&scad_hid);
+ pcb_dhlp_draw_helpers_init(&scad_hid);
scad_hid.struct_size = sizeof(scad_hid);
scad_hid.name = "openscad";
@@ -1151,7 +1132,7 @@ pcb_uninit_t hid_export_openscad_init()
scad_hid.get_export_options = scad_get_export_options;
scad_hid.do_export = scad_do_export;
scad_hid.parse_arguments = scad_parse_arguments;
- scad_hid.set_layer = scad_set_layer;
+ scad_hid.set_layer_group = scad_set_layer_group;
scad_hid.calibrate = scad_calibrate;
scad_hid.set_crosshair = scad_set_crosshair;
@@ -1170,8 +1151,8 @@ pcb_uninit_t hid_export_openscad_init()
scad_hid.fill_polygon = scad_fill_polygon;
scad_hid.fill_rect = scad_fill_rect;
- hid_register_hid(&scad_hid);
+ pcb_hid_register_hid(&scad_hid);
- hid_register_attributes(scad_options, sizeof(scad_options) / sizeof(scad_options[0]), openscad_cookie, 0);
+ pcb_hid_register_attributes(scad_options, sizeof(scad_options) / sizeof(scad_options[0]), openscad_cookie, 0);
return NULL;
}
diff --git a/src_plugins/export_openscad/scad.h b/src_plugins/export_openscad/scad.h
index 4dafd60..8658a1e 100644
--- a/src_plugins/export_openscad/scad.h
+++ b/src_plugins/export_openscad/scad.h
@@ -91,7 +91,7 @@
#define SCAD_CUT_BOTTOM 3
#define SCAD_CUT_BOTTOM_ONLY 4
-#define MAX_LAYER_COLORS (MAX_LAYER *2)
+#define MAX_LAYER_COLORS (PCB_MAX_LAYER *2)
/* polygon attributes */
@@ -109,18 +109,18 @@ typedef struct color_table_struct {
int r, g, b;
} color_table_struct;
-typedef struct hid_gc_struct {
- EndCapStyle cap;
+typedef struct hid_gc_s {
+ pcb_cap_style_t cap;
int width;
int erase;
int drill;
int r, g, b;
int seq;
-} hid_gc_struct;
+} hid_gc_s;
typedef struct {
int processed;
- Coord x1, y1, x2, y2;
+ pcb_coord_t x1, y1, x2, y2;
} t_outline_segment;
extern FILE *scad_output;
diff --git a/src_plugins/export_openscad/scadcomp.c b/src_plugins/export_openscad/scadcomp.c
index 6d2eca5..45e4302 100644
--- a/src_plugins/export_openscad/scadcomp.c
+++ b/src_plugins/export_openscad/scadcomp.c
@@ -38,14 +38,10 @@
#include <time.h>
-#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
-#include "misc.h"
#include "error.h"
#include "buffer.h"
-#include "mirror.h"
-#include "create.h"
#include "misc_util.h"
#include "hid.h"
@@ -94,7 +90,7 @@ static void scad_add_include_file(char *include_file)
include_files_bufsize = 2048;
}
else {
- Message(PCB_MSG_ERROR, "openscad: cannot allocate memory for component included files.\n");
+ pcb_message(PCB_MSG_ERROR, "openscad: cannot allocate memory for component included files.\n");
}
}
@@ -128,7 +124,7 @@ static void scad_export_include_files(void)
l = strlen(pcblibdir) + 1 + strlen(MODELBASE) + 1 + strlen(SCADBASE) + 1 + include_file_maxlength + 1;
if ((fullname = (char *) malloc(l * sizeof(char))) == NULL) {
- Message(PCB_MSG_ERROR, "openscad: cannot allocate memory for component included files.\n");
+ pcb_message(PCB_MSG_ERROR, "openscad: cannot allocate memory for component included files.\n");
return;
}
sprintf(fullname, "%s%s%s%s%s%s", pcblibdir, PCB_DIR_SEPARATOR_S,
@@ -237,22 +233,22 @@ static void scad_process_line(char *line)
}
-static int scad_parse_coord_triplet(char *s, Coord * ox, Coord * oy, Coord * oz)
+static int scad_parse_coord_triplet(char *s, pcb_coord_t * ox, pcb_coord_t * oy, pcb_coord_t * oz)
{
- Coord xx = 0, yy = 0, zz = 0;
+ pcb_coord_t xx = 0, yy = 0, zz = 0;
int n = 0, ln = 0;
char val[32];
while (sscanf(s, "%30s%n", val, &ln) >= 1) {
switch (n) {
case 0:
- xx = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ xx = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 1:
- yy = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ yy = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 2:
- zz = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ zz = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
}
s = s + ln;
@@ -289,26 +285,26 @@ static int scad_parse_float_triplet(char *s, float *ox, float *oy, float *oz)
* - adjusts the model position, rotation, scale
* - processes the model line-by-line and perfoprms variable expansion
************************************************************/
-static void scad_export_model(int model_type, ElementType * element, pcb_bool imported, FILE * f, char *line, int size)
+static void scad_export_model(int model_type, pcb_element_t * element, pcb_bool imported, FILE * f, char *line, int size)
{
char *model_rotation, *model_translate, *model_scale, *model_angle;
- Angle tmp_angle = (Angle) 0;
- Coord tx, ty, tz;
+ pcb_angle_t tmp_angle = (pcb_angle_t) 0;
+ pcb_coord_t tx, ty, tz;
float fx, fy, fz;
int x = element->MarkX, y = element->MarkY;
model_rotation =
- AttributeGetFromList(&(element->Attributes),
+ pcb_attribute_get(&(element->Attributes),
(model_type == SCAD_OVERLAY) ? "OpenSCAD::Overlay:rotate" : "OpenSCAD::Model:rotate");
model_scale =
- AttributeGetFromList(&(element->Attributes),
+ pcb_attribute_get(&(element->Attributes),
(model_type == SCAD_OVERLAY) ? "OpenSCAD::Overlay:scale" : "OpenSCAD::Model:scale");
model_translate =
- AttributeGetFromList(&(element->Attributes),
+ pcb_attribute_get(&(element->Attributes),
(model_type == SCAD_OVERLAY) ? "OpenSCAD::Overlay:translate" : "OpenSCAD::Model:translate");
- if ((model_angle = AttributeGetFromList(&(element->Attributes), "Footprint::RotationTracking")) != NULL) {
+ if ((model_angle = pcb_attribute_get(&(element->Attributes), "Footprint::RotationTracking")) != NULL) {
sscanf(model_angle, "%lf", &tmp_angle);
}
@@ -317,13 +313,13 @@ static void scad_export_model(int model_type, ElementType * element, pcb_bool im
fprintf(scad_output, "translate ([%f, %f, %f]) ",
scad_scale_coord((float) x), -scad_scale_coord((float) y),
- ((TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) ? -1. : 1.) * (BOARD_THICKNESS / 2. + OUTER_COPPER_THICKNESS));
+ ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) ? -1. : 1.) * (BOARD_THICKNESS / 2. + OUTER_COPPER_THICKNESS));
/* rotate order: angle onsolder user-defined */
if (tmp_angle != 0.)
- fprintf(scad_output, "rotate ([0, 0, %f]) ", (TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) ? -tmp_angle : tmp_angle);
+ fprintf(scad_output, "rotate ([0, 0, %f]) ", (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) ? -tmp_angle : tmp_angle);
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, (element)))
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element)))
fprintf(scad_output, "rotate([180.,0,0]) ");
if (model_rotation && scad_parse_float_triplet(model_rotation, &fx, &fy, &fz))
@@ -351,25 +347,25 @@ static void scad_export_model(int model_type, ElementType * element, pcb_bool im
-extern void FreeRotateBuffer(BufferType * Buffer, Angle angle);
+extern void pcb_buffer_free_rotate(pcb_buffer_t * Buffer, pcb_angle_t angle);
-static int scad_calculate_bbox(ElementType * element, Angle angle, float *w, float *h, float *ox, float *oy)
+static int scad_calculate_bbox(pcb_element_t * element, pcb_angle_t angle, float *w, float *h, float *ox, float *oy)
{
return 0;
/*
TODO: automatic calculation of bounding box
- BufferType element_buffer;
+ pcb_buffer_t element_buffer;
- element_buffer.Data = CreateNewBuffer ();
+ element_buffer.Data = pcb_buffer_new();
-- Copy
- AddElementToBuffer (ElementType *Element)
- if (ON_SIDE(Element,(Settings.ShowBottomSide)?BOTTOM_SIDE:TOP_SIDE))
- MirrorElementCoordinates (element_buffer.Data, element, 0);
+ AddElementToBuffer (pcb_element_t *Element)
+ if (PCB_ON_SIDE(Element,(Settings.ShowBottomSide)?BOTTOM_SIDE:TOP_SIDE))
+ pcb_element_mirror(element_buffer.Data, element, 0);
- ClearBuffer (&element_buffer);
+ pcb_buffer_clear(&element_buffer);
*/
}
@@ -378,20 +374,20 @@ static int scad_calculate_bbox(ElementType * element, Angle angle, float *w, flo
* - identifies the model for the component - primary and overlay
* - exports both models
************************************************************/
-static void scad_export_bbox(ElementType * element)
+static void scad_export_bbox(pcb_element_t * element)
{
char *model_angle, *bbox;
- Angle tmp_angle = (Angle) 0;
+ pcb_angle_t tmp_angle = (pcb_angle_t) 0;
float w = 0., h = 0., t = 0., ox = 0., oy = 0.;
int x = element->MarkX, y = element->MarkY;
int n, ln;
char val[32], *s;
- if ((bbox = AttributeGetFromList(&(element->Attributes), "Footprint::BoundingBox")) == NULL)
+ if ((bbox = pcb_attribute_get(&(element->Attributes), "Footprint::BoundingBox")) == NULL)
return;
- if ((model_angle = AttributeGetFromList(&(element->Attributes), "Footprint::RotationTracking")) != NULL) {
+ if ((model_angle = pcb_attribute_get(&(element->Attributes), "Footprint::RotationTracking")) != NULL) {
sscanf(model_angle, "%lf", &tmp_angle);
}
@@ -401,19 +397,19 @@ static void scad_export_bbox(ElementType * element)
while (sscanf(s, "%30s%n", val, &ln) >= 1) {
switch (n) {
case 0:
- w = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ w = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 1:
- h = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ h = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 2:
- t = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ t = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 3:
- ox = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ ox = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
case 4:
- oy = GetValueEx(val, NULL, NULL, NULL, "mm", NULL);
+ oy = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL);
break;
}
s = s + ln;
@@ -435,11 +431,11 @@ static void scad_export_bbox(ElementType * element)
fprintf(scad_output, "translate ([%f, %f, %f]) ",
scad_scale_coord((float) x), -scad_scale_coord((float) y),
- ((TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) ? -1. : 1.) * (BOARD_THICKNESS / 2. + OUTER_COPPER_THICKNESS));
+ ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) ? -1. : 1.) * (BOARD_THICKNESS / 2. + OUTER_COPPER_THICKNESS));
if (tmp_angle != 0.)
- fprintf(scad_output, "rotate ([0, 0, %f]) ", (TEST_FLAG(PCB_FLAG_ONSOLDER, (element))) ? -tmp_angle : tmp_angle);
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, (element)))
+ fprintf(scad_output, "rotate ([0, 0, %f]) ", (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element))) ? -tmp_angle : tmp_angle);
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (element)))
fprintf(scad_output, "rotate([180.,0,0]) ");
fprintf(scad_output, "{\n");
@@ -454,7 +450,7 @@ static void scad_export_bbox(ElementType * element)
}
-static void scad_writeout_element(ElementType * element, char *name, int model_type, pcb_bool imported, pcb_bool simple)
+static void scad_writeout_element(pcb_element_t * element, char *name, int model_type, pcb_bool imported, pcb_bool simple)
{
FILE *f = NULL;
char line[2048];
@@ -479,40 +475,40 @@ static void scad_writeout_element(ElementType * element, char *name, int model_t
* - identifies the model for the component - primary and overlay
* - exports both models
************************************************************/
-static void scad_export_element(ElementType * element, pcb_bool simple)
+static void scad_export_element(pcb_element_t * element, pcb_bool simple)
{
char *model_name, *s;
pcb_bool imported_model;
- s = AttributeGetFromList(&(element->Attributes), "OpenSCAD::Model:type");
+ s = pcb_attribute_get(&(element->Attributes), "OpenSCAD::Model:type");
imported_model = s && (strcmp(s, "STL") == 0);
/* get model name from attibute */
- model_name = AttributeGetFromList(&(element->Attributes), "OpenSCAD::Model");
+ model_name = pcb_attribute_get(&(element->Attributes), "OpenSCAD::Model");
if (model_name) {
scad_writeout_element(element, model_name, SCAD_STANDARD, imported_model, simple);
}
else {
/* no model variable found, try model, based on footprint name attribute */
- model_name = AttributeGetFromList(&(element->Attributes), "Footprint::File");
+ model_name = pcb_attribute_get(&(element->Attributes), "Footprint::File");
if (model_name) {
scad_writeout_element(element, model_name, SCAD_STANDARD, imported_model, simple);
}
else {
/* still no model found, try model, based on description */
- model_name = DESCRIPTION_NAME(element);
+ model_name = PCB_ELEM_NAME_DESCRIPTION(element);
if (model_name) {
scad_writeout_element(element, model_name, SCAD_STANDARD, imported_model, simple);
}
}
}
- s = AttributeGetFromList(&(element->Attributes), "OpenSCAD::Overlay:type");
+ s = pcb_attribute_get(&(element->Attributes), "OpenSCAD::Overlay:type");
imported_model = s && (strcmp(s, "STL") == 0);
/* get overlay name from attibute */
- model_name = AttributeGetFromList(&(element->Attributes), "OpenSCAD::Overlay");
+ model_name = pcb_attribute_get(&(element->Attributes), "OpenSCAD::Overlay");
if (model_name) {
scad_writeout_element(element, model_name, SCAD_OVERLAY, imported_model, simple);
@@ -537,7 +533,7 @@ void scad_process_components(int mode)
fprintf(scad_output, "module all_components() {\n");
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
if ((mode == SCAD_COMPONENT_SIMPLE) || (mode == SCAD_COMPONENT_REALISTIC)) {
scad_export_element(element, (mode == SCAD_COMPONENT_SIMPLE) ? 1 : 0);
@@ -547,7 +543,7 @@ void scad_process_components(int mode)
}
}
- END_LOOP;
+ PCB_END_LOOP;
fprintf(scad_output, "}\n\n");
diff --git a/src_plugins/export_openscad/scadproto.c b/src_plugins/export_openscad/scadproto.c
index 033d1e8..7513e09 100644
--- a/src_plugins/export_openscad/scadproto.c
+++ b/src_plugins/export_openscad/scadproto.c
@@ -35,16 +35,11 @@
#include <math.h>
#include <dirent.h>
#include <sys/stat.h>
-
#include <time.h>
-#include "config.h"
-#include "global.h"
#include "data.h"
-#include "misc.h"
#include "error.h"
#include "buffer.h"
-#include "create.h"
#include "hid.h"
#include "hid_nogui.h"
diff --git a/src_plugins/export_png/Makefile b/src_plugins/export_png/Makefile
index 8b4cfea..ae86881 100644
--- a/src_plugins/export_png/Makefile
+++ b/src_plugins/export_png/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_png
+ cd ../../src && $(MAKE) mod_export_png
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_png/png.c b/src_plugins/export_png/png.c
index ac5c805..3b85ae0 100644
--- a/src_plugins/export_png/png.c
+++ b/src_plugins/export_png/png.c
@@ -34,10 +34,9 @@
#include <assert.h>
#include <math.h>
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "layer.h"
#include "misc_util.h"
#include "compat_misc.h"
@@ -60,7 +59,7 @@
#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", func); abort()
-static HID png_hid;
+static pcb_hid_t png_hid;
const char *png_cookie = "png HID";
@@ -69,8 +68,8 @@ static void *brush_cache = NULL;
static double bloat = 0;
static double scale = 1;
-static Coord x_shift = 0;
-static Coord y_shift = 0;
+static pcb_coord_t x_shift = 0;
+static pcb_coord_t y_shift = 0;
static int show_solder_side;
#define SCALE(w) ((int)((w)/scale + 0.5))
#define SCALE_X(x) ((int)(((x) - x_shift)/scale))
@@ -82,7 +81,7 @@ static int show_solder_side;
#define NOT_EDGE_Y(y) ((y) != 0 && (y) != PCB->MaxHeight)
#define NOT_EDGE(x,y) (NOT_EDGE_X(x) || NOT_EDGE_Y(y))
-static void png_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
+static void png_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
/* The result of a failed gdImageColorAllocate() call */
#define BADC -1
@@ -96,15 +95,15 @@ typedef struct color_struct {
} color_struct;
-typedef struct hid_gc_struct {
- HID *me_pointer;
- EndCapStyle cap;
+typedef struct hid_gc_s {
+ pcb_hid_t *me_pointer;
+ pcb_cap_style_t cap;
int width;
unsigned char r, g, b;
color_struct *color;
gdImagePtr brush;
int is_erase;
-} hid_gc_struct;
+} hid_gc_s;
static color_struct *black = NULL, *white = NULL;
static gdImagePtr im = NULL, master_im, mask_im = NULL;
@@ -113,8 +112,6 @@ static int linewidth = -1;
static int lastgroup = -1;
static gdImagePtr lastbrush = (gdImagePtr) ((void *) -1);
static int lastcap = -1;
-static int print_group[MAX_LAYER];
-static int print_layer[MAX_LAYER];
/* For photo-mode we need the following layers as monochrome masks:
@@ -128,10 +125,10 @@ static int print_layer[MAX_LAYER];
#define PHOTO_FLIP_Y 2
static int photo_mode, photo_flip;
-static gdImagePtr photo_copper[MAX_LAYER + 2];
+static gdImagePtr photo_copper[PCB_MAX_LAYER + 2];
static gdImagePtr photo_silk, photo_mask, photo_drill, *photo_im;
static gdImagePtr photo_outline;
-static int photo_groups[MAX_LAYER + 2], photo_ngroups;
+static int photo_groups[PCB_MAX_LAYERGRP + 2], photo_ngroups;
static int photo_has_inners;
static int doing_outline, have_outline;
@@ -165,7 +162,7 @@ static const char *filetypes[] = {
NULL
};
-HID_Attribute png_attribute_list[] = {
+pcb_hid_attribute_t png_attribute_list[] = {
/* other HIDs expect this to be first. */
/* %start-doc options "93 PNG Options"
@@ -341,9 +338,9 @@ In photo-realistic mode, export the reverse side of the layout. Up-down flip.
#define NUM_OPTIONS (sizeof(png_attribute_list)/sizeof(png_attribute_list[0]))
-REGISTER_ATTRIBUTES(png_attribute_list, png_cookie)
+PCB_REGISTER_ATTRIBUTES(png_attribute_list, png_cookie)
- static HID_Attr_Val png_values[NUM_OPTIONS];
+ static pcb_hid_attr_val_t png_values[NUM_OPTIONS];
static const char *get_file_suffix(void)
{
@@ -367,27 +364,27 @@ REGISTER_ATTRIBUTES(png_attribute_list, png_cookie)
return result;
}
-static HID_Attribute *png_get_export_options(int *n)
+static pcb_hid_attribute_t *png_get_export_options(int *n)
{
static char *last_made_filename = 0;
const char *suffix = get_file_suffix();
if (PCB)
- derive_default_filename(PCB->Filename, &png_attribute_list[HA_pngfile], suffix, &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &png_attribute_list[HA_pngfile], suffix, &last_made_filename);
if (n)
*n = NUM_OPTIONS;
return png_attribute_list;
}
-static int comp_layer, solder_layer;
+static pcb_layergrp_id_t comp_layer, solder_layer;
-static int group_for_layer(int l)
+static pcb_layergrp_id_t group_for_layer(int l)
{
- if (l < max_copper_layer + 2 && l >= 0)
- return GetLayerGroupNumberByNumber(l);
+ if (l < pcb_max_copper_layer + 2 && l >= 0)
+ return pcb_layer_get_group(l);
/* else something unique */
- return max_group + 3 + l;
+ return pcb_max_group + 3 + l;
}
static int layer_sort(const void *va, const void *vb)
@@ -398,7 +395,7 @@ static int layer_sort(const void *va, const void *vb)
int bl = group_for_layer(b);
int d = bl - al;
- if (a >= 0 && a <= max_copper_layer + 1) {
+ if (a >= 0 && a <= pcb_max_copper_layer + 1) {
int aside = (al == solder_layer ? 0 : al == comp_layer ? 2 : 1);
int bside = (bl == solder_layer ? 0 : bl == comp_layer ? 2 : 1);
if (bside != aside)
@@ -410,13 +407,13 @@ static int layer_sort(const void *va, const void *vb)
}
static const char *filename;
-static BoxType *bounds;
+static pcb_box_t *bounds;
static int in_mono, as_shown;
static void parse_bloat(const char *str)
{
int n;
- UnitList extra_units = {
+ pcb_unit_list_t extra_units = {
{"pix", 0, 0},
{"px", 0, 0},
{"", 0, 0}
@@ -425,14 +422,13 @@ static void parse_bloat(const char *str)
extra_units[n].scale = scale;
if (str == NULL)
return;
- bloat = GetValueEx(str, NULL, NULL, extra_units, "", NULL);
+ bloat = pcb_get_value_ex(str, NULL, NULL, extra_units, "", NULL);
}
-void png_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
+void png_hid_export_to_file(FILE * the_file, pcb_hid_attr_val_t * options)
{
- int i;
- static int saved_layer_stack[MAX_LAYER];
- BoxType region;
+ static int saved_layer_stack[PCB_MAX_LAYER];
+ pcb_box_t tmp, region;
f = the_file;
@@ -442,25 +438,11 @@ void png_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
region.Y2 = PCB->MaxHeight;
if (options[HA_only_visible].int_value)
- bounds = GetDataBoundingBox(PCB->Data);
+ bounds = pcb_data_bbox(&tmp, PCB->Data);
else
bounds = ®ion;
- memset(print_group, 0, sizeof(print_group));
- memset(print_layer, 0, sizeof(print_layer));
-
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *layer = PCB->Data->Layer + i;
- if (!LAYER_IS_EMPTY(layer))
- print_group[GetLayerGroupNumberByNumber(i)] = 1;
- }
- print_group[GetLayerGroupNumberByNumber(solder_silk_layer)] = 1;
- print_group[GetLayerGroupNumberByNumber(component_silk_layer)] = 1;
- for (i = 0; i < max_copper_layer; i++)
- if (print_group[GetLayerGroupNumberByNumber(i)])
- print_layer[i] = 1;
-
- memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack));
+ memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack));
as_shown = options[HA_as_shown].int_value;
if (!options[HA_as_shown].int_value) {
@@ -470,9 +452,9 @@ void png_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
conf_force_set_bool(conf_core.editor.show_solder_side, 0);
conf_force_set_bool(conf_core.editor.show_mask, 0);
- comp_layer = GetLayerGroupNumberByNumber(component_silk_layer);
- solder_layer = GetLayerGroupNumberByNumber(solder_silk_layer);
- qsort(LayerStack, max_copper_layer, sizeof(LayerStack[0]), layer_sort);
+ comp_layer = pcb_layer_get_group(pcb_component_silk_layer);
+ solder_layer = pcb_layer_get_group(pcb_solder_silk_layer);
+ qsort(pcb_layer_stack, pcb_max_copper_layer, sizeof(pcb_layer_stack[0]), layer_sort);
if (photo_mode) {
int i, n = 0;
@@ -481,13 +463,13 @@ void png_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
if (comp_layer < solder_layer)
for (i = comp_layer; i <= solder_layer; i++) {
photo_groups[n++] = i;
- if (i != comp_layer && i != solder_layer && !IsLayerGroupEmpty(i))
+ if (i != comp_layer && i != solder_layer && !pcb_is_layergrp_empty(i))
photo_has_inners = 1;
}
else
for (i = comp_layer; i >= solder_layer; i--) {
photo_groups[n++] = i;
- if (i != comp_layer && i != solder_layer && !IsLayerGroupEmpty(i))
+ if (i != comp_layer && i != solder_layer && !pcb_is_layergrp_empty(i))
photo_has_inners = 1;
}
if (!photo_has_inners) {
@@ -515,16 +497,16 @@ void png_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
if (!photo_mode && conf_core.editor.show_solder_side) {
int i, j;
- for (i = 0, j = max_copper_layer - 1; i < j; i++, j--) {
- int k = LayerStack[i];
- LayerStack[i] = LayerStack[j];
- LayerStack[j] = k;
+ for (i = 0, j = pcb_max_copper_layer - 1; i < j; i++, j--) {
+ int k = pcb_layer_stack[i];
+ pcb_layer_stack[i] = pcb_layer_stack[j];
+ pcb_layer_stack[j] = k;
}
}
- hid_expose_callback(&png_hid, bounds, 0);
+ pcb_hid_expose_callback(&png_hid, bounds, 0);
- memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack));
+ memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack));
conf_update(NULL); /* restore forced sets */
}
@@ -598,11 +580,11 @@ static void ts_bs_sm(gdImagePtr im)
}
}
-static void png_do_export(HID_Attr_Val * options)
+static void png_do_export(pcb_hid_attr_val_t * options)
{
- int save_ons[MAX_LAYER + 2];
+ int save_ons[PCB_MAX_LAYER + 2];
int i;
- BoxType *bbox;
+ pcb_box_t tmp, *bbox;
int w, h;
int xmax, ymax, dpi;
const char *fmt;
@@ -648,7 +630,7 @@ static void png_do_export(HID_Attr_Val * options)
/* figure out width and height of the board */
if (options[HA_only_visible].int_value) {
- bbox = GetDataBoundingBox(PCB->Data);
+ bbox = pcb_data_bbox(&tmp, PCB->Data);
x_shift = bbox->X1;
y_shift = bbox->Y1;
h = bbox->Y2 - bbox->Y1;
@@ -726,7 +708,7 @@ static void png_do_export(HID_Attr_Val * options)
im = gdImageCreate(w, h);
if (im == NULL) {
- Message(PCB_MSG_DEFAULT, "png_do_export(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", w, h);
+ pcb_message(PCB_MSG_ERROR, "png_do_export(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", w, h);
return;
}
@@ -747,7 +729,7 @@ static void png_do_export(HID_Attr_Val * options)
white->a = 0;
white->c = gdImageColorAllocateAlpha(im, white->r, white->g, white->b, white->a);
if (white->c == BADC) {
- Message(PCB_MSG_DEFAULT, "png_do_export(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "png_do_export(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n");
return;
}
@@ -757,7 +739,7 @@ static void png_do_export(HID_Attr_Val * options)
black->r = black->g = black->b = black->a = 0;
black->c = gdImageColorAllocate(im, black->r, black->g, black->b);
if (black->c == BADC) {
- Message(PCB_MSG_DEFAULT, "png_do_export(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "png_do_export(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n");
return;
}
@@ -768,12 +750,12 @@ static void png_do_export(HID_Attr_Val * options)
}
if (!options[HA_as_shown].int_value)
- hid_save_and_show_layer_ons(save_ons);
+ pcb_hid_save_and_show_layer_ons(save_ons);
png_hid_export_to_file(f, options);
if (!options[HA_as_shown].int_value)
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
if (photo_mode) {
int x, y;
@@ -937,85 +919,58 @@ static void png_do_export(HID_Attr_Val * options)
static void png_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(png_attribute_list, sizeof(png_attribute_list) / sizeof(png_attribute_list[0]), png_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(png_attribute_list, sizeof(png_attribute_list) / sizeof(png_attribute_list[0]), png_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
static int is_mask;
static int is_drill;
-static int png_set_layer(const char *name, int group, int empty)
-{
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
- if (name == 0)
- name = PCB->Data->Layer[idx].Name;
-
- doing_outline = 0;
-
- if (idx >= 0 && idx < max_copper_layer && !print_layer[idx])
- return 0;
- if (SL_TYPE(idx) == SL_ASSY || SL_TYPE(idx) == SL_FAB)
- return 0;
-
- if (strcmp(name, "invisible") == 0)
- return 0;
-
- is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- is_mask = (SL_TYPE(idx) == SL_MASK);
-
- if (SL_TYPE(idx) == SL_PASTE)
- return 0;
- if (photo_mode) {
- switch (idx) {
- case SL(SILK, TOP):
+static int png_set_layer_group_photo(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
+{
+ if (((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK) && (flags & PCB_LYT_TOP)) {
if (photo_flip)
return 0;
photo_im = &photo_silk;
- break;
- case SL(SILK, BOTTOM):
+ }
+ else if (((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK) && (flags & PCB_LYT_BOTTOM)) {
if (!photo_flip)
return 0;
photo_im = &photo_silk;
- break;
-
- case SL(MASK, TOP):
+ }
+ else if ((flags & PCB_LYT_MASK) && (flags & PCB_LYT_TOP)) {
if (photo_flip)
return 0;
photo_im = &photo_mask;
- break;
- case SL(MASK, BOTTOM):
+ }
+ else if ((flags & PCB_LYT_MASK) && (flags & PCB_LYT_BOTTOM)) {
if (!photo_flip)
return 0;
photo_im = &photo_mask;
- break;
-
- case SL(PDRILL, 0):
- case SL(UDRILL, 0):
+ }
+ else if ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL)) {
photo_im = &photo_drill;
- break;
-
- default:
- if (idx < 0)
- return 0;
-
- if (strcmp(name, "outline") == 0) {
+ }
+ else {
+ if (flags & PCB_LYT_OUTLINE) {
doing_outline = 1;
have_outline = 0;
photo_im = &photo_outline;
}
- else
+ else if (flags & PCB_LYT_COPPER) {
photo_im = photo_copper + group;
-
- break;
+ }
+ else
+ return 0;
}
if (!*photo_im) {
static color_struct *black = NULL, *white = NULL;
*photo_im = gdImageCreate(gdImageSX(im), gdImageSY(im));
if (photo_im == NULL) {
- Message(PCB_MSG_DEFAULT, "png_set_layer(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", gdImageSX(im), gdImageSY(im));
+ pcb_message(PCB_MSG_ERROR, "png_set_layer(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", gdImageSX(im), gdImageSY(im));
return 0;
}
@@ -1025,7 +980,7 @@ static int png_set_layer(const char *name, int group, int empty)
white->a = 0;
white->c = gdImageColorAllocate(*photo_im, white->r, white->g, white->b);
if (white->c == BADC) {
- Message(PCB_MSG_DEFAULT, "png_set_layer(): gdImageColorAllocate() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "png_set_layer(): gdImageColorAllocate() returned NULL. Aborting export.\n");
return 0;
}
@@ -1033,50 +988,58 @@ static int png_set_layer(const char *name, int group, int empty)
black->r = black->g = black->b = black->a = 0;
black->c = gdImageColorAllocate(*photo_im, black->r, black->g, black->b);
if (black->c == BADC) {
- Message(PCB_MSG_DEFAULT, "png_set_layer(): gdImageColorAllocate() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "png_set_layer(): gdImageColorAllocate() returned NULL. Aborting export.\n");
return 0;
}
- if (idx == SL(PDRILL, 0)
- || idx == SL(UDRILL, 0))
+ if ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL))
gdImageFilledRectangle(*photo_im, 0, 0, gdImageSX(im), gdImageSY(im), black->c);
}
im = *photo_im;
return 1;
- }
+}
+
+static int png_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
+{
+ doing_outline = 0;
+
+ if (flags & PCB_LYT_UI)
+ return 0;
+
+ if ((flags & PCB_LYT_ASSY) || (flags & PCB_LYT_FAB) || (flags & PCB_LYT_PASTE) || (flags & PCB_LYT_INVIS))
+ return 0;
+
+ is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ is_mask = (flags & PCB_LYT_MASK);
+
+ if (photo_mode)
+ return png_set_layer_group_photo(group, layer, flags, is_empty);
if (as_shown) {
- switch (idx) {
- case SL(SILK, TOP):
- case SL(SILK, BOTTOM):
- if (SL_MYSIDE(idx))
+ if ((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK) {
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags))
return PCB->ElementOn;
return 0;
-
- case SL(MASK, TOP):
- case SL(MASK, BOTTOM):
- return conf_core.editor.show_mask && SL_MYSIDE(idx);
}
+
+ if ((flags & PCB_LYT_ANYTHING) == PCB_LYT_MASK)
+ return conf_core.editor.show_mask && PCB_LAYERFLG_ON_VISIBLE_SIDE(flags);
}
else {
if (is_mask)
return 0;
- switch (idx) {
- case SL(SILK, TOP):
- return 1;
- case SL(SILK, BOTTOM):
- return 0;
- }
+ if ((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK)
+ return !!(flags & PCB_LYT_TOP);
}
return 1;
}
-static hidGC png_make_gc(void)
+static pcb_hid_gc_t png_make_gc(void)
{
- hidGC rv = (hidGC) malloc(sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) malloc(sizeof(hid_gc_s));
rv->me_pointer = &png_hid;
rv->cap = Trace_Cap;
rv->width = 1;
@@ -1087,7 +1050,7 @@ static hidGC png_make_gc(void)
return rv;
}
-static void png_destroy_gc(hidGC gc)
+static void png_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -1104,7 +1067,7 @@ static void png_use_mask(int use_it)
if (mask_im == NULL) {
mask_im = gdImageCreate(gdImageSX(im), gdImageSY(im));
if (!mask_im) {
- Message(PCB_MSG_DEFAULT, "png_use_mask(): gdImageCreate(%d, %d) returned NULL. Corrupt export!\n", gdImageSY(im), gdImageSY(im));
+ pcb_message(PCB_MSG_ERROR, "png_use_mask(): gdImageCreate(%d, %d) returned NULL. Corrupt export!\n", gdImageSY(im), gdImageSY(im));
return;
}
gdImagePaletteCopy(mask_im, im);
@@ -1126,9 +1089,9 @@ static void png_use_mask(int use_it)
}
}
-static void png_set_color(hidGC gc, const char *name)
+static void png_set_color(pcb_hid_gc_t gc, const char *name)
{
- hidval cval;
+ pcb_hidval_t cval;
if (im == NULL)
return;
@@ -1148,7 +1111,7 @@ static void png_set_color(hidGC gc, const char *name)
return;
}
- if (hid_cache_color(0, name, &cval, &color_cache)) {
+ if (pcb_hid_cache_color(0, name, &cval, &color_cache)) {
gc->color = (color_struct *) cval.ptr;
}
else if (name[0] == '#') {
@@ -1156,11 +1119,11 @@ static void png_set_color(hidGC gc, const char *name)
sscanf(name + 1, "%2x%2x%2x", &(gc->color->r), &(gc->color->g), &(gc->color->b));
gc->color->c = gdImageColorAllocate(master_im, gc->color->r, gc->color->g, gc->color->b);
if (gc->color->c == BADC) {
- Message(PCB_MSG_DEFAULT, "png_set_color(): gdImageColorAllocate() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "png_set_color(): gdImageColorAllocate() returned NULL. Aborting export.\n");
return;
}
cval.ptr = gc->color;
- hid_cache_color(1, name, &cval, &color_cache);
+ pcb_hid_cache_color(1, name, &cval, &color_cache);
}
else {
printf("WE SHOULD NOT BE HERE!!!\n");
@@ -1169,22 +1132,22 @@ static void png_set_color(hidGC gc, const char *name)
}
-static void png_set_line_cap(hidGC gc, EndCapStyle style)
+static void png_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void png_set_line_width(hidGC gc, Coord width)
+static void png_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void png_set_draw_xor(hidGC gc, int xor_)
+static void png_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
-static void use_gc(hidGC gc)
+static void use_gc(pcb_hid_gc_t gc)
{
int need_brush = 0;
@@ -1204,7 +1167,7 @@ static void use_gc(hidGC gc)
}
if (lastbrush != gc->brush || need_brush) {
- hidval bval;
+ pcb_hidval_t bval;
char name[256];
char type;
int r;
@@ -1231,25 +1194,25 @@ static void use_gc(hidGC gc)
sprintf(name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g, gc->color->b, type, r);
- if (hid_cache_color(0, name, &bval, &brush_cache)) {
+ if (pcb_hid_cache_color(0, name, &bval, &brush_cache)) {
gc->brush = (gdImagePtr) bval.ptr;
}
else {
int bg, fg;
gc->brush = gdImageCreate(r, r);
if (gc->brush == NULL) {
- Message(PCB_MSG_DEFAULT, "use_gc(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", r, r);
+ pcb_message(PCB_MSG_ERROR, "use_gc(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", r, r);
return;
}
bg = gdImageColorAllocate(gc->brush, 255, 255, 255);
if (bg == BADC) {
- Message(PCB_MSG_DEFAULT, "use_gc(): gdImageColorAllocate() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "use_gc(): gdImageColorAllocate() returned NULL. Aborting export.\n");
return;
}
fg = gdImageColorAllocateAlpha(gc->brush, gc->color->r, gc->color->g, gc->color->b, 0);
if (fg == BADC) {
- Message(PCB_MSG_DEFAULT, "use_gc(): gdImageColorAllocate() returned NULL. Aborting export.\n");
+ pcb_message(PCB_MSG_ERROR, "use_gc(): gdImageColorAllocate() returned NULL. Aborting export.\n");
return;
}
gdImageColorTransparent(gc->brush, bg);
@@ -1273,7 +1236,7 @@ static void use_gc(hidGC gc)
gdImageFilledRectangle(gc->brush, 0, 0, r - 1, r - 1, fg);
}
bval.ptr = gc->brush;
- hid_cache_color(1, name, &bval, &brush_cache);
+ pcb_hid_cache_color(1, name, &bval, &brush_cache);
}
gdImageSetBrush(im, gc->brush);
@@ -1282,25 +1245,25 @@ static void use_gc(hidGC gc)
}
}
-static void png_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void png_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
gdImageRectangle(im, SCALE_X(x1), SCALE_Y(y1), SCALE_X(x2), SCALE_Y(y2), gc->color->c);
}
-static void png_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void png_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
gdImageSetThickness(im, 0);
linewidth = 0;
if (x1 > x2) {
- Coord t = x1;
+ pcb_coord_t t = x1;
x2 = x2;
x2 = t;
}
if (y1 > y2) {
- Coord t = y1;
+ pcb_coord_t t = y1;
y2 = y2;
y2 = t;
}
@@ -1312,10 +1275,10 @@ static void png_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
have_outline |= doing_outline;
}
-static void png_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void png_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
if (x1 == x2 && y1 == y2) {
- Coord w = gc->width / 2;
+ pcb_coord_t w = gc->width / 2;
if (gc->cap != Square_Cap)
png_fill_circle(gc, x1, y1, w);
else
@@ -1371,17 +1334,17 @@ static void png_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
}
-static void png_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void png_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- Angle sa, ea;
+ pcb_angle_t sa, ea;
/*
* zero angle arcs need special handling as gd will output either
* nothing at all or a full circle when passed delta angle of 0 or 360.
*/
if (delta_angle == 0) {
- Coord x = (width * cos(start_angle * M_PI / 180));
- Coord y = (width * sin(start_angle * M_PI / 180));
+ pcb_coord_t x = (width * cos(start_angle * M_PI / 180));
+ pcb_coord_t y = (width * sin(start_angle * M_PI / 180));
x = cx - x;
y = cy + y;
png_fill_circle(gc, x, y, gc->width / 2);
@@ -1411,8 +1374,8 @@ static void png_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height
* make sure we start between 0 and 360 otherwise gd does
* strange things
*/
- sa = NormalizeAngle(sa);
- ea = NormalizeAngle(ea);
+ sa = pcb_normalize_angle(sa);
+ ea = pcb_normalize_angle(ea);
have_outline |= doing_outline;
@@ -1427,9 +1390,9 @@ static void png_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height
gdImageArc(im, SCALE_X(cx), SCALE_Y(cy), SCALE(2 * width), SCALE(2 * height), sa, ea, gdBrushed);
}
-static void png_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void png_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
- Coord my_bloat;
+ pcb_coord_t my_bloat;
use_gc(gc);
@@ -1447,7 +1410,7 @@ static void png_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
}
-static void png_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void png_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
gdPoint *points;
@@ -1483,7 +1446,7 @@ static void png_set_crosshair(int x, int y, int a)
static int png_usage(const char *topic)
{
fprintf(stderr, "\npng exporter command line arguments:\n\n");
- hid_usage(png_attribute_list, sizeof(png_attribute_list) / sizeof(png_attribute_list[0]));
+ pcb_hid_usage(png_attribute_list, sizeof(png_attribute_list) / sizeof(png_attribute_list[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x png foo.pcb [png options]\n\n");
return 0;
}
@@ -1492,12 +1455,12 @@ static int png_usage(const char *topic)
pcb_uninit_t hid_export_png_init()
{
- memset(&png_hid, 0, sizeof(HID));
+ memset(&png_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&png_hid);
- common_draw_helpers_init(&png_hid);
+ pcb_hid_nogui_init(&png_hid);
+ pcb_dhlp_draw_helpers_init(&png_hid);
- png_hid.struct_size = sizeof(HID);
+ png_hid.struct_size = sizeof(pcb_hid_t);
png_hid.name = "png";
png_hid.description = "GIF/JPEG/PNG export";
png_hid.exporter = 1;
@@ -1506,7 +1469,7 @@ pcb_uninit_t hid_export_png_init()
png_hid.get_export_options = png_get_export_options;
png_hid.do_export = png_do_export;
png_hid.parse_arguments = png_parse_arguments;
- png_hid.set_layer = png_set_layer;
+ png_hid.set_layer_group = png_set_layer_group;
png_hid.make_gc = png_make_gc;
png_hid.destroy_gc = png_destroy_gc;
png_hid.use_mask = png_use_mask;
@@ -1526,7 +1489,7 @@ pcb_uninit_t hid_export_png_init()
png_hid.usage = png_usage;
#ifdef HAVE_SOME_FORMAT
- hid_register_hid(&png_hid);
+ pcb_hid_register_hid(&png_hid);
#endif
return NULL;
diff --git a/src_plugins/export_png/png.h b/src_plugins/export_png/png.h
index 4192fd1..3cf45c1 100644
--- a/src_plugins/export_png/png.h
+++ b/src_plugins/export_png/png.h
@@ -1,2 +1,2 @@
extern const char *png_cookie;
-extern void png_hid_export_to_file(FILE *, HID_Attr_Val *);
+extern void png_hid_export_to_file(FILE *, pcb_hid_attr_val_t *);
diff --git a/src_plugins/export_ps/Makefile b/src_plugins/export_ps/Makefile
index c1dd95c..f8ee0a4 100644
--- a/src_plugins/export_ps/Makefile
+++ b/src_plugins/export_ps/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_ps
+ cd ../../src && $(MAKE) mod_export_ps
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_ps/eps.c b/src_plugins/export_ps/eps.c
index 917ceeb..f9dc1c0 100644
--- a/src_plugins/export_ps/eps.c
+++ b/src_plugins/export_ps/eps.c
@@ -7,10 +7,10 @@
#include <string.h>
#include <assert.h>
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
#include "layer.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "hid.h"
@@ -28,45 +28,45 @@
/*----------------------------------------------------------------------------*/
/* Function prototypes */
/*----------------------------------------------------------------------------*/
-static HID_Attribute *eps_get_export_options(int *n);
-static void eps_do_export(HID_Attr_Val * options);
+static pcb_hid_attribute_t *eps_get_export_options(int *n);
+static void eps_do_export(pcb_hid_attr_val_t * options);
static void eps_parse_arguments(int *argc, char ***argv);
-static int eps_set_layer(const char *name, int group, int empty);
-static hidGC eps_make_gc(void);
-static void eps_destroy_gc(hidGC gc);
+static int eps_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty);
+static pcb_hid_gc_t eps_make_gc(void);
+static void eps_destroy_gc(pcb_hid_gc_t gc);
static void eps_use_mask(int use_it);
-static void eps_set_color(hidGC gc, const char *name);
-static void eps_set_line_cap(hidGC gc, EndCapStyle style);
-static void eps_set_line_width(hidGC gc, Coord width);
-static void eps_set_draw_xor(hidGC gc, int _xor);
-static void eps_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void eps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void eps_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle);
-static void eps_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void eps_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
-static void eps_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y);
+static void eps_set_color(pcb_hid_gc_t gc, const char *name);
+static void eps_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style);
+static void eps_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width);
+static void eps_set_draw_xor(pcb_hid_gc_t gc, int _xor);
+static void eps_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void eps_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void eps_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle);
+static void eps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
+static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y);
static void eps_calibrate(double xval, double yval);
static void eps_set_crosshair(int x, int y, int action);
/*----------------------------------------------------------------------------*/
-typedef struct hid_gc_struct {
- EndCapStyle cap;
- Coord width;
+typedef struct hid_gc_s {
+ pcb_cap_style_t cap;
+ pcb_coord_t width;
int color;
int erase;
-} hid_gc_struct;
+} hid_gc_s;
-static HID eps_hid;
+static pcb_hid_t eps_hid;
static FILE *f = 0;
-static Coord linewidth = -1;
+static pcb_coord_t linewidth = -1;
static int lastcap = -1;
static int lastcolor = -1;
-static int print_group[MAX_LAYER];
-static int print_layer[MAX_LAYER];
+static int print_group[PCB_MAX_LAYERGRP];
+static int print_layer[PCB_MAX_LAYER];
static int fast_erase = -1;
-static HID_Attribute eps_attribute_list[] = {
+static pcb_hid_attribute_t eps_attribute_list[] = {
/* other HIDs expect this to be first. */
/* %start-doc options "92 Encapsulated Postscript Export"
@@ -129,16 +129,16 @@ Limit the bounds of the EPS file to the visible items.
#define NUM_OPTIONS (sizeof(eps_attribute_list)/sizeof(eps_attribute_list[0]))
-REGISTER_ATTRIBUTES(eps_attribute_list, ps_cookie)
+PCB_REGISTER_ATTRIBUTES(eps_attribute_list, ps_cookie)
- static HID_Attr_Val eps_values[NUM_OPTIONS];
+ static pcb_hid_attr_val_t eps_values[NUM_OPTIONS];
- static HID_Attribute *eps_get_export_options(int *n)
+ static pcb_hid_attribute_t *eps_get_export_options(int *n)
{
static char *last_made_filename = 0;
if (PCB)
- derive_default_filename(PCB->Filename, &eps_attribute_list[HA_psfile], ".eps", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &eps_attribute_list[HA_psfile], ".eps", &last_made_filename);
if (n)
*n = NUM_OPTIONS;
@@ -147,12 +147,12 @@ REGISTER_ATTRIBUTES(eps_attribute_list, ps_cookie)
static int comp_layer, solder_layer;
-static int group_for_layer(int l)
+static pcb_layergrp_id_t group_for_layer(int l)
{
- if (l < max_copper_layer + 2 && l >= 0)
- return GetLayerGroupNumberByNumber(l);
+ if (l < pcb_max_copper_layer + 2 && l >= 0)
+ return pcb_layer_get_group(l);
/* else something unique */
- return max_group + 3 + l;
+ return pcb_max_group + 3 + l;
}
static int layer_sort(const void *va, const void *vb)
@@ -163,7 +163,7 @@ static int layer_sort(const void *va, const void *vb)
int bl = group_for_layer(b);
int d = bl - al;
- if (a >= 0 && a <= max_copper_layer + 1) {
+ if (a >= 0 && a <= pcb_max_copper_layer + 1) {
int aside = (al == solder_layer ? 0 : al == comp_layer ? 2 : 1);
int bside = (bl == solder_layer ? 0 : bl == comp_layer ? 2 : 1);
if (bside != aside)
@@ -175,14 +175,14 @@ static int layer_sort(const void *va, const void *vb)
}
static const char *filename;
-static BoxType *bounds;
+static pcb_box_t *bounds;
static int in_mono, as_shown;
-void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
+void eps_hid_export_to_file(FILE * the_file, pcb_hid_attr_val_t * options)
{
int i;
- static int saved_layer_stack[MAX_LAYER];
- BoxType region;
+ static int saved_layer_stack[PCB_MAX_LAYER];
+ pcb_box_t tmp, region;
conf_force_set_bool(conf_core.editor.thin_draw, 0);
conf_force_set_bool(conf_core.editor.thin_draw_poly, 0);
@@ -196,7 +196,7 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
region.Y2 = PCB->MaxHeight;
if (options[HA_only_visible].int_value)
- bounds = GetDataBoundingBox(PCB->Data);
+ bounds = pcb_data_bbox(&tmp, PCB->Data);
else
bounds = ®ion;
@@ -204,25 +204,25 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
memset(print_layer, 0, sizeof(print_layer));
/* Figure out which layers actually have stuff on them. */
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *layer = PCB->Data->Layer + i;
+ for (i = 0; i < pcb_max_copper_layer; i++) {
+ pcb_layer_t *layer = PCB->Data->Layer + i;
if (layer->On)
- if (!LAYER_IS_EMPTY(layer))
- print_group[GetLayerGroupNumberByNumber(i)] = 1;
+ if (!PCB_LAYER_IS_EMPTY(layer))
+ print_group[pcb_layer_get_group(i)] = 1;
}
/* Now, if only one layer has real stuff on it, we can use the fast
erase logic. Otherwise, we have to use the expensive multi-mask
erase. */
fast_erase = 0;
- for (i = 0; i < max_group; i++)
+ for (i = 0; i < pcb_max_group; i++)
if (print_group[i])
fast_erase++;
/* If NO layers had anything on them, at least print the component
layer to get the pins. */
if (fast_erase == 0) {
- print_group[GetLayerGroupNumberByNumber(component_silk_layer)] = 1;
+ print_group[pcb_layer_get_group(pcb_component_silk_layer)] = 1;
fast_erase = 1;
}
@@ -231,8 +231,8 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
/* Now, for each group we're printing, mark its layers for
printing. */
- for (i = 0; i < max_copper_layer; i++)
- if (print_group[GetLayerGroupNumberByNumber(i)])
+ for (i = 0; i < pcb_max_copper_layer; i++)
+ if (print_group[pcb_layer_get_group(i)])
print_layer[i] = 1;
if (fast_erase) {
@@ -244,12 +244,12 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
eps_hid.poly_after = 1;
}
- memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack));
+ memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack));
as_shown = options[HA_as_shown].int_value;
if (!options[HA_as_shown].int_value) {
- comp_layer = GetLayerGroupNumberByNumber(component_silk_layer);
- solder_layer = GetLayerGroupNumberByNumber(solder_silk_layer);
- qsort(LayerStack, max_copper_layer, sizeof(LayerStack[0]), layer_sort);
+ comp_layer = pcb_layer_get_group(pcb_component_silk_layer);
+ solder_layer = pcb_layer_get_group(pcb_solder_silk_layer);
+ qsort(pcb_layer_stack, pcb_max_copper_layer, sizeof(pcb_layer_stack[0]), layer_sort);
}
fprintf(f, "%%!PS-Adobe-3.0 EPSF-3.0\n");
linewidth = -1;
@@ -276,7 +276,7 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
linewidth = -1;
lastcap = -1;
lastcolor = -1;
-#define Q (Coord) PCB_MIL_TO_COORD(10)
+#define Q (pcb_coord_t) PCB_MIL_TO_COORD(10)
pcb_fprintf(f,
"/nclip { %mi %mi moveto %mi %mi lineto %mi %mi lineto %mi %mi lineto %mi %mi lineto eoclip newpath } def\n",
bounds->X1 - Q, bounds->Y1 - Q, bounds->X1 - Q, bounds->Y2 + Q,
@@ -290,7 +290,7 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
fprintf(f, "/cc { 0 360 arc nclip } bind def\n");
fprintf(f, "/a { gsave setlinewidth translate scale 0 0 1 5 3 roll arc stroke grestore} bind def\n");
- hid_expose_callback(&eps_hid, bounds, 0);
+ pcb_hid_expose_callback(&eps_hid, bounds, 0);
fprintf(f, "showpage\n");
@@ -299,14 +299,14 @@ void eps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
fprintf(f, "cleartomark countdictstack exch sub { end } repeat restore\n");
fprintf(f, "%%%%EOF\n");
- memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack));
+ memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack));
conf_update(NULL); /* restore forced sets */
}
-static void eps_do_export(HID_Attr_Val * options)
+static void eps_do_export(pcb_hid_attr_val_t * options)
{
int i;
- int save_ons[MAX_LAYER + 2];
+ int save_ons[PCB_MAX_LAYER + 2];
if (!options) {
eps_get_export_options(0);
@@ -326,81 +326,78 @@ static void eps_do_export(HID_Attr_Val * options)
}
if (!options[HA_as_shown].int_value)
- hid_save_and_show_layer_ons(save_ons);
+ pcb_hid_save_and_show_layer_ons(save_ons);
eps_hid_export_to_file(f, options);
if (!options[HA_as_shown].int_value)
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
fclose(f);
}
static void eps_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(eps_attribute_list, sizeof(eps_attribute_list) / sizeof(eps_attribute_list[0]), ps_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(eps_attribute_list, sizeof(eps_attribute_list) / sizeof(eps_attribute_list[0]), ps_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
static int is_mask;
static int is_paste;
static int is_drill;
-static int eps_set_layer(const char *name, int group, int empty)
+static int eps_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- int idx = (group >= 0 && group < max_group) ? PCB->LayerGroups.Entries[group][0] : group;
- if (name == 0)
- name = PCB->Data->Layer[idx].Name;
+ char tmp_ln[PCB_PATH_MAX];
+ const char *name;
- if (idx >= 0 && idx < max_copper_layer && !print_layer[idx])
+ if (flags & PCB_LYT_UI)
return 0;
- if (SL_TYPE(idx) == SL_ASSY || SL_TYPE(idx) == SL_FAB)
+
+ if ((flags & PCB_LYT_ASSY) || (flags & PCB_LYT_FAB) || (flags & PCB_LYT_INVIS))
return 0;
- if (strcmp(name, "invisible") == 0)
+ if ((group >= 0) && pcb_is_layergrp_empty(group))
return 0;
- is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- is_mask = (SL_TYPE(idx) == SL_MASK);
- is_paste = (SL_TYPE(idx) == SL_PASTE);
+ is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ is_mask = (flags & PCB_LYT_MASK);
+ is_paste = !!(flags & PCB_LYT_PASTE);
if (is_mask || is_paste)
return 0;
+
+ name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed);
+
#if 0
printf("Layer %s group %d drill %d mask %d\n", name, group, is_drill, is_mask);
#endif
- fprintf(f, "%% Layer %s group %d drill %d mask %d\n", name, group, is_drill, is_mask);
+ fprintf(f, "%% Layer %s group %ld drill %d mask %d\n", name, group, is_drill, is_mask);
if (as_shown) {
- switch (idx) {
- case SL(SILK, TOP):
- case SL(SILK, BOTTOM):
- if (SL_MYSIDE(idx))
- return PCB->ElementOn;
- else
- return 0;
- }
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags))
+ return PCB->ElementOn;
+ else
+ return 0;
}
else {
- switch (idx) {
- case SL(SILK, TOP):
+ if (((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK) && (flags & PCB_LYT_TOP))
return 1;
- case SL(SILK, BOTTOM):
+ if (((flags & PCB_LYT_ANYTHING) == PCB_LYT_SILK) && (flags & PCB_LYT_BOTTOM))
return 0;
- }
}
return 1;
}
-static hidGC eps_make_gc(void)
+static pcb_hid_gc_t eps_make_gc(void)
{
- hidGC rv = (hidGC) malloc(sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) malloc(sizeof(hid_gc_s));
rv->cap = Trace_Cap;
rv->width = 0;
rv->color = 0;
return rv;
}
-static void eps_destroy_gc(hidGC gc)
+static void eps_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -427,10 +424,10 @@ static void eps_use_mask(int use_it)
}
}
-static void eps_set_color(hidGC gc, const char *name)
+static void eps_set_color(pcb_hid_gc_t gc, const char *name)
{
static void *cache = 0;
- hidval cval;
+ pcb_hidval_t cval;
if (strcmp(name, "erase") == 0) {
gc->color = 0xffffff;
@@ -443,7 +440,7 @@ static void eps_set_color(hidGC gc, const char *name)
return;
}
gc->erase = 0;
- if (hid_cache_color(0, name, &cval, &cache)) {
+ if (pcb_hid_cache_color(0, name, &cval, &cache)) {
gc->color = cval.lval;
}
else if (in_mono) {
@@ -458,22 +455,22 @@ static void eps_set_color(hidGC gc, const char *name)
gc->color = 0;
}
-static void eps_set_line_cap(hidGC gc, EndCapStyle style)
+static void eps_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void eps_set_line_width(hidGC gc, Coord width)
+static void eps_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void eps_set_draw_xor(hidGC gc, int xor_)
+static void eps_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
-static void use_gc(hidGC gc)
+static void use_gc(pcb_hid_gc_t gc)
{
if (linewidth != gc->width) {
pcb_fprintf(f, "%mi setlinewidth\n", gc->width);
@@ -502,18 +499,18 @@ static void use_gc(hidGC gc)
}
}
-static void eps_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void eps_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
+static void eps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
-static void eps_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void eps_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
pcb_fprintf(f, "%mi %mi %mi %mi r\n", x1, y1, x2, y2);
}
-static void eps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void eps_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- Coord w = gc->width / 2;
+ pcb_coord_t w = gc->width / 2;
if (x1 == x2 && y1 == y2) {
if (gc->cap == Square_Cap)
eps_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w);
@@ -527,8 +524,8 @@ static void eps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
double dx = w * sin(ang);
double dy = -w * cos(ang);
double deg = ang * 180.0 / M_PI;
- Coord vx1 = x1 + dx;
- Coord vy1 = y1 + dy;
+ pcb_coord_t vx1 = x1 + dx;
+ pcb_coord_t vy1 = y1 + dy;
pcb_fprintf(f, "%mi %mi moveto ", vx1, vy1);
pcb_fprintf(f, "%mi %mi %mi %g %g arc\n", x2, y2, w, deg - 90, deg + 90);
@@ -540,9 +537,9 @@ static void eps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
pcb_fprintf(f, "%mi %mi %mi %mi %s\n", x1, y1, x2, y2, gc->erase ? "tc" : "t");
}
-static void eps_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void eps_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- Angle sa, ea;
+ pcb_angle_t sa, ea;
if (delta_angle > 0) {
sa = start_angle;
ea = start_angle + delta_angle;
@@ -558,13 +555,13 @@ static void eps_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height
pcb_fprintf(f, "%ma %ma %mi %mi %mi %mi %g a\n", sa, ea, -width, height, cx, cy, (double) linewidth / width);
}
-static void eps_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
use_gc(gc);
pcb_fprintf(f, "%mi %mi %mi %s\n", cx, cy, radius, gc->erase ? "cc" : "c");
}
-static void eps_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
const char *op = "moveto";
@@ -576,7 +573,7 @@ static void eps_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
fprintf(f, "fill\n");
}
-static void eps_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void eps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
pcb_fprintf(f, "%mi %mi %mi %mi r\n", x1, y1, x2, y2);
@@ -594,19 +591,19 @@ static void eps_set_crosshair(int x, int y, int action)
static int eps_usage(const char *topic)
{
fprintf(stderr, "\neps exporter command line arguments:\n\n");
- hid_usage(eps_attribute_list, sizeof(eps_attribute_list) / sizeof(eps_attribute_list[0]));
+ pcb_hid_usage(eps_attribute_list, sizeof(eps_attribute_list) / sizeof(eps_attribute_list[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x eps foo.pcb [eps options]\n\n");
return 0;
}
void hid_eps_init()
{
- memset(&eps_hid, 0, sizeof(HID));
+ memset(&eps_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&eps_hid);
- common_draw_helpers_init(&eps_hid);
+ pcb_hid_nogui_init(&eps_hid);
+ pcb_dhlp_draw_helpers_init(&eps_hid);
- eps_hid.struct_size = sizeof(HID);
+ eps_hid.struct_size = sizeof(pcb_hid_t);
eps_hid.name = "eps";
eps_hid.description = "Encapsulated Postscript";
eps_hid.exporter = 1;
@@ -615,7 +612,7 @@ void hid_eps_init()
eps_hid.get_export_options = eps_get_export_options;
eps_hid.do_export = eps_do_export;
eps_hid.parse_arguments = eps_parse_arguments;
- eps_hid.set_layer = eps_set_layer;
+ eps_hid.set_layer_group = eps_set_layer_group;
eps_hid.make_gc = eps_make_gc;
eps_hid.destroy_gc = eps_destroy_gc;
eps_hid.use_mask = eps_use_mask;
@@ -634,5 +631,5 @@ void hid_eps_init()
eps_hid.usage = eps_usage;
- hid_register_hid(&eps_hid);
+ pcb_hid_register_hid(&eps_hid);
}
diff --git a/src_plugins/export_ps/ps.c b/src_plugins/export_ps/ps.c
index 4522010..f52b8ab 100644
--- a/src_plugins/export_ps/ps.c
+++ b/src_plugins/export_ps/ps.c
@@ -11,9 +11,9 @@
#include <assert.h> /* not used */
#include <time.h>
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
-#include "misc.h"
#include "layer.h"
#include "error.h"
#include "draw.h"
@@ -25,28 +25,28 @@
#include "hid_nogui.h"
#include "hid_draw_helpers.h"
#include "ps.h"
-#include "draw_fab.h"
#include "hid_init.h"
#include "hid_attrib.h"
-#include "hid_helper.h"
#include "hid_flags.h"
#include "hid_actions.h"
#include "conf_core.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "stub_draw_fab.h"
const char *ps_cookie = "ps HID";
-static int ps_set_layer(const char *name, int group, int empty);
-static void use_gc(hidGC gc);
+static int ps_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty);
+static void use_gc(pcb_hid_gc_t gc);
-typedef struct hid_gc_struct {
- HID *me_pointer;
- EndCapStyle cap;
- Coord width;
+typedef struct hid_gc_s {
+ pcb_hid_t *me_pointer;
+ pcb_cap_style_t cap;
+ pcb_coord_t width;
unsigned char r, g, b;
int erase;
int faded;
-} hid_gc_struct;
+} hid_gc_s;
static const char *medias[] = {
"A0", "A1", "A2", "A3", "A4", "A5",
@@ -63,8 +63,8 @@ static const char *medias[] = {
typedef struct {
const char *name;
- Coord Width, Height;
- Coord MarginX, MarginY;
+ pcb_coord_t Width, Height;
+ pcb_coord_t MarginX, MarginY;
} MediaType, *MediaTypePtr;
/*
@@ -143,7 +143,7 @@ static MediaType media_data[] = {
#undef MARGINX
#undef MARGINY
-HID_Attribute ps_attribute_list[] = {
+pcb_hid_attribute_t ps_attribute_list[] = {
/* other HIDs expect this to be first. */
/* %start-doc options "91 Postscript Export"
@@ -370,7 +370,7 @@ If non-zero grid polygons instead of filling them with gridlines spaced as speci
#define NUM_OPTIONS (sizeof(ps_attribute_list)/sizeof(ps_attribute_list[0]))
-REGISTER_ATTRIBUTES(ps_attribute_list, ps_cookie)
+PCB_REGISTER_ATTRIBUTES(ps_attribute_list, ps_cookie)
/* All file-scope data is in global struct */
static struct {
@@ -378,12 +378,10 @@ static struct {
FILE *f;
int pagecount;
- Coord linewidth;
- pcb_bool print_group[MAX_LAYER];
- pcb_bool print_layer[MAX_LAYER];
+ pcb_coord_t linewidth;
double fade_ratio;
pcb_bool multi_file;
- Coord media_width, media_height, ps_width, ps_height;
+ pcb_coord_t media_width, media_height, ps_width, ps_height;
const char *filename;
pcb_bool drill_helper;
@@ -394,19 +392,19 @@ static struct {
pcb_bool automirror;
pcb_bool incolor;
pcb_bool doing_toc;
- Coord bloat;
+ pcb_coord_t bloat;
pcb_bool invert;
int media_idx;
pcb_bool drillcopper;
pcb_bool legend;
- LayerTypePtr outline_layer;
+ pcb_layer_t *outline_layer;
double scale_factor;
- BoxType region;
+ pcb_box_t region;
- HID_Attr_Val ps_values[NUM_OPTIONS];
+ pcb_hid_attr_val_t ps_values[NUM_OPTIONS];
pcb_bool is_mask;
pcb_bool is_drill;
@@ -417,23 +415,23 @@ static struct {
double polygrid;
} global;
-static HID_Attribute *ps_get_export_options(int *n)
+static pcb_hid_attribute_t *ps_get_export_options(int *n)
{
static char *last_made_filename = 0;
if (PCB)
- derive_default_filename(PCB->Filename, &ps_attribute_list[HA_psfile], ".ps", &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &ps_attribute_list[HA_psfile], ".ps", &last_made_filename);
if (n)
*n = NUM_OPTIONS;
return ps_attribute_list;
}
-static int group_for_layer(int l)
+static pcb_layergrp_id_t group_for_layer(int l)
{
- if (l < max_copper_layer + 2 && l >= 0)
- return GetLayerGroupNumberByNumber(l);
+ if (l < pcb_max_copper_layer + 2 && l >= 0)
+ return pcb_layer_get_group(l);
/* else something unique */
- return max_group + 3 + l;
+ return pcb_max_group + 3 + l;
}
static int layer_sort(const void *va, const void *vb)
@@ -596,10 +594,10 @@ static FILE *psopen(const char *base, const char *which)
/* This is used by other HIDs that use a postscript format, like lpr
or eps. */
-void ps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
+void ps_hid_export_to_file(FILE * the_file, pcb_hid_attr_val_t * options)
{
- int i;
- static int saved_layer_stack[MAX_LAYER];
+ static int saved_layer_stack[PCB_MAX_LAYER];
+ pcb_layer_id_t lid;
conf_force_set_bool(conf_core.editor.thin_draw, 0);
conf_force_set_bool(conf_core.editor.thin_draw_poly, 0);
@@ -644,32 +642,19 @@ void ps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
global.scale_factor *= MIN(zx, zy);
}
- memset(global.print_group, 0, sizeof(global.print_group));
- memset(global.print_layer, 0, sizeof(global.print_layer));
-
- global.outline_layer = NULL;
-
- for (i = 0; i < max_copper_layer; i++) {
- LayerType *layer = PCB->Data->Layer + i;
- if (!LAYER_IS_EMPTY(layer))
- global.print_group[GetLayerGroupNumberByNumber(i)] = 1;
-
- if (strcmp(layer->Name, "outline") == 0 || strcmp(layer->Name, "route") == 0) {
- global.outline_layer = layer;
- }
- }
- global.print_group[GetLayerGroupNumberByNumber(solder_silk_layer)] = 1;
- global.print_group[GetLayerGroupNumberByNumber(component_silk_layer)] = 1;
- for (i = 0; i < max_copper_layer; i++)
- if (global.print_group[GetLayerGroupNumberByNumber(i)])
- global.print_layer[i] = 1;
+ lid = -1;
+ pcb_layer_list(PCB_LYT_OUTLINE, &lid, 1);
+ if (lid >= 0)
+ global.outline_layer = pcb_get_layer(lid);
+ else
+ global.outline_layer = NULL;
- memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack));
- qsort(LayerStack, max_copper_layer, sizeof(LayerStack[0]), layer_sort);
+ memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack));
+ qsort(pcb_layer_stack, pcb_max_copper_layer, sizeof(pcb_layer_stack[0]), layer_sort);
global.linewidth = -1;
/* reset static vars */
- ps_set_layer(NULL, 0, -1);
+ ps_set_layer_group(-1, -1, 0, -1);
use_gc(NULL);
global.region.X1 = 0;
@@ -686,26 +671,26 @@ void ps_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
fprintf(the_file, "/tocp { /y y 12 sub def 90 y moveto rightshow } bind def\n");
global.doing_toc = 1;
- global.pagecount = 1; /* 'pagecount' is modified by hid_expose_callback() call */
- hid_expose_callback(&ps_hid, &global.region, 0);
+ global.pagecount = 1; /* 'pagecount' is modified by pcb_hid_expose_callback() call */
+ pcb_hid_expose_callback(&ps_hid, &global.region, 0);
}
global.pagecount = 1; /* Reset 'pagecount' if single file */
global.doing_toc = 0;
- ps_set_layer(NULL, 0, -1); /* reset static vars */
- hid_expose_callback(&ps_hid, &global.region, 0);
+ ps_set_layer_group(-1, -1, 0, -1); /* reset static vars */
+ pcb_hid_expose_callback(&ps_hid, &global.region, 0);
if (the_file)
fprintf(the_file, "showpage\n");
- memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack));
+ memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack));
conf_update(NULL); /* restore forced sets */
}
-static void ps_do_export(HID_Attr_Val * options)
+static void ps_do_export(pcb_hid_attr_val_t * options)
{
FILE *fh;
- int save_ons[MAX_LAYER + 2];
+ int save_ons[PCB_MAX_LAYER + 2];
int i;
if (!options) {
@@ -731,9 +716,9 @@ static void ps_do_export(HID_Attr_Val * options)
}
}
- hid_save_and_show_layer_ons(save_ons);
+ pcb_hid_save_and_show_layer_ons(save_ons);
ps_hid_export_to_file(fh, options);
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
global.multi_file = 0;
if (fh) {
@@ -744,15 +729,15 @@ static void ps_do_export(HID_Attr_Val * options)
static void ps_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(ps_attribute_list, NUM_OPTIONS, ps_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(ps_attribute_list, NUM_OPTIONS, ps_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-static void corner(FILE * fh, Coord x, Coord y, Coord dx, Coord dy)
+static void corner(FILE * fh, pcb_coord_t x, pcb_coord_t y, pcb_coord_t dx, pcb_coord_t dy)
{
- Coord len = PCB_MIL_TO_COORD(2000);
- Coord len2 = PCB_MIL_TO_COORD(200);
- Coord thick = 0;
+ pcb_coord_t len = PCB_MIL_TO_COORD(2000);
+ pcb_coord_t len2 = PCB_MIL_TO_COORD(200);
+ pcb_coord_t thick = 0;
/*
* Originally 'thick' used thicker lines. Currently is uses
* Postscript's "device thin" line - i.e. zero width means one
@@ -769,32 +754,39 @@ static void corner(FILE * fh, Coord x, Coord y, Coord dx, Coord dy)
fprintf(fh, "stroke grestore\n");
}
-static int ps_set_layer(const char *name, int group, int empty)
+static int ps_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
+ char tmp_fn[PCB_PATH_MAX];
+ char tmp_ln[PCB_PATH_MAX];
static int lastgroup = -1;
time_t currenttime;
- int idx = (group >= 0 && group < max_group)
- ? PCB->LayerGroups.Entries[group][0]
- : group;
- if (name == 0)
- name = PCB->Data->Layer[idx].Name;
+ const char *name;
- if (empty == -1)
+ if (is_empty == -1) {
lastgroup = -1;
- if (empty)
+ return 0;
+ }
+
+ if (flags & PCB_LYT_UI)
return 0;
- if (idx >= 0 && idx < max_copper_layer && !global.print_layer[idx])
+ if (is_empty)
return 0;
- if (strcmp(name, "invisible") == 0)
+ if ((group >= 0) && pcb_is_layergrp_empty(group))
return 0;
- global.is_drill = (SL_TYPE(idx) == SL_PDRILL || SL_TYPE(idx) == SL_UDRILL);
- global.is_mask = (SL_TYPE(idx) == SL_MASK);
- global.is_assy = (SL_TYPE(idx) == SL_ASSY);
- global.is_copper = (SL_TYPE(idx) == 0);
- global.is_paste = (SL_TYPE(idx) == SL_PASTE);
+ if (flags & PCB_LYT_INVIS)
+ return 0;
+
+ name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed);
+
+ global.is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL));
+ global.is_mask = !!(flags & PCB_LYT_MASK);
+ global.is_assy = !!(flags & PCB_LYT_ASSY);
+ global.is_copper = !!(flags & PCB_LYT_COPPER);
+ global.is_paste = !!(flags & PCB_LYT_PASTE);
+
#if 0
printf("Layer %s group %d drill %d mask %d\n", name, group, global.is_drill, global.is_mask);
#endif
@@ -834,7 +826,7 @@ static int ps_set_layer(const char *name, int group, int empty)
ps_end_file(global.f);
fclose(global.f);
}
- global.f = psopen(global.filename, layer_type_to_file_name(idx, FNS_fixed));
+ global.f = psopen(global.filename, pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed));
if (!global.f) {
perror(global.filename);
return 0;
@@ -851,21 +843,20 @@ static int ps_set_layer(const char *name, int group, int empty)
* ordinal page number must reflect the position of that page in
* the body of the PostScript file and must start with 1, not 0.
*/
- fprintf(global.f, "%%%%Page: %s %d\n", layer_type_to_file_name(idx, FNS_fixed), global.pagecount);
+ fprintf(global.f, "%%%%Page: %s %d\n", pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed), global.pagecount);
if (global.mirror)
mirror_this = !mirror_this;
- if (global.automirror && ((idx >= 0 && group == GetLayerGroupNumberByNumber(solder_silk_layer))
- || (idx < 0 && SL_SIDE(idx) == SL_BOTTOM_SIDE)))
+ if (global.automirror && (flags & PCB_LYT_BOTTOM))
mirror_this = !mirror_this;
fprintf(global.f, "/Helvetica findfont 10 scalefont setfont\n");
if (global.legend) {
fprintf(global.f, "30 30 moveto (%s) show\n", PCB->Filename);
if (PCB->Name)
- fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->Name, layer_type_to_file_name(idx, FNS_fixed));
+ fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->Name, pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed));
else
- fprintf(global.f, "30 41 moveto (%s) show\n", layer_type_to_file_name(idx, FNS_fixed));
+ fprintf(global.f, "30 41 moveto (%s) show\n", pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed));
if (mirror_this)
fprintf(global.f, "( \\(mirrored\\)) show\n");
@@ -890,16 +881,16 @@ static int ps_set_layer(const char *name, int group, int empty)
if (mirror_this)
fprintf(global.f, "1 -1 scale\n");
- fprintf(global.f, "%g dup neg scale\n", (SL_TYPE(idx) == SL_FAB) ? 1.0 : global.scale_factor);
+ fprintf(global.f, "%g dup neg scale\n", (flags & PCB_LYT_FAB) ? 1.0 : global.scale_factor);
pcb_fprintf(global.f, "%mi %mi translate\n", -PCB->MaxWidth / 2, -PCB->MaxHeight / 2);
/* Keep the drill list from falling off the left edge of the paper,
* even if it means some of the board falls off the right edge.
* If users don't want to make smaller boards, or use fewer drill
* sizes, they can always ignore this sheet. */
- if (SL_TYPE(idx) == SL_FAB) {
- Coord natural = boffset - PCB_MIL_TO_COORD(500) - PCB->MaxHeight / 2;
- Coord needed = DrawFab_overhang();
+ if (flags & PCB_LYT_FAB) {
+ pcb_coord_t natural = boffset - PCB_MIL_TO_COORD(500) - PCB->MaxHeight / 2;
+ pcb_coord_t needed = pcb_stub_draw_fab_overhang();
pcb_fprintf(global.f, "%% PrintFab overhang natural %mi, needed %mi\n", natural, needed);
if (needed > natural)
pcb_fprintf(global.f, "0 %mi translate\n", needed - natural);
@@ -944,12 +935,12 @@ static int ps_set_layer(const char *name, int group, int empty)
if (global.drill_helper)
pcb_fprintf(global.f,
"/dh { gsave %mi setlinewidth 0 gray %mi 0 360 arc stroke grestore} bind def\n",
- (Coord) MIN_PINORVIAHOLE, (Coord) (MIN_PINORVIAHOLE * 3 / 2));
+ (pcb_coord_t) PCB_MIN_PINORVIAHOLE, (pcb_coord_t) (PCB_MIN_PINORVIAHOLE * 3 / 2));
}
#if 0
/* Try to outsmart ps2pdf's heuristics for page rotation, by putting
* text on all pages -- even if that text is blank */
- if (SL_TYPE(idx) != SL_FAB)
+ if (!(flags & PCB_LYT_FAB))
fprintf(global.f, "gsave tx ty translate 1 -1 scale 0 0 moveto (Layer %s) show grestore newpath /ty ty ts sub def\n", name);
else
fprintf(global.f, "gsave tx ty translate 1 -1 scale 0 0 moveto ( ) show grestore newpath /ty ty ts sub def\n");
@@ -960,22 +951,23 @@ static int ps_set_layer(const char *name, int group, int empty)
print the outline layer on this layer also. */
if (global.outline &&
global.outline_layer != NULL &&
- global.outline_layer != PCB->Data->Layer + idx && strcmp(name, "outline") != 0 && strcmp(name, "route") != 0) {
- DrawLayer(global.outline_layer, &global.region);
+ global.outline_layer != pcb_get_layer(layer) &&
+ !(flags & PCB_LYT_OUTLINE)) {
+ pcb_draw_layer(global.outline_layer, &global.region);
}
return 1;
}
-static hidGC ps_make_gc(void)
+static pcb_hid_gc_t ps_make_gc(void)
{
- hidGC rv = (hidGC) calloc(1, sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) calloc(1, sizeof(hid_gc_s));
rv->me_pointer = &ps_hid;
rv->cap = Trace_Cap;
return rv;
}
-static void ps_destroy_gc(hidGC gc)
+static void ps_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -985,7 +977,7 @@ static void ps_use_mask(int use_it)
/* does nothing */
}
-static void ps_set_color(hidGC gc, const char *name)
+static void ps_set_color(pcb_hid_gc_t gc, const char *name)
{
if (strcmp(name, "erase") == 0 || strcmp(name, "drill") == 0) {
gc->r = gc->g = gc->b = 255;
@@ -1005,27 +997,27 @@ static void ps_set_color(hidGC gc, const char *name)
}
}
-static void ps_set_line_cap(hidGC gc, EndCapStyle style)
+static void ps_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void ps_set_line_width(hidGC gc, Coord width)
+static void ps_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void ps_set_draw_xor(hidGC gc, int xor_)
+static void ps_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
-static void ps_set_draw_faded(hidGC gc, int faded)
+static void ps_set_draw_faded(pcb_hid_gc_t gc, int faded)
{
gc->faded = faded;
}
-static void use_gc(hidGC gc)
+static void use_gc(pcb_hid_gc_t gc)
{
static int lastcap = -1;
static int lastcolor = -1;
@@ -1082,23 +1074,23 @@ static void use_gc(hidGC gc)
}
}
-static void ps_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void ps_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
pcb_fprintf(global.f, "%mi %mi %mi %mi dr\n", x1, y1, x2, y2);
}
-static void ps_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-static void ps_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
+static void ps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+static void ps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
-static void ps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void ps_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
#if 0
/* If you're etching your own paste mask, this will reduce the
amount of brass you need to etch by drawing outlines for large
pads. See also ps_fill_rect. */
if (is_paste && gc->width > 2500 && gc->cap == Square_Cap && (x1 == x2 || y1 == y2)) {
- Coord t, w;
+ pcb_coord_t t, w;
if (x1 > x2) {
t = x1;
x1 = x2;
@@ -1115,7 +1107,7 @@ static void ps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
#endif
if (x1 == x2 && y1 == y2) {
- Coord w = gc->width / 2;
+ pcb_coord_t w = gc->width / 2;
if (gc->cap == Square_Cap)
ps_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w);
else
@@ -1126,9 +1118,9 @@ static void ps_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
pcb_fprintf(global.f, "%mi %mi %mi %mi t\n", x1, y1, x2, y2);
}
-static void ps_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void ps_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- Angle sa, ea;
+ pcb_angle_t sa, ea;
if (delta_angle > 0) {
sa = start_angle;
ea = start_angle + delta_angle;
@@ -1145,7 +1137,7 @@ static void ps_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height,
sa, ea, -width, height, cx, cy, (double) (global.linewidth + 2 * global.bloat) /(double) width);
}
-static void ps_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void ps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
use_gc(gc);
if (!gc->erase || !global.is_copper || global.drillcopper) {
@@ -1155,7 +1147,7 @@ static void ps_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
}
}
-static void ps_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void ps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
const char *op = "moveto";
@@ -1168,11 +1160,11 @@ static void ps_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
}
typedef struct {
- Coord x1, y1, x2, y2;
+ pcb_coord_t x1, y1, x2, y2;
} lseg_t;
typedef struct {
- Coord x, y;
+ pcb_coord_t x, y;
} lpoint_t;
#define minmax(val, min, max) \
@@ -1212,16 +1204,16 @@ do { \
int coord_comp(const void *c1_, const void *c2_)
{
- const Coord *c1 = c1_, *c2 = c2_;
+ const pcb_coord_t *c1 = c1_, *c2 = c2_;
return *c1 < *c2;
}
-static void ps_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box)
+static void ps_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
/* Ignore clip_box, just draw everything */
- VNODE *v;
- PLINE *pl;
+ pcb_vnode_t *v;
+ pcb_pline_t *pl;
const char *op;
int len;
double POLYGRID = ps_attribute_list[HA_polygrid].default_val.real_value;
@@ -1249,9 +1241,9 @@ static void ps_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * cl
while ((pl = pl->next) != NULL);
if (POLYGRID > 0.1) {
- Coord y, x, lx, ly, fx, fy, lsegs_xmin, lsegs_xmax, lsegs_ymin, lsegs_ymax;
+ pcb_coord_t y, x, lx, ly, fx, fy, lsegs_xmin, lsegs_xmax, lsegs_ymin, lsegs_ymax;
lseg_t *lsegs = malloc(sizeof(lseg_t) * len);
- Coord *lpoints = malloc(sizeof(Coord) * len);
+ pcb_coord_t *lpoints = malloc(sizeof(pcb_coord_t) * len);
int lsegs_used = 0;
lsegs_xmin = -1000000000;
@@ -1307,7 +1299,7 @@ static void ps_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * cl
goto retry1;
}
if (pts > 1) {
- qsort(lpoints, pts, sizeof(Coord), coord_comp);
+ qsort(lpoints, pts, sizeof(pcb_coord_t), coord_comp);
for (n = 0; n < pts; n += 2)
lseg_line(lpoints[n], y, lpoints[n + 1], y);
}
@@ -1336,7 +1328,7 @@ static void ps_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * cl
goto retry2;
}
if ((pts > 1)) {
- qsort(lpoints, pts, sizeof(Coord), coord_comp);
+ qsort(lpoints, pts, sizeof(pcb_coord_t), coord_comp);
for (n = 0; n < pts; n += 2)
lseg_line(x, lpoints[n], x, lpoints[n + 1]);
}
@@ -1351,16 +1343,16 @@ static void ps_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * cl
fprintf(global.f, "fill\n");
}
-static void ps_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void ps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
use_gc(gc);
if (x1 > x2) {
- Coord t = x1;
+ pcb_coord_t t = x1;
x1 = x2;
x2 = t;
}
if (y1 > y2) {
- Coord t = y1;
+ pcb_coord_t t = y1;
y1 = y2;
y2 = t;
}
@@ -1379,7 +1371,7 @@ static void ps_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
pcb_fprintf(global.f, "%mi %mi %mi %mi r\n", x1 - global.bloat, y1 - global.bloat, x2 + global.bloat, y2 + global.bloat);
}
-HID_Attribute ps_calib_attribute_list[] = {
+pcb_hid_attribute_t ps_calib_attribute_list[] = {
{"lprcommand", "Command to print",
HID_String, 0, 0, {0, 0, 0}, 0, 0},
};
@@ -1471,7 +1463,7 @@ static int guess(double val, double close_to, double *calib)
void ps_calibrate_1(double xval, double yval, int use_command)
{
- HID_Attr_Val vals[3];
+ pcb_hid_attr_val_t vals[3];
FILE *ps_cal_file;
int used_popen = 0, c;
@@ -1482,7 +1474,7 @@ void ps_calibrate_1(double xval, double yval, int use_command)
if (xval < 2)
ps_attribute_list[HA_xcalib].default_val.real_value = global.calibration_x = xval;
else
- Message(PCB_MSG_DEFAULT, "X value of %g is too far off.\n" "Expecting it near: 1.0, 4.0, 15.0, 7.5\n", xval);
+ pcb_message(PCB_MSG_ERROR, "X value of %g is too far off.\n" "Expecting it near: 1.0, 4.0, 15.0, 7.5\n", xval);
}
if (guess(yval, 4, &global.calibration_y))
if (guess(yval, 20, &global.calibration_y))
@@ -1490,7 +1482,7 @@ void ps_calibrate_1(double xval, double yval, int use_command)
if (yval < 2)
ps_attribute_list[HA_ycalib].default_val.real_value = global.calibration_y = yval;
else
- Message(PCB_MSG_DEFAULT, "Y value of %g is too far off.\n" "Expecting it near: 1.0, 4.0, 20.0, 10.0\n", yval);
+ pcb_message(PCB_MSG_ERROR, "Y value of %g is too far off.\n" "Expecting it near: 1.0, 4.0, 20.0, 10.0\n", yval);
}
return;
}
@@ -1499,7 +1491,7 @@ void ps_calibrate_1(double xval, double yval, int use_command)
ps_calib_attribute_list[0].default_val.str_value = pcb_strdup("lpr");
}
- if (gui->
+ if (pcb_gui->
attribute_dialog(ps_calib_attribute_list, 1, vals, _("Print Calibration Page"),
_("Generates a printer calibration page")))
return;
@@ -1544,24 +1536,24 @@ static void ps_set_crosshair(int x, int y, int action)
{
}
-static int ActionPSCalib(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_PSCalib(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
ps_calibrate(0.0, 0.0);
return 0;
}
-HID_Action hidps_action_list[] = {
- {"pscalib", 0, ActionPSCalib}
+pcb_hid_action_t hidps_action_list[] = {
+ {"pscalib", 0, pcb_act_PSCalib}
};
-REGISTER_ACTIONS(hidps_action_list, ps_cookie)
+PCB_REGISTER_ACTIONS(hidps_action_list, ps_cookie)
#include "dolists.h"
-HID ps_hid;
+pcb_hid_t ps_hid;
static int ps_inited = 0;
-void ps_ps_init(HID * hid)
+void ps_ps_init(pcb_hid_t * hid)
{
if (ps_inited)
return;
@@ -1569,7 +1561,7 @@ void ps_ps_init(HID * hid)
hid->get_export_options = ps_get_export_options;
hid->do_export = ps_do_export;
hid->parse_arguments = ps_parse_arguments;
- hid->set_layer = ps_set_layer;
+ hid->set_layer_group = ps_set_layer_group;
hid->make_gc = ps_make_gc;
hid->destroy_gc = ps_destroy_gc;
hid->use_mask = ps_use_mask;
@@ -1588,7 +1580,7 @@ void ps_ps_init(HID * hid)
hid->calibrate = ps_calibrate;
hid->set_crosshair = ps_set_crosshair;
- REGISTER_ACTIONS(hidps_action_list, ps_cookie)
+ PCB_REGISTER_ACTIONS(hidps_action_list, ps_cookie)
ps_inited = 1;
}
@@ -1596,27 +1588,27 @@ void ps_ps_init(HID * hid)
static int ps_usage(const char *topic)
{
fprintf(stderr, "\nps exporter command line arguments:\n\n");
- hid_usage(ps_attribute_list, sizeof(ps_attribute_list) / sizeof(ps_attribute_list[0]));
+ pcb_hid_usage(ps_attribute_list, sizeof(ps_attribute_list) / sizeof(ps_attribute_list[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x ps foo.pcb [ps options]\n\n");
return 0;
}
static void plugin_ps_uninit(void)
{
- hid_remove_actions_by_cookie(ps_cookie);
+ pcb_hid_remove_actions_by_cookie(ps_cookie);
ps_inited = 0;
}
pcb_uninit_t hid_export_ps_init()
{
- memset(&ps_hid, 0, sizeof(HID));
+ memset(&ps_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&ps_hid);
- common_draw_helpers_init(&ps_hid);
+ pcb_hid_nogui_init(&ps_hid);
+ pcb_dhlp_draw_helpers_init(&ps_hid);
ps_ps_init(&ps_hid);
- ps_hid.struct_size = sizeof(HID);
+ ps_hid.struct_size = sizeof(pcb_hid_t);
ps_hid.name = "ps";
ps_hid.description = "Postscript export";
ps_hid.exporter = 1;
@@ -1624,7 +1616,7 @@ pcb_uninit_t hid_export_ps_init()
ps_hid.usage = ps_usage;
- hid_register_hid(&ps_hid);
+ pcb_hid_register_hid(&ps_hid);
hid_eps_init();
return plugin_ps_uninit;
diff --git a/src_plugins/export_ps/ps.h b/src_plugins/export_ps/ps.h
index 424021a..7e37087 100644
--- a/src_plugins/export_ps/ps.h
+++ b/src_plugins/export_ps/ps.h
@@ -1,7 +1,7 @@
extern const char *ps_cookie;
-extern HID ps_hid;
-extern void ps_hid_export_to_file(FILE *, HID_Attr_Val *);
+extern pcb_hid_t ps_hid;
+extern void ps_hid_export_to_file(FILE *, pcb_hid_attr_val_t *);
extern void ps_start_file(FILE *);
extern void ps_calibrate_1(double, double, int);
extern void hid_eps_init();
-void ps_ps_init(HID * hid);
+void ps_ps_init(pcb_hid_t * hid);
diff --git a/src_plugins/export_stat/Makefile b/src_plugins/export_stat/Makefile
new file mode 100644
index 0000000..f6d61f1
--- /dev/null
+++ b/src_plugins/export_stat/Makefile
@@ -0,0 +1,5 @@
+all:
+ cd ../../src && $(MAKE) mod_export_stat
+
+clean:
+ rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_stat/Plug.tmpasm b/src_plugins/export_stat/Plug.tmpasm
new file mode 100644
index 0000000..006110c
--- /dev/null
+++ b/src_plugins/export_stat/Plug.tmpasm
@@ -0,0 +1,8 @@
+put /local/pcb/mod {export_stat}
+put /local/pcb/mod/OBJS [@ $(PLUGDIR)/export_stat/stat.o @]
+
+switch /local/pcb/export_stat/controls
+ case {buildin} include /local/pcb/tmpasm/buildin; end;
+ case {plugin} include /local/pcb/tmpasm/plugin; end;
+ case {disable} include /local/pcb/tmpasm/disable; end;
+end
diff --git a/src_plugins/export_stat/README b/src_plugins/export_stat/README
new file mode 100644
index 0000000..274cacf
--- /dev/null
+++ b/src_plugins/export_stat/README
@@ -0,0 +1,5 @@
+Export various board statistics in lihata format
+
+#state: works
+#default: buildin
+#implements: export
diff --git a/src_plugins/export_stat/stat.c b/src_plugins/export_stat/stat.c
new file mode 100644
index 0000000..432dd35
--- /dev/null
+++ b/src_plugins/export_stat/stat.c
@@ -0,0 +1,347 @@
+ /*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 2006 Dan McMahill
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+/*
+ * Based on the png exporter by Dan McMahill
+ */
+
+#include "config.h"
+#include "conf_core.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+#include <time.h>
+
+#include "math_helper.h"
+#include "board.h"
+#include "data.h"
+#include "plugins.h"
+#include "pcb-printf.h"
+#include "compat_misc.h"
+#include "plug_io.h"
+
+#include "hid.h"
+#include "hid_nogui.h"
+#include "hid_draw_helpers.h"
+
+#include "hid_init.h"
+#include "hid_attrib.h"
+#include "hid_color.h"
+#include "hid_helper.h"
+#include "hid_flags.h"
+
+
+static pcb_hid_t stat_hid;
+
+const char *stat_cookie = "stat HID";
+
+pcb_hid_attribute_t stat_attribute_list[] = {
+ /* other HIDs expect this to be first. */
+
+ {"outfile", "Output file name",
+ HID_String, 0, 0, {0, 0, 0}, 0, 0},
+#define HA_statfile 0
+
+ {"board_id", "Short name of the board so it can be identified for updates",
+ HID_String, 0, 0, {0, 0, 0}, 0, 0},
+#define HA_board_id 1
+
+ {"orig", "This design started its life in pcb-rnd",
+ HID_Boolean, 0, 0, {0, 0, 0}, 0, 0},
+#define HA_orig 2
+
+ {"lht_built", "This design was already in lihata when real boards got built",
+ HID_Boolean, 0, 0, {0, 0, 0}, 0, 0},
+#define HA_lht_built 3
+
+
+ {"built", "how many actual/physical boards got built",
+ HID_Integer, 0, 1000000, {0, 0, 0}, 0, 0},
+#define HA_built 4
+
+ {"first_ver", "the version of pcb-rnd you first used on this board",
+ HID_String, 0, 0, {0, VERSION, 0}, 0, 0},
+#define HA_first_ver 5
+
+ {"license", "license of the design",
+ HID_String, 0, 0, {0, "proprietary/private", 0}, 0, 0},
+#define HA_license 6
+
+};
+
+#define NUM_OPTIONS (sizeof(stat_attribute_list)/sizeof(stat_attribute_list[0]))
+
+PCB_REGISTER_ATTRIBUTES(stat_attribute_list, stat_cookie)
+
+static pcb_hid_attr_val_t stat_values[NUM_OPTIONS];
+
+static pcb_hid_attribute_t *stat_get_export_options(int *n)
+{
+ static char *last_made_filename = 0;
+ const char *suffix = ".stat.lht";
+
+ if (PCB)
+ pcb_derive_default_filename(PCB->Filename, &stat_attribute_list[HA_statfile], suffix, &last_made_filename);
+
+ if (n)
+ *n = NUM_OPTIONS;
+ return stat_attribute_list;
+}
+
+typedef struct layer_stat_s {
+ pcb_coord_t trace_len;
+ double copper_area;
+ unsigned long int lines, arcs, polys, elements;
+} layer_stat_t;
+
+static void stat_do_export(pcb_hid_attr_val_t * options)
+{
+ FILE *f;
+ const char *filename;
+ int i, lid;
+ pcb_layergrp_id_t lgid;
+ char buff[1024];
+ time_t t;
+ layer_stat_t ls, *lgs, lgss[PCB_MAX_LAYERGRP];
+ int nl, phg, hp, hup, group_not_empty[PCB_MAX_LAYERGRP];
+ pcb_cardinal_t num_etop = 0, num_ebottom = 0, num_esmd = 0, num_epads = 0, num_epins = 0;
+
+ memset(lgss, 0, sizeof(lgss));
+ memset(group_not_empty, 0, sizeof(group_not_empty));
+
+ if (!options) {
+ stat_get_export_options(0);
+ for (i = 0; i < NUM_OPTIONS; i++)
+ stat_values[i] = stat_attribute_list[i].default_val;
+ options = stat_values;
+ }
+
+ filename = options[HA_statfile].str_value;
+ if (!filename)
+ filename = "pcb.stat.lht";
+
+ f = fopen(filename, "w");
+ if (!f) {
+ perror(filename);
+ return;
+ }
+
+ pcb_board_count_holes(&hp, &hup, NULL);
+ t = time(NULL);
+ strftime(buff, sizeof(buff), "%y-%d-%m %H:%M:%S", localtime(&t));
+
+ fprintf(f, "ha:pcb-rnd-board-stats-v1 {\n");
+ fprintf(f, " ha:meta {\n");
+ fprintf(f, " date=%s\n", buff);
+ fprintf(f, " built=%d\n", stat_values[HA_built].int_value);
+ fprintf(f, " lht_built=%s\n", (stat_values[HA_lht_built].int_value ? "yes" : "no"));
+ fprintf(f, " orig_rnd=%s\n", (stat_values[HA_orig].int_value ? "yes" : "no"));
+ fprintf(f, " first_ver=%s\n", stat_values[HA_first_ver].str_value);
+ fprintf(f, " curr_ver=%s\n", VERSION);
+#ifdef REVISION
+ fprintf(f, " curr_rev=%s\n", REVISION);
+#endif
+
+ fprintf(f, " }\n");
+
+ fprintf(f, " li:logical_layers {\n");
+ for(lid = 0; lid < pcb_max_copper_layer; lid++) {
+ pcb_layer_t *l = PCB->Data->Layer+lid;
+ int empty = pcb_layer_is_empty_(l);
+ lgid = pcb_layer_get_group(lid);
+ lgs = lgss + lgid;
+
+ fprintf(f, " ha:layer_%d {\n", lid);
+ fprintf(f, " name={%s}\n", l->Name);
+ fprintf(f, " empty=%s\n", empty ? "yes" : "no");
+ fprintf(f, " grp=%ld\n", lgid);
+
+ memset(&ls, 0, sizeof(ls));
+
+ PCB_LINE_LOOP(l) {
+ pcb_coord_t v;
+ double d;
+ lgs->lines++;
+ ls.lines++;
+ v = pcb_line_length(line);
+ ls.trace_len += v;
+ lgs->trace_len += v;
+ d = pcb_line_area(line);
+ ls.copper_area += d;
+ lgs->copper_area += d;
+
+ }
+ PCB_END_LOOP;
+
+ PCB_ARC_LOOP(l) {
+ pcb_coord_t v;
+ double d;
+ lgs->arcs++;
+ ls.arcs++;
+ v = pcb_arc_length(arc);
+ ls.trace_len += v;
+ lgs->trace_len += v;
+ d = pcb_arc_area(arc);
+ ls.copper_area += d;
+ lgs->copper_area += d;
+ }
+ PCB_END_LOOP;
+
+ PCB_POLY_LOOP(l) {
+ double v;
+ lgs->polys++;
+ ls.polys++;
+ v = pcb_poly_area(polygon);
+ ls.copper_area += v;
+ lgs->copper_area += v;
+ }
+ PCB_END_LOOP;
+
+ if (!empty)
+ group_not_empty[lgid] = 1;
+
+ fprintf(f, " lines=%lu\n", ls.lines);
+ fprintf(f, " arcs=%lu\n", ls.arcs);
+ fprintf(f, " polys=%lu\n", ls.polys);
+ pcb_fprintf(f, " trace_len=%$mm\n", ls.trace_len);
+ fprintf(f, " copper_area={%f mm^2}\n", (double)ls.copper_area / (double)PCB_MM_TO_COORD(1) / (double)PCB_MM_TO_COORD(1));
+
+ fprintf(f, " }\n");
+ }
+ fprintf(f, " }\n");
+
+ phg = 0;
+ fprintf(f, " li:physical_layers {\n");
+ for(lgid = 0; lgid < pcb_max_copper_layer; lgid++) {
+ if (group_not_empty[lgid]) {
+ phg++;
+ fprintf(f, " ha:layergroup_%ld {\n", lgid);
+ fprintf(f, " lines=%lu\n", lgss[lgid].lines);
+ fprintf(f, " arcs=%lu\n", lgss[lgid].arcs);
+ fprintf(f, " polys=%lu\n", lgss[lgid].polys);
+ pcb_fprintf(f, " trace_len=%$mm\n", lgss[lgid].trace_len);
+ fprintf(f, " copper_area={%f mm^2}\n", (double)lgss[lgid].copper_area / (double)PCB_MM_TO_COORD(1) / (double)PCB_MM_TO_COORD(1));
+ fprintf(f, " }\n");
+ }
+ }
+ fprintf(f, " }\n");
+
+ fprintf(f, " li:netlist {\n");
+ for(nl = 0; nl < PCB_NUM_NETLISTS; nl++) {
+ pcb_cardinal_t m, terms = 0, best_terms = 0;
+ fprintf(f, " ha:%s {\n", pcb_netlist_names[nl]);
+ for(m = 0; m < PCB->NetlistLib[nl].MenuN; m++) {
+ pcb_lib_menu_t *menu = &PCB->NetlistLib[nl].Menu[m];
+ terms += menu->EntryN;
+ if (menu->EntryN > best_terms)
+ best_terms = menu->EntryN;
+ }
+ fprintf(f, " nets=%ld\n", (long int)PCB->NetlistLib[nl].MenuN);
+ fprintf(f, " terminals=%ld\n", (long int)terms);
+ fprintf(f, " max_term_per_net=%ld\n", (long int)best_terms);
+ fprintf(f, " }\n");
+ }
+ fprintf(f, " }\n");
+
+ PCB_ELEMENT_LOOP(PCB->Data) {
+ int pal, pil;
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element))
+ num_ebottom++;
+ else
+ num_etop++;
+ pal = padlist_length(&element->Pad);
+ pil = pinlist_length(&element->Pin);
+ if (pal > pil)
+ num_esmd++;
+ num_epads += pal;
+ num_epins += pil;
+ }
+ PCB_END_LOOP;
+
+
+ fprintf(f, " ha:board {\n");
+ fprintf(f, " id={%s}\n", options[HA_board_id].str_value);
+ fprintf(f, " license={%s}\n", options[HA_license].str_value);
+ fprintf(f, " format={%s}\n", PCB->Data->loader == NULL ? "unknown" : PCB->Data->loader->description);
+ pcb_fprintf(f, " width=%$mm\n", PCB->MaxWidth);
+ pcb_fprintf(f, " height=%$mm\n", PCB->MaxHeight);
+ fprintf(f, " gross_area={%.4f mm^2}\n", (double)PCB_COORD_TO_MM(PCB->MaxWidth) * (double)PCB_COORD_TO_MM(PCB->MaxWidth));
+ fprintf(f, " holes_plated=%d\n", hp);
+ fprintf(f, " holes_unplated=%d\n", hup);
+ fprintf(f, " physical_copper_layers=%d\n", phg);
+ fprintf(f, " ha:elements {\n");
+ fprintf(f, " total=%ld\n", (long int)num_ebottom + num_etop);
+ fprintf(f, " top_side=%ld\n", (long int)num_etop);
+ fprintf(f, " bottom_side=%ld\n", (long int)num_ebottom);
+ fprintf(f, " smd=%ld\n", (long int)num_esmd);
+ fprintf(f, " pads=%ld\n", (long int)num_epads);
+ fprintf(f, " pins=%ld\n", (long int)num_epins);
+ fprintf(f, " }\n");
+ fprintf(f, " }\n");
+
+ fprintf(f, "}\n");
+ fclose(f);
+}
+
+static void stat_parse_arguments(int *argc, char ***argv)
+{
+ pcb_hid_register_attributes(stat_attribute_list, sizeof(stat_attribute_list) / sizeof(stat_attribute_list[0]), stat_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
+}
+
+static int stat_usage(const char *topic)
+{
+ fprintf(stderr, "\nstat exporter command line arguments:\n\n");
+ pcb_hid_usage(stat_attribute_list, sizeof(stat_attribute_list) / sizeof(stat_attribute_list[0]));
+ fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x stat foo.pcb [stat options]\n\n");
+ return 0;
+}
+
+#include "dolists.h"
+
+pcb_uninit_t hid_export_stat_init()
+{
+ memset(&stat_hid, 0, sizeof(pcb_hid_t));
+
+ pcb_hid_nogui_init(&stat_hid);
+ pcb_dhlp_draw_helpers_init(&stat_hid);
+
+ stat_hid.struct_size = sizeof(pcb_hid_t);
+ stat_hid.name = "stat";
+ stat_hid.description = "board statistics";
+ stat_hid.exporter = 1;
+
+ stat_hid.get_export_options = stat_get_export_options;
+ stat_hid.do_export = stat_do_export;
+ stat_hid.parse_arguments = stat_parse_arguments;
+
+ stat_hid.usage = stat_usage;
+
+ pcb_hid_register_hid(&stat_hid);
+
+ return NULL;
+}
diff --git a/src_plugins/export_svg/Makefile b/src_plugins/export_svg/Makefile
index 90a3a2d..063150c 100644
--- a/src_plugins/export_svg/Makefile
+++ b/src_plugins/export_svg/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_svg
+ cd ../../src && $(MAKE) mod_export_svg
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_svg/svg.c b/src_plugins/export_svg/svg.c
index 56ce219..9a60abc 100644
--- a/src_plugins/export_svg/svg.c
+++ b/src_plugins/export_svg/svg.c
@@ -36,10 +36,10 @@
#include <math.h>
#include <genvector/gds_char.h>
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "layer.h"
#include "misc_util.h"
#include "compat_misc.h"
@@ -56,20 +56,20 @@
#include "hid_flags.h"
-static HID svg_hid;
+static pcb_hid_t svg_hid;
const char *svg_cookie = "svg HID";
-typedef struct hid_gc_struct {
- HID *me_pointer;
- EndCapStyle cap;
+typedef struct hid_gc_s {
+ pcb_hid_t *me_pointer;
+ pcb_cap_style_t cap;
int width;
char *color;
int erase, drill;
-} hid_gc_struct;
+} hid_gc_s;
-static const char *CAPS(EndCapStyle cap)
+static const char *CAPS(pcb_cap_style_t cap)
{
switch (cap) {
case Trace_Cap:
@@ -105,7 +105,7 @@ struct {
const char *bright;
const char *normal;
const char *dark;
- Coord offs;
+ pcb_coord_t offs;
} photo_palette[] = {
/* MASK */ { "#00ff00", "#00ff00", "#00ff00", PCB_MM_TO_COORD(0) },
/* SILK */ { "#ffffff", "#eeeeee", "#aaaaaa", PCB_MM_TO_COORD(0) },
@@ -113,7 +113,7 @@ struct {
/* INNER */ { "#222222", "#111111", "#000000", PCB_MM_TO_COORD(0.05) }
};
-HID_Attribute svg_attribute_list[] = {
+pcb_hid_attribute_t svg_attribute_list[] = {
/* other HIDs expect this to be first. */
/* %start-doc options "93 SVG Options"
@@ -174,27 +174,27 @@ do { \
} while(0)
-REGISTER_ATTRIBUTES(svg_attribute_list, svg_cookie)
+PCB_REGISTER_ATTRIBUTES(svg_attribute_list, svg_cookie)
-static HID_Attr_Val svg_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t svg_values[NUM_OPTIONS];
-static HID_Attribute *svg_get_export_options(int *n)
+static pcb_hid_attribute_t *svg_get_export_options(int *n)
{
static char *last_made_filename = 0;
const char *suffix = ".svg";
if (PCB)
- derive_default_filename(PCB->Filename, &svg_attribute_list[HA_svgfile], suffix, &last_made_filename);
+ pcb_derive_default_filename(PCB->Filename, &svg_attribute_list[HA_svgfile], suffix, &last_made_filename);
if (n)
*n = NUM_OPTIONS;
return svg_attribute_list;
}
-void svg_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
+void svg_hid_export_to_file(FILE * the_file, pcb_hid_attr_val_t * options)
{
- static int saved_layer_stack[MAX_LAYER];
- BoxType region;
+ static int saved_layer_stack[PCB_MAX_LAYER];
+ pcb_box_t region;
region.X1 = 0;
region.Y1 = 0;
@@ -203,7 +203,7 @@ void svg_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
f = the_file;
- memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack));
+ memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack));
{
conf_force_set_bool(conf_core.editor.thin_draw, 0);
@@ -237,7 +237,7 @@ void svg_hid_export_to_file(FILE * the_file, HID_Attr_Val * options)
gds_init(&sbright);
gds_init(&sdark);
gds_init(&snormal);
- hid_expose_callback(&svg_hid, ®ion, 0);
+ pcb_hid_expose_callback(&svg_hid, ®ion, 0);
conf_update(NULL); /* restore forced sets */
}
@@ -267,12 +267,12 @@ static void group_close()
fprintf(f, "</g>\n");
}
-static void svg_do_export(HID_Attr_Val * options)
+static void svg_do_export(pcb_hid_attr_val_t * options)
{
const char *filename;
- int save_ons[MAX_LAYER + 2];
+ int save_ons[PCB_MAX_LAYER + 2];
int i;
- Coord w, h, x1, y1, x2, y2;
+ pcb_coord_t w, h, x1, y1, x2, y2;
if (!options) {
svg_get_export_options(0);
@@ -307,11 +307,11 @@ static void svg_do_export(HID_Attr_Val * options)
y2 += PCB_MM_TO_COORD(5);
pcb_fprintf(f, "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.0\" width=\"%mm\" height=\"%mm\" viewBox=\"-%mm -%mm %mm %mm\">\n", w, h, x1, y1, x2, y2);
- hid_save_and_show_layer_ons(save_ons);
+ pcb_hid_save_and_show_layer_ons(save_ons);
svg_hid_export_to_file(f, options);
- hid_restore_layer_ons(save_ons);
+ pcb_hid_restore_layer_ons(save_ons);
while(group_open) {
group_close();
@@ -325,42 +325,46 @@ static void svg_do_export(HID_Attr_Val * options)
static void svg_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(svg_attribute_list, sizeof(svg_attribute_list) / sizeof(svg_attribute_list[0]), svg_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(svg_attribute_list, sizeof(svg_attribute_list) / sizeof(svg_attribute_list[0]), svg_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-static int svg_set_layer(const char *name, int group, int empty)
+static int svg_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- int opa, our_mask, our_silk;
- unsigned int our_side;
+ int opa, is_our_mask = 0, is_our_silk = 0;
- if (flip) {
- our_mask = SL(MASK, BOTTOM);
- our_silk = SL(SILK, BOTTOM);
- our_side = PCB_LYT_BOTTOM;
- }
- else {
- our_mask = SL(MASK, TOP);
- our_silk = SL(SILK, TOP);
- our_side = PCB_LYT_TOP;
- }
+ if (flags & PCB_LYT_UI)
+ return 0;
+
+ if (flags & PCB_LYT_INVIS)
+ return 0;
/* don't draw the mask if we are not in the photo mode */
- if (!photo_mode && ((group == SL(MASK, TOP)) || (group == SL(MASK, BOTTOM))))
+ if (!photo_mode && (flags & PCB_LYT_MASK))
return 0;
- if ((group < 0) && (group != our_silk) && (group != our_mask) && (group != SL(UDRILL, 0)) && (group != SL(PDRILL, 0)))
+ switch(flags & PCB_LYT_ANYTHING) {
+ case PCB_LYT_MASK: is_our_mask = PCB_LAYERFLG_ON_VISIBLE_SIDE(flags); break;
+ case PCB_LYT_SILK: is_our_silk = PCB_LAYERFLG_ON_VISIBLE_SIDE(flags); break;
+ default:;
+ }
+
+ if (!(flags & PCB_LYT_COPPER) && (!is_our_silk) && (!is_our_mask) && !(flags & PCB_LYT_PDRILL) && !(flags & PCB_LYT_PDRILL) && !(flags & PCB_LYT_OUTLINE))
return 0;
+
while(group_open) {
group_close();
group_open--;
}
- if (name == NULL)
- name = "copper";
- fprintf(f, "<g id=\"layer_%d_%s\"", group, name);
- drawing_mask = (group == our_mask);
+
+ {
+ char tmp_ln[PCB_PATH_MAX];
+ const char *name = name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed);
+ fprintf(f, "<g id=\"layer_%ld_%s\"", group, name);
+ }
+
opa = opacity;
- if (drawing_mask)
+ if (is_our_mask)
opa *= mask_opacity_factor;
if (opa != 100)
fprintf(f, " opacity=\"%.2f\"", ((float)opa) / 100.0);
@@ -368,30 +372,27 @@ static int svg_set_layer(const char *name, int group, int empty)
group_open = 1;
if (photo_mode) {
- if (group == our_silk)
+ if (is_our_silk)
photo_color = PHOTO_SILK;
- if (group == our_mask)
+ if (is_our_mask)
photo_color = PHOTO_MASK;
else if (group >= 0) {
- int ly = PCB->LayerGroups.Entries[group][0];
- unsigned int fl;
- fl = pcb_layer_flags(ly) & PCB_LYT_ANYWHERE;
- if (fl == our_side)
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags))
photo_color = PHOTO_COPPER;
else
photo_color = PHOTO_INNER;
}
}
- drawing_hole = (group == SL(UDRILL, 0)) || (group == SL(PDRILL, 0));
+ drawing_hole = (flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL);
return 1;
}
-static hidGC svg_make_gc(void)
+static pcb_hid_gc_t svg_make_gc(void)
{
- hidGC rv = (hidGC) malloc(sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (pcb_hid_gc_t) malloc(sizeof(hid_gc_s));
rv->me_pointer = &svg_hid;
rv->cap = Trace_Cap;
rv->width = 1;
@@ -399,7 +400,7 @@ static hidGC svg_make_gc(void)
return rv;
}
-static void svg_destroy_gc(hidGC gc)
+static void svg_destroy_gc(pcb_hid_gc_t gc)
{
free(gc);
}
@@ -413,7 +414,7 @@ static void svg_use_mask(int use_it)
}
}
-static void svg_set_color(hidGC gc, const char *name)
+static void svg_set_color(pcb_hid_gc_t gc, const char *name)
{
gc->drill = gc->erase = 0;
if (name == NULL)
@@ -434,12 +435,12 @@ static void svg_set_color(hidGC gc, const char *name)
gc->color = pcb_strdup(name);
}
-static void svg_set_line_cap(hidGC gc, EndCapStyle style)
+static void svg_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void svg_set_line_width(hidGC gc, Coord width)
+static void svg_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
@@ -463,40 +464,40 @@ static void indent(gds_t *s)
pcb_append_printf(s, ind);
}
-static void svg_set_draw_xor(hidGC gc, int xor_)
+static void svg_set_draw_xor(pcb_hid_gc_t gc, int xor_)
{
;
}
#define fix_rect_coords() \
if (x1 > x2) {\
- Coord t = x1; \
+ pcb_coord_t t = x1; \
x1 = x2; \
x2 = t; \
} \
if (y1 > y2) { \
- Coord t = y1; \
+ pcb_coord_t t = y1; \
y1 = y2; \
y2 = t; \
}
-static void draw_rect(hidGC gc, Coord x1, Coord y1, Coord w, Coord h, Coord stroke)
+static void draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t w, pcb_coord_t h, pcb_coord_t stroke)
{
indent(&snormal);
pcb_append_printf(&snormal, "<rect x=\"%mm\" y=\"%mm\" width=\"%mm\" height=\"%mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
x1, y1, w, h, stroke, gc->color, CAPS(gc->cap));
}
-static void svg_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void svg_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
fix_rect_coords();
draw_rect(gc, x1, y1, x2-x1, y2-y1, gc->width);
}
-static void draw_fill_rect(hidGC gc, Coord x1, Coord y1, Coord w, Coord h)
+static void draw_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t w, pcb_coord_t h)
{
if ((photo_mode) && (!gc->erase)) {
- Coord photo_offs = photo_palette[photo_color].offs;
+ pcb_coord_t photo_offs = photo_palette[photo_color].offs;
if (photo_offs != 0) {
indent(&sdark);
pcb_append_printf(&sdark, "<rect x=\"%mm\" y=\"%mm\" width=\"%mm\" height=\"%mm\" fill=\"%s\" stroke=\"none\"/>\n",
@@ -516,17 +517,17 @@ static void draw_fill_rect(hidGC gc, Coord x1, Coord y1, Coord w, Coord h)
}
}
-static void svg_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void svg_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
TRX(x1); TRY(y1); TRX(x2); TRY(y2);
fix_rect_coords();
draw_fill_rect(gc, x1, y1, x2-x1, y2-y1);
}
-static void draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
if ((photo_mode) && (!gc->erase)) {
- Coord photo_offs = photo_palette[photo_color].offs;
+ pcb_coord_t photo_offs = photo_palette[photo_color].offs;
if (photo_offs != 0) {
indent(&sbright);
pcb_append_printf(&sbright, "<line x1=\"%mm\" y1=\"%mm\" x2=\"%mm\" y2=\"%mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\"/>\n",
@@ -546,39 +547,39 @@ static void draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
}
-static void svg_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void svg_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
TRX(x1); TRY(y1); TRX(x2); TRY(y2);
draw_line(gc, x1, y1, x2, y2);
}
-static void draw_arc(hidGC gc, Coord x1, Coord y1, Coord r, Coord x2, Coord y2, Coord stroke)
+static void draw_arc(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t r, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t stroke, int large, int sweep)
{
if ((photo_mode) && (!gc->erase)) {
- Coord photo_offs = photo_palette[photo_color].offs;
+ pcb_coord_t photo_offs = photo_palette[photo_color].offs;
if (photo_offs != 0) {
indent(&sbright);
- pcb_append_printf(&sbright, "<path d=\"M %mm %mm A %mm %mm 0 0 0 %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
- x1-photo_offs, y1-photo_offs, r, r, x2-photo_offs, y2-photo_offs, gc->width, photo_palette[photo_color].bright, CAPS(gc->cap));
+ pcb_append_printf(&sbright, "<path d=\"M %.8mm %.8mm A %mm %mm 0 %d %d %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
+ x1-photo_offs, y1-photo_offs, r, r, large, sweep, x2-photo_offs, y2-photo_offs, gc->width, photo_palette[photo_color].bright, CAPS(gc->cap));
indent(&sdark);
- pcb_append_printf(&sdark, "<path d=\"M %mm %mm A %mm %mm 0 0 0 %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
- x1+photo_offs, y1+photo_offs, r, r, x2+photo_offs, y2+photo_offs, gc->width, photo_palette[photo_color].dark, CAPS(gc->cap));
+ pcb_append_printf(&sdark, "<path d=\"M %.8mm %.8mm A %mm %mm 0 %d %d %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
+ x1+photo_offs, y1+photo_offs, r, r, large, sweep, x2+photo_offs, y2+photo_offs, gc->width, photo_palette[photo_color].dark, CAPS(gc->cap));
}
indent(&snormal);
- pcb_append_printf(&snormal, "<path d=\"M %mm %mm A %mm %mm 0 0 0 %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
- x1, y1, r, r, x2, y2, gc->width, photo_palette[photo_color].normal, CAPS(gc->cap));
+ pcb_append_printf(&snormal, "<path d=\"M %.8mm %.8mm A %mm %mm 0 %d %d %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
+ x1, y1, r, r, large, sweep, x2, y2, gc->width, photo_palette[photo_color].normal, CAPS(gc->cap));
}
else {
indent(&snormal);
- pcb_append_printf(&snormal, "<path d=\"M %mm %mm A %mm %mm 0 0 0 %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
- x1, y1, r, r, x2, y2, gc->width, gc->color, CAPS(gc->cap));
+ pcb_append_printf(&snormal, "<path d=\"M %.8mm %.8mm A %mm %mm 0 %d %d %mm %mm\" stroke-width=\"%mm\" stroke=\"%s\" stroke-linecap=\"%s\" fill=\"none\"/>\n",
+ x1, y1, r, r, large, sweep, x2, y2, gc->width, gc->color, CAPS(gc->cap));
}
}
-static void svg_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void svg_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- Coord x1, y1, x2, y2;
- Angle sa, ea;
+ pcb_coord_t x1, y1, x2, y2, diff = 0;
+ pcb_angle_t sa, ea;
TRX(cx); TRY(cy);
@@ -589,29 +590,30 @@ static void svg_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height
start_angle = -start_angle;
delta_angle = -delta_angle;
}
- if (delta_angle > 0) {
- sa = start_angle;
- ea = start_angle + delta_angle;
- }
- else {
- sa = start_angle + delta_angle;
- ea = start_angle;
- }
+
+
+ if (delta_angle >= +360.0) { delta_angle = 359.999; diff=1; }
+ if (delta_angle <= -360.0) { delta_angle = 359.999; diff=1; }
+
+ if (fabs(delta_angle) <= 0.001) { delta_angle = 0.001; diff=1; }
+
+ sa = start_angle;
+ ea = start_angle + delta_angle;
/* calculate the endpoints */
x2 = cx + (width * cos(sa * M_PI / 180));
y2 = cy + (width * sin(sa * M_PI / 180));
- x1 = cx + (width * cos(ea * M_PI / 180));
- y1 = cy + (width * sin(ea * M_PI / 180));
+ x1 = cx + (width * cos(ea * M_PI / 180))+diff;
+ y1 = cy + (width * sin(ea * M_PI / 180))+diff;
- draw_arc(gc, x1, y1, width, x2, y2, gc->width);
+ draw_arc(gc, x1, y1, width, x2, y2, gc->width, (fabs(delta_angle) > 180), (delta_angle < 0.0));
}
-static void draw_fill_circle(hidGC gc, Coord cx, Coord cy, Coord r, Coord stroke)
+static void draw_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r, pcb_coord_t stroke)
{
if ((photo_mode) && (!gc->erase)) {
if (!drawing_hole) {
- Coord photo_offs = photo_palette[photo_color].offs;
+ pcb_coord_t photo_offs = photo_palette[photo_color].offs;
if ((!gc->drill) && (photo_offs != 0)) {
indent(&sbright);
pcb_append_printf(&sbright, "<circle cx=\"%mm\" cy=\"%mm\" r=\"%mm\" stroke-width=\"%mm\" fill=\"%s\" stroke=\"none\"/>\n",
@@ -638,13 +640,13 @@ static void draw_fill_circle(hidGC gc, Coord cx, Coord cy, Coord r, Coord stroke
}
}
-static void svg_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void svg_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
TRX(cx); TRY(cy);
draw_fill_circle(gc, cx, cy, radius, gc->width);
}
-static void draw_poly(gds_t *s, hidGC gc, int n_coords, Coord * x, Coord * y, Coord offs, const char *clr)
+static void draw_poly(gds_t *s, pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t offs, const char *clr)
{
int i;
float poly_bloat = 0.075;
@@ -652,17 +654,17 @@ static void draw_poly(gds_t *s, hidGC gc, int n_coords, Coord * x, Coord * y, Co
indent(s);
gds_append_str(s, "<polygon points=\"");
for (i = 0; i < n_coords; i++) {
- Coord px = x[i], py = y[i];
+ pcb_coord_t px = x[i], py = y[i];
TRX(px); TRY(py);
pcb_append_printf(s, "%mm,%mm ", px+offs, py+offs);
}
pcb_append_printf(s, "\" stroke-width=\"%.3f\" stroke=\"%s\" fill=\"%s\"/>\n", poly_bloat, clr, clr);
}
-static void svg_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void svg_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
if ((photo_mode) && (!gc->erase)) {
- Coord photo_offs = photo_palette[photo_color].offs;
+ pcb_coord_t photo_offs = photo_palette[photo_color].offs;
if (photo_offs != 0) {
draw_poly(&sbright, gc, n_coords, x, y, -photo_offs, photo_palette[photo_color].bright);
draw_poly(&sdark, gc, n_coords, x, y, +photo_offs, photo_palette[photo_color].dark);
@@ -675,7 +677,7 @@ static void svg_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
static void svg_calibrate(double xval, double yval)
{
- Message(PCB_MSG_ERROR, "svg_calibrate() not implemented");
+ pcb_message(PCB_MSG_ERROR, "svg_calibrate() not implemented");
return;
}
@@ -686,7 +688,7 @@ static void svg_set_crosshair(int x, int y, int a)
static int svg_usage(const char *topic)
{
fprintf(stderr, "\nsvg exporter command line arguments:\n\n");
- hid_usage(svg_attribute_list, sizeof(svg_attribute_list) / sizeof(svg_attribute_list[0]));
+ pcb_hid_usage(svg_attribute_list, sizeof(svg_attribute_list) / sizeof(svg_attribute_list[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x svg foo.pcb [svg options]\n\n");
return 0;
}
@@ -695,12 +697,12 @@ static int svg_usage(const char *topic)
pcb_uninit_t hid_export_svg_init()
{
- memset(&svg_hid, 0, sizeof(HID));
+ memset(&svg_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&svg_hid);
- common_draw_helpers_init(&svg_hid);
+ pcb_hid_nogui_init(&svg_hid);
+ pcb_dhlp_draw_helpers_init(&svg_hid);
- svg_hid.struct_size = sizeof(HID);
+ svg_hid.struct_size = sizeof(pcb_hid_t);
svg_hid.name = "svg";
svg_hid.description = "Scalable Vector Graphics export";
svg_hid.exporter = 1;
@@ -710,7 +712,7 @@ pcb_uninit_t hid_export_svg_init()
svg_hid.get_export_options = svg_get_export_options;
svg_hid.do_export = svg_do_export;
svg_hid.parse_arguments = svg_parse_arguments;
- svg_hid.set_layer = svg_set_layer;
+ svg_hid.set_layer_group = svg_set_layer_group;
svg_hid.make_gc = svg_make_gc;
svg_hid.destroy_gc = svg_destroy_gc;
svg_hid.use_mask = svg_use_mask;
@@ -729,7 +731,7 @@ pcb_uninit_t hid_export_svg_init()
svg_hid.usage = svg_usage;
- hid_register_hid(&svg_hid);
+ pcb_hid_register_hid(&svg_hid);
return NULL;
}
diff --git a/src_plugins/export_test/Makefile b/src_plugins/export_test/Makefile
index 2213a7f..58f3c4b 100644
--- a/src_plugins/export_test/Makefile
+++ b/src_plugins/export_test/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_test
+ cd ../../src && $(MAKE) mod_export_test
clean:
diff --git a/src_plugins/export_test/export_test.c b/src_plugins/export_test/export_test.c
index c4d65cd..e82250d 100644
--- a/src_plugins/export_test/export_test.c
+++ b/src_plugins/export_test/export_test.c
@@ -7,10 +7,10 @@
#include <string.h>
#include <time.h>
-#include "global.h"
+#include "build_run.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "plugins.h"
@@ -22,7 +22,7 @@
const char *export_test_cookie = "export_test HID";
-static HID_Attribute export_test_options[] = {
+static pcb_hid_attribute_t export_test_options[] = {
/* %start-doc options "8 export_test Creation"
@ftable @code
@item --export_testfile <string>
@@ -37,16 +37,16 @@ Name of the export_test output file. Use stdout if not specified.
#define NUM_OPTIONS (sizeof(export_test_options)/sizeof(export_test_options[0]))
-static HID_Attr_Val export_test_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t export_test_values[NUM_OPTIONS];
static const char *export_test_filename;
-static HID_Attribute *export_test_get_export_options(int *n)
+static pcb_hid_attribute_t *export_test_get_export_options(int *n)
{
static char *last_export_test_filename = 0;
if (PCB) {
- derive_default_filename(PCB->Filename, &export_test_options[HA_export_testfile], ".export_test", &last_export_test_filename);
+ pcb_derive_default_filename(PCB->Filename, &export_test_options[HA_export_testfile], ".export_test", &last_export_test_filename);
}
if (n)
@@ -98,7 +98,7 @@ static int Printexport_test(void)
{
#if 0
char utcTime[64];
- Coord x, y;
+ pcb_coord_t x, y;
double theta = 0.0;
double sumx, sumy;
double pin1x = 0.0, pin1y = 0.0, pin1angle = 0.0;
@@ -130,7 +130,7 @@ static int Printexport_test(void)
fprintf(fp, "# PcbXY Version 1.0\n");
fprintf(fp, "# Date: %s\n", utcTime);
fprintf(fp, "# Author: %s\n", pcb_author());
- fprintf(fp, "# Title: %s - PCB X-Y\n", UNKNOWN(PCB->Name));
+ fprintf(fp, "# Title: %s - PCB X-Y\n", PCB_UNKNOWN(PCB->Name));
fprintf(fp, "# RefDes, Description, Value, X, Y, rotation, top/bottom\n");
fprintf(fp, "# X,Y in %s. rotation in degrees.\n", xy_unit->in_suffix);
fprintf(fp, "# --------------------------------------------\n");
@@ -141,7 +141,7 @@ static int Printexport_test(void)
* While here generate the export_test list
*/
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/* initialize our pin count and our totals for finding the
@@ -153,8 +153,8 @@ static int Printexport_test(void)
found_pin2 = 0;
/* insert this component into the bill of materials list */
- export_test = export_test_insert((char *) UNKNOWN(NAMEONPCB_NAME(element)),
- (char *) UNKNOWN(DESCRIPTION_NAME(element)), (char *) UNKNOWN(VALUE_NAME(element)), export_test);
+ export_test = export_test_insert((char *) PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)),
+ (char *) PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)), (char *) PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)), export_test);
/*
@@ -165,33 +165,33 @@ static int Printexport_test(void)
* we can find them
*/
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
sumx += (double) pin->X;
sumy += (double) pin->Y;
pin_cnt++;
- if (NSTRCMP(pin->Number, "1") == 0) {
+ if (PCB_NSTRCMP(pin->Number, "1") == 0) {
pin1x = (double) pin->X;
pin1y = (double) pin->Y;
pin1angle = 0.0; /* pins have no notion of angle */
found_pin1 = 1;
}
- else if (NSTRCMP(pin->Number, "2") == 0) {
+ else if (PCB_NSTRCMP(pin->Number, "2") == 0) {
pin2x = (double) pin->X;
pin2y = (double) pin->Y;
found_pin2 = 1;
}
}
- END_LOOP;
+ PCB_END_LOOP;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
sumx += (pad->Point1.X + pad->Point2.X) / 2.0;
sumy += (pad->Point1.Y + pad->Point2.Y) / 2.0;
pin_cnt++;
- if (NSTRCMP(pad->Number, "1") == 0) {
+ if (PCB_NSTRCMP(pad->Number, "1") == 0) {
pin1x = (double) (pad->Point1.X + pad->Point2.X) / 2.0;
pin1y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0;
/*
@@ -202,14 +202,14 @@ static int Printexport_test(void)
pin1angle = (180.0 / M_PI) * atan2(pad->Point1.Y - pad->Point2.Y, pad->Point2.X - pad->Point1.X);
found_pin1 = 1;
}
- else if (NSTRCMP(pad->Number, "2") == 0) {
+ else if (PCB_NSTRCMP(pad->Number, "2") == 0) {
pin2x = (double) (pad->Point1.X + pad->Point2.X) / 2.0;
pin2y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0;
found_pin2 = 1;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (pin_cnt > 0) {
x = sumx / (double) pin_cnt;
@@ -235,7 +235,7 @@ static int Printexport_test(void)
("Printexport_test(): unable to figure out angle of element\n"
" %s because pin #1 is at the centroid of the part.\n"
" and I could not find pin #2's location\n"
- " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta);
+ " Setting to %g degrees\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), theta);
}
}
else
@@ -247,22 +247,22 @@ static int Printexport_test(void)
theta = 0.0;
Message
("Printexport_test(): unable to figure out angle because I could\n"
- " not find pin #1 of element %s\n" " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta);
+ " not find pin #1 of element %s\n" " Setting to %g degrees\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), theta);
}
- name = Cleanexport_testString((char *) UNKNOWN(NAMEONPCB_NAME(element)));
- descr = Cleanexport_testString((char *) UNKNOWN(DESCRIPTION_NAME(element)));
- value = Cleanexport_testString((char *) UNKNOWN(VALUE_NAME(element)));
+ name = Cleanexport_testString((char *) PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)));
+ descr = Cleanexport_testString((char *) PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)));
+ value = Cleanexport_testString((char *) PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)));
y = PCB->MaxHeight - y;
pcb_fprintf(fp, "%m+%s,\"%s\",\"%s\",%mS,%.2mS,%g,%s\n",
- xy_unit->allow, name, descr, value, x, y, theta, FRONT(element) == 1 ? "top" : "bottom");
+ xy_unit->allow, name, descr, value, x, y, theta, PCB_FRONT(element) == 1 ? "top" : "bottom");
free(name);
free(descr);
free(value);
}
}
- END_LOOP;
+ PCB_END_LOOP;
fclose(fp);
@@ -280,7 +280,7 @@ static int Printexport_test(void)
fprintf(fp, "# Pcbexport_test Version 1.0\n");
fprintf(fp, "# Date: %s\n", utcTime);
fprintf(fp, "# Author: %s\n", pcb_author());
- fprintf(fp, "# Title: %s - PCB export_test\n", UNKNOWN(PCB->Name));
+ fprintf(fp, "# Title: %s - PCB export_test\n", PCB_UNKNOWN(PCB->Name));
fprintf(fp, "# Quantity, Description, Value, RefDes\n");
fprintf(fp, "# --------------------------------------------\n");
@@ -292,7 +292,7 @@ static int Printexport_test(void)
return (0);
}
-static void export_test_do_export(HID_Attr_Val * options)
+static void export_test_do_export(pcb_hid_attr_val_t * options)
{
int i;
@@ -316,7 +316,7 @@ static void export_test_do_export(HID_Attr_Val * options)
static int export_test_usage(const char *topic)
{
fprintf(stderr, "\nexport_test exporter command line arguments:\n\n");
- hid_usage(export_test_options, sizeof(export_test_options) / sizeof(export_test_options[0]));
+ pcb_hid_usage(export_test_options, sizeof(export_test_options) / sizeof(export_test_options[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x export_test foo.pcb [export_test_options]\n\n");
return 0;
}
@@ -324,19 +324,19 @@ static int export_test_usage(const char *topic)
static void export_test_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(export_test_options, sizeof(export_test_options) / sizeof(export_test_options[0]), export_test_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(export_test_options, sizeof(export_test_options) / sizeof(export_test_options[0]), export_test_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-HID export_test_hid;
+pcb_hid_t export_test_hid;
pcb_uninit_t hid_export_test_init()
{
- memset(&export_test_hid, 0, sizeof(HID));
+ memset(&export_test_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&export_test_hid);
+ pcb_hid_nogui_init(&export_test_hid);
- export_test_hid.struct_size = sizeof(HID);
+ export_test_hid.struct_size = sizeof(pcb_hid_t);
export_test_hid.name = "export_test";
export_test_hid.description = "Exports a dump of HID calls";
export_test_hid.exporter = 1;
@@ -347,6 +347,6 @@ pcb_uninit_t hid_export_test_init()
export_test_hid.usage = export_test_usage;
- hid_register_hid(&export_test_hid);
+ pcb_hid_register_hid(&export_test_hid);
return NULL;
}
diff --git a/src_plugins/export_xy/Makefile b/src_plugins/export_xy/Makefile
index 52b1a8f..ab66147 100644
--- a/src_plugins/export_xy/Makefile
+++ b/src_plugins/export_xy/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_export_xy
+ cd ../../src && $(MAKE) mod_export_xy
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/export_xy/xy.c b/src_plugins/export_xy/xy.c
index 4ec6ec3..da578f7 100644
--- a/src_plugins/export_xy/xy.c
+++ b/src_plugins/export_xy/xy.c
@@ -7,13 +7,15 @@
#include <string.h>
#include <time.h>
-#include "global.h"
+#include "math_helper.h"
+#include "build_run.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "plugins.h"
#include "compat_misc.h"
+#include "obj_pinvia.h"
#include "hid.h"
#include "hid_nogui.h"
@@ -26,7 +28,7 @@ extern char *CleanBOMString(const char *in);
const char *xy_cookie = "bom HID";
-static HID_Attribute xy_options[] = {
+static pcb_hid_attribute_t xy_options[] = {
/* %start-doc options "8 XY Creation"
@ftable @code
@item --xyfile <string>
@@ -55,12 +57,12 @@ Unit of XY dimensions. Defaults to mil.
#define NUM_OPTIONS (sizeof(xy_options)/sizeof(xy_options[0]))
-static HID_Attr_Val xy_values[NUM_OPTIONS];
+static pcb_hid_attr_val_t xy_values[NUM_OPTIONS];
static const char *xy_filename;
-static const Unit *xy_unit;
+static const pcb_unit_t *xy_unit;
-static HID_Attribute *xy_get_export_options(int *n)
+static pcb_hid_attribute_t *xy_get_export_options(int *n)
{
static char *last_xy_filename = 0;
static int last_unit_value = -1;
@@ -73,7 +75,7 @@ static HID_Attribute *xy_get_export_options(int *n)
last_unit_value = xy_options[HA_unit].default_val.int_value;
}
if (PCB)
- derive_default_filename(PCB->Filename, &xy_options[HA_xyfile], ".xy", &last_xy_filename);
+ pcb_derive_default_filename(PCB->Filename, &xy_options[HA_xyfile], ".xy", &last_xy_filename);
if (n)
*n = NUM_OPTIONS;
@@ -138,7 +140,7 @@ static char *reference_pin_names[] = {"1", "2", "A1", "A2", "B1", "B2", 0};
static int PrintXY(void)
{
char utcTime[64];
- Coord x, y;
+ pcb_coord_t x, y;
double theta = 0.0;
double sumx, sumy;
double pin1x = 0.0, pin1y = 0.0;
@@ -157,7 +159,7 @@ static int PrintXY(void)
fp = fopen(xy_filename, "w");
if (!fp) {
- gui->log("Cannot open file %s for writing\n", xy_filename);
+ pcb_gui->log("Cannot open file %s for writing\n", xy_filename);
return 1;
}
@@ -173,7 +175,7 @@ static int PrintXY(void)
fprintf(fp, "# PcbXY Version 1.0\n");
fprintf(fp, "# Date: %s\n", utcTime);
fprintf(fp, "# Author: %s\n", pcb_author());
- fprintf(fp, "# Title: %s - PCB X-Y\n", UNKNOWN(PCB->Name));
+ fprintf(fp, "# Title: %s - PCB X-Y\n", PCB_UNKNOWN(PCB->Name));
fprintf(fp, "# RefDes, Description, Value, X, Y, rotation, top/bottom\n");
fprintf(fp, "# X,Y in %s. rotation in degrees.\n", xy_unit->in_suffix);
fprintf(fp, "# --------------------------------------------\n");
@@ -182,7 +184,7 @@ static int PrintXY(void)
* For each element we calculate the centroid of the footprint.
*/
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/* initialize our pin count and our totals for finding the
centriod */
@@ -198,14 +200,14 @@ static int PrintXY(void)
* we can find them
*/
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
sumx += (double) pin->X;
sumy += (double) pin->Y;
pin_cnt++;
for (rpindex = 0; reference_pin_names[rpindex]; rpindex++) {
- if (NSTRCMP(pin->Number, reference_pin_names[rpindex]) == 0) {
+ if (PCB_NSTRCMP(pin->Number, reference_pin_names[rpindex]) == 0) {
pinx[rpindex] = (double) pin->X;
piny[rpindex] = (double) pin->Y;
pinangle[rpindex] = 0.0; /* pins have no notion of angle */
@@ -213,16 +215,16 @@ static int PrintXY(void)
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
sumx += (pad->Point1.X + pad->Point2.X) / 2.0;
sumy += (pad->Point1.Y + pad->Point2.Y) / 2.0;
pin_cnt++;
for (rpindex = 0; reference_pin_names[rpindex]; rpindex++) {
- if (NSTRCMP(pad->Number, reference_pin_names[rpindex]) == 0) {
+ if (PCB_NSTRCMP(pad->Number, reference_pin_names[rpindex]) == 0) {
padcentrex = (double) (pad->Point1.X + pad->Point2.X) / 2.0;
padcentrey = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0;
pinx[rpindex] = padcentrex;
@@ -237,13 +239,13 @@ static int PrintXY(void)
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (pin_cnt > 0) {
centroidx = sumx / (double) pin_cnt;
centroidy = sumy / (double) pin_cnt;
- if (NSTRCMP(AttributeGetFromList(&element->Attributes, "xy-centre"), "origin") == 0) {
+ if (PCB_NSTRCMP(pcb_attribute_get(&element->Attributes, "xy-centre"), "origin") == 0) {
x = element->MarkX;
y = element->MarkY;
}
@@ -252,7 +254,7 @@ static int PrintXY(void)
y = centroidy;
}
- fixed_rotation = AttributeGetFromList(&element->Attributes, "xy-fixed-rotation");
+ fixed_rotation = pcb_attribute_get(&element->Attributes, "xy-fixed-rotation");
if (fixed_rotation) {
/* The user specified a fixed rotation */
theta = atof(fixed_rotation);
@@ -274,7 +276,7 @@ static int PrintXY(void)
pin1y = piny[rpindex] - y;
/* flip x, to reverse rotation for elements on back */
- if (FRONT(element) != 1)
+ if (PCB_FRONT(element) != 1)
pin1x = -pin1x;
/* if only 1 pin, use pin 1's angle */
@@ -290,40 +292,40 @@ static int PrintXY(void)
}
if (!found_any) {
- Message
+ pcb_message
(PCB_MSG_WARNING, "PrintBOM(): unable to figure out angle because I could\n"
" not find a suitable reference pin of element %s\n"
- " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta);
+ " Setting to %g degrees\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), theta);
}
else if (!found_any_not_at_centroid) {
- Message
+ pcb_message
(PCB_MSG_WARNING, "PrintBOM(): unable to figure out angle of element\n"
" %s because the reference pin(s) are at the centroid of the part.\n"
- " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta);
+ " Setting to %g degrees\n", PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), theta);
}
}
}
- name = CleanBOMString((char *) UNKNOWN(NAMEONPCB_NAME(element)));
- descr = CleanBOMString((char *) UNKNOWN(DESCRIPTION_NAME(element)));
- value = CleanBOMString((char *) UNKNOWN(VALUE_NAME(element)));
+ name = CleanBOMString((char *) PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)));
+ descr = CleanBOMString((char *) PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)));
+ value = CleanBOMString((char *) PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)));
y = PCB->MaxHeight - y;
pcb_fprintf(fp, "%m+%s,\"%s\",\"%s\",%mS,%.2mS,%g,%s\n",
- xy_unit->allow, name, descr, value, x, y, theta, FRONT(element) == 1 ? "top" : "bottom");
+ xy_unit->allow, name, descr, value, x, y, theta, PCB_FRONT(element) == 1 ? "top" : "bottom");
free(name);
free(descr);
free(value);
}
- END_LOOP;
+ PCB_END_LOOP;
fclose(fp);
return (0);
}
-static void xy_do_export(HID_Attr_Val * options)
+static void xy_do_export(pcb_hid_attr_val_t * options)
{
int i;
@@ -349,26 +351,26 @@ static void xy_do_export(HID_Attr_Val * options)
static int xy_usage(const char *topic)
{
fprintf(stderr, "\nXY exporter command line arguments:\n\n");
- hid_usage(xy_options, sizeof(xy_options) / sizeof(xy_options[0]));
+ pcb_hid_usage(xy_options, sizeof(xy_options) / sizeof(xy_options[0]));
fprintf(stderr, "\nUsage: pcb-rnd [generic_options] -x xy foo.pcb [xy_options]\n\n");
return 0;
}
static void xy_parse_arguments(int *argc, char ***argv)
{
- hid_register_attributes(xy_options, sizeof(xy_options) / sizeof(xy_options[0]), xy_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(xy_options, sizeof(xy_options) / sizeof(xy_options[0]), xy_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
}
-HID xy_hid;
+pcb_hid_t xy_hid;
pcb_uninit_t hid_export_xy_init()
{
- memset(&xy_hid, 0, sizeof(HID));
+ memset(&xy_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&xy_hid);
+ pcb_hid_nogui_init(&xy_hid);
- xy_hid.struct_size = sizeof(HID);
+ xy_hid.struct_size = sizeof(pcb_hid_t);
xy_hid.name = "XY";
xy_hid.description = "Exports a XY (centroid)";
xy_hid.exporter = 1;
@@ -379,6 +381,6 @@ pcb_uninit_t hid_export_xy_init()
xy_hid.usage = xy_usage;
- hid_register_hid(&xy_hid);
+ pcb_hid_register_hid(&xy_hid);
return NULL;
}
diff --git a/src_plugins/fontmode/Makefile b/src_plugins/fontmode/Makefile
index 0692e77..1a1edd5 100644
--- a/src_plugins/fontmode/Makefile
+++ b/src_plugins/fontmode/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_fontmode
+ cd ../../src && $(MAKE) mod_fontmode
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/fontmode/fontmode.c b/src_plugins/fontmode/fontmode.c
index 45801f5..65aee1f 100644
--- a/src_plugins/fontmode/fontmode.c
+++ b/src_plugins/fontmode/fontmode.c
@@ -27,27 +27,27 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
+#include "board.h"
#include <math.h>
#include <memory.h>
#include <limits.h>
-#include "create.h"
#include "data.h"
#include "draw.h"
+#include "flag.h"
#include "layer.h"
-#include "misc.h"
#include "move.h"
#include "remove.h"
#include "rtree.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "undo.h"
#include "pcb-printf.h"
#include "plugins.h"
#include "hid_actions.h"
#include "compat_misc.h"
+#include "event.h"
/* FIXME - we currently hardcode the grid and PCB size. What we
should do in the future is scan the font for its extents, and size
@@ -55,7 +55,7 @@
should search the grid for the gridlines and use them to figure out
where the symbols are. */
-#define CELL_SIZE ((Coord)(PCB_MIL_TO_COORD (100)))
+#define CELL_SIZE ((pcb_coord_t)(PCB_MIL_TO_COORD (100)))
#define XYtoSym(x,y) (((x) / CELL_SIZE - 1) + (16 * ((y) / CELL_SIZE - 1)))
@@ -67,14 +67,14 @@ static const char fontedit_help[] = "Convert the current font to a PCB for editi
%end-doc */
-static int FontEdit(int argc, const char **argv, Coord Ux, Coord Uy)
+static int FontEdit(int argc, const char **argv, pcb_coord_t Ux, pcb_coord_t Uy)
{
- FontType *font;
- SymbolType *symbol;
- LayerTypePtr lfont, lorig, lwidth, lgrid;
+ pcb_font_t *font;
+ pcb_symbol_t *symbol;
+ pcb_layer_t *lfont, *lorig, *lwidth, *lgrid;
int s, l;
- if (hid_actionl("New", "Font", 0))
+ if (pcb_hid_actionl("New", "Font", 0))
return 1;
#warning TODO do we need to change design.bloat here?
@@ -84,23 +84,23 @@ static int FontEdit(int argc, const char **argv, Coord Ux, Coord Uy)
conf_set_design("design/min_wid", "%s", "1"); PCB->minWid = 1;
conf_set_design("design/min_slk", "%s", "1"); PCB->minSlk = 1;
- MoveLayerToGroup(max_copper_layer + COMPONENT_LAYER, 0);
- MoveLayerToGroup(max_copper_layer + SOLDER_LAYER, 1);
+ pcb_layer_move_to_group(pcb_max_copper_layer + PCB_COMPONENT_SIDE, 0);
+ pcb_layer_move_to_group(pcb_max_copper_layer + PCB_SOLDER_SIDE, 1);
while (PCB->Data->LayerN > 4)
- MoveLayer(4, -1);
+ pcb_layer_move(4, -1);
for (l = 0; l < 4; l++) {
- MoveLayerToGroup(l, l);
+ pcb_layer_move_to_group(l, l);
}
PCB->MaxWidth = CELL_SIZE * 18;
- PCB->MaxHeight = CELL_SIZE * ((MAX_FONTPOSITION + 15) / 16 + 2);
+ PCB->MaxHeight = CELL_SIZE * ((PCB_MAX_FONTPOSITION + 15) / 16 + 2);
PCB->Grid = PCB_MIL_TO_COORD(5);
PCB->Data->Layer[0].Name = pcb_strdup("Font");
PCB->Data->Layer[1].Name = pcb_strdup("OrigFont");
PCB->Data->Layer[2].Name = pcb_strdup("Width");
PCB->Data->Layer[3].Name = pcb_strdup("Grid");
- hid_action("PCBChanged");
- hid_action("LayersChanged");
+ pcb_event(PCB_EVENT_BOARD_CHANGED, NULL);
+ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL);
lfont = PCB->Data->Layer + 0;
lorig = PCB->Data->Layer + 1;
@@ -108,10 +108,10 @@ static int FontEdit(int argc, const char **argv, Coord Ux, Coord Uy)
lgrid = PCB->Data->Layer + 3;
font = &PCB->Font;
- for (s = 0; s <= MAX_FONTPOSITION; s++) {
- Coord ox = (s % 16 + 1) * CELL_SIZE;
- Coord oy = (s / 16 + 1) * CELL_SIZE;
- Coord w, miny, maxy, maxx = 0;
+ for (s = 0; s <= PCB_MAX_FONTPOSITION; s++) {
+ pcb_coord_t ox = (s % 16 + 1) * CELL_SIZE;
+ pcb_coord_t oy = (s / 16 + 1) * CELL_SIZE;
+ pcb_coord_t w, miny, maxy, maxx = 0;
symbol = &font->Symbol[s];
@@ -119,31 +119,31 @@ static int FontEdit(int argc, const char **argv, Coord Ux, Coord Uy)
maxy = font->MaxHeight;
for (l = 0; l < symbol->LineN; l++) {
- CreateDrawnLineOnLayer(lfont,
+ pcb_line_new_merge(lfont,
symbol->Line[l].Point1.X + ox,
symbol->Line[l].Point1.Y + oy,
symbol->Line[l].Point2.X + ox,
- symbol->Line[l].Point2.Y + oy, symbol->Line[l].Thickness, symbol->Line[l].Thickness, NoFlags());
- CreateDrawnLineOnLayer(lorig, symbol->Line[l].Point1.X + ox,
+ symbol->Line[l].Point2.Y + oy, symbol->Line[l].Thickness, symbol->Line[l].Thickness, pcb_no_flags());
+ pcb_line_new_merge(lorig, symbol->Line[l].Point1.X + ox,
symbol->Line[l].Point1.Y + oy,
symbol->Line[l].Point2.X + ox,
- symbol->Line[l].Point2.Y + oy, symbol->Line[l].Thickness, symbol->Line[l].Thickness, NoFlags());
+ symbol->Line[l].Point2.Y + oy, symbol->Line[l].Thickness, symbol->Line[l].Thickness, pcb_no_flags());
if (maxx < symbol->Line[l].Point1.X)
maxx = symbol->Line[l].Point1.X;
if (maxx < symbol->Line[l].Point2.X)
maxx = symbol->Line[l].Point2.X;
}
w = maxx + symbol->Delta + ox;
- CreateDrawnLineOnLayer(lwidth, w, miny + oy, w, maxy + oy, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), NoFlags());
+ pcb_line_new_merge(lwidth, w, miny + oy, w, maxy + oy, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags());
}
for (l = 0; l < 16; l++) {
int x = (l + 1) * CELL_SIZE;
- CreateDrawnLineOnLayer(lgrid, x, 0, x, PCB->MaxHeight, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), NoFlags());
+ pcb_line_new_merge(lgrid, x, 0, x, PCB->MaxHeight, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags());
}
- for (l = 0; l <= MAX_FONTPOSITION / 16 + 1; l++) {
+ for (l = 0; l <= PCB_MAX_FONTPOSITION / 16 + 1; l++) {
int y = (l + 1) * CELL_SIZE;
- CreateDrawnLineOnLayer(lgrid, 0, y, PCB->MaxWidth, y, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), NoFlags());
+ pcb_line_new_merge(lgrid, 0, y, PCB->MaxWidth, y, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags());
}
return 0;
}
@@ -156,20 +156,20 @@ static const char fontsave_help[] = "Convert the current PCB back to a font.";
%end-doc */
-static int FontSave(int argc, const char **argv, Coord Ux, Coord Uy)
+static int FontSave(int argc, const char **argv, pcb_coord_t Ux, pcb_coord_t Uy)
{
- FontTypePtr font;
- SymbolTypePtr symbol;
+ pcb_font_t *font;
+ pcb_symbol_t *symbol;
int i;
- LineType *l;
+ pcb_line_t *l;
gdl_iterator_t it;
- LayerTypePtr lfont, lwidth;
+ pcb_layer_t *lfont, *lwidth;
font = &PCB->Font;
lfont = PCB->Data->Layer + 0;
lwidth = PCB->Data->Layer + 2;
- for (i = 0; i <= MAX_FONTPOSITION; i++) {
+ for (i = 0; i <= PCB_MAX_FONTPOSITION; i++) {
font->Symbol[i].LineN = 0;
font->Symbol[i].Valid = 0;
font->Symbol[i].Width = 0;
@@ -198,13 +198,13 @@ static int FontSave(int argc, const char **argv, Coord Ux, Coord Uy)
symbol->Width = x2;
symbol->Valid = 1;
- CreateNewLineInSymbol(symbol, x1, y1, x2, y2, l->Thickness);
+ pcb_font_new_line_in_sym(symbol, x1, y1, x2, y2, l->Thickness);
}
linelist_foreach(&lwidth->Line, &it, l) {
- Coord x1 = l->Point1.X;
- Coord y1 = l->Point1.Y;
- Coord ox, s;
+ pcb_coord_t x1 = l->Point1.X;
+ pcb_coord_t y1 = l->Point1.Y;
+ pcb_coord_t ox, s;
s = XYtoSym(x1, y1);
ox = (s % 16 + 1) * CELL_SIZE;
@@ -215,12 +215,12 @@ static int FontSave(int argc, const char **argv, Coord Ux, Coord Uy)
symbol->Delta = x1 - symbol->Width;
}
- SetFontInfo(font);
+ pcb_font_set_info(font);
return 0;
}
-HID_Action fontmode_action_list[] = {
+pcb_hid_action_t fontmode_action_list[] = {
{"FontEdit", 0, FontEdit,
fontedit_help, fontedit_syntax}
,
@@ -230,16 +230,16 @@ HID_Action fontmode_action_list[] = {
static const char *fontmode_cookie = "fontmode plugin";
-REGISTER_ACTIONS(fontmode_action_list, fontmode_cookie)
+PCB_REGISTER_ACTIONS(fontmode_action_list, fontmode_cookie)
static void hid_fontmode_uninit(void)
{
- hid_remove_actions_by_cookie(fontmode_cookie);
+ pcb_hid_remove_actions_by_cookie(fontmode_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_fontmode_init(void)
{
- REGISTER_ACTIONS(fontmode_action_list, fontmode_cookie)
+ PCB_REGISTER_ACTIONS(fontmode_action_list, fontmode_cookie)
return hid_fontmode_uninit;
}
diff --git a/src_plugins/fp_fs/Makefile b/src_plugins/fp_fs/Makefile
index eed8033..431bedb 100644
--- a/src_plugins/fp_fs/Makefile
+++ b/src_plugins/fp_fs/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_fp_fs
+ cd ../../src && $(MAKE) mod_fp_fs
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/fp_fs/fp_fs.c b/src_plugins/fp_fs/fp_fs.c
index 52f7dd1..f8609b4 100644
--- a/src_plugins/fp_fs/fp_fs.c
+++ b/src_plugins/fp_fs/fp_fs.c
@@ -36,8 +36,8 @@
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
-#include "mymem.h"
#include "data.h"
#include "paths.h"
#include "plugins.h"
@@ -45,14 +45,15 @@
#include "compat_fs.h"
#include "compat_misc.h"
#include "error.h"
-#include "misc.h"
#include "conf.h"
#include "conf_core.h"
+#include "compat_nls.h"
+#include "macro.h"
/* opendir, readdir */
#include "compat_inc.h"
-static fp_type_t pcb_fp_file_type(const char *fn, void ***tags);
+static pcb_fptype_t pcb_fp_file_type(const char *fn, void ***tags);
/* ---------------------------------------------------------------------------
* Parse the directory tree where newlib footprints are found
@@ -66,20 +67,20 @@ struct list_dir_s {
};
typedef struct {
- library_t *menu;
+ pcb_fplibrary_t *menu;
list_dir_t *subdirs;
int children;
} list_st_t;
-static int list_cb(void *cookie, const char *subdir, const char *name, fp_type_t type, void *tags[])
+static int list_cb(void *cookie, const char *subdir, const char *name, pcb_fptype_t type, void *tags[])
{
list_st_t *l = (list_st_t *) cookie;
- library_t *e;
+ pcb_fplibrary_t *e;
if (type == PCB_FP_DIR) {
list_dir_t *d;
/* can not recurse directly from here because that would ruin the menu
- pointer: GetLibraryMenuMemory (&Library) calls realloc()!
+ pointer: pcb_lib_menu_new(&Library) calls realloc()!
Build a list of directories to be visited later, instead. */
d = malloc(sizeof(list_dir_t));
d->subdir = pcb_strdup(name);
@@ -90,9 +91,9 @@ static int list_cb(void *cookie, const char *subdir, const char *name, fp_type_t
}
l->children++;
- e = fp_append_entry(l->menu, name, type, tags);
+ e = pcb_fp_append_entry(l->menu, name, type, tags);
-/* Avoid using Concat() - would be a new dependency for gsch2pcb-rnd */
+/* Avoid using pcb_concat() - would be a new dependency for gsch2pcb-rnd */
{
int sl = strlen(subdir);
int nl = strlen(name);
@@ -107,13 +108,13 @@ static int list_cb(void *cookie, const char *subdir, const char *name, fp_type_t
return 0;
}
-static int fp_fs_list(library_t *pl, const char *subdir, int recurse,
- int (*cb) (void *cookie, const char *subdir, const char *name, fp_type_t type, void *tags[]), void *cookie,
+static int fp_fs_list(pcb_fplibrary_t *pl, const char *subdir, int recurse,
+ int (*cb) (void *cookie, const char *subdir, const char *name, pcb_fptype_t type, void *tags[]), void *cookie,
int subdir_may_not_exist, int need_tags)
{
- char olddir[MAXPATHLEN + 1]; /* The directory we start out in (cwd) */
- char new_subdir[MAXPATHLEN + 1];
- char fn[MAXPATHLEN + 1], *fn_end;
+ char olddir[PCB_PATH_MAX + 1]; /* The directory we start out in (cwd) */
+ char new_subdir[PCB_PATH_MAX + 1];
+ char fn[PCB_PATH_MAX + 1], *fn_end;
DIR *subdirobj; /* Interable object holding all subdir entries */
struct dirent *subdirentry; /* Individual subdir entry */
struct stat buffer; /* Buffer used in stat */
@@ -122,8 +123,8 @@ static int fp_fs_list(library_t *pl, const char *subdir, int recurse,
/* Cache old dir, then cd into subdir because stat is given relative file names. */
memset(olddir, 0, sizeof olddir);
- if (GetWorkingDirectory(olddir) == NULL) {
- Message(PCB_MSG_DEFAULT, _("fp_fs_list(): Could not determine initial working directory\n"));
+ if (pcb_get_wd(olddir) == NULL) {
+ pcb_message(PCB_MSG_ERROR, _("fp_fs_list(): Could not determine initial working directory\n"));
return 0;
}
@@ -132,16 +133,16 @@ static int fp_fs_list(library_t *pl, const char *subdir, int recurse,
if (chdir(subdir)) {
if (!subdir_may_not_exist)
- ChdirErrorMessage(subdir);
+ pcb_chdir_error_message(subdir);
return 0;
}
/* Determine subdir's abs path */
- if (GetWorkingDirectory(new_subdir) == NULL) {
- Message(PCB_MSG_DEFAULT, _("fp_fs_list(): Could not determine new working directory\n"));
+ if (pcb_get_wd(new_subdir) == NULL) {
+ pcb_message(PCB_MSG_ERROR, _("fp_fs_list(): Could not determine new working directory\n"));
if (chdir(olddir))
- ChdirErrorMessage(olddir);
+ pcb_chdir_error_message(olddir);
return 0;
}
@@ -152,9 +153,9 @@ static int fp_fs_list(library_t *pl, const char *subdir, int recurse,
/* First try opening the directory specified by path */
if ((subdirobj = opendir(new_subdir)) == NULL) {
- OpendirErrorMessage(new_subdir);
+ pcb_opendir_error_message(new_subdir);
if (chdir(olddir))
- ChdirErrorMessage(olddir);
+ pcb_chdir_error_message(olddir);
return 0;
}
@@ -174,19 +175,19 @@ static int fp_fs_list(library_t *pl, const char *subdir, int recurse,
l = strlen(subdirentry->d_name);
if (!stat(subdirentry->d_name, &buffer)
&& subdirentry->d_name[0] != '.'
- && NSTRCMP(subdirentry->d_name, "CVS") != 0
- && NSTRCMP(subdirentry->d_name, "Makefile") != 0
- && NSTRCMP(subdirentry->d_name, "Makefile.am") != 0
- && NSTRCMP(subdirentry->d_name, "Makefile.in") != 0 && (l < 4 || NSTRCMP(subdirentry->d_name + (l - 4), ".png") != 0)
- && (l < 5 || NSTRCMP(subdirentry->d_name + (l - 5), ".html") != 0)
- && (l < 4 || NSTRCMP(subdirentry->d_name + (l - 4), ".pcb") != 0)) {
+ && PCB_NSTRCMP(subdirentry->d_name, "CVS") != 0
+ && PCB_NSTRCMP(subdirentry->d_name, "Makefile") != 0
+ && PCB_NSTRCMP(subdirentry->d_name, "Makefile.am") != 0
+ && PCB_NSTRCMP(subdirentry->d_name, "Makefile.in") != 0 && (l < 4 || PCB_NSTRCMP(subdirentry->d_name + (l - 4), ".png") != 0)
+ && (l < 5 || PCB_NSTRCMP(subdirentry->d_name + (l - 5), ".html") != 0)
+ && (l < 4 || PCB_NSTRCMP(subdirentry->d_name + (l - 4), ".pcb") != 0)) {
#ifdef DEBUG
/* printf("... Found a footprint %s ... \n", subdirentry->d_name); */
#endif
strcpy(fn_end, subdirentry->d_name);
if ((S_ISREG(buffer.st_mode)) || (WRAP_S_ISLNK(buffer.st_mode))) {
- fp_type_t ty;
+ pcb_fptype_t ty;
void **tags = NULL;
ty = pcb_fp_file_type(subdirentry->d_name, (need_tags ? &tags : NULL));
if ((ty == PCB_FP_FILE) || (ty == PCB_FP_PARAMETRIC)) {
@@ -213,36 +214,36 @@ static int fp_fs_list(library_t *pl, const char *subdir, int recurse,
/* Done. Clean up, cd back into old dir, and return */
closedir(subdirobj);
if (chdir(olddir))
- ChdirErrorMessage(olddir);
+ pcb_chdir_error_message(olddir);
return n_footprints;
}
-static int fp_fs_load_dir_(library_t *pl, const char *subdir, const char *toppath, int is_root)
+static int fp_fs_load_dir_(pcb_fplibrary_t *pl, const char *subdir, const char *toppath, int is_root)
{
list_st_t l;
list_dir_t *d, *nextd;
- char working_[MAXPATHLEN + 1];
+ char working_[PCB_PATH_MAX + 1];
const char *visible_subdir;
char *working; /* String holding abs path to working dir */
sprintf(working_, "%s%c%s", toppath, PCB_DIR_SEPARATOR_C, subdir);
- resolve_path(working_, &working, 0);
+ pcb_path_resolve(working_, &working, 0);
if (strcmp(subdir, ".") == 0)
visible_subdir = "fs";
else
visible_subdir = subdir;
- l.menu = fp_lib_search(pl, visible_subdir);
+ l.menu = pcb_fp_lib_search(pl, visible_subdir);
if (l.menu == NULL)
- l.menu = fp_mkdir_len(pl, visible_subdir, -1);
+ l.menu = pcb_fp_mkdir_len(pl, visible_subdir, -1);
l.subdirs = NULL;
l.children = 0;
fp_fs_list(l.menu, working, 0, list_cb, &l, is_root, 1);
/* now recurse to each subdirectory mapped in the previous call;
- by now we don't care if menu is ruined by the realloc() in GetLibraryMenuMemory() */
+ by now we don't care if menu is ruined by the realloc() in pcb_lib_menu_new() */
for (d = l.subdirs; d != NULL; d = nextd) {
l.children += fp_fs_load_dir_(l.menu, d->subdir, d->parent, 0);
nextd = d->next;
@@ -251,15 +252,15 @@ static int fp_fs_load_dir_(library_t *pl, const char *subdir, const char *toppat
free(d);
}
if ((l.children == 0) && (l.menu->data.dir.children.used == 0))
- fp_rmdir(l.menu);
+ pcb_fp_rmdir(l.menu);
free(working);
return l.children;
}
-static int fp_fs_load_dir(plug_fp_t *ctx, const char *path)
+static int fp_fs_load_dir(pcb_plug_fp_t *ctx, const char *path)
{
- return fp_fs_load_dir_(&library, ".", path, 1);
+ return fp_fs_load_dir_(&pcb_library, ".", path, 1);
}
typedef struct {
@@ -270,13 +271,13 @@ typedef struct {
char *real_name;
} fp_search_t;
-static int fp_search_cb(void *cookie, const char *subdir, const char *name, fp_type_t type, void *tags[])
+static int fp_search_cb(void *cookie, const char *subdir, const char *name, pcb_fptype_t type, void *tags[])
{
fp_search_t *ctx = (fp_search_t *) cookie;
if ((strncmp(ctx->target, name, ctx->target_len) == 0) && ((! !ctx->parametric) == (type == PCB_FP_PARAMETRIC))) {
const char *suffix = name + ctx->target_len;
/* ugly heuristics: footprint names may end in .fp or .ele */
- if ((*suffix == '\0') || (strcasecmp(suffix, ".fp") == 0) || (strcasecmp(suffix, ".ele") == 0)) {
+ if ((*suffix == '\0') || (pcb_strcasecmp(suffix, ".fp") == 0) || (pcb_strcasecmp(suffix, ".ele") == 0)) {
ctx->path = pcb_strdup(subdir);
ctx->real_name = pcb_strdup(name);
return 1;
@@ -289,7 +290,7 @@ static int fp_search_cb(void *cookie, const char *subdir, const char *name, fp_t
static char *fp_fs_search(const char *search_path, const char *basename, int parametric)
{
const char *p, *end;
- char path[MAXPATHLEN + 1];
+ char path[PCB_PATH_MAX + 1];
fp_search_t ctx;
if ((*basename == '/') || (*basename == PCB_DIR_SEPARATOR_C))
@@ -310,10 +311,10 @@ static char *fp_fs_search(const char *search_path, const char *basename, int par
memcpy(path, p, end - p);
path[end - p] = '\0';
- resolve_path(path, &fpath, 0);
+ pcb_path_resolve(path, &fpath, 0);
/* fprintf(stderr, " in '%s'\n", fpath);*/
- fp_fs_list(&library, fpath, 1, fp_search_cb, &ctx, 1, 0);
+ fp_fs_list(&pcb_library, fpath, 1, fp_search_cb, &ctx, 1, 0);
if (ctx.path != NULL) {
sprintf(path, "%s%c%s", ctx.path, PCB_DIR_SEPARATOR_C, ctx.real_name);
free(ctx.path);
@@ -337,7 +338,7 @@ static char *fp_fs_search(const char *search_path, const char *basename, int par
- if a line of a file element starts with ## and doesn't contain @, it's a tag
- if tags is not NULL, it's a pointer to a void *tags[] - an array of tag IDs
*/
-static fp_type_t pcb_fp_file_type(const char *fn, void ***tags)
+static pcb_fptype_t pcb_fp_file_type(const char *fn, void ***tags)
{
int c, comment_len;
int first_element = 1;
@@ -351,7 +352,7 @@ static fp_type_t pcb_fp_file_type(const char *fn, void ***tags)
char *tag = NULL;
int talloced = 0, tused = 0;
int Talloced = 0, Tused = 0;
- fp_type_t ret = PCB_FP_INVALID;
+ pcb_fptype_t ret = PCB_FP_INVALID;
if (tags != NULL)
*tags = NULL;
@@ -417,7 +418,7 @@ static fp_type_t pcb_fp_file_type(const char *fn, void ***tags)
Talloced += 8;
*tags = realloc(*tags, (Talloced + 1) * sizeof(void *));
}
- (*tags)[Tused] = (void *) fp_tag(tag, 1);
+ (*tags)[Tused] = (void *) pcb_fp_tag(tag, 1);
Tused++;
(*tags)[Tused] = NULL;
}
@@ -445,13 +446,13 @@ out:;
}
#define F_IS_PARAMETRIC 0
-static FILE *fp_fs_fopen(plug_fp_t *ctx, const char *path, const char *name, fp_fopen_ctx_t *fctx)
+static FILE *fp_fs_fopen(pcb_plug_fp_t *ctx, const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx)
{
char *basename, *params, *fullname;
FILE *f = NULL;
const char *libshell = conf_core.rc.library_shell;
- fctx->field[F_IS_PARAMETRIC].i = fp_dupname(name, &basename, ¶ms);
+ fctx->field[F_IS_PARAMETRIC].i = pcb_fp_dupname(name, &basename, ¶ms);
if (basename == NULL)
return NULL;
@@ -486,7 +487,7 @@ static FILE *fp_fs_fopen(plug_fp_t *ctx, const char *path, const char *name, fp_
return f;
}
-static void fp_fs_fclose(plug_fp_t *ctx, FILE * f, fp_fopen_ctx_t *fctx)
+static void fp_fs_fclose(pcb_plug_fp_t *ctx, FILE * f, pcb_fp_fopen_ctx_t *fctx)
{
if (fctx->field[F_IS_PARAMETRIC].i)
pclose(f);
@@ -495,11 +496,11 @@ static void fp_fs_fclose(plug_fp_t *ctx, FILE * f, fp_fopen_ctx_t *fctx)
}
-static plug_fp_t fp_fs;
+static pcb_plug_fp_t fp_fs;
void hid_fp_fs_uninit(void)
{
- HOOK_UNREGISTER(plug_fp_t, plug_fp_chain, &fp_fs);
+ PCB_HOOK_UNREGISTER(pcb_plug_fp_t, pcb_plug_fp_chain, &fp_fs);
}
pcb_uninit_t hid_fp_fs_init(void)
@@ -508,6 +509,6 @@ pcb_uninit_t hid_fp_fs_init(void)
fp_fs.load_dir = fp_fs_load_dir;
fp_fs.fopen = fp_fs_fopen;
fp_fs.fclose = fp_fs_fclose;
- HOOK_REGISTER(plug_fp_t, plug_fp_chain, &fp_fs);
+ PCB_HOOK_REGISTER(pcb_plug_fp_t, pcb_plug_fp_chain, &fp_fs);
return hid_fp_fs_uninit;
}
diff --git a/src_plugins/fp_wget/Makefile b/src_plugins/fp_wget/Makefile
index 3c17ed4..5e4e166 100644
--- a/src_plugins/fp_wget/Makefile
+++ b/src_plugins/fp_wget/Makefile
@@ -1,5 +1,5 @@
all: tester
- cd ../../src && make mod_fp_wget
+ cd ../../src && $(MAKE) mod_fp_wget
CFLAGS = -Wall -g -I../../src -I../.. -I../../src_3rd -I../../src_3rd/liblihata
diff --git a/src_plugins/fp_wget/fp_wget.c b/src_plugins/fp_wget/fp_wget.c
index f509fe8..a3049e2 100644
--- a/src_plugins/fp_wget/fp_wget.c
+++ b/src_plugins/fp_wget/fp_wget.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "config.h"
#include "gedasymbols.h"
#include "plugins.h"
diff --git a/src_plugins/fp_wget/gedasymbols.c b/src_plugins/fp_wget/gedasymbols.c
index 6612d5b..1ed8cfc 100644
--- a/src_plugins/fp_wget/gedasymbols.c
+++ b/src_plugins/fp_wget/gedasymbols.c
@@ -4,7 +4,7 @@
#include <genvector/gds_char.h>
#include <genht/htsp.h>
#include <genht/hash.h>
-#include "global.h"
+#include "config.h"
#include "wget_common.h"
#include "gedasymbols.h"
#include "plugins.h"
@@ -68,7 +68,7 @@ static int md5_cmp_free(const char *last_fn, char *md5_last, char *md5_new)
return changed;
}
-int fp_gedasymbols_load_dir(plug_fp_t *ctx, const char *path)
+int fp_gedasymbols_load_dir(pcb_plug_fp_t *ctx, const char *path)
{
FILE *f;
int fctx;
@@ -116,7 +116,7 @@ int fp_gedasymbols_load_dir(plug_fp_t *ctx, const char *path)
while(fgets(line, sizeof(line), f) != NULL) {
char *end, *fn;
- library_t *l;
+ pcb_fplibrary_t *l;
if (*line == '#')
continue;
@@ -136,8 +136,8 @@ int fp_gedasymbols_load_dir(plug_fp_t *ctx, const char *path)
fn = end;
/* add to the database */
- l = fp_mkdir_p(vpath.array);
- l = fp_append_entry(l, fn, PCB_FP_FILE, NULL);
+ l = pcb_fp_mkdir_p(vpath.array);
+ l = pcb_fp_append_entry(l, fn, PCB_FP_FILE, NULL);
fn[-1] = '/';
l->data.fp.loc_info = pcb_strdup(vpath.array);
}
@@ -149,7 +149,7 @@ int fp_gedasymbols_load_dir(plug_fp_t *ctx, const char *path)
#define FIELD_WGET_CTX 0
-FILE *fp_gedasymbols_fopen(plug_fp_t *ctx, const char *path, const char *name, fp_fopen_ctx_t *fctx)
+FILE *fp_gedasymbols_fopen(pcb_plug_fp_t *ctx, const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx)
{
gds_t s;
FILE *f;
@@ -173,17 +173,17 @@ FILE *fp_gedasymbols_fopen(plug_fp_t *ctx, const char *path, const char *name, f
return f;
}
-void fp_gedasymbols_fclose(plug_fp_t *ctx, FILE * f, fp_fopen_ctx_t *fctx)
+void fp_gedasymbols_fclose(pcb_plug_fp_t *ctx, FILE * f, pcb_fp_fopen_ctx_t *fctx)
{
fp_wget_close(&f, &(fctx->field[FIELD_WGET_CTX].i));
}
-static plug_fp_t fp_gedasymbols;
+static pcb_plug_fp_t fp_gedasymbols;
void fp_gedasymbols_uninit(void)
{
- HOOK_UNREGISTER(plug_fp_t, plug_fp_chain, &fp_gedasymbols);
+ PCB_HOOK_UNREGISTER(pcb_plug_fp_t, pcb_plug_fp_chain, &fp_gedasymbols);
}
void fp_gedasymbols_init(void)
@@ -193,5 +193,5 @@ void fp_gedasymbols_init(void)
fp_gedasymbols.fopen = fp_gedasymbols_fopen;
fp_gedasymbols.fclose = fp_gedasymbols_fclose;
- HOOK_REGISTER(plug_fp_t, plug_fp_chain, &fp_gedasymbols);
+ PCB_HOOK_REGISTER(pcb_plug_fp_t, pcb_plug_fp_chain, &fp_gedasymbols);
}
diff --git a/src_plugins/fp_wget/gedasymbols.h b/src_plugins/fp_wget/gedasymbols.h
index 95d1f78..7c0c5b5 100644
--- a/src_plugins/fp_wget/gedasymbols.h
+++ b/src_plugins/fp_wget/gedasymbols.h
@@ -1,7 +1,7 @@
#include "plug_footprint.h"
-int fp_gedasymbols_load_dir(plug_fp_t *ctx, const char *path);
-FILE *fp_gedasymbols_fopen(plug_fp_t *ctx, const char *path, const char *name, fp_fopen_ctx_t *fctx);
-void fp_gedasymbols_fclose(plug_fp_t *ctx, FILE * f, fp_fopen_ctx_t *fctx);
+int fp_gedasymbols_load_dir(pcb_plug_fp_t *ctx, const char *path);
+FILE *fp_gedasymbols_fopen(pcb_plug_fp_t *ctx, const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx);
+void fp_gedasymbols_fclose(pcb_plug_fp_t *ctx, FILE * f, pcb_fp_fopen_ctx_t *fctx);
void fp_gedasymbols_init(void);
void fp_gedasymbols_uninit(void);
diff --git a/src_plugins/fp_wget/tester.c b/src_plugins/fp_wget/tester.c
index 6384ff9..230bd78 100644
--- a/src_plugins/fp_wget/tester.c
+++ b/src_plugins/fp_wget/tester.c
@@ -1,21 +1,21 @@
#include <stdlib.h>
#include <string.h>
-#include "global.h"
+#include "config.h"
#include "gedasymbols.h"
#undef strdup
char *pcb_strdup(const char *s) { return strdup(s); }
-plug_fp_t *plug_fp_chain = NULL;
+pcb_plug_fp_t *pcb_plug_fp_chain = NULL;
library_t ltmp;
-library_t *fp_mkdir_p(const char *path)
+library_t *pcb_fp_mkdir_p(const char *path)
{
printf("lib mkdir: '%s'\n", path);
return (library_t *)<mp;
}
-library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type, void *tags[])
+library_t *pcb_fp_append_entry(library_t *parent, const char *name, pcb_fp_type_t type, void *tags[])
{
printf("lib entry: '%s'\n", name);
return (library_t *)<mp;
@@ -23,7 +23,7 @@ library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type,
int main()
{
- fp_fopen_ctx_t fctx;
+ pcb_fp_fopen_ctx_t fctx;
FILE *f;
char line[1024];
diff --git a/src_plugins/fp_wget/wget_common.c b/src_plugins/fp_wget/wget_common.c
index e7892ae..954b6a1 100644
--- a/src_plugins/fp_wget/wget_common.c
+++ b/src_plugins/fp_wget/wget_common.c
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
+#include "config.h"
#include "wget_common.h"
enum {
diff --git a/src_plugins/gl/hidgl.c b/src_plugins/gl/hidgl.c
index f50b4d2..0f69604 100644
--- a/src_plugins/gl/hidgl.c
+++ b/src_plugins/gl/hidgl.c
@@ -50,8 +50,6 @@
#include "crosshair.h"
#include "data.h"
#include "error.h"
-#include "global.h"
-#include "mymem.h"
#include "clip.h"
#include "hid.h"
@@ -99,29 +97,29 @@ void hidgl_set_depth(float depth)
global_depth = depth;
}
-void hidgl_draw_grid(BoxType * drawn_area)
+void hidgl_draw_grid(pcb_box_t * drawn_area)
{
static GLfloat *points = 0;
static int npoints = 0;
- Coord x1, y1, x2, y2, n, i;
+ pcb_coord_t x1, y1, x2, y2, n, i;
double x, y;
if (!Settings.DrawGrid)
return;
- x1 = GridFit(MAX(0, drawn_area->X1), PCB->Grid, PCB->GridOffsetX);
- y1 = GridFit(MAX(0, drawn_area->Y1), PCB->Grid, PCB->GridOffsetY);
- x2 = GridFit(MIN(PCB->MaxWidth, drawn_area->X2), PCB->Grid, PCB->GridOffsetX);
- y2 = GridFit(MIN(PCB->MaxHeight, drawn_area->Y2), PCB->Grid, PCB->GridOffsetY);
+ x1 = pcb_grid_fit(MAX(0, drawn_area->X1), PCB->Grid, PCB->GridOffsetX);
+ y1 = pcb_grid_fit(MAX(0, drawn_area->Y1), PCB->Grid, PCB->GridOffsetY);
+ x2 = pcb_grid_fit(MIN(PCB->MaxWidth, drawn_area->X2), PCB->Grid, PCB->GridOffsetX);
+ y2 = pcb_grid_fit(MIN(PCB->MaxHeight, drawn_area->Y2), PCB->Grid, PCB->GridOffsetY);
if (x1 > x2) {
- Coord tmp = x1;
+ pcb_coord_t tmp = x1;
x1 = x2;
x2 = tmp;
}
if (y1 > y2) {
- Coord tmp = y1;
+ pcb_coord_t tmp = y1;
y1 = y2;
y2 = tmp;
}
@@ -165,7 +163,7 @@ int calc_slices(float pix_radius, float sweep_angle)
#define MIN_TRIANGLES_PER_CAP 3
#define MAX_TRIANGLES_PER_CAP 90
-static void draw_cap(Coord width, Coord x, Coord y, Angle angle, double scale)
+static void draw_cap(pcb_coord_t width, pcb_coord_t x, pcb_coord_t y, pcb_angle_t angle, double scale)
{
float last_capx, last_capy;
float capx, capy;
@@ -192,7 +190,7 @@ static void draw_cap(Coord width, Coord x, Coord y, Angle angle, double scale)
}
}
-void hidgl_draw_line(int cap, Coord width, Coord x1, Coord y1, Coord x2, Coord y2, double scale)
+void hidgl_draw_line(int cap, pcb_coord_t width, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, double scale)
{
double angle;
float deltax, deltay, length;
@@ -261,7 +259,7 @@ void hidgl_draw_line(int cap, Coord width, Coord x1, Coord y1, Coord x2, Coord y
#define MIN_SLICES_PER_ARC 6
#define MAX_SLICES_PER_ARC 360
-void hidgl_draw_arc(Coord width, Coord x, Coord y, Coord rx, Coord ry, Angle start_angle, Angle delta_angle, double scale)
+void hidgl_draw_arc(pcb_coord_t width, pcb_coord_t x, pcb_coord_t y, pcb_coord_t rx, pcb_coord_t ry, pcb_angle_t start_angle, pcb_angle_t delta_angle, double scale)
{
float last_inner_x, last_inner_y;
float last_outer_x, last_outer_y;
@@ -336,7 +334,7 @@ void hidgl_draw_arc(Coord width, Coord x, Coord y, Coord rx, Coord ry, Angle sta
y + rx * sinf(start_angle_rad + delta_angle_rad), start_angle + delta_angle + 180., scale);
}
-void hidgl_draw_rect(Coord x1, Coord y1, Coord x2, Coord y2)
+void hidgl_draw_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
glBegin(GL_LINE_LOOP);
glVertex3f(x1, y1, global_depth);
@@ -347,7 +345,7 @@ void hidgl_draw_rect(Coord x1, Coord y1, Coord x2, Coord y2)
}
-void hidgl_fill_circle(Coord vx, Coord vy, Coord vr, double scale)
+void hidgl_fill_circle(pcb_coord_t vx, pcb_coord_t vy, pcb_coord_t vr, double scale)
{
#define MIN_TRIANGLES_PER_CIRCLE 6
#define MAX_TRIANGLES_PER_CIRCLE 360
@@ -479,7 +477,7 @@ static void myVertex(GLdouble * vertex_data)
printf("Vertex received with unknown type\n");
}
-void hidgl_fill_polygon(int n_coords, Coord * x, Coord * y)
+void hidgl_fill_polygon(int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
int i;
GLUtesselator *tobj;
@@ -513,9 +511,9 @@ void hidgl_fill_polygon(int n_coords, Coord * x, Coord * y)
free(vertices);
}
-void tesselate_contour(GLUtesselator * tobj, PLINE * contour, GLdouble * vertices, double scale)
+void tesselate_contour(GLUtesselator * tobj, pcb_pline_t * contour, GLdouble * vertices, double scale)
{
- VNODE *vn = &contour->head;
+ pcb_vnode_t *vn = &contour->head;
int offset = 0;
/* If the contour is round, and hidgl_fill_circle would use
@@ -549,18 +547,18 @@ struct do_hole_info {
double scale;
};
-static r_dir_t do_hole(const BoxType * b, void *cl)
+static pcb_r_dir_t do_hole(const pcb_box_t * b, void *cl)
{
struct do_hole_info *info = cl;
- PLINE *curc = (PLINE *) b;
+ pcb_pline_t *curc = (pcb_pline_t *) b;
/* Ignore the outer contour - we draw it first explicitly */
- if (curc->Flags.orient == PLF_DIR) {
- return R_DIR_NOT_FOUND;
+ if (curc->Flags.orient == PCB_PLF_DIR) {
+ return PCB_R_DIR_NOT_FOUND;
}
tesselate_contour(info->tobj, curc, info->vertices, info->scale);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
static GLint stencil_bits;
@@ -568,10 +566,10 @@ static int dirty_bits = 0;
static int assigned_bits = 0;
/* FIXME: JUST DRAWS THE FIRST PIECE.. TODO: SUPPORT FOR FULLPOLY POLYGONS */
-void hidgl_fill_pcb_polygon(PolygonType * poly, const BoxType * clip_box, double scale)
+void hidgl_fill_pcb_polygon(pcb_polygon_t * poly, const pcb_box_t * clip_box, double scale)
{
int vertex_count = 0;
- PLINE *contour;
+ pcb_pline_t *contour;
struct do_hole_info info;
int stencil_bit;
@@ -616,7 +614,7 @@ void hidgl_fill_pcb_polygon(PolygonType * poly, const BoxType * clip_box, double
/* Drawing operations now set our reference bit in the stencil buffer */
- r_search(poly->Clipped->contour_tree, clip_box, NULL, do_hole, &info, NULL);
+ pcb_r_search(poly->Clipped->contour_tree, clip_box, NULL, do_hole, &info, NULL);
hidgl_flush_triangles(&buffer);
glPopAttrib(); /* Restore the colour and stencil buffer write-mask etc.. */
@@ -645,7 +643,7 @@ void hidgl_fill_pcb_polygon(PolygonType * poly, const BoxType * clip_box, double
free(info.vertices);
}
-void hidgl_fill_rect(Coord x1, Coord y1, Coord x2, Coord y2)
+void hidgl_fill_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
hidgl_ensure_triangle_space(&buffer, 2);
hidgl_add_triangle(&buffer, x1, y1, x1, y2, x2, y2);
diff --git a/src_plugins/gl/hidgl.h b/src_plugins/gl/hidgl.h
index 49325ca..46c1fef 100644
--- a/src_plugins/gl/hidgl.h
+++ b/src_plugins/gl/hidgl.h
@@ -60,15 +60,15 @@ hidgl_add_triangle(triangle_buffer * buffer, GLfloat x1, GLfloat y1, GLfloat x2,
hidgl_add_triangle_3D(buffer, x1, y1, global_depth, x2, y2, global_depth, x3, y3, global_depth);
}
-void hidgl_draw_grid(BoxType * drawn_area);
+void hidgl_draw_grid(pcb_box_t * drawn_area);
void hidgl_set_depth(float depth);
-void hidgl_draw_line(int cap, Coord width, Coord x1, Coord y1, Coord x2, Coord y2, double scale);
-void hidgl_draw_arc(Coord width, Coord vx, Coord vy, Coord vrx, Coord vry, Angle start_angle, Angle delta_angle, double scale);
-void hidgl_draw_rect(Coord x1, Coord y1, Coord x2, Coord y2);
-void hidgl_fill_circle(Coord vx, Coord vy, Coord vr, double scale);
-void hidgl_fill_polygon(int n_coords, Coord * x, Coord * y);
-void hidgl_fill_pcb_polygon(PolygonType * poly, const BoxType * clip_box, double scale);
-void hidgl_fill_rect(Coord x1, Coord y1, Coord x2, Coord y2);
+void hidgl_draw_line(int cap, pcb_coord_t width, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, double scale);
+void hidgl_draw_arc(pcb_coord_t width, pcb_coord_t vx, pcb_coord_t vy, pcb_coord_t vrx, pcb_coord_t vry, pcb_angle_t start_angle, pcb_angle_t delta_angle, double scale);
+void hidgl_draw_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void hidgl_fill_circle(pcb_coord_t vx, pcb_coord_t vy, pcb_coord_t vr, double scale);
+void hidgl_fill_polygon(int n_coords, pcb_coord_t * x, pcb_coord_t * y);
+void hidgl_fill_pcb_polygon(pcb_polygon_t * poly, const pcb_box_t * clip_box, double scale);
+void hidgl_fill_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
void hidgl_init(void);
int hidgl_stencil_bits(void);
diff --git a/src_plugins/gpmi/Makefile b/src_plugins/gpmi/Makefile
index b2da266..e835b18 100644
--- a/src_plugins/gpmi/Makefile
+++ b/src_plugins/gpmi/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_pcb_gpmi
+ cd ../../src && $(MAKE) mod_pcb_gpmi
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/gpmi/Plug.tmpasm b/src_plugins/gpmi/Plug.tmpasm
index 847c9d9..da97910 100644
--- a/src_plugins/gpmi/Plug.tmpasm
+++ b/src_plugins/gpmi/Plug.tmpasm
@@ -60,7 +60,7 @@ mod_pcb_gpmi: all
append /local/pcb/buildin_init_code [@
uninit_func = hid_gpmi_init();
- plugin_register("gpmi", "<gpmi>", NULL, 0, uninit_func);
+ pcb_plugin_register("gpmi", "<gpmi>", NULL, 0, uninit_func);
@] {\n}
diff --git a/src_plugins/gpmi/pcb-gpmi/Makefile b/src_plugins/gpmi/pcb-gpmi/Makefile
index 7dfe4e4..83a8b58 100644
--- a/src_plugins/gpmi/pcb-gpmi/Makefile
+++ b/src_plugins/gpmi/pcb-gpmi/Makefile
@@ -1,13 +1,13 @@
PCB_GPMI_ROOT=.
all:
- cd gpmi_plugin; make all
+ cd gpmi_plugin; $(MAKE) all
include ../../../Makefile.conf
PLUGIN_DIR=$(LIBDIR)/plugins
clean:
- cd gpmi_plugin; make clean
+ cd gpmi_plugin; $(MAKE) clean
test: all
cd host_lib; ./test.sh
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/Makefile b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/Makefile
index de0d2d5..6be8ca7 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/Makefile
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/Makefile
@@ -34,4 +34,4 @@ manage_scripts.o: manage_scripts.c
clean:
rm gpmi_plugin.o gpmi_plugin.so gpmi_buildin.a gpmi_buildin.o $(COMMON_OBJS) 2>/dev/null ; true
- cd gpmi_pkg; make clean
+ cd gpmi_pkg; $(MAKE) clean
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c
index a267c87..d22a908 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <gpmi.h>
-#include "src/global.h"
+#include "src/global_typedefs.h"
#include "src/hid.h"
#include "src/error.h"
#include "actions.h"
@@ -13,7 +13,7 @@
typedef struct acontext_s acontext_t;
struct acontext_s {
- HID_Action action;
+ pcb_hid_action_t action;
char *name;
gpmi_module *module;
acontext_t *next;
@@ -30,9 +30,9 @@ const char *action_arg(int argn)
}
-static int action_cb(int argc, const char **argv, Coord x, Coord y)
+static int action_cb(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- acontext_t *ctx = (acontext_t *)current_action;
+ acontext_t *ctx = (acontext_t *)pcb_current_action;
int action_argc_old;
const char **action_argv_old;
@@ -55,7 +55,7 @@ static int action_cb(int argc, const char **argv, Coord x, Coord y)
static void cleanup_action(gpmi_module *mod, gpmi_cleanup *cl)
{
acontext_t *ctx = cl->argv[0].p;
- hid_remove_action(&ctx->action);
+ pcb_hid_remove_action(&ctx->action);
free((char *)ctx->action.name);
if (ctx->action.need_coord_msg != NULL)
free((char *)ctx->action.need_coord_msg);
@@ -83,20 +83,20 @@ int action_register(const char *name, const char *need_xy, const char *descripti
ctx->module = gpmi_get_current_module();
ctx->next = NULL;
- hid_register_action(&ctx->action, gpmi_cookie, 0);
+ pcb_hid_register_action(&ctx->action, gpmi_cookie, 0);
gpmi_mod_cleanup_insert(ctx->module, cleanup_action, "p", ctx);
- printf("registered.\n");
+ pcb_trace("action %d registered.\n", name);
return 0;
}
int action(const char *cmdline)
{
- return hid_parse_command(cmdline);
+ return pcb_hid_parse_command(cmdline);
}
void create_menu(const char *path, const char *action, const char *mnemonic, const char *hotkey, const char *tooltip)
{
- gui->create_menu(path, action, mnemonic, hotkey, tooltip, "TODO#2");
+ pcb_gui->create_menu(path, action, mnemonic, hotkey, tooltip, "TODO#2");
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h
index 97230b1..f7299f4 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h
@@ -115,7 +115,7 @@ nowrap void cg_perp_line_(const cg_obj_t *i, cg_obj_t *o, int xp, int yp, int le
nowrap double cg_dist_(int x1, int y1, int x2, int y2);
/* is point on the object? Extend means the object is extended (lines become
- infinite long, arcs become circles). Vector always returns 1. */
+ infinite long, arcs become circles). pcb_vector_t always returns 1. */
nowrap int cg_ison_(cg_obj_t *o, int x, int y, int extend);
nowrap int cg_ison_line_(cg_obj_t *l, int x, int y, int extend);
nowrap int cg_ison_arc_(cg_obj_t *a, int x, int y, int extend);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c
index 0fa73f0..01844ef 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c
@@ -1,21 +1,21 @@
-#include "dialogs.h"
-#include "src/error.h"
#include "src/hid_attrib.h"
+#include "src/error.h"
+#include "dialogs.h"
-extern HID *gui;
+extern pcb_hid_t *pcb_gui;
void dialog_log(const char *msg)
{
- if (gui == NULL)
+ if (pcb_gui == NULL)
fprintf(stderr, "couldn't find gui for log: \"%s\"\n", msg);
else
- Message(PCB_MSG_DEFAULT, "%s", msg);
+ pcb_message(PCB_MSG_INFO, "%s", msg);
}
#define empty(s) (((s) == NULL) || ((*s) == '\0'))
int dialog_confirm(const char *msg, const char *ok, const char *cancel)
{
- if (gui == NULL) {
+ if (pcb_gui == NULL) {
fprintf(stderr, "couldn't find gui for dialog_confirm: \"%s\"\n", msg);
return -1;
}
@@ -25,58 +25,58 @@ int dialog_confirm(const char *msg, const char *ok, const char *cancel)
if (empty(cancel))
cancel = NULL;
- return gui->confirm_dialog(msg, cancel, ok, NULL);
+ return pcb_gui->confirm_dialog(msg, cancel, ok, NULL);
}
#undef empty
void dialog_report(const char *title, const char *msg)
{
- if (gui == NULL)
+ if (pcb_gui == NULL)
fprintf(stderr, "couldn't find gui for dialog_report: \"%s\" \"%s\"\n", title, msg);
else
- gui->report_dialog(title, msg);
+ pcb_gui->report_dialog(title, msg);
}
dynamic char *dialog_prompt(const char *msg, const char *default_)
{
- if (gui == NULL) {
+ if (pcb_gui == NULL) {
fprintf(stderr, "couldn't find gui for dialog_prompt: \"%s\" \"%s\"\n", msg, default_);
return NULL;
}
else
- return gui->prompt_for(msg, default_);
+ return pcb_gui->prompt_for(msg, default_);
}
dynamic char *dialog_fileselect(const char *title, const char *descr, char *default_file, char *default_ext, const char *history_tag, multiple dialog_fileselect_t flags)
{
- if (gui == NULL) {
+ if (pcb_gui == NULL) {
fprintf(stderr, "couldn't find gui for dialog_fileselect\n");
return NULL;
}
else
- return gui->fileselect(title, descr, default_file, default_ext, history_tag, flags);
+ return pcb_gui->fileselect(title, descr, default_file, default_ext, history_tag, flags);
}
void dialog_beep(void)
{
- if (gui == NULL)
+ if (pcb_gui == NULL)
fprintf(stderr, "couldn't find gui for dialog_beep\n");
else
- gui->beep();
+ pcb_gui->beep();
}
int dialog_progress(int so_far, int total, const char *message)
{
- if (gui == NULL) {
+ if (pcb_gui == NULL) {
fprintf(stderr, "couldn't find gui for dialog_process: %d/%d \"%s\"\n", so_far, total, message);
return -1;
}
- return gui->progress(so_far, total, message);
+ return pcb_gui->progress(so_far, total, message);
}
-int dialog_attribute(hid_t *hid, const char *title, const char *descr)
+int dialog_attribute(gpmi_hid_t *hid, const char *title, const char *descr)
{
- if (gui == NULL) {
+ if (pcb_gui == NULL) {
fprintf(stderr, "couldn't find gui for dialog_attribute: \"%s\" \"%s\"\n", title, descr);
return -1;
}
@@ -85,7 +85,7 @@ int dialog_attribute(hid_t *hid, const char *title, const char *descr)
/* TODO: free string fields to avoid memleaks */
}
else
- hid->result = calloc(sizeof(HID_Attribute), hid->attr_num);
+ hid->result = calloc(sizeof(pcb_hid_attribute_t), hid->attr_num);
- return gui->attribute_dialog(hid->attr, hid->attr_num, hid->result, title, descr);
+ return pcb_gui->attribute_dialog(hid->attr, hid->attr_num, hid->result, title, descr);
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.h
index 26201d5..f6d3996 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.h
@@ -1,5 +1,6 @@
#include <gpmi.h>
-#include "src/global.h"
+#include "src/hid.h"
+#include "src/global_typedefs.h"
#define FROM_PKG
#include "hid/hid.h"
#include "src/pcb-printf.h"
@@ -75,4 +76,4 @@ int dialog_progress(int so_far, int total, const char *message);
hid: widgets
title: title of the window
descr: descripting printed in the dialog */
-int dialog_attribute(hid_t *hid, const char *title, const char *descr);
+int dialog_attribute(gpmi_hid_t *hid, const char *title, const char *descr);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c
index 0f2304c..613c7a2 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c
@@ -1,8 +1,9 @@
#include <stdlib.h>
+#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <gpmi.h>
-#include "src/global.h"
+#include "src/global_typedefs.h"
#include "src/error.h"
#include "src/hid.h"
#include "src/hid_nogui.h"
@@ -16,26 +17,26 @@
#include "hid_callbacks.h"
-void hid_gpmi_data_set(hid_t *h, void *data)
+void hid_gpmi_data_set(gpmi_hid_t *h, void *data)
{
h->hid->user_context = data;
}
-hid_t *hid_gpmi_data_get(HID *h)
+gpmi_hid_t *hid_gpmi_data_get(pcb_hid_t *h)
{
if (h == NULL)
return NULL;
- return (hid_t *)h->user_context;
+ return (gpmi_hid_t *)h->user_context;
}
-hid_t *hid_create(char *hid_name, char *description)
+gpmi_hid_t *hid_create(char *hid_name, char *description)
{
- hid_t *h;
+ gpmi_hid_t *h;
- h = calloc(sizeof(hid_t), 1);
- h->hid = calloc(sizeof(HID), 1);
+ h = calloc(sizeof(gpmi_hid_t), 1);
+ h->hid = calloc(sizeof(pcb_hid_t), 1);
- common_nogui_init (h->hid);
+ pcb_hid_nogui_init(h->hid);
h->module = gpmi_get_current_module();
@@ -43,7 +44,7 @@ hid_t *hid_create(char *hid_name, char *description)
h->hid->description = pcb_strdup(description);
h->hid->exporter = 1;
h->hid->gui = 0;
- h->hid->struct_size = sizeof(HID);
+ h->hid->struct_size = sizeof(pcb_hid_t);
h->hid->get_export_options = gpmi_hid_get_export_options;
h->hid->make_gc = gpmi_hid_make_gc;
@@ -51,7 +52,7 @@ hid_t *hid_create(char *hid_name, char *description)
h->hid->do_export = gpmi_hid_do_export;
h->hid->parse_arguments = gpmi_hid_parse_arguments;
h->hid->set_crosshair = gpmi_hid_set_crosshair;
- h->hid->set_layer = gpmi_hid_set_layer;
+ h->hid->set_layer_group = gpmi_hid_set_layer_group;
h->hid->set_color = gpmi_hid_set_color;
h->hid->set_line_cap = gpmi_hid_set_line_cap;
h->hid->set_line_width = gpmi_hid_set_line_width;
@@ -76,11 +77,11 @@ hid_t *hid_create(char *hid_name, char *description)
return h;
}
-dynamic char *hid_get_attribute(hid_t *hid, int attr_id)
+dynamic char *hid_get_attribute(gpmi_hid_t *hid, int attr_id)
{
const char *res;
char buff[128];
- HID_Attr_Val *v;
+ pcb_hid_attr_val_t *v;
if ((hid == NULL) || (attr_id < 0) || (attr_id >= hid->attr_num) || (hid->result == NULL))
return 0;
@@ -118,13 +119,13 @@ dynamic char *hid_get_attribute(hid_t *hid, int attr_id)
break;
case HIDA_Unit:
{
- const Unit *u;
+ const pcb_unit_t *u;
double fact;
u = get_unit_by_idx(v->int_value);
if (u == NULL)
fact = 0;
else
- fact = unit_to_factor(u);
+ fact = pcb_unit_to_factor(u);
pcb_snprintf(buff, sizeof(buff), "%f", fact);
res = buff;
/* fprintf(stderr, "unit idx: %d %p res='%s'\n", v->int_value, (void *)u, res);*/
@@ -141,13 +142,13 @@ dynamic char *hid_get_attribute(hid_t *hid, int attr_id)
}
-HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char *str)
+pcb_hid_attr_val_t hid_string2val(const hid_attr_type_t type, const char *str)
{
- HID_Attr_Val v;
+ pcb_hid_attr_val_t v;
memset(&v, 0, sizeof(v));
switch(type) {
case HIDA_Boolean:
- if ((strcasecmp(str, "true") == 0) || (strcasecmp(str, "yes") == 0) || (strcasecmp(str, "1") == 0))
+ if ((pcb_strcasecmp(str, "true") == 0) || (pcb_strcasecmp(str, "yes") == 0) || (pcb_strcasecmp(str, "1") == 0))
v.int_value = 1;
else
v.int_value = 0;
@@ -162,14 +163,14 @@ HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char *str)
val = strtod(str, &end);
while(isspace(*end)) end++;
if (*end != '\0') {
- const Unit *u;
+ const pcb_unit_t *u;
u = get_unit_struct(end);
if (u == NULL) {
- Message(PCB_MSG_DEFAULT, "Invalid unit for HIDA_Coord in the script: '%s'\n", end);
+ pcb_message(PCB_MSG_ERROR, "Invalid unit for HIDA_Coord in the script: '%s'\n", end);
v.coord_value = 0;
}
else
- v.coord_value = unit_to_coord(u, val);
+ v.coord_value = pcb_unit_to_coord(u, val);
}
else
v.coord_value = val;
@@ -177,10 +178,10 @@ HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char *str)
break;
case HIDA_Unit:
{
- const Unit *u;
+ const pcb_unit_t *u;
u = get_unit_struct(str);
if (u != NULL)
- v.real_value = unit_to_factor(u);
+ v.real_value = pcb_unit_to_factor(u);
else
v.real_value = 0;
}
@@ -201,7 +202,7 @@ HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char *str)
return v;
}
-char **hid_string2enum(const char *str, HID_Attr_Val *def)
+char **hid_string2enum(const char *str, pcb_hid_attr_val_t *def)
{
char **e;
const char *s, *last;
@@ -238,13 +239,13 @@ char **hid_string2enum(const char *str, HID_Attr_Val *def)
return e;
}
-int hid_add_attribute(hid_t *hid, char *attr_name, char *help, hid_attr_type_t type, int min, int max, char *default_val)
+int hid_add_attribute(gpmi_hid_t *hid, char *attr_name, char *help, hid_attr_type_t type, int min, int max, char *default_val)
{
int current = hid->attr_num;
/* TODO: should realloc more space here */
hid->attr_num++;
- hid->attr = realloc(hid->attr, sizeof(HID_Attribute) * hid->attr_num);
+ hid->attr = realloc(hid->attr, sizeof(pcb_hid_attribute_t) * hid->attr_num);
hid->type = realloc(hid->type, sizeof(hid_attr_type_t) * hid->attr_num);
hid->attr[current].name = pcb_strdup(attr_name);
@@ -253,7 +254,7 @@ int hid_add_attribute(hid_t *hid, char *attr_name, char *help, hid_attr_type_t t
hid->attr[current].min_val = min;
hid->attr[current].max_val = max;
if (type == HIDA_Unit) {
- const Unit *u, *all;
+ const pcb_unit_t *u, *all;
all = get_unit_list();
u = get_unit_struct(default_val);
if (u != NULL)
@@ -277,10 +278,10 @@ int hid_add_attribute(hid_t *hid, char *attr_name, char *help, hid_attr_type_t t
static void cleanup_hid_reg(gpmi_module *mod, gpmi_cleanup *cl)
{
- hid_t *hid = cl->argv[0].p;
+ gpmi_hid_t *hid = cl->argv[0].p;
int n;
- hid_remove_hid(hid->hid);
+ pcb_hid_remove_hid(hid->hid);
for(n = 0; n < hid->attr_num; n++) {
free((char *)hid->attr[n].name);
@@ -298,9 +299,9 @@ static void cleanup_hid_reg(gpmi_module *mod, gpmi_cleanup *cl)
free(hid);
}
-int hid_register(hid_t *hid)
+int hid_register(gpmi_hid_t *hid)
{
- hid_register_hid(hid->hid);
+ pcb_hid_register_hid(hid->hid);
gpmi_mod_cleanup_insert(NULL, cleanup_hid_reg, "p", hid);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h
index 6cde596..30228fd 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h
@@ -22,36 +22,36 @@ gpmi_keyword *kw_hid_attr_type_e; /* of hid_attr_type_t */
/* TODO: these should not be here; GPMI needs to switch over to c99tree! */
#ifndef FROM_PKG
-typedef void HID;
-typedef void HID_Attribute;
-typedef void* hidGC;
-typedef char* HID_Attr_Val;
+typedef void pcb_hid_t;
+typedef void pcb_hid_attribute_t;
+typedef void* pcb_hid_gc_t;
+typedef char* pcb_hid_attr_val_t;
/* Line or arc ending style */
-typedef enum EndCapStyle_e {
+typedef enum pcb_cap_style_t_e {
Trace_Cap, /* filled circle (trace drawing) */
Square_Cap, /* rectangular lines (square pad) */
Round_Cap, /* round pins or round-ended pads, thermals */
Beveled_Cap /* octagon pins or bevel-cornered pads */
-} EndCapStyle;
+} pcb_cap_style_t;
-typedef void *PolygonType;
-typedef void *BoxType;
+typedef void *pcb_polygon_t;
+typedef void *pcb_box_t;
#endif
-typedef struct hid_s {
+typedef struct gpmi_hid_s {
gpmi_module *module;
int attr_num;
- HID_Attribute *attr;
+ pcb_hid_attribute_t *attr;
hid_attr_type_t *type;
- HID *hid;
- HID_Attr_Val *result;
- hidGC new_gc;
-} hid_t;
+ pcb_hid_t *hid;
+ pcb_hid_attr_val_t *result;
+ pcb_hid_gc_t new_gc;
+} gpmi_hid_t;
/* Creates a new hid context. Name and description matters only if the hid is
-registered as an exporter later. */
-hid_t *hid_create(char *hid_name, char *description);
+registered as an pcb_exporter later. */
+gpmi_hid_t *hid_create(char *hid_name, char *description);
/* Append an attribute in a hid previously created using hid_create().
Arguments:
@@ -66,25 +66,25 @@ hid_t *hid_create(char *hid_name, char *description);
later reference. For example this ID is used when retrieving the
value of the attribute after the user finished entering data in
the dialog. */
-int hid_add_attribute(hid_t *hid, char *attr_name, char *help, hid_attr_type_t type, int min, int max, char *default_val);
+int hid_add_attribute(gpmi_hid_t *hid, char *attr_name, char *help, hid_attr_type_t type, int min, int max, char *default_val);
/* Query an attribute from the hid after dialog_attributes() returned.
Arguments:
hid: hid_t previously created using hid_create()
attr_id: the unique ID of the attribute (returned by hid_add_attribute())
Returns the value (converted to string) set by the user. */
-dynamic char *hid_get_attribute(hid_t *hid, int attr_id);
+dynamic char *hid_get_attribute(gpmi_hid_t *hid, int attr_id);
/* Register the hid; call it after a hid is created and its attributes
are all set up */
-int hid_register(hid_t *hid);
+int hid_register(gpmi_hid_t *hid);
/* For internal use */
-void hid_gpmi_data_set(hid_t *h, void *data);
+void hid_gpmi_data_set(gpmi_hid_t *h, void *data);
/* For internal use */
-hid_t *hid_gpmi_data_get(HID *h);
+gpmi_hid_t *hid_gpmi_data_get(pcb_hid_t *h);
/* For internal use */
-nowrap HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char *str);
+nowrap pcb_hid_attr_val_t hid_string2val(const hid_attr_type_t type, const char *str);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c
index 6c821de..61cc578 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c
@@ -1,5 +1,6 @@
#include <stdlib.h>
-#include "src/global.h"
+#include "src/board.h"
+#include "src/global_typedefs.h"
#include "src/hid.h"
#include "src/data.h"
#define FROM_PKG
@@ -11,13 +12,13 @@
/* TODO */
-#define MAX_LAYER 16
+#define PCB_MAX_LAYER 16
-HID_Attribute *gpmi_hid_get_export_options(int *num)
+pcb_hid_attribute_t *gpmi_hid_get_export_options(int *num)
{
- hid_t *h;
+ gpmi_hid_t *h;
- h = hid_gpmi_data_get(exporter);
+ h = hid_gpmi_data_get(pcb_exporter);
if (h == NULL)
return NULL;
@@ -30,10 +31,10 @@ HID_Attribute *gpmi_hid_get_export_options(int *num)
}
static char *gcs = "abcdefghijklmnopqrstuvxyz";
-hidGC gpmi_hid_make_gc(void)
+pcb_hid_gc_t gpmi_hid_make_gc(void)
{
- hidGC ret;
- hid_t *h = hid_gpmi_data_get(exporter);
+ pcb_hid_gc_t ret;
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
/* TODO: fix gc handling... */
h->new_gc = (void *)(gcs++);
@@ -43,30 +44,30 @@ hidGC gpmi_hid_make_gc(void)
return ret;
}
-void gpmi_hid_destroy_gc(hidGC gc)
+void gpmi_hid_destroy_gc(pcb_hid_gc_t gc)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_destroy_gc, h, gc);
}
-void gpmi_hid_do_export(HID_Attr_Val * options)
+void gpmi_hid_do_export(pcb_hid_attr_val_t * options)
{
- hid_t *h = hid_gpmi_data_get(exporter);
- int save_ons[MAX_LAYER + 2];
- BoxType region;
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
+ int save_ons[PCB_MAX_LAYER + 2];
+ pcb_box_t region;
h->result = options;
gpmi_event(h->module, HIDE_do_export_start, h);
- hid_save_and_show_layer_ons(save_ons);
+ pcb_hid_save_and_show_layer_ons(save_ons);
region.X1 = 0;
region.Y1 = 0;
region.X2 = PCB->MaxWidth;
region.Y2 = PCB->MaxHeight;
- hid_expose_callback(h->hid, ®ion, 0);
- hid_restore_layer_ons(save_ons);
+ pcb_hid_expose_callback(h->hid, ®ion, 0);
+ pcb_hid_restore_layer_ons(save_ons);
gpmi_event(h->module, HIDE_do_export_finish, h);
h->result = NULL;
}
@@ -74,7 +75,7 @@ void gpmi_hid_do_export(HID_Attr_Val * options)
void gpmi_hid_parse_arguments(int *pcbargc, char ***pcbargv)
{
/* Do nothing for now */
- hid_parse_command_line(pcbargc, pcbargv);
+ pcb_hid_parse_command_line(pcbargc, pcbargv);
}
void gpmi_hid_set_crosshair(int x, int y, int cursor_action)
@@ -82,99 +83,99 @@ void gpmi_hid_set_crosshair(int x, int y, int cursor_action)
/* Do nothing */
}
-int gpmi_hid_set_layer(const char *name, int group, int empty)
+int gpmi_hid_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
- hid_t *h = hid_gpmi_data_get(exporter);
- gpmi_event(h->module, HIDE_set_layer, h, name, group, empty);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
+ gpmi_event(h->module, HIDE_set_layer_group, h, group, layer, flags, is_empty);
return 1;
}
-void gpmi_hid_set_color(hidGC gc, const char *name)
+void gpmi_hid_set_color(pcb_hid_gc_t gc, const char *name)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_set_color, h, gc, name);
}
-void gpmi_hid_set_line_cap(hidGC gc, EndCapStyle style)
+void gpmi_hid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_set_line_cap, h, gc, style);
}
-void gpmi_hid_set_line_width(hidGC gc, Coord width)
+void gpmi_hid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_set_line_width, h, gc, width);
}
-void gpmi_hid_set_draw_xor(hidGC gc, int xor)
+void gpmi_hid_set_draw_xor(pcb_hid_gc_t gc, int xor)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_set_draw_xor, h, gc, xor);
}
-void gpmi_hid_set_draw_faded(hidGC gc, int faded)
+void gpmi_hid_set_draw_faded(pcb_hid_gc_t gc, int faded)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_set_draw_faded, h, gc, faded);
}
-void gpmi_hid_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void gpmi_hid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_draw_line, h, gc, x1, y1, x2, y2);
}
-void gpmi_hid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle)
+void gpmi_hid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_draw_arc, h, gc, cx, cy, xradius, yradius, start_angle, delta_angle);
}
-void gpmi_hid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void gpmi_hid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_draw_rect, h, gc, x1, y1, x2, y2);
}
-void gpmi_hid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+void gpmi_hid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_fill_circle, h, gc, cx, cy, radius);
}
-void gpmi_hid_fill_polygon(hidGC gc, int n_coords, Coord *x, Coord *y)
+void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
/* TODO: need accessor for these */
gpmi_event(h->module, HIDE_fill_polygon, h, gc, x, y);
}
-void gpmi_hid_fill_pcb_polygon(hidGC gc, PolygonType *poly, const BoxType *clip_box)
+void gpmi_hid_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t *poly, const pcb_box_t *clip_box)
{
/* TODO */
}
-void gpmi_hid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void gpmi_hid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_fill_rect, h, gc, x1, y1, x2, y2);
}
void gpmi_hid_use_mask(int use_it)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_use_mask, h, use_it);
}
-void gpmi_hid_fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType *pad, pcb_bool drawHole, pcb_bool mask)
+void gpmi_hid_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t *pad, pcb_bool drawHole, pcb_bool mask)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_fill_pcb_pv, h, fg_gc, bg_gc, pad, drawHole, mask);
}
-void gpmi_hid_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask)
+void gpmi_hid_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask)
{
- hid_t *h = hid_gpmi_data_get(exporter);
+ gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter);
gpmi_event(h->module, HIDE_fill_pcb_pad, h, gc, pad, clear, mask);
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h
index 4f2d7fe..4c0983d 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h
@@ -1,22 +1,22 @@
-HID_Attribute *gpmi_hid_get_export_options(int *num);
-hidGC gpmi_hid_make_gc(void);
-void gpmi_hid_destroy_gc(hidGC gc);
-void gpmi_hid_do_export(HID_Attr_Val * options);
+pcb_hid_attribute_t *gpmi_hid_get_export_options(int *num);
+pcb_hid_gc_t gpmi_hid_make_gc(void);
+void gpmi_hid_destroy_gc(pcb_hid_gc_t gc);
+void gpmi_hid_do_export(pcb_hid_attr_val_t * options);
void gpmi_hid_parse_arguments(int *pcbargc, char ***pcbargv);
void gpmi_hid_set_crosshair(int x, int y, int cursor_action);
-int gpmi_hid_set_layer(const char *name, int group, int _empty);
-void gpmi_hid_set_color(hidGC gc, const char *name);
-void gpmi_hid_set_line_cap(hidGC gc, EndCapStyle style);
-void gpmi_hid_set_line_width(hidGC gc, Coord width);
-void gpmi_hid_set_draw_xor(hidGC gc, int xor);
-void gpmi_hid_set_draw_faded(hidGC gc, int faded);
-void gpmi_hid_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-void gpmi_hid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle);
-void gpmi_hid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-void gpmi_hid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
-void gpmi_hid_fill_polygon(hidGC gc, int n_coords, Coord *x, Coord *y);
-void gpmi_hid_fill_pcb_polygon(hidGC gc, PolygonType *poly, const BoxType *clip_box);
-void gpmi_hid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-void gpmi_hid_fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType *pad, pcb_bool drawHole, pcb_bool mask);
-void gpmi_hid_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask);
+int gpmi_hid_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty);
+void gpmi_hid_set_color(pcb_hid_gc_t gc, const char *name);
+void gpmi_hid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style);
+void gpmi_hid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width);
+void gpmi_hid_set_draw_xor(pcb_hid_gc_t gc, int xor);
+void gpmi_hid_set_draw_faded(pcb_hid_gc_t gc, int faded);
+void gpmi_hid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void gpmi_hid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle);
+void gpmi_hid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void gpmi_hid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
+void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y);
+void gpmi_hid_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t *poly, const pcb_box_t *clip_box);
+void gpmi_hid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void gpmi_hid_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t *pad, pcb_bool drawHole, pcb_bool mask);
+void gpmi_hid_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask);
void gpmi_hid_use_mask(int use_it);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_events.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_events.h
index c33bedd..5cafdd9 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_events.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_events.h
@@ -12,13 +12,13 @@ gpmi_define_event(HIDE_do_export_finish)(void *hid);
/* DRAWING */
/* PCB callback events for drawing: change layer */
-gpmi_define_event(HIDE_set_layer)(void *hid, const char *name, int group, int empty);
+gpmi_define_event(HIDE_set_layer_group)(void *hid, long int group, long int layer, unsigned int flags, int is_empty);
/* PCB callback events for drawing: change drawing color */
gpmi_define_event(HIDE_set_color)(void *hid, void *gc, const char *name);
/* PCB callback events for drawing: change drawing line cap style*/
-gpmi_define_event(HIDE_set_line_cap)(void *hid, void *gc, EndCapStyle style);
+gpmi_define_event(HIDE_set_line_cap)(void *hid, void *gc, pcb_cap_style_t style);
/* PCB callback events for drawing: change drawing line width */
gpmi_define_event(HIDE_set_line_width)(void *hid, void *gc, int width);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/coord.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/coord.c
index b8f1237..9855b83 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/coord.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/coord.c
@@ -14,7 +14,7 @@ double mm2pcb_multiplier()
const char *current_grid_unit()
{
- const Unit *u = conf_core.editor.grid_unit;
+ const pcb_unit_t *u = conf_core.editor.grid_unit;
if (u == NULL)
return "";
return u->suffix;
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c
index b86d168..3b38d63 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c
@@ -1,9 +1,12 @@
#include <stdlib.h>
#include <assert.h>
#include "layout.h"
+#include "src/const.h"
+#include "src/board.h"
#include "src/undo.h"
#include "src/conf_core.h"
#include "src/layer.h"
+#include "src/compat_misc.h"
typedef struct flag_tr_s {
@@ -14,28 +17,28 @@ typedef struct flag_tr_s {
static flag_tr_t flags[] = {
#warning TODO: get these from conf
#if 0
- {1, FL_SHOWNUMBER, SHOWNUMBERFLAG},
- {1, FL_LOCALREF, LOCALREFFLAG},
- {1, FL_CHECKPLANS, CHECKPLANESFLAG},
- {1, FL_SHOWDRC, SHOWPCB_FLAG_DRC},
- {1, FL_RUBBERBAND, RUBBERBANDFLAG},
- {1, FL_DESCRIPTION, DESCRIPTIONFLAG},
- {1, FL_NAMEONPCB, NAMEONPCBFLAG},
- {1, FL_AUTODRC, AUTOPCB_FLAG_DRC},
- {1, FL_ALLDIRECTION, ALLDIRECTIONFLAG},
- {1, FL_SWAPSTARTDIR, SWAPSTARTDIRFLAG},
- {1, FL_UNIQUENAME, UNIQUENAMEFLAG},
- {1, FL_CLEARNEW, CLEARNEWFLAG},
- {1, FL_SNAPPIN, SNAPPCB_FLAG_PIN},
- {1, FL_SHOWMASK, SHOWMASKFLAG},
- {1, FL_THINDRAW, THINDRAWFLAG},
- {1, FL_ORTHOMOVE, ORTHOMOVEFLAG},
- {1, FL_LIVEROUTE, LIVEROUTEFLAG},
- {1, FL_THINDRAWPOLY, THINDRAWPOLYFLAG},
- {1, FL_LOCKNAMES, LOCKNAMESFLAG},
- {1, FL_ONLYNAMES, ONLYNAMESFLAG},
- {1, FL_NEWFULLPOLY, NEWPCB_FLAG_FULLPOLY},
- {1, FL_HIDENAMES, HIDENAMESFLAG},
+ {1, FL_SHOWNUMBER, PCB_SHOWNUMBERFLAG},
+ {1, FL_LOCALREF, PCB_LOCALREFFLAG},
+ {1, FL_CHECKPLANS, PCB_CHECKPLANESFLAG},
+ {1, FL_SHOWDRC, PCB_SHOWPCB_FLAG_DRC},
+ {1, FL_RUBBERBAND, PCB_RUBBERBANDFLAG},
+ {1, FL_DESCRIPTION, PCB_DESCRIPTIONFLAG},
+ {1, FL_NAMEONPCB, PCB_NAMEONPCBFLAG},
+ {1, FL_AUTODRC, PCB_AUTOPCB_FLAG_DRC},
+ {1, FL_ALLDIRECTION, PCB_ALLDIRECTIONFLAG},
+ {1, FL_SWAPSTARTDIR, PCB_SWAPSTARTDIRFLAG},
+ {1, FL_UNIQUENAME, PCB_UNIQUENAMEFLAG},
+ {1, FL_CLEARNEW, PCB_CLEARNEWFLAG},
+ {1, FL_SNAPPIN, PCB_SNAPPCB_FLAG_PIN},
+ {1, FL_SHOWMASK, PCB_SHOWMASKFLAG},
+ {1, FL_THINDRAW, PCB_THINDRAWFLAG},
+ {1, FL_ORTHOMOVE, PCB_ORTHOMOVEFLAG},
+ {1, FL_LIVEROUTE, PCB_LIVEROUTEFLAG},
+ {1, FL_THINDRAWPOLY, PCB_THINDRAWPOLYFLAG},
+ {1, FL_LOCKNAMES, PCB_LOCKNAMESFLAG},
+ {1, FL_ONLYNAMES, PCB_ONLYNAMESFLAG},
+ {1, FL_NEWFULLPOLY, PCB_NEWPCB_FLAG_FULLPOLY},
+ {1, FL_HIDENAMES, PCB_HIDENAMESFLAG},
#endif
{0, FL_THERMALSTYLE1, 1},
@@ -46,10 +49,10 @@ static flag_tr_t flags[] = {
{0, 0, 0}
};
-static FlagType get_flags(int in)
+static pcb_flag_t get_flags(int in)
{
flag_tr_t *f;
- static FlagType out;
+ static pcb_flag_t out;
out.f = 0;
memset(out.t, 0, sizeof(out.t));
@@ -64,54 +67,83 @@ static FlagType get_flags(int in)
return out;
}
-static void *layout_create_line_(int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags)
+static void *layout_create_line_(pcb_layer_t *layer, int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags)
{
void *line;
- line = CreateNewLineOnLayer (CURRENT, x1, y1, x2, y2, thickness, clearance, get_flags(flags));
+ line = pcb_line_new(layer, x1, y1, x2, y2, thickness, clearance, get_flags(flags));
if (line != NULL) {
- AddObjectToCreateUndoList (PCB_TYPE_LINE, CURRENT, line, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, layer, line, line);
return line;
}
return NULL;
}
-int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags)
+layout_object_t *layout_create_line(const char *search_id, layer_id_t layer_id, int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags)
{
- return layout_create_line_(x1, y1, x2, y2, thickness, clearance, flags) != NULL;
+ pcb_layer_t *layer = pcb_get_layer(layer_id);
+ void *res;
+ if (layer == NULL)
+ return 0;
+ res = layout_create_line_(layer, x1, y1, x2, y2, thickness, clearance, flags);
+ return search_persist_created(search_id, layer_id, res, OM_LINE);
}
static void *layout_create_via_(int x, int y, int thickness, int clearance, int mask, int hole, const char *name, multiple layout_flag_t flags)
{
void *pin;
- pin = CreateNewVia (PCB->Data, x, y, thickness, clearance, mask, hole, name, get_flags(flags));
+ pin = pcb_via_new(PCB->Data, x, y, thickness, clearance, mask, hole, name, get_flags(flags));
if (pin != NULL) {
- AddObjectToCreateUndoList (PCB_TYPE_VIA, pin, pin, pin);
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, pin, pin, pin);
return pin;
}
return NULL;
}
-int layout_create_via(int x, int y, int thickness, int clearance, int mask, int hole, const char *name, multiple layout_flag_t flags)
+layout_object_t *layout_create_via(const char *search_id, int x, int y, int thickness, int clearance, int mask, int hole, const char *name, multiple layout_flag_t flags)
{
- return layout_create_via_(x, y, thickness, clearance, mask, hole, name, flags) != NULL;
+ void *res = layout_create_via_(x, y, thickness, clearance, mask, hole, name, flags);
+ return search_persist_created(search_id, -1, res, OM_VIA);
}
-static void *layout_create_arc_(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, multiple layout_flag_t flags)
+static void *layout_create_arc_(pcb_layer_t *layer, int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, multiple layout_flag_t flags)
{
void *arc;
- arc = CreateNewArcOnLayer (CURRENT, x, y, width, height, sa, dir, thickness, clearance, get_flags(flags));
+ arc = pcb_arc_new(layer, x, y, width, height, sa, dir, thickness, clearance, get_flags(flags));
if (arc != NULL) {
- AddObjectToCreateUndoList (PCB_TYPE_ARC, CURRENT, arc, arc);
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, layer, arc, arc);
return 0;
}
return NULL;
}
-int layout_create_arc(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, multiple layout_flag_t flags)
+layout_object_t *layout_create_arc(const char *search_id, layer_id_t layer_id, int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, multiple layout_flag_t flags)
+{
+ layout_search_t *s;
+ void *res;
+ pcb_layer_t *layer = pcb_get_layer(layer_id);
+
+ if (layer == NULL)
+ return NULL;
+
+ res = layout_create_arc_(layer, x, y, width, height, sa, dir, thickness, clearance, flags);
+ return search_persist_created(search_id, layer_id, res, OM_ARC);
+}
+
+layout_object_t *layout_create_text(const char *search_id, layer_id_t layer_id, int x, int y, int direction, int scale, const char *str, multiple layout_flag_t flags)
{
- return layout_create_arc_(x, y, width, height, sa, dir, thickness, clearance, flags) != NULL;
+ layout_search_t *s;
+ void *res;
+ pcb_layer_t *layer = pcb_get_layer(layer_id);
+
+ if (layer == NULL)
+ return NULL;
+
+ res = pcb_text_new(layer, &PCB->Font, x, y, direction, scale, pcb_strdup(str), get_flags(flags));
+ return search_persist_created(search_id, layer_id, res, OM_ARC);
}
+
+
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c
index fa1c599..a9164e1 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c
@@ -4,14 +4,14 @@
#include "src/hid.h"
#include "src/error.h"
-static HID *ddh = NULL;
+static pcb_hid_t *ddh = NULL;
#define need_ddh if (ddh == NULL) return
int debug_draw_request(void)
{
- ddh = gui->request_debug_draw();
+ ddh = pcb_gui->request_debug_draw();
if (ddh == NULL)
return 0;
return 1;
@@ -20,14 +20,14 @@ int debug_draw_request(void)
void debug_draw_flush(void)
{
need_ddh;
- gui->flush_debug_draw();
+ pcb_gui->flush_debug_draw();
}
void debug_draw_finish(dctx_t *ctx)
{
need_ddh;
ddh->destroy_gc(ctx->gc);
- gui->finish_debug_draw();
+ pcb_gui->finish_debug_draw();
free(ctx);
ddh = NULL;
}
@@ -35,11 +35,11 @@ void debug_draw_finish(dctx_t *ctx)
dctx_t *debug_draw_dctx(void)
{
dctx_t *ctx;
- hidGC gc;
+ pcb_hid_gc_t gc;
need_ddh(NULL);
gc = ddh->make_gc();
if (gc == NULL) {
- Message(PCB_MSG_DEFAULT, "debug_draw_dctx(): failed to make a new gc on ddh %p\n", (void *)ddh);
+ pcb_message(PCB_MSG_ERROR, "debug_draw_dctx(): failed to make a new gc on ddh %p\n", (void *)ddh);
return NULL;
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c
index 20a5c6f..9a80ca6 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c
@@ -5,9 +5,9 @@
#include "src/error.h"
#define setup(func) \
- hidGC gc = ctx->gc; \
- HID *hid = ctx->hid; \
- if ((hid == NULL) && (gc == NULL)) Message(PCB_MSG_DEFAULT, "%s failed because of invalid hid or gc\n", func); \
+ pcb_hid_gc_t gc = ctx->gc; \
+ pcb_hid_t *hid = ctx->hid; \
+ if ((hid == NULL) && (gc == NULL)) pcb_message(PCB_MSG_ERROR, "%s failed because of invalid hid or gc\n", func); \
if ((hid == NULL) && (gc == NULL)) return
@@ -17,7 +17,7 @@ void draw_set_color(dctx_t *ctx, const char *name)
hid->set_color(gc, name);
}
-/*void set_line_cap(dctx_t *ctx, EndCapStyle style_);*/
+/*void set_line_cap(dctx_t *ctx, pcb_cap_style_t style_);*/
void draw_set_line_width(dctx_t *ctx, int width)
{
setup("draw_set_line_width");
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c
index f6e1f93..a16c79a 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c
@@ -1,26 +1,32 @@
#include <stdlib.h>
#include <assert.h>
#include "layout.h"
-#include "src/misc.h"
+#include "src/board.h"
+#include "src/const.h"
#include "src/draw.h"
#include "src/conf_core.h"
#include "src/layer.h"
+#include "src/layer_ui.h"
+#include "src/layer_vis.h"
+#include "src/compat_misc.h"
+
+#define LAYER_SEARCH_MAX 32
#define layer_check(layer) \
- if ((layer < 0) || (layer >= MAX_LAYER+2)) \
+ if ((layer < 0) || (layer >= PCB_MAX_LAYER+2)) \
return
void layout_switch_to_layer(int layer)
{
layer_check(layer);
- ChangeGroupVisibility(layer, pcb_true, pcb_true);
- Redraw();
+ pcb_layervis_change_group_vis(layer, pcb_true, pcb_true);
+ pcb_redraw();
}
-int layout_get_current_layer()
+layer_id_t layout_get_current_layer()
{
- return GetLayerNumber(PCB->Data, CURRENT);
+ return pcb_layer_id(PCB->Data, CURRENT);
}
int layout_resolve_layer(const char *name)
@@ -28,7 +34,7 @@ int layout_resolve_layer(const char *name)
int n;
if (name == NULL)
return -2;
- for(n = 0; n < MAX_LAYER + 2; n++)
+ for(n = 0; n < PCB_MAX_LAYER + 2; n++)
if ((PCB->Data->Layer[n].Name != NULL) && (strcmp(PCB->Data->Layer[n].Name, name) == 0))
return n;
return -1;
@@ -36,17 +42,17 @@ int layout_resolve_layer(const char *name)
int layout_get_max_possible_layer()
{
- return MAX_LAYER+2;
+ return PCB_MAX_LAYER+2;
}
int layout_get_max_copper_layer()
{
- return max_copper_layer;
+ return pcb_max_copper_layer;
}
int layout_get_max_layer()
{
- return max_copper_layer+2;
+ return pcb_max_copper_layer+2;
}
@@ -75,3 +81,38 @@ int layout_layer_field(int layer, layer_field_t fld)
}
return -1;
}
+
+int layer_flag_is_set(unsigned int flags, multiple layer_type_t flg)
+{
+ return !!(flags & flg);
+}
+
+layer_id_t layer_list(multiple layer_type_t flags, int idx)
+{
+ pcb_layer_id_t ids[LAYER_SEARCH_MAX];
+ int len = pcb_layer_list(flags, ids, LAYER_SEARCH_MAX);
+ if (idx < 0)
+ return len;
+ if (idx >= len)
+ return -1;
+ return ids[idx];
+}
+
+layer_id_t layer_list_any(multiple layer_type_t flags, int idx)
+{
+ pcb_layer_id_t ids[LAYER_SEARCH_MAX];
+ int len = pcb_layer_list_any(flags, ids, LAYER_SEARCH_MAX);
+ if (idx < 0)
+ return len;
+ if (idx >= len)
+ return -1;
+ return ids[idx];
+}
+
+layer_id_t uilayer_alloc(const char *name, const char *color)
+{
+ pcb_layer_t *l = pcb_uilayer_alloc("script", pcb_strdup(name), pcb_strdup(color));
+ if (l == NULL)
+ return -1;
+ return pcb_layer_id(PCB->Data, l);
+}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h
index 2ff4e3e..e1b9c25 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h
@@ -1,13 +1,14 @@
#include <gpmi.h>
-#include "src/global.h"
+#include "src/global_typedefs.h"
#include "src/rtree.h"
-#include "src/create.h"
#include "src/data.h"
+#include "src/layer.h"
#include "src/pcb-printf.h"
#undef snprintf
#define snprintf pcb_snprintf
+typedef long int layer_id_t;
/* Object type search mask bits */
typedef enum layout_object_mask_e {
@@ -76,19 +77,45 @@ typedef enum layout_flag_e {
} layout_flag_t;
gpmi_keyword *kw_layout_flag_e; /* of layout_flag_t */
+/* Layer type bitfield */
+typedef enum layer_flag_e {
+ LYT_TOP = PCB_LYT_TOP,
+ LYT_BOTTOM = PCB_LYT_BOTTOM,
+ LYT_INTERN = PCB_LYT_INTERN,
+ LYT_LOGICAL = PCB_LYT_LOGICAL,
+ LYT_ANYWHERE = PCB_LYT_ANYWHERE,
+
+ LYT_COPPER = PCB_LYT_COPPER,
+ LYT_SILK = PCB_LYT_SILK,
+ LYT_MASK = PCB_LYT_MASK,
+ LYT_PASTE = PCB_LYT_PASTE,
+ LYT_OUTLINE = PCB_LYT_OUTLINE,
+ LYT_RAT = PCB_LYT_RAT,
+ LYT_INVIS = PCB_LYT_INVIS,
+ LYT_ASSY = PCB_LYT_ASSY,
+ LYT_FAB = PCB_LYT_FAB,
+ LYT_PDRILL = PCB_LYT_PDRILL,
+ LYT_UDRILL = PCB_LYT_UDRILL,
+ LYT_ANYTHING = PCB_LYT_ANYTHING,
+
+ LYT_VIRTUAL = PCB_LYT_VIRTUAL,
+ LYT_ANYPROP = PCB_LYT_ANYPROP
+} layer_type_t;
+gpmi_keyword *kw_layer_flag_e; /* of layer_type_t */
+
typedef struct layout_object_s {
layout_object_mask_t type;
union {
- LineType *l;
- TextType *t;
- PolygonType *p;
- ArcType *a;
- PinType *v;
- PinType *pin;
+ pcb_line_t *l;
+ pcb_text_t *t;
+ pcb_polygon_t *p;
+ pcb_arc_t *a;
+ pcb_pin_t *v;
+ pcb_pin_t *pin;
} obj;
- int layer;
+ pcb_layer_id_t layer;
} layout_object_t;
@@ -125,6 +152,10 @@ int layout_search_found(const char *search_ID, multiple layout_object_mask_t obj
/* Returns the nth object from a search list (or NULL pointer if n is beyond the list) */
layout_object_t *layout_search_get(const char *search_ID, int n);
+/* Creates a new, empty search list. Useful for search list manipulation.
+ Returns 0 on succes. */
+int layout_search_empty(const char *search_ID);
+
/* Frees all memory related to a search. Returns 0 on success.
Argument:
search_ID: unique name of the search (requires an existing search) */
@@ -152,8 +183,13 @@ int layout_obj_move(layout_object_t *obj, layout_object_coord_t coord, int dx, i
int layout_arc_angles(layout_object_t *obj, int relative, int start, int delta);
/* -- create new objects -- (create.c) */
+/* if search_id is not empty, a referece to the new object is stored
+ on that search list and a persistent pointer is returned on success. If
+ search_id is empty, a temporary pointer is returned that should not be
+ used for anything else than checking against NULL. */
+
/* create a line */
-int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags);
+layout_object_t *layout_create_line(const char *search_id, layer_id_t layer_id, int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags);
/* same as layout_create_line(), but appends the result to a list and
returns the index of the new object on the list (can be used as n for
@@ -161,10 +197,13 @@ int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int cleara
int layout_lcreate_line(const char *search_ID, int x1, int y1, int x2, int y2, int thickness, int clearance, multiple layout_flag_t flags);*/
/* create a named via */
-int layout_create_via(int x, int y, int thickness, int clearance, int mask, int hole, const char *name, multiple layout_flag_t flags);
+layout_object_t *layout_create_via(const char *search_id, int x, int y, int thickness, int clearance, int mask, int hole, const char *name, multiple layout_flag_t flags);
/* create a new arc; sa is start angle, dir is delta angle */
-int layout_create_arc(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, multiple layout_flag_t flags);
+layout_object_t *layout_create_arc(const char *search_id, layer_id_t layer_id, int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, multiple layout_flag_t flags);
+
+/* create a new text (TODO) */
+layout_object_t *layout_create_text(const char *search_id, layer_id_t layer_id, int x, int y, int direction, int scale, const char *str, multiple layout_flag_t flags);
/* -- layer manipulation -- (layers.c) */
/* Field name of the layer structure */
@@ -181,7 +220,7 @@ typedef enum layer_field_e {
void layout_switch_to_layer(int layer);
/* returns the number of the current layer */
-int layout_get_current_layer();
+layer_id_t layout_get_current_layer();
/* resolve layer number by name (case sensitive); returns negative number if not found */
int layout_resolve_layer(const char *name);
@@ -238,7 +277,7 @@ dctx_t *debug_draw_dctx(void);
/* Debug draw style: set drawing color */
void draw_set_color(dctx_t *ctx, const char *name);
-/*void set_line_cap(dctx_t *ctx, EndCapStyle style_);*/
+/*void set_line_cap(dctx_t *ctx, pcb_cap_style_t style_);*/
/* Debug draw style: set line width */
void draw_set_line_width(dctx_t *ctx, int width);
@@ -257,11 +296,31 @@ void draw_arc(dctx_t *ctx, int cx_, int cy_, int xradius_, int yradius_, double
void draw_rect(dctx_t *ctx, int x1_, int y1_, int x2_, int y2_);
void fill_circle(dctx_t *ctx, int cx_, int cy_, int radius_);
void fill_polygon(dctx_t *ctx, int n_ints_, int *x_, int *y_);
-void fill_pcb_polygon(dctx_t *ctx, PolygonType *poly, const BoxType *clip_box);
-void thindraw_pcb_polygon(dctx_t *ctx, PolygonType *poly, const BoxType *clip_box);
-void fill_pcb_pad(dctx_t *ctx, PadType *pad, pcb_bool clip, pcb_bool mask);
-void thindraw_pcb_pad(dctx_t *ctx, PadType *pad, pcb_bool clip, pcb_bool mask);
-void fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType *pv, pcb_bool drawHole, pcb_bool mask);
-void thindraw_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType *pv, pcb_bool drawHole, pcb_bool mask);
+void fill_pcb_polygon(dctx_t *ctx, pcb_polygon_t *poly, const pcb_box_t *clip_box);
+void thindraw_pcb_polygon(dctx_t *ctx, pcb_polygon_t *poly, const pcb_box_t *clip_box);
+void fill_pcb_pad(dctx_t *ctx, pcb_pad_t *pad, pcb_bool clip, pcb_bool mask);
+void thindraw_pcb_pad(dctx_t *ctx, pcb_pad_t *pad, pcb_bool clip, pcb_bool mask);
+void fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t *pv, pcb_bool drawHole, pcb_bool mask);
+void thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t *pv, pcb_bool drawHole, pcb_bool mask);
void fill_rect(dctx_t *ctx, int x1_, int y1_, int x2_, int y2_);
*/
+
+/* Returns 1 if flg is set in flags */
+int layer_flag_is_set(unsigned int flags, multiple layer_type_t flg);
+
+/* List layers IDs with exact match on flags. If idx is -1, return the
+ length of matches, else return the idxth match, */
+layer_id_t layer_list(multiple layer_type_t flags, int idx);
+
+/* List layers IDs with any match on flags. If idx is -1, return the
+ length of matches, else return the idxth match, */
+layer_id_t layer_list_any(multiple layer_type_t flags, int idx);
+
+/* Allocate a new UI layer */
+layer_id_t uilayer_alloc(const char *name, const char *color);
+
+/* Internal: */
+/* Append a newly created object to a search list or put it in a static var and
+ return the object */
+nowrap layout_object_t *search_persist_created(const char *search_id, pcb_layer_id_t layer, void *obj, layout_object_mask_t type);
+
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/object.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/object.c
index 8a8f3d1..038e3af 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/object.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/object.c
@@ -2,19 +2,20 @@
#include <assert.h>
#include "layout.h"
#include "src/change.h"
-#include "src/misc.h"
+#include "src/const.h"
+#include "src/board.h"
#include "src/move.h"
#include "src/conf_core.h"
#include "src/layer.h"
int layout_obj_coord(layout_object_t *obj, layout_object_coord_t coord)
{
- AnyObjectType *o;
+ pcb_any_obj_t *o;
if (obj == NULL)
return -1;
- o = (AnyObjectType *)obj->obj.l;
+ o = (pcb_any_obj_t *)obj->obj.l;
/* bounding box is the same for any type */
switch (coord) {
@@ -83,15 +84,20 @@ layout_object_mask_t layout_obj_type(layout_object_t *obj)
int layout_obj_move(layout_object_t *obj, layout_object_coord_t coord, int dx, int dy)
{
void *what = NULL;;
+ pcb_layer_t *ly;
if (obj == NULL)
return -1;
+ ly = pcb_get_layer(obj->layer);
+ if (ly == NULL)
+ return -1;
+
switch(obj->type) {
case OM_LINE:
switch(coord) {
case OC_OBJ:
- MoveObject (PCB_TYPE_LINE_POINT, CURRENT, obj->obj.l, &(obj->obj.l->Point2), dx, dy);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, ly, obj->obj.l, &(obj->obj.l->Point2), dx, dy);
/* intended falltrough */
case OC_P1X:
case OC_P1Y: what = &(obj->obj.l->Point1); break;
@@ -100,21 +106,21 @@ int layout_obj_move(layout_object_t *obj, layout_object_coord_t coord, int dx, i
default: /* we do not handle anything else for now */
;
}
- MoveObject (PCB_TYPE_LINE_POINT, CURRENT, obj->obj.l, what, dx, dy);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, ly, obj->obj.l, what, dx, dy);
return 0;
case OM_TEXT:
- MoveObject (PCB_TYPE_TEXT, CURRENT, obj->obj.t, obj->obj.t, dx, dy);
+ pcb_move_obj(PCB_TYPE_TEXT, ly, obj->obj.t, obj->obj.t, dx, dy);
return 0;
case OM_VIA:
- MoveObject (PCB_TYPE_VIA, obj->obj.v, obj->obj.v, obj->obj.v, dx, dy);
+ pcb_move_obj(PCB_TYPE_VIA, obj->obj.v, obj->obj.v, obj->obj.v, dx, dy);
return 0;
case OM_PIN:
- MoveObject (PCB_TYPE_PIN, obj->obj.pin, obj->obj.pin, obj->obj.pin, dx, dy);
+ pcb_move_obj(PCB_TYPE_PIN, obj->obj.pin, obj->obj.pin, obj->obj.pin, dx, dy);
return 0;
case OM_ARC:
switch(coord) {
case OC_OBJ:
- MoveObject (PCB_TYPE_ARC, CURRENT, obj->obj.a, obj->obj.a, dx, dy);
+ pcb_move_obj(PCB_TYPE_ARC, ly, obj->obj.a, obj->obj.a, dx, dy);
return 0;
default: /* we do not handle anything else for now */
;
@@ -123,7 +129,7 @@ int layout_obj_move(layout_object_t *obj, layout_object_coord_t coord, int dx, i
break;
case OM_POLYGON:
if (obj->layer != -1) {
- MoveObject (PCB_TYPE_POLYGON, PCB->Data->Layer + obj->layer, obj->obj.p, obj->obj.p, dx, dy);
+ pcb_move_obj(PCB_TYPE_POLYGON, PCB->Data->Layer + obj->layer, obj->obj.p, obj->obj.p, dx, dy);
return 0;
}
}
@@ -132,6 +138,12 @@ int layout_obj_move(layout_object_t *obj, layout_object_coord_t coord, int dx, i
int layout_arc_angles(layout_object_t *obj, int relative, int start, int delta)
{
+ pcb_layer_t *ly;
+
+ ly = pcb_get_layer(obj->layer);
+ if (ly == NULL)
+ return -1;
+
if (obj == NULL)
return -1;
if (obj->type != OM_ARC)
@@ -140,6 +152,6 @@ int layout_arc_angles(layout_object_t *obj, int relative, int start, int delta)
start += obj->obj.a->StartAngle;
delta += obj->obj.a->Delta;
}
- ChangeArcAngles (CURRENT, obj->obj.a, start, delta);
+ pcb_arc_set_angles(ly, obj->obj.a, start, delta);
return 0;
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/page.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/page.c
index 4565b8c..bead9a0 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/page.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/page.c
@@ -1,4 +1,5 @@
#include "layout.h"
+#include "src/board.h"
#include "src/change.h"
int layout_get_page_width()
@@ -13,6 +14,6 @@ int layout_get_page_height()
void layout_set_page_size(int width, int height)
{
- ChangePCBSize (MIN(MAX_COORD, MAX(width, MIN_SIZE)), MIN(MAX_COORD, MAX(height, MIN_SIZE)));
+ pcb_board_resize(MIN(PCB_MAX_COORD, MAX(width, PCB_MIN_SIZE)), MIN(PCB_MAX_COORD, MAX(height, PCB_MIN_SIZE)));
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c
index c0bbb77..60f9080 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c
@@ -2,12 +2,13 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include "src/board.h"
#include "src/conf_core.h"
#include "src/layer.h"
#include "layout.h"
#include "config.h"
-static inline void search_append(layout_search_t *s, void *obj)
+static inline layout_object_t *search_append(layout_search_t *s, void *obj)
{
layout_object_t *o;
if (s->used >= s->alloced) {
@@ -28,12 +29,13 @@ static inline void search_append(layout_search_t *s, void *obj)
default:
assert(!"Unimplemented object type");
}
+ return o;
}
-static r_dir_t search_callback (const BoxType * b, void *cl)
+static pcb_r_dir_t search_callback (const pcb_box_t * b, void *cl)
{
search_append(cl, (void *)b);
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
hash_t *layout_searches = NULL;
@@ -53,9 +55,18 @@ static layout_search_t *new_search(const char *search_ID)
return s;
}
+int layout_search_empty(const char *search_ID)
+{
+ layout_search_t *s = new_search(search_ID);
+ if (s != NULL)
+ return 0;
+ return -1;
+}
+
+
int layout_search_box(const char *search_ID, layout_object_mask_t obj_types, int x1, int y1, int x2, int y2)
{
- BoxType spot;
+ pcb_box_t spot;
layout_search_t *s = new_search(search_ID);
spot.X1 = x1;
@@ -66,33 +77,33 @@ int layout_search_box(const char *search_ID, layout_object_mask_t obj_types, int
s->layer = -1;
if (obj_types & OM_LINE) {
s->searching = OM_LINE;
- r_search (CURRENT->line_tree, &spot, NULL, search_callback, s, NULL);
+ pcb_r_search(CURRENT->line_tree, &spot, NULL, search_callback, s, NULL);
}
if (obj_types & OM_TEXT) {
s->searching = OM_TEXT;
- r_search (CURRENT->text_tree, &spot, NULL, search_callback, s, NULL);
+ pcb_r_search(CURRENT->text_tree, &spot, NULL, search_callback, s, NULL);
}
if (obj_types & OM_ARC) {
s->searching = OM_ARC;
- r_search (CURRENT->arc_tree, &spot, NULL, search_callback, s, NULL);
+ pcb_r_search(CURRENT->arc_tree, &spot, NULL, search_callback, s, NULL);
}
if (obj_types & OM_VIA) {
s->searching = OM_VIA;
- r_search (PCB->Data->via_tree, &spot, NULL, search_callback, s, NULL);
+ pcb_r_search(PCB->Data->via_tree, &spot, NULL, search_callback, s, NULL);
}
if (obj_types & OM_PIN) {
s->searching = OM_PIN;
- r_search (PCB->Data->pin_tree, &spot, NULL, search_callback, s, NULL);
+ pcb_r_search(PCB->Data->pin_tree, &spot, NULL, search_callback, s, NULL);
}
if (obj_types & OM_POLYGON) {
s->searching = OM_POLYGON;
- for (s->layer = 0; s->layer < MAX_LAYER + 2; s->layer++)
- r_search (PCB->Data->Layer[s->layer].polygon_tree, &spot, NULL, search_callback, s, NULL);
+ for (s->layer = 0; s->layer < PCB_MAX_LAYER + 2; s->layer++)
+ pcb_r_search(PCB->Data->Layer[s->layer].polygon_tree, &spot, NULL, search_callback, s, NULL);
s->layer = -1;
}
@@ -109,8 +120,8 @@ typedef struct {
static void select_cb(void *obj_, void *ud)
{
select_t *ctx = ud;
- AnyObjectTypePtr obj = obj_;
- if (TEST_FLAG(ctx->flag, obj))
+ pcb_any_obj_t *obj = obj_;
+ if (PCB_FLAG_TEST(ctx->flag, obj))
search_append(ctx->search, obj);
}
@@ -130,9 +141,9 @@ static int layout_search_flag(const char *search_ID, multiple layout_object_mask
{
pcb_cardinal_t l, n;
layout_search_t *s = new_search(search_ID);
- LayerType *layer = PCB->Data->Layer;
+ pcb_layer_t *layer = PCB->Data->Layer;
- for (l =0; l < MAX_LAYER + 2; l++, layer++) {
+ for (l =0; l < PCB_MAX_LAYER + 2; l++, layer++) {
s->layer = l;
select2(s, OM_ARC, flag, &layer->Arc);
select2(s, OM_LINE, flag, &layer->Line);
@@ -184,3 +195,23 @@ int layout_search_free(const char *search_ID)
}
return 2;
}
+
+
+layout_object_t *search_persist_created(const char *search_id, pcb_layer_id_t layer, void *obj, layout_object_mask_t type)
+{
+ layout_search_t *s = NULL;
+ static layout_object_t temp;
+
+ if ((search_id != NULL) && (*search_id != '\0'))
+ s = (layout_search_t *)hash_find(layout_searches, search_id);
+
+ if (s == NULL) {
+ temp.layer = layer;
+ temp.obj.l = obj;
+ temp.type = type;
+ return &temp;
+ }
+ s->searching = type;
+ s->layer = layer;
+ return search_append(s, obj);
+}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c
index d3e4e21..11549f0 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c
@@ -3,8 +3,9 @@
#include <assert.h>
#include <unistd.h>
#include <gpmi.h>
-#include "src/misc.h"
+#include "src/global_typedefs.h"
#include "src/misc_util.h"
+#include "src/compat_misc.h"
#include "src/conf_core.h"
#include "src/event.h"
#include "src/paths.h"
@@ -19,19 +20,34 @@ const char *gpmi_cookie = "GPMI plugin cookie";
/* This function is used to print a detailed GPMI error message */
void gpmi_hid_print_error(gpmi_err_stack_t *entry, char *string)
{
- Message(PCB_MSG_DEFAULT, "[GPMI] %s\n", string);
+ pcb_message(PCB_MSG_ERROR, "[GPMI] %s\n", string);
}
+static void start_timer(void);
+static void timer_cb(pcb_hidval_t hv)
+{
+ static int mono = 0;
+ hid_gpmi_script_info_t *i;
+ for(i = hid_gpmi_script_info; i != NULL; i = i->next)
+ gpmi_call_RunTick(i->module, mono++);
+ start_timer();
+}
+
+static void start_timer(void)
+{
+ pcb_hidval_t hv;
+ pcb_gui->add_timer(timer_cb, 100, hv);
+}
int gpmi_hid_gui_inited = 0;
-static void ev_gui_init(void *user_data, int argc, event_arg_t *argv[])
+static void ev_gui_init(void *user_data, int argc, pcb_event_arg_t argv[])
{
int ev;
char *ev_args;
hid_gpmi_script_info_t *i;
const char *menu = "/main_menu/Plugins/GPMI scripting/Scripts";
- gui->create_menu(menu, "gpmi_scripts()", "S", "Alt<Key>g", "Manage GPMI scripts", gpmi_cookie);
+ pcb_gui->create_menu(menu, "gpmi_scripts()", "S", "Alt<Key>g", "Manage GPMI scripts", gpmi_cookie);
ev = gpmi_event_find("ACTE_gui_init", &ev_args);
if (ev >= 0) {
@@ -40,6 +56,8 @@ static void ev_gui_init(void *user_data, int argc, event_arg_t *argv[])
gpmi_event(i->module, ev, argc, argv);
}
gpmi_hid_gui_inited = 1;
+
+ start_timer();
}
static void cmd_reload(const char *name)
@@ -50,7 +68,7 @@ static void cmd_reload(const char *name)
if (i != NULL)
hid_gpmi_reload_module(i);
else
- Message(PCB_MSG_DEFAULT, "Script %s not found\n", name);
+ pcb_message(PCB_MSG_ERROR, "Script %s not found\n", name);
}
else {
for(i = hid_gpmi_script_info; i != NULL; i = i->next)
@@ -58,53 +76,53 @@ static void cmd_reload(const char *name)
}
}
-static int action_gpmi_scripts(int argc, const char **argv, Coord x, Coord y)
+static int action_gpmi_scripts(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (argc == 0) {
gpmi_hid_manage_scripts();
return 0;
}
- if (strcasecmp(argv[0], "reload") == 0) {
+ if (pcb_strcasecmp(argv[0], "reload") == 0) {
if (argc > 1)
cmd_reload(argv[1]);
else
cmd_reload(NULL);
}
- else if (strcasecmp(argv[0], "load") == 0) {
+ else if (pcb_strcasecmp(argv[0], "load") == 0) {
if (argc == 3) {
if (hid_gpmi_load_module(NULL, argv[1], argv[2], NULL) == NULL)
- Message(PCB_MSG_DEFAULT, "Failed to load %s %s\n", argv[1], argv[2]);
+ pcb_message(PCB_MSG_ERROR, "Failed to load %s %s\n", argv[1], argv[2]);
}
else
- Message(PCB_MSG_DEFAULT, "Invalid number of arguments for load\n");
+ pcb_message(PCB_MSG_ERROR, "Invalid number of arguments for load\n");
}
- else if (strcasecmp(argv[0], "unload") == 0) {
+ else if (pcb_strcasecmp(argv[0], "unload") == 0) {
if (argc == 2) {
hid_gpmi_script_info_t *i = hid_gpmi_lookup(argv[1]);
if (i != NULL) {
if (gpmi_hid_script_unload(i) != 0) {
- Message(PCB_MSG_DEFAULT, "Failed to unload %s\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Failed to unload %s\n", argv[1]);
return 1;
}
}
else {
- Message(PCB_MSG_DEFAULT, "Failed to unload %s: not loaded\n", argv[1]);
+ pcb_message(PCB_MSG_ERROR, "Failed to unload %s: not loaded\n", argv[1]);
return 1;
}
}
else {
- Message(PCB_MSG_DEFAULT, "Invalid number of arguments for unload\n");
+ pcb_message(PCB_MSG_ERROR, "Invalid number of arguments for unload\n");
return 1;
}
}
else {
- Message(PCB_MSG_DEFAULT, "Invalid arguments in gpmi_scripts()\n");
+ pcb_message(PCB_MSG_ERROR, "Invalid arguments in gpmi_scripts()\n");
return 1;
}
return 0;
}
-static int action_gpmi_rehash(int argc, const char **argv, Coord x, Coord y)
+static int action_gpmi_rehash(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
cmd_reload(NULL);
return 0;
@@ -112,21 +130,21 @@ static int action_gpmi_rehash(int argc, const char **argv, Coord x, Coord y)
static void register_actions()
{
- HID_Action act;
+ pcb_hid_action_t act;
act.name = "gpmi_scripts";
act.need_coord_msg = NULL;
act.description = "Manage gpmi scripts";
act.syntax = "TODO";
act.trigger_cb = action_gpmi_scripts;
- hid_register_action(&act, gpmi_cookie, 0);
+ pcb_hid_register_action(&act, gpmi_cookie, 0);
act.name = "rehash";
act.need_coord_msg = NULL;
act.description = "Reload all gpmi scripts";
act.syntax = "TODO";
act.trigger_cb = action_gpmi_rehash;
- hid_register_action(&act, gpmi_cookie, 0);
+ pcb_hid_register_action(&act, gpmi_cookie, 0);
}
#ifndef PLUGIN_INIT_NAME
@@ -142,18 +160,18 @@ static void load_base_and_cfg(void)
const char *home;
void **gpmi_asm_scriptname;
- libdirg = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0);
- libdirh = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0);
- wdirh = resolve_path_inplace(Concat ("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0);
- wdir = Concat("plugins", NULL);
+ libdirg = pcb_path_resolve_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0);
+ libdirh = pcb_path_resolve_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0);
+ wdirh = pcb_path_resolve_inplace(pcb_concat("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0);
+ wdir = pcb_concat("plugins", NULL);
home = getenv ("PCB_RND_GPMI_HOME");
if (home == NULL)
home = conf_core.rc.path.home;
- hdirh = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0);
+ hdirh = pcb_path_resolve_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0);
- fprintf(stderr, "gpmi dirs: lg=%s lh=%s wh=%s w=%s hh=%s\n", libdirg, libdirh, wdirh, wdir, hdirh);
+ pcb_message(PCB_MSG_DEBUG, "gpmi dirs: lg=%s lh=%s wh=%s w=%s hh=%s\n", libdirg, libdirh, wdirh, wdir, hdirh);
/* first add package search path to all host-specific plugin dirs
This is needed because a script installed in ~/.pcb/plugins/ *.conf
@@ -183,19 +201,19 @@ static void load_base_and_cfg(void)
*gpmi_asm_scriptname = gpmi_hid_asm_scriptname;
register_actions();
- event_bind(EVENT_GUI_INIT, ev_gui_init, NULL, gpmi_cookie);
+ pcb_event_bind(PCB_EVENT_GUI_INIT, ev_gui_init, NULL, gpmi_cookie);
hid_gpmi_load_dir(libdirh, 0);
hid_gpmi_load_dir(libdirg, 0);
- dir = Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL);
+ dir = pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL);
hid_gpmi_load_dir(dir, 1);
free(dir);
if (home != NULL) {
hid_gpmi_load_dir (hdirh, 0);
- dir = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0);
+ dir = pcb_path_resolve_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0);
hid_gpmi_load_dir(dir, 1);
free(dir);
}
@@ -212,8 +230,8 @@ static void load_base_and_cfg(void)
static void plugin_gpmi_uninit(void)
{
- event_unbind_allcookie(gpmi_cookie);
- hid_remove_actions_by_cookie(gpmi_cookie);
+ pcb_event_unbind_allcookie(gpmi_cookie);
+ pcb_hid_remove_actions_by_cookie(gpmi_cookie);
hid_gpmi_script_info_uninit();
gpmi_pkg_unload(pkg_scripts);
gpmi_uninit();
@@ -221,7 +239,6 @@ static void plugin_gpmi_uninit(void)
pcb_uninit_t hid_gpmi_init(void)
{
- printf("pcb-gpmi hid is loaded.\n");
gpmi_init();
load_base_and_cfg();
return plugin_gpmi_uninit;
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h
index d02ba22..1987df8 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h
@@ -1,4 +1,4 @@
extern const char *gpmi_cookie;
-extern int gpmi_hid_gui_inited; /* whether the gui is already initialzied */
+extern int gpmi_hid_gui_inited; /* whether the pcb_gui is already initialized */
void gpmi_hid_print_error(gpmi_err_stack_t *entry, char *string);
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c
index 1dfa132..bcc2447 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c
@@ -3,7 +3,7 @@
#include <assert.h>
#include <unistd.h>
#include <gpmi.h>
-#include "src/misc.h"
+#include "src/global_typedefs.h"
#include "src/misc_util.h"
#include "src/event.h"
#include "gpmi_plugin.h"
@@ -11,11 +11,11 @@
#include "src/hid_attrib.h"
-extern HID *gui;
+extern pcb_hid_t *pcb_gui;
#define attr_make_label(attr, name_, help_) \
do { \
- memset((attr), 0, sizeof(HID_Attribute)); \
+ memset((attr), 0, sizeof(pcb_hid_attribute_t)); \
(attr)->name = name_; \
(attr)->help_text = help_; \
(attr)->type = HID_Label; \
@@ -24,14 +24,14 @@ do { \
#define attr_make_label_str(attr, name1, name2, help_) \
do { \
char *__names__; \
- __names__ = Concat(name1, name2, NULL); \
+ __names__ = pcb_concat(name1, name2, NULL); \
attr_make_label(attr, __names__, help_); \
} while(0)
#define attr_make_enum(attr, name_, help_, enum_vals, default_item) \
do { \
- memset((attr), 0, sizeof(HID_Attribute)); \
+ memset((attr), 0, sizeof(pcb_hid_attribute_t)); \
(attr)->name = name_; \
(attr)->help_text = help_; \
(attr)->type = HID_Enum; \
@@ -41,8 +41,8 @@ do { \
static hid_gpmi_script_info_t *choose_script(const char **operations, int *operation)
{
- HID_Attribute attr[3];
- HID_Attr_Val result[3];
+ pcb_hid_attribute_t attr[3];
+ pcb_hid_attr_val_t result[3];
char **scrl, **s;
hid_gpmi_script_info_t *i;
int n, res;
@@ -59,7 +59,7 @@ static hid_gpmi_script_info_t *choose_script(const char **operations, int *opera
else
basename++;
- scrl[n] = Concat(basename, "\t", i->module_name, NULL);
+ scrl[n] = pcb_concat(basename, "\t", i->module_name, NULL);
}
scrl[n] = NULL;
@@ -68,7 +68,7 @@ static hid_gpmi_script_info_t *choose_script(const char **operations, int *opera
if (operations != NULL)
attr_make_enum(&attr[1], "operation", "Choose what to do with the script", operations, *operation);
- res = gui->attribute_dialog(attr, 1 + (operations != NULL), result, "GPMI manage scripts - select script", "Select one of the scripts already loaded");
+ res = pcb_gui->attribute_dialog(attr, 1 + (operations != NULL), result, "GPMI manage scripts - select script", "Select one of the scripts already loaded");
/* free scrl slots before return */
for(s = scrl; *s != NULL; s++)
@@ -98,8 +98,8 @@ static hid_gpmi_script_info_t *load_script(void)
char *fn, *ext;
hid_gpmi_script_info_t *info;
int default_mod = -1;
- HID_Attribute attr[3];
- HID_Attr_Val result[3];
+ pcb_hid_attribute_t attr[3];
+ pcb_hid_attr_val_t result[3];
char *exts[] = {
".tcl", "tcl",
".lua", "lua",
@@ -121,7 +121,7 @@ static hid_gpmi_script_info_t *load_script(void)
"stutter", "ghli", "perl", "php", "cli", NULL };
- fn = gui->fileselect("Load script", "Load a GPMI script", NULL, NULL, "gpmi_load_script", HID_FILESELECT_READ);
+ fn = pcb_gui->fileselect("Load script", "Load a GPMI script", NULL, NULL, "gpmi_load_script", HID_FILESELECT_READ);
if (fn == NULL)
return NULL;
@@ -149,7 +149,7 @@ static hid_gpmi_script_info_t *load_script(void)
attr_make_enum(&attr[0], "module", "Select a GPMI module to interpret the script", modules, default_mod);
- if (gui->attribute_dialog(attr, 1, result, "GPMI manage scripts - select module", "Select one of GPMI modules to interpret the script"))
+ if (pcb_gui->attribute_dialog(attr, 1, result, "GPMI manage scripts - select module", "Select one of GPMI modules to interpret the script"))
return NULL;
if (result[0].int_value < 0)
@@ -157,14 +157,14 @@ static hid_gpmi_script_info_t *load_script(void)
info = hid_gpmi_load_module(NULL, modules[result[0].int_value], fn, NULL);
if (info == NULL)
- gui->report_dialog("GPMI script load", "Error loading the script.\nPlease consult the message log for details.");
+ pcb_gui->report_dialog("GPMI script load", "Error loading the script.\nPlease consult the message log for details.");
return info;
}
static void script_details(hid_gpmi_script_info_t *i)
{
- HID_Attribute attr[4];
- HID_Attr_Val result[4];
+ pcb_hid_attribute_t attr[4];
+ pcb_hid_attr_val_t result[4];
char *cf;
cf = i->conffile_name == NULL ? "<none>" : i->conffile_name;
@@ -173,7 +173,7 @@ static void script_details(hid_gpmi_script_info_t *i)
attr_make_label_str(&attr[0], "File name: ", i->name, "File name of the script (if not absolute, it's relative to the config file)");
attr_make_label_str(&attr[1], "GPMI module: ", i->module_name, "Name of the GPMI module that is interpreting the script");
attr_make_label_str(&attr[2], "Config file: ", cf, "Name of config file that requested the script to be loaded ");
- gui->attribute_dialog(attr, 3, result, "GPMI manage scripts - script details", "Displaying detailed info on a script already loaded");
+ pcb_gui->attribute_dialog(attr, 3, result, "GPMI manage scripts - script details", "Displaying detailed info on a script already loaded");
free((char *)attr[0].name);
free((char *)attr[1].name);
free((char *)attr[2].name);
@@ -193,24 +193,24 @@ void gpmi_hid_manage_scripts(void)
if (i != NULL)
script_details(i);
else
- gui->report_dialog("GPMI script details", err_no_script);
+ pcb_gui->report_dialog("GPMI script details", err_no_script);
break;
case 1:
if (i != NULL) {
i = hid_gpmi_reload_module(i);
if (i == NULL)
- gui->report_dialog("GPMI script reload", "Error reloading the script.\nThe script is now unloaded.\n" CONSULT "\n(e.g. there may be syntax errors in the script source).");
+ pcb_gui->report_dialog("GPMI script reload", "Error reloading the script.\nThe script is now unloaded.\n" CONSULT "\n(e.g. there may be syntax errors in the script source).");
}
else
- gui->report_dialog("GPMI script reload", err_no_script);
+ pcb_gui->report_dialog("GPMI script reload", err_no_script);
break;
case 2:
if (i != NULL) {
if (gpmi_hid_script_unload(i) != 0)
- gui->report_dialog("GPMI script unload", "Error unloading the script.\n" CONSULT "\n");
+ pcb_gui->report_dialog("GPMI script unload", "Error unloading the script.\n" CONSULT "\n");
}
else
- gui->report_dialog("GPMI script unload", err_no_script);
+ pcb_gui->report_dialog("GPMI script unload", err_no_script);
break;
case 3:
if (i != NULL) {
@@ -219,15 +219,15 @@ void gpmi_hid_manage_scripts(void)
r2 = gpmi_hid_script_unload(i);
if (r1 || r2) {
char *msg;
- msg = Concat("Error:",
+ msg = pcb_concat("Error:",
(r1 ? "couldnt't remove the script from the config file;" : ""),
(r2 ? "couldnt't unload the script;" : ""),
"\n" CONSULT "\n", NULL);
- gui->report_dialog("GPMI script unload and remove", msg);
+ pcb_gui->report_dialog("GPMI script unload and remove", msg);
free(msg);
}
else
- gui->report_dialog("GPMI script unload and remove", err_no_script);
+ pcb_gui->report_dialog("GPMI script unload and remove", err_no_script);
}
break;
case 4:
@@ -237,7 +237,7 @@ void gpmi_hid_manage_scripts(void)
i = load_script();
if (i != NULL) {
if (gpmi_hid_script_addcfg(i) != 0)
- gui->report_dialog("GPMI script add to config", "Error adding the script in user configuration.\n" CONSULT "\n");
+ pcb_gui->report_dialog("GPMI script add to config", "Error adding the script in user configuration.\n" CONSULT "\n");
}
break;
}
diff --git a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c
index 92ee726..24b4628 100644
--- a/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c
+++ b/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c
@@ -5,7 +5,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <gpmi.h>
-#include "src/misc.h"
+#include "src/global_typedefs.h"
#include "src/misc_util.h"
#include "src/event.h"
#include "src/error.h"
@@ -121,10 +121,10 @@ hid_gpmi_script_info_t *hid_gpmi_load_module(hid_gpmi_script_info_t *i, const ch
{
gpmi_module *module;
- Message(PCB_MSG_DEFAULT, "Loading GPMI module %s with params %s...\n", module_name, params);
+ pcb_message(PCB_MSG_INFO, "Loading GPMI module %s with params %s...\n", module_name, params);
module = gpmi_mod_load(module_name, params);
if (module == NULL) {
- Message(PCB_MSG_DEFAULT, " Failed loading the script. Details:\n");
+ pcb_message(PCB_MSG_ERROR, " Failed loading the script. Details:\n");
gpmi_err_stack_process_str(gpmi_hid_print_error);
}
gpmi_err_stack_destroy(NULL);
@@ -234,7 +234,7 @@ void hid_gpmi_load_dir(const char *dir, int add_pkg_path)
char *cfn;
conf_dir = dir;
- cfn = Concat(dir, PCB_DIR_SEPARATOR_S, CONFNAME, NULL);
+ cfn = pcb_concat(dir, PCB_DIR_SEPARATOR_S, CONFNAME, NULL);
#ifdef CONFIG_DEBUG
fprintf(stderr, "pcb-gpmi: opening config: %s\n", cfn);
#endif
@@ -309,19 +309,19 @@ int gpmi_hid_script_remove(hid_gpmi_script_info_t *i)
int res;
if (i->conffile_name == NULL) {
- Message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, the script is not loaded from a config.\n");
+ pcb_message(PCB_MSG_ERROR, "gpmi_hid_script_remove(): can't remove script from configs, the script is not loaded from a config.\n");
return -1;
}
fin = fopen(i->conffile_name, "r");
if (fin == NULL) {
- Message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, can't open %s for read.\n", i->conffile_name);
+ pcb_message(PCB_MSG_ERROR, "gpmi_hid_script_remove(): can't remove script from configs, can't open %s for read.\n", i->conffile_name);
return -1;
}
- tmpfn = Concat(i->conffile_name, ".tmp", NULL);
+ tmpfn = pcb_concat(i->conffile_name, ".tmp", NULL);
fout = fopen(tmpfn, "w");
if (fout == NULL) {
- Message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, can't create %s.\n", tmpfn);
+ pcb_message(PCB_MSG_ERROR, "gpmi_hid_script_remove(): can't remove script from configs, can't create %s.\n", tmpfn);
fclose(fin);
free(tmpfn);
return -1;
@@ -333,13 +333,13 @@ int gpmi_hid_script_remove(hid_gpmi_script_info_t *i)
fclose(fout);
if (res < 1) {
- Message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, can't find the correspondign config line in %s\n", i->conffile_name);
+ pcb_message(PCB_MSG_ERROR, "gpmi_hid_script_remove(): can't remove script from configs, can't find the correspondign config line in %s\n", i->conffile_name);
free(tmpfn);
return -1;
}
if (rename(tmpfn, i->conffile_name) != 0) {
- Message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, can't move %s to %s.\n", tmpfn, i->conffile_name);
+ pcb_message(PCB_MSG_ERROR, "gpmi_hid_script_remove(): can't remove script from configs, can't move %s to %s.\n", tmpfn, i->conffile_name);
free(tmpfn);
return -1;
}
@@ -359,22 +359,22 @@ int gpmi_hid_script_addcfg(hid_gpmi_script_info_t *i)
home = conf_core.rc.path.home;
if (conf_core.rc.path.home != NULL) {
- fn = Concat(home, PCB_DIR_SEPARATOR_S ".pcb", NULL);
+ fn = pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb", NULL);
pcb_mkdir(fn, 0755);
free(fn);
- fn = Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL);
+ fn = pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL);
pcb_mkdir(fn, 0755);
free(fn);
- fn = Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL);
+ fn = pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL);
}
else
- fn = Concat("plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL);
+ fn = pcb_concat("plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL);
- f = fopen(fn, "a");
+ f = fopen(fn, "a");
if (f == NULL) {
- Message(PCB_MSG_DEFAULT, "gpmi_hid_script_addcfg: can't open %s for write\n", fn);
+ pcb_message(PCB_MSG_ERROR, "gpmi_hid_script_addcfg: can't open %s for write\n", fn);
return -1;
}
diff --git a/src_plugins/hid_batch/Makefile b/src_plugins/hid_batch/Makefile
index 3477d42..c1effe6 100644
--- a/src_plugins/hid_batch/Makefile
+++ b/src_plugins/hid_batch/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_hid_batch
+ cd ../../src && $(MAKE) mod_hid_batch
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/hid_batch/batch.c b/src_plugins/hid_batch/batch.c
index 089ccb6..b5efb3d 100644
--- a/src_plugins/hid_batch/batch.c
+++ b/src_plugins/hid_batch/batch.c
@@ -5,15 +5,14 @@
#include <stdlib.h>
#include <string.h>
-#include "global.h"
+#include "board.h"
#include "hid.h"
#include "data.h"
-#include "misc.h"
#include "layer.h"
-#include "hid.h"
#include "pcb-printf.h"
#include "plugins.h"
#include "compat_misc.h"
+#include "event.h"
#include "hid_draw_helpers.h"
#include "hid_nogui.h"
@@ -28,11 +27,11 @@ static void batch_end(void);
/* This is a text-line "batch" HID, which exists for scripting and
non-GUI needs. */
-typedef struct hid_gc_struct {
+typedef struct hid_gc_s {
int nothing_interesting_here;
-} hid_gc_struct;
+} hid_gc_s;
-static HID_Attribute *batch_get_export_options(int *n_ret)
+static pcb_hid_attribute_t *batch_get_export_options(int *n_ret)
{
return 0;
}
@@ -43,17 +42,15 @@ static char *prompt = NULL;
static void hid_batch_uninit(void)
{
- hid_remove_actions_by_cookie(batch_cookie);
- if (prompt != NULL)
+ pcb_hid_remove_actions_by_cookie(batch_cookie);
+ pcb_event_unbind_allcookie(batch_cookie);
+ if (prompt != NULL) {
free(prompt);
+ prompt = NULL;
+ }
}
-static int nop(int argc, const char **argv, Coord x, Coord y)
-{
- return 0;
-}
-
-static int PCBChanged(int argc, const char **argv, Coord x, Coord y)
+static void ev_pcb_changed(void *user_data, int argc, pcb_event_arg_t argv[])
{
if (prompt != NULL)
free(prompt);
@@ -68,64 +65,49 @@ static int PCBChanged(int argc, const char **argv, Coord x, Coord y)
}
else
prompt = pcb_strdup("no-board");
- return 0;
}
-static int help(int argc, const char **argv, Coord x, Coord y)
+static int help(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- print_actions();
+ pcb_print_actions();
return 0;
}
-static int info(int argc, const char **argv, Coord x, Coord y)
+static int info(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int i, j;
- int cg, sg;
+ pcb_layergrp_id_t cg, sg;
if (!PCB || !PCB->Data || !PCB->Filename) {
printf("No PCB loaded.\n");
return 0;
}
printf("Filename: %s\n", PCB->Filename);
pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n", PCB->MaxWidth, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight);
- cg = GetLayerGroupNumberByNumber(component_silk_layer);
- sg = GetLayerGroupNumberByNumber(solder_silk_layer);
- for (i = 0; i < MAX_LAYER; i++) {
+ cg = pcb_layer_get_group(pcb_component_silk_layer);
+ sg = pcb_layer_get_group(pcb_solder_silk_layer);
+ for (i = 0; i < PCB_MAX_LAYER; i++) {
- int lg = GetLayerGroupNumberByNumber(i);
- for (j = 0; j < MAX_LAYER; j++)
+ pcb_layergrp_id_t lg = pcb_layer_get_group(i);
+ for (j = 0; j < PCB_MAX_LAYER; j++)
putchar(j == lg ? '#' : '-');
printf(" %c %s\n", lg == cg ? 'c' : lg == sg ? 's' : '-', PCB->Data->Layer[i].Name);
}
return 0;
}
-HID_Action batch_action_list[] = {
- {"PCBChanged", 0, PCBChanged}
- ,
- {"RouteStylesChanged", 0, nop}
- ,
- {"NetlistChanged", 0, nop}
- ,
- {"LayersChanged", 0, nop}
- ,
- {"LibraryChanged", 0, nop}
- ,
- {"Busy", 0, nop}
- ,
+pcb_hid_action_t batch_action_list[] = {
{"Help", 0, help}
,
{"Info", 0, info}
- ,
- {"PointCursor", 0, info}
};
-REGISTER_ACTIONS(batch_action_list, batch_cookie)
+PCB_REGISTER_ACTIONS(batch_action_list, batch_cookie)
extern int isatty();
/* ----------------------------------------------------------------------------- */
static int batch_stay;
-static void batch_do_export(HID_Attr_Val * options)
+static void batch_do_export(pcb_hid_attr_val_t * options)
{
int interactive;
char line[1000];
@@ -152,22 +134,22 @@ static void batch_do_export(HID_Attr_Val * options)
hid_batch_uninit();
return;
}
- hid_parse_command(line);
+ pcb_hid_parse_command(line);
}
batch_end();
}
-static void batch_do_exit(HID *hid)
+static void batch_do_exit(pcb_hid_t *hid)
{
batch_stay = 0;
}
static void batch_parse_arguments(int *argc, char ***argv)
{
- hid_parse_command_line(argc, argv);
+ pcb_hid_parse_command_line(argc, argv);
}
-static void batch_invalidate_lr(int l, int r, int t, int b)
+static void batch_invalidate_lr(pcb_coord_t l, pcb_coord_t r, pcb_coord_t t, pcb_coord_t b)
{
}
@@ -175,17 +157,17 @@ static void batch_invalidate_all(void)
{
}
-static int batch_set_layer(const char *name, int idx, int empty)
+static int batch_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
return 0;
}
-static hidGC batch_make_gc(void)
+static pcb_hid_gc_t batch_make_gc(void)
{
return 0;
}
-static void batch_destroy_gc(hidGC gc)
+static void batch_destroy_gc(pcb_hid_gc_t gc)
{
}
@@ -193,43 +175,43 @@ static void batch_use_mask(int use_it)
{
}
-static void batch_set_color(hidGC gc, const char *name)
+static void batch_set_color(pcb_hid_gc_t gc, const char *name)
{
}
-static void batch_set_line_cap(hidGC gc, EndCapStyle style)
+static void batch_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
}
-static void batch_set_line_width(hidGC gc, Coord width)
+static void batch_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
}
-static void batch_set_draw_xor(hidGC gc, int xor_set)
+static void batch_set_draw_xor(pcb_hid_gc_t gc, int xor_set)
{
}
-static void batch_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void batch_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
}
-static void batch_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle end_angle)
+static void batch_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle)
{
}
-static void batch_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void batch_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
}
-static void batch_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void batch_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
}
-static void batch_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void batch_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
}
-static void batch_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void batch_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
}
@@ -252,7 +234,7 @@ static int batch_mod1_is_pressed(void)
return 0;
}
-static void batch_get_coords(const char *msg, Coord * x, Coord * y)
+static void batch_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y)
{
}
@@ -260,43 +242,43 @@ static void batch_set_crosshair(int x, int y, int action)
{
}
-static hidval batch_add_timer(void (*func) (hidval user_data), unsigned long milliseconds, hidval user_data)
+static pcb_hidval_t batch_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data)
{
- hidval rv;
+ pcb_hidval_t rv;
rv.lval = 0;
return rv;
}
-static void batch_stop_timer(hidval timer)
+static void batch_stop_timer(pcb_hidval_t timer)
{
}
-hidval
-batch_watch_file(int fd, unsigned int condition, void (*func) (hidval watch, int fd, unsigned int condition, hidval user_data),
- hidval user_data)
+pcb_hidval_t
+batch_watch_file(int fd, unsigned int condition, void (*func) (pcb_hidval_t watch, int fd, unsigned int condition, pcb_hidval_t user_data),
+ pcb_hidval_t user_data)
{
- hidval ret;
+ pcb_hidval_t ret;
ret.ptr = NULL;
return ret;
}
-void batch_unwatch_file(hidval data)
+void batch_unwatch_file(pcb_hidval_t data)
{
}
-static hidval batch_add_block_hook(void (*func) (hidval data), hidval user_data)
+static pcb_hidval_t batch_add_block_hook(void (*func) (pcb_hidval_t data), pcb_hidval_t user_data)
{
- hidval ret;
+ pcb_hidval_t ret;
ret.ptr = NULL;
return ret;
}
-static void batch_stop_block_hook(hidval mlpoll)
+static void batch_stop_block_hook(pcb_hidval_t mlpoll)
{
}
static int
-batch_attribute_dialog(HID_Attribute * attrs_, int n_attrs_, HID_Attr_Val * results_, const char *title_, const char *descr_)
+batch_attribute_dialog(pcb_hid_attribute_t * attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, const char *descr_)
{
return 0;
}
@@ -339,16 +321,17 @@ static void batch_propedit_add_stat(void *pe, const char *propname, void *propct
#include "dolists.h"
-static HID batch_hid;
+static pcb_hid_t batch_hid;
+
pcb_uninit_t hid_hid_batch_init()
{
- memset(&batch_hid, 0, sizeof(HID));
+ memset(&batch_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&batch_hid);
- common_draw_helpers_init(&batch_hid);
+ pcb_hid_nogui_init(&batch_hid);
+ pcb_dhlp_draw_helpers_init(&batch_hid);
- batch_hid.struct_size = sizeof(HID);
+ batch_hid.struct_size = sizeof(pcb_hid_t);
batch_hid.name = "batch";
batch_hid.description = "Batch-mode GUI for non-interactive use.";
batch_hid.gui = 1;
@@ -359,7 +342,7 @@ pcb_uninit_t hid_hid_batch_init()
batch_hid.parse_arguments = batch_parse_arguments;
batch_hid.invalidate_lr = batch_invalidate_lr;
batch_hid.invalidate_all = batch_invalidate_all;
- batch_hid.set_layer = batch_set_layer;
+ batch_hid.set_layer_group = batch_set_layer_group;
batch_hid.make_gc = batch_make_gc;
batch_hid.destroy_gc = batch_destroy_gc;
batch_hid.use_mask = batch_use_mask;
@@ -395,17 +378,18 @@ pcb_uninit_t hid_hid_batch_init()
batch_hid.propedit_add_value = batch_propedit_add_value;
batch_hid.propedit_add_stat = batch_propedit_add_stat;
+ pcb_event_bind(PCB_EVENT_BOARD_CHANGED, ev_pcb_changed, NULL, batch_cookie);
- hid_register_hid(&batch_hid);
- return NULL;
+ pcb_hid_register_hid(&batch_hid);
+ return hid_batch_uninit;
}
static void batch_begin(void)
{
- REGISTER_ACTIONS(batch_action_list, batch_cookie)
+ PCB_REGISTER_ACTIONS(batch_action_list, batch_cookie)
}
static void batch_end(void)
{
- hid_remove_actions_by_cookie(batch_cookie);
+ pcb_hid_remove_actions_by_cookie(batch_cookie);
}
diff --git a/src_plugins/hid_gtk/Makefile b/src_plugins/hid_gtk/Makefile
index 84cf1c9..9be8e31 100644
--- a/src_plugins/hid_gtk/Makefile
+++ b/src_plugins/hid_gtk/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_hid_gtk
+ cd ../../src && $(MAKE) mod_hid_gtk
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/hid_gtk/Plug.tmpasm b/src_plugins/hid_gtk/Plug.tmpasm
index 29766ee..bcd2404 100644
--- a/src_plugins/hid_gtk/Plug.tmpasm
+++ b/src_plugins/hid_gtk/Plug.tmpasm
@@ -36,6 +36,7 @@ switch /local/pcb/hid_gtk/controls
default
put /local/pcb/mod/CFLAGS /target/libs/gui/gtk2/cflags
put /local/pcb/mod/LDFLAGS /target/libs/gui/gtk2/ldflags
+ put /local/pcb/mod/CLEANFILES { $(PLUGDIR)/hid_gtk/menu_lht.c }
append /local/pcb/RULES [@
### lesstif menu embed
$(PLUGDIR)/hid_gtk/menu_lht.c: pcb-menu-gtk.lht
diff --git a/src_plugins/hid_gtk/ghid-cell-renderer-visibility.c b/src_plugins/hid_gtk/ghid-cell-renderer-visibility.c
index 3a069cc..0c0478a 100644
--- a/src_plugins/hid_gtk/ghid-cell-renderer-visibility.c
+++ b/src_plugins/hid_gtk/ghid-cell-renderer-visibility.c
@@ -10,8 +10,10 @@
#include <glib-object.h>
#include <gtk/gtk.h>
+#include "config.h"
#include "gtkhid.h"
#include "gui.h"
+#include "compat_nls.h"
#include "ghid-cell-renderer-visibility.h"
diff --git a/src_plugins/hid_gtk/ghid-coord-entry.c b/src_plugins/hid_gtk/ghid-coord-entry.c
index 3ba0679..90c9b54 100644
--- a/src_plugins/hid_gtk/ghid-coord-entry.c
+++ b/src_plugins/hid_gtk/ghid-coord-entry.c
@@ -14,9 +14,11 @@
#include <glib-object.h>
#include <gtk/gtk.h>
+#include "config.h"
#include "gtkhid.h"
#include "gui.h"
#include "pcb-printf.h"
+#include "compat_nls.h"
#include "ghid-coord-entry.h"
@@ -30,18 +32,18 @@ static guint ghid_coord_entry_signals[LAST_SIGNAL] = { 0 };
struct _GHidCoordEntry {
GtkSpinButton parent;
- Coord min_value;
- Coord max_value;
- Coord value;
+ pcb_coord_t min_value;
+ pcb_coord_t max_value;
+ pcb_coord_t value;
enum ce_step_size step_size;
- const Unit *unit;
+ const pcb_unit_t *unit;
};
struct _GHidCoordEntryClass {
GtkSpinButtonClass parent_class;
- void (*change_unit) (GHidCoordEntry *, const Unit *);
+ void (*change_unit) (GHidCoordEntry *, const pcb_unit_t *);
};
/* SIGNAL HANDLERS */
@@ -49,7 +51,7 @@ struct _GHidCoordEntryClass {
static void menu_item_activate_cb(GtkMenuItem * item, GHidCoordEntry * ce)
{
const char *text = gtk_menu_item_get_label(item);
- const Unit *unit = get_unit_struct(text);
+ const pcb_unit_t *unit = get_unit_struct(text);
g_signal_emit(ce, ghid_coord_entry_signals[UNIT_CHANGE_SIGNAL], 0, unit);
}
@@ -58,11 +60,11 @@ static void menu_item_activate_cb(GtkMenuItem * item, GHidCoordEntry * ce)
static void ghid_coord_entry_popup_cb(GHidCoordEntry * ce, GtkMenu * menu, gpointer data)
{
int i, n;
- const Unit *unit_list;
+ const pcb_unit_t *unit_list;
GtkWidget *menu_item, *submenu;
/* Build submenu */
- n = get_n_units();
+ n = pcb_get_n_units();
unit_list = get_unit_list();
submenu = gtk_menu_new();
@@ -103,7 +105,7 @@ static gboolean ghid_coord_text_changed_cb(GHidCoordEntry * entry, gpointer data
{
const char *text;
char *suffix;
- const Unit *new_unit;
+ const pcb_unit_t *new_unit;
double value;
/* Check if units have changed */
@@ -111,7 +113,7 @@ static gboolean ghid_coord_text_changed_cb(GHidCoordEntry * entry, gpointer data
value = strtod(text, &suffix);
new_unit = get_unit_struct(suffix);
if (new_unit && new_unit != entry->unit) {
- entry->value = unit_to_coord(new_unit, value);
+ entry->value = pcb_unit_to_coord(new_unit, value);
g_signal_emit(entry, ghid_coord_entry_signals[UNIT_CHANGE_SIGNAL], 0, new_unit);
}
@@ -125,7 +127,7 @@ static gboolean ghid_coord_value_changed_cb(GHidCoordEntry * ce, gpointer data)
/* Re-calculate internal value */
double value = gtk_adjustment_get_value(adj);
- ce->value = unit_to_coord(ce->unit, value);
+ ce->value = pcb_unit_to_coord(ce->unit, value);
/* Handle potential unit changes */
ghid_coord_text_changed_cb(ce, data);
@@ -137,16 +139,16 @@ static gboolean ghid_coord_value_changed_cb(GHidCoordEntry * ce, gpointer data)
* \param [in] ce The entry to be acted on
* \parin [in] new_unit The new unit to be used
*/
-static void ghid_coord_entry_change_unit(GHidCoordEntry * ce, const Unit * new_unit)
+static void ghid_coord_entry_change_unit(GHidCoordEntry * ce, const pcb_unit_t * new_unit)
{
double climb_rate = 0.0;
GtkAdjustment *adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(ce));
ce->unit = new_unit;
/* Re-calculate min/max values for spinbox */
- gtk_adjustment_configure(adj, coord_to_unit(new_unit, ce->value),
- coord_to_unit(new_unit, ce->min_value),
- coord_to_unit(new_unit, ce->max_value), ce->unit->step_small, ce->unit->step_medium, 0.0);
+ gtk_adjustment_configure(adj, pcb_coord_to_unit(new_unit, ce->value),
+ pcb_coord_to_unit(new_unit, ce->min_value),
+ pcb_coord_to_unit(new_unit, ce->max_value), ce->unit->step_small, ce->unit->step_medium, 0.0);
switch (ce->step_size) {
case CE_TINY:
@@ -180,7 +182,7 @@ static void ghid_coord_entry_class_init(GHidCoordEntryClass * klass)
klass->change_unit = ghid_coord_entry_change_unit;
/* GtkAutoComplete *ce : the object acted on */
- /* const Unit *new_unit: the new unit that was set */
+ /* const pcb_unit_t *new_unit: the new unit that was set */
ghid_coord_entry_signals[UNIT_CHANGE_SIGNAL] =
g_signal_new("change-unit",
G_TYPE_FROM_CLASS(klass),
@@ -224,7 +226,7 @@ GType ghid_coord_entry_get_type(void)
*
* \return a freshly-allocated GHidCoordEntry
*/
-GtkWidget *ghid_coord_entry_new(Coord min_val, Coord max_val, Coord value, const Unit * unit, enum ce_step_size step_size)
+GtkWidget *ghid_coord_entry_new(pcb_coord_t min_val, pcb_coord_t max_val, pcb_coord_t value, const pcb_unit_t * unit, enum ce_step_size step_size)
{
/* Setup spinbox min/max values */
double small_step, big_step;
@@ -259,9 +261,9 @@ GtkWidget *ghid_coord_entry_new(Coord min_val, Coord max_val, Coord value, const
break;
}
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(coord_to_unit(unit, value),
- coord_to_unit(unit, min_val),
- coord_to_unit(unit, max_val), small_step, big_step, 0.0));
+ adj = GTK_ADJUSTMENT(gtk_adjustment_new(pcb_coord_to_unit(unit, value),
+ pcb_coord_to_unit(unit, min_val),
+ pcb_coord_to_unit(unit, max_val), small_step, big_step, 0.0));
gtk_spin_button_configure(GTK_SPIN_BUTTON(ce), adj, small_step, unit->default_prec + strlen(unit->suffix));
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ce), FALSE);
@@ -269,7 +271,7 @@ GtkWidget *ghid_coord_entry_new(Coord min_val, Coord max_val, Coord value, const
}
/*! \brief Gets a GHidCoordEntry's value, in pcb coords */
-Coord ghid_coord_entry_get_value(GHidCoordEntry * ce)
+pcb_coord_t ghid_coord_entry_get_value(GHidCoordEntry * ce)
{
return ce->value;
}
@@ -283,7 +285,7 @@ int ghid_coord_entry_get_value_str(GHidCoordEntry * ce, char *out, int out_len)
}
/*! \brief Sets a GHidCoordEntry's value, in pcb coords */
-void ghid_coord_entry_set_value(GHidCoordEntry * ce, Coord val)
+void ghid_coord_entry_set_value(GHidCoordEntry * ce, pcb_coord_t val)
{
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(ce), coord_to_unit(ce->unit, val));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(ce), pcb_coord_to_unit(ce->unit, val));
}
diff --git a/src_plugins/hid_gtk/ghid-coord-entry.h b/src_plugins/hid_gtk/ghid-coord-entry.h
index 69b763f..b7c8414 100644
--- a/src_plugins/hid_gtk/ghid-coord-entry.h
+++ b/src_plugins/hid_gtk/ghid-coord-entry.h
@@ -22,13 +22,13 @@ typedef struct _GHidCoordEntryClass GHidCoordEntryClass;
enum ce_step_size { CE_TINY, CE_SMALL, CE_MEDIUM, CE_LARGE };
GType ghid_coord_entry_get_type(void);
-GtkWidget *ghid_coord_entry_new(Coord min_val, Coord max_val, Coord value, const Unit * unit, enum ce_step_size step_size);
+GtkWidget *ghid_coord_entry_new(pcb_coord_t min_val, pcb_coord_t max_val, pcb_coord_t value, const pcb_unit_t * unit, enum ce_step_size step_size);
void ghid_coord_entry_add_entry(GHidCoordEntry * ce, const gchar * name, const gchar * desc);
gchar *ghid_coord_entry_get_last_command(GHidCoordEntry * ce);
int ghid_coord_entry_get_value_str(GHidCoordEntry * ce, char *out, int out_len);
-Coord ghid_coord_entry_get_value(GHidCoordEntry * ce);
-void ghid_coord_entry_set_value(GHidCoordEntry * ce, Coord val);
+pcb_coord_t ghid_coord_entry_get_value(GHidCoordEntry * ce);
+void ghid_coord_entry_set_value(GHidCoordEntry * ce, pcb_coord_t val);
G_END_DECLS /* keep c++ happy */
#endif
diff --git a/src_plugins/hid_gtk/ghid-layer-selector.c b/src_plugins/hid_gtk/ghid-layer-selector.c
index fce20c4..8bdec50 100644
--- a/src_plugins/hid_gtk/ghid-layer-selector.c
+++ b/src_plugins/hid_gtk/ghid-layer-selector.c
@@ -11,6 +11,7 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include "config.h"
#include "gtkhid.h"
#include "gui.h"
#include "pcb-printf.h"
@@ -736,7 +737,7 @@ void ghid_layer_selector_update_colors(GHidLayerSelector * ls, const gchar * (*c
* Deletes layers according to a callback function: a return value of TRUE
* means delete, FALSE means leave it alone. Do not try to delete all layers
* using this function; with nothing left to select, pcb will likely go into
- * an infinite recursion between hid_action() and g_signal().
+ * an infinite recursion between pcb_hid_action() and g_signal().
*
* Separators will be deleted if the layer AFTER them is deleted.
*
diff --git a/src_plugins/hid_gtk/ghid-main-menu.c b/src_plugins/hid_gtk/ghid-main-menu.c
index eadc587..7760452 100644
--- a/src_plugins/hid_gtk/ghid-main-menu.c
+++ b/src_plugins/hid_gtk/ghid-main-menu.c
@@ -9,6 +9,7 @@
#include <gtk/gtk.h>
#include <liblihata/tree.h>
+#include "config.h"
#include "gtkhid.h"
#include "gui.h"
#include "pcb-printf.h"
@@ -78,21 +79,21 @@ static GtkAction *ghid_add_menu(GHidMainMenu * menu, GtkMenuShell * shell, lht_n
GtkAction *action = NULL;
char *accel = NULL;
char *menu_label;
- lht_node_t *n_action = hid_cfg_menu_field(sub_res, MF_ACTION, NULL);
- lht_node_t *n_keydesc = hid_cfg_menu_field(sub_res, MF_ACCELERATOR, NULL);
+ lht_node_t *n_action = pcb_hid_cfg_menu_field(sub_res, PCB_MF_ACTION, NULL);
+ lht_node_t *n_keydesc = pcb_hid_cfg_menu_field(sub_res, PCB_MF_ACCELERATOR, NULL);
/* Resolve accelerator and save it */
if (n_keydesc != NULL) {
if (n_action != NULL) {
- hid_cfg_keys_add_by_desc(&ghid_keymap, n_keydesc, n_action, NULL, 0);
- accel = hid_cfg_keys_gen_accel(&ghid_keymap, n_keydesc, 1, NULL);
+ pcb_hid_cfg_keys_add_by_desc(&ghid_keymap, n_keydesc, n_action, NULL, 0);
+ accel = pcb_hid_cfg_keys_gen_accel(&ghid_keymap, n_keydesc, 1, NULL);
}
else
- hid_cfg_error(sub_res, "No action specified for key accel\n");
+ pcb_hid_cfg_error(sub_res, "No action specified for key accel\n");
}
/* Resolve the mnemonic */
- tmp_val = hid_cfg_menu_field_str(sub_res, MF_MNEMONIC);
+ tmp_val = pcb_hid_cfg_menu_field_str(sub_res, PCB_MF_MNEMONIC);
if (tmp_val)
mnemonic = tmp_val[0];
@@ -115,7 +116,7 @@ static GtkAction *ghid_add_menu(GHidMainMenu * menu, GtkMenuShell * shell, lht_n
}
}
- if (hid_cfg_has_submenus(sub_res)) {
+ if (pcb_hid_cfg_has_submenus(sub_res)) {
/* SUBMENU */
GtkWidget *submenu = gtk_menu_new();
GtkWidget *item = gtk_menu_item_new_with_mnemonic(menu_label);
@@ -130,19 +131,19 @@ static GtkAction *ghid_add_menu(GHidMainMenu * menu, GtkMenuShell * shell, lht_n
/* add tearoff to menu */
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), tearoff);
- /* recurse on the newly-added submenu; hid_cfg_has_submenus() makes sure
+ /* recurse on the newly-added submenu; pcb_hid_cfg_has_submenus() makes sure
the node format is correct; iterate over the list of submenus and create
them recursively. */
- n = hid_cfg_menu_field(sub_res, MF_SUBMENU, NULL);
+ n = pcb_hid_cfg_menu_field(sub_res, PCB_MF_SUBMENU, NULL);
for(n = n->data.list.first; n != NULL; n = n->next)
ghid_main_menu_real_add_node(menu, GTK_MENU_SHELL(submenu), n);
}
else {
/* NON-SUBMENU: MENU ITEM */
- const char *checked = hid_cfg_menu_field_str(sub_res, MF_CHECKED);
- const char *update_on = hid_cfg_menu_field_str(sub_res, MF_UPDATE_ON);
- const char *label = hid_cfg_menu_field_str(sub_res, MF_SENSITIVE);
- const char *tip = hid_cfg_menu_field_str(sub_res, MF_TIP);
+ const char *checked = pcb_hid_cfg_menu_field_str(sub_res, PCB_MF_CHECKED);
+ const char *update_on = pcb_hid_cfg_menu_field_str(sub_res, PCB_MF_UPDATE_ON);
+ const char *label = pcb_hid_cfg_menu_field_str(sub_res, PCB_MF_SENSITIVE);
+ const char *tip = pcb_hid_cfg_menu_field_str(sub_res, PCB_MF_TIP);
if (checked) {
/* TOGGLE ITEM */
conf_native_t *nat = NULL;
@@ -170,7 +171,7 @@ static GtkAction *ghid_add_menu(GHidMainMenu * menu, GtkMenuShell * shell, lht_n
}
else {
if ((update_on == NULL) || (*update_on != '\0')) /* warn if update_on is not explicitly empty */
- Message(PCB_MSG_WARNING, "Checkbox menu item not %s updated on any conf change - try to use the update_on field\n", checked);
+ pcb_message(PCB_MSG_WARNING, "Checkbox menu item not %s updated on any conf change - try to use the update_on field\n", checked);
}
}
else if (label && strcmp(label, "false") == 0) {
@@ -190,8 +191,8 @@ static GtkAction *ghid_add_menu(GHidMainMenu * menu, GtkMenuShell * shell, lht_n
if ((tip != NULL) || (n_keydesc != NULL)) {
char *acc = NULL, *s;
if (n_keydesc != NULL)
- acc = hid_cfg_keys_gen_accel(&ghid_keymap, n_keydesc, -1, "\nhotkey: ");
- s = Concat((tip == NULL ? "" : tip), "\nhotkey: ", (acc == NULL ? "" : acc), NULL);
+ acc = pcb_hid_cfg_keys_gen_accel(&ghid_keymap, n_keydesc, -1, "\nhotkey: ");
+ s = pcb_concat((tip == NULL ? "" : tip), "\nhotkey: ", (acc == NULL ? "" : acc), NULL);
gtk_widget_set_tooltip_text(item, s);
free(s);
}
@@ -236,11 +237,11 @@ void ghid_main_menu_real_add_node(GHidMainMenu * menu, GtkMenuShell * shell, lht
if (action) {
const char *val;
- val = hid_cfg_menu_field_str(base, MF_CHECKED);
+ val = pcb_hid_cfg_menu_field_str(base, PCB_MF_CHECKED);
if (val != NULL)
g_object_set_data(G_OBJECT(action), "checked-flag", (gpointer *)val);
- val = hid_cfg_menu_field_str(base, MF_ACTIVE);
+ val = pcb_hid_cfg_menu_field_str(base, PCB_MF_ACTIVE);
if (val != NULL)
g_object_set_data(G_OBJECT(action), "active-flag", (gpointer *)val);
}
@@ -273,11 +274,11 @@ void ghid_main_menu_real_add_node(GHidMainMenu * menu, GtkMenuShell * shell, lht
menu->route_style_pos = pos;
}
else
- hid_cfg_error(base, "Unexpected text node; the only text accepted here is sep, -, @layerview, @layerpick and @routestyles");
+ pcb_hid_cfg_error(base, "Unexpected text node; the only text accepted here is sep, -, @layerview, @layerpick and @routestyles");
}
break;
default:
- hid_cfg_error(base, "Unexpected node type; should be hash (submenu) or text (separator or @special)");
+ pcb_hid_cfg_error(base, "Unexpected node type; should be hash (submenu) or text (separator or @special)");
}
}
@@ -347,7 +348,7 @@ void ghid_main_menu_add_node(GHidMainMenu * menu, const lht_node_t *base)
{
lht_node_t *n;
if (base->type != LHT_LIST) {
- hid_cfg_error(base, "Menu description shall be a list (li)\n");
+ pcb_hid_cfg_error(base, "Menu description shall be a list (li)\n");
abort();
}
for(n = base->data.list.first; n != NULL; n = n->next) {
@@ -361,9 +362,9 @@ void ghid_main_menu_add_popup_node(GHidMainMenu * menu, lht_node_t *base)
lht_node_t *submenu, *i;
GtkWidget *new_menu;
- submenu = hid_cfg_menu_field_path(base, "submenu");
+ submenu = pcb_hid_cfg_menu_field_path(base, "submenu");
if (submenu == NULL) {
- hid_cfg_error(base, "can not create popup without submenu list");
+ pcb_hid_cfg_error(base, "can not create popup without submenu list");
return;
}
@@ -394,7 +395,7 @@ ghid_main_menu_update_toggle_state(GHidMainMenu * menu,
GList *list;
for (list = menu->actions; list; list = list->next) {
lht_node_t *res = g_object_get_data(G_OBJECT(list->data), "resource");
- lht_node_t *act = hid_cfg_menu_field(res, MF_ACTION, NULL);
+ lht_node_t *act = pcb_hid_cfg_menu_field(res, PCB_MF_ACTION, NULL);
const char *tf = g_object_get_data(G_OBJECT(list->data),
"checked-flag");
const char *af = g_object_get_data(G_OBJECT(list->data),
@@ -458,7 +459,7 @@ void ghid_main_menu_install_route_style_selector(GHidMainMenu * mm, GHidRouteSty
GtkAccelGroup *ghid_main_menu_get_accel_group(GHidMainMenu * menu)
{
if (menu == NULL) {
- Message(PCB_MSG_DEFAULT, "ghid: can't initialize the menu - is your menu .lht valid?\n");
+ pcb_message(PCB_MSG_ERROR, "ghid: can't initialize the menu - is your menu .lht valid?\n");
exit(1);
}
return menu->accel_group;
@@ -511,11 +512,11 @@ static int ghid_remove_menu_widget(void *ctx, lht_node_t *nd)
/* Create a new menu by path */
void ghid_create_menu(const char *menu_path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie)
{
- hid_cfg_create_menu(ghid_cfg, menu_path, action, mnemonic, accel, tip, cookie, ghid_create_menu_widget, NULL);
+ pcb_hid_cfg_create_menu(ghid_cfg, menu_path, action, mnemonic, accel, tip, cookie, ghid_create_menu_widget, NULL);
}
int ghid_remove_menu(const char *menu_path)
{
- return hid_cfg_remove_menu(ghid_cfg, menu_path, ghid_remove_menu_widget, NULL);
+ return pcb_hid_cfg_remove_menu(ghid_cfg, menu_path, ghid_remove_menu_widget, NULL);
}
diff --git a/src_plugins/hid_gtk/ghid-main-menu.h b/src_plugins/hid_gtk/ghid-main-menu.h
index 24d75e9..5d91fcf 100644
--- a/src_plugins/hid_gtk/ghid-main-menu.h
+++ b/src_plugins/hid_gtk/ghid-main-menu.h
@@ -34,7 +34,7 @@ void ghid_main_menu_install_route_style_selector(GHidMainMenu * mm, GHidRouteSty
void ghid_create_menu(const char *menu_path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie);
int ghid_remove_menu(const char *menu_path);
-extern hid_cfg_t *ghid_cfg;
+extern pcb_hid_cfg_t *ghid_cfg;
G_END_DECLS /* keep c++ happy */
#endif
diff --git a/src_plugins/hid_gtk/ghid-propedit.c b/src_plugins/hid_gtk/ghid-propedit.c
index 85b5ebc..0fefa2b 100644
--- a/src_plugins/hid_gtk/ghid-propedit.c
+++ b/src_plugins/hid_gtk/ghid-propedit.c
@@ -25,10 +25,12 @@
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
+#include "config.h"
#include "gui.h"
-#include "create.h"
#include "compat_misc.h"
+#include "compat_nls.h"
#include "polygon.h"
+#include "obj_all.h"
static char *str_sub(const char *val, char sepi, char sepo)
{
@@ -268,10 +270,10 @@ static void do_apply_cb(GtkWidget *tree, ghid_propedit_dialog_t *dlg)
gtk_entry_set_text(GTK_ENTRY(dlg->entry_val), val); /* keep relative values intact for a reapply */
}
else
- Message(PCB_MSG_WARNING, "Failed to change any object - %s is possibly invalid value for %s\n", val, prop);
+ pcb_message(PCB_MSG_WARNING, "Failed to change any object - %s is possibly invalid value for %s\n", val, prop);
}
else
- Message(PCB_MSG_ERROR, "Internal error: no type for proeprty %s\n", prop);
+ pcb_message(PCB_MSG_ERROR, "Internal error: no type for proeprty %s\n", prop);
free(val);
g_free(prop);
@@ -288,71 +290,71 @@ static gboolean preview_expose_event(GtkWidget *w, GdkEventExpose *event)
return FALSE;
}
-static PCBType preview_pcb;
+static pcb_board_t preview_pcb;
static GtkWidget *preview_init(ghid_propedit_dialog_t *dlg)
{
GtkWidget *area = gtk_drawing_area_new();
- PCBType *old_pcb;
+ pcb_board_t *old_pcb;
int n, zoom1, fx, fy;
- Coord cx, cy;
+ pcb_coord_t cx, cy;
/*
void *v;
- v = CreateNewPolygonFromRectangle(PCB->Data->Layer+1,
+ v = pcb_poly_new_from_rectangle(PCB->Data->Layer+1,
PCB_MIL_TO_COORD(0), PCB_MIL_TO_COORD(0),
PCB_MIL_TO_COORD(1500), PCB_MIL_TO_COORD(1500),
- MakeFlags(PCB_FLAG_CLEARPOLY | PCB_FLAG_FULLPOLY));
+ pcb_flag_make(PCB_FLAG_CLEARPOLY | PCB_FLAG_FULLPOLY));
printf("poly2=%p -----------\n", (void *)v);
DrawPolygon(PCB->Data->Layer+1, v);
- Draw();
+ pcb_draw();
gtk_drawing_area_size(GTK_DRAWING_AREA(area), 300, 400);
return;
*/
memset(&preview_pcb, 0, sizeof(preview_pcb));
- preview_pcb.Data = CreateNewBuffer();
+ preview_pcb.Data = pcb_buffer_new();
preview_pcb.MaxWidth = preview_pcb.MaxHeight = PCB_MIL_TO_COORD(2000);
pcb_colors_from_settings(&preview_pcb);
- CreateDefaultFont(&preview_pcb);
+ pcb_font_create_default(&preview_pcb);
preview_pcb.ViaOn = 1;
- for(n = 0; n < max_copper_layer+2; n++) {
+ for(n = 0; n < pcb_max_copper_layer+2; n++) {
preview_pcb.Data->Layer[n].On = 1;
preview_pcb.Data->Layer[n].Color = pcb_strdup(PCB->Data->Layer[n].Color);
preview_pcb.Data->Layer[n].Name = pcb_strdup("preview dummy");
}
memcpy(&preview_pcb.LayerGroups, &PCB->LayerGroups, sizeof(PCB->LayerGroups));
- preview_pcb.Data->LayerN = max_copper_layer;
+ preview_pcb.Data->LayerN = pcb_max_copper_layer;
preview_pcb.Data->pcb = &preview_pcb;
#warning TODO: preview_pcb is never freed
- CreateNewVia(preview_pcb.Data,
+ pcb_via_new(preview_pcb.Data,
PCB_MIL_TO_COORD(1000), PCB_MIL_TO_COORD(1000),
- PCB_MIL_TO_COORD(50), PCB_MIL_TO_COORD(10), 0, PCB_MIL_TO_COORD(20), "", NoFlags());
+ PCB_MIL_TO_COORD(50), PCB_MIL_TO_COORD(10), 0, PCB_MIL_TO_COORD(20), "", pcb_no_flags());
- CreateNewLineOnLayer(preview_pcb.Data->Layer+0,
+ pcb_line_new(preview_pcb.Data->Layer+0,
PCB_MIL_TO_COORD(1000), PCB_MIL_TO_COORD(1000),
PCB_MIL_TO_COORD(1000), PCB_MIL_TO_COORD(1300),
- PCB_MIL_TO_COORD(20), PCB_MIL_TO_COORD(20), MakeFlags(PCB_FLAG_CLEARLINE));
+ PCB_MIL_TO_COORD(20), PCB_MIL_TO_COORD(20), pcb_flag_make(PCB_FLAG_CLEARLINE));
- CreateNewArcOnLayer(preview_pcb.Data->Layer+0,
+ pcb_arc_new(preview_pcb.Data->Layer+0,
PCB_MIL_TO_COORD(1000), PCB_MIL_TO_COORD(1000),
PCB_MIL_TO_COORD(100), PCB_MIL_TO_COORD(100),
0.0, 90.0,
- PCB_MIL_TO_COORD(20), PCB_MIL_TO_COORD(20), MakeFlags(PCB_FLAG_CLEARLINE));
+ PCB_MIL_TO_COORD(20), PCB_MIL_TO_COORD(20), pcb_flag_make(PCB_FLAG_CLEARLINE));
- CreateNewText(preview_pcb.Data->Layer+0, &PCB->Font,
- PCB_MIL_TO_COORD(850), PCB_MIL_TO_COORD(1150), 0, 100, "Text", MakeFlags(PCB_FLAG_CLEARLINE));
+ pcb_text_new(preview_pcb.Data->Layer+0, &PCB->Font,
+ PCB_MIL_TO_COORD(850), PCB_MIL_TO_COORD(1150), 0, 100, "Text", pcb_flag_make(PCB_FLAG_CLEARLINE));
{
- PolygonType *v = CreateNewPolygonFromRectangle(preview_pcb.Data->Layer,
+ pcb_polygon_t *v = pcb_poly_new_from_rectangle(preview_pcb.Data->Layer,
PCB_MIL_TO_COORD(10), PCB_MIL_TO_COORD(10),
PCB_MIL_TO_COORD(1200), PCB_MIL_TO_COORD(1200),
- MakeFlags(PCB_FLAG_CLEARPOLY));
- InitClip(preview_pcb.Data, preview_pcb.Data->Layer, v);
+ pcb_flag_make(PCB_FLAG_CLEARPOLY));
+ pcb_poly_init_clip(preview_pcb.Data, preview_pcb.Data->Layer, v);
}
old_pcb = PCB;
diff --git a/src_plugins/hid_gtk/ghid-route-style-selector.c b/src_plugins/hid_gtk/ghid-route-style-selector.c
index d01b7f0..3b9db23 100644
--- a/src_plugins/hid_gtk/ghid-route-style-selector.c
+++ b/src_plugins/hid_gtk/ghid-route-style-selector.c
@@ -9,19 +9,19 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
-#include "global.h"
+#include "config.h"
#include "conf_core.h"
#include "gtkhid.h"
#include "gui.h"
#include "pcb-printf.h"
#include "route_style.h"
-#include "set.h"
+#include "compat_nls.h"
#include "ghid-route-style-selector.h"
/* Forward dec'ls */
struct _route_style;
-struct _route_style *ghid_route_style_selector_real_add_route_style(GHidRouteStyleSelector *, RouteStyleType *, int);
+struct _route_style *ghid_route_style_selector_real_add_route_style(GHidRouteStyleSelector *, pcb_route_style_t *, int);
static void ghid_route_style_selector_finalize(GObject * object);
static void add_new_iter(GHidRouteStyleSelector * rss);
@@ -62,12 +62,13 @@ struct _GHidRouteStyleSelector {
struct _route_style *active_style;
GtkTreeIter new_iter; /* iter for the <new> item */
+
};
struct _GHidRouteStyleSelectorClass {
GtkVBoxClass parent_class;
- void (*select_style) (GHidRouteStyleSelector *, RouteStyleType *);
+ void (*select_style) (GHidRouteStyleSelector *, pcb_route_style_t *);
void (*style_edited) (GHidRouteStyleSelector *, gboolean);
};
@@ -76,7 +77,7 @@ struct _route_style {
GtkWidget *button;
GtkWidget *menu_item;
GtkTreeRowReference *rref;
- RouteStyleType *rst;
+ pcb_route_style_t *rst;
gulong sig_id;
int hidden;
};
@@ -101,9 +102,32 @@ struct _dialog {
GtkWidget *select_box;
+ GtkWidget *attr_table;
+ GtkListStore *attr_model;
+
int inhibit_style_change; /* when 1, do not do anything when style changes */
+ int attr_editing; /* set to 1 when an attribute key or value text is being edited */
};
+/* Rebuild the gtk table for attribute list from style */
+static void update_attrib(struct _dialog *dialog, struct _route_style *style)
+{
+ GtkTreeIter iter;
+ int i;
+
+ gtk_list_store_clear(dialog->attr_model);
+
+ for(i = 0; i < style->rst->attr.Number; i++) {
+ gtk_list_store_append(dialog->attr_model, &iter);
+ gtk_list_store_set(dialog->attr_model, &iter, 0, style->rst->attr.List[i].name, -1);
+ gtk_list_store_set(dialog->attr_model, &iter, 1, style->rst->attr.List[i].value, -1);
+ }
+
+ gtk_list_store_append(dialog->attr_model, &iter);
+ gtk_list_store_set(dialog->attr_model, &iter, 0, "<new>", -1);
+ gtk_list_store_set(dialog->attr_model, &iter, 1, "<new>", -1);
+}
+
/*! \brief Callback for dialog box's combobox being changed
* \par Function Description
* When a different layer is selected, this function loads
@@ -141,6 +165,22 @@ static void dialog_style_changed_cb(GtkComboBox * combo, struct _dialog *dialog)
dialog->rss->selected = -1;
else
dialog->rss->selected = style->rst - PCB->RouteStyle.array;
+
+ update_attrib(dialog, style);
+}
+
+#warning TODO: this should be in core
+static void copy_route_style(int idx)
+{
+ pcb_route_style_t *drst;
+
+ if ((idx < 0) || (idx >= vtroutestyle_len(&PCB->RouteStyle)))
+ return;
+ drst = PCB->RouteStyle.array + idx;
+ pcb_custom_route_style.Thick = drst->Thick;
+ pcb_custom_route_style.Clearance = drst->Clearance;
+ pcb_custom_route_style.Diameter = drst->Diameter;
+ pcb_custom_route_style.Hole = drst->Hole;
}
/* Callback for Delete route style button */
@@ -151,11 +191,15 @@ static void delete_button_cb(GtkButton *button, struct _dialog *dialog)
dialog->inhibit_style_change = 1;
ghid_route_style_selector_empty(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector));
+
+#warning TODO: some of these should be in core
+ copy_route_style(dialog->rss->selected);
+
vtroutestyle_remove(&PCB->RouteStyle, dialog->rss->selected, 1);
dialog->rss->active_style = NULL;
make_route_style_buttons(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector));
pcb_trace("Style: %d deleted\n", dialog->rss->selected);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
ghid_window_set_name_label(PCB->Name);
add_new_iter(dialog->rss);
dialog->inhibit_style_change = 0;
@@ -163,15 +207,141 @@ static void delete_button_cb(GtkButton *button, struct _dialog *dialog)
gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->select_box), 0);
}
+/***** attr table *****/
+
+static int get_sel(struct _dialog *dlg)
+{
+ GtkTreeIter iter;
+ GtkTreeSelection *tsel;
+ GtkTreeModel *tm;
+ GtkTreePath *path;
+ int *i;
+
+ tsel = gtk_tree_view_get_selection(GTK_TREE_VIEW(dlg->attr_table));
+ if (tsel == NULL)
+ return -1;
+
+ gtk_tree_selection_get_selected(tsel, &tm, &iter);
+ if (iter.stamp == 0)
+ return -1;
+
+ path = gtk_tree_model_get_path(tm, &iter);
+ if (path != NULL) {
+ i = gtk_tree_path_get_indices(path);
+ if (i != NULL) {
+/* gtk_tree_model_get(GTK_TREE_MODEL(dlg->attr_model), &iter, 0, nkey, 1, nval, -1);*/
+ return i[0];
+ }
+ }
+ return -1;
+}
+
+
+static void attr_edited(int col, GtkCellRendererText *cell, gchar *path, gchar *new_text, struct _dialog *dlg)
+{
+ GtkTreeIter iter;
+ struct _route_style *style;
+ int idx = get_sel(dlg);
+
+ dlg->attr_editing = 0;
+
+ gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dlg->select_box), &iter);
+ gtk_tree_model_get(GTK_TREE_MODEL(dlg->rss->model), &iter, DATA_COL, &style, -1);
+
+ if (style == NULL)
+ return;
+
+ if (idx >= style->rst->attr.Number) { /* add new */
+ if (col == 0)
+ pcb_attribute_put(&style->rst->attr, new_text, "n/a", 0);
+ else
+ pcb_attribute_put(&style->rst->attr, "n/a", new_text, 0);
+ }
+ else { /* overwrite existing */
+ char **dest;
+ if (col == 0)
+ dest = &style->rst->attr.List[idx].name;
+ else
+ dest = &style->rst->attr.List[idx].value;
+ if (*dest != NULL)
+ free(*dest);
+ *dest = pcb_strdup(new_text);
+ }
+
+ /* rebuild the table to keep it in sync - expensive, but it happens rarely */
+ update_attrib(dlg, style);
+}
+
+static void attr_edited_key_cb(GtkCellRendererText *cell, gchar *path, gchar *new_text, struct _dialog *dlg)
+{
+ attr_edited(0, cell, path, new_text, dlg);
+}
+
+static void attr_edited_val_cb(GtkCellRendererText *cell, gchar *path, gchar *new_text, struct _dialog *dlg)
+{
+ attr_edited(1, cell, path, new_text, dlg);
+}
+
+
+static void attr_edit_started_cb(GtkCellRendererText *cell, GtkCellEditable *e,gchar *path, struct _dialog *dlg)
+{
+ dlg->attr_editing = 1;
+}
+
+static void attr_edit_canceled_cb(GtkCellRendererText *cell, struct _dialog *dlg)
+{
+ dlg->attr_editing = 0;
+}
+
+static gboolean attr_key_release_cb(GtkWidget *widget, GdkEventKey *event, struct _dialog *dlg)
+{
+ unsigned short int kv = event->keyval;
+
+ if (dlg->attr_editing)
+ return FALSE;
+
+ switch(kv) {
+#ifdef GDK_KEY_KP_Delete
+ case GDK_KEY_KP_Delete:
+#endif
+#ifdef GDK_KEY_Delete
+ case GDK_KEY_Delete:
+#endif
+ case 'd':
+ {
+ int idx = get_sel(dlg);
+ GtkTreeIter iter;
+ struct _route_style *style;
+ gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dlg->select_box), &iter);
+ gtk_tree_model_get(GTK_TREE_MODEL(dlg->rss->model), &iter, DATA_COL, &style, -1);
+ if (style == NULL)
+ return FALSE;
+ if ((idx >= 0) && (idx < style->rst->attr.Number)) {
+ pcb_attribute_remove_idx(&style->rst->attr, idx);
+ update_attrib(dlg, style);
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+/**** dialog creation ****/
+
/* \brief Helper for edit_button_cb */
-static void _table_attach(GtkWidget * table, gint row, const gchar * label, GtkWidget ** entry, Coord min, Coord max)
+static void _table_attach_(GtkWidget * table, gint row, const gchar *label, GtkWidget *entry)
{
GtkWidget *label_w = gtk_label_new(label);
gtk_misc_set_alignment(GTK_MISC(label_w), 1.0, 0.5);
+ gtk_table_attach(GTK_TABLE(table), label_w, 0, 1, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
+ gtk_table_attach(GTK_TABLE(table), entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
+}
+/* \brief Helper for edit_button_cb */
+static void _table_attach(GtkWidget * table, gint row, const gchar * label, GtkWidget ** entry, pcb_coord_t min, pcb_coord_t max)
+{
*entry = ghid_coord_entry_new(min, max, 0, conf_core.editor.grid_unit, CE_SMALL);
- gtk_table_attach(GTK_TABLE(table), label_w, 0, 1, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
- gtk_table_attach(GTK_TABLE(table), *entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
+ _table_attach_(table, row, label, *entry);
}
static void add_new_iter(GHidRouteStyleSelector * rss)
@@ -232,23 +402,59 @@ void ghid_route_style_selector_edit_dialog(GHidRouteStyleSelector * rss)
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
gtk_table_attach(GTK_TABLE(table), dialog_data.name_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
- _table_attach(table, 1, _("Line width:"), &dialog_data.line_entry, MIN_LINESIZE, MAX_LINESIZE);
+ _table_attach(table, 1, _("Line width:"), &dialog_data.line_entry, PCB_MIN_LINESIZE, PCB_MAX_LINESIZE);
_table_attach(table, 2, _("Via hole size:"),
- &dialog_data.via_hole_entry, MIN_PINORVIAHOLE, MAX_PINORVIASIZE - MIN_PINORVIACOPPER);
+ &dialog_data.via_hole_entry, PCB_MIN_PINORVIAHOLE, PCB_MAX_PINORVIASIZE - PCB_MIN_PINORVIACOPPER);
_table_attach(table, 3, _("Via ring size:"),
- &dialog_data.via_size_entry, MIN_PINORVIAHOLE + MIN_PINORVIACOPPER, MAX_PINORVIASIZE);
- _table_attach(table, 4, _("Clearance:"), &dialog_data.clearance_entry, MIN_LINESIZE, MAX_LINESIZE);
+ &dialog_data.via_size_entry, PCB_MIN_PINORVIAHOLE + PCB_MIN_PINORVIACOPPER, PCB_MAX_PINORVIASIZE);
+ _table_attach(table, 4, _("Clearance:"), &dialog_data.clearance_entry, PCB_MIN_LINESIZE, PCB_MAX_LINESIZE);
+
+ _table_attach_(table, 5, "", gtk_label_new(""));
+
+ /* create attrib table */
+ {
+ GType *ty;
+ GtkCellRenderer *renderer;
+
+ dialog_data.attr_table = gtk_tree_view_new();
+
+ ty = malloc(sizeof(GType) * 2);
+ ty[0] = G_TYPE_STRING;
+ ty[1] = G_TYPE_STRING;
+ dialog_data.attr_model = gtk_list_store_newv(2, ty);
+ free(ty);
+
+ renderer = gtk_cell_renderer_text_new();
+ g_object_set(renderer, "editable", TRUE, NULL);
+ g_signal_connect(renderer, "edited", G_CALLBACK(attr_edited_key_cb), &dialog_data);
+ g_signal_connect(renderer, "editing-started", G_CALLBACK(attr_edit_started_cb), &dialog_data);
+ g_signal_connect(renderer, "editing-canceled", G_CALLBACK(attr_edit_canceled_cb), &dialog_data);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(dialog_data.attr_table), -1, "key", renderer, "text", 0, NULL);
+
+
+ renderer = gtk_cell_renderer_text_new();
+ g_object_set(renderer, "editable", TRUE, NULL);
+ g_signal_connect(renderer, "edited", G_CALLBACK(attr_edited_val_cb), &dialog_data);
+ g_signal_connect(renderer, "editing-started", G_CALLBACK(attr_edit_started_cb), &dialog_data);
+ g_signal_connect(renderer, "editing-canceled", G_CALLBACK(attr_edit_canceled_cb), &dialog_data);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(dialog_data.attr_table), -1, "value", renderer, "text", 1, NULL);
+
+ gtk_tree_view_set_model(GTK_TREE_VIEW(dialog_data.attr_table), GTK_TREE_MODEL(dialog_data.attr_model));
+ g_signal_connect(G_OBJECT(dialog_data.attr_table), "key-release-event", G_CALLBACK(attr_key_release_cb), &dialog_data);
+
+ }
+ _table_attach_(table, 6, _("Attributes:"), dialog_data.attr_table);
+
/* create delete button */
button = gtk_button_new_with_label (_("Delete Style"));
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(delete_button_cb), &dialog_data);
- gtk_box_pack_start(GTK_BOX(vbox), button , TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), button , TRUE, FALSE, 0);
sub_vbox = ghid_category_vbox(vbox, _("Set as Default"), 4, 2, TRUE, TRUE);
check_box = gtk_check_button_new_with_label(_("Save route style settings as default"));
gtk_box_pack_start(GTK_BOX(sub_vbox), check_box, TRUE, TRUE, 0);
-
add_new_iter(rss);
/* Display dialog */
@@ -263,7 +469,7 @@ void ghid_route_style_selector_edit_dialog(GHidRouteStyleSelector * rss)
gtk_widget_show_all(dialog);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) {
int changed = 0;
- RouteStyleType *rst;
+ pcb_route_style_t *rst;
struct _route_style *style;
gboolean save;
if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(select_box), &iter))
@@ -290,7 +496,7 @@ void ghid_route_style_selector_edit_dialog(GHidRouteStyleSelector * rss)
/* Modify the route style only if there's significant difference (beyond rouding errors) */
#define rst_modify(changed, dst, src) \
do { \
- Coord __tmp__ = src; \
+ pcb_coord_t __tmp__ = src; \
if (abs(dst - __tmp__) > 10) { \
changed = 1; \
dst = __tmp__; \
@@ -317,7 +523,7 @@ void ghid_route_style_selector_edit_dialog(GHidRouteStyleSelector * rss)
g_signal_emit(rss, ghid_route_style_selector_signals[STYLE_EDITED_SIGNAL], 0, save);
if (changed) {
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
ghid_window_set_name_label(PCB->Name);
}
}
@@ -430,14 +636,14 @@ GtkWidget *ghid_route_style_selector_new()
* \param [in] data PCB's route style object that will be edited
*/
struct _route_style *ghid_route_style_selector_real_add_route_style(GHidRouteStyleSelector * rss,
- RouteStyleType * data, int hide)
+ pcb_route_style_t * data, int hide)
{
GtkTreeIter iter;
GtkTreePath *path;
gchar *action_name = g_strdup_printf("RouteStyle%d", action_count);
struct _route_style *new_style = g_malloc(sizeof(*new_style));
- /* Key the route style data with the RouteStyleType it controls */
+ /* Key the route style data with the pcb_route_style_t it controls */
new_style->hidden = hide;
new_style->rst = data;
new_style->action = gtk_radio_action_new(action_name, data->name, NULL, NULL, action_count);
@@ -484,11 +690,14 @@ struct _route_style *ghid_route_style_selector_real_add_route_style(GHidRouteSty
* \param [in] rss The selector to be acted on
* \param [in] data PCB's route style object describing the style
*/
-void ghid_route_style_selector_add_route_style(GHidRouteStyleSelector * rss, RouteStyleType * data)
+void ghid_route_style_selector_add_route_style(GHidRouteStyleSelector * rss, pcb_route_style_t * data)
{
if (!rss->hidden_button) {
- memset(&pcb_custom_route_style, 0, sizeof(pcb_custom_route_style));
- strcpy(pcb_custom_route_style.name, "<custom>");
+ if (*pcb_custom_route_style.name == '\0') {
+ memset(&pcb_custom_route_style, 0, sizeof(pcb_custom_route_style));
+ strcpy(pcb_custom_route_style.name, "<custom>");
+ copy_route_style(0);
+ }
ghid_route_style_selector_real_add_route_style(rss, &pcb_custom_route_style, 1);
rss->hidden_button = 1;
}
@@ -541,7 +750,7 @@ gint ghid_route_style_selector_install_items(GHidRouteStyleSelector * rss, GtkMe
*
* \return TRUE if a style was selected, FALSE otherwise
*/
-gboolean ghid_route_style_selector_select_style(GHidRouteStyleSelector * rss, RouteStyleType * rst)
+gboolean ghid_route_style_selector_select_style(GHidRouteStyleSelector * rss, pcb_route_style_t * rst)
{
GtkTreeIter iter;
gtk_tree_model_get_iter_first(GTK_TREE_MODEL(rss->model), &iter);
@@ -583,12 +792,12 @@ GtkAccelGroup *ghid_route_style_selector_get_accel_group(GHidRouteStyleSelector
* will happen. This function does not emit any signals.
*
* \param [in] rss The selector to be acted on
- * \param [in] Thick Coord to match selection to
- * \param [in] Hole Coord to match selection to
- * \param [in] Diameter Coord to match selection to
- * \param [in] Clearance Coord to match selection to
+ * \param [in] Thick pcb_coord_t to match selection to
+ * \param [in] Hole pcb_coord_t to match selection to
+ * \param [in] Diameter pcb_coord_t to match selection to
+ * \param [in] Clearance pcb_coord_t to match selection to
*/
-void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, Coord Thick, Coord Hole, Coord Diameter, Coord Clearance)
+void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, pcb_coord_t Thick, pcb_coord_t Hole, pcb_coord_t Diameter, pcb_coord_t Clearance)
{
GtkTreeIter iter;
int target, n;
diff --git a/src_plugins/hid_gtk/ghid-route-style-selector.h b/src_plugins/hid_gtk/ghid-route-style-selector.h
index 33e21bc..970ada4 100644
--- a/src_plugins/hid_gtk/ghid-route-style-selector.h
+++ b/src_plugins/hid_gtk/ghid-route-style-selector.h
@@ -5,7 +5,8 @@
#include <glib-object.h>
#include <gtk/gtk.h>
-#include "global.h"
+#include "config.h"
+#include "route_style.h"
G_BEGIN_DECLS /* keep c++ happy */
#define GHID_ROUTE_STYLE_SELECTOR_TYPE (ghid_route_style_selector_get_type ())
@@ -21,13 +22,13 @@ GtkWidget *ghid_route_style_selector_new(void);
gint ghid_route_style_selector_install_items(GHidRouteStyleSelector * rss, GtkMenuShell * shell, gint pos);
-void ghid_route_style_selector_add_route_style(GHidRouteStyleSelector * rss, RouteStyleType * data);
-gboolean ghid_route_style_selector_select_style(GHidRouteStyleSelector * rss, RouteStyleType * rst);
+void ghid_route_style_selector_add_route_style(GHidRouteStyleSelector * rss, pcb_route_style_t * data);
+gboolean ghid_route_style_selector_select_style(GHidRouteStyleSelector * rss, pcb_route_style_t * rst);
void ghid_route_style_selector_edit_dialog(GHidRouteStyleSelector * rss);
GtkAccelGroup *ghid_route_style_selector_get_accel_group(GHidRouteStyleSelector * rss);
-void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, Coord Thick, Coord Hole, Coord Diameter, Coord Clearance);
+void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, pcb_coord_t Thick, pcb_coord_t Hole, pcb_coord_t Diameter, pcb_coord_t Clearance);
void ghid_route_style_selector_empty(GHidRouteStyleSelector * rss);
G_END_DECLS /* keep c++ happy */
diff --git a/src_plugins/hid_gtk/ghid-search.c b/src_plugins/hid_gtk/ghid-search.c
index cca5a7b..7d7b871 100644
--- a/src_plugins/hid_gtk/ghid-search.c
+++ b/src_plugins/hid_gtk/ghid-search.c
@@ -27,12 +27,13 @@
#include <string.h>
#include <gtk/gtk.h>
#include <genlist/gendlist.h>
+#include "config.h"
#include "gui.h"
-#include "create.h"
#include "compat_misc.h"
#include "ghid-search.h"
#include "win_place.h"
#include "hid_actions.h"
+#include "compat_nls.h"
#include "misc_util.h"
typedef struct expr1_s expr1_t;
@@ -270,8 +271,8 @@ static void rebuild(void)
if (!or_first)
gds_append_str(&s, " || ");
or_first = 0;
+ gds_append_str(&s, o->code);
}
- gds_append_str(&s, o->code);
}
if (ors > 1)
@@ -641,7 +642,7 @@ void expr_wizard_import(const char *desc_)
case RIGHT_COORD:
{
pcb_bool succ;
- double d = GetValueEx(right, NULL, NULL, NULL, "mm", &succ);
+ double d = pcb_get_value_ex(right, NULL, NULL, NULL, "mm", &succ);
if (succ)
ghid_coord_entry_set_value(GHID_COORD_ENTRY(expr_wizard_dlg.right_coord), d);
break;
@@ -758,7 +759,7 @@ static void dialog_cb(GtkDialog *dlg, gint response_id, gpointer *data)
case GTK_RESPONSE_APPLY:
script = gtk_entry_get_text(GTK_ENTRY(sdlg.expr));
act = gtk_combo_box_get_active_text(GTK_COMBO_BOX(sdlg.action));
- hid_actionl("query", act, script, NULL);
+ pcb_hid_actionl("query", act, script, NULL);
break;
case GTK_RESPONSE_CLOSE:
gtk_widget_destroy(GTK_WIDGET(dlg));
@@ -774,10 +775,10 @@ static void ghid_search_window_create()
const char **s;
int ver;
- ver = hid_actionl("query", "version", NULL);
+ ver = pcb_hid_actionl("query", "version", NULL);
if (ver < 0100) {
sdlg.window = NULL;
- Message(PCB_MSG_ERROR, "The query plugin is not avaialble, can not do advanced search.\n");
+ pcb_message(PCB_MSG_ERROR, "The query plugin is not avaialble, can not do advanced search.\n");
return;
}
diff --git a/src_plugins/hid_gtk/gschem_accel_label.c b/src_plugins/hid_gtk/gschem_accel_label.c
index aa31b43..e838869 100644
--- a/src_plugins/hid_gtk/gschem_accel_label.c
+++ b/src_plugins/hid_gtk/gschem_accel_label.c
@@ -50,7 +50,9 @@ Modifications:
#include <glib.h>
#include <gtk/gtk.h>
+#include "config.h"
#include "gschem_accel_label.h"
+#include "compat_nls.h"
#define P_(x) (x)
diff --git a/src_plugins/hid_gtk/gtk_conf_list.c b/src_plugins/hid_gtk/gtk_conf_list.c
index 613679d..1d055f2 100644
--- a/src_plugins/hid_gtk/gtk_conf_list.c
+++ b/src_plugins/hid_gtk/gtk_conf_list.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
+#include "config.h"
#include "gtk_conf_list.h"
#include "compat_misc.h"
@@ -192,7 +193,7 @@ static void cell_edit_canceled_cb(GtkCellRendererText *cell, gtk_conf_list_t *cl
}
/* bind a few intuitive keys so that the list can be used without mouse */
-gboolean key_release_cb(GtkWidget *widget, GdkEventKey *event, gtk_conf_list_t *cl)
+static gboolean key_release_cb(GtkWidget *widget, GdkEventKey *event, gtk_conf_list_t *cl)
{
unsigned short int kv = event->keyval;
if (cl->editing)
diff --git a/src_plugins/hid_gtk/gtkhid-gdk.c b/src_plugins/hid_gtk/gtkhid-gdk.c
index d9a2987..4989b30 100644
--- a/src_plugins/hid_gtk/gtkhid-gdk.c
+++ b/src_plugins/hid_gtk/gtkhid-gdk.c
@@ -1,4 +1,3 @@
-#include "global.h"
#include "config.h"
#include "conf_core.h"
@@ -13,7 +12,7 @@
#include "hid_helper.h"
#include "hid_color.h"
-extern HID ghid_hid;
+extern pcb_hid_t ghid_hid;
/* Sets priv->u_gc to the "right" GC to use (wrt mask or window)
*/
@@ -37,68 +36,71 @@ typedef struct render_priv {
guint lead_user_timeout;
GTimer *lead_user_timer;
pcb_bool lead_user;
- Coord lead_user_radius;
- Coord lead_user_x;
- Coord lead_user_y;
+ pcb_coord_t lead_user_radius;
+ pcb_coord_t lead_user_x;
+ pcb_coord_t lead_user_y;
} render_priv;
-typedef struct hid_gc_struct {
- HID *me_pointer;
+typedef struct hid_gc_s {
+ pcb_hid_t *me_pointer;
GdkGC *gc;
gchar *colorname;
- Coord width;
+ pcb_coord_t width;
gint cap, join;
gchar xor_mask;
gint mask_seq;
-} hid_gc_struct;
+} hid_gc_s;
static void draw_lead_user(render_priv * priv);
-int ghid_set_layer(const char *name, int group, int empty)
+int ghid_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
int idx = group;
- if (idx >= 0 && idx < max_group) {
+ if (idx >= 0 && idx < pcb_max_group) {
int n = PCB->LayerGroups.Number[group];
for (idx = 0; idx < n - 1; idx++) {
int ni = PCB->LayerGroups.Entries[group][idx];
- if (ni >= 0 && ni < max_copper_layer + 2 && PCB->Data->Layer[ni].On)
+ if (ni >= 0 && ni < pcb_max_copper_layer + 2 && PCB->Data->Layer[ni].On)
break;
}
idx = PCB->LayerGroups.Entries[group][idx];
}
- if (idx >= 0 && idx < max_copper_layer + 2)
+ if (idx >= 0 && idx < pcb_max_copper_layer && ((flags & PCB_LYT_ANYTHING) != PCB_LYT_SILK))
return /*pinout ? 1 : */ PCB->Data->Layer[idx].On;
- if (idx < 0) {
- switch (SL_TYPE(idx)) {
- case SL_INVISIBLE:
+
+ {
+ switch (flags & PCB_LYT_ANYTHING) {
+ case PCB_LYT_INVIS:
return /* pinout ? 0 : */ PCB->InvisibleObjectsOn;
- case SL_MASK:
- if (SL_MYSIDE(idx) /*&& !pinout */ )
+ case PCB_LYT_MASK:
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags) /*&& !pinout */ )
return conf_core.editor.show_mask;
return 0;
- case SL_SILK:
- if (SL_MYSIDE(idx) /*|| pinout */ )
+ case PCB_LYT_SILK:
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags) /*|| pinout */ )
return PCB->ElementOn;
return 0;
- case SL_ASSY:
+ case PCB_LYT_ASSY:
return 0;
- case SL_PDRILL:
- case SL_UDRILL:
+ case PCB_LYT_PDRILL:
+ case PCB_LYT_UDRILL:
+ return 1;
+ case PCB_LYT_UI:
return 1;
- case SL_RATS:
+ case PCB_LYT_RAT:
return PCB->RatOn;
}
}
return 0;
}
-void ghid_destroy_gc(hidGC gc)
+void ghid_destroy_gc(pcb_hid_gc_t gc)
{
if (gc->gc)
g_object_unref(gc->gc);
@@ -107,11 +109,11 @@ void ghid_destroy_gc(hidGC gc)
g_free(gc);
}
-hidGC ghid_make_gc(void)
+pcb_hid_gc_t ghid_make_gc(void)
{
- hidGC rv;
+ pcb_hid_gc_t rv;
- rv = g_new0(hid_gc_struct, 1);
+ rv = g_new0(hid_gc_s, 1);
rv->me_pointer = &ghid_hid;
rv->colorname = g_strdup(conf_core.appearance.color.background);
return rv;
@@ -131,15 +133,15 @@ static void set_clip(render_priv * priv, GdkGC * gc)
static inline void ghid_draw_grid_global(void)
{
render_priv *priv = gport->render_priv;
- Coord x, y, x1, y1, x2, y2, grd;
+ pcb_coord_t x, y, x1, y1, x2, y2, grd;
int n, i;
static GdkPoint *points = NULL;
static int npoints = 0;
- x1 = GridFit(MAX(0, SIDE_X(gport->view.x0)), PCB->Grid, PCB->GridOffsetX);
- y1 = GridFit(MAX(0, SIDE_Y(gport->view.y0)), PCB->Grid, PCB->GridOffsetY);
- x2 = GridFit(MIN(PCB->MaxWidth, SIDE_X(gport->view.x0 + gport->view.width - 1)), PCB->Grid, PCB->GridOffsetX);
- y2 = GridFit(MIN(PCB->MaxHeight, SIDE_Y(gport->view.y0 + gport->view.height - 1)), PCB->Grid, PCB->GridOffsetY);
+ x1 = pcb_grid_fit(MAX(0, SIDE_X(gport->view.x0)), PCB->Grid, PCB->GridOffsetX);
+ y1 = pcb_grid_fit(MAX(0, SIDE_Y(gport->view.y0)), PCB->Grid, PCB->GridOffsetY);
+ x2 = pcb_grid_fit(MIN(PCB->MaxWidth, SIDE_X(gport->view.x0 + gport->view.width - 1)), PCB->Grid, PCB->GridOffsetX);
+ y2 = pcb_grid_fit(MIN(PCB->MaxHeight, SIDE_Y(gport->view.y0 + gport->view.height - 1)), PCB->Grid, PCB->GridOffsetY);
grd = PCB->Grid;
@@ -150,12 +152,12 @@ static inline void ghid_draw_grid_global(void)
}
if (x1 > x2) {
- Coord tmp = x1;
+ pcb_coord_t tmp = x1;
x1 = x2;
x2 = tmp;
}
if (y1 > y2) {
- Coord tmp = y1;
+ pcb_coord_t tmp = y1;
y1 = y2;
y2 = tmp;
}
@@ -188,15 +190,15 @@ static inline void ghid_draw_grid_global(void)
}
}
-static void ghid_draw_grid_local_(Coord cx, Coord cy, int radius)
+static void ghid_draw_grid_local_(pcb_coord_t cx, pcb_coord_t cy, int radius)
{
render_priv *priv = gport->render_priv;
static GdkPoint *points_base = NULL;
static GdkPoint *points_abs = NULL;
static int apoints = 0, npoints = 0, old_radius = 0;
- static Coord last_grid = 0;
+ static pcb_coord_t last_grid = 0;
int recalc = 0, n, r2;
- Coord x, y;
+ pcb_coord_t x, y;
/* PI is approximated with 3.25 here - allows a minimal overallocation, speeds up calculations */
r2 = radius * radius;
@@ -244,9 +246,9 @@ static void ghid_draw_grid_local_(Coord cx, Coord cy, int radius)
static int grid_local_have_old = 0, grid_local_old_r = 0;
-static Coord grid_local_old_x, grid_local_old_y;
+static pcb_coord_t grid_local_old_x, grid_local_old_y;
-void ghid_draw_grid_local(Coord cx, Coord cy)
+void ghid_draw_grid_local(pcb_coord_t cx, pcb_coord_t cy)
{
if (grid_local_have_old) {
ghid_draw_grid_local_(grid_local_old_x, grid_local_old_y, grid_local_old_r);
@@ -256,7 +258,7 @@ void ghid_draw_grid_local(Coord cx, Coord cy)
if (!conf_hid_gtk.plugins.hid_gtk.local_grid.enable)
return;
- if ((Vz(PCB->Grid) < MIN_GRID_DISTANCE) || (!conf_core.editor.draw_grid))
+ if ((Vz(PCB->Grid) < PCB_MIN_GRID_DISTANCE) || (!conf_core.editor.draw_grid))
return;
/* cx and cy are the actual cursor snapped to wherever - round them to the nearest real grid point */
@@ -456,10 +458,10 @@ void ghid_set_special_colors(conf_native_t *cfg)
}
}
-void ghid_set_color(hidGC gc, const char *name)
+void ghid_set_color(pcb_hid_gc_t gc, const char *name)
{
static void *cache = 0;
- hidval cval;
+ pcb_hidval_t cval;
if (name == NULL) {
fprintf(stderr, "ghid_set_color(): name = NULL, setting to magenta\n");
@@ -485,13 +487,13 @@ void ghid_set_color(hidGC gc, const char *name)
}
else {
ColorCache *cc;
- if (hid_cache_color(0, name, &cval, &cache))
+ if (pcb_hid_cache_color(0, name, &cval, &cache))
cc = (ColorCache *) cval.ptr;
else {
cc = (ColorCache *) malloc(sizeof(ColorCache));
memset(cc, 0, sizeof(*cc));
cval.ptr = cc;
- hid_cache_color(1, name, &cval, &cache);
+ pcb_hid_cache_color(1, name, &cval, &cache);
}
if (!cc->color_set) {
@@ -517,7 +519,7 @@ void ghid_set_color(hidGC gc, const char *name)
}
}
-void ghid_set_line_cap(hidGC gc, EndCapStyle style)
+void ghid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
render_priv *priv = gport->render_priv;
@@ -537,7 +539,7 @@ void ghid_set_line_cap(hidGC gc, EndCapStyle style)
gdk_gc_set_line_attributes(WHICH_GC(gc), Vz(gc->width), GDK_LINE_SOLID, (GdkCapStyle) gc->cap, (GdkJoinStyle) gc->join);
}
-void ghid_set_line_width(hidGC gc, Coord width)
+void ghid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
render_priv *priv = gport->render_priv;
@@ -546,7 +548,7 @@ void ghid_set_line_width(hidGC gc, Coord width)
gdk_gc_set_line_attributes(WHICH_GC(gc), Vz(gc->width), GDK_LINE_SOLID, (GdkCapStyle) gc->cap, (GdkJoinStyle) gc->join);
}
-void ghid_set_draw_xor(hidGC gc, int xor_mask)
+void ghid_set_draw_xor(pcb_hid_gc_t gc, int xor_mask)
{
gc->xor_mask = xor_mask;
if (!gc->gc)
@@ -555,7 +557,7 @@ void ghid_set_draw_xor(hidGC gc, int xor_mask)
ghid_set_color(gc, gc->colorname);
}
-static int use_gc(hidGC gc)
+static int use_gc(pcb_hid_gc_t gc)
{
render_priv *priv = gport->render_priv;
GdkWindow *window = gtk_widget_get_window(gport->top_window);
@@ -571,7 +573,7 @@ static int use_gc(hidGC gc)
gc->gc = gdk_gc_new(window);
ghid_set_color(gc, gc->colorname);
ghid_set_line_width(gc, gc->width);
- ghid_set_line_cap(gc, (EndCapStyle) gc->cap);
+ ghid_set_line_cap(gc, (pcb_cap_style_t) gc->cap);
ghid_set_draw_xor(gc, gc->xor_mask);
gdk_gc_set_clip_origin(gc->gc, 0, 0);
}
@@ -586,7 +588,7 @@ static int use_gc(hidGC gc)
return 1;
}
-void ghid_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
double dx1, dy1, dx2, dy2;
render_priv *priv = gport->render_priv;
@@ -596,14 +598,14 @@ void ghid_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
dx2 = Vx((double) x2);
dy2 = Vy((double) y2);
- if (!ClipLine(0, 0, gport->width, gport->height, &dx1, &dy1, &dx2, &dy2, gc->width / gport->view.coord_per_px))
+ if (!pcb_line_clip(0, 0, gport->width, gport->height, &dx1, &dy1, &dx2, &dy2, gc->width / gport->view.coord_per_px))
return;
USE_GC(gc);
gdk_draw_line(gport->drawable, priv->u_gc, dx1, dy1, dx2, dy2);
}
-void ghid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle)
+void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
gint vrx, vry;
gint w, h, radius;
@@ -630,7 +632,7 @@ void ghid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, A
delta_angle = -delta_angle;
}
/* make sure we fall in the -180 to +180 range */
- start_angle = NormalizeAngle(start_angle);
+ start_angle = pcb_normalize_angle(start_angle);
if (start_angle >= 180)
start_angle -= 360;
@@ -638,7 +640,7 @@ void ghid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, A
Vx(cx) - vrx, Vy(cy) - vry, vrx * 2, vry * 2, (start_angle + 180) * 64, delta_angle * 64);
}
-void ghid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
gint w, h, lw;
render_priv *priv = gport->render_priv;
@@ -674,7 +676,7 @@ void ghid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
-void ghid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+void ghid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
gint w, h, vr;
render_priv *priv = gport->render_priv;
@@ -691,7 +693,7 @@ void ghid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
gdk_draw_arc(gport->drawable, priv->u_gc, TRUE, Vx(cx) - vr, Vy(cy) - vr, vr * 2, vr * 2, 0, 360 * 64);
}
-void ghid_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
static GdkPoint *points = 0;
static int npoints = 0;
@@ -710,7 +712,7 @@ void ghid_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
gdk_draw_polygon(gport->drawable, priv->u_gc, 1, points, n_coords);
}
-void ghid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
gint w, h, lw, xx, yy;
render_priv *priv = gport->render_priv;
@@ -746,7 +748,7 @@ void ghid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void redraw_region(GdkRectangle * rect)
{
int eleft, eright, etop, ebottom;
- BoxType region;
+ pcb_box_t region;
render_priv *priv = gport->render_priv;
if (!gport->pixmap)
@@ -815,16 +817,16 @@ static void redraw_region(GdkRectangle * rect)
ghid_draw_bg_image();
- hid_expose_callback(&ghid_hid, ®ion, 0);
+ pcb_hid_expose_callback(&ghid_hid, ®ion, 0);
ghid_draw_grid();
/* In some cases we are called with the crosshair still off */
if (priv->attached_invalidate_depth == 0)
- DrawAttached();
+ pcb_draw_attached();
/* In some cases we are called with the mark still off */
if (priv->mark_invalidate_depth == 0)
- DrawMark();
+ pcb_draw_mark();
draw_lead_user(priv);
@@ -834,7 +836,7 @@ static void redraw_region(GdkRectangle * rect)
gdk_gc_set_clip_mask(priv->bg_gc, NULL);
}
-void ghid_invalidate_lr(int left, int right, int top, int bottom)
+void ghid_invalidate_lr(pcb_coord_t left, pcb_coord_t right, pcb_coord_t top, pcb_coord_t bottom)
{
int dleft, dright, dtop, dbottom;
int minx, maxx, miny, maxy;
@@ -889,7 +891,7 @@ void ghid_notify_crosshair_change(pcb_bool changes_complete)
}
if (priv->attached_invalidate_depth == 0)
- DrawAttached();
+ pcb_draw_attached();
if (!changes_complete) {
priv->attached_invalidate_depth++;
@@ -923,7 +925,7 @@ void ghid_notify_mark_change(pcb_bool changes_complete)
}
if (priv->mark_invalidate_depth == 0)
- DrawMark();
+ pcb_draw_mark();
if (!changes_complete) {
priv->mark_invalidate_depth++;
@@ -1017,14 +1019,14 @@ static void draw_dozen_cross(GdkGC * xor_gc, gint x, gint y)
static void draw_crosshair(GdkGC * xor_gc, gint x, gint y)
{
- static enum crosshair_shape prev = Basic_Crosshair_Shape;
+ static enum pcb_crosshair_shape_e prev = pcb_ch_shape_basic;
draw_right_cross(xor_gc, x, y);
- if (prev == Union_Jack_Crosshair_Shape)
+ if (prev == pcb_ch_shape_union_jack)
draw_slanted_cross(xor_gc, x, y);
- if (prev == Dozen_Crosshair_Shape)
+ if (prev == pcb_ch_shape_dozen)
draw_dozen_cross(xor_gc, x, y);
- prev = Crosshair.shape;
+ prev = pcb_crosshair.shape;
}
static void show_crosshair(gboolean paint_new_location)
@@ -1170,7 +1172,7 @@ gboolean ghid_pinout_preview_expose(GtkWidget * widget, GdkEventExpose * ev)
gdk_draw_rectangle(window, priv->bg_gc, TRUE, 0, 0, allocation.width, allocation.height);
/* call the drawing routine */
- hid_expose_callback(&ghid_hid, NULL, &pinout->element);
+ pcb_hid_expose_callback(&ghid_hid, NULL, &pinout->element);
gport->drawable = save_drawable;
gport->view = save_view;
@@ -1186,7 +1188,7 @@ GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height
GdkDrawable *save_drawable;
view_data save_view;
int save_width, save_height;
- BoxType region;
+ pcb_box_t region;
render_priv *priv = gport->render_priv;
save_drawable = gport->drawable;
@@ -1224,7 +1226,7 @@ GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height
region.Y1 = MAX(0, MIN(PCB->MaxHeight, region.Y1));
region.Y2 = MAX(0, MIN(PCB->MaxHeight, region.Y2));
- hid_expose_callback(&ghid_hid, ®ion, NULL);
+ pcb_hid_expose_callback(&ghid_hid, ®ion, NULL);
gport->drawable = save_drawable;
gport->view = save_view;
@@ -1234,7 +1236,7 @@ GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height
return pixmap;
}
-HID *ghid_request_debug_draw(void)
+pcb_hid_t *ghid_request_debug_draw(void)
{
/* No special setup requirements, drawing goes into
* the backing pixmap. */
@@ -1254,7 +1256,7 @@ void ghid_finish_debug_draw(void)
*/
}
-pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * pcb_y)
+pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, pcb_coord_t * pcb_x, pcb_coord_t * pcb_y)
{
*pcb_x = EVENT_TO_PCB_X(event_x);
*pcb_y = EVENT_TO_PCB_Y(event_y);
@@ -1262,7 +1264,7 @@ pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord
return pcb_true;
}
-pcb_bool ghid_pcb_to_event_coords(Coord pcb_x, Coord pcb_y, int *event_x, int *event_y)
+pcb_bool ghid_pcb_to_event_coords(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int *event_x, int *event_y)
{
*event_x = DRAW_X(pcb_x);
*event_y = DRAW_Y(pcb_y);
@@ -1286,9 +1288,9 @@ static void draw_lead_user(render_priv * priv)
GdkWindow *window = gtk_widget_get_window(gport->drawing_area);
GtkStyle *style = gtk_widget_get_style(gport->drawing_area);
int i;
- Coord radius = priv->lead_user_radius;
- Coord width = PCB_MM_TO_COORD(LEAD_USER_WIDTH);
- Coord separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION);
+ pcb_coord_t radius = priv->lead_user_radius;
+ pcb_coord_t width = PCB_MM_TO_COORD(LEAD_USER_WIDTH);
+ pcb_coord_t separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION);
static GdkGC *lead_gc = NULL;
GdkColor lead_color;
@@ -1326,7 +1328,7 @@ static void draw_lead_user(render_priv * priv)
gboolean lead_user_cb(gpointer data)
{
render_priv *priv = data;
- Coord step;
+ pcb_coord_t step;
double elapsed_time;
/* Queue a redraw */
@@ -1345,7 +1347,7 @@ gboolean lead_user_cb(gpointer data)
return TRUE;
}
-void ghid_lead_user_to_location(Coord x, Coord y)
+void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y)
{
render_priv *priv = gport->render_priv;
diff --git a/src_plugins/hid_gtk/gtkhid-gl.c b/src_plugins/hid_gtk/gtkhid-gl.c
index e8a12d9..2df05c1 100644
--- a/src_plugins/hid_gtk/gtkhid-gl.c
+++ b/src_plugins/hid_gtk/gtkhid-gl.c
@@ -25,9 +25,9 @@
#include "hid/common/hidgl.h"
#include "hid_draw_helpers.h"
-extern HID ghid_hid;
+extern pcb_hid_t ghid_hid;
-static hidGC current_gc = NULL;
+static pcb_hid_gc_t current_gc = NULL;
/* Sets gport->u_gc to the "right" GC to use (wrt mask or window)
*/
@@ -47,22 +47,22 @@ typedef struct render_priv {
guint lead_user_timeout;
GTimer *lead_user_timer;
bool lead_user;
- Coord lead_user_radius;
- Coord lead_user_x;
- Coord lead_user_y;
+ pcb_coord_t lead_user_radius;
+ pcb_coord_t lead_user_x;
+ pcb_coord_t lead_user_y;
} render_priv;
-typedef struct hid_gc_struct {
- HID *me_pointer;
+typedef struct hid_gc_s {
+ pcb_hid_t *me_pointer;
const char *colorname;
double alpha_mult;
- Coord width;
+ pcb_coord_t width;
gint cap, join;
gchar xor;
-} hid_gc_struct;
+} hid_gc_s;
static void draw_lead_user(render_priv * priv);
@@ -103,15 +103,15 @@ static void end_subcomposite(void)
}
-int ghid_set_layer(const char *name, int group, int empty)
+int ghid_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
render_priv *priv = gport->render_priv;
int idx = group;
- if (idx >= 0 && idx < max_group) {
+ if (idx >= 0 && idx < pcb_max_group) {
int n = PCB->LayerGroups.Number[group];
for (idx = 0; idx < n - 1; idx++) {
int ni = PCB->LayerGroups.Entries[group][idx];
- if (ni >= 0 && ni < max_copper_layer + 2 && PCB->Data->Layer[ni].On)
+ if (ni >= 0 && ni < pcb_max_copper_layer + 2 && PCB->Data->Layer[ni].On)
break;
}
idx = PCB->LayerGroups.Entries[group][idx];
@@ -120,29 +120,30 @@ int ghid_set_layer(const char *name, int group, int empty)
end_subcomposite();
start_subcomposite();
- if (idx >= 0 && idx < max_copper_layer + 2) {
+ if (idx >= 0 && idx < pcb_max_copper_layer + 2) {
priv->trans_lines = pcb_true;
return PCB->Data->Layer[idx].On;
}
- if (idx < 0) {
- switch (SL_TYPE(idx)) {
- case SL_INVISIBLE:
+
+ {
+ switch (flags & PCB_LYT_ANYTHING) {
+ case PCB_LYT_INVIS:
return PCB->InvisibleObjectsOn;
- case SL_MASK:
- if (SL_MYSIDE(idx))
- return TEST_FLAG(SHOWMASKFLAG, PCB);
+ case PCB_LYT_MASK:
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags))
+ return PCB_FLAG_TEST(PCB_SHOWMASKFLAG, PCB);
return 0;
- case SL_SILK:
+ case PCB_LYT_SILK:
priv->trans_lines = pcb_true;
- if (SL_MYSIDE(idx))
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags))
return PCB->ElementOn;
return 0;
- case SL_ASSY:
+ case PCB_LYT_ASSY:
return 0;
- case SL_PDRILL:
- case SL_UDRILL:
+ case PCB_LYT_PDRILL:
+ case PCB_LYT_UDRILL:
return 1;
- case SL_RATS:
+ case PCB_LYT_RATS:
if (PCB->RatOn)
priv->trans_lines = pcb_true;
return PCB->RatOn;
@@ -156,25 +157,25 @@ static void ghid_end_layer(void)
end_subcomposite();
}
-void ghid_destroy_gc(hidGC gc)
+void ghid_destroy_gc(pcb_hid_gc_t gc)
{
g_free(gc);
}
-hidGC ghid_make_gc(void)
+pcb_hid_gc_t ghid_make_gc(void)
{
- hidGC rv;
+ pcb_hid_gc_t rv;
- rv = g_new0(hid_gc_struct, 1);
+ rv = g_new0(hid_gc_s, 1);
rv->me_pointer = &ghid_hid;
rv->colorname = conf_core.appearance.color.background;
rv->alpha_mult = 1.0;
return rv;
}
-static void ghid_draw_grid(BoxTypePtr drawn_area)
+static void ghid_draw_grid(pcb_box_t *drawn_area)
{
- if (Vz(PCB->Grid) < MIN_GRID_DISTANCE)
+ if (Vz(PCB->Grid) < PCB_MIN_GRID_DISTANCE)
return;
if (gdk_color_parse(conf_core.appearance.color.grid, &gport->grid_color)) {
@@ -302,7 +303,7 @@ static void set_special_grid_color(void)
gport->grid_color.blue ^= gport->bg_color.blue;
}
-void ghid_set_special_colors(HID_Attribute * ha)
+void ghid_set_special_colors(pcb_hid_attribute_t * ha)
{
if (!ha->name || !ha->value)
return;
@@ -329,11 +330,11 @@ typedef struct {
double blue;
} ColorCache;
-static void set_gl_color_for_gc(hidGC gc)
+static void set_gl_color_for_gc(pcb_hid_gc_t gc)
{
render_priv *priv = gport->render_priv;
static void *cache = NULL;
- hidval cval;
+ pcb_hidval_t cval;
ColorCache *cc;
double r, g, b, a;
@@ -360,13 +361,13 @@ static void set_gl_color_for_gc(hidGC gc)
a = 0.85;
}
else {
- if (hid_cache_color(0, gc->colorname, &cval, &cache))
+ if (pcb_hid_cache_color(0, gc->colorname, &cval, &cache))
cc = (ColorCache *) cval.ptr;
else {
cc = (ColorCache *) malloc(sizeof(ColorCache));
memset(cc, 0, sizeof(*cc));
cval.ptr = cc;
- hid_cache_color(1, gc->colorname, &cval, &cache);
+ pcb_hid_cache_color(1, gc->colorname, &cval, &cache);
}
if (!cc->color_set) {
@@ -421,30 +422,30 @@ static void set_gl_color_for_gc(hidGC gc)
glColor4d(r, g, b, a);
}
-void ghid_set_color(hidGC gc, const char *name)
+void ghid_set_color(pcb_hid_gc_t gc, const char *name)
{
gc->colorname = name;
set_gl_color_for_gc(gc);
}
-void ghid_set_alpha_mult(hidGC gc, double alpha_mult)
+void ghid_set_alpha_mult(pcb_hid_gc_t gc, double alpha_mult)
{
gc->alpha_mult = alpha_mult;
set_gl_color_for_gc(gc);
}
-void ghid_set_line_cap(hidGC gc, EndCapStyle style)
+void ghid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-void ghid_set_line_width(hidGC gc, Coord width)
+void ghid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-void ghid_set_draw_xor(hidGC gc, int xor)
+void ghid_set_draw_xor(pcb_hid_gc_t gc, int xor)
{
/* NOT IMPLEMENTED */
@@ -452,12 +453,12 @@ void ghid_set_draw_xor(hidGC gc, int xor)
* We manage our own drawing model for that anyway. */
}
-void ghid_set_draw_faded(hidGC gc, int faded)
+void ghid_set_draw_faded(pcb_hid_gc_t gc, int faded)
{
printf("ghid_set_draw_faded(%p,%d) -- not implemented\n", (void *)gc, faded);
}
-void ghid_set_line_cap_angle(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_set_line_cap_angle(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
printf("ghid_set_line_cap_angle() -- not implemented\n");
}
@@ -467,7 +468,7 @@ static void ghid_invalidate_current_gc(void)
current_gc = NULL;
}
-static int use_gc(hidGC gc)
+static int use_gc(pcb_hid_gc_t gc)
{
if (gc->me_pointer != &ghid_hid) {
fprintf(stderr, "Fatal: GC from another HID passed to GTK HID\n");
@@ -483,21 +484,21 @@ static int use_gc(hidGC gc)
return 1;
}
-void ghid_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
USE_GC(gc);
hidgl_draw_line(gc->cap, gc->width, x1, y1, x2, y2, gport->view.coord_per_px);
}
-void ghid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle)
+void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
USE_GC(gc);
hidgl_draw_arc(gc->width, cx, cy, xradius, yradius, start_angle, delta_angle, gport->view.coord_per_px);
}
-void ghid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
USE_GC(gc);
@@ -505,7 +506,7 @@ void ghid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
-void ghid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+void ghid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
USE_GC(gc);
@@ -513,36 +514,36 @@ void ghid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
}
-void ghid_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
USE_GC(gc);
hidgl_fill_polygon(n_coords, x, y);
}
-void ghid_fill_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box)
+void ghid_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
USE_GC(gc);
hidgl_fill_pcb_polygon(poly, clip_box, gport->view.coord_per_px);
}
-void ghid_thindraw_pcb_polygon(hidGC gc, PolygonType * poly, const BoxType * clip_box)
+void ghid_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box)
{
- common_thindraw_pcb_polygon(gc, poly, clip_box);
+ pcb_dhlp_thindraw_pcb_polygon(gc, poly, clip_box);
ghid_set_alpha_mult(gc, 0.25);
ghid_fill_pcb_polygon(gc, poly, clip_box);
ghid_set_alpha_mult(gc, 1.0);
}
-void ghid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+void ghid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
USE_GC(gc);
hidgl_fill_rect(x1, y1, x2, y2);
}
-void ghid_invalidate_lr(int left, int right, int top, int bottom)
+void ghid_invalidate_lr(pcb_coord_t left, pcb_coord_t right, pcb_coord_t top, pcb_coord_t bottom)
{
ghid_invalidate_all();
}
@@ -659,14 +660,14 @@ static void draw_dozen_cross(gint x, gint y, gint z)
static void draw_crosshair(gint x, gint y, gint z)
{
- static enum crosshair_shape prev = Basic_Crosshair_Shape;
+ static enum pcb_crosshair_shape_e prev = pcb_ch_shape_basic;
draw_right_cross(x, y, z);
- if (prev == Union_Jack_Crosshair_Shape)
+ if (prev == pcb_ch_shape_union_jack)
draw_slanted_cross(x, y, z);
- if (prev == Dozen_Crosshair_Shape)
+ if (prev == pcb_ch_shape_dozen)
draw_dozen_cross(x, y, z);
- prev = Crosshair.shape;
+ prev = pcb_crosshair.shape;
}
void ghid_show_crosshair(gboolean paint_new_location)
@@ -780,7 +781,7 @@ gboolean ghid_drawing_area_expose_cb(GtkWidget * widget, GdkEventExpose * ev, GH
{
render_priv *priv = port->render_priv;
GtkAllocation allocation;
- BoxType region;
+ pcb_box_t region;
gtk_widget_get_allocation(widget, &allocation);
@@ -792,7 +793,7 @@ gboolean ghid_drawing_area_expose_cb(GtkWidget * widget, GdkEventExpose * ev, GH
we can't use the hidgl polygon drawing routine */
/* TODO: We could use the GLU tessellator though */
if (hidgl_stencil_bits() == 0)
- ghid_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ ghid_hid.fill_pcb_polygon = pcb_dhlp_fill_pcb_polygon;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -851,15 +852,15 @@ gboolean ghid_drawing_area_expose_cb(GtkWidget * widget, GdkEventExpose * ev, GH
hidgl_init_triangle_array(&buffer);
ghid_invalidate_current_gc();
- hid_expose_callback(&ghid_hid, ®ion, 0);
+ pcb_hid_expose_callback(&ghid_hid, ®ion, 0);
hidgl_flush_triangles(&buffer);
ghid_draw_grid(®ion);
ghid_invalidate_current_gc();
- DrawAttached();
- DrawMark();
+ pcb_draw_attached();
+ pcb_draw_mark();
hidgl_flush_triangles(&buffer);
ghid_show_crosshair(TRUE);
@@ -957,7 +958,7 @@ gboolean ghid_pinout_preview_expose(GtkWidget * widget, GdkEventExpose * ev)
(conf_core.editor.view.flip_y ? -1. : 1.) / gport->view.coord_per_px, 1);
glTranslatef(conf_core.editor.view.flip_x ? gport->view.x0 - PCB->MaxWidth :
-gport->view.x0, conf_core.editor.view.flip_y ? gport->view.y0 - PCB->MaxHeight : -gport->view.y0, 0);
- hid_expose_callback(&ghid_hid, NULL, &pinout->element);
+ pcb_hid_expose_callback(&ghid_hid, NULL, &pinout->element);
hidgl_flush_triangles(&buffer);
glPopMatrix();
@@ -987,7 +988,7 @@ GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height
GdkGLDrawable *gldrawable;
view_data save_view;
int save_width, save_height;
- BoxType region;
+ pcb_box_t region;
save_view = gport->view;
save_width = gport->width;
@@ -1061,7 +1062,7 @@ GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height
region.Y1 = MAX(0, MIN(PCB->MaxHeight, region.Y1));
region.Y2 = MAX(0, MIN(PCB->MaxHeight, region.Y2));
- hid_expose_callback(&ghid_hid, ®ion, NULL);
+ pcb_hid_expose_callback(&ghid_hid, ®ion, NULL);
hidgl_flush_triangles(&buffer);
glPopMatrix();
@@ -1083,7 +1084,7 @@ GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height
return pixmap;
}
-HID *ghid_request_debug_draw(void)
+pcb_hid_t *ghid_request_debug_draw(void)
{
GHidPort *port = gport;
GtkWidget *widget = port->drawing_area;
@@ -1138,7 +1139,7 @@ void ghid_finish_debug_draw(void)
ghid_end_drawing(gport);
}
-bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * pcb_y)
+bool ghid_event_to_pcb_coords(int event_x, int event_y, pcb_coord_t * pcb_x, pcb_coord_t * pcb_y)
{
*pcb_x = EVENT_TO_PCB_X(event_x);
*pcb_y = EVENT_TO_PCB_Y(event_y);
@@ -1146,7 +1147,7 @@ bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * p
return pcb_true;
}
-bool ghid_pcb_to_event_coords(Coord pcb_x, Coord pcb_y, int *event_x, int *event_y)
+bool ghid_pcb_to_event_coords(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int *event_x, int *event_y)
{
*event_x = DRAW_X(pcb_x);
*event_y = DRAW_Y(pcb_y);
@@ -1198,7 +1199,7 @@ static void draw_lead_user(render_priv * priv)
gboolean lead_user_cb(gpointer data)
{
render_priv *priv = data;
- Coord step;
+ pcb_coord_t step;
double elapsed_time;
/* Queue a redraw */
@@ -1217,7 +1218,7 @@ gboolean lead_user_cb(gpointer data)
return TRUE;
}
-void ghid_lead_user_to_location(Coord x, Coord y)
+void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y)
{
render_priv *priv = gport->render_priv;
diff --git a/src_plugins/hid_gtk/gtkhid-main.c b/src_plugins/hid_gtk/gtkhid-main.c
index a716627..ac4f232 100644
--- a/src_plugins/hid_gtk/gtkhid-main.c
+++ b/src_plugins/hid_gtk/gtkhid-main.c
@@ -10,6 +10,7 @@
#include "action_helper.h"
#include "crosshair.h"
#include "error.h"
+#include "draw.h"
#include "gui.h"
#include "hid_nogui.h"
#include "hid_draw_helpers.h"
@@ -25,6 +26,8 @@
#include "compat_misc.h"
#include "layer.h"
#include "ghid-search.h"
+#include "compat_nls.h"
+#include "layer_vis.h"
#include "gtkhid.h"
@@ -60,7 +63,7 @@ static void pan_common(GHidPort * port)
ghid_port_ranges_changed();
}
-static void ghid_pan_view_abs(Coord pcb_x, Coord pcb_y, int widget_x, int widget_y)
+static void ghid_pan_view_abs(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int widget_x, int widget_y)
{
gport->view.x0 = SIDE_X(pcb_x) - widget_x * gport->view.coord_per_px;
gport->view.y0 = SIDE_Y(pcb_y) - widget_y * gport->view.coord_per_px;
@@ -68,7 +71,7 @@ static void ghid_pan_view_abs(Coord pcb_x, Coord pcb_y, int widget_x, int widget
pan_common(gport);
}
-void ghid_pan_view_rel(Coord dx, Coord dy)
+void ghid_pan_view_rel(pcb_coord_t dx, pcb_coord_t dy)
{
gport->view.x0 += dx;
gport->view.y0 += dy;
@@ -85,11 +88,11 @@ void ghid_pan_view_rel(Coord dx, Coord dy)
*/
#define ALLOW_ZOOM_OUT_BY 10 /* Arbitrary, and same as the lesstif HID MAX_ZOOM_SCALE */
-static void ghid_zoom_view_abs(Coord center_x, Coord center_y, double new_zoom)
+static void ghid_zoom_view_abs(pcb_coord_t center_x, pcb_coord_t center_y, double new_zoom)
{
double min_zoom, max_zoom;
double xtmp, ytmp;
- Coord cmaxx, cmaxy;
+ pcb_coord_t cmaxx, cmaxy;
/* Limit the "minimum" zoom constant (maximum zoom), at 1 pixel per PCB
* unit, and set the "maximum" zoom constant (minimum zoom), such that
@@ -116,7 +119,7 @@ static void ghid_zoom_view_abs(Coord center_x, Coord center_y, double new_zoom)
ytmp = (SIDE_Y(center_y) - gport->view.y0) / (double) gport->view.height;
gport->view.coord_per_px = new_zoom;
- pixel_slop = new_zoom;
+ pcb_pixel_slop = new_zoom;
ghid_port_ranges_scale();
gport->view.x0 = SIDE_X(center_x) - xtmp * gport->view.width;
@@ -127,7 +130,7 @@ static void ghid_zoom_view_abs(Coord center_x, Coord center_y, double new_zoom)
ghid_set_status_line_label();
}
-static void ghid_zoom_view_rel(Coord center_x, Coord center_y, double factor)
+static void ghid_zoom_view_rel(pcb_coord_t center_x, pcb_coord_t center_y, double factor)
{
ghid_zoom_view_abs(center_x, center_y, gport->view.coord_per_px * factor);
}
@@ -138,10 +141,12 @@ static void ghid_zoom_view_fit(void)
ghid_zoom_view_abs(SIDE_X(0), SIDE_Y(0), MAX(PCB->MaxWidth / gport->width, PCB->MaxHeight / gport->height));
}
-static void ghid_flip_view(Coord center_x, Coord center_y, pcb_bool flip_x, pcb_bool flip_y)
+static void ghid_flip_view(pcb_coord_t center_x, pcb_coord_t center_y, pcb_bool flip_x, pcb_bool flip_y)
{
int widget_x, widget_y;
+ pcb_draw_inhibit_inc();
+
/* Work out where on the screen the flip point is */
ghid_pcb_to_event_coords(center_x, center_y, &widget_x, &widget_y);
@@ -151,6 +156,8 @@ static void ghid_flip_view(Coord center_x, Coord center_y, pcb_bool flip_x, pcb_
/* Pan the board so the center location remains in the same place */
ghid_pan_view_abs(center_x, center_y, widget_x, widget_y);
+ pcb_draw_inhibit_dec();
+
ghid_invalidate_all();
}
@@ -199,13 +206,13 @@ Note that zoom factors of zero are silently ignored.
%end-doc */
-static int Zoom(int argc, const char **argv, Coord x, Coord y)
+static int Zoom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *vp;
double v;
if (argc > 1)
- AFAIL(zoom);
+ PCB_AFAIL(zoom);
if (argc < 1) {
ghid_zoom_view_fit();
@@ -301,7 +308,7 @@ void ghid_set_crosshair(int x, int y, int action)
int offset_x, offset_y;
int widget_x, widget_y;
int pointer_x, pointer_y;
- Coord pcb_x, pcb_y;
+ pcb_coord_t pcb_x, pcb_y;
ghid_draw_grid_local(x, y);
@@ -364,9 +371,9 @@ void ghid_set_crosshair(int x, int y, int action)
}
typedef struct {
- void (*func) (hidval);
+ void (*func) (pcb_hidval_t);
guint id;
- hidval user_data;
+ pcb_hidval_t user_data;
} GuiTimer;
/* We need a wrapper around the hid timer because a gtk timer needs
@@ -379,10 +386,10 @@ static gboolean ghid_timer(GuiTimer * timer)
return FALSE; /* Turns timer off */
}
-hidval ghid_add_timer(void (*func) (hidval user_data), unsigned long milliseconds, hidval user_data)
+pcb_hidval_t ghid_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data)
{
GuiTimer *timer = g_new0(GuiTimer, 1);
- hidval ret;
+ pcb_hidval_t ret;
timer->func = func;
timer->user_data = user_data;
@@ -391,7 +398,7 @@ hidval ghid_add_timer(void (*func) (hidval user_data), unsigned long millisecond
return ret;
}
-void ghid_stop_timer(hidval timer)
+void ghid_stop_timer(pcb_hidval_t timer)
{
void *ptr = timer.ptr;
@@ -400,8 +407,8 @@ void ghid_stop_timer(hidval timer)
}
typedef struct {
- void (*func) (hidval, int, unsigned int, hidval);
- hidval user_data;
+ void (*func) (pcb_hidval_t, int, unsigned int, pcb_hidval_t);
+ pcb_hidval_t user_data;
int fd;
GIOChannel *channel;
gint id;
@@ -412,7 +419,7 @@ typedef struct {
static gboolean ghid_watch(GIOChannel * source, GIOCondition condition, gpointer data)
{
unsigned int pcb_condition = 0;
- hidval x;
+ pcb_hidval_t x;
GuiWatch *watch = (GuiWatch *) data;
if (condition & G_IO_IN)
@@ -431,12 +438,12 @@ static gboolean ghid_watch(GIOChannel * source, GIOCondition condition, gpointer
return TRUE; /* Leave watch on */
}
-hidval
-ghid_watch_file(int fd, unsigned int condition, void (*func) (hidval watch, int fd, unsigned int condition, hidval user_data),
- hidval user_data)
+pcb_hidval_t
+ghid_watch_file(int fd, unsigned int condition, void (*func) (pcb_hidval_t watch, int fd, unsigned int condition, pcb_hidval_t user_data),
+ pcb_hidval_t user_data)
{
GuiWatch *watch = g_new0(GuiWatch, 1);
- hidval ret;
+ pcb_hidval_t ret;
unsigned int glib_condition = 0;
if (condition & PCB_WATCH_READABLE)
@@ -458,7 +465,7 @@ ghid_watch_file(int fd, unsigned int condition, void (*func) (hidval watch, int
return ret;
}
-void ghid_unwatch_file(hidval data)
+void ghid_unwatch_file(pcb_hidval_t data)
{
GuiWatch *watch = (GuiWatch *) data.ptr;
@@ -469,8 +476,8 @@ void ghid_unwatch_file(hidval data)
typedef struct {
GSource source;
- void (*func) (hidval user_data);
- hidval user_data;
+ void (*func) (pcb_hidval_t user_data);
+ pcb_hidval_t user_data;
} BlockHookSource;
static gboolean ghid_block_hook_prepare(GSource * source, gint * timeout);
@@ -486,7 +493,7 @@ static GSourceFuncs ghid_block_hook_funcs = {
static gboolean ghid_block_hook_prepare(GSource * source, gint * timeout)
{
- hidval data = ((BlockHookSource *) source)->user_data;
+ pcb_hidval_t data = ((BlockHookSource *) source)->user_data;
((BlockHookSource *) source)->func(data);
return FALSE;
}
@@ -501,9 +508,9 @@ static gboolean ghid_block_hook_dispatch(GSource * source, GSourceFunc callback,
return FALSE;
}
-static hidval ghid_add_block_hook(void (*func) (hidval data), hidval user_data)
+static pcb_hidval_t ghid_add_block_hook(void (*func) (pcb_hidval_t data), pcb_hidval_t user_data)
{
- hidval ret;
+ pcb_hidval_t ret;
BlockHookSource *source;
source = (BlockHookSource *) g_source_new(&ghid_block_hook_funcs, sizeof(BlockHookSource));
@@ -517,7 +524,7 @@ static hidval ghid_add_block_hook(void (*func) (hidval data), hidval user_data)
return ret;
}
-static void ghid_stop_block_hook(hidval mlpoll)
+static void ghid_stop_block_hook(pcb_hidval_t mlpoll)
{
GSource *source = (GSource *) mlpoll.ptr;
g_source_destroy(source);
@@ -569,7 +576,7 @@ int ghid_close_confirm_dialog()
switch (ghid_dialog_close_confirm()) {
case GUI_DIALOG_CLOSE_CONFIRM_SAVE:
{
- if (hid_actionl("Save", NULL)) { /* Save failed */
+ if (pcb_hid_actionl("Save", NULL)) { /* Save failed */
return 0; /* Cancel */
}
else {
@@ -595,9 +602,13 @@ void ghid_report_dialog(const char *title, const char *msg)
char *ghid_prompt_for(const char *msg, const char *default_string)
{
- char *rv;
+ char *grv, *rv;
- rv = ghid_dialog_input(msg, default_string);
+ grv = ghid_dialog_input(msg, default_string);
+
+ /* can't assume the caller will do g_free() on it */
+ rv = pcb_strdup(grv);
+ g_free(grv);
return rv;
}
@@ -615,7 +626,7 @@ char *ghid_fileselect(const char *title, const char *descr,
void ghid_show_item(void *item)
{
- ghid_pinout_window_show(&ghid_port, (ElementTypePtr) item);
+ ghid_pinout_window_show(&ghid_port, (pcb_element_t *) item);
}
void ghid_beep()
@@ -817,7 +828,7 @@ typedef struct {
static AttrRow *attr_row = 0;
static int attr_num_rows = 0;
static int attr_max_rows = 0;
-static AttributeListType *attributes_list;
+static pcb_attribute_list_t *attributes_list;
static GtkWidget *attributes_dialog, *attr_table;
static void attributes_delete_callback(GtkWidget * w, void *v);
@@ -911,7 +922,7 @@ static void attributes_delete_callback(GtkWidget * w, void *v)
ghid_attr_set_table_size();
}
-static void ghid_attributes(const char *owner, AttributeListType * attrs)
+static void ghid_attributes(const char *owner, pcb_attribute_list_t * attrs)
{
GtkWidget *content_area;
int response;
@@ -953,11 +964,11 @@ static void ghid_attributes(const char *owner, AttributeListType * attrs)
free(attributes_list->List[i].value);
}
if (attributes_list->Max < attr_num_rows) {
- int sz = attr_num_rows * sizeof(AttributeType);
+ int sz = attr_num_rows * sizeof(pcb_attribute_t);
if (attributes_list->List == NULL)
- attributes_list->List = (AttributeType *) malloc(sz);
+ attributes_list->List = (pcb_attribute_t *) malloc(sz);
else
- attributes_list->List = (AttributeType *) realloc(attributes_list->List, sz);
+ attributes_list->List = (pcb_attribute_t *) realloc(attributes_list->List, sz);
attributes_list->Max = attr_num_rows;
}
for (i = 0; i < attr_num_rows; i++) {
@@ -991,7 +1002,7 @@ static void ghid_attributes(const char *owner, AttributeListType * attrs)
/* ---------------------------------------------------------------------- */
-HID_DRC_GUI ghid_drc_gui = {
+pcb_hid_drc_gui_t ghid_drc_gui = {
1, /* log_drc_overview */
0, /* log_drc_details */
ghid_drc_window_reset_message,
@@ -999,7 +1010,7 @@ HID_DRC_GUI ghid_drc_gui = {
ghid_drc_window_throw_dialog,
};
-extern HID_Attribute *ghid_get_export_options(int *);
+extern pcb_hid_attribute_t *ghid_get_export_options(int *);
/* ------------------------------------------------------------
@@ -1022,7 +1033,7 @@ This just pops up a dialog telling the user which version of
%end-doc */
-static int About(int argc, const char **argv, Coord x, Coord y)
+static int About(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
ghid_dialog_about();
return 0;
@@ -1039,67 +1050,65 @@ Prompts the user for a coordinate, if one is not already selected.
%end-doc */
-static int GetXY(int argc, const char **argv, Coord x, Coord y)
+static int GetXY(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
return 0;
}
/* ---------------------------------------------------------------------- */
-static int PointCursor(int argc, const char **argv, Coord x, Coord y)
+static void PointCursor(pcb_bool grabbed)
{
if (!ghidgui)
- return 0;
+ return;
- if (argc > 0)
+ if (grabbed > 0)
ghid_point_cursor();
else
ghid_mode_cursor(conf_core.editor.mode);
- return 0;
}
/* ---------------------------------------------------------------------- */
-static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y)
+static void RouteStylesChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
if (!ghidgui || !ghidgui->route_style_selector)
- return 0;
+ return;
ghid_route_style_selector_sync
(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector),
conf_core.design.line_thickness, conf_core.design.via_drilling_hole, conf_core.design.via_thickness, conf_core.design.clearance);
- return 0;
+ return;
}
/* ---------------------------------------------------------------------- */
-int PCBChanged(int argc, const char **argv, Coord x, Coord y)
+static void ev_pcb_changed(void *user_data, int argc, pcb_event_arg_t argv[])
{
- if (!ghidgui)
- return 0;
+ if ((!ghidgui) || (!gtkhid_active))
+ return;
if (PCB != NULL)
ghid_window_set_name_label(PCB->Name);
if (!gport->pixmap)
- return 0;
+ return;
if (ghidgui->route_style_selector) {
ghid_route_style_selector_empty(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector));
make_route_style_buttons(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector));
}
- RouteStylesChanged(0, NULL, 0, 0);
+ RouteStylesChanged(0, 0, NULL);
ghid_port_ranges_scale();
ghid_zoom_view_fit();
ghid_sync_with_new_layout();
- return 0;
}
/* ---------------------------------------------------------------------- */
-static int LayerGroupsChanged(int argc, const char **argv, Coord x, Coord y)
+static int LayerGroupsChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
printf(_("LayerGroupsChanged -- not implemented\n"));
return 0;
@@ -1107,17 +1116,7 @@ static int LayerGroupsChanged(int argc, const char **argv, Coord x, Coord y)
/* ---------------------------------------------------------------------- */
-static int LibraryChanged(int argc, const char **argv, Coord x, Coord y)
-{
- /* No need to show the library window every time it changes...
- * ghid_library_window_show (&ghid_port, FALSE);
- */
- return 0;
-}
-
-/* ---------------------------------------------------------------------- */
-
-static int Command(int argc, const char **argv, Coord x, Coord y)
+static int Command(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
ghid_handle_user_command(TRUE);
return 0;
@@ -1135,7 +1134,7 @@ static char *dup_cwd()
return pcb_strdup(getcwd(tmp, sizeof(tmp)));
}
-static int Load(int argc, const char **argv, Coord x, Coord y)
+static int Load(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function;
char *name = NULL;
@@ -1153,28 +1152,28 @@ static int Load(int argc, const char **argv, Coord x, Coord y)
/* we've been given the file name */
if (argc > 1)
- return hid_actionv("LoadFrom", argc, argv);
+ return pcb_hid_actionv("LoadFrom", argc, argv);
function = argc ? argv[0] : "Layout";
- if (strcasecmp(function, "Netlist") == 0) {
+ if (pcb_strcasecmp(function, "Netlist") == 0) {
name = ghid_dialog_file_select_open(_("Load netlist file"), ¤t_netlist_dir, conf_core.rc.file_path);
}
- else if (strcasecmp(function, "ElementToBuffer") == 0) {
- gchar *path = (gchar *)fp_default_search_path();
+ else if (pcb_strcasecmp(function, "ElementToBuffer") == 0) {
+ gchar *path = (gchar *)pcb_fp_default_search_path();
name = ghid_dialog_file_select_open(_("Load element to buffer"), ¤t_element_dir, path);
}
- else if (strcasecmp(function, "LayoutToBuffer") == 0) {
+ else if (pcb_strcasecmp(function, "LayoutToBuffer") == 0) {
name = ghid_dialog_file_select_open(_("Load layout file to buffer"), ¤t_layout_dir, conf_core.rc.file_path);
}
- else if (strcasecmp(function, "Layout") == 0) {
+ else if (pcb_strcasecmp(function, "Layout") == 0) {
name = ghid_dialog_file_select_open(_("Load layout file"), ¤t_layout_dir, conf_core.rc.file_path);
}
if (name) {
if (conf_core.rc.verbose)
fprintf(stderr, "Load: Calling LoadFrom(%s, %s)\n", function, name);
- hid_actionl("LoadFrom", function, name, NULL);
+ pcb_hid_actionl("LoadFrom", function, name, NULL);
g_free(name);
}
@@ -1198,13 +1197,13 @@ called with that filename.
%end-doc */
-static int Save(int argc, const char **argv, Coord x, Coord y)
+static int Save(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function;
- char *name;
+ char *name, *name_in = NULL;
const char *prompt;
pcb_io_formats_t avail;
- const char **formats_param = NULL;
+ const char **formats_param = NULL, **extensions_param = NULL;
int fmt, *fmt_param = NULL;
static gchar *current_dir = NULL;
@@ -1213,48 +1212,77 @@ static int Save(int argc, const char **argv, Coord x, Coord y)
current_dir = dup_cwd();
if (argc > 1)
- return hid_actionv("SaveTo", argc, argv);
+ return pcb_hid_actionv("SaveTo", argc, argv);
function = argc ? argv[0] : "Layout";
- if (strcasecmp(function, "Layout") == 0)
+ if (pcb_strcasecmp(function, "Layout") == 0)
if (PCB->Filename)
- return hid_actionl("SaveTo", "Layout", PCB->Filename, NULL);
+ return pcb_hid_actionl("SaveTo", "Layout", PCB->Filename, NULL);
- if (strcasecmp(function, "PasteBuffer") == 0) {
+ if (pcb_strcasecmp(function, "PasteBuffer") == 0) {
+ int num_fmts, n;
prompt = _("Save element as");
- if (pcb_io_list(&avail, PCB_IOT_BUFFER, 1, 1) > 0) {
+ num_fmts = pcb_io_list(&avail, PCB_IOT_BUFFER, 1, 1, PCB_IOL_EXT_FP);
+ if (num_fmts > 0) {
formats_param = (const char **)avail.digest;
+ extensions_param = (const char **)avail.extension;
fmt_param = &fmt;
fmt = 0;
+ for(n = 0; n < num_fmts; n++) {
+ if (strstr(avail.plug[n]->description, "mainline") != NULL) {
+ fmt = n;
+ name_in = pcb_concat("unnamed.fp", NULL);
+ }
+ }
}
else {
- Message(PCB_MSG_DEFAULT, "Error: no IO plugin avaialble for saving a buffer.");
+ pcb_message(PCB_MSG_ERROR, "Error: no IO plugin avaialble for saving a buffer.");
return -1;
}
}
else {
+ int num_fmts, n;
prompt = _("Save layout as");
- if (pcb_io_list(&avail, PCB_IOT_PCB, 1, 1) > 0) {
+ num_fmts = pcb_io_list(&avail, PCB_IOT_PCB, 1, 1, PCB_IOL_EXT_BOARD);
+ if (num_fmts > 0) {
formats_param = (const char **)avail.digest;
+ extensions_param = (const char **)avail.extension;
fmt_param = &fmt;
fmt = 0;
+ if (PCB->Data->loader != NULL) {
+ for(n = 0; n < num_fmts; n++) {
+ if (avail.plug[n] == PCB->Data->loader) {
+ fmt = n;
+ break;
+ }
+ }
+ }
}
else {
- Message(PCB_MSG_DEFAULT, "Error: no IO plugin avaialble for saving a buffer.");
+ pcb_message(PCB_MSG_ERROR, "Error: no IO plugin avaialble for saving a buffer.");
return -1;
}
}
- name = ghid_dialog_file_select_save(prompt, ¤t_dir, PCB->Filename, conf_core.rc.file_path, formats_param, fmt_param);
+ { /* invent an input file name if needed and run the save dialog to get an output file name */
+ if (name_in == NULL) {
+ if (PCB->Filename == NULL)
+ name_in = pcb_concat("unnamed", extensions_param[fmt], NULL);
+ else
+ name_in = pcb_strdup(PCB->Filename);
+ }
+ name = ghid_dialog_file_select_save(prompt, ¤t_dir, name_in, conf_core.rc.file_path, formats_param, extensions_param, fmt_param);
+ free(name_in);
+ }
if (name) {
if (conf_core.rc.verbose)
fprintf(stderr, "Save: Calling SaveTo(%s, %s)\n", function, name);
- if (strcasecmp(function, "PasteBuffer") == 0) {
- hid_actionl("PasteBuffer", "Save", name, avail.plug[fmt]->description, "1", NULL);
- pcb_io_list_free(&avail);
+ if (pcb_strcasecmp(function, "PasteBuffer") == 0) {
+ pcb_hid_actionl("PasteBuffer", "Save", name, avail.plug[fmt]->description, "1", NULL);
+
}
else {
const char *sfmt = NULL;
@@ -1266,14 +1294,16 @@ static int Save(int argc, const char **argv, Coord x, Coord y)
*/
if (fmt_param != NULL)
sfmt = avail.plug[fmt]->description;
- if (strcasecmp(function, "Layout") == 0)
- hid_actionl("SaveTo", "LayoutAs", name, sfmt, NULL);
+ if (pcb_strcasecmp(function, "Layout") == 0)
+ pcb_hid_actionl("SaveTo", "LayoutAs", name, sfmt, NULL);
else
- hid_actionl("SaveTo", function, name, sfmt, NULL);
+ pcb_hid_actionl("SaveTo", function, name, sfmt, NULL);
}
g_free(name);
+ pcb_io_list_free(&avail);
}
else {
+ pcb_io_list_free(&avail);
return 1;
}
@@ -1319,14 +1349,15 @@ side'' of the board.
%end-doc */
-static int SwapSides(int argc, const char **argv, Coord x, Coord y)
+static int SwapSides(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- int active_group = GetLayerGroupNumberByNumber(LayerStack[0]);
- int comp_group = GetLayerGroupNumberByNumber(component_silk_layer);
- int solder_group = GetLayerGroupNumberByNumber(solder_silk_layer);
+ pcb_layergrp_id_t active_group = pcb_layer_get_group(pcb_layer_stack[0]);
+ pcb_layergrp_id_t comp_group = pcb_layer_get_group(pcb_component_silk_layer);
+ pcb_layergrp_id_t solder_group = pcb_layer_get_group(pcb_solder_silk_layer);
pcb_bool comp_on = LAYER_PTR(PCB->LayerGroups.Entries[comp_group][0])->On;
pcb_bool solder_on = LAYER_PTR(PCB->LayerGroups.Entries[solder_group][0])->On;
+ pcb_draw_inhibit_inc();
if (argc > 0) {
switch (argv[0][0]) {
case 'h':
@@ -1343,6 +1374,7 @@ static int SwapSides(int argc, const char **argv, Coord x, Coord y)
conf_toggle_editor(show_solder_side); /* Swapped back below */
break;
default:
+ pcb_draw_inhibit_dec();
return 1;
}
}
@@ -1352,10 +1384,14 @@ static int SwapSides(int argc, const char **argv, Coord x, Coord y)
if ((active_group == comp_group && comp_on && !solder_on) || (active_group == solder_group && solder_on && !comp_on)) {
pcb_bool new_solder_vis = conf_core.editor.show_solder_side;
- ChangeGroupVisibility(PCB->LayerGroups.Entries[comp_group][0], !new_solder_vis, !new_solder_vis);
- ChangeGroupVisibility(PCB->LayerGroups.Entries[solder_group][0], new_solder_vis, new_solder_vis);
+ pcb_layervis_change_group_vis(PCB->LayerGroups.Entries[comp_group][0], !new_solder_vis, !new_solder_vis);
+ pcb_layervis_change_group_vis(PCB->LayerGroups.Entries[solder_group][0], new_solder_vis, new_solder_vis);
}
+ pcb_draw_inhibit_dec();
+
+ ghid_invalidate_all();
+
return 0;
}
@@ -1372,29 +1408,29 @@ options, and print the layout.
%end-doc */
-static int Print(int argc, const char **argv, Coord x, Coord y)
+static int Print(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- HID **hids;
+ pcb_hid_t **hids;
int i;
- HID *printer = NULL;
+ pcb_hid_t *printer = NULL;
- hids = hid_enumerate();
+ hids = pcb_hid_enumerate();
for (i = 0; hids[i]; i++) {
if (hids[i]->printer)
printer = hids[i];
}
if (printer == NULL) {
- gui->log(_("Can't find a suitable printer HID"));
+ pcb_gui->log(_("Can't find a suitable printer HID"));
return -1;
}
/* check if layout is empty */
- if (!IsDataEmpty(PCB->Data)) {
+ if (!pcb_data_is_empty(PCB->Data)) {
ghid_dialog_print(printer);
}
else
- gui->log(_("Can't print empty layout"));
+ pcb_gui->log(_("Can't print empty layout"));
return 0;
}
@@ -1402,7 +1438,7 @@ static int Print(int argc, const char **argv, Coord x, Coord y)
/* ------------------------------------------------------------ */
-static HID_Attribute printer_calibrate_attrs[] = {
+static pcb_hid_attribute_t printer_calibrate_attrs[] = {
{N_("Enter Values here:"), "",
HID_Label, 0, 0, {0, 0, 0}, 0, 0},
{N_("x-calibration"), N_("X scale for calibrating your printer"),
@@ -1411,7 +1447,7 @@ static HID_Attribute printer_calibrate_attrs[] = {
HID_Real, 0.5, 25, {0, 0, 1.00}, 0, 0}
};
-static HID_Attr_Val printer_calibrate_values[3];
+static pcb_hid_attr_val_t printer_calibrate_values[3];
static const char printcalibrate_syntax[] = "PrintCalibrate()";
@@ -1424,12 +1460,12 @@ the measurements in, so that future printouts will be more precise.
%end-doc */
-static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y)
+static int PrintCalibrate(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- HID *printer = hid_find_printer();
+ pcb_hid_t *printer = pcb_hid_find_printer();
printer->calibrate(0.0, 0.0);
- if (gui->attribute_dialog(printer_calibrate_attrs, 3,
+ if (pcb_gui->attribute_dialog(printer_calibrate_attrs, 3,
printer_calibrate_values,
_("Printer Calibration Values"), _("Enter calibration values for your printer")))
return 1;
@@ -1439,22 +1475,22 @@ static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y)
/* ------------------------------------------------------------ */
-static int Export(int argc, const char **argv, Coord x, Coord y)
+static int ExportGUI(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
/* check if layout is empty */
- if (!IsDataEmpty(PCB->Data)) {
+ if (!pcb_data_is_empty(PCB->Data)) {
ghid_dialog_export();
}
else
- gui->log(_("Can't export empty layout"));
+ pcb_gui->log(_("Can't export empty layout"));
return 0;
}
/* ------------------------------------------------------------ */
-static int Benchmark(int argc, const char **argv, Coord x, Coord y)
+static int Benchmark(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int i = 0;
time_t start, end;
@@ -1490,7 +1526,7 @@ currently within the window already.
%end-doc */
-static int Center(int argc, const char **argv, Coord pcb_x, Coord pcb_y)
+static int Center(int argc, const char **argv, pcb_coord_t pcb_x, pcb_coord_t pcb_y)
{
GdkDisplay *display;
GdkScreen *screen;
@@ -1499,7 +1535,7 @@ static int Center(int argc, const char **argv, Coord pcb_x, Coord pcb_y)
int pointer_x, pointer_y;
if (argc != 0)
- AFAIL(center);
+ PCB_AFAIL(center);
/* Aim to put the given x, y PCB coordinates in the center of the widget */
widget_x = gport->width / 2;
@@ -1566,15 +1602,15 @@ The values are percentages of the board size. Thus, a move of
%end-doc */
-static int CursorAction(int argc, const char **argv, Coord x, Coord y)
+static int CursorAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- UnitList extra_units_x = {
+ pcb_unit_list_t extra_units_x = {
{"grid", PCB->Grid, 0},
{"view", gport->view.width, UNIT_PERCENT},
{"board", PCB->MaxWidth, UNIT_PERCENT},
{"", 0, 0}
};
- UnitList extra_units_y = {
+ pcb_unit_list_t extra_units_y = {
{"grid", PCB->Grid, 0},
{"view", gport->view.height, UNIT_PERCENT},
{"board", PCB->MaxHeight, UNIT_PERCENT},
@@ -1584,24 +1620,24 @@ static int CursorAction(int argc, const char **argv, Coord x, Coord y)
double dx, dy;
if (argc != 4)
- AFAIL(cursor);
+ PCB_AFAIL(cursor);
- if (strcasecmp(argv[0], "pan") == 0)
+ if (pcb_strcasecmp(argv[0], "pan") == 0)
pan_warp = HID_SC_PAN_VIEWPORT;
- else if (strcasecmp(argv[0], "warp") == 0)
+ else if (pcb_strcasecmp(argv[0], "warp") == 0)
pan_warp = HID_SC_WARP_POINTER;
else
- AFAIL(cursor);
+ PCB_AFAIL(cursor);
- dx = GetValueEx(argv[1], argv[3], NULL, extra_units_x, "", NULL);
+ dx = pcb_get_value_ex(argv[1], argv[3], NULL, extra_units_x, "", NULL);
if (conf_core.editor.view.flip_x)
dx = -dx;
- dy = GetValueEx(argv[2], argv[3], NULL, extra_units_y, "", NULL);
+ dy = pcb_get_value_ex(argv[2], argv[3], NULL, extra_units_y, "", NULL);
if (!conf_core.editor.view.flip_y)
dy = -dy;
- EventMoveCrosshair(Crosshair.X + dx, Crosshair.Y + dy);
- gui->set_crosshair(Crosshair.X, Crosshair.Y, pan_warp);
+ pcb_event_move_crosshair(pcb_crosshair.X + dx, pcb_crosshair.Y + dy);
+ pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp);
return 0;
}
@@ -1649,7 +1685,7 @@ Open the advanced search window.
%end-doc */
-static int DoWindows(int argc, const char **argv, Coord x, Coord y)
+static int DoWindows(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *a = argc >= 1 ? argv[0] : "";
gboolean raise = TRUE;
@@ -1660,28 +1696,28 @@ static int DoWindows(int argc, const char **argv, Coord x, Coord y)
raise = FALSE;
}
- if (strcmp(a, "1") == 0 || strcasecmp(a, "Layout") == 0) {
+ if (strcmp(a, "1") == 0 || pcb_strcasecmp(a, "Layout") == 0) {
}
- else if (strcmp(a, "2") == 0 || strcasecmp(a, "Library") == 0) {
+ else if (strcmp(a, "2") == 0 || pcb_strcasecmp(a, "Library") == 0) {
ghid_library_window_show(gport, raise);
}
- else if (strcmp(a, "3") == 0 || strcasecmp(a, "Log") == 0) {
+ else if (strcmp(a, "3") == 0 || pcb_strcasecmp(a, "Log") == 0) {
ghid_log_window_show(raise);
}
- else if (strcmp(a, "4") == 0 || strcasecmp(a, "Netlist") == 0) {
+ else if (strcmp(a, "4") == 0 || pcb_strcasecmp(a, "Netlist") == 0) {
ghid_netlist_window_show(gport, raise);
}
- else if (strcmp(a, "5") == 0 || strcasecmp(a, "Preferences") == 0) {
+ else if (strcmp(a, "5") == 0 || pcb_strcasecmp(a, "Preferences") == 0) {
ghid_config_window_show();
}
- else if (strcmp(a, "6") == 0 || strcasecmp(a, "DRC") == 0) {
+ else if (strcmp(a, "6") == 0 || pcb_strcasecmp(a, "DRC") == 0) {
ghid_drc_window_show(raise);
}
- else if (strcmp(a, "7") == 0 || strcasecmp(a, "search") == 0) {
+ else if (strcmp(a, "7") == 0 || pcb_strcasecmp(a, "search") == 0) {
ghid_search_window_show(raise);
}
else {
- AFAIL(dowindows);
+ PCB_AFAIL(dowindows);
}
return 0;
@@ -1706,16 +1742,16 @@ Sets the display units to millimeters.
%end-doc */
-static int SetUnits(int argc, const char **argv, Coord x, Coord y)
+static int SetUnits(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const Unit *new_unit;
+ const pcb_unit_t *new_unit;
if (argc == 0)
return 0;
new_unit = get_unit_struct(argv[0]);
- if (new_unit != NULL && new_unit->allow != NO_PRINT) {
+ if (new_unit != NULL && new_unit->allow != PCB_UNIT_NO_PRINT) {
conf_set(CFR_DESIGN, "editor/grid_unit", -1, argv[0], POL_OVERWRITE);
- AttributePut(PCB, "PCB::grid::unit", argv[0]);
+ pcb_attrib_put(PCB, "PCB::grid::unit", argv[0]);
}
ghid_config_handle_units_changed();
@@ -1746,7 +1782,7 @@ default is given, div=40.
%end-doc */
-static int ScrollAction(int argc, const char **argv, Coord x, Coord y)
+static int ScrollAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
gdouble dx = 0.0, dy = 0.0;
int div = 40;
@@ -1755,21 +1791,21 @@ static int ScrollAction(int argc, const char **argv, Coord x, Coord y)
return 0;
if (argc != 1 && argc != 2)
- AFAIL(scroll);
+ PCB_AFAIL(scroll);
if (argc == 2)
div = atoi(argv[1]);
- if (strcasecmp(argv[0], "up") == 0)
+ if (pcb_strcasecmp(argv[0], "up") == 0)
dy = -gport->view.height / div;
- else if (strcasecmp(argv[0], "down") == 0)
+ else if (pcb_strcasecmp(argv[0], "down") == 0)
dy = gport->view.height / div;
- else if (strcasecmp(argv[0], "right") == 0)
+ else if (pcb_strcasecmp(argv[0], "right") == 0)
dx = gport->view.width / div;
- else if (strcasecmp(argv[0], "left") == 0)
+ else if (pcb_strcasecmp(argv[0], "left") == 0)
dx = -gport->view.width / div;
else
- AFAIL(scroll);
+ PCB_AFAIL(scroll);
ghid_pan_view_rel(dx, dy);
@@ -1789,7 +1825,7 @@ Mode = 0.
%end-doc */
-static int PanAction(int argc, const char **argv, Coord x, Coord y)
+static int PanAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int mode;
@@ -1797,13 +1833,13 @@ static int PanAction(int argc, const char **argv, Coord x, Coord y)
return 0;
if (argc != 1 && argc != 2)
- AFAIL(pan);
+ PCB_AFAIL(pan);
if (argc == 1)
mode = atoi(argv[0]);
else {
mode = atoi(argv[1]);
- Message(PCB_MSG_DEFAULT, _("The gtk gui currently ignores the optional first argument "
+ pcb_message(PCB_MSG_WARNING, _("The gtk gui currently ignores the optional first argument "
"to the Pan action.\nFeel free to provide patches.\n"));
}
@@ -1825,24 +1861,24 @@ This just pops up the specified menu. The menu must have been defined
in the popups subtree in the menu lht file.
%end-doc */
-static int Popup(int argc, const char **argv, Coord x, Coord y)
+static int Popup(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
GtkMenu *menu = NULL;
char name[256];
if (argc != 1 && argc != 2)
- AFAIL(popup);
+ PCB_AFAIL(popup);
if (strlen(argv[0]) < sizeof(name)-32) {
lht_node_t *menu_node;
sprintf(name, "/popups/%s", argv[0]);
- menu_node = hid_cfg_get_menu(ghid_cfg, name);
+ menu_node = pcb_hid_cfg_get_menu(ghid_cfg, name);
if (menu_node != NULL)
menu = menu_node->user_data;
}
if (!GTK_IS_MENU(menu)) {
- Message(PCB_MSG_DEFAULT, _("The specified popup menu \"%s\" has not been defined.\n"), argv[0]);
+ pcb_message(PCB_MSG_ERROR, _("The specified popup menu \"%s\" has not been defined.\n"), argv[0]);
return 1;
}
else {
@@ -1865,7 +1901,7 @@ Asks user which schematics to import into PCB.
%end-doc */
-static int ImportGUI(int argc, const char **argv, Coord x, Coord y)
+static int ImportGUI(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
char *name = NULL;
static gchar *current_layout_dir = NULL;
@@ -1885,11 +1921,11 @@ static int ImportGUI(int argc, const char **argv, Coord x, Coord y)
printf("File selected = %s\n", name);
#endif
- AttributePut(PCB, "import::src0", name);
+ pcb_attrib_put(PCB, "import::src0", name);
free(name);
I_am_recursing = 1;
- rv = hid_action("Import");
+ rv = pcb_hid_action("Import");
I_am_recursing = 0;
return rv;
@@ -1900,7 +1936,7 @@ static const char savewingeo_syntax[] = "SaveWindowGeometry()";
static const char savewingeo_help[] = N_("Saves window geometry in the config.\n");
-static int SaveWinGeo(int argc, const char **argv, Coord x, Coord y)
+static int SaveWinGeo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
ghid_wgeo_save(1, 0);
return 0;
@@ -1909,19 +1945,16 @@ static int SaveWinGeo(int argc, const char **argv, Coord x, Coord y)
/* ------------------------------------------------------------ */
-static int Busy(int argc, const char **argv, Coord x, Coord y)
+static void ghid_Busy(void *user_data, int argc, pcb_event_arg_t argv[])
{
ghid_watch_cursor();
- return 0;
}
-HID_Action ghid_main_action_list[] = {
+pcb_hid_action_t ghid_main_action_list[] = {
{"About", 0, About, about_help, about_syntax}
,
{"Benchmark", 0, Benchmark}
,
- {"Busy", 0, Busy}
- ,
{"Center", N_("Click on a location to center"), Center, center_help, center_syntax}
,
{"Command", 0, Command}
@@ -1930,7 +1963,7 @@ HID_Action ghid_main_action_list[] = {
,
{"DoWindows", 0, DoWindows, dowindows_help, dowindows_syntax}
,
- {"Export", 0, Export}
+ {"ExportGUI", 0, ExportGUI}
,
{"GetXY", "", GetXY, getxy_help, getxy_syntax}
,
@@ -1938,16 +1971,10 @@ HID_Action ghid_main_action_list[] = {
,
{"LayerGroupsChanged", 0, LayerGroupsChanged}
,
- {"LibraryChanged", 0, LibraryChanged}
- ,
{"Load", 0, Load}
,
{"Pan", 0, PanAction, pan_help, pan_syntax}
,
- {"PCBChanged", 0, PCBChanged}
- ,
- {"PointCursor", 0, PointCursor}
- ,
{"Popup", 0, Popup, popup_help, popup_syntax}
,
{"Print", 0, Print,
@@ -1956,8 +1983,6 @@ HID_Action ghid_main_action_list[] = {
{"PrintCalibrate", 0, PrintCalibrate,
printcalibrate_help, printcalibrate_syntax}
,
- {"RouteStylesChanged", 0, RouteStylesChanged}
- ,
{"Save", 0, Save, save_help, save_syntax}
,
{"SaveWindowGeometry", 0, SaveWinGeo, savewingeo_help, savewingeo_syntax}
@@ -1971,7 +1996,7 @@ HID_Action ghid_main_action_list[] = {
{"Zoom", N_("Click on zoom focus"), Zoom, zoom_help, zoom_syntax}
};
-REGISTER_ACTIONS(ghid_main_action_list, ghid_cookie)
+PCB_REGISTER_ACTIONS(ghid_main_action_list, ghid_cookie)
#include "dolists.h"
/*
@@ -1984,7 +2009,7 @@ REGISTER_ACTIONS(ghid_main_action_list, ghid_cookie)
#include <winreg.h>
#endif
-HID ghid_hid;
+pcb_hid_t ghid_hid;
static void init_conf_watch(conf_hid_callbacks_t *cbs, const char *path, void (*func)(conf_native_t *))
{
@@ -1998,20 +2023,23 @@ static void init_conf_watch(conf_hid_callbacks_t *cbs, const char *path, void (*
static void ghid_conf_regs()
{
- static conf_hid_callbacks_t cbs_refraction, cbs_direction, cbs_fullscreen;
+ static conf_hid_callbacks_t cbs_refraction, cbs_direction, cbs_fullscreen, cbs_show_sside;
init_conf_watch(&cbs_direction, "editor/all_direction_lines", ghid_confchg_all_direction_lines);
init_conf_watch(&cbs_refraction, "editor/line_refraction", ghid_confchg_line_refraction);
- init_conf_watch(&cbs_fullscreen, "editor/fullscreen", ghid_confchg_fullscreen);
+ init_conf_watch(&cbs_fullscreen, "editor/fullscreen", ghid_confchg_fullscreen);
+ init_conf_watch(&cbs_show_sside, "editor/show_solder_side", ghid_confchg_flip);
}
void hid_hid_gtk_uninit()
{
- event_unbind_allcookie(ghid_cookie);
+ pcb_event_unbind_allcookie(ghid_cookie);
conf_hid_unreg(ghid_cookie);
conf_hid_unreg(ghid_menu_cookie);
}
+void GhidNetlistChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+
pcb_uninit_t hid_hid_gtk_init()
{
#ifdef WIN32
@@ -2042,12 +2070,12 @@ pcb_uninit_t hid_hid_gtk_init()
printf("\"Share\" installation path is \"%s\"\n", "share_dir_todo12");
#endif
- memset(&ghid_hid, 0, sizeof(HID));
+ memset(&ghid_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&ghid_hid);
- common_draw_helpers_init(&ghid_hid);
+ pcb_hid_nogui_init(&ghid_hid);
+ pcb_dhlp_draw_helpers_init(&ghid_hid);
- ghid_hid.struct_size = sizeof(HID);
+ ghid_hid.struct_size = sizeof(pcb_hid_t);
ghid_hid.name = "gtk";
ghid_hid.description = "Gtk - The Gimp Toolkit";
ghid_hid.gui = 1;
@@ -2060,7 +2088,7 @@ pcb_uninit_t hid_hid_gtk_init()
ghid_hid.invalidate_all = ghid_invalidate_all;
ghid_hid.notify_crosshair_change = ghid_notify_crosshair_change;
ghid_hid.notify_mark_change = ghid_notify_mark_change;
- ghid_hid.set_layer = ghid_set_layer;
+ ghid_hid.set_layer_group = ghid_set_layer_group;
ghid_hid.make_gc = ghid_make_gc;
ghid_hid.destroy_gc = ghid_destroy_gc;
ghid_hid.use_mask = ghid_use_mask;
@@ -2098,7 +2126,9 @@ pcb_uninit_t hid_hid_gtk_init()
ghid_hid.show_item = ghid_show_item;
ghid_hid.beep = ghid_beep;
ghid_hid.progress = ghid_progress;
- ghid_hid.drc_gui = &ghid_drc_gui, ghid_hid.edit_attributes = ghid_attributes;
+ ghid_hid.drc_gui = &ghid_drc_gui;
+ ghid_hid.edit_attributes = ghid_attributes;
+ ghid_hid.point_cursor = PointCursor;
ghid_hid.request_debug_draw = ghid_request_debug_draw;
ghid_hid.flush_debug_draw = ghid_flush_debug_draw;
@@ -2123,14 +2153,19 @@ pcb_uninit_t hid_hid_gtk_init()
ghid_hid.usage = ghid_usage;
- hid_register_hid(&ghid_hid);
+ pcb_hid_register_hid(&ghid_hid);
#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \
conf_reg_field(conf_hid_gtk, field,isarray,type_name,cpath,cname,desc,flags);
#include "hid_gtk_conf_fields.h"
- event_bind(EVENT_SAVE_PRE, ghid_conf_save_pre_wgeo, NULL, ghid_cookie);
- event_bind(EVENT_LOAD_POST, ghid_conf_load_post_wgeo, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_SAVE_PRE, ghid_conf_save_pre_wgeo, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_LOAD_POST, ghid_conf_load_post_wgeo, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_BOARD_CHANGED, ev_pcb_changed, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_NETLIST_CHANGED, GhidNetlistChanged, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_ROUTE_STYLES_CHANGED, RouteStylesChanged, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_LAYERS_CHANGED, ghid_LayersChanged, NULL, ghid_cookie);
+ pcb_event_bind(PCB_EVENT_BUSY, ghid_Busy, NULL, ghid_cookie);
return hid_hid_gtk_uninit;
}
@@ -2139,17 +2174,17 @@ int gtkhid_active = 0;
void gtkhid_begin(void)
{
- REGISTER_ACTIONS(ghid_main_action_list, ghid_cookie)
- REGISTER_ACTIONS(ghid_netlist_action_list, ghid_cookie)
- REGISTER_ACTIONS(ghid_log_action_list, ghid_cookie)
- REGISTER_ACTIONS(gtk_topwindow_action_list, ghid_cookie)
- REGISTER_ACTIONS(ghid_menu_action_list, ghid_cookie)
+ PCB_REGISTER_ACTIONS(ghid_main_action_list, ghid_cookie)
+ PCB_REGISTER_ACTIONS(ghid_netlist_action_list, ghid_cookie)
+ PCB_REGISTER_ACTIONS(ghid_log_action_list, ghid_cookie)
+ PCB_REGISTER_ACTIONS(gtk_topwindow_action_list, ghid_cookie)
+ PCB_REGISTER_ACTIONS(ghid_menu_action_list, ghid_cookie)
gtkhid_active = 1;
}
void gtkhid_end(void)
{
- hid_remove_actions_by_cookie(ghid_cookie);
- hid_remove_attributes_by_cookie(ghid_cookie);
+ pcb_hid_remove_actions_by_cookie(ghid_cookie);
+ pcb_hid_remove_attributes_by_cookie(ghid_cookie);
gtkhid_active = 0;
}
diff --git a/src_plugins/hid_gtk/gui-command-window.c b/src_plugins/hid_gtk/gui-command-window.c
index 94adf28..2acb926 100644
--- a/src_plugins/hid_gtk/gui-command-window.c
+++ b/src_plugins/hid_gtk/gui-command-window.c
@@ -35,6 +35,7 @@
#include "crosshair.h"
#include "hid_actions.h"
#include "hid_gtk_conf.h"
+#include "compat_nls.h"
static GtkWidget *command_window;
static GtkWidget *combo_vbox;
@@ -192,7 +193,7 @@ static void command_entry_activate_cb(GtkWidget * widget, gpointer data)
command_history_add(command);
if (conf_hid_gtk.plugins.hid_gtk.use_command_window) {
- hid_parse_command(command);
+ pcb_hid_parse_command(command);
g_free(command);
}
else {
@@ -417,12 +418,12 @@ void ghid_handle_user_command(gboolean raise)
/* copy new comand line to save buffer */
g_free(previous);
previous = g_strdup(command);
- hid_parse_command(command);
+ pcb_hid_parse_command(command);
g_free(command);
}
else if (previous) {
command = g_strdup(previous);
- hid_parse_command(command);
+ pcb_hid_parse_command(command);
g_free(command);
}
}
diff --git a/src_plugins/hid_gtk/gui-config.c b/src_plugins/hid_gtk/gui-config.c
index 4134e60..10f5afd 100644
--- a/src_plugins/hid_gtk/gui-config.c
+++ b/src_plugins/hid_gtk/gui-config.c
@@ -34,15 +34,12 @@
#include "hid.h"
#include "gtkhid.h"
-#include "global.h"
#include "action_helper.h"
#include "change.h"
#include "plug_io.h"
#include "error.h"
#include "draw.h"
-#include "misc.h"
#include "pcb-printf.h"
-#include "set.h"
#include "hid_attrib.h"
#include "conf.h"
#include "misc_util.h"
@@ -51,6 +48,7 @@
#include "paths.h"
#include "plug_footprint.h"
#include "compat_misc.h"
+#include "compat_nls.h"
#include "fptr_cast.h"
#include <liblihata/tree.h>
@@ -58,7 +56,7 @@
#include <locale.h>
#endif
-extern int MoveLayerAction(int argc, char **argv, int x, int y);
+extern int pcb_act_MoveLayer(int argc, char **argv, int x, int y);
conf_hid_gtk_t conf_hid_gtk;
window_geometry_t hid_gtk_wgeo, hid_gtk_wgeo_old;
@@ -142,7 +140,7 @@ static void wgeo_save_direct(GtkButton *widget, const char *ctx)
/* event handler that runs before the current pcb is saved - save win geo
in the corresponding lihata trees if the checkbox is selected. */
-void ghid_conf_save_pre_wgeo(void *user_data, int argc, event_arg_t * argv[])
+void ghid_conf_save_pre_wgeo(void *user_data, int argc, pcb_event_arg_t argv[])
{
ghid_wgeo_save(1, 1);
}
@@ -169,7 +167,7 @@ static int just_loaded(const char *path)
wplc_place(id, NULL); \
}
-void ghid_conf_load_post_wgeo(void *user_data, int argc, event_arg_t * argv[])
+void ghid_conf_load_post_wgeo(void *user_data, int argc, pcb_event_arg_t argv[])
{
did_just_load_geo(top, WPLC_TOP);
did_just_load_geo(log, WPLC_LOG);
@@ -253,7 +251,7 @@ void config_any_replace(save_ctx_t *ctx, const char **paths)
conf_fields_foreach(e) {
if (strncmp(e->key, wildp, pl) == 0) {
if (conf_replace_subtree(ctx->dst_role, e->key, ctx->src_role, e->key) != 0)
- Message(PCB_MSG_DEFAULT, "Error: failed to save config item %s\n", *p);
+ pcb_message(PCB_MSG_ERROR, "Error: failed to save config item %s\n", *p);
if (ctx->dst_role < CFR_max_real) {
conf_update(e->key);
need_update++;
@@ -264,7 +262,7 @@ void config_any_replace(save_ctx_t *ctx, const char **paths)
else {
/* plain node */
if (conf_replace_subtree(ctx->dst_role, *p, ctx->src_role, *p) != 0)
- Message(PCB_MSG_DEFAULT, "Error: failed to save config item %s\n", *p);
+ pcb_message(PCB_MSG_ERROR, "Error: failed to save config item %s\n", *p);
if (ctx->dst_role < CFR_max_real) {
conf_update(*p);
need_update++;
@@ -432,7 +430,7 @@ static void config_backup_spin_button_cb(GtkSpinButton * spin_button, gpointer d
i = gtk_spin_button_get_value_as_int(spin_button);
sprintf(s, "%d", i);
conf_set(CFR_DESIGN, "rc/backup_interval", -1, s, POL_OVERWRITE);
- EnableAutosave();
+ pcb_enable_autosave();
}
static void config_history_spin_button_cb(GtkSpinButton * spin_button, gpointer data)
@@ -509,7 +507,7 @@ static void config_general_tab_create(GtkWidget * tab_vbox)
*/
static GtkWidget *config_sizes_vbox, *config_sizes_tab_vbox, *config_text_spin_button;
-static Coord new_board_width, new_board_height;
+static pcb_coord_t new_board_width, new_board_height;
static void config_sizes_apply(void)
{
@@ -525,7 +523,7 @@ static void config_sizes_apply(void)
conf_set_design("design/min_ring", "%$mS", PCB->minRing);
if (PCB->MaxWidth != conf_core.design.max_width || PCB->MaxHeight != conf_core.design.max_height)
- ChangePCBSize(conf_core.design.max_width, conf_core.design.max_height);
+ pcb_board_resize(conf_core.design.max_width, conf_core.design.max_height);
}
static void text_spin_button_cb(GtkSpinButton * spin, void *dst)
@@ -536,7 +534,7 @@ static void text_spin_button_cb(GtkSpinButton * spin, void *dst)
static void coord_entry_cb(GHidCoordEntry * ce, void *dst)
{
- *(Coord *) dst = ghid_coord_entry_get_value(ce);
+ *(pcb_coord_t *) dst = ghid_coord_entry_get_value(ce);
}
void config_sizes_save(GtkButton *widget, save_ctx_t *ctx)
@@ -590,10 +588,10 @@ static void config_sizes_tab_create(GtkWidget * tab_vbox)
new_board_width = PCB->MaxWidth;
new_board_height = PCB->MaxHeight;
ghid_table_coord_entry(table, 0, 0, NULL,
- PCB->MaxWidth, MIN_SIZE, MAX_COORD, CE_LARGE, 0, coord_entry_cb, &new_board_width, FALSE, _("Width"));
+ PCB->MaxWidth, PCB_MIN_SIZE, PCB_MAX_COORD, CE_LARGE, 0, coord_entry_cb, &new_board_width, FALSE, _("Width"));
ghid_table_coord_entry(table, 1, 0, NULL,
- PCB->MaxHeight, MIN_SIZE, MAX_COORD,
+ PCB->MaxHeight, PCB_MIN_SIZE, PCB_MAX_COORD,
CE_LARGE, 0, coord_entry_cb, &new_board_height, FALSE, _("Height"));
/* ---- Text Scale ---- */
@@ -606,7 +604,7 @@ static void config_sizes_tab_create(GtkWidget * tab_vbox)
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
ghid_table_spin_button(table, 0, 0, &config_text_spin_button,
conf_core.design.text_scale,
- MIN_TEXTSCALE, MAX_TEXTSCALE, 10.0, 10.0, 0, 0, text_spin_button_cb, NULL, FALSE, "%");
+ PCB_MIN_TEXTSCALE, PCB_MAX_TEXTSCALE, 10.0, 10.0, 0, 0, text_spin_button_cb, NULL, FALSE, "%");
/* ---- DRC Sizes ---- */
@@ -619,27 +617,27 @@ static void config_sizes_tab_create(GtkWidget * tab_vbox)
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
ghid_table_coord_entry(table, 0, 0, NULL,
- PCB->Bloat, MIN_DRC_VALUE, MAX_DRC_VALUE,
+ PCB->Bloat, PCB_MIN_DRC_VALUE, PCB_MAX_DRC_VALUE,
CE_SMALL, 0, coord_entry_cb, &PCB->Bloat, FALSE, _("Minimum copper spacing"));
ghid_table_coord_entry(table, 1, 0, NULL,
- PCB->minWid, MIN_DRC_VALUE, MAX_DRC_VALUE,
+ PCB->minWid, PCB_MIN_DRC_VALUE, PCB_MAX_DRC_VALUE,
CE_SMALL, 0, coord_entry_cb, &PCB->minWid, FALSE, _("Minimum copper width"));
ghid_table_coord_entry(table, 2, 0, NULL,
- PCB->Shrink, MIN_DRC_VALUE, MAX_DRC_VALUE,
+ PCB->Shrink, PCB_MIN_DRC_VALUE, PCB_MAX_DRC_VALUE,
CE_SMALL, 0, coord_entry_cb, &PCB->Shrink, FALSE, _("Minimum touching copper overlap"));
ghid_table_coord_entry(table, 3, 0, NULL,
- PCB->minSlk, MIN_DRC_VALUE, MAX_DRC_VALUE,
+ PCB->minSlk, PCB_MIN_DRC_VALUE, PCB_MAX_DRC_VALUE,
CE_SMALL, 0, coord_entry_cb, &PCB->minSlk, FALSE, _("Minimum silk width"));
ghid_table_coord_entry(table, 4, 0, NULL,
- PCB->minDrill, MIN_DRC_VALUE, MAX_DRC_VALUE,
+ PCB->minDrill, PCB_MIN_DRC_VALUE, PCB_MAX_DRC_VALUE,
CE_SMALL, 0, coord_entry_cb, &PCB->minDrill, FALSE, _("Minimum drill diameter"));
ghid_table_coord_entry(table, 5, 0, NULL,
- PCB->minRing, MIN_DRC_VALUE, MAX_DRC_VALUE,
+ PCB->minRing, PCB_MIN_DRC_VALUE, PCB_MAX_DRC_VALUE,
CE_SMALL, 0, coord_entry_cb, &PCB->minRing, FALSE, _("Minimum annular ring"));
vbox = gtk_vbox_new(TRUE, 0);
@@ -754,14 +752,14 @@ GtkWidget *config_increments_tbl[4][4]; /* [col][row] */
static GtkWidget *config_increments_vbox = NULL, *config_increments_tab_vbox = NULL;
-static void increment_tbl_update_cell(GtkLabel *lab, Coord val, const char *fmt)
+static void increment_tbl_update_cell(GtkLabel *lab, pcb_coord_t val, const char *fmt)
{
char s[128];
pcb_snprintf(s, sizeof(s), fmt, val);
gtk_label_set_text(lab, s);
}
-static void increment_tbl_update_row(int row, Coord edit_in_mm, Coord edit_in_mil)
+static void increment_tbl_update_row(int row, pcb_coord_t edit_in_mm, pcb_coord_t edit_in_mil)
{
increment_tbl_update_cell(GTK_LABEL(config_increments_tbl[0][row]), edit_in_mm, "%$mm");
increment_tbl_update_cell(GTK_LABEL(config_increments_tbl[1][row]), edit_in_mil, "%$mm");
@@ -780,7 +778,7 @@ static void increment_tbl_update()
static void increment_spin_button_cb(GHidCoordEntry * ce, void *dst)
{
const char *path = dst;
- conf_setf(CFR_DESIGN, path, -1, "%mr", (Coord)ghid_coord_entry_get_value(ce));
+ conf_setf(CFR_DESIGN, path, -1, "%mr", (pcb_coord_t)ghid_coord_entry_get_value(ce));
increment_tbl_update();
}
@@ -790,8 +788,8 @@ static void config_increments_sect_create(GtkWidget * vbox)
const int width = 128;
char pathmm[256], *pemm;
char pathmil[256], *pemil;
- const Unit *umm = get_unit_struct("mm");
- const Unit *umil = get_unit_struct("mil");
+ const pcb_unit_t *umm = get_unit_struct("mm");
+ const pcb_unit_t *umil = get_unit_struct("mil");
const char *base_pathmm = "editor/increments_mm";
const char *base_pathmil = "editor/increments_mil";
int lmm = strlen(base_pathmm);
@@ -999,14 +997,14 @@ static gtk_conf_list_t library_cl;
static void config_library_apply(void)
{
- fp_rehash();
+ pcb_fp_rehash();
}
static char *get_misc_col_data(int row, int col, lht_node_t *nd)
{
if ((nd != NULL) && (col == 1)) {
char *out;
- resolve_path(nd->data.text.value, &out, 0);
+ pcb_path_resolve(nd->data.text.value, &out, 0);
return out;
}
return NULL;
@@ -1077,7 +1075,7 @@ static void pre_rebuild(gtk_conf_list_t *cl)
lht_node_t *m;
lht_clean_list(config_library_lst);
- m = conf_lht_get_first(CFR_DESIGN);
+ m = conf_lht_get_first(CFR_DESIGN, 0);
cl->lst = lht_tree_path_(m->doc, m, "rc/library_search_paths", 1, 0, NULL);
if (cl->lst == NULL) {
@@ -1185,12 +1183,12 @@ static void config_library_tab_create(GtkWidget * tab_vbox)
*/
static GtkWidget *config_groups_table, *config_groups_vbox, *config_groups_window;
-static GtkWidget *layer_entry[MAX_LAYER];
-static GtkWidget *group_button[MAX_LAYER + 2][MAX_LAYER];
+static GtkWidget *layer_entry[PCB_MAX_LAYER];
+static GtkWidget *group_button[PCB_MAX_LAYERGRP + 2][PCB_MAX_LAYER];
-static gint config_layer_group[MAX_LAYER + 2];
+static gint config_layer_group[PCB_MAX_LAYERGRP + 2];
-static LayerGroupType layer_groups, /* Working copy */
+static pcb_layer_group_t layer_groups, /* Working copy */
*lg_monitor; /* Keep track if our working copy */
/* needs to be changed (new layout) */
@@ -1261,21 +1259,21 @@ static void config_layer_groups_radio_button_cb(GtkToggleButton * button, gpoint
/* Construct a layer group string. Follow logic in WritePCBDataHeader(),
| but use g_string functions.
*/
-static gchar *make_layer_group_string(LayerGroupType * lg)
+static gchar *make_layer_group_string(pcb_layer_group_t * lg)
{
GString *string;
gint group, entry, layer;
string = g_string_new("");
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
if (lg->Number[group] == 0)
continue;
for (entry = 0; entry < lg->Number[group]; entry++) {
layer = lg->Entries[group][entry];
- if (layer == component_silk_layer)
+ if (layer == pcb_component_silk_layer)
string = g_string_append(string, "c");
- else if (layer == solder_silk_layer)
+ else if (layer == pcb_solder_silk_layer)
string = g_string_append(string, "s");
else
g_string_append_printf(string, "%d", layer + 1);
@@ -1283,7 +1281,7 @@ static gchar *make_layer_group_string(LayerGroupType * lg)
if (entry != lg->Number[group] - 1)
string = g_string_append(string, ",");
}
- if (group != max_group - 1)
+ if (group != pcb_max_group - 1)
string = g_string_append(string, ":");
}
return g_string_free(string, FALSE); /* Don't free string->str */
@@ -1291,7 +1289,7 @@ static gchar *make_layer_group_string(LayerGroupType * lg)
static void config_layers_apply(void)
{
- LayerType *layer;
+ pcb_layer_t *layer;
const gchar *s;
gint group, i;
gint componentgroup = 0, soldergroup = 0;
@@ -1300,7 +1298,7 @@ static void config_layers_apply(void)
/* Get each layer name entry and dup if modified into the PCB layer names
| and, if to use as default, the Settings layer names.
*/
- for (i = 0; i < max_copper_layer; ++i) {
+ for (i = 0; i < pcb_max_copper_layer; ++i) {
layer = &PCB->Data->Layer[i];
s = ghid_entry_get_text(layer_entry[i]);
if (dup_string((char**)&layer->Name, s))
@@ -1317,16 +1315,16 @@ static void config_layers_apply(void)
if (groups_modified) { /* If any group radio buttons were toggled. */
/* clear all entries and read layer by layer
*/
- for (group = 0; group < max_group; group++)
+ for (group = 0; group < pcb_max_group; group++)
layer_groups.Number[group] = 0;
- for (i = 0; i < max_copper_layer + 2; i++) {
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
group = config_layer_group[i] - 1;
layer_groups.Entries[group][layer_groups.Number[group]++] = i;
- if (i == component_silk_layer)
+ if (i == pcb_component_silk_layer)
componentgroup = group;
- else if (i == solder_silk_layer)
+ else if (i == pcb_solder_silk_layer)
soldergroup = group;
}
@@ -1335,11 +1333,11 @@ static void config_layers_apply(void)
| solder-side and component-side must not be the only one in the group
*/
if (layer_groups.Number[soldergroup] <= 1 || layer_groups.Number[componentgroup] <= 1) {
- Message(PCB_MSG_DEFAULT, _("Both 'solder side' or 'component side' layers must have at least\n" "\tone other layer in their group.\n"));
+ pcb_message(PCB_MSG_ERROR, _("Both 'solder side' or 'component side' layers must have at least\n" "\tone other layer in their group.\n"));
return;
}
else if (soldergroup == componentgroup) {
- Message(PCB_MSG_DEFAULT, _("The 'solder side' and 'component side' layers are not allowed\n" "\tto be in the same layer group #\n"));
+ pcb_message(PCB_MSG_ERROR, _("The 'solder side' and 'component side' layers are not allowed\n" "\tto be in the same layer group #\n"));
return;
}
PCB->LayerGroups = layer_groups;
@@ -1355,7 +1353,7 @@ static void config_layer_group_button_state_update(void)
/* Set button active corresponding to layer group state.
*/
groups_holdoff = TRUE;
- for (g = 0; g < max_group; g++)
+ for (g = 0; g < pcb_max_group; g++)
for (i = 0; i < layer_groups.Number[g]; i++) {
/* printf("layer %d in group %d\n", layer_groups.Entries[g][i], g +1); */
config_layer_group[layer_groups.Entries[g][i]] = g + 1;
@@ -1367,7 +1365,7 @@ static void config_layer_group_button_state_update(void)
static void layer_name_entry_cb(GtkWidget * entry, gpointer data)
{
gint i = GPOINTER_TO_INT(data);
- LayerType *layer;
+ pcb_layer_t *layer;
const gchar *name;
layer = &PCB->Data->Layer[i];
@@ -1394,14 +1392,14 @@ void ghid_config_groups_changed(void)
gtk_widget_destroy(config_groups_window);
config_groups_window = scrolled_window = gtk_scrolled_window_new(NULL, NULL);
- gtk_widget_set_size_request(scrolled_window, (max_group + 1)*34, 300);
+ gtk_widget_set_size_request(scrolled_window, (pcb_max_group + 1)*34, 300);
gtk_container_set_border_width(GTK_CONTAINER(scrolled_window), 3);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
gtk_widget_show(scrolled_window);
- table = gtk_table_new(max_copper_layer + 3, max_group + 1, FALSE);
+ table = gtk_table_new(pcb_max_copper_layer + 3, pcb_max_group + 1, FALSE);
config_groups_table = table;
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), table);
@@ -1414,7 +1412,7 @@ void ghid_config_groups_changed(void)
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
- for (i = 1; i < max_group + 1; ++i) {
+ for (i = 1; i < pcb_max_group + 1; ++i) {
pcb_snprintf(buf, sizeof(buf), "% 3d", i);
label = gtk_label_new(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
@@ -1424,15 +1422,15 @@ void ghid_config_groups_changed(void)
/* Create a row of radio toggle buttons for layer. So each layer
| can have an active radio button set for the group it needs to be in.
*/
- for (layer = 0; layer < max_copper_layer + 2; ++layer) {
- if (layer == component_silk_layer)
+ for (layer = 0; layer < pcb_max_copper_layer + 2; ++layer) {
+ if (layer == pcb_component_silk_layer)
name = _("component side");
- else if (layer == solder_silk_layer)
+ else if (layer == pcb_solder_silk_layer)
name = _("solder side");
else
- name = (gchar *) UNKNOWN(PCB->Data->Layer[layer].Name);
+ name = (gchar *) PCB_UNKNOWN(PCB->Data->Layer[layer].Name);
- if (layer >= max_copper_layer) {
+ if (layer >= pcb_max_copper_layer) {
label = gtk_label_new(name);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, layer + 1, layer + 2);
@@ -1445,7 +1443,7 @@ void ghid_config_groups_changed(void)
}
group = NULL;
- for (i = 0; i < max_group; ++i) {
+ for (i = 0; i < pcb_max_group; ++i) {
button = gtk_radio_button_new(group);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
@@ -1468,14 +1466,14 @@ static void edit_layer_button_cb(GtkWidget * widget, gchar * data)
return;
argv = g_strsplit(data, ",", -1);
- MoveLayerAction(2, argv, 0, 0);
+ pcb_act_MoveLayer(2, argv, 0, 0);
g_strfreev(argv);
}
void config_layers_save(GtkButton *widget, save_ctx_t *ctx)
{
gchar *s;
- int n;
+ pcb_cardinal_t n;
const char *paths[] = {
"design/groups",
"design/default_layer_name",
@@ -1487,8 +1485,8 @@ void config_layers_save(GtkButton *widget, save_ctx_t *ctx)
s = make_layer_group_string(&PCB->LayerGroups);
/* change default layer names to the current ones in dest */
- for (n = 0; n < max_copper_layer; n++) {
- LayerType *layer;
+ for (n = 0; n < pcb_max_copper_layer; n++) {
+ pcb_layer_t *layer;
char lnp[128];
lht_node_t *nd;
sprintf(lnp, "design/default_layer_name[%d]", n);
@@ -2185,7 +2183,7 @@ static void config_auto_src_show(lht_node_t *nd)
break;
case CFN_COORD:
{
- Coord coord = 0;
+ pcb_coord_t coord = 0;
citem.coord = &coord;
conf_parse_text(&citem, 0, nat->type, nd->data.text.value, nd);
ghid_coord_entry_set_value(GHID_COORD_ENTRY(auto_tab_widgets.edit_coord), coord);
@@ -2226,7 +2224,7 @@ static void config_auto_src_show(lht_node_t *nd)
break;
case CFN_UNIT:
{
- const Unit *u = NULL;
+ const pcb_unit_t *u = NULL;
citem.unit = &u;
conf_parse_text(&citem, 0, nat->type, nd->data.text.value, nd);
if (citem.unit[0] == NULL)
@@ -2310,6 +2308,8 @@ static conf_role_t config_auto_get_edited_role(void)
int role = CFR_invalid;
gtk_tree_view_get_cursor(GTK_TREE_VIEW(auto_tab_widgets.src_t), &p, NULL);
+ if (p == NULL)
+ return CFR_invalid;
i = gtk_tree_path_get_indices(p);
if (i != NULL)
role = i[0];
@@ -2428,7 +2428,7 @@ static void config_auto_save(conf_role_t role)
FILE *f;
f = fopen(try, "w");
if (f == NULL) {
- Message(PCB_MSG_ERROR, "can not create config to project file: %s\n", try);
+ pcb_message(PCB_MSG_ERROR, "can not create config to project file: %s\n", try);
return;
}
fclose(f);
@@ -2534,7 +2534,7 @@ static void config_auto_remove_cb(GtkButton *btn, void *data)
conf_role_t role = config_auto_get_edited_role();
if (nat->array_size > 1) {
- Message(PCB_MSG_ERROR, "Can't create remove array %s\n", nat->hash_path);
+ pcb_message(PCB_MSG_ERROR, "Can't create remove array %s\n", nat->hash_path);
return;
}
@@ -2719,13 +2719,13 @@ static void config_tree_auto(GtkTreeStore *model, GtkTreeIter *main_parent)
char *basename;
e = sorted[n];
if (strlen(e->key) > sizeof(path)-1) {
- Message(PCB_MSG_DEFAULT, "Warning: can't create config item for %s: path too long\n", e->key);
+ pcb_message(PCB_MSG_WARNING, "Warning: can't create config item for %s: path too long\n", e->key);
continue;
}
strcpy(path, e->key);
basename = strrchr(path, '/');
if ((basename == NULL) || (basename == path)) {
- Message(PCB_MSG_DEFAULT, "Warning: can't create config item for %s: invalid path\n", e->key);
+ pcb_message(PCB_MSG_WARNING, "Warning: can't create config item for %s: invalid path\n", e->key);
continue;
}
*basename = '\0';
@@ -2781,7 +2781,7 @@ void ghid_config_window_show(void)
/* build the tree */
model = gtk_tree_store_new(N_CONFIG_COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER);
- config_tree_sect(model, NULL, &user_pov, _("User PoV"), _("\n<b>User PoV</b>\nA subset of configuration settings regroupped,\npresented in the User's Point of View."));
+ config_tree_sect(model, NULL, &user_pov, _("User PoV"), _("\n<b>User PoV</b>\nA subset of configuration settings regrouped,\npresented in the User's Point of View."));
config_tree_sect(model, NULL, &config_pov, _("Config PoV"), _("\n<b>Config PoV</b>\nAccess all configuration fields presented in\na tree that matches the configuration\nfile (lht) structure."));
config_tree_leaf(model, &user_pov, _("General"), config_general_tab_create);
diff --git a/src_plugins/hid_gtk/gui-dialog-print.c b/src_plugins/hid_gtk/gui-dialog-print.c
index 71323d6..8498358 100644
--- a/src_plugins/hid_gtk/gui-dialog-print.c
+++ b/src_plugins/hid_gtk/gui-dialog-print.c
@@ -36,6 +36,7 @@
#include "hid_init.h"
#include "misc_util.h"
#include "compat_misc.h"
+#include "compat_nls.h"
static GtkWidget *export_dialog = NULL;
@@ -52,10 +53,10 @@ static void intspinner_changed_cb(GtkSpinButton * spin_button, gpointer data)
*ival = gtk_spin_button_get_value(GTK_SPIN_BUTTON((GtkWidget *) spin_button));
}
-static void coordentry_changed_cb(GtkEntry * entry, Coord * res)
+static void coordentry_changed_cb(GtkEntry * entry, pcb_coord_t * res)
{
const gchar *s = gtk_entry_get_text(entry);
- *res = GetValue(s, NULL, NULL, NULL);
+ *res = pcb_get_value(s, NULL, NULL, NULL);
}
static void dblspinner_changed_cb(GtkSpinButton * spin_button, gpointer data)
@@ -86,7 +87,7 @@ static void enum_changed_cb(GtkWidget * combo_box, int *val)
}
-int ghid_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * results, const char *title, const char *descr)
+int ghid_attribute_dialog(pcb_hid_attribute_t * attrs, int n_attrs, pcb_hid_attr_val_t * results, const char *title, const char *descr)
{
GtkWidget *dialog;
GtkWidget *content_area;
@@ -119,7 +120,7 @@ int ghid_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * res
* reflected in this dialog box.
*/
for (j = 0; j < n_attrs; j++) {
- const Unit *unit_list;
+ const pcb_unit_t *unit_list;
if (attrs[j].help_text == ATTR_UNDOCUMENTED)
continue;
switch (attrs[j].type) {
@@ -259,7 +260,7 @@ int ghid_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * res
case HID_Unit:
unit_list = get_unit_list();
- n = get_n_units();
+ n = pcb_get_n_units();
hbox = gtk_hbox_new(FALSE, 4);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@@ -307,39 +308,39 @@ int ghid_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * res
-static void exporter_clicked_cb(GtkButton * button, HID * exporter)
+static void exporter_clicked_cb(GtkButton * button, pcb_hid_t * exporter)
{
ghid_dialog_print(exporter);
}
-void ghid_dialog_print(HID * hid)
+void ghid_dialog_print(pcb_hid_t * hid)
{
- HID_Attribute *attr;
+ pcb_hid_attribute_t *attr;
int n = 0;
int i;
- HID_Attr_Val *results = NULL;
+ pcb_hid_attr_val_t *results = NULL;
/* signal the initial export select dialog that it should close */
if (export_dialog)
gtk_dialog_response(GTK_DIALOG(export_dialog), GTK_RESPONSE_CANCEL);
- exporter = hid;
+ pcb_exporter = hid;
- attr = exporter->get_export_options(&n);
+ attr = pcb_exporter->get_export_options(&n);
if (n > 0) {
- results = (HID_Attr_Val *) malloc(n * sizeof(HID_Attr_Val));
+ results = (pcb_hid_attr_val_t *) malloc(n * sizeof(pcb_hid_attr_val_t));
if (results == NULL) {
fprintf(stderr, "ghid_dialog_print() -- malloc failed\n");
exit(1);
}
/* non-zero means cancel was picked */
- if (ghid_attribute_dialog(attr, n, results, _("PCB Print Layout"), exporter->description))
+ if (ghid_attribute_dialog(attr, n, results, _("PCB Print Layout"), pcb_exporter->description))
return;
}
- exporter->do_export(results);
+ pcb_exporter->do_export(results);
for (i = 0; i < n; i++) {
if (results[i].str_value)
@@ -349,7 +350,7 @@ void ghid_dialog_print(HID * hid)
if (results)
free(results);
- exporter = NULL;
+ pcb_exporter = NULL;
}
void ghid_dialog_export(void)
@@ -358,7 +359,7 @@ void ghid_dialog_export(void)
GtkWidget *vbox, *button;
GHidPort *out = &ghid_port;
int i;
- HID **hids;
+ pcb_hid_t **hids;
gboolean no_exporter = TRUE;
export_dialog = gtk_dialog_new_with_buttons(_("PCB Export Layout"),
@@ -382,7 +383,7 @@ void ghid_dialog_export(void)
* reflected in this dialog box.
*/
- hids = hid_enumerate();
+ hids = pcb_hid_enumerate();
for (i = 0; hids[i]; i++) {
if (hids[i]->exporter) {
no_exporter = FALSE;
diff --git a/src_plugins/hid_gtk/gui-dialog.c b/src_plugins/hid_gtk/gui-dialog.c
index e4b1a90..023b321 100644
--- a/src_plugins/hid_gtk/gui-dialog.c
+++ b/src_plugins/hid_gtk/gui-dialog.c
@@ -29,6 +29,9 @@
#include "config.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "build_run.h"
+#include "plug_io.h"
#include "data.h"
#include "gui.h"
@@ -86,7 +89,7 @@ void ghid_dialog_about(void)
dialog = gtk_message_dialog_new(GTK_WINDOW(out->top_window),
(GtkDialogFlags) (GTK_DIALOG_MODAL
| GTK_DIALOG_DESTROY_WITH_PARENT),
- GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", GetInfoString());
+ GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", pcb_get_infostr());
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -232,7 +235,7 @@ gchar *ghid_dialog_file_select_open(const gchar * title, gchar ** path, const gc
GtkWidget *dialog;
gchar *result = NULL, *folder, *seed;
GHidPort *out = &ghid_port;
- GtkFileFilter *no_filter;
+ GtkFileFilter *no_filter, *any_filter;
dialog = gtk_file_chooser_dialog_new(title,
GTK_WINDOW(out->top_window),
@@ -248,6 +251,11 @@ gchar *ghid_dialog_file_select_open(const gchar * title, gchar ** path, const gc
gtk_file_filter_add_pattern(no_filter, "*");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), no_filter);
+ any_filter = gtk_file_filter_new();
+ gtk_file_filter_set_name(any_filter, "any known format");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), any_filter);
+
+
/* in case we have a dialog for loading a footprint file */
if (strcmp(title, _("Load element to buffer")) == 0) {
/* add a filter for footprint files */
@@ -264,13 +272,39 @@ gchar *ghid_dialog_file_select_open(const gchar * title, gchar ** path, const gc
if ((strcmp(title, _("Load layout file")) == 0)
|| (strcmp(title, _("Load layout file to buffer")) == 0)) {
/* add a filter for layout files */
- GtkFileFilter *pcb_filter;
- pcb_filter = gtk_file_filter_new();
- gtk_file_filter_set_name(pcb_filter, "pcb");
- gtk_file_filter_add_mime_type(pcb_filter, "application/x-pcb-layout");
- gtk_file_filter_add_pattern(pcb_filter, "*.pcb");
- gtk_file_filter_add_pattern(pcb_filter, "*.PCB");
- gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), pcb_filter);
+ pcb_io_formats_t fmts;
+ int n, num_fmts = pcb_io_list(&fmts, PCB_IOT_PCB, 0, 0, PCB_IOL_EXT_BOARD);
+ for(n = 0; n < num_fmts; n++) {
+ int i;
+ char *ext;
+ GtkFileFilter *filter;
+
+ /* register each short name only once - slow O(N^2), but we don't have too many formats anyway */
+ for(i = 0; i < n; i++)
+ if (strcmp(fmts.plug[n]->default_fmt, fmts.plug[i]->default_fmt) == 0)
+ goto next_fmt;
+
+ filter = gtk_file_filter_new();
+ gtk_file_filter_set_name(filter, fmts.plug[n]->default_fmt);
+ if (fmts.plug[n]->mime_type != NULL) {
+ gtk_file_filter_add_mime_type(filter, fmts.plug[n]->mime_type);
+ gtk_file_filter_add_mime_type(any_filter, fmts.plug[n]->mime_type);
+ }
+ if (fmts.plug[n]->default_extension != NULL) {
+ char *s;
+ ext = pcb_concat("*", fmts.plug[n]->default_extension, NULL);
+ gtk_file_filter_add_pattern(filter, ext);
+ gtk_file_filter_add_pattern(any_filter, ext);
+ for(s = ext; *s != '\0'; s++)
+ *s = toupper(*s);
+ gtk_file_filter_add_pattern(filter, ext);
+ gtk_file_filter_add_pattern(any_filter, ext);
+ free(ext);
+ }
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+ next_fmt:;
+ }
+ pcb_io_list_free(&fmts);
}
/* in case we have a dialog for loading a netlist file */
@@ -312,21 +346,83 @@ gchar *ghid_dialog_file_select_open(const gchar * title, gchar ** path, const gc
return result;
}
+
+/* Callback to change the file name in the "save as" dialog according to
+ format selection */
+typedef struct {
+ GtkWidget *dialog;
+ const char **formats, **extensions;
+} ghid_save_ctx_t;
+
+static void fmt_changed_cb(GtkWidget *combo_box, ghid_save_ctx_t *ctx)
+{
+ char *fn, *s, *bn;
+ const char *ext;
+ gint active;
+
+ if (ctx->extensions == NULL)
+ return;
+
+ active = gtk_combo_box_get_active(GTK_COMBO_BOX(combo_box));
+ if (active < 0)
+ return;
+
+ fn = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(ctx->dialog));
+ if (fn == NULL)
+ return;
+
+ /* find and truncate extension */
+ for(s = fn+strlen(fn)-1; *s != '.'; s--) {
+ if ((s <= fn) || (*s == '/') || (*s == '\\')) {
+ g_free(fn);
+ return;
+ }
+ }
+ *s = '\0';
+
+ /* calculate basename in bn */
+ bn = strrchr(fn, '/');
+ if (bn == NULL) {
+ bn = strrchr(fn, '\\');
+ if (bn == NULL)
+ bn = fn;
+ else
+ bn++;
+ }
+ else
+ bn++;
+
+ /* fetch the desired extension */
+ ext = ctx->extensions[active];
+ if (ext == NULL)
+ ext = ".";
+
+ /* build a new file name with the right extension */
+ s = pcb_concat(bn, ext, NULL);
+ gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(ctx->dialog), s);
+
+ free(s);
+ g_free(fn);
+}
+
/* ---------------------------------------------- */
/* Caller must g_free() the returned filename. */
-gchar *ghid_dialog_file_select_save(const gchar * title, gchar ** path, const gchar * file, const gchar * shortcuts, const char **formats, int *format)
+gchar *ghid_dialog_file_select_save(const gchar * title, gchar ** path, const gchar * file, const gchar * shortcuts, const char **formats, const char **extensions, int *format)
{
- GtkWidget *dialog, *fmt, *tmp, *fmt_combo;
+ GtkWidget *fmt, *tmp, *fmt_combo;
gchar *result = NULL, *folder, *seed;
GHidPort *out = &ghid_port;
+ ghid_save_ctx_t ctx;
- dialog = gtk_file_chooser_dialog_new(title,
+ ctx.formats = formats;
+ ctx.extensions = extensions;
+ ctx.dialog = gtk_file_chooser_dialog_new(title,
GTK_WINDOW(out->top_window),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
- gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE);
- gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(ctx.dialog), TRUE);
+ gtk_dialog_set_default_response(GTK_DIALOG(ctx.dialog), GTK_RESPONSE_OK);
/* Create and add the file format widget */
if (format != NULL) {
@@ -346,31 +442,32 @@ gchar *ghid_dialog_file_select_save(const gchar * title, gchar ** path, const gc
gtk_combo_box_append_text(GTK_COMBO_BOX(fmt_combo), *s);
gtk_combo_box_set_active(GTK_COMBO_BOX(fmt_combo), *format);
+ g_signal_connect(G_OBJECT(fmt_combo), "changed", G_CALLBACK(fmt_changed_cb), &ctx);
gtk_widget_show_all(fmt);
- gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), fmt);
+ gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(ctx.dialog), fmt);
}
if (path && *path && **path)
- gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), *path);
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ctx.dialog), *path);
if (file && *file) {
- gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), g_path_get_basename(file));
- gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), g_path_get_dirname(file));
+ gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(ctx.dialog), g_path_get_basename(file));
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ctx.dialog), g_path_get_dirname(file));
}
if (shortcuts && *shortcuts) {
folder = g_strdup(shortcuts);
seed = folder;
while ((folder = strtok(seed, ":")) != NULL) {
- gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), folder, NULL);
+ gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(ctx.dialog), folder, NULL);
seed = NULL;
}
g_free(folder);
}
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) {
- result = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
- folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog));
+ if (gtk_dialog_run(GTK_DIALOG(ctx.dialog)) == GTK_RESPONSE_OK) {
+ result = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(ctx.dialog));
+ folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(ctx.dialog));
if (folder && path) {
dup_string(path, folder);
g_free(folder);
@@ -380,7 +477,7 @@ gchar *ghid_dialog_file_select_save(const gchar * title, gchar ** path, const gc
if (format != NULL)
*format = gtk_combo_box_get_active(GTK_COMBO_BOX(fmt_combo));
- gtk_widget_destroy(dialog);
+ gtk_widget_destroy(ctx.dialog);
return result;
}
diff --git a/src_plugins/hid_gtk/gui-drc-window.c b/src_plugins/hid_gtk/gui-drc-window.c
index ba23d6e..a055eeb 100644
--- a/src_plugins/hid_gtk/gui-drc-window.c
+++ b/src_plugins/hid_gtk/gui-drc-window.c
@@ -33,11 +33,20 @@
#include "layer.h"
#include "pcb-printf.h"
#include "undo.h"
-#include "set.h"
#include "gui.h"
#include "win_place.h"
#include "gui-drc-window.h"
#include "hid_actions.h"
+#include "compat_nls.h"
+#include "obj_all.h"
+#include "obj_pinvia_draw.h"
+#include "obj_pad_draw.h"
+#include "obj_rat_draw.h"
+#include "obj_line_draw.h"
+#include "obj_arc_draw.h"
+#include "obj_poly_draw.h"
+#include "layer_vis.h"
+
#define VIOLATION_PIXMAP_PIXEL_SIZE 100
#define VIOLATION_PIXMAP_PIXEL_BORDER 5
@@ -62,7 +71,7 @@ static void drc_close_cb(gpointer data)
static void drc_refresh_cb(gpointer data)
{
- hid_actionl("DRC", NULL);
+ pcb_hid_actionl("DRC", NULL);
}
static void drc_destroy_cb(GtkWidget * widget, gpointer data)
@@ -82,85 +91,85 @@ static void unset_found_flags(int AndDraw)
int flag = PCB_FLAG_FOUND;
int change = 0;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, via)) {
- AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via);
- CLEAR_FLAG(flag, via);
+ if (PCB_FLAG_TEST(flag, via)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_VIA, via, via, via);
+ PCB_FLAG_CLEAR(flag, via);
DrawVia(via);
change = pcb_true;
}
}
- END_LOOP;
- ELEMENT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(flag, pin)) {
- AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin);
- CLEAR_FLAG(flag, pin);
+ if (PCB_FLAG_TEST(flag, pin)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PIN, element, pin, pin);
+ PCB_FLAG_CLEAR(flag, pin);
DrawPin(pin);
change = pcb_true;
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(flag, pad)) {
- AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad);
- CLEAR_FLAG(flag, pad);
+ if (PCB_FLAG_TEST(flag, pad)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_PAD, element, pad, pad);
+ PCB_FLAG_CLEAR(flag, pad);
DrawPad(pad);
change = pcb_true;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
- RAT_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_RAT_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, line)) {
- AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line);
- CLEAR_FLAG(flag, line);
+ if (PCB_FLAG_TEST(flag, line)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_RATLINE, line, line, line);
+ PCB_FLAG_CLEAR(flag, line);
DrawRat(line);
change = pcb_true;
}
}
- END_LOOP;
- COPPERLINE_LOOP(PCB->Data);
+ PCB_END_LOOP;
+ PCB_LINE_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, line)) {
- AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line);
- CLEAR_FLAG(flag, line);
+ if (PCB_FLAG_TEST(flag, line)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_LINE, layer, line, line);
+ PCB_FLAG_CLEAR(flag, line);
DrawLine(layer, line);
change = pcb_true;
}
}
- ENDALL_LOOP;
- COPPERARC_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_ARC_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, arc)) {
- AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc);
- CLEAR_FLAG(flag, arc);
+ if (PCB_FLAG_TEST(flag, arc)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_ARC, layer, arc, arc);
+ PCB_FLAG_CLEAR(flag, arc);
DrawArc(layer, arc);
change = pcb_true;
}
}
- ENDALL_LOOP;
- COPPERPOLYGON_LOOP(PCB->Data);
+ PCB_ENDALL_LOOP;
+ PCB_POLY_COPPER_LOOP(PCB->Data);
{
- if (TEST_FLAG(flag, polygon)) {
- AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon);
- CLEAR_FLAG(flag, polygon);
+ if (PCB_FLAG_TEST(flag, polygon)) {
+ pcb_undo_add_obj_to_flag(PCB_TYPE_POLYGON, layer, polygon, polygon);
+ PCB_FLAG_CLEAR(flag, polygon);
DrawPolygon(layer, polygon);
change = pcb_true;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (change) {
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
if (AndDraw) {
- IncrementUndoSerialNumber();
- Draw();
+ pcb_undo_inc_serial();
+ pcb_draw();
}
}
}
@@ -195,24 +204,24 @@ static void selection_changed_cb(GtkTreeSelection * selection, gpointer user_dat
int found_type;
void *ptr1, *ptr2, *ptr3;
- found_type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, object_id, object_type);
+ found_type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, object_id, object_type);
if (found_type == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, _("Object ID %i identified during DRC was not found. Stale DRC window?\n"), object_id);
+ pcb_message(PCB_MSG_WARNING, _("Object ID %i identified during DRC was not found. Stale DRC window?\n"), object_id);
continue;
}
- AddObjectToFlagUndoList(object_type, ptr1, ptr2, ptr3);
- SET_FLAG(PCB_FLAG_FOUND, (AnyObjectType *) ptr2);
+ pcb_undo_add_obj_to_flag(object_type, ptr1, ptr2, ptr3);
+ PCB_FLAG_SET(PCB_FLAG_FOUND, (pcb_any_obj_t *) ptr2);
switch (violation->object_type_list[i]) {
case PCB_TYPE_LINE:
case PCB_TYPE_ARC:
case PCB_TYPE_POLYGON:
- ChangeGroupVisibility(GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), pcb_true, pcb_true);
+ pcb_layervis_change_group_vis(pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1), pcb_true, pcb_true);
}
- DrawObject(object_type, ptr1, ptr2);
+ pcb_draw_obj(object_type, ptr1, ptr2);
}
- SetChangedFlag(pcb_true);
- IncrementUndoSerialNumber();
- Draw();
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_draw();
}
static void row_activated_cb(GtkTreeView * view, GtkTreePath * path, GtkTreeViewColumn * column, gpointer user_data)
@@ -228,7 +237,7 @@ static void row_activated_cb(GtkTreeView * view, GtkTreePath * path, GtkTreeView
if (violation == NULL)
return;
- CenterDisplay(violation->x_coord, violation->y_coord);
+ pcb_center_display(violation->x_coord, violation->y_coord);
}
@@ -441,7 +450,7 @@ GType ghid_drc_violation_get_type()
}
-GhidDrcViolation *ghid_drc_violation_new(DrcViolationType * violation, GdkDrawable * pixmap)
+GhidDrcViolation *ghid_drc_violation_new(pcb_drc_violation_t * violation, GdkDrawable * pixmap)
{
object_list obj_list;
@@ -774,7 +783,7 @@ void ghid_drc_window_show(gboolean raise)
gtk_widget_show_all(drc_window);
}
-void ghid_drc_window_append_violation(DrcViolationType * violation)
+void ghid_drc_window_append_violation(pcb_drc_violation_t * violation)
{
GhidDrcViolation *violation_obj;
GtkTreeIter iter;
diff --git a/src_plugins/hid_gtk/gui-drc-window.h b/src_plugins/hid_gtk/gui-drc-window.h
index 5b581b8..9aa5e7c 100644
--- a/src_plugins/hid_gtk/gui-drc-window.h
+++ b/src_plugins/hid_gtk/gui-drc-window.h
@@ -47,12 +47,12 @@ struct _GhidDrcViolation {
char *title;
char *explanation;
- Coord x_coord;
- Coord y_coord;
- Angle angle;
+ pcb_coord_t x_coord;
+ pcb_coord_t y_coord;
+ pcb_angle_t angle;
pcb_bool have_measured;
- Coord measured_value;
- Coord required_value;
+ pcb_coord_t measured_value;
+ pcb_coord_t required_value;
int object_count;
long int *object_id_list;
int *object_type_list;
@@ -62,7 +62,7 @@ struct _GhidDrcViolation {
GType ghid_drc_violation_get_type(void);
-GhidDrcViolation *ghid_drc_violation_new(DrcViolationType * violation, GdkDrawable * pixmap);
+GhidDrcViolation *ghid_drc_violation_new(pcb_drc_violation_t * violation, GdkDrawable * pixmap);
#define GHID_TYPE_VIOLATION_RENDERER (ghid_violation_renderer_get_type())
diff --git a/src_plugins/hid_gtk/gui-keyref-window.c b/src_plugins/hid_gtk/gui-keyref-window.c
index 6fd1d6a..616f38f 100644
--- a/src_plugins/hid_gtk/gui-keyref-window.c
+++ b/src_plugins/hid_gtk/gui-keyref-window.c
@@ -30,6 +30,7 @@
#include "gui.h"
#include "win_place.h"
+#include "compat_nls.h"
static GtkWidget *keyref_window;
diff --git a/src_plugins/hid_gtk/gui-library-window.c b/src_plugins/hid_gtk/gui-library-window.c
index 9a07fa5..bce0851 100644
--- a/src_plugins/hid_gtk/gui-library-window.c
+++ b/src_plugins/hid_gtk/gui-library-window.c
@@ -56,11 +56,10 @@
#include "gui.h"
#include "win_place.h"
-#include "global.h"
#include "buffer.h"
#include "data.h"
-#include "set.h"
#include "plug_footprint.h"
+#include "compat_nls.h"
#include <gdk/gdkkeysyms.h>
@@ -205,7 +204,7 @@ static gboolean lib_model_filter_visible_func(GtkTreeModel * model, GtkTreeIter
g_assert(GHID_IS_LIBRARY_WINDOW(data));
text_ = gtk_entry_get_text(library_window->entry_filter);
- if (g_ascii_strcasecmp(text_, "") == 0) {
+ if (strcmp(text_, "") == 0) {
return TRUE;
}
@@ -265,7 +264,7 @@ static gboolean lib_model_filter_visible_func(GtkTreeModel * model, GtkTreeIter
ret = g_pattern_match_simple(pattern, compname_upper);
if ((tags != NULL) && ret) {
- library_t *entry = NULL;
+ pcb_fplibrary_t *entry = NULL;
gtk_tree_model_get(model, iter, MENU_ENTRY_COLUMN, &entry, -1);
if ((entry != NULL) && (entry->type == LIB_FOOTPRINT) && (entry->data.fp.tags != NULL)) {
char *next, *tag;
@@ -281,7 +280,7 @@ static gboolean lib_model_filter_visible_func(GtkTreeModel * model, GtkTreeIter
while (isspace(*next))
next++;
}
- need = fp_tag(tag, 0);
+ need = pcb_fp_tag(tag, 0);
fprintf(stderr, "TAG: '%s' %p\n", tag, (void *)need);
if (need == NULL) {
ret = FALSE;
@@ -380,7 +379,7 @@ static gboolean tree_row_key_pressed(GtkTreeView * tree_view, GdkEventKey * even
return TRUE;
}
-static void library_window_preview_refresh(GhidLibraryWindow * library_window, const char *name, library_t * entry)
+static void library_window_preview_refresh(GhidLibraryWindow * library_window, const char *name, pcb_fplibrary_t * entry)
{
GString *pt;
char *fullp;
@@ -393,13 +392,13 @@ static void library_window_preview_refresh(GhidLibraryWindow * library_window, c
return;
fullp = entry->data.fp.loc_info;
}
- SetMode(PCB_MODE_ARROW);
- if (LoadElementToBuffer(PASTEBUFFER, name == NULL ? fullp : name))
- SetMode(PCB_MODE_PASTE_BUFFER);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
+ if (pcb_element_load_to_buffer(PCB_PASTEBUFFER, name == NULL ? fullp : name))
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
/* update the preview with new symbol data */
- if ((PASTEBUFFER->Data != NULL) && (elementlist_length(&PASTEBUFFER->Data->Element) != 0))
- g_object_set(library_window->preview, "element-data", elementlist_first(&PASTEBUFFER->Data->Element), NULL);
+ if ((PCB_PASTEBUFFER->Data != NULL) && (elementlist_length(&PCB_PASTEBUFFER->Data->Element) != 0))
+ g_object_set(library_window->preview, "element-data", elementlist_first(&PCB_PASTEBUFFER->Data->Element), NULL);
else {
g_object_set(library_window->preview, "element-data", NULL, NULL);
}
@@ -410,7 +409,7 @@ static void library_window_preview_refresh(GhidLibraryWindow * library_window, c
void **t;
for (t = entry->data.fp.tags; *t != NULL; t++) {
- const char *name = fp_tagname(*t);
+ const char *name = pcb_fp_tagname(*t);
if (name != NULL) {
g_string_append(pt, "\n ");
g_string_append(pt, name);
@@ -439,7 +438,7 @@ static void library_window_callback_tree_selection_changed(GtkTreeSelection * se
GtkTreeModel *model;
GtkTreeIter iter;
GhidLibraryWindow *library_window = (GhidLibraryWindow *) user_data;
- library_t *entry = NULL;
+ pcb_fplibrary_t *entry = NULL;
if (!gtk_tree_selection_get_selected(selection, &model, &iter))
return;
@@ -519,7 +518,7 @@ static void library_window_callback_filter_entry_changed(GtkEditable * editable,
/* turns button off if filter entry is empty */
/* turns it on otherwise */
button = GTK_WIDGET(library_window->button_clear);
- sensitive = (g_ascii_strcasecmp(gtk_entry_get_text(library_window->entry_filter), "") != 0);
+ sensitive = (strcmp(gtk_entry_get_text(library_window->entry_filter), "") != 0);
gtk_widget_set_sensitive(button, sensitive);
/* Cancel any pending update of the footprint list filter */
@@ -557,10 +556,10 @@ static void library_window_callback_filter_button_clicked(GtkButton * button, gp
* Creates a tree where the branches are the available library
* sources and the leaves are the footprints.
*/
-static GtkTreeModel *create_lib_tree_model_recurse(GtkTreeStore *tree, GhidLibraryWindow *library_window, library_t *parent, GtkTreeIter *iter_parent)
+static GtkTreeModel *create_lib_tree_model_recurse(GtkTreeStore *tree, GhidLibraryWindow *library_window, pcb_fplibrary_t *parent, GtkTreeIter *iter_parent)
{
GtkTreeIter p_iter;
- library_t *menu;
+ pcb_fplibrary_t *menu;
int n;
for(menu = parent->data.dir.children.array, n = 0; n < parent->data.dir.children.used; n++, menu++)
@@ -577,7 +576,7 @@ static GtkTreeModel *create_lib_tree_model_recurse(GtkTreeStore *tree, GhidLibra
static GtkTreeModel *create_lib_tree_model(GhidLibraryWindow *library_window)
{
GtkTreeStore *tree = gtk_tree_store_new(N_MENU_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
- return create_lib_tree_model_recurse(tree, library_window, &library, NULL);
+ return create_lib_tree_model_recurse(tree, library_window, &pcb_library, NULL);
}
#if 0
diff --git a/src_plugins/hid_gtk/gui-log-window.c b/src_plugins/hid_gtk/gui-log-window.c
index b2508ba..6596c74 100644
--- a/src_plugins/hid_gtk/gui-log-window.c
+++ b/src_plugins/hid_gtk/gui-log-window.c
@@ -27,6 +27,7 @@
/* This file written by Bill Wilson for the PCB Gtk port
*/
+#include <ctype.h>
#include "config.h"
#include "conf_core.h"
#include "conf_hid.h"
@@ -35,6 +36,7 @@
#include "win_place.h"
#include "pcb-printf.h"
#include "hid_actions.h"
+#include "compat_nls.h"
static GtkWidget *log_window, *log_text;
static gboolean log_show_on_append = FALSE;
@@ -119,7 +121,7 @@ static void ghid_log_append_string_(enum pcb_message_level level, gchar *msg)
ghid_text_view_append(log_text, msg);
if (popup)
- hid_actionl("DoWindows", "Log", "false", NULL);
+ pcb_hid_actionl("DoWindows", "Log", "false", NULL);
}
static void ghid_log_append_string(enum pcb_message_level level, gchar *s)
@@ -179,23 +181,23 @@ static const char logshowonappend_help[] = "If true, the log window will be show
to it. If false, the log will still be updated, but the window won't \
be shown.";
-static gint GhidLogShowOnAppend(int argc, const char **argv, Coord x, Coord y)
+static gint GhidLogShowOnAppend(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *a = argc == 1 ? argv[0] : "";
- if (strncasecmp(a, "t", 1) == 0) {
+ if (tolower(*a) == 't') {
log_show_on_append = TRUE;
}
- else if (strncasecmp(a, "f", 1) == 0) {
+ else if (tolower(*a) == 'f') {
log_show_on_append = FALSE;
}
return 0;
}
-HID_Action ghid_log_action_list[] = {
+pcb_hid_action_t ghid_log_action_list[] = {
{"LogShowOnAppend", 0, GhidLogShowOnAppend,
logshowonappend_help, logshowonappend_syntax}
,
};
-REGISTER_ACTIONS(ghid_log_action_list, ghid_cookie)
+PCB_REGISTER_ACTIONS(ghid_log_action_list, ghid_cookie)
diff --git a/src_plugins/hid_gtk/gui-misc.c b/src_plugins/hid_gtk/gui-misc.c
index f8a69d0..2bb6c52 100644
--- a/src_plugins/hid_gtk/gui-misc.c
+++ b/src_plugins/hid_gtk/gui-misc.c
@@ -25,14 +25,13 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
+#include "math_helper.h"
#include "crosshair.h"
#include "data.h"
-#include "misc.h"
#include "action_helper.h"
-#include "set.h"
#include "pcb-printf.h"
#include "misc_util.h"
+#include "compat_nls.h"
#include "gui.h"
#include <gdk/gdkkeysyms.h>
@@ -200,10 +199,10 @@ void ghid_corner_cursor(void)
{
GdkCursorType shape;
- if (Crosshair.Y <= Crosshair.AttachedBox.Point1.Y)
- shape = (Crosshair.X >= Crosshair.AttachedBox.Point1.X) ? GDK_UR_ANGLE : GDK_UL_ANGLE;
+ if (pcb_crosshair.Y <= pcb_crosshair.AttachedBox.Point1.Y)
+ shape = (pcb_crosshair.X >= pcb_crosshair.AttachedBox.Point1.X) ? GDK_UR_ANGLE : GDK_UL_ANGLE;
else
- shape = (Crosshair.X >= Crosshair.AttachedBox.Point1.X) ? GDK_LR_ANGLE : GDK_LL_ANGLE;
+ shape = (pcb_crosshair.X >= pcb_crosshair.AttachedBox.Point1.X) ? GDK_LR_ANGLE : GDK_LL_ANGLE;
if (gport->X_cursor_shape != shape)
gport_set_cursor(shape);
}
@@ -276,15 +275,15 @@ static gboolean run_get_location_loop(const gchar * message)
getting_loc = 1;
ghid_status_line_set_text(message);
- oldObjState = Crosshair.AttachedObject.State;
- oldLineState = Crosshair.AttachedLine.State;
- oldBoxState = Crosshair.AttachedBox.State;
- notify_crosshair_change(pcb_false);
- Crosshair.AttachedObject.State = STATE_FIRST;
- Crosshair.AttachedLine.State = STATE_FIRST;
- Crosshair.AttachedBox.State = STATE_FIRST;
+ oldObjState = pcb_crosshair.AttachedObject.State;
+ oldLineState = pcb_crosshair.AttachedLine.State;
+ oldBoxState = pcb_crosshair.AttachedBox.State;
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_crosshair.AttachedObject.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST;
+ pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST;
ghid_hand_cursor();
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
/* Stop the top level GMainLoop from getting user input from keyboard
| and mouse so we can install our own handlers here. Also set the
@@ -310,11 +309,11 @@ static gboolean run_get_location_loop(const gchar * message)
ghid_interface_input_signals_connect(); /* return to normal */
ghid_interface_set_sensitive(TRUE);
- notify_crosshair_change(pcb_false);
- Crosshair.AttachedObject.State = oldObjState;
- Crosshair.AttachedLine.State = oldLineState;
- Crosshair.AttachedBox.State = oldBoxState;
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_crosshair.AttachedObject.State = oldObjState;
+ pcb_crosshair.AttachedLine.State = oldLineState;
+ pcb_crosshair.AttachedBox.State = oldBoxState;
+ pcb_notify_crosshair_change(pcb_true);
ghid_restore_cursor();
ghid_set_status_line_label();
@@ -396,10 +395,10 @@ void ghid_set_cursor_position_labels(void)
if (conf_hid_gtk.plugins.hid_gtk.compact_vertical)
sep = '\n';
- if (Marked.status) {
- Coord dx = Crosshair.X - Marked.X;
- Coord dy = Crosshair.Y - Marked.Y;
- Coord r = Distance(Crosshair.X, Crosshair.Y, Marked.X, Marked.Y);
+ if (pcb_marked.status) {
+ pcb_coord_t dx = pcb_crosshair.X - pcb_marked.X;
+ pcb_coord_t dy = pcb_crosshair.Y - pcb_marked.Y;
+ pcb_coord_t r = pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, pcb_marked.X, pcb_marked.Y);
double a = atan2(dy, dx) * PCB_RAD_TO_DEG;
@@ -414,7 +413,7 @@ void ghid_set_cursor_position_labels(void)
}
- text = pcb_strdup_printf("%m+%-mS%c%-mS", conf_core.editor.grid_unit->allow, Crosshair.X, sep, Crosshair.Y);
+ text = pcb_strdup_printf("%m+%-mS%c%-mS", conf_core.editor.grid_unit->allow, pcb_crosshair.X, sep, pcb_crosshair.Y);
ghid_cursor_position_label_set_text(text);
free(text);
}
diff --git a/src_plugins/hid_gtk/gui-netlist-window.c b/src_plugins/hid_gtk/gui-netlist-window.c
index 6007673..c253d33 100644
--- a/src_plugins/hid_gtk/gui-netlist-window.c
+++ b/src_plugins/hid_gtk/gui-netlist-window.c
@@ -35,24 +35,20 @@
#include <stdlib.h>
#include <string.h>
-#include "global.h"
-
#include "win_place.h"
-#include "create.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "find.h"
-#include "misc.h"
-#include "mymem.h"
#include "rats.h"
#include "remove.h"
#include "search.h"
#include "select.h"
-#include "set.h"
#include "undo.h"
#include "hid_actions.h"
+#include "compat_nls.h"
+#include "obj_all.h"
#include "gui.h"
@@ -68,8 +64,8 @@ static GtkTreeSelection *node_selection;
static gboolean selection_holdoff;
-static LibraryMenuType *selected_net;
-static LibraryMenuType *node_selected_net;
+static pcb_lib_menu_t *selected_net;
+static pcb_lib_menu_t *node_selected_net;
/* The Netlist window displays all the layout nets in a left treeview
@@ -107,7 +103,7 @@ static LibraryMenuType *node_selected_net;
*/
-/* -------- The netlist nodes (LibraryEntryType) data model ----------
+/* -------- The netlist nodes (pcb_lib_entry_t) data model ----------
| Each time a net is selected in the left treeview, this node model
| is recreated containing all the nodes (pins/pads) that are connected
| to the net. Loading the new model will update the right treeview with
@@ -116,14 +112,14 @@ static LibraryMenuType *node_selected_net;
| The terminology is a bit confusing because the PCB netlist data
| structures are generic structures used for library elements, netlist
| data, and possibly other things also. The mapping is that
- | the layout netlist data structure is a LibraryType which
- | contains an allocated array of LibraryMenuType structs. Each of these
+ | the layout netlist data structure is a pcb_lib_t which
+ | contains an allocated array of pcb_lib_menu_t structs. Each of these
| structs represents a net in the netlist and contains an array
- | of LibraryEntryType structs which represent the nodes connecting to
+ | of pcb_lib_entry_t structs which represent the nodes connecting to
| the net. So we have:
|
| Nets Nodes
- | LibraryType LibraryMenuType LibraryEntryType
+ | pcb_lib_t pcb_lib_menu_t pcb_lib_entry_t
| -------------------------------------------------------
| PCB->NetlistLib------Menu[0]-----------Entry[0]
| | Entry[1]
@@ -139,18 +135,18 @@ static LibraryMenuType *node_selected_net;
| names would be nodes C101-1, R101-2, etc
*/
-LibraryEntryType *node_get_node_from_name(gchar * node_name, LibraryMenuType ** node_net);
+pcb_lib_entry_t *node_get_node_from_name(gchar * node_name, pcb_lib_menu_t ** node_net);
enum {
NODE_NAME_COLUMN, /* Name to show in the treeview */
- NODE_LIBRARY_COLUMN, /* Pointer to this node (LibraryEntryType) */
+ NODE_LIBRARY_COLUMN, /* Pointer to this node (pcb_lib_entry_t) */
N_NODE_COLUMNS
};
-/* Given a net in the netlist (a LibraryMenuType) put all the Entry[]
+/* Given a net in the netlist (a pcb_lib_menu_t) put all the Entry[]
| names (the nodes) into a newly created node tree model.
*/
-static GtkTreeModel *node_model_create(LibraryMenuType * menu)
+static GtkTreeModel *node_model_create(pcb_lib_menu_t * menu)
{
GtkListStore *store;
GtkTreeIter iter;
@@ -160,14 +156,14 @@ static GtkTreeModel *node_model_create(LibraryMenuType * menu)
if (menu == NULL)
return GTK_TREE_MODEL(store);
- ENTRY_LOOP(menu);
+ PCB_ENTRY_LOOP(menu);
{
if (!entry->ListEntry)
continue;
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, NODE_NAME_COLUMN, entry->ListEntry, NODE_LIBRARY_COLUMN, entry, -1);
}
- END_LOOP;
+ PCB_END_LOOP;
return GTK_TREE_MODEL(store);
}
@@ -176,12 +172,12 @@ static GtkTreeModel *node_model_create(LibraryMenuType * menu)
| Create a new model containing the nodes of the given net, insert
| the model into the treeview and unref the old model.
*/
-static void node_model_update(LibraryMenuType * menu)
+static void node_model_update(pcb_lib_menu_t * menu)
{
GtkTreeModel *model;
if (menu == NULL) {
- Message(PCB_MSG_DEFAULT, "Error: can't update netlist window: there is no netlist loaded.\n");
+ pcb_message(PCB_MSG_ERROR, "Error: can't update netlist window: there is no netlist loaded.\n");
return;
}
@@ -198,16 +194,16 @@ static void node_model_update(LibraryMenuType * menu)
g_object_unref(G_OBJECT(model));
}
-static void toggle_pin_selected(LibraryEntryType * entry)
+static void toggle_pin_selected(pcb_lib_entry_t * entry)
{
- ConnectionType conn;
+ pcb_connection_t conn;
- if (!SeekPad(entry, &conn, pcb_false))
+ if (!pcb_rat_seek_pad(entry, &conn, pcb_false))
return;
- AddObjectToFlagUndoList(conn.type, conn.ptr1, conn.ptr2, conn.ptr2);
- TOGGLE_FLAG(PCB_FLAG_SELECTED, (AnyObjectType *) conn.ptr2);
- DrawObject(conn.type, conn.ptr1, conn.ptr2);
+ pcb_undo_add_obj_to_flag(conn.type, conn.ptr1, conn.ptr2, conn.ptr2);
+ PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, (pcb_any_obj_t *) conn.ptr2);
+ pcb_draw_obj(conn.type, conn.ptr1, conn.ptr2);
}
@@ -217,10 +213,10 @@ static void node_selection_changed_cb(GtkTreeSelection * selection, gpointer dat
{
GtkTreeIter iter;
GtkTreeModel *model;
- LibraryMenuType *node_net;
- LibraryEntryType *node;
- ConnectionType conn;
- Coord x, y;
+ pcb_lib_menu_t *node_net;
+ pcb_lib_entry_t *node;
+ pcb_connection_t conn;
+ pcb_coord_t x, y;
static gchar *node_name;
if (selection_holdoff) /* PCB is highlighting, user is not selecting */
@@ -252,7 +248,7 @@ static void node_selection_changed_cb(GtkTreeSelection * selection, gpointer dat
}
/* From the treeview row, extract the node pointer stored there and
- | we've got a pointer to the LibraryEntryType (node) the row
+ | we've got a pointer to the pcb_lib_entry_t (node) the row
| represents.
*/
gtk_tree_model_get(model, &iter, NODE_LIBRARY_COLUMN, &node, -1);
@@ -263,26 +259,26 @@ static void node_selection_changed_cb(GtkTreeSelection * selection, gpointer dat
/* Now just toggle a select of the node on the layout
*/
toggle_pin_selected(node);
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
/* And lead the user to the location */
- if (SeekPad(node, &conn, pcb_false))
+ if (pcb_rat_seek_pad(node, &conn, pcb_false))
switch (conn.type) {
case PCB_TYPE_PIN:
{
- PinTypePtr pin = (PinTypePtr) conn.ptr2;
+ pcb_pin_t *pin = (pcb_pin_t *) conn.ptr2;
x = pin->X;
y = pin->Y;
- gui->set_crosshair(x, y, 0);
+ pcb_gui->set_crosshair(x, y, 0);
ghid_lead_user_to_location(x, y);
break;
}
case PCB_TYPE_PAD:
{
- PadTypePtr pad = (PadTypePtr) conn.ptr2;
+ pcb_pad_t *pad = (pcb_pad_t *) conn.ptr2;
x = pad->Point1.X + (pad->Point2.X - pad->Point1.X) / 2;
y = pad->Point1.Y + (pad->Point2.Y - pad->Point2.Y) / 2;
- gui->set_crosshair(x, y, 0);
+ pcb_gui->set_crosshair(x, y, 0);
ghid_lead_user_to_location(x, y);
break;
}
@@ -290,7 +286,7 @@ static void node_selection_changed_cb(GtkTreeSelection * selection, gpointer dat
}
-/* -------- The net (LibraryMenuType) data model ----------
+/* -------- The net (pcb_lib_menu_t) data model ----------
*/
/* TODO: the enable and disable all nets. Can't seem to get how that's
| supposed to work, but it'll take updating the NET_ENABLED_COLUMN in
@@ -303,7 +299,7 @@ static void node_selection_changed_cb(GtkTreeSelection * selection, gpointer dat
enum {
NET_ENABLED_COLUMN, /* If enabled will be ' ', if disable '*' */
NET_NAME_COLUMN, /* Name to show in the treeview */
- NET_LIBRARY_COLUMN, /* Pointer to this net (LibraryMenuType) */
+ NET_LIBRARY_COLUMN, /* Pointer to this net (pcb_lib_menu_t) */
N_NET_COLUMNS
};
@@ -337,7 +333,7 @@ static GtkTreeModel *net_model_create(void)
prefix_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)
gtk_tree_row_reference_free);
- MENU_LOOP(&PCB->NetlistLib[NETLIST_EDITED]);
+ PCB_MENU_LOOP(&PCB->NetlistLib[PCB_NETLIST_EDITED]);
{
if (!menu->Name)
continue;
@@ -403,7 +399,7 @@ static GtkTreeModel *net_model_create(void)
NET_NAME_COLUMN, path_segments[path_depth - 1], NET_LIBRARY_COLUMN, menu, -1);
g_strfreev(path_segments);
}
- END_LOOP;
+ PCB_END_LOOP;
g_hash_table_destroy(prefix_hash);
@@ -418,7 +414,7 @@ static void net_selection_double_click_cb(GtkTreeView * treeview, GtkTreePath *
GtkTreeModel *model;
GtkTreeIter iter;
gchar *str;
- LibraryMenuType *menu;
+ pcb_lib_menu_t *menu;
model = gtk_tree_view_get_model(treeview);
if (gtk_tree_model_get_iter(model, &iter, path)) {
@@ -449,7 +445,7 @@ static void net_selection_changed_cb(GtkTreeSelection * selection, gpointer data
{
GtkTreeIter iter;
GtkTreeModel *model;
- LibraryMenuType *net;
+ pcb_lib_menu_t *net;
if (selection_holdoff) /* PCB is highlighting, user is not selecting */
return;
@@ -460,7 +456,7 @@ static void net_selection_changed_cb(GtkTreeSelection * selection, gpointer data
return;
}
- /* Get a pointer, net, to the LibraryMenuType of the newly selected
+ /* Get a pointer, net, to the pcb_lib_menu_t of the newly selected
| netlist row, and create a new node model from the net entries
| and insert that model into the node view. Delete old entry model.
*/
@@ -474,7 +470,7 @@ static void netlist_disable_all_cb(GtkToggleButton * button, gpointer data)
{
GtkTreeIter iter;
gboolean active = gtk_toggle_button_get_active(button);
- LibraryMenuType *menu;
+ pcb_lib_menu_t *menu;
/* Get each net iter and change the NET_ENABLED_COLUMN to a "*" or ""
| to flag it as disabled or enabled based on toggle button state.
@@ -493,8 +489,8 @@ static void netlist_disable_all_cb(GtkToggleButton * button, gpointer data)
*/
static void netlist_select_cb(GtkWidget * widget, gpointer data)
{
- LibraryEntryType *entry;
- ConnectionType conn;
+ pcb_lib_entry_t *entry;
+ pcb_connection_t conn;
gint i;
gboolean select_flag = GPOINTER_TO_INT(data);
@@ -503,18 +499,18 @@ static void netlist_select_cb(GtkWidget * widget, gpointer data)
if (selected_net == node_selected_net)
node_selected_net = NULL;
- InitConnectionLookup();
- ResetConnections(pcb_true);
+ pcb_conn_lookup_init();
+ pcb_reset_conns(pcb_true);
for (i = selected_net->EntryN, entry = selected_net->Entry; i; i--, entry++)
- if (SeekPad(entry, &conn, pcb_false))
- RatFindHook(conn.type, conn.ptr1, conn.ptr2, conn.ptr2, pcb_true, pcb_true);
-
- SelectConnection(select_flag);
- ResetConnections(pcb_false);
- FreeConnectionLookupMemory();
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_rat_seek_pad(entry, &conn, pcb_false))
+ pcb_rat_find_hook(conn.type, conn.ptr1, conn.ptr2, conn.ptr2, pcb_true, pcb_true);
+
+ pcb_select_connection(select_flag);
+ pcb_reset_conns(pcb_false);
+ pcb_conn_lookup_uninit();
+ pcb_undo_inc_serial();
+ pcb_draw();
}
static void netlist_find_cb(GtkWidget * widget, gpointer data)
@@ -525,8 +521,8 @@ static void netlist_find_cb(GtkWidget * widget, gpointer data)
return;
name = selected_net->Name + 2;
- hid_actionl("connection", "reset", NULL);
- hid_actionl("netlist", "find", name, NULL);
+ pcb_hid_actionl("connection", "reset", NULL);
+ pcb_hid_actionl("netlist", "find", name, NULL);
}
static void netlist_rip_up_cb(GtkWidget * widget, gpointer data)
@@ -536,41 +532,41 @@ static void netlist_rip_up_cb(GtkWidget * widget, gpointer data)
return;
netlist_find_cb(widget, data);
- VISIBLELINE_LOOP(PCB->Data);
+ PCB_LINE_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, line) && !TEST_FLAG(PCB_FLAG_LOCK, line))
- RemoveObject(PCB_TYPE_LINE, layer, line, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, line) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line))
+ pcb_remove_object(PCB_TYPE_LINE, layer, line, line);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- VISIBLEARC_LOOP(PCB->Data);
+ PCB_ARC_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc))
- RemoveObject(PCB_TYPE_ARC, layer, arc, arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, arc) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, arc))
+ pcb_remove_object(PCB_TYPE_ARC, layer, arc, arc);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->ViaOn)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, via) && !TEST_FLAG(PCB_FLAG_LOCK, via))
- RemoveObject(PCB_TYPE_VIA, via, via, via);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, via) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, via))
+ pcb_remove_object(PCB_TYPE_VIA, via, via, via);
}
- END_LOOP;
+ PCB_END_LOOP;
}
/**/ typedef struct {
- LibraryEntryType *ret_val;
- LibraryMenuType *node_net;
+ pcb_lib_entry_t *ret_val;
+ pcb_lib_menu_t *node_net;
const gchar *node_name;
pcb_bool found;
} node_get_node_from_name_state;
static gboolean node_get_node_from_name_helper(GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
{
- LibraryMenuType *net;
- LibraryEntryType *node;
+ pcb_lib_menu_t *net;
+ pcb_lib_entry_t *node;
node_get_node_from_name_state *state = data;
gtk_tree_model_get(net_model, iter, NET_LIBRARY_COLUMN, &net, -1);
@@ -590,7 +586,7 @@ static gboolean node_get_node_from_name_helper(GtkTreeModel * model, GtkTreePath
return FALSE;
}
-LibraryEntryType *node_get_node_from_name(gchar * node_name, LibraryMenuType ** node_net)
+pcb_lib_entry_t *node_get_node_from_name(gchar * node_name, pcb_lib_menu_t ** node_net)
{
node_get_node_from_name_state state;
@@ -653,7 +649,7 @@ void ghid_netlist_window_create(GHidPort * out)
/* No point in putting up the window if no netlist is loaded.
*/
- if (!PCB->NetlistLib[NETLIST_EDITED].MenuN)
+ if (!PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN)
return;
if (netlist_window)
@@ -777,15 +773,15 @@ void ghid_netlist_window_show(GHidPort * out, gboolean raise)
struct ggnfnn_task {
gboolean enabled_only;
const gchar *node_name;
- LibraryMenuType *found_net;
+ pcb_lib_menu_t *found_net;
GtkTreeIter iter;
};
static gboolean hunt_named_node(GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
{
struct ggnfnn_task *task = (struct ggnfnn_task *) data;
- LibraryMenuType *net;
- LibraryEntryType *node;
+ pcb_lib_menu_t *net;
+ pcb_lib_entry_t *node;
gchar *str;
gint j;
gboolean is_disabled;
@@ -814,7 +810,7 @@ static gboolean hunt_named_node(GtkTreeModel * model, GtkTreePath * path, GtkTre
return FALSE;
}
-LibraryMenuType *ghid_get_net_from_node_name(const gchar * node_name, gboolean enabled_only)
+pcb_lib_menu_t *ghid_get_net_from_node_name(const gchar * node_name, gboolean enabled_only)
{
GtkTreePath *path;
struct ggnfnn_task task;
@@ -823,7 +819,7 @@ LibraryMenuType *ghid_get_net_from_node_name(const gchar * node_name, gboolean e
return NULL;
/* Have to force the netlist window created because we need the treeview
- | models constructed so we can find the LibraryMenuType pointer the
+ | models constructed so we can find the pcb_lib_menu_t pointer the
| caller wants.
*/
ghid_netlist_window_create(gport);
@@ -863,7 +859,7 @@ void ghid_netlist_highlight_node(const gchar * node_name)
{
GtkTreePath *path;
GtkTreeIter iter;
- LibraryMenuType *net;
+ pcb_lib_menu_t *net;
gchar *name;
if (!node_name)
@@ -918,16 +914,15 @@ void ghid_netlist_window_update(gboolean init_nodes)
/* XXX Check if the select callback does this for us */
if (init_nodes)
- node_model_update((&PCB->NetlistLib[NETLIST_EDITED])->Menu);
+ node_model_update((&PCB->NetlistLib[PCB_NETLIST_EDITED])->Menu);
}
-static gint GhidNetlistChanged(int argc, const char **argv, Coord x, Coord y)
+void GhidNetlistChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
loading_new_netlist = TRUE;
ghid_netlist_window_update(TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(disable_all_button), FALSE);
loading_new_netlist = FALSE;
- return 0;
}
static const char netlistshow_syntax[] = "NetlistShow(pinname|netname)";
@@ -935,7 +930,7 @@ static const char netlistshow_syntax[] = "NetlistShow(pinname|netname)";
static const char netlistshow_help[] = "Selects the given pinname or netname in the netlist window. Does not \
show the window if it isn't already shown.";
-static gint GhidNetlistShow(int argc, const char **argv, Coord x, Coord y)
+static gint GhidNetlistShow(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
ghid_netlist_window_create(gport);
if (argc > 0)
@@ -947,16 +942,13 @@ static const char netlistpresent_syntax[] = "NetlistPresent()";
static const char netlistpresent_help[] = "Presents the netlist window.";
-static gint GhidNetlistPresent(int argc, const char **argv, Coord x, Coord y)
+static gint GhidNetlistPresent(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
ghid_netlist_window_show(gport, TRUE);
return 0;
}
-HID_Action ghid_netlist_action_list[] = {
- {"NetlistChanged", 0, GhidNetlistChanged,
- netlistchanged_help, netlistchanged_syntax}
- ,
+pcb_hid_action_t ghid_netlist_action_list[] = {
{"NetlistShow", 0, GhidNetlistShow,
netlistshow_help, netlistshow_syntax}
,
@@ -965,4 +957,4 @@ HID_Action ghid_netlist_action_list[] = {
,
};
-REGISTER_ACTIONS(ghid_netlist_action_list, ghid_cookie)
+PCB_REGISTER_ACTIONS(ghid_netlist_action_list, ghid_cookie)
diff --git a/src_plugins/hid_gtk/gui-output-events.c b/src_plugins/hid_gtk/gui-output-events.c
index 26bc9cd..426b9f3 100644
--- a/src_plugins/hid_gtk/gui-output-events.c
+++ b/src_plugins/hid_gtk/gui-output-events.c
@@ -40,8 +40,6 @@
#include "draw.h"
#include "error.h"
#include "layer.h"
-#include "misc.h"
-#include "set.h"
#include "find.h"
#include "search.h"
#include "rats.h"
@@ -100,7 +98,7 @@ void ghid_port_ranges_scale(void)
* handles all events from PCB drawing area
*/
-void ghid_get_coords(const char *msg, Coord * x, Coord * y)
+void ghid_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y)
{
if (!ghid_port.has_entered && msg)
ghid_get_user_xy(msg);
@@ -124,14 +122,14 @@ void ghid_note_event_location(GdkEventButton * ev)
ghid_event_to_pcb_coords(event_x, event_y, &gport->pcb_x, &gport->pcb_y);
- EventMoveCrosshair(gport->pcb_x, gport->pcb_y);
+ pcb_event_move_crosshair(gport->pcb_x, gport->pcb_y);
ghid_set_cursor_position_labels();
}
static gboolean ghid_idle_cb(gpointer data)
{
if (conf_core.editor.mode == PCB_MODE_NO)
- SetMode(PCB_MODE_ARROW);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
ghid_mode_cursor(conf_core.editor.mode);
if (ghidgui->settings_mode != conf_core.editor.mode) {
ghid_mode_buttons_update();
@@ -147,7 +145,7 @@ gboolean ghid_port_key_release_cb(GtkWidget * drawing_area, GdkEventKey * kev, g
if (ghid_is_modifier_key_sym(ksym))
ghid_note_event_location(NULL);
- AdjustAttachedObjects();
+ pcb_adjust_attached_objects();
ghid_invalidate_all();
g_idle_add(ghid_idle_cb, NULL);
return FALSE;
@@ -162,7 +160,7 @@ gboolean ghid_port_key_press_cb(GtkWidget * drawing_area, GdkEventKey * kev, gpo
if (kev->keyval <= 0xffff) {
GdkModifierType state = (GdkModifierType) (kev->state);
int slen, mods = 0;
- static hid_cfg_keyseq_t *seq[32];
+ static pcb_hid_cfg_keyseq_t *seq[32];
static int seq_len = 0;
unsigned short int kv = kev->keyval;
@@ -171,23 +169,23 @@ gboolean ghid_port_key_press_cb(GtkWidget * drawing_area, GdkEventKey * kev, gpo
extern GdkModifierType ghid_glob_mask;
ghid_glob_mask = state;
- if (state & GDK_MOD1_MASK) mods |= M_Alt;
- if (state & GDK_CONTROL_MASK) mods |= M_Ctrl;
+ if (state & GDK_MOD1_MASK) mods |= PCB_M_Alt;
+ if (state & GDK_CONTROL_MASK) mods |= PCB_M_Ctrl;
if (state & GDK_SHIFT_MASK) {
/* TODO#3: this works only on US keyboard */
static const char *ignore_shift = "~!@#$%^&*()_+{}|:\"<>?";
if ((kv < 32) || (kv > 126) || (strchr(ignore_shift, kv) == NULL)) {
- mods |= M_Shift;
+ mods |= PCB_M_Shift;
if ((kv >= 'A') && (kv <= 'Z'))
kv = tolower(kv);
}
}
if (kv == GDK_KEY_ISO_Left_Tab) kv = GDK_KEY_Tab;
- slen = hid_cfg_keys_input(&ghid_keymap, mods, kv, seq, &seq_len);
+ slen = pcb_hid_cfg_keys_input(&ghid_keymap, mods, kv, seq, &seq_len);
if (slen > 0) {
ghid_port.has_entered = 1;
- hid_cfg_keys_action(seq, slen);
+ pcb_hid_cfg_keys_action(seq, slen);
return TRUE;
}
}
@@ -195,10 +193,10 @@ gboolean ghid_port_key_press_cb(GtkWidget * drawing_area, GdkEventKey * kev, gpo
return FALSE;
}
-static hid_cfg_mod_t ghid_mouse_button(int ev_button)
+static pcb_hid_cfg_mod_t ghid_mouse_button(int ev_button)
{
/* GDK numbers buttons from 1..5, there seem to be no symbolic names */
- return (MB_LEFT << (ev_button-1));
+ return (PCB_MB_LEFT << (ev_button-1));
}
gboolean ghid_port_button_press_cb(GtkWidget * drawing_area, GdkEventButton * ev, gpointer data)
@@ -242,9 +240,9 @@ gboolean ghid_port_button_release_cb(GtkWidget * drawing_area, GdkEventButton *
state = (GdkModifierType) (ev->state);
mk = ghid_modifier_keys_state(&state);
- hid_cfg_mouse_action(&ghid_mouse, ghid_mouse_button(ev->button) | mk | M_Release);
+ hid_cfg_mouse_action(&ghid_mouse, ghid_mouse_button(ev->button) | mk | PCB_M_Release);
- AdjustAttachedObjects();
+ pcb_adjust_attached_objects();
ghid_invalidate_all();
ghid_window_set_name_label(PCB->Name);
@@ -280,7 +278,7 @@ gboolean ghid_port_drawing_area_configure_event_cb(GtkWidget * widget, GdkEventC
gdk_color_white(gport->colormap, &gport->offlimits_color);
first_time_done = TRUE;
ghid_drawing_area_configure_hook(out);
- PCBChanged(0, NULL, 0, 0);
+ pcb_board_changed(0);
}
else {
ghid_drawing_area_configure_hook(out);
@@ -292,7 +290,7 @@ gboolean ghid_port_drawing_area_configure_event_cb(GtkWidget * widget, GdkEventC
}
-static char *describe_location(Coord X, Coord Y)
+static char *describe_location(pcb_coord_t X, pcb_coord_t Y)
{
void *ptr1, *ptr2, *ptr3;
int type;
@@ -304,29 +302,29 @@ static char *describe_location(Coord X, Coord Y)
/* check if there are any pins or pads at that position */
- type = SearchObjectByLocation(PCB_TYPE_PIN | PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3, X, Y, Range);
+ type = pcb_search_obj_by_location(PCB_TYPE_PIN | PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3, X, Y, Range);
if (type == PCB_TYPE_NONE)
return NULL;
/* don't mess with silk objects! */
- if (type & SILK_TYPE && GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1) >= max_copper_layer)
+ if (type & PCB_SILK_TYPE && pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1) >= pcb_max_copper_layer)
return NULL;
if (type == PCB_TYPE_PIN || type == PCB_TYPE_PAD)
- elename = (char *) UNKNOWN(NAMEONPCB_NAME((ElementTypePtr) ptr1));
+ elename = (char *) PCB_UNKNOWN(PCB_ELEM_NAME_REFDES((pcb_element_t *) ptr1));
- pinname = ConnectionName(type, ptr1, ptr2);
+ pinname = pcb_connection_name(type, ptr1, ptr2);
if (pinname == NULL)
return NULL;
/* Find netlist entry */
- MENU_LOOP(&PCB->NetlistLib[NETLIST_EDITED]);
+ PCB_MENU_LOOP(&PCB->NetlistLib[PCB_NETLIST_EDITED]);
{
if (!menu->Name)
continue;
- ENTRY_LOOP(menu);
+ PCB_ENTRY_LOOP(menu);
{
if (!entry->ListEntry)
continue;
@@ -338,12 +336,12 @@ static char *describe_location(Coord X, Coord Y)
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (netname != NULL)
break;
}
- END_LOOP;
+ PCB_END_LOOP;
description = g_strdup_printf("Element name: %s\n"
"Pinname : %s\n"
@@ -490,10 +488,10 @@ gint ghid_port_window_mouse_scroll_cb(GtkWidget * widget, GdkEventScroll * ev, G
* who has buttons 4 - 7 that aren't the scroll wheel?
*/
switch (ev->direction) {
- case GDK_SCROLL_UP: button = MB_SCROLL_UP; break;
- case GDK_SCROLL_DOWN: button = MB_SCROLL_DOWN; break;
- case GDK_SCROLL_LEFT: button = MB_SCROLL_LEFT; break;
- case GDK_SCROLL_RIGHT: button = MB_SCROLL_RIGHT; break;
+ case GDK_SCROLL_UP: button = PCB_MB_SCROLL_UP; break;
+ case GDK_SCROLL_DOWN: button = PCB_MB_SCROLL_DOWN; break;
+ case GDK_SCROLL_LEFT: button = PCB_MB_SCROLL_LEFT; break;
+ case GDK_SCROLL_RIGHT: button = PCB_MB_SCROLL_RIGHT; break;
default: return FALSE;
}
@@ -520,6 +518,14 @@ void ghid_confchg_all_direction_lines(conf_native_t *cfg)
ghid_set_status_line_label();
}
+void ghid_confchg_flip(conf_native_t *cfg)
+{
+ /* test if PCB struct doesn't exist at startup */
+ if (!PCB)
+ return;
+ ghid_set_status_line_label();
+}
+
void ghid_confchg_fullscreen(conf_native_t *cfg)
{
if (gtkhid_active)
diff --git a/src_plugins/hid_gtk/gui-pinout-preview.c b/src_plugins/hid_gtk/gui-pinout-preview.c
index 1142a84..2773a19 100644
--- a/src_plugins/hid_gtk/gui-pinout-preview.c
+++ b/src_plugins/hid_gtk/gui-pinout-preview.c
@@ -30,16 +30,14 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
-
#include "gui.h"
#include "copy.h"
#include "data.h"
#include "draw.h"
-#include "mymem.h"
#include "move.h"
#include "rotate.h"
+#include "obj_all.h"
#include "gui-pinout-preview.h"
/* Just define a sensible scale, lets say (for example), 100 pixel per 150 mil */
@@ -55,10 +53,10 @@ static void pinout_set_view(GhidPinoutPreview * pinout)
}
-static void pinout_set_data(GhidPinoutPreview * pinout, ElementType * element)
+static void pinout_set_data(GhidPinoutPreview * pinout, pcb_element_t * element)
{
if (element == NULL) {
- FreeElementMemory(&pinout->element);
+ pcb_element_destroy(&pinout->element);
pinout->w_pixels = 0;
pinout->h_pixels = 0;
return;
@@ -70,33 +68,33 @@ static void pinout_set_data(GhidPinoutPreview * pinout, ElementType * element)
* move element to a 5% offset from zero position
* set all package lines/arcs to zero width
*/
- CopyElementLowLevel(NULL, &pinout->element, element, FALSE, 0, 0);
- PIN_LOOP(&pinout->element);
+ pcb_element_copy(NULL, &pinout->element, element, FALSE, 0, 0);
+ PCB_PIN_LOOP(&pinout->element);
{
- SET_FLAG(PCB_FLAG_DISPLAYNAME, pin);
+ PCB_FLAG_SET(PCB_FLAG_DISPLAYNAME, pin);
}
- END_LOOP;
+ PCB_END_LOOP;
- PAD_LOOP(&pinout->element);
+ PCB_PAD_LOOP(&pinout->element);
{
- SET_FLAG(PCB_FLAG_DISPLAYNAME, pad);
+ PCB_FLAG_SET(PCB_FLAG_DISPLAYNAME, pad);
}
- END_LOOP;
+ PCB_END_LOOP;
- MoveElementLowLevel(NULL, &pinout->element,
+ pcb_element_move(NULL, &pinout->element,
conf_core.appearance.pinout.offset_x -
pinout->element.BoundingBox.X1, conf_core.appearance.pinout.offset_y - pinout->element.BoundingBox.Y1);
pinout_set_view(pinout);
- ELEMENTLINE_LOOP(&pinout->element);
+ PCB_ELEMENT_PCB_LINE_LOOP(&pinout->element);
{
line->Thickness = 0;
}
- END_LOOP;
+ PCB_END_LOOP;
- ARC_LOOP(&pinout->element);
+ PCB_ARC_LOOP(&pinout->element);
{
/*
* for whatever reason setting a thickness of 0 causes the arcs to
@@ -105,7 +103,7 @@ static void pinout_set_data(GhidPinoutPreview * pinout, ElementType * element)
*/
arc->Thickness = 1;
}
- END_LOOP;
+ PCB_END_LOOP;
}
@@ -174,7 +172,7 @@ static void ghid_pinout_preview_set_property(GObject * object, guint property_id
switch (property_id) {
case PROP_ELEMENT_DATA:
- pinout_set_data(pinout, (ElementType *) g_value_get_pointer(value));
+ pinout_set_data(pinout, (pcb_element_t *) g_value_get_pointer(value));
if (window != NULL)
gdk_window_invalidate_rect(window, NULL, FALSE);
break;
@@ -275,7 +273,7 @@ GType ghid_pinout_preview_get_type()
*
* \return The GhidPinoutPreview created.
*/
-GtkWidget *ghid_pinout_preview_new(ElementType * element)
+GtkWidget *ghid_pinout_preview_new(pcb_element_t * element)
{
GhidPinoutPreview *pinout_preview;
diff --git a/src_plugins/hid_gtk/gui-pinout-preview.h b/src_plugins/hid_gtk/gui-pinout-preview.h
index 9d18d35..78afd1f 100644
--- a/src_plugins/hid_gtk/gui-pinout-preview.h
+++ b/src_plugins/hid_gtk/gui-pinout-preview.h
@@ -47,7 +47,7 @@ struct _GhidPinoutPreviewClass {
struct _GhidPinoutPreview {
GtkDrawingArea parent_instance;
- ElementType element; /* element data to display */
+ pcb_element_t element; /* element data to display */
gint x_max, y_max;
gint w_pixels, h_pixels; /* natural size of element preview */
};
@@ -55,7 +55,7 @@ struct _GhidPinoutPreview {
GType ghid_pinout_preview_get_type(void);
-GtkWidget *ghid_pinout_preview_new(ElementType * element);
+GtkWidget *ghid_pinout_preview_new(pcb_element_t * element);
void ghid_pinout_preview_get_natural_size(GhidPinoutPreview * pinout, int *width, int *height);
#endif /* PCB_HID_GTK_GUI_PINOUT_PREVIEW_H */
diff --git a/src_plugins/hid_gtk/gui-pinout-window.c b/src_plugins/hid_gtk/gui-pinout-window.c
index 9d13511..2507ae2 100644
--- a/src_plugins/hid_gtk/gui-pinout-window.c
+++ b/src_plugins/hid_gtk/gui-pinout-window.c
@@ -29,15 +29,12 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
-
#include "gui.h"
#include "win_place.h"
#include "copy.h"
#include "data.h"
#include "draw.h"
-#include "mymem.h"
#include "move.h"
#include "rotate.h"
@@ -49,7 +46,7 @@ static void pinout_close_cb(GtkWidget * widget, GtkWidget * top_window)
}
-void ghid_pinout_window_show(GHidPort * out, ElementType * element)
+void ghid_pinout_window_show(GHidPort * out, pcb_element_t * element)
{
GtkWidget *button, *vbox, *hbox, *preview, *top_window;
gchar *title;
@@ -58,7 +55,7 @@ void ghid_pinout_window_show(GHidPort * out, ElementType * element)
if (!element)
return;
title = g_strdup_printf("%s [%s,%s]",
- UNKNOWN(DESCRIPTION_NAME(element)), UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(VALUE_NAME(element)));
+ PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)), PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)));
top_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(top_window), title);
diff --git a/src_plugins/hid_gtk/gui-top-window.c b/src_plugins/hid_gtk/gui-top-window.c
index 6827ff0..2db5136 100644
--- a/src_plugins/hid_gtk/gui-top-window.c
+++ b/src_plugins/hid_gtk/gui-top-window.c
@@ -27,9 +27,9 @@ TODO:
-what about stuff like this:
- /* Set to ! because ActionDisplay toggles it */
+ /* Set to ! because pcb_act_Display toggles it */
conf_core.editor.draw_grid = !gtk_toggle_action_get_active(action);
-hid_actionl("Display", "Grid", "", NULL);
+pcb_hid_actionl("Display", "Grid", "", NULL);
ghid_set_status_line_label();
@@ -65,16 +65,12 @@ I NEED TO DO THE STATUS LINE THING.for example shift - alt - v to change the
#include "buffer.h"
#include "change.h"
#include "copy.h"
-#include "create.h"
#include "crosshair.h"
#include "draw.h"
#include "error.h"
#include "plug_io.h"
#include "find.h"
#include "insert.h"
-#include "line.h"
-#include "mymem.h"
-#include "misc.h"
#include "layer.h"
#include "move.h"
#include "pcb-printf.h"
@@ -82,22 +78,23 @@ I NEED TO DO THE STATUS LINE THING.for example shift - alt - v to change the
#include "rats.h"
#include "remove.h"
#include "rotate.h"
-#include "rubberband.h"
#include "search.h"
#include "select.h"
-#include "set.h"
#include "undo.h"
#include "event.h"
#include "free_atexit.h"
#include "paths.h"
#include "gui-icons-mode-buttons.data"
#include "gui-icons-misc.data"
-#include "gui.h"
#include "win_place.h"
#include "hid_attrib.h"
#include "hid_actions.h"
#include "hid_flags.h"
#include "route_style.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
+#include "obj_line.h"
+#include "layer_vis.h"
static pcb_bool ignore_layer_update;
@@ -107,15 +104,15 @@ GhidGui _ghidgui, *ghidgui = &_ghidgui;
GHidPort ghid_port, *gport;
-hid_cfg_t *ghid_cfg = NULL;
-hid_cfg_mouse_t ghid_mouse;
-hid_cfg_keys_t ghid_keymap;
+pcb_hid_cfg_t *ghid_cfg = NULL;
+pcb_hid_cfg_mouse_t ghid_mouse;
+pcb_hid_cfg_keys_t ghid_keymap;
/*! \brief callback for ghid_main_menu_update_toggle_state () */
void menu_toggle_update_cb(GtkAction * act, const char *tflag, const char *aflag)
{
if (tflag != NULL) {
- int v = hid_get_flag(tflag);
+ int v = pcb_hid_get_flag(tflag);
if (v < 0) {
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), 0);
gtk_action_set_sensitive(act, 0);
@@ -124,7 +121,7 @@ void menu_toggle_update_cb(GtkAction * act, const char *tflag, const char *aflag
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), ! !v);
}
if (aflag != NULL) {
- int v = hid_get_flag(aflag);
+ int v = pcb_hid_get_flag(aflag);
gtk_action_set_sensitive(act, ! !v);
}
}
@@ -166,7 +163,7 @@ static void info_bar_response_cb(GtkInfoBar * info_bar, gint response_id, GhidGu
_gui->info_bar = NULL;
if (response_id == GTK_RESPONSE_ACCEPT)
- RevertPCB();
+ pcb_revert_pcb();
}
static void close_file_modified_externally_prompt(void)
@@ -281,13 +278,13 @@ static void ghid_menu_cb(GtkAction * action, const lht_node_t * node)
if (action == NULL || node == NULL)
return;
- hid_cfg_action(node);
+ pcb_hid_cfg_action(node);
/* Sync gui widgets with pcb state */
ghid_mode_buttons_update();
/* Sync gui status display with pcb state */
- AdjustAttachedObjects();
+ pcb_adjust_attached_objects();
ghid_invalidate_all();
ghid_window_set_name_label(PCB->Name);
ghid_set_status_line_label();
@@ -368,6 +365,7 @@ static void layer_process(const gchar ** color_string, const char **text, int *s
int tmp;
const char *tmps;
const gchar *tmpc;
+ pcb_layer_t *l;
/* cheap hack to let users pass in NULL for either text or set if
* they don't care about the result
@@ -413,10 +411,21 @@ static void layer_process(const gchar ** color_string, const char **text, int *s
*text = _("solder mask");
*set = conf_core.editor.show_mask;
break;
+ case LAYER_BUTTON_UI:
default: /* layers */
- *color_string = conf_core.appearance.color.layer[i];
- *text = (char *) UNKNOWN(PCB->Data->Layer[i].Name);
- *set = PCB->Data->Layer[i].On;
+ if (i >= LAYER_BUTTON_UI) {
+ i -= LAYER_BUTTON_UI;
+ l = pcb_get_layer(PCB_LYT_UI + i);
+ *color_string = l->Color;
+ *text = l->Name;
+ *set = l->On;
+ }
+ else {
+ /* plain old copper layer */
+ *color_string = conf_core.appearance.color.layer[i];
+ *text = (char *) PCB_UNKNOWN(PCB->Data->Layer[i].Name);
+ *set = PCB->Data->Layer[i].On;
+ }
break;
}
}
@@ -430,14 +439,14 @@ static void layer_selector_select_callback(GHidLayerSelector * ls, int layer, gp
PCB->RatDraw = (layer == LAYER_BUTTON_RATS);
if (layer == LAYER_BUTTON_SILK) {
PCB->ElementOn = pcb_true;
- hid_action("LayersChanged");
+ ghid_LayersChanged(0, 0, 0);
}
else if (layer == LAYER_BUTTON_RATS) {
PCB->RatOn = pcb_true;
- hid_action("LayersChanged");
+ ghid_LayersChanged(0, 0, 0);
}
- else if (layer < max_copper_layer)
- ChangeGroupVisibility(layer, TRUE, pcb_true);
+ else if (layer < pcb_max_copper_layer)
+ pcb_layervis_change_group_vis(layer, TRUE, pcb_true);
ignore_layer_update = pcb_false;
@@ -486,7 +495,12 @@ static void layer_selector_toggle_callback(GHidLayerSelector * ls, int layer, gp
break;
default:
/* Flip the visibility */
- ChangeGroupVisibility(layer, active, pcb_false);
+ if (layer >= LAYER_BUTTON_UI) {
+ layer -= LAYER_BUTTON_UI;
+ layer |= PCB_LYT_UI;
+ }
+
+ pcb_layervis_change_group_vis(layer, active, pcb_false);
redraw = TRUE;
break;
}
@@ -541,7 +555,7 @@ void ghid_window_set_name_label(gchar * name)
ghidgui->name_label_string = g_strdup(_("Unnamed"));
if (!PCB->Filename || !*PCB->Filename)
- filename = g_strdup(_("Unsaved.pcb"));
+ filename = g_strdup(_("<board with no file name or format>"));
else
filename = g_strdup(PCB->Filename);
@@ -555,9 +569,9 @@ static void grid_units_button_cb(GtkWidget * widget, gpointer data)
{
/* Button only toggles between mm and mil */
if (conf_core.editor.grid_unit == get_unit_struct("mm"))
- hid_actionl("SetUnits", "mil", NULL);
+ pcb_hid_actionl("SetUnits", "mil", NULL);
else
- hid_actionl("SetUnits", "mm", NULL);
+ pcb_hid_actionl("SetUnits", "mm", NULL);
}
/*
@@ -633,6 +647,7 @@ static void make_virtual_layer_buttons(GtkWidget * layer_selector)
const gchar *text;
const gchar *color_string;
gboolean active;
+ pcb_layer_id_t ui[16], numui, n;
layer_process(&color_string, &text, &active, LAYER_BUTTON_SILK);
ghid_layer_selector_add_layer(layersel, LAYER_BUTTON_SILK, text, color_string, active, TRUE);
@@ -646,6 +661,12 @@ static void make_virtual_layer_buttons(GtkWidget * layer_selector)
ghid_layer_selector_add_layer(layersel, LAYER_BUTTON_FARSIDE, text, color_string, active, FALSE);
layer_process(&color_string, &text, &active, LAYER_BUTTON_MASK);
ghid_layer_selector_add_layer(layersel, LAYER_BUTTON_MASK, text, color_string, active, FALSE);
+
+ numui = pcb_layer_list(PCB_LYT_UI, ui, sizeof(ui)/sizeof(ui[0]));
+ for(n = 0; n < numui; n++) {
+ pcb_layer_t *l = pcb_get_layer(ui[n]);
+ ghid_layer_selector_add_layer(layersel, LAYER_BUTTON_UI, l->Name, l->Color, 1, FALSE);
+ }
}
/*! \brief callback for ghid_layer_selector_update_colors */
@@ -671,7 +692,7 @@ static void make_layer_buttons(GtkWidget * layersel)
const gchar *color_string;
gboolean active = TRUE;
- for (i = 0; i < max_copper_layer; ++i) {
+ for (i = 0; i < pcb_max_copper_layer; ++i) {
layer_process(&color_string, &text, &active, i);
ghid_layer_selector_add_layer(GHID_LAYER_SELECTOR(layersel), i, text, color_string, active, TRUE);
}
@@ -681,7 +702,7 @@ static void make_layer_buttons(GtkWidget * layersel)
/*! \brief callback for ghid_layer_selector_delete_layers */
gboolean get_layer_delete(gint layer)
{
- return layer >= max_copper_layer;
+ return layer >= pcb_max_copper_layer;
}
/*! \brief Synchronize layer selector widget with current PCB state
@@ -707,7 +728,7 @@ void ghid_layer_buttons_update(void)
else if (PCB->SilkActive)
layer = LAYER_BUTTON_SILK;
else
- layer = LayerStack[0];
+ layer = pcb_layer_stack[0];
ghid_layer_selector_select_layer(GHID_LAYER_SELECTOR(ghidgui->layer_selector), layer);
}
@@ -715,15 +736,15 @@ void ghid_layer_buttons_update(void)
/*! \brief Called when user clicks OK on route style dialog */
static void route_styles_edited_cb(GHidRouteStyleSelector * rss, gboolean save, gpointer data)
{
- conf_setf(CFR_DESIGN, "design/routes", -1, "%s", make_route_string(&PCB->RouteStyle));
+ conf_setf(CFR_DESIGN, "design/routes", -1, "%s", pcb_route_string_make(&PCB->RouteStyle));
if (save)
- conf_setf(CFR_USER, "design/routes", -1, "%s", make_route_string(&PCB->RouteStyle));
+ conf_setf(CFR_USER, "design/routes", -1, "%s", pcb_route_string_make(&PCB->RouteStyle));
ghid_main_menu_install_route_style_selector
(GHID_MAIN_MENU(ghidgui->menu_bar), GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector));
}
/*! \brief Called when a route style is selected */
-static void route_style_changed_cb(GHidRouteStyleSelector * rss, RouteStyleType * rst, gpointer data)
+static void route_style_changed_cb(GHidRouteStyleSelector * rss, pcb_route_style_t * rst, gpointer data)
{
pcb_use_route_style(rst);
ghid_set_status_line_label();
@@ -779,7 +800,7 @@ static gint n_mode_buttons = G_N_ELEMENTS(mode_buttons);
static void do_set_mode(int mode)
{
- SetMode(mode);
+ pcb_crosshair_set_mode(mode);
ghid_mode_cursor(mode);
ghidgui->settings_mode = mode;
}
@@ -936,7 +957,7 @@ static gint delete_chart_cb(GtkWidget * widget, GdkEvent * event, GHidPort * por
if (ghid_entry_loop != NULL)
g_main_loop_quit(ghid_entry_loop);
- hid_action("Quit");
+ pcb_hid_action("Quit");
/*
* Return TRUE to keep our app running. A FALSE here would let the
@@ -1302,7 +1323,7 @@ void ghid_create_pcb_widgets(void)
ghid_update_toggle_flags();
ghid_init_icons(port);
- SetMode(PCB_MODE_ARROW);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
ghid_mode_buttons_update();
}
@@ -1316,7 +1337,7 @@ static gboolean ghid_listener_cb(GIOChannel * source, GIOCondition condition, gp
if (condition & G_IO_HUP) {
- gui->log("Read end of pipe died!\n");
+ pcb_gui->log("Read end of pipe died!\n");
return FALSE;
}
@@ -1324,22 +1345,22 @@ static gboolean ghid_listener_cb(GIOChannel * source, GIOCondition condition, gp
status = g_io_channel_read_line(source, &str, &len, &term, &err);
switch (status) {
case G_IO_STATUS_NORMAL:
- hid_parse_actions(str);
+ pcb_hid_parse_actions(str);
g_free(str);
break;
case G_IO_STATUS_ERROR:
- gui->log("ERROR status from g_io_channel_read_line\n");
+ pcb_gui->log("ERROR status from g_io_channel_read_line\n");
return FALSE;
break;
case G_IO_STATUS_EOF:
- gui->log("Input pipe returned EOF. The --listen option is \n" "probably not running anymore in this session.\n");
+ pcb_gui->log("Input pipe returned EOF. The --listen option is \n" "probably not running anymore in this session.\n");
return FALSE;
break;
case G_IO_STATUS_AGAIN:
- gui->log("AGAIN status from g_io_channel_read_line\n");
+ pcb_gui->log("AGAIN status from g_io_channel_read_line\n");
return FALSE;
break;
@@ -1370,7 +1391,7 @@ static void ghid_create_listener(void)
int ghid_usage(const char *topic)
{
fprintf(stderr, "\nGTK GUI command line arguments:\n\n");
- conf_usage("plugins/hid_gtk", hid_usage_option);
+ conf_usage("plugins/hid_gtk", pcb_hid_usage_option);
fprintf(stderr, "\nInvocation: pcb-rnd --gui gtk [options]\n");
return 0;
}
@@ -1431,7 +1452,7 @@ void ghid_parse_arguments(int *argc, char ***argv)
gport = &ghid_port;
gport->view.coord_per_px = 300.0;
- pixel_slop = 300;
+ pcb_pixel_slop = 300;
ghid_init_renderer(argc, argv, gport);
@@ -1459,11 +1480,11 @@ static unsigned short int ghid_translate_key(const char *desc, int len)
{
guint key;
- if (strcasecmp(desc, "enter") == 0) desc = "Return";
+ if (pcb_strcasecmp(desc, "enter") == 0) desc = "Return";
key = gdk_keyval_from_name(desc);
if (key > 0xffff) {
- Message(PCB_MSG_DEFAULT, "Ignoring invalid/exotic key sym: '%s'\n", desc);
+ pcb_message(PCB_MSG_WARNING, "Ignoring invalid/exotic key sym: '%s'\n", desc);
return 0;
}
return key;
@@ -1479,11 +1500,11 @@ int ghid_key_name(unsigned short int key_char, char *out, int out_len)
return 0;
}
-void ghid_do_export(HID_Attr_Val * options)
+void ghid_do_export(pcb_hid_attr_val_t * options)
{
gtkhid_begin();
- hid_cfg_keys_init(&ghid_keymap);
+ pcb_hid_cfg_keys_init(&ghid_keymap);
ghid_keymap.translate_key = ghid_translate_key;
ghid_keymap.key_name = ghid_key_name;
ghid_keymap.auto_chr = 1;
@@ -1503,14 +1524,14 @@ void ghid_do_export(HID_Attr_Val * options)
ghid_notify_gui_is_up();
- event(EVENT_GUI_INIT, NULL);
+ pcb_event(PCB_EVENT_GUI_INIT, NULL);
gtk_main();
- hid_cfg_keys_uninit(&ghid_keymap);
+ pcb_hid_cfg_keys_uninit(&ghid_keymap);
gtkhid_end();
}
-void ghid_do_exit(HID *hid)
+void ghid_do_exit(pcb_hid_t *hid)
{
gtk_main_quit();
}
@@ -1537,10 +1558,10 @@ static gboolean get_layer_visible_cb(int id)
return visible;
}
-gint LayersChanged(int argc, const char **argv, Coord x, Coord y)
+void ghid_LayersChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
- if (!ghidgui || !ghidgui->menu_bar)
- return 0;
+ if (!ghidgui || !ghidgui->menu_bar || PCB == NULL)
+ return;
ghid_config_groups_changed();
ghid_layer_buttons_update();
@@ -1552,7 +1573,7 @@ gint LayersChanged(int argc, const char **argv, Coord x, Coord y)
| the way it will be when the pcb is reloaded.
*/
pcb_colors_from_settings(PCB);
- return 0;
+ return;
}
static const char toggleview_syntax[] =
@@ -1573,16 +1594,17 @@ the same as a special layer, the layer is chosen over the special layer.
%end-doc */
-static int ToggleView(int argc, const char **argv, Coord x, Coord y)
+static int ToggleView(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- int i, l;
+ pcb_cardinal_t i;
+ int l;
#ifdef DEBUG_MENUS
puts("Starting ToggleView().");
#endif
if (argc == 0) {
- AFAIL(toggleview);
+ PCB_AFAIL(toggleview);
}
if (isdigit((int) argv[0][0])) {
l = atoi(argv[0]) - 1;
@@ -1601,15 +1623,15 @@ static int ToggleView(int argc, const char **argv, Coord x, Coord y)
l = LAYER_BUTTON_FARSIDE;
else {
l = -1;
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
if (strcmp(argv[0], PCB->Data->Layer[i].Name) == 0) {
l = i;
break;
}
- if (l == -1) {
- AFAIL(toggleview);
}
-
+#warning layer TODO: also check for UI layer names
+ if (l == -1)
+ PCB_AFAIL(toggleview);
}
/* Now that we've figured out which toggle button ought to control
@@ -1630,15 +1652,15 @@ visible if it is not already visible
%end-doc */
-static int SelectLayer(int argc, const char **argv, Coord x, Coord y)
+static int SelectLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int newl;
if (argc == 0)
- AFAIL(selectlayer);
+ PCB_AFAIL(selectlayer);
- if (strcasecmp(argv[0], "silk") == 0)
+ if (pcb_strcasecmp(argv[0], "silk") == 0)
newl = LAYER_BUTTON_SILK;
- else if (strcasecmp(argv[0], "rats") == 0)
+ else if (pcb_strcasecmp(argv[0], "rats") == 0)
newl = LAYER_BUTTON_RATS;
else
newl = atoi(argv[0]) - 1;
@@ -1656,10 +1678,7 @@ static int SelectLayer(int argc, const char **argv, Coord x, Coord y)
}
-HID_Action gtk_topwindow_action_list[] = {
- {"LayersChanged", 0, LayersChanged,
- layerschanged_help, layerschanged_syntax}
- ,
+pcb_hid_action_t gtk_topwindow_action_list[] = {
{"SelectLayer", 0, SelectLayer,
selectlayer_help, selectlayer_syntax}
,
@@ -1667,7 +1686,7 @@ HID_Action gtk_topwindow_action_list[] = {
toggleview_help, toggleview_syntax}
};
-REGISTER_ACTIONS(gtk_topwindow_action_list, ghid_cookie)
+PCB_REGISTER_ACTIONS(gtk_topwindow_action_list, ghid_cookie)
static GtkWidget *ghid_load_menus(void)
{
@@ -1675,19 +1694,19 @@ static GtkWidget *ghid_load_menus(void)
GtkWidget *menu_bar = NULL;
extern const char *hid_gtk_menu_default;
- ghid_cfg = hid_cfg_load("gtk", 0, hid_gtk_menu_default);
+ ghid_cfg = pcb_hid_cfg_load("gtk", 0, hid_gtk_menu_default);
if (ghid_cfg == NULL) {
- Message(PCB_MSG_DEFAULT, "FATAL: can't load the gtk menu res either from file or from hardwired default.");
+ pcb_message(PCB_MSG_ERROR, "FATAL: can't load the gtk menu res either from file or from hardwired default.");
abort();
}
- mr = hid_cfg_get_menu(ghid_cfg, "/main_menu");
+ mr = pcb_hid_cfg_get_menu(ghid_cfg, "/main_menu");
if (mr != NULL) {
menu_bar = ghid_main_menu_new(G_CALLBACK(ghid_menu_cb));
ghid_main_menu_add_node(GHID_MAIN_MENU(menu_bar), mr);
}
- mr = hid_cfg_get_menu(ghid_cfg, "/popups");
+ mr = pcb_hid_cfg_get_menu(ghid_cfg, "/popups");
if (mr != NULL) {
if (mr->type == LHT_LIST) {
lht_node_t *n;
@@ -1695,16 +1714,16 @@ static GtkWidget *ghid_load_menus(void)
ghid_main_menu_add_popup_node(GHID_MAIN_MENU(menu_bar), n);
}
else
- hid_cfg_error(mr, "/popups should be a list");
+ pcb_hid_cfg_error(mr, "/popups should be a list");
}
#ifdef DEBUG_MENUS
puts("Finished loading menus.");
#endif
- mr = hid_cfg_get_menu(ghid_cfg, "/mouse");
+ mr = pcb_hid_cfg_get_menu(ghid_cfg, "/mouse");
if (hid_cfg_mouse_init(ghid_cfg, &ghid_mouse) != 0)
- Message(PCB_MSG_DEFAULT, "Error: failed to load mouse actions from the hid config lihata - mouse input will not work.");
+ pcb_message(PCB_MSG_ERROR, "Error: failed to load mouse actions from the hid config lihata - mouse input will not work.");
return menu_bar;
}
@@ -1721,10 +1740,10 @@ Opens the window which allows editing of the route styles.
%end-doc */
-static int AdjustStyle(int argc, const char **argv, Coord x, Coord y)
+static int AdjustStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (argc > 1)
- AFAIL(adjuststyle);
+ PCB_AFAIL(adjuststyle);
ghid_route_style_selector_edit_dialog(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector));
return 0;
@@ -1744,23 +1763,23 @@ lht compatibility with the lesstif HID.
%end-doc */
-static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y)
+static int EditLayerGroups(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (argc != 0)
- AFAIL(editlayergroups);
+ PCB_AFAIL(editlayergroups);
- hid_actionl("DoWindows", "Preferences", NULL);
+ pcb_hid_actionl("DoWindows", "Preferences", NULL);
return 0;
}
/* ------------------------------------------------------------ */
-HID_Action ghid_menu_action_list[] = {
+pcb_hid_action_t ghid_menu_action_list[] = {
{"AdjustStyle", 0, AdjustStyle, adjuststyle_help, adjuststyle_syntax}
,
{"EditLayerGroups", 0, EditLayerGroups, editlayergroups_help, editlayergroups_syntax}
};
-REGISTER_ACTIONS(ghid_menu_action_list, ghid_cookie)
+PCB_REGISTER_ACTIONS(ghid_menu_action_list, ghid_cookie)
diff --git a/src_plugins/hid_gtk/gui-utils.c b/src_plugins/hid_gtk/gui-utils.c
index 47ce04f..70c1c1a 100644
--- a/src_plugins/hid_gtk/gui-utils.c
+++ b/src_plugins/hid_gtk/gui-utils.c
@@ -211,8 +211,8 @@ ghid_check_button_connected(GtkWidget * box,
}
void
-ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, Coord value,
- Coord low, Coord high, enum ce_step_size step_size, const Unit *u,
+ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, pcb_coord_t value,
+ pcb_coord_t low, pcb_coord_t high, enum ce_step_size step_size, const pcb_unit_t *u,
gint width, void (*cb_func) (GHidCoordEntry *, gpointer), gpointer data, const gchar * string_pre, const gchar * string_post)
{
GtkWidget *hbox = NULL, *label, *entry_widget;
@@ -295,8 +295,8 @@ ghid_spin_button(GtkWidget * box, GtkWidget ** spin_button, gfloat value,
void
ghid_table_coord_entry(GtkWidget * table, gint row, gint column,
- GtkWidget ** coord_entry, Coord value,
- Coord low, Coord high, enum ce_step_size step_size,
+ GtkWidget ** coord_entry, pcb_coord_t value,
+ pcb_coord_t low, pcb_coord_t high, enum ce_step_size step_size,
gint width, void (*cb_func) (GHidCoordEntry *, gpointer),
gpointer data, gboolean right_align, const gchar * string)
{
@@ -402,7 +402,7 @@ ghid_range_control(GtkWidget * box, GtkWidget ** scale_res,
gtk_scale_set_draw_value(GTK_SCALE(scale), set_draw_value);
gtk_scale_set_digits(GTK_SCALE(scale), digits);
- /* Increments don't make sense, use -1,1 because that does closest to
+ /* pcb_increments_t don't make sense, use -1,1 because that does closest to
| what I want: scroll down decrements slider value.
*/
gtk_range_set_increments(GTK_RANGE(scale), -1, 1);
diff --git a/src_plugins/hid_gtk/gui.h b/src_plugins/hid_gtk/gui.h
index b309eb8..db54deb 100644
--- a/src_plugins/hid_gtk/gui.h
+++ b/src_plugins/hid_gtk/gui.h
@@ -25,13 +25,13 @@
#ifndef PCB_HID_GTK_GHID_H
#define PCB_HID_GTK_GHID_H
-#include "global.h"
+#include "config.h"
+#include "board.h"
#include "hid.h"
#include "hid_cfg.h"
#include "hid_cfg_input.h"
#include "data.h"
-#include "misc.h"
#include <gtk/gtk.h>
#include "ghid-coord-entry.h"
@@ -48,23 +48,24 @@
| gui code in gui-top-window.c and group code in misc.c must agree
| on what layer is what!
*/
-#define LAYER_BUTTON_SILK MAX_LAYER
-#define LAYER_BUTTON_RATS (MAX_LAYER + 1)
+#define LAYER_BUTTON_SILK PCB_MAX_LAYER
+#define LAYER_BUTTON_RATS (PCB_MAX_LAYER + 1)
#define N_SELECTABLE_LAYER_BUTTONS (LAYER_BUTTON_RATS + 1)
-#define LAYER_BUTTON_PINS (MAX_LAYER + 2)
-#define LAYER_BUTTON_VIAS (MAX_LAYER + 3)
-#define LAYER_BUTTON_FARSIDE (MAX_LAYER + 4)
-#define LAYER_BUTTON_MASK (MAX_LAYER + 5)
-#define N_LAYER_BUTTONS (MAX_LAYER + 6)
+#define LAYER_BUTTON_PINS (PCB_MAX_LAYER + 2)
+#define LAYER_BUTTON_VIAS (PCB_MAX_LAYER + 3)
+#define LAYER_BUTTON_FARSIDE (PCB_MAX_LAYER + 4)
+#define LAYER_BUTTON_MASK (PCB_MAX_LAYER + 5)
+#define LAYER_BUTTON_UI (PCB_MAX_LAYER + 6)
+#define N_LAYER_BUTTONS (PCB_MAX_LAYER + 7)
/* Go from from the grid units in use (millimeters or mils) to PCB units
| and back again.
| PCB keeps values internally higher precision, but gui
| widgets (spin buttons, labels, etc) need mils or millimeters.
*/
-#define FROM_PCB_UNITS(v) coord_to_unit (conf_core.editor.grid_unit, v)
-#define TO_PCB_UNITS(v) unit_to_coord (conf_core.editor.grid_unit, v)
+#define FROM_PCB_UNITS(v) pcb_coord_to_unit(conf_core.editor.grid_unit, v)
+#define TO_PCB_UNITS(v) pcb_unit_to_coord(conf_core.editor.grid_unit, v)
#define SIDE_X(x) ((conf_core.editor.view.flip_x ? PCB->MaxWidth - (x) : (x)))
#define SIDE_Y(y) ((conf_core.editor.view.flip_y ? PCB->MaxHeight - (y) : (y)))
@@ -134,10 +135,10 @@ extern GhidGui _ghidgui, *ghidgui;
typedef struct {
double coord_per_px; /* Zoom level described as PCB units per screen pixel */
- Coord x0;
- Coord y0;
- Coord width;
- Coord height;
+ pcb_coord_t x0;
+ pcb_coord_t y0;
+ pcb_coord_t width;
+ pcb_coord_t height;
} view_data;
@@ -163,21 +164,21 @@ typedef struct {
gboolean panning;
view_data view;
- Coord pcb_x, pcb_y; /* PCB coordinates of the mouse pointer */
- Coord crosshair_x, crosshair_y; /* PCB coordinates of the crosshair */
+ pcb_coord_t pcb_x, pcb_y; /* PCB coordinates of the mouse pointer */
+ pcb_coord_t crosshair_x, crosshair_y; /* PCB coordinates of the crosshair */
} GHidPort;
extern GHidPort ghid_port, *gport;
typedef enum {
NONE_PRESSED = 0,
- SHIFT_PRESSED = M_Shift,
- CONTROL_PRESSED = M_Ctrl,
- MOD1_PRESSED = M_Mod1,
- SHIFT_CONTROL_PRESSED = M_Shift | M_Ctrl,
- SHIFT_MOD1_PRESSED = M_Shift | M_Mod1,
- CONTROL_MOD1_PRESSED = M_Ctrl | M_Mod1,
- SHIFT_CONTROL_MOD1_PRESSED = M_Shift | M_Ctrl | M_Mod1
+ SHIFT_PRESSED = PCB_M_Shift,
+ CONTROL_PRESSED = PCB_M_Ctrl,
+ MOD1_PRESSED = PCB_M_Mod1,
+ SHIFT_CONTROL_PRESSED = PCB_M_Shift | PCB_M_Ctrl,
+ SHIFT_MOD1_PRESSED = PCB_M_Shift | PCB_M_Mod1,
+ CONTROL_MOD1_PRESSED = PCB_M_Ctrl | PCB_M_Mod1,
+ SHIFT_CONTROL_MOD1_PRESSED = PCB_M_Shift | PCB_M_Ctrl | PCB_M_Mod1
} ModifierKeysState;
typedef enum {
@@ -190,8 +191,8 @@ typedef enum {
/* Function prototypes
*/
void ghid_parse_arguments(gint * argc, gchar *** argv);
-void ghid_do_export(HID_Attr_Val * options);
-void ghid_do_exit(HID *hid);
+void ghid_do_export(pcb_hid_attr_val_t * options);
+void ghid_do_exit(pcb_hid_t *hid);
void ghid_create_pcb_widgets(void);
void ghid_window_set_name_label(gchar * name);
@@ -213,8 +214,8 @@ void ghid_config_groups_changed(void);
void ghid_config_init(void);
void ghid_wgeo_save(int save_to_file, int skip_user);
-void ghid_conf_save_pre_wgeo(void *user_data, int argc, event_arg_t * argv[]);
-void ghid_conf_load_post_wgeo(void *user_data, int argc, event_arg_t * argv[]);
+void ghid_conf_save_pre_wgeo(void *user_data, int argc, pcb_event_arg_t argv[]);
+void ghid_conf_load_post_wgeo(void *user_data, int argc, pcb_event_arg_t argv[]);
void ghid_mode_buttons_update(void);
void ghid_pack_mode_buttons(void);
@@ -267,7 +268,7 @@ gint ghid_port_drawing_area_configure_event_cb(GtkWidget * widget, GdkEventConfi
#define GUI_DIALOG_RESPONSE_ALL 1
gchar *ghid_dialog_file_select_open(const gchar * title, gchar ** path, const gchar * shortcuts);
-gchar *ghid_dialog_file_select_save(const gchar * title, gchar ** path, const gchar * file, const gchar * shortcuts, const char **formats, int *format);
+gchar *ghid_dialog_file_select_save(const gchar * title, gchar ** path, const gchar * file, const gchar * shortcuts, const char **formats, const char **extensions, int *format);
void ghid_dialog_message(gchar * message);
gboolean ghid_dialog_confirm(const gchar * message, const gchar * cancelmsg, const gchar * okmsg);
int ghid_dialog_close_confirm(void);
@@ -283,14 +284,14 @@ char *ghid_fileselect(const char *, const char *, const char *, const char *, co
/* gui-dialog-print.c */
void ghid_dialog_export(void);
-void ghid_dialog_print(HID *);
+void ghid_dialog_print(pcb_hid_t *);
-int ghid_attribute_dialog(HID_Attribute *, int, HID_Attr_Val *, const char *, const char *);
+int ghid_attribute_dialog(pcb_hid_attribute_t *, int, pcb_hid_attr_val_t *, const char *, const char *);
/* gui-drc-window.c */
void ghid_drc_window_show(gboolean raise);
void ghid_drc_window_reset_message(void);
-void ghid_drc_window_append_violation(DrcViolationType * violation);
+void ghid_drc_window_append_violation(pcb_drc_violation_t * violation);
void ghid_drc_window_append_messagev(const char *fmt, va_list va);
int ghid_drc_window_throw_dialog(void);
@@ -323,8 +324,8 @@ void ghid_check_button_connected(GtkWidget * box, GtkWidget ** button,
gboolean active, gboolean pack_start,
gboolean expand, gboolean fill, gint pad,
void (*cb_func) (GtkToggleButton *, gpointer), gpointer data, const gchar * string);
-void ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, Coord value,
- Coord low, Coord high, enum ce_step_size step_size, const Unit *u,
+void ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, pcb_coord_t value,
+ pcb_coord_t low, pcb_coord_t high, enum ce_step_size step_size, const pcb_unit_t *u,
gint width, void (*cb_func) (GHidCoordEntry *, gpointer),
gpointer data, const gchar * string_pre, const gchar * string_post);
void ghid_spin_button(GtkWidget * box, GtkWidget ** spin_button,
@@ -332,8 +333,8 @@ void ghid_spin_button(GtkWidget * box, GtkWidget ** spin_button,
gfloat step1, gint digits, gint width,
void (*cb_func) (GtkSpinButton *, gpointer), gpointer data, gboolean right_align, const gchar * string);
void ghid_table_coord_entry(GtkWidget * table, gint row, gint column,
- GtkWidget ** coord_entry, Coord value,
- Coord low, Coord high, enum ce_step_size, gint width,
+ GtkWidget ** coord_entry, pcb_coord_t value,
+ pcb_coord_t low, pcb_coord_t high, enum ce_step_size, gint width,
void (*cb_func) (GHidCoordEntry *, gpointer), gpointer data, gboolean right_align, const gchar * string);
void ghid_table_spin_button(GtkWidget * box, gint row, gint column,
GtkWidget ** spin_button, gfloat value,
@@ -379,7 +380,7 @@ void ghid_netlist_window_create(GHidPort * out);
void ghid_netlist_window_show(GHidPort * out, gboolean raise);
void ghid_netlist_window_update(gboolean init_nodes);
-LibraryMenuType *ghid_get_net_from_node_name(const gchar * name, gboolean);
+pcb_lib_menu_t *ghid_get_net_from_node_name(const gchar * name, gboolean);
void ghid_netlist_highlight_node(const gchar * name);
@@ -404,24 +405,24 @@ void ghid_log(const char *fmt, ...);
void ghid_logv(enum pcb_message_level level, const char *fmt, va_list args);
/* gui-pinout-window.c */
-void ghid_pinout_window_show(GHidPort * out, ElementTypePtr Element);
+void ghid_pinout_window_show(GHidPort * out, pcb_element_t *Element);
/* gtkhid-gdk.c AND gtkhid-gl.c */
-int ghid_set_layer(const char *name, int group, int empty);
-hidGC ghid_make_gc(void);
-void ghid_destroy_gc(hidGC);
+int ghid_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty);
+pcb_hid_gc_t ghid_make_gc(void);
+void ghid_destroy_gc(pcb_hid_gc_t);
void ghid_use_mask(int use_it);
-void ghid_set_color(hidGC gc, const char *name);
-void ghid_set_line_cap(hidGC gc, EndCapStyle style);
-void ghid_set_line_width(hidGC gc, Coord width);
-void ghid_set_draw_xor(hidGC gc, int _xor);
-void ghid_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-void ghid_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle);
-void ghid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-void ghid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius);
-void ghid_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y);
-void ghid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2);
-void ghid_invalidate_lr(int left, int right, int top, int bottom);
+void ghid_set_color(pcb_hid_gc_t gc, const char *name);
+void ghid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style);
+void ghid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width);
+void ghid_set_draw_xor(pcb_hid_gc_t gc, int _xor);
+void ghid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle);
+void ghid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void ghid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
+void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y);
+void ghid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void ghid_invalidate_lr(pcb_coord_t left, pcb_coord_t right, pcb_coord_t top, pcb_coord_t bottom);
void ghid_invalidate_all();
void ghid_notify_crosshair_change(pcb_bool changes_complete);
void ghid_notify_mark_change(pcb_bool changes_complete);
@@ -434,21 +435,18 @@ gboolean ghid_drawing_area_expose_cb(GtkWidget *, GdkEventExpose *, GHidPort *);
void ghid_port_drawing_realize_cb(GtkWidget *, gpointer);
gboolean ghid_pinout_preview_expose(GtkWidget * widget, GdkEventExpose * ev);
GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height, int depth);
-HID *ghid_request_debug_draw(void);
+pcb_hid_t *ghid_request_debug_draw(void);
void ghid_flush_debug_draw(void);
void ghid_finish_debug_draw(void);
-pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * pcb_y);
-pcb_bool ghid_pcb_to_event_coords(Coord pcb_x, Coord pcb_y, int *event_x, int *event_y);
+pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, pcb_coord_t * pcb_x, pcb_coord_t * pcb_y);
+pcb_bool ghid_pcb_to_event_coords(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int *event_x, int *event_y);
-void ghid_lead_user_to_location(Coord x, Coord y);
+void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y);
void ghid_cancel_lead_user(void);
/* gtkhid-main.c */
-void ghid_pan_view_rel(Coord dx, Coord dy);
-void ghid_get_coords(const char *msg, Coord * x, Coord * y);
-gint PCBChanged(int argc, const char **argv, Coord x, Coord y);
-
-
+void ghid_pan_view_rel(pcb_coord_t dx, pcb_coord_t dy);
+void ghid_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y);
extern GdkPixmap *XC_hand_source, *XC_hand_mask;
@@ -458,7 +456,7 @@ extern GdkPixmap *XC_clock_source, *XC_clock_mask;
/* Coordinate conversions */
/* Px converts view->pcb, Vx converts pcb->view */
-static inline int Vx(Coord x)
+static inline int Vx(pcb_coord_t x)
{
double rv;
if (conf_core.editor.view.flip_x)
@@ -468,7 +466,7 @@ static inline int Vx(Coord x)
return pcb_round(rv);
}
-static inline int Vy(Coord y)
+static inline int Vy(pcb_coord_t y)
{
double rv;
if (conf_core.editor.view.flip_y)
@@ -478,36 +476,36 @@ static inline int Vy(Coord y)
return pcb_round(rv);
}
-static inline int Vz(Coord z)
+static inline int Vz(pcb_coord_t z)
{
return pcb_round((double)z / gport->view.coord_per_px + 0.5);
}
-static inline Coord Px(int x)
+static inline pcb_coord_t Px(int x)
{
- Coord rv = x * gport->view.coord_per_px + gport->view.x0;
+ pcb_coord_t rv = x * gport->view.coord_per_px + gport->view.x0;
if (conf_core.editor.view.flip_x)
rv = PCB->MaxWidth - (x * gport->view.coord_per_px + gport->view.x0);
return rv;
}
-static inline Coord Py(int y)
+static inline pcb_coord_t Py(int y)
{
- Coord rv = y * gport->view.coord_per_px + gport->view.y0;
+ pcb_coord_t rv = y * gport->view.coord_per_px + gport->view.y0;
if (conf_core.editor.view.flip_y)
rv = PCB->MaxHeight - (y * gport->view.coord_per_px + gport->view.y0);
return rv;
}
-static inline Coord Pz(int z)
+static inline pcb_coord_t Pz(int z)
{
return (z * gport->view.coord_per_px);
}
extern const char *ghid_cookie;
extern const char *ghid_menu_cookie;
-extern hid_cfg_mouse_t ghid_mouse;
-extern hid_cfg_keys_t ghid_keymap;
+extern pcb_hid_cfg_mouse_t ghid_mouse;
+extern pcb_hid_cfg_keys_t ghid_keymap;
extern int ghid_wheel_zoom;
int ghid_usage(const char *topic);
@@ -518,10 +516,14 @@ void ghid_confchg_line_refraction(conf_native_t *cfg);
void ghid_confchg_all_direction_lines(conf_native_t *cfg);
void ghid_confchg_fullscreen(conf_native_t *cfg);
void ghid_confchg_checkbox(conf_native_t *cfg);
-void ghid_draw_grid_local(Coord cx, Coord cy);
+void ghid_confchg_flip(conf_native_t *cfg);
+
+void ghid_draw_grid_local(pcb_coord_t cx, pcb_coord_t cy);
void ghid_fullscreen_apply(void);
GMainLoop *ghid_entry_loop;
+void ghid_LayersChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+
#endif /* PCB_HID_GTK_GHID_GUI_H */
diff --git a/src_plugins/hid_gtk/win_place.c b/src_plugins/hid_gtk/win_place.c
index 8404e0c..e01c057 100644
--- a/src_plugins/hid_gtk/win_place.c
+++ b/src_plugins/hid_gtk/win_place.c
@@ -20,6 +20,7 @@
*
*/
+#include "config.h"
#include "win_place.h"
#define CONF_PREFIX "plugins/hid_gtk/window_geometry/"
@@ -45,12 +46,15 @@ void wplc_place(wplc_win_t id, GtkWidget *new_win)
conf_native_t *nx, *ny, *nw, *nh;
GtkWidget *win;
- if (!conf_core.editor.auto_place)
- return; /* feature disabled */
-
if ((id < 0) || (id >= WPLC_max))
return; /* invalid window */
+ if (!conf_core.editor.auto_place) {
+ if (new_win != NULL) /* remember window widgets in case editor.auto_place gets enabled later */
+ wplc_windows[id] = new_win;
+ return; /* feature disabled */
+ }
+
/* build base path for the specific window */
pe = path;
strcpy(pe, CONF_PREFIX); pe += strlen(CONF_PREFIX);
@@ -75,10 +79,12 @@ void wplc_place(wplc_win_t id, GtkWidget *new_win)
}
else {
win = wplc_windows[id];
- if (HAVE(nw) && HAVE(nh))
- gtk_window_resize(GTK_WINDOW(win), nw->val.integer[0], nh->val.integer[0]);
- if (HAVE(nx) && HAVE(ny))
- gtk_window_move(GTK_WINDOW(win), nx->val.integer[0], ny->val.integer[0]);
+ if (win != NULL) {
+ if (HAVE(nw) && HAVE(nh))
+ gtk_window_resize(GTK_WINDOW(win), nw->val.integer[0], nh->val.integer[0]);
+ if (HAVE(nx) && HAVE(ny))
+ gtk_window_move(GTK_WINDOW(win), nx->val.integer[0], ny->val.integer[0]);
+ }
}
}
#undef HAVE
diff --git a/src_plugins/hid_lesstif/Makefile b/src_plugins/hid_lesstif/Makefile
index ba83ecf..4e6247f 100644
--- a/src_plugins/hid_lesstif/Makefile
+++ b/src_plugins/hid_lesstif/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_hid_lesstif
+ cd ../../src && $(MAKE) mod_hid_lesstif
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/hid_lesstif/Plug.tmpasm b/src_plugins/hid_lesstif/Plug.tmpasm
index 51bf6b8..f0f07ba 100644
--- a/src_plugins/hid_lesstif/Plug.tmpasm
+++ b/src_plugins/hid_lesstif/Plug.tmpasm
@@ -25,6 +25,7 @@ switch /local/pcb/hid_lesstif/controls
@?/target/libs/gui/xrender/ldflags@
@]
+ put /local/pcb/mod/CLEANFILES { $(PLUGDIR)/hid_lesstif/menu_lht.c }
append /local/pcb/RULES [@
### lesstif menu embed
$(PLUGDIR)/hid_lesstif/menu_lht.c: pcb-menu-lesstif.lht
diff --git a/src_plugins/hid_lesstif/dialogs.c b/src_plugins/hid_lesstif/dialogs.c
index a196442..ca08dc4 100644
--- a/src_plugins/hid_lesstif/dialogs.c
+++ b/src_plugins/hid_lesstif/dialogs.c
@@ -10,11 +10,10 @@
#include "compat_misc.h"
-#include "global.h"
#include "data.h"
+#include "build_run.h"
#include "crosshair.h"
#include "layer.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "hid.h"
@@ -24,6 +23,8 @@
#include "hid_init.h"
#include "stdarg.h"
#include "misc_util.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
static int ok;
@@ -90,22 +91,22 @@ called with that filename.
%end-doc */
-static int Load(int argc, const char **argv, Coord x, Coord y)
+static int Load(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function;
char *name;
XmString xmname, pattern;
if (argc > 1)
- return hid_actionv("LoadFrom", argc, argv);
+ return pcb_hid_actionv("LoadFrom", argc, argv);
function = argc ? argv[0] : "Layout";
setup_fsb_dialog();
- if (strcasecmp(function, "Netlist") == 0)
+ if (pcb_strcasecmp(function, "Netlist") == 0)
pattern = xms_net;
- else if (strcasecmp(function, "ElementToBuffer") == 0)
+ else if (pcb_strcasecmp(function, "ElementToBuffer") == 0)
pattern = xms_fp;
else
pattern = xms_pcb;
@@ -129,7 +130,7 @@ static int Load(int argc, const char **argv, Coord x, Coord y)
XmStringGetLtoR(xmname, XmFONTLIST_DEFAULT_TAG, &name);
- hid_actionl("LoadFrom", function, name, NULL);
+ pcb_hid_actionl("LoadFrom", function, name, NULL);
XtFree(name);
@@ -148,13 +149,13 @@ load that vendor file.
%end-doc */
-static int LoadVendor(int argc, const char **argv, Coord x, Coord y)
+static int LoadVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
char *name;
XmString xmname, pattern;
if (argc > 0)
- return hid_actionv("LoadVendorFrom", argc, argv);
+ return pcb_hid_actionv("LoadVendorFrom", argc, argv);
setup_fsb_dialog();
@@ -179,7 +180,7 @@ static int LoadVendor(int argc, const char **argv, Coord x, Coord y)
XmStringGetLtoR(xmname, XmFONTLIST_DEFAULT_TAG, &name);
- hid_actionl("LoadVendorFrom", name, NULL);
+ pcb_hid_actionl("LoadVendorFrom", name, NULL);
XtFree(name);
@@ -201,20 +202,20 @@ called with that filename.
%end-doc */
-static int Save(int argc, const char **argv, Coord x, Coord y)
+static int Save(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function;
char *name;
XmString xmname, pattern;
if (argc > 1)
- hid_actionv("SaveTo", argc, argv);
+ pcb_hid_actionv("SaveTo", argc, argv);
function = argc ? argv[0] : "Layout";
- if (strcasecmp(function, "Layout") == 0)
+ if (pcb_strcasecmp(function, "Layout") == 0)
if (PCB->Filename)
- return hid_actionl("SaveTo", "Layout", PCB->Filename, NULL);
+ return pcb_hid_actionl("SaveTo", "Layout", PCB->Filename, NULL);
setup_fsb_dialog();
@@ -241,8 +242,8 @@ static int Save(int argc, const char **argv, Coord x, Coord y)
XmStringGetLtoR(xmname, XmFONTLIST_DEFAULT_TAG, &name);
- if (strcasecmp(function, "PasteBuffer") == 0)
- hid_actionl("PasteBuffer", "Save", name, NULL);
+ if (pcb_strcasecmp(function, "PasteBuffer") == 0)
+ pcb_hid_actionl("PasteBuffer", "Save", name, NULL);
else {
/*
* if we got this far and the function is Layout, then
@@ -250,10 +251,10 @@ static int Save(int argc, const char **argv, Coord x, Coord y)
* ActionSaveTo() will ignore the new file name we
* just obtained.
*/
- if (strcasecmp(function, "Layout") == 0)
- hid_actionl("SaveTo", "LayoutAs", name, NULL);
+ if (pcb_strcasecmp(function, "Layout") == 0)
+ pcb_hid_actionl("SaveTo", "LayoutAs", name, NULL);
else
- hid_actionl("SaveTo", function, name, NULL);
+ pcb_hid_actionl("SaveTo", function, name, NULL);
}
XtFree(name);
@@ -419,7 +420,7 @@ int lesstif_confirm_dialog(const char *msg, ...)
return ok;
}
-static int ConfirmAction(int argc, const char **argv, Coord x, Coord y)
+static int ConfirmAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int rv = lesstif_confirm_dialog(argc > 0 ? argv[0] : 0,
argc > 1 ? argv[1] : 0,
@@ -542,7 +543,7 @@ user's stdout.
%end-doc */
-static int PromptFor(int argc, const char **argv, Coord x, Coord y)
+static int PromptFor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
char *rv = lesstif_prompt_for(argc > 0 ? argv[0] : 0,
argc > 1 ? argv[1] : 0);
@@ -573,7 +574,7 @@ static Widget create_form_ok_dialog(const char *name, int ok)
return topform;
}
-int lesstif_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * results, const char *title, const char *descr)
+int lesstif_attribute_dialog(pcb_hid_attribute_t * attrs, int n_attrs, pcb_hid_attr_val_t * results, const char *title, const char *descr)
{
Widget dialog, topform, lform, form;
Widget *wl;
@@ -759,7 +760,7 @@ int lesstif_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val *
break;
case HID_Coord:
cp = XmTextGetString(wl[i]);
- results[i].coord_value = GetValue(cp, NULL, NULL, NULL);
+ results[i].coord_value = pcb_get_value(cp, NULL, NULL, NULL);
break;
case HID_Real:
cp = XmTextGetString(wl[i]);
@@ -821,20 +822,20 @@ Open the netlist window.
%end-doc */
-static int DoWindows(int argc, const char **argv, Coord x, Coord y)
+static int DoWindows(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *a = argc == 1 ? argv[0] : "";
- if (strcmp(a, "1") == 0 || strcasecmp(a, "Layout") == 0) {
+ if (strcmp(a, "1") == 0 || pcb_strcasecmp(a, "Layout") == 0) {
}
- else if (strcmp(a, "2") == 0 || strcasecmp(a, "Library") == 0) {
+ else if (strcmp(a, "2") == 0 || pcb_strcasecmp(a, "Library") == 0) {
lesstif_show_library();
}
- else if (strcmp(a, "3") == 0 || strcasecmp(a, "Log") == 0) {
+ else if (strcmp(a, "3") == 0 || pcb_strcasecmp(a, "Log") == 0) {
if (log_form == 0)
lesstif_log("");
XtManageChild(log_form);
}
- else if (strcmp(a, "4") == 0 || strcasecmp(a, "Netlist") == 0) {
+ else if (strcmp(a, "4") == 0 || pcb_strcasecmp(a, "Netlist") == 0) {
lesstif_show_netlist();
}
else {
@@ -857,13 +858,13 @@ This just pops up a dialog telling the user which version of
%end-doc */
-static int About(int argc, const char **argv, Coord x, Coord y)
+static int About(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
static Widget about = 0;
if (!about) {
XmString xs;
stdarg_n = 0;
- xs = XmStringCreatePCB(GetInfoString());
+ xs = XmStringCreatePCB(pcb_get_infostr());
stdarg(XmNmessageString, xs);
stdarg(XmNtitle, "About pcb-rnd");
about = XmCreateInformationDialog(mainwind, XmStrCast("about"), stdarg_args, stdarg_n);
@@ -887,20 +888,20 @@ options, and print the layout.
%end-doc */
-static int Print(int argc, const char **argv, Coord x, Coord y)
+static int Print(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- HID_Attribute *opts;
- HID *printer;
- HID_Attr_Val *vals;
+ pcb_hid_attribute_t *opts;
+ pcb_hid_t *printer;
+ pcb_hid_attr_val_t *vals;
int n;
- printer = hid_find_printer();
+ printer = pcb_hid_find_printer();
if (!printer) {
lesstif_confirm_dialog("No printer?", "Oh well", 0);
return 1;
}
opts = printer->get_export_options(&n);
- vals = (HID_Attr_Val *) calloc(n, sizeof(HID_Attr_Val));
+ vals = (pcb_hid_attr_val_t *) calloc(n, sizeof(pcb_hid_attr_val_t));
if (lesstif_attribute_dialog(opts, n, vals, "Print", "")) {
free(vals);
return 1;
@@ -910,7 +911,7 @@ static int Print(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-static HID_Attribute printer_calibrate_attrs[] = {
+static pcb_hid_attribute_t printer_calibrate_attrs[] = {
{"Enter Values here:", "",
HID_Label, 0, 0, {0, 0, 0}, 0, 0},
{"x-calibration", "X scale for calibrating your printer",
@@ -919,7 +920,7 @@ static HID_Attribute printer_calibrate_attrs[] = {
HID_Real, 0.5, 25, {0, 0, 1.00}, 0, 0}
};
-static HID_Attr_Val printer_calibrate_values[3];
+static pcb_hid_attr_val_t printer_calibrate_values[3];
static const char printcalibrate_syntax[] = "PrintCalibrate()";
@@ -932,11 +933,11 @@ the measurements in, so that future printouts will be more precise.
%end-doc */
-static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y)
+static int PrintCalibrate(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- HID *printer = hid_find_printer();
+ pcb_hid_t *printer = pcb_hid_find_printer();
printer->calibrate(0.0, 0.0);
- if (gui->attribute_dialog(printer_calibrate_attrs, 3,
+ if (pcb_gui->attribute_dialog(printer_calibrate_attrs, 3,
printer_calibrate_values,
"Printer Calibration Values", "Enter calibration values for your printer"))
return 1;
@@ -944,9 +945,9 @@ static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-static const char export_syntax[] = "Export()";
+static const char exportgui_syntax[] = "ExportGUI()";
-static const char export_help[] = "Export the layout.";
+static const char exportgui_help[] = "Export the layout. Export is configured using dialog a box.";
/* %start-doc actions Export
@@ -955,17 +956,17 @@ that exporter's options, and exports the layout.
%end-doc */
-static int Export(int argc, const char **argv, Coord x, Coord y)
+static int ExportGUI(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
static Widget selector = 0;
- HID_Attribute *opts;
- HID *printer, **hids;
- HID_Attr_Val *vals;
+ pcb_hid_attribute_t *opts;
+ pcb_hid_t *printer, **hids;
+ pcb_hid_attr_val_t *vals;
int n, i, count;
Widget prev = 0;
Widget w;
- hids = hid_enumerate();
+ hids = pcb_hid_enumerate();
if (!selector) {
stdarg_n = 0;
@@ -1011,17 +1012,17 @@ static int Export(int argc, const char **argv, Coord x, Coord y)
return 1;
printer = hids[i - 1];
- exporter = printer;
+ pcb_exporter = printer;
opts = printer->get_export_options(&n);
- vals = (HID_Attr_Val *) calloc(n, sizeof(HID_Attr_Val));
+ vals = (pcb_hid_attr_val_t *) calloc(n, sizeof(pcb_hid_attr_val_t));
if (lesstif_attribute_dialog(opts, n, vals, "Export", NULL)) {
free(vals);
return 1;
}
printer->do_export(vals);
free(vals);
- exporter = NULL;
+ pcb_exporter = NULL;
return 0;
}
@@ -1037,10 +1038,10 @@ static int sz_str2val(Widget w, pcb_bool pcbu)
char *buf = XmTextGetString(w);
if (!pcbu)
return strtol(buf, NULL, 0);
- return GetValueEx(buf, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, NULL);
+ return pcb_get_value_ex(buf, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, NULL);
}
-static void sz_val2str(Widget w, Coord u, int pcbu)
+static void sz_val2str(Widget w, pcb_coord_t u, int pcbu)
{
static char buf[40];
if (pcbu)
@@ -1069,7 +1070,7 @@ static void sizes_set()
conf_set_design("design/min_drill", "%s", sz_drc_drill);
conf_set_design("design/min_ring", "%s", sz_drc_ring);
- SetCrosshairRange(0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight);
lesstif_pan_fixup();
}
@@ -1137,7 +1138,7 @@ The units are determined by the default display units.
%end-doc */
-static int AdjustSizes(int argc, const char **argv, Coord x, Coord y)
+static int AdjustSizes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (!sizes_dialog) {
Widget inf, sep;
@@ -1212,16 +1213,16 @@ static int AdjustSizes(int argc, const char **argv, Coord x, Coord y)
static Widget layer_groups_form = 0;
static Widget lg_buttonform = 0;
-static int lg_setcol[MAX_LAYER + 2];
+static int lg_setcol[PCB_MAX_LAYERGRP + 2];
static int lg_width, lg_height;
-static int lg_r[MAX_LAYER + 3];
-static int lg_c[MAX_LAYER + 1];
+static int lg_r[PCB_MAX_LAYER + 3];
+static int lg_c[PCB_MAX_LAYERGRP + 1];
static int lg_label_width, lg_fa, lg_fd;
static GC lg_gc = 0;
#if 0
-static Widget lglabels[MAX_LAYER + 2];
-static Widget lgbuttons[MAX_LAYER + 2][MAX_LAYER];
+static Widget lglabels[PCB_MAX_LAYER + 2];
+static Widget lgbuttons[PCB_MAX_LAYER + 2][PCB_MAX_LAYER];
#endif
typedef struct {
@@ -1243,10 +1244,10 @@ static void lgbutton_cb(Widget w, int ij, void *cbs)
{
int layer, group, k;
- layer = ij / max_group;
- group = ij % max_group;
- group = MoveLayerToGroup(layer, group);
- for (k = 0; k < max_group; k++) {
+ layer = ij / pcb_max_group;
+ group = ij % pcb_max_group;
+ group = pcb_layer_move_to_group(layer, group);
+ for (k = 0; k < pcb_max_group; k++) {
if (k == group)
XmToggleButtonSetState(lgbuttons[layer][k], 1, 0);
else
@@ -1272,19 +1273,19 @@ static void lgbutton_expose(Widget w, XtPointer u, XmDrawingAreaCallbackStruct *
XSetForeground(display, lg_gc, lgr.bg);
XFillRectangle(display, win, lg_gc, 0, 0, lg_width, lg_height);
XSetForeground(display, lg_gc, lgr.fg);
- for (i = 0; i < max_group; i++)
+ for (i = 0; i < pcb_max_group; i++)
XDrawLine(display, win, lg_gc, lg_c[i], 0, lg_c[i], lg_height);
- for (i = 1; i < max_copper_layer + 2; i++)
+ for (i = 1; i < pcb_max_copper_layer + 2; i++)
XDrawLine(display, win, lg_gc, lg_label_width, lg_r[i], lg_width, lg_r[i]);
- for (i = 0; i < max_copper_layer + 2; i++) {
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
int dir;
XCharStruct size;
int swidth;
const char *name;
- if (i == solder_silk_layer)
+ if (i == pcb_solder_silk_layer)
name = SOLDER_SIDE_NAME;
- else if (i == component_silk_layer)
+ else if (i == pcb_component_silk_layer)
name = COMPONENT_SIDE_NAME;
else
name = PCB->Data->Layer[i].Name;
@@ -1295,7 +1296,7 @@ static void lgbutton_expose(Widget w, XtPointer u, XmDrawingAreaCallbackStruct *
(lg_r[i] + lg_r[i + 1] + lg_fd + lg_fa) / 2 - 1, name, strlen(name));
}
XSetForeground(display, lg_gc, lgr.sel);
- for (i = 0; i < max_copper_layer + 2; i++) {
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
int c = lg_setcol[i];
int x1 = lg_c[c] + 2;
int x2 = lg_c[c + 1] - 2;
@@ -1310,12 +1311,12 @@ static void lgbutton_input(Widget w, XtPointer u, XmDrawingAreaCallbackStruct *
int layer, group;
if (cbs->event->type != ButtonPress)
return;
- layer = cbs->event->xbutton.y * (max_copper_layer + 2) / lg_height;
- group = (cbs->event->xbutton.x - lg_label_width) * max_group / (lg_width - lg_label_width);
- group = MoveLayerToGroup(layer, group);
+ layer = cbs->event->xbutton.y * (pcb_max_copper_layer + 2) / lg_height;
+ group = (cbs->event->xbutton.x - lg_label_width) * pcb_max_group / (lg_width - lg_label_width);
+ group = pcb_layer_move_to_group(layer, group);
lg_setcol[layer] = group;
lgbutton_expose(w, 0, 0);
- gui->invalidate_all();
+ pcb_gui->invalidate_all();
}
static void lgbutton_resize(Widget w, XtPointer u, XmDrawingAreaCallbackStruct * cbs)
@@ -1329,40 +1330,40 @@ static void lgbutton_resize(Widget w, XtPointer u, XmDrawingAreaCallbackStruct *
lg_width = width;
lg_height = height;
- for (i = 0; i <= max_group; i++)
- lg_c[i] = lg_label_width + (lg_width - lg_label_width) * i / max_group;
- for (i = 0; i <= max_copper_layer + 2; i++)
- lg_r[i] = lg_height * i / (max_copper_layer + 2);
+ for (i = 0; i <= pcb_max_group; i++)
+ lg_c[i] = lg_label_width + (lg_width - lg_label_width) * i / pcb_max_group;
+ for (i = 0; i <= pcb_max_copper_layer + 2; i++)
+ lg_r[i] = lg_height * i / (pcb_max_copper_layer + 2);
lgbutton_expose(w, 0, 0);
}
void lesstif_update_layer_groups()
{
- int sets[MAX_LAYER + 2][MAX_LAYER];
+ int sets[PCB_MAX_LAYERGRP + 2][PCB_MAX_LAYER];
int i, j;
- LayerGroupType *l = &(PCB->LayerGroups);
+ pcb_layer_group_t *l = &(PCB->LayerGroups);
if (!layer_groups_form)
return;
memset(sets, 0, sizeof(sets));
- for (i = 0; i < max_group; i++)
+ for (i = 0; i < pcb_max_group; i++)
for (j = 0; j < l->Number[i]; j++) {
sets[l->Entries[i][j]][i] = 1;
lg_setcol[l->Entries[i][j]] = i;
}
lg_label_width = 0;
- for (i = 0; i < max_copper_layer + 2; i++) {
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
int dir;
XCharStruct size;
int swidth;
const char *name;
- if (i == solder_silk_layer)
+ if (i == pcb_solder_silk_layer)
name = SOLDER_SIDE_NAME;
- else if (i == component_silk_layer)
+ else if (i == pcb_component_silk_layer)
name = COMPONENT_SIDE_NAME;
else
name = PCB->Data->Layer[i].Name;
@@ -1374,49 +1375,49 @@ void lesstif_update_layer_groups()
lg_label_width += 4;
stdarg_n = 0;
- stdarg(XmNwidth, lg_label_width + (lg_fa + lg_fd) * max_group);
- stdarg(XmNheight, (lg_fa + lg_fd) * (max_copper_layer + 2));
+ stdarg(XmNwidth, lg_label_width + (lg_fa + lg_fd) * pcb_max_group);
+ stdarg(XmNheight, (lg_fa + lg_fd) * (pcb_max_copper_layer + 2));
XtSetValues(lg_buttonform, stdarg_args, stdarg_n);
lgbutton_expose(lg_buttonform, 0, 0);
#if 0
- for (i = 0; i < max_copper_layer + 2; i++) {
+ for (i = 0; i < pcb_max_copper_layer + 2; i++) {
char *name = "unknown";
stdarg_n = 0;
- if (i < max_copper_layer)
+ if (i < pcb_max_copper_layer)
name = PCB->Data->Layer[i].Name;
- else if (i == solder_silk_layer)
+ else if (i == pcb_solder_silk_layer)
name = SOLDER_SIDE_NAME;
- else if (i == component_silk_layer)
+ else if (i == pcb_component_silk_layer)
name = COMPONENT_SIDE_NAME;
stdarg(XmNlabelString, XmStringCreatePCB(name));
XtSetValues(lglabels[i], stdarg_args, stdarg_n);
- for (j = 0; j < max_group; j++) {
+ for (j = 0; j < pcb_max_group; j++) {
if (sets[i][j] != XmToggleButtonGetState(lgbuttons[i][j])) {
XmToggleButtonSetState(lgbuttons[i][j], sets[i][j], 0);
}
}
}
XtUnmanageChild(lg_buttonform);
- for (i = 0; i < MAX_LAYER + 2; i++)
- for (j = 0; j < MAX_LAYER; j++) {
- if (i < max_copper_layer + 2 && j < max_group) {
+ for (i = 0; i < PCB_MAX_LAYERGRP + 2; i++)
+ for (j = 0; j < PCB_MAX_LAYER; j++) {
+ if (i < pcb_max_copper_layer + 2 && j < pcb_max_group) {
XtManageChild(lgbuttons[i][j]);
stdarg_n = 0;
- stdarg(XmNleftPosition, j * (max_copper_layer + 2));
- stdarg(XmNrightPosition, (j + 1) * (max_copper_layer + 2));
- stdarg(XmNtopPosition, i * max_group);
- stdarg(XmNbottomPosition, (i + 1) * max_group);
+ stdarg(XmNleftPosition, j * (pcb_max_copper_layer + 2));
+ stdarg(XmNrightPosition, (j + 1) * (pcb_max_copper_layer + 2));
+ stdarg(XmNtopPosition, i * pcb_max_group);
+ stdarg(XmNbottomPosition, (i + 1) * pcb_max_group);
XtSetValues(lgbuttons[i][j], stdarg_args, stdarg_n);
}
else
XtUnmanageChild(lgbuttons[i][j]);
}
stdarg_n = 0;
- stdarg(XmNfractionBase, max_copper_layer + 2);
+ stdarg(XmNfractionBase, pcb_max_copper_layer + 2);
XtSetValues(layer_groups_form, stdarg_args, stdarg_n);
stdarg_n = 0;
- stdarg(XmNfractionBase, max_group * (max_copper_layer + 2));
+ stdarg(XmNfractionBase, pcb_max_group * (pcb_max_copper_layer + 2));
XtSetValues(lg_buttonform, stdarg_args, stdarg_n);
XtManageChild(lg_buttonform);
#endif
@@ -1438,12 +1439,12 @@ See @ref{ChangeName Action}.
%end-doc */
-static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y)
+static int EditLayerGroups(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (!layer_groups_form) {
stdarg_n = 0;
- stdarg(XmNfractionBase, max_copper_layer + 2);
+ stdarg(XmNfractionBase, pcb_max_copper_layer + 2);
stdarg(XmNtitle, "Layer Groups");
layer_groups_form = XmCreateFormDialog(mainwind, XmStrCast("layers"), stdarg_args, stdarg_n);
@@ -1461,10 +1462,10 @@ static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y)
XtGetSubresources(layer_groups_form, &lgr, "layergroups", "LayerGroups", lg_resources, XtNumber(lg_resources), 0, 0);
#if 0
- stdarg(XmNfractionBase, max_group * (MAX_LAYER + 2));
+ stdarg(XmNfractionBase, pcb_max_group * (PCB_MAX_LAYER + 2));
lg_buttonform = XmCreateForm(layer_groups_form, "lgbutton", stdarg_args, stdarg_n);
- for (i = 0; i < MAX_LAYER + 2; i++) {
+ for (i = 0; i < PCB_MAX_LAYER + 2; i++) {
stdarg_n = 0;
stdarg(XmNleftAttachment, XmATTACH_FORM);
stdarg(XmNtopAttachment, XmATTACH_POSITION);
@@ -1476,16 +1477,16 @@ static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y)
lglabels[i] = XmCreateLabel(layer_groups_form, "layer", stdarg_args, stdarg_n);
XtManageChild(lglabels[i]);
- for (j = 0; j < MAX_LAYER; j++) {
+ for (j = 0; j < PCB_MAX_LAYER; j++) {
stdarg_n = 0;
stdarg(XmNleftAttachment, XmATTACH_POSITION);
- stdarg(XmNleftPosition, j * (MAX_LAYER + 2));
+ stdarg(XmNleftPosition, j * (PCB_MAX_LAYER + 2));
stdarg(XmNrightAttachment, XmATTACH_POSITION);
- stdarg(XmNrightPosition, (j + 1) * (MAX_LAYER + 2));
+ stdarg(XmNrightPosition, (j + 1) * (PCB_MAX_LAYER + 2));
stdarg(XmNtopAttachment, XmATTACH_POSITION);
- stdarg(XmNtopPosition, i * MAX_LAYER);
+ stdarg(XmNtopPosition, i * PCB_MAX_LAYER);
stdarg(XmNbottomAttachment, XmATTACH_POSITION);
- stdarg(XmNbottomPosition, (i + 1) * MAX_LAYER);
+ stdarg(XmNbottomPosition, (i + 1) * PCB_MAX_LAYER);
stdarg(XmNlabelString, XmStringCreatePCB(" "));
stdarg(XmNspacing, 0);
stdarg(XmNvisibleWhenOff, True);
@@ -1497,7 +1498,7 @@ static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y)
lgbuttons[i][j] = XmCreateToggleButton(lg_buttonform, "label", stdarg_args, stdarg_n);
XtManageChild(lgbuttons[i][j]);
- XtAddCallback(lgbuttons[i][j], XmNvalueChangedCallback, (XtCallbackProc) lgbutton_cb, (XtPointer) (i * max_group + j));
+ XtAddCallback(lgbuttons[i][j], XmNvalueChangedCallback, (XtCallbackProc) lgbutton_cb, (XtPointer) (i * pcb_max_group + j));
}
}
#endif
@@ -1519,7 +1520,7 @@ static AttrRow *attr_row = 0;
static int attr_num_rows = 0;
static int attr_max_rows = 0;
static Widget attr_dialog = NULL, f_top;
-static AttributeListType *attributes_list;
+static pcb_attribute_list_t *attributes_list;
static void attributes_delete_callback(Widget w, void *v, void *cbs);
@@ -1714,7 +1715,7 @@ static void attributes_revert_callback(Widget w, void *v, void *cbs)
lesstif_attributes_revert();
}
-void lesstif_attributes_dialog(const char *owner, AttributeListType * attrs_list)
+void lesstif_attributes_dialog(const char *owner, pcb_attribute_list_t * attrs_list)
{
Widget bform, sw, b_ok, b_cancel, b_revert, b_new;
Widget sep;
@@ -1801,11 +1802,11 @@ void lesstif_attributes_dialog(const char *owner, AttributeListType * attrs_list
free(attributes_list->List[i].value);
}
if (attributes_list->Max < attr_num_rows) {
- int sz = attr_num_rows * sizeof(AttributeType);
+ int sz = attr_num_rows * sizeof(pcb_attribute_t);
if (attributes_list->List == NULL)
- attributes_list->List = (AttributeType *) malloc(sz);
+ attributes_list->List = (pcb_attribute_t *) malloc(sz);
else
- attributes_list->List = (AttributeType *) realloc(attributes_list->List, sz);
+ attributes_list->List = (pcb_attribute_t *) realloc(attributes_list->List, sz);
attributes_list->Max = attr_num_rows;
}
for (i = 0; i < attr_num_rows; i++) {
@@ -1832,7 +1833,7 @@ future imports.
%end-doc */
-static int ImportGUI(int argc, const char **argv, Coord x, Coord y)
+static int ImportGUI(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
static int I_am_recursing = 0;
static XmString xms_sch = 0, xms_import = 0;
@@ -1890,13 +1891,13 @@ static int ImportGUI(int argc, const char **argv, Coord x, Coord y)
bname = last_slash + 1;
}
- AttributePut(PCB, "import::src0", bname);
+ pcb_attrib_put(PCB, "import::src0", bname);
XtFree(name);
I_am_recursing = 1;
- rv = hid_action("Import");
+ rv = pcb_hid_action("Import");
I_am_recursing = 0;
return rv;
@@ -1904,7 +1905,7 @@ static int ImportGUI(int argc, const char **argv, Coord x, Coord y)
/* ------------------------------------------------------------ */
-HID_Action lesstif_dialog_action_list[] = {
+pcb_hid_action_t lesstif_dialog_action_list[] = {
{"Load", 0, Load,
load_help, load_syntax}
,
@@ -1931,8 +1932,8 @@ HID_Action lesstif_dialog_action_list[] = {
{"PrintCalibrate", 0, PrintCalibrate,
printcalibrate_help, printcalibrate_syntax}
,
- {"Export", 0, Export,
- export_help, export_syntax}
+ {"ExportGUI", 0, ExportGUI,
+ exportgui_help, exportgui_syntax}
,
{"AdjustSizes", 0, AdjustSizes,
adjustsizes_help, adjustsizes_syntax}
@@ -1945,4 +1946,4 @@ HID_Action lesstif_dialog_action_list[] = {
,
};
-REGISTER_ACTIONS(lesstif_dialog_action_list, lesstif_cookie)
+PCB_REGISTER_ACTIONS(lesstif_dialog_action_list, lesstif_cookie)
diff --git a/src_plugins/hid_lesstif/lesstif.h b/src_plugins/hid_lesstif/lesstif.h
index f2ba2e8..ce7b6f1 100644
--- a/src_plugins/hid_lesstif/lesstif.h
+++ b/src_plugins/hid_lesstif/lesstif.h
@@ -1,4 +1,6 @@
#include "hid_cfg_input.h"
+#include "compat_nls.h"
+#include "board.h"
#define app_context lesstif_app_context
#define appwidget lesstif_appwidget
@@ -19,8 +21,8 @@ extern Display *display;
extern Screen *screen_s;
extern int screen;
-extern hid_cfg_mouse_t lesstif_mouse;
-extern hid_cfg_keys_t lesstif_keymap;
+extern pcb_hid_cfg_mouse_t lesstif_mouse;
+extern pcb_hid_cfg_keys_t lesstif_keymap;
extern Widget mainwind, work_area, command, hscroll, vscroll;
extern Widget m_click;
@@ -40,7 +42,7 @@ extern int lesstif_pcbxy_to_winxy(int pcbx, int pcby, int *winx, int *winy);
extern void lesstif_need_idle_proc(void);
extern void lesstif_show_crosshair(int);
extern void lesstif_invalidate_all(void);
-extern void lesstif_coords_to_pcb(int, int, Coord *, Coord *);
+extern void lesstif_coords_to_pcb(int, int, pcb_coord_t *, pcb_coord_t *);
extern void lesstif_get_xy(const char *msg);
extern void lesstif_update_widget_flags(void);
extern int lesstif_call_action(const char *, int, char **);
@@ -56,7 +58,8 @@ extern void lesstif_update_status_line();
extern char *lesstif_prompt_for(const char *, const char *);
extern char *lesstif_fileselect(const char *, const char *, const char *, const char *, const char *, int);
extern void lesstif_log(const char *fmt, ...);
-extern void lesstif_attributes_dialog(const char *, AttributeListType *);
+extern void lesstif_attributes_dialog(const char *, pcb_attribute_list_t *);
+
#ifndef XtRPCBCoord
#define XtRPCBCoord "PCBCoord"
diff --git a/src_plugins/hid_lesstif/library.c b/src_plugins/hid_lesstif/library.c
index 976eef4..ad4e417 100644
--- a/src_plugins/hid_lesstif/library.c
+++ b/src_plugins/hid_lesstif/library.c
@@ -9,10 +9,7 @@
#include <string.h>
#include "compat_misc.h"
-#include "global.h"
#include "data.h"
-#include "misc.h"
-#include "set.h"
#include "buffer.h"
#include "vtptr.h"
#include "plug_footprint.h"
@@ -20,6 +17,7 @@
#include "hid.h"
#include "lesstif.h"
#include "stdarg.h"
+#include "event.h"
static Widget library_dialog = 0;
static Widget library_list, libnode_list;
@@ -28,12 +26,12 @@ static XmString *library_strings = 0;
static XmString *libnode_strings = 0;
static int last_pick = -1;
-vtptr_t picks; /* of library_t * */
+vtptr_t picks; /* of pcb_fplibrary_t * */
vtptr_t pick_names; /* of char * */
static void pick_net(int pick)
{
- library_t *menu = (library_t *)picks.array[pick];
+ pcb_fplibrary_t *menu = (pcb_fplibrary_t *)picks.array[pick];
int i, found;
if (pick == last_pick)
@@ -64,10 +62,10 @@ static void library_browse(Widget w, void *v, XmListCallbackStruct * cbs)
static void libnode_select(Widget w, void *v, XmListCallbackStruct * cbs)
{
- library_t *e = picks.array[last_pick];
+ pcb_fplibrary_t *e = picks.array[last_pick];
e = &e->data.dir.children.array[cbs->item_position - 1];
- if (LoadElementToBuffer(PASTEBUFFER, e->data.fp.loc_info))
- SetMode(PCB_MODE_PASTE_BUFFER);
+ if (pcb_element_load_to_buffer(PCB_PASTEBUFFER, e->data.fp.loc_info))
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
}
static int build_library_dialog()
@@ -104,9 +102,9 @@ static int build_library_dialog()
return 0;
}
-static void lib_dfs(library_t *parent, int level)
+static void lib_dfs(pcb_fplibrary_t *parent, int level)
{
- library_t *l;
+ pcb_fplibrary_t *l;
char *s;
int n, len;
@@ -126,13 +124,13 @@ static void lib_dfs(library_t *parent, int level)
lib_dfs(l, level+1);
}
-static int LibraryChanged(int argc, const char **argv, Coord x, Coord y)
+void LesstifLibraryChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
int i;
- if (library.data.dir.children.used == 0)
- return 0;
+ if (pcb_library.data.dir.children.used == 0)
+ return;
if (build_library_dialog())
- return 0;
+ return;
last_pick = -1;
for (i = 0; i < pick_names.used; i++)
@@ -141,7 +139,7 @@ static int LibraryChanged(int argc, const char **argv, Coord x, Coord y)
vtptr_truncate(&picks, 0);
vtptr_truncate(&pick_names, 0);
- lib_dfs(&library, 0);
+ lib_dfs(&pcb_library, 0);
if (library_strings)
@@ -156,7 +154,7 @@ static int LibraryChanged(int argc, const char **argv, Coord x, Coord y)
XtSetValues(library_list, stdarg_args, stdarg_n);
pick_net(0);
- return 0;
+ return;
}
static const char libraryshow_syntax[] = "LibraryShow()";
@@ -167,7 +165,7 @@ static const char libraryshow_help[] = "Displays the library window.";
%end-doc */
-static int LibraryShow(int argc, const char **argv, Coord x, Coord y)
+static int LibraryShow(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (build_library_dialog())
return 0;
@@ -178,18 +176,15 @@ void lesstif_show_library()
{
if (mainwind) {
if (!library_dialog)
- LibraryChanged(0, 0, 0, 0);
+ LesstifLibraryChanged(0, 0, 0);
XtManageChild(library_dialog);
}
}
-HID_Action lesstif_library_action_list[] = {
- {"LibraryChanged", 0, LibraryChanged,
- librarychanged_help, librarychanged_syntax}
- ,
+pcb_hid_action_t lesstif_library_action_list[] = {
{"LibraryShow", 0, LibraryShow,
libraryshow_help, libraryshow_syntax}
,
};
-REGISTER_ACTIONS(lesstif_library_action_list, lesstif_cookie)
+PCB_REGISTER_ACTIONS(lesstif_library_action_list, lesstif_cookie)
diff --git a/src_plugins/hid_lesstif/main.c b/src_plugins/hid_lesstif/main.c
index 1b6cb75..e43317f 100644
--- a/src_plugins/hid_lesstif/main.c
+++ b/src_plugins/hid_lesstif/main.c
@@ -3,6 +3,7 @@
#include "xincludes.h"
#include "config.h"
+#include "math_helper.h"
#include "conf_core.h"
#include <stdio.h>
@@ -18,13 +19,10 @@
#include <unistd.h>
#endif
-#include "global.h"
#include "data.h"
#include "action_helper.h"
#include "crosshair.h"
#include "layer.h"
-#include "mymem.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "clip.h"
#include "event.h"
@@ -47,13 +45,15 @@
#include "stdarg.h"
#include "misc_util.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "layer_vis.h"
#include <sys/poll.h>
const char *lesstif_cookie = "lesstif HID";
-hid_cfg_mouse_t lesstif_mouse;
-hid_cfg_keys_t lesstif_keymap;
+pcb_hid_cfg_mouse_t lesstif_mouse;
+pcb_hid_cfg_keys_t lesstif_keymap;
#ifndef XtRDouble
@@ -64,17 +64,17 @@ hid_cfg_keys_t lesstif_keymap;
#define MAX_ZOOM_SCALE 10
#define UUNIT conf_core.editor.grid_unit->allow
-typedef struct hid_gc_struct {
- HID *me_pointer;
+typedef struct hid_gc_s {
+ pcb_hid_t *me_pointer;
Pixel color;
char *colorname;
int width;
- EndCapStyle cap;
+ pcb_cap_style_t cap;
char xor_set;
char erase;
-} hid_gc_struct;
+} hid_gc_s;
-static HID lesstif_hid;
+static pcb_hid_t lesstif_hid;
#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented GUI function %s\n", func), abort()
@@ -119,8 +119,8 @@ typedef struct PinoutData {
struct PinoutData *prev, *next;
Widget form;
Window window;
- Coord left, right, top, bottom; /* PCB extents of item */
- Coord x, y; /* PCB coordinates of upper right corner of window */
+ pcb_coord_t left, right, top, bottom; /* PCB extents of item */
+ pcb_coord_t x, y; /* PCB coordinates of upper right corner of window */
double zoom; /* PCB units per screen pixel */
int v_width, v_height; /* pixels */
void *item;
@@ -162,15 +162,15 @@ static void ShowCrosshair(pcb_bool show)
if (crosshair_on == show)
return;
- notify_crosshair_change(pcb_false);
- if (Marked.status)
- notify_mark_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
+ if (pcb_marked.status)
+ pcb_notify_mark_change(pcb_false);
crosshair_on = show;
- notify_crosshair_change(pcb_true);
- if (Marked.status)
- notify_mark_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
+ if (pcb_marked.status)
+ pcb_notify_mark_change(pcb_true);
}
/* This is the size of the current PCB work area. */
@@ -180,7 +180,7 @@ static void ShowCrosshair(pcb_bool show)
static int stdin_listen = 0;
static char *background_image_file = 0;
- HID_Attribute lesstif_attribute_list[] = {
+ pcb_hid_attribute_t lesstif_attribute_list[] = {
{"install", "Install private colormap",
HID_Boolean, 0, 0, {0, 0, 0}, 0, &use_private_colormap},
#define HA_colormap 0
@@ -224,7 +224,7 @@ Location of the @file{pcb-menu.res} file which defines the menu for the lesstif
*/
};
-REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie)
+PCB_REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie)
static void lesstif_use_mask(int use_it);
static void zoom_max();
@@ -238,7 +238,7 @@ REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie)
/* Px converts view->pcb, Vx converts pcb->view */
static inline int
- Vx(Coord x)
+ Vx(pcb_coord_t x)
{
int rv = (x - view_left_x) / view_zoom + 0.5;
if (conf_core.editor.view.flip_x)
@@ -246,7 +246,7 @@ REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie)
return rv;
}
-static inline int Vy(Coord y)
+static inline int Vy(pcb_coord_t y)
{
int rv = (y - view_top_y) / view_zoom + 0.5;
if (conf_core.editor.view.flip_y)
@@ -254,31 +254,31 @@ static inline int Vy(Coord y)
return rv;
}
-static inline int Vz(Coord z)
+static inline int Vz(pcb_coord_t z)
{
return z / view_zoom + 0.5;
}
-static inline Coord Px(int x)
+static inline pcb_coord_t Px(int x)
{
if (conf_core.editor.view.flip_x)
x = view_width - x;
return x * view_zoom + view_left_x;
}
-static inline Coord Py(int y)
+static inline pcb_coord_t Py(int y)
{
if (conf_core.editor.view.flip_y)
y = view_height - y;
return y * view_zoom + view_top_y;
}
-static inline Coord Pz(int z)
+static inline pcb_coord_t Pz(int z)
{
return z * view_zoom;
}
-void lesstif_coords_to_pcb(int vx, int vy, Coord * px, Coord * py)
+void lesstif_coords_to_pcb(int vx, int vy, pcb_coord_t * px, pcb_coord_t * py)
{
*px = Px(vx);
*py = Py(vy);
@@ -310,7 +310,7 @@ static const char *cur_clip()
/* Called from the core when it's busy doing something and we need to
indicate that to the user. */
-static int Busy(int argc, const char **argv, Coord x, Coord y)
+static void LesstifBusy(void *user_data, int argc, pcb_event_arg_t argv[])
{
static Cursor busy_cursor = 0;
if (busy_cursor == 0)
@@ -318,27 +318,32 @@ static int Busy(int argc, const char **argv, Coord x, Coord y)
XDefineCursor(display, window, busy_cursor);
XFlush(display);
old_cursor_mode = -1;
- return 0;
+ return;
}
/* ---------------------------------------------------------------------- */
/* Local actions. */
-static int PointCursor(int argc, const char **argv, Coord x, Coord y)
+static void PointCursor(pcb_bool grabbed)
{
- if (argc > 0)
+ if (grabbed > 0)
over_point = 1;
else
over_point = 0;
old_cursor_mode = -1;
- return 0;
}
-static int PCBChanged(int argc, const char **argv, Coord x, Coord y)
+extern void LesstifNetlistChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+extern void LesstifRouteStylesChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+extern void LesstifLayersChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+extern void LesstifLibraryChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+
+
+static void ev_pcb_changed(void *user_data, int argc, pcb_event_arg_t argv[])
{
if (work_area == 0)
- return 0;
+ return;
/*pcb_printf("PCB Changed! %$mD\n", PCB->MaxWidth, PCB->MaxHeight); */
stdarg_n = 0;
stdarg(XmNminimum, 0);
@@ -354,9 +359,9 @@ static int PCBChanged(int argc, const char **argv, Coord x, Coord y)
XtSetValues(vscroll, stdarg_args, stdarg_n);
zoom_max();
- hid_action("NetlistChanged");
- hid_action("LayersChanged");
- hid_action("RouteStylesChanged");
+ LesstifNetlistChanged(NULL, 0, NULL);
+ LesstifLayersChanged(NULL, 0, NULL);
+ LesstifRouteStylesChanged(NULL, 0, NULL);
lesstif_sizes_reset();
lesstif_update_layer_groups();
while (pinouts)
@@ -367,7 +372,7 @@ static int PCBChanged(int argc, const char **argv, Coord x, Coord y)
stdarg(XmNtitle, cp ? cp + 1 : PCB->Filename);
XtSetValues(appwidget, stdarg_args, stdarg_n);
}
- return 0;
+ return;
}
@@ -389,19 +394,19 @@ Sets the display units to millimeters.
%end-doc */
-static int SetUnits(int argc, const char **argv, Coord x, Coord y)
+static int SetUnits(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- const Unit *new_unit;
+ const pcb_unit_t *new_unit;
if (argc == 0)
return 0;
new_unit = get_unit_struct(argv[0]);
- if (new_unit != NULL && new_unit->allow != NO_PRINT) {
+ if (new_unit != NULL && new_unit->allow != PCB_UNIT_NO_PRINT) {
conf_set(CFR_DESIGN, "editor/grid_unit", -1, argv[0], POL_OVERWRITE);
#warning TODO: figure what to do with increments
#if 0
- Settings.increments = get_increments_struct(Settings.grid_unit->suffix);
+ Settings.increments = pcb_get_increments_struct(Settings.grid_unit->suffix);
#endif
- AttributePut(PCB, "PCB::grid::unit", argv[0]);
+ pcb_attrib_put(PCB, "PCB::grid::unit", argv[0]);
}
lesstif_sizes_reset();
lesstif_styles_update_values();
@@ -449,7 +454,7 @@ Note that zoom factors of zero are silently ignored.
%end-doc */
-static int ZoomAction(int argc, const char **argv, Coord x, Coord y)
+static int ZoomAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *vp;
double v;
@@ -466,7 +471,7 @@ static int ZoomAction(int argc, const char **argv, Coord x, Coord y)
return 0;
}
vp = argv[0];
- if (strcasecmp(vp, "toggle") == 0) {
+ if (pcb_strcasecmp(vp, "toggle") == 0) {
zoom_toggle(x, y);
return 0;
}
@@ -494,12 +499,12 @@ static int ZoomAction(int argc, const char **argv, Coord x, Coord y)
static int pan_thumb_mode;
-static int PanAction(int argc, const char **argv, Coord x, Coord y)
+static int PanAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int mode;
if (argc == 2) {
- pan_thumb_mode = (strcasecmp(argv[0], "thumb") == 0) ? 1 : 0;
+ pan_thumb_mode = (pcb_strcasecmp(argv[0], "thumb") == 0) ? 1 : 0;
mode = atoi(argv[1]);
}
else {
@@ -554,7 +559,7 @@ static int group_showing(int g, int *c)
*c = PCB->LayerGroups.Entries[g][0];
for (i = 0; i < PCB->LayerGroups.Number[g]; i++) {
l = PCB->LayerGroups.Entries[g][i];
- if (l >= 0 && l < max_copper_layer) {
+ if (l >= 0 && l < pcb_max_copper_layer) {
*c = l;
if (PCB->Data->Layer[l].On)
return 1;
@@ -563,12 +568,12 @@ static int group_showing(int g, int *c)
return 0;
}
-static int SwapSides(int argc, const char **argv, Coord x, Coord y)
+static int SwapSides(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int old_shown_side = conf_core.editor.show_solder_side;
- int comp_group = GetLayerGroupNumberByNumber(component_silk_layer);
- int solder_group = GetLayerGroupNumberByNumber(solder_silk_layer);
- int active_group = GetLayerGroupNumberByNumber(LayerStack[0]);
+ pcb_layergrp_id_t comp_group = pcb_layer_get_group(pcb_component_silk_layer);
+ pcb_layergrp_id_t solder_group = pcb_layer_get_group(pcb_solder_silk_layer);
+ pcb_layergrp_id_t active_group = pcb_layer_get_group(pcb_layer_stack[0]);
int comp_layer;
int solder_layer;
int comp_showing = group_showing(comp_group, &comp_layer);
@@ -621,15 +626,15 @@ static int SwapSides(int argc, const char **argv, Coord x, Coord y)
if (conf_core.editor.show_solder_side) {
if (active_group == comp_group) {
if (comp_showing && !solder_showing)
- ChangeGroupVisibility(comp_layer, 0, 0);
- ChangeGroupVisibility(solder_layer, 1, 1);
+ pcb_layervis_change_group_vis(comp_layer, 0, 0);
+ pcb_layervis_change_group_vis(solder_layer, 1, 1);
}
}
else {
if (active_group == solder_group) {
if (solder_showing && !comp_showing)
- ChangeGroupVisibility(solder_layer, 0, 0);
- ChangeGroupVisibility(comp_layer, 1, 1);
+ pcb_layervis_change_group_vis(solder_layer, 0, 0);
+ pcb_layervis_change_group_vis(comp_layer, 1, 1);
}
}
}
@@ -646,7 +651,7 @@ static void command_callback(Widget w, XtPointer uptr, XmTextVerifyCallbackStruc
case XmCR_ACTIVATE:
s = XmTextGetString(w);
lesstif_show_crosshair(0);
- hid_parse_command(s);
+ pcb_hid_parse_command(s);
XtFree(s);
XmTextSetString(w, XmStrCast(""));
case XmCR_LOSING_FOCUS:
@@ -716,7 +721,7 @@ before.
%end-doc */
-static int Command(int argc, const char **argv, Coord x, Coord y)
+static int Command(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
XtManageChild(m_cmd_label);
XtManageChild(m_cmd);
@@ -736,11 +741,11 @@ It reports the amount of time needed to draw the screen once.
%end-doc */
-static int Benchmark(int argc, const char **argv, Coord x, Coord y)
+static int Benchmark(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int i = 0;
time_t start, end;
- BoxType region;
+ pcb_box_t region;
Drawable save_main;
save_main = main_pixmap;
@@ -756,7 +761,7 @@ static int Benchmark(int argc, const char **argv, Coord x, Coord y)
time(&start);
do {
XFillRectangle(display, pixmap, bg_gc, 0, 0, view_width, view_height);
- hid_expose_callback(&lesstif_hid, ®ion, 0);
+ pcb_hid_expose_callback(&lesstif_hid, ®ion, 0);
XSync(display, 0);
time(&end);
i++;
@@ -769,10 +774,10 @@ static int Benchmark(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-static int Center(int argc, const char **argv, Coord x, Coord y)
+static int Center(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- x = GridFit(x, PCB->Grid, PCB->GridOffsetX);
- y = GridFit(y, PCB->Grid, PCB->GridOffsetY);
+ x = pcb_grid_fit(x, PCB->Grid, PCB->GridOffsetX);
+ y = pcb_grid_fit(y, PCB->Grid, PCB->GridOffsetY);
view_left_x = x - (view_width * view_zoom) / 2;
view_top_y = y - (view_height * view_zoom) / 2;
lesstif_pan_fixup();
@@ -822,15 +827,15 @@ The values are percentages of the board size. Thus, a move of
%end-doc */
-static int CursorAction(int argc, const char **argv, Coord x, Coord y)
+static int CursorAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- UnitList extra_units_x = {
+ pcb_unit_list_t extra_units_x = {
{"grid", 0, 0},
{"view", 0, UNIT_PERCENT},
{"board", 0, UNIT_PERCENT},
{"", 0, 0}
};
- UnitList extra_units_y = {
+ pcb_unit_list_t extra_units_y = {
{"grid", 0, 0},
{"view", 0, UNIT_PERCENT},
{"board", 0, UNIT_PERCENT},
@@ -848,32 +853,29 @@ static int CursorAction(int argc, const char **argv, Coord x, Coord y)
extra_units_y[2].scale = PCB->MaxHeight;
if (argc != 4)
- AFAIL(cursor);
+ PCB_AFAIL(cursor);
- if (strcasecmp(argv[0], "pan") == 0)
+ if (pcb_strcasecmp(argv[0], "pan") == 0)
pan_warp = HID_SC_PAN_VIEWPORT;
- else if (strcasecmp(argv[0], "warp") == 0)
+ else if (pcb_strcasecmp(argv[0], "warp") == 0)
pan_warp = HID_SC_WARP_POINTER;
else
- AFAIL(cursor);
+ PCB_AFAIL(cursor);
- dx = GetValueEx(argv[1], argv[3], NULL, extra_units_x, "mil", NULL);
+ dx = pcb_get_value_ex(argv[1], argv[3], NULL, extra_units_x, "mil", NULL);
if (conf_core.editor.view.flip_x)
dx = -dx;
- dy = GetValueEx(argv[2], argv[3], NULL, extra_units_y, "mil", NULL);
+ dy = pcb_get_value_ex(argv[2], argv[3], NULL, extra_units_y, "mil", NULL);
if (!conf_core.editor.view.flip_y)
dy = -dy;
- EventMoveCrosshair(Crosshair.X + dx, Crosshair.Y + dy);
- gui->set_crosshair(Crosshair.X, Crosshair.Y, pan_warp);
+ pcb_event_move_crosshair(pcb_crosshair.X + dx, pcb_crosshair.Y + dy);
+ pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp);
return 0;
}
-HID_Action lesstif_main_action_list[] = {
- {"PCBChanged", 0, PCBChanged,
- pcbchanged_help, pcbchanged_syntax}
- ,
+pcb_hid_action_t lesstif_main_action_list[] = {
{"SetUnits", 0, SetUnits,
setunits_help, setunits_syntax}
,
@@ -892,18 +894,14 @@ HID_Action lesstif_main_action_list[] = {
{"Benchmark", 0, Benchmark,
benchmark_help, benchmark_syntax}
,
- {"PointCursor", 0, PointCursor}
- ,
{"Center", "Click on a location to center", Center}
,
- {"Busy", 0, Busy}
- ,
{"Cursor", 0, CursorAction,
cursor_help, cursor_syntax}
,
};
-REGISTER_ACTIONS(lesstif_main_action_list, lesstif_cookie)
+PCB_REGISTER_ACTIONS(lesstif_main_action_list, lesstif_cookie)
/* ----------------------------------------------------------------------
@@ -1025,7 +1023,7 @@ void LoadBackgroundImage(char *filename)
{
FILE *f = fopen(filename, "rb");
if (!f) {
- if (NSTRCMP(filename, "pcb-background.ppm"))
+ if (PCB_NSTRCMP(filename, "pcb-background.ppm"))
perror(filename);
return;
}
@@ -1072,9 +1070,9 @@ static void DrawBackgroundImage()
/* ---------------------------------------------------------------------- */
-static HID_Attribute *lesstif_get_export_options(int *n)
+static pcb_hid_attribute_t *lesstif_get_export_options(int *n)
{
- *n = sizeof(lesstif_attribute_list) / sizeof(HID_Attribute);
+ *n = sizeof(lesstif_attribute_list) / sizeof(pcb_hid_attribute_t);
return lesstif_attribute_list;
}
@@ -1124,7 +1122,7 @@ static void zoom_max()
view_left_x = -(view_width * new_zoom - PCB->MaxWidth) / 2;
view_top_y = -(view_height * new_zoom - PCB->MaxHeight) / 2;
view_zoom = new_zoom;
- pixel_slop = view_zoom;
+ pcb_pixel_slop = view_zoom;
lesstif_pan_fixup();
}
@@ -1160,7 +1158,7 @@ static void zoom_to(double new_zoom, int x, int y)
if (view_zoom != new_zoom) {
view_zoom = new_zoom;
- pixel_slop = view_zoom;
+ pcb_pixel_slop = view_zoom;
view_left_x = cx - view_width * xfrac * view_zoom;
view_top_y = cy - view_height * yfrac * view_zoom;
@@ -1255,23 +1253,23 @@ static void mod_changed(XKeyEvent * e, int set)
return;
}
in_move_event = 1;
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
if (panning)
Pan(2, e->x, e->y);
- EventMoveCrosshair(Px(e->x), Py(e->y));
- AdjustAttachedObjects();
- notify_crosshair_change(pcb_true);
+ pcb_event_move_crosshair(Px(e->x), Py(e->y));
+ pcb_adjust_attached_objects();
+ pcb_notify_crosshair_change(pcb_true);
in_move_event = 0;
}
-static hid_cfg_mod_t lesstif_mb2cfg(int but)
+static pcb_hid_cfg_mod_t lesstif_mb2cfg(int but)
{
switch(but) {
- case 1: return MB_LEFT;
- case 2: return MB_MIDDLE;
- case 3: return MB_RIGHT;
- case 4: return MB_SCROLL_UP;
- case 5: return MB_SCROLL_DOWN;
+ case 1: return PCB_MB_LEFT;
+ case 2: return PCB_MB_MIDDLE;
+ case 3: return PCB_MB_RIGHT;
+ case 4: return PCB_MB_SCROLL_UP;
+ case 5: return PCB_MB_SCROLL_DOWN;
}
return 0;
}
@@ -1301,18 +1299,18 @@ static void work_area_input(Widget w, XtPointer v, XEvent * e, Boolean * ctd)
if (lesstif_button_event(w, e))
return;
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
pressed_button = e->xbutton.button;
- mods = ((e->xbutton.state & ShiftMask) ? M_Shift : 0)
- + ((e->xbutton.state & ControlMask) ? M_Ctrl : 0)
+ mods = ((e->xbutton.state & ShiftMask) ? PCB_M_Shift : 0)
+ + ((e->xbutton.state & ControlMask) ? PCB_M_Ctrl : 0)
#ifdef __APPLE__
- + ((e->xbutton.state & (1 << 13)) ? M_Alt : 0);
+ + ((e->xbutton.state & (1 << 13)) ? PCB_M_Alt : 0);
#else
- + ((e->xbutton.state & Mod1Mask) ? M_Alt : 0);
+ + ((e->xbutton.state & Mod1Mask) ? PCB_M_Alt : 0);
#endif
hid_cfg_mouse_action(&lesstif_mouse, lesstif_mb2cfg(e->xbutton.button) | mods);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
}
@@ -1322,18 +1320,18 @@ static void work_area_input(Widget w, XtPointer v, XEvent * e, Boolean * ctd)
if (e->xbutton.button != pressed_button)
return;
lesstif_button_event(w, e);
- notify_crosshair_change(pcb_false);
+ pcb_notify_crosshair_change(pcb_false);
pressed_button = 0;
- mods = ((e->xbutton.state & ShiftMask) ? M_Shift : 0)
- + ((e->xbutton.state & ControlMask) ? M_Ctrl : 0)
+ mods = ((e->xbutton.state & ShiftMask) ? PCB_M_Shift : 0)
+ + ((e->xbutton.state & ControlMask) ? PCB_M_Ctrl : 0)
#ifdef __APPLE__
- + ((e->xbutton.state & (1 << 13)) ? M_Alt : 0)
+ + ((e->xbutton.state & (1 << 13)) ? PCB_M_Alt : 0)
#else
- + ((e->xbutton.state & Mod1Mask) ? M_Alt : 0)
+ + ((e->xbutton.state & Mod1Mask) ? PCB_M_Alt : 0)
#endif
- + M_Release;
+ + PCB_M_Release;
hid_cfg_mouse_action(&lesstif_mouse, lesstif_mb2cfg(e->xbutton.button) | mods);
- notify_crosshair_change(pcb_true);
+ pcb_notify_crosshair_change(pcb_true);
break;
}
@@ -1356,7 +1354,7 @@ static void work_area_input(Widget w, XtPointer v, XEvent * e, Boolean * ctd)
in_move_event = 1;
if (panning)
Pan(2, pos_x, pos_y);
- EventMoveCrosshair(Px(pos_x), Py(pos_y));
+ pcb_event_move_crosshair(Px(pos_x), Py(pos_y));
in_move_event = 0;
}
break;
@@ -1370,7 +1368,7 @@ static void work_area_input(Widget w, XtPointer v, XEvent * e, Boolean * ctd)
case EnterNotify:
crosshair_in_window = 1;
in_move_event = 1;
- EventMoveCrosshair(Px(e->xcrossing.x), Py(e->xcrossing.y));
+ pcb_event_move_crosshair(Px(e->xcrossing.x), Py(e->xcrossing.y));
ShowCrosshair(pcb_true);
in_move_event = 0;
need_idle_proc();
@@ -1461,9 +1459,9 @@ static void draw_dozen_cross(GC xor_gc, int x, int y, int view_width, int view_h
static void draw_crosshair(GC xor_gc, int x, int y, int view_width, int view_height)
{
draw_right_cross(xor_gc, x, y, view_width, view_height);
- if (Crosshair.shape == Union_Jack_Crosshair_Shape)
+ if (pcb_crosshair.shape == pcb_ch_shape_union_jack)
draw_slanted_cross(xor_gc, x, y, view_width, view_height);
- if (Crosshair.shape == Dozen_Crosshair_Shape)
+ if (pcb_crosshair.shape == pcb_ch_shape_dozen)
draw_dozen_cross(xor_gc, x, y, view_width, view_height);
}
@@ -1676,11 +1674,11 @@ static unsigned short int lesstif_translate_key(const char *desc, int len)
{
KeySym key;
- if (strcasecmp(desc, "enter") == 0) desc = "Return";
+ if (pcb_strcasecmp(desc, "enter") == 0) desc = "Return";
key = XStringToKeysym(desc);
if (key == NoSymbol && len > 1) {
- Message(PCB_MSG_DEFAULT, "no symbol for %s\n", desc);
+ pcb_message(PCB_MSG_INFO, "lesstif_translate_key: no symbol for %s\n", desc);
return 0;
}
return key;
@@ -1700,7 +1698,7 @@ int lesstif_key_name(unsigned short int key_char, char *out, int out_len)
extern Widget lesstif_menubar;
static int lesstif_hid_inited = 0;
-static void lesstif_do_export(HID_Attr_Val * options)
+static void lesstif_do_export(pcb_hid_attr_val_t * options)
{
Dimension width, height;
Widget menu;
@@ -1708,7 +1706,7 @@ static void lesstif_do_export(HID_Attr_Val * options)
lesstif_begin();
- hid_cfg_keys_init(&lesstif_keymap);
+ pcb_hid_cfg_keys_init(&lesstif_keymap);
lesstif_keymap.translate_key = lesstif_translate_key;
lesstif_keymap.key_name = lesstif_key_name;
lesstif_keymap.auto_chr = 1;
@@ -1851,27 +1849,27 @@ static void lesstif_do_export(HID_Attr_Val * options)
XtDispatchEvent(&e);
}
- PCBChanged(0, 0, 0, 0);
+ pcb_board_changed(0);
lesstif_menubar = menu;
- event(EVENT_GUI_INIT, NULL);
+ pcb_event(PCB_EVENT_GUI_INIT, NULL);
lesstif_hid_inited = 1;
XtAppMainLoop(app_context);
- hid_cfg_keys_uninit(&lesstif_keymap);
+ pcb_hid_cfg_keys_uninit(&lesstif_keymap);
lesstif_end();
}
-static void lesstif_do_exit(HID *hid)
+static void lesstif_do_exit(pcb_hid_t *hid)
{
XtAppSetExitFlag(app_context);
}
void lesstif_uninit_menu(void);
-static void lesstif_uninit(HID *hid)
+static void lesstif_uninit(pcb_hid_t *hid)
{
if (lesstif_hid_inited) {
lesstif_uninit_menu();
@@ -1883,7 +1881,7 @@ typedef union {
int i;
double f;
char *s;
- Coord c;
+ pcb_coord_t c;
} val_union;
static Boolean
@@ -1902,10 +1900,10 @@ pcb_cvt_string_to_double(Display * d, XrmValue * args, Cardinal * num_args, XrmV
static Boolean
pcb_cvt_string_to_coord(Display * d, XrmValue * args, Cardinal * num_args, XrmValue * from, XrmValue * to, XtPointer * data)
{
- static Coord rv;
- rv = GetValue((char *) from->addr, NULL, NULL, NULL);
+ static pcb_coord_t rv;
+ rv = pcb_get_value((char *) from->addr, NULL, NULL, NULL);
if (to->addr)
- *(Coord *) to->addr = rv;
+ *(pcb_coord_t *) to->addr = rv;
else
to->addr = (XPointer) & rv;
to->size = sizeof(rv);
@@ -1914,7 +1912,7 @@ pcb_cvt_string_to_coord(Display * d, XrmValue * args, Cardinal * num_args, XrmVa
static void mainwind_delete_cb()
{
- hid_action("Quit");
+ pcb_hid_action("Quit");
}
static void lesstif_listener_cb(XtPointer client_data, int *fid, XtInputId * id)
@@ -1927,14 +1925,14 @@ static void lesstif_listener_cb(XtPointer client_data, int *fid, XtInputId * id)
if (nbytes) {
buf[nbytes] = '\0';
- hid_parse_actions(buf);
+ pcb_hid_parse_actions(buf);
}
}
static void lesstif_parse_arguments(int *argc, char ***argv)
{
Atom close_atom;
- HID_AttrNode *ha;
+ pcb_hid_attr_node_t *ha;
int acount = 0, amax;
int rcount = 0, rmax;
int i;
@@ -1949,7 +1947,7 @@ static void lesstif_parse_arguments(int *argc, char ***argv)
for (ha = hid_attr_nodes; ha; ha = ha->next)
for (i = 0; i < ha->n; i++) {
- HID_Attribute *a = ha->attributes + i;
+ pcb_hid_attribute_t *a = ha->attributes + i;
switch (a->type) {
case HID_Integer:
case HID_Coord:
@@ -1993,7 +1991,7 @@ static void lesstif_parse_arguments(int *argc, char ***argv)
for (ha = hid_attr_nodes; ha; ha = ha->next)
for (i = 0; i < ha->n; i++) {
- HID_Attribute *a = ha->attributes + i;
+ pcb_hid_attribute_t *a = ha->attributes + i;
XrmOptionDescRec *o = new_options + acount;
char *tmpopt, *tmpres;
XtResource *r = new_resources + rcount;
@@ -2042,7 +2040,7 @@ static void lesstif_parse_arguments(int *argc, char ***argv)
case HID_Coord:
r->resource_type = XmStrCast(XtRPCBCoord);
r->default_type = XmStrCast(XtRPCBCoord);
- r->resource_size = sizeof(Coord);
+ r->resource_size = sizeof(pcb_coord_t);
r->default_addr = &(a->default_val.coord_value);
rcount++;
break;
@@ -2111,7 +2109,7 @@ static void lesstif_parse_arguments(int *argc, char ***argv)
rcount = 0;
for (ha = hid_attr_nodes; ha; ha = ha->next)
for (i = 0; i < ha->n; i++) {
- HID_Attribute *a = ha->attributes + i;
+ pcb_hid_attribute_t *a = ha->attributes + i;
val_union *v = new_values + rcount;
switch (a->type) {
case HID_Integer:
@@ -2123,7 +2121,7 @@ static void lesstif_parse_arguments(int *argc, char ***argv)
break;
case HID_Coord:
if (a->value)
- *(Coord *) a->value = v->c;
+ *(pcb_coord_t *) a->value = v->c;
else
a->default_val.coord_value = v->c;
rcount++;
@@ -2171,14 +2169,14 @@ static void draw_grid()
{
static XPoint *points = 0;
static int npoints = 0;
- Coord x1, y1, x2, y2, prevx;
- Coord x, y;
+ pcb_coord_t x1, y1, x2, y2, prevx;
+ pcb_coord_t x, y;
int n;
static GC grid_gc = 0;
if (!conf_core.editor.draw_grid)
return;
- if (Vz(PCB->Grid) < MIN_GRID_DISTANCE)
+ if (Vz(PCB->Grid) < PCB_MIN_GRID_DISTANCE)
return;
if (!grid_gc) {
grid_gc = XCreateGC(display, window, 0, 0);
@@ -2186,32 +2184,32 @@ static void draw_grid()
XSetForeground(display, grid_gc, grid_color);
}
if (conf_core.editor.view.flip_x) {
- x2 = GridFit(Px(0), PCB->Grid, PCB->GridOffsetX);
- x1 = GridFit(Px(view_width), PCB->Grid, PCB->GridOffsetX);
+ x2 = pcb_grid_fit(Px(0), PCB->Grid, PCB->GridOffsetX);
+ x1 = pcb_grid_fit(Px(view_width), PCB->Grid, PCB->GridOffsetX);
if (Vx(x2) < 0)
x2 -= PCB->Grid;
if (Vx(x1) >= view_width)
x1 += PCB->Grid;
}
else {
- x1 = GridFit(Px(0), PCB->Grid, PCB->GridOffsetX);
- x2 = GridFit(Px(view_width), PCB->Grid, PCB->GridOffsetX);
+ x1 = pcb_grid_fit(Px(0), PCB->Grid, PCB->GridOffsetX);
+ x2 = pcb_grid_fit(Px(view_width), PCB->Grid, PCB->GridOffsetX);
if (Vx(x1) < 0)
x1 += PCB->Grid;
if (Vx(x2) >= view_width)
x2 -= PCB->Grid;
}
if (conf_core.editor.view.flip_y) {
- y2 = GridFit(Py(0), PCB->Grid, PCB->GridOffsetY);
- y1 = GridFit(Py(view_height), PCB->Grid, PCB->GridOffsetY);
+ y2 = pcb_grid_fit(Py(0), PCB->Grid, PCB->GridOffsetY);
+ y1 = pcb_grid_fit(Py(view_height), PCB->Grid, PCB->GridOffsetY);
if (Vy(y2) < 0)
y2 -= PCB->Grid;
if (Vy(y1) >= view_height)
y1 += PCB->Grid;
}
else {
- y1 = GridFit(Py(0), PCB->Grid, PCB->GridOffsetY);
- y2 = GridFit(Py(view_height), PCB->Grid, PCB->GridOffsetY);
+ y1 = pcb_grid_fit(Py(0), PCB->Grid, PCB->GridOffsetY);
+ y2 = pcb_grid_fit(Py(view_height), PCB->Grid, PCB->GridOffsetY);
if (Vy(y1) < 0)
y1 += PCB->Grid;
if (Vy(y2) >= view_height)
@@ -2241,10 +2239,10 @@ static void draw_grid()
}
}
-static void mark_delta_to_widget(Coord dx, Coord dy, Widget w)
+static void mark_delta_to_widget(pcb_coord_t dx, pcb_coord_t dy, Widget w)
{
char *buf;
- double g = coord_to_unit(conf_core.editor.grid_unit, PCB->Grid);
+ double g = pcb_coord_to_unit(conf_core.editor.grid_unit, PCB->Grid);
int prec;
XmString ms;
@@ -2257,8 +2255,8 @@ static void mark_delta_to_widget(Coord dx, Coord dy, Widget w)
if (dx == 0 && dy == 0)
buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS", UUNIT, prec, dx, prec, dy);
else {
- Angle angle = atan2(dy, -dx) * 180 / M_PI;
- Coord dist = Distance(0, 0, dx, dy);
+ pcb_angle_t angle = atan2(dy, -dx) * 180 / M_PI;
+ pcb_coord_t dist = pcb_distance(0, 0, dx, dy);
buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS (%.*mS, %.2f\260)", UUNIT, prec, dx, prec, dy, prec, dist, angle);
}
@@ -2270,12 +2268,12 @@ static void mark_delta_to_widget(Coord dx, Coord dy, Widget w)
free(buf);
}
-static int cursor_pos_to_widget(Coord x, Coord y, Widget w, int prev_state)
+static int cursor_pos_to_widget(pcb_coord_t x, pcb_coord_t y, Widget w, int prev_state)
{
int this_state = prev_state;
char *buf = NULL;
const char *msg = "";
- double g = coord_to_unit(conf_core.editor.grid_unit, PCB->Grid);
+ double g = pcb_coord_to_unit(conf_core.editor.grid_unit, PCB->Grid);
XmString ms;
int prec;
@@ -2360,7 +2358,7 @@ static Boolean idle_proc(XtPointer dummy)
{
if (need_redraw) {
int mx, my;
- BoxType region;
+ pcb_box_t region;
lesstif_use_mask(0);
pixmap = main_pixmap;
mx = view_width;
@@ -2370,12 +2368,12 @@ static Boolean idle_proc(XtPointer dummy)
region.X2 = Px(view_width);
region.Y2 = Py(view_height);
if (conf_core.editor.view.flip_x) {
- Coord tmp = region.X1;
+ pcb_coord_t tmp = region.X1;
region.X1 = region.X2;
region.X2 = tmp;
}
if (conf_core.editor.view.flip_y) {
- Coord tmp = region.Y1;
+ pcb_coord_t tmp = region.Y1;
region.Y1 = region.Y2;
region.Y2 = tmp;
}
@@ -2429,7 +2427,7 @@ static Boolean idle_proc(XtPointer dummy)
}
}
DrawBackgroundImage();
- hid_expose_callback(&lesstif_hid, ®ion, 0);
+ pcb_hid_expose_callback(&lesstif_hid, ®ion, 0);
draw_grid();
lesstif_use_mask(0);
show_crosshair(0); /* To keep the drawn / not drawn info correct */
@@ -2437,18 +2435,18 @@ static Boolean idle_proc(XtPointer dummy)
XCopyArea(display, main_pixmap, window, my_gc, 0, 0, view_width, view_height, 0, 0);
pixmap = window;
if (crosshair_on) {
- DrawAttached();
- DrawMark();
+ pcb_draw_attached();
+ pcb_draw_mark();
}
need_redraw = 0;
}
{
static int c_x = -2, c_y = -2;
- static MarkType saved_mark;
- static const Unit *old_grid_unit = NULL;
+ static pcb_mark_t saved_mark;
+ static const pcb_unit_t *old_grid_unit = NULL;
if (crosshair_x != c_x || crosshair_y != c_y
- || conf_core.editor.grid_unit != old_grid_unit || memcmp(&saved_mark, &Marked, sizeof(MarkType))) {
+ || conf_core.editor.grid_unit != old_grid_unit || memcmp(&saved_mark, &pcb_marked, sizeof(pcb_mark_t))) {
static int last_state = 0;
static int this_state = 0;
@@ -2456,11 +2454,11 @@ static Boolean idle_proc(XtPointer dummy)
c_y = crosshair_y;
this_state = cursor_pos_to_widget(crosshair_x, crosshair_y, m_crosshair, this_state);
- if (Marked.status)
- mark_delta_to_widget(crosshair_x - Marked.X, crosshair_y - Marked.Y, m_mark);
+ if (pcb_marked.status)
+ mark_delta_to_widget(crosshair_x - pcb_marked.X, crosshair_y - pcb_marked.Y, m_mark);
- if (Marked.status != saved_mark.status) {
- if (Marked.status) {
+ if (pcb_marked.status != saved_mark.status) {
+ if (pcb_marked.status) {
XtManageChild(XtParent(m_mark));
XtManageChild(m_mark);
stdarg_n = 0;
@@ -2476,7 +2474,7 @@ static Boolean idle_proc(XtPointer dummy)
}
last_state = this_state + 100;
}
- memcpy(&saved_mark, &Marked, sizeof(MarkType));
+ memcpy(&saved_mark, &pcb_marked, sizeof(pcb_mark_t));
if (old_grid_unit != conf_core.editor.grid_unit) {
old_grid_unit = conf_core.editor.grid_unit;
@@ -2513,9 +2511,9 @@ static Boolean idle_proc(XtPointer dummy)
}
{
- static Coord old_grid = -1;
- static Coord old_gx, old_gy;
- static const Unit *old_unit;
+ static pcb_coord_t old_grid = -1;
+ static pcb_coord_t old_gx, old_gy;
+ static const pcb_unit_t *old_unit;
XmString ms;
if (PCB->Grid != old_grid || PCB->GridOffsetX != old_gx || PCB->GridOffsetY != old_gy || conf_core.editor.grid_unit != old_unit) {
static char buf[100];
@@ -2541,10 +2539,10 @@ static Boolean idle_proc(XtPointer dummy)
{
static double old_zoom = -1;
- static const Unit *old_grid_unit = NULL;
+ static const pcb_unit_t *old_grid_unit = NULL;
if (view_zoom != old_zoom || conf_core.editor.grid_unit != old_grid_unit) {
char *buf = pcb_strdup_printf("%m+%$mS/pix",
- conf_core.editor.grid_unit->allow, (Coord) view_zoom);
+ conf_core.editor.grid_unit->allow, (pcb_coord_t) view_zoom);
XmString ms;
old_zoom = view_zoom;
@@ -2731,7 +2729,7 @@ void lesstif_need_idle_proc()
idle_proc_set = 1;
}
-static void lesstif_invalidate_lr(int l, int r, int t, int b)
+static void lesstif_invalidate_lr(pcb_coord_t l, pcb_coord_t r, pcb_coord_t t, pcb_coord_t b)
{
if (!window)
return;
@@ -2770,7 +2768,7 @@ static void lesstif_notify_crosshair_change(pcb_bool changes_complete)
if (invalidate_depth == 0 && crosshair_on) {
save_pixmap = pixmap;
pixmap = window;
- DrawAttached();
+ pcb_draw_attached();
pixmap = save_pixmap;
}
@@ -2800,7 +2798,7 @@ static void lesstif_notify_mark_change(pcb_bool changes_complete)
if (invalidate_depth == 0 && crosshair_on) {
save_pixmap = pixmap;
pixmap = window;
- DrawMark();
+ pcb_draw_mark();
pixmap = save_pixmap;
}
@@ -2808,20 +2806,20 @@ static void lesstif_notify_mark_change(pcb_bool changes_complete)
invalidate_depth++;
}
-static int lesstif_set_layer(const char *name, int group, int empty)
+static int lesstif_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
{
int idx = group;
- if (idx >= 0 && idx < max_group) {
+ if (idx >= 0 && idx < pcb_max_group) {
int n = PCB->LayerGroups.Number[group];
for (idx = 0; idx < n - 1; idx++) {
int ni = PCB->LayerGroups.Entries[group][idx];
- if (ni >= 0 && ni < max_copper_layer + 2 && PCB->Data->Layer[ni].On)
+ if (ni >= 0 && ni < pcb_max_copper_layer + 2 && PCB->Data->Layer[ni].On)
break;
}
idx = PCB->LayerGroups.Entries[group][idx];
#if 0
- if (idx == LayerStack[0]
- || GetLayerGroupNumberByNumber(idx) == GetLayerGroupNumberByNumber(LayerStack[0]))
+ if (idx == pcb_layer_stack[0]
+ || pcb_layer_get_group(idx) == pcb_layer_get_group(pcb_layer_stack[0]))
autofade = 0;
else
autofade = 1;
@@ -2831,42 +2829,45 @@ static int lesstif_set_layer(const char *name, int group, int empty)
else
autofade = 0;
#endif
- if (idx >= 0 && idx < max_copper_layer + 2)
+
+ if (flags & PCB_LYT_COPPER)
return pinout ? 1 : PCB->Data->Layer[idx].On;
- if (idx < 0) {
- switch (SL_TYPE(idx)) {
- case SL_INVISIBLE:
+
+ {
+ switch (flags & PCB_LYT_ANYTHING) {
+ case PCB_LYT_INVIS:
return pinout ? 0 : PCB->InvisibleObjectsOn;
- case SL_MASK:
- if (SL_MYSIDE(idx) && !pinout)
+ case PCB_LYT_MASK:
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags) && !pinout)
return conf_core.editor.show_mask;
return 0;
- case SL_SILK:
- if (SL_MYSIDE(idx) || pinout)
+ case PCB_LYT_SILK:
+ if (PCB_LAYERFLG_ON_VISIBLE_SIDE(flags) || pinout) {
return PCB->ElementOn;
+ }
return 0;
- case SL_ASSY:
+ case PCB_LYT_ASSY:
return 0;
- case SL_UDRILL:
- case SL_PDRILL:
+ case PCB_LYT_UDRILL:
+ case PCB_LYT_PDRILL:
return 1;
- case SL_RATS:
+ case PCB_LYT_RAT:
return PCB->RatOn;
}
}
return 0;
}
-static hidGC lesstif_make_gc(void)
+static pcb_hid_gc_t lesstif_make_gc(void)
{
- hidGC rv = (hid_gc_struct *) malloc(sizeof(hid_gc_struct));
- memset(rv, 0, sizeof(hid_gc_struct));
+ pcb_hid_gc_t rv = (hid_gc_s *) malloc(sizeof(hid_gc_s));
+ memset(rv, 0, sizeof(hid_gc_s));
rv->me_pointer = &lesstif_hid;
rv->colorname = NULL;
return rv;
}
-static void lesstif_destroy_gc(hidGC gc)
+static void lesstif_destroy_gc(pcb_hid_gc_t gc)
{
if (gc->colorname != NULL)
free(gc->colorname);
@@ -2916,10 +2917,10 @@ static void lesstif_use_mask(int use_it)
}
}
-static void lesstif_set_color(hidGC gc, const char *name)
+static void lesstif_set_color(pcb_hid_gc_t gc, const char *name)
{
static void *cache = 0;
- hidval cval;
+ pcb_hidval_t cval;
static XColor color, exact_color;
if (!display)
@@ -2941,7 +2942,7 @@ static void lesstif_set_color(hidGC gc, const char *name)
gc->color = offlimit_color;
gc->erase = 0;
}
- else if (hid_cache_color(0, name, &cval, &cache)) {
+ else if (pcb_hid_cache_color(0, name, &cval, &cache)) {
gc->color = cval.lval;
gc->erase = 0;
}
@@ -2952,7 +2953,7 @@ static void lesstif_set_color(hidGC gc, const char *name)
printf("lesstif_set_color `%s' %08x rgb/%d/%d/%d\n", name, color.pixel, color.red, color.green, color.blue);
#endif
cval.lval = gc->color = color.pixel;
- hid_cache_color(1, name, &cval, &cache);
+ pcb_hid_cache_color(1, name, &cval, &cache);
gc->erase = 0;
}
if (autofade) {
@@ -2973,7 +2974,7 @@ static void lesstif_set_color(hidGC gc, const char *name)
}
}
-static void set_gc(hidGC gc)
+static void set_gc(pcb_hid_gc_t gc)
{
int cap, join, width;
if (gc->me_pointer != &lesstif_hid) {
@@ -3027,24 +3028,24 @@ static void set_gc(hidGC gc)
}
}
-static void lesstif_set_line_cap(hidGC gc, EndCapStyle style)
+static void lesstif_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
{
gc->cap = style;
}
-static void lesstif_set_line_width(hidGC gc, Coord width)
+static void lesstif_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
{
gc->width = width;
}
-static void lesstif_set_draw_xor(hidGC gc, int xor_set)
+static void lesstif_set_draw_xor(pcb_hid_gc_t gc, int xor_set)
{
gc->xor_set = xor_set;
}
#define ISORT(a,b) if (a>b) { a^=b; b^=a; a^=b; }
-static void lesstif_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void lesstif_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
double dx1, dy1, dx2, dy2;
int vw = Vz(gc->width);
@@ -3062,7 +3063,7 @@ static void lesstif_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
#endif
#if 1
- if (!ClipLine(0, 0, view_width, view_height, &dx1, &dy1, &dx2, &dy2, vw))
+ if (!pcb_line_clip(0, 0, view_width, view_height, &dx1, &dy1, &dx2, &dy2, vw))
return;
#endif
@@ -3084,7 +3085,7 @@ static void lesstif_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
}
}
-static void lesstif_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle)
+static void lesstif_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle)
{
if ((pinout || conf_core.editor.thin_draw) && gc->erase)
return;
@@ -3103,7 +3104,7 @@ static void lesstif_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord he
start_angle = -start_angle;
delta_angle = -delta_angle;
}
- start_angle = NormalizeAngle(start_angle);
+ start_angle = pcb_normalize_angle(start_angle);
if (start_angle >= 180)
start_angle -= 360;
#if 0
@@ -3129,7 +3130,7 @@ static void lesstif_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord he
#endif
}
-static void lesstif_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void lesstif_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
int vw = Vz(gc->width);
if ((pinout || conf_core.editor.thin_draw) && gc->erase)
@@ -3162,7 +3163,7 @@ static void lesstif_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
XDrawRectangle(display, mask_bitmap, mask_gc, x1, y1, x2 - x1 + 1, y2 - y1 + 1);
}
-static void lesstif_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
+static void lesstif_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
{
if (pinout && use_mask && gc->erase)
return;
@@ -3187,7 +3188,7 @@ static void lesstif_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius)
XFillArc(display, mask_bitmap, mask_gc, cx, cy, radius * 2, radius * 2, 0, 360 * 64);
}
-static void lesstif_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
+static void lesstif_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
{
static XPoint *p = 0;
static int maxp = 0;
@@ -3214,7 +3215,7 @@ static void lesstif_fill_polygon(hidGC gc, int n_coords, Coord * x, Coord * y)
XFillPolygon(display, mask_bitmap, mask_gc, p, n_coords, Complex, CoordModeOrigin);
}
-static void lesstif_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+static void lesstif_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
{
int vw = Vz(gc->width);
if ((pinout || conf_core.editor.thin_draw) && gc->erase)
@@ -3267,7 +3268,7 @@ static int lesstif_mod1_is_pressed(void)
return alt_pressed;
}
-extern void lesstif_get_coords(const char *msg, Coord * x, Coord * y);
+extern void lesstif_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y);
static void lesstif_set_crosshair(int x, int y, int action)
{
@@ -3312,8 +3313,8 @@ static void lesstif_set_crosshair(int x, int y, int action)
}
typedef struct {
- void (*func) (hidval);
- hidval user_data;
+ void (*func) (pcb_hidval_t);
+ pcb_hidval_t user_data;
XtIntervalId id;
} TimerStruct;
@@ -3324,10 +3325,10 @@ static void lesstif_timer_cb(XtPointer * p, XtIntervalId * id)
free(ts);
}
-static hidval lesstif_add_timer(void (*func) (hidval user_data), unsigned long milliseconds, hidval user_data)
+static pcb_hidval_t lesstif_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data)
{
TimerStruct *t;
- hidval rv;
+ pcb_hidval_t rv;
t = (TimerStruct *) malloc(sizeof(TimerStruct));
rv.ptr = t;
t->func = func;
@@ -3336,7 +3337,7 @@ static hidval lesstif_add_timer(void (*func) (hidval user_data), unsigned long m
return rv;
}
-static void lesstif_stop_timer(hidval hv)
+static void lesstif_stop_timer(pcb_hidval_t hv)
{
TimerStruct *ts = (TimerStruct *) hv.ptr;
XtRemoveTimeOut(ts->id);
@@ -3345,8 +3346,8 @@ static void lesstif_stop_timer(hidval hv)
typedef struct {
- void (*func) (hidval, int, unsigned int, hidval);
- hidval user_data;
+ void (*func) (pcb_hidval_t, int, unsigned int, pcb_hidval_t);
+ pcb_hidval_t user_data;
int fd;
XtInputId id;
} WatchStruct;
@@ -3358,7 +3359,7 @@ static void lesstif_watch_cb(XtPointer client_data, int *fid, XtInputId * id)
unsigned int pcb_condition = 0;
struct pollfd fds;
short condition;
- hidval x;
+ pcb_hidval_t x;
WatchStruct *watch = (WatchStruct *) client_data;
fds.fd = watch->fd;
@@ -3382,12 +3383,12 @@ static void lesstif_watch_cb(XtPointer client_data, int *fid, XtInputId * id)
return;
}
-hidval
+pcb_hidval_t
lesstif_watch_file(int fd, unsigned int condition,
- void (*func) (hidval watch, int fd, unsigned int condition, hidval user_data), hidval user_data)
+ void (*func) (pcb_hidval_t watch, int fd, unsigned int condition, pcb_hidval_t user_data), pcb_hidval_t user_data)
{
WatchStruct *watch = (WatchStruct *) malloc(sizeof(WatchStruct));
- hidval ret;
+ pcb_hidval_t ret;
unsigned int xt_condition = 0;
if (condition & PCB_WATCH_READABLE)
@@ -3408,7 +3409,7 @@ lesstif_watch_file(int fd, unsigned int condition,
return ret;
}
-void lesstif_unwatch_file(hidval data)
+void lesstif_unwatch_file(pcb_hidval_t data)
{
WatchStruct *watch = (WatchStruct *) data.ptr;
XtRemoveInput(watch->id);
@@ -3417,8 +3418,8 @@ void lesstif_unwatch_file(hidval data)
typedef struct {
XtBlockHookId id;
- void (*func) (hidval user_data);
- hidval user_data;
+ void (*func) (pcb_hidval_t user_data);
+ pcb_hidval_t user_data;
} BlockHookStruct;
static void lesstif_block_hook_cb(XtPointer user_data);
@@ -3429,9 +3430,9 @@ static void lesstif_block_hook_cb(XtPointer user_data)
block_hook->func(block_hook->user_data);
}
-static hidval lesstif_add_block_hook(void (*func) (hidval data), hidval user_data)
+static pcb_hidval_t lesstif_add_block_hook(void (*func) (pcb_hidval_t data), pcb_hidval_t user_data)
{
- hidval ret;
+ pcb_hidval_t ret;
BlockHookStruct *block_hook = (BlockHookStruct *) malloc(sizeof(BlockHookStruct));
block_hook->func = func;
@@ -3443,7 +3444,7 @@ static hidval lesstif_add_block_hook(void (*func) (hidval data), hidval user_dat
return ret;
}
-static void lesstif_stop_block_hook(hidval mlpoll)
+static void lesstif_stop_block_hook(pcb_hidval_t mlpoll)
{
BlockHookStruct *block_hook = (BlockHookStruct *) mlpoll.ptr;
XtRemoveBlockHook(block_hook->id);
@@ -3460,11 +3461,11 @@ extern int lesstif_close_confirm_dialog();
extern void lesstif_report_dialog(const char *title, const char *msg);
extern int
-lesstif_attribute_dialog(HID_Attribute * attrs, int n_attrs, HID_Attr_Val * results, const char *title, const char *descr);
+lesstif_attribute_dialog(pcb_hid_attribute_t * attrs, int n_attrs, pcb_hid_attr_val_t * results, const char *title, const char *descr);
static void pinout_callback(Widget da, PinoutData * pd, XmDrawingAreaCallbackStruct * cbs)
{
- BoxType region;
+ pcb_box_t region;
int save_vx, save_vy, save_vw, save_vh;
int save_fx, save_fy;
double save_vz;
@@ -3518,7 +3519,7 @@ static void pinout_callback(Widget da, PinoutData * pd, XmDrawingAreaCallbackStr
region.Y2 = PCB->MaxHeight;
XFillRectangle(display, pixmap, bg_gc, 0, 0, pd->v_width, pd->v_height);
- hid_expose_callback(&lesstif_hid, ®ion, pd->item);
+ pcb_hid_expose_callback(&lesstif_hid, ®ion, pd->item);
pinout = 0;
view_left_x = save_vx;
@@ -3547,7 +3548,7 @@ static void lesstif_show_item(void *item)
{
double scale;
Widget da;
- BoxType *extents;
+ pcb_box_t *extents;
PinoutData *pd;
for (pd = pinouts; pd; pd = pd->next)
@@ -3560,7 +3561,7 @@ static void lesstif_show_item(void *item)
pd->item = item;
- extents = hid_get_extents(item);
+ extents = pcb_hid_get_extents(item);
pd->left = extents->X1;
pd->right = extents->X2;
pd->top = extents->Y1;
@@ -3722,7 +3723,7 @@ static int lesstif_progress(int so_far, int total, const char *message)
return progress_cancelled;
}
-static HID *lesstif_request_debug_draw(void)
+static pcb_hid_t *lesstif_request_debug_draw(void)
{
/* Send drawing to the backing pixmap */
pixmap = main_pixmap;
@@ -3736,8 +3737,8 @@ static void lesstif_flush_debug_draw(void)
XCopyArea(display, main_pixmap, window, my_gc, 0, 0, view_width, view_height, 0, 0);
pixmap = window;
if (crosshair_on) {
- DrawAttached();
- DrawMark();
+ pcb_draw_attached();
+ pcb_draw_mark();
}
pixmap = main_pixmap;
}
@@ -3752,7 +3753,7 @@ static void lesstif_finish_debug_draw(void)
static int lesstif_usage(const char *topic)
{
fprintf(stderr, "\nLesstif GUI command line arguments:\n\n");
- hid_usage(lesstif_attribute_list, sizeof(lesstif_attribute_list) / sizeof(lesstif_attribute_list[0]));
+ pcb_hid_usage(lesstif_attribute_list, sizeof(lesstif_attribute_list) / sizeof(lesstif_attribute_list[0]));
fprintf(stderr, "\nInvocation: pcb-rnd --gui lesstif [options]\n");
return 0;
}
@@ -3761,18 +3762,24 @@ static int lesstif_usage(const char *topic)
void lesstif_create_menu(const char *menu, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie);
+static void hid_lesstif_uninit(void)
+{
+ pcb_event_unbind_allcookie(lesstif_cookie);
+}
+
pcb_uninit_t hid_hid_lesstif_init()
{
- memset(&lesstif_hid, 0, sizeof(HID));
+ memset(&lesstif_hid, 0, sizeof(pcb_hid_t));
- common_nogui_init(&lesstif_hid);
- common_draw_helpers_init(&lesstif_hid);
+ pcb_hid_nogui_init(&lesstif_hid);
+ pcb_dhlp_draw_helpers_init(&lesstif_hid);
- lesstif_hid.struct_size = sizeof(HID);
+ lesstif_hid.struct_size = sizeof(pcb_hid_t);
lesstif_hid.name = "lesstif";
lesstif_hid.description = "LessTif - a Motif clone for X/Unix";
lesstif_hid.gui = 1;
lesstif_hid.poly_before = 1;
+ lesstif_hid.can_mask_clear_rats = 1;
lesstif_hid.get_export_options = lesstif_get_export_options;
lesstif_hid.do_export = lesstif_do_export;
@@ -3783,7 +3790,7 @@ pcb_uninit_t hid_hid_lesstif_init()
lesstif_hid.invalidate_all = lesstif_invalidate_all;
lesstif_hid.notify_crosshair_change = lesstif_notify_crosshair_change;
lesstif_hid.notify_mark_change = lesstif_notify_mark_change;
- lesstif_hid.set_layer = lesstif_set_layer;
+ lesstif_hid.set_layer_group = lesstif_set_layer_group;
lesstif_hid.make_gc = lesstif_make_gc;
lesstif_hid.destroy_gc = lesstif_destroy_gc;
lesstif_hid.use_mask = lesstif_use_mask;
@@ -3823,6 +3830,7 @@ pcb_uninit_t hid_hid_lesstif_init()
lesstif_hid.beep = lesstif_beep;
lesstif_hid.progress = lesstif_progress;
lesstif_hid.edit_attributes = lesstif_attributes_dialog;
+ lesstif_hid.point_cursor = PointCursor;
lesstif_hid.request_debug_draw = lesstif_request_debug_draw;
lesstif_hid.flush_debug_draw = lesstif_flush_debug_draw;
@@ -3831,24 +3839,31 @@ pcb_uninit_t hid_hid_lesstif_init()
lesstif_hid.create_menu = lesstif_create_menu;
lesstif_hid.usage = lesstif_usage;
- hid_register_hid(&lesstif_hid);
+ pcb_event_bind(PCB_EVENT_BOARD_CHANGED, ev_pcb_changed, NULL, lesstif_cookie);
+ pcb_event_bind(PCB_EVENT_NETLIST_CHANGED, LesstifNetlistChanged, NULL, lesstif_cookie);
+ pcb_event_bind(PCB_EVENT_ROUTE_STYLES_CHANGED, LesstifRouteStylesChanged, NULL, lesstif_cookie);
+ pcb_event_bind(PCB_EVENT_LAYERS_CHANGED, LesstifLayersChanged, NULL, lesstif_cookie);
+ pcb_event_bind(PCB_EVENT_LIBRARY_CHANGED, LesstifLibraryChanged, NULL, lesstif_cookie);
+ pcb_event_bind(PCB_EVENT_BUSY, LesstifBusy, NULL, lesstif_cookie);
+
+ pcb_hid_register_hid(&lesstif_hid);
- return NULL;
+ return hid_lesstif_uninit;
}
static void lesstif_begin(void)
{
- REGISTER_ACTIONS(lesstif_library_action_list, lesstif_cookie)
- REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie)
- REGISTER_ACTIONS(lesstif_main_action_list, lesstif_cookie)
- REGISTER_ACTIONS(lesstif_dialog_action_list, lesstif_cookie)
- REGISTER_ACTIONS(lesstif_netlist_action_list, lesstif_cookie)
- REGISTER_ACTIONS(lesstif_menu_action_list, lesstif_cookie)
- REGISTER_ACTIONS(lesstif_styles_action_list, lesstif_cookie)
+ PCB_REGISTER_ACTIONS(lesstif_library_action_list, lesstif_cookie)
+ PCB_REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie)
+ PCB_REGISTER_ACTIONS(lesstif_main_action_list, lesstif_cookie)
+ PCB_REGISTER_ACTIONS(lesstif_dialog_action_list, lesstif_cookie)
+ PCB_REGISTER_ACTIONS(lesstif_netlist_action_list, lesstif_cookie)
+ PCB_REGISTER_ACTIONS(lesstif_menu_action_list, lesstif_cookie)
+ PCB_REGISTER_ACTIONS(lesstif_styles_action_list, lesstif_cookie)
}
static void lesstif_end(void)
{
- hid_remove_actions_by_cookie(lesstif_cookie);
- hid_remove_attributes_by_cookie(lesstif_cookie);
+ pcb_hid_remove_actions_by_cookie(lesstif_cookie);
+ pcb_hid_remove_attributes_by_cookie(lesstif_cookie);
}
diff --git a/src_plugins/hid_lesstif/menu.c b/src_plugins/hid_lesstif/menu.c
index 1428785..54ad821 100644
--- a/src_plugins/hid_lesstif/menu.c
+++ b/src_plugins/hid_lesstif/menu.c
@@ -9,10 +9,8 @@
#include <ctype.h>
#include <assert.h>
-#include "global.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "pcb-printf.h"
#include "layer.h"
@@ -21,16 +19,17 @@
#include "hid_cfg_action.h"
#include "hid_cfg_input.h"
#include "lesstif.h"
-#include "mymem.h"
#include "paths.h"
#include "hid_actions.h"
#include "hid_flags.h"
#include "stdarg.h"
+#include "event.h"
#include "compat_misc.h"
+#include "layer_vis.h"
#include <genht/hash.h>
Widget lesstif_menubar;
-hid_cfg_t *lesstif_cfg;
+pcb_hid_cfg_t *lesstif_cfg;
#ifndef R_OK
/* Common value for systems that don't define it. */
@@ -52,22 +51,22 @@ Prompts the user for a coordinate, if one is not already selected.
%end-doc */
-static int GetXY(int argc, const char **argv, Coord x, Coord y)
+static int GetXY(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
return 0;
}
/*-----------------------------------------------------------------------------*/
-#define LB_SILK (MAX_LAYER+0)
-#define LB_RATS (MAX_LAYER+1)
+#define LB_SILK (PCB_MAX_LAYER+0)
+#define LB_RATS (PCB_MAX_LAYER+1)
#define LB_NUMPICK (LB_RATS+1)
/* more */
-#define LB_PINS (MAX_LAYER+2)
-#define LB_VIAS (MAX_LAYER+3)
-#define LB_BACK (MAX_LAYER+4)
-#define LB_MASK (MAX_LAYER+5)
-#define LB_NUM (MAX_LAYER+6)
+#define LB_PINS (PCB_MAX_LAYER+2)
+#define LB_VIAS (PCB_MAX_LAYER+3)
+#define LB_BACK (PCB_MAX_LAYER+4)
+#define LB_MASK (PCB_MAX_LAYER+5)
+#define LB_NUM (PCB_MAX_LAYER+6)
typedef struct {
Widget w[LB_NUM];
@@ -81,17 +80,17 @@ static int bg_color;
extern Widget lesstif_m_layer;
-static int LayersChanged(int argc, const char **argv, Coord x, Coord y)
+void LesstifLayersChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
int l, i, set;
const char *name;
int current_layer;
if (!layer_button_list)
- return 0;
+ return;
if (PCB && PCB->Data) {
- DataType *d = PCB->Data;
- for (i = 0; i < MAX_LAYER; i++)
+ pcb_data_t *d = PCB->Data;
+ for (i = 0; i < PCB_MAX_LAYER; i++)
fg_colors[i] = lesstif_parse_color(d->Layer[i].Color);
fg_colors[LB_SILK] = lesstif_parse_color(PCB->ElementColor);
fg_colors[LB_RATS] = lesstif_parse_color(PCB->RatColor);
@@ -102,7 +101,7 @@ static int LayersChanged(int argc, const char **argv, Coord x, Coord y)
bg_color = lesstif_parse_color(conf_core.appearance.color.background);
}
else {
- for (i = 0; i < MAX_LAYER; i++)
+ for (i = 0; i < PCB_MAX_LAYER; i++)
fg_colors[i] = lesstif_parse_color(conf_core.appearance.color.layer[i]);
fg_colors[LB_SILK] = lesstif_parse_color(conf_core.appearance.color.element);
fg_colors[LB_RATS] = lesstif_parse_color(conf_core.appearance.color.rat);
@@ -118,7 +117,7 @@ static int LayersChanged(int argc, const char **argv, Coord x, Coord y)
else if (PCB->SilkActive)
current_layer = LB_SILK;
else
- current_layer = LayerStack[0];
+ current_layer = pcb_layer_stack[0];
for (l = 0; l < num_layer_buttons; l++) {
LayerButtons *lb = layer_button_list + l;
@@ -148,7 +147,7 @@ static int LayersChanged(int argc, const char **argv, Coord x, Coord y)
}
stdarg_n = 0;
- if (i < MAX_LAYER && PCB->Data->Layer[i].Name) {
+ if (i < PCB_MAX_LAYER && PCB->Data->Layer[i].Name) {
XmString s = XmStringCreatePCB(PCB->Data->Layer[i].Name);
stdarg(XmNlabelString, s);
}
@@ -170,7 +169,7 @@ static int LayersChanged(int argc, const char **argv, Coord x, Coord y)
}
XtSetValues(lb->w[i], stdarg_args, stdarg_n);
- if (i >= max_copper_layer && i < MAX_LAYER)
+ if (i >= pcb_max_copper_layer && i < PCB_MAX_LAYER)
XtUnmanageChild(lb->w[i]);
else
XtManageChild(lb->w[i]);
@@ -197,7 +196,7 @@ static int LayersChanged(int argc, const char **argv, Coord x, Coord y)
lesstif_update_layer_groups();
- return 0;
+ return;
}
static void show_one_layer_button(int layer, int set)
@@ -253,12 +252,12 @@ static void layer_button_callback(Widget w, int layer, XmPushButtonCallbackStruc
}
show_one_layer_button(layer, set);
- if (layer < max_copper_layer) {
+ if (layer < pcb_max_copper_layer) {
int i;
- int group = GetLayerGroupNumberByNumber(layer);
+ pcb_layergrp_id_t group = pcb_layer_get_group(layer);
for (i = 0; i < PCB->LayerGroups.Number[group]; i++) {
l = PCB->LayerGroups.Entries[group][i];
- if (l != layer && l < max_copper_layer) {
+ if (l != layer && l < pcb_max_copper_layer) {
show_one_layer_button(l, set);
PCB->Data->Layer[l].On = set;
}
@@ -273,8 +272,8 @@ static void layerpick_button_callback(Widget w, int layer, XmPushButtonCallbackS
const char *name;
PCB->RatDraw = (layer == LB_RATS);
PCB->SilkActive = (layer == LB_SILK);
- if (layer < max_copper_layer)
- ChangeGroupVisibility(layer, 1, 1);
+ if (layer < pcb_max_copper_layer)
+ pcb_layervis_change_group_vis(layer, 1, 1);
for (l = 0; l < num_layer_buttons; l++) {
LayerButtons *lb = layer_button_list + l;
if (!lb->is_pick)
@@ -312,14 +311,14 @@ visible if it is not already visible
%end-doc */
-static int SelectLayer(int argc, const char **argv, Coord x, Coord y)
+static int SelectLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int newl;
if (argc == 0)
return 1;
- if (strcasecmp(argv[0], "silk") == 0)
+ if (pcb_strcasecmp(argv[0], "silk") == 0)
newl = LB_SILK;
- else if (strcasecmp(argv[0], "rats") == 0)
+ else if (pcb_strcasecmp(argv[0], "rats") == 0)
newl = LB_RATS;
else
newl = atoi(argv[0]) - 1;
@@ -345,7 +344,7 @@ the same as a special layer, the layer is chosen over the special layer.
%end-doc */
-static int ToggleView(int argc, const char **argv, Coord x, Coord y)
+static int ToggleView(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int i, l;
@@ -369,7 +368,7 @@ static int ToggleView(int argc, const char **argv, Coord x, Coord y)
layer_button_callback(0, LB_BACK, 0);
else {
l = -1;
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
if (strcmp(argv[0], PCB->Data->Layer[i].Name) == 0) {
l = i;
break;
@@ -403,11 +402,11 @@ static void insert_layerview_buttons(Widget menu)
switch (i) {
case LB_SILK:
name = "Silk";
- /*accel_idx = max_copper_layer;*/
+ /*accel_idx = pcb_max_copper_layer;*/
break;
case LB_RATS:
name = "Rat Lines";
- /*accel_idx = max_copper_layer + 1;*/
+ /*accel_idx = pcb_max_copper_layer + 1;*/
break;
case LB_PINS:
name = "Pins/Pads";
@@ -432,7 +431,7 @@ static void insert_layerview_buttons(Widget menu)
note_widget_flag(btn, XmNset, "showmask");
}
lb->is_pick = 0;
- LayersChanged(0, 0, 0, 0);
+ LesstifLayersChanged(0, 0, 0);
}
static void insert_layerpick_buttons(Widget menu)
@@ -458,12 +457,12 @@ static void insert_layerpick_buttons(Widget menu)
switch (i) {
case LB_SILK:
name = "Silk";
- /*accel_idx = max_copper_layer;*/
+ /*accel_idx = pcb_max_copper_layer;*/
strcpy(av, "SelectLayer(Silk)");
break;
case LB_RATS:
name = "Rat Lines";
- /*accel_idx = max_copper_layer + 1;*/
+ /*accel_idx = pcb_max_copper_layer + 1;*/
strcpy(av, "SelectLayer(Rats)");
break;
default:
@@ -478,7 +477,7 @@ static void insert_layerpick_buttons(Widget menu)
lb->w[i] = btn;
}
lb->is_pick = 1;
- LayersChanged(0, 0, 0, 0);
+ LesstifLayersChanged(0, 0, 0);
}
/*-----------------------------------------------------------------------------*/
@@ -488,9 +487,9 @@ typedef struct {
const char *flagname;
int oldval;
char *xres;
-} WidgetFlagType;
+} Widgetpcb_flag_t;
-static WidgetFlagType *wflags = 0;
+static Widgetpcb_flag_t *wflags = 0;
static int n_wflags = 0;
static int max_wflags = 0;
@@ -498,7 +497,7 @@ static void note_widget_flag(Widget w, char *type, const char *name)
{
if (n_wflags >= max_wflags) {
max_wflags += 20;
- wflags = (WidgetFlagType *) realloc(wflags, max_wflags * sizeof(WidgetFlagType));
+ wflags = (Widgetpcb_flag_t *) realloc(wflags, max_wflags * sizeof(Widgetpcb_flag_t));
}
wflags[n_wflags].w = w;
wflags[n_wflags].flagname = name;
@@ -511,7 +510,7 @@ void lesstif_update_widget_flags()
{
int i;
for (i = 0; i < n_wflags; i++) {
- int v = hid_get_flag(wflags[i].flagname);
+ int v = pcb_hid_get_flag(wflags[i].flagname);
Arg args[2];
if (v < 0) {
XtSetArg(args[0], wflags[i].xres, 0);
@@ -528,18 +527,16 @@ void lesstif_update_widget_flags()
/*-----------------------------------------------------------------------------*/
-HID_Action lesstif_menu_action_list[] = {
+pcb_hid_action_t lesstif_menu_action_list[] = {
{"GetXY", "", GetXY,
getxy_help, getxy_syntax},
- {"LayersChanged", 0, LayersChanged,
- layerschanged_help, layerschanged_syntax},
{"ToggleView", 0, ToggleView,
toggleview_help, toggleview_syntax},
{"SelectLayer", 0, SelectLayer,
selectlayer_help, selectlayer_syntax}
};
-REGISTER_ACTIONS(lesstif_menu_action_list, lesstif_cookie)
+PCB_REGISTER_ACTIONS(lesstif_menu_action_list, lesstif_cookie)
#if 0
static void
stdarg_do_color(char *value, char *which)
@@ -615,7 +612,7 @@ void lesstif_get_xy(const char *message)
XtUnmanageChild(m_click);
}
-void lesstif_get_coords(const char *msg, Coord * px, Coord * py)
+void lesstif_get_coords(const char *msg, pcb_coord_t * px, pcb_coord_t * py)
{
if (!have_xy && msg)
lesstif_get_xy(msg);
@@ -650,19 +647,19 @@ static void callback(Widget w, lht_node_t * node, XmPushButtonCallbackStruct * p
}
lesstif_need_idle_proc();
- hid_cfg_action(node);
+ pcb_hid_cfg_action(node);
}
static void note_accelerator(const lht_node_t *node)
{
lht_node_t *anode, *knode;
assert(node != NULL);
- anode = hid_cfg_menu_field(node, MF_ACTION, NULL);
- knode = hid_cfg_menu_field(node, MF_ACCELERATOR, NULL);
+ anode = pcb_hid_cfg_menu_field(node, PCB_MF_ACTION, NULL);
+ knode = pcb_hid_cfg_menu_field(node, PCB_MF_ACCELERATOR, NULL);
if ((anode != NULL) && (knode != NULL))
- hid_cfg_keys_add_by_desc(&lesstif_keymap, knode, anode, NULL, 0);
+ pcb_hid_cfg_keys_add_by_desc(&lesstif_keymap, knode, anode, NULL, 0);
else
- hid_cfg_error(node, "No action specified for key accel\n");
+ pcb_hid_cfg_error(node, "No action specified for key accel\n");
}
int lesstif_key_event(XKeyEvent * e)
@@ -671,15 +668,15 @@ int lesstif_key_event(XKeyEvent * e)
KeySym sym;
int slen;
int mods = 0;
- static hid_cfg_keyseq_t *seq[32];
+ static pcb_hid_cfg_keyseq_t *seq[32];
static int seq_len = 0;
if (e->state & ShiftMask)
- mods |= M_Shift;
+ mods |= PCB_M_Shift;
if (e->state & ControlMask)
- mods |= M_Ctrl;
+ mods |= PCB_M_Ctrl;
if (e->state & Mod1Mask)
- mods |= M_Alt;
+ mods |= PCB_M_Alt;
e->state &= ~(ControlMask | Mod1Mask);
@@ -708,7 +705,7 @@ int lesstif_key_event(XKeyEvent * e)
}
/* TODO#3: this works only on US keyboard */
- if (mods & M_Shift) {
+ if (mods & PCB_M_Shift) {
static const char *lower = "`1234567890-=[]\\;',./";
static const char *upper = "~!@#$%^&*()_+{}|:\"<>?";
char *l;
@@ -716,13 +713,13 @@ int lesstif_key_event(XKeyEvent * e)
sym = tolower(sym);
else if ((l = strchr(lower, sym)) != NULL) {
sym = upper[l - lower];
- mods &= ~M_Shift;
+ mods &= ~PCB_M_Shift;
}
}
/* printf("KEY lookup: mod=%x sym=%x/%d\n", mods, sym, slen); */
- slen = hid_cfg_keys_input(&lesstif_keymap, mods, sym, seq, &seq_len);
+ slen = pcb_hid_cfg_keys_input(&lesstif_keymap, mods, sym, seq, &seq_len);
if (slen <= 0)
return 1;
@@ -736,7 +733,7 @@ int lesstif_key_event(XKeyEvent * e)
/* Parsing actions may not return until more user interaction
happens. */
- hid_cfg_keys_action(seq, slen);
+ pcb_hid_cfg_keys_action(seq, slen);
return 1;
}
@@ -757,9 +754,9 @@ static void add_res2menu_main(Widget menu, lht_node_t *node, XtCallbackProc call
node->user_data = sub;
- if (hid_cfg_has_submenus(node)) {
+ if (pcb_hid_cfg_has_submenus(node)) {
lht_node_t *i;
- i = hid_cfg_menu_field(node, MF_SUBMENU, NULL);
+ i = pcb_hid_cfg_menu_field(node, PCB_MF_SUBMENU, NULL);
for(i = i->data.list.first; i != NULL; i = i->next)
add_node_to_menu(sub, i, callback, 1);
}
@@ -772,15 +769,15 @@ static void add_res2menu_named(Widget menu, lht_node_t *node, XtCallbackProc cal
lht_node_t *act, *kacc;
stdarg_n = 0;
- v = hid_cfg_menu_field_str(node, MF_FOREGROUND);
+ v = pcb_hid_cfg_menu_field_str(node, PCB_MF_FOREGROUND);
if (v != NULL)
stdarg_do_color(v, XmNforeground);
- v = hid_cfg_menu_field_str(node, MF_BACKGROUND);
+ v = pcb_hid_cfg_menu_field_str(node, PCB_MF_BACKGROUND);
if (v != NULL)
stdarg_do_color(v, XmNbackground);
- v = hid_cfg_menu_field_str(node, MF_FONT);
+ v = pcb_hid_cfg_menu_field_str(node, PCB_MF_FONT);
if (v != NULL) {
XFontStruct *fs = XLoadQueryFont(display, v);
if (fs) {
@@ -789,13 +786,13 @@ static void add_res2menu_named(Widget menu, lht_node_t *node, XtCallbackProc cal
}
}
- v = hid_cfg_menu_field_str(node, MF_MNEMONIC);
+ v = pcb_hid_cfg_menu_field_str(node, PCB_MF_MNEMONIC);
if (v != NULL)
stdarg(XmNmnemonic, v);
- kacc = hid_cfg_menu_field(node, MF_ACCELERATOR, NULL);
+ kacc = pcb_hid_cfg_menu_field(node, PCB_MF_ACCELERATOR, NULL);
if (kacc != NULL) {
- char *acc_str = hid_cfg_keys_gen_accel(&lesstif_keymap, kacc, 1, NULL);
+ char *acc_str = pcb_hid_cfg_keys_gen_accel(&lesstif_keymap, kacc, 1, NULL);
if (acc_str != NULL) {
XmString as = XmStringCreatePCB(acc_str);
@@ -809,11 +806,11 @@ static void add_res2menu_named(Widget menu, lht_node_t *node, XtCallbackProc cal
v = node->name;
stdarg(XmNlabelString, XmStringCreatePCB(pcb_strdup(v)));
- if (hid_cfg_has_submenus(node)) {
+ if (pcb_hid_cfg_has_submenus(node)) {
int nn = stdarg_n;
lht_node_t *i;
const char *field_name;
- lht_node_t *submenu_node = hid_cfg_menu_field(node, MF_SUBMENU, &field_name);
+ lht_node_t *submenu_node = pcb_hid_cfg_menu_field(node, PCB_MF_SUBMENU, &field_name);
stdarg(XmNtearOffModel, XmTEAR_OFF_ENABLED);
sub = XmCreatePulldownMenu(menu, pcb_strdup(v), stdarg_args + nn, stdarg_n - nn);
@@ -823,14 +820,14 @@ static void add_res2menu_named(Widget menu, lht_node_t *node, XtCallbackProc cal
btn = XmCreateCascadeButton(menu, XmStrCast("menubutton"), stdarg_args, stdarg_n);
XtManageChild(btn);
- /* assume submenu is a list, hid_cfg_has_submenus() already checked that */
+ /* assume submenu is a list, pcb_hid_cfg_has_submenus() already checked that */
for(i = submenu_node->data.list.first; i != NULL; i = i->next)
add_node_to_menu(sub, i, callback, level+1);
}
else {
/* doesn't have submenu */
- const char *checked = hid_cfg_menu_field_str(node, MF_CHECKED);
- const char *label = hid_cfg_menu_field_str(node, MF_SENSITIVE);
+ const char *checked = pcb_hid_cfg_menu_field_str(node, PCB_MF_CHECKED);
+ const char *label = pcb_hid_cfg_menu_field_str(node, PCB_MF_SENSITIVE);
#if 0
/* Do not support radio for now: the gtk HID doesn't have it either */
Resource *radio = resource_subres(node->v[i].subres, "radio");
@@ -853,7 +850,7 @@ static void add_res2menu_named(Widget menu, lht_node_t *node, XtCallbackProc cal
}
else
#endif
- act = hid_cfg_menu_field(node, MF_ACTION, NULL);
+ act = pcb_hid_cfg_menu_field(node, PCB_MF_ACTION, NULL);
if (checked) {
if (strchr(checked, '='))
stdarg(XmNindicatorType, XmONE_OF_MANY);
@@ -872,11 +869,11 @@ static void add_res2menu_named(Widget menu, lht_node_t *node, XtCallbackProc cal
XtAddCallback(btn, XmNactivateCallback, callback, (XtPointer) act);
}
- v = hid_cfg_menu_field_str(node, MF_CHECKED);
+ v = pcb_hid_cfg_menu_field_str(node, PCB_MF_CHECKED);
if (v != NULL)
note_widget_flag(btn, XmNset, v);
- v = hid_cfg_menu_field_str(node, MF_ACTIVE);
+ v = pcb_hid_cfg_menu_field_str(node, PCB_MF_ACTIVE);
if (v != NULL)
note_widget_flag(btn, XmNsensitive, v);
@@ -931,13 +928,13 @@ Widget lesstif_menu(Widget parent, const char *name, Arg * margs, int mn)
screen = DefaultScreen(display);
cmap = DefaultColormap(display, screen);
- lesstif_cfg = hid_cfg_load("lesstif", 0, lesstif_menu_default);
+ lesstif_cfg = pcb_hid_cfg_load("lesstif", 0, lesstif_menu_default);
if (lesstif_cfg == NULL) {
- Message(PCB_MSG_DEFAULT, "FATAL: can't load the lesstif menu res either from file or from hardwired default.");
+ pcb_message(PCB_MSG_ERROR, "FATAL: can't load the lesstif menu res either from file or from hardwired default.");
abort();
}
- mr = hid_cfg_get_menu(lesstif_cfg, "/main_menu");
+ mr = pcb_hid_cfg_get_menu(lesstif_cfg, "/main_menu");
if (mr != NULL) {
if (mr->type == LHT_LIST) {
lht_node_t *n;
@@ -945,7 +942,7 @@ Widget lesstif_menu(Widget parent, const char *name, Arg * margs, int mn)
add_node_to_menu(mb, n, (XtCallbackProc) callback, 0);
}
else
- hid_cfg_error(mr, "/main_menu should be a list");
+ pcb_hid_cfg_error(mr, "/main_menu should be a list");
}
@@ -969,7 +966,7 @@ static int lesstif_create_menu_widget(void *ctx, const char *path, const char *n
void lesstif_create_menu(const char *menu_path, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie)
{
- hid_cfg_create_menu(lesstif_cfg, menu_path, action, mnemonic, accel, tip, cookie, lesstif_create_menu_widget, NULL);
+ pcb_hid_cfg_create_menu(lesstif_cfg, menu_path, action, mnemonic, accel, tip, cookie, lesstif_create_menu_widget, NULL);
}
diff --git a/src_plugins/hid_lesstif/netlist.c b/src_plugins/hid_lesstif/netlist.c
index daa9dc9..c7e3ff0 100644
--- a/src_plugins/hid_lesstif/netlist.c
+++ b/src_plugins/hid_lesstif/netlist.c
@@ -8,7 +8,6 @@
#include "xincludes.h"
#include "compat_misc.h"
-#include "global.h"
#include "data.h"
#include "find.h"
@@ -18,6 +17,8 @@
#include "remove.h"
#include "crosshair.h"
#include "draw.h"
+#include "obj_all.h"
+#include "event.h"
#include "hid.h"
#include "hid_actions.h"
@@ -32,11 +33,9 @@ static XmString *netnode_strings = 0;
static int n_netnode_strings;
static int last_pick = -1;
-static int LesstifNetlistChanged(int argc, const char **argv, Coord x, Coord y);
-
static void pick_net(int pick)
{
- LibraryMenuType *menu = PCB->NetlistLib[NETLIST_EDITED].Menu + pick;
+ pcb_lib_menu_t *menu = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu + pick;
int i;
if (pick == last_pick)
@@ -59,7 +58,7 @@ static void netlist_select(Widget w, void *v, XmListCallbackStruct * cbs)
{
XmString str;
int pos = cbs->item_position;
- LibraryMenuTypePtr net = &(PCB->NetlistLib[NETLIST_EDITED].Menu[pos - 1]);
+ pcb_lib_menu_t *net = &(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[pos - 1]);
char *name = net->Name;
if (name[0] == ' ') {
name[0] = '*';
@@ -82,9 +81,9 @@ static void netlist_extend(Widget w, void *v, XmListCallbackStruct * cbs)
pick_net(cbs->item_position - 1);
}
-typedef void (*Std_Nbcb_Func) (LibraryMenuTypePtr, int);
+typedef void (*Std_Nbcb_Func) (pcb_lib_menu_t *, int);
-static void nbcb_rat_on(LibraryMenuTypePtr net, int pos)
+static void nbcb_rat_on(pcb_lib_menu_t *net, int pos)
{
XmString str;
char *name = net->Name;
@@ -95,7 +94,7 @@ static void nbcb_rat_on(LibraryMenuTypePtr net, int pos)
XmStringFree(str);
}
-static void nbcb_rat_off(LibraryMenuTypePtr net, int pos)
+static void nbcb_rat_off(pcb_lib_menu_t *net, int pos)
{
XmString str;
char *name = net->Name;
@@ -109,40 +108,40 @@ static void nbcb_rat_off(LibraryMenuTypePtr net, int pos)
/* Select on the layout the current net treeview selection
*/
-static void nbcb_select_common(LibraryMenuTypePtr net, int pos, int select_flag)
+static void nbcb_select_common(pcb_lib_menu_t *net, int pos, int select_flag)
{
- LibraryEntryType *entry;
- ConnectionType conn;
+ pcb_lib_entry_t *entry;
+ pcb_connection_t conn;
int i;
- InitConnectionLookup();
- ResetConnections(pcb_true);
+ pcb_conn_lookup_init();
+ pcb_reset_conns(pcb_true);
for (i = net->EntryN, entry = net->Entry; i; i--, entry++)
- if (SeekPad(entry, &conn, pcb_false))
- RatFindHook(conn.type, conn.ptr1, conn.ptr2, conn.ptr2, pcb_true, pcb_true);
-
- SelectConnection(select_flag);
- ResetConnections(pcb_false);
- FreeConnectionLookupMemory();
- IncrementUndoSerialNumber();
- Draw();
+ if (pcb_rat_seek_pad(entry, &conn, pcb_false))
+ pcb_rat_find_hook(conn.type, conn.ptr1, conn.ptr2, conn.ptr2, pcb_true, pcb_true);
+
+ pcb_select_connection(select_flag);
+ pcb_reset_conns(pcb_false);
+ pcb_conn_lookup_uninit();
+ pcb_undo_inc_serial();
+ pcb_draw();
}
-static void nbcb_select(LibraryMenuTypePtr net, int pos)
+static void nbcb_select(pcb_lib_menu_t *net, int pos)
{
nbcb_select_common(net, pos, 1);
}
-static void nbcb_deselect(LibraryMenuTypePtr net, int pos)
+static void nbcb_deselect(pcb_lib_menu_t *net, int pos)
{
nbcb_select_common(net, pos, 0);
}
-static void nbcb_find(LibraryMenuTypePtr net, int pos)
+static void nbcb_find(pcb_lib_menu_t *net, int pos)
{
char *name = net->Name + 2;
- hid_actionl("netlist", "find", name, NULL);
+ pcb_hid_actionl("netlist", "find", name, NULL);
}
static void nbcb_std_callback(Widget w, Std_Nbcb_Func v, XmPushButtonCallbackStruct * cbs)
@@ -152,9 +151,9 @@ static void nbcb_std_callback(Widget w, Std_Nbcb_Func v, XmPushButtonCallbackStr
if (XmListGetSelectedPos(netlist_list, &posl, &posc) == False)
return;
if (v == nbcb_find)
- hid_actionl("connection", "reset", NULL);
+ pcb_hid_actionl("connection", "reset", NULL);
for (i = 0; i < posc; i++) {
- LibraryMenuTypePtr net = &(PCB->NetlistLib[NETLIST_EDITED].Menu[posl[i] - 1]);
+ pcb_lib_menu_t *net = &(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[posl[i] - 1]);
v(net, posl[i]);
}
stdarg_n = 0;
@@ -173,32 +172,32 @@ static void nbcb_ripup(Widget w, Std_Nbcb_Func v, XmPushButtonCallbackStruct * c
{
nbcb_std_callback(w, nbcb_find, cbs);
- VISIBLELINE_LOOP(PCB->Data);
+ PCB_LINE_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, line) && !TEST_FLAG(PCB_FLAG_LOCK, line))
- RemoveObject(PCB_TYPE_LINE, layer, line, line);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, line) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, line))
+ pcb_remove_object(PCB_TYPE_LINE, layer, line, line);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- VISIBLEARC_LOOP(PCB->Data);
+ PCB_ARC_VISIBLE_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc))
- RemoveObject(PCB_TYPE_ARC, layer, arc, arc);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, arc) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, arc))
+ pcb_remove_object(PCB_TYPE_ARC, layer, arc, arc);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (PCB->ViaOn)
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, via) && !TEST_FLAG(PCB_FLAG_LOCK, via))
- RemoveObject(PCB_TYPE_VIA, via, via, via);
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, via) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, via))
+ pcb_remove_object(PCB_TYPE_VIA, via, via, via);
}
- END_LOOP;
+ PCB_END_LOOP;
}
static void netnode_browse(Widget w, XtPointer v, XmListCallbackStruct * cbs)
{
- LibraryMenuType *menu = PCB->NetlistLib[NETLIST_EDITED].Menu + last_pick;
+ pcb_lib_menu_t *menu = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu + last_pick;
const char *name = menu->Entry[cbs->item_position - 1].ListEntry;
char *ename, *pname;
@@ -210,33 +209,33 @@ static void netnode_browse(Widget w, XtPointer v, XmListCallbackStruct * cbs)
}
*pname++ = 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- char *es = element->Name[NAMEONPCB_INDEX].TextString;
+ char *es = element->Name[PCB_ELEMNAME_IDX_REFDES].TextString;
if (es && strcmp(es, ename) == 0) {
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
if (strcmp(pin->Number, pname) == 0) {
- MoveCrosshairAbsolute(pin->X, pin->Y);
+ pcb_crosshair_move_absolute(pin->X, pin->Y);
free(ename);
return;
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
if (strcmp(pad->Number, pname) == 0) {
int x = (pad->Point1.X + pad->Point2.X) / 2;
int y = (pad->Point1.Y + pad->Point2.Y) / 2;
- gui->set_crosshair(x, y, HID_SC_PAN_VIEWPORT);
+ pcb_gui->set_crosshair(x, y, HID_SC_PAN_VIEWPORT);
free(ename);
return;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- END_LOOP;
+ PCB_END_LOOP;
free(ename);
}
@@ -343,25 +342,25 @@ static int build_netlist_dialog()
return 0;
}
-static int LesstifNetlistChanged(int argc, const char **argv, Coord x, Coord y)
+void LesstifNetlistChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
int i;
- if (!PCB->NetlistLib[NETLIST_EDITED].MenuN)
- return 0;
+ if (!PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN)
+ return;
if (build_netlist_dialog())
- return 0;
+ return;
last_pick = -1;
if (netlist_strings)
free(netlist_strings);
- netlist_strings = (XmString *) malloc(PCB->NetlistLib[NETLIST_EDITED].MenuN * sizeof(XmString));
- for (i = 0; i < PCB->NetlistLib[NETLIST_EDITED].MenuN; i++)
- netlist_strings[i] = XmStringCreatePCB(PCB->NetlistLib[NETLIST_EDITED].Menu[i].Name);
+ netlist_strings = (XmString *) malloc(PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN * sizeof(XmString));
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; i++)
+ netlist_strings[i] = XmStringCreatePCB(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[i].Name);
stdarg_n = 0;
stdarg(XmNitems, netlist_strings);
- stdarg(XmNitemCount, PCB->NetlistLib[NETLIST_EDITED].MenuN);
+ stdarg(XmNitemCount, PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN);
XtSetValues(netlist_list, stdarg_args, stdarg_n);
pick_net(0);
- return 0;
+ return;
}
static const char netlistshow_syntax[] = "NetlistShow(pinname|netname)";
@@ -372,13 +371,13 @@ static const char netlistshow_help[] = "Selects the given pinname or netname in
%end-doc */
-static int LesstifNetlistShow(int argc, const char **argv, Coord x, Coord y)
+static int LesstifNetlistShow(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (build_netlist_dialog())
return 0;
if (argc == 1) {
- LibraryMenuTypePtr net;
+ pcb_lib_menu_t *net;
net = pcb_netnode_to_netname(argv[0]);
if (net) {
@@ -431,11 +430,9 @@ void lesstif_show_netlist()
XtManageChild(netlist_dialog);
}
-HID_Action lesstif_netlist_action_list[] = {
- {"NetlistChanged", 0, LesstifNetlistChanged,
- netlistchanged_help, netlistchanged_syntax},
+pcb_hid_action_t lesstif_netlist_action_list[] = {
{"NetlistShow", 0, LesstifNetlistShow,
netlistshow_help, netlistshow_syntax}
};
-REGISTER_ACTIONS(lesstif_netlist_action_list, lesstif_cookie)
+PCB_REGISTER_ACTIONS(lesstif_netlist_action_list, lesstif_cookie)
diff --git a/src_plugins/hid_lesstif/styles.c b/src_plugins/hid_lesstif/styles.c
index e46a030..45c65a7 100644
--- a/src_plugins/hid_lesstif/styles.c
+++ b/src_plugins/hid_lesstif/styles.c
@@ -9,11 +9,7 @@
#include <string.h>
#include "compat_misc.h"
-#include "global.h"
#include "data.h"
-#include "set.h"
-#include "misc.h"
-#include "mymem.h"
#include "pcb-printf.h"
#include "hid.h"
@@ -21,6 +17,7 @@
#include "hid_flags.h"
#include "stdarg.h"
#include "misc_util.h"
+#include "event.h"
/* There are three places where styles are kept:
@@ -40,6 +37,9 @@
So, we need to do PCB->RouteStyle <-> active style.
*/
+void LesstifRouteStylesChanged(void *user_data, int argc, pcb_event_arg_t argv[]);
+
+
typedef enum {
SSthick, SSdiam, SShole, SSkeep,
SSNUM
@@ -65,7 +65,7 @@ static Widget value_form, value_labels, value_texts, units_form;
static int local_update = 0;
XmString xms_mm, xms_mil;
-static const Unit *unit = 0;
+static const pcb_unit_t *unit = 0;
static XmString ustr;
static int hash(char *cp)
@@ -83,9 +83,7 @@ static const char *value_names[] = {
"Thickness", "Diameter", "Hole", "Clearance"
};
-static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y);
-
-static void update_one_value(int i, Coord v)
+static void update_one_value(int i, pcb_coord_t v)
{
char buf[100];
@@ -120,7 +118,7 @@ void lesstif_styles_update_values()
static void update_style_buttons()
{
- int i = hid_get_flag("GetStyle()");
+ int i = pcb_hid_get_flag("GetStyle()");
int j, n;
for (n = 0; n < num_style_buttons; n++) {
@@ -146,7 +144,7 @@ static void style_value_cb(Widget w, int i, void *cbs)
if (local_update)
return;
s = XmTextGetString(w);
- GetValueEx(s, NULL, NULL, NULL, unit->suffix, NULL);
+ pcb_get_value_ex(s, NULL, NULL, NULL, unit->suffix, NULL);
switch (i) {
case SSthick:
conf_setf(CFR_DESIGN, "design/line_thickness", -1, "%s %s", s, unit->suffix);
@@ -222,7 +220,7 @@ static void style_name_cb(Widget w, int i, XmToggleButtonCallbackStruct * cbs)
PCB->RouteStyle.array[i].name[sizeof(PCB->RouteStyle.array[i].name)-1] = '\0';
free(newname);
- RouteStylesChanged(0, 0, 0, 0);
+ LesstifRouteStylesChanged(0, 0, 0);
}
static void style_set_cb(Widget w, int i, XmToggleButtonCallbackStruct * cbs)
@@ -236,17 +234,17 @@ static void style_set_cb(Widget w, int i, XmToggleButtonCallbackStruct * cbs)
static void style_selected(Widget w, int i, XmToggleButtonCallbackStruct * cbs)
{
- RouteStyleType *style;
+ pcb_route_style_t *style;
int j, n;
if (cbs && cbs->set == 0) {
XmToggleButtonSetState(w, 1, 0);
return;
}
style = PCB->RouteStyle.array + i;
- SetLineSize(style->Thick);
- SetViaSize(style->Diameter, pcb_true);
- SetViaDrillingHole(style->Hole, pcb_true);
- SetClearanceWidth(style->Clearance);
+ pcb_board_set_line_width(style->Thick);
+ pcb_board_set_via_size(style->Diameter, pcb_true);
+ pcb_board_set_via_drilling_hole(style->Hole, pcb_true);
+ pcb_board_set_clearance(style->Clearance);
if (style_dialog) {
for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++)
if (j != i)
@@ -312,7 +310,7 @@ static const char adjuststyle_help[] = "Displays the route style adjustment wind
%end-doc */
-static int AdjustStyle(int argc, const char **argv, Coord x, Coord y)
+static int AdjustStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if ((!mainwind) || (PCB->RouteStyle.array == NULL))
return 1;
@@ -375,14 +373,14 @@ static int AdjustStyle(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y)
+void LesstifRouteStylesChanged(void *user_data, int argc, pcb_event_arg_t argv[])
{
int i, j, h;
if (!PCB || vtroutestyle_len(&PCB->RouteStyle) == 0)
- return 0;
+ return;
update_style_buttons();
if (!style_dialog)
- return 0;
+ return;
for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) {
h = hash(PCB->RouteStyle.array[j].name);
if (name_hashes[j] == h)
@@ -396,7 +394,7 @@ static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y)
XtSetValues(style_button_list[i].w[j], stdarg_args, stdarg_n);
}
update_values();
- return 0;
+ return;
}
void lesstif_insert_style_buttons(Widget menu)
@@ -429,12 +427,9 @@ void lesstif_insert_style_buttons(Widget menu)
update_style_buttons();
}
-HID_Action lesstif_styles_action_list[] = {
+pcb_hid_action_t lesstif_styles_action_list[] = {
{"AdjustStyle", 0, AdjustStyle,
adjuststyle_help, adjuststyle_syntax}
- ,
- {"RouteStylesChanged", 0, RouteStylesChanged,
- routestyleschanged_help, routestyleschanged_syntax}
};
-REGISTER_ACTIONS(lesstif_styles_action_list, lesstif_cookie)
+PCB_REGISTER_ACTIONS(lesstif_styles_action_list, lesstif_cookie)
diff --git a/src_plugins/hid_remote/Makefile b/src_plugins/hid_remote/Makefile
new file mode 100644
index 0000000..83b89a7
--- /dev/null
+++ b/src_plugins/hid_remote/Makefile
@@ -0,0 +1,6 @@
+all:
+ cd ../../src && $(MAKE) mod_hid_remote
+
+clean:
+ rm *.o *.so 2>/dev/null ; true
+
diff --git a/src_plugins/hid_remote/Plug.tmpasm b/src_plugins/hid_remote/Plug.tmpasm
new file mode 100644
index 0000000..4864a83
--- /dev/null
+++ b/src_plugins/hid_remote/Plug.tmpasm
@@ -0,0 +1,12 @@
+put /local/pcb/mod {hid_remote}
+append /local/pcb/mod/OBJS [@
+ $(PLUGDIR)/hid_remote/remote.o
+ $(PLUGDIR)/hid_remote/base64.o
+ $(PLUGDIR)/hid_remote/proto.o
+@]
+
+switch /local/pcb/hid_remote/controls
+ case {buildin} include /local/pcb/tmpasm/buildin; end;
+ case {plugin} include /local/pcb/tmpasm/plugin; end;
+ case {disable} include /local/pcb/tmpasm/disable; end;
+end
diff --git a/src_plugins/hid_remote/README b/src_plugins/hid_remote/README
new file mode 100644
index 0000000..3f2d3bc
--- /dev/null
+++ b/src_plugins/hid_remote/README
@@ -0,0 +1,6 @@
+Remote access HID: implement a protocol and use it to relay between a core
+and a remote HID implementation.
+
+#state: WIP
+#default: disable
+#implements: hid
diff --git a/src_plugins/hid_remote/base64.c b/src_plugins/hid_remote/base64.c
new file mode 100644
index 0000000..75b76e1
--- /dev/null
+++ b/src_plugins/hid_remote/base64.c
@@ -0,0 +1,85 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+#include <limits.h>
+#include "base64.h"
+
+static char int2digit(int digit)
+{
+ if (digit < 26) return 'A' + digit;
+ if (digit < 52) return 'a' + digit - 26;
+ if (digit < 62) return '0' + digit - 52;
+ if (digit == 62) return '+';
+ if (digit == 63) return '/';
+ return '\0'; /* error */
+}
+
+static int digit2int(char c)
+{
+ if ((c >= 'A') && (c <= 'Z')) return c - 'A';
+ if ((c >= 'a') && (c <= 'z')) return c - 'a' + 26;
+ if ((c >= '0') && (c <= '9')) return c - 'a' + 52;
+ if (c == '+') return 62;
+ if (c == '/') return 63;
+ return -1;
+}
+
+
+size_t base64_write_right(char *buff_start, size_t buff_len, unsigned long int num)
+{
+ char *end = buff_start + buff_len;
+ size_t rlen = 0;
+
+ if (num == 0) {
+ *end = int2digit(0);
+ return 1;
+ }
+
+ while(num > 0) {
+ unsigned int digit = num & 0x3F;
+ *end = int2digit(digit);
+ num >>= 6;
+ rlen++;
+ }
+
+ return rlen;
+}
+
+int base64_parse_grow(unsigned long int *num, int chr, int term)
+{
+ int digit;
+ if (chr == term)
+ return 1;
+
+ if (*num >= (ULONG_MAX >> 6UL))
+ return -1;
+
+ digit = digit2int(chr);
+ if (digit < 0)
+ return -1;
+
+ (*num) <<= 6UL;
+ (*num) |= digit;
+ return 0;
+}
diff --git a/src_plugins/hid_remote/base64.h b/src_plugins/hid_remote/base64.h
new file mode 100644
index 0000000..b209231
--- /dev/null
+++ b/src_plugins/hid_remote/base64.h
@@ -0,0 +1,29 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+#include <stdlib.h>
+
+size_t base64_write_right(char *buff_start, size_t buff_len, unsigned long int num);
+int base64_parse_grow(unsigned long int *num, int chr, int term);
diff --git a/src_plugins/hid_remote/proto.c b/src_plugins/hid_remote/proto.c
new file mode 100644
index 0000000..9ea1edd
--- /dev/null
+++ b/src_plugins/hid_remote/proto.c
@@ -0,0 +1,323 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+#include <stdarg.h>
+#include <ctype.h>
+#include "pcb-printf.h"
+#define proto_vsnprintf pcb_vsnprintf
+#include "proto_lowcommon.h"
+#include "proto_lowsend.h"
+#include "proto_lowparse.h"
+#include "layer.h"
+
+static const int proto_ver = 1;
+static proto_ctx_t pctx;
+static const char *cfmt = "%.08mm";
+
+static proto_node_t *proto_error;
+static proto_node_t *remote_proto_parse(const char *wait_for, int cache_msgs);
+
+void remote_proto_send_ver()
+{
+ send_begin(&pctx, "ver");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%ld", proto_ver);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void remote_proto_send_unit()
+{
+ send_begin(&pctx, "unit");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "mm");
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void remote_proto_send_brddim(pcb_coord_t w, pcb_coord_t h)
+{
+ send_begin(&pctx, "brddim");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, cfmt, w);
+ sendf(&pctx, cfmt, h);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+int remote_proto_send_ready()
+{
+ proto_node_t *targ;
+ send_begin(&pctx, "ready");
+ send_open(&pctx, 0, 1);
+ send_close(&pctx);
+ send_end(&pctx);
+ targ = remote_proto_parse("Ready", 0);
+ if (targ == proto_error)
+ return -1;
+ proto_node_free(targ);
+ return 0;
+}
+
+void proto_send_invalidate(int l, int r, int t, int b)
+{
+ send_begin(&pctx, "inval");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", l);
+ sendf(&pctx, "%d", r);
+ sendf(&pctx, "%d", t);
+ sendf(&pctx, "%d", b);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_invalidate_all()
+{
+ send_begin(&pctx, "inval");
+ send_open(&pctx, 0, 1);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+int proto_send_set_layer_group(pcb_layergrp_id_t group, unsigned int flags, int is_empty)
+{
+ send_begin(&pctx, "setlg");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%ld", group);
+ sendf(&pctx, "%lx", flags);
+ sendf(&pctx, "%d", is_empty);
+ send_close(&pctx);
+ send_end(&pctx);
+ return 0;
+}
+
+
+static void remote_send_layer_flag_cb(void *ctx, pcb_layer_type_t bit, const char *name, int class, const char *class_name)
+{
+/* sends(&pctx, class_name);*/
+ sends(&pctx, name);
+}
+
+static void pcb_remote_send_layer_flags(unsigned int flags, int first_arg)
+{
+ send_open(&pctx, 0, first_arg); /* our flags and classes are nicely behaved, no need to do binary */
+ pcb_layer_type_map(flags, NULL, remote_send_layer_flag_cb);
+ send_close(&pctx);
+}
+
+
+int pcb_remote_new_layer(const char *name, int idx, unsigned int flags, unsigned int group)
+{
+ send_begin(&pctx, "newly");
+ send_open(&pctx, str_is_bin(name), 1);
+ sends(&pctx, name);
+ sendf(&pctx, "%d", idx);
+ send_open(&pctx, 0, 0);
+ pcb_remote_send_layer_flags(flags & PCB_LYT_ANYWHERE, 1);
+ pcb_remote_send_layer_flags(flags & PCB_LYT_ANYTHING, 0);
+ pcb_remote_send_layer_flags(flags & PCB_LYT_ANYPROP, 0);
+ send_close(&pctx);
+ sendf(&pctx, "%d", group);
+ send_close(&pctx);
+ send_end(&pctx);
+ return 0;
+}
+
+int proto_send_make_gc(void)
+{
+ proto_node_t *targ;
+ const char *gcs;
+ int gci;
+
+ send_begin(&pctx, "makeGC");
+ send_open(&pctx, 0, 1);
+ send_close(&pctx);
+ send_end(&pctx);
+ targ = remote_proto_parse("MakeGC", 1);
+ if (targ == proto_error)
+ return -1;
+ gci = aint(child1(targ), -1);
+ if (gci < 0)
+ return -1;
+/* printf("New GC: %s\n", gcs);*/
+ proto_node_free(targ);
+ return gci;
+}
+
+int proto_send_del_gc(int gc)
+{
+ send_begin(&pctx, "delGC");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ send_close(&pctx);
+ send_end(&pctx);
+ return 0;
+}
+
+void proto_send_set_color(int gc, const char *name)
+{
+ send_begin(&pctx, "clr");
+ send_open(&pctx, str_is_bin(name), 1);
+ sendf(&pctx, "%d", gc);
+ sends(&pctx, name);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_set_line_cap(int gc, char style)
+{
+ send_begin(&pctx, "cap");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, "%c", style);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_set_line_width(int gc, pcb_coord_t width)
+{
+ send_begin(&pctx, "linwid");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, cfmt, width);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_set_draw_xor(int gc, int xor_set)
+{
+ send_begin(&pctx, "setxor");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, "%d", xor_set);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_draw_line(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
+{
+ send_begin(&pctx, "line");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, cfmt, x1);
+ sendf(&pctx, cfmt, y1);
+ sendf(&pctx, cfmt, x2);
+ sendf(&pctx, cfmt, y2);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_draw_rect(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, int is_filled)
+{
+ send_begin(&pctx, "rect");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, cfmt, x1);
+ sendf(&pctx, cfmt, y1);
+ sendf(&pctx, cfmt, x2);
+ sendf(&pctx, cfmt, y2);
+ sendf(&pctx, "%d", is_filled);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_fill_circle(int gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
+{
+ send_begin(&pctx, "fcirc");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, cfmt, cx);
+ sendf(&pctx, cfmt, cy);
+ sendf(&pctx, cfmt, radius);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+void proto_send_draw_poly(int gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
+{
+ int n;
+ send_begin(&pctx, "poly");
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, "%d", gc);
+ sendf(&pctx, "%d", n_coords);
+ send_open(&pctx, 0, 1);
+ for(n = 0; n < n_coords; n++) {
+ send_open(&pctx, 0, 1);
+ sendf(&pctx, cfmt, x[n]);
+ sendf(&pctx, cfmt, y[n]);
+ send_close(&pctx);
+ }
+ send_close(&pctx);
+ send_close(&pctx);
+ send_end(&pctx);
+}
+
+int proto_send_use_mask(const char *name)
+{
+ send_begin(&pctx, "umask");
+ send_open(&pctx, str_is_bin(name), 1);
+ sends(&pctx, name);
+ send_close(&pctx);
+ send_end(&pctx);
+ return 0;
+}
+
+void proto_exec_cmd(const char *cmd, proto_node_t *targ)
+{
+
+}
+
+static proto_node_t *remote_proto_parse(const char *wait_for, int cache_msgs)
+{
+ for(;;) {
+ int c = getchar();
+ if (c == EOF)
+ return proto_error;
+ switch(parse_char(&pctx, c)) {
+ case PRES_ERR:
+ fprintf(stderr, "Protocol error.\n");
+ return proto_error;
+ case PRES_PROCEED:
+ break;
+ case PRES_GOT_MSG:
+ if ((wait_for != NULL) && (strcmp(wait_for, pctx.pcmd) == 0))
+ return pctx.targ;
+ if (cache_msgs) {
+#warning TODO
+ }
+ else
+ proto_exec_cmd(pctx.pcmd, pctx.targ);
+ proto_node_free(pctx.targ);
+ break;
+ }
+ }
+}
+
+int remote_proto_parse_all()
+{
+ if (remote_proto_parse(NULL, 0) == proto_error)
+ return -1;
+ return 0;
+}
diff --git a/src_plugins/hid_remote/proto.h b/src_plugins/hid_remote/proto.h
new file mode 100644
index 0000000..37f0bc3
--- /dev/null
+++ b/src_plugins/hid_remote/proto.h
@@ -0,0 +1,46 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+
+void remote_proto_send_ver();
+void remote_proto_send_unit();
+int remote_proto_send_ready();
+void proto_send_invalidate(int l, int r, int t, int b);
+void proto_send_invalidate_all();
+int proto_send_set_layer_group(pcb_layergrp_id_t group, unsigned int flags, int is_empty);
+int pcb_remote_new_layer(const char *name, int idx, unsigned int flags, unsigned int group);
+int proto_send_make_gc(void);
+int proto_send_del_gc(int gc);
+void proto_send_set_color(int gc, const char *name);
+void proto_send_set_line_cap(int gc, char style);
+void proto_send_set_line_width(int gc, pcb_coord_t width);
+void proto_send_set_draw_xor(int gc, int xor_set);
+void proto_send_draw_line(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2);
+void proto_send_draw_rect(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, int is_filled);
+void proto_send_fill_circle(int gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius);
+void proto_send_draw_poly(int gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y);
+int proto_send_use_mask(const char *name);
+
+int remote_proto_parse_all();
diff --git a/src_plugins/hid_remote/proto_lowcommon.h b/src_plugins/hid_remote/proto_lowcommon.h
new file mode 100644
index 0000000..ceaf4eb
--- /dev/null
+++ b/src_plugins/hid_remote/proto_lowcommon.h
@@ -0,0 +1,80 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+
+typedef enum {
+ PST_MSG,
+ PST_COMMENT,
+ PST_CMD,
+ PST_TSTR,
+ PST_BSTR,
+ PST_LIST
+} parse_state_t;
+
+
+typedef struct proto_node_s proto_node_t;
+
+struct proto_node_s {
+ unsigned is_list:1; /* whether current node is a list */
+ unsigned is_bin:1; /* whether current node is a binary - {} list or len=str */
+ unsigned in_len:1; /* for parser internal use */
+ proto_node_t *parent;
+ proto_node_t *next; /* next sibling on the current level (singly linked list) */
+ union {
+ struct { /* if ->is_list == 0 */
+ unsigned long int len; /* length of the string */
+ unsigned long int pos; /* for parser internal use */
+ char *str;
+ } s;
+ struct { /* if ->is_list == 1 */
+ proto_node_t *first_child, *last_child;
+ } l;
+ } data;
+};
+
+typedef struct {
+ int depth; /* parenthesis nesting depth */
+ int bindepth; /* how many of the inmost levels are binary */
+ unsigned long int subseq_tab;
+
+ /* parser */
+ parse_state_t pst;
+ int pdepth;
+ char pcmd[18];
+ int pcmd_next;
+ proto_node_t *targ, *tcurr;
+ size_t palloc; /* field allocation total */
+} proto_ctx_t;
+
+static int chr_is_bin(char c)
+{
+ if (isalnum(c))
+ return 0;
+ if ((c == '-') || (c == '+') || (c == '.') || (c == '_') || (c == '#'))
+ return 0;
+ return 1;
+}
diff --git a/src_plugins/hid_remote/proto_lowdbg.h b/src_plugins/hid_remote/proto_lowdbg.h
new file mode 100644
index 0000000..b14c396
--- /dev/null
+++ b/src_plugins/hid_remote/proto_lowdbg.h
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <string.h>
+
+static char ind[] = " ";
+static void proto_node_print(proto_node_t *n, int level)
+{
+ if (level < sizeof(ind)-1)
+ ind[level] = '\0';
+ printf("%s%s (%s):", ind, (n->is_list ? "list" : "str"), (n->is_bin ? "bin" : "text"));
+ if (level < sizeof(ind)-1)
+ ind[level] = ' ';
+
+ if (n->is_list) {
+ proto_node_t *ch;
+ printf("\n");
+ for(ch = n->data.l.first_child; ch != NULL; ch = ch->next)
+ proto_node_print(ch, level+1);
+ }
+ else
+ printf(" %lu/'%s'\n", n->data.s.len, n->data.s.str);
+}
diff --git a/src_plugins/hid_remote/proto_lowparse.h b/src_plugins/hid_remote/proto_lowparse.h
new file mode 100644
index 0000000..e1a34bd
--- /dev/null
+++ b/src_plugins/hid_remote/proto_lowparse.h
@@ -0,0 +1,310 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+#include <unistd.h>
+#include <stdarg.h>
+#include "base64.h"
+
+#define MAX_FIELD_ALLOC 1024*1024
+
+typedef enum {
+ PRES_ERR = -1,
+ PRES_PROCEED = 0,
+ PRES_GOT_MSG = 1
+} parse_res_t;
+
+static proto_node_t *list_new(proto_ctx_t *ctx, proto_node_t *parent, int is_bin)
+{
+ proto_node_t *l;
+
+ if (ctx->palloc + sizeof(proto_node_t) > MAX_FIELD_ALLOC)
+ return NULL;
+ ctx->palloc += sizeof(proto_node_t);
+
+ l = calloc(sizeof(proto_node_t), 1);
+ if (l != NULL) {
+ l->is_list = 1;
+ l->is_bin = is_bin;
+ l->parent = parent;
+ }
+ return l;
+}
+
+static proto_node_t *str_new(proto_ctx_t *ctx, proto_node_t *parent, int is_bin)
+{
+ proto_node_t *l;
+
+ if (ctx->palloc + sizeof(proto_node_t) > MAX_FIELD_ALLOC)
+ return NULL;
+ ctx->palloc += sizeof(proto_node_t);
+
+ l = calloc(sizeof(proto_node_t), 1);
+ if (l != NULL) {
+ l->is_list = 0;
+ l->is_bin = is_bin;
+ l->in_len = 1;
+ l->parent = parent;
+ }
+ return l;
+}
+
+static void list_append(proto_ctx_t *ctx, proto_node_t *l)
+{
+ if (ctx->tcurr->data.l.last_child != NULL) {
+ ctx->tcurr->data.l.last_child->next = l;
+ ctx->tcurr->data.l.last_child = l;
+ }
+ else
+ ctx->tcurr->data.l.first_child = ctx->tcurr->data.l.last_child = l;
+ ctx->tcurr = l;
+}
+
+static void pop(proto_ctx_t *ctx)
+{
+ ctx->tcurr = ctx->tcurr->parent;
+ ctx->pst = PST_LIST;
+}
+
+static void proto_node_free(proto_node_t *n)
+{
+ if (n->is_list) {
+ proto_node_t *ch, *chn;
+ for(ch = n->data.l.first_child; ch != NULL; ch = chn) {
+ chn = ch->next;
+ proto_node_free(ch);
+ }
+ }
+ else
+ free(n->data.s.str);
+
+ free(n);
+}
+
+
+static parse_res_t parse_char(proto_ctx_t *ctx, int c)
+{
+ switch(ctx->pst) {
+ case PST_MSG:
+ if (c == '#') {
+ ctx->pst = PST_COMMENT;
+ break;
+ }
+ if ((c == '\r') || (c == '\n') || (c == ' ') || (c == '\t')) /* ignore empty lines */
+ break;
+ if (chr_is_bin(c)) /* invalid command */
+ return -1;
+ ctx->pst = PST_CMD;
+ ctx->palloc = 0;
+ ctx->pcmd[0] = c;
+ ctx->pcmd_next = 1;
+ break;
+
+ case PST_COMMENT:
+ if (c == '\n')
+ ctx->pst = PST_MSG;
+ break;
+
+ case PST_CMD:
+ if ((c == '(') || (c == '{')) {
+ ctx->targ = ctx->tcurr = list_new(ctx, NULL, c == '{');
+ if (ctx->tcurr == NULL)
+ return -1;
+ ctx->pst = PST_LIST;
+ break;
+ }
+ if (chr_is_bin(c)) /* invalid command */
+ return -1;
+ if (ctx->pcmd_next >= 16) /* command name too long */
+ return -1;
+ ctx->pcmd[ctx->pcmd_next++] = c;
+ break;
+
+ case PST_LIST:
+ do_list:;
+ if ((c == ')') || (c == '}')) { /* close current list */
+ pop(ctx);
+ break;
+ }
+ if (c == '\n') {
+ if (ctx->tcurr != NULL) /* unbalanced: newline before enough closes */
+ return -1;
+ if (ctx->pcmd_next >= 16) /* command name too long */
+ return -1;
+ ctx->pcmd[ctx->pcmd_next++] = '\0';
+ ctx->pst = PST_MSG;
+ return PRES_GOT_MSG;
+ }
+
+ if (ctx->tcurr == NULL) /* unbalanced: too many closes */
+ return -1;
+
+ if ((c == '(') || (c == '{')) { /* open new list */
+ proto_node_t *l = list_new(ctx, ctx->tcurr, c == '{');
+ if (l == NULL)
+ return -1;
+ list_append(ctx, l);
+ ctx->pst = PST_LIST;
+ break;
+ }
+ if (c == ' ') /* field separator - may be after a bin-string, but tolerate for now */
+ break;
+
+ /* we are in a list and got a string char. It's the first char of a
+ text string or the first character of a binary string length, depending
+ on the list context */
+ if (ctx->tcurr->is_bin) {
+ proto_node_t *s = str_new(ctx, ctx->tcurr, 1);
+ if (s == NULL)
+ return -1;
+ list_append(ctx, s);
+ ctx->pst = PST_BSTR;
+ goto do_bstr;
+ }
+ else {
+ proto_node_t *s = str_new(ctx, ctx->tcurr, 0);
+ if (s == NULL)
+ return -1;
+ s->data.s.str = malloc(18);
+ list_append(ctx, s);
+ if (s->data.s.str == NULL)
+ goto error;
+ ctx->pst = PST_TSTR;
+ goto do_tstr;
+ }
+
+ case PST_TSTR:
+ do_tstr:;
+ if (c == ' ') {
+ ctx->tcurr->data.s.str[ctx->tcurr->data.s.len] = '\0';
+ pop(ctx);
+ break;
+ }
+ if ((c == ')') || (c == '}')) {
+ ctx->tcurr->data.s.str[ctx->tcurr->data.s.len] = '\0';
+ pop(ctx);
+ goto do_list;
+ }
+ if (chr_is_bin(c)) /* invalid: binary char in text string */
+ return -1;
+ if (ctx->tcurr->data.s.len >= 16) /* invalid: text string too long */
+ return -1;
+ ctx->tcurr->data.s.str[ctx->tcurr->data.s.len++] = c;
+ break;
+
+ case PST_BSTR:
+ do_bstr:;
+ if (ctx->tcurr->in_len) { /* parsing length */
+ int res = base64_parse_grow(&ctx->tcurr->data.s.len, c, '=');
+ if (res < 0) /* invalid length field */
+ return -1;
+ if (res == 0) /* proceed with len parsing */
+ break;
+ /* seen terminator, len parsing finished */
+ if (ctx->palloc + ctx->tcurr->data.s.len > MAX_FIELD_ALLOC) /* limit allocation */
+ return -1;
+ ctx->tcurr->in_len = 0;
+ if (ctx->tcurr->data.s.len == 0) {
+ pop(ctx);
+ break;
+ }
+ ctx->palloc += ctx->tcurr->data.s.len;
+ ctx->tcurr->data.s.str = malloc(ctx->tcurr->data.s.len+1);
+ ctx->tcurr->data.s.str[ctx->tcurr->data.s.len] = '\0';
+ if (ctx->tcurr->data.s.str == NULL)
+ return -1;
+ }
+ else { /* parsing the actual string */
+ ctx->tcurr->data.s.str[ctx->tcurr->data.s.pos++] = c;
+ if (ctx->tcurr->data.s.pos >= ctx->tcurr->data.s.len) {
+ pop(ctx);
+ break;
+ }
+ }
+ break;
+ }
+
+ return PRES_PROCEED;
+
+ error:;
+ proto_node_free(ctx->targ);
+ ctx->targ = ctx->tcurr = NULL;
+ return PRES_ERR;
+}
+
+/* Helpers */
+static proto_node_t *child1(proto_node_t *lst)
+{
+ if ((lst != NULL) && (lst->is_list))
+ return lst->data.l.first_child;
+ return NULL;
+}
+
+static proto_node_t *next(proto_node_t *nd)
+{
+ if (nd != NULL)
+ return nd->next;
+ return NULL;
+}
+
+static int is_list(proto_node_t *nd)
+{
+ return (nd != NULL) && nd->is_list;
+}
+
+static int is_str(proto_node_t *nd)
+{
+ return (nd != NULL) && !nd->is_list;
+}
+
+static char *astr(proto_node_t *nd)
+{
+ if ((nd != NULL) && !nd->is_list)
+ return nd->data.s.str;
+ return NULL;
+}
+
+static int aint(proto_node_t *nd, int badval)
+{
+ char *s = astr(nd), *end;
+ long int l;
+ if (s == NULL)
+ return badval;
+ l = strtol(s, &end, 10);
+ if (*end != '\0')
+ return badval;
+ return l;
+}
+
+static double adbl(proto_node_t *nd, double badval)
+{
+ char *s = astr(nd), *end;
+ double d;
+ if (s == NULL)
+ return badval;
+ d = strtod(s, &end);
+ if (*end != '\0')
+ return badval;
+ return d;
+}
diff --git a/src_plugins/hid_remote/proto_lowsend.h b/src_plugins/hid_remote/proto_lowsend.h
new file mode 100644
index 0000000..05379b8
--- /dev/null
+++ b/src_plugins/hid_remote/proto_lowsend.h
@@ -0,0 +1,157 @@
+/*
+ * COPYRIGHT
+ *
+ * pcb-rnd, interactive printed circuit board design
+ * Copyright (C) 2015 Tibor 'Igor2' Palinkas
+ *
+ * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
+ * this module is also subject to the GNU GPL as described below
+ *
+ * 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.
+ *
+ */
+
+#include <unistd.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include "base64.h"
+
+#define SUBSEQ_MASK (1 << (ctx->depth - 1))
+
+static int send_raw(proto_ctx_t *ctx, const void *data, size_t len)
+{
+ return write(1, data, len);
+}
+
+#define PREFIX_LEN 10
+static int sendf(proto_ctx_t *ctx, const char *fmt, ...)
+{
+ va_list ap;
+ char buff[8192];
+ char *out_start, *payload = buff + PREFIX_LEN;
+ size_t slen, len, payload_len = sizeof(buff) - PREFIX_LEN;
+
+ va_start(ap, fmt);
+ len = proto_vsnprintf(payload, payload_len, fmt, ap);
+ if (len >= payload_len-1)
+ return -1; /* too long, won't split for now */
+ va_end(ap);
+
+ if (ctx->bindepth > 0) {
+ size_t blen;
+ payload[-1] = '='; /* separator */
+ blen = base64_write_right(buff, PREFIX_LEN-2, len);
+ if (blen <= 0)
+ return -1;
+ blen++; /* for the separator */
+ out_start = payload - blen;
+ len += blen;
+ }
+ else
+ out_start = payload;
+
+ if (ctx->subseq_tab & SUBSEQ_MASK) {
+ /* subsequent field on the given level, insert a space */
+ out_start--;
+ *out_start = ' ';
+ len++;
+ }
+
+ slen = send_raw(ctx, out_start, len);
+
+ /* next on this field will be subsequent */
+ ctx->subseq_tab |= SUBSEQ_MASK;
+
+ if (slen != len)
+ return -1;
+ return 0;
+}
+
+#warning TODO: this is unsafe, s can have %
+static int sends(proto_ctx_t *ctx, const char *s)
+{
+ if (s == NULL)
+ s = "";
+ return sendf(ctx, s);
+}
+
+
+static int send_open(proto_ctx_t *ctx, int bin, int first_arg)
+{
+ int res;
+
+ if (!first_arg) {
+ if (send_raw(ctx, " ", 1) != 1)
+ return -1;
+ }
+
+ if (bin || (ctx->bindepth > 0)) {
+ res = send_raw(ctx, "{", 1);
+ ctx->bindepth++;
+ }
+ else
+ res = send_raw(ctx, "(", 1);
+ ctx->depth++;
+ ctx->subseq_tab &= ~SUBSEQ_MASK;
+
+ if (res != 1)
+ return -1;
+ return 0;
+}
+
+static int send_close(proto_ctx_t *ctx)
+{
+ int res;
+ if (ctx->bindepth > 0) {
+ res = send_raw(ctx, "}", 1);
+ ctx->bindepth--;
+ }
+ else
+ res = send_raw(ctx, ")", 1);
+ ctx->depth--;
+
+ if (res != 1)
+ return -1;
+ return 0;
+}
+
+static int send_begin(proto_ctx_t *ctx, const char *s)
+{
+ ctx->depth = 0;
+ ctx->bindepth = 0;
+ return send_raw(ctx, s, strlen(s));
+}
+
+static int send_end(proto_ctx_t *ctx)
+{
+ while(ctx->depth > 0)
+ if (send_close(ctx) < 0)
+ return -1;
+ return send_raw(ctx, "\n", 1);
+}
+
+/* Returns whether str needs to be sent as binary */
+static int str_is_bin(const char *str)
+{
+ const char *s;
+ int l;
+ if ((str == NULL) || (*str == '\0')) /* empty string can be encoded in bin only */
+ return 1;
+ for(s = str, l = 0; *s != '\0'; s++,l++)
+ if ((l > 16) && (chr_is_bin(*s)))
+ return 1;
+ return 0;
+}
diff --git a/src_plugins/hid_remote/remote.c b/src_plugins/hid_remote/remote.c
new file mode 100644
index 0000000..d437a14
--- /dev/null
+++ b/src_plugins/hid_remote/remote.c
@@ -0,0 +1,436 @@
+#include "config.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "board.h"
+#include "hid.h"
+#include "data.h"
+#include "layer.h"
+#include "pcb-printf.h"
+#include "plugins.h"
+#include "compat_misc.h"
+#include "event.h"
+
+#include "proto.h"
+
+#include "hid_draw_helpers.h"
+#include "hid_nogui.h"
+#include "hid_actions.h"
+#include "hid_init.h"
+
+static const char *remote_cookie = "remote HID";
+
+static pcb_hid_t remote_hid;
+
+typedef struct hid_gc_s {
+ int nop;
+} hid_gc_s;
+
+static pcb_hid_attribute_t *remote_get_export_options(int *n_ret)
+{
+ return 0;
+}
+
+/* ----------------------------------------------------------------------------- */
+
+static void ev_pcb_changed(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+}
+
+static int help(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ pcb_print_actions();
+ return 0;
+}
+
+static int info(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ return 0;
+}
+
+pcb_hid_action_t remote_action_list[] = {
+ {"Help", 0, help}
+ ,
+ {"Info", 0, info}
+};
+
+PCB_REGISTER_ACTIONS(remote_action_list, remote_cookie)
+
+
+static void remote_send_all_layers()
+{
+ pcb_layer_id_t arr[128];
+ int n, used;
+
+ used = pcb_layer_list_any(PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, arr, sizeof(arr)/sizeof(arr[0]));
+ for(n = 0; n < used; n++) {
+ pcb_layer_id_t layer_id = arr[n];
+ pcb_layergrp_id_t grp = pcb_layer_get_group(layer_id);
+ pcb_remote_new_layer(pcb_layer_name(layer_id), layer_id, pcb_layer_flags(layer_id), grp);
+ }
+}
+
+
+/* ----------------------------------------------------------------------------- */
+static int remote_stay;
+static void remote_do_export(pcb_hid_attr_val_t * options)
+{
+ pcb_box_t region;
+ region.X1 = 0;
+ region.Y1 = 0;
+ region.X2 = PCB->MaxWidth;
+ region.Y2 = PCB->MaxHeight;
+
+#warning TODO: wait for a connection?
+ remote_proto_send_ver();
+ remote_proto_send_unit();
+ remote_proto_send_brddim(PCB->MaxWidth, PCB->MaxHeight);
+ remote_send_all_layers();
+ if (remote_proto_send_ready() != 0)
+ exit(1);
+
+ pcb_hid_expose_callback(&remote_hid, ®ion, 0);
+
+/* main loop, parser */
+ if (remote_proto_parse_all() != 0)
+ exit(1);
+}
+
+static void remote_do_exit(pcb_hid_t *hid)
+{
+ remote_stay = 0;
+}
+
+static void remote_parse_arguments(int *argc, char ***argv)
+{
+ pcb_hid_parse_command_line(argc, argv);
+}
+
+static void remote_invalidate_lr(pcb_coord_t l, pcb_coord_t r, pcb_coord_t t, pcb_coord_t b)
+{
+ proto_send_invalidate(l,r, t, b);
+}
+
+static void remote_invalidate_all(void)
+{
+ proto_send_invalidate_all();
+}
+
+static int remote_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
+{
+ proto_send_set_layer_group(group, flags, is_empty);
+ return 1; /* do draw */
+}
+
+typedef struct {
+ char color[64];
+ pcb_coord_t line_width;
+ char cap;
+} remote_gc_cache_t;
+static hid_gc_s remote_gc[32];
+static remote_gc_cache_t gc_cache[32];
+
+static pcb_hid_gc_t remote_make_gc(void)
+{
+ int gci = proto_send_make_gc();
+ int max = sizeof(remote_gc) / sizeof(remote_gc[0]);
+ if (gci >= max) {
+ pcb_message(PCB_MSG_ERROR, "remote_make_gc(): GC index too high: %d >= %d\n", gci, max);
+ proto_send_del_gc(gci);
+ return NULL;
+ }
+ memset(&gc_cache[gci], 0, sizeof(remote_gc_cache_t));
+ return remote_gc+gci;
+}
+
+static int gc2idx(pcb_hid_gc_t gc)
+{
+ int idx = gc - remote_gc;
+ int max = sizeof(remote_gc) / sizeof(remote_gc[0]);
+
+ if ((idx < 0) || (idx >= max)) {
+ pcb_message(PCB_MSG_ERROR, "GC index too high: %d >= %d\n", idx, max);
+ return -1;
+ }
+ return idx;
+}
+
+static void remote_destroy_gc(pcb_hid_gc_t gc)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_del_gc(idx);
+}
+
+static const char *mask_names[] = { "off", "before", "clear", "after" };
+static void remote_use_mask(int mask)
+{
+ if ((mask >= 0) && (mask < sizeof(mask_names) / sizeof(mask_names[0])))
+ proto_send_use_mask(mask_names[mask]);
+ else
+ pcb_message(PCB_MSG_ERROR, "Invalid use_mask %d\n", mask);
+}
+
+static void remote_set_color(pcb_hid_gc_t gc, const char *name)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0) {
+ if (strcmp(gc_cache[idx].color, name) != 0) {
+ proto_send_set_color(idx, name);
+ strcpy(gc_cache[idx].color, name);
+ }
+ }
+}
+
+/* r=round, s=square, b=beveled (octagon) */
+static const char *cap_style_names = "rsrb";
+static void remote_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style)
+{
+ int idx = gc2idx(gc);
+ int max = strlen(cap_style_names);
+
+
+ if (style >= max) {
+ pcb_message(PCB_MSG_ERROR, "can't set invalid cap style: %d >= %d\n", style, max);
+ return;
+ }
+ if (idx >= 0) {
+ char cs = cap_style_names[style];
+ if (cs != gc_cache[idx].cap) {
+ proto_send_set_line_cap(idx, cs);
+ gc_cache[idx].cap = cs;
+ }
+ }
+}
+
+static void remote_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0) {
+ if (width != gc_cache[idx].line_width) {
+ proto_send_set_line_width(idx, width);
+ gc_cache[idx].line_width = width;
+ }
+ }
+}
+
+static void remote_set_draw_xor(pcb_hid_gc_t gc, int xor_set)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_set_draw_xor(idx, xor_set);
+}
+
+static void remote_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_draw_line(idx, x1, y1, x2, y2);
+}
+
+static void remote_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle)
+{
+#warning TODO
+}
+
+static void remote_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_draw_rect(idx, x1, y1, x2, y2, 0);
+}
+
+static void remote_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_fill_circle(idx, cx, cy, radius);
+}
+
+static void remote_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_draw_poly(idx, n_coords, x, y);
+}
+
+static void remote_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2)
+{
+ int idx = gc2idx(gc);
+ if (idx >= 0)
+ proto_send_draw_rect(idx, x1, y1, x2, y2, 1);
+}
+
+static void remote_calibrate(double xval, double yval)
+{
+}
+
+static int remote_shift_is_pressed(void)
+{
+ return 0;
+}
+
+static int remote_control_is_pressed(void)
+{
+ return 0;
+}
+
+static int remote_mod1_is_pressed(void)
+{
+ return 0;
+}
+
+static void remote_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y)
+{
+}
+
+static void remote_set_crosshair(int x, int y, int action)
+{
+}
+
+static pcb_hidval_t remote_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data)
+{
+ pcb_hidval_t rv;
+ rv.lval = 0;
+ return rv;
+}
+
+static void remote_stop_timer(pcb_hidval_t timer)
+{
+}
+
+pcb_hidval_t
+remote_watch_file(int fd, unsigned int condition, void (*func) (pcb_hidval_t watch, int fd, unsigned int condition, pcb_hidval_t user_data),
+ pcb_hidval_t user_data)
+{
+ pcb_hidval_t ret;
+ ret.ptr = NULL;
+ return ret;
+}
+
+void remote_unwatch_file(pcb_hidval_t data)
+{
+}
+
+static pcb_hidval_t remote_add_block_hook(void (*func) (pcb_hidval_t data), pcb_hidval_t user_data)
+{
+ pcb_hidval_t ret;
+ ret.ptr = NULL;
+ return ret;
+}
+
+static void remote_stop_block_hook(pcb_hidval_t mlpoll)
+{
+}
+
+static int
+remote_attribute_dialog(pcb_hid_attribute_t * attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, const char *descr_)
+{
+ return 0;
+}
+
+static void remote_show_item(void *item)
+{
+}
+
+static void remote_create_menu(const char *menu, const char *action, const char *mnemonic, const char *accel, const char *tip, const char *cookie)
+{
+}
+
+static int remote_propedit_start(void *pe, int num_props, const char *(*query)(void *pe, const char *cmd, const char *key, const char *val, int idx))
+{
+ return 0;
+}
+
+static void remote_propedit_end(void *pe)
+{
+}
+
+static void *remote_propedit_add_prop(void *pe, const char *propname, int is_mutable, int num_vals)
+{
+ return NULL;
+}
+
+static void remote_propedit_add_value(void *pe, const char *propname, void *propctx, const char *value, int repeat_cnt)
+{
+}
+
+static void remote_propedit_add_stat(void *pe, const char *propname, void *propctx, const char *most_common, const char *min, const char *max, const char *avg)
+{
+}
+
+
+#include "dolists.h"
+
+
+static void hid_hid_remote_uninit()
+{
+ pcb_hid_remove_actions_by_cookie(remote_cookie);
+ pcb_event_unbind_allcookie(remote_cookie);
+}
+
+pcb_uninit_t hid_hid_remote_init()
+{
+ memset(&remote_hid, 0, sizeof(pcb_hid_t));
+
+ pcb_hid_nogui_init(&remote_hid);
+ pcb_dhlp_draw_helpers_init(&remote_hid);
+
+ remote_hid.struct_size = sizeof(pcb_hid_t);
+ remote_hid.name = "remote";
+ remote_hid.description = "remote-mode GUI for non-interactive use.";
+ remote_hid.gui = 1;
+
+ remote_hid.get_export_options = remote_get_export_options;
+ remote_hid.do_export = remote_do_export;
+ remote_hid.do_exit = remote_do_exit;
+ remote_hid.parse_arguments = remote_parse_arguments;
+ remote_hid.invalidate_lr = remote_invalidate_lr;
+ remote_hid.invalidate_all = remote_invalidate_all;
+ remote_hid.set_layer_group = remote_set_layer_group;
+ remote_hid.make_gc = remote_make_gc;
+ remote_hid.destroy_gc = remote_destroy_gc;
+ remote_hid.use_mask = remote_use_mask;
+ remote_hid.set_color = remote_set_color;
+ remote_hid.set_line_cap = remote_set_line_cap;
+ remote_hid.set_line_width = remote_set_line_width;
+ remote_hid.set_draw_xor = remote_set_draw_xor;
+ remote_hid.draw_line = remote_draw_line;
+ remote_hid.draw_arc = remote_draw_arc;
+ remote_hid.draw_rect = remote_draw_rect;
+ remote_hid.fill_circle = remote_fill_circle;
+ remote_hid.fill_polygon = remote_fill_polygon;
+ remote_hid.fill_rect = remote_fill_rect;
+ remote_hid.calibrate = remote_calibrate;
+ remote_hid.shift_is_pressed = remote_shift_is_pressed;
+ remote_hid.control_is_pressed = remote_control_is_pressed;
+ remote_hid.mod1_is_pressed = remote_mod1_is_pressed;
+ remote_hid.get_coords = remote_get_coords;
+ remote_hid.set_crosshair = remote_set_crosshair;
+ remote_hid.add_timer = remote_add_timer;
+ remote_hid.stop_timer = remote_stop_timer;
+ remote_hid.watch_file = remote_watch_file;
+ remote_hid.unwatch_file = remote_unwatch_file;
+ remote_hid.add_block_hook = remote_add_block_hook;
+ remote_hid.stop_block_hook = remote_stop_block_hook;
+ remote_hid.attribute_dialog = remote_attribute_dialog;
+ remote_hid.show_item = remote_show_item;
+ remote_hid.create_menu = remote_create_menu;
+
+ remote_hid.propedit_start = remote_propedit_start;
+ remote_hid.propedit_end = remote_propedit_end;
+ remote_hid.propedit_add_prop = remote_propedit_add_prop;
+ remote_hid.propedit_add_value = remote_propedit_add_value;
+ remote_hid.propedit_add_stat = remote_propedit_add_stat;
+
+ PCB_REGISTER_ACTIONS(remote_action_list, remote_cookie)
+
+ pcb_hid_register_hid(&remote_hid);
+
+ pcb_event_bind(PCB_EVENT_BOARD_CHANGED, ev_pcb_changed, NULL, remote_cookie);
+
+ return hid_hid_remote_uninit;
+}
diff --git a/src_plugins/import_dsn/Makefile b/src_plugins/import_dsn/Makefile
index f061554..efde4a3 100644
--- a/src_plugins/import_dsn/Makefile
+++ b/src_plugins/import_dsn/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_import_dsn
+ cd ../../src && $(MAKE) mod_import_dsn
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/import_dsn/dsn.c b/src_plugins/import_dsn/dsn.c
index c2b5eb0..6a7fecd 100644
--- a/src_plugins/import_dsn/dsn.c
+++ b/src_plugins/import_dsn/dsn.c
@@ -36,21 +36,22 @@ By Josh Jordan and Dan McMahill, modified from bom.c
#include <string.h>
#include <time.h>
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "error.h"
-#include "misc.h"
#include "rats.h"
#include "buffer.h"
#include "change.h"
#include "draw.h"
-#include "set.h"
#include "undo.h"
#include "pcb-printf.h"
-#include "create.h"
#include "polygon.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "obj_pinvia.h"
+#include "obj_rat.h"
+#include "action_helper.h"
#include "hid.h"
#include "hid_draw_helpers.h"
#include "hid_nogui.h"
@@ -82,28 +83,28 @@ be prompted to enter one.
%end-doc */
-int ActionLoadDsnFrom(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_LoadDsnFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *fname = NULL;
static char *default_file = NULL;
char str[200];
FILE *fp;
int ret;
- Coord dim1, dim2, x0 = 0, y0 = 0, x1, y1;
- Coord linethick = 0, lineclear, viadiam, viadrill;
+ pcb_coord_t dim1, dim2, x0 = 0, y0 = 0, x1, y1;
+ pcb_coord_t linethick = 0, lineclear, viadiam, viadrill;
char lname[200];
- LayerType *rlayer = NULL;
- LineType *line = NULL;
+ pcb_layer_t *rlayer = NULL;
+ pcb_line_t *line = NULL;
fname = argc ? argv[0] : 0;
if (!fname || !*fname) {
- fname = gui->fileselect(_("Load dsn routing session Resource File..."),
+ fname = pcb_gui->fileselect(_("Load dsn routing session Resource File..."),
_("Picks a dsn session resource file to load.\n"
"This file could be generated by freeroute.net\n"),
default_file, ".ses", "ses", HID_FILESELECT_READ);
if (fname == NULL)
- AFAIL(load_dsn);
+ PCB_AFAIL(load_dsn);
if (default_file != NULL) {
free(default_file);
default_file = NULL;
@@ -116,7 +117,7 @@ int ActionLoadDsnFrom(int argc, const char **argv, Coord x, Coord y)
lineclear = PCB->RouteStyle.array[0].Clearance * 2;
fp = fopen(fname, "r");
if (!fp) {
- Message(PCB_MSG_ERROR, "Can't load dsn file %s for read\n", fname);
+ pcb_message(PCB_MSG_ERROR, "Can't load dsn file %s for read\n", fname);
return 1;
}
while (fgets(str, sizeof(str), fp) != NULL) {
@@ -127,11 +128,11 @@ int ActionLoadDsnFrom(int argc, const char **argv, Coord x, Coord y)
ret = sscanf(str, " (path %s %ld", lname, &dim1);
if (ret == 2) {
rlayer = 0;
- LAYER_LOOP(PCB->Data, max_group) {
+ LAYER_LOOP(PCB->Data, pcb_max_group) {
if (!strcmp(layer->Name, lname))
rlayer = layer;
}
- END_LOOP;
+ PCB_END_LOOP;
linethick = dim1;
x0 = 0;
y0 = 0;
@@ -141,27 +142,27 @@ int ActionLoadDsnFrom(int argc, const char **argv, Coord x, Coord y)
x1 = dim1;
y1 = dim2;
if (x0 != 0 || y0 != 0) {
- line = CreateDrawnLineOnLayer(rlayer, x0, PCB->MaxHeight - y0,
- x1, PCB->MaxHeight - y1, linethick, lineclear, MakeFlags(PCB_FLAG_AUTO | PCB_FLAG_CLEARLINE));
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, rlayer, line);
+ line = pcb_line_new_merge(rlayer, x0, PCB->MaxHeight - y0,
+ x1, PCB->MaxHeight - y1, linethick, lineclear, pcb_flag_make(PCB_FLAG_AUTO | PCB_FLAG_CLEARLINE));
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, rlayer, line);
}
x0 = x1;
y0 = y1;
}
ret = sscanf(str, " (via via_%ld_%ld %ld %ld", &viadiam, &viadrill, &dim1, &dim2);
if (ret == 4) {
- CreateNewVia(PCB->Data, dim1, PCB->MaxHeight - dim2, viadiam, lineclear, 0, viadrill, 0, MakeFlags(PCB_FLAG_AUTO));
+ pcb_via_new(PCB->Data, dim1, PCB->MaxHeight - dim2, viadiam, lineclear, 0, viadrill, 0, pcb_flag_make(PCB_FLAG_AUTO));
}
}
fclose(fp);
return 0;
}
-HID_Action dsn_action_list[] = {
- {"LoadDsnFrom", 0, ActionLoadDsnFrom, load_dsn_help, load_dsn_syntax}
+pcb_hid_action_t dsn_action_list[] = {
+ {"LoadDsnFrom", 0, pcb_act_LoadDsnFrom, load_dsn_help, load_dsn_syntax}
};
-REGISTER_ACTIONS(dsn_action_list, dsn_cookie)
+PCB_REGISTER_ACTIONS(dsn_action_list, dsn_cookie)
static void hid_dsn_uninit()
{
@@ -171,7 +172,7 @@ static void hid_dsn_uninit()
#include "dolists.h"
pcb_uninit_t hid_import_dsn_init()
{
- REGISTER_ACTIONS(dsn_action_list, dsn_cookie)
+ PCB_REGISTER_ACTIONS(dsn_action_list, dsn_cookie)
return hid_dsn_uninit;
}
diff --git a/src_plugins/import_edif/Makefile b/src_plugins/import_edif/Makefile
index 0fb3a2e..3ae9958 100644
--- a/src_plugins/import_edif/Makefile
+++ b/src_plugins/import_edif/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_import_edif
+ cd ../../src && $(MAKE) mod_import_edif
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/import_edif/edif.c b/src_plugins/import_edif/edif.c
index ad59be7..29d30d0 100644
--- a/src_plugins/import_edif/edif.c
+++ b/src_plugins/import_edif/edif.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
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
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -70,7 +70,7 @@
#define yychar edifchar
/* Copy the first part of user declarations. */
-#line 1 "../../src_plugins/import_edif/edif.y" /* yacc.c:339 */
+#line 1 "edif.y" /* yacc.c:339 */
/*
* PCB Edif parser based heavily on:
@@ -99,15 +99,18 @@
#include <ctype.h>
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
+#include "library.h"
#include "error.h"
#include "plugins.h"
#include "compat_misc.h"
+#include "compat_nls.h"
/* from mymem.h, not include because of the malloc junk */
-LibraryMenuTypePtr GetLibraryMenuMemory(LibraryTypePtr, int *idx);
-LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
+pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *, int *idx);
+pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *);
/*
@@ -176,8 +179,8 @@ LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
str_pair* node;
char* buf;
char* p;
- LibraryEntryTypePtr entry;
- LibraryMenuTypePtr menu = GetLibraryMenuMemory(&PCB->NetlistLib[NETLIST_INPUT], NULL);
+ pcb_lib_entry_t *entry;
+ pcb_lib_menu_t *menu = pcb_lib_menu_new(&PCB->NetlistLib[PCB_NETLIST_INPUT], NULL);
if ( !name->str1 )
{
@@ -251,7 +254,7 @@ LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
/* free the strings */
free(node->str1);
free(node->str2);
- entry = GetLibraryEntryMemory (menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(buf);
done_node = node;
node = node->next;
@@ -265,7 +268,7 @@ LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
static void yyerror(const char *);
static void PopC(void);
-#line 269 "edif.tab.c" /* yacc.c:339 */
+#line 272 "edif.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -284,9 +287,9 @@ LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
#endif
/* In a future release of Bison, this section will be replaced
- by #include "edif.tab.h". */
-#ifndef YY_EDIF_EDIF_TAB_H_INCLUDED
-# define YY_EDIF_EDIF_TAB_H_INCLUDED
+ by #include "edif.h". */
+#ifndef YY_EDIF_EDIF_H_INCLUDED
+# define YY_EDIF_EDIF_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -597,17 +600,19 @@ extern int edifdebug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
+
union YYSTYPE
{
-#line 198 "../../src_plugins/import_edif/edif.y" /* yacc.c:355 */
+#line 201 "edif.y" /* yacc.c:355 */
char* s;
pair_list* pl;
str_pair* ps;
-#line 610 "edif.tab.c" /* yacc.c:355 */
+#line 613 "edif.c" /* yacc.c:355 */
};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
@@ -617,11 +622,11 @@ extern YYSTYPE ediflval;
int edifparse (void);
-#endif /* !YY_EDIF_EDIF_TAB_H_INCLUDED */
+#endif /* !YY_EDIF_EDIF_H_INCLUDED */
/* Copy the second part of user declarations. */
-#line 625 "edif.tab.c" /* yacc.c:358 */
+#line 630 "edif.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -947,119 +952,119 @@ static const yytype_uint16 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 510, 510, 513, 516, 517, 518, 519, 520, 521,
- 522, 525, 528, 531, 535, 538, 539, 542, 545, 546,
- 547, 548, 549, 550, 553, 556, 557, 560, 563, 564,
- 565, 566, 567, 570, 573, 576, 577, 580, 583, 586,
- 587, 588, 589, 590, 593, 596, 599, 602, 605, 608,
- 611, 612, 613, 616, 619, 620, 623, 624, 627, 630,
- 631, 632, 633, 636, 639, 640, 643, 646, 647, 650,
- 653, 656, 659, 662, 663, 664, 665, 666, 667, 668,
- 671, 674, 677, 678, 681, 684, 687, 688, 689, 692,
- 695, 696, 697, 700, 701, 702, 705, 708, 709, 712,
- 715, 718, 719, 722, 725, 726, 727, 728, 729, 730,
- 731, 732, 735, 738, 741, 742, 743, 744, 745, 746,
- 747, 748, 749, 750, 751, 752, 753, 754, 755, 756,
- 757, 758, 761, 764, 765, 768, 771, 772, 773, 776,
- 779, 780, 783, 786, 789, 790, 791, 794, 797, 798,
- 801, 804, 805, 808, 811, 812, 815, 818, 819, 822,
- 825, 826, 829, 832, 833, 836, 839, 840, 843, 846,
- 847, 850, 853, 854, 855, 858, 861, 862, 863, 864,
- 865, 868, 871, 872, 875, 878, 881, 882, 883, 884,
- 885, 886, 887, 888, 889, 890, 891, 892, 893, 894,
- 895, 898, 901, 902, 903, 904, 907, 910, 911, 912,
- 915, 918, 919, 922, 923, 926, 927, 930, 931, 934,
- 937, 938, 941, 944, 945, 948, 951, 955, 956, 957,
- 958, 961, 964, 965, 966, 969, 973, 974, 975, 978,
- 979, 980, 981, 984, 985, 986, 989, 992, 993, 994,
- 995, 996, 997, 998, 1001, 1004, 1007, 1008, 1009, 1010,
- 1011, 1014, 1017, 1020, 1023, 1024, 1025, 1026, 1027, 1028,
- 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1039, 1042,
- 1045, 1048, 1049, 1050, 1053, 1056, 1057, 1058, 1059, 1060,
- 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1074,
- 1075, 1078, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088,
- 1089, 1090, 1091, 1094, 1097, 1098, 1099, 1100, 1103, 1104,
- 1105, 1106, 1107, 1110, 1113, 1114, 1115, 1116, 1119, 1122,
- 1123, 1124, 1125, 1128, 1131, 1134, 1135, 1138, 1139, 1140,
- 1141, 1144, 1147, 1148, 1151, 1154, 1155, 1156, 1157, 1158,
- 1161, 1164, 1167, 1170, 1173, 1176, 1177, 1180, 1183, 1186,
- 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1198,
- 1201, 1202, 1203, 1206, 1209, 1210, 1211, 1212, 1213, 1216,
- 1219, 1220, 1223, 1226, 1227, 1228, 1229, 1230, 1233, 1234,
- 1237, 1238, 1241, 1244, 1245, 1248, 1251, 1252, 1253, 1254,
- 1257, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268,
- 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1279, 1283,
- 1284, 1285, 1286, 1289, 1292, 1293, 1294, 1295, 1298, 1301,
- 1302, 1303, 1304, 1307, 1310, 1311, 1314, 1317, 1320, 1321,
- 1322, 1323, 1326, 1329, 1330, 1331, 1332, 1333, 1334, 1335,
- 1336, 1337, 1340, 1343, 1344, 1347, 1350, 1353, 1354, 1357,
- 1360, 1363, 1366, 1369, 1372, 1375, 1376, 1377, 1378, 1379,
- 1382, 1385, 1388, 1389, 1392, 1395, 1396, 1397, 1400, 1403,
- 1404, 1407, 1410, 1411, 1414, 1415, 1416, 1419, 1420, 1421,
- 1424, 1427, 1428, 1429, 1430, 1433, 1436, 1437, 1438, 1439,
- 1442, 1445, 1446, 1449, 1452, 1453, 1456, 1459, 1462, 1465,
- 1466, 1467, 1470, 1473, 1474, 1475, 1476, 1479, 1482, 1483,
- 1484, 1485, 1488, 1491, 1492, 1495, 1498, 1499, 1500, 1501,
- 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511,
- 1512, 1515, 1518, 1519, 1520, 1521, 1522, 1525, 1528, 1529,
- 1532, 1533, 1534, 1537, 1540, 1541, 1542, 1545, 1546, 1547,
- 1550, 1553, 1554, 1557, 1560, 1561, 1562, 1563, 1566, 1569,
- 1570, 1573, 1574, 1577, 1580, 1581, 1582, 1585, 1588, 1589,
- 1592, 1595, 1596, 1597, 1598, 1599, 1602, 1605, 1606, 1609,
- 1610, 1611, 1614, 1615, 1618, 1621, 1622, 1623, 1624, 1625,
- 1626, 1627, 1628, 1629, 1630, 1633, 1636, 1637, 1638, 1639,
- 1640, 1643, 1646, 1647, 1648, 1649, 1650, 1651, 1654, 1657,
- 1658, 1659, 1662, 1665, 1666, 1667, 1670, 1673, 1674, 1675,
- 1676, 1677, 1680, 1681, 1685, 1686, 1689, 1692, 1693, 1694,
- 1695, 1698, 1701, 1704, 1705, 1706, 1709, 1712, 1713, 1714,
- 1717, 1720, 1721, 1722, 1723, 1726, 1729, 1730, 1731, 1732,
- 1735, 1738, 1739, 1742, 1745, 1746, 1747, 1748, 1751, 1754,
- 1755, 1756, 1757, 1758, 1761, 1764, 1767, 1768, 1771, 1774,
- 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1784, 1787, 1791,
- 1792, 1793, 1794, 1797, 1801, 1802, 1803, 1804, 1807, 1810,
- 1811, 1814, 1817, 1820, 1821, 1822, 1823, 1824, 1825, 1826,
- 1827, 1828, 1829, 1832, 1835, 1838, 1839, 1842, 1845, 1846,
- 1849, 1852, 1855, 1856, 1859, 1862, 1863, 1866, 1869, 1872,
- 1873, 1874, 1875, 1878, 1881, 1882, 1885, 1888, 1889, 1890,
- 1891, 1894, 1897, 1898, 1901, 1904, 1905, 1908, 1911, 1914,
- 1915, 1918, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928,
- 1929, 1930, 1931, 1932, 1933, 1936, 1939, 1940, 1941, 1942,
- 1943, 1944, 1945, 1946, 1947, 1948, 1951, 1954, 1955, 1956,
- 1957, 1960, 1963, 1964, 1965, 1966, 1969, 1972, 1973, 1974,
- 1977, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988,
- 1989, 1990, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2014, 2015, 2016,
- 2019, 2022, 2025, 2026, 2027, 2028, 2029, 2032, 2033, 2036,
- 2037, 2040, 2055, 2056, 2057, 2058, 2061, 2064, 2065, 2068,
- 2071, 2072, 2075, 2078, 2079, 2080, 2081, 2082, 2085, 2088,
- 2091, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102,
- 2103, 2104, 2105, 2108, 2109, 2110, 2111, 2112, 2113, 2116,
- 2119, 2120, 2121, 2124, 2127, 2128, 2131, 2134, 2135, 2136,
- 2137, 2140, 2144, 2145, 2148, 2149, 2152, 2155, 2156, 2159,
- 2162, 2165, 2166, 2169, 2172, 2175, 2178, 2179, 2180, 2181,
- 2184, 2187, 2188, 2191, 2194, 2197, 2198, 2199, 2200, 2201,
- 2202, 2205, 2208, 2209, 2210, 2211, 2214, 2217, 2218, 2221,
- 2224, 2225, 2228, 2231, 2232, 2235, 2238, 2239, 2242, 2245,
- 2246, 2247, 2248, 2251, 2254, 2255, 2256, 2259, 2260, 2261,
- 2264, 2267, 2270, 2271, 2272, 2273, 2276, 2277, 2280, 2283,
- 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295,
- 2296, 2297, 2298, 2299, 2302, 2305, 2306, 2309, 2312, 2313,
- 2314, 2317, 2320, 2321, 2322, 2323, 2326, 2327, 2328, 2331,
- 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2343, 2346, 2349,
- 2350, 2353, 2354, 2355, 2358, 2362, 2365, 2366, 2367, 2368,
- 2369, 2372, 2376, 2377, 2380, 2381, 2384, 2385, 2388, 2389,
- 2392, 2393, 2396, 2399, 2400, 2401, 2404, 2407, 2408, 2409,
- 2410, 2413, 2416, 2417, 2418, 2419, 2420, 2421, 2424, 2427,
- 2430, 2433, 2434, 2435, 2436, 2439, 2442, 2443, 2444, 2445,
- 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455,
- 2456, 2457, 2460, 2463, 2466, 2467, 2468, 2469, 2470, 2473,
- 2474, 2477, 2478, 2481, 2484, 2487, 2488, 2489, 2490, 2491,
- 2492, 2495, 2498, 2499, 2500, 2503, 2506, 2507, 2508, 2509,
- 2510, 2511, 2512, 2513, 2514, 2517, 2520, 2523, 2526, 2527,
- 2530, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541,
- 2542, 2545, 2548, 2551, 2554, 2557, 2560, 2561, 2562, 2563,
- 2566, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2578, 2581,
- 2582, 2583, 2584, 2585, 2586, 2587, 2590, 2593, 2596, 2599
+ 0, 513, 513, 516, 519, 520, 521, 522, 523, 524,
+ 525, 528, 531, 534, 538, 541, 542, 545, 548, 549,
+ 550, 551, 552, 553, 556, 559, 560, 563, 566, 567,
+ 568, 569, 570, 573, 576, 579, 580, 583, 586, 589,
+ 590, 591, 592, 593, 596, 599, 602, 605, 608, 611,
+ 614, 615, 616, 619, 622, 623, 626, 627, 630, 633,
+ 634, 635, 636, 639, 642, 643, 646, 649, 650, 653,
+ 656, 659, 662, 665, 666, 667, 668, 669, 670, 671,
+ 674, 677, 680, 681, 684, 687, 690, 691, 692, 695,
+ 698, 699, 700, 703, 704, 705, 708, 711, 712, 715,
+ 718, 721, 722, 725, 728, 729, 730, 731, 732, 733,
+ 734, 735, 738, 741, 744, 745, 746, 747, 748, 749,
+ 750, 751, 752, 753, 754, 755, 756, 757, 758, 759,
+ 760, 761, 764, 767, 768, 771, 774, 775, 776, 779,
+ 782, 783, 786, 789, 792, 793, 794, 797, 800, 801,
+ 804, 807, 808, 811, 814, 815, 818, 821, 822, 825,
+ 828, 829, 832, 835, 836, 839, 842, 843, 846, 849,
+ 850, 853, 856, 857, 858, 861, 864, 865, 866, 867,
+ 868, 871, 874, 875, 878, 881, 884, 885, 886, 887,
+ 888, 889, 890, 891, 892, 893, 894, 895, 896, 897,
+ 898, 901, 904, 905, 906, 907, 910, 913, 914, 915,
+ 918, 921, 922, 925, 926, 929, 930, 933, 934, 937,
+ 940, 941, 944, 947, 948, 951, 954, 958, 959, 960,
+ 961, 964, 967, 968, 969, 972, 976, 977, 978, 981,
+ 982, 983, 984, 987, 988, 989, 992, 995, 996, 997,
+ 998, 999, 1000, 1001, 1004, 1007, 1010, 1011, 1012, 1013,
+ 1014, 1017, 1020, 1023, 1026, 1027, 1028, 1029, 1030, 1031,
+ 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1042, 1045,
+ 1048, 1051, 1052, 1053, 1056, 1059, 1060, 1061, 1062, 1063,
+ 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1074, 1077,
+ 1078, 1081, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091,
+ 1092, 1093, 1094, 1097, 1100, 1101, 1102, 1103, 1106, 1107,
+ 1108, 1109, 1110, 1113, 1116, 1117, 1118, 1119, 1122, 1125,
+ 1126, 1127, 1128, 1131, 1134, 1137, 1138, 1141, 1142, 1143,
+ 1144, 1147, 1150, 1151, 1154, 1157, 1158, 1159, 1160, 1161,
+ 1164, 1167, 1170, 1173, 1176, 1179, 1180, 1183, 1186, 1189,
+ 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1201,
+ 1204, 1205, 1206, 1209, 1212, 1213, 1214, 1215, 1216, 1219,
+ 1222, 1223, 1226, 1229, 1230, 1231, 1232, 1233, 1236, 1237,
+ 1240, 1241, 1244, 1247, 1248, 1251, 1254, 1255, 1256, 1257,
+ 1260, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271,
+ 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1282, 1286,
+ 1287, 1288, 1289, 1292, 1295, 1296, 1297, 1298, 1301, 1304,
+ 1305, 1306, 1307, 1310, 1313, 1314, 1317, 1320, 1323, 1324,
+ 1325, 1326, 1329, 1332, 1333, 1334, 1335, 1336, 1337, 1338,
+ 1339, 1340, 1343, 1346, 1347, 1350, 1353, 1356, 1357, 1360,
+ 1363, 1366, 1369, 1372, 1375, 1378, 1379, 1380, 1381, 1382,
+ 1385, 1388, 1391, 1392, 1395, 1398, 1399, 1400, 1403, 1406,
+ 1407, 1410, 1413, 1414, 1417, 1418, 1419, 1422, 1423, 1424,
+ 1427, 1430, 1431, 1432, 1433, 1436, 1439, 1440, 1441, 1442,
+ 1445, 1448, 1449, 1452, 1455, 1456, 1459, 1462, 1465, 1468,
+ 1469, 1470, 1473, 1476, 1477, 1478, 1479, 1482, 1485, 1486,
+ 1487, 1488, 1491, 1494, 1495, 1498, 1501, 1502, 1503, 1504,
+ 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514,
+ 1515, 1518, 1521, 1522, 1523, 1524, 1525, 1528, 1531, 1532,
+ 1535, 1536, 1537, 1540, 1543, 1544, 1545, 1548, 1549, 1550,
+ 1553, 1556, 1557, 1560, 1563, 1564, 1565, 1566, 1569, 1572,
+ 1573, 1576, 1577, 1580, 1583, 1584, 1585, 1588, 1591, 1592,
+ 1595, 1598, 1599, 1600, 1601, 1602, 1605, 1608, 1609, 1612,
+ 1613, 1614, 1617, 1618, 1621, 1624, 1625, 1626, 1627, 1628,
+ 1629, 1630, 1631, 1632, 1633, 1636, 1639, 1640, 1641, 1642,
+ 1643, 1646, 1649, 1650, 1651, 1652, 1653, 1654, 1657, 1660,
+ 1661, 1662, 1665, 1668, 1669, 1670, 1673, 1676, 1677, 1678,
+ 1679, 1680, 1683, 1684, 1688, 1689, 1692, 1695, 1696, 1697,
+ 1698, 1701, 1704, 1707, 1708, 1709, 1712, 1715, 1716, 1717,
+ 1720, 1723, 1724, 1725, 1726, 1729, 1732, 1733, 1734, 1735,
+ 1738, 1741, 1742, 1745, 1748, 1749, 1750, 1751, 1754, 1757,
+ 1758, 1759, 1760, 1761, 1764, 1767, 1770, 1771, 1774, 1777,
+ 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1787, 1790, 1794,
+ 1795, 1796, 1797, 1800, 1804, 1805, 1806, 1807, 1810, 1813,
+ 1814, 1817, 1820, 1823, 1824, 1825, 1826, 1827, 1828, 1829,
+ 1830, 1831, 1832, 1835, 1838, 1841, 1842, 1845, 1848, 1849,
+ 1852, 1855, 1858, 1859, 1862, 1865, 1866, 1869, 1872, 1875,
+ 1876, 1877, 1878, 1881, 1884, 1885, 1888, 1891, 1892, 1893,
+ 1894, 1897, 1900, 1901, 1904, 1907, 1908, 1911, 1914, 1917,
+ 1918, 1921, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931,
+ 1932, 1933, 1934, 1935, 1936, 1939, 1942, 1943, 1944, 1945,
+ 1946, 1947, 1948, 1949, 1950, 1951, 1954, 1957, 1958, 1959,
+ 1960, 1963, 1966, 1967, 1968, 1969, 1972, 1975, 1976, 1977,
+ 1980, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991,
+ 1992, 1993, 1996, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2017, 2018, 2019,
+ 2022, 2025, 2028, 2029, 2030, 2031, 2032, 2035, 2036, 2039,
+ 2040, 2043, 2058, 2059, 2060, 2061, 2064, 2067, 2068, 2071,
+ 2074, 2075, 2078, 2081, 2082, 2083, 2084, 2085, 2088, 2091,
+ 2094, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105,
+ 2106, 2107, 2108, 2111, 2112, 2113, 2114, 2115, 2116, 2119,
+ 2122, 2123, 2124, 2127, 2130, 2131, 2134, 2137, 2138, 2139,
+ 2140, 2143, 2147, 2148, 2151, 2152, 2155, 2158, 2159, 2162,
+ 2165, 2168, 2169, 2172, 2175, 2178, 2181, 2182, 2183, 2184,
+ 2187, 2190, 2191, 2194, 2197, 2200, 2201, 2202, 2203, 2204,
+ 2205, 2208, 2211, 2212, 2213, 2214, 2217, 2220, 2221, 2224,
+ 2227, 2228, 2231, 2234, 2235, 2238, 2241, 2242, 2245, 2248,
+ 2249, 2250, 2251, 2254, 2257, 2258, 2259, 2262, 2263, 2264,
+ 2267, 2270, 2273, 2274, 2275, 2276, 2279, 2280, 2283, 2286,
+ 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298,
+ 2299, 2300, 2301, 2302, 2305, 2308, 2309, 2312, 2315, 2316,
+ 2317, 2320, 2323, 2324, 2325, 2326, 2329, 2330, 2331, 2334,
+ 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2346, 2349, 2352,
+ 2353, 2356, 2357, 2358, 2361, 2365, 2368, 2369, 2370, 2371,
+ 2372, 2375, 2379, 2380, 2383, 2384, 2387, 2388, 2391, 2392,
+ 2395, 2396, 2399, 2402, 2403, 2404, 2407, 2410, 2411, 2412,
+ 2413, 2416, 2419, 2420, 2421, 2422, 2423, 2424, 2427, 2430,
+ 2433, 2436, 2437, 2438, 2439, 2442, 2445, 2446, 2447, 2448,
+ 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458,
+ 2459, 2460, 2463, 2466, 2469, 2470, 2471, 2472, 2473, 2476,
+ 2477, 2480, 2481, 2484, 2487, 2490, 2491, 2492, 2493, 2494,
+ 2495, 2498, 2501, 2502, 2503, 2506, 2509, 2510, 2511, 2512,
+ 2513, 2514, 2515, 2516, 2517, 2520, 2523, 2526, 2529, 2530,
+ 2533, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544,
+ 2545, 2548, 2551, 2554, 2557, 2560, 2563, 2564, 2565, 2566,
+ 2569, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2581, 2584,
+ 2585, 2586, 2587, 2588, 2589, 2590, 2593, 2596, 2599, 2602
};
#endif
@@ -3367,541 +3372,541 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 510 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 513 "edif.y" /* yacc.c:1646 */
{ PopC(); }
-#line 3373 "edif.tab.c" /* yacc.c:1646 */
+#line 3378 "edif.c" /* yacc.c:1646 */
break;
case 11:
-#line 525 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 528 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3379 "edif.tab.c" /* yacc.c:1646 */
+#line 3384 "edif.c" /* yacc.c:1646 */
break;
case 12:
-#line 528 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 531 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 3385 "edif.tab.c" /* yacc.c:1646 */
+#line 3390 "edif.c" /* yacc.c:1646 */
break;
case 13:
-#line 532 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 535 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-3].s)); free((yyvsp[-2].s)); free((yyvsp[-1].s)); }
-#line 3391 "edif.tab.c" /* yacc.c:1646 */
+#line 3396 "edif.c" /* yacc.c:1646 */
break;
case 25:
-#line 556 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 559 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3397 "edif.tab.c" /* yacc.c:1646 */
+#line 3402 "edif.c" /* yacc.c:1646 */
break;
case 34:
-#line 573 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 576 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[-3].ps)); free((yyvsp[-2].s)); }
-#line 3403 "edif.tab.c" /* yacc.c:1646 */
+#line 3408 "edif.c" /* yacc.c:1646 */
break;
case 36:
-#line 577 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 580 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3409 "edif.tab.c" /* yacc.c:1646 */
+#line 3414 "edif.c" /* yacc.c:1646 */
break;
case 47:
-#line 602 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 605 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 3415 "edif.tab.c" /* yacc.c:1646 */
+#line 3420 "edif.c" /* yacc.c:1646 */
break;
case 69:
-#line 650 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 653 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-3].s)); free((yyvsp[-2].s)); }
-#line 3421 "edif.tab.c" /* yacc.c:1646 */
+#line 3426 "edif.c" /* yacc.c:1646 */
break;
case 70:
-#line 653 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 656 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 3427 "edif.tab.c" /* yacc.c:1646 */
+#line 3432 "edif.c" /* yacc.c:1646 */
break;
case 80:
-#line 671 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 674 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3433 "edif.tab.c" /* yacc.c:1646 */
+#line 3438 "edif.c" /* yacc.c:1646 */
break;
case 84:
-#line 681 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 684 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3439 "edif.tab.c" /* yacc.c:1646 */
+#line 3444 "edif.c" /* yacc.c:1646 */
break;
case 91:
-#line 696 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 699 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3445 "edif.tab.c" /* yacc.c:1646 */
+#line 3450 "edif.c" /* yacc.c:1646 */
break;
case 102:
-#line 719 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 722 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3451 "edif.tab.c" /* yacc.c:1646 */
+#line 3456 "edif.c" /* yacc.c:1646 */
break;
case 140:
-#line 779 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 782 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3457 "edif.tab.c" /* yacc.c:1646 */
+#line 3462 "edif.c" /* yacc.c:1646 */
break;
case 147:
-#line 794 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 797 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); }
-#line 3463 "edif.tab.c" /* yacc.c:1646 */
+#line 3468 "edif.c" /* yacc.c:1646 */
break;
case 150:
-#line 801 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 804 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); }
-#line 3469 "edif.tab.c" /* yacc.c:1646 */
+#line 3474 "edif.c" /* yacc.c:1646 */
break;
case 182:
-#line 871 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 874 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3475 "edif.tab.c" /* yacc.c:1646 */
+#line 3480 "edif.c" /* yacc.c:1646 */
break;
case 184:
-#line 875 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 878 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3481 "edif.tab.c" /* yacc.c:1646 */
+#line 3486 "edif.c" /* yacc.c:1646 */
break;
case 240:
-#line 979 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 982 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3487 "edif.tab.c" /* yacc.c:1646 */
+#line 3492 "edif.c" /* yacc.c:1646 */
break;
case 247:
-#line 992 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 995 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3493 "edif.tab.c" /* yacc.c:1646 */
+#line 3498 "edif.c" /* yacc.c:1646 */
break;
case 278:
-#line 1039 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1042 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3499 "edif.tab.c" /* yacc.c:1646 */
+#line 3504 "edif.c" /* yacc.c:1646 */
break;
case 279:
-#line 1042 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1045 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3505 "edif.tab.c" /* yacc.c:1646 */
+#line 3510 "edif.c" /* yacc.c:1646 */
break;
case 333:
-#line 1128 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1131 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-3].s)); free((yyvsp[-2].s)); }
-#line 3511 "edif.tab.c" /* yacc.c:1646 */
+#line 3516 "edif.c" /* yacc.c:1646 */
break;
case 336:
-#line 1135 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1138 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3517 "edif.tab.c" /* yacc.c:1646 */
+#line 3522 "edif.c" /* yacc.c:1646 */
break;
case 337:
-#line 1138 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1141 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3523 "edif.tab.c" /* yacc.c:1646 */
+#line 3528 "edif.c" /* yacc.c:1646 */
break;
case 344:
-#line 1151 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1154 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); }
-#line 3529 "edif.tab.c" /* yacc.c:1646 */
+#line 3534 "edif.c" /* yacc.c:1646 */
break;
case 346:
-#line 1155 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1158 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3535 "edif.tab.c" /* yacc.c:1646 */
+#line 3540 "edif.c" /* yacc.c:1646 */
break;
case 347:
-#line 1156 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1159 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3541 "edif.tab.c" /* yacc.c:1646 */
+#line 3546 "edif.c" /* yacc.c:1646 */
break;
case 348:
-#line 1157 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1160 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3547 "edif.tab.c" /* yacc.c:1646 */
+#line 3552 "edif.c" /* yacc.c:1646 */
break;
case 369:
-#line 1198 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1201 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[-2].s); }
-#line 3553 "edif.tab.c" /* yacc.c:1646 */
+#line 3558 "edif.c" /* yacc.c:1646 */
break;
case 371:
-#line 1202 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1205 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3559 "edif.tab.c" /* yacc.c:1646 */
+#line 3564 "edif.c" /* yacc.c:1646 */
break;
case 374:
-#line 1209 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1212 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3565 "edif.tab.c" /* yacc.c:1646 */
+#line 3570 "edif.c" /* yacc.c:1646 */
break;
case 381:
-#line 1220 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1223 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3571 "edif.tab.c" /* yacc.c:1646 */
+#line 3576 "edif.c" /* yacc.c:1646 */
break;
case 384:
-#line 1227 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1230 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3577 "edif.tab.c" /* yacc.c:1646 */
+#line 3582 "edif.c" /* yacc.c:1646 */
break;
case 388:
-#line 1233 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1236 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3583 "edif.tab.c" /* yacc.c:1646 */
+#line 3588 "edif.c" /* yacc.c:1646 */
break;
case 390:
-#line 1237 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1240 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3589 "edif.tab.c" /* yacc.c:1646 */
+#line 3594 "edif.c" /* yacc.c:1646 */
break;
case 393:
-#line 1244 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1247 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3595 "edif.tab.c" /* yacc.c:1646 */
+#line 3600 "edif.c" /* yacc.c:1646 */
break;
case 397:
-#line 1252 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1255 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3601 "edif.tab.c" /* yacc.c:1646 */
+#line 3606 "edif.c" /* yacc.c:1646 */
break;
case 408:
-#line 1267 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1270 "edif.y" /* yacc.c:1646 */
{ pair_list_free((yyvsp[0].pl)); }
-#line 3607 "edif.tab.c" /* yacc.c:1646 */
+#line 3612 "edif.c" /* yacc.c:1646 */
break;
case 437:
-#line 1317 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1320 "edif.y" /* yacc.c:1646 */
{ (yyval.pl) = new_pair_list((yyvsp[-1].ps)); }
-#line 3613 "edif.tab.c" /* yacc.c:1646 */
+#line 3618 "edif.c" /* yacc.c:1646 */
break;
case 438:
-#line 1320 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1323 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=NULL; }
-#line 3619 "edif.tab.c" /* yacc.c:1646 */
+#line 3624 "edif.c" /* yacc.c:1646 */
break;
case 439:
-#line 1321 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1324 "edif.y" /* yacc.c:1646 */
{ (yyvsp[0].ps)->next = (yyvsp[-1].ps); (yyval.ps) = (yyvsp[0].ps); }
-#line 3625 "edif.tab.c" /* yacc.c:1646 */
+#line 3630 "edif.c" /* yacc.c:1646 */
break;
case 455:
-#line 1347 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1350 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 3631 "edif.tab.c" /* yacc.c:1646 */
+#line 3636 "edif.c" /* yacc.c:1646 */
break;
case 459:
-#line 1357 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1360 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3637 "edif.tab.c" /* yacc.c:1646 */
+#line 3642 "edif.c" /* yacc.c:1646 */
break;
case 460:
-#line 1360 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1363 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3643 "edif.tab.c" /* yacc.c:1646 */
+#line 3648 "edif.c" /* yacc.c:1646 */
break;
case 462:
-#line 1366 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1369 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3649 "edif.tab.c" /* yacc.c:1646 */
+#line 3654 "edif.c" /* yacc.c:1646 */
break;
case 463:
-#line 1369 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1372 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3655 "edif.tab.c" /* yacc.c:1646 */
+#line 3660 "edif.c" /* yacc.c:1646 */
break;
case 483:
-#line 1411 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1414 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3661 "edif.tab.c" /* yacc.c:1646 */
+#line 3666 "edif.c" /* yacc.c:1646 */
break;
case 484:
-#line 1414 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1417 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3667 "edif.tab.c" /* yacc.c:1646 */
+#line 3672 "edif.c" /* yacc.c:1646 */
break;
case 492:
-#line 1428 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1431 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3673 "edif.tab.c" /* yacc.c:1646 */
+#line 3678 "edif.c" /* yacc.c:1646 */
break;
case 506:
-#line 1456 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1459 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3679 "edif.tab.c" /* yacc.c:1646 */
+#line 3684 "edif.c" /* yacc.c:1646 */
break;
case 507:
-#line 1459 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1462 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3685 "edif.tab.c" /* yacc.c:1646 */
+#line 3690 "edif.c" /* yacc.c:1646 */
break;
case 514:
-#line 1474 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1477 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3691 "edif.tab.c" /* yacc.c:1646 */
+#line 3696 "edif.c" /* yacc.c:1646 */
break;
case 549:
-#line 1529 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1532 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3697 "edif.tab.c" /* yacc.c:1646 */
+#line 3702 "edif.c" /* yacc.c:1646 */
break;
case 555:
-#line 1541 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1544 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3703 "edif.tab.c" /* yacc.c:1646 */
+#line 3708 "edif.c" /* yacc.c:1646 */
break;
case 560:
-#line 1550 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1553 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); }
-#line 3709 "edif.tab.c" /* yacc.c:1646 */
+#line 3714 "edif.c" /* yacc.c:1646 */
break;
case 561:
-#line 1553 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1556 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3715 "edif.tab.c" /* yacc.c:1646 */
+#line 3720 "edif.c" /* yacc.c:1646 */
break;
case 562:
-#line 1554 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1557 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3721 "edif.tab.c" /* yacc.c:1646 */
+#line 3726 "edif.c" /* yacc.c:1646 */
break;
case 582:
-#line 1596 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1599 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3727 "edif.tab.c" /* yacc.c:1646 */
+#line 3732 "edif.c" /* yacc.c:1646 */
break;
case 585:
-#line 1599 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1602 "edif.y" /* yacc.c:1646 */
{ pair_list_free((yyvsp[0].pl)); }
-#line 3733 "edif.tab.c" /* yacc.c:1646 */
+#line 3738 "edif.c" /* yacc.c:1646 */
break;
case 586:
-#line 1602 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1605 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[-1].s); }
-#line 3739 "edif.tab.c" /* yacc.c:1646 */
+#line 3744 "edif.c" /* yacc.c:1646 */
break;
case 587:
-#line 1605 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1608 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3745 "edif.tab.c" /* yacc.c:1646 */
+#line 3750 "edif.c" /* yacc.c:1646 */
break;
case 589:
-#line 1609 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1612 "edif.y" /* yacc.c:1646 */
{ (yyval.ps) = new_str_pair((yyvsp[0].s),NULL); }
-#line 3751 "edif.tab.c" /* yacc.c:1646 */
+#line 3756 "edif.c" /* yacc.c:1646 */
break;
case 590:
-#line 1610 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1613 "edif.y" /* yacc.c:1646 */
{ (yyval.ps) = new_str_pair((yyvsp[0].s),NULL); }
-#line 3757 "edif.tab.c" /* yacc.c:1646 */
+#line 3762 "edif.c" /* yacc.c:1646 */
break;
case 591:
-#line 1611 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1614 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=(yyvsp[0].ps); }
-#line 3763 "edif.tab.c" /* yacc.c:1646 */
+#line 3768 "edif.c" /* yacc.c:1646 */
break;
case 592:
-#line 1614 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1617 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3769 "edif.tab.c" /* yacc.c:1646 */
+#line 3774 "edif.c" /* yacc.c:1646 */
break;
case 593:
-#line 1615 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1618 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3775 "edif.tab.c" /* yacc.c:1646 */
+#line 3780 "edif.c" /* yacc.c:1646 */
break;
case 594:
-#line 1618 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1621 "edif.y" /* yacc.c:1646 */
{ define_pcb_net((yyvsp[-2].ps), (yyvsp[-1].pl)); }
-#line 3781 "edif.tab.c" /* yacc.c:1646 */
+#line 3786 "edif.c" /* yacc.c:1646 */
break;
case 595:
-#line 1621 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1624 "edif.y" /* yacc.c:1646 */
{ (yyval.pl)=(yyvsp[0].pl); }
-#line 3787 "edif.tab.c" /* yacc.c:1646 */
+#line 3792 "edif.c" /* yacc.c:1646 */
break;
case 611:
-#line 1643 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1646 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[-2].ps)); }
-#line 3793 "edif.tab.c" /* yacc.c:1646 */
+#line 3798 "edif.c" /* yacc.c:1646 */
break;
case 632:
-#line 1680 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1683 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=(yyvsp[0].ps); }
-#line 3799 "edif.tab.c" /* yacc.c:1646 */
+#line 3804 "edif.c" /* yacc.c:1646 */
break;
case 633:
-#line 1681 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1684 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=NULL; }
-#line 3805 "edif.tab.c" /* yacc.c:1646 */
+#line 3810 "edif.c" /* yacc.c:1646 */
break;
case 634:
-#line 1685 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1688 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3811 "edif.tab.c" /* yacc.c:1646 */
+#line 3816 "edif.c" /* yacc.c:1646 */
break;
case 639:
-#line 1694 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1697 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3817 "edif.tab.c" /* yacc.c:1646 */
+#line 3822 "edif.c" /* yacc.c:1646 */
break;
case 644:
-#line 1705 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1708 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3823 "edif.tab.c" /* yacc.c:1646 */
+#line 3828 "edif.c" /* yacc.c:1646 */
break;
case 698:
-#line 1807 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1810 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-3].s)); }
-#line 3829 "edif.tab.c" /* yacc.c:1646 */
+#line 3834 "edif.c" /* yacc.c:1646 */
break;
case 701:
-#line 1814 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1817 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 3835 "edif.tab.c" /* yacc.c:1646 */
+#line 3840 "edif.c" /* yacc.c:1646 */
break;
case 727:
-#line 1866 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1869 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 3841 "edif.tab.c" /* yacc.c:1646 */
+#line 3846 "edif.c" /* yacc.c:1646 */
break;
case 730:
-#line 1873 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1876 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3847 "edif.tab.c" /* yacc.c:1646 */
+#line 3852 "edif.c" /* yacc.c:1646 */
break;
case 747:
-#line 1908 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1911 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); free((yyvsp[-1].s)); }
-#line 3853 "edif.tab.c" /* yacc.c:1646 */
+#line 3858 "edif.c" /* yacc.c:1646 */
break;
case 766:
-#line 1939 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1942 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3859 "edif.tab.c" /* yacc.c:1646 */
+#line 3864 "edif.c" /* yacc.c:1646 */
break;
case 789:
-#line 1974 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1977 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3865 "edif.tab.c" /* yacc.c:1646 */
+#line 3870 "edif.c" /* yacc.c:1646 */
break;
case 791:
-#line 1980 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1983 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3871 "edif.tab.c" /* yacc.c:1646 */
+#line 3876 "edif.c" /* yacc.c:1646 */
break;
case 803:
-#line 1996 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 1999 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3877 "edif.tab.c" /* yacc.c:1646 */
+#line 3882 "edif.c" /* yacc.c:1646 */
break;
case 818:
-#line 2015 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2018 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3883 "edif.tab.c" /* yacc.c:1646 */
+#line 3888 "edif.c" /* yacc.c:1646 */
break;
case 823:
-#line 2026 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2029 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3889 "edif.tab.c" /* yacc.c:1646 */
+#line 3894 "edif.c" /* yacc.c:1646 */
break;
case 827:
-#line 2032 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2035 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3895 "edif.tab.c" /* yacc.c:1646 */
+#line 3900 "edif.c" /* yacc.c:1646 */
break;
case 829:
-#line 2036 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2039 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3901 "edif.tab.c" /* yacc.c:1646 */
+#line 3906 "edif.c" /* yacc.c:1646 */
break;
case 831:
-#line 2041 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2044 "edif.y" /* yacc.c:1646 */
{
if ((yyvsp[-1].ps))
{
@@ -3914,251 +3919,251 @@ yyreduce:
(yyval.ps) = new_str_pair(NULL,(yyvsp[-2].s));
}
}
-#line 3918 "edif.tab.c" /* yacc.c:1646 */
+#line 3923 "edif.c" /* yacc.c:1646 */
break;
case 832:
-#line 2055 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2058 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=NULL; }
-#line 3924 "edif.tab.c" /* yacc.c:1646 */
+#line 3929 "edif.c" /* yacc.c:1646 */
break;
case 833:
-#line 2056 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2059 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=(yyvsp[0].ps); }
-#line 3930 "edif.tab.c" /* yacc.c:1646 */
+#line 3935 "edif.c" /* yacc.c:1646 */
break;
case 834:
-#line 2057 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2060 "edif.y" /* yacc.c:1646 */
{ (yyval.ps) = new_str_pair((yyvsp[0].s),NULL); }
-#line 3936 "edif.tab.c" /* yacc.c:1646 */
+#line 3941 "edif.c" /* yacc.c:1646 */
break;
case 835:
-#line 2058 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2061 "edif.y" /* yacc.c:1646 */
{ (yyval.ps)=NULL; }
-#line 3942 "edif.tab.c" /* yacc.c:1646 */
+#line 3947 "edif.c" /* yacc.c:1646 */
break;
case 848:
-#line 2085 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2088 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3948 "edif.tab.c" /* yacc.c:1646 */
+#line 3953 "edif.c" /* yacc.c:1646 */
break;
case 849:
-#line 2088 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2091 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3954 "edif.tab.c" /* yacc.c:1646 */
+#line 3959 "edif.c" /* yacc.c:1646 */
break;
case 881:
-#line 2141 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2144 "edif.y" /* yacc.c:1646 */
{ (yyval.ps) = new_str_pair((yyvsp[-2].s),(yyvsp[-1].s)); }
-#line 3960 "edif.tab.c" /* yacc.c:1646 */
+#line 3965 "edif.c" /* yacc.c:1646 */
break;
case 882:
-#line 2144 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2147 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3966 "edif.tab.c" /* yacc.c:1646 */
+#line 3971 "edif.c" /* yacc.c:1646 */
break;
case 883:
-#line 2145 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2148 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3972 "edif.tab.c" /* yacc.c:1646 */
+#line 3977 "edif.c" /* yacc.c:1646 */
break;
case 884:
-#line 2148 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2151 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 3978 "edif.tab.c" /* yacc.c:1646 */
+#line 3983 "edif.c" /* yacc.c:1646 */
break;
case 885:
-#line 2149 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2152 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=NULL; }
-#line 3984 "edif.tab.c" /* yacc.c:1646 */
+#line 3989 "edif.c" /* yacc.c:1646 */
break;
case 889:
-#line 2159 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2162 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 3990 "edif.tab.c" /* yacc.c:1646 */
+#line 3995 "edif.c" /* yacc.c:1646 */
break;
case 891:
-#line 2165 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2168 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 3996 "edif.tab.c" /* yacc.c:1646 */
+#line 4001 "edif.c" /* yacc.c:1646 */
break;
case 892:
-#line 2166 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2169 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); free((yyvsp[-1].s)); }
-#line 4002 "edif.tab.c" /* yacc.c:1646 */
+#line 4007 "edif.c" /* yacc.c:1646 */
break;
case 893:
-#line 2169 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2172 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); free((yyvsp[-1].s)); }
-#line 4008 "edif.tab.c" /* yacc.c:1646 */
+#line 4013 "edif.c" /* yacc.c:1646 */
break;
case 894:
-#line 2172 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2175 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-2].s)); free((yyvsp[-1].s)); }
-#line 4014 "edif.tab.c" /* yacc.c:1646 */
+#line 4019 "edif.c" /* yacc.c:1646 */
break;
case 896:
-#line 2178 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2181 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4020 "edif.tab.c" /* yacc.c:1646 */
+#line 4025 "edif.c" /* yacc.c:1646 */
break;
case 898:
-#line 2180 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2183 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4026 "edif.tab.c" /* yacc.c:1646 */
+#line 4031 "edif.c" /* yacc.c:1646 */
break;
case 903:
-#line 2191 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2194 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 4032 "edif.tab.c" /* yacc.c:1646 */
+#line 4037 "edif.c" /* yacc.c:1646 */
break;
case 935:
-#line 2255 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2258 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 4038 "edif.tab.c" /* yacc.c:1646 */
+#line 4043 "edif.c" /* yacc.c:1646 */
break;
case 943:
-#line 2271 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2274 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4044 "edif.tab.c" /* yacc.c:1646 */
+#line 4049 "edif.c" /* yacc.c:1646 */
break;
case 946:
-#line 2276 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2279 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4050 "edif.tab.c" /* yacc.c:1646 */
+#line 4055 "edif.c" /* yacc.c:1646 */
break;
case 973:
-#line 2321 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2324 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 4056 "edif.tab.c" /* yacc.c:1646 */
+#line 4061 "edif.c" /* yacc.c:1646 */
break;
case 987:
-#line 2343 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2346 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 4062 "edif.tab.c" /* yacc.c:1646 */
+#line 4067 "edif.c" /* yacc.c:1646 */
break;
case 994:
-#line 2359 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2362 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-6].s)); free((yyvsp[-5].s)); free((yyvsp[-4].s)); free((yyvsp[-3].s)); free((yyvsp[-2].s)); free((yyvsp[-1].s)); }
-#line 4068 "edif.tab.c" /* yacc.c:1646 */
+#line 4073 "edif.c" /* yacc.c:1646 */
break;
case 1054:
-#line 2466 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2469 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4074 "edif.tab.c" /* yacc.c:1646 */
+#line 4079 "edif.c" /* yacc.c:1646 */
break;
case 1055:
-#line 2467 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2470 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4080 "edif.tab.c" /* yacc.c:1646 */
+#line 4085 "edif.c" /* yacc.c:1646 */
break;
case 1056:
-#line 2468 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2471 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4086 "edif.tab.c" /* yacc.c:1646 */
+#line 4091 "edif.c" /* yacc.c:1646 */
break;
case 1057:
-#line 2469 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2472 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4092 "edif.tab.c" /* yacc.c:1646 */
+#line 4097 "edif.c" /* yacc.c:1646 */
break;
case 1059:
-#line 2473 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2476 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 4098 "edif.tab.c" /* yacc.c:1646 */
+#line 4103 "edif.c" /* yacc.c:1646 */
break;
case 1061:
-#line 2477 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2480 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4104 "edif.tab.c" /* yacc.c:1646 */
+#line 4109 "edif.c" /* yacc.c:1646 */
break;
case 1063:
-#line 2481 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2484 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[-1].s)); }
-#line 4110 "edif.tab.c" /* yacc.c:1646 */
+#line 4115 "edif.c" /* yacc.c:1646 */
break;
case 1085:
-#line 2517 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2520 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 4116 "edif.tab.c" /* yacc.c:1646 */
+#line 4121 "edif.c" /* yacc.c:1646 */
break;
case 1086:
-#line 2520 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2523 "edif.y" /* yacc.c:1646 */
{ free((yyvsp[0].s)); }
-#line 4122 "edif.tab.c" /* yacc.c:1646 */
+#line 4127 "edif.c" /* yacc.c:1646 */
break;
case 1107:
-#line 2561 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2564 "edif.y" /* yacc.c:1646 */
{ str_pair_free((yyvsp[0].ps)); }
-#line 4128 "edif.tab.c" /* yacc.c:1646 */
+#line 4133 "edif.c" /* yacc.c:1646 */
break;
case 1109:
-#line 2563 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2566 "edif.y" /* yacc.c:1646 */
{ pair_list_free((yyvsp[0].pl)); }
-#line 4134 "edif.tab.c" /* yacc.c:1646 */
+#line 4139 "edif.c" /* yacc.c:1646 */
break;
case 1126:
-#line 2590 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2593 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 4140 "edif.tab.c" /* yacc.c:1646 */
+#line 4145 "edif.c" /* yacc.c:1646 */
break;
case 1127:
-#line 2593 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2596 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 4146 "edif.tab.c" /* yacc.c:1646 */
+#line 4151 "edif.c" /* yacc.c:1646 */
break;
case 1128:
-#line 2596 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2599 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 4152 "edif.tab.c" /* yacc.c:1646 */
+#line 4157 "edif.c" /* yacc.c:1646 */
break;
case 1129:
-#line 2599 "../../src_plugins/import_edif/edif.y" /* yacc.c:1646 */
+#line 2602 "edif.y" /* yacc.c:1646 */
{ (yyval.s)=(yyvsp[0].s); }
-#line 4158 "edif.tab.c" /* yacc.c:1646 */
+#line 4163 "edif.c" /* yacc.c:1646 */
break;
-#line 4162 "edif.tab.c" /* yacc.c:1646 */
+#line 4167 "edif.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4386,7 +4391,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 2602 "../../src_plugins/import_edif/edif.y" /* yacc.c:1906 */
+#line 2605 "edif.y" /* yacc.c:1906 */
/*
* xmalloc:
@@ -6236,7 +6241,7 @@ static int yylex()
int ReadEdifNetlist(char *filename)
{
- Message(PCB_MSG_INFO, _("Importing edif netlist %s\n"), filename);
+ pcb_message(PCB_MSG_INFO, _("Importing edif netlist %s\n"), filename);
ParseEDIF(filename, NULL);
return 0;
diff --git a/src_plugins/import_edif/edif.h b/src_plugins/import_edif/edif.h
index 505014e..a513205 100644
--- a/src_plugins/import_edif/edif.h
+++ b/src_plugins/import_edif/edif.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
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
@@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_EDIF_EDIF_TAB_H_INCLUDED
-# define YY_EDIF_EDIF_TAB_H_INCLUDED
+#ifndef YY_EDIF_EDIF_H_INCLUDED
+# define YY_EDIF_EDIF_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -342,17 +342,19 @@ extern int edifdebug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
+
union YYSTYPE
{
-#line 198 "../../src_plugins/import_edif/edif.y" /* yacc.c:1909 */
+#line 201 "edif.y" /* yacc.c:1909 */
char* s;
pair_list* pl;
str_pair* ps;
-#line 355 "edif.tab.h" /* yacc.c:1909 */
+#line 355 "edif.h" /* yacc.c:1909 */
};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
@@ -362,4 +364,4 @@ extern YYSTYPE ediflval;
int edifparse (void);
-#endif /* !YY_EDIF_EDIF_TAB_H_INCLUDED */
+#endif /* !YY_EDIF_EDIF_H_INCLUDED */
diff --git a/src_plugins/import_edif/edif.y b/src_plugins/import_edif/edif.y
index 3dd069d..8be19b1 100644
--- a/src_plugins/import_edif/edif.y
+++ b/src_plugins/import_edif/edif.y
@@ -26,15 +26,18 @@
#include <ctype.h>
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
+#include "library.h"
#include "error.h"
#include "plugins.h"
#include "compat_misc.h"
+#include "compat_nls.h"
/* from mymem.h, not include because of the malloc junk */
-LibraryMenuTypePtr GetLibraryMenuMemory(LibraryTypePtr, int *idx);
-LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
+pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *, int *idx);
+pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *);
/*
@@ -103,8 +106,8 @@ LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
str_pair* node;
char* buf;
char* p;
- LibraryEntryTypePtr entry;
- LibraryMenuTypePtr menu = GetLibraryMenuMemory(&PCB->NetlistLib[NETLIST_INPUT], NULL);
+ pcb_lib_entry_t *entry;
+ pcb_lib_menu_t *menu = pcb_lib_menu_new(&PCB->NetlistLib[PCB_NETLIST_INPUT], NULL);
if ( !name->str1 )
{
@@ -178,7 +181,7 @@ LibraryEntryTypePtr GetLibraryEntryMemory(LibraryMenuTypePtr);
/* free the strings */
free(node->str1);
free(node->str2);
- entry = GetLibraryEntryMemory (menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(buf);
done_node = node;
node = node->next;
@@ -4448,7 +4451,7 @@ static int yylex()
int ReadEdifNetlist(char *filename)
{
- Message(PCB_MSG_INFO, _("Importing edif netlist %s\n"), filename);
+ pcb_message(PCB_MSG_INFO, _("Importing edif netlist %s\n"), filename);
ParseEDIF(filename, NULL);
return 0;
diff --git a/src_plugins/import_edif/import_edif.c b/src_plugins/import_edif/import_edif.c
index 7997251..a7a71ec 100644
--- a/src_plugins/import_edif/import_edif.c
+++ b/src_plugins/import_edif/import_edif.c
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "plugins.h"
#include "plug_import.h"
@@ -35,9 +35,9 @@
#include "plug_io.h"
-static plug_import_t import_edif;
+static pcb_plug_import_t import_edif;
-int edif_support_prio(plug_import_t *ctx, unsigned int aspects, FILE *fp, const char *filename)
+int edif_support_prio(pcb_plug_import_t *ctx, unsigned int aspects, FILE *fp, const char *filename)
{
char buf[65];
int len;
@@ -63,12 +63,12 @@ int edif_support_prio(plug_import_t *ctx, unsigned int aspects, FILE *fp, const
extern int ReadEdifNetlist(char *filename);
-static int edif_import(plug_import_t *ctx, unsigned int aspects, const char *fn)
+static int edif_import(pcb_plug_import_t *ctx, unsigned int aspects, const char *fn)
{
int ret = ReadEdifNetlist((char *)fn);
if (ret == 0) {
pcb_sort_netlist();
- rats_patch_make_edited(PCB);
+ pcb_ratspatch_make_edited(PCB);
}
return ret;
}
@@ -86,7 +86,7 @@ pcb_uninit_t hid_import_edif_init(void)
import_edif.fmt_support_prio = edif_support_prio;
import_edif.import = edif_import;
- HOOK_REGISTER(plug_import_t, plug_import_chain, &import_edif);
+ PCB_HOOK_REGISTER(pcb_plug_import_t, pcb_plug_import_chain, &import_edif);
return hid_import_edif_uninit;
}
diff --git a/src_plugins/import_hyp/Makefile b/src_plugins/import_hyp/Makefile
new file mode 100644
index 0000000..cac36bf
--- /dev/null
+++ b/src_plugins/import_hyp/Makefile
@@ -0,0 +1,10 @@
+all:
+ cd ../../src && $(MAKE) mod_import_hyp
+
+hyp_l.o: hyp_y.h
+
+parser.o: hyp_l.h hyp_y.h
+
+clean:
+ rm *.o *.so hyp_l.c hyp_l.h hyp_y.c hyp_y.h 2>/dev/null ; true
+
diff --git a/src_plugins/import_hyp/Plug.tmpasm b/src_plugins/import_hyp/Plug.tmpasm
new file mode 100644
index 0000000..d8b7e5e
--- /dev/null
+++ b/src_plugins/import_hyp/Plug.tmpasm
@@ -0,0 +1,18 @@
+put /local/pcb/mod {import_hyp}
+
+append /local/pcb/mod/OBJS [@
+ $(PLUGDIR)/import_hyp/import_hyp.o
+ $(PLUGDIR)/import_hyp/hyp_l.o
+ $(PLUGDIR)/import_hyp/hyp_y.o
+ $(PLUGDIR)/import_hyp/parser.o
+@]
+
+put /local/pcb/mod/YACC {$(PLUGDIR)/import_hyp/hyp_y}
+put /local/pcb/mod/LEX {$(PLUGDIR)/import_hyp/hyp_l}
+
+
+switch /local/pcb/import_hyp/controls
+ case {buildin} include /local/pcb/tmpasm/buildin; end;
+ case {plugin} include /local/pcb/tmpasm/plugin; end;
+ case {disable} include /local/pcb/tmpasm/disable; end;
+end
diff --git a/src_plugins/import_hyp/README b/src_plugins/import_hyp/README
new file mode 100644
index 0000000..ff9f3eb
--- /dev/null
+++ b/src_plugins/import_hyp/README
@@ -0,0 +1,5 @@
+Import plugin for hyperlynx geometry.
+
+#state: WIP
+#default: disable
+#implements: import
diff --git a/src_plugins/import_hyp/hyp_l.l b/src_plugins/import_hyp/hyp_l.l
new file mode 100644
index 0000000..5875698
--- /dev/null
+++ b/src_plugins/import_hyp/hyp_l.l
@@ -0,0 +1,376 @@
+
+/*
+ * read hyperlynx files
+ * Copyright 2012, 2016 Koen De Vleeschauwer.
+ *
+ * This file is part of pcb-rnd.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+%option noyywrap nodefault yylineno debug
+
+/* avoid collision with other scanners */
+%option prefix="hyy"
+
+%{
+#include <stdlib.h>
+
+char *pcb_strdup(const char *s); /* from #include "compat_misc.h" */
+
+#include "hyp_y.h"
+
+/* copy a string between quotes */
+char *strunquote(const char *);
+
+/* remember hyperlynx file section we're in */
+int section = -1;
+
+%}
+
+ /*
+ * The scanner knows five states: INITIAL, STATE_STRING, STATE_POSINT, STATE_FLOAT and STATE_COMMENT
+ *
+ * In state INITIAL the scanner recognizes:
+ * - punctuation (such as {}()=, )
+ * - keywords (such as VERSION, BOARD, NET),
+ * - strings (both between double quotes " and unquoted),
+ * - and floating point numbers (with optional suffix, eg. 10 uF),
+ *
+ * In STATE_STRING the scanner recognizes punctuation and strings only.
+ * This avoids unquoted strings being interpreted as numbers, or keywords.
+ *
+ * In STATE_POSINT the scanner recognizes a positive integer.
+ *
+ * In STATE_FLOAT the scanner recognizes a floating point number (without suffix).
+ *
+ * In STATE_COMMENT the scanner discards all text up to the next
+ * right brace } , and then continues in state INITIAL.
+ *
+ */
+
+%x STATE_STRING STATE_POSINT STATE_FLOAT STATE_COMMENT STATE_COMMENT_EOL
+
+ /* whitespace: space, tab, vertical tab, form feed */
+WS [ \t\v\f]
+
+ /* accept windows and unix newlines */
+NEWLINE [\r\n]+
+
+ /*
+ * lines with an asterisk in the first column are comments
+ */
+COMMENT ^\*[^\n\r]*[\n\r]+
+
+ /* Left-hand side of an assignment: check whether next token is equals sign */
+LHS [ \t\v\f]*"="
+
+ /*
+ * Positive integer
+ */
+
+POSINT [0-9]+
+
+ /*
+ * Floating point numbers
+ */
+
+ /* ordinary floating point numbers */
+SIMPLE_FLOAT [-+]?([0-9]+"."[0-9]*|"."?[0-9]+)([Ee][-+]?[0-9]+)?
+
+ /* floating point numbers with suffix, e,g. pF, nH */
+FLOAT_SUFFIX [A-Za-z]*{WS}+
+FLOAT_YOTTA {SIMPLE_FLOAT}{WS}*"Y"{FLOAT_SUFFIX}
+FLOAT_ZETA {SIMPLE_FLOAT}{WS}*"Z"{FLOAT_SUFFIX}
+FLOAT_EXA {SIMPLE_FLOAT}{WS}*"E"{FLOAT_SUFFIX}
+FLOAT_PETA {SIMPLE_FLOAT}{WS}*"P"{FLOAT_SUFFIX}
+FLOAT_TERA {SIMPLE_FLOAT}{WS}*"T"{FLOAT_SUFFIX}
+FLOAT_GIGA {SIMPLE_FLOAT}{WS}*"G"{FLOAT_SUFFIX}
+FLOAT_MEGA {SIMPLE_FLOAT}{WS}*"M"{FLOAT_SUFFIX}
+FLOAT_KILO {SIMPLE_FLOAT}{WS}*[Kk]{FLOAT_SUFFIX}
+FLOAT_MILLI {SIMPLE_FLOAT}{WS}*"m"{FLOAT_SUFFIX}
+FLOAT_MICRO {SIMPLE_FLOAT}{WS}*[uU]{FLOAT_SUFFIX}
+FLOAT_NANO {SIMPLE_FLOAT}{WS}*[nN]{FLOAT_SUFFIX}
+FLOAT_PICO {SIMPLE_FLOAT}{WS}*[pP]{FLOAT_SUFFIX}
+FLOAT_FEMTO {SIMPLE_FLOAT}{WS}*[fF]{FLOAT_SUFFIX}
+FLOAT_ATTO {SIMPLE_FLOAT}{WS}*"a"{FLOAT_SUFFIX}
+FLOAT_ZEPTO {SIMPLE_FLOAT}{WS}*"z"{FLOAT_SUFFIX}
+FLOAT_YOCTO {SIMPLE_FLOAT}{WS}*"y"{FLOAT_SUFFIX}
+
+ /*
+ * Strings
+ */
+
+ /* an unquoted string */
+STRING [^ \t\v\f\r\n\{\}\(\)=\"]+
+
+ /* a string enclosed in double quotes " */
+QUOTED_STRING \"([^\"\n]|\"\")*\"
+
+%%
+
+ /* When in STATE_COMMENT skip all comment until next right brace */
+<STATE_COMMENT>{
+[^\}]* { BEGIN INITIAL; /* skip all comment until next right brace */ }
+}
+
+ /* When in STATE_COMMENT_EOL skip all comment until end-of-line */
+<STATE_COMMENT_EOL>{
+[^\r\n]*{NEWLINE}+ { BEGIN INITIAL; /* skip all comment until next end-of-line */ }
+}
+
+
+ /* skip comments and whitespace */
+<*>{
+
+ {COMMENT} { /* skip comments */ }
+
+ {WS}+ { /* skip whitespace */ }
+
+ {NEWLINE}+ { /* skip newlines */ }
+
+}
+
+ /*
+ * Hyperlynx keywords
+ */
+
+ /* Sections */
+
+"BOARD_FILE" {section = H_BOARD_FILE; return H_BOARD_FILE;}
+"VERSION" {section = H_VERSION; return H_VERSION;}
+"DATA_MODE" {section = H_DATA_MODE; return H_DATA_MODE;}
+"UNITS" {section = H_UNITS; return H_UNITS;}
+"PLANE_SEP" {section = H_PLANE_SEP; return H_PLANE_SEP;}
+"BOARD" {section = H_BOARD; BEGIN STATE_COMMENT_EOL; return H_BOARD;}
+"STACKUP" {section = H_STACKUP; BEGIN STATE_COMMENT_EOL; return H_STACKUP;}
+"DEVICES" {section = H_DEVICES; BEGIN STATE_COMMENT_EOL; return H_DEVICES;}
+"SUPPLIES" {section = H_SUPPLIES; BEGIN STATE_COMMENT_EOL; return H_SUPPLIES;}
+"PADSTACK" {section = H_PADSTACK; BEGIN STATE_STRING; return H_PADSTACK;}
+"NET" {section = H_NET; BEGIN STATE_STRING; return H_NET;}
+"NET_CLASS" {section = H_NET_CLASS; return H_NET_CLASS;}
+"END" {section = H_END; return H_END;}
+"KEY" {section = H_KEY; return H_KEY;}
+
+ /* Keywords */
+
+"A" {return H_A;}
+"ARC" {return H_ARC;}
+"COPPER" {return H_COPPER;}
+"CURVE" {return H_CURVE;}
+"DETAILED" {if (section == H_DATA_MODE) BEGIN STATE_COMMENT; return H_DETAILED;}
+"DIELECTRIC" {return H_DIELECTRIC;}
+"ENGLISH" {return H_ENGLISH;}
+"LENGTH" {if (section == H_UNITS) BEGIN STATE_COMMENT; return H_LENGTH;}
+"LINE" {return H_LINE;}
+"METRIC" {return H_METRIC;}
+"M" {return H_M;}
+"N" {return H_N;}
+"OPTIONS" {return H_OPTIONS;}
+"PAD" {return H_PAD;}
+"PERIMETER_ARC" {return H_PERIMETER_ARC;}
+"PERIMETER_SEGMENT" {return H_PERIMETER_SEGMENT;}
+"PIN" {return H_PIN;}
+"PLANE" {return H_PLANE;}
+"POLYGON" {return H_POLYGON;}
+"POLYLINE" {return H_POLYLINE;}
+"POLYVOID" {return H_POLYVOID;}
+"POUR" {return H_POUR;}
+"S" {return H_S;}
+"T" {return H_T;}
+"SEG" {return H_SEG;}
+"SIGNAL" {return H_SIGNAL;}
+"SIMPLIFIED" {if (section == H_DATA_MODE) BEGIN STATE_COMMENT; return H_SIMPLIFIED; }
+"SIM_BOTH" {return H_SIM_BOTH;}
+"SIM_IN" {return H_SIM_IN;}
+"SIM_OUT" {return H_SIM_OUT;}
+"USEG" {return H_USEG;}
+"VIA" {return H_VIA;}
+"WEIGHT" {if (section == H_UNITS) BEGIN STATE_COMMENT; return H_WEIGHT;}
+
+ /* Assignments */
+
+"A"/{LHS} {return H_A;}
+"A1"/{LHS} {return H_A1;}
+"A2"/{LHS} {return H_A2;}
+"BR"/{LHS} {return H_BR;}
+"C"/{LHS} {return H_C;}
+"C?"/{LHS} {return H_C_QM;}
+"CO?"/{LHS} {return H_CO_QM;}
+"D"/{LHS} {return H_D;}
+"ER"/{LHS} {return H_ER;}
+"F"/{LHS} {return H_F;}
+"ID"/{LHS} {BEGIN STATE_POSINT; return H_ID;}
+"L"/{LHS} {BEGIN STATE_STRING; return H_L;}
+"L1"/{LHS} {BEGIN STATE_STRING; return H_L1;}
+"L2"/{LHS} {BEGIN STATE_STRING; return H_L2;}
+"LPS"/{LHS} {return H_LPS;}
+"LT"/{LHS} {return H_LT;}
+"M"/{LHS} {BEGIN STATE_STRING; return H_M;}
+"N"/{LHS} {BEGIN STATE_STRING; return H_N;}
+"NAME"/{LHS} {BEGIN STATE_STRING; return H_NAME;}
+ /* P is used as "plating thickness" in "stackup/signal" and as "padstack" in "net/via" */
+"P"/{LHS} {if (section == H_NET) BEGIN STATE_STRING; return H_P;}
+"PKG"/{LHS} {BEGIN STATE_STRING; return H_PKG;}
+"PR?"/{LHS} {return H_PR_QM;}
+"PS"/{LHS} {return H_PS;}
+"R"/{LHS} {return H_R;}
+"REF"/{LHS} {BEGIN STATE_STRING; return H_REF;}
+"S"/{LHS} {BEGIN STATE_STRING; return H_S;}
+"SX"/{LHS} {return H_SX;}
+"SY"/{LHS} {return H_SY;}
+"S1"/{LHS} {BEGIN STATE_STRING; return H_S1;}
+"S1X"/{LHS} {return H_S1X;}
+"S1Y"/{LHS} {return H_S1Y;}
+"S2"/{LHS} {BEGIN STATE_STRING; return H_S2;}
+"S2X"/{LHS} {return H_S2X;}
+"S2Y"/{LHS} {return H_S2Y;}
+"T"/{LHS} {return H_T;}
+"TC"/{LHS} {return H_TC;}
+"USE_DIE_FOR_METAL"/{LHS} {return H_USE_DIE_FOR_METAL;}
+"V"/{LHS} {BEGIN STATE_STRING; return H_V;}
+"V?"/{LHS} {return H_V_QM;}
+"VAL"/{LHS} {return H_VAL;}
+"W"/{LHS} {return H_W;}
+"X"/{LHS} {return H_X;}
+"X1"/{LHS} {return H_X1;}
+"X2"/{LHS} {return H_X2;}
+"XC"/{LHS} {return H_XC;}
+"Y"/{LHS} {return H_Y;}
+"Y1"/{LHS} {return H_Y1;}
+"Y2"/{LHS} {return H_Y2;}
+"YC"/{LHS} {return H_YC;}
+"Z"/{LHS} {return H_Z;}
+"ZL"/{LHS} {return H_ZL;}
+"ZLEN"/{LHS} {return H_ZLEN;}
+"ZW"/{LHS} {return H_ZW;}
+
+ /* Booleans */
+
+"YES"|"yes" {hyylval.boolval = 1; return H_BOOL; }
+"NO"|"no" {hyylval.boolval = 0; return H_BOOL; }
+
+ /* Floats */
+
+ /* ordinary floating point numbers */
+{SIMPLE_FLOAT} {hyylval.floatval = strtod(hyytext, NULL); return H_FLOAT;}
+
+ /* floating point numbers with suffix, e,g. pF, nH */
+{FLOAT_YOTTA} {hyylval.floatval = strtod(hyytext, NULL) * 1e24; return H_FLOAT;}
+{FLOAT_ZETA} {hyylval.floatval = strtod(hyytext, NULL) * 1e21; return H_FLOAT;}
+{FLOAT_EXA} {hyylval.floatval = strtod(hyytext, NULL) * 1e18; return H_FLOAT;}
+{FLOAT_PETA} {hyylval.floatval = strtod(hyytext, NULL) * 1e15; return H_FLOAT;}
+{FLOAT_TERA} {hyylval.floatval = strtod(hyytext, NULL) * 1e12; return H_FLOAT;}
+{FLOAT_GIGA} {hyylval.floatval = strtod(hyytext, NULL) * 1e9; return H_FLOAT;}
+{FLOAT_MEGA} {hyylval.floatval = strtod(hyytext, NULL) * 1e6; return H_FLOAT;}
+{FLOAT_KILO} {hyylval.floatval = strtod(hyytext, NULL) * 1e3; return H_FLOAT;}
+{FLOAT_MILLI} {hyylval.floatval = strtod(hyytext, NULL) * 1e-3; return H_FLOAT;}
+{FLOAT_MICRO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-6; return H_FLOAT;}
+{FLOAT_NANO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-9; return H_FLOAT;}
+{FLOAT_PICO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-12; return H_FLOAT;}
+{FLOAT_FEMTO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-15; return H_FLOAT;}
+{FLOAT_ATTO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-18; return H_FLOAT;}
+{FLOAT_ZEPTO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-21; return H_FLOAT;}
+{FLOAT_YOCTO} {hyylval.floatval = strtod(hyytext, NULL) * 1e-24; return H_FLOAT;}
+
+ /* floating point numbers in VERSION and PLANE_SEP have no suffix and are followed by optional comments */
+<STATE_FLOAT>{
+{SIMPLE_FLOAT} {hyylval.floatval = strtod(hyytext, NULL); BEGIN STATE_COMMENT; return H_FLOAT;}
+}
+
+ /* A positive integer is used only in polygon/polyline/polyvoid "ID = posint" */
+<STATE_POSINT>{
+{POSINT} { BEGIN INITIAL; hyylval.intval = atoi(hyytext); return H_POSINT; }
+}
+
+
+ /*
+ * This is a workaround for syntactically incorrect .hyp files.
+ * We accept the following constructs as representing an empty string:
+ * NAME= L1=somelayer
+ * NAME= )
+ * NAME= }
+ */
+<STATE_STRING>{
+([A-Z][A-Z1-2_]*{WS}*"="|")"|"}") { yyless(0); BEGIN INITIAL; hyylval.strval = pcb_strdup(""); return H_STRING; } /* emit empty string and reprocess */
+}
+
+<*>{
+
+ "{" {return '{';}
+
+ "}" {BEGIN STATE_COMMENT_EOL; return '}';}
+
+ "(" {if (section == H_PADSTACK) BEGIN STATE_STRING; return '(';}
+
+ /* allow for comment after the closing bracket ) */
+ ")" {BEGIN STATE_COMMENT_EOL; return ')';}
+
+ "," {return ',';}
+
+ "=" {if ((section == H_VERSION) || (section == H_PLANE_SEP)) BEGIN STATE_FLOAT; return '=';}
+
+ /* string */
+ {STRING} {
+ /*
+ * Commas are not allowed in strings in the padstack section
+ * unless the string is enclosed in double quotes (").
+ */
+
+ if ((section == H_PADSTACK) && strchr(hyytext, ','))
+ REJECT
+ else
+ {
+ BEGIN INITIAL;
+ hyylval.strval = pcb_strdup(hyytext);
+ return H_STRING;
+ }
+ }
+
+ /* string in double quotes */
+ {QUOTED_STRING} {BEGIN INITIAL; hyylval.strval = strunquote(hyytext); return H_STRING;}
+
+ <<EOF>> {yyterminate();}
+
+ /* have bison catch all unrecognized characters with parse errors */
+ . {return hyytext[0];}
+
+}
+
+%%
+
+ /*
+ * copy a quoted string.
+ * e.g. "data 0" -> data 0
+ * a double quote inside the string can be escaped by writing two consecutive double quotes
+ * e.g. "net ""hi""" -> net "hi"
+ */
+
+ char *strunquote(const char *src)
+ {
+ char* dst;
+ size_t len = strlen(src) + 1;
+ dst = (char *)malloc(len);
+ if (dst != NULL)
+ {
+ char* p = (char *)src + 1; /* first char after initial quote */
+ char* q = dst;
+ do
+ if (*p == '"') p++;
+ while ((*q++ = *p++) != '\0');
+ }
+ return dst;
+ }
+
+ /* not truncated */
diff --git a/src_plugins/import_hyp/hyp_y.y b/src_plugins/import_hyp/hyp_y.y
new file mode 100644
index 0000000..08c1325
--- /dev/null
+++ b/src_plugins/import_hyp/hyp_y.y
@@ -0,0 +1,831 @@
+/*
+ * read hyperlynx files
+ * Copyright 2012 Koen De Vleeschauwer.
+ *
+ * This file is part of pcb-rnd.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+%code requires {
+#include "parser.h"
+}
+
+%error-verbose
+%debug
+%defines "hyp_y.h"
+%define api.prefix {hyy}
+
+%union {
+ int boolval;
+ int intval;
+ double floatval;
+ char* strval;
+}
+
+%{
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+void hyyerror(const char *);
+
+/* HYYPRINT and hyyprint print values of the tokens when debugging is switched on */
+void hyyprint(FILE *, int, HYYSTYPE);
+#define HYYPRINT(file, type, value) hyyprint (file, type, value)
+
+/* clear parse_param struct at beginning of new record */
+void new_record();
+
+/* struct to pass to calling class */
+parse_param h;
+
+%}
+
+/*
+ * Hyperlynx keywords
+ */
+
+ /* Punctuation: { } ( ) = , */
+
+ /* Sections */
+
+%token H_BOARD_FILE H_VERSION H_DATA_MODE H_UNITS H_PLANE_SEP
+%token H_BOARD H_STACKUP H_DEVICES H_SUPPLIES
+%token H_PAD H_PADSTACK H_NET H_NET_CLASS H_END H_KEY
+
+ /* Keywords */
+
+%token H_A H_ARC H_COPPER H_CURVE H_DETAILED H_DIELECTRIC H_ENGLISH H_LENGTH
+%token H_LINE H_METRIC H_N H_OPTIONS H_PERIMETER_ARC H_PERIMETER_SEGMENT H_PIN
+%token H_PLANE H_POLYGON H_POLYLINE H_POLYVOID H_POUR H_S H_SEG H_SIGNAL
+%token H_SIMPLIFIED H_SIM_BOTH H_SIM_IN H_SIM_OUT H_USEG H_VIA H_WEIGHT
+
+ /* Assignments */
+
+%token H_A1 H_A2 H_BR H_C H_C_QM H_CO_QM H_D H_ER H_F H_ID
+%token H_L H_L1 H_L2 H_LPS H_LT H_M H_NAME
+%token H_P H_PKG H_PR_QM H_PS H_R H_REF H_SX H_SY H_S1 H_S1X H_S1Y H_S2 H_S2X H_S2Y H_T H_TC
+%token H_USE_DIE_FOR_METAL H_V H_V_QM H_VAL H_W H_X H_X1 H_X2
+%token H_XC H_Y H_Y1 H_Y2 H_YC H_Z H_ZL H_ZLEN H_ZW
+
+ /* Booleans */
+
+%token H_YES H_NO
+
+%token <boolval> H_BOOL
+%token <intval> H_POSINT
+%token <floatval> H_FLOAT
+%token <strval> H_STRING
+
+%start hyp_file
+
+%%
+
+/*
+ * Note:
+ * Use left recursion when parsing board perimeter and nets.
+ * When using left recursion cpu time is linear with board size.
+ * When using right recursion we run out of memory on large boards.
+ * (Typical error message: line xxx: memory exhausted at 'yyy' )
+ */
+
+ /*
+ hyperlynx file sections:
+
+ board_file
+ version
+ data_mode*
+ units
+ plane_sep*
+ board*
+ stackup*
+ devices
+ supplies*
+ padstack*
+ net
+ net_class*
+ end
+
+ * = optional section
+
+ */
+
+hyp_file
+ : hyp_file hyp_section
+ | hyp_section ;
+
+hyp_section
+ : board_file
+ | version
+ | data_mode
+ | units
+ | plane_sep
+ | board
+ | stackup
+ | devices
+ | supplies
+ | padstack
+ | net
+ | netclass
+ | end
+ | key
+ | '{' error '}' ;
+
+ /* board_file */
+
+board_file
+ : '{' H_BOARD_FILE { if (exec_board_file(&h)) YYERROR; } '}' ;
+
+ /* version */
+
+version
+ : '{' H_VERSION '=' H_FLOAT { h.vers = yylval.floatval; } '}' { if (exec_version(&h)) YYERROR; } ;
+
+ /* data_mode */
+
+data_mode
+ : '{' H_DATA_MODE '=' mode '}' { if (exec_data_mode(&h)) YYERROR; };
+
+mode
+ : H_SIMPLIFIED { h.detailed = pcb_false; }
+ | H_DETAILED { h.detailed = pcb_true; } ;
+
+ /* units */
+
+units
+ : '{' H_UNITS '=' unit_system metal_thickness_unit '}' { if (exec_units(&h)) YYERROR; } ;
+
+unit_system
+ : H_ENGLISH { h.unit_system_english = pcb_true; }
+ | H_METRIC { h.unit_system_english = pcb_false; };
+
+metal_thickness_unit
+ : H_WEIGHT { h.metal_thickness_weight = pcb_true; }
+ | H_LENGTH { h.metal_thickness_weight = pcb_false; } ;
+
+ /* plane_sep */
+plane_sep
+ : '{' H_PLANE_SEP '=' H_FLOAT { h.default_plane_separation = yylval.floatval; } '}' { if (exec_plane_sep(&h)) YYERROR; } ;
+
+ /* board */
+
+board
+ : '{' H_BOARD board_param_list '}'
+ | '{' H_BOARD '}' ;
+
+board_param_list
+ : board_param_list board_param_list_item
+ | board_param_list_item ;
+
+board_param_list_item
+ : '(' board_param ')'
+ | '(' board_param { hyyerror("warning: missing ')'"); }
+ ;
+
+board_param
+ : perimeter_segment
+ | perimeter_arc
+ | board_attribute
+ | error ;
+
+perimeter_segment
+ : H_PERIMETER_SEGMENT coord_line { if (exec_perimeter_segment(&h)) YYERROR; } ;
+
+perimeter_arc
+ : H_PERIMETER_ARC coord_arc { if (exec_perimeter_arc(&h)) YYERROR; } ;
+
+board_attribute
+ : H_A H_N '=' H_STRING { h.name = yylval.strval; } H_V '=' H_STRING { h.value = yylval.strval; } { if (exec_board_attribute(&h)) YYERROR; } ;
+
+ /* stackup */
+
+stackup
+ : '{' H_STACKUP stackup_paramlist '}' ;
+
+stackup_paramlist
+ : stackup_paramlist stackup_param
+ | stackup_param ;
+
+stackup_param
+ : options
+ | signal
+ | dielectric
+ | plane
+ | '(' error ')' ;
+
+options
+ : '(' H_OPTIONS options_params { if (exec_options(&h)) YYERROR; } ;
+
+options_params
+ : H_USE_DIE_FOR_METAL '=' H_BOOL { h.use_die_for_metal = yylval.boolval; } ')'
+ | ')'
+ ;
+
+signal
+ : '(' H_SIGNAL { new_record(); } signal_paramlist ')' { if (exec_signal(&h)) YYERROR; } ;
+
+signal_paramlist
+ : signal_paramlist signal_param
+ | signal_param ;
+
+signal_param
+ : thickness
+ | plating_thickness
+ | H_C '=' H_FLOAT { h.bulk_resistivity = yylval.floatval; h.bulk_resistivity_set = pcb_true; }
+ | bulk_resistivity
+ | temperature_coefficient
+ | epsilon_r
+ | loss_tangent
+ | layer_name
+ | material_name
+ | plane_separation ;
+
+dielectric
+ : '(' H_DIELECTRIC { new_record(); } dielectric_paramlist ')' { if (exec_dielectric(&h)) YYERROR; } ;
+
+dielectric_paramlist
+ : dielectric_paramlist dielectric_param
+ | dielectric_param ;
+
+dielectric_param
+ : thickness
+ | H_C '=' H_FLOAT { h.epsilon_r = yylval.floatval; h.epsilon_r_set = pcb_true; }
+ | epsilon_r
+ | loss_tangent
+ | conformal
+ | prepreg
+ | layer_name
+ | material_name
+ ;
+
+plane
+ : '(' H_PLANE { new_record(); } plane_paramlist ')' { if (exec_plane(&h)) YYERROR; } ;
+
+plane_paramlist
+ : plane_paramlist plane_param
+ | plane_param ;
+
+plane_param
+ : thickness
+ | H_C '=' H_FLOAT { h.bulk_resistivity = yylval.floatval; h.bulk_resistivity_set = pcb_true; }
+ | bulk_resistivity
+ | temperature_coefficient
+ | epsilon_r
+ | loss_tangent
+ | layer_name
+ | material_name
+ | plane_separation ;
+
+thickness
+ : H_T '=' H_FLOAT { h.thickness = yylval.floatval; h.thickness_set = pcb_true; }
+
+plating_thickness
+ : H_P '=' H_FLOAT { h.plating_thickness = yylval.floatval; h.plating_thickness_set = pcb_true; }
+
+bulk_resistivity
+ : H_BR '=' H_FLOAT { h.bulk_resistivity = yylval.floatval; h.bulk_resistivity_set = pcb_true; }
+
+temperature_coefficient
+ : H_TC '=' H_FLOAT { h.temperature_coefficient = yylval.floatval; h.temperature_coefficient_set = pcb_true; }
+
+epsilon_r
+ : H_ER '=' H_FLOAT { h.epsilon_r = yylval.floatval; h.epsilon_r_set = pcb_true; }
+
+loss_tangent
+ : H_LT '=' H_FLOAT { h.loss_tangent = yylval.floatval; h.loss_tangent_set = pcb_true; }
+
+layer_name
+ : H_L '=' H_STRING { h.layer_name = yylval.strval; h.layer_name_set = pcb_true; }
+
+material_name
+ : H_M '=' H_STRING { h.material_name = yylval.strval; h.material_name_set = pcb_true; }
+
+plane_separation
+ : H_PS '=' H_FLOAT { h.plane_separation = yylval.floatval; h.plane_separation_set = pcb_true; }
+
+conformal
+ : H_CO_QM '=' H_BOOL { h.conformal = yylval.boolval; h.conformal_set = pcb_true; }
+
+prepreg
+ : H_PR_QM '=' H_BOOL { h.prepreg = yylval.boolval; h.prepreg_set = pcb_true; }
+
+ /* devices */
+
+devices
+ : '{' H_DEVICES device_list '}'
+ | '{' H_DEVICES '}' ;
+
+device_list
+ : device_list device
+ | device ;
+
+device
+ : '(' { new_record(); } H_STRING { h.device_type = yylval.strval; } H_REF '=' H_STRING { h.ref = yylval.strval; } device_paramlist ')' { if (exec_devices(&h)) YYERROR; }
+ | '(' error ')' ;
+
+device_paramlist
+ : name device_value
+ | device_value
+ ;
+
+device_value
+ : value device_layer
+ | device_layer
+ ;
+
+device_layer
+ : layer_name package
+ | layer_name
+ ;
+
+name
+ : H_NAME '=' H_STRING { h.name = yylval.strval; h.name_set = pcb_true; } ;
+
+value
+ : value_float
+ | value_string
+ ;
+
+value_float
+ : H_VAL '=' H_FLOAT { h.value_float = yylval.floatval; h.value_float_set = pcb_true; } ;
+
+value_string
+ : H_VAL '=' H_STRING { h.value_string = yylval.strval; h.value_string_set = pcb_true; } ;
+
+package
+ : H_PKG '=' H_STRING { h.package = yylval.strval; h.package_set = pcb_true; } ;
+
+ /* supplies */
+
+supplies
+ : '{' H_SUPPLIES supply_list '}' ;
+
+supply_list
+ : supply_list supply
+ | supply ;
+
+supply
+ : '(' H_S name value_float voltage_spec conversion ')' { if (exec_supplies(&h)) YYERROR; }
+ | '(' error ')' ;
+
+voltage_spec
+ : H_V_QM '=' H_BOOL { h.voltage_specified = yylval.boolval; } ;
+
+conversion
+ : H_C_QM '=' H_BOOL { h.conversion = yylval.boolval; }
+
+ /* padstack */
+
+padstack
+ : '{' H_PADSTACK { new_record(); } '=' H_STRING { h.padstack_name = yylval.strval; h.padstack_name_set = pcb_true; } drill_size '}' { if (exec_padstack_end(&h)) YYERROR; } ;
+
+drill_size
+ : ',' H_FLOAT { h.drill_size = yylval.floatval; h.drill_size_set = pcb_true; } padstack_list
+ | ',' padstack_list ;
+ | padstack_list ;
+
+padstack_list
+ : padstack_list padstack_def
+ | padstack_def ;
+
+padstack_def
+ : '(' H_STRING { h.layer_name = yylval.strval; h.layer_name_set = pcb_true; } ',' pad_shape pad_coord pad_type { if (exec_padstack_element(&h)) YYERROR; new_record(); }
+ | '(' error ')' ;
+
+pad_shape
+ : H_FLOAT { h.pad_shape = yylval.floatval; } ','
+ | ',' { h.pad_shape = -1; } /* Workaround: Altium sometimes prints an empty pad shape */
+ ;
+
+pad_coord
+ : H_FLOAT { h.pad_sx = yylval.floatval; } ',' H_FLOAT { h.pad_sy = yylval.floatval; } ',' H_FLOAT { h.pad_angle = yylval.floatval; }
+
+pad_type
+ : ')'
+ | ',' H_M ')' { h.pad_type = PAD_TYPE_METAL; h.pad_type_set = pcb_true; }
+ | ',' H_A ')' { h.pad_type = PAD_TYPE_ANTIPAD; h.pad_type_set = pcb_true; }
+ | ',' H_FLOAT { h.thermal_clear_shape = yylval.floatval; }
+ ',' H_FLOAT { h.thermal_clear_sx = yylval.floatval; }
+ ',' H_FLOAT { h.thermal_clear_sy = yylval.floatval; }
+ ',' H_FLOAT { h.thermal_clear_angle = yylval.floatval; }
+ ',' H_T ')' { h.pad_type = PAD_TYPE_THERMAL_RELIEF; h.pad_type_set = pcb_true; }
+ ;
+
+ /* net */
+
+net
+ : '{' H_NET '=' H_STRING { h.net_name = yylval.strval; if (exec_net(&h)) YYERROR; } net_separation ;
+
+net_separation
+ : plane_separation { if (exec_net_plane_separation(&h)) YYERROR; } net_copper
+ | net_copper
+
+net_copper
+ : net_subrecord_list '}'
+ | { hyyerror("warning: empty net"); } '}'
+ ;
+
+net_subrecord_list
+ : net_subrecord_list net_subrecord
+ | net_subrecord ;
+
+net_subrecord
+ : seg
+ | arc
+ | via
+ | pin
+ | pad
+ | useg
+ | polygon
+ | polyvoid
+ | polyline
+ | net_attribute
+ | '(' error ')'
+ | '{' error '}'
+ ;
+
+seg
+ : '(' H_SEG { new_record(); } coord_line width layer_name ps_lps_param { if (exec_seg(&h)) YYERROR; } ;
+
+arc
+ : '(' H_ARC { new_record(); } coord_arc width layer_name ps_lps_param { if (exec_arc(&h)) YYERROR; } ;
+
+ps_lps_param
+ : plane_separation lps_param
+ | lps_param
+ ;
+
+lps_param
+ : left_plane_separation ')'
+ | ')'
+ ;
+
+width
+ : H_W '=' H_FLOAT { h.width = yylval.floatval; h.width_set = pcb_true; } ;
+
+left_plane_separation
+ : H_LPS '=' H_FLOAT { h.left_plane_separation = yylval.floatval; h.left_plane_separation_set = pcb_true; } ;
+
+via
+ : '(' H_VIA { new_record(); } coord_point via_new_or_old_style
+ ;
+
+via_new_or_old_style
+ : via_new_style
+ | via_old_style
+ ;
+
+via_new_style
+ : via_new_style_l1_param { if (exec_via(&h)) YYERROR; } ;
+
+via_new_style_l1_param
+ : layer1_name via_new_style_l2_param
+ | via_new_style_l2_param
+ ;
+
+via_new_style_l2_param
+ : layer2_name via_new_style_padstack_param
+ | via_new_style_padstack_param
+ ;
+
+via_new_style_padstack_param
+ : padstack_name ')'
+ ;
+
+padstack_name
+ : H_P '=' H_STRING { h.padstack_name = yylval.strval; h.padstack_name_set = pcb_true; } ;
+
+layer1_name
+ : H_L1 '=' H_STRING { h.layer1_name = yylval.strval; h.layer1_name_set = pcb_true; } ;
+
+layer2_name
+ : H_L2 '=' H_STRING { h.layer2_name = yylval.strval; h.layer2_name_set = pcb_true; } ;
+
+via_old_style
+ : H_D '=' H_FLOAT { h.drill_size = yylval.floatval; } /* deprecated hyperlynx v1.x VIA format */
+ layer1_name
+ layer2_name
+ H_S1 '=' H_STRING { h.pad1_shape = yylval.strval; }
+ H_S1X '=' H_FLOAT { h.pad1_sx = yylval.floatval; }
+ H_S1Y '=' H_FLOAT { h.pad1_sy = yylval.floatval; }
+ H_A1 '=' H_FLOAT { h.pad1_angle = yylval.floatval; }
+ H_S2 '=' H_STRING { h.pad2_shape = yylval.strval; }
+ H_S2X '=' H_FLOAT { h.pad2_sx = yylval.floatval; }
+ H_S2Y '=' H_FLOAT { h.pad2_sy = yylval.floatval; }
+ H_A2 '=' H_FLOAT { h.pad2_angle = yylval.floatval; }
+ ')' { if (exec_via_v1(&h)) YYERROR; } ;
+ ;
+
+pin
+ : '(' H_PIN { new_record(); } coord_point pin_reference pin_param { if (exec_pin(&h)) YYERROR; } ;
+
+pin_param
+ : padstack_name pin_function_param
+ | pin_function_param
+ ;
+
+pin_function_param
+ : pin_function ')'
+ | ')'
+ ;
+
+pin_reference
+ : H_R '=' H_STRING { h.pin_reference = yylval.strval; h.pin_reference_set = pcb_true; } ;
+
+pin_function
+ : H_F '=' H_SIM_OUT { h.pin_function = PIN_SIM_OUT; h.pin_function_set = pcb_true; }
+ | H_F '=' H_SIM_IN { h.pin_function = PIN_SIM_IN; h.pin_function_set = pcb_true; }
+ | H_F '=' H_SIM_BOTH { h.pin_function = PIN_SIM_BOTH; h.pin_function_set = pcb_true; }
+ ;
+
+pad
+ : '(' H_PAD { new_record(); } /* deprecated hyperlynx v1.x only */
+ coord_point
+ layer_name
+ H_S '=' H_STRING { h.pad1_shape = yylval.strval; }
+ H_SX '=' H_FLOAT { h.pad1_sx = yylval.floatval; }
+ H_SY '=' H_FLOAT { h.pad1_sy = yylval.floatval; }
+ H_A '=' H_FLOAT { h.pad1_angle = yylval.floatval; }
+ ')' { if (exec_pad(&h)) YYERROR; } ;
+ ;
+
+useg
+ : '(' H_USEG { new_record(); } coord_point1 layer1_name coord_point2 layer2_name useg_param { if (exec_useg(&h)) YYERROR; } ;
+
+useg_param
+ : useg_stackup
+ | useg_impedance
+ ;
+
+useg_stackup
+ : H_ZL '=' H_STRING { h.zlayer_name = yylval.strval; h.zlayer_name_set = pcb_true; }
+ H_ZW '=' H_FLOAT { h.width = yylval.floatval; }
+ H_ZLEN '=' H_FLOAT { h.length = yylval.floatval; }
+ ')'
+ ;
+
+useg_impedance
+ : H_Z '=' H_FLOAT { h.impedance = yylval.floatval; h.impedance_set = pcb_true; }
+ H_D '=' H_FLOAT { h.delay = yylval.floatval; }
+ useg_resistance;
+
+useg_resistance
+ : H_R '=' H_FLOAT { h.resistance = yylval.floatval; h.resistance_set = pcb_true;}
+ ')'
+ | ')'
+ ;
+
+polygon
+ : '{' H_POLYGON { new_record(); } polygon_param_list coord_point { if (exec_polygon_begin(&h)) YYERROR; }
+ lines_and_curves '}' { if (exec_polygon_end(&h)) YYERROR; } ;
+
+polygon_param_list
+ : polygon_param_list polygon_param
+ | polygon_param
+ ;
+
+polygon_param
+ : layer_name
+ | width
+ | polygon_type
+ | polygon_id
+ ;
+
+polygon_id
+ : H_ID '=' H_POSINT { h.id = yylval.intval; h.id_set = pcb_true; } /* polygon id is a non-negative integer */
+ ;
+
+polygon_type
+ : H_T '=' H_POUR { h.polygon_type = POLYGON_TYPE_POUR; h.polygon_type_set = pcb_true; }
+ | H_T '=' H_PLANE { h.polygon_type = POLYGON_TYPE_PLANE; h.polygon_type_set = pcb_true; }
+ | H_T '=' H_COPPER { h.polygon_type = POLYGON_TYPE_COPPER; h.polygon_type_set = pcb_true; }
+ ;
+
+polyvoid
+ : '{' H_POLYVOID { new_record(); } polygon_id coord_point { if (exec_polyvoid_begin(&h)) YYERROR; }
+ lines_and_curves '}' { if (exec_polyvoid_end(&h)) YYERROR; } ;
+
+polyline
+ : '{' H_POLYLINE { new_record(); } polygon_param_list coord_point { if (exec_polyline_begin(&h)) YYERROR; }
+ lines_and_curves '}' { if (exec_polyline_end(&h)) YYERROR; } ;
+
+lines_and_curves
+ : lines_and_curves line_or_curve
+ | line_or_curve
+ ;
+
+line_or_curve
+ : line
+ | curve
+ | '(' error ')'
+ ;
+
+line
+ : '(' H_LINE { new_record(); } coord_point ')' { if (exec_line(&h)) YYERROR; } ;
+
+curve
+ : '(' H_CURVE { new_record(); } coord_arc ')' { if (exec_curve(&h)) YYERROR; } ;
+
+net_attribute
+ : '(' H_A H_N '=' H_STRING { h.name = yylval.strval; } H_V '=' H_STRING { h.value = yylval.strval; } ')' { if (exec_net_attribute(&h)) YYERROR; } ;
+
+ /* net class */
+
+netclass
+ : '{' H_NET_CLASS '=' H_STRING { h.net_class_name = yylval.strval; if (exec_net_class(&h)) YYERROR; } netclass_subrecords ;
+
+netclass_subrecords
+ : netclass_paramlist '}'
+ | '}'
+ ;
+
+netclass_paramlist
+ : netclass_paramlist netclass_param
+ | netclass_param
+ ;
+
+netclass_param
+ : netclass_attribute
+ | net_name
+ | '(' error ')'
+ ;
+
+net_name
+ : '(' H_N H_N '=' H_STRING { h.net_name = yylval.strval; } ')' { if (exec_net_class_element(&h)) YYERROR; } ;
+
+netclass_attribute
+ : '(' H_A H_N '=' H_STRING { h.name = yylval.strval; } H_V '=' H_STRING { h.value = yylval.strval; } ')' { if (exec_net_class_attribute(&h)) YYERROR; } ;
+
+ /* end */
+
+end
+ : '{' H_END '}' { if (exec_end(&h)) YYERROR; } ;
+
+ /* key */
+
+key
+ : '{' H_KEY '=' H_STRING { h.key = yylval.strval; } '}' { if (exec_key(&h)) YYERROR; } ;
+
+ /* coordinates */
+
+coord_point
+ : H_X '=' H_FLOAT { h.x = yylval.floatval; } H_Y '=' H_FLOAT { h.y = yylval.floatval; } ;
+
+coord_point1
+ : H_X1 '=' H_FLOAT { h.x1 = yylval.floatval; } H_Y1 '=' H_FLOAT { h.y1 = yylval.floatval; } ;
+
+coord_point2
+ : H_X2 '=' H_FLOAT { h.x2 = yylval.floatval; } H_Y2 '=' H_FLOAT { h.y2 = yylval.floatval; } ;
+
+coord_line
+ : coord_point1 coord_point2 ;
+
+coord_arc
+ : coord_line H_XC '=' H_FLOAT { h.xc = yylval.floatval; } H_YC '=' H_FLOAT { h.yc = yylval.floatval; } H_R '=' H_FLOAT { h.r = yylval.floatval; } ;
+
+%%
+
+/*
+ * Supporting C routines
+ */
+
+void hyyerror(const char *msg)
+{
+ /* log pcb-rnd message */
+ hyp_error(msg);
+}
+
+void hyyprint(FILE *file, int type, YYSTYPE value)
+{
+ if (type == H_STRING)
+ fprintf (file, "%s", value.strval);
+ else if (type == H_FLOAT)
+ fprintf (file, "%g", value.floatval);
+ else if (type == H_BOOL)
+ fprintf (file, "%i", value.boolval);
+ return;
+}
+
+/*
+ * reset parse_param struct at beginning of record
+ */
+
+void new_record()
+{
+ h.vers = 0;
+ h.detailed = pcb_false;
+ h.unit_system_english = pcb_false;
+ h.metal_thickness_weight = pcb_false;
+ h.default_plane_separation = 0;
+ h.use_die_for_metal = pcb_false;
+ h.bulk_resistivity = 0;
+ h.conformal = pcb_false;
+ h.epsilon_r = 0;
+ h.layer_name = NULL;/* XXX */
+ h.loss_tangent = 0;
+ h.material_name = NULL;/* XXX */
+ h.plane_separation = 0;
+ h.plating_thickness = 0;
+ h.prepreg = pcb_false;
+ h.temperature_coefficient = 0;
+ h.thickness = 0;
+ h.bulk_resistivity_set = pcb_false;
+ h.conformal_set = pcb_false;
+ h.epsilon_r_set = pcb_false;
+ h.layer_name_set = pcb_false;
+ h.loss_tangent_set = pcb_false;
+ h.material_name_set = pcb_false;
+ h.plane_separation_set = pcb_false;
+ h.plating_thickness_set = pcb_false;
+ h.prepreg_set = pcb_false;
+ h.temperature_coefficient_set = pcb_false;
+ h.thickness_set = pcb_false;
+ h.device_type = NULL;/* XXX */
+ h.ref = NULL;/* XXX */
+ h.value_float = 0;
+ h.value_string = NULL;/* XXX */
+ h.package = NULL;/* XXX */
+ h.name_set = pcb_false;
+ h.value_float_set = pcb_false;
+ h.value_string_set = pcb_false;
+ h.package_set = pcb_false;
+ h.voltage_specified = pcb_false;
+ h.conversion = pcb_false;
+ h.padstack_name = NULL;/* XXX */
+ h.drill_size = 0;
+ h.pad_shape = 0;
+ h.pad_sx = 0;
+ h.pad_sy = 0;
+ h.pad_angle = 0;
+ h.thermal_clear_shape = 0;
+ h.thermal_clear_sx = 0;
+ h.thermal_clear_sy = 0;
+ h.thermal_clear_angle = 0;
+ h.pad_type = PAD_TYPE_METAL;
+ h.padstack_name_set = pcb_false;
+ h.drill_size_set = pcb_false;
+ h.pad_type_set = pcb_false;
+ h.width = 0;
+ h.left_plane_separation = 0;
+ h.width_set = pcb_false;
+ h.left_plane_separation_set = pcb_false;
+ h.layer1_name = NULL;/* XXX */
+ h.layer1_name_set = pcb_false;
+ h.layer2_name = NULL;/* XXX */
+ h.layer2_name_set = pcb_false;
+ h.pad1_shape = NULL;/* XXX */
+ h.pad1_sx = 0;
+ h.pad1_sy = 0;
+ h.pad1_angle = 0;
+ h.pad2_shape = NULL;/* XXX */
+ h.pad2_sx = 0;
+ h.pad2_sy = 0;
+ h.pad2_angle = 0;
+ h.pin_reference = NULL;/* XXX */
+ h.pin_reference_set = pcb_false;
+ h.pin_function = PIN_SIM_BOTH;
+ h.pin_function_set = pcb_false;
+ h.zlayer_name = NULL;/* XXX */
+ h.zlayer_name_set = pcb_false;
+ h.length = 0;
+ h.impedance = 0;
+ h.impedance_set = pcb_false;
+ h.delay = 0;
+ h.resistance = 0;
+ h.resistance_set = pcb_false;
+ h.id = -1;
+ h.id_set = pcb_false;
+ h.polygon_type = POLYGON_TYPE_PLANE;
+ h.polygon_type_set = pcb_false;
+ h.net_class_name = NULL;/* XXX */
+ h.net_name = NULL;/* XXX */
+ h.key = NULL;/* XXX */
+ h.name = NULL;/* XXX */
+ h.value = NULL;/* XXX */
+ h.x = 0;
+ h.y = 0;
+ h.x1 = 0;
+ h.y1 = 0;
+ h.x2 = 0;
+ h.y2 = 0;
+ h.xc = 0;
+ h.yc = 0;
+ h.r = 0;
+
+ return;
+}
+
+/* not truncated */
diff --git a/src_plugins/import_hyp/import_hyp.c b/src_plugins/import_hyp/import_hyp.c
new file mode 100644
index 0000000..5485d8c
--- /dev/null
+++ b/src_plugins/import_hyp/import_hyp.c
@@ -0,0 +1,103 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ *
+ * hyperlynx .hyp importer, plugin entry
+ * Copyright (C) 2016 Tibor 'Igor2' Palinkas
+ *
+ * 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.
+ *
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "action_helper.h"
+#include "compat_nls.h"
+#include "hid.h"
+#include "hid_draw_helpers.h"
+#include "hid_nogui.h"
+#include "hid_actions.h"
+#include "hid_init.h"
+#include "hid_attrib.h"
+#include "hid_helper.h"
+#include "plugins.h"
+
+#warning TODO: rename config.h VERSION to PCB_VERSION
+#undef VERSION
+
+#include "parser.h"
+#include "board.h"
+
+static const char *hyp_cookie = "hyp importer";
+
+static const char load_hyp_syntax[] = "LoadhypFrom(filename[, \"debug\"]...)";
+
+static const char load_hyp_help[] = "Loads the specified Hyperlynx file.";
+
+int pcb_act_LoadhypFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
+{
+ const char *fname = NULL;
+ int debug = 0;
+ int i = 0;
+
+ fname = argc ? argv[0] : 0;
+
+ if ((fname == NULL) || (*fname == '\0')) {
+ fname = pcb_gui->fileselect(_("Load .hyp file..."),
+ _("Picks a hyperlynx file to load.\n"),
+ "default.hyp", ".hyp", "hyp", HID_FILESELECT_READ);
+ }
+
+ if (fname == NULL)
+ PCB_AFAIL(load_hyp);
+
+
+ /* debug level */
+ for (i = 0; i < argc; i++)
+ debug += (strcmp(argv[i], "debug") == 0);
+
+ if (debug > 0)
+ pcb_message(PCB_MSG_INFO, _("Importing Hyperlynx file '%s', debug level %d\n"), fname, debug);
+
+ if (hyp_parse(PCB->Data, fname, debug))
+ PCB_AFAIL(load_hyp);
+
+ return 0;
+}
+
+pcb_hid_action_t hyp_action_list[] = {
+ {"LoadhypFrom", 0, pcb_act_LoadhypFrom, load_hyp_help, load_hyp_syntax}
+};
+
+PCB_REGISTER_ACTIONS(hyp_action_list, hyp_cookie)
+
+static void hid_hyp_uninit()
+{
+
+}
+
+#include "dolists.h"
+pcb_uninit_t hid_import_hyp_init()
+{
+#warning TODO: rather register an importer than an action
+ PCB_REGISTER_ACTIONS(hyp_action_list, hyp_cookie)
+ return hid_hyp_uninit;
+}
+
+/* not truncated */
diff --git a/src_plugins/import_hyp/parser.c b/src_plugins/import_hyp/parser.c
new file mode 100644
index 0000000..3f2ecd8
--- /dev/null
+++ b/src_plugins/import_hyp/parser.c
@@ -0,0 +1,669 @@
+/*
+ * read hyperlynx files
+ * Copyright 2016 Koen De Vleeschauwer.
+ *
+ * This file is part of pcb-rnd.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "parser.h"
+#include "hyp_l.h"
+#include "hyp_y.h"
+#include "error.h"
+#include "pcb-printf.h"
+#include "obj_all.h"
+#include "flag_str.h"
+#include "board.h"
+#include "layer.h"
+#include "data.h"
+
+/*
+ * the board is shared between all routines.
+ */
+pcb_data_t *hyp_dest;
+
+/*
+ * board outline is doubly linked list of arcs and line segments.
+ */
+
+typedef struct outline_s {
+ pcb_coord_t x1;
+ pcb_coord_t y1;
+ pcb_coord_t x2;
+ pcb_coord_t y2;
+ pcb_coord_t xc;
+ pcb_coord_t yc;
+ pcb_coord_t r;
+ pcb_bool_t is_arc; /* arc or line */
+ pcb_bool_t used; /* already included in outline */
+ struct outline_s *next;
+ } outline_t;
+
+outline_t *outline_head;
+outline_t *outline_tail;
+
+void hyp_set_origin(); /* set origin so all coordinates are positive */
+void hyp_perimeter(); /* add board outline to pcb */
+
+int hyp_debug; /* logging on/off switch */
+
+/* Physical constants */
+double inches; /* inches to m */
+double copper_imperial_weight; /* metal thickness in ounces/ft2 */
+double copper_metric_weight; /* metal thickness in grams/cm2 */
+double copper_bulk_resistivity; /* metal resistivity in ohm meter */
+double copper_temperature_coefficient; /* temperature coefficient of bulk resistivity */
+double fr4_epsilon_r; /* dielectric constant of substrate */
+double fr4_loss_tangent; /* loss tangent of substrate */
+double conformal_epsilon_r; /* dielectric constant of conformal coating */
+
+/* Hyperlynx UNIT and OPTIONS */
+double unit; /* conversion factor: pcb length units to meters */
+double metal_thickness_unit; /* conversion factor: metal thickness to meters */
+
+pcb_bool use_die_for_metal; /* use dielectric constant and loss tangent of dielectric for metal layers */
+pcb_coord_t plane_separation; /* distance between PLANE polygon and copper of different nets; -1 if not set */
+
+/* origin. Chosen so all coordinates are positive. */
+pcb_coord_t origin_x;
+pcb_coord_t origin_y;
+
+/*
+ * Conversion from hyperlynx to pcb_coord_t - igor2
+ */
+
+/* meter to pcb_coord_t */
+
+pcb_coord_t inline m2coord(double m)
+{
+ return ((pcb_coord_t) PCB_MM_TO_COORD(1000.0 * m));
+}
+
+/* xy coordinates to pcb_coord_t, without offset */
+
+pcb_coord_t inline xy2coord(double f)
+{
+ return (m2coord(unit * f));
+}
+
+
+/* x coordinates to pcb_coord_t, with offset */
+
+pcb_coord_t inline x2coord(double f)
+{
+ return (m2coord(unit * f) - origin_x);
+}
+
+/* y coordinates to pcb_coord_t, with offset */
+
+pcb_coord_t inline y2coord(double f)
+{
+ return (m2coord(unit * f) - origin_y);
+}
+
+/* z coordinates to pcb_coord_t. No offset needed. */
+
+pcb_coord_t inline z2coord(double f)
+{
+ return (m2coord(metal_thickness_unit * f));
+}
+
+/*
+ * initialize physical constants
+ */
+
+void hyp_init(void)
+{
+ unit = 1;
+ metal_thickness_unit = 1;
+ use_die_for_metal = pcb_false;
+
+ inches = 0.0254; /* inches to m */
+ copper_imperial_weight = 1.341; /* metal thickness in ounces/ft2. 1 oz/ft2 copper = 1.341 mil */
+ copper_metric_weight = 0.1116; /* metal thickness in grams/cm2. 1 gr/cm2 copper = 0.1116 cm */
+ copper_bulk_resistivity = 1.724e-8;
+ copper_temperature_coefficient = 0.00393;
+ fr4_epsilon_r = 4.3;
+ fr4_loss_tangent = 0.020;
+ conformal_epsilon_r = 3.3; /* dielectric constant of conformal layer */
+ plane_separation = -1; /* distance between PLANE polygon and copper of different nets; -1 if not set */
+
+ outline_head = NULL;
+ outline_tail = NULL;
+
+ return;
+}
+
+/*
+ * called by pcb-rnd to load hyperlynx file
+ */
+
+int hyp_parse(pcb_data_t *dest, const char *fname, int debug)
+{
+ int retval;
+
+ hyp_init();
+
+ /* set debug levels */
+ hyyset_debug(debug > 2); /* switch flex logging on */
+ hyydebug = (debug > 1); /* switch bison logging on */
+ hyp_debug = (debug > 0); /* switch hyperlynx logging on */
+
+ /* set shared board */
+ hyp_dest = dest;
+
+ /* set origin */
+ origin_x = 0;
+ origin_y = 0;
+
+ /* parse hyperlynx file */
+ hyyin = fopen(fname, "r");
+ if (hyyin == NULL) return (1);
+ retval = hyyparse();
+ fclose(hyyin);
+
+ /* add board outline last */
+ hyp_perimeter();
+
+ /* clear */
+ hyp_dest = NULL;
+
+ return(retval);
+}
+
+/* print error message */
+void hyp_error(const char *msg)
+{
+ pcb_message(PCB_MSG_DEBUG, "line %d: %s at '%s'\n", hyylineno, msg, hyytext);
+}
+
+/* exec_* routines are called by parser to interpret hyperlynx file */
+
+/*
+ * Hyperlynx 'BOARD_FILE' section.
+ * Hyperlynx file header.
+ */
+
+pcb_bool exec_board_file(parse_param *h)
+{
+ if (hyp_debug) pcb_printf(PCB_MSG_DEBUG, "board\n");
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'VERSION' record.
+ * Specifies version number.
+ * Required record; must be first record of the file.
+ */
+
+pcb_bool exec_version(parse_param *h)
+{
+ if (hyp_debug) pcb_printf("version: vers = %f\n", h->vers);
+
+ if (h->vers < 1.0) pcb_message(PCB_MSG_DEBUG, "warning: version 1.x deprecated\n");
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'DATA_MODE' record.
+ * If DATA_MODE is DETAILED, model can be used for power and signal simulation.
+ * If DATA_MODE is SIMPLIFIED, model can be used for signal simulation only.
+ */
+
+pcb_bool exec_data_mode(parse_param *h)
+{
+ if (hyp_debug) pcb_printf("data_mode: detailed = %i\n", h->detailed);
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'UNITS' record.
+ * Specifies measurement system (english/metric) for the rest of the file.
+ */
+
+pcb_bool exec_units(parse_param *h)
+{
+ if (hyp_debug) pcb_printf("units: unit_system_english = %d metal_thickness_weight = %d\n", h->unit_system_english, h->metal_thickness_weight);
+
+ /* convert everything to meter */
+
+ if (h->unit_system_english) {
+ unit = inches; /* lengths in inches. 1 in = 2.54 cm = 0.0254 m */
+ if (h->metal_thickness_weight)
+ metal_thickness_unit = copper_imperial_weight * unit; /* metal thickness in ounces/ft2. 1 oz/ft2 copper = 1.341 mil */
+ else
+ metal_thickness_unit = unit; /* metal thickness in inches */
+ }
+ else {
+ unit = 0.01; /* lengths in centimeters. 1 cm = 0.01 m */
+ if (h->metal_thickness_weight)
+ metal_thickness_unit = copper_metric_weight * unit; /* metal thickness in grams/cm2. 1 gr/cm2 copper = 0.1116 cm */
+ else
+ metal_thickness_unit = unit; /* metal thickness in centimeters */
+ }
+
+ if (hyp_debug) pcb_printf("units: unit = %f metal_thickness_unit = %f\n", unit, metal_thickness_unit);
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'PLANE_SEP' record.
+ * Defines default trace to plane separation
+ */
+
+pcb_bool exec_plane_sep(parse_param *h)
+{
+ plane_separation = m2coord(h->plane_separation);
+
+ if (hyp_debug) pcb_printf("plane_sep: default_plane_separation = %mm\n", plane_separation);
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'PERIMETER_SEGMENT' subrecord of 'BOARD' record.
+ * Draws linear board outline segment.
+ * Linear segment drawn from (x1, y1) to (x2, y2).
+ */
+
+pcb_bool exec_perimeter_segment(parse_param *h)
+{
+ outline_t *peri_seg;
+
+ peri_seg = malloc(sizeof(outline_t));
+
+ /* convert coordinates */
+ peri_seg->x1 = xy2coord(h->x1);
+ peri_seg->y1 = xy2coord(h->y1);
+ peri_seg->x2 = xy2coord(h->x2);
+ peri_seg->y2 = xy2coord(h->y2);
+ peri_seg->xc = 0;
+ peri_seg->yc = 0;
+ peri_seg->r = 0;
+ peri_seg->is_arc = pcb_false;
+ peri_seg->used = pcb_false;
+ peri_seg->next = NULL;
+
+ if (hyp_debug) pcb_printf("perimeter_segment: x1 = %mm y1 = %mm x2 = %mm y2 = %mm\n", peri_seg->x1, peri_seg->y1, peri_seg->x2, peri_seg->y2);
+
+ /* append at end of doubly linked list */
+ if (outline_tail == NULL) {
+ outline_head = peri_seg;
+ outline_tail = peri_seg;
+ }
+ else {
+ outline_tail->next = peri_seg;
+ outline_tail = peri_seg;
+ }
+
+ /* set origin so all coordinates are positive */
+ hyp_set_origin();
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'PERIMETER_ARC' subrecord of 'BOARD' record.
+ * Draws arc segment of board outline.
+ * Arc drawn counterclockwise from (x1, y1) to (x2, y2) with center (xc, yc) and radius r.
+ */
+
+pcb_bool exec_perimeter_arc(parse_param *h)
+{
+ outline_t *peri_arc;
+
+ peri_arc = malloc(sizeof(outline_t));
+
+ peri_arc->x1 = xy2coord(h->x1);
+ peri_arc->y1 = xy2coord(h->y1);
+ peri_arc->x2 = xy2coord(h->x2);
+ peri_arc->y2 = xy2coord(h->y2);
+ peri_arc->xc = xy2coord(h->xc);
+ peri_arc->yc = xy2coord(h->yc);
+ peri_arc->r = xy2coord(h->r);
+ peri_arc->is_arc = pcb_true;
+ peri_arc->used = pcb_false;
+ peri_arc->next = NULL;
+
+ if (hyp_debug) pcb_printf("perimeter_arc: x1 = %mm y1 = %mm x2 = %mm y2 = %mm xc = %mm yc = %mm r = %mm\n", peri_arc->x1, peri_arc->y1, peri_arc->x2, peri_arc->y2, peri_arc->xc, peri_arc->yc, peri_arc->r);
+
+ /* append at end of doubly linked list */
+ if (outline_tail == NULL) {
+ outline_head = peri_arc;
+ outline_tail = peri_arc;
+ }
+ else {
+ outline_tail->next = peri_arc;
+ outline_tail = peri_arc;
+ }
+
+ /* set origin so all coordinates are positive */
+ hyp_set_origin();
+
+ return 0;
+}
+
+/*
+ * Hyperlynx 'A' attribute subrecord of 'BOARD' record.
+ * Defines board attributes as name/value pairs.
+ */
+
+pcb_bool exec_board_attribute(parse_param *h)
+{
+ if (hyp_debug) pcb_printf("board_attribute: name = %s value = %s\n", h->name, h->value);
+
+ return 0;
+}
+
+/*
+ * add segment to board outline
+ */
+
+void perimeter_segment_add(outline_t *s, pcb_bool_t forward)
+{
+ pcb_layer_t *outline_layer;
+
+ /* get outline layer */
+ int outlineCount = 0;
+ int outlineLayerCount = 0;
+ int *outlineLayers = NULL;
+ /* count outline layers */
+ outlineLayerCount = pcb_layer_group_list(PCB_LYT_OUTLINE, NULL, 0);
+ outlineLayers = malloc(sizeof(int) * outlineLayerCount);
+ outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0);
+ pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount);
+ /* XXX fix: add outline layer if necessary */
+ outline_layer = &(hyp_dest->Layer[outlineLayers[0]]);
+ if (outline_layer == NULL) return;
+
+ /* mark segment as used, so we don't use it twice */
+ s->used = pcb_true;
+
+ /* debugging */
+ if (hyp_debug) {
+ if (forward) pcb_printf("outline: %s from (%mm, %mm) to (%mm, %mm)\n", s->is_arc ? "arc" : "line", s->x1, s->y1, s->x2, s->y2);
+ else pcb_printf("outline: %s from (%mm, %mm) to (%mm, %mm)\n", s->is_arc ? "arc" : "line", s->x2, s->y2, s->x1, s->y1); /* add segment back to front */
+ }
+
+ if (s->is_arc) {
+ if (forward)
+ hyp_arc_new(outline_layer, s->x1, s->y1, s->x2, s->y2, s->xc, s->yc, s->r, s->r, pcb_false, 1, 0, pcb_no_flags());
+ else
+ hyp_arc_new(outline_layer, s->x2, s->y2, s->x1, s->y1, s->xc, s->yc, s->r, s->r, pcb_false, 1, 0, pcb_no_flags());
+ }
+ else
+ pcb_line_new(outline_layer, s->x1, s->y1, s->x2, s->y2, 1, 0, pcb_no_flags());
+
+ return;
+}
+
+/*
+ * Check whether point (end_x, end_y) is connected to point (begin_x, begin_y) via un-used segment s and other un-used segments.
+ */
+
+pcb_bool_t segment_connected(pcb_coord_t begin_x, pcb_coord_t begin_y, pcb_coord_t end_x, pcb_coord_t end_y, outline_t *s)
+{
+ outline_t *i;
+ pcb_bool_t connected;
+
+ connected = (begin_x == end_x) && (begin_y == end_y); /* trivial case */
+
+ if (!connected)
+ {
+ /* recursive descent */
+ s->used = pcb_true;
+
+ for (i = outline_head; i != NULL; i = i->next)
+ {
+ if (i->used) continue;
+ if ((i->x1 == begin_x) && (i->y1 == begin_y))
+ {
+ connected = ((i->x2 == end_x) && (i->y2 == end_y)) || segment_connected(i->x2, i->y2, end_x, end_y, i);
+ if (connected) break;
+ }
+ /* try back-to-front */
+ if ((i->x2 == begin_x) && (i->y2 == begin_y))
+ {
+ connected = ((i->x1 == end_x) && (i->y1 == end_y)) || segment_connected(i->x1, i->y1, end_x, end_y, i);
+ if (connected) break;
+ }
+ }
+
+ s->used = pcb_false;
+ }
+
+ return connected;
+}
+
+/*
+ * Sets (origin_x, origin_y)
+ * Choose origin so that all coordinates are posive.
+ */
+
+void hyp_set_origin()
+{
+ pcb_bool_t first;
+ outline_t *i;
+
+ first = pcb_true;
+ for (i = outline_head; i != NULL; i = i->next) {
+ /* set origin so all coordinates are positive */
+ if ((i->x1 < origin_x) || first) origin_x = i->x1;
+ if ((i->x2 < origin_x) || first) origin_x = i->x2;
+ if ((i->y1 < origin_y) || first) origin_x = i->y1;
+ if ((i->y2 < origin_y) || first) origin_x = i->y2;
+ if (i->is_arc) {
+ if ((i->xc - i->r < origin_x) || first) origin_x = i->xc - i->r;
+ if ((i->yc - i->r < origin_y) || first) origin_y = i->yc - i->r;
+ }
+ first = pcb_false;
+ }
+}
+
+/*
+ * Draw board perimeter.
+ * The first segment is part of the first polygon.
+ * The first polygon of the board perimeter is positive, the rest are holes.
+ * Segments do not necesarily occur in order.
+ */
+
+void hyp_perimeter()
+{
+ pcb_bool_t warn_not_closed;
+ pcb_bool_t segment_found;
+ pcb_bool_t polygon_closed;
+ pcb_coord_t begin_x, begin_y, last_x, last_y;
+ outline_t *i;
+ outline_t *j;
+
+ warn_not_closed = pcb_false;
+
+ /* iterate over perimeter segments and adjust origin */
+ for (i = outline_head; i != NULL; i = i->next) {
+ /* set origin so all coordinates are positive */
+ i->x1 -= origin_x;
+ i->y1 -= origin_y;
+ i->x2 -= origin_x;
+ i->y2 -= origin_y;
+ if (i->is_arc) {
+ i->xc -= origin_x;
+ i->yc -= origin_y;
+ }
+ }
+
+ /* iterate over perimeter polygons */
+ while (pcb_true)
+ {
+
+ /* find first free segment */
+ for (i = outline_head; i != NULL; i = i->next)
+ if (i->used == pcb_false) break;
+
+ /* exit if no segments found */
+ if (i == NULL) break;
+
+ /* first point of polygon (begin_x, begin_y) */
+ begin_x = i->x1;
+ begin_y = i->y1;
+
+ /* last point of polygon (last_x, last_y) */
+ last_x = i->x2;
+ last_y = i->y2;
+
+ /* add segment */
+ perimeter_segment_add(i, pcb_true);
+
+ /* add polygon segments until the polygon is closed */
+ polygon_closed = pcb_false;
+ while (!polygon_closed)
+ {
+
+#undef XXX
+#ifdef XXX
+ pcb_printf("perimeter: last_x = %mm last_y = %mm\n", last_x, last_y);
+ for (i = outline_head; i != NULL; i = i->next)
+ if (!i->used) pcb_printf("perimeter segments available: %s from (%mm, %mm) to (%mm, %mm)\n", i->is_arc ? "arc" : "line", i->x1, i->y1, i->x2, i->y2);
+#endif
+
+ /* find segment to add to current polygon */
+ segment_found = pcb_false;
+
+ /* XXX prefer closed polygon over open polyline */
+
+ for (i = outline_head; i != NULL; i = i->next)
+ {
+ if (i->used) continue;
+
+ if ((last_x == i->x1) && (last_y == i->y1))
+ {
+ if (!segment_connected(i->x2, i->y2, begin_x, begin_y, i)) continue; /* XXX Checkme */
+ /* first point of segment is last point of current edge: add segment to edge */
+ segment_found = pcb_true;
+ perimeter_segment_add(i, pcb_true);
+ last_x = i->x2;
+ last_y = i->y2;
+ }
+ else if ((last_x == i->x2) && (last_y == i->y2))
+ {
+ if (!segment_connected(i->x1, i->y1, begin_x, begin_y, i)) continue; /* XXX Checkme */
+ /* last point of segment is last point of current edge: add segment to edge back to front */
+ segment_found = pcb_true;
+ /* add segment back to front */
+ perimeter_segment_add(i, pcb_false);
+ last_x = i->x1;
+ last_y = i->y1;
+ }
+ if (segment_found) break;
+ }
+ polygon_closed = (begin_x == last_x) && (begin_y == last_y);
+ if (!polygon_closed && !segment_found)
+ break; /* can't find anything suitable */
+ }
+ if (polygon_closed) {
+ if (hyp_debug) pcb_printf("outline: closed\n");
+ }
+ else
+ {
+ if (hyp_debug) pcb_printf("outline: open\n");
+ warn_not_closed = pcb_true;
+ }
+ }
+
+ /* free segment memory */
+ for (i = outline_head; i != NULL; i = j)
+ {
+ j = i->next;
+ free (i);
+ }
+ outline_head = outline_tail = NULL;
+
+ if (warn_not_closed) pcb_message(PCB_MSG_DEBUG, "warning: board outline not closed\n");
+
+ return;
+}
+
+pcb_bool exec_options(parse_param *h){return(0);}
+pcb_bool exec_signal(parse_param *h){return(0);}
+pcb_bool exec_dielectric(parse_param *h){return(0);}
+pcb_bool exec_plane(parse_param *h){return(0);}
+
+pcb_bool exec_devices(parse_param *h){return(0);}
+
+pcb_bool exec_supplies(parse_param *h){return(0);}
+
+pcb_bool exec_padstack_element(parse_param *h){return(0);}
+pcb_bool exec_padstack_end(parse_param *h){return(0);}
+
+pcb_bool exec_net(parse_param *h){return(0);}
+pcb_bool exec_net_plane_separation(parse_param *h){return(0);}
+pcb_bool exec_net_attribute(parse_param *h){return(0);}
+pcb_bool exec_seg(parse_param *h){return(0);}
+pcb_bool exec_arc(parse_param *h){return(0);}
+pcb_bool exec_via(parse_param *h){return(0);}
+pcb_bool exec_via_v1(parse_param *h){return(0);}
+pcb_bool exec_pin(parse_param *h){return(0);}
+pcb_bool exec_pad(parse_param *h){return(0);}
+pcb_bool exec_useg(parse_param *h){return(0);}
+
+pcb_bool exec_polygon_begin(parse_param *h){return(0);}
+pcb_bool exec_polygon_end(parse_param *h){return(0);}
+pcb_bool exec_polyvoid_begin(parse_param *h){return(0);}
+pcb_bool exec_polyvoid_end(parse_param *h){return(0);}
+pcb_bool exec_polyline_begin(parse_param *h){return(0);}
+pcb_bool exec_polyline_end(parse_param *h){return(0);}
+pcb_bool exec_line(parse_param *h){return(0);}
+pcb_bool exec_curve(parse_param *h){return(0);}
+
+pcb_bool exec_net_class(parse_param *h){return(0);}
+pcb_bool exec_net_class_element(parse_param *h){return(0);}
+pcb_bool exec_net_class_attribute(parse_param *h){return(0);}
+
+pcb_bool exec_end(parse_param *h){return(0);}
+pcb_bool exec_key(parse_param *h){return(0);}
+
+/*
+ * Draw arc from (x1, y1) to (x2, y2) with center (xc, yc) and radius r.
+ * Direction of arc is clockwise or counter-clockwise, depending upon value of pcb_bool_t Clockwise.
+ */
+
+pcb_arc_t *hyp_arc_new(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t XC, pcb_coord_t YC, pcb_coord_t Width, pcb_coord_t Height, pcb_bool_t Clockwise, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags)
+{
+ pcb_angle_t start_angle;
+ pcb_angle_t end_angle;
+ pcb_angle_t delta;
+
+ if (Width < 1) {
+ start_angle = 0.0;
+ delta = 360.0; /* XXX !!! */
+ }
+ else {
+ start_angle = 180*atan2(Y1 - YC, X1 - XC)/M_PI;
+ end_angle = 180*atan2(Y2 - YC, X2 - XC)/M_PI;
+ delta = end_angle - start_angle;
+ }
+
+ if (Clockwise && (delta < 0.0)) delta += 360.0;
+ if (!Clockwise && (delta > 0.0)) delta = 360.0 - delta;
+
+ /* for circle width = height = radius? XXX */
+
+ return pcb_arc_new(Layer, XC, YC, Width, Height, start_angle, delta, Thickness, Clearance, Flags);
+}
+
+/* not truncated */
diff --git a/src_plugins/import_hyp/parser.h b/src_plugins/import_hyp/parser.h
new file mode 100644
index 0000000..06bcae0
--- /dev/null
+++ b/src_plugins/import_hyp/parser.h
@@ -0,0 +1,232 @@
+/*
+ * read hyperlynx files
+ * Copyright 2012 Koen De Vleeschauwer.
+ *
+ * This file is part of pcb-rnd.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include <stdio.h>
+#include "pcb_bool.h"
+#include "board.h"
+
+ /*
+ * Parameters passed on by the parser.
+ * All variables added here are initialized in new_record().
+ */
+
+ typedef enum { PAD_TYPE_METAL, PAD_TYPE_ANTIPAD, PAD_TYPE_THERMAL_RELIEF } pad_type_enum;
+
+ typedef enum { PIN_SIM_IN, PIN_SIM_OUT, PIN_SIM_BOTH } pin_function_enum;
+
+ typedef enum { POLYGON_TYPE_POUR, POLYGON_TYPE_PLANE, POLYGON_TYPE_COPPER, POLYGON_TYPE_PAD, POLYGON_TYPE_ANTIPAD } polygon_type_enum;
+
+ typedef struct {
+ double vers; /* version of the hyp file format */
+ pcb_bool detailed; /* data detailed enough for power integrity */
+ pcb_bool unit_system_english; /* english or metric units */
+ pcb_bool metal_thickness_weight; /* copper by weight or by length */
+ double default_plane_separation; /* trace to plane separation */
+
+ /* stackup record */
+ pcb_bool use_die_for_metal; /* dielectric constant and loss tangent of dielectric for metal layers */
+ double bulk_resistivity;
+ pcb_bool conformal;
+ double epsilon_r;
+ char *layer_name;
+ double loss_tangent;
+ char *material_name;
+ double plane_separation;
+ double plating_thickness;
+ pcb_bool prepreg;
+ double temperature_coefficient; /* temperature coefficient of resistivity */
+ double thickness; /* layer thickness */
+
+ /* stackup record flags */
+ pcb_bool bulk_resistivity_set;
+ pcb_bool conformal_set;
+ pcb_bool epsilon_r_set;
+ pcb_bool layer_name_set;
+ pcb_bool loss_tangent_set;
+ pcb_bool material_name_set;
+ pcb_bool plane_separation_set;
+ pcb_bool plating_thickness_set;
+ pcb_bool prepreg_set;
+ pcb_bool temperature_coefficient_set;
+ pcb_bool thickness_set;
+
+ /* device record */
+ char *device_type;
+ char *ref;
+ double value_float;
+ char *value_string;
+ char *package;
+
+ /* device record flags */
+ pcb_bool name_set;
+ pcb_bool value_float_set;
+ pcb_bool value_string_set;
+ pcb_bool package_set;
+
+ /* supplies record */
+ pcb_bool voltage_specified;
+ pcb_bool conversion;
+
+ /* padstack record */
+ char *padstack_name;
+ double drill_size;
+ double pad_shape;
+ double pad_sx;
+ double pad_sy;
+ double pad_angle;
+ double thermal_clear_shape;
+ double thermal_clear_sx;
+ double thermal_clear_sy;
+ double thermal_clear_angle;
+ pad_type_enum pad_type;
+
+ /* padstack record flags */
+ pcb_bool padstack_name_set;
+ pcb_bool drill_size_set;
+ pcb_bool pad_type_set;
+
+ /* net record */
+ double width;
+ double left_plane_separation;
+ pcb_bool width_set;
+ pcb_bool left_plane_separation_set;
+
+ /* via subrecord of net */
+ char *layer1_name;
+ pcb_bool layer1_name_set;
+ char *layer2_name;
+ pcb_bool layer2_name_set;
+ char *pad1_shape;
+ double pad1_sx;
+ double pad1_sy;
+ double pad1_angle;
+ char *pad2_shape;
+ double pad2_sx;
+ double pad2_sy;
+ double pad2_angle;
+
+ /* pin subrecord of net */
+ char *pin_reference;
+ pcb_bool pin_reference_set;
+ pin_function_enum pin_function;
+ pcb_bool pin_function_set;
+
+ /* useg subrecord of net */
+ char *zlayer_name;
+ pcb_bool zlayer_name_set;
+ double length;
+ double impedance;
+ pcb_bool impedance_set;
+ double delay;
+ double resistance;
+ pcb_bool resistance_set;
+
+ /* polygon subrecord of net */
+ int id;
+ pcb_bool id_set;
+ polygon_type_enum polygon_type;
+ pcb_bool polygon_type_set;
+
+ /* net class record */
+ char *net_class_name;
+ char *net_name;
+
+ /* key record */
+ char *key;
+
+ /* Attributes */
+ char *name; /* attribute name */
+ char *value; /* attribute value */
+
+ /* point, line and arc coordinates */
+ double x; /* coordinates point */
+ double y; /* coordinates point */
+ double x1; /* coordinates point 1 */
+ double y1; /* coordinates point 1 */
+ double x2; /* coordinates point 2 */
+ double y2; /* coordinates point 2 */
+ double xc; /* coordinates arc */
+ double yc; /* coordinates arc */
+ double r; /* coordinates arc */
+ } parse_param;
+
+ /* exec_* routines are called by parser to interpret hyperlynx file */
+ pcb_bool exec_board_file(parse_param *h);
+ pcb_bool exec_version(parse_param *h);
+ pcb_bool exec_data_mode(parse_param *h);
+ pcb_bool exec_units(parse_param *h);
+ pcb_bool exec_plane_sep(parse_param *h);
+ pcb_bool exec_perimeter_segment(parse_param *h);
+ pcb_bool exec_perimeter_arc(parse_param *h);
+ pcb_bool exec_board_attribute(parse_param *h);
+
+ pcb_bool exec_options(parse_param *h);
+ pcb_bool exec_signal(parse_param *h);
+ pcb_bool exec_dielectric(parse_param *h);
+ pcb_bool exec_plane(parse_param *h);
+
+ pcb_bool exec_devices(parse_param *h);
+
+ pcb_bool exec_supplies(parse_param *h);
+
+ pcb_bool exec_padstack_element(parse_param *h);
+ pcb_bool exec_padstack_end(parse_param *h);
+
+ pcb_bool exec_net(parse_param *h);
+ pcb_bool exec_net_plane_separation(parse_param *h);
+ pcb_bool exec_net_attribute(parse_param *h);
+ pcb_bool exec_seg(parse_param *h);
+ pcb_bool exec_arc(parse_param *h);
+ pcb_bool exec_via(parse_param *h);
+ pcb_bool exec_via_v1(parse_param *h); /* Old style via format */
+ pcb_bool exec_pin(parse_param *h);
+ pcb_bool exec_pad(parse_param *h);
+ pcb_bool exec_useg(parse_param *h);
+
+ pcb_bool exec_polygon_begin(parse_param *h);
+ pcb_bool exec_polygon_end(parse_param *h);
+ pcb_bool exec_polyvoid_begin(parse_param *h);
+ pcb_bool exec_polyvoid_end(parse_param *h);
+ pcb_bool exec_polyline_begin(parse_param *h);
+ pcb_bool exec_polyline_end(parse_param *h);
+ pcb_bool exec_line(parse_param *h);
+ pcb_bool exec_curve(parse_param *h);
+
+ pcb_bool exec_net_class(parse_param *h);
+ pcb_bool exec_net_class_element(parse_param *h);
+ pcb_bool exec_net_class_attribute(parse_param *h);
+
+ pcb_bool exec_end(parse_param *h);
+ pcb_bool exec_key(parse_param *h);
+
+ /* called by pcb-rnd to load hyperlynx file */
+ pcb_bool hyp_parse(pcb_data_t *dest, const char *fname, int debug);
+ void hyp_error(const char *msg);
+
+ /* create arc, hyperlynx-style */
+ pcb_arc_t *hyp_arc_new(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t XC, pcb_coord_t YC, pcb_coord_t Width, pcb_coord_t Height, pcb_bool_t Clockwise, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags);
+
+#endif
+
+ /* not truncated */
+
diff --git a/src_plugins/import_netlist/Makefile b/src_plugins/import_netlist/Makefile
index e5bb6ae..8ef4348 100644
--- a/src_plugins/import_netlist/Makefile
+++ b/src_plugins/import_netlist/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_import_netlist
+ cd ../../src && $(MAKE) mod_import_netlist
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/import_netlist/import_netlist.c b/src_plugins/import_netlist/import_netlist.c
index e567a91..a296fa6 100644
--- a/src_plugins/import_netlist/import_netlist.c
+++ b/src_plugins/import_netlist/import_netlist.c
@@ -26,18 +26,19 @@
#define _BSD_SOURCE
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "plugins.h"
#include "plug_io.h"
#include "plug_import.h"
#include "conf_core.h"
#include "error.h"
-#include "misc.h"
#include "data.h"
#include "rats_patch.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "paths.h"
-static plug_import_t import_netlist;
+static pcb_plug_import_t import_netlist;
#define BLANK(x) ((x) == ' ' || (x) == '\t' || (x) == '\n' \
@@ -49,11 +50,11 @@ static plug_import_t import_netlist;
static int ReadNetlist(const char *filename)
{
char *command = NULL;
- char inputline[MAX_NETLIST_LINE_LENGTH + 1];
- char temp[MAX_NETLIST_LINE_LENGTH + 1];
+ char inputline[PCB_MAX_NETLIST_LINE_LENGTH + 1];
+ char temp[PCB_MAX_NETLIST_LINE_LENGTH + 1];
FILE *fp;
- LibraryMenuTypePtr menu = NULL;
- LibraryEntryTypePtr entry;
+ pcb_lib_menu_t *menu = NULL;
+ pcb_lib_entry_t *entry;
int i, j, lines, kind;
pcb_bool continued;
int used_popen = 0;
@@ -61,22 +62,26 @@ static int ReadNetlist(const char *filename)
if (!filename)
return (1); /* nothing to do */
- Message(PCB_MSG_DEFAULT, _("Importing PCB netlist %s\n"), filename);
+ pcb_message(PCB_MSG_INFO, _("Importing PCB netlist %s\n"), filename);
- if (EMPTY_STRING_P(conf_core.rc.rat_command)) {
+ if (PCB_EMPTY_STRING_P(conf_core.rc.rat_command)) {
fp = fopen(filename, "r");
if (!fp) {
- Message(PCB_MSG_DEFAULT, "Cannot open %s for reading", filename);
+ pcb_message(PCB_MSG_ERROR, "Cannot open %s for reading", filename);
return 1;
}
}
else {
+ pcb_build_argfn_t p;
used_popen = 1;
- command = EvaluateFilename(conf_core.rc.rat_command, conf_core.rc.rat_path, filename, NULL);
+ memset(&p, 0, sizeof(p));
+ p.params['p'-'a'] = conf_core.rc.rat_path;
+ p.params['f'-'a'] = filename;
+ command = pcb_build_argfn(conf_core.rc.rat_command, &p);
/* open pipe to stdout of command */
if (*command == '\0' || (fp = popen(command, "r")) == NULL) {
- PopenErrorMessage(command);
+ pcb_popen_error_message(command);
free(command);
return (1);
}
@@ -88,13 +93,13 @@ static int ReadNetlist(const char *filename)
* kind = 2 is connection
*/
kind = 0;
- while (fgets(inputline, MAX_NETLIST_LINE_LENGTH, fp)) {
+ while (fgets(inputline, PCB_MAX_NETLIST_LINE_LENGTH, fp)) {
size_t len = strlen(inputline);
/* check for maximum length line */
if (len) {
if (inputline[--len] != '\n')
- Message(PCB_MSG_DEFAULT, _("Line length (%i) exceeded in netlist file.\n"
- "additional characters will be ignored.\n"), MAX_NETLIST_LINE_LENGTH);
+ pcb_message(PCB_MSG_ERROR, _("Line length (%i) exceeded in netlist file.\n"
+ "additional characters will be ignored.\n"), PCB_MAX_NETLIST_LINE_LENGTH);
else
inputline[len] = '\0';
}
@@ -119,7 +124,7 @@ static int ReadNetlist(const char *filename)
while (inputline[i] != '\0' && BLANK(inputline[i]))
i++;
if (kind == 0) {
- menu = GetLibraryMenuMemory(&PCB->NetlistLib[NETLIST_INPUT], NULL);
+ menu = pcb_lib_menu_new(&PCB->NetlistLib[PCB_NETLIST_INPUT], NULL);
menu->Name = pcb_strdup(temp);
menu->flag = 1;
kind++;
@@ -130,7 +135,7 @@ static int ReadNetlist(const char *filename)
menu->Style = pcb_strdup(temp);
}
else {
- entry = GetLibraryEntryMemory(menu);
+ entry = pcb_lib_entry_new(menu);
entry->ListEntry = pcb_strdup(temp);
entry->ListEntry_dontfree = 0;
}
@@ -140,7 +145,7 @@ static int ReadNetlist(const char *filename)
kind = 0;
}
if (!lines) {
- Message(PCB_MSG_DEFAULT, _("Empty netlist file!\n"));
+ pcb_message(PCB_MSG_ERROR, _("Empty netlist file!\n"));
pclose(fp);
return (1);
}
@@ -149,11 +154,11 @@ static int ReadNetlist(const char *filename)
else
fclose(fp);
pcb_sort_netlist();
- rats_patch_make_edited(PCB);
+ pcb_ratspatch_make_edited(PCB);
return (0);
}
-int netlist_support_prio(plug_import_t *ctx, unsigned int aspects, FILE *fp, const char *filename)
+int netlist_support_prio(pcb_plug_import_t *ctx, unsigned int aspects, FILE *fp, const char *filename)
{
if (aspects != IMPORT_ASPECT_NETLIST)
return 0; /* only pure netlist import is supported */
@@ -163,7 +168,7 @@ int netlist_support_prio(plug_import_t *ctx, unsigned int aspects, FILE *fp, con
}
-static int netlist_import(plug_import_t *ctx, unsigned int aspects, const char *fn)
+static int netlist_import(pcb_plug_import_t *ctx, unsigned int aspects, const char *fn)
{
return ReadNetlist(fn);
}
@@ -181,7 +186,7 @@ pcb_uninit_t hid_import_netlist_init(void)
import_netlist.fmt_support_prio = netlist_support_prio;
import_netlist.import = netlist_import;
- HOOK_REGISTER(plug_import_t, plug_import_chain, &import_netlist);
+ PCB_HOOK_REGISTER(pcb_plug_import_t, pcb_plug_import_chain, &import_netlist);
return hid_import_netlist_uninit;
}
diff --git a/src_plugins/import_sch/Makefile b/src_plugins/import_sch/Makefile
index dfcba41..f7c508f 100644
--- a/src_plugins/import_sch/Makefile
+++ b/src_plugins/import_sch/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_autoplace
+ cd ../../src && $(MAKE) mod_autoplace
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/import_sch/import_sch.c b/src_plugins/import_sch/import_sch.c
index 6b4f590..c63332f 100644
--- a/src_plugins/import_sch/import_sch.c
+++ b/src_plugins/import_sch/import_sch.c
@@ -27,7 +27,7 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "action_helper.h"
#include "change.h"
@@ -35,7 +35,6 @@
#include "undo.h"
#include "plugins.h"
-#include "misc.h"
#include "compat_fs.h"
#include "pcb-printf.h"
#include "remove.h"
@@ -43,6 +42,9 @@
#include "hid_actions.h"
#include "import_sch_conf.h"
#include "misc_util.h"
+#include "compat_nls.h"
+#include "compat_misc.h"
+#include "obj_rat.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -50,14 +52,14 @@
conf_import_sch_t conf_import_sch;
-extern int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y);
+extern int pcb_act_ExecuteFile(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
/* ---------------------------------------------------------------- */
-static const char import_syntax[] =
+static const char pcb_acts_Import[] =
"Import()\n"
"Import([gnetlist|make[,source,source,...]])\n" "Import(setnewpoint[,(mark|center|X,Y)])\n" "Import(setdisperse,D,units)\n";
-static const char import_help[] = "Import schematics.";
+static const char pcb_acth_Import[] = "Import schematics.";
/* %start-doc actions Import
@@ -168,80 +170,80 @@ smallest board dimension. Dispersion is saved in the
%end-doc */
-static int ActionImport(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Import(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *mode;
const char **sources = NULL;
int nsources = 0;
#ifdef DEBUG
- printf("ActionImport: =========== Entering ActionImport ============\n");
+ printf("pcb_act_Import: =========== Entering pcb_act_Import ============\n");
#endif
- mode = ACTION_ARG(0);
+ mode = PCB_ACTION_ARG(0);
- if (mode && strcasecmp(mode, "setdisperse") == 0) {
+ if (mode && pcb_strcasecmp(mode, "setdisperse") == 0) {
const char *ds, *units;
char buf[50];
- ds = ACTION_ARG(1);
- units = ACTION_ARG(2);
+ ds = PCB_ACTION_ARG(1);
+ units = PCB_ACTION_ARG(2);
if (!ds) {
- const char *as = AttributeGet(PCB, "import::disperse");
- ds = gui->prompt_for(_("Enter dispersion:"), as ? as : "0");
+ const char *as = pcb_attrib_get(PCB, "import::disperse");
+ ds = pcb_gui->prompt_for(_("Enter dispersion:"), as ? as : "0");
}
if (units) {
sprintf(buf, "%s%s", ds, units);
- AttributePut(PCB, "import::disperse", buf);
+ pcb_attrib_put(PCB, "import::disperse", buf);
}
else
- AttributePut(PCB, "import::disperse", ds);
- if (ACTION_ARG(1) == NULL)
+ pcb_attrib_put(PCB, "import::disperse", ds);
+ if (PCB_ACTION_ARG(1) == NULL)
free((char*)ds);
return 0;
}
- if (mode && strcasecmp(mode, "setnewpoint") == 0) {
+ if (mode && pcb_strcasecmp(mode, "setnewpoint") == 0) {
const char *xs, *ys, *units;
- Coord x, y;
+ pcb_coord_t x, y;
char buf[50];
- xs = ACTION_ARG(1);
- ys = ACTION_ARG(2);
- units = ACTION_ARG(3);
+ xs = PCB_ACTION_ARG(1);
+ ys = PCB_ACTION_ARG(2);
+ units = PCB_ACTION_ARG(3);
if (!xs) {
- gui->get_coords(_("Click on a location"), &x, &y);
+ pcb_gui->get_coords(_("Click on a location"), &x, &y);
}
- else if (strcasecmp(xs, "center") == 0) {
- AttributeRemove(PCB, "import::newX");
- AttributeRemove(PCB, "import::newY");
+ else if (pcb_strcasecmp(xs, "center") == 0) {
+ pcb_attrib_remove(PCB, "import::newX");
+ pcb_attrib_remove(PCB, "import::newY");
return 0;
}
- else if (strcasecmp(xs, "mark") == 0) {
- if (Marked.status) {
- x = Marked.X;
- y = Marked.Y;
+ else if (pcb_strcasecmp(xs, "mark") == 0) {
+ if (pcb_marked.status) {
+ x = pcb_marked.X;
+ y = pcb_marked.Y;
}
}
else if (ys) {
- x = GetValue(xs, units, NULL, NULL);
- y = GetValue(ys, units, NULL, NULL);
+ x = pcb_get_value(xs, units, NULL, NULL);
+ y = pcb_get_value(ys, units, NULL, NULL);
}
else {
- Message(PCB_MSG_DEFAULT, _("Bad syntax for Import(setnewpoint)"));
+ pcb_message(PCB_MSG_ERROR, _("Bad syntax for Import(setnewpoint)"));
return 1;
}
pcb_sprintf(buf, "%$ms", x);
- AttributePut(PCB, "import::newX", buf);
+ pcb_attrib_put(PCB, "import::newX", buf);
pcb_sprintf(buf, "%$ms", y);
- AttributePut(PCB, "import::newY", buf);
+ pcb_attrib_put(PCB, "import::newY", buf);
return 0;
}
if (!mode)
- mode = AttributeGet(PCB, "import::mode");
+ mode = pcb_attrib_get(PCB, "import::mode");
if (!mode)
mode = "gnetlist";
@@ -258,7 +260,7 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
do {
nsources++;
sprintf(sname, "import::src%d", nsources);
- src = AttributeGet(PCB, sname);
+ src = pcb_attrib_get(PCB, sname);
} while (src);
if (nsources > 0) {
@@ -267,7 +269,7 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
do {
nsources++;
sprintf(sname, "import::src%d", nsources);
- src = AttributeGet(PCB, sname);
+ src = pcb_attrib_get(PCB, sname);
sources[nsources] = src;
} while (src);
}
@@ -280,7 +282,7 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
char *dot, *slash, *bslash;
if (!pcbname)
- return hid_action("ImportGUI");
+ return pcb_hid_action("ImportGUI");
schname = (char *) malloc(strlen(pcbname) + 5);
strcpy(schname, pcbname);
@@ -296,7 +298,7 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
strcat(schname, ".sch");
if (access(schname, F_OK))
- return hid_action("ImportGUI");
+ return pcb_hid_action("ImportGUI");
sources = (const char **) malloc(2 * sizeof(char *));
sources[0] = schname;
@@ -304,18 +306,18 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
nsources = 1;
}
- if (strcasecmp(mode, "gnetlist") == 0) {
- char *tmpfile = tempfile_name_new("gnetlist_output");
+ if (pcb_strcasecmp(mode, "gnetlist") == 0) {
+ char *tmpfile = pcb_tempfile_name_new("gnetlist_output");
const char **cmd;
int i;
if (tmpfile == NULL) {
- Message(PCB_MSG_ERROR, _("Could not create temp file"));
+ pcb_message(PCB_MSG_ERROR, _("Could not create temp file"));
return 1;
}
if ((conf_import_sch.plugins.import_sch.gnetlist_program == NULL) || (*conf_import_sch.plugins.import_sch.gnetlist_program == '\0')) {
- Message(PCB_MSG_ERROR, _("No gnetlist program configured, can not import. Please fill in configuration setting plugins/import_sch/gnetlist_program\n"));
+ pcb_message(PCB_MSG_ERROR, _("No gnetlist program configured, can not import. Please fill in configuration setting plugins/import_sch/gnetlist_program\n"));
return 1;
}
@@ -333,7 +335,7 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
cmd[8 + nsources] = NULL;
#ifdef DEBUG
- printf("ActionImport: =========== About to run gnetlist ============\n");
+ printf("pcb_act_Import: =========== About to run gnetlist ============\n");
printf("%s %s %s %s %s %s %s %s %s ...\n", cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6], cmd[7], cmd[8]);
#endif
@@ -343,17 +345,17 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
}
#ifdef DEBUG
- printf("ActionImport: =========== About to run ActionExecuteFile, file = %s ============\n", tmpfile);
+ printf("pcb_act_Import: =========== About to run pcb_act_ExecuteFile, file = %s ============\n", tmpfile);
#endif
cmd[0] = tmpfile;
cmd[1] = NULL;
- ActionExecuteFile(1, cmd, 0, 0);
+ pcb_act_ExecuteFile(1, cmd, 0, 0);
free(cmd);
- tempfile_unlink(tmpfile);
+ pcb_tempfile_unlink(tmpfile);
}
- else if (strcasecmp(mode, "make") == 0) {
+ else if (pcb_strcasecmp(mode, "make") == 0) {
int must_free_tmpfile = 0;
char *tmpfile;
const char *cmd[10];
@@ -365,23 +367,23 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
char *user_target = NULL;
- user_outfile = AttributeGet(PCB, "import::outfile");
- user_makefile = AttributeGet(PCB, "import::makefile");
- user_target = AttributeGet(PCB, "import::target");
+ user_outfile = pcb_attrib_get(PCB, "import::outfile");
+ user_makefile = pcb_attrib_get(PCB, "import::makefile");
+ user_target = pcb_attrib_get(PCB, "import::target");
if (user_outfile && !user_target)
user_target = user_outfile;
if ((conf_import_sch.plugins.import_sch.make_program == NULL) || (*conf_import_sch.plugins.import_sch.make_program == '\0')) {
- Message(PCB_MSG_ERROR, _("No make program configured, can not import. Please fill in configuration setting plugins/import_sch/make_program\n"));
+ pcb_message(PCB_MSG_ERROR, _("No make program configured, can not import. Please fill in configuration setting plugins/import_sch/make_program\n"));
return 1;
}
if (user_outfile)
tmpfile = user_outfile;
else {
- tmpfile = tempfile_name_new("gnetlist_output");
+ tmpfile = pcb_tempfile_name_new("gnetlist_output");
if (tmpfile == NULL) {
- Message(PCB_MSG_ERROR, _("Could not create temp file"));
+ pcb_message(PCB_MSG_ERROR, _("Could not create temp file"));
return 1;
}
must_free_tmpfile = 1;
@@ -400,9 +402,9 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
cmd[0] = conf_import_sch.plugins.import_sch.make_program;
cmd[1] = "-s";
- cmd[2] = Concat("PCB=", PCB->Filename, NULL);
+ cmd[2] = pcb_concat("PCB=", PCB->Filename, NULL);
cmd[3] = srclist;
- cmd[4] = Concat("OUT=", tmpfile, NULL);
+ cmd[4] = pcb_concat("OUT=", tmpfile, NULL);
i = 5;
if (user_makefile) {
cmd[i++] = "-f";
@@ -422,24 +424,24 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
cmd[0] = tmpfile;
cmd[1] = NULL;
- ActionExecuteFile(1, cmd, 0, 0);
+ pcb_act_ExecuteFile(1, cmd, 0, 0);
free((char*)cmd[2]);
free((char*)cmd[3]);
free((char*)cmd[4]);
if (must_free_tmpfile)
- tempfile_unlink(tmpfile);
+ pcb_tempfile_unlink(tmpfile);
}
else {
- Message(PCB_MSG_DEFAULT, _("Unknown import mode: %s\n"), mode);
+ pcb_message(PCB_MSG_ERROR, _("Unknown import mode: %s\n"), mode);
return 1;
}
- DeleteRats(pcb_false);
- AddAllRats(pcb_false, NULL);
+ pcb_rats_destroy(pcb_false);
+ pcb_rat_add_all(pcb_false, NULL);
#ifdef DEBUG
- printf("ActionImport: =========== Leaving ActionImport ============\n");
+ printf("pcb_act_Import: =========== Leaving pcb_act_Import ============\n");
#endif
return 0;
@@ -447,16 +449,16 @@ static int ActionImport(int argc, const char **argv, Coord x, Coord y)
static const char *import_sch_cookie = "import_sch plugin";
-HID_Action import_sch_action_list[] = {
- {"Import", 0, ActionImport,
- import_help, import_syntax}
+pcb_hid_action_t import_sch_action_list[] = {
+ {"Import", 0, pcb_act_Import,
+ pcb_acth_Import, pcb_acts_Import}
};
-REGISTER_ACTIONS(import_sch_action_list, import_sch_cookie)
+PCB_REGISTER_ACTIONS(import_sch_action_list, import_sch_cookie)
static void hid_import_sch_uninit(void)
{
- hid_remove_actions_by_cookie(import_sch_cookie);
+ pcb_hid_remove_actions_by_cookie(import_sch_cookie);
conf_unreg_fields("plugins/import_sch/");
}
@@ -465,7 +467,7 @@ pcb_uninit_t hid_import_sch_init(void)
{
char *tmp;
- REGISTER_ACTIONS(import_sch_action_list, import_sch_cookie)
+ PCB_REGISTER_ACTIONS(import_sch_action_list, import_sch_cookie)
#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \
conf_reg_field(conf_import_sch, field,isarray,type_name,cpath,cname,desc,flags);
#include "import_sch_conf_fields.h"
diff --git a/src_plugins/io_kicad/Makefile b/src_plugins/io_kicad/Makefile
index 27e6cf9..24ca0ab 100644
--- a/src_plugins/io_kicad/Makefile
+++ b/src_plugins/io_kicad/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_io_kicad
+ cd ../../src && $(MAKE) mod_io_kicad
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/io_kicad/README b/src_plugins/io_kicad/README
index 697df2e..f7eaf10 100644
--- a/src_plugins/io_kicad/README
+++ b/src_plugins/io_kicad/README
@@ -1,6 +1,6 @@
Load and save the design and elements in Kicad's s-expression format - this
is the new, currently preferred format in Kicad.
-#state: work-in-progress
-#default: disabled
+#state: works
+#default: buildin
#implements: io
diff --git a/src_plugins/io_kicad/io_kicad.c b/src_plugins/io_kicad/io_kicad.c
index b1fe09e..0aa56d4 100644
--- a/src_plugins/io_kicad/io_kicad.c
+++ b/src_plugins/io_kicad/io_kicad.c
@@ -24,15 +24,14 @@
*/
#include "config.h"
-#include "global.h"
#include "plugins.h"
#include "plug_io.h"
#include "write.h"
#include "read.h"
-static plug_io_t io_kicad;
+static pcb_plug_io_t io_kicad;
-int io_kicad_fmt(plug_io_t *ctx, plug_iot_t typ, int wr, const char *fmt)
+int io_kicad_fmt(pcb_plug_io_t *ctx, pcb_plug_iot_t typ, int wr, const char *fmt)
{
if (strcmp(ctx->description, fmt) == 0)
return 200;
@@ -55,6 +54,7 @@ pcb_uninit_t hid_io_kicad_init(void)
/* register the IO hook */
io_kicad.plugin_data = NULL;
io_kicad.fmt_support_prio = io_kicad_fmt;
+ io_kicad.test_parse_pcb = io_kicad_test_parse_pcb;
io_kicad.parse_pcb = io_kicad_read_pcb;
io_kicad.parse_element = NULL;
io_kicad.parse_font = NULL;
@@ -63,9 +63,13 @@ pcb_uninit_t hid_io_kicad_init(void)
io_kicad.write_pcb = io_kicad_write_pcb;
io_kicad.default_fmt = "kicad";
io_kicad.description = "Kicad, s-expression";
- io_kicad.save_preference_prio = 92;
+ io_kicad.save_preference_prio = 80;
+ io_kicad.default_extension = ".kicad_pcb";
+ io_kicad.fp_extension = ".kicad_mod";
+ io_kicad.mime_type = "application/x-kicad-pcb";
- HOOK_REGISTER(plug_io_t, plug_io_chain, &io_kicad);
+
+ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &io_kicad);
/* TODO: Alloc plugin-globals here. */
diff --git a/src_plugins/io_kicad/read.c b/src_plugins/io_kicad/read.c
index 441a30a..7c60830 100644
--- a/src_plugins/io_kicad/read.c
+++ b/src_plugins/io_kicad/read.c
@@ -29,6 +29,8 @@
#include <gensexpr/gsxl.h>
#include <genht/htsi.h>
#include "compat_misc.h"
+#include "config.h"
+#include "board.h"
#include "plug_io.h"
#include "error.h"
#include "data.h"
@@ -36,18 +38,15 @@
#include "layer.h"
#include "const.h"
#include "netlist.h"
-#include "create.h"
#include "polygon.h"
-#include "misc.h" /* for flag setting */
#include "misc_util.h" /* for distance calculations */
#include "conf_core.h"
#include "move.h"
#include "macro.h"
-
-
+#include "obj_all.h"
typedef struct {
- PCBTypePtr PCB;
+ pcb_board_t *PCB;
const char *Filename;
conf_role_t settings_dest;
gsxl_dom_t dom;
@@ -172,13 +171,13 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
char *end, *text;
double val;
- Coord X, Y;
+ pcb_coord_t X, Y;
int scaling = 100;
int textLength = 0;
int mirrored = 0;
double glyphWidth = 1.27; /* a reasonable approximation of pcb glyph width, ~= 5000 centimils */
unsigned direction = 0; /* default is horizontal */
- FlagType Flags = MakeFlags(0); /* start with something bland here */
+ pcb_flag_t Flags = pcb_flag_make(0); /* start with something bland here */
int PCBLayer = 0; /* sane default value */
if (subtree->str != NULL) {
@@ -193,7 +192,6 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 0);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\ttext at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 1); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -205,7 +203,6 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\ttext at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 2);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -228,33 +225,30 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
}
printf("\tkicad angle: %f, Direction %d\n", val, direction);
}
- SEEN_NO_DUP(tally, 3);
}
} else {
return -1;
}
} else if (n->str != NULL && strcmp("layer", n->str) == 0) {
- SEEN_NO_DUP(tally, 4);
+ SEEN_NO_DUP(tally, 1);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\ttext layer: '%s'\n", (n->children->str));
PCBLayer = kicad_get_layeridx(st, n->children->str);
if (PCBLayer == -1) {
return -1;
} else if (pcb_layer_flags(PCBLayer) & PCB_LYT_BOTTOM) {
- Flags = MakeFlags(PCB_FLAG_ONSOLDER);
+ Flags = pcb_flag_make(PCB_FLAG_ONSOLDER);
}
} else {
return -1;
}
} else if (n->str != NULL && strcmp("effects", n->str) == 0) {
- SEEN_NO_DUP(tally, 5);
for(m = n->children; m != NULL; m = m->next) {
printf("\tstepping through text effects definitions\n");
if (m->str != NULL && strcmp("font", m->str) == 0) {
- SEEN_NO_DUP(tally, 6);
for(l = m->children; l != NULL; l = l->next) {
if (m->str != NULL && strcmp("size", l->str) == 0) {
- SEEN_NO_DUP(tally, 7);
+ SEEN_NO_DUP(tally, 2);
if (l->children != NULL && l->children->str != NULL) {
pcb_printf("\tfont sizeX: '%s'\n", (l->children->str));
val = strtod(l->children->str, &end);
@@ -272,7 +266,7 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (strcmp("thickness", l->str) == 0) {
- SEEN_NO_DUP(tally, 8);
+ SEEN_NO_DUP(tally, 3);
if (l->children != NULL && l->children->str != NULL) {
pcb_printf("\tfont thickness: '%s'\n", (l->children->str));
} else {
@@ -281,7 +275,7 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
}
}
} else if (m->str != NULL && strcmp("justify", m->str) == 0) {
- SEEN_NO_DUP(tally, 9);
+ SEEN_NO_DUP(tally, 4);
if (m->children != NULL && m->children->str != NULL) {
pcb_printf("\ttext justification: '%s'\n", (m->children->str));
if (strcmp("mirror", m->children->str) == 0) {
@@ -300,10 +294,10 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- required = 1; /*BV(2) | BV(3) | BV(4) | BV(7) | BV(8); */
+ required = BV(0) | BV(1) | BV(2) | BV(3);
if ((tally & required) == required) { /* has location, layer, size and stroke thickness at a minimum */
if (&st->PCB->Font == NULL) {
- CreateDefaultFont(st->PCB);
+ pcb_font_create_default(st->PCB);
}
if (mirrored != 0) {
@@ -340,7 +334,7 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
}
}
- CreateNewText( &st->PCB->Data->Layer[PCBLayer], &st->PCB->Font, X, Y, direction, scaling, text, Flags);
+ pcb_text_new( &st->PCB->Data->Layer[PCBLayer], &st->PCB->Font, X, Y, direction, scaling, text, Flags);
return 0; /* create new font */
}
return -1;
@@ -350,12 +344,12 @@ static int kicad_parse_gr_text(read_state_t *st, gsxl_node_t *subtree)
static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
{
gsxl_node_t *n;
- unsigned long tally = 0;
+ unsigned long tally = 0, required;
char *end;
double val;
- Coord X1, Y1, X2, Y2, Thickness, Clearance; /* not sure what to do with mask */
- FlagType Flags = MakeFlags(0); /* start with something bland here */
+ pcb_coord_t X1, Y1, X2, Y2, Thickness, Clearance; /* not sure what to do with mask */
+ pcb_flag_t Flags = pcb_flag_make(0); /* start with something bland here */
int PCBLayer = 0; /* sane default value */
Clearance = Thickness = PCB_MM_TO_COORD(0.250); /* start with sane defaults */
@@ -368,7 +362,6 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 0);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_line start at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 1); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -380,7 +373,6 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tgr_line start at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 2);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -391,10 +383,9 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("end", n->str) == 0) {
- SEEN_NO_DUP(tally, 3);
+ SEEN_NO_DUP(tally, 1);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_line end at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 4);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -406,7 +397,6 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tgr_line end at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 5);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -417,10 +407,9 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("layer", n->str) == 0) {
- SEEN_NO_DUP(tally, 6);
+ SEEN_NO_DUP(tally, 2);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_line layer: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 7);
PCBLayer = kicad_get_layeridx(st, n->children->str);
if (PCBLayer == -1) {
return -1;
@@ -429,10 +418,9 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("width", n->str) == 0) {
- SEEN_NO_DUP(tally, 8);
+ SEEN_NO_DUP(tally, 3);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_line width: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 9);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -443,18 +431,16 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("angle", n->str) == 0) { /* unlikely to be used or seen */
- SEEN_NO_DUP(tally, 10);
+ SEEN_NO_DUP(tally, 4);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_line angle: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 11);
} else {
return -1;
}
} else if (n->str != NULL && strcmp("net", n->str) == 0) { /* unlikely to be used or seen */
- SEEN_NO_DUP(tally, 12);
+ SEEN_NO_DUP(tally, 5);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_line net: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 13);
} else {
return -1;
}
@@ -466,8 +452,9 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- if (tally >= 0) { /* need start, end, layer, thickness at a minimum */
- CreateNewLineOnLayer( &st->PCB->Data->Layer[PCBLayer], X1, Y1, X2, Y2, Thickness, Clearance, Flags);
+ required = BV(0) | BV(1) | BV(2) | BV(3);
+ if ((tally & required) == required) { /* need start, end, layer, thickness at a minimum */
+ pcb_line_new( &st->PCB->Data->Layer[PCBLayer], X1, Y1, X2, Y2, Thickness, Clearance, Flags);
pcb_printf("\tnew gr_line on layer created\n");
return 0;
}
@@ -478,14 +465,14 @@ static int kicad_parse_gr_line(read_state_t *st, gsxl_node_t *subtree)
static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
{
gsxl_node_t *n;
- unsigned long tally = 0;
+ unsigned long tally = 0, required;
char *end;
double val;
- Coord centreX, centreY, endX, endY, width, height, Thickness, Clearance;
- Angle startAngle = 0.0;
- Angle delta = 360.0; /* these defaults allow a gr_circle to be parsed, which does not specify (angle XXX) */
- FlagType Flags = MakeFlags(0); /* start with something bland here */
+ pcb_coord_t centreX, centreY, endX, endY, width, height, Thickness, Clearance;
+ pcb_angle_t startAngle = 0.0;
+ pcb_angle_t delta = 360.0; /* these defaults allow a gr_circle to be parsed, which does not specify (angle XXX) */
+ pcb_flag_t Flags = pcb_flag_make(0); /* start with something bland here */
int PCBLayer = 0; /* sane default value */
Clearance = Thickness = PCB_MM_TO_COORD(0.250); /* start with sane defaults */
@@ -497,7 +484,6 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 0);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc centre at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 1); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -509,7 +495,6 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tgr_arc centre at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 2);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -523,7 +508,6 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 0);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc centre at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 1); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -535,7 +519,6 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tgr_arc centre at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 2);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -546,10 +529,9 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("end", n->str) == 0) {
- SEEN_NO_DUP(tally, 3);
+ SEEN_NO_DUP(tally, 1);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc end at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 4);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -561,7 +543,6 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tgr_arc end at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 5);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -572,10 +553,9 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("layer", n->str) == 0) {
- SEEN_NO_DUP(tally, 6);
+ SEEN_NO_DUP(tally, 2);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc layer: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 7);
PCBLayer = kicad_get_layeridx(st, n->children->str);
if (PCBLayer == -1) {
return -1;
@@ -584,10 +564,9 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("width", n->str) == 0) {
- SEEN_NO_DUP(tally, 8);
+ SEEN_NO_DUP(tally, 3);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc width: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 9);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -598,10 +577,9 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("angle", n->str) == 0) {
- SEEN_NO_DUP(tally, 10);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc angle CW rotation: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 11);
+ SEEN_NO_DUP(tally, 4);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -612,10 +590,8 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("net", n->str) == 0) { /* unlikely to be used or seen */
- SEEN_NO_DUP(tally, 12);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tgr_arc net: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 13);
} else {
return -1;
}
@@ -627,14 +603,16 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- if (tally >= 0) { /* need start, end, layer, thickness at a minimum */
- width = height = Distance(centreX, centreY, endX, endY); /* calculate radius of arc */
+ required = BV(0) | BV(1) | BV(2) | BV(3); /* | BV(4); not needed for circles */
+ if ((tally & required) == required) { /* need start, end, layer, thickness at a minimum */
+ width = height = pcb_distance(centreX, centreY, endX, endY); /* calculate radius of arc */
if (width < 1) { /* degenerate case */
startAngle = 0;
} else {
- startAngle = 180*atan2(endY - centreY, endX - centreX)/M_PI; /* avoid using atan2 with zero parameters */
+ startAngle = 180*atan2(endY - centreY, endX - centreX)/M_PI;
+ /* avoid using atan2 with zero parameters */
}
- CreateNewArcOnLayer( &st->PCB->Data->Layer[PCBLayer], centreX, centreY, width, height, startAngle, -delta, Thickness, Clearance, Flags);
+ pcb_arc_new( &st->PCB->Data->Layer[PCBLayer], centreX, centreY, width, height, startAngle, -delta, Thickness, Clearance, Flags);
return 0;
}
return -1;
@@ -644,12 +622,12 @@ static int kicad_parse_gr_arc(read_state_t *st, gsxl_node_t *subtree)
static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
{
gsxl_node_t *m, *n;
- unsigned long tally = 0;
+ unsigned long tally = 0, required;
char *end, *name; /* not using via name for now */
double val;
- Coord X, Y, Thickness, Clearance, Mask, Drill; /* not sure what to do with mask */
- FlagType Flags = MakeFlags(0); /* start with something bland here */
+ pcb_coord_t X, Y, Thickness, Clearance, Mask, Drill; /* not sure what to do with mask */
+ pcb_flag_t Flags = pcb_flag_make(0); /* start with something bland here */
/* int PCBLayer = 0; not used for now; no blind or buried vias currently in pcb-rnd */
Clearance = Mask = PCB_MM_TO_COORD(0.250); /* start with something bland here */
@@ -663,7 +641,6 @@ static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 0);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tvia at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 1); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -675,7 +652,6 @@ static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tvia at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 2);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -686,10 +662,9 @@ static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("size", n->str) == 0) {
- SEEN_NO_DUP(tally, 3);
+ SEEN_NO_DUP(tally, 1);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tvia size: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 4);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -700,7 +675,7 @@ static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("layers", n->str) == 0) {
- SEEN_NO_DUP(tally, 5);
+ SEEN_NO_DUP(tally, 2);
for(m = n->children; m != NULL; m = m->next) {
if (m->str != NULL) {
pcb_printf("\tvia layer: '%s'\n", (m->str));
@@ -714,10 +689,9 @@ static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
}
}
} else if (n->str != NULL && strcmp("net", n->str) == 0) {
- SEEN_NO_DUP(tally, 6);
+ SEEN_NO_DUP(tally, 3);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tvia segment net: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 7);
} else {
return -1;
}
@@ -729,8 +703,9 @@ static int kicad_parse_via(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- if (tally >= 0) { /* need start, end, layer, thickness at a minimum */
- CreateNewVia( st->PCB->Data, X, Y, Thickness, Clearance, Mask, Drill, name, Flags);
+ required = BV(0) | BV(1);
+ if ((tally & required) == required) { /* need start, end, layer, thickness at a minimum */
+ pcb_via_new( st->PCB->Data, X, Y, Thickness, Clearance, Mask, Drill, name, Flags);
return 0;
}
return -1;
@@ -741,12 +716,12 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
{
gsxl_node_t *n;
- unsigned long tally = 0;
+ unsigned long tally = 0, required;
char *end;
double val;
- Coord X1, Y1, X2, Y2, Thickness, Clearance;
- FlagType Flags = MakeFlags(PCB_FLAG_CLEARLINE); /* we try clearline flag here */
+ pcb_coord_t X1, Y1, X2, Y2, Thickness, Clearance;
+ pcb_flag_t Flags = pcb_flag_make(PCB_FLAG_CLEARLINE); /* we try clearline flag here */
int PCBLayer = 0; /* sane default value */
Clearance = PCB_MM_TO_COORD(0.250); /* start with something bland here */
@@ -758,7 +733,6 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 0);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tsegment start at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 1); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -770,7 +744,6 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tsegment start at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 2);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -781,10 +754,9 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("end", n->str) == 0) {
- SEEN_NO_DUP(tally, 3);
+ SEEN_NO_DUP(tally, 1);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tsegment end at x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 4);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -796,7 +768,6 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tsegment end at y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 5);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -807,10 +778,9 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("layer", n->str) == 0) {
- SEEN_NO_DUP(tally, 6);
+ SEEN_NO_DUP(tally, 2);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tsegment layer: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 7);
PCBLayer = kicad_get_layeridx(st, n->children->str);
if (PCBLayer == -1) {
return -1;
@@ -819,10 +789,9 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("width", n->str) == 0) {
- SEEN_NO_DUP(tally, 8);
+ SEEN_NO_DUP(tally, 3);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tsegment width: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 9);
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -833,7 +802,7 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("net", n->str) == 0) {
- SEEN_NO_DUP(tally, 10);
+ SEEN_NO_DUP(tally, 4);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tsegment net: '%s'\n", (n->children->str));
SEEN_NO_DUP(tally, 11);
@@ -841,7 +810,7 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("tstamp", n->str) == 0) { /* not likely to be used */
- SEEN_NO_DUP(tally, 12);
+ SEEN_NO_DUP(tally, 5);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tsegment timestamp: '%s'\n", (n->children->str));
SEEN_NO_DUP(tally, 13);
@@ -856,8 +825,9 @@ static int kicad_parse_segment(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- if (tally >= 0) { /* need start, end, layer, thickness at a minimum */
- CreateNewLineOnLayer( &st->PCB->Data->Layer[PCBLayer], X1, Y1, X2, Y2, Thickness, Clearance, Flags);
+ required = BV(0) | BV(1) | BV(2) | BV(3);
+ if ((tally & required) == required) { /* need start, end, layer, thickness at a minimum */
+ pcb_line_new( &st->PCB->Data->Layer[PCBLayer], X1, Y1, X2, Y2, Thickness, Clearance, Flags);
pcb_printf("\tnew segment on layer created\n");
return 0;
}
@@ -870,11 +840,11 @@ static int kicad_create_layer(read_state_t *st, int lnum, const char *lname, con
int id = -1;
switch(lnum) {
case 0:
- id = SOLDER_LAYER;
+ id = PCB_SOLDER_SIDE;
pcb_layer_rename(id, lname);
break;
case 15:
- id = COMPONENT_LAYER;
+ id = PCB_COMPONENT_SIDE;
pcb_layer_rename(id, lname);
break;
default:
@@ -955,7 +925,7 @@ static int kicad_parse_layer_definitions(read_state_t *st, gsxl_node_t *subtree)
pcb_printf("\tlayer #%d layer label found:\t%s\n", i, lname);
pcb_printf("\tlayer #%d layer description/type found:\t%s\n", i, ltype);
if (kicad_create_layer(st, lnum, lname, ltype) < 0) {
- Message(PCB_MSG_ERROR, "Unrecognized layer: %d, %s, %s\n", lnum, lname, ltype);
+ pcb_message(PCB_MSG_ERROR, "Unrecognized layer: %d, %s, %s\n", lnum, lname, ltype);
return -1;
}
} else {
@@ -977,7 +947,7 @@ static int kicad_parse_layer_definitions(read_state_t *st, gsxl_node_t *subtree)
*/
if (res != 0) {
- Message(PCB_MSG_ERROR, "Internal error: can't find a silk or mask layer\n");
+ pcb_message(PCB_MSG_ERROR, "Internal error: can't find a silk or mask layer\n");
return -1;
}
@@ -1020,19 +990,19 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
int foundRefdes = 0;
int refdesScaling = 100;
unsigned long tally = 0, featureTally, required;
- Coord moduleX, moduleY, X, Y, X1, Y1, X2, Y2, centreX, centreY, endX, endY, width, height, Thickness, Clearance, padXsize, padYsize, drill, refdesX, refdesY;
- Angle startAngle = 0.0;
- Angle endAngle = 0.0;
- Angle delta = 360.0; /* these defaults allow a fp_circle to be parsed, which does not specify (angle XXX) */
+ pcb_coord_t moduleX, moduleY, X, Y, X1, Y1, X2, Y2, centreX, centreY, endX, endY, width, height, Thickness, Clearance, padXsize, padYsize, drill, refdesX, refdesY;
+ pcb_angle_t startAngle = 0.0;
+ pcb_angle_t endAngle = 0.0;
+ pcb_angle_t delta = 360.0; /* these defaults allow a fp_circle to be parsed, which does not specify (angle XXX) */
double val;
double glyphWidth = 1.27; /* a reasonable approximation of pcb glyph width, ~= 5000 centimils */
unsigned direction = 0; /* default is horizontal */
char * end, * textLabel, * text;
char * moduleName, * moduleRefdes, * moduleValue, * pinName;
- ElementTypePtr newModule;
+ pcb_element_t *newModule;
- FlagType Flags = MakeFlags(0); /* start with something bland here */
- FlagType TextFlags = MakeFlags(0); /* start with something bland here */
+ pcb_flag_t Flags = pcb_flag_make(0); /* start with something bland here */
+ pcb_flag_t TextFlags = pcb_flag_make(0); /* start with something bland here */
Clearance = PCB_MM_TO_COORD(0.250); /* start with something bland here */
moduleName = moduleRefdes = moduleValue = NULL;
@@ -1040,40 +1010,41 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
if (subtree->str != NULL) {
printf("Name of module element being parsed: '%s'\n", subtree->str);
moduleName = subtree->str;
+ SEEN_NO_DUP(tally, 0);
for(n = subtree->next, i = 0; n != NULL; n = n->next, i++) {
if (n->str != NULL && strcmp("layer", n->str) == 0) { /* need this to sort out ONSOLDER flags etc... */
- SEEN_NO_DUP(tally, 0);
+ SEEN_NO_DUP(tally, 1);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tlayer: '%s'\n", (n->children->str));
PCBLayer = kicad_get_layeridx(st, n->children->str);
if (PCBLayer == -1) {
return -1;
} else if (pcb_layer_flags(PCBLayer) & PCB_LYT_BOTTOM) {
- Flags = MakeFlags(PCB_FLAG_ONSOLDER);
- TextFlags = MakeFlags(PCB_FLAG_ONSOLDER);
+ Flags = pcb_flag_make(PCB_FLAG_ONSOLDER);
+ TextFlags = pcb_flag_make(PCB_FLAG_ONSOLDER);
}
} else {
return -1;
}
} else if (n->str != NULL && strcmp("tedit", n->str) == 0) {
- SEEN_NO_DUP(tally, 1);
+ SEEN_NO_DUP(tally, 2);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\ttedit: '%s'\n", (n->children->str));
} else {
return -1;
}
} else if (n->str != NULL && strcmp("tstamp", n->str) == 0) {
- SEEN_NO_DUP(tally, 2);
+ SEEN_NO_DUP(tally, 3);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\ttstamp: '%s'\n", (n->children->str));
} else {
return -1;
}
} else if (n->str != NULL && strcmp("at", n->str) == 0) {
- SEEN_NO_DUP(tally, 3);
+ SEEN_NO_DUP(tally, 4);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tat x: '%s'\n", (n->children->str));
- SEEN_NO_DUP(tally, 4); /* same as ^= 1 was */
+ SEEN_NO_DUP(tally, 5); /* same as ^= 1 was */
val = strtod(n->children->str, &end);
if (*end != 0) {
return -1;
@@ -1085,7 +1056,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tat y: '%s'\n", (n->children->next->str));
- SEEN_NO_DUP(tally, 5);
+ SEEN_NO_DUP(tally, 6);
val = strtod(n->children->next->str, &end);
if (*end != 0) {
return -1;
@@ -1110,6 +1081,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
text = n->children->next->str;
foundRefdes = 0;
if (strcmp("reference", textLabel) == 0) {
+ SEEN_NO_DUP(tally, 7);
printf("\tfp_text reference found: '%s'\n", textLabel);
moduleRefdes = text;
foundRefdes = 1;
@@ -1118,6 +1090,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
printf("\tmoduleRefdes now: '%s'\n", moduleRefdes);
} else if (strcmp("value", textLabel) == 0) {
+ SEEN_NO_DUP(tally, 8);
printf("\tfp_text value found: '%s'\n", textLabel);
moduleValue = text;
foundRefdes = 0;
@@ -1192,7 +1165,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
if (PCBLayer == -1) {
return -1;
} else if (pcb_layer_flags(PCBLayer) & PCB_LYT_BOTTOM) {
- Flags = MakeFlags(PCB_FLAG_ONSOLDER);
+ Flags = pcb_flag_make(PCB_FLAG_ONSOLDER);
}
} else {
return -1;
@@ -1255,10 +1228,10 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- required = 1; /*BV(2) | BV(3) | BV(4) | BV(7) | BV(8); */
- if ((featureTally & required) == required) { /* has location, layer, size and stroke thickness at a minimum */
+ required = BV(0) | BV(1) | BV(4) | BV(7) | BV(8);
+ if ((tally & required) == required) { /* has location, layer, size and stroke thickness at a minimum */
if (&st->PCB->Font == NULL) {
- CreateDefaultFont(st->PCB);
+ pcb_font_create_default(st->PCB);
}
X = refdesX;
@@ -1303,12 +1276,12 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
if (moduleValue != NULL && moduleRefdes != NULL && moduleName != NULL && moduleDefined == 0) {
moduleDefined = 1;
printf("now have RefDes %s and Value %s, can now define module/element %s\n", moduleRefdes, moduleValue, moduleName);
- newModule = CreateNewElement(st->PCB->Data, NULL,
+ newModule = pcb_element_new(st->PCB->Data, NULL,
&st->PCB->Font, Flags,
moduleName, moduleRefdes, moduleValue,
moduleX, moduleY, direction,
- refdesScaling, TextFlags, pcb_false); /*FlagType TextFlags, pcb_bool uniqueName) */
- MoveObject(PCB_TYPE_ELEMENT_NAME, newModule, &newModule->Name[NAME_INDEX()], &newModule->Name[NAME_INDEX()], X, Y);
+ refdesScaling, TextFlags, pcb_false); /*pcb_flag_t TextFlags, pcb_bool uniqueName) */
+ pcb_move_obj(PCB_TYPE_ELEMENT_NAME, newModule, &newModule->Name[PCB_ELEMNAME_IDX_VISIBLE()], &newModule->Name[PCB_ELEMNAME_IDX_VISIBLE()], X, Y);
}
}
@@ -1316,28 +1289,28 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
/* ********************************************************** */
} else if (n->str != NULL && strcmp("descr", n->str) == 0) {
- SEEN_NO_DUP(tally, 6);
+ SEEN_NO_DUP(tally, 9);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tmodule descr: '%s'\n", (n->children->str));
} else {
return -1;
}
} else if (n->str != NULL && strcmp("tags", n->str) == 0) {
- SEEN_NO_DUP(tally, 7);
+ SEEN_NO_DUP(tally, 10);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tmodule tags: '%s'\n", (n->children->str)); /* maye be more than one? */
} else {
return -1;
}
} else if (n->str != NULL && strcmp("path", n->str) == 0) {
- SEEN_NO_DUP(tally, 8);
+ SEEN_NO_DUP(tally, 11);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tmodule path: '%s'\n", (n->children->str));
} else {
return -1;
}
} else if (n->str != NULL && strcmp("model", n->str) == 0) {
- SEEN_NO_DUP(tally, 9);
+ SEEN_NO_DUP(tally, 12);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tmodule model provided: '%s'\n", (n->children->str));
} else {
@@ -1345,9 +1318,11 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
/* pads next - have thru_hole, circle, rect, roundrect, to think about*/
} else if (n->str != NULL && strcmp("pad", n->str) == 0) {
+ featureTally = 0;
if (n->children != 0 && n->children->str != NULL) {
printf("pad name found: %s\n", n->children->str);
pinName = n->children->str;
+ SEEN_NO_DUP(featureTally, 0);
if (n->children->next != NULL && n->children->next->str != NULL) {
pcb_printf("\tpad type: '%s'\n", (n->children->next->str));
if (strcmp("thru_hole", n->children->next->str) == 0) {
@@ -1383,7 +1358,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
printf("error in pad def\n");
}
if (m->str != NULL && strcmp("at", m->str) == 0) {
- /*SEEN_NO_DUP(padTally, 1); */
+ SEEN_NO_DUP(featureTally, 1);
if (m->children != NULL && m->children->str != NULL) {
pcb_printf("\tpad X position:\t'%s'\n", (m->children->str));
val = strtod(m->children->str, &end);
@@ -1408,7 +1383,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
} else if (m->str != NULL && strcmp("layers", m->str) == 0) {
if (SMD) { /* skip testing for pins */
- /*SEEN_NO_DUP(padTally, 2);*/
+ SEEN_NO_DUP(featureTally, 2);
kicadLayer = 15;
for(l = m->children; l != NULL; l = l->next) {
if (l->str != NULL) {
@@ -1419,7 +1394,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
} else if (PCBLayer < -1) {
printf("\tUnimplemented layer definition: %s", l->str);
} else if (pcb_layer_flags(PCBLayer) & PCB_LYT_BOTTOM) {
- Flags = MakeFlags(PCB_FLAG_ONSOLDER);
+ Flags = pcb_flag_make(PCB_FLAG_ONSOLDER);
kicadLayer = 0;
}
pcb_printf("\tpad layer: '%s', PCB layer number %d\n", (l->str), kicad_get_layeridx(st, l->str));
@@ -1431,7 +1406,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
printf("\tIgnoring layer definitions for through hole pin\n");
}
} else if (m->str != NULL && strcmp("drill", m->str) == 0) {
- /*SEEN_NO_DUP(padTally, 3);*/
+ SEEN_NO_DUP(featureTally, 3);
if (m->children != NULL && m->children->str != NULL) {
pcb_printf("\tdrill size: '%s'\n", (m->children->str));
val = strtod(m->children->str, &end);
@@ -1445,7 +1420,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (m->str != NULL && strcmp("net", m->str) == 0) {
- /*SEEN_NO_DUP(padTally, 4);*/
+ SEEN_NO_DUP(featureTally, 4);
if (m->children != NULL && m->children->str != NULL) {
pcb_printf("\tpad's net number:\t'%s'\n", (m->children->str));
if (m->children->next != NULL && m->children->next->str != NULL) {
@@ -1457,7 +1432,7 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (m->str != NULL && strcmp("size", m->str) == 0) {
- /*SEEN_NO_DUP(padTally, 5);*/
+ SEEN_NO_DUP(featureTally, 5);
if (m->children != NULL && m->children->str != NULL) {
pcb_printf("\tpad X size:\t'%s'\n", (m->children->str));
val = strtod(m->children->str, &end);
@@ -1488,34 +1463,46 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
printf("\tFinished stepping through pad args\n");
}
printf("\tfinished pad parse\n");
- if (throughHole == 1) {
- printf("\tcreating new pin %s in element\n", pinName);
- CreateNewPin(newModule, X + moduleX, Y + moduleY, padXsize, Clearance,
+ if (throughHole == 1 && newModule != NULL) {
+ printf("\tcreating new pin %s in element\n", pinName);
+ required = BV(0) | BV(1) | BV(3) | BV(5);
+ if ((featureTally & required) == required) {
+ pcb_element_pin_new(newModule, X + moduleX, Y + moduleY, padXsize, Clearance,
Clearance, drill, pinName, pinName, Flags); /* using clearance value for arg 5 = mask too */
- } else {
- printf("\tcreating new pad %s in element\n", pinName);
- if (padXsize >= padYsize) { /* square pad or rectangular pad, wider than tall */
- Y1 = Y2 = Y;
- X1 = X - (padXsize - padYsize)/2;
- X2 = X + (padXsize - padYsize)/2;
- Thickness = padYsize;
- } else { /* rectangular pad, taller than wide */
- X1 = X2 = X;
- Y1 = Y - (padYsize - padXsize)/2;
- Y2 = Y + (padYsize - padXsize)/2;
- Thickness = padXsize;
- }
- if (square && kicadLayer) {
- Flags = MakeFlags(PCB_FLAG_SQUARE);
- } else if (kicadLayer) {
- Flags = MakeFlags(0);
- } else if (square && !kicadLayer) {
- Flags = MakeFlags(PCB_FLAG_SQUARE | PCB_FLAG_ONSOLDER);
} else {
- Flags = MakeFlags(PCB_FLAG_ONSOLDER);
+ return -1;
}
- CreateNewPad(newModule, X1 + moduleX, Y1 + moduleY, X2 + moduleX, Y2 + moduleY, Thickness, Clearance,
+ } else if (newModule != NULL) {
+ printf("\tcreating new pad %s in element\n", pinName);
+ required = BV(0) | BV(1) | BV(2) | BV(5);
+ if ((featureTally & required) == required) {
+ if (padXsize >= padYsize) { /* square pad or rectangular pad, wider than tall */
+ Y1 = Y2 = Y;
+ X1 = X - (padXsize - padYsize)/2;
+ X2 = X + (padXsize - padYsize)/2;
+ Thickness = padYsize;
+ } else { /* rectangular pad, taller than wide */
+ X1 = X2 = X;
+ Y1 = Y - (padYsize - padXsize)/2;
+ Y2 = Y + (padYsize - padXsize)/2;
+ Thickness = padXsize;
+ }
+ if (square && kicadLayer) {
+ Flags = pcb_flag_make(PCB_FLAG_SQUARE);
+ } else if (kicadLayer) {
+ Flags = pcb_flag_make(0);
+ } else if (square && !kicadLayer) {
+ Flags = pcb_flag_make(PCB_FLAG_SQUARE | PCB_FLAG_ONSOLDER);
+ } else {
+ Flags = pcb_flag_make(PCB_FLAG_ONSOLDER);
+ }
+ pcb_element_pad_new(newModule, X1 + moduleX, Y1 + moduleY, X2 + moduleX, Y2 + moduleY, Thickness, Clearance,
Clearance, pinName, pinName, Flags); /* using clearance value for arg 7 = mask too */
+ } else {
+ return -1;
+ }
+ } else {
+ return -1;
}
} else if (n->str != NULL && strcmp("fp_line", n->str) == 0) {
@@ -1629,9 +1616,9 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- if (featureTally >= 0 && newModule != NULL) { /* need start, end, layer, thickness at a minimum */
-
- CreateNewLineInElement(newModule, X1, Y1, X2, Y2, Thickness);
+ required = BV(0) | BV(3) | BV(6) | BV(8);
+ if (((featureTally & required) == required) && newModule != NULL) { /* need start, end, layer, thickness at a minimum */
+ pcb_element_line_new(newModule, X1, Y1, X2, Y2, Thickness);
pcb_printf("\tnew fp_line on layer created\n");
}
@@ -1780,8 +1767,10 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- if (featureTally >= 0) { /* need start, end, layer, thickness at a minimum */
- width = height = Distance(centreX, centreY, endX, endY); /* calculate radius of arc */
+ required = BV(0) | BV(6) | BV(8);
+ if (((featureTally & required) == required) && newModule != NULL) {
+ /* need start, layer, thickness at a minimum */
+ width = height = pcb_distance(centreX, centreY, endX, endY); /* calculate radius of arc */
if (width < 1) { /* degenerate case */
startAngle = 0;
} else {
@@ -1798,10 +1787,8 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
}
+ pcb_element_arc_new(newModule, moduleX + centreX, moduleY + centreY, width, height, endAngle, delta, Thickness);
- if (featureTally >= 0 && newModule != NULL) { /* need start, end, layer, thickness at a minimum */
- CreateNewArcInElement(newModule, moduleX + centreX, moduleY + centreY, width, height, endAngle, delta, Thickness);
- }
}
/* ********************************************************** */
@@ -1813,11 +1800,13 @@ static int kicad_parse_module(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- SetElementBoundingBox(PCB->Data, newModule, &PCB->Font);
- return 0;
- /* required = 1; BV(2) | BV(3) | BV(4) | BV(7) | BV(8);
- if ((tally & required) == required) { */ /* has location, layer, size and stroke thickness at a minimum */
+ if (newModule != NULL) {
+ pcb_element_bbox(PCB->Data, newModule, &PCB->Font);
+ return 0;
+ } else {
+ return -1;
+ }
} else {
return -1;
}
@@ -1831,13 +1820,13 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
int polycount = 0;
long j = 0;
unsigned long tally = 0;
-/* unsigned long required; yet to be implemented */
+ unsigned long required;
- PolygonTypePtr polygon = NULL;
- FlagType flags = MakeFlags(PCB_FLAG_CLEARPOLY);
+ pcb_polygon_t *polygon = NULL;
+ pcb_flag_t flags = pcb_flag_make(PCB_FLAG_CLEARPOLY);
char *end;
double val;
- Coord X, Y;
+ pcb_coord_t X, Y;
int PCBLayer = 0;
if (subtree->str != NULL) {
@@ -1885,10 +1874,10 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
SEEN_NO_DUP(tally, 7); /* same as ^= 1 was */
} else if (n->children != NULL && n->children->str != NULL && n->children->next->str != NULL) {
pcb_printf("\tzone connect_pads:\t'%s'\n", (n->children->str)); /* this is if the optional(!) yes or no flag for connected pads is present */
- SEEN_NO_DUP(tally, 7); /* same as ^= 1 was */
+ SEEN_NO_DUP(tally, 8); /* same as ^= 1 was */
if (n->children->next != NULL && n->children->next->str != NULL && n->children->next->children != NULL && n->children->next->children->str != NULL) {
if (strcmp("clearance", n->children->next->str) == 0) {
- SEEN_NO_DUP(tally, 8);
+ SEEN_NO_DUP(tally, 9);
pcb_printf("\tzone connect_pads clearance: '%s'\n", (n->children->next->children->str));
} else {
printf("Unrecognised zone connect_pads option %s\n", n->children->next->str);
@@ -1896,14 +1885,14 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
}
}
} else if (n->str != NULL && strcmp("layer", n->str) == 0) {
- SEEN_NO_DUP(tally, 9);
+ SEEN_NO_DUP(tally, 10);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tzone layer:\t'%s'\n", (n->children->str));
PCBLayer = kicad_get_layeridx(st, n->children->str);
if (PCBLayer == -1) {
return -1;
}
- polygon = CreateNewPolygon(&st->PCB->Data->Layer[PCBLayer], flags);
+ polygon = pcb_poly_new(&st->PCB->Data->Layer[PCBLayer], flags);
} else {
return -1;
}
@@ -1931,7 +1920,7 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
Y = PCB_MM_TO_COORD(val);
}
if (polygon != NULL) {
- CreateNewPointInPolygon(polygon, X, Y);
+ pcb_poly_point_new(polygon, X, Y);
}
} else {
return -1;
@@ -1950,7 +1939,7 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
return -1;
}
} else if (n->str != NULL && strcmp("fill", n->str) == 0) {
- SEEN_NO_DUP(tally, 10);
+ SEEN_NO_DUP(tally, 11);
printf("\tReading fill settings:\n");
for (m = n->children; m != NULL; m = m->next) {
if (m->str != NULL && strcmp("arc_segments", m->str) == 0) {
@@ -1976,7 +1965,7 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
}
}
} else if (n->str != NULL && strcmp("min_thickness", n->str) == 0) {
- SEEN_NO_DUP(tally, 11);
+ SEEN_NO_DUP(tally, 12);
if (n->children != NULL && n->children->str != NULL) {
pcb_printf("\tzone min_thickness:\t'%s'\n", (n->children->str));
} else {
@@ -1991,15 +1980,16 @@ static int kicad_parse_zone(read_state_t *st, gsxl_node_t *subtree)
}
}
}
- /* required = 1; BV(2) | BV(3) | BV(4) | BV(7) | BV(8);
- if ((tally & required) == required) { */ /* has location, layer, size and stroke thickness at a minimum */
+
+ required = BV(10);
+ if ((tally & required) == required) { /* has location, layer, size and stroke thickness at a minimum */
if (polygon != NULL) {
pcb_add_polygon_on_layer(&st->PCB->Data->Layer[PCBLayer], polygon);
- InitClip(st->PCB->Data, &st->PCB->Data->Layer[PCBLayer], polygon);
+ pcb_poly_init_clip(st->PCB->Data, &st->PCB->Data->Layer[PCBLayer], polygon);
}
return 0;
-/*}
- return -1; */
+ }
+ return -1;
}
@@ -2036,7 +2026,7 @@ static int kicad_parse_pcb(read_state_t *st)
return kicad_foreach_dispatch(st, st->dom.root->children, disp);
}
-int io_kicad_read_pcb(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest)
+int io_kicad_read_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest)
{
int c, readres = 0;
read_state_t st;
@@ -2076,6 +2066,26 @@ int io_kicad_read_pcb(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf
#warning TODO: free the layer hash
-printf("readres=%d\n", readres);
return readres;
}
+
+int io_kicad_test_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, FILE *f)
+{
+ char line[1024], *s;
+
+ while(!(feof(f))) {
+ if (fgets(line, sizeof(line), f) != NULL) {
+ s = line;
+ while(isspace(*s)) s++; /* strip leading whitespace */
+ if (strncmp(s, "(kicad_pcb", 10) == 0) /* valid root */
+ return 1;
+ if ((*s == '\r') || (*s == '\n') || (*s == '#') || (*s == '\0')) /* ignore empty lines and comments */
+ continue;
+ /* non-comment, non-empty line - and we don't have our root -> it's not an s-expression */
+ return 0;
+ }
+ }
+
+ /* hit eof before seeing a valid root -> bad */
+ return 0;
+}
diff --git a/src_plugins/io_kicad/read.h b/src_plugins/io_kicad/read.h
index c875baa..5396f03 100644
--- a/src_plugins/io_kicad/read.h
+++ b/src_plugins/io_kicad/read.h
@@ -27,7 +27,7 @@
#include "config.h"
#include <stdio.h>
-#include "global.h"
#include "data.h"
-int io_kicad_read_pcb(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest);
+int io_kicad_test_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, FILE *f);
+int io_kicad_read_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest);
diff --git a/src_plugins/io_kicad/uniq_name.c b/src_plugins/io_kicad/uniq_name.c
index fccd940..27ebc98 100644
--- a/src_plugins/io_kicad/uniq_name.c
+++ b/src_plugins/io_kicad/uniq_name.c
@@ -2,6 +2,7 @@
#include <string.h>
#include <stdio.h>
#include <genht/hash.h>
+#include "config.h"
#include "uniq_name.h"
#include "compat_misc.h"
diff --git a/src_plugins/io_kicad/write.c b/src_plugins/io_kicad/write.c
index 5c2d1f7..d38e073 100644
--- a/src_plugins/io_kicad/write.c
+++ b/src_plugins/io_kicad/write.c
@@ -25,6 +25,8 @@
*
*/
#include <math.h>
+#include "config.h"
+#include "board.h"
#include "plug_io.h"
#include "error.h"
#include "uniq_name.h"
@@ -33,9 +35,9 @@
#include "layer.h"
#include "const.h"
#include "netlist.h"
-#include "misc.h"
+#include "obj_all.h"
-#define F2S(OBJ, TYPE) flags_to_string ((OBJ)->Flags, TYPE)
+#define F2S(OBJ, TYPE) pcb_strflg_f2s((OBJ)->Flags, TYPE)
/* layer "0" is first copper layer = "0. Back - Solder"
* and layer "15" is "15. Front - Component"
@@ -44,7 +46,7 @@
*/
/* generates a line by line listing of the elements being saved */
-static int io_kicad_write_element_index(FILE * FP, DataTypePtr Data);
+static int io_kicad_write_element_index(FILE * FP, pcb_data_t *Data);
/* generates text for the kicad layer provided */
static char * kicad_sexpr_layer_to_text(int layer);
@@ -53,7 +55,7 @@ static char * kicad_sexpr_layer_to_text(int layer);
static int write_kicad_layout_via_drill_size(FILE * FP, pcb_cardinal_t indentation);
/* writes the buffer to file */
-int io_kicad_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff)
+int io_kicad_write_buffer(pcb_plug_io_t *ctx, FILE * FP, pcb_buffer_t *buff)
{
/*fputs("io_kicad_legacy_write_buffer()", FP); */
@@ -65,19 +67,19 @@ int io_kicad_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff)
/* WriteViaData(FP, buff->Data); */
- WriteElementData(FP, buff->Data, "kicadl");
+ pcb_write_element_data(FP, buff->Data, "kicadl");
/*
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
WriteLayerData(FP, i, &(buff->Data->Layer[i]));
*/
- return (STATUS_OK);
+ return (0);
}
/* ---------------------------------------------------------------------------
- * writes PCB to file
+ * writes PCB to file in s-expression format
*/
-int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
+int io_kicad_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
{
/* this is the first step in exporting a layout;
* creating a kicad module containing the elements used in the layout
@@ -90,28 +92,26 @@ int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, cons
pcb_cardinal_t i;
int physicalLayerCount = 0;
int kicadLayerCount = 0;
- int silkLayerCount= 0;
- int outlineLayerCount = 0;
int layer = 0;
int currentKicadLayer = 0;
int currentGroup = 0;
- Coord outlineThickness = PCB_MIL_TO_COORD(10);
+ pcb_coord_t outlineThickness = PCB_MIL_TO_COORD(10);
int bottomCount;
- int *bottomLayers;
+ pcb_layer_id_t *bottomLayers;
int innerCount;
- int *innerLayers;
+ pcb_layer_id_t *innerLayers;
int topCount;
- int *topLayers;
+ pcb_layer_id_t *topLayers;
int bottomSilkCount;
- int *bottomSilk;
+ pcb_layer_id_t *bottomSilk;
int topSilkCount;
- int *topSilk;
+ pcb_layer_id_t *topSilk;
int outlineCount;
- int *outlineLayers;
+ pcb_layer_id_t *outlineLayers;
- Coord LayoutXOffset;
- Coord LayoutYOffset;
+ pcb_coord_t LayoutXOffset;
+ pcb_coord_t LayoutYOffset;
/* Kicad expects a layout "sheet" size to be specified in mils, and A4, A3 etc... */
int A4HeightMil = 8267;
@@ -181,16 +181,21 @@ int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, cons
layer = 0;
if (physicalLayerCount >= 1) {
- fprintf(FP, "%*s(%d bottom_side.Cu signal)\n", baseSExprIndent + 2, "", layer);
+ fprintf(FP, "%*s(%d B.Cu signal)\n", baseSExprIndent + 2, "", layer);
}
if (physicalLayerCount > 1) { /* seems we need to ignore layers > 16 due to kicad limitation */
for (layer = 1; (layer < (kicadLayerCount - 1)) && (layer < 15); layer++ ) {
fprintf(FP, "%*s(%d Inner%d.Cu signal)\n", baseSExprIndent + 2, "", layer, layer);
}
- fprintf(FP, "%*s(15 top_side.Cu signal)\n", baseSExprIndent + 2, "");
+ fprintf(FP, "%*s(15 F.Cu signal)\n", baseSExprIndent + 2, "");
}
+ fprintf(FP, "%*s(18 B.Paste user)\n", baseSExprIndent + 2, "");
+ fprintf(FP, "%*s(19 F.Paste user)\n", baseSExprIndent + 2, "");
fprintf(FP, "%*s(20 B.SilkS user)\n", baseSExprIndent + 2, "");
fprintf(FP, "%*s(21 F.SilkS user)\n", baseSExprIndent + 2, "");
+ fprintf(FP, "%*s(22 B.Mask user)\n", baseSExprIndent + 2, "");
+ fprintf(FP, "%*s(23 F.Mask user)\n", baseSExprIndent + 2, "");
+
fprintf(FP, "%*s(28 Edge.Cuts user)\n", baseSExprIndent + 2, "");
fprintf(FP, "%*s)\n", baseSExprIndent, "");
@@ -213,45 +218,58 @@ int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, cons
currentGroup = 0;
/* figure out which pcb layers are bottom copper and make a list */
- bottomLayers = malloc(sizeof(int) * physicalLayerCount);
- /*int bottomLayers[physicalLayerCount];*/
- bottomCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0);
- pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, physicalLayerCount);
+ bottomCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0);
+ if (bottomCount > 0 ) {
+ bottomLayers = malloc(sizeof(pcb_layer_id_t) * bottomCount);
+ pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottomCount);
+ } else {
+ bottomLayers = NULL;
+ }
/* figure out which pcb layers are internal copper layers and make a list */
- innerLayers = malloc(sizeof(int) * physicalLayerCount);
- /*int innerLayers[physicalLayerCount];*/
- innerCount = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0);
- pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, physicalLayerCount);
+ innerCount = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0);
+ if (innerCount > 0 ) {
+ innerLayers = malloc(sizeof(pcb_layer_id_t) * innerCount);
+ pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, innerCount);
+ } else {
+ innerLayers = NULL;
+ }
/* figure out which pcb layers are top copper and make a list */
- topLayers = malloc(sizeof(int) * physicalLayerCount);
- /*int topLayers[physicalLayerCount];*/
- topCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0);
- pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, physicalLayerCount);
-
- silkLayerCount = pcb_layer_group_list(PCB_LYT_SILK, NULL, 0);
+ topCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0);
+ if (topCount > 0 ) {
+ topLayers = malloc(sizeof(pcb_layer_id_t) * topCount);
+ pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, topCount);
+ } else {
+ topLayers = NULL;
+ }
/* figure out which pcb layers are bottom silk and make a list */
- bottomSilk = malloc(sizeof(int) * silkLayerCount);
- /*int bottomSilk[silkLayerCount];*/
- bottomSilkCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0);
- pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, silkLayerCount);
+ bottomSilkCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0);
+ if (bottomSilkCount > 0 ) {
+ bottomSilk = malloc(sizeof(pcb_layer_id_t) * bottomSilkCount);
+ pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottomSilkCount);
+ } else {
+ bottomSilk = NULL;
+ }
/* figure out which pcb layers are top silk and make a list */
- topSilk = malloc(sizeof(int) * silkLayerCount);
- /*int topSilk[silkLayerCount];*/
topSilkCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0);
- pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, silkLayerCount);
-
- /* here we count outline layers */
- outlineLayerCount = pcb_layer_group_list(PCB_LYT_OUTLINE, NULL, 0);
+ if (topSilkCount > 0) {
+ topSilk = malloc(sizeof(pcb_layer_id_t) * topSilkCount);
+ pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, topSilkCount);
+ } else {
+ topSilk = NULL;
+ }
/* figure out which pcb layers are outlines and make a list */
- outlineLayers = malloc(sizeof(int) * outlineLayerCount);
- outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0);
- pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount);
-
+ outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0);
+ if (outlineCount > 0) {
+ outlineLayers = malloc(sizeof(pcb_layer_id_t) * outlineCount);
+ pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount);
+ } else {
+ outlineLayers = NULL;
+ }
/* we now proceed to write the bottom silk lines, arcs, text to the kicad legacy file, using layer 20 */
currentKicadLayer = 20; /* 20 is the bottom silk layer in kicad */
@@ -357,7 +375,7 @@ int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, cons
/* we now proceed to write the outline tracks to the kicad file, layer by layer */
currentKicadLayer = 28; /* 28 is the edge cuts layer in kicad */
- if (outlineCount != 0) {
+ if (outlineCount > 0) {
for (i = 0; i < outlineCount; i++) /* write outline tracks, if any */
{
write_kicad_layout_tracks(FP, currentKicadLayer, &(PCB->Data->Layer[outlineLayers[i]]),
@@ -446,22 +464,34 @@ int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, cons
fputs(")\n",FP); /* finish off the board */
/* now free memory from arrays that were used */
- free(bottomLayers);
- free(innerLayers);
- free(topLayers);
- free(topSilk);
- free(bottomSilk);
- free(outlineLayers);
- return (STATUS_OK);
+ if (bottomCount > 0) {
+ free(bottomLayers);
+ }
+ if (innerCount > 0) {
+ free(innerLayers);
+ }
+ if (topCount > 0) {
+ free(topLayers);
+ }
+ if (topSilkCount > 0) {
+ free(topSilk);
+ }
+ if (bottomSilkCount > 0) {
+ free(bottomSilk);
+ }
+ if (outlineCount > 0) {
+ free(outlineLayers);
+ }
+ return (0);
}
/* ---------------------------------------------------------------------------
* writes (eventually) de-duplicated list of element names in kicad legacy format module $INDEX
*/
-static int io_kicad_write_element_index(FILE * FP, DataTypePtr Data)
+static int io_kicad_write_element_index(FILE * FP, pcb_data_t *Data)
{
gdl_iterator_t eit;
- ElementType *element;
+ pcb_element_t *element;
unm_t group1; /* group used to deal with missing names and provide unique ones if needed */
elementlist_dedup_initializer(ededup);
@@ -500,10 +530,10 @@ static int io_kicad_write_element_index(FILE * FP, DataTypePtr Data)
*/
-int write_kicad_layout_vias(FILE * FP, DataTypePtr Data, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation)
+int write_kicad_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation)
{
gdl_iterator_t it;
- PinType *via;
+ pcb_pin_t *via;
/* write information about vias */
pinlist_foreach(&Data->Via, &it, via) {
fprintf(FP, "%*s", indentation,"");
@@ -518,7 +548,7 @@ static char * kicad_sexpr_layer_to_text(int layer)
{
switch (layer) {
case 0:
- return "bottom_side.Cu";
+ return "B.Cu";
case 1:
return "Inner1.Cu";
case 2:
@@ -548,7 +578,7 @@ static char * kicad_sexpr_layer_to_text(int layer)
case 14:
return "Inner14.Cu";
case 15:
- return "top_side.Cu";
+ return "F.Cu";
case 20:
return "B.SilkS";
case 21:
@@ -568,17 +598,17 @@ static int write_kicad_layout_via_drill_size(FILE * FP, pcb_cardinal_t indentati
}
int write_kicad_layout_tracks(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation)
{
gdl_iterator_t it;
- LineType *line;
+ pcb_line_t *line;
pcb_cardinal_t currentLayer = number;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
/*
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
*/
@@ -606,22 +636,21 @@ int write_kicad_layout_tracks(FILE * FP, pcb_cardinal_t number,
}
int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation)
{
gdl_iterator_t it;
- ArcType *arc;
- ArcType localArc; /* for converting ellipses to circular arcs */
- BoxType *boxResult; /* for figuring out arc ends */
+ pcb_arc_t *arc;
+ pcb_arc_t localArc; /* for converting ellipses to circular arcs */
pcb_cardinal_t currentLayer = number;
- Coord radius, xStart, yStart, xEnd, yEnd;
+ pcb_coord_t radius, xStart, yStart, xEnd, yEnd;
int copperStartX; /* used for mapping geda copper arcs onto kicad copper lines */
int copperStartY; /* used for mapping geda copper arcs onto kicad copper lines */
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
/*
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
*/
@@ -636,7 +665,14 @@ int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number,
radius = arc->Width;
localArc.Height = radius;
}
- boxResult = GetArcEnds(&localArc);
+
+/* Return the x;y coordinate of the endpoint of an arc; if which is 0, return
+ the endpoint that corresponds to StartAngle, else return the end angle's.
+void pcb_arc_get_end(pcb_arc_t *Arc, int which, pcb_coord_t *x, pcb_coord_t *y);
+
+Obsolete: please use pcb_arc_get_end() instead
+pcb_box_t *pcb_arc_get_ends(pcb_arc_t *Arc); */
+
if (arc->Delta == 360.0 || arc->Delta == -360.0 ) { /* it's a circle */
kicadArcShape = 3;
} else { /* it's an arc */
@@ -644,10 +680,12 @@ int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number,
}
xStart = localArc.X + xOffset;
yStart = localArc.Y + yOffset;
- xEnd = boxResult->X2 + xOffset;
- yEnd = boxResult->Y2 + yOffset;
- copperStartX = boxResult->X1 + xOffset;
- copperStartY = boxResult->Y1 + yOffset;
+ pcb_arc_get_end(&localArc, 1, &xEnd, &yEnd);
+ xEnd += xOffset;
+ yEnd += yOffset;
+ pcb_arc_get_end(&localArc, 0, &copperStartX, &copperStartY);
+ copperStartX += xOffset;
+ copperStartY += yOffset;
if ((currentLayer < 16) || (currentLayer == 28)) { /* a copper arc, i.e. track, or edge cut, is unsupported by kicad, and will be exported as a line */
fprintf(FP, "%*s", indentation, "");
pcb_fprintf(FP, "(segment (start %.3mm %.3mm) (end %.3mm %.3mm) (layer %s) (width %.3mm))\n",
@@ -668,32 +706,32 @@ int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number,
}
int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation)
{
- FontType *myfont = &PCB->Font;
- Coord mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */
- Coord defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */
+ pcb_font_t *myfont = &PCB->Font;
+ pcb_coord_t mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */
+ pcb_coord_t defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */
int kicadMirrored = 1; /* 1 is not mirrored, 0 is mirrored */
- Coord defaultXSize;
- Coord defaultYSize;
- Coord strokeThickness;
+ pcb_coord_t defaultXSize;
+ pcb_coord_t defaultYSize;
+ pcb_coord_t strokeThickness;
int rotation;
- Coord textOffsetX;
- Coord textOffsetY;
- Coord halfStringWidth;
- Coord halfStringHeight;
+ pcb_coord_t textOffsetX;
+ pcb_coord_t textOffsetY;
+ pcb_coord_t halfStringWidth;
+ pcb_coord_t halfStringHeight;
int localFlag;
gdl_iterator_t it;
- TextType *text;
+ pcb_text_t *text;
pcb_cardinal_t currentLayer = number;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
/*
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
*/
@@ -787,7 +825,7 @@ int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number,
/* ---------------------------------------------------------------------------
* writes element data in kicad legacy format for use in a .mod library
*/
-int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
+int io_kicad_write_element(pcb_plug_io_t *ctx, FILE * FP, pcb_data_t *Data)
{
@@ -799,12 +837,11 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
gdl_iterator_t eit;
- LineType *line;
- ArcType *arc;
- ElementType *element;
- BoxType *boxResult;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ pcb_element_t *element;
- Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */
+ pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */
unm_t group1; /* group used to deal with missing names and provide unique ones if needed */
const char * currentElementName;
@@ -815,8 +852,8 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
elementlist_foreach(&Data->Element, &eit, element) {
gdl_iterator_t it;
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
elementlist_dedup_skip(ededup, element); /* skip duplicate elements */
@@ -833,17 +870,17 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
information
fprintf(FP, "\nDS %s ", F2S(element, PCB_TYPE_ELEMENT));
- PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_REFDES(element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_VALUE(element)));
pcb_fprintf(FP, " %mm %mm %mm %mm %d %d %s]\n(\n",
element->MarkX, element->MarkY,
- DESCRIPTION_TEXT(element).X - element->MarkX,
- DESCRIPTION_TEXT(element).Y - element->MarkY,
- DESCRIPTION_TEXT(element).Direction,
- DESCRIPTION_TEXT(element).Scale, F2S(&(DESCRIPTION_TEXT(element)), PCB_TYPE_ELEMENT_NAME));
+ PCB_ELEM_TEXT_DESCRIPTION(element).X - element->MarkX,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Y - element->MarkY,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Direction,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Scale, F2S(&(PCB_ELEM_TEXT_DESCRIPTION(element)), PCB_TYPE_ELEMENT_NAME));
*/
@@ -871,11 +908,8 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
}
arclist_foreach(&element->Arc, &it, arc) {
- boxResult = GetArcEnds(arc);
- arcStartX = boxResult->X1;
- arcStartY = boxResult->Y1;
- arcEndX = boxResult->X2;
- arcEndY = boxResult->Y2;
+ pcb_arc_get_end(arc, 0, &arcStartX, &arcStartY);
+ pcb_arc_get_end(arc, 1, &arcEndX, &arcEndY);
if ((arc->Delta == 360.0) || (arc->Delta == -360.0)) { /* it's a circle */
pcb_fprintf(FP, "DC %.3mm %.3mm %.3mm %.3mm %.3mm ",
arc->X - element->MarkX, /* x_1 centre */
@@ -915,9 +949,9 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
pin->Y - element->MarkY);
fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pin->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Number));
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
fputs(" R ",FP); /* square */
} else {
fputs(" C ",FP); /* circular */
@@ -933,7 +967,7 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
fputs("Ne 0 \"\"\n",FP); /* library parts have empty net descriptors */
/*
- PrintQuotedString(FP, (char *) EMPTY(pin->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Name));
fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN));
*/
fputs("$EndPAD\n",FP);
@@ -946,7 +980,7 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
(pad->Point1.Y + pad->Point2.Y)/2- element->MarkY);
fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pad->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Number));
fputs(" R ",FP); /* rectangular, not a pin */
if ((pad->Point1.X-pad->Point2.X) <= 0
@@ -995,19 +1029,19 @@ int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
* writes netlist data in kicad legacy format for use in a layout .brd file
*/
-int write_kicad_equipotential_netlists(FILE * FP, PCBTypePtr Layout, pcb_cardinal_t indentation)
+int write_kicad_equipotential_netlists(FILE * FP, pcb_board_t *Layout, pcb_cardinal_t indentation)
{
int n; /* code mostly lifted from netlist.c */
int netNumber;
- LibraryMenuTypePtr menu;
- LibraryEntryTypePtr netlist;
+ pcb_lib_menu_t *menu;
+ pcb_lib_entry_t *netlist;
/* first we write a default netlist for the 0 net, which is for unconnected pads in pcbnew */
fprintf(FP, "\n%*s(net 0 \"\")\n", indentation, "");
/* now we step through any available netlists and generate descriptors */
- for (n = 0, netNumber = 1; n < Layout->NetlistLib[NETLIST_EDITED].MenuN; n++, netNumber ++) {
- menu = &Layout->NetlistLib[NETLIST_EDITED].Menu[n];
+ for (n = 0, netNumber = 1; n < Layout->NetlistLib[PCB_NETLIST_EDITED].MenuN; n++, netNumber ++) {
+ menu = &Layout->NetlistLib[PCB_NETLIST_EDITED].Menu[n];
netlist = &menu->Entry[0];
if (netlist != NULL) {
fprintf(FP, "%*s(net %d %s)\n", indentation, "", netNumber, pcb_netlist_name(menu)); /* netlist 0 was used for unconnected pads */
@@ -1031,23 +1065,23 @@ int write_kicad_equipotential_netlists(FILE * FP, PCBTypePtr Layout, pcb_cardina
/* ---------------------------------------------------------------------------
* writes element data in kicad legacy format for use in a layout .brd file
*/
-int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation)
+int write_kicad_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation)
{
gdl_iterator_t eit;
- LineType *line;
- ArcType *arc;
- Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */
- Coord xPos, yPos;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */
+ pcb_coord_t xPos, yPos;
- ElementType *element;
+ pcb_element_t *element;
unm_t group1; /* group used to deal with missing names and provide unique ones if needed */
const char * currentElementName;
const char * currentElementRef;
const char * currentElementVal;
- LibraryMenuTypePtr current_pin_menu;
- LibraryMenuTypePtr current_pad_menu;
+ pcb_lib_menu_t *current_pin_menu;
+ pcb_lib_menu_t *current_pad_menu;
int silkLayer = 21; /* hard coded default, 20 is bottom silk */
int copperLayer = 15; /* hard coded default, 0 is bottom copper */
@@ -1058,8 +1092,8 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
elementlist_foreach(&Data->Element, &eit, element) {
gdl_iterator_t it;
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
/* elementlist_dedup_skip(ededup, element); */
/* let's not skip duplicate elements for layout export*/
@@ -1075,23 +1109,23 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
xPos = element->MarkX + xOffset;
yPos = element->MarkY + yOffset;
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, element)) {
+ silkLayer = 21; /* default */
+ copperLayer = 15; /* default */
+
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element)) {
silkLayer = 20;
copperLayer = 0;
- } else {
- silkLayer = 21;
- copperLayer = 15;
}
currentElementName = unm_name(&group1, element->Name[0].TextString, element);
if (currentElementName == NULL) {
currentElementName = "unknown";
}
- currentElementRef = element->Name[NAMEONPCB_INDEX].TextString;
+ currentElementRef = element->Name[PCB_ELEMNAME_IDX_REFDES].TextString;
if (currentElementRef == NULL) {
currentElementRef = "unknown";
}
- currentElementVal = element->Name[VALUE_INDEX].TextString;
+ currentElementVal = element->Name[PCB_ELEMNAME_IDX_VALUE].TextString;
if (currentElementVal == NULL) {
currentElementVal = "unknown";
}
@@ -1100,18 +1134,23 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
fprintf(FP, "(module %s (layer %s) (tedit 4E4C0E65) (tstamp 5127A136)\n",
currentElementName, kicad_sexpr_layer_to_text(copperLayer));
fprintf(FP, "%*s", indentation + 2, "");
- pcb_fprintf(FP, "(at %.3mm %.3mm)\n", xPos, yPos);
+ pcb_fprintf(FP, "(at %.3mm %.3mm)\n", xPos, yPos);
fprintf(FP, "%*s", indentation + 2, "");
- pcb_fprintf(FP, "(fp_text reference %s (at 0 0.127) (layer %s)\n",
- currentElementRef, kicad_sexpr_layer_to_text(silkLayer));
+
+ pcb_fprintf(FP, "(fp_text reference %s (at 0.0 -2.56) ", currentElementRef);
+ pcb_fprintf(FP, "(layer %s)\n", kicad_sexpr_layer_to_text(silkLayer));
+
fprintf(FP, "%*s", indentation + 4, "");
fprintf(FP, "(effects (font (size 1.397 1.27) (thickness 0.2032)))\n");
fprintf(FP, "%*s)\n", indentation + 2, "");
fprintf(FP, "%*s", indentation + 2, "");
- pcb_fprintf(FP, "(fp_text value %s (at 0 0.127) (layer %s)\n",
- currentElementVal, kicad_sexpr_layer_to_text(silkLayer));
+ printf("Element SilkLayer: %s\n", kicad_sexpr_layer_to_text(silkLayer));
+
+ pcb_fprintf(FP, "(fp_text value %s (at 0.0 -1.27) ", currentElementVal);
+ pcb_fprintf(FP, "(layer %s)\n", kicad_sexpr_layer_to_text(silkLayer));
+
fprintf(FP, "%*s", indentation + 4, "");
fprintf(FP, "(effects (font (size 1.397 1.27) (thickness 0.2032)))\n");
fprintf(FP, "%*s)\n", indentation + 2, "");
@@ -1129,11 +1168,8 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
arclist_foreach(&element->Arc, &it, arc) {
- BoxType *boxResult = GetArcEnds(arc);
- arcStartX = boxResult->X1;
- arcStartY = boxResult->Y1;
- arcEndX = boxResult->X2;
- arcEndY = boxResult->Y2;
+ pcb_arc_get_end(arc, 0, &arcStartX, &arcStartY);
+ pcb_arc_get_end(arc, 1, &arcEndX, &arcEndY);
if ((arc->Delta == 360.0) || (arc->Delta == -360.0)) { /* it's a circle */
fprintf(FP, "%*s", indentation +2, "");
@@ -1159,8 +1195,8 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
pinlist_foreach(&element->Pin, &it, pin) {
fprintf(FP, "%*s", indentation + 2, "");
fputs("(pad ", FP);
- PrintQuotedString(FP, (char *) EMPTY(pin->Number));
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Number));
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
fputs(" thru_hole rect ",FP); /* square */
} else {
fputs(" thru_hole circle ",FP); /* circular */
@@ -1168,7 +1204,7 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
pcb_fprintf(FP, "(at %.3mm %.3mm)", /* positions of pad */
pin->X - element->MarkX,
pin->Y - element->MarkY);
- /* PrintQuotedString(FP, (char *) EMPTY(pin->Number)); */
+ /* pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Number)); */
pcb_fprintf(FP, " (size %.3mm %.3mm)", pin->Thickness, pin->Thickness); /* height = width */
/* drill details; size */
pcb_fprintf(FP, " (drill %.3mm)\n", pin->DrillingHole);
@@ -1183,56 +1219,55 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
}
fprintf(FP, "%*s)\n", indentation + 2, "");
/*
- PrintQuotedString(FP, (char *) EMPTY(pin->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Name));
fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN));
*/
}
padlist_foreach(&element->Pad, &it, pad) {
- fputs("$PAD\n",FP); /* start pad descriptor for an smd pad */
-
- pcb_fprintf(FP, "Po %.3mm %.3mm\n", /* positions of pad */
+ fprintf(FP, "%*s", indentation + 2, "");
+ fputs("(pad ", FP);
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Number));
+ fputs(" smd rect ",FP); /* square for now */
+ pcb_fprintf(FP, "(at %.3mm %.3mm)", /* positions of pad */
(pad->Point1.X + pad->Point2.X)/2- element->MarkX,
(pad->Point1.Y + pad->Point2.Y)/2- element->MarkY);
-
- fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pad->Number));
- fputs(" R ",FP); /* rectangular, not a pin */
-
+ pcb_fprintf(FP, " (size ");
if ((pad->Point1.X-pad->Point2.X) <= 0
&& (pad->Point1.Y-pad->Point2.Y) <= 0 ) {
- pcb_fprintf(FP, "%.0mk %.0mk ",
+ pcb_fprintf(FP, "%.3mm %.3mm)\n",
pad->Point2.X-pad->Point1.X + pad->Thickness, /* width */
pad->Point2.Y-pad->Point1.Y + pad->Thickness); /* height */
} else if ((pad->Point1.X-pad->Point2.X) <= 0
&& (pad->Point1.Y-pad->Point2.Y) > 0 ) {
- pcb_fprintf(FP, "%.0mk %.0mk ",
+ pcb_fprintf(FP, "%.3mm %.3mm)\n",
pad->Point2.X-pad->Point1.X + pad->Thickness, /* width */
pad->Point1.Y-pad->Point2.Y + pad->Thickness); /* height */
} else if ((pad->Point1.X-pad->Point2.X) > 0
&& (pad->Point1.Y-pad->Point2.Y) > 0 ) {
- pcb_fprintf(FP, "%.0mk %.0mk ",
+ pcb_fprintf(FP, "%.3mm %.3mm)\n",
pad->Point1.X-pad->Point2.X + pad->Thickness, /* width */
pad->Point1.Y-pad->Point2.Y + pad->Thickness); /* height */
} else if ((pad->Point1.X-pad->Point2.X) > 0
&& (pad->Point1.Y-pad->Point2.Y) <= 0 ) {
- pcb_fprintf(FP, "%.0mk %.0mk ",
+ pcb_fprintf(FP, "%.3mm %.3mm)\n",
pad->Point1.X-pad->Point2.X + pad->Thickness, /* width */
pad->Point2.Y-pad->Point1.Y + pad->Thickness); /* height */
}
- fputs("0 0 0\n",FP); /* deltaX deltaY Orientation as float in decidegrees */
-
- fputs("Dr 0 0 0\n",FP); /* drill details; zero size; x,y pos vs pad location */
-
- fputs("At SMD N 00888000\n", FP); /* SMD pin, need to use right layer mask */
-
- current_pad_menu = pcb_netlist_find_net4pad(Layout, pad);
- if ((current_pad_menu != NULL) && (pcb_netlist_net_idx(Layout, current_pad_menu) != PCB_NETLIST_INVALID_INDEX)) {
- fprintf(FP, "Ne %d \"%s\"\n", (1 + pcb_netlist_net_idx(Layout, current_pad_menu)), pcb_netlist_name(current_pad_menu)); /* library parts have empty net descriptors, in a .brd they don't */
+ fprintf(FP, "%*s", indentation + 4, "");
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad)) {
+ fprintf(FP, "(layers B.Cu B.Paste B.Mask)\n"); /* May break if odd layer names */
} else {
- fprintf(FP, "Ne 0 \"\"\n"); /* a net number of 0 indicates an unconnected pad in pcbnew */
- }
+ fprintf(FP, "(layers F.Cu F.Paste F.Mask)\n"); /* May break if odd layer names */
+ }
+ current_pin_menu = pcb_netlist_find_net4pad(Layout, pad);
+ fprintf(FP, "%*s", indentation + 4, "");
+ if ((current_pin_menu != NULL) && (pcb_netlist_net_idx(Layout, current_pin_menu) != PCB_NETLIST_INVALID_INDEX)) {
+ fprintf(FP, "(net %d \"%s\")\n", (1 + pcb_netlist_net_idx(Layout, current_pin_menu)), pcb_netlist_name(current_pin_menu)); /* library parts have empty net descriptors, in a .brd they don't */
+ } else {
+ fprintf(FP, "(net 0 \"\")\n"); /* unconnected pads have zero for net */
+ }
fprintf(FP, "%*s)\n", indentation + 2, "");
}
@@ -1253,15 +1288,15 @@ int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data,
*/
int write_kicad_layout_polygons(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation)
{
int i, j;
gdl_iterator_t it;
- PolygonType *polygon;
+ pcb_polygon_t *polygon;
pcb_cardinal_t currentLayer = number;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
int localFlag = 0;
polylist_foreach(&layer->Polygon, &it, polygon) {
if (polygon->HoleIndexN == 0) { /* no holes defined within polygon, which we implement support for first */
diff --git a/src_plugins/io_kicad/write.h b/src_plugins/io_kicad/write.h
index 49fb025..f166ead 100644
--- a/src_plugins/io_kicad/write.h
+++ b/src_plugins/io_kicad/write.h
@@ -27,22 +27,21 @@
#include "config.h"
#include <stdio.h>
-#include "global.h"
#include "data.h"
-int io_kicad_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data);
-int io_kicad_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff);
-int io_kicad_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency);
+int io_kicad_write_element(pcb_plug_io_t *ctx, FILE * FP, pcb_data_t *Data);
+int io_kicad_write_buffer(pcb_plug_io_t *ctx, FILE * FP, pcb_buffer_t *buff);
+int io_kicad_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency);
int write_kicad_module_header(FILE * FP, pcb_cardinal_t indentation);
int write_kicad_layout_header(FILE * FP, pcb_cardinal_t indentation);
-int write_kicad_layout_vias(FILE * FP, DataTypePtr Data, Coord MaxWidth, Coord MaxHeight, pcb_cardinal_t indentation);
-int write_kicad_layout_tracks(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer,
- Coord MaxWidth, Coord MaxHeight, pcb_cardinal_t indentation);
-int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer,
- Coord xOffset, Coord yOffset, pcb_cardinal_t indentation);
-int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer,
- Coord xOffset, Coord yOffset, pcb_cardinal_t indentation);
-int write_kicad_equipotential_netlists(FILE * FP, PCBTypePtr Layout, pcb_cardinal_t indentation);
-int write_kicad_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation);
-int write_kicad_layout_polygons(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation);
+int write_kicad_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t MaxWidth, pcb_coord_t MaxHeight, pcb_cardinal_t indentation);
+int write_kicad_layout_tracks(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer,
+ pcb_coord_t MaxWidth, pcb_coord_t MaxHeight, pcb_cardinal_t indentation);
+int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer,
+ pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation);
+int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer,
+ pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation);
+int write_kicad_equipotential_netlists(FILE * FP, pcb_board_t *Layout, pcb_cardinal_t indentation);
+int write_kicad_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation);
+int write_kicad_layout_polygons(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation);
diff --git a/src_plugins/io_kicad_legacy/Makefile b/src_plugins/io_kicad_legacy/Makefile
index f44b79c..4879992 100644
--- a/src_plugins/io_kicad_legacy/Makefile
+++ b/src_plugins/io_kicad_legacy/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_io_kicad_legacy
+ cd ../../src && $(MAKE) mod_io_kicad_legacy
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/io_kicad_legacy/README b/src_plugins/io_kicad_legacy/README
index 9154d12..3009f4c 100644
--- a/src_plugins/io_kicad_legacy/README
+++ b/src_plugins/io_kicad_legacy/README
@@ -1,5 +1,5 @@
-Load and save the design and elements in Kicad's legacy format.
+Export the design and elements in Kicad's legacy format.
-#state: work-in-progress
+#state: works
#default: buildin
#implements: io
diff --git a/src_plugins/io_kicad_legacy/io_kicad_legacy.c b/src_plugins/io_kicad_legacy/io_kicad_legacy.c
index 407df34..b47a834 100644
--- a/src_plugins/io_kicad_legacy/io_kicad_legacy.c
+++ b/src_plugins/io_kicad_legacy/io_kicad_legacy.c
@@ -24,14 +24,13 @@
*/
#include "config.h"
-#include "global.h"
#include "plugins.h"
#include "plug_io.h"
#include "write.h"
-static plug_io_t io_kicad_legacy;
+static pcb_plug_io_t io_kicad_legacy;
-int io_kicad_legacy_fmt(plug_io_t *ctx, plug_iot_t typ, int wr, const char *fmt)
+int io_kicad_legacy_fmt(pcb_plug_io_t *ctx, pcb_plug_iot_t typ, int wr, const char *fmt)
{
if (strcmp(ctx->description, fmt) == 0)
return 200;
@@ -63,9 +62,13 @@ pcb_uninit_t hid_io_kicad_legacy_init(void)
io_kicad_legacy.write_pcb = io_kicad_legacy_write_pcb;
io_kicad_legacy.default_fmt = "kicadl";
io_kicad_legacy.description = "Kicad, legacy format";
- io_kicad_legacy.save_preference_prio = 90;
+ io_kicad_legacy.save_preference_prio = 70;
+ io_kicad_legacy.default_extension = ".brd";
+ io_kicad_legacy.fp_extension = ".mod";
+ io_kicad_legacy.mime_type = "application/x-kicad-pcbnew";
- HOOK_REGISTER(plug_io_t, plug_io_chain, &io_kicad_legacy);
+
+ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &io_kicad_legacy);
/* TODO: Alloc plugin-globals here. */
diff --git a/src_plugins/io_kicad_legacy/write.c b/src_plugins/io_kicad_legacy/write.c
index 108d333..f81427a 100644
--- a/src_plugins/io_kicad_legacy/write.c
+++ b/src_plugins/io_kicad_legacy/write.c
@@ -25,6 +25,8 @@
*
*/
#include <math.h>
+#include "config.h"
+#include "board.h"
#include "plug_io.h"
#include "error.h"
#include "../io_kicad/uniq_name.h"
@@ -33,9 +35,9 @@
#include "layer.h"
#include "const.h"
#include "netlist.h"
-#include "misc.h"
+#include "obj_all.h"
-#define F2S(OBJ, TYPE) flags_to_string ((OBJ)->Flags, TYPE)
+#define F2S(OBJ, TYPE) pcb_strflg_f2s((OBJ)->Flags, TYPE)
/* layer "0" is first copper layer = "0. Back - Solder"
* and layer "15" is "15. Front - Component"
@@ -44,13 +46,13 @@
*/
/* generates a line by line listing of the elements being saved */
-static int io_kicad_legacy_write_element_index(FILE * FP, DataTypePtr Data);
+static int io_kicad_legacy_write_element_index(FILE * FP, pcb_data_t *Data);
/* generates a default via drill size for the layout */
static int write_kicad_legacy_layout_via_drill_size(FILE * FP);
/* writes the buffer to file */
-int io_kicad_legacy_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff)
+int io_kicad_legacy_write_buffer(pcb_plug_io_t *ctx, FILE * FP, pcb_buffer_t *buff)
{
/*fputs("io_kicad_legacy_write_buffer()", FP); */
@@ -62,19 +64,19 @@ int io_kicad_legacy_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff)
/* WriteViaData(FP, buff->Data); */
- WriteElementData(FP, buff->Data, "kicadl");
+ pcb_write_element_data(FP, buff->Data, "kicadl");
/*
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
WriteLayerData(FP, i, &(buff->Data->Layer[i]));
*/
- return (STATUS_OK);
+ return (0);
}
/* ---------------------------------------------------------------------------
* writes PCB to file
*/
-int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
+int io_kicad_legacy_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
{
/* this is the first step in exporting a layout;
* creating a kicd module containing the elements used in the layout
@@ -83,30 +85,28 @@ int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filenam
/*fputs("io_kicad_legacy_write_pcb()", FP);*/
pcb_cardinal_t i;
- int physicalLayerCount = 0;
int kicadLayerCount = 0;
- int silkLayerCount= 0;
- int outlineLayerCount = 0;
+ int physicalLayerCount = 0;
int layer = 0;
int currentKicadLayer = 0;
int currentGroup = 0;
- Coord outlineThickness = PCB_MIL_TO_COORD(10);
+ pcb_coord_t outlineThickness = PCB_MIL_TO_COORD(10);
int bottomCount;
- int *bottomLayers;
+ pcb_layer_id_t *bottomLayers;
int innerCount;
- int *innerLayers;
+ pcb_layer_id_t *innerLayers;
int topCount;
- int *topLayers;
+ pcb_layer_id_t *topLayers;
int bottomSilkCount;
- int *bottomSilk;
+ pcb_layer_id_t *bottomSilk;
int topSilkCount;
- int *topSilk;
+ pcb_layer_id_t *topSilk;
int outlineCount;
- int *outlineLayers;
+ pcb_layer_id_t *outlineLayers;
- Coord LayoutXOffset;
- Coord LayoutYOffset;
+ pcb_coord_t LayoutXOffset;
+ pcb_coord_t LayoutYOffset;
/* Kicad expects a layout "sheet" size to be specified in mils, and A4, A3 etc... */
int A4HeightMil = 8267;
@@ -210,47 +210,62 @@ int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filenam
currentGroup = 0;
/* figure out which pcb layers are bottom copper and make a list */
- bottomLayers = malloc(sizeof(int) * physicalLayerCount);
- /*int bottomLayers[physicalLayerCount];*/
- bottomCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0);
- pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, physicalLayerCount);
+ bottomCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0);
+ if (bottomCount > 0 ) {
+ bottomLayers = malloc(sizeof(pcb_layer_id_t) * bottomCount);
+ pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottomCount);
+ } else {
+ bottomLayers = NULL;
+ }
/* figure out which pcb layers are internal copper layers and make a list */
- innerLayers = malloc(sizeof(int) * physicalLayerCount);
- /*int innerLayers[physicalLayerCount];*/
- innerCount = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0);
- pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, physicalLayerCount);
+ innerCount = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0);
+ if (innerCount > 0 ) {
+ innerLayers = malloc(sizeof(pcb_layer_id_t) * innerCount);
+ pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, innerCount);
+ } else {
+ innerLayers = NULL;
+ }
/* figure out which pcb layers are top copper and make a list */
- topLayers = malloc(sizeof(int) * physicalLayerCount);
- /*int topLayers[physicalLayerCount];*/
- topCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0);
- pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, physicalLayerCount);
-
- silkLayerCount = pcb_layer_group_list(PCB_LYT_SILK, NULL, 0);
+ topCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0);
+ if (topCount > 0 ) {
+ topLayers = malloc(sizeof(pcb_layer_id_t) * topCount);
+ pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, topCount);
+ } else {
+ topLayers = NULL;
+ }
/* figure out which pcb layers are bottom silk and make a list */
- bottomSilk = malloc(sizeof(int) * silkLayerCount);
- /*int bottomSilk[silkLayerCount];*/
- bottomSilkCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0);
- pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, silkLayerCount);
+ bottomSilkCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0);
+ if (bottomSilkCount > 0 ) {
+ bottomSilk = malloc(sizeof(pcb_layer_id_t) * bottomSilkCount);
+ pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottomSilkCount);
+ } else {
+ bottomSilk = NULL;
+ }
/* figure out which pcb layers are top silk and make a list */
- topSilk = malloc(sizeof(int) * silkLayerCount);
- /*int topSilk[silkLayerCount];*/
topSilkCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0);
- pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, silkLayerCount);
-
- outlineLayerCount = pcb_layer_group_list(PCB_LYT_OUTLINE, NULL, 0);
+ if (topSilkCount > 0) {
+ topSilk = malloc(sizeof(pcb_layer_id_t) * topSilkCount);
+ pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, topSilkCount);
+ } else {
+ topSilk = NULL;
+ }
/* figure out which pcb layers are outlines and make a list */
- outlineLayers = malloc(sizeof(int) * outlineLayerCount);
- outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0);
- pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount);
+ outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0);
+ if (outlineCount > 0) {
+ outlineLayers = malloc(sizeof(pcb_layer_id_t) * outlineCount);
+ pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount);
+ } else {
+ outlineLayers = NULL;
+ }
/* we now proceed to write the outline tracks to the kicad file, layer by layer */
currentKicadLayer = 28; /* 28 is the edge cuts layer in kicad */
- if (outlineCount != 0) {
+ if (outlineCount > 0 ) {
for (i = 0; i < outlineCount; i++) /* write top copper tracks, if any */
{
write_kicad_legacy_layout_tracks(FP, currentKicadLayer, &(PCB->Data->Layer[outlineLayers[i]]),
@@ -311,7 +326,7 @@ int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filenam
} /* 0 is the bottom most track in kicad */
/* we now proceed to write the internal copper text to the kicad file, layer by layer */
- if (innerCount != 0) {
+ if (innerCount > 0) {
currentGroup = pcb_layer_lookup_group(innerLayers[0]);
}
for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper text, group by group */
@@ -363,7 +378,7 @@ int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filenam
} /* 0 is the bottom most track in kicad */
/* we now proceed to write the internal copper tracks to the kicad file, layer by layer */
- if (innerCount != 0) {
+ if (innerCount > 0) {
currentGroup = pcb_layer_lookup_group(innerLayers[0]);
}
for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper tracks, group by group */
@@ -413,7 +428,7 @@ int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filenam
} /* 0 is the bottom most track in kicad */
/* we now proceed to write the internal copper polygons to the kicad file, layer by layer */
- if (innerCount != 0) {
+ if (innerCount > 0) {
currentGroup = pcb_layer_lookup_group(innerLayers[0]);
}
for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper polygons, group by group */
@@ -449,22 +464,34 @@ int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filenam
fputs("$EndBOARD\n",FP);
/* now free memory from arrays that were used */
- free(bottomLayers);
- free(innerLayers);
- free(topLayers);
- free(topSilk);
- free(bottomSilk);
- free(outlineLayers);
- return (STATUS_OK);
+ if (bottomCount > 0) {
+ free(bottomLayers);
+ }
+ if (innerCount > 0) {
+ free(innerLayers);
+ }
+ if (topCount > 0) {
+ free(topLayers);
+ }
+ if (topSilkCount > 0) {
+ free(topSilk);
+ }
+ if (bottomSilkCount > 0) {
+ free(bottomSilk);
+ }
+ if (outlineCount > 0) {
+ free(outlineLayers);
+ }
+ return (0);
}
/* ---------------------------------------------------------------------------
* writes (eventually) de-duplicated list of element names in kicad legacy format module $INDEX
*/
-static int io_kicad_legacy_write_element_index(FILE * FP, DataTypePtr Data)
+static int io_kicad_legacy_write_element_index(FILE * FP, pcb_data_t *Data)
{
gdl_iterator_t eit;
- ElementType *element;
+ pcb_element_t *element;
unm_t group1; /* group used to deal with missing names and provide unique ones if needed */
elementlist_dedup_initializer(ededup);
@@ -503,10 +530,10 @@ static int io_kicad_legacy_write_element_index(FILE * FP, DataTypePtr Data)
*/
-int write_kicad_legacy_layout_vias(FILE * FP, DataTypePtr Data, Coord xOffset, Coord yOffset)
+int write_kicad_legacy_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset)
{
gdl_iterator_t it;
- PinType *via;
+ pcb_pin_t *via;
/* write information about vias */
pinlist_foreach(&Data->Via, &it, via) {
/* pcb_fprintf(FP, "Po 3 %.3mm %.3mm %.3mm %.3mm %.3mm\n",
@@ -527,17 +554,17 @@ static int write_kicad_legacy_layout_via_drill_size(FILE * FP)
}
int write_kicad_legacy_layout_tracks(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset)
{
gdl_iterator_t it;
- LineType *line;
+ pcb_line_t *line;
pcb_cardinal_t currentLayer = number;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
/*
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
*/
@@ -567,22 +594,21 @@ int write_kicad_legacy_layout_tracks(FILE * FP, pcb_cardinal_t number,
}
int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset)
{
gdl_iterator_t it;
- ArcType *arc;
- ArcType localArc; /* for converting ellipses to circular arcs */
- BoxType *boxResult; /* for figuring out arc ends */
+ pcb_arc_t *arc;
+ pcb_arc_t localArc; /* for converting ellipses to circular arcs */
pcb_cardinal_t currentLayer = number;
- Coord radius, xStart, yStart, xEnd, yEnd;
+ pcb_coord_t radius, xStart, yStart, xEnd, yEnd;
int copperStartX; /* used for mapping geda copper arcs onto kicad copper lines */
int copperStartY; /* used for mapping geda copper arcs onto kicad copper lines */
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
/*
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
*/
@@ -597,18 +623,21 @@ int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number,
radius = arc->Width;
localArc.Height = radius;
}
- boxResult = GetArcEnds(&localArc);
if (arc->Delta == 360.0 || arc->Delta == -360.0 ) { /* it's a circle */
kicadArcShape = 3;
} else { /* it's an arc */
kicadArcShape = 2;
}
+
xStart = localArc.X + xOffset;
yStart = localArc.Y + yOffset;
- xEnd = boxResult->X2 + xOffset;
- yEnd = boxResult->Y2 + yOffset;
- copperStartX = boxResult->X1 + xOffset;
- copperStartY = boxResult->Y1 + yOffset;
+ pcb_arc_get_end(&localArc, 1, &xEnd, &yEnd);
+ xEnd += xOffset;
+ yEnd += yOffset;
+ pcb_arc_get_end(&localArc, 0, &copperStartX, &copperStartY);
+ copperStartX += xOffset;
+ copperStartY += yOffset;
+
if (currentLayer < 16) { /* a copper arc, i.e. track, is unsupported by kicad, and will be exported as a line */
kicadArcShape = 0; /* make it a line for copper layers - kicad doesn't do arcs on copper */
pcb_fprintf(FP, "Po %d %.0mk %.0mk %.0mk %.0mk %.0mk\n",
@@ -632,32 +661,32 @@ int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number,
}
int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset)
{
- FontType *myfont = &PCB->Font;
- Coord mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */
- Coord defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */
+ pcb_font_t *myfont = &PCB->Font;
+ pcb_coord_t mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */
+ pcb_coord_t defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */
int kicadMirrored = 1; /* 1 is not mirrored, 0 is mirrored */
- Coord defaultXSize;
- Coord defaultYSize;
- Coord strokeThickness;
+ pcb_coord_t defaultXSize;
+ pcb_coord_t defaultYSize;
+ pcb_coord_t strokeThickness;
int rotation;
- Coord textOffsetX;
- Coord textOffsetY;
- Coord halfStringWidth;
- Coord halfStringHeight;
+ pcb_coord_t textOffsetX;
+ pcb_coord_t textOffsetY;
+ pcb_coord_t halfStringWidth;
+ pcb_coord_t halfStringHeight;
int localFlag;
gdl_iterator_t it;
- TextType *text;
+ pcb_text_t *text;
pcb_cardinal_t currentLayer = number;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
/*
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
*/
@@ -747,7 +776,7 @@ int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number,
/* ---------------------------------------------------------------------------
* writes element data in kicad legacy format for use in a .mod library
*/
-int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
+int io_kicad_legacy_write_element(pcb_plug_io_t *ctx, FILE * FP, pcb_data_t *Data)
{
@@ -759,12 +788,11 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
gdl_iterator_t eit;
- LineType *line;
- ArcType *arc;
- ElementType *element;
- BoxType *boxResult;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ pcb_element_t *element;
- Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */
+ pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */
unm_t group1; /* group used to deal with missing names and provide unique ones if needed */
const char * currentElementName;
@@ -775,8 +803,8 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
elementlist_foreach(&Data->Element, &eit, element) {
gdl_iterator_t it;
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
elementlist_dedup_skip(ededup, element); /* skip duplicate elements */
@@ -793,17 +821,17 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
information
fprintf(FP, "\nDS %s ", F2S(element, PCB_TYPE_ELEMENT));
- PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_REFDES(element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_VALUE(element)));
pcb_fprintf(FP, " %mm %mm %mm %mm %d %d %s]\n(\n",
element->MarkX, element->MarkY,
- DESCRIPTION_TEXT(element).X - element->MarkX,
- DESCRIPTION_TEXT(element).Y - element->MarkY,
- DESCRIPTION_TEXT(element).Direction,
- DESCRIPTION_TEXT(element).Scale, F2S(&(DESCRIPTION_TEXT(element)), PCB_TYPE_ELEMENT_NAME));
+ PCB_ELEM_TEXT_DESCRIPTION(element).X - element->MarkX,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Y - element->MarkY,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Direction,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Scale, F2S(&(PCB_ELEM_TEXT_DESCRIPTION(element)), PCB_TYPE_ELEMENT_NAME));
*/
@@ -831,11 +859,8 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
}
arclist_foreach(&element->Arc, &it, arc) {
- boxResult = GetArcEnds(arc);
- arcStartX = boxResult->X1;
- arcStartY = boxResult->Y1;
- arcEndX = boxResult->X2;
- arcEndY = boxResult->Y2;
+ pcb_arc_get_end(arc, 0, &arcStartX, &arcStartY);
+ pcb_arc_get_end(arc, 1, &arcEndX, &arcEndY);
if ((arc->Delta == 360.0) || (arc->Delta == -360.0)) { /* it's a circle */
pcb_fprintf(FP, "DC %.3mm %.3mm %.3mm %.3mm %.3mm ",
arc->X - element->MarkX, /* x_1 centre */
@@ -875,9 +900,9 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
pin->Y - element->MarkY);
fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pin->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Number));
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
fputs(" R ",FP); /* square */
} else {
fputs(" C ",FP); /* circular */
@@ -893,7 +918,7 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
fputs("Ne 0 \"\"\n",FP); /* library parts have empty net descriptors */
/*
- PrintQuotedString(FP, (char *) EMPTY(pin->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Name));
fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN));
*/
fputs("$EndPAD\n",FP);
@@ -906,7 +931,7 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
(pad->Point1.Y + pad->Point2.Y)/2- element->MarkY);
fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pad->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Number));
fputs(" R ",FP); /* rectangular, not a pin */
if ((pad->Point1.X-pad->Point2.X) <= 0
@@ -955,12 +980,12 @@ int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
* writes netlist data in kicad legacy format for use in a layout .brd file
*/
-int write_kicad_legacy_equipotential_netlists(FILE * FP, PCBTypePtr Layout)
+int write_kicad_legacy_equipotential_netlists(FILE * FP, pcb_board_t *Layout)
{
int n; /* code mostly lifted from netlist.c */
int netNumber;
- LibraryMenuTypePtr menu;
- LibraryEntryTypePtr netlist;
+ pcb_lib_menu_t *menu;
+ pcb_lib_entry_t *netlist;
/* first we write a default netlist for the 0 net, which is for unconnected pads in pcbnew */
fputs("$EQUIPOT\n",FP);
@@ -969,8 +994,8 @@ int write_kicad_legacy_equipotential_netlists(FILE * FP, PCBTypePtr Layout)
fputs("$EndEQUIPOT\n",FP);
/* now we step through any available netlists and generate descriptors */
- for (n = 0, netNumber = 1; n < Layout->NetlistLib[NETLIST_EDITED].MenuN; n++, netNumber ++) {
- menu = &Layout->NetlistLib[NETLIST_EDITED].Menu[n];
+ for (n = 0, netNumber = 1; n < Layout->NetlistLib[PCB_NETLIST_EDITED].MenuN; n++, netNumber ++) {
+ menu = &Layout->NetlistLib[PCB_NETLIST_EDITED].Menu[n];
netlist = &menu->Entry[0];
if (netlist != NULL) {
fputs("$EQUIPOT\n",FP);
@@ -986,20 +1011,20 @@ int write_kicad_legacy_equipotential_netlists(FILE * FP, PCBTypePtr Layout)
/* ---------------------------------------------------------------------------
* writes element data in kicad legacy format for use in a layout .brd file
*/
-int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data, Coord xOffset, Coord yOffset)
+int write_kicad_legacy_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset)
{
gdl_iterator_t eit;
- LineType *line;
- ArcType *arc;
- Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */
- Coord xPos, yPos;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */
+ pcb_coord_t xPos, yPos;
- ElementType *element;
+ pcb_element_t *element;
unm_t group1; /* group used to deal with missing names and provide unique ones if needed */
const char * currentElementName;
- LibraryMenuTypePtr current_pin_menu;
- LibraryMenuTypePtr current_pad_menu;
+ pcb_lib_menu_t *current_pin_menu;
+ pcb_lib_menu_t *current_pad_menu;
int silkLayer = 21; /* hard coded default, 20 is bottom silk */
int copperLayer = 15; /* hard coded default, 0 is bottom copper */
@@ -1010,8 +1035,8 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
elementlist_foreach(&Data->Element, &eit, element) {
gdl_iterator_t it;
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
/* elementlist_dedup_skip(ededup, element); */
/* let's not skip duplicate elements for layout export*/
@@ -1027,7 +1052,7 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
xPos = element->MarkX + xOffset;
yPos = element->MarkY + yOffset;
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, element)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element)) {
silkLayer = 20;
copperLayer = 0;
} else {
@@ -1043,8 +1068,8 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
fputs("Sc 0\n",FP);
fputs("AR\n",FP);
fputs("Op 0 0 0\n",FP);
- fprintf(FP, "T0 0 -4000 600 600 0 120 N V %d N \"%s\"\n", silkLayer, element->Name[NAMEONPCB_INDEX].TextString);
- fprintf(FP, "T1 0 -5000 600 600 0 120 N V %d N \"%s\"\n", silkLayer, element->Name[VALUE_INDEX].TextString);
+ fprintf(FP, "T0 0 -4000 600 600 0 120 N V %d N \"%s\"\n", silkLayer, element->Name[PCB_ELEMNAME_IDX_REFDES].TextString);
+ fprintf(FP, "T1 0 -5000 600 600 0 120 N V %d N \"%s\"\n", silkLayer, element->Name[PCB_ELEMNAME_IDX_VALUE].TextString);
pinlist_foreach(&element->Pin, &it, pin) {
fputs("$PAD\n",FP); /* start pad descriptor for a pin */
@@ -1053,9 +1078,9 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
pin->Y - element->MarkY);
fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pin->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Number));
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
fputs(" R ",FP); /* square */
} else {
fputs(" C ",FP); /* circular */
@@ -1076,7 +1101,7 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
fprintf(FP, "Ne 0 \"\"\n"); /* unconnected pads have zero for net */
}
/*
- PrintQuotedString(FP, (char *) EMPTY(pin->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Name));
fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN));
*/
fputs("$EndPAD\n",FP);
@@ -1089,7 +1114,7 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
(pad->Point1.Y + pad->Point2.Y)/2- element->MarkY);
fputs("Sh ",FP); /* pin shape descriptor */
- PrintQuotedString(FP, (char *) EMPTY(pad->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Number));
fputs(" R ",FP); /* rectangular, not a pin */
if ((pad->Point1.X-pad->Point2.X) <= 0
@@ -1142,11 +1167,8 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
arclist_foreach(&element->Arc, &it, arc) {
- BoxType *boxResult = GetArcEnds(arc);
- arcStartX = boxResult->X1;
- arcStartY = boxResult->Y1;
- arcEndX = boxResult->X2;
- arcEndY = boxResult->Y2;
+ pcb_arc_get_end(arc, 0, &arcStartX, &arcStartY);
+ pcb_arc_get_end(arc, 1, &arcEndX, &arcEndY);
if ((arc->Delta == 360.0) || (arc->Delta == -360.0)) { /* it's a circle */
pcb_fprintf(FP, "DC %.0mk %.0mk %.0mk %.0mk %.0mk ",
@@ -1183,15 +1205,15 @@ int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr
*/
int write_kicad_legacy_layout_polygons(FILE * FP, pcb_cardinal_t number,
- LayerTypePtr layer, Coord xOffset, Coord yOffset)
+ pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset)
{
int i, j;
gdl_iterator_t it;
- PolygonType *polygon;
+ pcb_polygon_t *polygon;
pcb_cardinal_t currentLayer = number;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
int localFlag = 0;
polylist_foreach(&layer->Polygon, &it, polygon) {
if (polygon->HoleIndexN == 0) { /* no holes defined within polygon, which we implement support for first */
diff --git a/src_plugins/io_kicad_legacy/write.h b/src_plugins/io_kicad_legacy/write.h
index 16461c8..a8e834b 100644
--- a/src_plugins/io_kicad_legacy/write.h
+++ b/src_plugins/io_kicad_legacy/write.h
@@ -27,22 +27,21 @@
#include "config.h"
#include <stdio.h>
-#include "global.h"
#include "data.h"
-int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data);
-int io_kicad_legacy_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff);
-int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency);
+int io_kicad_legacy_write_element(pcb_plug_io_t *ctx, FILE * FP, pcb_data_t *Data);
+int io_kicad_legacy_write_buffer(pcb_plug_io_t *ctx, FILE * FP, pcb_buffer_t *buff);
+int io_kicad_legacy_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency);
int write_kicad_legacy_module_header(FILE * FP);
int write_kicad_legacy_layout_header(FILE * FP);
-int write_kicad_legacy_layout_vias(FILE * FP, DataTypePtr Data, Coord MaxWidth, Coord MaxHeight);
-int write_kicad_legacy_layout_tracks(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer,
- Coord MaxWidth, Coord MaxHeight);
-int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer,
- Coord xOffset, Coord yOffset);
-int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer,
- Coord xOffset, Coord yOffset);
-int write_kicad_legacy_equipotential_netlists(FILE * FP, PCBTypePtr Layout);
-int write_kicad_legacy_layout_elements(FILE * FP, PCBTypePtr Layout, DataTypePtr Data, Coord xOffset, Coord yOffset);
-int write_kicad_legacy_layout_polygons(FILE * FP, pcb_cardinal_t number, LayerTypePtr layer, Coord xOffset, Coord yOffset);
+int write_kicad_legacy_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t MaxWidth, pcb_coord_t MaxHeight);
+int write_kicad_legacy_layout_tracks(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer,
+ pcb_coord_t MaxWidth, pcb_coord_t MaxHeight);
+int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer,
+ pcb_coord_t xOffset, pcb_coord_t yOffset);
+int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer,
+ pcb_coord_t xOffset, pcb_coord_t yOffset);
+int write_kicad_legacy_equipotential_netlists(FILE * FP, pcb_board_t *Layout);
+int write_kicad_legacy_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset);
+int write_kicad_legacy_layout_polygons(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset);
diff --git a/src_plugins/io_lihata/Makefile b/src_plugins/io_lihata/Makefile
index c37de74..cb659bf 100644
--- a/src_plugins/io_lihata/Makefile
+++ b/src_plugins/io_lihata/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_io_lihata
+ cd ../../src && $(MAKE) mod_io_lihata
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/io_lihata/README b/src_plugins/io_lihata/README
index 1cc4f8c..5134e80 100644
--- a/src_plugins/io_lihata/README
+++ b/src_plugins/io_lihata/README
@@ -1,5 +1,5 @@
Load and save the design and elements in the lihata board format.
-#state: WIP
-#default: disabled
+#state: works
+#default: buildin
#implements: io
diff --git a/src_plugins/io_lihata/common.c b/src_plugins/io_lihata/common.c
index c8f8fba..7b4b41f 100644
--- a/src_plugins/io_lihata/common.c
+++ b/src_plugins/io_lihata/common.c
@@ -24,7 +24,7 @@
A document is built for the merge-save. */
#include <stdio.h>
-#include "global.h"
+#include "config.h"
#include "data.h"
#include "macro.h"
#include "common.h"
@@ -46,7 +46,7 @@ int io_lihata_resolve_thermal_style(const char *name)
if (name == NULL)
return 0;
- for(n = 1; n < ENTRIES(thermal_style); n++)
+ for(n = 1; n < PCB_ENTRIES(thermal_style); n++)
if (strcmp(name, thermal_style[n]) == 0)
return n;
@@ -59,7 +59,7 @@ int io_lihata_resolve_thermal_style(const char *name)
const char *io_lihata_thermal_style(int idx)
{
- if ((idx > 0) && (idx < ENTRIES(thermal_style)))
+ if ((idx > 0) && (idx < PCB_ENTRIES(thermal_style)))
return thermal_style[idx];
return NULL;
}
diff --git a/src_plugins/io_lihata/common.h b/src_plugins/io_lihata/common.h
index 845f856..e49a246 100644
--- a/src_plugins/io_lihata/common.h
+++ b/src_plugins/io_lihata/common.h
@@ -1,6 +1,6 @@
/* Because all the macros expect it, that's why. */
typedef struct {
- FlagType Flags;
+ pcb_flag_t Flags;
} io_lihata_flag_holder;
/* Convert between thermal style index and textual representation */
diff --git a/src_plugins/io_lihata/io_lihata.c b/src_plugins/io_lihata/io_lihata.c
index 8b46c61..071ded1 100644
--- a/src_plugins/io_lihata/io_lihata.c
+++ b/src_plugins/io_lihata/io_lihata.c
@@ -21,17 +21,16 @@
*/
#include "config.h"
-#include "global.h"
#include "plugins.h"
#include "plug_io.h"
#include "read.h"
#include "write.h"
#include "io_lihata.h"
-static plug_io_t io_lihata;
+static pcb_plug_io_t io_lihata;
conf_io_lihata_t conf_io_lihata;
-int io_lihata_fmt(plug_io_t *ctx, plug_iot_t typ, int wr, const char *fmt)
+int io_lihata_fmt(pcb_plug_io_t *ctx, pcb_plug_iot_t typ, int wr, const char *fmt)
{
if (strcmp(ctx->description, fmt) == 0)
return 200;
@@ -54,6 +53,7 @@ pcb_uninit_t hid_io_lihata_init(void)
/* register the IO hook */
io_lihata.plugin_data = NULL;
io_lihata.fmt_support_prio = io_lihata_fmt;
+ io_lihata.test_parse_pcb = io_lihata_test_parse_pcb;
io_lihata.parse_pcb = io_lihata_parse_pcb;
io_lihata.parse_element = NULL;
io_lihata.parse_font = NULL;
@@ -62,9 +62,13 @@ pcb_uninit_t hid_io_lihata_init(void)
io_lihata.write_pcb = io_lihata_write_pcb;
io_lihata.default_fmt = "lihata";
io_lihata.description = "lihata board";
- io_lihata.save_preference_prio = 20;
+ io_lihata.save_preference_prio = 100;
+ io_lihata.default_extension = ".lht";
+ io_lihata.fp_extension = ".lht";
+ io_lihata.mime_type = "application/x-pcbrnd-board";
- HOOK_REGISTER(plug_io_t, plug_io_chain, &io_lihata);
+
+ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &io_lihata);
#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \
conf_reg_field(conf_io_lihata, field,isarray,type_name,cpath,cname,desc,flags);
diff --git a/src_plugins/io_lihata/read.c b/src_plugins/io_lihata/read.c
index cb06ba3..2b6caf4 100644
--- a/src_plugins/io_lihata/read.c
+++ b/src_plugins/io_lihata/read.c
@@ -28,22 +28,22 @@
#include <stdarg.h>
#include <string.h>
#include <liblihata/tree.h>
-#include "global.h"
+#include "config.h"
+#include "board.h"
#include "data.h"
#include "plugins.h"
#include "plug_io.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "compat_misc.h"
#include "macro.h"
#include "error.h"
-#include "misc.h"
#include "misc_util.h"
#include "layer.h"
-#include "create.h"
#include "vtptr.h"
#include "common.h"
#include "polygon.h"
#include "conf_core.h"
+#include "obj_all.h"
#warning TODO: put these in a gloal load-context-struct
vtptr_t post_ids, post_thermal;
@@ -54,7 +54,7 @@ vtptr_t post_ids, post_thermal;
objects during the load. */
#define post_id_req(obj) vtptr_append(&post_ids, &((obj)->ID))
-static int parse_attributes(AttributeListType *list, lht_node_t *nd)
+static int parse_attributes(pcb_attribute_list_t *list, lht_node_t *nd)
{
lht_node_t *n;
lht_dom_iterator_t it;
@@ -67,7 +67,7 @@ static int parse_attributes(AttributeListType *list, lht_node_t *nd)
for(n = lht_dom_first(&it, nd); n != NULL; n = lht_dom_next(&it)) {
if (n->type == LHT_TEXT)
- AttributePutToList(list, n->name, n->data.text.value, 0);
+ pcb_attribute_put(list, n->name, n->data.text.value, 0);
}
return 0;
@@ -82,8 +82,8 @@ static int parse_text(char **res, lht_node_t *nd)
return 0;
}
-/* Load the Coord value of a text node into res. Return 0 on success */
-static int parse_coord(Coord *res, lht_node_t *nd)
+/* Load the pcb_coord_t value of a text node into res. Return 0 on success */
+static int parse_coord(pcb_coord_t *res, lht_node_t *nd)
{
double tmp;
pcb_bool success;
@@ -91,9 +91,9 @@ static int parse_coord(Coord *res, lht_node_t *nd)
if ((nd == NULL) || (nd->type != LHT_TEXT))
return -1;
- tmp = GetValueEx(nd->data.text.value, NULL, NULL, NULL, NULL, &success);
+ tmp = pcb_get_value_ex(nd->data.text.value, NULL, NULL, NULL, NULL, &success);
if (!success) {
- Message(PCB_MSG_ERROR, "#LHT1 Invalid coord value: '%s'\n", nd->data.text.value);
+ pcb_message(PCB_MSG_ERROR, "#LHT1 Invalid coord value: '%s'\n", nd->data.text.value);
return -1;
}
@@ -102,19 +102,19 @@ static int parse_coord(Coord *res, lht_node_t *nd)
}
/* Load the Angle value of a text node into res. Return 0 on success */
-static int parse_angle(Angle *res, lht_node_t *nd)
+static int parse_angle(pcb_angle_t *res, lht_node_t *nd)
{
double tmp;
pcb_bool success;
if ((nd == NULL) || (nd->type != LHT_TEXT)) {
- Message(PCB_MSG_ERROR, "#LHT2 Invalid angle type: '%d'\n", nd->type);
+ pcb_message(PCB_MSG_ERROR, "#LHT2 Invalid angle type: '%d'\n", nd->type);
return -1;
}
- tmp = GetValueEx(nd->data.text.value, NULL, NULL, NULL, NULL, &success);
+ tmp = pcb_get_value_ex(nd->data.text.value, NULL, NULL, NULL, NULL, &success);
if (!success) {
- Message(PCB_MSG_ERROR, "#LHT3 Invalid angle value: '%s'\n", nd->data.text.value);
+ pcb_message(PCB_MSG_ERROR, "#LHT3 Invalid angle value: '%s'\n", nd->data.text.value);
return -1;
}
@@ -122,7 +122,7 @@ static int parse_angle(Angle *res, lht_node_t *nd)
return 0;
}
-/* Load the Coord value of a text node into res. Return 0 on success */
+/* Load the pcb_coord_t value of a text node into res. Return 0 on success */
static int parse_int(int *res, lht_node_t *nd)
{
long int tmp;
@@ -133,7 +133,7 @@ static int parse_int(int *res, lht_node_t *nd)
return -1;
if (nd->type != LHT_TEXT) {
- Message(PCB_MSG_ERROR, "#LHT4 Invalid int type: '%d'\n", nd->type);
+ pcb_message(PCB_MSG_ERROR, "#LHT4 Invalid int type: '%d'\n", nd->type);
return -1;
}
@@ -141,7 +141,7 @@ static int parse_int(int *res, lht_node_t *nd)
base = 16;
tmp = strtol(nd->data.text.value, &end, base);
if (*end != '\0') {
- Message(PCB_MSG_ERROR, "#LHT5 Invalid int value: '%s'\n", nd->data.text.value);
+ pcb_message(PCB_MSG_ERROR, "#LHT5 Invalid int value: '%s'\n", nd->data.text.value);
return -1;
}
@@ -159,14 +159,14 @@ static int parse_double(double *res, lht_node_t *nd)
return -1;
if (nd->type != LHT_TEXT) {
- Message(PCB_MSG_ERROR, "#LHT8 Invalid double type: '%d'\n", nd->type);
+ pcb_message(PCB_MSG_ERROR, "#LHT8 Invalid double type: '%d'\n", nd->type);
return -1;
}
tmp = strtod(nd->data.text.value, &end);
if (*end != '\0') {
- Message(PCB_MSG_ERROR, "#LHT9 Invalid double value: '%s'\n", nd->data.text.value);
+ pcb_message(PCB_MSG_ERROR, "#LHT9 Invalid double value: '%s'\n", nd->data.text.value);
return -1;
}
@@ -186,11 +186,11 @@ static int parse_id(long int *res, lht_node_t *nd, int prefix_len)
tmp = strtol(nd->name + prefix_len, &end, 10);
if (*end != '\0') {
- Message(PCB_MSG_ERROR, "#LHT6 Invalid id value: '%s' in line %d\n", nd->data.text.value, nd->line);
+ pcb_message(PCB_MSG_ERROR, "#LHT6 Invalid id value: '%s' in line %d\n", nd->data.text.value, nd->line);
return -1;
}
- CreateIDBump(tmp+1);
+ pcb_create_ID_bump(tmp+1);
*res = tmp;
return 0;
@@ -203,23 +203,23 @@ static int parse_bool(pcb_bool *res, lht_node_t *nd)
if (nd == NULL)
return -1;
- if ((strcmp(nd->data.text.value, "1") == 0) || (strcasecmp(nd->data.text.value, "on") == 0) ||
- (strcasecmp(nd->data.text.value, "true") == 0) || (strcasecmp(nd->data.text.value, "yes") == 0)) {
+ if ((strcmp(nd->data.text.value, "1") == 0) || (pcb_strcasecmp(nd->data.text.value, "on") == 0) ||
+ (pcb_strcasecmp(nd->data.text.value, "true") == 0) || (pcb_strcasecmp(nd->data.text.value, "yes") == 0)) {
*res = 1;
return 0;
}
- if ((strcmp(nd->data.text.value, "0") == 0) || (strcasecmp(nd->data.text.value, "off") == 0) ||
- (strcasecmp(nd->data.text.value, "false") == 0) || (strcasecmp(nd->data.text.value, "no") == 0)) {
+ if ((strcmp(nd->data.text.value, "0") == 0) || (pcb_strcasecmp(nd->data.text.value, "off") == 0) ||
+ (pcb_strcasecmp(nd->data.text.value, "false") == 0) || (pcb_strcasecmp(nd->data.text.value, "no") == 0)) {
*res = 0;
return 0;
}
- Message(PCB_MSG_ERROR, "#LHT7 Invalid bool value: '%s'\n", nd->data.text.value);
+ pcb_message(PCB_MSG_ERROR, "#LHT7 Invalid bool value: '%s'\n", nd->data.text.value);
return -1;
}
-static int parse_meta(PCBType *pcb, lht_node_t *nd)
+static int parse_meta(pcb_board_t *pcb, lht_node_t *nd)
{
lht_node_t *grp;
@@ -278,7 +278,7 @@ static int post_thermal_assign(vtptr_t *pt)
lht_dom_iterator_t it;
io_lihata_flag_holder fh;
lht_node_t *thr = pt->array[i];
- FlagType *f = thr->user_data;
+ pcb_flag_t *f = thr->user_data;
memset(&fh, 0, sizeof(fh));
fh.Flags = *f;
@@ -286,10 +286,10 @@ static int post_thermal_assign(vtptr_t *pt)
if (n->type == LHT_TEXT) {
int layer = pcb_layer_by_name(n->name);
if (layer < 0) {
- Message(PCB_MSG_ERROR, "#LHT10 Invalid layer name in thermal: '%s'\n", n->name);
+ pcb_message(PCB_MSG_ERROR, "#LHT10 Invalid layer name in thermal: '%s'\n", n->name);
return -1;
}
- ASSIGN_THERM(layer, io_lihata_resolve_thermal_style(n->data.text.value), &fh);
+ PCB_FLAG_THERM_ASSIGN(layer, io_lihata_resolve_thermal_style(n->data.text.value), &fh);
}
}
*f = fh.Flags;
@@ -301,7 +301,7 @@ static int post_thermal_assign(vtptr_t *pt)
/* NOTE: in case of objects with thermal, f must point to the object's
flags because termals will be filled in at the end, in a 2nd pass and
we need to store the f pointer. */
-static int parse_flags(FlagType *f, lht_node_t *fn, int object_type)
+static int parse_flags(pcb_flag_t *f, lht_node_t *fn, int object_type)
{
io_lihata_flag_holder fh;
@@ -314,7 +314,7 @@ static int parse_flags(FlagType *f, lht_node_t *fn, int object_type)
if (pcb_object_flagbits[n].object_types & object_type) {
pcb_bool b;
if ((parse_bool(&b, lht_dom_hash_get(fn, pcb_object_flagbits[n].name)) == 0) && b)
- SET_FLAG(pcb_object_flagbits[n].mask, &fh);
+ PCB_FLAG_SET(pcb_object_flagbits[n].mask, &fh);
}
}
@@ -336,14 +336,14 @@ static int parse_flags(FlagType *f, lht_node_t *fn, int object_type)
}
-static int parse_line(LayerType *ly, ElementType *el, lht_node_t *obj, int no_id, Coord dx, Coord dy)
+static int parse_line(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, int no_id, pcb_coord_t dx, pcb_coord_t dy)
{
- LineType *line;
+ pcb_line_t *line;
if (ly != NULL)
- line = GetLineMemory(ly);
+ line = pcb_line_alloc(ly);
else if (el != NULL)
- line = GetElementLineMemory(el);
+ line = pcb_element_line_alloc(el);
else
return -1;
@@ -377,9 +377,9 @@ static int parse_line(LayerType *ly, ElementType *el, lht_node_t *obj, int no_id
return 0;
}
-static int parse_rat(DataType *dt, lht_node_t *obj)
+static int parse_rat(pcb_data_t *dt, lht_node_t *obj)
{
- RatType rat, *new_rat;
+ pcb_rat_t rat, *new_rat;
parse_id(&rat.ID, obj, 4);
parse_attributes(&rat.Attributes, lht_dom_hash_get(obj, "attributes"));
@@ -396,7 +396,7 @@ static int parse_rat(DataType *dt, lht_node_t *obj)
post_id_req(&rat.Point1);
post_id_req(&rat.Point2);
- new_rat = CreateNewRat(dt, rat.Point1.X, rat.Point1.Y, rat.Point2.X, rat.Point2.Y, rat.group1, rat.group2,
+ new_rat = pcb_rat_new(dt, rat.Point1.X, rat.Point1.Y, rat.Point2.X, rat.Point2.Y, rat.group1, rat.group2,
conf_core.appearance.rat_thickness, rat.Flags);
new_rat->ID = rat.ID;
@@ -404,14 +404,14 @@ static int parse_rat(DataType *dt, lht_node_t *obj)
return 0;
}
-static int parse_arc(LayerType *ly, ElementType *el, lht_node_t *obj, Coord dx, Coord dy)
+static int parse_arc(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy)
{
- ArcType *arc;
+ pcb_arc_t *arc;
if (ly != NULL)
- arc = GetArcMemory(ly);
+ arc = pcb_arc_alloc(ly);
else if (el != NULL)
- arc = GetElementArcMemory(el);
+ arc = pcb_element_arc_alloc(el);
else
return -1;
@@ -438,9 +438,9 @@ static int parse_arc(LayerType *ly, ElementType *el, lht_node_t *obj, Coord dx,
}
-static int parse_polygon(LayerType *ly, ElementType *el, lht_node_t *obj)
+static int parse_polygon(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj)
{
- PolygonType *poly = GetPolygonMemory(ly);
+ pcb_polygon_t *poly = pcb_poly_alloc(ly);
lht_node_t *geo;
pcb_cardinal_t n = 0, c;
@@ -461,7 +461,7 @@ static int parse_polygon(LayerType *ly, ElementType *el, lht_node_t *obj)
poly->PointN += cnt->data.table.rows;
}
poly->PointMax = poly->PointN;
- poly->Points = malloc(sizeof(PointType) * poly->PointMax);
+ poly->Points = malloc(sizeof(pcb_point_t) * poly->PointMax);
poly->HoleIndexMax = poly->HoleIndexN = c-1;
if (poly->HoleIndexN > 0)
poly->HoleIndex = malloc(sizeof(pcb_cardinal_t) * poly->HoleIndexMax);
@@ -488,9 +488,9 @@ static int parse_polygon(LayerType *ly, ElementType *el, lht_node_t *obj)
return 0;
}
-static int parse_pcb_text(LayerType *ly, ElementType *el, lht_node_t *obj)
+static int parse_pcb_text(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj)
{
- TextType *text;
+ pcb_text_t *text;
lht_node_t *role;
int tmp;
@@ -499,18 +499,20 @@ static int parse_pcb_text(LayerType *ly, ElementType *el, lht_node_t *obj)
if (ly != NULL) {
if (role != NULL)
return -1;
- text = GetTextMemory(ly);
+ text = pcb_text_alloc(ly);
}
else if (el != NULL) {
if (role == NULL)
return -1;
- if (strcmp(role->data.text.value, "desc") == 0) text = &DESCRIPTION_TEXT(el);
- else if (strcmp(role->data.text.value, "name") == 0) text = &NAMEONPCB_TEXT(el);
- else if (strcmp(role->data.text.value, "value") == 0) text = &VALUE_TEXT(el);
+ if (strcmp(role->data.text.value, "desc") == 0) text = &PCB_ELEM_TEXT_DESCRIPTION(el);
+ else if (strcmp(role->data.text.value, "name") == 0) text = &PCB_ELEM_TEXT_REFDES(el);
+ else if (strcmp(role->data.text.value, "value") == 0) text = &PCB_ELEM_TEXT_VALUE(el);
else
return -1;
}
+ parse_id(&text->ID, obj, 5);
+
parse_attributes(&text->Attributes, lht_dom_hash_get(obj, "attributes"));
parse_flags(&text->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_TEXT);
parse_int(&text->Scale, lht_dom_hash_get(obj, "scale"));
@@ -529,12 +531,12 @@ static int parse_pcb_text(LayerType *ly, ElementType *el, lht_node_t *obj)
return 0;
}
-static int parse_data_layer(PCBType *pcb, DataType *dt, lht_node_t *grp, int layer_id)
+static int parse_data_layer(pcb_board_t *pcb, pcb_data_t *dt, lht_node_t *grp, int layer_id)
{
lht_node_t *n, *lst;
lht_dom_iterator_t it;
- LayerType *ly = &dt->Layer[dt->LayerN];
+ pcb_layer_t *ly = &dt->Layer[dt->LayerN];
dt->LayerN++;
ly->Name = pcb_strdup(grp->name);
@@ -565,7 +567,7 @@ static int parse_data_layer(PCBType *pcb, DataType *dt, lht_node_t *grp, int lay
return 0;
}
-static int parse_data_layers(PCBType *pcb, DataType *dt, lht_node_t *grp)
+static int parse_data_layers(pcb_board_t *pcb, pcb_data_t *dt, lht_node_t *grp)
{
int id;
lht_node_t *n;
@@ -580,14 +582,14 @@ static int parse_data_layers(PCBType *pcb, DataType *dt, lht_node_t *grp)
}
/* If el == NULL and dt != NULL it is a via (for now). */
-static int parse_pin(DataType *dt, ElementType *el, lht_node_t *obj, Coord dx, Coord dy)
+static int parse_pin(pcb_data_t *dt, pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy)
{
- PinType *via;
+ pcb_pin_t *via;
if (dt != NULL)
- via = GetViaMemory(dt);
+ via = pcb_via_alloc(dt);
else if (el != NULL)
- via = GetPinMemory(el);
+ via = pcb_pin_alloc(el);
else
return -1;
@@ -615,11 +617,11 @@ static int parse_pin(DataType *dt, ElementType *el, lht_node_t *obj, Coord dx, C
return 0;
}
-static int parse_pad(ElementType *el, lht_node_t *obj, Coord dx, Coord dy)
+static int parse_pad(pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy)
{
- PadType *pad;
+ pcb_pad_t *pad;
- pad = GetPadMemory(el);
+ pad = pcb_pad_alloc(el);
parse_id(&pad->ID, obj, 4);
parse_attributes(&pad->Attributes, lht_dom_hash_get(obj, "attributes"));
@@ -648,9 +650,9 @@ static int parse_pad(ElementType *el, lht_node_t *obj, Coord dx, Coord dy)
}
-static int parse_element(PCBType *pcb, DataType *dt, lht_node_t *obj)
+static int parse_element(pcb_board_t *pcb, pcb_data_t *dt, lht_node_t *obj)
{
- ElementType *elem = GetElementMemory(dt);
+ pcb_element_t *elem = pcb_element_alloc(dt);
lht_node_t *lst, *n;
lht_dom_iterator_t it;
int onsld;
@@ -661,7 +663,7 @@ static int parse_element(PCBType *pcb, DataType *dt, lht_node_t *obj)
parse_coord(&elem->MarkX, lht_dom_hash_get(obj, "x"));
parse_coord(&elem->MarkY, lht_dom_hash_get(obj, "y"));
- onsld = TEST_FLAG(PCB_FLAG_ONSOLDER, elem);
+ onsld = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, elem);
lst = lht_dom_hash_get(obj, "objects");
if (lst->type == LHT_LIST) {
@@ -683,18 +685,18 @@ static int parse_element(PCBType *pcb, DataType *dt, lht_node_t *obj)
if (onsld) {
int n;
- for(n = 0; n < MAX_ELEMENTNAMES; n++)
- SET_FLAG(PCB_FLAG_ONSOLDER, &elem->Name[n]);
+ for(n = 0; n < PCB_MAX_ELEMENTNAMES; n++)
+ PCB_FLAG_SET(PCB_FLAG_ONSOLDER, &elem->Name[n]);
}
/* Make sure we use some sort of font */
if (pcb == NULL)
pcb = PCB;
- SetElementBoundingBox(dt, elem, &pcb->Font);
+ pcb_element_bbox(dt, elem, &pcb->Font);
return 0;
}
-static int parse_data_objects(PCBType *pcb_for_font, DataType *dt, lht_node_t *grp)
+static int parse_data_objects(pcb_board_t *pcb_for_font, pcb_data_t *dt, lht_node_t *grp)
{
lht_node_t *n;
lht_dom_iterator_t it;
@@ -714,14 +716,14 @@ static int parse_data_objects(PCBType *pcb_for_font, DataType *dt, lht_node_t *g
return 0;
}
-static DataType *parse_data(PCBType *pcb, lht_node_t *nd)
+static pcb_data_t *parse_data(pcb_board_t *pcb, lht_node_t *nd)
{
- DataType *dt;
+ pcb_data_t *dt;
lht_node_t *grp;
if (nd->type != LHT_HASH)
return NULL;
- dt = calloc(sizeof(DataType), 1);
+ dt = calloc(sizeof(pcb_data_t), 1);
grp = lht_dom_hash_get(nd, "layers");
if ((grp != NULL) && (grp->type == LHT_LIST))
@@ -737,7 +739,7 @@ static DataType *parse_data(PCBType *pcb, lht_node_t *nd)
return dt;
}
-static int parse_symbol(SymbolType *sym, lht_node_t *nd)
+static int parse_symbol(pcb_symbol_t *sym, lht_node_t *nd)
{
lht_node_t *grp, *obj;
lht_dom_iterator_t it;
@@ -748,20 +750,20 @@ static int parse_symbol(SymbolType *sym, lht_node_t *nd)
grp = lht_dom_hash_get(nd, "objects");
for(obj = lht_dom_first(&it, grp); obj != NULL; obj = lht_dom_next(&it)) {
- Coord x1, y1, x2, y2, th;
+ pcb_coord_t x1, y1, x2, y2, th;
parse_coord(&x1, lht_dom_hash_get(obj, "x1"));
parse_coord(&y1, lht_dom_hash_get(obj, "y1"));
parse_coord(&x2, lht_dom_hash_get(obj, "x2"));
parse_coord(&y2, lht_dom_hash_get(obj, "y2"));
parse_coord(&th, lht_dom_hash_get(obj, "thickness"));
- CreateNewLineInSymbol(sym, x1, y1, x2, y2, th);
+ pcb_font_new_line_in_sym(sym, x1, y1, x2, y2, th);
}
sym->Valid = 1;
return 0;
}
-static int parse_font(FontType *font, lht_node_t *nd)
+static int parse_font(pcb_font_t *font, lht_node_t *nd)
{
lht_node_t *grp, *sym;
lht_dom_iterator_t it;
@@ -791,7 +793,7 @@ static int parse_font(FontType *font, lht_node_t *nd)
char *end;
chr = strtol(sym->name+1, &end, 16);
if (*end != '\0') {
- Message(PCB_MSG_ERROR, "Ignoring invalid symbol name '%s'.\n", sym->name);
+ pcb_message(PCB_MSG_ERROR, "Ignoring invalid symbol name '%s'.\n", sym->name);
continue;
}
}
@@ -811,7 +813,7 @@ static void post_ids_assign(vtptr_t *ids)
int n;
for(n = 0; n < vtptr_len(ids); n++) {
long int *id = ids->array[n];
- *id = CreateIDGet();
+ *id = pcb_create_ID_get();
}
vtptr_uninit(ids);
}
@@ -825,12 +827,12 @@ static int parse_styles(vtroutestyle_t *styles, lht_node_t *nd)
return -1;
for(stn = lht_dom_first(&it, nd); stn != NULL; stn = lht_dom_next(&it)) {
- RouteStyleType *s = vtroutestyle_alloc_append(styles, 1);
+ pcb_route_style_t *s = vtroutestyle_alloc_append(styles, 1);
int name_len = strlen(stn->name);
/* safe copy the name */
if (name_len > sizeof(s->name)-1) {
- Message(PCB_MSG_WARNING, "Route style name too long: '%s' (should be less than %d characters)\n", stn->name, sizeof(s->name)-1);
+ pcb_message(PCB_MSG_WARNING, "Route style name too long: '%s' (should be less than %d characters)\n", stn->name, sizeof(s->name)-1);
memcpy(s->name, stn->name, sizeof(s->name)-2);
s->name[sizeof(s->name)-1] = '\0';
}
@@ -841,11 +843,12 @@ static int parse_styles(vtroutestyle_t *styles, lht_node_t *nd)
parse_coord(&s->Diameter, lht_dom_hash_get(stn, "diameter"));
parse_coord(&s->Hole, lht_dom_hash_get(stn, "hole"));
parse_coord(&s->Clearance, lht_dom_hash_get(stn, "clearance"));
+ parse_attributes(&s->attr, lht_dom_hash_get(stn, "attributes"));
}
return 0;
}
-static int parse_netlist_input(LibraryType *lib, lht_node_t *netlist)
+static int parse_netlist_input(pcb_lib_t *lib, lht_node_t *netlist)
{
lht_node_t *nnet;
if (netlist->type != LHT_LIST)
@@ -853,7 +856,7 @@ static int parse_netlist_input(LibraryType *lib, lht_node_t *netlist)
for(nnet = netlist->data.list.first; nnet != NULL; nnet = nnet->next) {
lht_node_t *nconn, *nstyle, *nt;
- LibraryMenuType *net;
+ pcb_lib_menu_t *net;
const char *style = NULL;
if (nnet->type != LHT_HASH)
@@ -870,19 +873,19 @@ static int parse_netlist_input(LibraryType *lib, lht_node_t *netlist)
style = nstyle->data.text.value;
}
- net = CreateNewNet(lib, nnet->name, style);
+ net = pcb_lib_net_new(lib, nnet->name, style);
if (nconn != NULL) {
for(nt = nconn->data.list.first; nt != NULL; nt = nt->next) {
if ((nt->type != LHT_TEXT) || (*nt->data.text.value == '\0'))
return -1;
- CreateNewConnection(net, nt->data.text.value);
+ pcb_lib_conn_new(net, nt->data.text.value);
}
}
}
return 0;
}
-static int parse_netlist_patch(PCBType *pcb, lht_node_t *patches)
+static int parse_netlist_patch(pcb_board_t *pcb, lht_node_t *patches)
{
lht_node_t *np;
@@ -901,13 +904,13 @@ static int parse_netlist_patch(PCBType *pcb, lht_node_t *patches)
nval = lht_dom_hash_get(np, "term");
if ((nval == NULL) || (nval->type != LHT_TEXT) || (*nval->data.text.value == '\0'))
return -1;
- rats_patch_append(pcb, RATP_ADD_CONN, nval->data.text.value, nnet->data.text.value, NULL);
+ pcb_ratspatch_append(pcb, RATP_ADD_CONN, nval->data.text.value, nnet->data.text.value, NULL);
}
else if (strcmp(np->name, "add_conn") == 0) {
nval = lht_dom_hash_get(np, "term");
if ((nval == NULL) || (nval->type != LHT_TEXT) || (*nval->data.text.value == '\0'))
return -1;
- rats_patch_append(pcb, RATP_DEL_CONN, nval->data.text.value, nnet->data.text.value, NULL);
+ pcb_ratspatch_append(pcb, RATP_DEL_CONN, nval->data.text.value, nnet->data.text.value, NULL);
}
else if (strcmp(np->name, "change_attrib") == 0) {
nkey = lht_dom_hash_get(np, "key");
@@ -916,13 +919,13 @@ static int parse_netlist_patch(PCBType *pcb, lht_node_t *patches)
nval = lht_dom_hash_get(np, "term");
if ((nval == NULL) || (nval->type != LHT_TEXT))
return -1;
- rats_patch_append(pcb, RATP_CHANGE_ATTRIB, nnet->data.text.value, nkey->data.text.value, nval->data.text.value);
+ pcb_ratspatch_append(pcb, RATP_CHANGE_ATTRIB, nnet->data.text.value, nkey->data.text.value, nval->data.text.value);
}
}
return 0;
}
-static int parse_netlists(PCBType *pcb, lht_node_t *netlists)
+static int parse_netlists(pcb_board_t *pcb, lht_node_t *netlists)
{
lht_node_t *sub;
@@ -930,7 +933,7 @@ static int parse_netlists(PCBType *pcb, lht_node_t *netlists)
return -1;
sub = lht_dom_hash_get(netlists, "input");
- if ((sub != NULL) && (parse_netlist_input(pcb->NetlistLib+NETLIST_INPUT, sub) != 0))
+ if ((sub != NULL) && (parse_netlist_input(pcb->NetlistLib+PCB_NETLIST_INPUT, sub) != 0))
return -1;
sub = lht_dom_hash_get(netlists, "netlist_patch");
@@ -940,12 +943,21 @@ static int parse_netlists(PCBType *pcb, lht_node_t *netlists)
return 0;
}
-static int parse_board(PCBType *pcb, lht_node_t *nd)
+static void parse_conf(pcb_board_t *pcb, lht_node_t *sub)
+{
+ if (conf_insert_tree_as(CFR_DESIGN, sub) != 0)
+ pcb_message(PCB_MSG_ERROR, "Failed to insert the config subtree found in %s\n", pcb->Filename);
+ else
+ conf_update(NULL);
+}
+
+
+static int parse_board(pcb_board_t *pcb, lht_node_t *nd)
{
lht_node_t *sub;
if ((nd->type != LHT_HASH) || (strcmp(nd->name, "pcb-rnd-board-v1"))) {
- Message(PCB_MSG_DEFAULT, "Not a board lihata.\n");
+ pcb_message(PCB_MSG_ERROR, "Not a board lihata.\n");
return -1;
}
@@ -983,23 +995,27 @@ static int parse_board(PCBType *pcb, lht_node_t *nd)
/* Run poly clipping at the end so we have all IDs and we can
announce the clipping (it's slow, we may need a progress bar) */
- ALLPOLYGON_LOOP(pcb->Data);
+ PCB_POLY_ALL_LOOP(pcb->Data);
{
- InitClip(pcb->Data, layer, polygon);
+ pcb_poly_init_clip(pcb->Data, layer, polygon);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
+
+ sub = lht_dom_hash_get(nd, "pcb-rnd-conf-v1");
+ if (sub != NULL)
+ parse_conf(pcb, sub);
return 0;
}
-int io_lihata_parse_pcb(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest)
+int io_lihata_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest)
{
int res;
char *errmsg;
lht_doc_t *doc = lht_dom_load(Filename, &errmsg);
if (doc == NULL) {
-/* Message(PCB_MSG_DEFAULT, "Error loading '%s': %s\n", Filename, errmsg);*/
+ pcb_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", Filename, errmsg);
return -1;
}
@@ -1007,3 +1023,54 @@ int io_lihata_parse_pcb(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, co
lht_dom_uninit(doc);
return res;
}
+
+
+
+typedef enum {
+ TPS_UNDECIDED,
+ TPS_GOOD,
+ TPS_BAD,
+} test_parse_t;
+
+/* expect root to be a ha:pcb-rnd-board-v* */
+void test_parse_ev(lht_parse_t *ctx, lht_event_t ev, lht_node_type_t nt, const char *name, const char *value)
+{
+ test_parse_t *state = ctx->user_data;
+ if (ev == LHT_OPEN) {
+ if ((nt == LHT_HASH) && (strncmp(name, "pcb-rnd-board-v", 15) == 0))
+ *state = TPS_GOOD;
+ else
+ *state = TPS_BAD;
+ }
+}
+
+
+/* run an event parser for the first 32k of the file; accept the file if it
+ has a valid looking root; refuse if:
+ - no root in the first 32k (or till eof)
+ - not a valid lihata doc (parser error)
+ - lihata, but the wrong root
+*/
+int io_lihata_test_parse_pcb(pcb_plug_io_t *plug_ctx, pcb_board_t *Ptr, const char *Filename, FILE *f)
+{
+ lht_parse_t ctx;
+ int count;
+ test_parse_t state = TPS_UNDECIDED;
+
+ lht_parser_init(&ctx);
+ ctx.event = test_parse_ev;
+ ctx.user_data = &state;
+
+ for(count = 0; count < 32768; count++) {
+ int c = fgetc(f);
+ if (lht_parser_char(&ctx, c) != LHTE_SUCCESS) {
+ /* parse error or end */
+ state = TPS_BAD;
+ break;
+ }
+ if (state != TPS_UNDECIDED)
+ break;
+ }
+ lht_parser_uninit(&ctx);
+ return (state == TPS_GOOD);
+}
diff --git a/src_plugins/io_lihata/read.h b/src_plugins/io_lihata/read.h
index 7bea513..6dbc7cf 100644
--- a/src_plugins/io_lihata/read.h
+++ b/src_plugins/io_lihata/read.h
@@ -20,6 +20,7 @@
*
*/
-int io_lihata_parse_pcb(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest);
+int io_lihata_test_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, FILE *f);
+int io_lihata_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest);
diff --git a/src_plugins/io_lihata/write.c b/src_plugins/io_lihata/write.c
index 12a8175..4a08ce8 100644
--- a/src_plugins/io_lihata/write.c
+++ b/src_plugins/io_lihata/write.c
@@ -26,11 +26,12 @@
#include <stdio.h>
#include <stdarg.h>
#include <liblihata/tree.h>
-#include "global.h"
+#include "config.h"
+#include "board.h"
#include "data.h"
#include "plugins.h"
#include "plug_io.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "compat_misc.h"
#include "rats_patch.h"
#include "hid_actions.h"
@@ -40,6 +41,7 @@
#include "common.h"
#include "write_style.h"
#include "io_lihata.h"
+#include "paths.h"
/*#define CFMT "%[9]"*/
#define CFMT "%.08$$mH"
@@ -91,7 +93,7 @@ static lht_node_t *build_textf(const char *key, const char *fmt, ...)
return field;
}
-static lht_node_t *build_board_meta(PCBType *pcb)
+static lht_node_t *build_board_meta(pcb_board_t *pcb)
{
lht_node_t *meta, *grp;
@@ -130,7 +132,7 @@ static lht_node_t *build_board_meta(PCBType *pcb)
return meta;
}
-static lht_node_t *build_attributes(AttributeListType *lst)
+static lht_node_t *build_attributes(pcb_attribute_list_t *lst)
{
int n;
lht_node_t *ln;
@@ -146,7 +148,7 @@ static lht_node_t *build_attributes(AttributeListType *lst)
return ln;
}
-static lht_node_t *build_flags(FlagType *f, int object_type)
+static lht_node_t *build_flags(pcb_flag_t *f, int object_type)
{
int n, layer, added = 0, thrm = 0;
lht_node_t *hsh, *txt, *lst;
@@ -159,9 +161,9 @@ static lht_node_t *build_flags(FlagType *f, int object_type)
/* create normal flag nodes */
for (n = 0; n < pcb_object_flagbits_len; n++) {
- if ((pcb_object_flagbits[n].object_types & object_type) && (TEST_FLAG(pcb_object_flagbits[n].mask, &fh))) {
+ if ((pcb_object_flagbits[n].object_types & object_type) && (PCB_FLAG_TEST(pcb_object_flagbits[n].mask, &fh))) {
lht_dom_hash_put(hsh, build_text(pcb_object_flagbits[n].name, "1"));
- CLEAR_FLAG(pcb_object_flagbits[n].mask, &fh);
+ PCB_FLAG_CLEAR(pcb_object_flagbits[n].mask, &fh);
added++;
}
}
@@ -169,9 +171,9 @@ static lht_node_t *build_flags(FlagType *f, int object_type)
/* thermal flags per layer */
lst = lht_dom_node_alloc(LHT_HASH, "thermal");
- for(layer = 0; layer < max_copper_layer; layer++) {
- if (TEST_ANY_THERMS(&fh)) {
- int t = GET_THERM(layer, &fh);
+ for(layer = 0; layer < pcb_max_copper_layer; layer++) {
+ if (PCB_FLAG_THERM_TEST_ANY(&fh)) {
+ int t = PCB_FLAG_THERM_GET(layer, &fh);
if (t != 0) {
const char *name;
txt = lht_dom_node_alloc(LHT_TEXT, PCB->Data->Layer[layer].Name);
@@ -210,7 +212,7 @@ static lht_node_t *build_flags(FlagType *f, int object_type)
return hsh;
}
-static lht_node_t *build_line(LineType *line, int local_id, Coord dx, Coord dy)
+static lht_node_t *build_line(pcb_line_t *line, int local_id, pcb_coord_t dx, pcb_coord_t dy)
{
char buff[128];
lht_node_t *obj;
@@ -230,7 +232,7 @@ static lht_node_t *build_line(LineType *line, int local_id, Coord dx, Coord dy)
return obj;
}
-static lht_node_t *build_rat(RatType *rat)
+static lht_node_t *build_rat(pcb_rat_t *rat)
{
char buff[128];
lht_node_t *obj;
@@ -249,7 +251,7 @@ static lht_node_t *build_rat(RatType *rat)
return obj;
}
-static lht_node_t *build_arc(ArcType *arc, Coord dx, Coord dy)
+static lht_node_t *build_arc(pcb_arc_t *arc, pcb_coord_t dx, pcb_coord_t dy)
{
char buff[128];
lht_node_t *obj;
@@ -271,7 +273,7 @@ static lht_node_t *build_arc(ArcType *arc, Coord dx, Coord dy)
return obj;
}
-static lht_node_t *build_pin(PinType *pin, int is_via, Coord dx, Coord dy)
+static lht_node_t *build_pin(pcb_pin_t *pin, int is_via, pcb_coord_t dx, pcb_coord_t dy)
{
char buff[128];
lht_node_t *obj;
@@ -292,7 +294,7 @@ static lht_node_t *build_pin(PinType *pin, int is_via, Coord dx, Coord dy)
return obj;
}
-static lht_node_t *build_pad(PadType *pad, Coord dx, Coord dy)
+static lht_node_t *build_pad(pcb_pad_t *pad, pcb_coord_t dx, pcb_coord_t dy)
{
char buff[128];
lht_node_t *obj;
@@ -314,7 +316,7 @@ static lht_node_t *build_pad(PadType *pad, Coord dx, Coord dy)
return obj;
}
-static lht_node_t *build_polygon(PolygonType *poly)
+static lht_node_t *build_polygon(pcb_polygon_t *poly)
{
char buff[128];
lht_node_t *obj, *tbl, *geo;
@@ -351,7 +353,7 @@ static lht_node_t *build_polygon(PolygonType *poly)
return obj;
}
-static lht_node_t *build_pcb_text(const char *role, TextType *text)
+static lht_node_t *build_pcb_text(const char *role, pcb_text_t *text)
{
char buff[128];
lht_node_t *obj;
@@ -373,13 +375,13 @@ static lht_node_t *build_pcb_text(const char *role, TextType *text)
return obj;
}
-static lht_node_t *build_element(ElementType *elem)
+static lht_node_t *build_element(pcb_element_t *elem)
{
char buff[128];
- LineType *li;
- ArcType *ar;
- PinType *pi;
- PadType *pa;
+ pcb_line_t *li;
+ pcb_arc_t *ar;
+ pcb_pin_t *pi;
+ pcb_pad_t *pa;
lht_node_t *obj, *lst;
sprintf(buff, "element.%ld", elem->ID);
@@ -393,9 +395,9 @@ static lht_node_t *build_element(ElementType *elem)
lst = lht_dom_node_alloc(LHT_LIST, "objects");
lht_dom_hash_put(obj, lst);
- lht_dom_list_append(lst, build_pcb_text("desc", &elem->Name[DESCRIPTION_INDEX]));
- lht_dom_list_append(lst, build_pcb_text("name", &elem->Name[NAMEONPCB_INDEX]));
- lht_dom_list_append(lst, build_pcb_text("value", &elem->Name[VALUE_INDEX]));
+ lht_dom_list_append(lst, build_pcb_text("desc", &elem->Name[PCB_ELEMNAME_IDX_DESCRIPTION]));
+ lht_dom_list_append(lst, build_pcb_text("name", &elem->Name[PCB_ELEMNAME_IDX_REFDES]));
+ lht_dom_list_append(lst, build_pcb_text("value", &elem->Name[PCB_ELEMNAME_IDX_VALUE]));
lht_dom_hash_put(obj, build_textf("x", CFMT, elem->MarkX));
lht_dom_hash_put(obj, build_textf("y", CFMT, elem->MarkY));
@@ -416,13 +418,13 @@ static lht_node_t *build_element(ElementType *elem)
}
-static lht_node_t *build_data_layer(DataType *data, LayerType *layer, int layer_group)
+static lht_node_t *build_data_layer(pcb_data_t *data, pcb_layer_t *layer, int layer_group)
{
lht_node_t *obj, *grp;
- LineType *li;
- ArcType *ar;
- PolygonType *po;
- TextType *tx;
+ pcb_line_t *li;
+ pcb_arc_t *ar;
+ pcb_polygon_t *po;
+ pcb_text_t *tx;
char tmp[16];
int added = 0;
@@ -465,27 +467,27 @@ static lht_node_t *build_data_layer(DataType *data, LayerType *layer, int layer_
return obj;
}
-static lht_node_t *build_data_layers(DataType *data)
+static lht_node_t *build_data_layers(pcb_data_t *data)
{
int n;
lht_node_t *layers;
layers = lht_dom_node_alloc(LHT_LIST, "layers");
- for(n = 0; n < max_copper_layer + 2; n++)
+ for(n = 0; n < pcb_max_copper_layer + 2; n++)
lht_dom_list_append(layers, build_data_layer(data, data->Layer+n, pcb_layer_lookup_group(n)));
return layers;
}
-static lht_node_t *build_data(DataType *data)
+static lht_node_t *build_data(pcb_data_t *data)
{
lht_node_t *grp, *ndt;
- PinType *pi;
- ElementType *el;
+ pcb_pin_t *pi;
+ pcb_element_t *el;
gdl_iterator_t it;
- RatType *line;
+ pcb_rat_t *line;
ndt = lht_dom_node_alloc(LHT_HASH, "data");
@@ -508,10 +510,10 @@ static lht_node_t *build_data(DataType *data)
return ndt;
}
-static lht_node_t *build_symbol(SymbolType *sym, const char *name)
+static lht_node_t *build_symbol(pcb_symbol_t *sym, const char *name)
{
lht_node_t *lst, *ndt;
- LineType *li;
+ pcb_line_t *li;
int n;
ndt = lht_dom_node_alloc(LHT_HASH, name);
@@ -528,7 +530,7 @@ static lht_node_t *build_symbol(SymbolType *sym, const char *name)
return ndt;
}
-static lht_node_t *build_font(FontType *font)
+static lht_node_t *build_font(pcb_font_t *font)
{
lht_node_t *syms, *ndt, *frt;
int n;
@@ -546,7 +548,7 @@ static lht_node_t *build_font(FontType *font)
syms = lht_dom_node_alloc(LHT_HASH, "symbols");
lht_dom_hash_put(ndt, syms);
- for(n = 0; n < MAX_FONTPOSITION + 1; n++) {
+ for(n = 0; n < PCB_MAX_FONTPOSITION + 1; n++) {
char sname[32];
if (!font->Symbol[n].Valid)
continue;
@@ -569,19 +571,20 @@ static lht_node_t *build_styles(vtroutestyle_t *styles)
stl = lht_dom_node_alloc(LHT_LIST, "styles");
for(n = 0; n < vtroutestyle_len(styles); n++) {
- RouteStyleType *s = styles->array + n;
+ pcb_route_style_t *s = styles->array + n;
sn = lht_dom_node_alloc(LHT_HASH, s->name);
lht_dom_list_append(stl, sn);
lht_dom_hash_put(sn, build_textf("thickness", CFMT, s->Thick));
lht_dom_hash_put(sn, build_textf("diameter", CFMT, s->Diameter));
lht_dom_hash_put(sn, build_textf("hole", CFMT, s->Hole));
lht_dom_hash_put(sn, build_textf("clearance", CFMT, s->Clearance));
+ lht_dom_hash_put(sn, build_attributes(&s->attr));
}
return stl;
}
/* Build a plain old netlist */
-static lht_node_t *build_netlist(LibraryType *netlist, const char *name, int *nonempty)
+static lht_node_t *build_netlist(pcb_lib_t *netlist, const char *name, int *nonempty)
{
lht_node_t *nl, *pl, *pn, *nnet;
pcb_cardinal_t n, p;
@@ -593,7 +596,7 @@ static lht_node_t *build_netlist(LibraryType *netlist, const char *name, int *no
nl = lht_dom_node_alloc(LHT_LIST, name);
for (n = 0; n < netlist->MenuN; n++) {
- LibraryMenuTypePtr menu = &netlist->Menu[n];
+ pcb_lib_menu_t *menu = &netlist->Menu[n];
const char *netname = &menu->Name[2];
const char *style = menu->Style;
@@ -606,7 +609,7 @@ static lht_node_t *build_netlist(LibraryType *netlist, const char *name, int *no
/* grow the connection list */
for (p = 0; p < menu->EntryN; p++) {
- LibraryEntryTypePtr entry = &menu->Entry[p];
+ pcb_lib_entry_t *entry = &menu->Entry[p];
const char *pin = entry->ListEntry;
pn = lht_dom_node_alloc(LHT_TEXT, "");
pn->data.text.value = pcb_strdup(pin);
@@ -660,7 +663,7 @@ static void build_net_patch_cb(void *ctx_, pcb_rats_patch_export_ev_t ev, const
}
/* Build a netlist patch so that we don't need to export a complete new set of "as built" netlist */
-static lht_node_t *build_net_patch(PCBType *pcb, rats_patch_line_t *pat, int *nonempty)
+static lht_node_t *build_net_patch(pcb_board_t *pcb, pcb_ratspatch_line_t *pat, int *nonempty)
{
lht_node_t *pn;
build_net_patch_t ctx;
@@ -680,19 +683,19 @@ static lht_node_t *build_net_patch(PCBType *pcb, rats_patch_line_t *pat, int *no
}
-static lht_node_t *build_netlists(PCBType *pcb, LibraryType *netlists, rats_patch_line_t *pat, int num_netlists)
+static lht_node_t *build_netlists(pcb_board_t *pcb, pcb_lib_t *netlists, pcb_ratspatch_line_t *pat, int num_netlists)
{
lht_node_t *nls;
int n, nonempty = 0;
- if (num_netlists > NUM_NETLISTS)
+ if (num_netlists > PCB_NUM_NETLISTS)
return dummy_node("netlists");
nls = lht_dom_node_alloc(LHT_HASH, "netlists");
for(n = 0; n < num_netlists; n++) {
lht_node_t *nl;
- if (n == NETLIST_EDITED)
+ if (n == PCB_NETLIST_EDITED)
nl = build_net_patch(pcb, pat, &nonempty);
else
nl = build_netlist(netlists+n, pcb_netlist_names[n], &nonempty);
@@ -707,8 +710,28 @@ static lht_node_t *build_netlists(PCBType *pcb, LibraryType *netlists, rats_patc
return nls;
}
+extern lht_doc_t *conf_root[CFR_max_alloc];
+static lht_node_t *build_conf()
+{
+ const char **s, *del_paths[] = { "editor/mode", NULL };
+ lht_node_t *root, *n;
+ if ((conf_root[CFR_DESIGN] == NULL) || (conf_root[CFR_DESIGN]->root == NULL) || (conf_root[CFR_DESIGN]->root->type != LHT_LIST))
+ return lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1");
+
+ root = conf_root[CFR_DESIGN]->root;
+ for(n = root->data.list.first; n != NULL; n = n->next) {
+ for(s = del_paths; *s != NULL; s++) {
+ lht_node_t *sub = lht_tree_path_(n->doc, n, *s, 0, 0, NULL);
+ if (sub != NULL) {
+ lht_tree_del(sub);
+ }
+ }
+ }
-static lht_doc_t *build_board(PCBType *pcb)
+ return lht_dom_duptree(root);
+}
+
+static lht_doc_t *build_board(pcb_board_t *pcb)
{
lht_doc_t *brd = lht_dom_init();
@@ -718,7 +741,8 @@ static lht_doc_t *build_board(PCBType *pcb)
lht_dom_hash_put(brd->root, build_attributes(&pcb->Attributes));
lht_dom_hash_put(brd->root, build_font(&pcb->Font));
lht_dom_hash_put(brd->root, build_styles(&pcb->RouteStyle));
- lht_dom_hash_put(brd->root, build_netlists(pcb, pcb->NetlistLib, pcb->NetlistPatches, NUM_NETLISTS));
+ lht_dom_hash_put(brd->root, build_netlists(pcb, pcb->NetlistLib, pcb->NetlistPatches, PCB_NUM_NETLISTS));
+ lht_dom_hash_put(brd->root, build_conf());
return brd;
}
@@ -726,13 +750,13 @@ static lhtpers_ev_res_t check_text(void *ev_ctx, lht_perstyle_t *style, lht_node
{
/* for coords, preserve formatting as long as values match */
if (lhtpers_rule_find(io_lihata_out_coords, inmem_node) != NULL) {
- Coord v1, v2;
+ pcb_coord_t v1, v2;
pcb_bool success1, success2;
/* fprintf(stderr, "SMART d='%s' m='%s'\n", ondisk_value, inmem_node->data.text.value);*/
- v1 = GetValueEx(ondisk_value, NULL, NULL, NULL, NULL, &success1);
- v2 = GetValueEx(inmem_node->data.text.value, NULL, NULL, NULL, NULL, &success2);
+ v1 = pcb_get_value_ex(ondisk_value, NULL, NULL, NULL, NULL, &success1);
+ v2 = pcb_get_value_ex(inmem_node->data.text.value, NULL, NULL, NULL, NULL, &success2);
/* pcb_fprintf(stderr, " %d %d | %mm %mm\n", success1, success2, v1, v2);*/
if (success1 && success2) {
/* smart: if values are the same, keep the on-disk version */
@@ -751,8 +775,19 @@ static lhtpers_ev_res_t check_text(void *ev_ctx, lht_perstyle_t *style, lht_node
return LHTPERS_DISK;
}
+static void clean_invalid(lht_node_t *node)
+{
+ lht_node_t *n;
+ lht_dom_iterator_t it;
+ for(n = lht_dom_first(&it, node); n != NULL; n = lht_dom_next(&it)) {
+ if (n->type == LHT_INVALID_TYPE)
+ lht_tree_del(n);
+ else
+ clean_invalid(n);
+ }
+}
-int io_lihata_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
+int io_lihata_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
{
int res;
lht_doc_t *brd = build_board(PCB);
@@ -760,11 +795,11 @@ int io_lihata_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, con
if ((fnpat != NULL) && (*fnpat != '\0')) {
char *orig_fn;
- char *pcb_fn = pcb_strdup_subst(fnpat, pcb_build_fn_cb);
+ char *pcb_fn = pcb_strdup_subst(fnpat, pcb_build_fn_cb, NULL);
orig_fn = PCB->Filename;
PCB->Filename = NULL;
- fprintf(stderr, "NOTE: io_lihata_write_pcb will save to '%s' but first saves in '%s': %d\n", new_filename, pcb_fn, hid_actionl("SaveTo", "LayoutAs", pcb_fn, "pcb", NULL));
+ fprintf(stderr, "NOTE: io_lihata_write_pcb will save to '%s' but first saves in '%s': res=%d (expected: 0)\n", new_filename, pcb_fn, pcb_save_pcb(pcb_fn, "pcb"));
free(pcb_fn);
/* restore these because SaveTo() has changed them */
@@ -775,6 +810,7 @@ int io_lihata_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, con
if ((emergency) || ((old_filename == NULL) && (new_filename == NULL))) {
/* emergency or pipe save: use the canonical form */
+ clean_invalid(brd->root); /* remove invalid nodes placed for persistency */
res = lht_dom_export(brd->root, FP, "");
}
else {
@@ -792,6 +828,17 @@ int io_lihata_write_pcb(plug_io_t *ctx, FILE * FP, const char *old_filename, con
events.output_rules = io_lihata_out_rules;
res = lhtpers_fsave_as(&events, brd, inf, FP, old_filename, &errmsg);
+ if (res != 0) {
+ FILE *fe;
+ char *fe_name = pcb_concat(old_filename, ".mem.lht", NULL);
+ fe = fopen(fe_name, "w");
+ if (fe != NULL) {
+ res = lht_dom_export(brd->root, fe, "");
+ fclose(fe);
+ }
+ pcb_message(PCB_MSG_ERROR, "lhtpers_fsave_as() failed. Please include files %s and %s and %s in your bugreport\n", inf, old_filename, fe_name);
+ pcb_message(PCB_MSG_ERROR, "in case this broke your file %s, please use the emergency save %s instead.\n", old_filename, fe_name);
+ }
fflush(FP);
if (inf != NULL)
fclose(inf);
diff --git a/src_plugins/io_lihata/write.h b/src_plugins/io_lihata/write.h
index a1447b3..dc93a63 100644
--- a/src_plugins/io_lihata/write.h
+++ b/src_plugins/io_lihata/write.h
@@ -20,4 +20,4 @@
*
*/
-int io_lihata_write_pcb(plug_io_t *ctx, FILE * FP);
+int io_lihata_write_pcb(pcb_plug_io_t *ctx, FILE * FP);
diff --git a/src_plugins/io_lihata/write_style.c b/src_plugins/io_lihata/write_style.c
index e5b04d7..1607779 100644
--- a/src_plugins/io_lihata/write_style.c
+++ b/src_plugins/io_lihata/write_style.c
@@ -23,6 +23,7 @@
/* Specify default output formatting style to be more compact than
the canonical lihata export style */
+#include "config.h"
#include "write_style.h"
#define PB_BEGIN {"*", 2, 2}
diff --git a/src_plugins/io_pcb/Makefile b/src_plugins/io_pcb/Makefile
index 1023b1a..654cc91 100644
--- a/src_plugins/io_pcb/Makefile
+++ b/src_plugins/io_pcb/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_io_pcb
+ cd ../../src && $(MAKE) mod_io_pcb
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/io_pcb/Plug.tmpasm b/src_plugins/io_pcb/Plug.tmpasm
index 3547b13..357eaf0 100644
--- a/src_plugins/io_pcb/Plug.tmpasm
+++ b/src_plugins/io_pcb/Plug.tmpasm
@@ -1,5 +1,11 @@
put /local/pcb/mod {io_pcb}
-put /local/pcb/mod/OBJS [@ $(PLUGDIR)/io_pcb/io_pcb.o $(PLUGDIR)/io_pcb/file.o $(PLUGDIR)/io_pcb/parse_y.o $(PLUGDIR)/io_pcb/parse_l.o $(PLUGDIR)/io_pcb/flags.o $(PLUGDIR)/io_pcb/attribs.o @]
+put /local/pcb/mod/OBJS [@
+ $(PLUGDIR)/io_pcb/io_pcb.o
+ $(PLUGDIR)/io_pcb/file.o
+ $(PLUGDIR)/io_pcb/parse_y.o
+ $(PLUGDIR)/io_pcb/parse_l.o
+ $(PLUGDIR)/io_pcb/attribs.o
+@]
put /local/pcb/mod/YACC {$(PLUGDIR)/io_pcb/parse_y}
put /local/pcb/mod/LEX {$(PLUGDIR)/io_pcb/parse_l}
@@ -8,3 +14,4 @@ switch /local/pcb/io_pcb/controls
case {plugin} include /local/pcb/tmpasm/plugin; end;
case {disable} include /local/pcb/tmpasm/disable; end;
end
+
diff --git a/src_plugins/io_pcb/attribs.c b/src_plugins/io_pcb/attribs.c
index 6e7fd93..52d6625 100644
--- a/src_plugins/io_pcb/attribs.c
+++ b/src_plugins/io_pcb/attribs.c
@@ -20,8 +20,9 @@
*
*/
+#include "config.h"
#include "conf.h"
-#include "misc.h"
+#include "board.h"
#include "compat_misc.h"
#define LISTSEP " [[pcb-rnd]] "
@@ -42,7 +43,7 @@ static int path_ok(const char *path)
return 1;
}
-static void c2a(PCBType *pcb, lht_node_t *tree, const char *path1)
+static void c2a(pcb_board_t *pcb, lht_node_t *tree, const char *path1)
{
lht_dom_iterator_t it;
lht_node_t *n;
@@ -71,7 +72,7 @@ static void c2a(PCBType *pcb, lht_node_t *tree, const char *path1)
if (n->type == LHT_TEXT) {
conf_native_t *nv = conf_get_field(path);
if ((nv != NULL) && (!nv->random_flags.io_pcb_no_attrib))
- AttributePutToList(&pcb->Attributes, apath, n->data.text.value, 1);
+ pcb_attribute_put(&pcb->Attributes, apath, n->data.text.value, 1);
}
else if (n->type == LHT_LIST) {
lht_node_t *i;
@@ -84,21 +85,21 @@ static void c2a(PCBType *pcb, lht_node_t *tree, const char *path1)
gds_append_str(&conc, LISTSEP);
gds_append_str(&conc, i->data.text.value);
}
- AttributePutToList(&pcb->Attributes, apath, conc.array, 1);
+ pcb_attribute_put(&pcb->Attributes, apath, conc.array, 1);
gds_uninit(&conc);
}
}
}
}
-void io_pcb_attrib_c2a(PCBType *pcb)
+void io_pcb_attrib_c2a(pcb_board_t *pcb)
{
- lht_node_t *nmain = conf_lht_get_first(CFR_DESIGN);
+ lht_node_t *nmain = conf_lht_get_first(CFR_DESIGN, 0);
c2a(pcb, nmain, "");
}
-void io_pcb_attrib_a2c(PCBType *pcb)
+void io_pcb_attrib_a2c(pcb_board_t *pcb)
{
int n;
diff --git a/src_plugins/io_pcb/attribs.h b/src_plugins/io_pcb/attribs.h
index 8529766..beaa5c1 100644
--- a/src_plugins/io_pcb/attribs.h
+++ b/src_plugins/io_pcb/attribs.h
@@ -1,2 +1,2 @@
-void io_pcb_attrib_c2a(PCBType *pcb);
-void io_pcb_attrib_a2c(PCBType *pcb);
+void io_pcb_attrib_c2a(pcb_board_t *pcb);
+void io_pcb_attrib_a2c(pcb_board_t *pcb);
diff --git a/src_plugins/io_pcb/file.c b/src_plugins/io_pcb/file.c
index b23ade1..5b3ac12 100644
--- a/src_plugins/io_pcb/file.c
+++ b/src_plugins/io_pcb/file.c
@@ -31,17 +31,13 @@
#include "conf_core.h"
#include <locale.h>
-#include "global.h"
-
#include <time.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "buffer.h"
#include "change.h"
-#include "create.h"
#include "crosshair.h"
#include "data.h"
#include "error.h"
@@ -49,24 +45,22 @@
#include "plug_io.h"
#include "hid.h"
#include "layer.h"
-#include "misc.h"
#include "move.h"
-#include "mymem.h"
#include "parse_common.h"
#include "pcb-printf.h"
#include "polygon.h"
#include "rats.h"
#include "remove.h"
-#include "set.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "compat_fs.h"
#include "paths.h"
#include "rats_patch.h"
#include "hid_actions.h"
#include "hid_flags.h"
-#include "flags.h"
+#include "flag_str.h"
#include "attribs.h"
#include "route_style.h"
+#include "obj_poly.h"
/* ---------------------------------------------------------------------------
* some local prototypes
@@ -74,15 +68,15 @@
static void WritePCBInfoHeader(FILE *);
static void WritePCBDataHeader(FILE *);
static void WritePCBFontData(FILE *);
-static void WriteViaData(FILE *, DataTypePtr);
+static void WriteViaData(FILE *, pcb_data_t *);
static void WritePCBRatData(FILE *);
-static void WriteLayerData(FILE *, pcb_cardinal_t, LayerTypePtr);
+static void WriteLayerData(FILE *, pcb_cardinal_t, pcb_layer_t *);
/* ---------------------------------------------------------------------------
* Flag helper functions
*/
-#define F2S(OBJ, TYPE) flags_to_string ((OBJ)->Flags, TYPE)
+#define F2S(OBJ, TYPE) pcb_strflg_f2s((OBJ)->Flags, TYPE)
/* --------------------------------------------------------------------------- */
@@ -114,12 +108,12 @@ static void WriteLayerData(FILE *, pcb_cardinal_t, LayerTypePtr);
int PCBFileVersionNeeded(void)
{
- ALLPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_ALL_LOOP(PCB->Data);
{
if (polygon->HoleIndexN > 0)
return PCB_FILE_VERSION_HOLES;
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
return PCB_FILE_VERSION_BASELINE;
}
@@ -148,11 +142,46 @@ static const char *c_dtostr(double d)
return buf;
}
+/* Returns pointer to private buffer */
+static char *LayerGroupsToString(pcb_layer_group_t *lg)
+{
+#if PCB_MAX_LAYER < 9998
+ /* Allows for layer numbers 0..9999 */
+ static char buf[(PCB_MAX_LAYER + 2) * 5 + 1];
+#endif
+ char *cp = buf;
+ char sep = 0;
+ int group, entry;
+ for (group = 0; group < pcb_max_group; group++)
+ if (PCB->LayerGroups.Number[group]) {
+ if (sep)
+ *cp++ = ':';
+ sep = 1;
+ for (entry = 0; entry < PCB->LayerGroups.Number[group]; entry++) {
+ int layer = PCB->LayerGroups.Entries[group][entry];
+ if (layer == pcb_component_silk_layer) {
+ *cp++ = 'c';
+ }
+ else if (layer == pcb_solder_silk_layer) {
+ *cp++ = 's';
+ }
+ else {
+ sprintf(cp, "%d", layer + 1);
+ while (*++cp);
+ }
+ if (entry != PCB->LayerGroups.Number[group] - 1)
+ *cp++ = ',';
+ }
+ }
+ *cp++ = 0;
+ return buf;
+}
+
/* ---------------------------------------------------------------------------
* writes out an attribute list
*/
-static void WriteAttributeList(FILE * FP, AttributeListTypePtr list, const char *prefix)
+static void WriteAttributeList(FILE * FP, pcb_attribute_list_t *list, const char *prefix)
{
int i;
@@ -173,17 +202,17 @@ static void WritePCBInfoHeader(FILE * FP)
*/
}
-static void conf_update_pcb_flag(FlagType *dest, const char *hash_path, int binflag)
+static void conf_update_pcb_flag(pcb_flag_t *dest, const char *hash_path, int binflag)
{
conf_native_t *n = conf_get_field(hash_path);
struct {
- FlagType Flags;
+ pcb_flag_t Flags;
} *tmp = (void *)dest;
if ((n == NULL) || (n->type != CFN_BOOLEAN) || (n->used < 0) || (!n->val.boolean[0]))
- CLEAR_FLAG(binflag, tmp);
+ PCB_FLAG_CLEAR(binflag, tmp);
else
- SET_FLAG(binflag, tmp);
+ PCB_FLAG_SET(binflag, tmp);
}
/* ---------------------------------------------------------------------------
@@ -194,7 +223,7 @@ static void conf_update_pcb_flag(FlagType *dest, const char *hash_path, int binf
static void WritePCBDataHeader(FILE * FP)
{
int group;
- FlagType pcb_flags;
+ pcb_flag_t pcb_flags;
memset(&pcb_flags, 0, sizeof(pcb_flags));
@@ -213,45 +242,45 @@ static void WritePCBDataHeader(FILE * FP)
io_pcb_attrib_c2a(PCB);
/* set binary flags from conf hash; these flags used to be checked
- with TEST_FLAG() but got moved to the conf system */
- conf_update_pcb_flag(&pcb_flags, "plugins/mincut/enable", ENABLEPCB_FLAG_MINCUT);
- conf_update_pcb_flag(&pcb_flags, "editor/show_number", SHOWNUMBERFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/show_drc", SHOWPCB_FLAG_DRC);
- conf_update_pcb_flag(&pcb_flags, "editor/rubber_band_mode", RUBBERBANDFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/auto_drc", AUTOPCB_FLAG_DRC);
- conf_update_pcb_flag(&pcb_flags, "editor/all_direction_lines", ALLDIRECTIONFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/swap_start_direction", SWAPSTARTDIRFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/unique_names", UNIQUENAMEFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/clear_line", CLEARNEWFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/full_poly", NEWPCB_FLAG_FULLPOLY);
- conf_update_pcb_flag(&pcb_flags, "editor/snap_pin", SNAPPCB_FLAG_PIN);
- conf_update_pcb_flag(&pcb_flags, "editor/orthogonal_moves", ORTHOMOVEFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/live_routing", LIVEROUTEFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/lock_names", LOCKNAMESFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/only_names", ONLYNAMESFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/hide_names", HIDENAMESFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/thin_draw", THINDRAWFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/thin_draw_poly", THINDRAWPOLYFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/local_ref", LOCALREFFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/check_planes",CHECKPLANESFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/description", DESCRIPTIONFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/name_on_pcb", NAMEONPCBFLAG);
- conf_update_pcb_flag(&pcb_flags, "editor/show_mask", SHOWMASKFLAG);
+ with PCB_FLAG_TEST() but got moved to the conf system */
+ conf_update_pcb_flag(&pcb_flags, "plugins/mincut/enable", PCB_ENABLEPCB_FLAG_MINCUT);
+ conf_update_pcb_flag(&pcb_flags, "editor/show_number", PCB_SHOWNUMBERFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/show_drc", PCB_SHOWPCB_FLAG_DRC);
+ conf_update_pcb_flag(&pcb_flags, "editor/rubber_band_mode", PCB_RUBBERBANDFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/auto_drc", PCB_AUTOPCB_FLAG_DRC);
+ conf_update_pcb_flag(&pcb_flags, "editor/all_direction_lines", PCB_ALLDIRECTIONFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/swap_start_direction", PCB_SWAPSTARTDIRFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/unique_names", PCB_UNIQUENAMEFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/clear_line", PCB_CLEARNEWFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/full_poly", PCB_NEWPCB_FLAG_FULLPOLY);
+ conf_update_pcb_flag(&pcb_flags, "editor/snap_pin", PCB_SNAPPCB_FLAG_PIN);
+ conf_update_pcb_flag(&pcb_flags, "editor/orthogonal_moves", PCB_ORTHOMOVEFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/live_routing", PCB_LIVEROUTEFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/lock_names", PCB_LOCKNAMESFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/only_names", PCB_ONLYNAMESFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/hide_names", PCB_HIDENAMESFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/thin_draw", PCB_THINDRAWFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/thin_draw_poly", PCB_THINDRAWPOLYFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/local_ref", PCB_LOCALREFFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/check_planes",PCB_CHECKPLANESFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/description", PCB_DESCRIPTIONFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/name_on_pcb", PCB_NAMEONPCBFLAG);
+ conf_update_pcb_flag(&pcb_flags, "editor/show_mask", PCB_SHOWMASKFLAG);
fprintf(FP, "\n# To read pcb files, the pcb version (or the git source date) must be >= the file version\n");
fprintf(FP, "FileVersion[%i]\n", PCBFileVersionNeeded());
fputs("\nPCB[", FP);
- PrintQuotedString(FP, (char *) EMPTY(PCB->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB->Name));
pcb_fprintf(FP, " %[0] %[0]]\n\n", PCB->MaxWidth, PCB->MaxHeight);
pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->Grid, PCB->GridOffsetX, PCB->GridOffsetY, conf_core.editor.draw_grid);
- pcb_fprintf(FP, "Cursor[%[0] %[0] %s]\n", Crosshair.X, Crosshair.Y, c_dtostr(PCB->Zoom));
+ pcb_fprintf(FP, "Cursor[%[0] %[0] %s]\n", pcb_crosshair.X, pcb_crosshair.Y, c_dtostr(PCB->Zoom));
/* PolyArea should be output in square cmils, no suffix */
fprintf(FP, "PolyArea[%s]\n", c_dtostr(PCB_COORD_TO_MIL(PCB_COORD_TO_MIL(PCB->IsleArea) * 100) * 100));
pcb_fprintf(FP, "Thermal[%s]\n", c_dtostr(PCB->ThermScale));
pcb_fprintf(FP, "DRC[%[0] %[0] %[0] %[0] %[0] %[0]]\n", PCB->Bloat, PCB->Shrink,
PCB->minWid, PCB->minSlk, PCB->minDrill, PCB->minRing);
- fprintf(FP, "Flags(%s)\n", pcbflags_to_string(pcb_flags));
+ fprintf(FP, "Flags(%s)\n", pcb_strflg_board_f2s(pcb_flags));
fprintf(FP, "Groups(\"%s\")\n", LayerGroupsToString(&PCB->LayerGroups));
fputs("Styles[\"", FP);
@@ -274,10 +303,10 @@ static void WritePCBDataHeader(FILE * FP)
static void WritePCBFontData(FILE * FP)
{
pcb_cardinal_t i, j;
- LineTypePtr line;
- FontTypePtr font;
+ pcb_line_t *line;
+ pcb_font_t *font;
- for (font = &PCB->Font, i = 0; i <= MAX_FONTPOSITION; i++) {
+ for (font = &PCB->Font, i = 0; i <= PCB_MAX_FONTPOSITION; i++) {
if (!font->Symbol[i].Valid)
continue;
@@ -297,16 +326,16 @@ static void WritePCBFontData(FILE * FP)
/* ---------------------------------------------------------------------------
* writes via data
*/
-static void WriteViaData(FILE * FP, DataTypePtr Data)
+static void WriteViaData(FILE * FP, pcb_data_t *Data)
{
gdl_iterator_t it;
- PinType *via;
+ pcb_pin_t *via;
/* write information about vias */
pinlist_foreach(&Data->Via, &it, via) {
pcb_fprintf(FP, "Via[%[0] %[0] %[0] %[0] %[0] %[0] ", via->X, via->Y,
via->Thickness, via->Clearance, via->Mask, via->DrillingHole);
- PrintQuotedString(FP, (char *) EMPTY(via->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(via->Name));
fprintf(FP, " %s]\n", F2S(via, PCB_TYPE_VIA));
}
}
@@ -317,7 +346,7 @@ static void WriteViaData(FILE * FP, DataTypePtr Data)
static void WritePCBRatData(FILE * FP)
{
gdl_iterator_t it;
- RatType *line;
+ pcb_rat_t *line;
/* write information about rats */
ratlist_foreach(&PCB->Data->Rat, &it, line) {
@@ -333,21 +362,21 @@ static void WritePCBRatData(FILE * FP)
static void WritePCBNetlistData(FILE * FP)
{
/* write out the netlist if it exists */
- if (PCB->NetlistLib[NETLIST_INPUT].MenuN) {
+ if (PCB->NetlistLib[PCB_NETLIST_INPUT].MenuN) {
int n, p;
fprintf(FP, "NetList()\n(\n");
- for (n = 0; n < PCB->NetlistLib[NETLIST_INPUT].MenuN; n++) {
- LibraryMenuTypePtr menu = &PCB->NetlistLib[NETLIST_INPUT].Menu[n];
+ for (n = 0; n < PCB->NetlistLib[PCB_NETLIST_INPUT].MenuN; n++) {
+ pcb_lib_menu_t *menu = &PCB->NetlistLib[PCB_NETLIST_INPUT].Menu[n];
fprintf(FP, "\tNet(");
- PrintQuotedString(FP, &menu->Name[2]);
+ pcb_print_quoted_string(FP, &menu->Name[2]);
fprintf(FP, " ");
- PrintQuotedString(FP, (char *) UNKNOWN(menu->Style));
+ pcb_print_quoted_string(FP, (char *) PCB_UNKNOWN(menu->Style));
fprintf(FP, ")\n\t(\n");
for (p = 0; p < menu->EntryN; p++) {
- LibraryEntryTypePtr entry = &menu->Entry[p];
+ pcb_lib_entry_t *entry = &menu->Entry[p];
fprintf(FP, "\t\tConnect(");
- PrintQuotedString(FP, entry->ListEntry);
+ pcb_print_quoted_string(FP, entry->ListEntry);
fprintf(FP, ")\n");
}
fprintf(FP, "\t)\n");
@@ -363,7 +392,7 @@ static void WritePCBNetlistPatchData(FILE * FP)
{
if (PCB->NetlistPatches != NULL) {
fprintf(FP, "NetListPatch()\n(\n");
- rats_patch_fexport(PCB, FP, 1);
+ pcb_ratspatch_fexport(PCB, FP, 1);
fprintf(FP, ")\n");
}
}
@@ -371,18 +400,18 @@ static void WritePCBNetlistPatchData(FILE * FP)
/* ---------------------------------------------------------------------------
* writes element data
*/
-int io_pcb_WriteElementData(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
+int io_pcb_WriteElementData(pcb_plug_io_t *ctx, FILE * FP, pcb_data_t *Data)
{
gdl_iterator_t eit;
- LineType *line;
- ArcType *arc;
- ElementType *element;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ pcb_element_t *element;
pcb_printf_slot[0] = ((io_pcb_ctx_t *)(ctx->plugin_data))->write_coord_fmt;
elementlist_foreach(&Data->Element, &eit, element) {
gdl_iterator_t it;
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
/* only non empty elements */
if (!linelist_length(&element->Line) && !pinlist_length(&element->Pin) && !arclist_length(&element->Arc) && !padlist_length(&element->Pad))
@@ -391,25 +420,25 @@ int io_pcb_WriteElementData(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
* both names of an element
*/
fprintf(FP, "\nElement[%s ", F2S(element, PCB_TYPE_ELEMENT));
- PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_REFDES(element)));
fputc(' ', FP);
- PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(element)));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB_ELEM_NAME_VALUE(element)));
pcb_fprintf(FP, " %[0] %[0] %[0] %[0] %d %d %s]\n(\n",
element->MarkX, element->MarkY,
- DESCRIPTION_TEXT(element).X - element->MarkX,
- DESCRIPTION_TEXT(element).Y - element->MarkY,
- DESCRIPTION_TEXT(element).Direction,
- DESCRIPTION_TEXT(element).Scale, F2S(&(DESCRIPTION_TEXT(element)), PCB_TYPE_ELEMENT_NAME));
+ PCB_ELEM_TEXT_DESCRIPTION(element).X - element->MarkX,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Y - element->MarkY,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Direction,
+ PCB_ELEM_TEXT_DESCRIPTION(element).Scale, F2S(&(PCB_ELEM_TEXT_DESCRIPTION(element)), PCB_TYPE_ELEMENT_NAME));
WriteAttributeList(FP, &element->Attributes, "\t");
pinlist_foreach(&element->Pin, &it, pin) {
pcb_fprintf(FP, "\tPin[%[0] %[0] %[0] %[0] %[0] %[0] ",
pin->X - element->MarkX,
pin->Y - element->MarkY, pin->Thickness, pin->Clearance, pin->Mask, pin->DrillingHole);
- PrintQuotedString(FP, (char *) EMPTY(pin->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Name));
fprintf(FP, " ");
- PrintQuotedString(FP, (char *) EMPTY(pin->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pin->Number));
fprintf(FP, " %s]\n", F2S(pin, PCB_TYPE_PIN));
}
pinlist_foreach(&element->Pad, &it, pad) {
@@ -417,9 +446,9 @@ int io_pcb_WriteElementData(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
pad->Point1.X - element->MarkX,
pad->Point1.Y - element->MarkY,
pad->Point2.X - element->MarkX, pad->Point2.Y - element->MarkY, pad->Thickness, pad->Clearance, pad->Mask);
- PrintQuotedString(FP, (char *) EMPTY(pad->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Name));
fprintf(FP, " ");
- PrintQuotedString(FP, (char *) EMPTY(pad->Number));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(pad->Number));
fprintf(FP, " %s]\n", F2S(pad, PCB_TYPE_PAD));
}
linelist_foreach(&element->Line, &it, line) {
@@ -441,18 +470,18 @@ int io_pcb_WriteElementData(plug_io_t *ctx, FILE * FP, DataTypePtr Data)
/* ---------------------------------------------------------------------------
* writes layer data
*/
-static void WriteLayerData(FILE * FP, pcb_cardinal_t Number, LayerTypePtr layer)
+static void WriteLayerData(FILE * FP, pcb_cardinal_t Number, pcb_layer_t *layer)
{
gdl_iterator_t it;
- LineType *line;
- ArcType *arc;
- TextType *text;
- PolygonType *polygon;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
+ pcb_text_t *text;
+ pcb_polygon_t *polygon;
/* write information about non empty layers */
- if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
+ if (!PCB_LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) {
fprintf(FP, "Layer(%i ", (int) Number + 1);
- PrintQuotedString(FP, (char *) EMPTY(layer->Name));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(layer->Name));
fputs(")\n(\n", FP);
WriteAttributeList(FP, &layer->Attributes, "\t");
@@ -468,7 +497,7 @@ static void WriteLayerData(FILE * FP, pcb_cardinal_t Number, LayerTypePtr layer)
}
textlist_foreach(&layer->Text, &it, text) {
pcb_fprintf(FP, "\tText[%[0] %[0] %d %d ", text->X, text->Y, text->Direction, text->Scale);
- PrintQuotedString(FP, (char *) EMPTY(text->TextString));
+ pcb_print_quoted_string(FP, (char *) PCB_EMPTY(text->TextString));
fprintf(FP, " %s]\n", F2S(text, PCB_TYPE_TEXT));
}
textlist_foreach(&layer->Polygon, &it, polygon) {
@@ -476,7 +505,7 @@ static void WriteLayerData(FILE * FP, pcb_cardinal_t Number, LayerTypePtr layer)
pcb_cardinal_t hole = 0;
fprintf(FP, "\tPolygon(%s)\n\t(", F2S(polygon, PCB_TYPE_POLYGON));
for (p = 0; p < polygon->PointN; p++) {
- PointTypePtr point = &polygon->Points[p];
+ pcb_point_t *point = &polygon->Points[p];
if (hole < polygon->HoleIndexN && p == polygon->HoleIndex[hole]) {
if (hole > 0)
@@ -504,26 +533,26 @@ static void WriteLayerData(FILE * FP, pcb_cardinal_t Number, LayerTypePtr layer)
/* ---------------------------------------------------------------------------
* writes the buffer to file
*/
-int io_pcb_WriteBuffer(plug_io_t *ctx, FILE * FP, BufferType *buff)
+int io_pcb_WriteBuffer(pcb_plug_io_t *ctx, FILE * FP, pcb_buffer_t *buff)
{
pcb_cardinal_t i;
pcb_printf_slot[0] = ((io_pcb_ctx_t *)(ctx->plugin_data))->write_coord_fmt;
WriteViaData(FP, buff->Data);
io_pcb_WriteElementData(ctx, FP, buff->Data);
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
WriteLayerData(FP, i, &(buff->Data->Layer[i]));
- return (STATUS_OK);
+ return (0);
}
/* ---------------------------------------------------------------------------
* writes PCB to file
*/
-int io_pcb_WritePCB(plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
+int io_pcb_WritePCB(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency)
{
pcb_cardinal_t i;
- AttributePutToList(&PCB->Attributes, "PCB::loader", ctx->description, 1);
+ pcb_attribute_put(&PCB->Attributes, "PCB::loader", ctx->description, 1);
pcb_printf_slot[0] = ((io_pcb_ctx_t *)(ctx->plugin_data))->write_coord_fmt;
WritePCBInfoHeader(FP);
@@ -533,21 +562,21 @@ int io_pcb_WritePCB(plug_io_t *ctx, FILE * FP, const char *old_filename, const c
WriteViaData(FP, PCB->Data);
io_pcb_WriteElementData(ctx, FP, PCB->Data);
WritePCBRatData(FP);
- for (i = 0; i < max_copper_layer + 2; i++)
+ for (i = 0; i < pcb_max_copper_layer + 2; i++)
WriteLayerData(FP, i, &(PCB->Data->Layer[i]));
WritePCBNetlistData(FP);
WritePCBNetlistPatchData(FP);
- return (STATUS_OK);
+ return (0);
}
/* ---------------------------------------------------------------------------
* functions for loading elements-as-pcb
*/
-extern PCBTypePtr yyPCB;
-extern DataTypePtr yyData;
-extern FontTypePtr yyFont;
+extern pcb_board_t *yyPCB;
+extern pcb_data_t *yyData;
+extern pcb_font_t *yyFont;
void PreLoadElementPCB()
{
@@ -563,19 +592,58 @@ void PreLoadElementPCB()
void PostLoadElementPCB()
{
- PCBTypePtr pcb_save = PCB;
- ElementTypePtr e;
+ pcb_board_t *pcb_save = PCB;
+ pcb_element_t *e;
if (!yyPCB)
return;
- CreateNewPCBPost(yyPCB, 0);
- ParseGroupString("1,c:2,s", &yyPCB->LayerGroups, yyData->LayerN);
+ pcb_board_new_postproc(yyPCB, 0);
+ pcb_layer_parse_group_string("1,c:2,s", &yyPCB->LayerGroups, yyData->LayerN, 0);
e = elementlist_first(&yyPCB->Data->Element); /* we know there's only one */
PCB = yyPCB;
- MoveElementLowLevel(yyPCB->Data, e, -e->BoundingBox.X1, -e->BoundingBox.Y1);
+ pcb_element_move(yyPCB->Data, e, -e->BoundingBox.X1, -e->BoundingBox.Y1);
PCB = pcb_save;
yyPCB->MaxWidth = e->BoundingBox.X2;
yyPCB->MaxHeight = e->BoundingBox.Y2;
yyPCB->is_footprint = 1;
}
+
+
+int io_pcb_test_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, FILE *f)
+{
+ char line[1024];
+ int bad = 0;
+
+/*
+ Look for any of these in the top few lines of the file:
+ # release: pcb-bin 20050609
+ PCB["name" 600000 500000]
+
+ or
+ PCB("name" 600000 500000]
+*/
+
+ while(!(feof(f))) {
+ if (fgets(line, sizeof(line), f) != NULL) {
+ char *s = line;
+ while(isspace(*s)) s++;
+ if ((strncmp(s, "# release: pcb", 14) == 0) )
+ return 1;
+ if ((strncmp(s, "PCB", 3) == 0) && ((s[3] == '(') || (s[3] == '[')))
+ return 1;
+ if ((strncmp(s, "Element", 7) == 0) && ((s[7] == '(') || (s[7] == '[')))
+ return 1;
+ if ((*s == '\r') || (*s == '\n') || (*s == '#') || (*s == '\0')) /* ignore empty lines and comments */
+ continue;
+ /* non-comment, non-empty line: tolerate at most 16 of these before giving up */
+ bad++;
+ if (bad > 16)
+ return 0;
+ }
+ }
+
+ /* hit eof before finding anything familiar or too many bad lines: the file
+ is surely not a .pcb */
+ return 0;
+}
diff --git a/src_plugins/io_pcb/file.h b/src_plugins/io_pcb/file.h
index a465d76..5cd890d 100644
--- a/src_plugins/io_pcb/file.h
+++ b/src_plugins/io_pcb/file.h
@@ -31,21 +31,32 @@
#define PCB_FILE_H
#include <stdio.h> /* needed to define 'FILE *' */
-#include "global.h"
+#include "config.h"
+#include "board.h"
#include "plug_io.h"
+/* This is used by the lexer/parser */
+typedef struct {
+ int ival;
+ pcb_coord_t bval;
+ double dval;
+ char has_units;
+} PLMeasure;
+
typedef struct {
const char *write_coord_fmt;
} io_pcb_ctx_t;
-int io_pcb_WriteBuffer(plug_io_t *ctx, FILE *f, BufferType *buff);
-int io_pcb_WriteElementData(plug_io_t *ctx, FILE *f, DataTypePtr);
-int io_pcb_WritePCB(plug_io_t *ctx, FILE *f, const char *old_filename, const char *new_filename, pcb_bool emergency);
+int io_pcb_WriteBuffer(pcb_plug_io_t *ctx, FILE *f, pcb_buffer_t *buff);
+int io_pcb_WriteElementData(pcb_plug_io_t *ctx, FILE *f, pcb_data_t *);
+int io_pcb_WritePCB(pcb_plug_io_t *ctx, FILE *f, const char *old_filename, const char *new_filename, pcb_bool emergency);
void PreLoadElementPCB(void);
void PostLoadElementPCB(void);
-/*
+int io_pcb_test_parse_pcb(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, FILE *f);
+
+/*
* Whenever the pcb file format is modified, this version number
* should be updated to the date when the new code is committed.
* It will be written out to the file and also used by pcb to give
diff --git a/src_plugins/io_pcb/flags.c b/src_plugins/io_pcb/flags.c
deleted file mode 100644
index 3b6a8cf..0000000
--- a/src_plugins/io_pcb/flags.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 2005 DJ Delorie
- *
- * 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:
- * DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA
- * dj at delorie.com
- *
- */
-
-#include "strflags.h"
-#include "flags.h"
-#include "const.h"
-#include "macro.h"
-
-#define N(x) x, sizeof(x)-1
-static FlagBitsType pcb_flagbits[] = {
- {SHOWNUMBERFLAG, N("shownumber"), 1},
- {LOCALREFFLAG, N("localref"), 1},
- {CHECKPLANESFLAG, N("checkplanes"), 1},
- {SHOWPCB_FLAG_DRC, N("showdrc"), 1},
- {RUBBERBANDFLAG, N("rubberband"), 1},
- {DESCRIPTIONFLAG, N("description"), 1},
- {NAMEONPCBFLAG, N("nameonpcb"), 1},
- {AUTOPCB_FLAG_DRC, N("autodrc"), 1},
- {ALLDIRECTIONFLAG, N("alldirection"), 1},
- {SWAPSTARTDIRFLAG, N("swapstartdir"), 1},
- {UNIQUENAMEFLAG, N("uniquename"), 1},
- {CLEARNEWFLAG, N("clearnew"), 1},
- {NEWPCB_FLAG_FULLPOLY, N("newfullpoly"), 1},
- {SNAPPCB_FLAG_PIN, N("snappin"), 1},
- {SHOWMASKFLAG, N("showmask"), 1},
- {THINDRAWFLAG, N("thindraw"), 1},
- {ORTHOMOVEFLAG, N("orthomove"), 1},
- {LIVEROUTEFLAG, N("liveroute"), 1},
- {THINDRAWPOLYFLAG, N("thindrawpoly"), 1},
- {LOCKNAMESFLAG, N("locknames"), 1},
- {ONLYNAMESFLAG, N("onlynames"), 1},
- {HIDENAMESFLAG, N("hidenames"), 1},
- {ENABLEPCB_FLAG_MINCUT, N("enablemincut"), 1},
-};
-#undef N
-
-char *pcbflags_to_string(FlagType flags)
-{
- return common_flags_to_string(flags, PCB_TYPEMASK_ALL, pcb_flagbits, ENTRIES(pcb_flagbits));
-}
-
-FlagType string_to_pcbflags(const char *flagstring, int (*error) (const char *msg))
-{
- return common_string_to_flags(flagstring, error, pcb_flagbits, ENTRIES(pcb_flagbits));
-}
diff --git a/src_plugins/io_pcb/flags.h b/src_plugins/io_pcb/flags.h
deleted file mode 100644
index 8a7605b..0000000
--- a/src_plugins/io_pcb/flags.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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 at rz.uni-ulm.de
- *
- */
-
-char *pcbflags_to_string(FlagType flags);
-FlagType string_to_pcbflags(const char *flagstring, int (*error) (const char *msg));
-
-/* ---------------------------------------------------------------------------
- * PCB flags - kept only for file format compatibility reasons; these bits
- should be a mirror of booleans from the conf.
- */
-
-/* %start-doc pcbfile ~pcbflags
- at node PCBFlags
- at section PCBFlags
- at table @code
- at item 0x00001
-Pinout displays pin numbers instead of pin names.
- at item 0x00002
-Use local reference for moves, by setting the mark at the beginning of
-each move.
- at item 0x00004
-When set, only polygons and their clearances are drawn, to see if
-polygons have isolated regions.
- at item 0x00008
-Display DRC region on crosshair.
- at item 0x00010
-Do all move, mirror, rotate with rubberband connections.
- at item 0x00020
-Display descriptions of elements, instead of refdes.
- at item 0x00040
-Display names of elements, instead of refdes.
- at item 0x00080
-Auto-DRC flag. When set, PCB doesn't let you place copper that
-violates DRC.
- at item 0x00100
-Enable 'all-direction' lines.
- at item 0x00200
-Switch starting angle after each click.
- at item 0x00400
-Force unique names on board.
- at item 0x00800
-New lines/arc clear polygons.
- at item 0x01000
-Crosshair snaps to pins and pads.
- at item 0x02000
-Show the solder mask layer.
- at item 0x04000
-Draw with thin lines.
- at item 0x08000
-Move items orthogonally.
- at item 0x10000
-Draw autoroute paths real-time.
- at item 0x20000
-New polygons are full ones.
- at item 0x40000
-Names are locked, the mouse cannot select them.
- at item 0x80000
-Everything but names are locked, the mouse cannot select anything else.
- at item 0x100000
-New polygons are full polygons.
- at item 0x200000
-When set, element names are not drawn.
-+ at item 0x800000
-+snap to certain off-grid points.
-+ at item 0x1000000
-+highlight lines and arcs when the crosshair is on one of their endpoints.
- at end table
-%end-doc */
-
-#define PCB_FLAGS 0x01ffffff /* all used flags */
-
-#define SHOWNUMBERFLAG 0x00000001
-#define LOCALREFFLAG 0x00000002
-#define CHECKPLANESFLAG 0x00000004
-#define SHOWPCB_FLAG_DRC 0x00000008
-#define RUBBERBANDFLAG 0x00000010
-#define DESCRIPTIONFLAG 0x00000020
-#define NAMEONPCBFLAG 0x00000040
-#define AUTOPCB_FLAG_DRC 0x00000080
-#define ALLDIRECTIONFLAG 0x00000100
-#define SWAPSTARTDIRFLAG 0x00000200
-#define UNIQUENAMEFLAG 0x00000400
-#define CLEARNEWFLAG 0x00000800
-#define SNAPPCB_FLAG_PIN 0x00001000
-#define SHOWMASKFLAG 0x00002000
-#define THINDRAWFLAG 0x00004000
-#define ORTHOMOVEFLAG 0x00008000
-#define LIVEROUTEFLAG 0x00010000
-#define THINDRAWPOLYFLAG 0x00020000
-#define LOCKNAMESFLAG 0x00040000
-#define ONLYNAMESFLAG 0x00080000
-#define NEWPCB_FLAG_FULLPOLY 0x00100000
-#define HIDENAMESFLAG 0x00200000
-#define ENABLEPCB_FLAG_MINCUT 0x00400000
diff --git a/src_plugins/io_pcb/io_pcb.c b/src_plugins/io_pcb/io_pcb.c
index 5eaba41..b1996b5 100644
--- a/src_plugins/io_pcb/io_pcb.c
+++ b/src_plugins/io_pcb/io_pcb.c
@@ -24,15 +24,14 @@
*/
#include "config.h"
-#include "global.h"
#include "plugins.h"
#include "parse_common.h"
#include "file.h"
-static plug_io_t io_pcb[3];
+static pcb_plug_io_t io_pcb[3];
static io_pcb_ctx_t ctx[3];
-int io_pcb_fmt(plug_io_t *ctx, plug_iot_t typ, int wr, const char *fmt)
+int io_pcb_fmt(pcb_plug_io_t *ctx, pcb_plug_iot_t typ, int wr, const char *fmt)
{
if (strcmp(ctx->description, fmt) == 0)
return 200;
@@ -50,7 +49,7 @@ static void hid_io_pcb_uninit(void)
pcb_lex_destroy();
for(n = 0; n < 3; n++)
- HOOK_UNREGISTER(plug_io_t, plug_io_chain, &(io_pcb[n]));
+ PCB_HOOK_UNREGISTER(pcb_plug_io_t, pcb_plug_io_chain, &(io_pcb[n]));
}
pcb_uninit_t hid_io_pcb_init(void)
@@ -58,11 +57,11 @@ pcb_uninit_t hid_io_pcb_init(void)
memset(&io_pcb, 0, sizeof(io_pcb));
-
/* register the IO hook */
ctx[0].write_coord_fmt = pcb_printf_slot[8];
io_pcb[0].plugin_data = &ctx[0];
io_pcb[0].fmt_support_prio = io_pcb_fmt;
+ io_pcb[0].test_parse_pcb = io_pcb_test_parse_pcb;
io_pcb[0].parse_pcb = io_pcb_ParsePCB;
io_pcb[0].parse_element = io_pcb_ParseElement;
io_pcb[0].parse_font = io_pcb_ParseFont;
@@ -71,8 +70,11 @@ pcb_uninit_t hid_io_pcb_init(void)
io_pcb[0].write_pcb = io_pcb_WritePCB;
io_pcb[0].default_fmt = "pcb";
io_pcb[0].description = "geda/pcb - mainline (centimils)";
- io_pcb[0].save_preference_prio = 100;
- HOOK_REGISTER(plug_io_t, plug_io_chain, &(io_pcb[0]));
+ io_pcb[0].save_preference_prio = 89;
+ io_pcb[0].default_extension = ".pcb";
+ io_pcb[0].fp_extension = ".fp";
+ io_pcb[0].mime_type = "application/x-pcb-layout";
+ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &(io_pcb[0]));
ctx[1].write_coord_fmt = pcb_printf_slot[9];
io_pcb[1].plugin_data = &ctx[1];
@@ -82,8 +84,11 @@ pcb_uninit_t hid_io_pcb_init(void)
io_pcb[1].write_pcb = io_pcb_WritePCB;
io_pcb[1].default_fmt = "pcb";
io_pcb[1].description = "geda/pcb - readable units";
- io_pcb[1].save_preference_prio = 99;
- HOOK_REGISTER(plug_io_t, plug_io_chain, &(io_pcb[1]));
+ io_pcb[1].save_preference_prio = 90;
+ io_pcb[1].default_extension = ".pcb";
+ io_pcb[1].fp_extension = ".fp";
+ io_pcb[1].mime_type = "application/x-pcb-layout";
+ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &(io_pcb[1]));
ctx[2].write_coord_fmt = "%$$mn";
io_pcb[2].plugin_data = &ctx[2];
@@ -93,8 +98,11 @@ pcb_uninit_t hid_io_pcb_init(void)
io_pcb[2].write_pcb = io_pcb_WritePCB;
io_pcb[2].default_fmt = "pcb";
io_pcb[2].description = "geda/pcb - nanometer";
- io_pcb[2].save_preference_prio = 98;
- HOOK_REGISTER(plug_io_t, plug_io_chain, &(io_pcb[2]));
+ io_pcb[2].save_preference_prio = 88;
+ io_pcb[2].default_extension = ".pcb";
+ io_pcb[2].fp_extension = ".fp";
+ io_pcb[2].mime_type = "application/x-pcb-layout";
+ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &(io_pcb[2]));
return hid_io_pcb_uninit;
}
diff --git a/src_plugins/io_pcb/parse_common.h b/src_plugins/io_pcb/parse_common.h
index 6f864e2..9499d9d 100644
--- a/src_plugins/io_pcb/parse_common.h
+++ b/src_plugins/io_pcb/parse_common.h
@@ -31,11 +31,11 @@
#ifndef PCB_LEX_H
#define PCB_LEX_H
-#include "global.h"
+#include "config.h"
#include "plug_io.h"
-int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest);
-int io_pcb_ParseElement(plug_io_t *ctx, DataTypePtr, const char *);
-int io_pcb_ParseFont(plug_io_t *ctx, FontTypePtr, const char *);
+int io_pcb_ParsePCB(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest);
+int io_pcb_ParseElement(pcb_plug_io_t *ctx, pcb_data_t *, const char *);
+int io_pcb_ParseFont(pcb_plug_io_t *ctx, pcb_font_t *, const char *);
#endif
diff --git a/src_plugins/io_pcb/parse_l.c b/src_plugins/io_pcb/parse_l.c
index 34993df..bb4932a 100644
--- a/src_plugins/io_pcb/parse_l.c
+++ b/src_plugins/io_pcb/parse_l.c
@@ -27,8 +27,8 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 1
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -107,25 +107,13 @@ typedef unsigned int flex_uint32_t;
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Returned upon end-of-file. */
@@ -181,6 +169,11 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
extern int pcb_leng;
extern FILE *pcb_in, *pcb_out;
@@ -191,7 +184,7 @@ extern FILE *pcb_in, *pcb_out;
/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
* access to the local variable yy_act. Since yyless() is a macro, it would break
- * existing scanners that call yyless() from OUTSIDE pcb_lex.
+ * existing scanners that call yyless() from OUTSIDE pcb_lex.
* One obvious solution it to make yy_act a global. I tried that, and saw
* a 5% performance hit in a non-pcb_lineno scanner, because yy_act is
* normally declared as a register variable-- so it is not worth it.
@@ -203,6 +196,13 @@ extern FILE *pcb_in, *pcb_out;
if ( pcb_text[yyl] == '\n' )\
--pcb_lineno;\
}while(0)
+ #define YY_LINENO_REWIND_TO(dst) \
+ do {\
+ const char *p;\
+ for ( p = yy_cp-1; p >= (dst); --p)\
+ if ( *p == '\n' )\
+ --pcb_lineno;\
+ }while(0)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
@@ -220,11 +220,6 @@ extern FILE *pcb_in, *pcb_out;
#define unput(c) yyunput( c, (yytext_ptr) )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -237,7 +232,7 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -265,7 +260,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -293,7 +288,7 @@ struct yy_buffer_state
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
@@ -316,7 +311,7 @@ static int yy_n_chars; /* number of characters read into yy_ch_buf */
int pcb_leng;
/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
+static char *yy_c_buf_p = NULL;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
@@ -375,7 +370,7 @@ void pcb_free (void * );
typedef unsigned char YY_CHAR;
-FILE *pcb_in = (FILE *) 0, *pcb_out = (FILE *) 0;
+FILE *pcb_in = NULL, *pcb_out = NULL;
typedef int yy_state_type;
@@ -384,19 +379,22 @@ extern int pcb_lineno;
int pcb_lineno = 1;
extern char *pcb_text;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
#define yytext_ptr pcb_text
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[] );
+static void yynoreturn yy_fatal_error (yyconst char* msg );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up pcb_text.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- pcb_leng = (size_t) (yy_cp - yy_bp); \
+ pcb_leng = (int) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@@ -439,7 +437,7 @@ static yyconst flex_int16_t yy_accept[222] =
0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static yyconst YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
@@ -471,7 +469,7 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[51] =
+static yyconst YY_CHAR yy_meta[51] =
{ 0,
1, 1, 2, 3, 1, 1, 1, 1, 1, 4,
4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
@@ -480,7 +478,7 @@ static yyconst flex_int32_t yy_meta[51] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
} ;
-static yyconst flex_int16_t yy_base[226] =
+static yyconst flex_uint16_t yy_base[226] =
{ 0,
0, 0, 256, 257, 253, 257, 257, 46, 0, 0,
42, 45, 46, 13, 16, 230, 213, 23, 207, 208,
@@ -538,7 +536,7 @@ static yyconst flex_int16_t yy_def[226] =
0, 221, 221, 221, 221
} ;
-static yyconst flex_int16_t yy_nxt[308] =
+static yyconst flex_uint16_t yy_nxt[308] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
13, 14, 4, 15, 16, 17, 18, 19, 20, 21,
@@ -682,30 +680,21 @@ char *pcb_text;
#include <unistd.h>
#endif
-#include "global.h"
-#include "flags.h"
-
-#ifdef HAVE_LIBDMALLOC
-# include <dmalloc.h> /* see http://dmalloc.com */
-#endif
-
-
+#include "flag_str.h"
-
-#include "global.h"
#include "crosshair.h"
#include "data.h"
#include "error.h"
#include "file.h"
-#include "mymem.h"
-#include "misc.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "parse_common.h"
#include "parse_y.h"
-#include "create.h"
#include "plug_footprint.h"
#include "attribs.h"
#include "compat_misc.h"
+#include "compat_cc.h"
+#include "obj_common.h"
+#include "paths.h"
#define YY_NO_INPUT
@@ -714,16 +703,16 @@ char *pcb_text;
*/
#ifdef FLEX_SCANNER
-#define yyunput ATTRIBUTE_UNUSED yyunput
+#define yyunput PCB_ATTRIBUTE_UNUSED yyunput
#endif
const char *yyfilename; /* in this file */
-PCBTypePtr yyPCB; /* used by parser */
-DataTypePtr yyData;
-ElementTypePtr yyElement;
-FontTypePtr yyFont;
+pcb_board_t * yyPCB; /* used by parser */
+pcb_data_t * yyData;
+pcb_element_t * yyElement;
+pcb_font_t * yyFont;
conf_role_t yy_settings_dest;
-FlagType yy_pcb_flags;
+pcb_flag_t yy_pcb_flags;
static int parse_number (void);
@@ -735,9 +724,9 @@ int yyparse(void);
/* ---------------------------------------------------------------------------
* some local prototypes
*/
-static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename, const char *Parse_parameter);
+static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename);
-#line 741 "parse_l.c"
+#line 730 "parse_l.c"
#define INITIAL 0
@@ -770,19 +759,19 @@ void pcb_set_extra (YY_EXTRA_TYPE user_defined );
FILE *pcb_get_in (void );
-void pcb_set_in (FILE * in_str );
+void pcb_set_in (FILE * _in_str );
FILE *pcb_get_out (void );
-void pcb_set_out (FILE * out_str );
+void pcb_set_out (FILE * _out_str );
-int pcb_get_leng (void );
+ int pcb_get_leng (void );
char *pcb_get_text (void );
int pcb_get_lineno (void );
-void pcb_set_lineno (int line_number );
+void pcb_set_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -796,8 +785,12 @@ extern int pcb_wrap (void );
#endif
#endif
+#ifndef YY_NO_UNPUT
+
static void yyunput (int c,char *buf_ptr );
+#endif
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -831,7 +824,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( pcb_text, pcb_leng, 1, pcb_out )) {} } while (0)
+#define ECHO do { if (fwrite( pcb_text, (size_t) pcb_leng, 1, pcb_out )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -855,7 +848,7 @@ static int input (void );
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, pcb_in))==0 && ferror(pcb_in)) \
+ while ( (result = (int) fread(buf, 1, max_size, pcb_in))==0 && ferror(pcb_in)) \
{ \
if( errno != EINTR) \
{ \
@@ -910,7 +903,7 @@ extern int pcb_lex (void);
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
@@ -920,15 +913,10 @@ extern int pcb_lex (void);
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
-#line 116 "parse_l.l"
-
-
-#line 931 "parse_l.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -955,7 +943,13 @@ YY_DECL
pcb__load_buffer_state( );
}
- while ( 1 ) /* loops until end-of-file is reached */
+ {
+#line 107 "parse_l.l"
+
+
+#line 951 "parse_l.c"
+
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
@@ -971,7 +965,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -983,7 +977,7 @@ yy_match:
if ( yy_current_state >= 222 )
yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 257 );
@@ -1001,10 +995,10 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- int yyl;
+ yy_size_t yyl;
for ( yyl = 0; yyl < pcb_leng; ++yyl )
if ( pcb_text[yyl] == '\n' )
-
+
pcb_lineno++;
;
}
@@ -1022,227 +1016,227 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 118 "parse_l.l"
+#line 109 "parse_l.l"
{ return(T_FILEVERSION); }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 119 "parse_l.l"
+#line 110 "parse_l.l"
{ return(T_PCB); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 120 "parse_l.l"
+#line 111 "parse_l.l"
{ return(T_GRID); }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 121 "parse_l.l"
+#line 112 "parse_l.l"
{ return(T_CURSOR); }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 122 "parse_l.l"
+#line 113 "parse_l.l"
{ return(T_THERMAL); }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 123 "parse_l.l"
+#line 114 "parse_l.l"
{ return(T_AREA); }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 124 "parse_l.l"
+#line 115 "parse_l.l"
{ return(T_DRC); }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 125 "parse_l.l"
+#line 116 "parse_l.l"
{ return(T_FLAGS); }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 126 "parse_l.l"
+#line 117 "parse_l.l"
{ return(T_LAYER); }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 127 "parse_l.l"
+#line 118 "parse_l.l"
{ return(T_PIN); }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 128 "parse_l.l"
+#line 119 "parse_l.l"
{ return(T_PAD); }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 129 "parse_l.l"
+#line 120 "parse_l.l"
{ return(T_VIA); }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 130 "parse_l.l"
+#line 121 "parse_l.l"
{ return(T_LINE); }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 131 "parse_l.l"
+#line 122 "parse_l.l"
{ return(T_RAT); }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 132 "parse_l.l"
+#line 123 "parse_l.l"
{ return(T_RECTANGLE); }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 133 "parse_l.l"
+#line 124 "parse_l.l"
{ return(T_TEXT); }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 134 "parse_l.l"
+#line 125 "parse_l.l"
{ return(T_ELEMENTLINE); }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 135 "parse_l.l"
+#line 126 "parse_l.l"
{ return(T_ELEMENTARC); }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 136 "parse_l.l"
+#line 127 "parse_l.l"
{ return(T_ELEMENT); }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 137 "parse_l.l"
+#line 128 "parse_l.l"
{ return(T_SYMBOLLINE); }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 138 "parse_l.l"
+#line 129 "parse_l.l"
{ return(T_SYMBOL); }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 139 "parse_l.l"
+#line 130 "parse_l.l"
{ return(T_MARK); }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 140 "parse_l.l"
+#line 131 "parse_l.l"
{ return(T_GROUPS); }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 141 "parse_l.l"
+#line 132 "parse_l.l"
{ return(T_STYLES); }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 142 "parse_l.l"
+#line 133 "parse_l.l"
{ return(T_POLYGON); }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 143 "parse_l.l"
+#line 134 "parse_l.l"
{ return(T_POLYGON_HOLE); }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 144 "parse_l.l"
+#line 135 "parse_l.l"
{ return(T_ARC); }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 145 "parse_l.l"
+#line 136 "parse_l.l"
{ return(T_NETLIST); }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 146 "parse_l.l"
+#line 137 "parse_l.l"
{ return(T_NET); }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 147 "parse_l.l"
+#line 138 "parse_l.l"
{ return(T_CONN); }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 148 "parse_l.l"
+#line 139 "parse_l.l"
{ return(T_NETLISTPATCH); }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 149 "parse_l.l"
+#line 140 "parse_l.l"
{ return(T_ADD_CONN); }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 150 "parse_l.l"
+#line 141 "parse_l.l"
{ return(T_DEL_CONN); }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 151 "parse_l.l"
+#line 142 "parse_l.l"
{ return(T_CHANGE_ATTRIB); }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 152 "parse_l.l"
+#line 143 "parse_l.l"
{ return(T_ATTRIBUTE); }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 154 "parse_l.l"
+#line 145 "parse_l.l"
{ return T_NM; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 155 "parse_l.l"
+#line 146 "parse_l.l"
{ return T_UM; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 156 "parse_l.l"
+#line 147 "parse_l.l"
{ return T_MM; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 157 "parse_l.l"
+#line 148 "parse_l.l"
{ return T_M; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 158 "parse_l.l"
+#line 149 "parse_l.l"
{ return T_KM; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 159 "parse_l.l"
+#line 150 "parse_l.l"
{ return T_UMIL; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 160 "parse_l.l"
+#line 151 "parse_l.l"
{ return T_CMIL; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 161 "parse_l.l"
+#line 152 "parse_l.l"
{ return T_MIL; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 162 "parse_l.l"
+#line 153 "parse_l.l"
{ return T_IN; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 164 "parse_l.l"
+#line 155 "parse_l.l"
{
pcb_lval.integer = (unsigned) *(pcb_text+1);
return(CHAR_CONST);
@@ -1250,17 +1244,17 @@ YY_RULE_SETUP
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 168 "parse_l.l"
+#line 159 "parse_l.l"
{ return parse_number(); }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 169 "parse_l.l"
+#line 160 "parse_l.l"
{ pcb_lval.integer = pcb_round (strtod (pcb_text, NULL)); return INTEGER; }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 171 "parse_l.l"
+#line 162 "parse_l.l"
{ unsigned n;
sscanf((char *) pcb_text, "%x", &n);
pcb_lval.integer = n;
@@ -1269,7 +1263,7 @@ YY_RULE_SETUP
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 176 "parse_l.l"
+#line 167 "parse_l.l"
{
char *p1, *p2;
@@ -1305,18 +1299,18 @@ YY_RULE_SETUP
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 208 "parse_l.l"
+#line 199 "parse_l.l"
{}
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 209 "parse_l.l"
+#line 200 "parse_l.l"
{}
YY_BREAK
case 52:
/* rule 52 can match eol */
YY_RULE_SETUP
-#line 210 "parse_l.l"
+#line 201 "parse_l.l"
{
#ifndef FLEX_SCANNER
pcb_lineno++;
@@ -1325,20 +1319,20 @@ YY_RULE_SETUP
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 215 "parse_l.l"
+#line 206 "parse_l.l"
{}
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 216 "parse_l.l"
+#line 207 "parse_l.l"
{ return(*pcb_text); }
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 218 "parse_l.l"
+#line 209 "parse_l.l"
ECHO;
YY_BREAK
-#line 1342 "parse_l.c"
+#line 1336 "parse_l.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1469,6 +1463,7 @@ case YY_STATE_EOF(INITIAL):
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
+ } /* end of user's declarations */
} /* end of pcb_lex */
/* yy_get_next_buffer - try to read in a new buffer
@@ -1480,9 +1475,9 @@ case YY_STATE_EOF(INITIAL):
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ yy_size_t number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@@ -1511,7 +1506,7 @@ static int yy_get_next_buffer (void)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+ number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1531,7 +1526,7 @@ static int yy_get_next_buffer (void)
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
@@ -1551,7 +1546,7 @@ static int yy_get_next_buffer (void)
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
+ b->yy_ch_buf = NULL;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@@ -1569,7 +1564,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -1593,9 +1588,9 @@ static int yy_get_next_buffer (void)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pcb_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
@@ -1614,14 +1609,14 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -1633,7 +1628,7 @@ static int yy_get_next_buffer (void)
if ( yy_current_state >= 222 )
yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
}
return yy_current_state;
@@ -1646,10 +1641,10 @@ static int yy_get_next_buffer (void)
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
+ int yy_is_jam;
+ char *yy_cp = (yy_c_buf_p);
- register YY_CHAR yy_c = 1;
+ YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -1661,15 +1656,17 @@ static int yy_get_next_buffer (void)
if ( yy_current_state >= 222 )
yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
yy_is_jam = (yy_current_state == 221);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
- static void yyunput (int c, register char * yy_bp )
+#ifndef YY_NO_UNPUT
+
+ static void yyunput (int c, char * yy_bp )
{
- register char *yy_cp;
+ char *yy_cp;
yy_cp = (yy_c_buf_p);
@@ -1679,10 +1676,10 @@ static int yy_get_next_buffer (void)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ int number_to_move = (yy_n_chars) + 2;
+ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
+ char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
@@ -1691,7 +1688,7 @@ static int yy_get_next_buffer (void)
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -1708,6 +1705,8 @@ static int yy_get_next_buffer (void)
(yy_c_buf_p) = yy_cp;
}
+#endif
+
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
@@ -1756,7 +1755,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( pcb_wrap( ) )
- return EOF;
+ return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@@ -1779,7 +1778,7 @@ static int yy_get_next_buffer (void)
(yy_hold_char) = *++(yy_c_buf_p);
if ( c == '\n' )
-
+
pcb_lineno++;
;
@@ -1862,7 +1861,7 @@ static void pcb__load_buffer_state (void)
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in pcb__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = (yy_size_t)size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
@@ -1897,10 +1896,6 @@ static void pcb__load_buffer_state (void)
pcb_free((void *) b );
}
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a pcb_restart() or at EOF.
@@ -2021,15 +2016,15 @@ static void pcb_ensure_buffer_stack (void)
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1;
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
(yy_buffer_stack) = (struct yy_buffer_state**)pcb_alloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in pcb_ensure_buffer_stack()" );
-
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@@ -2038,7 +2033,7 @@ static void pcb_ensure_buffer_stack (void)
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
+ yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)pcb_realloc
@@ -2058,7 +2053,7 @@ static void pcb_ensure_buffer_stack (void)
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE pcb__scan_buffer (char * base, yy_size_t size )
{
@@ -2068,7 +2063,7 @@ YY_BUFFER_STATE pcb__scan_buffer (char * base, yy_size_t size )
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
- return 0;
+ return NULL;
b = (YY_BUFFER_STATE) pcb_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
@@ -2077,7 +2072,7 @@ YY_BUFFER_STATE pcb__scan_buffer (char * base, yy_size_t size )
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
+ b->yy_input_file = NULL;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
@@ -2100,7 +2095,7 @@ YY_BUFFER_STATE pcb__scan_buffer (char * base, yy_size_t size )
YY_BUFFER_STATE pcb__scan_string (yyconst char * yystr )
{
- return pcb__scan_bytes(yystr,strlen(yystr) );
+ return pcb__scan_bytes(yystr,(int) strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to pcb_lex() will
@@ -2115,10 +2110,10 @@ YY_BUFFER_STATE pcb__scan_bytes (yyconst char * yybytes, int _yybytes_len )
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- int i;
+ yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
+ n = (yy_size_t) _yybytes_len + 2;
buf = (char *) pcb_alloc(n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in pcb__scan_bytes()" );
@@ -2144,9 +2139,9 @@ YY_BUFFER_STATE pcb__scan_bytes (yyconst char * yybytes, int _yybytes_len )
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
+ (void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2174,7 +2169,7 @@ static void yy_fatal_error (yyconst char* msg )
*/
int pcb_get_lineno (void)
{
-
+
return pcb_lineno;
}
@@ -2212,29 +2207,29 @@ char *pcb_get_text (void)
}
/** Set the current line number.
- * @param line_number
+ * @param _line_number line number
*
*/
-void pcb_set_lineno (int line_number )
+void pcb_set_lineno (int _line_number )
{
- pcb_lineno = line_number;
+ pcb_lineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
*
* @see pcb__switch_to_buffer
*/
-void pcb_set_in (FILE * in_str )
+void pcb_set_in (FILE * _in_str )
{
- pcb_in = in_str ;
+ pcb_in = _in_str ;
}
-void pcb_set_out (FILE * out_str )
+void pcb_set_out (FILE * _out_str )
{
- pcb_out = out_str ;
+ pcb_out = _out_str ;
}
int pcb_get_debug (void)
@@ -2242,9 +2237,9 @@ int pcb_get_debug (void)
return pcb__flex_debug;
}
-void pcb_set_debug (int bdebug )
+void pcb_set_debug (int _bdebug )
{
- pcb__flex_debug = bdebug ;
+ pcb__flex_debug = _bdebug ;
}
static int yy_init_globals (void)
@@ -2256,10 +2251,10 @@ static int yy_init_globals (void)
/* We do not touch pcb_lineno unless the option is enabled. */
pcb_lineno = 1;
- (yy_buffer_stack) = 0;
+ (yy_buffer_stack) = NULL;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = (char *) 0;
+ (yy_c_buf_p) = NULL;
(yy_init) = 0;
(yy_start) = 0;
@@ -2268,8 +2263,8 @@ static int yy_init_globals (void)
pcb_in = stdin;
pcb_out = stdout;
#else
- pcb_in = (FILE *) 0;
- pcb_out = (FILE *) 0;
+ pcb_in = NULL;
+ pcb_out = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
@@ -2307,7 +2302,8 @@ int pcb_lex_destroy (void)
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
+
+ int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
@@ -2316,7 +2312,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
+ int n;
for ( n = 0; s[n]; ++n )
;
@@ -2326,11 +2322,12 @@ static int yy_flex_strlen (yyconst char * s )
void *pcb_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return malloc(size);
}
void *pcb_realloc (void * ptr, yy_size_t size )
{
+
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -2338,24 +2335,24 @@ void *pcb_realloc (void * ptr, yy_size_t size )
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
void pcb_free (void * ptr )
{
- free( (char *) ptr ); /* see pcb_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see pcb_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 218 "parse_l.l"
+#line 209 "parse_l.l"
/* ---------------------------------------------------------------------------
* sets up the preprocessor command
*/
-static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename, const char *Parse_parameter)
+static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename)
{
static char *command = NULL;
int returncode;
@@ -2367,7 +2364,7 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
#endif
if (Pipe == NULL) {
- if (EMPTY_STRING_P (Executable))
+ if (PCB_EMPTY_STRING_P(Executable))
{
l = 2;
if ( Path != NULL )
@@ -2395,14 +2392,16 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
}
else
{
+ pcb_build_argfn_t p;
used_popen = 1;
-
- command = EvaluateFilename(Executable, Path, Filename, Parse_parameter);
-
+ memset(&p, 0, sizeof(p));
+ p.params['p'-'a'] = Path;
+ p.params['f'-'a'] = Filename;
+ command = pcb_build_argfn(Executable, &p);
/* open pipe to stdout of command */
if (*command == '\0' || (pcb_in = popen(command, "r")) == NULL)
{
- PopenErrorMessage(command);
+ pcb_popen_error_message(command);
free(command);
return(1);
}
@@ -2430,20 +2429,20 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
* on termination.
*/
- CreateBeLenient (pcb_true);
+ pcb_create_be_lenient(pcb_true);
#if !defined(HAS_ATEXIT)
if (PCB && PCB->Data)
- SaveTMPData();
+ pcb_tmp_data_save();
returncode = pcb_parse();
- RemoveTMPData();
+ pcb_tmp_data_remove();
#else
returncode = pcb_parse();
#endif
/* clean up parse buffer */
pcb__delete_buffer(YY_CURRENT_BUFFER);
- CreateBeLenient (pcb_false);
+ pcb_create_be_lenient(pcb_false);
if (Pipe != NULL)
return returncode;
@@ -2456,11 +2455,11 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
/* ---------------------------------------------------------------------------
* initializes LEX and calls parser for a single element file
*/
-int io_pcb_ParseElement(plug_io_t *ctx, DataTypePtr Ptr, const char *name)
+int io_pcb_ParseElement(pcb_plug_io_t *ctx, pcb_data_t *Ptr, const char *name)
{
FILE *f;
int ret;
- fp_fopen_ctx_t st;
+ pcb_fp_fopen_ctx_t st;
yy_settings_dest = CFR_invalid;
yyPCB = NULL;
@@ -2468,14 +2467,14 @@ int io_pcb_ParseElement(plug_io_t *ctx, DataTypePtr Ptr, const char *name)
yyFont = &PCB->Font;
yyElement = NULL;
- f = fp_fopen(fp_default_search_path(), name, &st);
+ f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st);
if (f == NULL)
return -1;
- ret = Parse(f, NULL,NULL,NULL,NULL);
+ ret = Parse(f, NULL,NULL,NULL);
- fp_fclose(f, &st);
+ pcb_fp_fclose(f, &st);
return(ret);
}
@@ -2502,7 +2501,7 @@ do { \
conf_set(target, path, arr_idx, new_val, pol); \
} while(0) \
-int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest)
+int io_pcb_ParsePCB(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest)
{
int retval;
yyPCB = Ptr;
@@ -2513,33 +2512,33 @@ int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_r
if (settings_dest != CFR_invalid)
conf_reset(settings_dest, Filename);
setlocale(LC_ALL, "C"); /* make sure numerics are read predictably */
- retval = Parse(NULL, conf_core.rc.file_command, conf_core.rc.file_path, Filename, NULL);
+ retval = Parse(NULL, conf_core.rc.file_command, conf_core.rc.file_path, Filename);
setlocale(LC_ALL, "");
if ((settings_dest != CFR_invalid) && (retval == 0)) {
/* overwrite settings from the flags, mark them not-to-save */
- CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/show_mask", -1, CONF_BOOL_FLAG(SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(PCB_ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(PCB_SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(PCB_SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(PCB_RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(PCB_AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(PCB_ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(PCB_SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(PCB_UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(PCB_CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(PCB_NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(PCB_SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(PCB_ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(PCB_LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(PCB_LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(PCB_ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(PCB_HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(PCB_THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(PCB_THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(PCB_LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(PCB_CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(PCB_DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(PCB_NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/show_mask", -1, CONF_BOOL_FLAG(PCB_SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE);
/* don't save this because it is saved manually as PCB::grid::unit */
CONF_NO_ATTRIB("editor/grid_unit");
@@ -2557,7 +2556,7 @@ int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_r
}
if (retval == 0) {
/* restore loader so the next save will use the same units */
- const char *loader = AttributeGetFromList(&PCB->Attributes, "PCB::loader");
+ const char *loader = pcb_attribute_get(&PCB->Attributes, "PCB::loader");
if (loader != NULL) {
pcb_find_io_t f;
int len;
@@ -2576,7 +2575,7 @@ int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_r
/* ---------------------------------------------------------------------------
* initializes LEX and calls parser for a font
*/
-int io_pcb_ParseFont(plug_io_t *ctx, FontTypePtr Ptr, const char *Filename)
+int io_pcb_ParseFont(pcb_plug_io_t *ctx, pcb_font_t *Ptr, const char *Filename)
{
int r = 0;
yyPCB = NULL;
@@ -2584,10 +2583,10 @@ int io_pcb_ParseFont(plug_io_t *ctx, FontTypePtr Ptr, const char *Filename)
yyElement = NULL;
yy_settings_dest = CFR_invalid;
- r = Parse(NULL, conf_core.rc.font_command, NULL, Filename, NULL);
+ r = Parse(NULL, conf_core.rc.font_command, NULL, Filename);
if (r == 0) {
#ifdef DEBUG
- Message (PCB_MSG_DEBUG, "Found %s in %s\n", Filename, conf_core.rc.font_command);
+ pcb_message(PCB_MSG_DEBUG, "Found %s in %s\n", Filename, conf_core.rc.font_command);
#endif
}
return r;
diff --git a/src_plugins/io_pcb/parse_l.h b/src_plugins/io_pcb/parse_l.h
index 61b5edc..ea0f155 100644
--- a/src_plugins/io_pcb/parse_l.h
+++ b/src_plugins/io_pcb/parse_l.h
@@ -12,8 +12,8 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 1
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -92,25 +92,13 @@ typedef unsigned int flex_uint32_t;
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Size of default input buffer. */
@@ -131,15 +119,15 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-extern int pcb_leng;
-
-extern FILE *pcb_in, *pcb_out;
-
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
+extern int pcb_leng;
+
+extern FILE *pcb_in, *pcb_out;
+
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -152,7 +140,7 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -180,7 +168,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -212,6 +200,9 @@ void pcb_free (void * );
extern int pcb_lineno;
extern char *pcb_text;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
#define yytext_ptr pcb_text
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
@@ -246,19 +237,19 @@ void pcb_set_extra (YY_EXTRA_TYPE user_defined );
FILE *pcb_get_in (void );
-void pcb_set_in (FILE * in_str );
+void pcb_set_in (FILE * _in_str );
FILE *pcb_get_out (void );
-void pcb_set_out (FILE * out_str );
+void pcb_set_out (FILE * _out_str );
-int pcb_get_leng (void );
+ int pcb_get_leng (void );
char *pcb_get_text (void );
int pcb_get_lineno (void );
-void pcb_set_lineno (int line_number );
+void pcb_set_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -324,9 +315,9 @@ extern int pcb_lex (void);
#undef YY_DECL
#endif
-#line 218 "parse_l.l"
+#line 209 "parse_l.l"
-#line 331 "parse_l.h"
+#line 322 "parse_l.h"
#undef pcb_IN_HEADER
#endif /* pcb_HEADER_H */
diff --git a/src_plugins/io_pcb/parse_l.l b/src_plugins/io_pcb/parse_l.l
index 4623223..cadb754 100644
--- a/src_plugins/io_pcb/parse_l.l
+++ b/src_plugins/io_pcb/parse_l.l
@@ -46,30 +46,21 @@
#include <unistd.h>
#endif
-#include "global.h"
-#include "flags.h"
+#include "flag_str.h"
-#ifdef HAVE_LIBDMALLOC
-# include <dmalloc.h> /* see http://dmalloc.com */
-#endif
-
-
-
-
-#include "global.h"
#include "crosshair.h"
#include "data.h"
#include "error.h"
#include "file.h"
-#include "mymem.h"
-#include "misc.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "parse_common.h"
#include "parse_y.h"
-#include "create.h"
#include "plug_footprint.h"
#include "attribs.h"
#include "compat_misc.h"
+#include "compat_cc.h"
+#include "obj_common.h"
+#include "paths.h"
#define YY_NO_INPUT
@@ -78,16 +69,16 @@
*/
#ifdef FLEX_SCANNER
-#define yyunput ATTRIBUTE_UNUSED yyunput
+#define yyunput PCB_ATTRIBUTE_UNUSED yyunput
#endif
const char *yyfilename; /* in this file */
-PCBTypePtr yyPCB; /* used by parser */
-DataTypePtr yyData;
-ElementTypePtr yyElement;
-FontTypePtr yyFont;
+pcb_board_t * yyPCB; /* used by parser */
+pcb_data_t * yyData;
+pcb_element_t * yyElement;
+pcb_font_t * yyFont;
conf_role_t yy_settings_dest;
-FlagType yy_pcb_flags;
+pcb_flag_t yy_pcb_flags;
static int parse_number (void);
@@ -99,7 +90,7 @@ int yyparse(void);
/* ---------------------------------------------------------------------------
* some local prototypes
*/
-static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename, const char *Parse_parameter);
+static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename);
%}
@@ -220,7 +211,7 @@ in { return T_IN; }
/* ---------------------------------------------------------------------------
* sets up the preprocessor command
*/
-static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename, const char *Parse_parameter)
+static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename)
{
static char *command = NULL;
int returncode;
@@ -232,7 +223,7 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
#endif
if (Pipe == NULL) {
- if (EMPTY_STRING_P (Executable))
+ if (PCB_EMPTY_STRING_P(Executable))
{
l = 2;
if ( Path != NULL )
@@ -260,14 +251,16 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
}
else
{
+ pcb_build_argfn_t p;
used_popen = 1;
-
- command = EvaluateFilename(Executable, Path, Filename, Parse_parameter);
-
+ memset(&p, 0, sizeof(p));
+ p.params['p'-'a'] = Path;
+ p.params['f'-'a'] = Filename;
+ command = pcb_build_argfn(Executable, &p);
/* open pipe to stdout of command */
if (*command == '\0' || (yyin = popen(command, "r")) == NULL)
{
- PopenErrorMessage(command);
+ pcb_popen_error_message(command);
free(command);
return(1);
}
@@ -295,20 +288,20 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
* on termination.
*/
- CreateBeLenient (pcb_true);
+ pcb_create_be_lenient(pcb_true);
#if !defined(HAS_ATEXIT)
if (PCB && PCB->Data)
- SaveTMPData();
+ pcb_tmp_data_save();
returncode = pcb_parse();
- RemoveTMPData();
+ pcb_tmp_data_remove();
#else
returncode = pcb_parse();
#endif
/* clean up parse buffer */
yy_delete_buffer(YY_CURRENT_BUFFER);
- CreateBeLenient (pcb_false);
+ pcb_create_be_lenient(pcb_false);
if (Pipe != NULL)
return returncode;
@@ -321,11 +314,11 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const cha
/* ---------------------------------------------------------------------------
* initializes LEX and calls parser for a single element file
*/
-int io_pcb_ParseElement(plug_io_t *ctx, DataTypePtr Ptr, const char *name)
+int io_pcb_ParseElement(pcb_plug_io_t *ctx, pcb_data_t *Ptr, const char *name)
{
FILE *f;
int ret;
- fp_fopen_ctx_t st;
+ pcb_fp_fopen_ctx_t st;
yy_settings_dest = CFR_invalid;
yyPCB = NULL;
@@ -333,14 +326,14 @@ int io_pcb_ParseElement(plug_io_t *ctx, DataTypePtr Ptr, const char *name)
yyFont = &PCB->Font;
yyElement = NULL;
- f = fp_fopen(fp_default_search_path(), name, &st);
+ f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st);
if (f == NULL)
return -1;
- ret = Parse(f, NULL,NULL,NULL,NULL);
+ ret = Parse(f, NULL,NULL,NULL);
- fp_fclose(f, &st);
+ pcb_fp_fclose(f, &st);
return(ret);
}
@@ -367,7 +360,7 @@ do { \
conf_set(target, path, arr_idx, new_val, pol); \
} while(0) \
-int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_role_t settings_dest)
+int io_pcb_ParsePCB(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest)
{
int retval;
yyPCB = Ptr;
@@ -378,33 +371,33 @@ int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_r
if (settings_dest != CFR_invalid)
conf_reset(settings_dest, Filename);
setlocale(LC_ALL, "C"); /* make sure numerics are read predictably */
- retval = Parse(NULL, conf_core.rc.file_command, conf_core.rc.file_path, Filename, NULL);
+ retval = Parse(NULL, conf_core.rc.file_command, conf_core.rc.file_path, Filename);
setlocale(LC_ALL, "");
if ((settings_dest != CFR_invalid) && (retval == 0)) {
/* overwrite settings from the flags, mark them not-to-save */
- CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE);
- CONF_SET(settings_dest, "editor/show_mask", -1, CONF_BOOL_FLAG(SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(PCB_ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(PCB_SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(PCB_SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(PCB_RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(PCB_AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(PCB_ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(PCB_SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(PCB_UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(PCB_CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(PCB_NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(PCB_SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(PCB_ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(PCB_LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(PCB_LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(PCB_ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(PCB_HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(PCB_THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(PCB_THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(PCB_LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(PCB_CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(PCB_DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(PCB_NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE);
+ CONF_SET(settings_dest, "editor/show_mask", -1, CONF_BOOL_FLAG(PCB_SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE);
/* don't save this because it is saved manually as PCB::grid::unit */
CONF_NO_ATTRIB("editor/grid_unit");
@@ -422,7 +415,7 @@ int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_r
}
if (retval == 0) {
/* restore loader so the next save will use the same units */
- const char *loader = AttributeGetFromList(&PCB->Attributes, "PCB::loader");
+ const char *loader = pcb_attribute_get(&PCB->Attributes, "PCB::loader");
if (loader != NULL) {
pcb_find_io_t f;
int len;
@@ -441,7 +434,7 @@ int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, const char *Filename, conf_r
/* ---------------------------------------------------------------------------
* initializes LEX and calls parser for a font
*/
-int io_pcb_ParseFont(plug_io_t *ctx, FontTypePtr Ptr, const char *Filename)
+int io_pcb_ParseFont(pcb_plug_io_t *ctx, pcb_font_t *Ptr, const char *Filename)
{
int r = 0;
yyPCB = NULL;
@@ -449,10 +442,10 @@ int io_pcb_ParseFont(plug_io_t *ctx, FontTypePtr Ptr, const char *Filename)
yyElement = NULL;
yy_settings_dest = CFR_invalid;
- r = Parse(NULL, conf_core.rc.font_command, NULL, Filename, NULL);
+ r = Parse(NULL, conf_core.rc.font_command, NULL, Filename);
if (r == 0) {
#ifdef DEBUG
- Message (PCB_MSG_DEBUG, "Found %s in %s\n", Filename, conf_core.rc.font_command);
+ pcb_message(PCB_MSG_DEBUG, "Found %s in %s\n", Filename, conf_core.rc.font_command);
#endif
}
return r;
diff --git a/src_plugins/io_pcb/parse_y.c b/src_plugins/io_pcb/parse_y.c
index c9ffa07..2e3fbd5 100644
--- a/src_plugins/io_pcb/parse_y.c
+++ b/src_plugins/io_pcb/parse_y.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
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
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -102,58 +102,51 @@
*/
#include "config.h"
+#include "flag.h"
+#include "board.h"
#include "conf_core.h"
-#include "global.h"
#include "layer.h"
-#include "create.h"
#include "data.h"
#include "error.h"
#include "file.h"
-#include "mymem.h"
-#include "misc.h"
#include "parse_l.h"
#include "polygon.h"
#include "remove.h"
#include "rtree.h"
-#include "strflags.h"
-#include "thermal.h"
+#include "flag_str.h"
+#include "obj_pinvia_therm.h"
#include "rats_patch.h"
-#include "flags.h"
#include "route_style.h"
#include "compat_misc.h"
+#include "obj_all.h"
-#ifdef HAVE_LIBDMALLOC
-# include <dmalloc.h> /* see http://dmalloc.com */
-#endif
-
-
-
-static LayerTypePtr Layer;
-static PolygonTypePtr Polygon;
-static SymbolTypePtr Symbol;
+static pcb_layer_t *Layer;
+static pcb_polygon_t *Polygon;
+static pcb_symbol_t *Symbol;
static int pin_num;
-static LibraryMenuTypePtr Menu;
-static pcb_bool LayerFlag[MAX_LAYER + 2];
+static pcb_lib_menu_t *Menu;
+static pcb_bool LayerFlag[PCB_MAX_LAYER + 2];
+static int old_fmt; /* 1 if we are reading a PCB(), 0 if PCB[] */
extern char *yytext; /* defined by LEX */
-extern PCBTypePtr yyPCB;
-extern DataTypePtr yyData;
-extern ElementTypePtr yyElement;
-extern FontTypePtr yyFont;
+extern pcb_board_t * yyPCB;
+extern pcb_data_t * yyData;
+extern pcb_element_t *yyElement;
+extern pcb_font_t * yyFont;
extern int pcb_lineno; /* linenumber */
extern char *yyfilename; /* in this file */
extern conf_role_t yy_settings_dest;
-extern FlagType yy_pcb_flags;
+extern pcb_flag_t yy_pcb_flags;
static char *layer_group_string;
-static AttributeListTypePtr attr_list;
+static pcb_attribute_list_t *attr_list;
int yyerror(const char *s);
int yylex();
static int check_file_version (int);
-static void do_measure (PLMeasure *m, Coord i, double d, int u);
+static void do_measure (PLMeasure *m, pcb_coord_t i, double d, int u);
#define M(r,f,d) do_measure (&(r), f, d, 1)
/* Macros for interpreting what "measure" means - integer value only,
@@ -163,8 +156,9 @@ static void do_measure (PLMeasure *m, Coord i, double d, int u);
#define NU(m) new_units (m)
static int integer_value (PLMeasure m);
-static Coord old_units (PLMeasure m);
-static Coord new_units (PLMeasure m);
+static pcb_coord_t old_units (PLMeasure m);
+static pcb_coord_t new_units (PLMeasure m);
+static pcb_flag_t pcb_flag_old(unsigned int flags);
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
@@ -172,7 +166,7 @@ static Coord new_units (PLMeasure m);
#include "parse_y.h"
-#line 176 "parse_y.c" /* yacc.c:339 */
+#line 170 "parse_y.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -260,19 +254,21 @@ extern int pcb_debug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
+
union YYSTYPE
{
-#line 118 "parse_y.y" /* yacc.c:355 */
+#line 112 "parse_y.y" /* yacc.c:355 */
int integer;
double number;
char *string;
- FlagType flagtype;
+ pcb_flag_t flagtype;
PLMeasure measure;
-#line 275 "parse_y.c" /* yacc.c:355 */
+#line 269 "parse_y.c" /* yacc.c:355 */
};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
@@ -286,7 +282,7 @@ int pcb_parse (void);
/* Copy the second part of user declarations. */
-#line 290 "parse_y.c" /* yacc.c:358 */
+#line 286 "parse_y.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -588,28 +584,28 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 145, 145, 146, 147, 148, 172, 172, 229, 229,
- 240, 240, 259, 260, 265, 265, 305, 307, 337, 343,
- 349, 378, 379, 380, 383, 391, 406, 440, 446, 452,
- 468, 470, 495, 497, 528, 530, 531, 532, 536, 546,
- 557, 584, 588, 593, 621, 625, 669, 678, 687, 691,
- 692, 696, 697, 701, 702, 702, 703, 704, 706, 706,
- 713, 717, 718, 719, 720, 721, 757, 767, 778, 788,
- 798, 834, 839, 871, 870, 898, 899, 903, 904, 908,
- 909, 910, 911, 912, 913, 915, 920, 921, 922, 923,
- 923, 924, 954, 963, 972, 1020, 1029, 1038, 1075, 1085,
- 1103, 1153, 1152, 1191, 1193, 1198, 1197, 1204, 1206, 1211,
- 1215, 1275, 1276, 1277, 1278, 1279, 1287, 1286, 1305, 1304,
- 1323, 1322, 1343, 1341, 1365, 1363, 1444, 1445, 1449, 1450,
- 1451, 1452, 1453, 1455, 1460, 1465, 1470, 1475, 1480, 1485,
- 1485, 1489, 1490, 1494, 1495, 1496, 1497, 1499, 1505, 1512,
- 1517, 1522, 1522, 1563, 1575, 1587, 1598, 1614, 1668, 1682,
- 1695, 1706, 1717, 1718, 1722, 1723, 1745, 1747, 1763, 1782,
- 1783, 1786, 1788, 1789, 1810, 1817, 1833, 1834, 1838, 1843,
- 1844, 1848, 1849, 1873, 1872, 1882, 1883, 1887, 1888, 1907,
- 1924, 1925, 1929, 1934, 1935, 1939, 1940, 1955, 1956, 1957,
- 1984, 1992, 1993, 1997, 1998, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012
+ 0, 139, 139, 140, 141, 142, 166, 166, 224, 224,
+ 235, 235, 254, 255, 260, 260, 300, 302, 332, 339,
+ 346, 376, 377, 378, 381, 389, 404, 438, 444, 450,
+ 466, 468, 493, 495, 526, 528, 529, 530, 534, 544,
+ 555, 582, 586, 591, 619, 623, 667, 676, 685, 689,
+ 690, 694, 695, 699, 700, 700, 701, 702, 704, 704,
+ 711, 715, 716, 717, 718, 719, 755, 765, 776, 786,
+ 796, 832, 837, 869, 868, 896, 897, 901, 902, 906,
+ 907, 908, 909, 910, 911, 913, 918, 919, 920, 921,
+ 921, 922, 952, 961, 970, 1018, 1027, 1036, 1073, 1083,
+ 1101, 1151, 1150, 1189, 1191, 1196, 1195, 1202, 1204, 1209,
+ 1213, 1273, 1274, 1275, 1276, 1277, 1285, 1284, 1303, 1302,
+ 1321, 1320, 1341, 1339, 1363, 1361, 1442, 1443, 1447, 1448,
+ 1449, 1450, 1451, 1453, 1458, 1463, 1468, 1473, 1478, 1483,
+ 1483, 1487, 1488, 1492, 1493, 1494, 1495, 1497, 1503, 1510,
+ 1515, 1520, 1520, 1561, 1573, 1585, 1596, 1612, 1666, 1680,
+ 1693, 1704, 1715, 1716, 1720, 1721, 1743, 1745, 1761, 1780,
+ 1781, 1784, 1786, 1787, 1808, 1815, 1831, 1832, 1836, 1841,
+ 1842, 1846, 1847, 1871, 1870, 1880, 1881, 1885, 1886, 1905,
+ 1922, 1923, 1927, 1932, 1933, 1937, 1938, 1953, 1954, 1955,
+ 1982, 1990, 1991, 1995, 1996, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010
};
#endif
@@ -1786,13 +1782,13 @@ yyreduce:
switch (yyn)
{
case 5:
-#line 148 "parse_y.y" /* yacc.c:1646 */
+#line 142 "parse_y.y" /* yacc.c:1646 */
{ YYABORT; }
-#line 1792 "parse_y.c" /* yacc.c:1646 */
+#line 1788 "parse_y.c" /* yacc.c:1646 */
break;
case 6:
-#line 172 "parse_y.y" /* yacc.c:1646 */
+#line 166 "parse_y.y" /* yacc.c:1646 */
{
/* reset flags for 'used layers';
* init font and data pointers
@@ -1801,10 +1797,10 @@ yyreduce:
if (!yyPCB)
{
- Message(PCB_MSG_ERROR, "illegal fileformat\n");
+ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n");
YYABORT;
}
- for (i = 0; i < MAX_LAYER + 2; i++)
+ for (i = 0; i < PCB_MAX_LAYER + 2; i++)
LayerFlag[i] = pcb_false;
yyFont = &yyPCB->Font;
yyData = yyPCB->Data;
@@ -1812,20 +1808,21 @@ yyreduce:
yyData->LayerN = 0;
yyPCB->NetlistPatches = yyPCB->NetlistPatchLast = NULL;
layer_group_string = NULL;
+ old_fmt = 0;
}
-#line 1817 "parse_y.c" /* yacc.c:1646 */
+#line 1814 "parse_y.c" /* yacc.c:1646 */
break;
case 7:
-#line 206 "parse_y.y" /* yacc.c:1646 */
+#line 201 "parse_y.y" /* yacc.c:1646 */
{
- PCBTypePtr pcb_save = PCB;
+ pcb_board_t *pcb_save = PCB;
if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL))
conf_set(yy_settings_dest, "design/groups", -1, layer_group_string, POL_OVERWRITE);
- CreateNewPCBPost (yyPCB, 0);
- if (ParseGroupString(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN))
+ pcb_board_new_postproc(yyPCB, 0);
+ if (pcb_layer_parse_group_string(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN, old_fmt))
{
- Message(PCB_MSG_ERROR, "illegal layer-group string\n");
+ pcb_message(PCB_MSG_ERROR, "illegal layer-group string\n");
YYABORT;
}
/* initialize the polygon clipping now since
@@ -1833,35 +1830,35 @@ yyreduce:
*/
free(layer_group_string);
PCB = yyPCB;
- ALLPOLYGON_LOOP (yyData);
+ PCB_POLY_ALL_LOOP(yyData);
{
- InitClip (yyData, layer, polygon);
+ pcb_poly_init_clip(yyData, layer, polygon);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
PCB = pcb_save;
}
-#line 1844 "parse_y.c" /* yacc.c:1646 */
+#line 1841 "parse_y.c" /* yacc.c:1646 */
break;
case 8:
-#line 229 "parse_y.y" /* yacc.c:1646 */
+#line 224 "parse_y.y" /* yacc.c:1646 */
{ PreLoadElementPCB ();
layer_group_string = NULL; }
-#line 1851 "parse_y.c" /* yacc.c:1646 */
+#line 1848 "parse_y.c" /* yacc.c:1646 */
break;
case 9:
-#line 232 "parse_y.y" /* yacc.c:1646 */
+#line 227 "parse_y.y" /* yacc.c:1646 */
{ LayerFlag[0] = pcb_true;
LayerFlag[1] = pcb_true;
yyData->LayerN = 2;
PostLoadElementPCB ();
}
-#line 1861 "parse_y.c" /* yacc.c:1646 */
+#line 1858 "parse_y.c" /* yacc.c:1646 */
break;
case 10:
-#line 240 "parse_y.y" /* yacc.c:1646 */
+#line 235 "parse_y.y" /* yacc.c:1646 */
{
/* reset flags for 'used layers';
* init font and data pointers
@@ -1870,87 +1867,90 @@ yyreduce:
if (!yyData || !yyFont)
{
- Message(PCB_MSG_ERROR, "illegal fileformat\n");
+ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n");
YYABORT;
}
- for (i = 0; i < MAX_LAYER + 2; i++)
+ for (i = 0; i < PCB_MAX_LAYER + 2; i++)
LayerFlag[i] = pcb_false;
yyData->LayerN = 0;
}
-#line 1881 "parse_y.c" /* yacc.c:1646 */
+#line 1878 "parse_y.c" /* yacc.c:1646 */
break;
case 14:
-#line 265 "parse_y.y" /* yacc.c:1646 */
+#line 260 "parse_y.y" /* yacc.c:1646 */
{
/* mark all symbols invalid */
int i;
if (!yyFont)
{
- Message(PCB_MSG_ERROR, "illegal fileformat\n");
+ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n");
YYABORT;
}
yyFont->Valid = pcb_false;
- for (i = 0; i <= MAX_FONTPOSITION; i++)
+ for (i = 0; i <= PCB_MAX_FONTPOSITION; i++)
free (yyFont->Symbol[i].Line);
memset(yyFont->Symbol, 0, sizeof(yyFont->Symbol));
}
-#line 1900 "parse_y.c" /* yacc.c:1646 */
+#line 1897 "parse_y.c" /* yacc.c:1646 */
break;
case 15:
-#line 280 "parse_y.y" /* yacc.c:1646 */
+#line 275 "parse_y.y" /* yacc.c:1646 */
{
yyFont->Valid = pcb_true;
- SetFontInfo(yyFont);
+ pcb_font_set_info(yyFont);
}
-#line 1909 "parse_y.c" /* yacc.c:1646 */
+#line 1906 "parse_y.c" /* yacc.c:1646 */
break;
case 17:
-#line 308 "parse_y.y" /* yacc.c:1646 */
+#line 303 "parse_y.y" /* yacc.c:1646 */
{
if (check_file_version ((yyvsp[-1].integer)) != 0)
{
YYABORT;
}
}
-#line 1920 "parse_y.c" /* yacc.c:1646 */
+#line 1917 "parse_y.c" /* yacc.c:1646 */
break;
case 18:
-#line 338 "parse_y.y" /* yacc.c:1646 */
+#line 333 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Name = (yyvsp[-1].string);
- yyPCB->MaxWidth = MAX_COORD;
- yyPCB->MaxHeight = MAX_COORD;
+ yyPCB->MaxWidth = PCB_MAX_COORD;
+ yyPCB->MaxHeight = PCB_MAX_COORD;
+ old_fmt = 1;
}
-#line 1930 "parse_y.c" /* yacc.c:1646 */
+#line 1928 "parse_y.c" /* yacc.c:1646 */
break;
case 19:
-#line 344 "parse_y.y" /* yacc.c:1646 */
+#line 340 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Name = (yyvsp[-3].string);
yyPCB->MaxWidth = OU ((yyvsp[-2].measure));
yyPCB->MaxHeight = OU ((yyvsp[-1].measure));
+ old_fmt = 1;
}
-#line 1940 "parse_y.c" /* yacc.c:1646 */
+#line 1939 "parse_y.c" /* yacc.c:1646 */
break;
case 20:
-#line 350 "parse_y.y" /* yacc.c:1646 */
+#line 347 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Name = (yyvsp[-3].string);
yyPCB->MaxWidth = NU ((yyvsp[-2].measure));
yyPCB->MaxHeight = NU ((yyvsp[-1].measure));
+ old_fmt = 0;
}
#line 1950 "parse_y.c" /* yacc.c:1646 */
break;
case 24:
-#line 384 "parse_y.y" /* yacc.c:1646 */
+#line 382 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Grid = OU ((yyvsp[-3].measure));
yyPCB->GridOffsetX = OU ((yyvsp[-2].measure));
@@ -1960,7 +1960,7 @@ yyreduce:
break;
case 25:
-#line 392 "parse_y.y" /* yacc.c:1646 */
+#line 390 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Grid = OU ((yyvsp[-4].measure));
yyPCB->GridOffsetX = OU ((yyvsp[-3].measure));
@@ -1976,7 +1976,7 @@ yyreduce:
break;
case 26:
-#line 407 "parse_y.y" /* yacc.c:1646 */
+#line 405 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Grid = NU ((yyvsp[-4].measure));
yyPCB->GridOffsetX = NU ((yyvsp[-3].measure));
@@ -1992,7 +1992,7 @@ yyreduce:
break;
case 27:
-#line 441 "parse_y.y" /* yacc.c:1646 */
+#line 439 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->CursorX = OU ((yyvsp[-3].measure));
yyPCB->CursorY = OU ((yyvsp[-2].measure));
@@ -2002,7 +2002,7 @@ yyreduce:
break;
case 28:
-#line 447 "parse_y.y" /* yacc.c:1646 */
+#line 445 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->CursorX = NU ((yyvsp[-3].measure));
yyPCB->CursorY = NU ((yyvsp[-2].measure));
@@ -2012,7 +2012,7 @@ yyreduce:
break;
case 31:
-#line 471 "parse_y.y" /* yacc.c:1646 */
+#line 469 "parse_y.y" /* yacc.c:1646 */
{
/* Read in cmil^2 for now; in future this should be a noop. */
yyPCB->IsleArea = PCB_MIL_TO_COORD (PCB_MIL_TO_COORD ((yyvsp[-1].number)) / 100.0) / 100.0;
@@ -2021,7 +2021,7 @@ yyreduce:
break;
case 33:
-#line 498 "parse_y.y" /* yacc.c:1646 */
+#line 496 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->ThermScale = (yyvsp[-1].number);
}
@@ -2029,7 +2029,7 @@ yyreduce:
break;
case 38:
-#line 537 "parse_y.y" /* yacc.c:1646 */
+#line 535 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Bloat = NU ((yyvsp[-3].measure));
yyPCB->Shrink = NU ((yyvsp[-2].measure));
@@ -2040,7 +2040,7 @@ yyreduce:
break;
case 39:
-#line 547 "parse_y.y" /* yacc.c:1646 */
+#line 545 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Bloat = NU ((yyvsp[-4].measure));
yyPCB->Shrink = NU ((yyvsp[-3].measure));
@@ -2052,7 +2052,7 @@ yyreduce:
break;
case 40:
-#line 558 "parse_y.y" /* yacc.c:1646 */
+#line 556 "parse_y.y" /* yacc.c:1646 */
{
yyPCB->Bloat = NU ((yyvsp[-6].measure));
yyPCB->Shrink = NU ((yyvsp[-5].measure));
@@ -2065,24 +2065,24 @@ yyreduce:
break;
case 41:
-#line 585 "parse_y.y" /* yacc.c:1646 */
+#line 583 "parse_y.y" /* yacc.c:1646 */
{
- yy_pcb_flags = MakeFlags ((yyvsp[-1].integer) & PCB_FLAGS);
+ yy_pcb_flags = pcb_flag_make((yyvsp[-1].integer) & PCB_FLAGS);
}
#line 2073 "parse_y.c" /* yacc.c:1646 */
break;
case 42:
-#line 589 "parse_y.y" /* yacc.c:1646 */
+#line 587 "parse_y.y" /* yacc.c:1646 */
{
- yy_pcb_flags = string_to_pcbflags ((yyvsp[-1].string), yyerror);
+ yy_pcb_flags = pcb_strflg_board_s2f((yyvsp[-1].string), yyerror);
free((yyvsp[-1].string));
}
#line 2082 "parse_y.c" /* yacc.c:1646 */
break;
case 44:
-#line 622 "parse_y.y" /* yacc.c:1646 */
+#line 620 "parse_y.y" /* yacc.c:1646 */
{
layer_group_string = (yyvsp[-1].string);
}
@@ -2090,11 +2090,11 @@ yyreduce:
break;
case 46:
-#line 670 "parse_y.y" /* yacc.c:1646 */
+#line 668 "parse_y.y" /* yacc.c:1646 */
{
- if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle, "mil"))
+ if (pcb_route_string_parse((yyvsp[-1].string), &yyPCB->RouteStyle, "mil"))
{
- Message(PCB_MSG_ERROR, "illegal route-style string\n");
+ pcb_message(PCB_MSG_ERROR, "illegal route-style string\n");
YYABORT;
}
free((yyvsp[-1].string));
@@ -2103,11 +2103,11 @@ yyreduce:
break;
case 47:
-#line 679 "parse_y.y" /* yacc.c:1646 */
+#line 677 "parse_y.y" /* yacc.c:1646 */
{
- if (ParseRouteString(((yyvsp[-1].string) == NULL ? "" : (yyvsp[-1].string)), &yyPCB->RouteStyle, "cmil"))
+ if (pcb_route_string_parse(((yyvsp[-1].string) == NULL ? "" : (yyvsp[-1].string)), &yyPCB->RouteStyle, "cmil"))
{
- Message(PCB_MSG_ERROR, "illegal route-style string\n");
+ pcb_message(PCB_MSG_ERROR, "illegal route-style string\n");
YYABORT;
}
free((yyvsp[-1].string));
@@ -2116,13 +2116,13 @@ yyreduce:
break;
case 54:
-#line 702 "parse_y.y" /* yacc.c:1646 */
+#line 700 "parse_y.y" /* yacc.c:1646 */
{ attr_list = & yyPCB->Attributes; }
#line 2122 "parse_y.c" /* yacc.c:1646 */
break;
case 58:
-#line 706 "parse_y.y" /* yacc.c:1646 */
+#line 704 "parse_y.y" /* yacc.c:1646 */
{
/* clear pointer to force memory allocation by
* the appropriate subroutine
@@ -2133,15 +2133,15 @@ yyreduce:
break;
case 60:
-#line 713 "parse_y.y" /* yacc.c:1646 */
+#line 711 "parse_y.y" /* yacc.c:1646 */
{ YYABORT; }
#line 2139 "parse_y.c" /* yacc.c:1646 */
break;
case 66:
-#line 758 "parse_y.y" /* yacc.c:1646 */
+#line 756 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewVia(yyData, NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)),
+ pcb_via_new(yyData, NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)),
NU ((yyvsp[-3].measure)), (yyvsp[-2].string), (yyvsp[-1].flagtype));
free ((yyvsp[-2].string));
}
@@ -2149,74 +2149,74 @@ yyreduce:
break;
case 67:
-#line 768 "parse_y.y" /* yacc.c:1646 */
+#line 766 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewVia(yyData, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string),
- OldFlags((yyvsp[-1].integer)));
+ pcb_via_new(yyData, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string),
+ pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2159 "parse_y.c" /* yacc.c:1646 */
break;
case 68:
-#line 779 "parse_y.y" /* yacc.c:1646 */
+#line 777 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewVia(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)),
- OU ((yyvsp[-5].measure)) + OU((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ pcb_via_new(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)),
+ OU ((yyvsp[-5].measure)) + OU((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2169 "parse_y.c" /* yacc.c:1646 */
break;
case 69:
-#line 789 "parse_y.y" /* yacc.c:1646 */
+#line 787 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewVia(yyData, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), 2*GROUNDPLANEFRAME,
- OU((yyvsp[-4].measure)) + 2*MASKFRAME, OU ((yyvsp[-3].measure)), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ pcb_via_new(yyData, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU((yyvsp[-4].measure)) + 2*PCB_MASKFRAME, OU ((yyvsp[-3].measure)), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2179 "parse_y.c" /* yacc.c:1646 */
break;
case 70:
-#line 799 "parse_y.y" /* yacc.c:1646 */
+#line 797 "parse_y.y" /* yacc.c:1646 */
{
- Coord hole = (OU((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE);
+ pcb_coord_t hole = (OU((yyvsp[-3].measure)) * PCB_DEFAULT_DRILLINGHOLE);
/* make sure that there's enough copper left */
- if (OU((yyvsp[-3].measure)) - hole < MIN_PINORVIACOPPER &&
- OU((yyvsp[-3].measure)) > MIN_PINORVIACOPPER)
- hole = OU((yyvsp[-3].measure)) - MIN_PINORVIACOPPER;
+ if (OU((yyvsp[-3].measure)) - hole < PCB_MIN_PINORVIACOPPER &&
+ OU((yyvsp[-3].measure)) > PCB_MIN_PINORVIACOPPER)
+ hole = OU((yyvsp[-3].measure)) - PCB_MIN_PINORVIACOPPER;
- CreateNewVia(yyData, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), 2*GROUNDPLANEFRAME,
- OU((yyvsp[-3].measure)) + 2*MASKFRAME, hole, (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ pcb_via_new(yyData, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU((yyvsp[-3].measure)) + 2*PCB_MASKFRAME, hole, (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2196 "parse_y.c" /* yacc.c:1646 */
break;
case 71:
-#line 835 "parse_y.y" /* yacc.c:1646 */
+#line 833 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewRat(yyData, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer),
+ pcb_rat_new(yyData, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer),
conf_core.appearance.rat_thickness, (yyvsp[-1].flagtype));
}
#line 2205 "parse_y.c" /* yacc.c:1646 */
break;
case 72:
-#line 840 "parse_y.y" /* yacc.c:1646 */
+#line 838 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewRat(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer),
- conf_core.appearance.rat_thickness, OldFlags((yyvsp[-1].integer)));
+ pcb_rat_new(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer),
+ conf_core.appearance.rat_thickness, pcb_flag_old((yyvsp[-1].integer)));
}
#line 2214 "parse_y.c" /* yacc.c:1646 */
break;
case 73:
-#line 871 "parse_y.y" /* yacc.c:1646 */
+#line 869 "parse_y.y" /* yacc.c:1646 */
{
- if ((yyvsp[-4].integer) <= 0 || (yyvsp[-4].integer) > MAX_LAYER + 2)
+ if ((yyvsp[-4].integer) <= 0 || (yyvsp[-4].integer) > PCB_MAX_LAYER + 2)
{
yyerror("Layernumber out of range");
YYABORT;
@@ -2242,107 +2242,107 @@ yyreduce:
break;
case 85:
-#line 916 "parse_y.y" /* yacc.c:1646 */
+#line 914 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPolygonFromRectangle(Layer,
- OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-5].measure)) + OU ((yyvsp[-3].measure)), OU ((yyvsp[-4].measure)) + OU ((yyvsp[-2].measure)), OldFlags((yyvsp[-1].integer)));
+ pcb_poly_new_from_rectangle(Layer,
+ OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-5].measure)) + OU ((yyvsp[-3].measure)), OU ((yyvsp[-4].measure)) + OU ((yyvsp[-2].measure)), pcb_flag_old((yyvsp[-1].integer)));
}
#line 2251 "parse_y.c" /* yacc.c:1646 */
break;
case 89:
-#line 923 "parse_y.y" /* yacc.c:1646 */
+#line 921 "parse_y.y" /* yacc.c:1646 */
{ attr_list = & Layer->Attributes; }
#line 2257 "parse_y.c" /* yacc.c:1646 */
break;
case 92:
-#line 955 "parse_y.y" /* yacc.c:1646 */
+#line 953 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineOnLayer(Layer, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)),
+ pcb_line_new(Layer, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)),
NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), (yyvsp[-1].flagtype));
}
#line 2266 "parse_y.c" /* yacc.c:1646 */
break;
case 93:
-#line 964 "parse_y.y" /* yacc.c:1646 */
+#line 962 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineOnLayer(Layer, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)),
- OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OldFlags((yyvsp[-1].integer)));
+ pcb_line_new(Layer, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)),
+ OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), pcb_flag_old((yyvsp[-1].integer)));
}
#line 2275 "parse_y.c" /* yacc.c:1646 */
break;
case 94:
-#line 973 "parse_y.y" /* yacc.c:1646 */
+#line 971 "parse_y.y" /* yacc.c:1646 */
{
/* eliminate old-style rat-lines */
if ((IV ((yyvsp[-1].measure)) & PCB_FLAG_RAT) == 0)
- CreateNewLineOnLayer(Layer, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)),
- 200*GROUNDPLANEFRAME, OldFlags(IV ((yyvsp[-1].measure))));
+ pcb_line_new(Layer, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)),
+ 200*PCB_GROUNDPLANEFRAME, pcb_flag_old(IV ((yyvsp[-1].measure))));
}
#line 2286 "parse_y.c" /* yacc.c:1646 */
break;
case 95:
-#line 1021 "parse_y.y" /* yacc.c:1646 */
+#line 1019 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcOnLayer(Layer, NU ((yyvsp[-9].measure)), NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number),
+ pcb_arc_new(Layer, NU ((yyvsp[-9].measure)), NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number),
NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-1].flagtype));
}
#line 2295 "parse_y.c" /* yacc.c:1646 */
break;
case 96:
-#line 1030 "parse_y.y" /* yacc.c:1646 */
+#line 1028 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcOnLayer(Layer, OU ((yyvsp[-9].measure)), OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number),
- OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OldFlags((yyvsp[-1].integer)));
+ pcb_arc_new(Layer, OU ((yyvsp[-9].measure)), OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number),
+ OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), pcb_flag_old((yyvsp[-1].integer)));
}
#line 2304 "parse_y.c" /* yacc.c:1646 */
break;
case 97:
-#line 1039 "parse_y.y" /* yacc.c:1646 */
+#line 1037 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcOnLayer(Layer, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-6].measure)), IV ((yyvsp[-3].measure)), (yyvsp[-2].number),
- OU ((yyvsp[-4].measure)), 200*GROUNDPLANEFRAME, OldFlags((yyvsp[-1].integer)));
+ pcb_arc_new(Layer, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-6].measure)), IV ((yyvsp[-3].measure)), (yyvsp[-2].number),
+ OU ((yyvsp[-4].measure)), 200*PCB_GROUNDPLANEFRAME, pcb_flag_old((yyvsp[-1].integer)));
}
#line 2313 "parse_y.c" /* yacc.c:1646 */
break;
case 98:
-#line 1076 "parse_y.y" /* yacc.c:1646 */
+#line 1074 "parse_y.y" /* yacc.c:1646 */
{
/* use a default scale of 100% */
- CreateNewText(Layer,yyFont,OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), 100, (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ pcb_text_new(Layer,yyFont,OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), 100, (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2323 "parse_y.c" /* yacc.c:1646 */
break;
case 99:
-#line 1086 "parse_y.y" /* yacc.c:1646 */
+#line 1084 "parse_y.y" /* yacc.c:1646 */
{
if ((yyvsp[-1].integer) & PCB_FLAG_ONSILK)
{
- LayerTypePtr lay = &yyData->Layer[yyData->LayerN +
- (((yyvsp[-1].integer) & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)];
+ pcb_layer_t *lay = &yyData->Layer[yyData->LayerN +
+ (((yyvsp[-1].integer) & PCB_FLAG_ONSOLDER) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)];
- CreateNewText(lay ,yyFont, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string),
- OldFlags((yyvsp[-1].integer)));
+ pcb_text_new(lay ,yyFont, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string),
+ pcb_flag_old((yyvsp[-1].integer)));
}
else
- CreateNewText(Layer, yyFont, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string),
- OldFlags((yyvsp[-1].integer)));
+ pcb_text_new(Layer, yyFont, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string),
+ pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2342 "parse_y.c" /* yacc.c:1646 */
break;
case 100:
-#line 1104 "parse_y.y" /* yacc.c:1646 */
+#line 1102 "parse_y.y" /* yacc.c:1646 */
{
/* FIXME: shouldn't know about .f */
/* I don't think this matters because anything with hi_format
@@ -2353,28 +2353,28 @@ yyreduce:
*/
if ((yyvsp[-1].flagtype).f & PCB_FLAG_ONSILK)
{
- LayerTypePtr lay = &yyData->Layer[yyData->LayerN +
- (((yyvsp[-1].flagtype).f & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)];
+ pcb_layer_t *lay = &yyData->Layer[yyData->LayerN +
+ (((yyvsp[-1].flagtype).f & PCB_FLAG_ONSOLDER) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)];
- CreateNewText(lay, yyFont, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].flagtype));
+ pcb_text_new(lay, yyFont, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].flagtype));
}
else
- CreateNewText(Layer, yyFont, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].flagtype));
+ pcb_text_new(Layer, yyFont, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].flagtype));
free ((yyvsp[-2].string));
}
#line 2366 "parse_y.c" /* yacc.c:1646 */
break;
case 101:
-#line 1153 "parse_y.y" /* yacc.c:1646 */
+#line 1151 "parse_y.y" /* yacc.c:1646 */
{
- Polygon = CreateNewPolygon(Layer, (yyvsp[-2].flagtype));
+ Polygon = pcb_poly_new(Layer, (yyvsp[-2].flagtype));
}
#line 2374 "parse_y.c" /* yacc.c:1646 */
break;
case 102:
-#line 1158 "parse_y.y" /* yacc.c:1646 */
+#line 1156 "parse_y.y" /* yacc.c:1646 */
{
pcb_cardinal_t contour, contour_start, contour_end;
pcb_bool bad_contour_found = pcb_false;
@@ -2392,52 +2392,52 @@ yyreduce:
if (bad_contour_found)
{
- Message(PCB_MSG_WARNING, "WARNING parsing file '%s'\n"
+ pcb_message(PCB_MSG_WARNING, "WARNING parsing file '%s'\n"
" line: %i\n"
" description: 'ignored polygon (< 3 points in a contour)'\n",
yyfilename, pcb_lineno);
- DestroyObject(yyData, PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
+ pcb_destroy_object(yyData, PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
}
else
{
- SetPolygonBoundingBox (Polygon);
+ pcb_poly_bbox(Polygon);
if (!Layer->polygon_tree)
- Layer->polygon_tree = r_create_tree (NULL, 0, 0);
- r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0);
+ Layer->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
}
}
#line 2410 "parse_y.c" /* yacc.c:1646 */
break;
case 105:
-#line 1198 "parse_y.y" /* yacc.c:1646 */
+#line 1196 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewHoleInPolygon (Polygon);
+ pcb_poly_hole_new(Polygon);
}
#line 2418 "parse_y.c" /* yacc.c:1646 */
break;
case 109:
-#line 1212 "parse_y.y" /* yacc.c:1646 */
+#line 1210 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPointInPolygon(Polygon, OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure)));
+ pcb_poly_point_new(Polygon, OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure)));
}
#line 2426 "parse_y.c" /* yacc.c:1646 */
break;
case 110:
-#line 1216 "parse_y.y" /* yacc.c:1646 */
+#line 1214 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPointInPolygon(Polygon, NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure)));
+ pcb_poly_point_new(Polygon, NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure)));
}
#line 2434 "parse_y.c" /* yacc.c:1646 */
break;
case 116:
-#line 1287 "parse_y.y" /* yacc.c:1646 */
+#line 1285 "parse_y.y" /* yacc.c:1646 */
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, NoFlags(),
- (yyvsp[-6].string), (yyvsp[-5].string), NULL, OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].integer), 100, NoFlags(), pcb_false);
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_no_flags(),
+ (yyvsp[-6].string), (yyvsp[-5].string), NULL, OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].integer), 100, pcb_no_flags(), pcb_false);
free ((yyvsp[-6].string));
free ((yyvsp[-5].string));
pin_num = 1;
@@ -2446,18 +2446,18 @@ yyreduce:
break;
case 117:
-#line 1295 "parse_y.y" /* yacc.c:1646 */
+#line 1293 "parse_y.y" /* yacc.c:1646 */
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
#line 2454 "parse_y.c" /* yacc.c:1646 */
break;
case 118:
-#line 1305 "parse_y.y" /* yacc.c:1646 */
+#line 1303 "parse_y.y" /* yacc.c:1646 */
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags((yyvsp[-9].integer)),
- (yyvsp[-8].string), (yyvsp[-7].string), NULL, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), OldFlags((yyvsp[-2].integer)), pcb_false);
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old((yyvsp[-9].integer)),
+ (yyvsp[-8].string), (yyvsp[-7].string), NULL, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), pcb_flag_old((yyvsp[-2].integer)), pcb_false);
free ((yyvsp[-8].string));
free ((yyvsp[-7].string));
pin_num = 1;
@@ -2466,18 +2466,18 @@ yyreduce:
break;
case 119:
-#line 1313 "parse_y.y" /* yacc.c:1646 */
+#line 1311 "parse_y.y" /* yacc.c:1646 */
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
#line 2474 "parse_y.c" /* yacc.c:1646 */
break;
case 120:
-#line 1323 "parse_y.y" /* yacc.c:1646 */
+#line 1321 "parse_y.y" /* yacc.c:1646 */
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags((yyvsp[-10].integer)),
- (yyvsp[-9].string), (yyvsp[-8].string), (yyvsp[-7].string), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), OldFlags((yyvsp[-2].integer)), pcb_false);
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old((yyvsp[-10].integer)),
+ (yyvsp[-9].string), (yyvsp[-8].string), (yyvsp[-7].string), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), pcb_flag_old((yyvsp[-2].integer)), pcb_false);
free ((yyvsp[-9].string));
free ((yyvsp[-8].string));
free ((yyvsp[-7].string));
@@ -2487,19 +2487,19 @@ yyreduce:
break;
case 121:
-#line 1332 "parse_y.y" /* yacc.c:1646 */
+#line 1330 "parse_y.y" /* yacc.c:1646 */
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
#line 2495 "parse_y.c" /* yacc.c:1646 */
break;
case 122:
-#line 1343 "parse_y.y" /* yacc.c:1646 */
+#line 1341 "parse_y.y" /* yacc.c:1646 */
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags((yyvsp[-12].integer)),
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old((yyvsp[-12].integer)),
(yyvsp[-11].string), (yyvsp[-10].string), (yyvsp[-9].string), OU ((yyvsp[-8].measure)) + OU ((yyvsp[-6].measure)), OU ((yyvsp[-7].measure)) + OU ((yyvsp[-5].measure)),
- (yyvsp[-4].number), (yyvsp[-3].number), OldFlags((yyvsp[-2].integer)), pcb_false);
+ (yyvsp[-4].number), (yyvsp[-3].number), pcb_flag_old((yyvsp[-2].integer)), pcb_false);
yyElement->MarkX = OU ((yyvsp[-8].measure));
yyElement->MarkY = OU ((yyvsp[-7].measure));
free ((yyvsp[-11].string));
@@ -2510,17 +2510,17 @@ yyreduce:
break;
case 123:
-#line 1354 "parse_y.y" /* yacc.c:1646 */
+#line 1352 "parse_y.y" /* yacc.c:1646 */
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
#line 2518 "parse_y.c" /* yacc.c:1646 */
break;
case 124:
-#line 1365 "parse_y.y" /* yacc.c:1646 */
+#line 1363 "parse_y.y" /* yacc.c:1646 */
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, (yyvsp[-12].flagtype),
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, (yyvsp[-12].flagtype),
(yyvsp[-11].string), (yyvsp[-10].string), (yyvsp[-9].string), NU ((yyvsp[-8].measure)) + NU ((yyvsp[-6].measure)), NU ((yyvsp[-7].measure)) + NU ((yyvsp[-5].measure)),
(yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].flagtype), pcb_false);
yyElement->MarkX = NU ((yyvsp[-8].measure));
@@ -2533,47 +2533,47 @@ yyreduce:
break;
case 125:
-#line 1376 "parse_y.y" /* yacc.c:1646 */
+#line 1374 "parse_y.y" /* yacc.c:1646 */
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
#line 2541 "parse_y.c" /* yacc.c:1646 */
break;
case 133:
-#line 1456 "parse_y.y" /* yacc.c:1646 */
+#line 1454 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineInElement(yyElement, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure)));
+ pcb_element_line_new(yyElement, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure)));
}
#line 2549 "parse_y.c" /* yacc.c:1646 */
break;
case 134:
-#line 1461 "parse_y.y" /* yacc.c:1646 */
+#line 1459 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineInElement(yyElement, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure)));
+ pcb_element_line_new(yyElement, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure)));
}
#line 2557 "parse_y.c" /* yacc.c:1646 */
break;
case 135:
-#line 1466 "parse_y.y" /* yacc.c:1646 */
+#line 1464 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcInElement(yyElement, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure)));
+ pcb_element_arc_new(yyElement, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure)));
}
#line 2565 "parse_y.c" /* yacc.c:1646 */
break;
case 136:
-#line 1471 "parse_y.y" /* yacc.c:1646 */
+#line 1469 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcInElement(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure)));
+ pcb_element_arc_new(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure)));
}
#line 2573 "parse_y.c" /* yacc.c:1646 */
break;
case 137:
-#line 1476 "parse_y.y" /* yacc.c:1646 */
+#line 1474 "parse_y.y" /* yacc.c:1646 */
{
yyElement->MarkX = NU ((yyvsp[-2].measure));
yyElement->MarkY = NU ((yyvsp[-1].measure));
@@ -2582,7 +2582,7 @@ yyreduce:
break;
case 138:
-#line 1481 "parse_y.y" /* yacc.c:1646 */
+#line 1479 "parse_y.y" /* yacc.c:1646 */
{
yyElement->MarkX = OU ((yyvsp[-2].measure));
yyElement->MarkY = OU ((yyvsp[-1].measure));
@@ -2591,15 +2591,15 @@ yyreduce:
break;
case 139:
-#line 1485 "parse_y.y" /* yacc.c:1646 */
+#line 1483 "parse_y.y" /* yacc.c:1646 */
{ attr_list = & yyElement->Attributes; }
#line 2597 "parse_y.c" /* yacc.c:1646 */
break;
case 147:
-#line 1500 "parse_y.y" /* yacc.c:1646 */
+#line 1498 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineInElement(yyElement, NU ((yyvsp[-5].measure)) + yyElement->MarkX,
+ pcb_element_line_new(yyElement, NU ((yyvsp[-5].measure)) + yyElement->MarkX,
NU ((yyvsp[-4].measure)) + yyElement->MarkY, NU ((yyvsp[-3].measure)) + yyElement->MarkX,
NU ((yyvsp[-2].measure)) + yyElement->MarkY, NU ((yyvsp[-1].measure)));
}
@@ -2607,9 +2607,9 @@ yyreduce:
break;
case 148:
-#line 1506 "parse_y.y" /* yacc.c:1646 */
+#line 1504 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineInElement(yyElement, OU ((yyvsp[-5].measure)) + yyElement->MarkX,
+ pcb_element_line_new(yyElement, OU ((yyvsp[-5].measure)) + yyElement->MarkX,
OU ((yyvsp[-4].measure)) + yyElement->MarkY, OU ((yyvsp[-3].measure)) + yyElement->MarkX,
OU ((yyvsp[-2].measure)) + yyElement->MarkY, OU ((yyvsp[-1].measure)));
}
@@ -2617,33 +2617,33 @@ yyreduce:
break;
case 149:
-#line 1513 "parse_y.y" /* yacc.c:1646 */
+#line 1511 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcInElement(yyElement, NU ((yyvsp[-7].measure)) + yyElement->MarkX,
+ pcb_element_arc_new(yyElement, NU ((yyvsp[-7].measure)) + yyElement->MarkX,
NU ((yyvsp[-6].measure)) + yyElement->MarkY, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure)));
}
#line 2626 "parse_y.c" /* yacc.c:1646 */
break;
case 150:
-#line 1518 "parse_y.y" /* yacc.c:1646 */
+#line 1516 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewArcInElement(yyElement, OU ((yyvsp[-7].measure)) + yyElement->MarkX,
+ pcb_element_arc_new(yyElement, OU ((yyvsp[-7].measure)) + yyElement->MarkX,
OU ((yyvsp[-6].measure)) + yyElement->MarkY, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure)));
}
#line 2635 "parse_y.c" /* yacc.c:1646 */
break;
case 151:
-#line 1522 "parse_y.y" /* yacc.c:1646 */
+#line 1520 "parse_y.y" /* yacc.c:1646 */
{ attr_list = & yyElement->Attributes; }
#line 2641 "parse_y.c" /* yacc.c:1646 */
break;
case 153:
-#line 1564 "parse_y.y" /* yacc.c:1646 */
+#line 1562 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPin(yyElement, NU ((yyvsp[-9].measure)) + yyElement->MarkX,
+ pcb_element_pin_new(yyElement, NU ((yyvsp[-9].measure)) + yyElement->MarkX,
NU ((yyvsp[-8].measure)) + yyElement->MarkY, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].string),
(yyvsp[-2].string), (yyvsp[-1].flagtype));
free ((yyvsp[-3].string));
@@ -2653,11 +2653,11 @@ yyreduce:
break;
case 154:
-#line 1576 "parse_y.y" /* yacc.c:1646 */
+#line 1574 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPin(yyElement, OU ((yyvsp[-9].measure)) + yyElement->MarkX,
+ pcb_element_pin_new(yyElement, OU ((yyvsp[-9].measure)) + yyElement->MarkX,
OU ((yyvsp[-8].measure)) + yyElement->MarkY, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].string),
- (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-3].string));
free ((yyvsp[-2].string));
}
@@ -2665,10 +2665,10 @@ yyreduce:
break;
case 155:
-#line 1588 "parse_y.y" /* yacc.c:1646 */
+#line 1586 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPin(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), 2*GROUNDPLANEFRAME,
- OU ((yyvsp[-5].measure)) + 2*MASKFRAME, OU ((yyvsp[-4].measure)), (yyvsp[-3].string), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ pcb_element_pin_new(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU ((yyvsp[-5].measure)) + 2*PCB_MASKFRAME, OU ((yyvsp[-4].measure)), (yyvsp[-3].string), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-3].string));
free ((yyvsp[-2].string));
}
@@ -2676,13 +2676,13 @@ yyreduce:
break;
case 156:
-#line 1599 "parse_y.y" /* yacc.c:1646 */
+#line 1597 "parse_y.y" /* yacc.c:1646 */
{
char p_number[8];
sprintf(p_number, "%d", pin_num++);
- CreateNewPin(yyElement, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), 2*GROUNDPLANEFRAME,
- OU ((yyvsp[-4].measure)) + 2*MASKFRAME, OU ((yyvsp[-3].measure)), (yyvsp[-2].string), p_number, OldFlags((yyvsp[-1].integer)));
+ pcb_element_pin_new(yyElement, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU ((yyvsp[-4].measure)) + 2*PCB_MASKFRAME, OU ((yyvsp[-3].measure)), (yyvsp[-2].string), p_number, pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
@@ -2690,28 +2690,28 @@ yyreduce:
break;
case 157:
-#line 1615 "parse_y.y" /* yacc.c:1646 */
+#line 1613 "parse_y.y" /* yacc.c:1646 */
{
- Coord hole = OU ((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE;
+ pcb_coord_t hole = OU ((yyvsp[-3].measure)) * PCB_DEFAULT_DRILLINGHOLE;
char p_number[8];
/* make sure that there's enough copper left */
- if (OU ((yyvsp[-3].measure)) - hole < MIN_PINORVIACOPPER &&
- OU ((yyvsp[-3].measure)) > MIN_PINORVIACOPPER)
- hole = OU ((yyvsp[-3].measure)) - MIN_PINORVIACOPPER;
+ if (OU ((yyvsp[-3].measure)) - hole < PCB_MIN_PINORVIACOPPER &&
+ OU ((yyvsp[-3].measure)) > PCB_MIN_PINORVIACOPPER)
+ hole = OU ((yyvsp[-3].measure)) - PCB_MIN_PINORVIACOPPER;
sprintf(p_number, "%d", pin_num++);
- CreateNewPin(yyElement, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), 2*GROUNDPLANEFRAME,
- OU ((yyvsp[-3].measure)) + 2*MASKFRAME, hole, (yyvsp[-2].string), p_number, OldFlags((yyvsp[-1].integer)));
+ pcb_element_pin_new(yyElement, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU ((yyvsp[-3].measure)) + 2*PCB_MASKFRAME, hole, (yyvsp[-2].string), p_number, pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2709 "parse_y.c" /* yacc.c:1646 */
break;
case 158:
-#line 1669 "parse_y.y" /* yacc.c:1646 */
+#line 1667 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPad(yyElement, NU ((yyvsp[-10].measure)) + yyElement->MarkX,
+ pcb_element_pad_new(yyElement, NU ((yyvsp[-10].measure)) + yyElement->MarkX,
NU ((yyvsp[-9].measure)) + yyElement->MarkY,
NU ((yyvsp[-8].measure)) + yyElement->MarkX,
NU ((yyvsp[-7].measure)) + yyElement->MarkY, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)),
@@ -2723,12 +2723,12 @@ yyreduce:
break;
case 159:
-#line 1683 "parse_y.y" /* yacc.c:1646 */
+#line 1681 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPad(yyElement,OU ((yyvsp[-10].measure)) + yyElement->MarkX,
+ pcb_element_pad_new(yyElement,OU ((yyvsp[-10].measure)) + yyElement->MarkX,
OU ((yyvsp[-9].measure)) + yyElement->MarkY, OU ((yyvsp[-8].measure)) + yyElement->MarkX,
OU ((yyvsp[-7].measure)) + yyElement->MarkY, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)),
- (yyvsp[-3].string), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ (yyvsp[-3].string), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-3].string));
free ((yyvsp[-2].string));
}
@@ -2736,10 +2736,10 @@ yyreduce:
break;
case 160:
-#line 1696 "parse_y.y" /* yacc.c:1646 */
+#line 1694 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewPad(yyElement,OU ((yyvsp[-8].measure)),OU ((yyvsp[-7].measure)),OU ((yyvsp[-6].measure)),OU ((yyvsp[-5].measure)),OU ((yyvsp[-4].measure)), 2*GROUNDPLANEFRAME,
- OU ((yyvsp[-4].measure)) + 2*MASKFRAME, (yyvsp[-3].string), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer)));
+ pcb_element_pad_new(yyElement,OU ((yyvsp[-8].measure)),OU ((yyvsp[-7].measure)),OU ((yyvsp[-6].measure)),OU ((yyvsp[-5].measure)),OU ((yyvsp[-4].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU ((yyvsp[-4].measure)) + 2*PCB_MASKFRAME, (yyvsp[-3].string), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-3].string));
free ((yyvsp[-2].string));
}
@@ -2747,34 +2747,34 @@ yyreduce:
break;
case 161:
-#line 1707 "parse_y.y" /* yacc.c:1646 */
+#line 1705 "parse_y.y" /* yacc.c:1646 */
{
char p_number[8];
sprintf(p_number, "%d", pin_num++);
- CreateNewPad(yyElement,OU ((yyvsp[-7].measure)),OU ((yyvsp[-6].measure)),OU ((yyvsp[-5].measure)),OU ((yyvsp[-4].measure)),OU ((yyvsp[-3].measure)), 2*GROUNDPLANEFRAME,
- OU ((yyvsp[-3].measure)) + 2*MASKFRAME, (yyvsp[-2].string),p_number, OldFlags((yyvsp[-1].integer)));
+ pcb_element_pad_new(yyElement,OU ((yyvsp[-7].measure)),OU ((yyvsp[-6].measure)),OU ((yyvsp[-5].measure)),OU ((yyvsp[-4].measure)),OU ((yyvsp[-3].measure)), 2*PCB_GROUNDPLANEFRAME,
+ OU ((yyvsp[-3].measure)) + 2*PCB_MASKFRAME, (yyvsp[-2].string),p_number, pcb_flag_old((yyvsp[-1].integer)));
free ((yyvsp[-2].string));
}
#line 2760 "parse_y.c" /* yacc.c:1646 */
break;
case 162:
-#line 1717 "parse_y.y" /* yacc.c:1646 */
- { (yyval.flagtype) = OldFlags((yyvsp[0].integer)); }
+#line 1715 "parse_y.y" /* yacc.c:1646 */
+ { (yyval.flagtype) = pcb_flag_old((yyvsp[0].integer)); }
#line 2766 "parse_y.c" /* yacc.c:1646 */
break;
case 163:
-#line 1718 "parse_y.y" /* yacc.c:1646 */
- { (yyval.flagtype) = string_to_flags ((yyvsp[0].string), yyerror); free((yyvsp[0].string)); }
+#line 1716 "parse_y.y" /* yacc.c:1646 */
+ { (yyval.flagtype) = pcb_strflg_s2f((yyvsp[0].string), yyerror); free((yyvsp[0].string)); }
#line 2772 "parse_y.c" /* yacc.c:1646 */
break;
case 167:
-#line 1748 "parse_y.y" /* yacc.c:1646 */
+#line 1746 "parse_y.y" /* yacc.c:1646 */
{
- if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > MAX_FONTPOSITION)
+ if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > PCB_MAX_FONTPOSITION)
{
yyerror("fontposition out of range");
YYABORT;
@@ -2792,9 +2792,9 @@ yyreduce:
break;
case 168:
-#line 1764 "parse_y.y" /* yacc.c:1646 */
+#line 1762 "parse_y.y" /* yacc.c:1646 */
{
- if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > MAX_FONTPOSITION)
+ if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > PCB_MAX_FONTPOSITION)
{
yyerror("fontposition out of range");
YYABORT;
@@ -2812,25 +2812,25 @@ yyreduce:
break;
case 174:
-#line 1811 "parse_y.y" /* yacc.c:1646 */
+#line 1809 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineInSymbol(Symbol, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure)));
+ pcb_font_new_line_in_sym(Symbol, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure)));
}
#line 2820 "parse_y.c" /* yacc.c:1646 */
break;
case 175:
-#line 1818 "parse_y.y" /* yacc.c:1646 */
+#line 1816 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewLineInSymbol(Symbol, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure)));
+ pcb_font_new_line_in_sym(Symbol, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure)));
}
#line 2828 "parse_y.c" /* yacc.c:1646 */
break;
case 183:
-#line 1873 "parse_y.y" /* yacc.c:1646 */
+#line 1871 "parse_y.y" /* yacc.c:1646 */
{
- Menu = CreateNewNet((LibraryTypePtr)&yyPCB->NetlistLib, (yyvsp[-3].string), (yyvsp[-2].string));
+ Menu = pcb_lib_net_new((pcb_lib_t *)&yyPCB->NetlistLib, (yyvsp[-3].string), (yyvsp[-2].string));
free ((yyvsp[-3].string));
free ((yyvsp[-2].string));
}
@@ -2838,36 +2838,36 @@ yyreduce:
break;
case 189:
-#line 1908 "parse_y.y" /* yacc.c:1646 */
+#line 1906 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewConnection(Menu, (yyvsp[-1].string));
+ pcb_lib_conn_new(Menu, (yyvsp[-1].string));
free ((yyvsp[-1].string));
}
#line 2847 "parse_y.c" /* yacc.c:1646 */
break;
case 197:
-#line 1955 "parse_y.y" /* yacc.c:1646 */
- { rats_patch_append(yyPCB, RATP_ADD_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); }
+#line 1953 "parse_y.y" /* yacc.c:1646 */
+ { pcb_ratspatch_append(yyPCB, RATP_ADD_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); }
#line 2853 "parse_y.c" /* yacc.c:1646 */
break;
case 198:
-#line 1956 "parse_y.y" /* yacc.c:1646 */
- { rats_patch_append(yyPCB, RATP_DEL_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); }
+#line 1954 "parse_y.y" /* yacc.c:1646 */
+ { pcb_ratspatch_append(yyPCB, RATP_DEL_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); }
#line 2859 "parse_y.c" /* yacc.c:1646 */
break;
case 199:
-#line 1957 "parse_y.y" /* yacc.c:1646 */
- { rats_patch_append(yyPCB, RATP_CHANGE_ATTRIB, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string)); free((yyvsp[-3].string)); free((yyvsp[-2].string)); free((yyvsp[-1].string)); }
+#line 1955 "parse_y.y" /* yacc.c:1646 */
+ { pcb_ratspatch_append(yyPCB, RATP_CHANGE_ATTRIB, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string)); free((yyvsp[-3].string)); free((yyvsp[-2].string)); free((yyvsp[-1].string)); }
#line 2865 "parse_y.c" /* yacc.c:1646 */
break;
case 200:
-#line 1985 "parse_y.y" /* yacc.c:1646 */
+#line 1983 "parse_y.y" /* yacc.c:1646 */
{
- CreateNewAttribute (attr_list, (yyvsp[-2].string), (yyvsp[-1].string) ? (yyvsp[-1].string) : (char *)"");
+ pcb_attribute_put(attr_list, (yyvsp[-2].string), (yyvsp[-1].string) ? (yyvsp[-1].string) : (char *)"", 0);
free ((yyvsp[-2].string));
free ((yyvsp[-1].string));
}
@@ -2875,85 +2875,85 @@ yyreduce:
break;
case 201:
-#line 1992 "parse_y.y" /* yacc.c:1646 */
+#line 1990 "parse_y.y" /* yacc.c:1646 */
{ (yyval.string) = (yyvsp[0].string); }
#line 2881 "parse_y.c" /* yacc.c:1646 */
break;
case 202:
-#line 1993 "parse_y.y" /* yacc.c:1646 */
+#line 1991 "parse_y.y" /* yacc.c:1646 */
{ (yyval.string) = 0; }
#line 2887 "parse_y.c" /* yacc.c:1646 */
break;
case 203:
-#line 1997 "parse_y.y" /* yacc.c:1646 */
+#line 1995 "parse_y.y" /* yacc.c:1646 */
{ (yyval.number) = (yyvsp[0].number); }
#line 2893 "parse_y.c" /* yacc.c:1646 */
break;
case 204:
-#line 1998 "parse_y.y" /* yacc.c:1646 */
+#line 1996 "parse_y.y" /* yacc.c:1646 */
{ (yyval.number) = (yyvsp[0].integer); }
#line 2899 "parse_y.c" /* yacc.c:1646 */
break;
case 205:
-#line 2003 "parse_y.y" /* yacc.c:1646 */
+#line 2001 "parse_y.y" /* yacc.c:1646 */
{ do_measure(&(yyval.measure), (yyvsp[0].number), PCB_MIL_TO_COORD ((yyvsp[0].number)) / 100.0, 0); }
#line 2905 "parse_y.c" /* yacc.c:1646 */
break;
case 206:
-#line 2004 "parse_y.y" /* yacc.c:1646 */
+#line 2002 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MIL_TO_COORD ((yyvsp[-1].number)) / 100000.0); }
#line 2911 "parse_y.c" /* yacc.c:1646 */
break;
case 207:
-#line 2005 "parse_y.y" /* yacc.c:1646 */
+#line 2003 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MIL_TO_COORD ((yyvsp[-1].number)) / 100.0); }
#line 2917 "parse_y.c" /* yacc.c:1646 */
break;
case 208:
-#line 2006 "parse_y.y" /* yacc.c:1646 */
+#line 2004 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MIL_TO_COORD ((yyvsp[-1].number))); }
#line 2923 "parse_y.c" /* yacc.c:1646 */
break;
case 209:
-#line 2007 "parse_y.y" /* yacc.c:1646 */
+#line 2005 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_INCH_TO_COORD ((yyvsp[-1].number))); }
#line 2929 "parse_y.c" /* yacc.c:1646 */
break;
case 210:
-#line 2008 "parse_y.y" /* yacc.c:1646 */
+#line 2006 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) / 1000000.0); }
#line 2935 "parse_y.c" /* yacc.c:1646 */
break;
case 211:
-#line 2009 "parse_y.y" /* yacc.c:1646 */
+#line 2007 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) / 1000.0); }
#line 2941 "parse_y.c" /* yacc.c:1646 */
break;
case 212:
-#line 2010 "parse_y.y" /* yacc.c:1646 */
+#line 2008 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number))); }
#line 2947 "parse_y.c" /* yacc.c:1646 */
break;
case 213:
-#line 2011 "parse_y.y" /* yacc.c:1646 */
+#line 2009 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) * 1000.0); }
#line 2953 "parse_y.c" /* yacc.c:1646 */
break;
case 214:
-#line 2012 "parse_y.y" /* yacc.c:1646 */
+#line 2010 "parse_y.y" /* yacc.c:1646 */
{ M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) * 1000000.0); }
#line 2959 "parse_y.c" /* yacc.c:1646 */
break;
@@ -3187,7 +3187,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 2015 "parse_y.y" /* yacc.c:1906 */
+#line 2013 "parse_y.y" /* yacc.c:1906 */
/* ---------------------------------------------------------------------------
@@ -3195,7 +3195,7 @@ yyreturn:
*/
int yyerror(const char * s)
{
- Message(PCB_MSG_ERROR, "ERROR parsing file '%s'\n"
+ pcb_message(PCB_MSG_ERROR, "ERROR parsing file '%s'\n"
" line: %i\n"
" description: '%s'\n",
yyfilename, pcb_lineno, s);
@@ -3211,7 +3211,7 @@ static int
check_file_version (int ver)
{
if ( ver > PCB_FILE_VERSION ) {
- Message (PCB_MSG_DEFAULT, "ERROR: The file you are attempting to load is in a format\n"
+ pcb_message(PCB_MSG_ERROR, "ERROR: The file you are attempting to load is in a format\n"
"which is too new for this version of pcb. To load this file\n"
"you need a version of pcb which is >= %d. If you are\n"
"using a version built from git source, the source date\n"
@@ -3224,7 +3224,7 @@ check_file_version (int ver)
}
static void
-do_measure (PLMeasure *m, Coord i, double d, int u)
+do_measure (PLMeasure *m, pcb_coord_t i, double d, int u)
{
m->ival = i;
m->bval = pcb_round (d);
@@ -3240,7 +3240,7 @@ integer_value (PLMeasure m)
return m.ival;
}
-static Coord
+static pcb_coord_t
old_units (PLMeasure m)
{
if (m.has_units)
@@ -3248,7 +3248,7 @@ old_units (PLMeasure m)
return pcb_round (PCB_MIL_TO_COORD (m.ival));
}
-static Coord
+static pcb_coord_t
new_units (PLMeasure m)
{
if (m.has_units)
@@ -3256,3 +3256,21 @@ new_units (PLMeasure m)
/* if there's no unit m.dval already contains the converted value */
return pcb_round (m.dval);
}
+
+/* This converts old flag bits (from saved PCB files) to new format. */
+static pcb_flag_t pcb_flag_old(unsigned int flags)
+{
+ pcb_flag_t rv;
+ int i, f;
+ memset(&rv, 0, sizeof(rv));
+ /* If we move flag bits around, this is where we map old bits to them. */
+ rv.f = flags & 0xffff;
+ f = 0x10000;
+ for (i = 0; i < 8; i++) {
+ /* use the closest thing to the old thermal style */
+ if (flags & f)
+ rv.t[i / 2] |= (1 << (4 * (i % 2)));
+ f <<= 1;
+ }
+ return rv;
+}
diff --git a/src_plugins/io_pcb/parse_y.h b/src_plugins/io_pcb/parse_y.h
index 758b2ca..c93774a 100644
--- a/src_plugins/io_pcb/parse_y.h
+++ b/src_plugins/io_pcb/parse_y.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
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
@@ -98,19 +98,21 @@ extern int pcb_debug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
+
union YYSTYPE
{
-#line 118 "parse_y.y" /* yacc.c:1909 */
+#line 112 "parse_y.y" /* yacc.c:1909 */
int integer;
double number;
char *string;
- FlagType flagtype;
+ pcb_flag_t flagtype;
PLMeasure measure;
#line 113 "parse_y.h" /* yacc.c:1909 */
};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
diff --git a/src_plugins/io_pcb/parse_y.y b/src_plugins/io_pcb/parse_y.y
index 8fae060..393163b 100644
--- a/src_plugins/io_pcb/parse_y.y
+++ b/src_plugins/io_pcb/parse_y.y
@@ -39,58 +39,51 @@
*/
#include "config.h"
+#include "flag.h"
+#include "board.h"
#include "conf_core.h"
-#include "global.h"
#include "layer.h"
-#include "create.h"
#include "data.h"
#include "error.h"
#include "file.h"
-#include "mymem.h"
-#include "misc.h"
#include "parse_l.h"
#include "polygon.h"
#include "remove.h"
#include "rtree.h"
-#include "strflags.h"
-#include "thermal.h"
+#include "flag_str.h"
+#include "obj_pinvia_therm.h"
#include "rats_patch.h"
-#include "flags.h"
#include "route_style.h"
#include "compat_misc.h"
+#include "obj_all.h"
-#ifdef HAVE_LIBDMALLOC
-# include <dmalloc.h> /* see http://dmalloc.com */
-#endif
-
-
-
-static LayerTypePtr Layer;
-static PolygonTypePtr Polygon;
-static SymbolTypePtr Symbol;
+static pcb_layer_t *Layer;
+static pcb_polygon_t *Polygon;
+static pcb_symbol_t *Symbol;
static int pin_num;
-static LibraryMenuTypePtr Menu;
-static pcb_bool LayerFlag[MAX_LAYER + 2];
+static pcb_lib_menu_t *Menu;
+static pcb_bool LayerFlag[PCB_MAX_LAYER + 2];
+static int old_fmt; /* 1 if we are reading a PCB(), 0 if PCB[] */
extern char *yytext; /* defined by LEX */
-extern PCBTypePtr yyPCB;
-extern DataTypePtr yyData;
-extern ElementTypePtr yyElement;
-extern FontTypePtr yyFont;
+extern pcb_board_t * yyPCB;
+extern pcb_data_t * yyData;
+extern pcb_element_t *yyElement;
+extern pcb_font_t * yyFont;
extern int pcb_lineno; /* linenumber */
extern char *yyfilename; /* in this file */
extern conf_role_t yy_settings_dest;
-extern FlagType yy_pcb_flags;
+extern pcb_flag_t yy_pcb_flags;
static char *layer_group_string;
-static AttributeListTypePtr attr_list;
+static pcb_attribute_list_t *attr_list;
int yyerror(const char *s);
int yylex();
static int check_file_version (int);
-static void do_measure (PLMeasure *m, Coord i, double d, int u);
+static void do_measure (PLMeasure *m, pcb_coord_t i, double d, int u);
#define M(r,f,d) do_measure (&(r), f, d, 1)
/* Macros for interpreting what "measure" means - integer value only,
@@ -100,8 +93,9 @@ static void do_measure (PLMeasure *m, Coord i, double d, int u);
#define NU(m) new_units (m)
static int integer_value (PLMeasure m);
-static Coord old_units (PLMeasure m);
-static Coord new_units (PLMeasure m);
+static pcb_coord_t old_units (PLMeasure m);
+static pcb_coord_t new_units (PLMeasure m);
+static pcb_flag_t pcb_flag_old(unsigned int flags);
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
@@ -119,7 +113,7 @@ static Coord new_units (PLMeasure m);
int integer;
double number;
char *string;
- FlagType flagtype;
+ pcb_flag_t flagtype;
PLMeasure measure;
}
@@ -177,10 +171,10 @@ parsepcb
if (!yyPCB)
{
- Message(PCB_MSG_ERROR, "illegal fileformat\n");
+ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n");
YYABORT;
}
- for (i = 0; i < MAX_LAYER + 2; i++)
+ for (i = 0; i < PCB_MAX_LAYER + 2; i++)
LayerFlag[i] = pcb_false;
yyFont = &yyPCB->Font;
yyData = yyPCB->Data;
@@ -188,6 +182,7 @@ parsepcb
yyData->LayerN = 0;
yyPCB->NetlistPatches = yyPCB->NetlistPatchLast = NULL;
layer_group_string = NULL;
+ old_fmt = 0;
}
pcbfileversion
pcbname
@@ -204,13 +199,13 @@ parsepcb
pcbnetlist
pcbnetlistpatch
{
- PCBTypePtr pcb_save = PCB;
+ pcb_board_t *pcb_save = PCB;
if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL))
conf_set(yy_settings_dest, "design/groups", -1, layer_group_string, POL_OVERWRITE);
- CreateNewPCBPost (yyPCB, 0);
- if (ParseGroupString(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN))
+ pcb_board_new_postproc(yyPCB, 0);
+ if (pcb_layer_parse_group_string(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN, old_fmt))
{
- Message(PCB_MSG_ERROR, "illegal layer-group string\n");
+ pcb_message(PCB_MSG_ERROR, "illegal layer-group string\n");
YYABORT;
}
/* initialize the polygon clipping now since
@@ -218,11 +213,11 @@ parsepcb
*/
free(layer_group_string);
PCB = yyPCB;
- ALLPOLYGON_LOOP (yyData);
+ PCB_POLY_ALL_LOOP(yyData);
{
- InitClip (yyData, layer, polygon);
+ pcb_poly_init_clip(yyData, layer, polygon);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
PCB = pcb_save;
}
@@ -245,10 +240,10 @@ parsedata
if (!yyData || !yyFont)
{
- Message(PCB_MSG_ERROR, "illegal fileformat\n");
+ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n");
YYABORT;
}
- for (i = 0; i < MAX_LAYER + 2; i++)
+ for (i = 0; i < PCB_MAX_LAYER + 2; i++)
LayerFlag[i] = pcb_false;
yyData->LayerN = 0;
}
@@ -268,18 +263,18 @@ parsefont
if (!yyFont)
{
- Message(PCB_MSG_ERROR, "illegal fileformat\n");
+ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n");
YYABORT;
}
yyFont->Valid = pcb_false;
- for (i = 0; i <= MAX_FONTPOSITION; i++)
+ for (i = 0; i <= PCB_MAX_FONTPOSITION; i++)
free (yyFont->Symbol[i].Line);
memset(yyFont->Symbol, 0, sizeof(yyFont->Symbol));
}
symbols
{
yyFont->Valid = pcb_true;
- SetFontInfo(yyFont);
+ pcb_font_set_info(yyFont);
}
;
@@ -337,20 +332,23 @@ pcbname
: T_PCB '(' STRING ')'
{
yyPCB->Name = $3;
- yyPCB->MaxWidth = MAX_COORD;
- yyPCB->MaxHeight = MAX_COORD;
+ yyPCB->MaxWidth = PCB_MAX_COORD;
+ yyPCB->MaxHeight = PCB_MAX_COORD;
+ old_fmt = 1;
}
| T_PCB '(' STRING measure measure ')'
{
yyPCB->Name = $3;
yyPCB->MaxWidth = OU ($4);
yyPCB->MaxHeight = OU ($5);
+ old_fmt = 1;
}
| T_PCB '[' STRING measure measure ']'
{
yyPCB->Name = $3;
yyPCB->MaxWidth = NU ($4);
yyPCB->MaxHeight = NU ($5);
+ old_fmt = 0;
}
;
@@ -583,11 +581,11 @@ represent pcb-wide flags as defined in @ref{PCBFlags}.
pcbflags
: T_FLAGS '(' INTEGER ')'
{
- yy_pcb_flags = MakeFlags ($3 & PCB_FLAGS);
+ yy_pcb_flags = pcb_flag_make($3 & PCB_FLAGS);
}
| T_FLAGS '(' STRING ')'
{
- yy_pcb_flags = string_to_pcbflags ($3, yyerror);
+ yy_pcb_flags = pcb_strflg_board_s2f($3, yyerror);
free($3);
}
|
@@ -668,18 +666,18 @@ is split across lines only to make it readable.
pcbstyles
: T_STYLES '(' STRING ')'
{
- if (ParseRouteString($3, &yyPCB->RouteStyle, "mil"))
+ if (pcb_route_string_parse($3, &yyPCB->RouteStyle, "mil"))
{
- Message(PCB_MSG_ERROR, "illegal route-style string\n");
+ pcb_message(PCB_MSG_ERROR, "illegal route-style string\n");
YYABORT;
}
free($3);
}
| T_STYLES '[' STRING ']'
{
- if (ParseRouteString(($3 == NULL ? "" : $3), &yyPCB->RouteStyle, "cmil"))
+ if (pcb_route_string_parse(($3 == NULL ? "" : $3), &yyPCB->RouteStyle, "cmil"))
{
- Message(PCB_MSG_ERROR, "illegal route-style string\n");
+ pcb_message(PCB_MSG_ERROR, "illegal route-style string\n");
YYABORT;
}
free($3);
@@ -756,7 +754,7 @@ via_hi_format
/* x, y, thickness, clearance, mask, drilling-hole, name, flags */
: T_VIA '[' measure measure measure measure measure measure STRING flags ']'
{
- CreateNewVia(yyData, NU ($3), NU ($4), NU ($5), NU ($6), NU ($7),
+ pcb_via_new(yyData, NU ($3), NU ($4), NU ($5), NU ($6), NU ($7),
NU ($8), $9, $10);
free ($9);
}
@@ -766,8 +764,8 @@ via_2.0_format
/* x, y, thickness, clearance, mask, drilling-hole, name, flags */
: T_VIA '(' measure measure measure measure measure measure STRING INTEGER ')'
{
- CreateNewVia(yyData, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7), OU ($8), $9,
- OldFlags($10));
+ pcb_via_new(yyData, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7), OU ($8), $9,
+ pcb_flag_old($10));
free ($9);
}
;
@@ -777,8 +775,8 @@ via_1.7_format
/* x, y, thickness, clearance, drilling-hole, name, flags */
: T_VIA '(' measure measure measure measure measure STRING INTEGER ')'
{
- CreateNewVia(yyData, OU ($3), OU ($4), OU ($5), OU ($6),
- OU ($5) + OU($6), OU ($7), $8, OldFlags($9));
+ pcb_via_new(yyData, OU ($3), OU ($4), OU ($5), OU ($6),
+ OU ($5) + OU($6), OU ($7), $8, pcb_flag_old($9));
free ($8);
}
;
@@ -787,8 +785,8 @@ via_newformat
/* x, y, thickness, drilling-hole, name, flags */
: T_VIA '(' measure measure measure measure STRING INTEGER ')'
{
- CreateNewVia(yyData, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME,
- OU($5) + 2*MASKFRAME, OU ($6), $7, OldFlags($8));
+ pcb_via_new(yyData, OU ($3), OU ($4), OU ($5), 2*PCB_GROUNDPLANEFRAME,
+ OU($5) + 2*PCB_MASKFRAME, OU ($6), $7, pcb_flag_old($8));
free ($7);
}
;
@@ -797,15 +795,15 @@ via_oldformat
/* old format: x, y, thickness, name, flags */
: T_VIA '(' measure measure measure STRING INTEGER ')'
{
- Coord hole = (OU($5) * DEFAULT_DRILLINGHOLE);
+ pcb_coord_t hole = (OU($5) * PCB_DEFAULT_DRILLINGHOLE);
/* make sure that there's enough copper left */
- if (OU($5) - hole < MIN_PINORVIACOPPER &&
- OU($5) > MIN_PINORVIACOPPER)
- hole = OU($5) - MIN_PINORVIACOPPER;
+ if (OU($5) - hole < PCB_MIN_PINORVIACOPPER &&
+ OU($5) > PCB_MIN_PINORVIACOPPER)
+ hole = OU($5) - PCB_MIN_PINORVIACOPPER;
- CreateNewVia(yyData, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME,
- OU($5) + 2*MASKFRAME, hole, $6, OldFlags($7));
+ pcb_via_new(yyData, OU ($3), OU ($4), OU ($5), 2*PCB_GROUNDPLANEFRAME,
+ OU($5) + 2*PCB_MASKFRAME, hole, $6, pcb_flag_old($7));
free ($6);
}
;
@@ -833,13 +831,13 @@ Numeric flags.
rats
: T_RAT '[' measure measure INTEGER measure measure INTEGER flags ']'
{
- CreateNewRat(yyData, NU ($3), NU ($4), NU ($6), NU ($7), $5, $8,
+ pcb_rat_new(yyData, NU ($3), NU ($4), NU ($6), NU ($7), $5, $8,
conf_core.appearance.rat_thickness, $9);
}
| T_RAT '(' measure measure INTEGER measure measure INTEGER INTEGER ')'
{
- CreateNewRat(yyData, OU ($3), OU ($4), OU ($6), OU ($7), $5, $8,
- conf_core.appearance.rat_thickness, OldFlags($9));
+ pcb_rat_new(yyData, OU ($3), OU ($4), OU ($6), OU ($7), $5, $8,
+ conf_core.appearance.rat_thickness, pcb_flag_old($9));
}
;
@@ -869,7 +867,7 @@ layer
/* name */
: T_LAYER '(' INTEGER STRING opt_string ')' '('
{
- if ($3 <= 0 || $3 > MAX_LAYER + 2)
+ if ($3 <= 0 || $3 > PCB_MAX_LAYER + 2)
{
yyerror("Layernumber out of range");
YYABORT;
@@ -914,8 +912,8 @@ layerdefinition
/* x1, y1, x2, y2, flags */
| T_RECTANGLE '(' measure measure measure measure INTEGER ')'
{
- CreateNewPolygonFromRectangle(Layer,
- OU ($3), OU ($4), OU ($3) + OU ($5), OU ($4) + OU ($6), OldFlags($7));
+ pcb_poly_new_from_rectangle(Layer,
+ OU ($3), OU ($4), OU ($3) + OU ($5), OU ($4) + OU ($6), pcb_flag_old($7));
}
| text_hi_format
| text_newformat
@@ -953,7 +951,7 @@ line_hi_format
/* x1, y1, x2, y2, thickness, clearance, flags */
: T_LINE '[' measure measure measure measure measure measure flags ']'
{
- CreateNewLineOnLayer(Layer, NU ($3), NU ($4), NU ($5), NU ($6),
+ pcb_line_new(Layer, NU ($3), NU ($4), NU ($5), NU ($6),
NU ($7), NU ($8), $9);
}
;
@@ -962,8 +960,8 @@ line_1.7_format
/* x1, y1, x2, y2, thickness, clearance, flags */
: T_LINE '(' measure measure measure measure measure measure INTEGER ')'
{
- CreateNewLineOnLayer(Layer, OU ($3), OU ($4), OU ($5), OU ($6),
- OU ($7), OU ($8), OldFlags($9));
+ pcb_line_new(Layer, OU ($3), OU ($4), OU ($5), OU ($6),
+ OU ($7), OU ($8), pcb_flag_old($9));
}
;
@@ -973,8 +971,8 @@ line_oldformat
{
/* eliminate old-style rat-lines */
if ((IV ($8) & PCB_FLAG_RAT) == 0)
- CreateNewLineOnLayer(Layer, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7),
- 200*GROUNDPLANEFRAME, OldFlags(IV ($8)));
+ pcb_line_new(Layer, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7),
+ 200*PCB_GROUNDPLANEFRAME, pcb_flag_old(IV ($8)));
}
;
@@ -1019,7 +1017,7 @@ arc_hi_format
/* x, y, width, height, thickness, clearance, startangle, delta, flags */
: T_ARC '[' measure measure measure measure measure measure number number flags ']'
{
- CreateNewArcOnLayer(Layer, NU ($3), NU ($4), NU ($5), NU ($6), $9, $10,
+ pcb_arc_new(Layer, NU ($3), NU ($4), NU ($5), NU ($6), $9, $10,
NU ($7), NU ($8), $11);
}
;
@@ -1028,8 +1026,8 @@ arc_1.7_format
/* x, y, width, height, thickness, clearance, startangle, delta, flags */
: T_ARC '(' measure measure measure measure measure measure number number INTEGER ')'
{
- CreateNewArcOnLayer(Layer, OU ($3), OU ($4), OU ($5), OU ($6), $9, $10,
- OU ($7), OU ($8), OldFlags($11));
+ pcb_arc_new(Layer, OU ($3), OU ($4), OU ($5), OU ($6), $9, $10,
+ OU ($7), OU ($8), pcb_flag_old($11));
}
;
@@ -1037,8 +1035,8 @@ arc_oldformat
/* x, y, width, height, thickness, startangle, delta, flags */
: T_ARC '(' measure measure measure measure measure measure number INTEGER ')'
{
- CreateNewArcOnLayer(Layer, OU ($3), OU ($4), OU ($5), OU ($5), IV ($8), $9,
- OU ($7), 200*GROUNDPLANEFRAME, OldFlags($10));
+ pcb_arc_new(Layer, OU ($3), OU ($4), OU ($5), OU ($5), IV ($8), $9,
+ OU ($7), 200*PCB_GROUNDPLANEFRAME, pcb_flag_old($10));
}
;
@@ -1075,7 +1073,7 @@ text_oldformat
: T_TEXT '(' measure measure number STRING INTEGER ')'
{
/* use a default scale of 100% */
- CreateNewText(Layer,yyFont,OU ($3), OU ($4), $5, 100, $6, OldFlags($7));
+ pcb_text_new(Layer,yyFont,OU ($3), OU ($4), $5, 100, $6, pcb_flag_old($7));
free ($6);
}
;
@@ -1086,15 +1084,15 @@ text_newformat
{
if ($8 & PCB_FLAG_ONSILK)
{
- LayerTypePtr lay = &yyData->Layer[yyData->LayerN +
- (($8 & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)];
+ pcb_layer_t *lay = &yyData->Layer[yyData->LayerN +
+ (($8 & PCB_FLAG_ONSOLDER) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)];
- CreateNewText(lay ,yyFont, OU ($3), OU ($4), $5, $6, $7,
- OldFlags($8));
+ pcb_text_new(lay ,yyFont, OU ($3), OU ($4), $5, $6, $7,
+ pcb_flag_old($8));
}
else
- CreateNewText(Layer, yyFont, OU ($3), OU ($4), $5, $6, $7,
- OldFlags($8));
+ pcb_text_new(Layer, yyFont, OU ($3), OU ($4), $5, $6, $7,
+ pcb_flag_old($8));
free ($7);
}
;
@@ -1111,13 +1109,13 @@ text_hi_format
*/
if ($8.f & PCB_FLAG_ONSILK)
{
- LayerTypePtr lay = &yyData->Layer[yyData->LayerN +
- (($8.f & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)];
+ pcb_layer_t *lay = &yyData->Layer[yyData->LayerN +
+ (($8.f & PCB_FLAG_ONSOLDER) ? PCB_SOLDER_SIDE : PCB_COMPONENT_SIDE)];
- CreateNewText(lay, yyFont, NU ($3), NU ($4), $5, $6, $7, $8);
+ pcb_text_new(lay, yyFont, NU ($3), NU ($4), $5, $6, $7, $8);
}
else
- CreateNewText(Layer, yyFont, NU ($3), NU ($4), $5, $6, $7, $8);
+ pcb_text_new(Layer, yyFont, NU ($3), NU ($4), $5, $6, $7, $8);
free ($7);
}
;
@@ -1151,7 +1149,7 @@ polygon_format
: /* flags are passed in */
T_POLYGON '(' flags ')' '('
{
- Polygon = CreateNewPolygon(Layer, $3);
+ Polygon = pcb_poly_new(Layer, $3);
}
polygonpoints
polygonholes ')'
@@ -1172,18 +1170,18 @@ polygon_format
if (bad_contour_found)
{
- Message(PCB_MSG_WARNING, "WARNING parsing file '%s'\n"
+ pcb_message(PCB_MSG_WARNING, "WARNING parsing file '%s'\n"
" line: %i\n"
" description: 'ignored polygon (< 3 points in a contour)'\n",
yyfilename, pcb_lineno);
- DestroyObject(yyData, PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
+ pcb_destroy_object(yyData, PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
}
else
{
- SetPolygonBoundingBox (Polygon);
+ pcb_poly_bbox(Polygon);
if (!Layer->polygon_tree)
- Layer->polygon_tree = r_create_tree (NULL, 0, 0);
- r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0);
+ Layer->polygon_tree = pcb_r_create_tree(NULL, 0, 0);
+ pcb_r_insert_entry(Layer->polygon_tree, (pcb_box_t *) Polygon, 0);
}
}
;
@@ -1196,7 +1194,7 @@ polygonholes
polygonhole
: T_POLYGON_HOLE '('
{
- CreateNewHoleInPolygon (Polygon);
+ pcb_poly_hole_new(Polygon);
}
polygonpoints ')'
;
@@ -1210,11 +1208,11 @@ polygonpoint
/* xcoord ycoord */
: '(' measure measure ')'
{
- CreateNewPointInPolygon(Polygon, OU ($2), OU ($3));
+ pcb_poly_point_new(Polygon, OU ($2), OU ($3));
}
| '[' measure measure ']'
{
- CreateNewPointInPolygon(Polygon, NU ($2), NU ($3));
+ pcb_poly_point_new(Polygon, NU ($2), NU ($3));
}
;
@@ -1285,15 +1283,15 @@ element_oldformat
*/
: T_ELEMENT '(' STRING STRING measure measure INTEGER ')' '('
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, NoFlags(),
- $3, $4, NULL, OU ($5), OU ($6), $7, 100, NoFlags(), pcb_false);
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_no_flags(),
+ $3, $4, NULL, OU ($5), OU ($6), $7, 100, pcb_no_flags(), pcb_false);
free ($3);
free ($4);
pin_num = 1;
}
elementdefinitions ')'
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
;
@@ -1303,15 +1301,15 @@ element_1.3.4_format
*/
: T_ELEMENT '(' INTEGER STRING STRING measure measure measure measure INTEGER ')' '('
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
- $4, $5, NULL, OU ($6), OU ($7), IV ($8), IV ($9), OldFlags($10), pcb_false);
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old($3),
+ $4, $5, NULL, OU ($6), OU ($7), IV ($8), IV ($9), pcb_flag_old($10), pcb_false);
free ($4);
free ($5);
pin_num = 1;
}
elementdefinitions ')'
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
;
@@ -1321,8 +1319,8 @@ element_newformat
*/
: T_ELEMENT '(' INTEGER STRING STRING STRING measure measure measure measure INTEGER ')' '('
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
- $4, $5, $6, OU ($7), OU ($8), IV ($9), IV ($10), OldFlags($11), pcb_false);
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old($3),
+ $4, $5, $6, OU ($7), OU ($8), IV ($9), IV ($10), pcb_flag_old($11), pcb_false);
free ($4);
free ($5);
free ($6);
@@ -1330,7 +1328,7 @@ element_newformat
}
elementdefinitions ')'
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
;
@@ -1341,9 +1339,9 @@ element_1.7_format
: T_ELEMENT '(' INTEGER STRING STRING STRING measure measure
measure measure number number INTEGER ')' '('
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old($3),
$4, $5, $6, OU ($7) + OU ($9), OU ($8) + OU ($10),
- $11, $12, OldFlags($13), pcb_false);
+ $11, $12, pcb_flag_old($13), pcb_false);
yyElement->MarkX = OU ($7);
yyElement->MarkY = OU ($8);
free ($4);
@@ -1352,7 +1350,7 @@ element_1.7_format
}
relementdefs ')'
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
;
@@ -1363,7 +1361,7 @@ element_hi_format
: T_ELEMENT '[' flags STRING STRING STRING measure measure
measure measure number number flags ']' '('
{
- yyElement = CreateNewElement(yyData, yyElement, yyFont, $3,
+ yyElement = pcb_element_new(yyData, yyElement, yyFont, $3,
$4, $5, $6, NU ($7) + NU ($9), NU ($8) + NU ($10),
$11, $12, $13, pcb_false);
yyElement->MarkX = NU ($7);
@@ -1374,7 +1372,7 @@ element_hi_format
}
relementdefs ')'
{
- SetElementBoundingBox(yyData, yyElement, yyFont);
+ pcb_element_bbox(yyData, yyElement, yyFont);
}
;
@@ -1454,22 +1452,22 @@ elementdefinition
/* x1, y1, x2, y2, thickness */
| T_ELEMENTLINE '[' measure measure measure measure measure ']'
{
- CreateNewLineInElement(yyElement, NU ($3), NU ($4), NU ($5), NU ($6), NU ($7));
+ pcb_element_line_new(yyElement, NU ($3), NU ($4), NU ($5), NU ($6), NU ($7));
}
/* x1, y1, x2, y2, thickness */
| T_ELEMENTLINE '(' measure measure measure measure measure ')'
{
- CreateNewLineInElement(yyElement, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7));
+ pcb_element_line_new(yyElement, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7));
}
/* x, y, width, height, startangle, anglediff, thickness */
| T_ELEMENTARC '[' measure measure measure measure number number measure ']'
{
- CreateNewArcInElement(yyElement, NU ($3), NU ($4), NU ($5), NU ($6), $7, $8, NU ($9));
+ pcb_element_arc_new(yyElement, NU ($3), NU ($4), NU ($5), NU ($6), $7, $8, NU ($9));
}
/* x, y, width, height, startangle, anglediff, thickness */
| T_ELEMENTARC '(' measure measure measure measure number number measure ')'
{
- CreateNewArcInElement(yyElement, OU ($3), OU ($4), OU ($5), OU ($6), $7, $8, OU ($9));
+ pcb_element_arc_new(yyElement, OU ($3), OU ($4), OU ($5), OU ($6), $7, $8, OU ($9));
}
/* x, y position */
| T_MARK '[' measure measure ']'
@@ -1498,25 +1496,25 @@ relementdef
/* x1, y1, x2, y2, thickness */
| T_ELEMENTLINE '[' measure measure measure measure measure ']'
{
- CreateNewLineInElement(yyElement, NU ($3) + yyElement->MarkX,
+ pcb_element_line_new(yyElement, NU ($3) + yyElement->MarkX,
NU ($4) + yyElement->MarkY, NU ($5) + yyElement->MarkX,
NU ($6) + yyElement->MarkY, NU ($7));
}
| T_ELEMENTLINE '(' measure measure measure measure measure ')'
{
- CreateNewLineInElement(yyElement, OU ($3) + yyElement->MarkX,
+ pcb_element_line_new(yyElement, OU ($3) + yyElement->MarkX,
OU ($4) + yyElement->MarkY, OU ($5) + yyElement->MarkX,
OU ($6) + yyElement->MarkY, OU ($7));
}
/* x, y, width, height, startangle, anglediff, thickness */
| T_ELEMENTARC '[' measure measure measure measure number number measure ']'
{
- CreateNewArcInElement(yyElement, NU ($3) + yyElement->MarkX,
+ pcb_element_arc_new(yyElement, NU ($3) + yyElement->MarkX,
NU ($4) + yyElement->MarkY, NU ($5), NU ($6), $7, $8, NU ($9));
}
| T_ELEMENTARC '(' measure measure measure measure number number measure ')'
{
- CreateNewArcInElement(yyElement, OU ($3) + yyElement->MarkX,
+ pcb_element_arc_new(yyElement, OU ($3) + yyElement->MarkX,
OU ($4) + yyElement->MarkY, OU ($5), OU ($6), $7, $8, OU ($9));
}
| { attr_list = & yyElement->Attributes; } attribute
@@ -1562,7 +1560,7 @@ pin_hi_format
number, flags */
: T_PIN '[' measure measure measure measure measure measure STRING STRING flags ']'
{
- CreateNewPin(yyElement, NU ($3) + yyElement->MarkX,
+ pcb_element_pin_new(yyElement, NU ($3) + yyElement->MarkX,
NU ($4) + yyElement->MarkY, NU ($5), NU ($6), NU ($7), NU ($8), $9,
$10, $11);
free ($9);
@@ -1574,9 +1572,9 @@ pin_1.7_format
number, flags */
: T_PIN '(' measure measure measure measure measure measure STRING STRING INTEGER ')'
{
- CreateNewPin(yyElement, OU ($3) + yyElement->MarkX,
+ pcb_element_pin_new(yyElement, OU ($3) + yyElement->MarkX,
OU ($4) + yyElement->MarkY, OU ($5), OU ($6), OU ($7), OU ($8), $9,
- $10, OldFlags($11));
+ $10, pcb_flag_old($11));
free ($9);
free ($10);
}
@@ -1586,8 +1584,8 @@ pin_1.6.3_format
/* x, y, thickness, drilling hole, name, number, flags */
: T_PIN '(' measure measure measure measure STRING STRING INTEGER ')'
{
- CreateNewPin(yyElement, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME,
- OU ($5) + 2*MASKFRAME, OU ($6), $7, $8, OldFlags($9));
+ pcb_element_pin_new(yyElement, OU ($3), OU ($4), OU ($5), 2*PCB_GROUNDPLANEFRAME,
+ OU ($5) + 2*PCB_MASKFRAME, OU ($6), $7, $8, pcb_flag_old($9));
free ($7);
free ($8);
}
@@ -1600,8 +1598,8 @@ pin_newformat
char p_number[8];
sprintf(p_number, "%d", pin_num++);
- CreateNewPin(yyElement, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME,
- OU ($5) + 2*MASKFRAME, OU ($6), $7, p_number, OldFlags($8));
+ pcb_element_pin_new(yyElement, OU ($3), OU ($4), OU ($5), 2*PCB_GROUNDPLANEFRAME,
+ OU ($5) + 2*PCB_MASKFRAME, OU ($6), $7, p_number, pcb_flag_old($8));
free ($7);
}
@@ -1613,17 +1611,17 @@ pin_oldformat
*/
: T_PIN '(' measure measure measure STRING INTEGER ')'
{
- Coord hole = OU ($5) * DEFAULT_DRILLINGHOLE;
+ pcb_coord_t hole = OU ($5) * PCB_DEFAULT_DRILLINGHOLE;
char p_number[8];
/* make sure that there's enough copper left */
- if (OU ($5) - hole < MIN_PINORVIACOPPER &&
- OU ($5) > MIN_PINORVIACOPPER)
- hole = OU ($5) - MIN_PINORVIACOPPER;
+ if (OU ($5) - hole < PCB_MIN_PINORVIACOPPER &&
+ OU ($5) > PCB_MIN_PINORVIACOPPER)
+ hole = OU ($5) - PCB_MIN_PINORVIACOPPER;
sprintf(p_number, "%d", pin_num++);
- CreateNewPin(yyElement, OU ($3), OU ($4), OU ($5), 2*GROUNDPLANEFRAME,
- OU ($5) + 2*MASKFRAME, hole, $6, p_number, OldFlags($7));
+ pcb_element_pin_new(yyElement, OU ($3), OU ($4), OU ($5), 2*PCB_GROUNDPLANEFRAME,
+ OU ($5) + 2*PCB_MASKFRAME, hole, $6, p_number, pcb_flag_old($7));
free ($6);
}
;
@@ -1667,7 +1665,7 @@ pad_hi_format
/* x1, y1, x2, y2, thickness, clearance, mask, name , pad number, flags */
: T_PAD '[' measure measure measure measure measure measure measure STRING STRING flags ']'
{
- CreateNewPad(yyElement, NU ($3) + yyElement->MarkX,
+ pcb_element_pad_new(yyElement, NU ($3) + yyElement->MarkX,
NU ($4) + yyElement->MarkY,
NU ($5) + yyElement->MarkX,
NU ($6) + yyElement->MarkY, NU ($7), NU ($8), NU ($9),
@@ -1681,10 +1679,10 @@ pad_1.7_format
/* x1, y1, x2, y2, thickness, clearance, mask, name , pad number, flags */
: T_PAD '(' measure measure measure measure measure measure measure STRING STRING INTEGER ')'
{
- CreateNewPad(yyElement,OU ($3) + yyElement->MarkX,
+ pcb_element_pad_new(yyElement,OU ($3) + yyElement->MarkX,
OU ($4) + yyElement->MarkY, OU ($5) + yyElement->MarkX,
OU ($6) + yyElement->MarkY, OU ($7), OU ($8), OU ($9),
- $10, $11, OldFlags($12));
+ $10, $11, pcb_flag_old($12));
free ($10);
free ($11);
}
@@ -1694,8 +1692,8 @@ pad_newformat
/* x1, y1, x2, y2, thickness, name , pad number, flags */
: T_PAD '(' measure measure measure measure measure STRING STRING INTEGER ')'
{
- CreateNewPad(yyElement,OU ($3),OU ($4),OU ($5),OU ($6),OU ($7), 2*GROUNDPLANEFRAME,
- OU ($7) + 2*MASKFRAME, $8, $9, OldFlags($10));
+ pcb_element_pad_new(yyElement,OU ($3),OU ($4),OU ($5),OU ($6),OU ($7), 2*PCB_GROUNDPLANEFRAME,
+ OU ($7) + 2*PCB_MASKFRAME, $8, $9, pcb_flag_old($10));
free ($8);
free ($9);
}
@@ -1708,14 +1706,14 @@ pad
char p_number[8];
sprintf(p_number, "%d", pin_num++);
- CreateNewPad(yyElement,OU ($3),OU ($4),OU ($5),OU ($6),OU ($7), 2*GROUNDPLANEFRAME,
- OU ($7) + 2*MASKFRAME, $8,p_number, OldFlags($9));
+ pcb_element_pad_new(yyElement,OU ($3),OU ($4),OU ($5),OU ($6),OU ($7), 2*PCB_GROUNDPLANEFRAME,
+ OU ($7) + 2*PCB_MASKFRAME, $8,p_number, pcb_flag_old($9));
free ($8);
}
;
-flags : INTEGER { $$ = OldFlags($1); }
- | STRING { $$ = string_to_flags ($1, yyerror); free($1); }
+flags : INTEGER { $$ = pcb_flag_old($1); }
+ | STRING { $$ = pcb_strflg_s2f($1, yyerror); free($1); }
;
symbols
@@ -1746,7 +1744,7 @@ symbol : symbolhead symboldata ')'
symbolhead : T_SYMBOL '[' symbolid measure ']' '('
{
- if ($3 <= 0 || $3 > MAX_FONTPOSITION)
+ if ($3 <= 0 || $3 > PCB_MAX_FONTPOSITION)
{
yyerror("fontposition out of range");
YYABORT;
@@ -1762,7 +1760,7 @@ symbolhead : T_SYMBOL '[' symbolid measure ']' '('
}
| T_SYMBOL '(' symbolid measure ')' '('
{
- if ($3 <= 0 || $3 > MAX_FONTPOSITION)
+ if ($3 <= 0 || $3 > PCB_MAX_FONTPOSITION)
{
yyerror("fontposition out of range");
YYABORT;
@@ -1809,14 +1807,14 @@ symboldefinition
/* x1, y1, x2, y2, thickness */
: T_SYMBOLLINE '(' measure measure measure measure measure ')'
{
- CreateNewLineInSymbol(Symbol, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7));
+ pcb_font_new_line_in_sym(Symbol, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7));
}
;
hiressymbol
/* x1, y1, x2, y2, thickness */
: T_SYMBOLLINE '[' measure measure measure measure measure ']'
{
- CreateNewLineInSymbol(Symbol, NU ($3), NU ($4), NU ($5), NU ($6), NU ($7));
+ pcb_font_new_line_in_sym(Symbol, NU ($3), NU ($4), NU ($5), NU ($6), NU ($7));
}
;
@@ -1871,7 +1869,7 @@ net
/* name style pin pin ... */
: T_NET '(' STRING STRING ')' '('
{
- Menu = CreateNewNet((LibraryTypePtr)&yyPCB->NetlistLib, $3, $4);
+ Menu = pcb_lib_net_new((pcb_lib_t *)&yyPCB->NetlistLib, $3, $4);
free ($3);
free ($4);
}
@@ -1906,7 +1904,7 @@ pin 7 of U14, or @code{"T4-E"} for pin E of T4.
conn
: T_CONN '(' STRING ')'
{
- CreateNewConnection(Menu, $3);
+ pcb_lib_conn_new(Menu, $3);
free ($3);
}
;
@@ -1952,9 +1950,9 @@ op (arg1 arg2 ...) (
netpatch
/* name style pin pin ... */
- : T_ADD_CONN '(' STRING STRING ')' { rats_patch_append(yyPCB, RATP_ADD_CONN, $3, $4, NULL); free($3); free($4); }
- | T_DEL_CONN '(' STRING STRING ')' { rats_patch_append(yyPCB, RATP_DEL_CONN, $3, $4, NULL); free($3); free($4); }
- | T_CHANGE_ATTRIB '(' STRING STRING STRING ')' { rats_patch_append(yyPCB, RATP_CHANGE_ATTRIB, $3, $4, $5); free($3); free($4); free($5); }
+ : T_ADD_CONN '(' STRING STRING ')' { pcb_ratspatch_append(yyPCB, RATP_ADD_CONN, $3, $4, NULL); free($3); free($4); }
+ | T_DEL_CONN '(' STRING STRING ')' { pcb_ratspatch_append(yyPCB, RATP_DEL_CONN, $3, $4, NULL); free($3); free($4); }
+ | T_CHANGE_ATTRIB '(' STRING STRING STRING ')' { pcb_ratspatch_append(yyPCB, RATP_CHANGE_ATTRIB, $3, $4, $5); free($3); free($4); free($5); }
;
@@ -1983,7 +1981,7 @@ if the value is interpreted as, for example, a number.
attribute
: T_ATTRIBUTE '(' STRING STRING ')'
{
- CreateNewAttribute (attr_list, $3, $4 ? $4 : (char *)"");
+ pcb_attribute_put(attr_list, $3, $4 ? $4 : (char *)"", 0);
free ($3);
free ($4);
}
@@ -2019,7 +2017,7 @@ measure
*/
int yyerror(const char * s)
{
- Message(PCB_MSG_ERROR, "ERROR parsing file '%s'\n"
+ pcb_message(PCB_MSG_ERROR, "ERROR parsing file '%s'\n"
" line: %i\n"
" description: '%s'\n",
yyfilename, pcb_lineno, s);
@@ -2035,7 +2033,7 @@ static int
check_file_version (int ver)
{
if ( ver > PCB_FILE_VERSION ) {
- Message (PCB_MSG_DEFAULT, "ERROR: The file you are attempting to load is in a format\n"
+ pcb_message(PCB_MSG_ERROR, "ERROR: The file you are attempting to load is in a format\n"
"which is too new for this version of pcb. To load this file\n"
"you need a version of pcb which is >= %d. If you are\n"
"using a version built from git source, the source date\n"
@@ -2048,7 +2046,7 @@ check_file_version (int ver)
}
static void
-do_measure (PLMeasure *m, Coord i, double d, int u)
+do_measure (PLMeasure *m, pcb_coord_t i, double d, int u)
{
m->ival = i;
m->bval = pcb_round (d);
@@ -2064,7 +2062,7 @@ integer_value (PLMeasure m)
return m.ival;
}
-static Coord
+static pcb_coord_t
old_units (PLMeasure m)
{
if (m.has_units)
@@ -2072,7 +2070,7 @@ old_units (PLMeasure m)
return pcb_round (PCB_MIL_TO_COORD (m.ival));
}
-static Coord
+static pcb_coord_t
new_units (PLMeasure m)
{
if (m.has_units)
@@ -2080,3 +2078,21 @@ new_units (PLMeasure m)
/* if there's no unit m.dval already contains the converted value */
return pcb_round (m.dval);
}
+
+/* This converts old flag bits (from saved PCB files) to new format. */
+static pcb_flag_t pcb_flag_old(unsigned int flags)
+{
+ pcb_flag_t rv;
+ int i, f;
+ memset(&rv, 0, sizeof(rv));
+ /* If we move flag bits around, this is where we map old bits to them. */
+ rv.f = flags & 0xffff;
+ f = 0x10000;
+ for (i = 0; i < 8; i++) {
+ /* use the closest thing to the old thermal style */
+ if (flags & f)
+ rv.t[i / 2] |= (1 << (4 * (i % 2)));
+ f <<= 1;
+ }
+ return rv;
+}
diff --git a/src_plugins/jostle/Makefile b/src_plugins/jostle/Makefile
index ebdadff..d1be51f 100644
--- a/src_plugins/jostle/Makefile
+++ b/src_plugins/jostle/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_jostle
+ cd ../../src && $(MAKE) mod_jostle
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/jostle/jostle.c b/src_plugins/jostle/jostle.c
index 2e4fa57..6aceb2c 100644
--- a/src_plugins/jostle/jostle.c
+++ b/src_plugins/jostle/jostle.c
@@ -21,56 +21,55 @@
#include <unistd.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "rats.h"
#include "polygon.h"
#include "remove.h"
#include "error.h"
-#include "set.h"
#include "pcb-printf.h"
#include "plugins.h"
#include "hid_actions.h"
#include "layer.h"
#include "conf_core.h"
#include "misc_util.h"
+#include "obj_line.h"
+#include "event.h"
-/*#define DEBUG_POLYAREA*/
+/*#define DEBUG_pcb_polyarea_t*/
-double vect_dist2(Vector v1, Vector v2);
+double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2);
#define Vcpy2(r,a) {(r)[0] = (a)[0]; (r)[1] = (a)[1];}
#define Vswp2(a,b) { long t; \
t = (a)[0], (a)[0] = (b)[0], (b)[0] = t; \
t = (a)[1], (a)[1] = (b)[1], (b)[1] = t; \
}
-/*{if (!Marked.status && side==NORTHWEST) { DrawMark(pcb_true); Marked.status = True; Marked.X = p[0]; Marked.Y = p[1]; DrawMark(False);} }*/
+/*{if (!pcb_marked.status && side==NORTHWEST) { pcb_draw_mark(pcb_true); pcb_marked.status = True; pcb_marked.X = p[0]; pcb_marked.Y = p[1]; pcb_draw_mark(False);} }*/
enum {
- NORTH,
- NORTHEAST,
- EAST,
- SOUTHEAST,
- SOUTH,
- SOUTHWEST,
- WEST,
- NORTHWEST
+ JNORTH,
+ JNORTHEAST,
+ JEAST,
+ JSOUTHEAST,
+ JSOUTH,
+ JSOUTHWEST,
+ JWEST,
+ JNORTHWEST
};
const char *dirnames[] = {
- "NORTH",
- "NORTHEAST",
- "EAST",
- "SOUTHEAST",
- "SOUTH",
- "SOUTHWEST",
- "WEST",
- "NORTHWEST"
+ "JNORTH",
+ "JNORTHEAST",
+ "JEAST",
+ "JSOUTHEAST",
+ "JSOUTH",
+ "JSOUTHWEST",
+ "JWEST",
+ "JNORTHWEST"
};
#define ARG(n) (argc > (n) ? argv[n] : 0)
@@ -78,19 +77,19 @@ const char *dirnames[] = {
static const char jostle_syntax[] = "Jostle(diameter)";
/* DEBUG */
-static void DebugPOLYAREA(POLYAREA * s, char *color)
+static void Debugpcb_polyarea_t(pcb_polyarea_t * s, char *color)
{
int *x, *y, n, i = 0;
- PLINE *pl;
- VNODE *v;
- POLYAREA *p;
- HID *ddraw;
- hidGC ddgc;
+ pcb_pline_t *pl;
+ pcb_vnode_t *v;
+ pcb_polyarea_t *p;
+ pcb_hid_t *ddraw;
+ pcb_hid_gc_t ddgc;
-#ifndef DEBUG_POLYAREA
+#ifndef DEBUG_pcb_polyarea_t
return;
#endif
- ddraw = gui->request_debug_draw();
+ ddraw = pcb_gui->request_debug_draw();
ddgc = ddraw->make_gc();
p = s;
@@ -104,36 +103,36 @@ static void DebugPOLYAREA(POLYAREA * s, char *color)
y[i++] = v->point[1];
}
if (1) {
- gui->set_color(ddgc, color ? color : PCB->ConnectedColor);
- gui->set_line_width(ddgc, 1);
+ pcb_gui->set_color(ddgc, color ? color : PCB->ConnectedColor);
+ pcb_gui->set_line_width(ddgc, 1);
for (i = 0; i < n - 1; i++) {
- gui->draw_line(ddgc, x[i], y[i], x[i + 1], y[i + 1]);
- /* gui->fill_circle (ddgc, x[i], y[i], 30);*/
+ pcb_gui->draw_line(ddgc, x[i], y[i], x[i + 1], y[i + 1]);
+ /* pcb_gui->fill_circle (ddgc, x[i], y[i], 30);*/
}
- gui->draw_line(ddgc, x[n - 1], y[n - 1], x[0], y[0]);
+ pcb_gui->draw_line(ddgc, x[n - 1], y[n - 1], x[0], y[0]);
}
free(x);
free(y);
}
} while ((p = p->f) != s);
ddraw->flush_debug_draw();
- hid_action("Busy");
+ pcb_event(PCB_EVENT_BUSY, NULL);
sleep(3);
ddraw->finish_debug_draw();
}
/*!
- * \brief Find the bounding box of a POLYAREA.
+ * \brief Find the bounding box of a pcb_polyarea_t.
*
- * POLYAREAs linked by ->f/b are outlines.\n
+ * pcb_polyarea_ts linked by ->f/b are outlines.\n
* n->contours->next would be the start of the inner holes (irrelevant
* for bounding box).
*/
-static BoxType POLYAREA_boundingBox(POLYAREA * a)
+static pcb_box_t pcb_polyarea_t_boundingBox(pcb_polyarea_t * a)
{
- POLYAREA *n;
- PLINE *pa;
- BoxType box;
+ pcb_polyarea_t *n;
+ pcb_pline_t *pa;
+ pcb_box_t box;
int first = 1;
n = a;
@@ -147,10 +146,10 @@ static BoxType POLYAREA_boundingBox(POLYAREA * a)
first = 0;
}
else {
- MAKEMIN(box.X1, pa->xmin);
- MAKEMAX(box.X2, pa->xmax + 1);
- MAKEMIN(box.Y1, pa->ymin);
- MAKEMAX(box.Y2, pa->ymax + 1);
+ PCB_MAKE_MIN(box.X1, pa->xmin);
+ PCB_MAKE_MAX(box.X2, pa->xmax + 1);
+ PCB_MAKE_MIN(box.Y1, pa->ymin);
+ PCB_MAKE_MAX(box.Y2, pa->ymax + 1);
}
} while ((n = n->f) != a);
return box;
@@ -162,29 +161,29 @@ static BoxType POLYAREA_boundingBox(POLYAREA * a)
* as a pair of vectors PQ.\n
* Make it long so it will intersect everything in the area.
*/
-static void POLYAREA_findXmostLine(POLYAREA * a, int side, Vector p, Vector q, int clearance)
+static void pcb_polyarea_t_findXmostLine(pcb_polyarea_t * a, int side, pcb_vector_t p, pcb_vector_t q, int clearance)
{
int extra;
p[0] = p[1] = 0;
q[0] = q[1] = 0;
extra = a->contours->xmax - a->contours->xmin + a->contours->ymax - a->contours->ymin;
switch (side) {
- case NORTH:
+ case JNORTH:
p[1] = q[1] = a->contours->ymin - clearance;
p[0] = a->contours->xmin - extra;
q[0] = a->contours->xmax + extra;
break;
- case SOUTH:
+ case JSOUTH:
p[1] = q[1] = a->contours->ymax + clearance;
p[0] = a->contours->xmin - extra;
q[0] = a->contours->xmax + extra;
break;
- case EAST:
+ case JEAST:
p[0] = q[0] = a->contours->xmax + clearance;
p[1] = a->contours->ymin - extra;
q[1] = a->contours->ymax + extra;
break;
- case WEST:
+ case JWEST:
p[0] = q[0] = a->contours->xmin - clearance;
p[1] = a->contours->ymin - extra;
q[1] = a->contours->ymax + extra;
@@ -192,19 +191,19 @@ static void POLYAREA_findXmostLine(POLYAREA * a, int side, Vector p, Vector q, i
default: /* diagonal case */
{
int kx, ky, minmax, dq, ckx, cky;
- Coord mm[2] = { MAX_COORD, -MAX_COORD };
- Vector mmp[2];
- VNODE *v;
+ pcb_coord_t mm[2] = { PCB_MAX_COORD, -PCB_MAX_COORD };
+ pcb_vector_t mmp[2];
+ pcb_vnode_t *v;
switch (side) {
- case NORTHWEST:
+ case JNORTHWEST:
kx = 1; /* new_x = kx * x + ky * y */
ky = 1;
dq = -1; /* extend line in +x, dq*y */
ckx = cky = -1; /* clear line in ckx*clear, cky*clear */
minmax = 0; /* min or max */
break;
- case SOUTHWEST:
+ case JSOUTHWEST:
kx = 1;
ky = -1;
dq = 1;
@@ -212,7 +211,7 @@ static void POLYAREA_findXmostLine(POLYAREA * a, int side, Vector p, Vector q, i
cky = 1;
minmax = 0;
break;
- case NORTHEAST:
+ case JNORTHEAST:
kx = 1;
ky = -1;
dq = 1;
@@ -220,14 +219,14 @@ static void POLYAREA_findXmostLine(POLYAREA * a, int side, Vector p, Vector q, i
cky = -1;
minmax = 1;
break;
- case SOUTHEAST:
+ case JSOUTHEAST:
kx = ky = 1;
dq = -1;
ckx = cky = 1;
minmax = 1;
break;
default:
- Message(PCB_MSG_ERROR, "jostle: aiee, what side?");
+ pcb_message(PCB_MSG_ERROR, "jostle: aiee, what side?");
return;
}
v = &a->contours->head;
@@ -260,7 +259,7 @@ static void POLYAREA_findXmostLine(POLYAREA * a, int side, Vector p, Vector q, i
}
/*!
- * Given a 'side' from the NORTH/SOUTH/etc enum, rotate it by n.
+ * Given a 'side' from the JNORTH/JSOUTH/etc enum, rotate it by n.
*/
static int rotateSide(int side, int n)
{
@@ -270,25 +269,25 @@ static int rotateSide(int side, int n)
/*!
* Wrapper for CreateNewLineOnLayer that takes vectors and deals with Undo
*/
-static LineType *CreateVectorLineOnLayer(LayerType * layer, Vector a, Vector b, int thickness, int clearance, FlagType flags)
+static pcb_line_t *Createpcb_vector_tLineOnLayer(pcb_layer_t * layer, pcb_vector_t a, pcb_vector_t b, int thickness, int clearance, pcb_flag_t flags)
{
- LineType *line;
+ pcb_line_t *line;
- line = CreateNewLineOnLayer(layer, a[0], a[1], b[0], b[1], thickness, clearance, flags);
+ line = pcb_line_new(layer, a[0], a[1], b[0], b[1], thickness, clearance, flags);
if (line) {
- AddObjectToCreateUndoList(PCB_TYPE_LINE, layer, line, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, layer, line, line);
}
return line;
}
-static LineType *MakeBypassLine(LayerType * layer, Vector a, Vector b, LineType * orig, POLYAREA ** expandp)
+static pcb_line_t *MakeBypassLine(pcb_layer_t * layer, pcb_vector_t a, pcb_vector_t b, pcb_line_t * orig, pcb_polyarea_t ** expandp)
{
- LineType *line;
+ pcb_line_t *line;
- line = CreateVectorLineOnLayer(layer, a, b, orig->Thickness, orig->Clearance, orig->Flags);
+ line = Createpcb_vector_tLineOnLayer(layer, a, b, orig->Thickness, orig->Clearance, orig->Flags);
if (line && expandp) {
- POLYAREA *p = LinePoly(line, line->Thickness + line->Clearance);
- poly_Boolean_free(*expandp, p, expandp, PBO_UNITE);
+ pcb_polyarea_t *p = pcb_poly_from_line(line, line->Thickness + line->Clearance);
+ pcb_polyarea_boolean_free(*expandp, p, expandp, PCB_PBO_UNITE);
}
return line;
}
@@ -312,30 +311,30 @@ static LineType *MakeBypassLine(LayerType * layer, Vector a, Vector b, LineType
* points a, b, c, d. Finally connect the dots and remove the
* old straight line.
*/
-static int MakeBypassingLines(POLYAREA * brush, LayerType * layer, LineType * line, int side, POLYAREA ** expandp)
+static int MakeBypassingLines(pcb_polyarea_t * brush, pcb_layer_t * layer, pcb_line_t * line, int side, pcb_polyarea_t ** expandp)
{
- Vector pA, pB, flatA, flatB, qA, qB;
- Vector lA, lB;
- Vector a, b, c, d, junk;
+ pcb_vector_t pA, pB, flatA, flatB, qA, qB;
+ pcb_vector_t lA, lB;
+ pcb_vector_t a, b, c, d, junk;
int hits;
- SET_FLAG(PCB_FLAG_DRC, line); /* will cause sublines to inherit */
+ PCB_FLAG_SET(PCB_FLAG_DRC, line); /* will cause sublines to inherit */
lA[0] = line->Point1.X;
lA[1] = line->Point1.Y;
lB[0] = line->Point2.X;
lB[1] = line->Point2.Y;
- POLYAREA_findXmostLine(brush, side, flatA, flatB, line->Thickness / 2);
- POLYAREA_findXmostLine(brush, rotateSide(side, 1), pA, pB, line->Thickness / 2);
- POLYAREA_findXmostLine(brush, rotateSide(side, -1), qA, qB, line->Thickness / 2);
- hits = vect_inters2(lA, lB, qA, qB, a, junk) +
- vect_inters2(qA, qB, flatA, flatB, b, junk) +
- vect_inters2(pA, pB, flatA, flatB, c, junk) + vect_inters2(lA, lB, pA, pB, d, junk);
+ pcb_polyarea_t_findXmostLine(brush, side, flatA, flatB, line->Thickness / 2);
+ pcb_polyarea_t_findXmostLine(brush, rotateSide(side, 1), pA, pB, line->Thickness / 2);
+ pcb_polyarea_t_findXmostLine(brush, rotateSide(side, -1), qA, qB, line->Thickness / 2);
+ hits = pcb_vect_inters2(lA, lB, qA, qB, a, junk) +
+ pcb_vect_inters2(qA, qB, flatA, flatB, b, junk) +
+ pcb_vect_inters2(pA, pB, flatA, flatB, c, junk) + pcb_vect_inters2(lA, lB, pA, pB, d, junk);
if (hits != 4) {
return 0;
}
/* flip the line endpoints to match up with a/b */
- if (vect_dist2(lA, d) < vect_dist2(lA, a)) {
+ if (pcb_vect_dist2(lA, d) < pcb_vect_dist2(lA, a)) {
Vswp2(lA, lB);
}
MakeBypassLine(layer, lA, a, line, NULL);
@@ -343,19 +342,19 @@ static int MakeBypassingLines(POLYAREA * brush, LayerType * layer, LineType * li
MakeBypassLine(layer, b, c, line, expandp);
MakeBypassLine(layer, c, d, line, expandp);
MakeBypassLine(layer, d, lB, line, NULL);
- RemoveLine(layer, line);
+ pcb_line_destroy(layer, line);
return 1;
}
struct info {
- BoxType box;
- POLYAREA *brush;
- LayerType *layer;
- POLYAREA *smallest;
+ pcb_box_t box;
+ pcb_polyarea_t *brush;
+ pcb_layer_t *layer;
+ pcb_polyarea_t *smallest;
/*!< after cutting brush with line, the smallest chunk, which we
* will go around on 'side'.
*/
- LineType *line;
+ pcb_line_t *line;
int side;
double centroid;
/*!< smallest difference between slices of brush after cutting with
@@ -367,38 +366,38 @@ struct info {
/*!
* Process lines that intersect our 'brush'.
*/
-static r_dir_t jostle_callback(const BoxType * targ, void *private)
+static pcb_r_dir_t jostle_callback(const pcb_box_t * targ, void *private)
{
- LineType *line = (LineType *) targ;
+ pcb_line_t *line = (pcb_line_t *) targ;
struct info *info = private;
- POLYAREA *lp, *copy, *tmp, *n, *smallest = NULL;
- Vector p;
+ pcb_polyarea_t *lp, *copy, *tmp, *n, *smallest = NULL;
+ pcb_vector_t p;
int inside = 0, side, r;
double small, big;
int nocentroid = 0;
- if (TEST_FLAG(PCB_FLAG_DRC, line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_DRC, line)) {
return 0;
}
fprintf(stderr, "hit! %p\n", (void *)line);
p[0] = line->Point1.X;
p[1] = line->Point1.Y;
- if (poly_InsideContour(info->brush->contours, p)) {
+ if (pcb_poly_contour_inside(info->brush->contours, p)) {
pcb_fprintf(stderr, "\tinside1 %ms,%ms\n", p[0], p[1]);
inside++;
}
p[0] = line->Point2.X;
p[1] = line->Point2.Y;
- if (poly_InsideContour(info->brush->contours, p)) {
+ if (pcb_poly_contour_inside(info->brush->contours, p)) {
pcb_fprintf(stderr, "\tinside2 %ms,%ms\n", p[0], p[1]);
inside++;
}
- lp = LinePoly(line, line->Thickness);
- if (!Touching(lp, info->brush)) {
+ lp = pcb_poly_from_line(line, line->Thickness);
+ if (!pcb_polyarea_touching(lp, info->brush)) {
/* not a factor */
return 0;
}
- poly_Free(&lp);
+ pcb_polyarea_free(&lp);
if (inside) {
/* XXX not done!
XXX if this is part of a series of lines passing
@@ -410,12 +409,12 @@ static r_dir_t jostle_callback(const BoxType * targ, void *private)
* Cut the brush with the line to figure out which side to go
* around. Use a very fine line. XXX can still graze.
*/
- lp = LinePoly(line, 1);
- if (!poly_M_Copy0(©, info->brush))
+ lp = pcb_poly_from_line(line, 1);
+ if (!pcb_polyarea_m_copy0(©, info->brush))
return 0;
- r = poly_Boolean_free(copy, lp, &tmp, PBO_SUB);
- if (r != err_ok) {
- pcb_fprintf(stderr, "Error while jostling PBO_SUB: %d\n", r);
+ r = pcb_polyarea_boolean_free(copy, lp, &tmp, PCB_PBO_SUB);
+ if (r != pcb_err_ok) {
+ pcb_fprintf(stderr, "Error while jostling PCB_PBO_SUB: %d\n", r);
return 0;
}
if (tmp == tmp->f) {
@@ -423,10 +422,10 @@ static r_dir_t jostle_callback(const BoxType * targ, void *private)
* to get the glancing sliver??
*/
pcb_fprintf(stderr, "try isect??\n");
- lp = LinePoly(line, line->Thickness);
- r = poly_Boolean_free(tmp, lp, &tmp, PBO_ISECT);
- if (r != err_ok) {
- fprintf(stderr, "Error while jostling PBO_ISECT: %d\n", r);
+ lp = pcb_poly_from_line(line, line->Thickness);
+ r = pcb_polyarea_boolean_free(tmp, lp, &tmp, PCB_PBO_ISECT);
+ if (r != pcb_err_ok) {
+ fprintf(stderr, "Error while jostling PCB_PBO_ISECT: %d\n", r);
return 0;
}
nocentroid = 1;
@@ -449,41 +448,41 @@ static r_dir_t jostle_callback(const BoxType * targ, void *private)
} while ((n = n->f) != tmp);
if (line->Point1.X == line->Point2.X) { /* | */
if (info->box.X2 - smallest->contours->xmax > smallest->contours->xmin - info->box.X1) {
- side = WEST;
+ side = JWEST;
}
else {
- side = EAST;
+ side = JEAST;
}
}
else if (line->Point1.Y == line->Point2.Y) { /* - */
if (info->box.Y2 - smallest->contours->ymax > smallest->contours->ymin - info->box.Y1) {
- side = NORTH;
+ side = JNORTH;
}
else {
- side = SOUTH;
+ side = JSOUTH;
}
}
else if ((line->Point1.X > line->Point2.X) == (line->Point1.Y > line->Point2.Y)) { /* \ */
if (info->box.X2 - smallest->contours->xmax > smallest->contours->xmin - info->box.X1) {
- side = SOUTHWEST;
+ side = JSOUTHWEST;
}
else {
- side = NORTHEAST;
+ side = JNORTHEAST;
}
}
else { /* / */
if (info->box.X2 - smallest->contours->xmax > smallest->contours->xmin - info->box.X1) {
- side = NORTHWEST;
+ side = JNORTHWEST;
}
else {
- side = SOUTHEAST;
+ side = JSOUTHEAST;
}
}
pcb_fprintf(stderr, "\t%s\n", dirnames[side]);
if (info->line == NULL || (!nocentroid && (big - small) < info->centroid)) {
pcb_fprintf(stderr, "\tkeep it!\n");
if (info->smallest) {
- poly_Free(&info->smallest);
+ pcb_polyarea_free(&info->smallest);
}
info->centroid = nocentroid ? DBL_MAX : (big - small);
info->side = side;
@@ -494,70 +493,70 @@ static r_dir_t jostle_callback(const BoxType * targ, void *private)
return 0;
}
-static int jostle(int argc, const char **argv, Coord x, Coord y)
+static int jostle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
pcb_bool rel;
- POLYAREA *expand;
+ pcb_polyarea_t *expand;
float value;
struct info info;
int found;
if (argc == 2) {
pcb_bool succ;
- value = GetValue(ARG(0), ARG(1), &rel, &succ);
+ value = pcb_get_value(ARG(0), ARG(1), &rel, &succ);
if (!succ) {
- Message(PCB_MSG_ERROR, "Failed to convert size\n");
+ pcb_message(PCB_MSG_ERROR, "Failed to convert size\n");
return -1;
}
}
else {
value = conf_core.design.via_thickness + (PCB->Bloat + 1) * 2 + 50;
}
- x = Crosshair.X;
- y = Crosshair.Y;
+ x = pcb_crosshair.X;
+ y = pcb_crosshair.Y;
fprintf(stderr, "%d, %d, %f\n", (int) x, (int) y, value);
- info.brush = CirclePoly(x, y, value / 2);
+ info.brush = pcb_poly_from_circle(x, y, value / 2);
info.layer = CURRENT;
- LINE_LOOP(info.layer);
+ PCB_LINE_LOOP(info.layer);
{
- CLEAR_FLAG(PCB_FLAG_DRC, line);
+ PCB_FLAG_CLEAR(PCB_FLAG_DRC, line);
}
- END_LOOP;
+ PCB_END_LOOP;
do {
- info.box = POLYAREA_boundingBox(info.brush);
- DebugPOLYAREA(info.brush, NULL);
+ info.box = pcb_polyarea_t_boundingBox(info.brush);
+ Debugpcb_polyarea_t(info.brush, NULL);
pcb_fprintf(stderr, "search (%ms,%ms)->(%ms,%ms):\n", info.box.X1, info.box.Y1, info.box.X2, info.box.Y2);
info.line = NULL;
info.smallest = NULL;
- r_search(info.layer->line_tree, &info.box, NULL, jostle_callback, &info, &found);
+ pcb_r_search(info.layer->line_tree, &info.box, NULL, jostle_callback, &info, &found);
if (found) {
expand = NULL;
MakeBypassingLines(info.smallest, info.layer, info.line, info.side, &expand);
- poly_Free(&info.smallest);
- poly_Boolean_free(info.brush, expand, &info.brush, PBO_UNITE);
+ pcb_polyarea_free(&info.smallest);
+ pcb_polyarea_boolean_free(info.brush, expand, &info.brush, PCB_PBO_UNITE);
}
} while (found);
- SetChangedFlag(pcb_true);
- IncrementUndoSerialNumber();
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_undo_inc_serial();
return 0;
}
-static HID_Action jostle_action_list[] = {
+static pcb_hid_action_t jostle_action_list[] = {
{"jostle", NULL, jostle, "Move lines out of the way", jostle_syntax},
};
char *jostle_cookie = "jostle plugin";
-REGISTER_ACTIONS(jostle_action_list, jostle_cookie)
+PCB_REGISTER_ACTIONS(jostle_action_list, jostle_cookie)
static void hid_jostle_uninit(void)
{
- hid_remove_actions_by_cookie(jostle_cookie);
+ pcb_hid_remove_actions_by_cookie(jostle_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_jostle_init()
{
- REGISTER_ACTIONS(jostle_action_list, jostle_cookie);
+ PCB_REGISTER_ACTIONS(jostle_action_list, jostle_cookie);
return hid_jostle_uninit;
}
diff --git a/src_plugins/lib_gensexpr/Makefile b/src_plugins/lib_gensexpr/Makefile
index deeabca..d14361d 100644
--- a/src_plugins/lib_gensexpr/Makefile
+++ b/src_plugins/lib_gensexpr/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_lib_gensexpr
+ cd ../../src && $(MAKE) mod_lib_gensexpr
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/lib_legacy_func/Makefile b/src_plugins/lib_legacy_func/Makefile
index 87807f6..ff403e4 100644
--- a/src_plugins/lib_legacy_func/Makefile
+++ b/src_plugins/lib_legacy_func/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_lib_legacy_func
+ cd ../../src && $(MAKE) mod_lib_legacy_func
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/lib_legacy_func/lib_legacy_func.c b/src_plugins/lib_legacy_func/lib_legacy_func.c
index 766aca4..51e2656 100644
--- a/src_plugins/lib_legacy_func/lib_legacy_func.c
+++ b/src_plugins/lib_legacy_func/lib_legacy_func.c
@@ -30,8 +30,8 @@
#define _BSD_SOURCE
#include <genvector/gds_char.h>
+#include <stdio.h>
#include "config.h"
-#include "global.h"
#include "data.h"
#include "action_helper.h"
#include "change.h"
@@ -77,7 +77,7 @@ char *ExpandFilename(char *Dirname, char *Filename)
}
/* couldn't be expanded by the shell */
- PopenErrorMessage(command);
+ pcb_popen_error_message(command);
free(command);
gds_uninit(&answer);
return NULL;
@@ -95,15 +95,40 @@ void CreateQuotedString(gds_t *DS, char *S)
gds_append(DS, '"');
}
-int FileExists(const char *name)
+/* ---------------------------------------------------------------------------
+ * Convenience for plugins using the old {Hide,Restore}pcb_crosshair API.
+ * This links up to notify the GUI of the expected changes using the new APIs.
+ *
+ * Use of this old API is deprecated, as the names don't necessarily reflect
+ * what all GUIs may do in response to the notifications. Keeping these APIs
+ * is aimed at easing transition to the newer API, they will emit a harmless
+ * warning at the time of their first use.
+ *
+ */
+void pcb_crosshair_hide(void)
{
- FILE *f;
- f = fopen(name, "r");
- if (f) {
- fclose(f);
- return 1;
+ static pcb_bool warned_old_api = pcb_false;
+ if (!warned_old_api) {
+ pcb_message(PCB_MSG_WARNING, "WARNING: A plugin is using the deprecated API pcb_crosshair_hide().\n"
+ " This API may be removed in a future release of PCB.\n");
+ warned_old_api = pcb_true;
}
- return 0;
+
+ pcb_notify_crosshair_change(pcb_false);
+ pcb_notify_mark_change(pcb_false);
+}
+
+void pcb_crosshair_restore(void)
+{
+ static pcb_bool warned_old_api = pcb_false;
+ if (!warned_old_api) {
+ pcb_message(PCB_MSG_WARNING, "WARNING: A plugin is using the deprecated API pcb_crosshair_restore().\n"
+ " This API may be removed in a future release of PCB.\n");
+ warned_old_api = pcb_true;
+ }
+
+ pcb_notify_crosshair_change(pcb_true);
+ pcb_notify_mark_change(pcb_true);
}
diff --git a/src_plugins/lib_legacy_func/lib_legacy_func.h b/src_plugins/lib_legacy_func/lib_legacy_func.h
index 1761685..74fed36 100644
--- a/src_plugins/lib_legacy_func/lib_legacy_func.h
+++ b/src_plugins/lib_legacy_func/lib_legacy_func.h
@@ -36,7 +36,5 @@ char *ExpandFilename(char *dirname, char *filename);
*/
void CreateQuotedString(gds_t *, char *);
-/*
- * Return nonzero if the given file exists and is readable.
- */
-int FileExists(const char *name)
+void pcb_crosshair_hide(void);
+void pcb_crosshair_restore(void);
diff --git a/src_plugins/loghid/Makefile b/src_plugins/loghid/Makefile
index 42f703a..3010e07 100644
--- a/src_plugins/loghid/Makefile
+++ b/src_plugins/loghid/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_loghid
+ cd ../../src && $(MAKE) mod_loghid
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/loghid/hid-logger.c b/src_plugins/loghid/hid-logger.c
index 6bddf05..1ed2cd5 100644
--- a/src_plugins/loghid/hid-logger.c
+++ b/src_plugins/loghid/hid-logger.c
@@ -1,9 +1,9 @@
/*
* a HID mostly for debugging.
*/
+#include "config.h"
#include "hid-logger.h"
#include "pcb-printf.h"
-#include "global_objs.h"
#define ENUM_LOG_TEXT(e) case e: txt = #e; break
@@ -11,17 +11,17 @@
* Just having one instance for now. Keeping it
* local is fine.
*/
-static HID logging_hid_;
-static HID *delegatee_ = NULL;
+static pcb_hid_t logging_hid_;
+static pcb_hid_t *delegatee_ = NULL;
static FILE *out_ = NULL;
-static HID_Attribute *log_get_export_options(int *ret) {
- HID_Attribute *result = delegatee_->get_export_options(ret);
+static pcb_hid_attribute_t *log_get_export_options(int *ret) {
+ pcb_hid_attribute_t *result = delegatee_->get_export_options(ret);
pcb_fprintf(out_, "get_export_options(ret) -> ret=%d\n", *ret);
return result;
}
-static void log_do_exit(HID *hid) {
+static void log_do_exit(pcb_hid_t *hid) {
pcb_fprintf(out_, "do_exit()\n");
delegatee_->do_exit(delegatee_);
}
@@ -31,7 +31,7 @@ static void log_parse_arguments(int *argc, char ***argv) {
delegatee_->parse_arguments(argc, argv);
}
-static void log_invalidate_lr(int left, int right, int top, int bottom) {
+static void log_invalidate_lr(pcb_coord_t left, pcb_coord_t right, pcb_coord_t top, pcb_coord_t bottom) {
pcb_fprintf(out_, "invalidate_lr(%mm, %mm, %mm, %mm)\n", left, right, top, bottom);
delegatee_->invalidate_lr(left, right, top, bottom);
}
@@ -41,14 +41,14 @@ static void log_invalidate_all(void) {
delegatee_->invalidate_all();
}
-static void log_notify_mark_change(pcb_bool changes_complete) {
- pcb_fprintf(out_, "notify_mark_change(%s)\n", changes_complete ? "true" : "false");
- delegatee_->notify_mark_change(changes_complete);
+static void log_pcb_notify_mark_change(pcb_bool changes_complete) {
+ pcb_fprintf(out_, "pcb_notify_mark_change(%s)\n", changes_complete ? "true" : "false");
+ delegatee_->pcb_notify_mark_change(changes_complete);
}
-static int log_set_layer(const char *name, int group, int empty) {
- pcb_fprintf(out_, "set_layer(name=%s, group=%d, empty=%s", name, group, empty ? "true" : "false");
- return delegatee_->set_layer(name, group, empty);
+static int log_set_layer_group(pcb_layergrp_id_t group, pcb_layer_id_t layer, unsigned int flags, int is_empty)
+ pcb_fprintf(out_, "set_layer(group=%ld, layer=%ld, flags=%lx, empty=%s", group, layer, flags, empty ? "true" : "false");
+ return delegatee_->set_layer_group(group, layer, flags, is_empty);
}
static void log_end_layer() {
@@ -56,12 +56,12 @@ static void log_end_layer() {
delegatee_->end_layer();
}
-static hidGC log_make_gc() {
+static pcb_hid_gc_t log_make_gc() {
pcb_fprintf(out_, "make_gc()\n");
return delegatee_->make_gc();
}
-static void log_destroy_gc(hidGC gc) {
+static void log_destroy_gc(pcb_hid_gc_t gc) {
pcb_fprintf(out_, "detroy_gc()\n");
delegatee_->destroy_gc(gc);
}
@@ -71,12 +71,12 @@ static void log_use_mask(int use_it) {
delegatee_->use_mask(use_it);
}
-static void log_set_color(hidGC gc, const char *name) {
+static void log_set_color(pcb_hid_gc_t gc, const char *name) {
pcb_fprintf(out_, "set_color(gc, %s)\n", name);
delegatee_->set_color(gc, name);
}
-static void log_set_line_cap(hidGC gc, EndCapStyle style) {
+static void log_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style) {
const char *txt = "unknown";
switch (style) {
ENUM_LOG_TEXT(Trace_Cap);
@@ -88,43 +88,43 @@ static void log_set_line_cap(hidGC gc, EndCapStyle style) {
delegatee_->set_line_cap(gc, style);
}
-static void log_set_line_width(hidGC gc, Coord width) {
+static void log_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) {
pcb_fprintf(out_, "set_line_width(gc, %d)\n", width);
delegatee_->set_line_width(gc, width);
}
-static void log_set_draw_xor(hidGC gc, int xor) {
+static void log_set_draw_xor(pcb_hid_gc_t gc, int xor) {
pcb_fprintf(out_, "set_draw_xor(gc, %s)\n", xor ? "true" : "false");
delegatee_->set_draw_xor(gc, xor);
}
-static void log_set_draw_faded(hidGC gc, int faded) {
+static void log_set_draw_faded(pcb_hid_gc_t gc, int faded) {
pcb_fprintf(out_, "set_draw_faded(gc, %s)\n", faded ? "true" : "false");
delegatee_->set_draw_faded(gc, faded);
}
-static void log_draw_line(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) {
+static void log_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) {
pcb_fprintf(out_, "draw_line(gc, %mm, %mm, %mm, %mm)\n", x1, y1, x2, y2);
delegatee_->draw_line(gc, x1, y1, x2, y2);
}
-static void log_draw_arc(hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle) {
+static void log_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) {
pcb_fprintf(out_, "draw_arc(gc, %mm, %mm, rx=%mm, ry=%mm, start_angle=%.1f, delta_a=%.1f)\n",
cx, cy, xradius, yradius, start_angle, delta_angle);
delegatee_->draw_arc(gc, cx, cy, xradius, yradius, start_angle, delta_angle);
}
-static void log_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) {
+static void log_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) {
pcb_fprintf(out_, "draw_rect(gc, %mm, %mm, %mm, %mm)\n", x1, y1, x2, y2);
delegatee_->draw_rect(gc, x1, y1, x2, y2);
}
-static void log_fill_circle(hidGC gc, Coord x, Coord y, Coord r) {
+static void log_fill_circle(pcb_hid_gc_t gc, pcb_coord_t x, pcb_coord_t y, pcb_coord_t r) {
pcb_fprintf(out_, "fill_circle(gc, %mm, %mm, %mm)\n", x, y, r);
delegatee_->fill_circle(gc, x, y, r);
}
-static void log_fill_polygon(hidGC gc, int n_coords, Coord *x, Coord *y) {
+static void log_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y) {
int i;
pcb_fprintf(out_, "fill_polygon(gc, %d", n_coords);
for (i = 0; i < n_coords; ++i) {
@@ -134,41 +134,41 @@ static void log_fill_polygon(hidGC gc, int n_coords, Coord *x, Coord *y) {
delegatee_->fill_polygon(gc, n_coords, x, y);
}
-static void log_fill_pcb_polygon(hidGC gc, PolygonType *poly, const BoxType *clip_box) {
+static void log_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t *poly, const pcb_box_t *clip_box) {
pcb_fprintf(out_, "fill_pcb_polygon(gc, poly->PointN=%d, ...)\n", poly->PointN);
delegatee_->fill_pcb_polygon(gc, poly, clip_box);
}
-static void log_thindraw_pcb_polygon(hidGC gc, PolygonType *poly, const BoxType *clip_box) {
+static void log_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t *poly, const pcb_box_t *clip_box) {
pcb_fprintf(out_, "thindraw_pcb_polygon(gc, poly->PointN=%d, ...)\n", poly->PointN);
delegatee_->thindraw_pcb_polygon(gc, poly, clip_box);
}
-static void log_fill_pcb_pad(hidGC gc, PadType *pad, pcb_bool clip, pcb_bool mask) {
+static void log_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t *pad, pcb_bool clip, pcb_bool mask) {
pcb_fprintf(out_, "fill_pcb_pad(gc, pad->name=%s, clip=%s, mask=%s)\n",
pad->Name, clip ? "true" : "false", mask ? "true" : "false");
delegatee_->fill_pcb_pad(gc, pad, clip, mask);
}
-static void log_thindraw_pcb_pad(hidGC gc, PadType *pad, pcb_bool clip, pcb_bool mask) {
+static void log_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t *pad, pcb_bool clip, pcb_bool mask) {
pcb_fprintf(out_, "thindraw_pcb_pad(gc, pad->name=%s, clip=%s, mask=%s)\n",
pad->Name, clip ? "true" : "false", mask ? "true" : "false");
delegatee_->thindraw_pcb_pad(gc, pad, clip, mask);
}
-static void log_fill_pcb_pv(hidGC fg, hidGC bg, PinType *pv, pcb_bool drawHole, pcb_bool mask) {
+static void log_fill_pcb_pv(pcb_hid_gc_t fg, pcb_hid_gc_t bg, pcb_pin_t *pv, pcb_bool drawHole, pcb_bool mask) {
pcb_fprintf(out_, "fill_pcb_pv(fg, bg, (%mm, %mm), draw_hole=%s, mask=%s)\n",
pv->X, pv->Y, drawHole ? "true" : "false", mask ? "true" : "false");
delegatee_->fill_pcb_pv(fg, bg, pv, drawHole, mask);
}
-static void log_thindraw_pcb_pv(hidGC fg, hidGC bg, PinType *pv, pcb_bool drawHole, pcb_bool mask) {
+static void log_thindraw_pcb_pv(pcb_hid_gc_t fg, pcb_hid_gc_t bg, pcb_pin_t *pv, pcb_bool drawHole, pcb_bool mask) {
pcb_fprintf(out_, "thindraw_pcb_pv(fg, bg, (%mm, %mm), draw_hole=%s, mask=%s)\n",
pv->X, pv->Y, drawHole ? "true" : "false", mask ? "true" : "false");
delegatee_->thindraw_pcb_pv(fg, bg, pv, drawHole, mask);
}
-static void log_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) {
+static void log_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) {
pcb_fprintf(out_, "fill_rect(gc, %mm, %mm, %mm, %mm)\n", x1, y1, x2, y2);
delegatee_->fill_rect(gc, x1, y1, x2, y2);
}
@@ -183,7 +183,7 @@ static void log_beep() {
delegatee_->beep();
}
-HID *create_log_hid(FILE *log_out, HID *delegatee) {
+pcb_hid_t *create_log_hid(FILE *log_out, pcb_hid_t *delegatee) {
out_ = log_out;
delegatee_ = delegatee;
@@ -201,7 +201,7 @@ HID *create_log_hid(FILE *log_out, HID *delegatee) {
REGISTER_IF_NOT_NULL(invalidate_lr);
REGISTER_IF_NOT_NULL(invalidate_all);
REGISTER_IF_NOT_NULL(notify_mark_change);
- REGISTER_IF_NOT_NULL(set_layer);
+ REGISTER_IF_NOT_NULL(set_layer_group);
REGISTER_IF_NOT_NULL(end_layer);
REGISTER_IF_NOT_NULL(make_gc);
REGISTER_IF_NOT_NULL(destroy_gc);
diff --git a/src_plugins/loghid/hid-logger.h b/src_plugins/loghid/hid-logger.h
index 9bdb078..19b57a1 100644
--- a/src_plugins/loghid/hid-logger.h
+++ b/src_plugins/loghid/hid-logger.h
@@ -9,6 +9,6 @@
* Create a delegating HID that sends all calls to the
* delegatee but also logs the calls.
*/
-HID *create_log_hid(FILE *log_out, HID *delegatee);
+pcb_hid_t *create_log_hid(FILE *log_out, pcb_hid_t *delegatee);
#endif
diff --git a/src_plugins/loghid/loghid.c b/src_plugins/loghid/loghid.c
index 8d1d44f..8e5318b 100644
--- a/src_plugins/loghid/loghid.c
+++ b/src_plugins/loghid/loghid.c
@@ -25,7 +25,6 @@
*
*/
#include "config.h"
-#include "global.h"
#include "conf.h"
#include "data.h"
#include "action_helper.h"
@@ -38,7 +37,7 @@
static const char *loghid_cookie = "loghid plugin";
-HID_Attribute loghid_attribute_list[] = {
+pcb_hid_attribute_t loghid_attribute_list[] = {
{"target-hid", "the real GUI or export HID to relay calls to",
HID_String, 0, 0, {0, 0, 0}, 0, 0}
#define HA_target_hid 0
@@ -47,18 +46,18 @@ HID_Attribute loghid_attribute_list[] = {
static void loghid_parse_arguments_real(int *argc, char ***argv, int is_gui)
{
- HID *target;
+ pcb_hid_t *target;
const char *target_name;
- hid_register_attributes(loghid_attribute_list, NUM_OPTIONS, loghid_cookie, 0);
- hid_parse_command_line(argc, argv);
+ pcb_hid_register_attributes(loghid_attribute_list, NUM_OPTIONS, loghid_cookie, 0);
+ pcb_hid_parse_command_line(argc, argv);
target_name = loghid_attribute_list[HA_target_hid].default_val.str_value;
if (is_gui)
- target = hid_find_gui(target_name);
+ target = pcb_hid_find_gui(target_name);
else
- target = hid_find_exporter(target_name);
+ target = pcb_hid_find_exporter(target_name);
#warning TODO:
fprintf(stderr, "Initialize for delegatee: '%s' -> %p\n", target_name, (void *)target);
@@ -79,7 +78,7 @@ static void loghid_parse_arguments_exp(int *argc, char ***argv)
static int loghid_usage(const char *topic)
{
fprintf(stderr, "\nhidlog command line arguments:\n\n");
- hid_usage(loghid_attribute_list, NUM_OPTIONS);
+ pcb_hid_usage(loghid_attribute_list, NUM_OPTIONS);
fprintf(stderr, "\n");
fprintf(stderr, "Usage: pcb-rnd [generic_options] --gui hidlog-gui --target-hid gtk foo.pcb\n");
fprintf(stderr, "Usage: pcb-rnd [generic_options] --x hidlog-exp --target-hid png foo.pcb\n");
@@ -87,9 +86,9 @@ static int loghid_usage(const char *topic)
return 0;
}
-REGISTER_ATTRIBUTES(loghid_attribute_list, loghid_cookie)
+PCB_REGISTER_ATTRIBUTES(loghid_attribute_list, loghid_cookie)
-static HID_Attribute *loghid_get_export_options(int *n)
+static pcb_hid_attribute_t *loghid_get_export_options(int *n)
{
/* loghid_attribute_list[HA_psfile] = pcb_strdup("default?");*/
@@ -105,16 +104,16 @@ static void hid_loghid_uninit(void)
{
}
-static HID loghid_gui;
-static HID loghid_exp;
+static pcb_hid_t loghid_gui;
+static pcb_hid_t loghid_exp;
pcb_uninit_t hid_loghid_init(void)
{
- memset(&loghid_gui, 0, sizeof(HID));
- memset(&loghid_exp, 0, sizeof(HID));
+ memset(&loghid_gui, 0, sizeof(pcb_hid_t));
+ memset(&loghid_exp, 0, sizeof(pcb_hid_t));
/* gui version */
- loghid_gui.struct_size = sizeof(HID);
+ loghid_gui.struct_size = sizeof(pcb_hid_t);
loghid_gui.name = "loghid-gui";
loghid_gui.description = "log GUI HID calls";
loghid_gui.gui = 1;
@@ -122,10 +121,10 @@ pcb_uninit_t hid_loghid_init(void)
loghid_gui.usage = loghid_usage;
loghid_gui.parse_arguments = loghid_parse_arguments_gui;
- hid_register_hid(&loghid_gui);
+ pcb_hid_register_hid(&loghid_gui);
/* export version */
- loghid_exp.struct_size = sizeof(HID);
+ loghid_exp.struct_size = sizeof(pcb_hid_t);
loghid_exp.name = "loghid-exp";
loghid_exp.description = "log export HID calls";
loghid_exp.exporter = 1;
@@ -133,7 +132,7 @@ pcb_uninit_t hid_loghid_init(void)
loghid_exp.usage = loghid_usage;
loghid_exp.parse_arguments = loghid_parse_arguments_exp;
- hid_register_hid(&loghid_exp);
+ pcb_hid_register_hid(&loghid_exp);
return hid_loghid_uninit;
}
diff --git a/src_plugins/mincut/Makefile b/src_plugins/mincut/Makefile
index ff909df..33c93d4 100644
--- a/src_plugins/mincut/Makefile
+++ b/src_plugins/mincut/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_mincut
+ cd ../../src && $(MAKE) mod_mincut
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/mincut/rats_mincut.c b/src_plugins/mincut/rats_mincut.c
index bd64f91..49b7251 100644
--- a/src_plugins/mincut/rats_mincut.c
+++ b/src_plugins/mincut/rats_mincut.c
@@ -29,20 +29,14 @@
#include <stdio.h>
#include <assert.h>
-#include "global.h"
-
-#include "create.h"
+#include "const.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "plug_io.h"
#include "find.h"
-#include "misc.h"
-#include "mymem.h"
#include "polygon.h"
-#include "rats.h"
#include "search.h"
-#include "set.h"
#include "undo.h"
#include "plugins.h"
#include "compat_misc.h"
@@ -61,12 +55,12 @@ typedef struct short_conn_s short_conn_t;
struct short_conn_s {
int gid; /* id in the graph */
int from_type;
-/* AnyObjectType *from;*/
+/* pcb_any_obj_t *from;*/
int from_id;
int to_type;
int edges; /* number of edges */
- AnyObjectType *to;
- found_conn_type_t type;
+ pcb_any_obj_t *to;
+ pcb_found_conn_type_t type;
short_conn_t *next;
};
@@ -74,9 +68,9 @@ static short_conn_t *short_conns = NULL;
static int num_short_conns = 0;
static int short_conns_maxid = 0;
-static void proc_short_cb(int current_type, void *current_obj, int from_type, void *from_obj, found_conn_type_t type)
+static void proc_short_cb(int current_type, void *current_obj, int from_type, void *from_obj, pcb_found_conn_type_t type)
{
- AnyObjectType *curr = current_obj, *from = from_obj;
+ pcb_any_obj_t *curr = current_obj, *from = from_obj;
short_conn_t *s;
s = malloc(sizeof(short_conn_t));
@@ -102,10 +96,10 @@ static void proc_short_cb(int current_type, void *current_obj, int from_type, vo
}
/* returns 0 on succes */
-static int proc_short(PinType * pin, PadType * pad, int ignore)
+static int proc_short(pcb_pin_t * pin, pcb_pad_t * pad, int ignore)
{
- find_callback_t old_cb;
- Coord x, y;
+ pcb_find_callback_t old_cb;
+ pcb_coord_t x, y;
short_conn_t *n, **lut_by_oid, **lut_by_gid, *next;
int gids;
gr_t *g;
@@ -123,14 +117,14 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
if (pin != NULL) {
debprintf("short on pin!\n");
- SET_FLAG(PCB_FLAG_WARN, pin);
+ PCB_FLAG_SET(PCB_FLAG_WARN, pin);
x = pin->X;
y = pin->Y;
}
else if (pad != NULL) {
debprintf("short on pad!\n");
- SET_FLAG(PCB_FLAG_WARN, pad);
- if (TEST_FLAG(PCB_FLAG_EDGE2, pad)) {
+ PCB_FLAG_SET(PCB_FLAG_WARN, pad);
+ if (PCB_FLAG_TEST(PCB_FLAG_EDGE2, pad)) {
x = pad->Point2.X;
y = pad->Point2.Y;
}
@@ -149,10 +143,10 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
short_conns_maxid = 0;
/* perform a search using PCB_FLAG_MINCUT, calling back proc_short_cb() with the connections */
- old_cb = find_callback;
- find_callback = proc_short_cb;
- SaveFindFlag(PCB_FLAG_MINCUT);
- LookupConnection(x, y, pcb_false, 1, PCB_FLAG_MINCUT);
+ old_cb = pcb_find_callback;
+ pcb_find_callback = proc_short_cb;
+ pcb_save_find_flag(PCB_FLAG_MINCUT);
+ pcb_lookup_conn(x, y, pcb_false, 1, PCB_FLAG_MINCUT);
debprintf("- alloced for %d\n", (short_conns_maxid + 1));
lut_by_oid = calloc(sizeof(short_conn_t *), (short_conns_maxid + 1));
@@ -166,7 +160,7 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
for (n = short_conns, gids = 2; n != NULL; n = n->next, gids++) {
char *s;
const char *typ;
- ElementType *parent;
+ pcb_element_t *parent;
n->gid = gids;
debprintf(" {%d} found %d %d/%p type %d from %d\n", n->gid, n->to_type, n->to->ID, (void *)n->to, n->type, n->from_id);
lut_by_oid[n->to->ID] = n;
@@ -177,15 +171,15 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
switch (n->to_type) {
case PCB_TYPE_PIN:
typ = "pin";
- parent = ((PinType *) (n->to))->Element;
+ parent = ((pcb_pin_t *) (n->to))->Element;
break;
case PCB_TYPE_VIA:
typ = "via";
- parent = ((PinType *) (n->to))->Element;
+ parent = ((pcb_pin_t *) (n->to))->Element;
break;
case PCB_TYPE_PAD:
typ = "pad";
- parent = ((PadType *) (n->to))->Element;
+ parent = ((pcb_pad_t *) (n->to))->Element;
break;
case PCB_TYPE_LINE:
typ = "line";
@@ -195,7 +189,7 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
break;
}
if (parent != NULL) {
- TextType *name;
+ pcb_text_t *name;
name = &parent->Name[1];
if ((name->TextString == NULL) || (*name->TextString == '\0'))
sprintf(s, "%s #%ld \\nof #%ld", typ, n->to->ID, parent->ID);
@@ -242,11 +236,11 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
spare = NULL;
if (n->to_type == PCB_TYPE_PIN)
- spare = ((PinType *) n->to)->Spare;
+ spare = ((pcb_pin_t *) n->to)->Spare;
if (n->to_type == PCB_TYPE_PAD)
- spare = ((PadType *) n->to)->Spare;
+ spare = ((pcb_pad_t *) n->to)->Spare;
if (spare != NULL) {
- void *net = &(((LibraryMenuTypePtr) spare)->Name[2]);
+ void *net = &(((pcb_lib_menu_t *) spare)->Name[2]);
debprintf(" net=%s\n", net);
if (S == NULL) {
debprintf(" -> became S\n");
@@ -269,7 +263,7 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
from = lut_by_oid[n->from_id];
/* weight: 1 for connections we can break, large value for connections we shall not break */
- if ((n->type == FCT_COPPER) || (n->type == FCT_START)) {
+ if ((n->type == PCB_FCT_COPPER) || (n->type == PCB_FCT_START)) {
/* connection to a pin/pad is slightly stronger than the
strongest obj-obj conn; obj-obj conns are weaker at junctions where many
objects connect */
@@ -310,7 +304,7 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
s = lut_by_gid[solution[i]];
debprintf("%d %p", solution[i], (void *)s);
if (s != NULL) {
- SET_FLAG(PCB_FLAG_WARN, s->to);
+ PCB_FLAG_SET(PCB_FLAG_WARN, s->to);
debprintf(" -> %d", s->to->ID);
}
debprintf("\n");
@@ -332,26 +326,26 @@ static int proc_short(PinType * pin, PadType * pad, int ignore)
}
- ResetFoundLinesAndPolygons(pcb_false);
- ResetFoundPinsViasAndPads(pcb_false);
- RestoreFindFlag();
+ pcb_reset_found_lines_polys(pcb_false);
+ pcb_reset_found_pins_vias_pads(pcb_false);
+ pcb_restore_find_flag();
- find_callback = old_cb;
+ pcb_find_callback = old_cb;
return bad_gr;
}
typedef struct pinpad_s pinpad_t;
struct pinpad_s {
int ignore; /* if 1, changed our mind, do not check */
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
const char *with_net; /* the name of the net this pin/pad is in short with */
pinpad_t *next;
};
static pinpad_t *shorts = NULL;
-void rat_found_short(PinType * pin, PadType * pad, const char *with_net)
+void rat_found_short(pcb_pin_t * pin, pcb_pad_t * pad, const char *with_net)
{
pinpad_t *pp;
pp = malloc(sizeof(pinpad_t));
@@ -371,9 +365,9 @@ void rat_proc_shorts(void)
next = n->next;
if (n->pin != NULL)
- SET_FLAG(PCB_FLAG_WARN, n->pin);
+ PCB_FLAG_SET(PCB_FLAG_WARN, n->pin);
if (n->pad != NULL)
- SET_FLAG(PCB_FLAG_WARN, n->pad);
+ PCB_FLAG_SET(PCB_FLAG_WARN, n->pad);
/* run only if net is not ignored */
@@ -385,7 +379,7 @@ void rat_proc_shorts(void)
if (!bad_gr) {
/* check if the rest of the shorts affect the same nets - ignore them if so */
for (i = n->next; i != NULL; i = i->next) {
- LibraryMenuType *spn, *spi;
+ pcb_lib_menu_t *spn, *spi;
spn = (n->pin != NULL) ? n->pin->Spare : n->pad->Spare;
spi = (i->pin != NULL) ? i->pin->Spare : i->pad->Spare;
@@ -410,8 +404,8 @@ void hid_mincut_uninit(void)
#include "stub_mincut.h"
pcb_uninit_t hid_mincut_init(void)
{
- stub_rat_found_short = rat_found_short;
- stub_rat_proc_shorts = rat_proc_shorts;
+ pcb_stub_rat_found_short = rat_found_short;
+ pcb_stub_rat_proc_shorts = rat_proc_shorts;
#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \
conf_reg_field(conf_mincut, field,isarray,type_name,cpath,cname,desc,flags);
#include "rats_mincut_conf_fields.h"
diff --git a/src_plugins/mincut/rats_mincut.h b/src_plugins/mincut/rats_mincut.h
index 748ea7f..f16743a 100644
--- a/src_plugins/mincut/rats_mincut.h
+++ b/src_plugins/mincut/rats_mincut.h
@@ -23,5 +23,5 @@
*
*/
-void rat_found_short(PinType * pin, PadType * pad, const char *with_net);
+void rat_found_short(pcb_pin_t * pin, pcb_pad_t * pad, const char *with_net);
void rat_proc_shorts(void);
diff --git a/src_plugins/oldactions/Makefile b/src_plugins/oldactions/Makefile
index 7b0bb22..a49eac8 100644
--- a/src_plugins/oldactions/Makefile
+++ b/src_plugins/oldactions/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_oldactions
+ cd ../../src && $(MAKE) mod_oldactions
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/oldactions/oldactions.c b/src_plugins/oldactions/oldactions.c
index dd5b918..a60a8ae 100644
--- a/src_plugins/oldactions/oldactions.c
+++ b/src_plugins/oldactions/oldactions.c
@@ -25,7 +25,6 @@
*
*/
#include "config.h"
-#include "global.h"
#include "conf.h"
#include "data.h"
#include "action_helper.h"
@@ -41,11 +40,11 @@ static void conf_toggle(conf_role_t role, const char *path)
{
conf_native_t *n = conf_get_field(path);
if (n == NULL) {
- Message(PCB_MSG_DEFAULT, "Error: can't find config node %s to toggle\n", path);
+ pcb_message(PCB_MSG_ERROR, "Error: can't find config node %s to toggle\n", path);
return;
}
if (n->type != CFN_BOOLEAN) {
- Message(PCB_MSG_DEFAULT, "Error: config node %s is not a boolean, can't toggle\n", path);
+ pcb_message(PCB_MSG_ERROR, "Error: config node %s is not a boolean, can't toggle\n", path);
return;
}
@@ -54,9 +53,9 @@ static void conf_toggle(conf_role_t role, const char *path)
/* -------------------------------------------------------------------------- */
-static const char dumplibrary_syntax[] = "DumpLibrary()";
+static const char pcb_acts_DumpLibrary[] = "DumpLibrary()";
-static const char dumplibrary_help[] = "Display the entire contents of the libraries.";
+static const char pcb_acth_DumpLibrary[] = "Display the entire contents of the libraries.";
/* %start-doc actions DumpLibrary
@@ -73,9 +72,9 @@ static void ind(int level)
inds[level] = ' ';
}
-static void dump_lib_any(int level, library_t *l);
+static void dump_lib_any(int level, pcb_fplibrary_t *l);
-static void dump_lib_dir(int level, library_t *l)
+static void dump_lib_dir(int level, pcb_fplibrary_t *l)
{
pcb_cardinal_t n;
@@ -85,7 +84,7 @@ static void dump_lib_dir(int level, library_t *l)
dump_lib_any(level+1, l->data.dir.children.array+n);
}
-static void dump_lib_fp(int level, library_t *l)
+static void dump_lib_fp(int level, pcb_fplibrary_t *l)
{
ind(level);
printf("%s", l->name);
@@ -98,7 +97,7 @@ static void dump_lib_fp(int level, library_t *l)
printf(" loc_info(%s)\n", l->data.fp.loc_info);
}
-static void dump_lib_any(int level, library_t *l)
+static void dump_lib_any(int level, pcb_fplibrary_t *l)
{
switch(l->type) {
case LIB_INVALID: printf("??\n"); break;
@@ -108,9 +107,9 @@ static void dump_lib_any(int level, library_t *l)
}
-static int ActionDumpLibrary(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_DumpLibrary(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- dump_lib_any(0, &library);
+ dump_lib_any(0, &pcb_library);
return 0;
}
@@ -119,21 +118,21 @@ static int ActionDumpLibrary(int argc, const char **argv, Coord x, Coord y)
* no operation, just for testing purposes
* syntax: Bell(volume)
*/
-static const char bell_syntax[] = "Bell()";
+static const char pcb_acts_Bell[] = "Bell()";
-static const char bell_help[] = "Attempt to produce audible notification (e.g. beep the speaker).";
+static const char pcb_acth_Bell[] = "Attempt to produce audible notification (e.g. beep the speaker).";
-static int ActionBell(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Bell(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- gui->beep();
+ pcb_gui->beep();
return 0;
}
/* --------------------------------------------------------------------------- */
-static const char debug_syntax[] = "Debug(...)";
+static const char pcb_acts_debug[] = "Debug(...)";
-static const char debug_help[] = "Debug action.";
+static const char pcb_acth_debug[] = "Debug action.";
/* %start-doc actions Debug
@@ -142,9 +141,9 @@ arguments to stdout.
%end-doc */
-static const char debugxy_syntax[] = "DebugXY(...)";
+static const char pcb_acts_debugxy[] = "DebugXY(...)";
-static const char debugxy_help[] = "Debug action, with coordinates";
+static const char pcb_acth_debugxy[] = "Debug action, with coordinates";
/* %start-doc actions DebugXY
@@ -154,7 +153,7 @@ on one.
%end-doc */
-static int Debug(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Debug(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int i;
printf("Debug:");
@@ -164,9 +163,9 @@ static int Debug(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-static const char return_syntax[] = "Return(0|1)";
+static const char pcb_acts_return[] = "Return(0|1)";
-static const char return_help[] = "Simulate a passing or failing action.";
+static const char pcb_acth_return[] = "Simulate a passing or failing action.";
/* %start-doc actions Return
@@ -175,15 +174,15 @@ passed a 1, does nothing but pretends to fail.
%end-doc */
-static int Return(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Return(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
return atoi(argv[0]);
}
-static const char djopt_sao_syntax[] = "OptAutoOnly()";
+static const char pcb_acts_djopt_sao[] = "OptAutoOnly()";
-static const char djopt_sao_help[] = "Toggles the optimize-only-autorouted flag.";
+static const char pcb_acth_djopt_sao[] = "Toggles the optimize-only-autorouted flag.";
/* %start-doc actions OptAutoOnly
@@ -199,7 +198,7 @@ optimize hand-routed traces also.
-int djopt_set_auto_only(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_djopt_set_auto_only(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
conf_toggle(CFR_DESIGN, "plugins/djopt/auto_only");
return 0;
@@ -207,9 +206,9 @@ int djopt_set_auto_only(int argc, const char **argv, Coord x, Coord y)
/* ************************************************************ */
-static const char toggle_vendor_syntax[] = "ToggleVendor()";
+static const char pcb_acts_toggle_vendor[] = "ToggleVendor()";
-static const char toggle_vendor_help[] = "Toggles the state of automatic drill size mapping.";
+static const char pcb_acth_toggle_vendor[] = "Toggles the state of automatic drill size mapping.";
/* %start-doc actions ToggleVendor
@@ -225,7 +224,7 @@ loaded first.
%end-doc */
-int ActionToggleVendor(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_ToggleVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
conf_toggle(CFR_DESIGN, "plugins/vendor/enable");
return 0;
@@ -233,9 +232,9 @@ int ActionToggleVendor(int argc, const char **argv, Coord x, Coord y)
/* ************************************************************ */
-static const char enable_vendor_syntax[] = "EnableVendor()";
+static const char pcb_acts_enable_vendor[] = "EnableVendor()";
-static const char enable_vendor_help[] = "Enables automatic drill size mapping.";
+static const char pcb_acth_enable_vendor[] = "Enables automatic drill size mapping.";
/* %start-doc actions EnableVendor
@@ -251,7 +250,7 @@ loaded first.
%end-doc */
-int ActionEnableVendor(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_EnableVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE);
return 0;
@@ -259,9 +258,9 @@ int ActionEnableVendor(int argc, const char **argv, Coord x, Coord y)
/* ************************************************************ */
-static const char disable_vendor_syntax[] = "DisableVendor()";
+static const char pcb_acts_disable_vendor[] = "DisableVendor()";
-static const char disable_vendor_help[] = "Disables automatic drill size mapping.";
+static const char pcb_acth_disable_vendor[] = "Disables automatic drill size mapping.";
/* %start-doc actions DisableVendor
@@ -275,46 +274,46 @@ specified in the currently loaded vendor drill table.
%end-doc */
-int ActionDisableVendor(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_DisableVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE);
return 0;
}
-HID_Action oldactions_action_list[] = {
- {"DumpLibrary", 0, ActionDumpLibrary,
- dumplibrary_help, dumplibrary_syntax},
- {"Bell", 0, ActionBell,
- bell_help, bell_syntax},
- {"Debug", 0, Debug,
- debug_help, debug_syntax},
- {"DebugXY", "Click X,Y for Debug", Debug,
- debugxy_help, debugxy_syntax},
- {"Return", 0, Return,
- return_help, return_syntax},
- {"OptAutoOnly", 0, djopt_set_auto_only,
- djopt_sao_help, djopt_sao_syntax},
- {"ToggleVendor", 0, ActionToggleVendor,
- toggle_vendor_help, toggle_vendor_syntax},
- {"EnableVendor", 0, ActionEnableVendor,
- enable_vendor_help, enable_vendor_syntax},
- {"DisableVendor", 0, ActionDisableVendor,
- disable_vendor_help, disable_vendor_syntax}
+pcb_hid_action_t oldactions_action_list[] = {
+ {"DumpLibrary", 0, pcb_act_DumpLibrary,
+ pcb_acth_DumpLibrary, pcb_acts_DumpLibrary},
+ {"Bell", 0, pcb_act_Bell,
+ pcb_acth_Bell, pcb_acts_Bell},
+ {"Debug", 0, pcb_act_Debug,
+ pcb_acth_debug, pcb_acts_debug},
+ {"DebugXY", "Click X,Y for Debug", pcb_act_Debug,
+ pcb_acth_debugxy, pcb_acts_debugxy},
+ {"Return", 0, pcb_act_Return,
+ pcb_acth_return, pcb_acts_return},
+ {"OptAutoOnly", 0, pcb_act_djopt_set_auto_only,
+ pcb_acth_djopt_sao, pcb_acts_djopt_sao},
+ {"ToggleVendor", 0, pcb_act_ToggleVendor,
+ pcb_acth_toggle_vendor, pcb_acts_toggle_vendor},
+ {"EnableVendor", 0, pcb_act_EnableVendor,
+ pcb_acth_enable_vendor, pcb_acts_enable_vendor},
+ {"DisableVendor", 0, pcb_act_DisableVendor,
+ pcb_acth_disable_vendor, pcb_acts_disable_vendor}
};
static const char *oldactions_cookie = "oldactions plugin";
-REGISTER_ACTIONS(oldactions_action_list, oldactions_cookie)
+PCB_REGISTER_ACTIONS(oldactions_action_list, oldactions_cookie)
static void hid_oldactions_uninit(void)
{
- hid_remove_actions_by_cookie(oldactions_cookie);
+ pcb_hid_remove_actions_by_cookie(oldactions_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_oldactions_init(void)
{
- REGISTER_ACTIONS(oldactions_action_list, oldactions_cookie)
+ PCB_REGISTER_ACTIONS(oldactions_action_list, oldactions_cookie)
return hid_oldactions_uninit;
}
diff --git a/src_plugins/plugins_feature.tmpasm b/src_plugins/plugins_feature.tmpasm
index f66d5dc..5ab1f89 100644
--- a/src_plugins/plugins_feature.tmpasm
+++ b/src_plugins/plugins_feature.tmpasm
@@ -9,6 +9,7 @@ include {../src_plugins/autoroute/Plug.tmpasm}
include {../src_plugins/boardflip/Plug.tmpasm}
include {../src_plugins/distalign/Plug.tmpasm}
include {../src_plugins/distaligntext/Plug.tmpasm}
+include {../src_plugins/draw_fab/Plug.tmpasm}
include {../src_plugins/jostle/Plug.tmpasm}
include {../src_plugins/polycombine/Plug.tmpasm}
include {../src_plugins/polystitch/Plug.tmpasm}
@@ -31,3 +32,5 @@ include {../src_plugins/propedit/Plug.tmpasm}
include {../src_plugins/diag/Plug.tmpasm}
include {../src_plugins/loghid/Plug.tmpasm}
include {../src_plugins/query/Plug.tmpasm}
+include {../src_plugins/acompnet/Plug.tmpasm}
+include {../src_plugins/rubberband_orig/Plug.tmpasm}
diff --git a/src_plugins/plugins_io.tmpasm b/src_plugins/plugins_io.tmpasm
index 2e5aaf3..f5a71b5 100644
--- a/src_plugins/plugins_io.tmpasm
+++ b/src_plugins/plugins_io.tmpasm
@@ -4,6 +4,7 @@ include {../src_plugins/import_edif/Plug.tmpasm}
include {../src_plugins/import_netlist/Plug.tmpasm}
include {../src_plugins/import_sch/Plug.tmpasm}
include {../src_plugins/import_dsn/Plug.tmpasm}
+include {../src_plugins/import_hyp/Plug.tmpasm}
include {../src_plugins/export_ps/Plug.tmpasm}
include {../src_plugins/export_lpr/Plug.tmpasm}
@@ -20,10 +21,12 @@ include {../src_plugins/export_openscad/Plug.tmpasm}
include {../src_plugins/export_dsn/Plug.tmpasm}
include {../src_plugins/export_ipcd356/Plug.tmpasm}
include {../src_plugins/export_svg/Plug.tmpasm}
+include {../src_plugins/export_stat/Plug.tmpasm}
include {../src_plugins/hid_batch/Plug.tmpasm}
include {../src_plugins/hid_gtk/Plug.tmpasm}
include {../src_plugins/hid_lesstif/Plug.tmpasm}
+include {../src_plugins/hid_remote/Plug.tmpasm}
include {../src_plugins/io_lihata/Plug.tmpasm}
include {../src_plugins/io_pcb/Plug.tmpasm}
diff --git a/src_plugins/polycombine/Makefile b/src_plugins/polycombine/Makefile
index ba21c31..5957e0f 100644
--- a/src_plugins/polycombine/Makefile
+++ b/src_plugins/polycombine/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_polycombine
+ cd ../../src && $(MAKE) mod_polycombine
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/polycombine/polycombine.c b/src_plugins/polycombine/polycombine.c
index be905ff..041a63b 100644
--- a/src_plugins/polycombine/polycombine.c
+++ b/src_plugins/polycombine/polycombine.c
@@ -20,10 +20,9 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "macro.h"
-#include "create.h"
#include "remove.h"
#include "hid.h"
#include "error.h"
@@ -31,25 +30,25 @@
#include "polygon.h"
#include "polyarea.h"
#include "assert.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "find.h"
-#include "misc.h"
#include "draw.h"
#include "undo.h"
#include "plugins.h"
#include "hid_actions.h"
+#include "obj_poly.h"
-static POLYAREA *original_poly(PolygonType *p, pcb_bool *forward)
+static pcb_polyarea_t *original_poly(pcb_polygon_t *p, pcb_bool *forward)
{
- PLINE *contour = NULL;
- POLYAREA *np = NULL;
+ pcb_pline_t *contour = NULL;
+ pcb_polyarea_t *np = NULL;
pcb_cardinal_t n;
- Vector v;
+ pcb_vector_t v;
int hole = 0;
*forward = pcb_true;
- if ((np = poly_Create()) == NULL)
+ if ((np = pcb_polyarea_create()) == NULL)
return NULL;
/* first make initial polygon contour */
@@ -60,29 +59,29 @@ static POLYAREA *original_poly(PolygonType *p, pcb_bool *forward)
v[0] = p->Points[n].X;
v[1] = p->Points[n].Y;
if (contour == NULL) {
- if ((contour = poly_NewContour(v)) == NULL)
+ if ((contour = pcb_poly_contour_new(v)) == NULL)
return NULL;
}
else {
- poly_InclVertex(contour->head.prev, poly_CreateNode(v));
+ pcb_poly_vertex_include(contour->head.prev, pcb_poly_node_create(v));
}
/* Is current point last in contour? If so process it. */
if (n == p->PointN - 1 || (hole < p->HoleIndexN && n == p->HoleIndex[hole] - 1)) {
- poly_PreContour(contour, pcb_true);
+ pcb_poly_contour_pre(contour, pcb_true);
/* Log the direction in which the outer contour was specified */
if (hole == 0)
- *forward = (contour->Flags.orient == PLF_DIR);
+ *forward = (contour->Flags.orient == PCB_PLF_DIR);
/* make sure it is a positive contour (outer) or negative (hole) */
- if (contour->Flags.orient != (hole ? PLF_INV : PLF_DIR))
- poly_InvContour(contour);
- assert(contour->Flags.orient == (hole ? PLF_INV : PLF_DIR));
+ if (contour->Flags.orient != (hole ? PCB_PLF_INV : PCB_PLF_DIR))
+ pcb_poly_contour_inv(contour);
+ assert(contour->Flags.orient == (hole ? PCB_PLF_INV : PCB_PLF_DIR));
- poly_InclContour(np, contour);
+ pcb_polyarea_contour_include(np, contour);
contour = NULL;
- assert(poly_Valid(np));
+ assert(pcb_poly_valid(np));
hole++;
}
@@ -93,9 +92,9 @@ static POLYAREA *original_poly(PolygonType *p, pcb_bool *forward)
typedef struct poly_tree poly_tree;
struct poly_tree {
- PolygonType *polygon;
+ pcb_polygon_t *polygon;
pcb_bool forward;
- POLYAREA *polyarea;
+ pcb_polyarea_t *polyarea;
poly_tree *parent;
poly_tree *child;
poly_tree *prev;
@@ -128,15 +127,15 @@ struct poly_tree {
* contours can be assumed not to overlap, we can drill down in this
* order: P1, P2, P3, P4, P5, P6.
*/
-static pcb_bool PolygonContainsPolygon(POLYAREA *outer, POLYAREA *inner)
+static pcb_bool PolygonContainsPolygon(pcb_polyarea_t *outer, pcb_polyarea_t *inner)
{
/* int contours_isect;*/
/* Should check outer contours don't intersect? */
-/* contours_isect = Touching (outer, inner);*/
+/* contours_isect = pcb_polyarea_touching(outer, inner);*/
/* Cheat and assume simple single contour polygons for now */
/* return contours_isect ?
- 0 : poly_ContourInContour (outer->contours, inner->contours);*/
- return poly_ContourInContour(outer->contours, inner->contours);
+ 0 : pcb_poly_contour_in_contour(outer->contours, inner->contours);*/
+ return pcb_poly_contour_in_contour(outer->contours, inner->contours);
}
@@ -160,7 +159,7 @@ static poly_tree *insert_node_recursive(poly_tree * start_point, poly_tree * to_
for (cur_node = start_point; cur_node != NULL; cur_node = next) {
next = cur_node->next;
-/* to_insert_isects_cur_node = IsPolygonInPolygon (to_insert->polygon, cur_node->polygon);*/
+/* to_insert_isects_cur_node = pcb_is_poly_in_poly(to_insert->polygon, cur_node->polygon);*/
to_insert_contains_cur_node = PolygonContainsPolygon(to_insert->polyarea, cur_node->polyarea);
#if 0
@@ -250,14 +249,14 @@ static poly_tree *insert_node_recursive(poly_tree * start_point, poly_tree * to_
return to_insert;
}
-static POLYAREA *compute_polygon_recursive(poly_tree * root, POLYAREA * accumulate)
+static pcb_polyarea_t *compute_polygon_recursive(poly_tree * root, pcb_polyarea_t * accumulate)
{
- POLYAREA *res;
+ pcb_polyarea_t *res;
poly_tree *cur_node;
for (cur_node = root; cur_node != NULL; cur_node = cur_node->next) {
/* Process this element */
/* printf ("Processing node %ld %s\n", cur_node->polygon->ID, cur_node->forward ? "FWD" : "BWD");*/
- poly_Boolean_free(accumulate, cur_node->polyarea, &res, cur_node->forward ? PBO_UNITE : PBO_SUB);
+ pcb_polyarea_boolean_free(accumulate, cur_node->polyarea, &res, cur_node->forward ? PCB_PBO_UNITE : PCB_PBO_SUB);
accumulate = res;
/* And its children if it has them */
@@ -269,24 +268,24 @@ static POLYAREA *compute_polygon_recursive(poly_tree * root, POLYAREA * accumula
return accumulate;
}
-static int polycombine(int argc, const char **argv, Coord x, Coord y)
+static int polycombine(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- POLYAREA *res;
+ pcb_polyarea_t *res;
pcb_bool forward;
- POLYAREA *np;
+ pcb_polyarea_t *np;
/* bool outer;
- POLYAREA *pa;
- PLINE *pline;
- VNODE *node;
- PolygonType *Polygon;*/
- LayerType *Layer = NULL;
+ pcb_polyarea_t *pa;
+ pcb_pline_t *pline;
+ pcb_vnode_t *node;
+ pcb_polygon_t *Polygon;*/
+ pcb_layer_t *Layer = NULL;
poly_tree *root = NULL;
poly_tree *this_node;
/* First pass to combine the forward and backward contours */
- VISIBLEPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_VISIBLE_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, polygon))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon))
continue;
/* Pick the layer of the first polygon we find selected */
@@ -308,55 +307,55 @@ static int polycombine(int argc, const char **argv, Coord x, Coord y)
/* Check where we should place the node in the tree */
root = insert_node_recursive(root, this_node);
- /*RemovePolygon (layer, polygon);*/
+ /*pcb_poly_remove(layer, polygon);*/
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* Now perform a traversal of the tree, computing a polygon */
res = compute_polygon_recursive(root, NULL);
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
/* Second pass to remove the input polygons */
- VISIBLEPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_VISIBLE_LOOP(PCB->Data);
{
- if (!TEST_FLAG(PCB_FLAG_SELECTED, polygon))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon))
continue;
/* Only combine polygons on the same layer */
if (Layer != layer)
continue;
- RemovePolygon(layer, polygon);
+ pcb_poly_remove(layer, polygon);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
/* Now de-construct the resulting polygon into raw PCB polygons */
- PolyToPolygonsOnLayer(PCB->Data, Layer, res, string_to_pcbflags("clearpoly", NULL));
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
- Draw();
+ pcb_poly_to_polygons_on_layer(PCB->Data, Layer, res, pcb_strflg_board_s2f("clearpoly", NULL));
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
+ pcb_draw();
return 0;
}
-static HID_Action polycombine_action_list[] = {
+static pcb_hid_action_t polycombine_action_list[] = {
{"PolyCombine", "???", polycombine,
NULL, NULL}
};
char *polycombine_cookie = "polycombine plugin";
-REGISTER_ACTIONS(polycombine_action_list, polycombine_cookie)
+PCB_REGISTER_ACTIONS(polycombine_action_list, polycombine_cookie)
static void hid_polycombine_uninit(void)
{
- hid_remove_actions_by_cookie(polycombine_cookie);
+ pcb_hid_remove_actions_by_cookie(polycombine_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_polycombine_init()
{
- REGISTER_ACTIONS(polycombine_action_list, polycombine_cookie);
+ PCB_REGISTER_ACTIONS(polycombine_action_list, polycombine_cookie);
return hid_polycombine_uninit;
}
diff --git a/src_plugins/polystitch/Makefile b/src_plugins/polystitch/Makefile
index 051fc9b..1267449 100644
--- a/src_plugins/polystitch/Makefile
+++ b/src_plugins/polystitch/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_polystitch
+ cd ../../src && $(MAKE) mod_polystitch
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/polystitch/polystitch.c b/src_plugins/polystitch/polystitch.c
index 44906e1..3fba8b2 100644
--- a/src_plugins/polystitch/polystitch.c
+++ b/src_plugins/polystitch/polystitch.c
@@ -24,32 +24,31 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "macro.h"
-#include "create.h"
#include "remove.h"
#include "hid.h"
#include "error.h"
#include "rtree.h"
#include "draw.h"
-#include "set.h"
#include "polygon.h"
-#include "misc.h"
#include "plugins.h"
#include "hid_actions.h"
+#include "obj_poly.h"
+#include "obj_poly_draw.h"
-static PolygonType *inner_poly, *outer_poly;
-static LayerType *poly_layer;
+static pcb_polygon_t *inner_poly, *outer_poly;
+static pcb_layer_t *poly_layer;
-static double ATAN2(PointType a, PointType b)
+static double ATAN2(pcb_point_t a, pcb_point_t b)
{
if (a.X == b.X && a.Y == b.Y)
return 0;
return atan2((double) b.Y - a.Y, (double) b.X - a.X);
}
-static double poly_winding(PolygonType * poly)
+static double poly_winding(pcb_polygon_t * poly)
{
double winding, turn;
double prev_angle, this_angle;
@@ -83,10 +82,10 @@ static void find_crosshair_poly(int x, int y)
inner_poly = NULL;
poly_layer = NULL;
- VISIBLEPOLYGON_LOOP(PCB->Data);
+ PCB_POLY_VISIBLE_LOOP(PCB->Data);
{
/* layer, polygon */
- POLYGONPOINT_LOOP(polygon);
+ PCB_POLY_POINT_LOOP(polygon);
{
/* point */
int dx = x - point->X;
@@ -98,11 +97,11 @@ static void find_crosshair_poly(int x, int y)
best = dist;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
if (!inner_poly) {
- Message(PCB_MSG_ERROR, "Cannot find any polygons");
+ pcb_message(PCB_MSG_ERROR, "Cannot find any polygons");
return;
}
}
@@ -115,7 +114,7 @@ static void find_enclosing_poly()
{
outer_poly = NULL;
- POLYGON_LOOP(poly_layer);
+ PCB_POLY_LOOP(poly_layer);
{
if (polygon == inner_poly)
continue;
@@ -126,8 +125,8 @@ static void find_enclosing_poly()
return;
}
}
- END_LOOP;
- Message(PCB_MSG_ERROR, "Cannot find a polygon enclosing the one you selected");
+ PCB_END_LOOP;
+ pcb_message(PCB_MSG_ERROR, "Cannot find a polygon enclosing the one you selected");
}
static void check_windings()
@@ -140,7 +139,7 @@ static void check_windings()
if (iw * ow > 0) {
/* Wound in same direction, must reverse one. */
for (i = 0, j = inner_poly->PointN - 1; i < j; i++, j--) {
- PointType x = inner_poly->Points[i];
+ pcb_point_t x = inner_poly->Points[i];
inner_poly->Points[i] = inner_poly->Points[j];
inner_poly->Points[j] = x;
}
@@ -151,15 +150,15 @@ static void check_windings()
* \brief Rotate the polygon point list around so that point N is the
* first one in the list.
*/
-static void rotate_points(PolygonType * poly, int n)
+static void rotate_points(pcb_polygon_t * poly, int n)
{
- PointType *np;
+ pcb_point_t *np;
int n2 = poly->PointN - n;
- np = (PointType *) malloc(poly->PointN * sizeof(PointType));
- memcpy(np, poly->Points + n, n2 * sizeof(PointType));
- memcpy(np + n2, poly->Points, n * sizeof(PointType));
- memcpy(poly->Points, np, poly->PointN * sizeof(PointType));
+ np = (pcb_point_t *) malloc(poly->PointN * sizeof(pcb_point_t));
+ memcpy(np, poly->Points + n, n2 * sizeof(pcb_point_t));
+ memcpy(np + n2, poly->Points, n * sizeof(pcb_point_t));
+ memcpy(poly->Points, np, poly->PointN * sizeof(pcb_point_t));
free(np);
}
@@ -167,12 +166,12 @@ static void rotate_points(PolygonType * poly, int n)
* \brief Make sure the first and last point of the polygon are the same
* point, so we can stitch them properly.
*/
-static void dup_endpoints(PolygonType * poly)
+static void dup_endpoints(pcb_polygon_t * poly)
{
int n = poly->PointN;
if (poly->Points[0].X == poly->Points[n - 1].X && poly->Points[0].Y == poly->Points[n - 1].Y)
return;
- CreateNewPointInPolygon(poly, poly->Points[0].X, poly->Points[0].Y);
+ pcb_poly_point_new(poly, poly->Points[0].X, poly->Points[0].Y);
}
/*!
@@ -208,26 +207,26 @@ static void stitch_them()
dup_endpoints(inner_poly);
dup_endpoints(outer_poly);
- r_delete_entry(poly_layer->polygon_tree, (BoxType *) inner_poly);
- r_delete_entry(poly_layer->polygon_tree, (BoxType *) outer_poly);
+ pcb_r_delete_entry(poly_layer->polygon_tree, (pcb_box_t *) inner_poly);
+ pcb_r_delete_entry(poly_layer->polygon_tree, (pcb_box_t *) outer_poly);
for (i = 0; i < inner_poly->PointN; i++)
- CreateNewPointInPolygon(outer_poly, inner_poly->Points[i].X, inner_poly->Points[i].Y);
+ pcb_poly_point_new(outer_poly, inner_poly->Points[i].X, inner_poly->Points[i].Y);
- SetChangedFlag(pcb_true);
+ pcb_board_set_changed_flag(pcb_true);
outer_poly->NoHolesValid = 0;
- SetPolygonBoundingBox(outer_poly);
- r_insert_entry(poly_layer->polygon_tree, (BoxType *) outer_poly, 0);
- RemoveExcessPolygonPoints(poly_layer, outer_poly);
- InitClip(PCB->Data, poly_layer, outer_poly);
+ pcb_poly_bbox(outer_poly);
+ pcb_r_insert_entry(poly_layer->polygon_tree, (pcb_box_t *) outer_poly, 0);
+ pcb_poly_remove_excess_points(poly_layer, outer_poly);
+ pcb_poly_init_clip(PCB->Data, poly_layer, outer_poly);
DrawPolygon(poly_layer, outer_poly);
- Draw();
+ pcb_draw();
- RemovePolygon(poly_layer, inner_poly);
+ pcb_poly_remove(poly_layer, inner_poly);
}
-static int polystitch(int argc, const char **argv, Coord x, Coord y)
+static int polystitch(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
find_crosshair_poly(x, y);
if (inner_poly) {
@@ -240,23 +239,23 @@ static int polystitch(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-static HID_Action polystitch_action_list[] = {
+static pcb_hid_action_t polystitch_action_list[] = {
{"PolyStitch", "Select a corner on the inner polygon", polystitch,
NULL, NULL}
};
char *polystitch_cookie = "polystitch plugin";
-REGISTER_ACTIONS(polystitch_action_list, polystitch_cookie)
+PCB_REGISTER_ACTIONS(polystitch_action_list, polystitch_cookie)
static void hid_polystitch_uninit(void)
{
- hid_remove_actions_by_cookie(polystitch_cookie);
+ pcb_hid_remove_actions_by_cookie(polystitch_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_polystitch_init()
{
- REGISTER_ACTIONS(polystitch_action_list, polystitch_cookie);
+ PCB_REGISTER_ACTIONS(polystitch_action_list, polystitch_cookie);
return hid_polystitch_uninit;
}
diff --git a/src_plugins/propedit/Makefile b/src_plugins/propedit/Makefile
index 55f3aa9..33f9736 100644
--- a/src_plugins/propedit/Makefile
+++ b/src_plugins/propedit/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_propedit
+ cd ../../src && $(MAKE) mod_propedit
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/propedit/propedit.c b/src_plugins/propedit/propedit.c
index e6222dd..7e8d782 100644
--- a/src_plugins/propedit/propedit.c
+++ b/src_plugins/propedit/propedit.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include "plugins.h"
+#include "config.h"
#include "props.h"
#include "propsel.h"
#include "hid_actions.h"
@@ -33,31 +34,31 @@
#warning TODO
static const char propedit_syntax[] = "propedit()";
static const char propedit_help[] = "Run the property editor";
-int propedit_action(int argc, const char **argv, Coord x, Coord y)
+int propedit_action(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
pe_ctx_t ctx;
htsp_entry_t *pe;
- if ((gui == NULL) || (gui->propedit_start == NULL)) {
- Message(PCB_MSG_DEFAULT, "Error: there's no GUI or the active GUI can't edit properties.\n");
+ if ((pcb_gui == NULL) || (pcb_gui->propedit_start == NULL)) {
+ pcb_message(PCB_MSG_ERROR, "Error: there's no GUI or the active GUI can't edit properties.\n");
return 1;
}
ctx.core_props = pcb_props_init();
pcb_propsel_map_core(ctx.core_props);
- gui->propedit_start(&ctx, ctx.core_props->fill, propedit_query);
+ pcb_gui->propedit_start(&ctx, ctx.core_props->fill, propedit_query);
for (pe = htsp_first(ctx.core_props); pe; pe = htsp_next(ctx.core_props, pe))
propedit_ins_prop(&ctx, pe);
- gui->propedit_end(&ctx);
+ pcb_gui->propedit_end(&ctx);
pcb_props_uninit(ctx.core_props);
return 0;
}
static const char propset_syntax[] = "propset(name, value)";
static const char propset_help[] = "Change the named property of all selected objects to/by value";
-int propset_action(int argc, const char **argv, Coord x, Coord y)
+int propset_action(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int res;
/*
@@ -71,23 +72,23 @@ int propset_action(int argc, const char **argv, Coord x, Coord y)
static const char *propedit_cookie = "propedit";
-HID_Action propedit_action_list[] = {
+pcb_hid_action_t propedit_action_list[] = {
{"propedit", 0, propedit_action,
propedit_help, propedit_syntax},
{"propset", 0, propset_action,
propset_help, propset_syntax},
};
-REGISTER_ACTIONS(propedit_action_list, propedit_cookie)
+PCB_REGISTER_ACTIONS(propedit_action_list, propedit_cookie)
static void hid_propedit_uninit(void)
{
- hid_remove_actions_by_cookie(propedit_cookie);
+ pcb_hid_remove_actions_by_cookie(propedit_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_propedit_init(void)
{
- REGISTER_ACTIONS(propedit_action_list, propedit_cookie)
+ PCB_REGISTER_ACTIONS(propedit_action_list, propedit_cookie)
return hid_propedit_uninit;
}
diff --git a/src_plugins/propedit/props.c b/src_plugins/propedit/props.c
index 4ce2c17..a778de5 100644
--- a/src_plugins/propedit/props.c
+++ b/src_plugins/propedit/props.c
@@ -19,10 +19,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
+#include "config.h"
#include "props.h"
#include "propsel.h"
#include "compat_misc.h"
#include "pcb-printf.h"
+#include "hid.h"
+#include <genht/hash.h>
/*#define HT_INVALID_VALUE ((pcb_propval_t){PCB_PROPT_invalid, {0}})*/
#define HT(x) htprop_ ## x
#include <genht/ht.c>
@@ -227,23 +230,23 @@ void propedit_ins_prop(pe_ctx_t *ctx, htsp_entry_t *pe)
pcb_props_t *p = pe->value;
pcb_propval_t common, min, max, avg;
- if (gui->propedit_add_prop != NULL)
- rowid = gui->propedit_add_prop(ctx, pe->key, 1, p->values.fill);
+ if (pcb_gui->propedit_add_prop != NULL)
+ rowid = pcb_gui->propedit_add_prop(ctx, pe->key, 1, p->values.fill);
- if (gui->propedit_add_stat != NULL) {
+ if (pcb_gui->propedit_add_stat != NULL) {
if (p->type == PCB_PROPT_STRING) {
pcb_props_stat(ctx->core_props, pe->key, &common, NULL, NULL, NULL);
- gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), NULL, NULL, NULL);
+ pcb_gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), NULL, NULL, NULL);
}
else {
pcb_props_stat(ctx->core_props, pe->key, &common, &min, &max, &avg);
- gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), propedit_sprint_val(p->type, min), propedit_sprint_val(p->type, max), propedit_sprint_val(p->type, avg));
+ pcb_gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), propedit_sprint_val(p->type, min), propedit_sprint_val(p->type, max), propedit_sprint_val(p->type, avg));
}
}
- if (gui->propedit_add_value != NULL)
+ if (pcb_gui->propedit_add_value != NULL)
for (e = htprop_first(&p->values); e; e = htprop_next(&p->values, e))
- gui->propedit_add_value(ctx, pe->key, rowid, propedit_sprint_val(p->type, e->key), e->value);
+ pcb_gui->propedit_add_value(ctx, pe->key, rowid, propedit_sprint_val(p->type, e->key), e->value);
}
diff --git a/src_plugins/propedit/props.h b/src_plugins/propedit/props.h
index 6fb3cec..f1040f9 100644
--- a/src_plugins/propedit/props.h
+++ b/src_plugins/propedit/props.h
@@ -30,7 +30,8 @@
- statistics of values of a property
*/
-#include "global.h"
+#include <limits.h>
+#include "global_typedefs.h"
#include <genht/htsp.h>
typedef enum {
@@ -44,8 +45,8 @@ typedef enum {
typedef union {
const char *string;
- Coord coord;
- Angle angle;
+ pcb_coord_t coord;
+ pcb_angle_t angle;
int i;
} pcb_propval_t;
diff --git a/src_plugins/propedit/propsel.c b/src_plugins/propedit/propsel.c
index b32ab8b..87f4bd7 100644
--- a/src_plugins/propedit/propsel.c
+++ b/src_plugins/propedit/propsel.c
@@ -20,11 +20,13 @@
*
*/
+#include <ctype.h>
+#include "config.h"
+#include "const.h"
#include "data.h"
#include "props.h"
#include "propsel.h"
#include "change.h"
-#include "misc.h"
#include "misc_util.h"
#include "compat_misc.h"
#include "undo.h"
@@ -36,16 +38,16 @@ typedef struct {
} map_ctx_t;
#define map_chk_skip(ctx, obj) \
- if (!TEST_FLAG(PCB_FLAG_SELECTED, obj)) return;
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, obj)) return;
#define type2field_String string
-#define type2field_Coord coord
-#define type2field_Angle angle
+#define type2field_pcb_coord_t coord
+#define type2field_pcb_angle_t angle
#define type2field_int i
#define type2TYPE_String PCB_PROPT_STRING
-#define type2TYPE_Coord PCB_PROPT_COORD
-#define type2TYPE_Angle PCB_PROPT_ANGLE
+#define type2TYPE_pcb_coord_t PCB_PROPT_COORD
+#define type2TYPE_pcb_angle_t PCB_PROPT_ANGLE
#define type2TYPE_int PCB_PROPT_INT
#define map_add_prop(ctx, name, type, val) \
@@ -55,7 +57,7 @@ do { \
pcb_props_add(((map_ctx_t *)ctx)->props, name, type2TYPE_ ## type, v); \
} while(0)
-static void map_attr(void *ctx, const AttributeListType *list)
+static void map_attr(void *ctx, const pcb_attribute_list_t *list)
{
int i, bl = 0;
char small[256];
@@ -87,27 +89,27 @@ static void map_attr(void *ctx, const AttributeListType *list)
free(big);
}
-static void map_line_cb(void *ctx, PCBType *pcb, LayerType *layer, LineType *line)
+static void map_line_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line)
{
map_chk_skip(ctx, line);
- map_add_prop(ctx, "p/trace/thickness", Coord, line->Thickness);
- map_add_prop(ctx, "p/trace/clearance", Coord, line->Clearance);
+ map_add_prop(ctx, "p/trace/thickness", pcb_coord_t, line->Thickness);
+ map_add_prop(ctx, "p/trace/clearance", pcb_coord_t, line->Clearance);
map_attr(ctx, &line->Attributes);
}
-static void map_arc_cb(void *ctx, PCBType *pcb, LayerType *layer, ArcType *arc)
+static void map_arc_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc)
{
map_chk_skip(ctx, arc);
- map_add_prop(ctx, "p/trace/thickness", Coord, arc->Thickness);
- map_add_prop(ctx, "p/trace/clearance", Coord, arc->Clearance);
- map_add_prop(ctx, "p/arc/width", Coord, arc->Width);
- map_add_prop(ctx, "p/arc/height", Coord, arc->Height);
- map_add_prop(ctx, "p/arc/angle/start", Angle, arc->StartAngle);
- map_add_prop(ctx, "p/arc/angle/delta", Angle, arc->Delta);
+ map_add_prop(ctx, "p/trace/thickness", pcb_coord_t, arc->Thickness);
+ map_add_prop(ctx, "p/trace/clearance", pcb_coord_t, arc->Clearance);
+ map_add_prop(ctx, "p/arc/width", pcb_coord_t, arc->Width);
+ map_add_prop(ctx, "p/arc/height", pcb_coord_t, arc->Height);
+ map_add_prop(ctx, "p/arc/angle/start", pcb_angle_t, arc->StartAngle);
+ map_add_prop(ctx, "p/arc/angle/delta", pcb_angle_t, arc->Delta);
map_attr(ctx, &arc->Attributes);
}
-static void map_text_cb(void *ctx, PCBType *pcb, LayerType *layer, TextType *text)
+static void map_text_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_text_t *text)
{
map_chk_skip(ctx, text);
map_add_prop(ctx, "p/text/scale", int, text->Scale);
@@ -116,59 +118,59 @@ static void map_text_cb(void *ctx, PCBType *pcb, LayerType *layer, TextType *tex
map_attr(ctx, &text->Attributes);
}
-static void map_poly_cb(void *ctx, PCBType *pcb, LayerType *layer, PolygonType *poly)
+static void map_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly)
{
map_chk_skip(ctx, poly);
map_attr(ctx, &poly->Attributes);
}
-static void map_eline_cb(void *ctx, PCBType *pcb, ElementType *element, LineType *line)
+static void map_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line)
{
map_chk_skip(ctx, line);
map_line_cb(ctx, pcb, NULL, line);
map_attr(ctx, &line->Attributes);
}
-static void map_earc_cb(void *ctx, PCBType *pcb, ElementType *element, ArcType *arc)
+static void map_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc)
{
map_chk_skip(ctx, arc);
map_arc_cb(ctx, pcb, NULL, arc);
map_attr(ctx, &arc->Attributes);
}
-static void map_etext_cb(void *ctx, PCBType *pcb, ElementType *element, TextType *text)
+static void map_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_text_t *text)
{
map_chk_skip(ctx, text);
map_text_cb(ctx, pcb, NULL, text);
map_attr(ctx, &text->Attributes);
}
-static void map_epin_cb(void *ctx, PCBType *pcb, ElementType *element, PinType *pin)
+static void map_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin)
{
map_chk_skip(ctx, pin);
- map_add_prop(ctx, "p/pin/thickness", Coord, pin->Thickness);
- map_add_prop(ctx, "p/pin/clearance", Coord, pin->Clearance);
- map_add_prop(ctx, "p/pin/mask", Coord, pin->Mask);
- map_add_prop(ctx, "p/pin/hole", Coord, pin->DrillingHole);
+ map_add_prop(ctx, "p/pin/thickness", pcb_coord_t, pin->Thickness);
+ map_add_prop(ctx, "p/pin/clearance", pcb_coord_t, pin->Clearance);
+ map_add_prop(ctx, "p/pin/mask", pcb_coord_t, pin->Mask);
+ map_add_prop(ctx, "p/pin/hole", pcb_coord_t, pin->DrillingHole);
map_attr(ctx, &pin->Attributes);
}
-static void map_epad_cb(void *ctx, PCBType *pcb, ElementType *element, PadType *pad)
+static void map_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad)
{
map_chk_skip(ctx, pad);
- map_add_prop(ctx, "p/pad/mask", Coord, pad->Mask);
+ map_add_prop(ctx, "p/pad/mask", pcb_coord_t, pad->Mask);
map_attr(ctx, &pad->Attributes);
}
-static void map_via_cb(void *ctx, PCBType *pcb, PinType *via)
+static void map_via_cb(void *ctx, pcb_board_t *pcb, pcb_pin_t *via)
{
map_chk_skip(ctx, via);
- map_add_prop(ctx, "p/via/thickness", Coord, via->Thickness);
- map_add_prop(ctx, "p/via/clearance", Coord, via->Clearance);
- map_add_prop(ctx, "p/via/mask", Coord, via->Mask);
- map_add_prop(ctx, "p/via/hole", Coord, via->DrillingHole);
+ map_add_prop(ctx, "p/via/thickness", pcb_coord_t, via->Thickness);
+ map_add_prop(ctx, "p/via/clearance", pcb_coord_t, via->Clearance);
+ map_add_prop(ctx, "p/via/mask", pcb_coord_t, via->Mask);
+ map_add_prop(ctx, "p/via/hole", pcb_coord_t, via->DrillingHole);
map_attr(ctx, &via->Attributes);
}
@@ -190,31 +192,31 @@ void pcb_propsel_map_core(htsp_t *props)
typedef struct set_ctx_s {
const char *name;
const char *value;
- Coord c;
+ pcb_coord_t c;
double d;
pcb_bool c_absolute, d_absolute, c_valid, d_valid, is_trace, is_attr;
int set_cnt;
} set_ctx_t;
-static void set_attr(set_ctx_t *st, AttributeListType *list)
+static void set_attr(set_ctx_t *st, pcb_attribute_list_t *list)
{
const char *key = st->name+2;
- const char *orig = AttributeGetFromList(list, key);
+ const char *orig = pcb_attribute_get(list, key);
if ((orig != NULL) && (strcmp(orig, st->value) == 0))
return;
- AttributePutToList(list, key, st->value, 1);
+ pcb_attribute_put(list, key, st->value, 1);
st->set_cnt++;
}
#define set_chk_skip(ctx, obj) \
- if (!TEST_FLAG(PCB_FLAG_SELECTED, obj)) return;
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, obj)) return;
-#define DONE { st->set_cnt++; RestoreUndoSerialNumber(); return; }
+#define DONE { st->set_cnt++; pcb_undo_restore_serial(); return; }
-static void set_line_cb(void *ctx, PCBType *pcb, LayerType *layer, LineType *line)
+static void set_line_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line)
{
set_ctx_t *st = (set_ctx_t *)ctx;
const char *pn = st->name + 8;
@@ -227,13 +229,13 @@ static void set_line_cb(void *ctx, PCBType *pcb, LayerType *layer, LineType *lin
}
if (st->is_trace && st->c_valid && (strcmp(pn, "thickness") == 0) &&
- ChangeObject1stSize(PCB_TYPE_LINE, layer, line, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_1st_size(PCB_TYPE_LINE, layer, line, NULL, st->c, st->c_absolute)) DONE;
if (st->is_trace && st->c_valid && (strcmp(pn, "clearance") == 0) &&
- ChangeObjectClearSize(PCB_TYPE_LINE, layer, line, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_clear_size(PCB_TYPE_LINE, layer, line, NULL, st->c, st->c_absolute)) DONE;
}
-static void set_arc_cb(void *ctx, PCBType *pcb, LayerType *layer, ArcType *arc)
+static void set_arc_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc)
{
set_ctx_t *st = (set_ctx_t *)ctx;
const char *pn = st->name + 8;
@@ -246,27 +248,27 @@ static void set_arc_cb(void *ctx, PCBType *pcb, LayerType *layer, ArcType *arc)
}
if (st->is_trace && st->c_valid && (strcmp(pn, "thickness") == 0) &&
- ChangeObject1stSize(PCB_TYPE_ARC, layer, arc, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_1st_size(PCB_TYPE_ARC, layer, arc, NULL, st->c, st->c_absolute)) DONE;
if (st->is_trace && st->c_valid && (strcmp(pn, "clearance") == 0) &&
- ChangeObjectClearSize(PCB_TYPE_ARC, layer, arc, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_clear_size(PCB_TYPE_ARC, layer, arc, NULL, st->c, st->c_absolute)) DONE;
pn = st->name + 6;
if (!st->is_trace && st->c_valid && (strcmp(pn, "width") == 0) &&
- ChangeObjectRadius(PCB_TYPE_ARC, layer, arc, NULL, 0, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_radius(PCB_TYPE_ARC, layer, arc, NULL, 0, st->c, st->c_absolute)) DONE;
if (!st->is_trace && st->c_valid && (strcmp(pn, "height") == 0) &&
- ChangeObjectRadius(PCB_TYPE_ARC, layer, arc, NULL, 1, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_radius(PCB_TYPE_ARC, layer, arc, NULL, 1, st->c, st->c_absolute)) DONE;
if (!st->is_trace && st->d_valid && (strcmp(pn, "angle/start") == 0) &&
- ChangeObjectAngle(PCB_TYPE_ARC, layer, arc, NULL, 0, st->d, st->d_absolute)) DONE;
+ pcb_chg_obj_angle(PCB_TYPE_ARC, layer, arc, NULL, 0, st->d, st->d_absolute)) DONE;
if (!st->is_trace && st->d_valid && (strcmp(pn, "angle/delta") == 0) &&
- ChangeObjectAngle(PCB_TYPE_ARC, layer, arc, NULL, 1, st->d, st->d_absolute)) DONE;
+ pcb_chg_obj_angle(PCB_TYPE_ARC, layer, arc, NULL, 1, st->d, st->d_absolute)) DONE;
}
-static void set_text_cb_any(void *ctx, PCBType *pcb, int type, void *layer_or_element, TextType *text)
+static void set_text_cb_any(void *ctx, pcb_board_t *pcb, int type, void *layer_or_element, pcb_text_t *text)
{
set_ctx_t *st = (set_ctx_t *)ctx;
const char *pn = st->name + 7;
@@ -280,10 +282,10 @@ static void set_text_cb_any(void *ctx, PCBType *pcb, int type, void *layer_or_el
}
if (st->d_valid && (strcmp(pn, "scale") == 0) &&
- ChangeObjectSize(type, layer_or_element, text, text, PCB_MIL_TO_COORD(st->d), st->d_absolute)) DONE;
+ pcb_chg_obj_size(type, layer_or_element, text, text, PCB_MIL_TO_COORD(st->d), st->d_absolute)) DONE;
if ((strcmp(pn, "string") == 0) &&
- (old = ChangeObjectName(type, layer_or_element, text, NULL, pcb_strdup(st->value)))) {
+ (old = pcb_chg_obj_name(type, layer_or_element, text, NULL, pcb_strdup(st->value)))) {
free(old);
DONE;
}
@@ -298,18 +300,18 @@ static void set_text_cb_any(void *ctx, PCBType *pcb, int type, void *layer_or_el
}
else
delta = st->d;
- if (RotateObject(type, layer_or_element, text, text, text->X, text->Y, delta) != NULL)
+ if (pcb_obj_rotate90(type, layer_or_element, text, text, text->X, text->Y, delta) != NULL)
DONE;
}
}
-static void set_text_cb(void *ctx, PCBType *pcb, LayerType *layer, TextType *text)
+static void set_text_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_text_t *text)
{
set_text_cb_any(ctx, pcb, PCB_TYPE_TEXT, layer, text);
}
-static void set_poly_cb(void *ctx, PCBType *pcb, LayerType *layer, PolygonType *poly)
+static void set_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly)
{
set_ctx_t *st = (set_ctx_t *)ctx;
@@ -321,7 +323,7 @@ static void set_poly_cb(void *ctx, PCBType *pcb, LayerType *layer, PolygonType *
}
}
-static void set_eline_cb(void *ctx, PCBType *pcb, ElementType *element, LineType *line)
+static void set_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line)
{
set_ctx_t *st = (set_ctx_t *)ctx;
@@ -333,7 +335,7 @@ static void set_eline_cb(void *ctx, PCBType *pcb, ElementType *element, LineType
}
}
-static void set_earc_cb(void *ctx, PCBType *pcb, ElementType *element, ArcType *arc)
+static void set_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc)
{
set_ctx_t *st = (set_ctx_t *)ctx;
@@ -345,12 +347,12 @@ static void set_earc_cb(void *ctx, PCBType *pcb, ElementType *element, ArcType *
}
}
-static void set_etext_cb(void *ctx, PCBType *pcb, ElementType *element, TextType *text)
+static void set_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_text_t *text)
{
set_text_cb_any(ctx, pcb, PCB_TYPE_ELEMENT_NAME, element, text);
}
-static void set_epin_cb(void *ctx, PCBType *pcb, ElementType *element, PinType *pin)
+static void set_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin)
{
set_ctx_t *st = (set_ctx_t *)ctx;
const char *pn = st->name + 6;
@@ -363,19 +365,19 @@ static void set_epin_cb(void *ctx, PCBType *pcb, ElementType *element, PinType *
}
if (st->c_valid && (strcmp(pn, "thickness") == 0) &&
- ChangeObject1stSize(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_1st_size(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute)) DONE;
if (st->c_valid && (strcmp(pn, "clearance") == 0) &&
- ChangeObjectClearSize(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_clear_size(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute)) DONE;
if (st->c_valid && (strcmp(pn, "mask") == 0) &&
- ChangeObjectMaskSize(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_mask_size(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute)) DONE;
if (st->c_valid && (strcmp(pn, "hole") == 0) &&
- ChangeObject2ndSize(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute, pcb_false)) DONE;
+ pcb_chg_obj_2nd_size(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute, pcb_false)) DONE;
}
-static void set_epad_cb(void *ctx, PCBType *pcb, ElementType *element, PadType *pad)
+static void set_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad)
{
set_ctx_t *st = (set_ctx_t *)ctx;
const char *pn = st->name + 6;
@@ -388,10 +390,10 @@ static void set_epad_cb(void *ctx, PCBType *pcb, ElementType *element, PadType *
}
if (st->c_valid && (strcmp(pn, "mask") == 0) &&
- ChangeObjectMaskSize(PCB_TYPE_PAD, pad->Element, pad, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_mask_size(PCB_TYPE_PAD, pad->Element, pad, NULL, st->c, st->c_absolute)) DONE;
}
-static void set_via_cb(void *ctx, PCBType *pcb, PinType *via)
+static void set_via_cb(void *ctx, pcb_board_t *pcb, pcb_pin_t *via)
{
set_ctx_t *st = (set_ctx_t *)ctx;
const char *pn = st->name + 6;
@@ -404,16 +406,16 @@ static void set_via_cb(void *ctx, PCBType *pcb, PinType *via)
}
if (st->c_valid && (strcmp(pn, "thickness") == 0) &&
- ChangeObject1stSize(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_1st_size(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute)) DONE;
if (st->c_valid && (strcmp(pn, "clearance") == 0) &&
- ChangeObjectClearSize(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_clear_size(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute)) DONE;
if (st->c_valid && (strcmp(pn, "mask") == 0) &&
- ChangeObjectMaskSize(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute)) DONE;
+ pcb_chg_obj_mask_size(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute)) DONE;
if (st->c_valid && (strcmp(pn, "hole") == 0) &&
- ChangeObject2ndSize(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute, pcb_false)) DONE;
+ pcb_chg_obj_2nd_size(PCB_TYPE_VIA, via, via, NULL, st->c, st->c_absolute, pcb_false)) DONE;
}
/* use the callback if trc is true or prop matches a prefix or we are setting attributes, else NULL */
@@ -439,7 +441,7 @@ int pcb_propsel_set(const char *prop, const char *value)
ctx.is_attr = (prop[0] == 'a');
ctx.name = prop;
ctx.value = value;
- ctx.c = GetValueEx(value, NULL, &ctx.c_absolute, NULL, NULL, &ctx.c_valid);
+ ctx.c = pcb_get_value_ex(value, NULL, &ctx.c_absolute, NULL, NULL, &ctx.c_valid);
ctx.d = strtod(value, &end);
ctx.d_valid = (*end == '\0');
start = value;
@@ -447,7 +449,7 @@ int pcb_propsel_set(const char *prop, const char *value)
ctx.d_absolute = ((*start != '-') && (*start != '+'));
ctx.set_cnt = 0;
- SaveUndoSerialNumber();
+ pcb_undo_save_serial();
pcb_loop_all(&ctx,
NULL,
@@ -463,7 +465,7 @@ int pcb_propsel_set(const char *prop, const char *value)
MAYBE_PROP(0, "p/pad/", set_epad_cb),
MAYBE_PROP(0, "p/via/", set_via_cb)
);
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return ctx.set_cnt;
}
@@ -477,68 +479,68 @@ typedef struct del_ctx_s {
int del_cnt;
} del_ctx_t;
-static void del_attr(void *ctx, AttributeListType *list)
+static void del_attr(void *ctx, pcb_attribute_list_t *list)
{
del_ctx_t *st = (del_ctx_t *)ctx;
- if (AttributeRemoveFromList(list, st->key+2))
+ if (pcb_attribute_remove(list, st->key+2))
st->del_cnt++;
}
-static void del_line_cb(void *ctx, PCBType *pcb, LayerType *layer, LineType *line)
+static void del_line_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line)
{
map_chk_skip(ctx, line);
del_attr(ctx, &line->Attributes);
}
-static void del_arc_cb(void *ctx, PCBType *pcb, LayerType *layer, ArcType *arc)
+static void del_arc_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc)
{
map_chk_skip(ctx, arc);
del_attr(ctx, &arc->Attributes);
}
-static void del_text_cb(void *ctx, PCBType *pcb, LayerType *layer, TextType *text)
+static void del_text_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_text_t *text)
{
map_chk_skip(ctx, text);
del_attr(ctx, &text->Attributes);
}
-static void del_poly_cb(void *ctx, PCBType *pcb, LayerType *layer, PolygonType *poly)
+static void del_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly)
{
map_chk_skip(ctx, poly);
del_attr(ctx, &poly->Attributes);
}
-static void del_eline_cb(void *ctx, PCBType *pcb, ElementType *element, LineType *line)
+static void del_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line)
{
map_chk_skip(ctx, line);
del_attr(ctx, &line->Attributes);
}
-static void del_earc_cb(void *ctx, PCBType *pcb, ElementType *element, ArcType *arc)
+static void del_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc)
{
map_chk_skip(ctx, arc);
del_attr(ctx, &arc->Attributes);
}
-static void del_etext_cb(void *ctx, PCBType *pcb, ElementType *element, TextType *text)
+static void del_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_text_t *text)
{
map_chk_skip(ctx, text);
del_attr(ctx, &text->Attributes);
}
-static void del_epin_cb(void *ctx, PCBType *pcb, ElementType *element, PinType *pin)
+static void del_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin)
{
map_chk_skip(ctx, pin);
del_attr(ctx, &pin->Attributes);
}
-static void del_epad_cb(void *ctx, PCBType *pcb, ElementType *element, PadType *pad)
+static void del_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad)
{
map_chk_skip(ctx, pad);
del_attr(ctx, &pad->Attributes);
}
-static void del_via_cb(void *ctx, PCBType *pcb, PinType *via)
+static void del_via_cb(void *ctx, pcb_board_t *pcb, pcb_pin_t *via)
{
map_chk_skip(ctx, via);
del_attr(ctx, &via->Attributes);
diff --git a/src_plugins/puller/Makefile b/src_plugins/puller/Makefile
index e389405..efa23f8 100644
--- a/src_plugins/puller/Makefile
+++ b/src_plugins/puller/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_puller
+ cd ../../src && $(MAKE) mod_puller
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/puller/puller.c b/src_plugins/puller/puller.c
index 7ba0ab2..bd64ccf 100644
--- a/src_plugins/puller/puller.c
+++ b/src_plugins/puller/puller.c
@@ -47,28 +47,27 @@
#include "config.h"
#include "conf_core.h"
-#include "global.h"
-
#include <math.h>
#include <memory.h>
#include <limits.h>
#include <setjmp.h>
#include <glib.h>
-#include "create.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
-#include "misc.h"
#include "move.h"
#include "pcb-printf.h"
#include "remove.h"
#include "rtree.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "undo.h"
#include "layer.h"
#include "plugins.h"
#include "hid_actions.h"
#include "misc_util.h"
+#include "obj_all.h"
+#include "compat_misc.h"
#define abort1() fprintf(stderr, "abort at line %d\n", __LINE__), abort()
@@ -83,8 +82,8 @@ static jmp_buf abort_buf;
#define sqr(x) (1.0*(x)*(x))
static int multi, line_exact, arc_exact;
-static LineTypePtr the_line;
-static ArcTypePtr the_arc;
+static pcb_line_t *the_line;
+static pcb_arc_t *the_arc;
static double arc_dist;
/* We canonicalize the arc and line such that the point to be moved is
@@ -98,10 +97,10 @@ static int ex, ey; /* fixed end of the line */
static int within(int x1, int y1, int x2, int y2, int r)
{
- return Distance(x1, y1, x2, y2) <= r / 2;
+ return pcb_distance(x1, y1, x2, y2) <= r / 2;
}
-static int arc_endpoint_is(ArcTypePtr a, int angle, int x, int y)
+static int arc_endpoint_is(pcb_arc_t *a, int angle, int x, int y)
{
int ax = a->X, ay = a->Y;
@@ -130,7 +129,7 @@ static int arc_endpoint_is(ArcTypePtr a, int angle, int x, int y)
#if TRACE1
pcb_printf(" - arc endpoint %#mD\n", ax, ay);
#endif
- arc_dist = Distance(ax, ay, x, y);
+ arc_dist = pcb_distance(ax, ay, x, y);
if (arc_exact)
return arc_dist < 2;
return arc_dist < a->Thickness / 2;
@@ -246,7 +245,7 @@ static int intersection_of_linesegs(int x1, int y1, int x2, int y2, int x3, int
/* distance between a line and a point */
static double dist_lp(int x1, int y1, int x2, int y2, int px, int py)
{
- double den = Distance(x1, y1, x2, y2);
+ double den = pcb_distance(x1, y1, x2, y2);
double rv = (fabs(((double) x2 - x1) * ((double) y1 - py)
- ((double) x1 - px) * ((double) y2 - y1))
/ den);
@@ -261,31 +260,31 @@ static double dist_lsp(int x1, int y1, int x2, int y2, int px, int py)
{
double d;
if (dot2d(x1, y1, x2, y2, px, py) < 0)
- return Distance(x1, y1, px, py);
+ return pcb_distance(x1, y1, px, py);
if (dot2d(x2, y2, x1, y1, px, py) < 0)
- return Distance(x2, y2, px, py);
+ return pcb_distance(x2, y2, px, py);
d = (fabs(((double) x2 - x1) * ((double) y1 - py)
- ((double) x1 - px) * ((double) y2 - y1))
- / Distance(x1, y1, x2, y2));
+ / pcb_distance(x1, y1, x2, y2));
return d;
}
/*****************************************************************************/
/* */
-/* Single Point Puller */
+/* Single Point pcb_act_Puller */
/* */
/*****************************************************************************/
-static r_dir_t line_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t line_callback(const pcb_box_t * b, void *cl)
{
- /* LayerTypePtr layer = (LayerTypePtr)cl; */
- LineTypePtr l = (LineTypePtr) b;
+ /* pcb_layer_t *layer = (pcb_layer_t *)cl; */
+ pcb_line_t *l = (pcb_line_t *) b;
double d1, d2, t;
#if TRACE1
pcb_printf("line %#mD .. %#mD\n", l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y);
#endif
- d1 = Distance(l->Point1.X, l->Point1.Y, x, y);
- d2 = Distance(l->Point2.X, l->Point2.Y, x, y);
+ d1 = pcb_distance(l->Point1.X, l->Point1.Y, x, y);
+ d2 = pcb_distance(l->Point2.X, l->Point2.Y, x, y);
if ((d1 < 2 || d2 < 2) && !line_exact) {
line_exact = 1;
the_line = 0;
@@ -299,13 +298,13 @@ static r_dir_t line_callback(const BoxType * b, void *cl)
printf("picked, exact %d\n", line_exact);
#endif
}
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
-static r_dir_t arc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t arc_callback(const pcb_box_t * b, void *cl)
{
- /* LayerTypePtr layer = (LayerTypePtr) cl; */
- ArcTypePtr a = (ArcTypePtr) b;
+ /* pcb_layer_t *layer = (pcb_layer_t *) cl; */
+ pcb_arc_t *a = (pcb_arc_t *) b;
#if TRACE1
pcb_printf("arc a %#mD r %#mS sa %ld d %ld\n", a->X, a->Y, a->Width, a->StartAngle, a->Delta);
@@ -333,15 +332,15 @@ static r_dir_t arc_callback(const BoxType * b, void *cl)
printf("picked, exact %d\n", arc_exact);
#endif
}
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
static int find_pair(int Px, int Py)
{
- BoxType spot;
+ pcb_box_t spot;
#if TRACE1
- pcb_printf("\nPuller find_pair at %#mD\n", Crosshair.X, Crosshair.Y);
+ pcb_printf("\nPuller find_pair at %#mD\n", pcb_crosshair.X, pcb_crosshair.Y);
#endif
x = Px;
@@ -354,8 +353,8 @@ static int find_pair(int Px, int Py)
spot.Y1 = y - 1;
spot.X2 = x + 1;
spot.Y2 = y + 1;
- r_search(CURRENT->line_tree, &spot, NULL, line_callback, CURRENT, NULL);
- r_search(CURRENT->arc_tree, &spot, NULL, arc_callback, CURRENT, NULL);
+ pcb_r_search(CURRENT->line_tree, &spot, NULL, line_callback, CURRENT, NULL);
+ pcb_r_search(CURRENT->arc_tree, &spot, NULL, arc_callback, CURRENT, NULL);
if (the_line && the_arc && !multi)
return 1;
x = Px;
@@ -364,13 +363,13 @@ static int find_pair(int Px, int Py)
}
-static const char puller_syntax[] = "Puller()";
+static const char pcb_acts_Puller[] = "pcb_act_Puller()";
-static const char puller_help[] = "Pull an arc-line junction tight.";
+static const char pcb_acth_Puller[] = "Pull an arc-line junction tight.";
-/* %start-doc actions Puller
+/* %start-doc actions pcb_act_Puller
-The @code{Puller()} action is a special-purpose optimization. When
+The @code{pcb_act_Puller()} action is a special-purpose optimization. When
invoked while the crosshair is over the junction of an arc and a line,
it will adjust the arc's angle and the connecting line's endpoint such
that the line intersects the arc at a tangent. In the example below,
@@ -384,7 +383,7 @@ arc-line intersection was moved to.
%end-doc */
-static int Puller(int argc, const char **argv, Coord Ux, Coord Uy)
+static int pcb_act_Puller(int argc, const char **argv, pcb_coord_t Ux, pcb_coord_t Uy)
{
double arc_angle, base_angle;
#if TRACE1
@@ -393,7 +392,7 @@ static int Puller(int argc, const char **argv, Coord Ux, Coord Uy)
double tangent;
int new_delta_angle;
- if (!find_pair(Crosshair.X, Crosshair.Y))
+ if (!find_pair(pcb_crosshair.X, pcb_crosshair.Y))
if (!find_pair(Ux, Uy))
return 0;
@@ -417,7 +416,7 @@ static int Puller(int argc, const char **argv, Coord Ux, Coord Uy)
cx = the_arc->X;
cy = the_arc->Y;
if (arc_endpoint_is(the_arc, the_arc->StartAngle, x, y)) {
- ChangeArcAngles(CURRENT, the_arc, the_arc->StartAngle + the_arc->Delta, -the_arc->Delta);
+ pcb_arc_set_angles(CURRENT, the_arc, the_arc->StartAngle + the_arc->Delta, -the_arc->Delta);
}
else if (!arc_endpoint_is(the_arc, the_arc->StartAngle + the_arc->Delta, x, y)) {
#if TRACE1
@@ -439,7 +438,7 @@ static int Puller(int argc, const char **argv, Coord Ux, Coord Uy)
arc_angle = the_arc->StartAngle + the_arc->Delta - 90;
base_angle = r2d(atan2(ey - cy, cx - ex));
- tangent = r2d(acos(the_arc->Width / Distance(cx, cy, ex, ey)));
+ tangent = r2d(acos(the_arc->Width / pcb_distance(cx, cy, ex, ey)));
#if TRACE1
line_angle = r2d(atan2(ey - y, x - ex));
@@ -463,7 +462,7 @@ static int Puller(int argc, const char **argv, Coord Ux, Coord Uy)
new_delta_angle -= 360;
if (new_delta_angle < -180)
new_delta_angle += 360;
- ChangeArcAngles(CURRENT, the_arc, the_arc->StartAngle, new_delta_angle);
+ pcb_arc_set_angles(CURRENT, the_arc, the_arc->StartAngle, new_delta_angle);
#if TRACE1
printf("arc now start %ld end %ld\n", the_arc->StartAngle, the_arc->StartAngle + new_delta_angle);
@@ -473,25 +472,25 @@ static int Puller(int argc, const char **argv, Coord Ux, Coord Uy)
x = the_arc->X - the_arc->Width * cos(d2r(arc_angle)) + 0.5;
y = the_arc->Y + the_arc->Height * sin(d2r(arc_angle)) + 0.5;
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, the_line, &(the_line->Point2), x - the_line->Point2.X, y - the_line->Point2.Y);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, the_line, &(the_line->Point2), x - the_line->Point2.X, y - the_line->Point2.Y);
- gui->invalidate_all();
- IncrementUndoSerialNumber();
+ pcb_gui->invalidate_all();
+ pcb_undo_inc_serial();
return 1;
}
/*****************************************************************************/
/* */
-/* Global Puller */
+/* Global pcb_act_Puller */
/* */
/*****************************************************************************/
-static const char globalpuller_syntax[] = "GlobalPuller()";
+static const char pcb_acts_GlobalPuller[] = "pcb_act_GlobalPuller()";
-static const char globalpuller_help[] = "Pull all traces tight.";
+static const char pcb_acth_GlobalPuller[] = "Pull all traces tight.";
-/* %start-doc actions GlobalPuller
+/* %start-doc actions pcb_act_GlobalPuller
%end-doc */
@@ -564,8 +563,8 @@ typedef struct Extra {
unsigned deleted:1;
int type;
union {
- LineType *line;
- ArcType *arc;
+ pcb_line_t *line;
+ pcb_arc_t *arc;
} parent;
} Extra;
@@ -581,7 +580,7 @@ static int current_is_component, current_is_solder;
#if TRACE1
static void trace_paths();
#endif
-static void mark_line_for_deletion(LineTypePtr);
+static void mark_line_for_deletion(pcb_line_t *);
#define LINE2EXTRA(l) ((Extra *)g_hash_table_lookup (lines, l))
#define ARC2EXTRA(a) ((Extra *)g_hash_table_lookup (arcs, a))
@@ -614,7 +613,7 @@ static void unlink_end(Extra * x, Extra ** e)
#if TRACE1
-static void clear_found_cb(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void clear_found_cb(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
extra->found = 0;
}
@@ -626,7 +625,7 @@ static void clear_found()
}
#endif
-static void fix_arc_extra(ArcTypePtr a, Extra * e)
+static void fix_arc_extra(pcb_arc_t *a, Extra * e)
{
#if TRACE1
printf("new arc angles %ld %ld\n", a->StartAngle, a->Delta);
@@ -649,16 +648,16 @@ typedef struct {
#define NEAR(a,b) ((a) <= (b) + 2 && (a) >= (b) - 2)
-static r_dir_t find_pair_line_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t find_pair_line_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
+ pcb_line_t *line = (pcb_line_t *) b;
#if TRACE1
Extra *e = LINE2EXTRA(line);
#endif
FindPairCallbackStruct *fpcs = (FindPairCallbackStruct *) cl;
if (line == fpcs->me)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
#ifdef CHECK_LINE_PT_NEG
if (line->Point1.X < 0)
abort1();
@@ -681,17 +680,17 @@ static r_dir_t find_pair_line_callback(const BoxType * b, void *cl)
#endif
}
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t find_pair_arc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t find_pair_arc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
Extra *e = ARC2EXTRA(arc);
FindPairCallbackStruct *fpcs = (FindPairCallbackStruct *) cl;
if (arc == fpcs->me)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
#if TRACE1
pcb_printf(" - %p arc %#mD or %#mD\n", (void *)e, e->start.x, e->start.y, e->end.x, e->end.y);
#endif
@@ -706,13 +705,13 @@ static r_dir_t find_pair_arc_callback(const BoxType * b, void *cl)
else
*fpcs->extra_ptr = e;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
static void find_pairs_1(void *me, Extra ** e, int x, int y)
{
FindPairCallbackStruct fpcs;
- BoxType b;
+ pcb_box_t b;
if (*e)
return;
@@ -728,18 +727,18 @@ static void find_pairs_1(void *me, Extra ** e, int x, int y)
b.X2 = x + 10;
b.Y1 = y - 10;
b.Y2 = y + 10;
- r_search(CURRENT->line_tree, &b, NULL, find_pair_line_callback, &fpcs, NULL);
- r_search(CURRENT->arc_tree, &b, NULL, find_pair_arc_callback, &fpcs, NULL);
+ pcb_r_search(CURRENT->line_tree, &b, NULL, find_pair_line_callback, &fpcs, NULL);
+ pcb_r_search(CURRENT->arc_tree, &b, NULL, find_pair_arc_callback, &fpcs, NULL);
}
-static int check_point_in_pin(PinTypePtr pin, int x, int y, End * e)
+static int check_point_in_pin(pcb_pin_t *pin, int x, int y, End * e)
{
int inside_p;
int t = (pin->Thickness + 1) / 2;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin))
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin))
inside_p = (x >= pin->X - t && x <= pin->X + t && y >= pin->Y - t && y <= pin->Y + t);
else
- inside_p = (Distance(pin->X, pin->Y, x, y) <= t);
+ inside_p = (pcb_distance(pin->X, pin->Y, x, y) <= t);
if (inside_p) {
e->in_pin = 1;
@@ -751,10 +750,10 @@ static int check_point_in_pin(PinTypePtr pin, int x, int y, End * e)
return 0;
}
-static r_dir_t find_pair_pinline_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t find_pair_pinline_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
- PinTypePtr pin = (PinTypePtr) cl;
+ pcb_line_t *line = (pcb_line_t *) b;
+ pcb_pin_t *pin = (pcb_pin_t *) cl;
Extra *e = LINE2EXTRA(line);
int hits;
@@ -767,7 +766,7 @@ static r_dir_t find_pair_pinline_callback(const BoxType * b, void *cl)
hits += check_point_in_pin(pin, line->Point2.X, line->Point2.Y, &(e->end));
if (hits)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
/* See if the line passes through this pin. */
/* FIXME: this assumes round pads, but it's good enough for square
@@ -780,22 +779,22 @@ static r_dir_t find_pair_pinline_callback(const BoxType * b, void *cl)
unlink_end(e, &e->start.next);
unlink_end(e, &e->end.next);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t find_pair_pinarc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t find_pair_pinarc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
- PinTypePtr pin = (PinTypePtr) cl;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
+ pcb_pin_t *pin = (pcb_pin_t *) cl;
Extra *e = ARC2EXTRA(arc);
int hits;
hits = check_point_in_pin(pin, e->start.x, e->start.y, &(e->start));
hits += check_point_in_pin(pin, e->end.x, e->end.y, &(e->end));
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t check_point_in_pad(PadTypePtr pad, int x, int y, End * e)
+static pcb_r_dir_t check_point_in_pad(pcb_pad_t *pad, int x, int y, End * e)
{
int inside_p;
int t;
@@ -803,7 +802,7 @@ static r_dir_t check_point_in_pad(PadTypePtr pad, int x, int y, End * e)
pcb_printf("pad %#mD - %#mD t %#mS vs %#mD\n", pad->Point1.X, pad->Point1.Y,
pad->Point2.X, pad->Point2.Y, pad->Thickness, x, y);
t = (pad->Thickness + 1) / 2;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) {
inside_p = (x >= MIN(pad->Point1.X - t, pad->Point2.X - t)
&& x <= MAX(pad->Point1.X + t, pad->Point2.X + t)
&& y >= MIN(pad->Point1.Y - t, pad->Point2.Y - t)
@@ -821,7 +820,7 @@ static r_dir_t check_point_in_pad(PadTypePtr pad, int x, int y, End * e)
&& y >= pad->Point1.Y - t && y <= pad->Point1.Y + t);
}
if (!inside_p) {
- if (Distance(pad->Point1.X, pad->Point1.Y, x, y) <= t || Distance(pad->Point2.X, pad->Point2.Y, x, y) <= t)
+ if (pcb_distance(pad->Point1.X, pad->Point1.Y, x, y) <= t || pcb_distance(pad->Point2.X, pad->Point2.Y, x, y) <= t)
inside_p = 1;
}
}
@@ -834,28 +833,28 @@ static r_dir_t check_point_in_pad(PadTypePtr pad, int x, int y, End * e)
e->at_pin = 1;
e->pin = pad;
e->is_pad = 1;
- return R_DIR_FOUND_CONTINUE;
+ return PCB_R_DIR_FOUND_CONTINUE;
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t find_pair_padline_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t find_pair_padline_callback(const pcb_box_t * b, void *cl)
{
- LineTypePtr line = (LineTypePtr) b;
- PadTypePtr pad = (PadTypePtr) cl;
+ pcb_line_t *line = (pcb_line_t *) b;
+ pcb_pad_t *pad = (pcb_pad_t *) cl;
Extra *e = LINE2EXTRA(line);
int hits;
double t;
int intersect;
double p1_d, p2_d;
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad)) {
if (!current_is_solder)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
else {
if (!current_is_component)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
#ifdef CHECK_LINE_PT_NEG
@@ -867,7 +866,7 @@ static r_dir_t find_pair_padline_callback(const BoxType * b, void *cl)
hits += check_point_in_pad(pad, line->Point2.X, line->Point2.Y, &(e->end));
if (hits)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
/* Ok, something strange. The line intersects our space, but
doesn't end in our space. See if it just passes through us, and
@@ -894,31 +893,31 @@ static r_dir_t find_pair_padline_callback(const BoxType * b, void *cl)
unlink_end(e, &e->end.next);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t find_pair_padarc_callback(const BoxType * b, void *cl)
+static pcb_r_dir_t find_pair_padarc_callback(const pcb_box_t * b, void *cl)
{
- ArcTypePtr arc = (ArcTypePtr) b;
- PadTypePtr pad = (PadTypePtr) cl;
+ pcb_arc_t *arc = (pcb_arc_t *) b;
+ pcb_pad_t *pad = (pcb_pad_t *) cl;
Extra *e = ARC2EXTRA(arc);
int hits;
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad)) {
if (!current_is_solder)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
else {
if (!current_is_component)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
hits = check_point_in_pad(pad, e->start.x, e->start.y, &(e->start));
hits += check_point_in_pad(pad, e->end.x, e->end.y, &(e->end));
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static void null_multi_next_ends(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void null_multi_next_ends(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
if (extra->start.next == &multi_next)
extra->start.next = NULL;
@@ -927,7 +926,7 @@ static void null_multi_next_ends(AnyObjectType * ptr, Extra * extra, void *userd
extra->end.next = NULL;
}
-static Extra *new_line_extra(LineType * line)
+static Extra *new_line_extra(pcb_line_t * line)
{
Extra *extra = g_slice_new0(Extra);
g_hash_table_insert(lines, line, extra);
@@ -936,7 +935,7 @@ static Extra *new_line_extra(LineType * line)
return extra;
}
-static Extra *new_arc_extra(ArcType * arc)
+static Extra *new_arc_extra(pcb_arc_t * arc)
{
Extra *extra = g_slice_new0(Extra);
g_hash_table_insert(arcs, arc, extra);
@@ -947,66 +946,66 @@ static Extra *new_arc_extra(ArcType * arc)
static void find_pairs()
{
- ARC_LOOP(CURRENT); {
+ PCB_ARC_LOOP(CURRENT); {
Extra *e = new_arc_extra(arc);
fix_arc_extra(arc, e);
- } END_LOOP;
+ } PCB_END_LOOP;
- LINE_LOOP(CURRENT); {
+ PCB_LINE_LOOP(CURRENT); {
new_line_extra(line);
- } END_LOOP;
+ } PCB_END_LOOP;
- LINE_LOOP(CURRENT); {
+ PCB_LINE_LOOP(CURRENT); {
Extra *e = LINE2EXTRA(line);
if (line->Point1.X >= 0) {
find_pairs_1(line, &e->start.next, line->Point1.X, line->Point1.Y);
find_pairs_1(line, &e->end.next, line->Point2.X, line->Point2.Y);
}
}
- END_LOOP;
+ PCB_END_LOOP;
- ARC_LOOP(CURRENT); {
+ PCB_ARC_LOOP(CURRENT); {
Extra *e = ARC2EXTRA(arc);
if (!e->deleted) {
find_pairs_1(arc, &e->start.next, e->start.x, e->start.y);
find_pairs_1(arc, &e->end.next, e->end.x, e->end.y);
}
}
- END_LOOP;
+ PCB_END_LOOP;
- ALLPIN_LOOP(PCB->Data); {
- BoxType box;
+ PCB_PIN_ALL_LOOP(PCB->Data); {
+ pcb_box_t box;
box.X1 = pin->X - pin->Thickness / 2;
box.Y1 = pin->Y - pin->Thickness / 2;
box.X2 = pin->X + pin->Thickness / 2;
box.Y2 = pin->Y + pin->Thickness / 2;
- r_search(CURRENT->line_tree, &box, NULL, find_pair_pinline_callback, pin, NULL);
- r_search(CURRENT->arc_tree, &box, NULL, find_pair_pinarc_callback, pin, NULL);
+ pcb_r_search(CURRENT->line_tree, &box, NULL, find_pair_pinline_callback, pin, NULL);
+ pcb_r_search(CURRENT->arc_tree, &box, NULL, find_pair_pinarc_callback, pin, NULL);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- VIA_LOOP(PCB->Data); {
- BoxType box;
+ PCB_VIA_LOOP(PCB->Data); {
+ pcb_box_t box;
box.X1 = via->X - via->Thickness / 2;
box.Y1 = via->Y - via->Thickness / 2;
box.X2 = via->X + via->Thickness / 2;
box.Y2 = via->Y + via->Thickness / 2;
- r_search(CURRENT->line_tree, &box, NULL, find_pair_pinline_callback, via, NULL);
- r_search(CURRENT->arc_tree, &box, NULL, find_pair_pinarc_callback, via, NULL);
+ pcb_r_search(CURRENT->line_tree, &box, NULL, find_pair_pinline_callback, via, NULL);
+ pcb_r_search(CURRENT->arc_tree, &box, NULL, find_pair_pinarc_callback, via, NULL);
}
- END_LOOP;
+ PCB_END_LOOP;
- ALLPAD_LOOP(PCB->Data); {
- BoxType box;
+ PCB_PAD_ALL_LOOP(PCB->Data); {
+ pcb_box_t box;
box.X1 = MIN(pad->Point1.X, pad->Point2.X) - pad->Thickness / 2;
box.Y1 = MIN(pad->Point1.Y, pad->Point2.Y) - pad->Thickness / 2;
box.X2 = MAX(pad->Point1.X, pad->Point2.X) + pad->Thickness / 2;
box.Y2 = MAX(pad->Point1.Y, pad->Point2.Y) + pad->Thickness / 2;
- r_search(CURRENT->line_tree, &box, NULL, find_pair_padline_callback, pad, NULL);
- r_search(CURRENT->arc_tree, &box, NULL, find_pair_padarc_callback, pad, NULL);
+ pcb_r_search(CURRENT->line_tree, &box, NULL, find_pair_padline_callback, pad, NULL);
+ pcb_r_search(CURRENT->arc_tree, &box, NULL, find_pair_padarc_callback, pad, NULL);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
g_hash_table_foreach(lines, (GHFunc) null_multi_next_ends, NULL);
g_hash_table_foreach(arcs, (GHFunc) null_multi_next_ends, NULL);
@@ -1046,11 +1045,11 @@ static void propogate_end_pin(Extra * e, End * near, End * far)
}
}
-static void propogate_end_step1_cb(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void propogate_end_step1_cb(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
if (extra->start.next != NULL && extra->start.next == extra->end.next) {
extra->end.next = NULL;
- mark_line_for_deletion((LineType *) ptr);
+ mark_line_for_deletion((pcb_line_t *) ptr);
}
if (extra->start.at_pin)
@@ -1060,7 +1059,7 @@ static void propogate_end_step1_cb(AnyObjectType * ptr, Extra * extra, void *use
propogate_ends_at(extra, &extra->end, &extra->start);
}
-static void propogate_end_step2_cb(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void propogate_end_step2_cb(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
if (extra->start.in_pin) {
#if TRACE1
@@ -1076,7 +1075,7 @@ static void propogate_end_step2_cb(AnyObjectType * ptr, Extra * extra, void *use
}
}
-static void propogate_end_step3_cb(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void propogate_end_step3_cb(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
if (extra->start.next)
propogate_end_pin(extra, &extra->end, &extra->start);
@@ -1125,12 +1124,12 @@ static void print_extra(Extra * e, Extra * prev)
e->end.in_pin ? "I" : "-", e->end.at_pin ? "A" : "-", e->end.is_pad ? "P" : "-", e->end.pending ? "p" : "-");
if (EXTRA_IS_LINE(e)) {
- LineTypePtr line = EXTRA2LINE(e);
+ pcb_line_t *line = EXTRA2LINE(e);
pcb_printf(" %p L %#mD-%#mD", (void *)line, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y);
printf(" %s %p %s %p\n", e->start.is_pad ? "pad" : "pin", (void *)e->start.pin, e->end.is_pad ? "pad" : "pin", (void *)e->end.pin);
}
else if (EXTRA_IS_ARC(e)) {
- ArcTypePtr arc = EXTRA2ARC(e);
+ pcb_arc_t *arc = EXTRA2ARC(e);
pcb_printf(" %p A %#mD-%#mD", (void *)arc, e->start.x, e->start.y, e->end.x, e->end.y);
pcb_printf(" at %#mD ang %ld,%ld\n", arc->X, arc->Y, arc->StartAngle, arc->Delta);
}
@@ -1172,18 +1171,18 @@ static void trace_paths()
Extra *e;
clear_found();
- LINE_LOOP(CURRENT); {
+ PCB_LINE_LOOP(CURRENT); {
e = LINE2EXTRA(line);
trace_path(e);
- } END_LOOP;
- ARC_LOOP(CURRENT); {
+ } PCB_END_LOOP;
+ PCB_ARC_LOOP(CURRENT); {
e = ARC2EXTRA(arc);
trace_path(e);
- } END_LOOP;
+ } PCB_END_LOOP;
}
#endif
-static void reverse_line(LineTypePtr line)
+static void reverse_line(pcb_line_t *line)
{
Extra *e = LINE2EXTRA(line);
int x, y;
@@ -1192,8 +1191,8 @@ static void reverse_line(LineTypePtr line)
x = line->Point1.X;
y = line->Point1.Y;
#if 1
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, line, &(line->Point1), line->Point2.X - line->Point1.X, line->Point2.Y - line->Point1.Y);
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, line, &(line->Point2), x - line->Point2.X, y - line->Point2.Y);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, line, &(line->Point1), line->Point2.X - line->Point1.X, line->Point2.Y - line->Point1.Y);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, line, &(line->Point2), x - line->Point2.X, y - line->Point2.Y);
#else
/* In theory, we should be using the above so that undo works. */
line->Point1.X = line->Point2.X;
@@ -1206,13 +1205,13 @@ static void reverse_line(LineTypePtr line)
memcpy(&e->end, &etmp, sizeof(End));
}
-static void reverse_arc(ArcTypePtr arc)
+static void reverse_arc(pcb_arc_t *arc)
{
Extra *e = ARC2EXTRA(arc);
End etmp;
#if 1
- ChangeArcAngles(CURRENT, arc, arc->StartAngle + arc->Delta, -arc->Delta);
+ pcb_arc_set_angles(CURRENT, arc, arc->StartAngle + arc->Delta, -arc->Delta);
#else
/* Likewise, see above. */
arc->StartAngle += arc->Delta;
@@ -1223,7 +1222,7 @@ static void reverse_arc(ArcTypePtr arc)
memcpy(&e->end, &etmp, sizeof(End));
}
-static void expand_box(BoxTypePtr b, int x, int y, int t)
+static void expand_box(pcb_box_t *b, int x, int y, int t)
{
b->X1 = MIN(b->X1, x - t);
b->X2 = MAX(b->X2, x + t);
@@ -1236,10 +1235,10 @@ static void expand_box(BoxTypePtr b, int x, int y, int t)
working on. */
/* what we're working with */
-static ArcTypePtr start_arc;
-static LineTypePtr start_line;
-static LineTypePtr end_line;
-static ArcTypePtr end_arc;
+static pcb_arc_t *start_arc;
+static pcb_line_t *start_line;
+static pcb_line_t *end_line;
+static pcb_arc_t *end_arc;
static Extra *start_extra, *end_extra;
static Extra *sarc_extra, *earc_extra;
static void *start_pinpad, *end_pinpad;
@@ -1293,7 +1292,7 @@ static int gp_point_force(int x, int y, int t, End * e, int esa, int eda, int fo
r = t + thickness;
/* See if the point is inside our start arc. */
- d = Distance(scx, scy, x, y);
+ d = pcb_distance(scx, scy, x, y);
#if TRACE1
pcb_printf("%f = dist #mD to %#mD\n", d, scx, scy, x, y);
pcb_printf("sr %#mS r %f d %f\n", sr, r, d);
@@ -1391,9 +1390,9 @@ static int gp_point_force(int x, int y, int t, End * e, int esa, int eda, int fo
printf("%f * %f < %f * %f ?\n", a, se_sign, best_angle, se_sign);
#endif
if (a * se_sign == best_angle * se_sign) {
- double old_d = Distance(start_line->Point1.X, start_line->Point1.Y,
+ double old_d = pcb_distance(start_line->Point1.X, start_line->Point1.Y,
fx, fy);
- double new_d = Distance(start_line->Point1.X, start_line->Point1.Y,
+ double new_d = pcb_distance(start_line->Point1.X, start_line->Point1.Y,
x, y);
if (new_d > old_d) {
best_angle = a;
@@ -1492,14 +1491,14 @@ static int gp_point_2(int x, int y, int t, End * e, int esa, int eda, const char
return gp_point_force(x, y, t, e, esa, eda, 0, func);
}
-static r_dir_t gp_line_cb(const BoxType * b, void *cb)
+static pcb_r_dir_t gp_line_cb(const pcb_box_t * b, void *cb)
{
- const LineTypePtr l = (LineTypePtr) b;
+ const pcb_line_t *l = (pcb_line_t *) b;
Extra *e = LINE2EXTRA(l);
if (l == start_line || l == end_line)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (e->deleted)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
#ifdef CHECK_LINE_PT_NEG
if (l->Point1.X < 0)
abort1();
@@ -1508,62 +1507,62 @@ static r_dir_t gp_line_cb(const BoxType * b, void *cb)
gp_point(l->Point1.X, l->Point1.Y, l->Thickness / 2, &e->start);
if (!e->end.next || !EXTRA_IS_ARC(e->end.next))
gp_point(l->Point2.X, l->Point2.Y, l->Thickness / 2, &e->end);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t gp_arc_cb(const BoxType * b, void *cb)
+static pcb_r_dir_t gp_arc_cb(const pcb_box_t * b, void *cb)
{
- const ArcTypePtr a = (ArcTypePtr) b;
+ const pcb_arc_t *a = (pcb_arc_t *) b;
Extra *e = ARC2EXTRA(a);
if (a == start_arc || a == end_arc)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (e->deleted)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
gp_point_2(a->X, a->Y, a->Width + a->Thickness / 2, 0, a->StartAngle, a->Delta, "gp_arc_cb");
if (start_arc && a->X == start_arc->X && a->Y == start_arc->Y)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (end_arc && a->X != end_arc->X && a->Y != end_arc->Y)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
if (e->start.next || e->end.next)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
gp_point(e->start.x, e->start.y, a->Thickness / 2, 0);
gp_point(e->end.x, e->end.y, a->Thickness / 2, 0);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t gp_text_cb(const BoxType * b, void *cb)
+static pcb_r_dir_t gp_text_cb(const pcb_box_t * b, void *cb)
{
- const TextTypePtr t = (TextTypePtr) b;
+ const pcb_text_t *t = (pcb_text_t *) b;
/* FIXME: drop in the actual text-line endpoints later. */
gp_point(t->BoundingBox.X1, t->BoundingBox.Y1, 0, 0);
gp_point(t->BoundingBox.X1, t->BoundingBox.Y2, 0, 0);
gp_point(t->BoundingBox.X2, t->BoundingBox.Y2, 0, 0);
gp_point(t->BoundingBox.X2, t->BoundingBox.Y1, 0, 0);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t gp_poly_cb(const BoxType * b, void *cb)
+static pcb_r_dir_t gp_poly_cb(const pcb_box_t * b, void *cb)
{
int i;
- const PolygonTypePtr p = (PolygonTypePtr) b;
+ const pcb_polygon_t *p = (pcb_polygon_t *) b;
for (i = 0; i < p->PointN; i++)
gp_point(p->Points[i].X, p->Points[i].Y, 0, 0);
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t gp_pin_cb(const BoxType * b, void *cb)
+static pcb_r_dir_t gp_pin_cb(const pcb_box_t * b, void *cb)
{
- const PinTypePtr p = (PinTypePtr) b;
+ const pcb_pin_t *p = (pcb_pin_t *) b;
int t2 = (p->Thickness + 1) / 2;
if (p == start_pinpad || p == end_pinpad)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
/* FIXME: we lump octagonal pins in with square; safe, but not
optimal. */
- if (TEST_FLAG(PCB_FLAG_SQUARE, p) || TEST_FLAG(PCB_FLAG_OCTAGON, p)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, p) || PCB_FLAG_TEST(PCB_FLAG_OCTAGON, p)) {
gp_point(p->X - t2, p->Y - t2, 0, 0);
gp_point(p->X - t2, p->Y + t2, 0, 0);
gp_point(p->X + t2, p->Y + t2, 0, 0);
@@ -1572,29 +1571,29 @@ static r_dir_t gp_pin_cb(const BoxType * b, void *cb)
else {
gp_point(p->X, p->Y, t2, 0);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static r_dir_t gp_pad_cb(const BoxType * b, void *cb)
+static pcb_r_dir_t gp_pad_cb(const pcb_box_t * b, void *cb)
{
- const PadTypePtr p = (PadTypePtr) b;
+ const pcb_pad_t *p = (pcb_pad_t *) b;
int t2 = (p->Thickness + 1) / 2;
if (p == start_pinpad || p == end_pinpad)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
- if (TEST_FLAG(PCB_FLAG_ONSOLDER, p)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, p)) {
if (!current_is_solder)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
else {
if (!current_is_component)
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
/* FIXME: we lump octagonal pads in with square; safe, but not
optimal. I don't think we even support octagonal pads. */
- if (TEST_FLAG(PCB_FLAG_SQUARE, p) || TEST_FLAG(PCB_FLAG_OCTAGON, p)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, p) || PCB_FLAG_TEST(PCB_FLAG_OCTAGON, p)) {
if (p->Point1.X == p->Point2.X) {
int y1 = MIN(p->Point1.Y, p->Point2.Y) - t2;
int y2 = MAX(p->Point1.Y, p->Point2.Y) + t2;
@@ -1618,18 +1617,18 @@ static r_dir_t gp_pad_cb(const BoxType * b, void *cb)
gp_point(p->Point1.X, p->Point1.Y, t2, 0);
gp_point(p->Point2.X, p->Point2.Y, t2, 0);
}
- return R_DIR_NOT_FOUND;
+ return PCB_R_DIR_NOT_FOUND;
}
-static LineTypePtr create_line(LineTypePtr sample, int x1, int y1, int x2, int y2)
+static pcb_line_t *create_line(pcb_line_t *sample, int x1, int y1, int x2, int y2)
{
#if TRACE1
Extra *e;
pcb_printf("create_line from %#mD to %#mD\n", x1, y1, x2, y2);
#endif
- LineTypePtr line = CreateNewLineOnLayer(CURRENT, x1, y1, x2, y2,
+ pcb_line_t *line = pcb_line_new(CURRENT, x1, y1, x2, y2,
sample->Thickness, sample->Clearance, sample->Flags);
- AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, line, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, CURRENT, line, line);
#if TRACE1
e =
@@ -1641,10 +1640,10 @@ static LineTypePtr create_line(LineTypePtr sample, int x1, int y1, int x2, int y
return line;
}
-static ArcTypePtr create_arc(LineTypePtr sample, int x, int y, int r, int sa, int da)
+static pcb_arc_t *create_arc(pcb_line_t *sample, int x, int y, int r, int sa, int da)
{
Extra *e;
- ArcTypePtr arc;
+ pcb_arc_t *arc;
if (r % 100 == 1)
r--;
@@ -1653,11 +1652,11 @@ static ArcTypePtr create_arc(LineTypePtr sample, int x, int y, int r, int sa, in
#if TRACE1
pcb_printf("create_arc at %#mD r %#mS sa %d delta %d\n", x, y, r, sa, da);
#endif
- arc = CreateNewArcOnLayer(CURRENT, x, y, r, r, sa, da, sample->Thickness, sample->Clearance, sample->Flags);
+ arc = pcb_arc_new(CURRENT, x, y, r, r, sa, da, sample->Thickness, sample->Clearance, sample->Flags);
if (arc == 0) {
- arc = CreateNewArcOnLayer(CURRENT, x, y, r, r, sa, da * 2, sample->Thickness, sample->Clearance, sample->Flags);
+ arc = pcb_arc_new(CURRENT, x, y, r, r, sa, da * 2, sample->Thickness, sample->Clearance, sample->Flags);
}
- AddObjectToCreateUndoList(PCB_TYPE_ARC, CURRENT, arc, arc);
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, CURRENT, arc, arc);
if (!arc)
longjmp(abort_buf, 1);
@@ -1721,7 +1720,7 @@ static void unlink_extras(Extra * e)
e->start.next = e->end.next = 0;
}
-static void mark_line_for_deletion(LineTypePtr l)
+static void mark_line_for_deletion(pcb_line_t *l)
{
Extra *e = LINE2EXTRA(l);
if (e->deleted) {
@@ -1731,25 +1730,25 @@ static void mark_line_for_deletion(LineTypePtr l)
e->deleted = 1;
unlink_extras(e);
#if TRACE1
- pcb_printf("Marked line %p for deletion %#mD to %#mD\n", (void *)e, l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y);
+ pcb_printf("pcb_marked line %p for deletion %#mD to %#mD\n", (void *)e, l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y);
#endif
#if 0
if (l->Point1.X < 0) {
fprintf(stderr, "double neg move?\n");
abort();
}
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, l, &(l->Point1), -1 - l->Point1.X, -1 - l->Point1.Y);
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, l, &(l->Point2), -1 - l->Point2.X, -1 - l->Point2.Y);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, l, &(l->Point1), -1 - l->Point1.X, -1 - l->Point1.Y);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, l, &(l->Point2), -1 - l->Point2.X, -1 - l->Point2.Y);
#endif
}
-static void mark_arc_for_deletion(ArcTypePtr a)
+static void mark_arc_for_deletion(pcb_arc_t *a)
{
Extra *e = ARC2EXTRA(a);
e->deleted = 1;
unlink_extras(e);
#if TRACE1
- printf("Marked arc %p for deletion %ld < %ld\n", (void *)e, a->StartAngle, a->Delta);
+ printf("pcb_marked arc %p for deletion %ld < %ld\n", (void *)e, a->StartAngle, a->Delta);
#endif
}
@@ -1766,14 +1765,14 @@ static void mark_arc_for_deletion(ArcTypePtr a)
S E S E S E E S
*/
-static void maybe_pull_1(LineTypePtr line)
+static void maybe_pull_1(pcb_line_t *line)
{
- BoxType box;
+ pcb_box_t box;
/* Line half-thicknesses, including line space */
int ex, ey;
- LineTypePtr new_line;
+ pcb_line_t *new_line;
Extra *new_lextra;
- ArcTypePtr new_arc;
+ pcb_arc_t *new_arc;
Extra *new_aextra;
double abs_angle;
@@ -1923,19 +1922,19 @@ static void maybe_pull_1(LineTypePtr line)
abort();
}
- end_dist = Distance(end_line->Point1.X, end_line->Point1.Y, end_line->Point2.X, end_line->Point2.Y);
+ end_dist = pcb_distance(end_line->Point1.X, end_line->Point1.Y, end_line->Point2.X, end_line->Point2.Y);
start_pinpad = start_extra->start.pin;
end_pinpad = start_extra->end.pin;
fp = 0;
- r_search(CURRENT->line_tree, &box, NULL, gp_line_cb, 0, NULL);
- r_search(CURRENT->arc_tree, &box, NULL, gp_arc_cb, 0, NULL);
- r_search(CURRENT->text_tree, &box, NULL, gp_text_cb, 0, NULL);
- r_search(CURRENT->polygon_tree, &box, NULL, gp_poly_cb, 0, NULL);
- r_search(PCB->Data->pin_tree, &box, NULL, gp_pin_cb, 0, NULL);
- r_search(PCB->Data->via_tree, &box, NULL, gp_pin_cb, 0, NULL);
- r_search(PCB->Data->pad_tree, &box, NULL, gp_pad_cb, 0, NULL);
+ pcb_r_search(CURRENT->line_tree, &box, NULL, gp_line_cb, 0, NULL);
+ pcb_r_search(CURRENT->arc_tree, &box, NULL, gp_arc_cb, 0, NULL);
+ pcb_r_search(CURRENT->text_tree, &box, NULL, gp_text_cb, 0, NULL);
+ pcb_r_search(CURRENT->polygon_tree, &box, NULL, gp_poly_cb, 0, NULL);
+ pcb_r_search(PCB->Data->pin_tree, &box, NULL, gp_pin_cb, 0, NULL);
+ pcb_r_search(PCB->Data->via_tree, &box, NULL, gp_pin_cb, 0, NULL);
+ pcb_r_search(PCB->Data->pad_tree, &box, NULL, gp_pad_cb, 0, NULL);
/* radians, absolute angle of (at the moment) the start_line */
abs_angle = fa + start_angle;
@@ -1946,7 +1945,7 @@ static void maybe_pull_1(LineTypePtr line)
#if 0
if (fa > M_PI / 2 || fa < -M_PI / 2) {
- SET_FLAG(PCB_FLAG_FOUND, line);
+ PCB_FLAG_SET(PCB_FLAG_FOUND, line);
longjmp(abort_buf, 1);
}
#endif
@@ -1984,7 +1983,7 @@ static void maybe_pull_1(LineTypePtr line)
mark_arc_for_deletion(end_arc);
mark_line_for_deletion(start_line);
mark_line_for_deletion(end_line);
- ChangeArcAngles(CURRENT, start_arc, start_arc->StartAngle, new_delta);
+ pcb_arc_set_angles(CURRENT, start_arc, start_arc->StartAngle, new_delta);
fix_arc_extra(start_arc, sarc_extra);
did_something++;
return;
@@ -2019,13 +2018,13 @@ static void maybe_pull_1(LineTypePtr line)
if (new_delta * start_arc->Delta <= 0)
del_arc = 1;
- ChangeArcAngles(CURRENT, start_arc, start_arc->StartAngle, new_delta);
+ pcb_arc_set_angles(CURRENT, start_arc, start_arc->StartAngle, new_delta);
fix_arc_extra(start_arc, sarc_extra);
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point1),
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point1),
sarc_extra->end.x - start_line->Point1.X, sarc_extra->end.y - start_line->Point1.Y);
if (del_arc) {
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point1),
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point1),
sarc_extra->start.x - start_line->Point1.X, sarc_extra->start.y - start_line->Point1.Y);
mark_arc_for_deletion(start_arc);
}
@@ -2041,7 +2040,7 @@ static void maybe_pull_1(LineTypePtr line)
pcb_printf("obstacle at %#mD angle %d = arc starts at %#mD\n", fx, fy, (int) r2d(oa), (int) ox, (int) oy);
#endif
- if (Distance(ox, oy, end_line->Point2.X, end_line->Point2.Y)
+ if (pcb_distance(ox, oy, end_line->Point2.X, end_line->Point2.Y)
< fr * SIN1D) {
/* Pretend it doesn't exist. */
fx = ex;
@@ -2085,19 +2084,19 @@ static void maybe_pull_1(LineTypePtr line)
if (new_delta * end_arc->Delta <= 0)
del_arc = 1;
- ChangeArcAngles(CURRENT, end_arc, end_arc->StartAngle, new_delta);
+ pcb_arc_set_angles(CURRENT, end_arc, end_arc->StartAngle, new_delta);
fix_arc_extra(end_arc, earc_extra);
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
earc_extra->end.x - start_line->Point2.X, earc_extra->end.y - start_line->Point2.Y);
if (del_arc) {
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
earc_extra->start.x - start_line->Point2.X, earc_extra->start.y - start_line->Point2.Y);
mark_arc_for_deletion(end_arc);
}
}
else {
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
end_line->Point2.X - start_line->Point2.X, end_line->Point2.Y - start_line->Point2.Y);
}
mark_line_for_deletion(end_line);
@@ -2131,7 +2130,7 @@ static void maybe_pull_1(LineTypePtr line)
#if TRACE1
pcb_printf("new point %#mS\n", ex, ey);
#endif
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, end_line, &(end_line->Point1), ex - end_line->Point1.X, ey - end_line->Point1.Y);
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, end_line, &(end_line->Point1), ex - end_line->Point1.X, ey - end_line->Point1.Y);
/* Step 4: Split start_line at the obstacle and insert a zero-delta
arc at it. */
@@ -2144,7 +2143,7 @@ static void maybe_pull_1(LineTypePtr line)
if (end_arc)
earc_extra = ARC2EXTRA(end_arc);
- MoveObject(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
+ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, start_line, &(start_line->Point2),
new_aextra->start.x - start_line->Point2.X, new_aextra->start.y - start_line->Point2.Y);
new_line = create_line(start_line, new_aextra->end.x, new_aextra->end.y, ex, ey);
@@ -2172,19 +2171,19 @@ static void maybe_pull_1(LineTypePtr line)
#if TRACE0
printf("\033[35mdid_something: recursing\033[0m\n");
{
- int i = gui->confirm_dialog("recurse?", 0);
+ int i = pcb_gui->confirm_dialog("recurse?", 0);
printf("confirm = %d\n", i);
if (i == 0)
return;
}
printf("\n\033[33mRECURSING\033[0m\n\n");
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
#endif
maybe_pull_1(new_line);
}
/* Given a line with a end_next, attempt to pull both ends. */
-static void maybe_pull(LineTypePtr line, Extra * e)
+static void maybe_pull(pcb_line_t *line, Extra * e)
{
#if TRACE0
printf("maybe_pull: ");
@@ -2218,7 +2217,7 @@ static void validate_pair(Extra * e, End * end)
abort();
}
-static void validate_pair_cb(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void validate_pair_cb(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
validate_pair(extra, &extra->start);
validate_pair(extra, &extra->end);
@@ -2238,17 +2237,17 @@ static void FreeExtra(Extra * extra)
g_slice_free(Extra, extra);
}
-static void mark_ends_pending(LineType * line, Extra * extra, void *userdata)
+static void mark_ends_pending(pcb_line_t * line, Extra * extra, void *userdata)
{
int *select_flags = userdata;
- if (TEST_FLAGS(*select_flags, line)) {
+ if (PCB_FLAGS_TEST(*select_flags, line)) {
extra->start.pending = 1;
extra->end.pending = 1;
}
}
#if TRACE1
-static void trace_print_extra(AnyObjectType * ptr, Extra * extra, void *userdata)
+static void trace_print_extra(pcb_any_obj_t * ptr, Extra * extra, void *userdata)
{
last_pextra = (Extra *) 1;
print_extra(extra, 0);
@@ -2266,7 +2265,7 @@ static void trace_print_lines_arcs(void)
}
#endif
-static int GlobalPuller(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_GlobalPuller(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int select_flags = 0;
@@ -2275,19 +2274,19 @@ static int GlobalPuller(int argc, const char **argv, Coord x, Coord y)
npulled = 0;
printf("puller! %s\n", argc > 0 ? argv[0] : "");
- if (argc > 0 && strcasecmp(argv[0], "selected") == 0)
+ if (argc > 0 && pcb_strcasecmp(argv[0], "selected") == 0)
select_flags = PCB_FLAG_SELECTED;
- if (argc > 0 && strcasecmp(argv[0], "found") == 0)
+ if (argc > 0 && pcb_strcasecmp(argv[0], "found") == 0)
select_flags = PCB_FLAG_FOUND;
printf("optimizing...\n");
/* This canonicalizes all the lines, and cleans up near-misses. */
- /* hid_actionl ("djopt", "puller", 0); */
+ /* pcb_hid_actionl("djopt", "puller", 0); */
- current_is_solder = (GetLayerGroupNumberByPointer(CURRENT)
- == GetLayerGroupNumberByNumber(solder_silk_layer));
- current_is_component = (GetLayerGroupNumberByPointer(CURRENT)
- == GetLayerGroupNumberByNumber(component_silk_layer));
+ current_is_solder = (pcb_layer_get_group_(CURRENT)
+ == pcb_layer_get_group(pcb_solder_silk_layer));
+ current_is_component = (pcb_layer_get_group_(CURRENT)
+ == pcb_layer_get_group(pcb_component_silk_layer));
lines = g_hash_table_new_full(NULL, NULL, NULL, (GDestroyNotify) FreeExtra);
arcs = g_hash_table_new_full(NULL, NULL, NULL, (GDestroyNotify) FreeExtra);
@@ -2319,7 +2318,7 @@ static int GlobalPuller(int argc, const char **argv, Coord x, Coord y)
nloops++;
status();
did_something = 0;
- LINE_LOOP(CURRENT); {
+ PCB_LINE_LOOP(CURRENT); {
Extra *e = LINE2EXTRA(line);
if (e->deleted)
continue;
@@ -2331,17 +2330,17 @@ static int GlobalPuller(int argc, const char **argv, Coord x, Coord y)
maybe_pull(line, e);
#if TRACE0
if (did_something != old_did_something) {
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
old_did_something = did_something;
- if (gui->confirm_dialog("more?", 0) == 0) {
+ if (pcb_gui->confirm_dialog("more?", 0) == 0) {
did_something = 0;
break;
}
}
#endif
- /*gui->progress(0,0,0); */
+ /*pcb_gui->progress(0,0,0); */
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
@@ -2354,24 +2353,24 @@ static int GlobalPuller(int argc, const char **argv, Coord x, Coord y)
printf("\nlines\n");
#endif
- LINE_LOOP(CURRENT);
+ PCB_LINE_LOOP(CURRENT);
{
if (LINE2EXTRA(line)->deleted)
- RemoveLine(CURRENT, line);
+ pcb_line_destroy(CURRENT, line);
}
- END_LOOP;
+ PCB_END_LOOP;
- ARC_LOOP(CURRENT);
+ PCB_ARC_LOOP(CURRENT);
{
if (ARC2EXTRA(arc)->deleted)
- RemoveArc(CURRENT, arc);
+ pcb_arc_destroy(CURRENT, arc);
}
- END_LOOP;
+ PCB_END_LOOP;
g_hash_table_unref(lines);
g_hash_table_unref(arcs);
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return 0;
}
@@ -2381,26 +2380,26 @@ static int GlobalPuller(int argc, const char **argv, Coord x, Coord y)
/* */
/*****************************************************************************/
-HID_Action puller_action_list[] = {
- {"Puller", "Click on a line-arc intersection or line segment", Puller,
- puller_help, puller_syntax}
+pcb_hid_action_t puller_action_list[] = {
+ {"pcb_act_Puller", "Click on a line-arc intersection or line segment", pcb_act_Puller,
+ pcb_acth_Puller, pcb_acts_Puller}
,
- {"GlobalPuller", 0, GlobalPuller,
- globalpuller_help, globalpuller_syntax}
+ {"pcb_act_GlobalPuller", 0, pcb_act_GlobalPuller,
+ pcb_acth_GlobalPuller, pcb_acts_GlobalPuller}
};
static const char *puller_cookie = "puller plugin";
-REGISTER_ACTIONS(puller_action_list, puller_cookie)
+PCB_REGISTER_ACTIONS(puller_action_list, puller_cookie)
static void hid_puller_uninit(void)
{
- hid_remove_actions_by_cookie(puller_cookie);
+ pcb_hid_remove_actions_by_cookie(puller_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_puller_init(void)
{
- REGISTER_ACTIONS(puller_action_list, puller_cookie)
+ PCB_REGISTER_ACTIONS(puller_action_list, puller_cookie)
return hid_puller_uninit;
}
diff --git a/src_plugins/query/Makefile b/src_plugins/query/Makefile
index 1ab3e10..2c6d897 100644
--- a/src_plugins/query/Makefile
+++ b/src_plugins/query/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_query
+ cd ../../src && $(MAKE) mod_query
clean:
diff --git a/src_plugins/query/Plug.tmpasm b/src_plugins/query/Plug.tmpasm
index 8022689..3f247ae 100644
--- a/src_plugins/query/Plug.tmpasm
+++ b/src_plugins/query/Plug.tmpasm
@@ -13,7 +13,6 @@ put /local/pcb/mod/YACC {$(PLUGDIR)/query/query_y}
put /local/pcb/mod/LEX {$(PLUGDIR)/query/query_l}
put /local/pcb/mod/SPHASH {$(PLUGDIR)/query/fields.sphash}
-
switch /local/pcb/query/controls
case {buildin} include /local/pcb/tmpasm/buildin; end;
case {plugin} include /local/pcb/tmpasm/plugin; end;
diff --git a/src_plugins/query/README b/src_plugins/query/README
index 751264e..ec3fd47 100644
--- a/src_plugins/query/README
+++ b/src_plugins/query/README
@@ -1,6 +1,6 @@
pcb-rnd query language: execute expressions on objects and rules for the
programmed drc.
-#state: WIP
-#default: disable
+#state: works
+#default: buildin
#implements: (feature)
diff --git a/src_plugins/query/basic_fnc.c b/src_plugins/query/basic_fnc.c
index 1d58b2e..f07c535 100644
--- a/src_plugins/query/basic_fnc.c
+++ b/src_plugins/query/basic_fnc.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
-#include "global.h"
+#include "config.h"
#include "data.h"
#include "query_access.h"
#include "query_exec.h"
diff --git a/src_plugins/query/query.c b/src_plugins/query/query.c
index 2bc9476..8521aba 100644
--- a/src_plugins/query/query.c
+++ b/src_plugins/query/query.c
@@ -23,7 +23,6 @@
/* Query language - common code for the compiled tree and plugin administration */
#include "config.h"
-#include "global.h"
#include <genht/hash.h>
#include <genht/htsi.h>
#include "conf.h"
@@ -281,7 +280,7 @@ static const char *query_cookie = "query plugin";
static void hid_query_uninit(void)
{
- hid_remove_actions_by_cookie(query_cookie);
+ pcb_hid_remove_actions_by_cookie(query_cookie);
}
void pcb_qry_basic_fnc_init(void);
diff --git a/src_plugins/query/query.h b/src_plugins/query/query.h
index c600dae..664d21e 100644
--- a/src_plugins/query/query.h
+++ b/src_plugins/query/query.h
@@ -48,7 +48,7 @@ struct pcb_qry_val_s {
union {
pcb_obj_t obj;
pcb_objlist_t lst;
- Coord crd;
+ pcb_coord_t crd;
double dbl;
const char *str;
} data;
@@ -101,7 +101,7 @@ struct pcb_qry_node_s {
pcb_qry_node_t *next; /* sibling on this level of the tree (or NULL) */
pcb_qry_node_t *parent;
union { /* field selection depends on ->type */
- Coord crd;
+ pcb_coord_t crd;
double dbl;
const char *str;
pcb_query_iter_t *iter_ctx;
diff --git a/src_plugins/query/query_access.c b/src_plugins/query/query_access.c
index dff30b2..ade9231 100644
--- a/src_plugins/query/query_access.c
+++ b/src_plugins/query/query_access.c
@@ -22,19 +22,19 @@
/* Query language - access to / extract core data */
-#include <math.h>
-#include "global.h"
+#include "config.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
#include "query_access.h"
#include "query_exec.h"
-#include "misc.h"
#include "layer.h"
#include "fields_sphash.h"
#define APPEND(_ctx_, _type_, _obj_, _parenttype_, _parent_) \
do { \
pcb_objlist_t *lst = (pcb_objlist_t *)_ctx_; \
- pcb_obj_t *o = malloc(sizeof(pcb_obj_t)); \
+ pcb_obj_t *o = calloc(sizeof(pcb_obj_t), 1); \
o->type = _type_; \
o->data.any = _obj_; \
o->parent_type = _parenttype_; \
@@ -42,66 +42,66 @@ do { \
pcb_objlist_append(lst, o); \
} while(0)
-static int list_layer_cb(void *ctx, PCBType *pcb, LayerType *layer, int enter)
+static int list_layer_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, int enter)
{
if (enter)
APPEND(ctx, PCB_OBJ_LAYER, layer, PCB_PARENT_DATA, pcb->Data);
return 0;
}
-static void list_line_cb(void *ctx, PCBType *pcb, LayerType *layer, LineType *line)
+static void list_line_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line)
{
APPEND(ctx, PCB_OBJ_LINE, line, PCB_PARENT_LAYER, layer);
}
-static void list_arc_cb(void *ctx, PCBType *pcb, LayerType *layer, ArcType *arc)
+static void list_arc_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc)
{
APPEND(ctx, PCB_OBJ_ARC, arc, PCB_PARENT_LAYER, layer);
}
-static void list_text_cb(void *ctx, PCBType *pcb, LayerType *layer, TextType *text)
+static void list_text_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_text_t *text)
{
APPEND(ctx, PCB_OBJ_TEXT, text, PCB_PARENT_LAYER, layer);
}
-static void list_poly_cb(void *ctx, PCBType *pcb, LayerType *layer, PolygonType *poly)
+static void list_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly)
{
APPEND(ctx, PCB_OBJ_POLYGON, poly, PCB_PARENT_LAYER, layer);
}
-static int list_element_cb(void *ctx, PCBType *pcb, ElementType *element, int enter)
+static int list_element_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, int enter)
{
if (enter)
APPEND(ctx, PCB_OBJ_ELEMENT, element, PCB_PARENT_DATA, pcb->Data);
return 0;
}
-static void list_eline_cb(void *ctx, PCBType *pcb, ElementType *element, LineType *line)
+static void list_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line)
{
APPEND(ctx, PCB_OBJ_ELINE, line, PCB_PARENT_ELEMENT, element);
}
-static void list_earc_cb(void *ctx, PCBType *pcb, ElementType *element, ArcType *arc)
+static void list_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc)
{
APPEND(ctx, PCB_OBJ_EARC, arc, PCB_PARENT_ELEMENT, element);
}
-static void list_etext_cb(void *ctx, PCBType *pcb, ElementType *element, TextType *text)
+static void list_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_text_t *text)
{
APPEND(ctx, PCB_OBJ_ETEXT, text, PCB_PARENT_ELEMENT, element);
}
-static void list_epin_cb(void *ctx, PCBType *pcb, ElementType *element, PinType *pin)
+static void list_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin)
{
APPEND(ctx, PCB_OBJ_PIN, pin, PCB_PARENT_ELEMENT, element);
}
-static void list_epad_cb(void *ctx, PCBType *pcb, ElementType *element, PadType *pad)
+static void list_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad)
{
APPEND(ctx, PCB_OBJ_PAD, pad, PCB_PARENT_ELEMENT, element);
}
-static void list_via_cb(void *ctx, PCBType *pcb, PinType *via)
+static void list_via_cb(void *ctx, pcb_board_t *pcb, pcb_pin_t *via)
{
APPEND(ctx, PCB_OBJ_VIA, via, PCB_PARENT_DATA, pcb->Data);
}
@@ -224,7 +224,7 @@ do { \
static int field_layer(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- LayerType *l = obj->data.layer;
+ pcb_layer_t *l = obj->data.layer;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
@@ -232,7 +232,7 @@ static int field_layer(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&l->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&l->Attributes, s2));
}
if (fld->next != NULL)
@@ -241,15 +241,15 @@ static int field_layer(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
switch(fh1) {
case query_fields_name: PCB_QRY_RET_STR(res, l->Name);
case query_fields_visible: PCB_QRY_RET_INT(res, l->On);
- case query_fields_position: PCB_QRY_RET_INT(res, pcb_layer_flags(GetLayerNumber(PCB->Data, l)) & PCB_LYT_ANYWHERE);
- case query_fields_type: PCB_QRY_RET_INT(res, pcb_layer_flags(GetLayerNumber(PCB->Data, l)) & PCB_LYT_ANYTHING);
+ case query_fields_position: PCB_QRY_RET_INT(res, pcb_layer_flags(pcb_layer_id(PCB->Data, l)) & PCB_LYT_ANYWHERE);
+ case query_fields_type: PCB_QRY_RET_INT(res, pcb_layer_flags(pcb_layer_id(PCB->Data, l)) & PCB_LYT_ANYTHING);
default:;
}
PCB_QRY_RET_INV(res);
}
-static int field_layer_from_ptr(LayerType *l, pcb_qry_node_t *fld, pcb_qry_val_t *res)
+static int field_layer_from_ptr(pcb_layer_t *l, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
pcb_obj_t tmp;
tmp.type = PCB_OBJ_LAYER;
@@ -283,7 +283,7 @@ static int layer_of_obj(pcb_qry_node_t *fld, pcb_qry_val_t *res, pcb_layer_type_
static int field_line(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- LineType *l = obj->data.line;
+ pcb_line_t *l = obj->data.line;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
@@ -291,7 +291,7 @@ static int field_line(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&l->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&l->Attributes, s2));
}
if (fh1 == query_fields_layer) {
@@ -316,7 +316,7 @@ static int field_line(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
double x = l->Point1.X - l->Point2.X;
double y = l->Point1.Y - l->Point2.Y;
double len = sqrt(x*x + y*y);
- PCB_QRY_RET_INT(res, ((Coord)len));
+ PCB_QRY_RET_INT(res, ((pcb_coord_t)len));
}
break;
default:;
@@ -327,7 +327,7 @@ static int field_line(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_arc(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- ArcType *a = obj->data.arc;
+ pcb_arc_t *a = obj->data.arc;
query_fields_keys_t fh1, fh2;
fld2hash_req(fh1, fld, 0);
@@ -335,7 +335,7 @@ static int field_arc(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&a->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&a->Attributes, s2));
}
if (fh1 == query_fields_angle) {
@@ -370,7 +370,7 @@ static int field_arc(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
#warning TODO: this breaks for elliptics; see http://tutorial.math.lamar.edu/Classes/CalcII/ArcLength.aspx
double r = (a->Width + a->Height)/2;
double len = r * M_PI / 180.0 * a->Delta;
- PCB_QRY_RET_INT(res, ((Coord)len));
+ PCB_QRY_RET_INT(res, ((pcb_coord_t)len));
}
break;
default:;
@@ -381,7 +381,7 @@ static int field_arc(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_text(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- TextType *t = obj->data.text;
+ pcb_text_t *t = obj->data.text;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
@@ -389,7 +389,7 @@ static int field_text(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&t->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&t->Attributes, s2));
}
if (fh1 == query_fields_layer) {
@@ -416,7 +416,7 @@ static int field_text(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_polygon(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- PolygonType *p = obj->data.polygon;
+ pcb_polygon_t *p = obj->data.polygon;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
@@ -424,7 +424,7 @@ static int field_polygon(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&p->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&p->Attributes, s2));
}
if (fh1 == query_fields_layer) {
@@ -457,7 +457,7 @@ static int field_rat(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_via(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- PinType *p = obj->data.via;
+ pcb_pin_t *p = obj->data.via;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
@@ -465,7 +465,7 @@ static int field_via(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&p->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&p->Attributes, s2));
}
if (fld->next != NULL)
@@ -488,18 +488,18 @@ static int field_via(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_element(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- ElementType *p = obj->data.element;
+ pcb_element_t *p = obj->data.element;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
if (fh1 == query_fields_a) {
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&p->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&p->Attributes, s2));
}
if (fh1 == query_fields_layer)
- return layer_of_obj(fld->next, res, PCB_LYT_SILK | (TEST_FLAG(PCB_FLAG_ONSOLDER, p) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
+ return layer_of_obj(fld->next, res, PCB_LYT_SILK | (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, p) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
if (fld->next != NULL)
PCB_QRY_RET_INV(res);
@@ -508,16 +508,16 @@ static int field_element(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res
case query_fields_x: PCB_QRY_RET_INT(res, p->MarkX);
case query_fields_y: PCB_QRY_RET_INT(res, p->MarkY);
case query_fields_refdes: /* alias of: */
- case query_fields_name: PCB_QRY_RET_STR(res, p->Name[NAMEONPCB_INDEX].TextString);
- case query_fields_description: PCB_QRY_RET_STR(res, p->Name[DESCRIPTION_INDEX].TextString);
- case query_fields_value: PCB_QRY_RET_STR(res, p->Name[VALUE_INDEX].TextString);
+ case query_fields_name: PCB_QRY_RET_STR(res, p->Name[PCB_ELEMNAME_IDX_REFDES].TextString);
+ case query_fields_description: PCB_QRY_RET_STR(res, p->Name[PCB_ELEMNAME_IDX_DESCRIPTION].TextString);
+ case query_fields_value: PCB_QRY_RET_STR(res, p->Name[PCB_ELEMNAME_IDX_VALUE].TextString);
default:;
}
PCB_QRY_RET_INV(res);
}
-static int field_element_from_ptr(ElementType *e, pcb_qry_node_t *fld, pcb_qry_val_t *res)
+static int field_element_from_ptr(pcb_element_t *e, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
pcb_obj_t tmp;
tmp.type = PCB_OBJ_ELEMENT;
@@ -562,13 +562,13 @@ static int field_net(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_eline(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- LineType *l = obj->data.line;
+ pcb_line_t *l = obj->data.line;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
switch(fh1) {
- case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_SILK | (TEST_FLAG(PCB_FLAG_ONSOLDER, l) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
+ case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_SILK | (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, l) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
case query_fields_element: return field_element_obj(obj, fld->next, res);
default:;
}
@@ -578,13 +578,13 @@ static int field_eline(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_earc(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- ArcType *a = obj->data.arc;
+ pcb_arc_t *a = obj->data.arc;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
switch(fh1) {
- case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_SILK | (TEST_FLAG(PCB_FLAG_ONSOLDER, a) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
+ case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_SILK | (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, a) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
case query_fields_element: return field_element_obj(obj, fld->next, res);
default:;
}
@@ -594,13 +594,13 @@ static int field_earc(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_etext(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- TextType *t = obj->data.text;
+ pcb_text_t *t = obj->data.text;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
switch(fh1) {
- case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_SILK | (TEST_FLAG(PCB_FLAG_ONSOLDER, t) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
+ case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_SILK | (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, t) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
case query_fields_element: return field_element_obj(obj, fld->next, res);
default:;
}
@@ -624,7 +624,7 @@ static int field_pin(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
static int field_pad(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
- PadType *p = obj->data.pad;
+ pcb_pad_t *p = obj->data.pad;
query_fields_keys_t fh1;
fld2hash_req(fh1, fld, 0);
@@ -634,9 +634,9 @@ static int field_pad(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res)
{
const char *s2;
fld2str_req(s2, fld, 1);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&p->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&p->Attributes, s2));
}
- case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_COPPER | (TEST_FLAG(PCB_FLAG_ONSOLDER, p) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
+ case query_fields_layer: return layer_of_obj(fld->next, res, PCB_LYT_COPPER | (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, p) ? PCB_LYT_BOTTOM : PCB_LYT_TOP));
case query_fields_element: return field_element_obj(obj, fld->next, res);
default:;
}
@@ -677,10 +677,10 @@ int pcb_qry_obj_field(pcb_qry_val_t *objval, pcb_qry_node_t *fld, pcb_qry_val_t
if (fh1 == query_fields_a) {
const char *s2;
- fld2str_req(s2, fld, 0);
+ fld2str_req(s2, fld, 1);
if (!PCB_OBJ_IS_CLASS(obj->type, PCB_OBJ_CLASS_OBJ))
PCB_QRY_RET_INV(res);
- PCB_QRY_RET_STR(res, AttributeGetFromList(&obj->data.anyobj->Attributes, s2));
+ PCB_QRY_RET_STR(res, pcb_attribute_get(&obj->data.anyobj->Attributes, s2));
}
if (fh1 == query_fields_ID) {
diff --git a/src_plugins/query/query_act.c b/src_plugins/query/query_act.c
index a871f28..51d4444 100644
--- a/src_plugins/query/query_act.c
+++ b/src_plugins/query/query_act.c
@@ -22,13 +22,17 @@
/* Query language - actions */
-#include "global.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
#include "query.h"
#include "query_y.h"
#include "query_exec.h"
-#include "set.h"
+#include "const.h"
#include "draw.h"
#include "select.h"
+#include "board.h"
#include "macro.h"
static const char query_action_syntax[] =
@@ -71,14 +75,14 @@ static void select_cb(void *user_ctx, pcb_qry_val_t *res, pcb_obj_t *current)
return;
if (PCB_OBJ_IS_CLASS(current->type, PCB_OBJ_CLASS_OBJ)) {
int state_wanted = (sel->how == PCB_CHGFLG_SET);
- int state_is = TEST_FLAG(PCB_FLAG_SELECTED, current->data.anyobj);
+ int state_is = PCB_FLAG_TEST(PCB_FLAG_SELECTED, current->data.anyobj);
if (state_wanted != state_is) {
if (current->type == PCB_OBJ_ELEMENT)
pcb_select_element(current->data.element, sel->how, 0);
else if (current->type == PCB_OBJ_ETEXT)
pcb_select_element_name(current->data.element, sel->how, 0);
else
- CHANGE_FLAG(sel->how, PCB_FLAG_SELECTED, current->data.anyobj);
+ PCB_FLAG_CHANGE(sel->how, PCB_FLAG_SELECTED, current->data.anyobj);
sel->cnt++;
}
}
@@ -92,14 +96,14 @@ static int run_script(const char *script, void (*cb)(void *user_ctx, pcb_qry_val
qry_parse(&prg);
if (prg == NULL) {
- Message(PCB_MSG_ERROR, "Compilation error.\n");
+ pcb_message(PCB_MSG_ERROR, "Compilation error.\n");
return -1;
}
return pcb_qry_run(prg, cb, user_ctx);
}
-static int query_action(int argc, const char **argv, Coord x, Coord y)
+static int query_action(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *cmd = argc > 0 ? argv[0] : 0;
select_t sel;
@@ -142,8 +146,8 @@ static int query_action(int argc, const char **argv, Coord x, Coord y)
if (run_script(argv[1], select_cb, &sel) < 0)
printf("Failed to run the query\n");
if (sel.cnt > 0) {
- SetChangedFlag(pcb_true);
- Redraw();
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_redraw();
}
return 0;
}
@@ -153,8 +157,8 @@ static int query_action(int argc, const char **argv, Coord x, Coord y)
if (run_script(argv[1], select_cb, &sel) < 0)
printf("Failed to run the query\n");
if (sel.cnt > 0) {
- SetChangedFlag(pcb_true);
- Redraw();
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_redraw();
}
return 0;
}
@@ -162,15 +166,15 @@ static int query_action(int argc, const char **argv, Coord x, Coord y)
return -1;
}
-HID_Action query_action_list[] = {
+pcb_hid_action_t query_action_list[] = {
{"query", NULL, query_action,
query_action_help, query_action_syntax}
};
-REGISTER_ACTIONS(query_action_list, NULL)
+PCB_REGISTER_ACTIONS(query_action_list, NULL)
#include "dolists.h"
void query_action_reg(const char *cookie)
{
- REGISTER_ACTIONS(query_action_list, cookie)
+ PCB_REGISTER_ACTIONS(query_action_list, cookie)
}
diff --git a/src_plugins/query/query_exec.c b/src_plugins/query/query_exec.c
index 6147af4..7077b0c 100644
--- a/src_plugins/query/query_exec.c
+++ b/src_plugins/query/query_exec.c
@@ -22,11 +22,13 @@
/* Query language - execution */
-#include "global.h"
+#include <stdio.h>
+#include "config.h"
#include "data.h"
#include "query.h"
#include "query_exec.h"
#include "query_access.h"
+#include "pcb-printf.h"
void pcb_qry_init(pcb_qry_exec_t *ctx, pcb_qry_node_t *root)
{
@@ -139,6 +141,7 @@ static const char *op2str(char *buff, int buff_size, pcb_qry_val_t *val)
case PCBQ_VT_OBJ:
case PCBQ_VT_LST: return NULL;
}
+ return NULL;
}
int pcb_qry_is_true(pcb_qry_val_t *val)
@@ -401,6 +404,8 @@ int pcb_qry_eval(pcb_qry_exec_t *ctx, pcb_qry_node_t *node, pcb_qry_val_t *res)
case PCBQ_VAR:
assert((node->data.crd >= 0) && (node->data.crd < ctx->iter->num_vars));
res->type = PCBQ_VT_OBJ;
+ if (ctx->iter->it[node->data.crd] == NULL)
+ return -1;
res->data.obj = *ctx->iter->it[node->data.crd];
return 0;
@@ -437,7 +442,7 @@ int pcb_qry_eval(pcb_qry_exec_t *ctx, pcb_qry_node_t *node, pcb_qry_val_t *res)
return -1;
if (farg != NULL) {
- Message(PCB_MSG_ERROR, "too many function arguments\n");
+ pcb_message(PCB_MSG_ERROR, "too many function arguments\n");
return -1;
}
printf("CALL n=%d\n", n);
diff --git a/src_plugins/query/query_l.c b/src_plugins/query/query_l.c
index 4454ff3..7c8cc5c 100644
--- a/src_plugins/query/query_l.c
+++ b/src_plugins/query/query_l.c
@@ -27,8 +27,8 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 1
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -107,25 +107,13 @@ typedef unsigned int flex_uint32_t;
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Returned upon end-of-file. */
@@ -181,6 +169,11 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
extern int qry_leng;
extern FILE *qry_in, *qry_out;
@@ -190,6 +183,7 @@ extern FILE *qry_in, *qry_out;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
+ #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
@@ -207,11 +201,6 @@ extern FILE *qry_in, *qry_out;
#define unput(c) yyunput( c, (yytext_ptr) )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -224,7 +213,7 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -252,7 +241,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -280,7 +269,7 @@ struct yy_buffer_state
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
@@ -303,7 +292,7 @@ static int yy_n_chars; /* number of characters read into yy_ch_buf */
int qry_leng;
/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
+static char *yy_c_buf_p = NULL;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
@@ -362,7 +351,7 @@ void qry_free (void * );
typedef unsigned char YY_CHAR;
-FILE *qry_in = (FILE *) 0, *qry_out = (FILE *) 0;
+FILE *qry_in = NULL, *qry_out = NULL;
typedef int yy_state_type;
@@ -371,19 +360,22 @@ extern int qry_lineno;
int qry_lineno = 1;
extern char *qry_text;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
#define yytext_ptr qry_text
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[] );
+static void yynoreturn yy_fatal_error (yyconst char* msg );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up qry_text.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- qry_leng = (size_t) (yy_cp - yy_bp); \
+ qry_leng = (int) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@@ -423,7 +415,7 @@ static yyconst flex_int16_t yy_accept[195] =
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static yyconst YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
@@ -455,7 +447,7 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[52] =
+static yyconst YY_CHAR yy_meta[52] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
@@ -465,7 +457,7 @@ static yyconst flex_int32_t yy_meta[52] =
1
} ;
-static yyconst flex_int16_t yy_base[198] =
+static yyconst flex_uint16_t yy_base[198] =
{ 0,
0, 0, 210, 211, 211, 211, 197, 203, 201, 199,
211, 195, 43, 192, 191, 190, 172, 173, 172, 0,
@@ -517,7 +509,7 @@ static yyconst flex_int16_t yy_def[198] =
} ;
-static yyconst flex_int16_t yy_nxt[263] =
+static yyconst flex_uint16_t yy_nxt[263] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 20,
@@ -623,7 +615,6 @@ char *qry_text;
/* Query language - compiler: lexical analyzer */
-#include "global.h"
#include "unit.h"
#include "query.h"
#include "query_y.h"
@@ -634,7 +625,7 @@ static const char *pcb_qry_program, *pcb_qry_program_ptr;
static int qry_yy_input(char *buf, int buflen);
static pcb_qry_node_t *make_constant(char *str, long val);
#define YY_INPUT(buf, res, buflen) (res = qry_yy_input(buf, buflen))
-#line 638 "query_l.c"
+#line 629 "query_l.c"
#define INITIAL 0
@@ -667,19 +658,19 @@ void qry_set_extra (YY_EXTRA_TYPE user_defined );
FILE *qry_get_in (void );
-void qry_set_in (FILE * in_str );
+void qry_set_in (FILE * _in_str );
FILE *qry_get_out (void );
-void qry_set_out (FILE * out_str );
+void qry_set_out (FILE * _out_str );
-int qry_get_leng (void );
+ int qry_get_leng (void );
char *qry_get_text (void );
int qry_get_lineno (void );
-void qry_set_lineno (int line_number );
+void qry_set_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -693,8 +684,12 @@ extern int qry_wrap (void );
#endif
#endif
+#ifndef YY_NO_UNPUT
+
static void yyunput (int c,char *buf_ptr );
+#endif
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -728,7 +723,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( qry_text, qry_leng, 1, qry_out )) {} } while (0)
+#define ECHO do { if (fwrite( qry_text, (size_t) qry_leng, 1, qry_out )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -752,7 +747,7 @@ static int input (void );
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, qry_in))==0 && ferror(qry_in)) \
+ while ( (result = (int) fread(buf, 1, max_size, qry_in))==0 && ferror(qry_in)) \
{ \
if( errno != EINTR) \
{ \
@@ -807,7 +802,7 @@ extern int qry_lex (void);
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
@@ -817,14 +812,10 @@ extern int qry_lex (void);
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
-#line 41 "query_l.l"
-
-#line 827 "query_l.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -851,7 +842,12 @@ YY_DECL
qry__load_buffer_state( );
}
- while ( 1 ) /* loops until end-of-file is reached */
+ {
+#line 40 "query_l.l"
+
+#line 849 "query_l.c"
+
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
@@ -867,7 +863,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -879,7 +875,7 @@ yy_match:
if ( yy_current_state >= 195 )
yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 211 );
@@ -909,317 +905,317 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 42 "query_l.l"
+#line 41 "query_l.l"
{ qry_lval.s = pcb_strdup(qry_text+1); qry_lval.s[strlen(qry_lval.s)-1] = '\0'; return T_QSTR; /*"*/ }
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 43 "query_l.l"
+#line 42 "query_l.l"
{ qry_lval.s = pcb_strdup(qry_text+1); qry_lval.s[strlen(qry_lval.s)-1] = '\0'; return T_QSTR; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 45 "query_l.l"
+#line 44 "query_l.l"
{ return T_LET; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 46 "query_l.l"
+#line 45 "query_l.l"
{ return T_ASSERT; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 47 "query_l.l"
+#line 46 "query_l.l"
{ return T_RULE; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 48 "query_l.l"
+#line 47 "query_l.l"
{ return T_LIST; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 49 "query_l.l"
+#line 48 "query_l.l"
{ return T_INVALID; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 50 "query_l.l"
+#line 49 "query_l.l"
{ return T_FLD_P; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 51 "query_l.l"
+#line 50 "query_l.l"
{ return T_FLD_A; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 53 "query_l.l"
+#line 52 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_POINT); return T_CONST; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 54 "query_l.l"
+#line 53 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_LINE); return T_CONST; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 55 "query_l.l"
+#line 54 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_TEXT); return T_CONST; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 56 "query_l.l"
+#line 55 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_POLYGON); return T_CONST; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 57 "query_l.l"
+#line 56 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_ARC); return T_CONST; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 58 "query_l.l"
+#line 57 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_RAT); return T_CONST; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 59 "query_l.l"
+#line 58 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_PAD); return T_CONST; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 60 "query_l.l"
+#line 59 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_PIN); return T_CONST; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 61 "query_l.l"
+#line 60 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_VIA); return T_CONST; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 62 "query_l.l"
+#line 61 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_ELEMENT); return T_CONST; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 63 "query_l.l"
+#line 62 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_NET); return T_CONST; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 64 "query_l.l"
+#line 63 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_LAYER); return T_CONST; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 65 "query_l.l"
+#line 64 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_ELINE); return T_CONST; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 66 "query_l.l"
+#line 65 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_EARC); return T_CONST; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 67 "query_l.l"
+#line 66 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_OBJ_ETEXT); return T_CONST; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 69 "query_l.l"
+#line 68 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 1); return T_CONST; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 70 "query_l.l"
+#line 69 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 1); return T_CONST; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 71 "query_l.l"
+#line 70 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 1); return T_CONST; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 72 "query_l.l"
+#line 71 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 1); return T_CONST; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 74 "query_l.l"
+#line 73 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 0); return T_CONST; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 75 "query_l.l"
+#line 74 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 0); return T_CONST; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 76 "query_l.l"
+#line 75 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 0); return T_CONST; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 77 "query_l.l"
+#line 76 "query_l.l"
{ qry_lval.n = make_constant(qry_text, 0); return T_CONST; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 79 "query_l.l"
+#line 78 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_TOP); return T_CONST; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 80 "query_l.l"
+#line 79 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_BOTTOM); return T_CONST; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 81 "query_l.l"
+#line 80 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_INTERN); return T_CONST; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 82 "query_l.l"
+#line 81 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_INTERN); return T_CONST; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 83 "query_l.l"
+#line 82 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_COPPER); return T_CONST; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 84 "query_l.l"
+#line 83 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_SILK); return T_CONST; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 85 "query_l.l"
+#line 84 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_MASK); return T_CONST; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 86 "query_l.l"
+#line 85 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_PASTE); return T_CONST; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 87 "query_l.l"
+#line 86 "query_l.l"
{ qry_lval.n = make_constant(qry_text, PCB_LYT_OUTLINE); return T_CONST; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 91 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_MM); return T_UNIT; }
+#line 90 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MM); return T_UNIT; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 92 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_M); return T_UNIT; }
+#line 91 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_M); return T_UNIT; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 93 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_UM); return T_UNIT; }
+#line 92 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_UM); return T_UNIT; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 94 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_CM); return T_UNIT; }
+#line 93 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_CM); return T_UNIT; }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 95 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_NM); return T_UNIT; }
+#line 94 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_NM); return T_UNIT; }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 96 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_MIL); return T_UNIT; }
+#line 95 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MIL); return T_UNIT; }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 97 "query_l.l"
-{ qry_lval.u = get_unit_struct_by_allow(ALLOW_IN); return T_UNIT; }
+#line 96 "query_l.l"
+{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_IN); return T_UNIT; }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 99 "query_l.l"
+#line 98 "query_l.l"
{ return T_OR; }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 100 "query_l.l"
+#line 99 "query_l.l"
{ return T_AND; }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 101 "query_l.l"
+#line 100 "query_l.l"
{ return T_EQ; }
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 102 "query_l.l"
+#line 101 "query_l.l"
{ return T_NEQ; }
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 103 "query_l.l"
+#line 102 "query_l.l"
{ return T_GTEQ; }
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 104 "query_l.l"
+#line 103 "query_l.l"
{ return T_LTEQ; }
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 106 "query_l.l"
+#line 105 "query_l.l"
{ qry_lval.c = strtol(qry_text, NULL, 10); return T_INT; }
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 107 "query_l.l"
+#line 106 "query_l.l"
{ qry_lval.d = strtod(qry_text, NULL); return T_DBL; }
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 108 "query_l.l"
+#line 107 "query_l.l"
{ qry_lval.d = strtod(qry_text, NULL); return T_DBL; }
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 109 "query_l.l"
+#line 108 "query_l.l"
{ qry_lval.s = pcb_strdup(qry_text); return T_STR; }
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 111 "query_l.l"
+#line 110 "query_l.l"
{ return *qry_text; }
YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
-#line 113 "query_l.l"
+#line 112 "query_l.l"
{ return T_NL; }
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 114 "query_l.l"
+#line 113 "query_l.l"
{ continue; }
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 116 "query_l.l"
+#line 115 "query_l.l"
ECHO;
YY_BREAK
-#line 1223 "query_l.c"
+#line 1219 "query_l.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1350,6 +1346,7 @@ case YY_STATE_EOF(INITIAL):
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
+ } /* end of user's declarations */
} /* end of qry_lex */
/* yy_get_next_buffer - try to read in a new buffer
@@ -1361,9 +1358,9 @@ case YY_STATE_EOF(INITIAL):
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ yy_size_t number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@@ -1392,7 +1389,7 @@ static int yy_get_next_buffer (void)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+ number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1412,7 +1409,7 @@ static int yy_get_next_buffer (void)
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
@@ -1432,7 +1429,7 @@ static int yy_get_next_buffer (void)
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
+ b->yy_ch_buf = NULL;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@@ -1450,7 +1447,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -1474,9 +1471,9 @@ static int yy_get_next_buffer (void)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) qry_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
@@ -1495,14 +1492,14 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -1514,7 +1511,7 @@ static int yy_get_next_buffer (void)
if ( yy_current_state >= 195 )
yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
}
return yy_current_state;
@@ -1527,10 +1524,10 @@ static int yy_get_next_buffer (void)
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
+ int yy_is_jam;
+ char *yy_cp = (yy_c_buf_p);
- register YY_CHAR yy_c = 1;
+ YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
@@ -1542,15 +1539,17 @@ static int yy_get_next_buffer (void)
if ( yy_current_state >= 195 )
yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
yy_is_jam = (yy_current_state == 194);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
- static void yyunput (int c, register char * yy_bp )
+#ifndef YY_NO_UNPUT
+
+ static void yyunput (int c, char * yy_bp )
{
- register char *yy_cp;
+ char *yy_cp;
yy_cp = (yy_c_buf_p);
@@ -1560,10 +1559,10 @@ static int yy_get_next_buffer (void)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ int number_to_move = (yy_n_chars) + 2;
+ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
+ char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
@@ -1572,7 +1571,7 @@ static int yy_get_next_buffer (void)
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -1585,6 +1584,8 @@ static int yy_get_next_buffer (void)
(yy_c_buf_p) = yy_cp;
}
+#endif
+
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
@@ -1633,7 +1634,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( qry_wrap( ) )
- return EOF;
+ return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@@ -1734,7 +1735,7 @@ static void qry__load_buffer_state (void)
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in qry__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = (yy_size_t)size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
@@ -1769,10 +1770,6 @@ static void qry__load_buffer_state (void)
qry_free((void *) b );
}
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a qry_restart() or at EOF.
@@ -1893,15 +1890,15 @@ static void qry_ensure_buffer_stack (void)
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1;
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
(yy_buffer_stack) = (struct yy_buffer_state**)qry_alloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in qry_ensure_buffer_stack()" );
-
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@@ -1910,7 +1907,7 @@ static void qry_ensure_buffer_stack (void)
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
+ yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)qry_realloc
@@ -1930,7 +1927,7 @@ static void qry_ensure_buffer_stack (void)
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE qry__scan_buffer (char * base, yy_size_t size )
{
@@ -1940,7 +1937,7 @@ YY_BUFFER_STATE qry__scan_buffer (char * base, yy_size_t size )
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
- return 0;
+ return NULL;
b = (YY_BUFFER_STATE) qry_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
@@ -1949,7 +1946,7 @@ YY_BUFFER_STATE qry__scan_buffer (char * base, yy_size_t size )
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
+ b->yy_input_file = NULL;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
@@ -1972,7 +1969,7 @@ YY_BUFFER_STATE qry__scan_buffer (char * base, yy_size_t size )
YY_BUFFER_STATE qry__scan_string (yyconst char * yystr )
{
- return qry__scan_bytes(yystr,strlen(yystr) );
+ return qry__scan_bytes(yystr,(int) strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to qry_lex() will
@@ -1987,10 +1984,10 @@ YY_BUFFER_STATE qry__scan_bytes (yyconst char * yybytes, int _yybytes_len )
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- int i;
+ yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
+ n = (yy_size_t) _yybytes_len + 2;
buf = (char *) qry_alloc(n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in qry__scan_bytes()" );
@@ -2016,9 +2013,9 @@ YY_BUFFER_STATE qry__scan_bytes (yyconst char * yybytes, int _yybytes_len )
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
+ (void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2046,7 +2043,7 @@ static void yy_fatal_error (yyconst char* msg )
*/
int qry_get_lineno (void)
{
-
+
return qry_lineno;
}
@@ -2084,29 +2081,29 @@ char *qry_get_text (void)
}
/** Set the current line number.
- * @param line_number
+ * @param _line_number line number
*
*/
-void qry_set_lineno (int line_number )
+void qry_set_lineno (int _line_number )
{
- qry_lineno = line_number;
+ qry_lineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
*
* @see qry__switch_to_buffer
*/
-void qry_set_in (FILE * in_str )
+void qry_set_in (FILE * _in_str )
{
- qry_in = in_str ;
+ qry_in = _in_str ;
}
-void qry_set_out (FILE * out_str )
+void qry_set_out (FILE * _out_str )
{
- qry_out = out_str ;
+ qry_out = _out_str ;
}
int qry_get_debug (void)
@@ -2114,9 +2111,9 @@ int qry_get_debug (void)
return qry__flex_debug;
}
-void qry_set_debug (int bdebug )
+void qry_set_debug (int _bdebug )
{
- qry__flex_debug = bdebug ;
+ qry__flex_debug = _bdebug ;
}
static int yy_init_globals (void)
@@ -2125,10 +2122,10 @@ static int yy_init_globals (void)
* This function is called from qry_lex_destroy(), so don't allocate here.
*/
- (yy_buffer_stack) = 0;
+ (yy_buffer_stack) = NULL;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = (char *) 0;
+ (yy_c_buf_p) = NULL;
(yy_init) = 0;
(yy_start) = 0;
@@ -2137,8 +2134,8 @@ static int yy_init_globals (void)
qry_in = stdin;
qry_out = stdout;
#else
- qry_in = (FILE *) 0;
- qry_out = (FILE *) 0;
+ qry_in = NULL;
+ qry_out = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
@@ -2176,7 +2173,8 @@ int qry_lex_destroy (void)
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
+
+ int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
@@ -2185,7 +2183,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
+ int n;
for ( n = 0; s[n]; ++n )
;
@@ -2195,11 +2193,12 @@ static int yy_flex_strlen (yyconst char * s )
void *qry_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return malloc(size);
}
void *qry_realloc (void * ptr, yy_size_t size )
{
+
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -2207,17 +2206,17 @@ void *qry_realloc (void * ptr, yy_size_t size )
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
void qry_free (void * ptr )
{
- free( (char *) ptr ); /* see qry_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see qry_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 116 "query_l.l"
+#line 115 "query_l.l"
diff --git a/src_plugins/query/query_l.h b/src_plugins/query/query_l.h
index 861ba3d..2ba2606 100644
--- a/src_plugins/query/query_l.h
+++ b/src_plugins/query/query_l.h
@@ -12,8 +12,8 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 1
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -92,25 +92,13 @@ typedef unsigned int flex_uint32_t;
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Size of default input buffer. */
@@ -131,15 +119,15 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-extern int qry_leng;
-
-extern FILE *qry_in, *qry_out;
-
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
+extern int qry_leng;
+
+extern FILE *qry_in, *qry_out;
+
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -152,7 +140,7 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -180,7 +168,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -212,6 +200,9 @@ void qry_free (void * );
extern int qry_lineno;
extern char *qry_text;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
#define yytext_ptr qry_text
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
@@ -246,19 +237,19 @@ void qry_set_extra (YY_EXTRA_TYPE user_defined );
FILE *qry_get_in (void );
-void qry_set_in (FILE * in_str );
+void qry_set_in (FILE * _in_str );
FILE *qry_get_out (void );
-void qry_set_out (FILE * out_str );
+void qry_set_out (FILE * _out_str );
-int qry_get_leng (void );
+ int qry_get_leng (void );
char *qry_get_text (void );
int qry_get_lineno (void );
-void qry_set_lineno (int line_number );
+void qry_set_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -324,9 +315,9 @@ extern int qry_lex (void);
#undef YY_DECL
#endif
-#line 116 "query_l.l"
+#line 115 "query_l.l"
-#line 331 "query_l.h"
+#line 322 "query_l.h"
#undef qry_IN_HEADER
#endif /* qry_HEADER_H */
diff --git a/src_plugins/query/query_l.l b/src_plugins/query/query_l.l
index 62a4f9d..92639e0 100644
--- a/src_plugins/query/query_l.l
+++ b/src_plugins/query/query_l.l
@@ -23,7 +23,6 @@
/* Query language - compiler: lexical analyzer */
-#include "global.h"
#include "unit.h"
#include "query.h"
#include "query_y.h"
@@ -88,13 +87,13 @@ a[.] { return T_FLD_A; }
-mm { qry_lval.u = get_unit_struct_by_allow(ALLOW_MM); return T_UNIT; }
-m { qry_lval.u = get_unit_struct_by_allow(ALLOW_M); return T_UNIT; }
-um { qry_lval.u = get_unit_struct_by_allow(ALLOW_UM); return T_UNIT; }
-cm { qry_lval.u = get_unit_struct_by_allow(ALLOW_CM); return T_UNIT; }
-nm { qry_lval.u = get_unit_struct_by_allow(ALLOW_NM); return T_UNIT; }
-mil { qry_lval.u = get_unit_struct_by_allow(ALLOW_MIL); return T_UNIT; }
-inch { qry_lval.u = get_unit_struct_by_allow(ALLOW_IN); return T_UNIT; }
+mm { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MM); return T_UNIT; }
+m { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_M); return T_UNIT; }
+um { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_UM); return T_UNIT; }
+cm { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_CM); return T_UNIT; }
+nm { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_NM); return T_UNIT; }
+mil { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MIL); return T_UNIT; }
+inch { qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_IN); return T_UNIT; }
[|][|] { return T_OR; }
[&][&] { return T_AND; }
diff --git a/src_plugins/query/query_y.c b/src_plugins/query/query_y.c
index f0148a0..3a4c05f 100644
--- a/src_plugins/query/query_y.c
+++ b/src_plugins/query/query_y.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
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
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -97,7 +97,7 @@
/* Query language - compiler: grammar */
#include <assert.h>
-#include "global.h"
+#include "const.h"
#include "unit.h"
#include "query.h"
#include "query_l.h"
@@ -110,9 +110,9 @@ do { \
if (negative) \
dst = -dst; \
if (unit != NULL) { \
- if (unit->family == IMPERIAL) \
+ if (unit->family == PCB_UNIT_IMPERIAL) \
dst = PCB_MIL_TO_COORD(dst); \
- else if (unit->family == METRIC) \
+ else if (unit->family == PCB_UNIT_METRIC) \
dst = PCB_MM_TO_COORD(dst); \
dst /= unit->scale_factor; \
} \
@@ -220,19 +220,21 @@ extern int qry_debug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
+
union YYSTYPE
{
#line 95 "query_y.y" /* yacc.c:355 */
char *s;
- Coord c;
+ pcb_coord_t c;
double d;
- const Unit *u;
+ const pcb_unit_t *u;
pcb_qry_node_t *n;
#line 235 "query_y.c" /* yacc.c:355 */
};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
@@ -246,7 +248,7 @@ int qry_parse (pcb_qry_node_t **prg_out);
/* Copy the second part of user declarations. */
-#line 250 "query_y.c" /* yacc.c:358 */
+#line 252 "query_y.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -1414,19 +1416,19 @@ yyreduce:
case 2:
#line 133 "query_y.y" /* yacc.c:1646 */
{ *prg_out = (yyvsp[0].n); }
-#line 1418 "query_y.c" /* yacc.c:1646 */
+#line 1420 "query_y.c" /* yacc.c:1646 */
break;
case 3:
#line 134 "query_y.y" /* yacc.c:1646 */
{ *prg_out = (yyvsp[0].n); }
-#line 1424 "query_y.c" /* yacc.c:1646 */
+#line 1426 "query_y.c" /* yacc.c:1646 */
break;
case 4:
#line 139 "query_y.y" /* yacc.c:1646 */
{ iter_ctx = pcb_qry_iter_alloc(); }
-#line 1430 "query_y.c" /* yacc.c:1646 */
+#line 1432 "query_y.c" /* yacc.c:1646 */
break;
case 5:
@@ -1439,19 +1441,19 @@ yyreduce:
(yyval.n)->data.children->next = (yyvsp[0].n);
(yyvsp[0].n)->parent = (yyval.n);
}
-#line 1443 "query_y.c" /* yacc.c:1646 */
+#line 1445 "query_y.c" /* yacc.c:1646 */
break;
case 6:
#line 152 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = NULL; }
-#line 1449 "query_y.c" /* yacc.c:1646 */
+#line 1451 "query_y.c" /* yacc.c:1646 */
break;
case 7:
#line 153 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[-1].n); (yyvsp[-1].n)->next = (yyvsp[0].n); }
-#line 1455 "query_y.c" /* yacc.c:1646 */
+#line 1457 "query_y.c" /* yacc.c:1646 */
break;
case 8:
@@ -1465,151 +1467,151 @@ yyreduce:
(yyval.n)->data.children->next->next = (yyvsp[0].n);
(yyvsp[0].n)->parent = (yyval.n);
}
-#line 1469 "query_y.c" /* yacc.c:1646 */
+#line 1471 "query_y.c" /* yacc.c:1646 */
break;
case 9:
#line 169 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = NULL; }
-#line 1475 "query_y.c" /* yacc.c:1646 */
+#line 1477 "query_y.c" /* yacc.c:1646 */
break;
case 10:
#line 170 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[-2].n); (yyvsp[-2].n)->next = (yyvsp[-1].n); }
-#line 1481 "query_y.c" /* yacc.c:1646 */
+#line 1483 "query_y.c" /* yacc.c:1646 */
break;
case 11:
#line 174 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 1487 "query_y.c" /* yacc.c:1646 */
+#line 1489 "query_y.c" /* yacc.c:1646 */
break;
case 12:
#line 175 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 1493 "query_y.c" /* yacc.c:1646 */
+#line 1495 "query_y.c" /* yacc.c:1646 */
break;
case 13:
#line 176 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 1499 "query_y.c" /* yacc.c:1646 */
+#line 1501 "query_y.c" /* yacc.c:1646 */
break;
case 14:
#line 177 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_DATA_INVALID); }
-#line 1505 "query_y.c" /* yacc.c:1646 */
+#line 1507 "query_y.c" /* yacc.c:1646 */
break;
case 15:
#line 178 "query_y.y" /* yacc.c:1646 */
{ UNOP((yyval.n), PCBQ_OP_NOT, (yyvsp[0].n)); }
-#line 1511 "query_y.c" /* yacc.c:1646 */
+#line 1513 "query_y.c" /* yacc.c:1646 */
break;
case 16:
#line 179 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[-1].n); }
-#line 1517 "query_y.c" /* yacc.c:1646 */
+#line 1519 "query_y.c" /* yacc.c:1646 */
break;
case 17:
#line 180 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_AND, (yyvsp[0].n)); }
-#line 1523 "query_y.c" /* yacc.c:1646 */
+#line 1525 "query_y.c" /* yacc.c:1646 */
break;
case 18:
#line 181 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_OR, (yyvsp[0].n)); }
-#line 1529 "query_y.c" /* yacc.c:1646 */
+#line 1531 "query_y.c" /* yacc.c:1646 */
break;
case 19:
#line 182 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_EQ, (yyvsp[0].n)); }
-#line 1535 "query_y.c" /* yacc.c:1646 */
+#line 1537 "query_y.c" /* yacc.c:1646 */
break;
case 20:
#line 183 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_NEQ, (yyvsp[0].n)); }
-#line 1541 "query_y.c" /* yacc.c:1646 */
+#line 1543 "query_y.c" /* yacc.c:1646 */
break;
case 21:
#line 184 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_GTEQ, (yyvsp[0].n)); }
-#line 1547 "query_y.c" /* yacc.c:1646 */
+#line 1549 "query_y.c" /* yacc.c:1646 */
break;
case 22:
#line 185 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_LTEQ, (yyvsp[0].n)); }
-#line 1553 "query_y.c" /* yacc.c:1646 */
+#line 1555 "query_y.c" /* yacc.c:1646 */
break;
case 23:
#line 186 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_GT, (yyvsp[0].n)); }
-#line 1559 "query_y.c" /* yacc.c:1646 */
+#line 1561 "query_y.c" /* yacc.c:1646 */
break;
case 24:
#line 187 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_LT, (yyvsp[0].n)); }
-#line 1565 "query_y.c" /* yacc.c:1646 */
+#line 1567 "query_y.c" /* yacc.c:1646 */
break;
case 25:
#line 188 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_ADD, (yyvsp[0].n)); }
-#line 1571 "query_y.c" /* yacc.c:1646 */
+#line 1573 "query_y.c" /* yacc.c:1646 */
break;
case 26:
#line 189 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_SUB, (yyvsp[0].n)); }
-#line 1577 "query_y.c" /* yacc.c:1646 */
+#line 1579 "query_y.c" /* yacc.c:1646 */
break;
case 27:
#line 190 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_MUL, (yyvsp[0].n)); }
-#line 1583 "query_y.c" /* yacc.c:1646 */
+#line 1585 "query_y.c" /* yacc.c:1646 */
break;
case 28:
#line 191 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_DIV, (yyvsp[0].n)); }
-#line 1589 "query_y.c" /* yacc.c:1646 */
+#line 1591 "query_y.c" /* yacc.c:1646 */
break;
case 29:
#line 192 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_MATCH, make_regex_free((yyvsp[0].s))); }
-#line 1595 "query_y.c" /* yacc.c:1646 */
+#line 1597 "query_y.c" /* yacc.c:1646 */
break;
case 30:
#line 193 "query_y.y" /* yacc.c:1646 */
{ BINOP((yyval.n), (yyvsp[-2].n), PCBQ_OP_MATCH, make_regex_free((yyvsp[0].s))); }
-#line 1601 "query_y.c" /* yacc.c:1646 */
+#line 1603 "query_y.c" /* yacc.c:1646 */
break;
case 31:
#line 194 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 1607 "query_y.c" /* yacc.c:1646 */
+#line 1609 "query_y.c" /* yacc.c:1646 */
break;
case 32:
#line 195 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 1613 "query_y.c" /* yacc.c:1646 */
+#line 1615 "query_y.c" /* yacc.c:1646 */
break;
case 33:
@@ -1623,121 +1625,121 @@ yyreduce:
for(n = (yyvsp[0].n); n != NULL; n = n->next)
n->parent = (yyval.n);
}
-#line 1627 "query_y.c" /* yacc.c:1646 */
+#line 1629 "query_y.c" /* yacc.c:1646 */
break;
case 34:
#line 208 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_DATA_COORD); UNIT_CONV((yyval.n)->data.crd, 0, (yyvsp[-1].c), (yyvsp[0].u)); }
-#line 1633 "query_y.c" /* yacc.c:1646 */
+#line 1635 "query_y.c" /* yacc.c:1646 */
break;
case 35:
#line 209 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_DATA_DOUBLE); UNIT_CONV((yyval.n)->data.dbl, 0, (yyvsp[-1].d), (yyvsp[0].u)); }
-#line 1639 "query_y.c" /* yacc.c:1646 */
+#line 1641 "query_y.c" /* yacc.c:1646 */
break;
case 36:
#line 210 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_DATA_COORD); UNIT_CONV((yyval.n)->data.crd, 1, (yyvsp[-1].c), (yyvsp[0].u)); }
-#line 1645 "query_y.c" /* yacc.c:1646 */
+#line 1647 "query_y.c" /* yacc.c:1646 */
break;
case 37:
#line 211 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_DATA_DOUBLE); UNIT_CONV((yyval.n)->data.dbl, 1, (yyvsp[-1].d), (yyvsp[0].u)); }
-#line 1651 "query_y.c" /* yacc.c:1646 */
+#line 1653 "query_y.c" /* yacc.c:1646 */
break;
case 38:
#line 215 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_DATA_STRING); (yyval.n)->data.str = (yyvsp[0].s); }
-#line 1657 "query_y.c" /* yacc.c:1646 */
+#line 1659 "query_y.c" /* yacc.c:1646 */
break;
case 39:
#line 219 "query_y.y" /* yacc.c:1646 */
{ (yyval.u) = NULL; }
-#line 1663 "query_y.c" /* yacc.c:1646 */
+#line 1665 "query_y.c" /* yacc.c:1646 */
break;
case 40:
#line 220 "query_y.y" /* yacc.c:1646 */
{ (yyval.u) = (yyvsp[0].u); }
-#line 1669 "query_y.c" /* yacc.c:1646 */
+#line 1671 "query_y.c" /* yacc.c:1646 */
break;
case 41:
#line 224 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FIELD); (yyval.n)->data.str = (yyvsp[0].s); (yyval.n)->precomp.fld = query_fields_sphash((yyvsp[0].s)); }
-#line 1675 "query_y.c" /* yacc.c:1646 */
+#line 1677 "query_y.c" /* yacc.c:1646 */
break;
case 42:
#line 225 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FIELD); (yyval.n)->data.str = (yyvsp[-2].s); (yyval.n)->precomp.fld = query_fields_sphash((yyvsp[-2].s)); (yyval.n)->next = (yyvsp[0].n); }
-#line 1681 "query_y.c" /* yacc.c:1646 */
+#line 1683 "query_y.c" /* yacc.c:1646 */
break;
case 43:
#line 226 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); /* just ignore .p. */ }
-#line 1687 "query_y.c" /* yacc.c:1646 */
+#line 1689 "query_y.c" /* yacc.c:1646 */
break;
case 44:
#line 227 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FIELD); (yyval.n)->data.str = pcb_strdup("a"); (yyval.n)->precomp.fld = query_fields_sphash("a"); (yyval.n)->next = (yyvsp[0].n); }
-#line 1693 "query_y.c" /* yacc.c:1646 */
+#line 1695 "query_y.c" /* yacc.c:1646 */
break;
case 45:
#line 231 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FIELD); (yyval.n)->data.str = (yyvsp[0].s); }
-#line 1699 "query_y.c" /* yacc.c:1646 */
+#line 1701 "query_y.c" /* yacc.c:1646 */
break;
case 46:
#line 232 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FIELD); (yyval.n)->data.str = attrib_prepend_free((yyvsp[0].n)->data.str, (yyvsp[-2].s), '.'); }
-#line 1705 "query_y.c" /* yacc.c:1646 */
+#line 1707 "query_y.c" /* yacc.c:1646 */
break;
case 47:
#line 233 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FIELD); (yyval.n)->data.str = (yyvsp[0].s); }
-#line 1711 "query_y.c" /* yacc.c:1646 */
+#line 1713 "query_y.c" /* yacc.c:1646 */
break;
case 48:
#line 237 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_VAR); (yyval.n)->data.crd = pcb_qry_iter_var(iter_ctx, (yyvsp[0].s), 1); free((yyvsp[0].s)); }
-#line 1717 "query_y.c" /* yacc.c:1646 */
+#line 1719 "query_y.c" /* yacc.c:1646 */
break;
case 49:
#line 238 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_LISTVAR); (yyval.n)->data.str = pcb_strdup("@"); }
-#line 1723 "query_y.c" /* yacc.c:1646 */
+#line 1725 "query_y.c" /* yacc.c:1646 */
break;
case 50:
#line 239 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_VAR); (yyval.n)->data.crd = pcb_qry_iter_var(iter_ctx, "@", 1); }
-#line 1729 "query_y.c" /* yacc.c:1646 */
+#line 1731 "query_y.c" /* yacc.c:1646 */
break;
case 51:
#line 243 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FCALL); (yyval.n)->data.children = (yyvsp[-3].n); (yyval.n)->data.children->next = (yyvsp[-1].n); (yyvsp[-3].n)->parent = (yyvsp[-1].n)->parent = (yyval.n); }
-#line 1735 "query_y.c" /* yacc.c:1646 */
+#line 1737 "query_y.c" /* yacc.c:1646 */
break;
case 52:
#line 244 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_FCALL); (yyval.n)->data.children = (yyvsp[-2].n); (yyvsp[-2].n)->parent = (yyval.n); }
-#line 1741 "query_y.c" /* yacc.c:1646 */
+#line 1743 "query_y.c" /* yacc.c:1646 */
break;
case 53:
@@ -1752,25 +1754,25 @@ yyreduce:
}
free((yyvsp[0].s));
}
-#line 1756 "query_y.c" /* yacc.c:1646 */
+#line 1758 "query_y.c" /* yacc.c:1646 */
break;
case 54:
#line 262 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 1762 "query_y.c" /* yacc.c:1646 */
+#line 1764 "query_y.c" /* yacc.c:1646 */
break;
case 55:
#line 263 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[-2].n); (yyval.n)->next = (yyvsp[0].n); }
-#line 1768 "query_y.c" /* yacc.c:1646 */
+#line 1770 "query_y.c" /* yacc.c:1646 */
break;
case 56:
#line 267 "query_y.y" /* yacc.c:1646 */
{ (yyval.n) = pcb_qry_n_alloc(PCBQ_RNAME); (yyval.n)->data.str = (const char *)pcb_strdup(""); }
-#line 1774 "query_y.c" /* yacc.c:1646 */
+#line 1776 "query_y.c" /* yacc.c:1646 */
break;
case 57:
@@ -1782,11 +1784,11 @@ yyreduce:
memcpy((char *)(yyvsp[0].n)->data.str+l1, (yyvsp[-1].s), l2+1);
free((yyvsp[-1].s));
}
-#line 1786 "query_y.c" /* yacc.c:1646 */
+#line 1788 "query_y.c" /* yacc.c:1646 */
break;
-#line 1790 "query_y.c" /* yacc.c:1646 */
+#line 1792 "query_y.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
diff --git a/src_plugins/query/query_y.h b/src_plugins/query/query_y.h
index 8534068..266921d 100644
--- a/src_plugins/query/query_y.h
+++ b/src_plugins/query/query_y.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
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
@@ -70,19 +70,21 @@ extern int qry_debug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
+
union YYSTYPE
{
#line 95 "query_y.y" /* yacc.c:1909 */
char *s;
- Coord c;
+ pcb_coord_t c;
double d;
- const Unit *u;
+ const pcb_unit_t *u;
pcb_qry_node_t *n;
#line 85 "query_y.h" /* yacc.c:1909 */
};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
diff --git a/src_plugins/query/query_y.y b/src_plugins/query/query_y.y
index 25ed59b..2692fff 100644
--- a/src_plugins/query/query_y.y
+++ b/src_plugins/query/query_y.y
@@ -24,7 +24,7 @@
/* Query language - compiler: grammar */
#include <assert.h>
-#include "global.h"
+#include "const.h"
#include "unit.h"
#include "query.h"
#include "query_l.h"
@@ -37,9 +37,9 @@ do { \
if (negative) \
dst = -dst; \
if (unit != NULL) { \
- if (unit->family == IMPERIAL) \
+ if (unit->family == PCB_UNIT_IMPERIAL) \
dst = PCB_MIL_TO_COORD(dst); \
- else if (unit->family == METRIC) \
+ else if (unit->family == PCB_UNIT_METRIC) \
dst = PCB_MM_TO_COORD(dst); \
dst /= unit->scale_factor; \
} \
@@ -94,9 +94,9 @@ static pcb_qry_node_t *make_regex_free(char *str)
%union {
char *s;
- Coord c;
+ pcb_coord_t c;
double d;
- const Unit *u;
+ const pcb_unit_t *u;
pcb_qry_node_t *n;
}
diff --git a/src_plugins/renumber/Makefile b/src_plugins/renumber/Makefile
index a0c409d..1d16307 100644
--- a/src_plugins/renumber/Makefile
+++ b/src_plugins/renumber/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_renumber
+ cd ../../src && $(MAKE) mod_renumber
clean:
diff --git a/src_plugins/renumber/renumber.c b/src_plugins/renumber/renumber.c
index 604db8e..e85c573 100644
--- a/src_plugins/renumber/renumber.c
+++ b/src_plugins/renumber/renumber.c
@@ -25,26 +25,26 @@
*
*/
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "action_helper.h"
#include "change.h"
#include "error.h"
#include "undo.h"
-#include "misc.h"
-#include "set.h"
#include "plugins.h"
#include "hid_actions.h"
#include "conf_core.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "netlist.h"
#include "pcb-printf.h"
/* --------------------------------------------------------------------------- */
-static const char renumber_syntax[] = "Renumber()\n" "Renumber(filename)";
+static const char pcb_acts_Renumber[] = "Renumber()\n" "Renumber(filename)";
-static const char renumber_help[] =
+static const char pcb_acth_Renumber[] =
"Renumber all elements. The changes will be recorded to filename\n"
"for use in backannotating these changes to the schematic.";
@@ -54,11 +54,11 @@ static const char renumber_help[] =
#define WTF 0
-static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
+static int pcb_act_Renumber(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
pcb_bool changed = pcb_false;
- ElementTypePtr *element_list;
- ElementTypePtr *locked_element_list;
+ pcb_element_t **element_list;
+ pcb_element_t **locked_element_list;
unsigned int i, j, k, cnt, lock_cnt;
unsigned int tmpi;
size_t sz;
@@ -81,7 +81,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
* We deal with the case where name already exists in this
* function so the GUI doesn't need to deal with it
*/
- name = gui->fileselect(_("Save Renumber Annotation File As ..."),
+ name = pcb_gui->fileselect(_("Save Renumber Annotation File As ..."),
_("Choose a file to record the renumbering to.\n"
"This file may be used to back annotate the\n"
"change to the schematics.\n"), default_file, ".eco", "eco", 0);
@@ -102,7 +102,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
if ((out = fopen(name, "r"))) {
fclose(out);
- if (!gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) {
+ if (!pcb_gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) {
if (free_name && name)
free((char*)name);
return 0;
@@ -110,7 +110,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
}
if ((out = fopen(name, "w")) == NULL) {
- Message(PCB_MSG_DEFAULT, _("Could not open %s\n"), name);
+ pcb_message(PCB_MSG_ERROR, _("Could not open %s\n"), name);
if (free_name && name)
free((char*)name);
return 1;
@@ -130,28 +130,28 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
* We'll actually renumber things in the 2nd pass.
*/
numele = elementlist_length(&PCB->Data->Element);
- element_list = (ElementType **) calloc(numele, sizeof(ElementTypePtr));
- locked_element_list = (ElementType **) calloc(numele, sizeof(ElementTypePtr));
+ element_list = (pcb_element_t **) calloc(numele, sizeof(pcb_element_t *));
+ locked_element_list = (pcb_element_t **) calloc(numele, sizeof(pcb_element_t *));
was = (char **) calloc(numele, sizeof(char *));
is = (char **) calloc(numele, sizeof(char *));
if (element_list == NULL || locked_element_list == NULL || was == NULL || is == NULL) {
- fprintf(stderr, "calloc() failed in ActionRenumber\n");
+ fprintf(stderr, "calloc() failed in pcb_act_Renumber\n");
exit(1);
}
cnt = 0;
lock_cnt = 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_LOCK, element->Name) || TEST_FLAG(PCB_FLAG_LOCK, element)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, element->Name) || PCB_FLAG_TEST(PCB_FLAG_LOCK, element)) {
/*
* add to the list of locked elements which we won't try to
* renumber and whose reference designators are now reserved.
*/
pcb_fprintf(out,
"*WARN* Element \"%s\" at %$md is locked and will not be renumbered.\n",
- UNKNOWN(NAMEONPCB_NAME(element)), element->MarkX, element->MarkY);
+ PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), element->MarkX, element->MarkY);
locked_element_list[lock_cnt] = element;
lock_cnt++;
}
@@ -180,7 +180,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
element_list[i] = element;
}
}
- END_LOOP;
+ PCB_END_LOOP;
/*
@@ -199,9 +199,9 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
cnt_list = (struct _cnt_list *) calloc(cnt_list_sz, sizeof(struct _cnt_list));
for (i = 0; i < cnt; i++) {
/* If there is no refdes, maybe just spit out a warning */
- if (NAMEONPCB_NAME(element_list[i])) {
+ if (PCB_ELEM_NAME_REFDES(element_list[i])) {
/* figure out the prefix */
- tmps = pcb_strdup(NAMEONPCB_NAME(element_list[i]));
+ tmps = pcb_strdup(PCB_ELEM_NAME_REFDES(element_list[i]));
j = 0;
while (tmps[j] && (tmps[j] < '0' || tmps[j] > '9')
&& tmps[j] != '?')
@@ -217,7 +217,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
cnt_list_sz += 100;
cnt_list = (struct _cnt_list *) realloc(cnt_list, cnt_list_sz);
if (cnt_list == NULL) {
- fprintf(stderr, "realloc() failed in ActionRenumber\n");
+ fprintf(stderr, "realloc() failed in pcb_act_Renumber\n");
exit(1);
}
/* zero out the memory that we added */
@@ -262,7 +262,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
* elements) names
*/
for (k = 0; k < lock_cnt; k++) {
- if (strcmp(UNKNOWN(NAMEONPCB_NAME(locked_element_list[k])), tmps) == 0) {
+ if (strcmp(PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(locked_element_list[k])), tmps) == 0) {
ok = 0;
break;
}
@@ -271,17 +271,17 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
}
while (!ok);
- if (strcmp(tmps, NAMEONPCB_NAME(element_list[i])) != 0) {
- fprintf(out, "*RENAME* \"%s\" \"%s\"\n", NAMEONPCB_NAME(element_list[i]), tmps);
+ if (strcmp(tmps, PCB_ELEM_NAME_REFDES(element_list[i])) != 0) {
+ fprintf(out, "*RENAME* \"%s\" \"%s\"\n", PCB_ELEM_NAME_REFDES(element_list[i]), tmps);
/* add this rename to our table of renames so we can update the netlist */
- was[c_cnt] = pcb_strdup(NAMEONPCB_NAME(element_list[i]));
+ was[c_cnt] = pcb_strdup(PCB_ELEM_NAME_REFDES(element_list[i]));
is[c_cnt] = pcb_strdup(tmps);
c_cnt++;
- AddObjectToChangeNameUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element_list[i], NAMEONPCB_NAME(element_list[i]));
+ pcb_undo_add_obj_to_change_name(PCB_TYPE_ELEMENT, NULL, NULL, element_list[i], PCB_ELEM_NAME_REFDES(element_list[i]));
- ChangeObjectName(PCB_TYPE_ELEMENT, element_list[i], NULL, NULL, tmps);
+ pcb_chg_obj_name(PCB_TYPE_ELEMENT, element_list[i], NULL, NULL, tmps);
changed = pcb_true;
/* we don't free tmps in this case because it is used */
@@ -303,7 +303,7 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
if (changed) {
/* update the netlist */
- AddNetlistLibToUndoList(PCB->NetlistLib);
+ pcb_undo_add_netlist_lib(PCB->NetlistLib);
/* iterate over each net */
for (i = 0; i < PCB->NetlistLib[WTF].MenuN; i++) {
@@ -342,8 +342,8 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
}
pcb_netlist_changed(0);
- IncrementUndoSerialNumber();
- SetChangedFlag(pcb_true);
+ pcb_undo_inc_serial();
+ pcb_board_set_changed_flag(pcb_true);
}
free(locked_element_list);
@@ -352,31 +352,31 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y)
return 0;
}
-int action_renumber_block(int argc, const char **argv, Coord x, Coord y);
-int action_renumber_buffer(int argc, const char **argv, Coord x, Coord y);
+int pcb_act_RenumberBlock(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
+int pcb_act_RenumberBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y);
static const char *renumber_cookie = "renumber plugin";
-HID_Action renumber_action_list[] = {
- {"Renumber", 0, ActionRenumber,
- renumber_help, renumber_syntax},
- {"RenumberBlock", NULL, action_renumber_block,
+pcb_hid_action_t renumber_action_list[] = {
+ {"Renumber", 0, pcb_act_Renumber,
+ pcb_acth_Renumber, pcb_acts_Renumber},
+ {"RenumberBlock", NULL, pcb_act_RenumberBlock,
NULL, NULL},
- {"RenumberBuffer", NULL, action_renumber_buffer,
+ {"RenumberBuffer", NULL, pcb_act_RenumberBuffer,
NULL, NULL}
};
static void hid_renumber_uninit(void)
{
- hid_remove_actions_by_cookie(renumber_cookie);
+ pcb_hid_remove_actions_by_cookie(renumber_cookie);
}
-REGISTER_ACTIONS(renumber_action_list, renumber_cookie)
+PCB_REGISTER_ACTIONS(renumber_action_list, renumber_cookie)
#include "dolists.h"
pcb_uninit_t hid_renumber_init(void)
{
- REGISTER_ACTIONS(renumber_action_list, renumber_cookie)
+ PCB_REGISTER_ACTIONS(renumber_action_list, renumber_cookie)
return hid_renumber_uninit;
}
diff --git a/src_plugins/renumber/renumberblock.c b/src_plugins/renumber/renumberblock.c
index fc76dde..f9d6283 100644
--- a/src_plugins/renumber/renumberblock.c
+++ b/src_plugins/renumber/renumberblock.c
@@ -25,24 +25,22 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "error.h"
#include "change.h"
#include "conf_core.h"
-int action_renumber_block(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_RenumberBlock(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
char num_buf[15];
int old_base, new_base;
if (argc < 2) {
- Message(PCB_MSG_ERROR, "Usage: RenumberBlock oldnum newnum");
+ pcb_message(PCB_MSG_ERROR, "Usage: RenumberBlock oldnum newnum");
return 1;
}
@@ -51,13 +49,13 @@ int action_renumber_block(int argc, const char **argv, Coord x, Coord y)
conf_set_editor(name_on_pcb, 1);
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
char *refdes_split, *cp;
char *old_ref, *new_ref;
int num;
- if (!TEST_FLAG(PCB_FLAG_SELECTED, element))
+ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))
continue;
old_ref = element->Name[1].TextString;
@@ -72,22 +70,22 @@ int action_renumber_block(int argc, const char **argv, Coord x, Coord y)
memcpy(new_ref, old_ref, refdes_split - old_ref);
strcpy(new_ref + (refdes_split - old_ref), num_buf);
- AddObjectToChangeNameUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element, NAMEONPCB_NAME(element));
+ pcb_undo_add_obj_to_change_name(PCB_TYPE_ELEMENT, NULL, NULL, element, PCB_ELEM_NAME_REFDES(element));
- ChangeObjectName(PCB_TYPE_ELEMENT, element, NULL, NULL, new_ref);
+ pcb_chg_obj_name(PCB_TYPE_ELEMENT, element, NULL, NULL, new_ref);
}
- END_LOOP;
- IncrementUndoSerialNumber();
+ PCB_END_LOOP;
+ pcb_undo_inc_serial();
return 0;
}
-int action_renumber_buffer(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_RenumberBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
char num_buf[15];
int old_base, new_base;
if (argc < 2) {
- Message(PCB_MSG_ERROR, "Usage: RenumberBuffer oldnum newnum");
+ pcb_message(PCB_MSG_ERROR, "Usage: RenumberBuffer oldnum newnum");
return 1;
}
@@ -96,7 +94,7 @@ int action_renumber_buffer(int argc, const char **argv, Coord x, Coord y)
conf_set_editor(name_on_pcb, 1);
- ELEMENT_LOOP(PASTEBUFFER->Data);
+ PCB_ELEMENT_LOOP(PCB_PASTEBUFFER->Data);
{
char *refdes_split, *cp;
char *old_ref, *new_ref;
@@ -114,8 +112,8 @@ int action_renumber_buffer(int argc, const char **argv, Coord x, Coord y)
memcpy(new_ref, old_ref, refdes_split - old_ref);
strcpy(new_ref + (refdes_split - old_ref), num_buf);
- ChangeObjectName(PCB_TYPE_ELEMENT, element, NULL, NULL, new_ref);
+ pcb_chg_obj_name(PCB_TYPE_ELEMENT, element, NULL, NULL, new_ref);
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
diff --git a/src_plugins/report/Makefile b/src_plugins/report/Makefile
index 61be1b8..3d52bc3 100644
--- a/src_plugins/report/Makefile
+++ b/src_plugins/report/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_report
+ cd ../../src && $(MAKE) mod_report
clean:
diff --git a/src_plugins/report/Plug.tmpasm b/src_plugins/report/Plug.tmpasm
index 91b5230..c8c6e12 100644
--- a/src_plugins/report/Plug.tmpasm
+++ b/src_plugins/report/Plug.tmpasm
@@ -1,5 +1,8 @@
put /local/pcb/mod {report}
-put /local/pcb/mod/OBJS [@ $(PLUGDIR)/report/report.o @]
+put /local/pcb/mod/OBJS [@
+ $(PLUGDIR)/report/report.o
+ $(PLUGDIR)/report/drill.o
+@]
put /local/pcb/mod/CONF {$(PLUGDIR)/report/report_conf.h}
switch /local/pcb/report/controls
diff --git a/src_plugins/report/drill.c b/src_plugins/report/drill.c
new file mode 100644
index 0000000..44a16b3
--- /dev/null
+++ b/src_plugins/report/drill.c
@@ -0,0 +1,306 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996 Thomas Nau
+ *
+ * This module, drill.c, was written and is Copyright (C) 1997 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Contact addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+#include "config.h"
+
+#include "data.h"
+#include "drill.h"
+#include "macro.h"
+#include "obj_pinvia.h"
+
+#define STEP_ELEMENT 50
+#define STEP_DRILL 30
+#define STEP_POINT 100
+
+/*
+ * some local prototypes
+ */
+static void FillDrill(DrillTypePtr, pcb_element_t *, pcb_pin_t *);
+static void InitializeDrill(DrillTypePtr, pcb_pin_t *, pcb_element_t *);
+
+
+static void FillDrill(DrillTypePtr Drill, pcb_element_t *Element, pcb_pin_t *Pin)
+{
+ pcb_cardinal_t n;
+ pcb_element_t **ptr;
+ pcb_pin_t ** pin;
+
+ pin = GetDrillPinMemory(Drill);
+ *pin = Pin;
+ if (Element) {
+ Drill->PinCount++;
+ for (n = Drill->ElementN - 1; n != -1; n--)
+ if (Drill->Element[n] == Element)
+ break;
+ if (n == -1) {
+ ptr = GetDrillElementMemory(Drill);
+ *ptr = Element;
+ }
+ }
+ else
+ Drill->ViaCount++;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, Pin))
+ Drill->UnplatedCount++;
+}
+
+static void InitializeDrill(DrillTypePtr drill, pcb_pin_t *pin, pcb_element_t *element)
+{
+ void *ptr;
+
+ drill->DrillSize = pin->DrillingHole;
+ drill->ElementN = 0;
+ drill->ViaCount = 0;
+ drill->PinCount = 0;
+ drill->UnplatedCount = 0;
+ drill->ElementMax = 0;
+ drill->Element = NULL;
+ drill->PinN = 0;
+ drill->Pin = NULL;
+ drill->PinMax = 0;
+ ptr = (void *) GetDrillPinMemory(drill);
+ *((pcb_pin_t **) ptr) = pin;
+ if (element) {
+ ptr = (void *) GetDrillElementMemory(drill);
+ *((pcb_element_t **) ptr) = element;
+ drill->PinCount = 1;
+ }
+ else
+ drill->ViaCount = 1;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pin))
+ drill->UnplatedCount = 1;
+}
+
+static int DrillQSort(const void *va, const void *vb)
+{
+ DrillType *a = (DrillType *) va;
+ DrillType *b = (DrillType *) vb;
+ return a->DrillSize - b->DrillSize;
+}
+
+DrillInfoTypePtr GetDrillInfo(pcb_data_t *top)
+{
+ DrillInfoTypePtr AllDrills;
+ DrillTypePtr Drill = NULL;
+ DrillType savedrill, swapdrill;
+ pcb_bool DrillFound = pcb_false;
+ pcb_bool NewDrill;
+
+ AllDrills = (DrillInfoTypePtr) calloc(1, sizeof(DrillInfoType));
+ PCB_PIN_ALL_LOOP(top);
+ {
+ if (!DrillFound) {
+ DrillFound = pcb_true;
+ Drill = GetDrillInfoDrillMemory(AllDrills);
+ InitializeDrill(Drill, pin, element);
+ }
+ else {
+ if (Drill->DrillSize == pin->DrillingHole)
+ FillDrill(Drill, element, pin);
+ else {
+ NewDrill = pcb_false;
+ DRILL_LOOP(AllDrills);
+ {
+ if (drill->DrillSize == pin->DrillingHole) {
+ Drill = drill;
+ FillDrill(Drill, element, pin);
+ break;
+ }
+ else if (drill->DrillSize > pin->DrillingHole) {
+ if (!NewDrill) {
+ NewDrill = pcb_true;
+ InitializeDrill(&swapdrill, pin, element);
+ Drill = GetDrillInfoDrillMemory(AllDrills);
+ Drill->DrillSize = pin->DrillingHole + 1;
+ Drill = drill;
+ }
+ savedrill = *drill;
+ *drill = swapdrill;
+ swapdrill = savedrill;
+ }
+ }
+ PCB_END_LOOP;
+ if (AllDrills->Drill[AllDrills->DrillN - 1].DrillSize < pin->DrillingHole) {
+ Drill = GetDrillInfoDrillMemory(AllDrills);
+ InitializeDrill(Drill, pin, element);
+ }
+ }
+ }
+ }
+ PCB_ENDALL_LOOP;
+ PCB_VIA_LOOP(top);
+ {
+ if (!DrillFound) {
+ DrillFound = pcb_true;
+ Drill = GetDrillInfoDrillMemory(AllDrills);
+ Drill->DrillSize = via->DrillingHole;
+ FillDrill(Drill, NULL, via);
+ }
+ else {
+ if (Drill->DrillSize != via->DrillingHole) {
+ DRILL_LOOP(AllDrills);
+ {
+ if (drill->DrillSize == via->DrillingHole) {
+ Drill = drill;
+ FillDrill(Drill, NULL, via);
+ break;
+ }
+ }
+ PCB_END_LOOP;
+ if (Drill->DrillSize != via->DrillingHole) {
+ Drill = GetDrillInfoDrillMemory(AllDrills);
+ Drill->DrillSize = via->DrillingHole;
+ FillDrill(Drill, NULL, via);
+ }
+ }
+ else
+ FillDrill(Drill, NULL, via);
+ }
+ }
+ PCB_END_LOOP;
+ qsort(AllDrills->Drill, AllDrills->DrillN, sizeof(DrillType), DrillQSort);
+ return (AllDrills);
+}
+
+#define ROUND(x,n) ((int)(((x)+(n)/2)/(n))*(n))
+
+void RoundDrillInfo(DrillInfoTypePtr d, int roundto)
+{
+ unsigned int i = 0;
+
+ while ((d->DrillN > 0) && (i < d->DrillN - 1)) {
+ int diam1 = ROUND(d->Drill[i].DrillSize, roundto);
+ int diam2 = ROUND(d->Drill[i + 1].DrillSize, roundto);
+
+ if (diam1 == diam2) {
+ int ei, ej;
+
+ d->Drill[i].ElementMax = d->Drill[i].ElementN + d->Drill[i + 1].ElementN;
+ if (d->Drill[i].ElementMax) {
+ d->Drill[i].Element = (pcb_element_t **) realloc(d->Drill[i].Element, d->Drill[i].ElementMax * sizeof(pcb_element_t *));
+
+ for (ei = 0; ei < d->Drill[i + 1].ElementN; ei++) {
+ for (ej = 0; ej < d->Drill[i].ElementN; ej++)
+ if (d->Drill[i].Element[ej] == d->Drill[i + 1].Element[ei])
+ break;
+ if (ej == d->Drill[i].ElementN)
+ d->Drill[i].Element[d->Drill[i].ElementN++]
+ = d->Drill[i + 1].Element[ei];
+ }
+ }
+ free(d->Drill[i + 1].Element);
+ d->Drill[i + 1].Element = NULL;
+
+ d->Drill[i].PinMax = d->Drill[i].PinN + d->Drill[i + 1].PinN;
+ d->Drill[i].Pin = (pcb_pin_t **) realloc(d->Drill[i].Pin, d->Drill[i].PinMax * sizeof(pcb_pin_t *));
+ memcpy(d->Drill[i].Pin + d->Drill[i].PinN, d->Drill[i + 1].Pin, d->Drill[i + 1].PinN * sizeof(pcb_pin_t *));
+ d->Drill[i].PinN += d->Drill[i + 1].PinN;
+ free(d->Drill[i + 1].Pin);
+ d->Drill[i + 1].Pin = NULL;
+
+ d->Drill[i].PinCount += d->Drill[i + 1].PinCount;
+ d->Drill[i].ViaCount += d->Drill[i + 1].ViaCount;
+ d->Drill[i].UnplatedCount += d->Drill[i + 1].UnplatedCount;
+
+ d->Drill[i].DrillSize = diam1;
+
+ memmove(d->Drill + i + 1, d->Drill + i + 2, (d->DrillN - i - 2) * sizeof(DrillType));
+ d->DrillN--;
+ }
+ else {
+ d->Drill[i].DrillSize = diam1;
+ i++;
+ }
+ }
+}
+
+void FreeDrillInfo(DrillInfoTypePtr Drills)
+{
+ DRILL_LOOP(Drills);
+ {
+ free(drill->Element);
+ free(drill->Pin);
+ }
+ PCB_END_LOOP;
+ free(Drills->Drill);
+ free(Drills);
+}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a Drill, allocates memory if necessary
+ */
+DrillTypePtr GetDrillInfoDrillMemory(DrillInfoTypePtr DrillInfo)
+{
+ DrillTypePtr drill = DrillInfo->Drill;
+
+ /* realloc new memory if necessary and clear it */
+ if (DrillInfo->DrillN >= DrillInfo->DrillMax) {
+ DrillInfo->DrillMax += STEP_DRILL;
+ drill = (DrillTypePtr) realloc(drill, DrillInfo->DrillMax * sizeof(DrillType));
+ DrillInfo->Drill = drill;
+ memset(drill + DrillInfo->DrillN, 0, STEP_DRILL * sizeof(DrillType));
+ }
+ return (drill + DrillInfo->DrillN++);
+}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a DrillPoint, allocates memory if necessary
+ */
+pcb_pin_t ** GetDrillPinMemory(DrillTypePtr Drill)
+{
+ pcb_pin_t **pin;
+
+ pin = Drill->Pin;
+
+ /* realloc new memory if necessary and clear it */
+ if (Drill->PinN >= Drill->PinMax) {
+ Drill->PinMax += STEP_POINT;
+ pin = (pcb_pin_t **) realloc(pin, Drill->PinMax * sizeof(pcb_pin_t **));
+ Drill->Pin = pin;
+ memset(pin + Drill->PinN, 0, STEP_POINT * sizeof(pcb_pin_t **));
+ }
+ return (pin + Drill->PinN++);
+}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a DrillElement, allocates memory if necessary
+ */
+pcb_element_t **GetDrillElementMemory(DrillTypePtr Drill)
+{
+ pcb_element_t **element;
+
+ element = Drill->Element;
+
+ /* realloc new memory if necessary and clear it */
+ if (Drill->ElementN >= Drill->ElementMax) {
+ Drill->ElementMax += STEP_ELEMENT;
+ element = (pcb_element_t **) realloc(element, Drill->ElementMax * sizeof(pcb_element_t **));
+ Drill->Element = element;
+ memset(element + Drill->ElementN, 0, STEP_ELEMENT * sizeof(pcb_element_t **));
+ }
+ return (element + Drill->ElementN++);
+}
+
diff --git a/src_plugins/report/drill.h b/src_plugins/report/drill.h
new file mode 100644
index 0000000..955936e
--- /dev/null
+++ b/src_plugins/report/drill.h
@@ -0,0 +1,64 @@
+/*
+ * COPYRIGHT
+ *
+ * PCB, interactive printed circuit board design
+ * Copyright (C) 1994,1995,1996 Thomas Nau
+ *
+ * This module, drill.h, was written and is Copyright (C) 1997 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Contact addresses for paper mail and Email:
+ * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
+ * Thomas.Nau at rz.uni-ulm.de
+ *
+ */
+#ifndef PCB_DRILL_H
+#define PCB_DRILL_H
+
+typedef struct { /* holds drill information */
+ pcb_coord_t DrillSize; /* this drill's diameter */
+ pcb_cardinal_t ElementN, /* the number of elements using this drill size */
+ ElementMax, /* max number of elements from malloc() */
+ PinCount, /* number of pins drilled this size */
+ ViaCount, /* number of vias drilled this size */
+ UnplatedCount, /* number of these holes that are unplated */
+ PinN, /* number of drill coordinates in the list */
+ PinMax; /* max number of coordinates from malloc() */
+ pcb_pin_t **Pin; /* coordinates to drill */
+ pcb_element_t **Element; /* a pointer to an array of element pointers */
+} DrillType, *DrillTypePtr;
+
+typedef struct { /* holds a range of Drill Infos */
+ pcb_cardinal_t DrillN, /* number of drill sizes */
+ DrillMax; /* max number from malloc() */
+ DrillTypePtr Drill; /* plated holes */
+} DrillInfoType, *DrillInfoTypePtr;
+
+DrillInfoTypePtr GetDrillInfo(pcb_data_t *);
+void FreeDrillInfo(DrillInfoTypePtr);
+void RoundDrillInfo(DrillInfoTypePtr, int);
+DrillTypePtr GetDrillInfoDrillMemory(DrillInfoTypePtr);
+pcb_pin_t **GetDrillPinMemory(DrillTypePtr);
+pcb_element_t **GetDrillElementMemory(DrillTypePtr);
+
+#define DRILL_LOOP(top) do { \
+ pcb_cardinal_t n; \
+ DrillTypePtr drill; \
+ for (n = 0; (top)->DrillN > 0 && n < (top)->DrillN; n++) \
+ { \
+ drill = &(top)->Drill[n]
+
+#endif
diff --git a/src_plugins/report/report.c b/src_plugins/report/report.c
index d20f143..f5675b8 100644
--- a/src_plugins/report/report.c
+++ b/src_plugins/report/report.c
@@ -33,35 +33,39 @@
#include <math.h>
#include "report.h"
+#include "math_helper.h"
#include "crosshair.h"
+#include "board.h"
#include "data.h"
#include "drill.h"
#include "error.h"
#include "search.h"
-#include "misc.h"
-#include "mymem.h"
#include "rats.h"
#include "rtree.h"
-#include "strflags.h"
+#include "flag_str.h"
#include "macro.h"
#include "undo.h"
#include "find.h"
#include "draw.h"
#include "pcb-printf.h"
#include "plugins.h"
+#include "action_helper.h"
#include "hid_actions.h"
#include "misc_util.h"
#include "report_conf.h"
#include "compat_misc.h"
+#include "compat_nls.h"
#include "layer.h"
+#include "obj_all.h"
#include <genregex/regex_sei.h>
conf_report_t conf_report;
+#define AUSAGE(x) pcb_message(PCB_MSG_INFO, "Usage:\n%s\n", (x##_syntax))
#define USER_UNITMASK (conf_core.editor.grid_unit->allow)
-static int ReportDrills(int argc, const char **argv, Coord x, Coord y)
+static int ReportDrills(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
DrillInfoTypePtr AllDrills;
pcb_cardinal_t n;
@@ -101,7 +105,7 @@ static int ReportDrills(int argc, const char **argv, Coord x, Coord y)
}
FreeDrillInfo(AllDrills);
/* create dialog box */
- gui->report_dialog("Drill Report", stringlist);
+ pcb_gui->report_dialog("Drill Report", stringlist);
free(stringlist);
return 0;
@@ -118,34 +122,34 @@ This is a shortcut for @code{Report(Object)}.
%end-doc */
-static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
+static int ReportDialog(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
void *ptr1, *ptr2, *ptr3;
int type;
char *report = NULL;
- type = SearchScreen(x, y, REPORT_TYPES, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(x, y, REPORT_TYPES, &ptr1, &ptr2, &ptr3);
if (type == PCB_TYPE_NONE)
- type = SearchScreen(x, y, REPORT_TYPES | PCB_TYPE_LOCKED, &ptr1, &ptr2, &ptr3);
+ type = pcb_search_screen(x, y, REPORT_TYPES | PCB_TYPE_LOCKED, &ptr1, &ptr2, &ptr3);
switch (type) {
case PCB_TYPE_VIA:
{
- PinTypePtr via;
+ pcb_pin_t *via;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- __r_dump_tree(PCB->Data->via_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_r_dump_tree(PCB->Data->via_tree->root, 0);
return 0;
}
#endif
- via = (PinTypePtr) ptr2;
- if (TEST_FLAG(PCB_FLAG_HOLE, via))
+ via = (pcb_pin_t *) ptr2;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, via))
report = pcb_strdup_printf("%m+VIA ID# %ld; Flags:%s\n"
"(X,Y) = %$mD.\n"
"It is a pure hole of diameter %$mS.\n"
"Name = \"%s\"."
- "%s", USER_UNITMASK, via->ID, flags_to_string(via->Flags, PCB_TYPE_VIA),
- via->X, via->Y, via->DrillingHole, EMPTY(via->Name), TEST_FLAG(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : "");
+ "%s", USER_UNITMASK, via->ID, pcb_strflg_f2s(via->Flags, PCB_TYPE_VIA),
+ via->X, via->Y, via->DrillingHole, PCB_EMPTY(via->Name), PCB_FLAG_TEST(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : "");
else
report = pcb_strdup_printf("%m+VIA ID# %ld; Flags:%s\n"
"(X,Y) = %$mD.\n"
@@ -154,43 +158,43 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
"Annulus = %$mS.\n"
"Solder mask hole = %$mS (gap = %$mS).\n"
"Name = \"%s\"."
- "%s", USER_UNITMASK, via->ID, flags_to_string(via->Flags, PCB_TYPE_VIA),
+ "%s", USER_UNITMASK, via->ID, pcb_strflg_f2s(via->Flags, PCB_TYPE_VIA),
via->X, via->Y,
via->Thickness,
via->DrillingHole,
via->Clearance / 2,
(via->Thickness - via->DrillingHole) / 2,
via->Mask,
- (via->Mask - via->Thickness) / 2, EMPTY(via->Name), TEST_FLAG(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : "");
+ (via->Mask - via->Thickness) / 2, PCB_EMPTY(via->Name), PCB_FLAG_TEST(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_PIN:
{
- PinTypePtr Pin;
- ElementTypePtr element;
+ pcb_pin_t *Pin;
+ pcb_element_t *element;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- __r_dump_tree(PCB->Data->pin_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_r_dump_tree(PCB->Data->pin_tree->root, 0);
return 0;
}
#endif
- Pin = (PinTypePtr) ptr2;
- element = (ElementTypePtr) ptr1;
+ Pin = (pcb_pin_t *) ptr2;
+ element = (pcb_element_t *) ptr1;
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
if (pin == Pin)
break;
}
- END_LOOP;
- if (TEST_FLAG(PCB_FLAG_HOLE, Pin))
+ PCB_END_LOOP;
+ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, Pin))
report = pcb_strdup_printf("%m+PIN ID# %ld; Flags:%s\n"
"(X,Y) = %$mD.\n"
"It is a mounting hole. Drill width = %$mS.\n"
"It is owned by element %$mS.\n"
- "%s", USER_UNITMASK, Pin->ID, flags_to_string(Pin->Flags, PCB_TYPE_PIN),
+ "%s", USER_UNITMASK, Pin->ID, pcb_strflg_f2s(Pin->Flags, PCB_TYPE_PIN),
Pin->X, Pin->Y, Pin->DrillingHole,
- EMPTY(element->Name[1].TextString), TEST_FLAG(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : "");
+ PCB_EMPTY(element->Name[1].TextString), PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : "");
else
report = pcb_strdup_printf(
"%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n"
@@ -201,28 +205,28 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
"Name = \"%s\".\n"
"It is owned by element %s\n as pin number %s.\n"
"%s", USER_UNITMASK,
- Pin->ID, flags_to_string(Pin->Flags, PCB_TYPE_PIN),
+ Pin->ID, pcb_strflg_f2s(Pin->Flags, PCB_TYPE_PIN),
Pin->X, Pin->Y, Pin->Thickness,
Pin->DrillingHole,
Pin->Clearance / 2,
(Pin->Thickness - Pin->DrillingHole) / 2,
Pin->Mask,
(Pin->Mask - Pin->Thickness) / 2,
- EMPTY(Pin->Name),
- EMPTY(element->Name[1].TextString), EMPTY(Pin->Number), TEST_FLAG(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : "");
+ PCB_EMPTY(Pin->Name),
+ PCB_EMPTY(element->Name[1].TextString), PCB_EMPTY(Pin->Number), PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_LINE:
{
- LineTypePtr line;
+ pcb_line_t *line;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- LayerTypePtr layer = (LayerTypePtr) ptr1;
- __r_dump_tree(layer->line_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_layer_t *layer = (pcb_layer_t *) ptr1;
+ pcb_r_dump_tree(layer->line_tree->root, 0);
return 0;
}
#endif
- line = (LineTypePtr) ptr2;
+ line = (pcb_line_t *) ptr2;
report = pcb_strdup_printf("%m+LINE ID# %ld; Flags:%s\n"
"FirstPoint(X,Y) = %$mD, ID = %ld.\n"
"SecondPoint(X,Y) = %$mD, ID = %ld.\n"
@@ -230,47 +234,48 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
"It is on layer %d\n"
"and has name \"%s\".\n"
"%s", USER_UNITMASK,
- line->ID, flags_to_string(line->Flags, PCB_TYPE_LINE),
+ line->ID, pcb_strflg_f2s(line->Flags, PCB_TYPE_LINE),
line->Point1.X, line->Point1.Y, line->Point1.ID,
line->Point2.X, line->Point2.Y, line->Point2.ID,
line->Thickness, line->Clearance / 2,
- GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1),
- UNKNOWN(line->Number), TEST_FLAG(PCB_FLAG_LOCK, line) ? "It is LOCKED.\n" : "");
+ pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1),
+ PCB_UNKNOWN(line->Number), PCB_FLAG_TEST(PCB_FLAG_LOCK, line) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_RATLINE:
{
- RatTypePtr line;
+ pcb_rat_t *line;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- __r_dump_tree(PCB->Data->rat_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_r_dump_tree(PCB->Data->rat_tree->root, 0);
return 0;
}
#endif
- line = (RatTypePtr) ptr2;
+ line = (pcb_rat_t *) ptr2;
report = pcb_strdup_printf("%m+RAT-LINE ID# %ld; Flags:%s\n"
"FirstPoint(X,Y) = %$mD; ID = %ld; "
"connects to layer group %d.\n"
"SecondPoint(X,Y) = %$mD; ID = %ld; "
"connects to layer group %d.\n",
- USER_UNITMASK, line->ID, flags_to_string(line->Flags, PCB_TYPE_LINE),
+ USER_UNITMASK, line->ID, pcb_strflg_f2s(line->Flags, PCB_TYPE_LINE),
line->Point1.X, line->Point1.Y,
line->Point1.ID, line->group1, line->Point2.X, line->Point2.Y, line->Point2.ID, line->group2);
break;
}
case PCB_TYPE_ARC:
{
- ArcTypePtr Arc;
- BoxTypePtr box;
+ pcb_arc_t *Arc;
+ pcb_box_t box;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- LayerTypePtr layer = (LayerTypePtr) ptr1;
- __r_dump_tree(layer->arc_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_layer_t *layer = (pcb_layer_t *) ptr1;
+ pcb_r_dump_tree(layer->arc_tree->root, 0);
return 0;
}
#endif
- Arc = (ArcTypePtr) ptr2;
- box = GetArcEnds(Arc);
+ Arc = (pcb_arc_t *) ptr2;
+ pcb_arc_get_end(Arc, 0, &box.X1, &box.Y1);
+ pcb_arc_get_end(Arc, 1, &box.X2, &box.Y2);
report = pcb_strdup_printf("%m+ARC ID# %ld; Flags:%s\n"
"CenterPoint(X,Y) = %$mD.\n"
@@ -280,28 +285,28 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
"Bounding Box is %$mD, %$mD.\n"
"That makes the end points at %$mD and %$mD.\n"
"It is on layer %d.\n"
- "%s", USER_UNITMASK, Arc->ID, flags_to_string(Arc->Flags, PCB_TYPE_ARC),
+ "%s", USER_UNITMASK, Arc->ID, pcb_strflg_f2s(Arc->Flags, PCB_TYPE_ARC),
Arc->X, Arc->Y,
Arc->Width, Arc->Thickness,
Arc->Clearance / 2, Arc->StartAngle, Arc->Delta,
Arc->BoundingBox.X1, Arc->BoundingBox.Y1,
Arc->BoundingBox.X2, Arc->BoundingBox.Y2,
- box->X1, box->Y1,
- box->X2, box->Y2,
- GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), TEST_FLAG(PCB_FLAG_LOCK, Arc) ? "It is LOCKED.\n" : "");
+ box.X1, box.Y1,
+ box.X2, box.Y2,
+ pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1), PCB_FLAG_TEST(PCB_FLAG_LOCK, Arc) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_POLYGON:
{
- PolygonTypePtr Polygon;
+ pcb_polygon_t *Polygon;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- LayerTypePtr layer = (LayerTypePtr) ptr1;
- __r_dump_tree(layer->polygon_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_layer_t *layer = (pcb_layer_t *) ptr1;
+ pcb_r_dump_tree(layer->polygon_tree->root, 0);
return 0;
}
#endif
- Polygon = (PolygonTypePtr) ptr2;
+ Polygon = (pcb_polygon_t *) ptr2;
report = pcb_strdup_printf("%m+POLYGON ID# %ld; Flags:%s\n"
"Its bounding box is %$mD %$mD.\n"
@@ -309,37 +314,37 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
" without using more memory.\n"
"It has %d holes and resides on layer %d.\n"
"%s", USER_UNITMASK, Polygon->ID,
- flags_to_string(Polygon->Flags, PCB_TYPE_POLYGON),
+ pcb_strflg_f2s(Polygon->Flags, PCB_TYPE_POLYGON),
Polygon->BoundingBox.X1, Polygon->BoundingBox.Y1,
Polygon->BoundingBox.X2, Polygon->BoundingBox.Y2,
Polygon->PointN, Polygon->PointMax - Polygon->PointN,
Polygon->HoleIndexN,
- GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), TEST_FLAG(PCB_FLAG_LOCK, Polygon) ? "It is LOCKED.\n" : "");
+ pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1), PCB_FLAG_TEST(PCB_FLAG_LOCK, Polygon) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_PAD:
{
- Coord len;
- PadTypePtr Pad;
- ElementTypePtr element;
+ pcb_coord_t len;
+ pcb_pad_t *Pad;
+ pcb_element_t *element;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- __r_dump_tree(PCB->Data->pad_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_r_dump_tree(PCB->Data->pad_tree->root, 0);
return 0;
}
#endif
- Pad = (PadTypePtr) ptr2;
- element = (ElementTypePtr) ptr1;
+ Pad = (pcb_pad_t *) ptr2;
+ element = (pcb_element_t *) ptr1;
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
{
if (pad == Pad)
break;
}
}
- END_LOOP;
- len = Distance(Pad->Point1.X, Pad->Point1.Y, Pad->Point2.X, Pad->Point2.Y);
+ PCB_END_LOOP;
+ len = pcb_distance(Pad->Point1.X, Pad->Point1.Y, Pad->Point2.X, Pad->Point2.Y);
report = pcb_strdup_printf("%m+PAD ID# %ld; Flags:%s\n"
"FirstPoint(X,Y) = %$mD; ID = %ld.\n"
"SecondPoint(X,Y) = %$mD; ID = %ld.\n"
@@ -351,30 +356,30 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
" as pin number %s and is on the %s\n"
"side of the board.\n"
"%s", USER_UNITMASK, Pad->ID,
- flags_to_string(Pad->Flags, PCB_TYPE_PAD),
+ pcb_strflg_f2s(Pad->Flags, PCB_TYPE_PAD),
Pad->Point1.X, Pad->Point1.Y, Pad->Point1.ID,
Pad->Point2.X, Pad->Point2.Y, Pad->Point2.ID,
Pad->Thickness, len + Pad->Thickness,
Pad->Clearance / 2,
Pad->Mask, len + Pad->Mask,
(Pad->Mask - Pad->Thickness) / 2,
- EMPTY(Pad->Name),
- EMPTY(element->Name[1].TextString),
- EMPTY(Pad->Number),
- TEST_FLAG(PCB_FLAG_ONSOLDER,
- Pad) ? "solder (bottom)" : "component", TEST_FLAG(PCB_FLAG_LOCK, Pad) ? "It is LOCKED.\n" : "");
+ PCB_EMPTY(Pad->Name),
+ PCB_EMPTY(element->Name[1].TextString),
+ PCB_EMPTY(Pad->Number),
+ PCB_FLAG_TEST(PCB_FLAG_ONSOLDER,
+ Pad) ? "solder (bottom)" : "component", PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_ELEMENT:
{
- ElementTypePtr element;
+ pcb_element_t *element;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- __r_dump_tree(PCB->Data->element_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_r_dump_tree(PCB->Data->element_tree->root, 0);
return 0;
}
#endif
- element = (ElementTypePtr) ptr2;
+ element = (pcb_element_t *) ptr2;
report = pcb_strdup_printf("%m+ELEMENT ID# %ld; Flags:%s\n"
"BoundingBox %$mD %$mD.\n"
"Descriptive Name \"%s\".\n"
@@ -384,42 +389,42 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
"Mark located at point (X,Y) = %$mD.\n"
"It is on the %s side of the board.\n"
"%s", USER_UNITMASK,
- element->ID, flags_to_string(element->Flags, PCB_TYPE_ELEMENT),
+ element->ID, pcb_strflg_f2s(element->Flags, PCB_TYPE_ELEMENT),
element->BoundingBox.X1, element->BoundingBox.Y1,
element->BoundingBox.X2, element->BoundingBox.Y2,
- EMPTY(element->Name[0].TextString),
- EMPTY(element->Name[1].TextString),
- EMPTY(element->Name[2].TextString),
- PCB_SCALE_TEXT(FONT_CAPHEIGHT, element->Name[1].Scale),
+ PCB_EMPTY(element->Name[0].TextString),
+ PCB_EMPTY(element->Name[1].TextString),
+ PCB_EMPTY(element->Name[2].TextString),
+ PCB_SCALE_TEXT(PCB_FONT_CAPHEIGHT, element->Name[1].Scale),
element->Name[1].X, element->Name[1].Y,
- TEST_FLAG(PCB_FLAG_HIDENAME, element) ? ",\n but it's hidden" : "",
+ PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element) ? ",\n but it's hidden" : "",
element->MarkX, element->MarkY,
- TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? "solder (bottom)" : "component",
- TEST_FLAG(PCB_FLAG_LOCK, element) ? "It is LOCKED.\n" : "");
+ PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) ? "solder (bottom)" : "component",
+ PCB_FLAG_TEST(PCB_FLAG_LOCK, element) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_TEXT:
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- LayerTypePtr layer = (LayerTypePtr) ptr1;
- __r_dump_tree(layer->text_tree->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_layer_t *layer = (pcb_layer_t *) ptr1;
+ pcb_r_dump_tree(layer->text_tree->root, 0);
return 0;
}
#endif
case PCB_TYPE_ELEMENT_NAME:
{
char laynum[32];
- TextTypePtr text;
+ pcb_text_t *text;
#ifndef NDEBUG
- if (gui->shift_is_pressed()) {
- __r_dump_tree(PCB->Data->name_tree[NAME_INDEX()]->root, 0);
+ if (pcb_gui->shift_is_pressed()) {
+ pcb_r_dump_tree(PCB->Data->name_tree[PCB_ELEMNAME_IDX_VISIBLE()]->root, 0);
return 0;
}
#endif
- text = (TextTypePtr) ptr2;
+ text = (pcb_text_t *) ptr2;
if (type == PCB_TYPE_TEXT)
- sprintf(laynum, "It is on layer %d.", GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1));
+ sprintf(laynum, "It is on layer %ld.", pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1));
report = pcb_strdup_printf("%m+TEXT ID# %ld; Flags:%s\n"
"Located at (X,Y) = %$mD.\n"
"Characters are %$mS tall.\n"
@@ -427,23 +432,23 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
"Direction is %d.\n"
"The bounding box is %$mD %$mD.\n"
"%s\n"
- "%s", USER_UNITMASK, text->ID, flags_to_string(text->Flags, PCB_TYPE_TEXT),
- text->X, text->Y, PCB_SCALE_TEXT(FONT_CAPHEIGHT, text->Scale),
+ "%s", USER_UNITMASK, text->ID, pcb_strflg_f2s(text->Flags, PCB_TYPE_TEXT),
+ text->X, text->Y, PCB_SCALE_TEXT(PCB_FONT_CAPHEIGHT, text->Scale),
text->TextString, text->Direction,
text->BoundingBox.X1, text->BoundingBox.Y1,
text->BoundingBox.X2, text->BoundingBox.Y2,
- (type == PCB_TYPE_TEXT) ? laynum : "It is an element name.", TEST_FLAG(PCB_FLAG_LOCK, text) ? "It is LOCKED.\n" : "");
+ (type == PCB_TYPE_TEXT) ? laynum : "It is an element name.", PCB_FLAG_TEST(PCB_FLAG_LOCK, text) ? "It is LOCKED.\n" : "");
break;
}
case PCB_TYPE_LINE_POINT:
case PCB_TYPE_POLYGON_POINT:
{
- PointTypePtr point = (PointTypePtr) ptr2;
+ pcb_point_t *point = (pcb_point_t *) ptr2;
report = pcb_strdup_printf("%m+POINT ID# %ld.\n"
"Located at (X,Y) = %$mD.\n"
"It belongs to a %s on layer %d.\n", USER_UNITMASK, point->ID,
point->X, point->Y,
- (type == PCB_TYPE_LINE_POINT) ? "line" : "polygon", GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1));
+ (type == PCB_TYPE_LINE_POINT) ? "line" : "polygon", pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1));
break;
}
case PCB_TYPE_NONE:
@@ -456,52 +461,52 @@ static int ReportDialog(int argc, const char **argv, Coord x, Coord y)
}
if ((report == NULL) || (report == '\0')) {
- Message(PCB_MSG_DEFAULT, _("Nothing found to report on\n"));
+ pcb_message(PCB_MSG_INFO, _("Nothing found to report on\n"));
return 1;
}
if (report != NULL) {
/* create dialog box */
- gui->report_dialog("Report", report);
+ pcb_gui->report_dialog("Report", report);
free(report);
}
return 0;
}
-static int ReportFoundPins(int argc, const char **argv, Coord x, Coord y)
+static int ReportFoundPins(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
gds_t list;
int col = 0;
gds_init(&list);
gds_append_str(&list, "The following pins/pads are FOUND:\n");
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, pin))
- pcb_append_printf(&list, "%s-%s,%c", NAMEONPCB_NAME(element), pin->Number, ((col++ % (conf_report.plugins.report.columns + 1)) == conf_report.plugins.report.columns) ? '\n' : ' ');
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, pin))
+ pcb_append_printf(&list, "%s-%s,%c", PCB_ELEM_NAME_REFDES(element), pin->Number, ((col++ % (conf_report.plugins.report.columns + 1)) == conf_report.plugins.report.columns) ? '\n' : ' ');
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, pad))
- pcb_append_printf(&list, "%s-%s,%c", NAMEONPCB_NAME(element), pad->Number, ((col++ % (conf_report.plugins.report.columns + 1)) == conf_report.plugins.report.columns) ? '\n' : ' ');
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, pad))
+ pcb_append_printf(&list, "%s-%s,%c", PCB_ELEM_NAME_REFDES(element), pad->Number, ((col++ % (conf_report.plugins.report.columns + 1)) == conf_report.plugins.report.columns) ? '\n' : ' ');
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
- gui->report_dialog("Report", list.array);
+ pcb_gui->report_dialog("Report", list.array);
gds_uninit(&list);
return 0;
}
/* Assumes that we start with a blank connection state,
- * e.g. ResetConnections() has been run.
+ * e.g. pcb_reset_conns() has been run.
* Does not add its own changes to the undo system
*/
-static double XYtoNetLength(Coord x, Coord y, int *found)
+static double XYtoNetLength(pcb_coord_t x, pcb_coord_t y, int *found)
{
double length;
@@ -511,11 +516,11 @@ static double XYtoNetLength(Coord x, Coord y, int *found)
/* NB: The third argument here, 'false' ensures LookupConnection
* does not add its changes to the undo system.
*/
- LookupConnection(x, y, pcb_false, PCB->Grid, PCB_FLAG_FOUND);
+ pcb_lookup_conn(x, y, pcb_false, PCB->Grid, PCB_FLAG_FOUND);
- ALLLINE_LOOP(PCB->Data);
+ PCB_LINE_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, line)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, line)) {
double l;
int dx, dy;
dx = line->Point1.X - line->Point2.X;
@@ -525,11 +530,11 @@ static double XYtoNetLength(Coord x, Coord y, int *found)
*found = 1;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- ALLARC_LOOP(PCB->Data);
+ PCB_ARC_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, arc)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, arc)) {
double l;
/* FIXME: we assume width==height here */
l = M_PI * 2 * arc->Width * fabs(arc->Delta) / 360.0;
@@ -537,12 +542,12 @@ static double XYtoNetLength(Coord x, Coord y, int *found)
*found = 1;
}
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
return length;
}
-static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y)
+static int ReportAllNetLengths(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
int ni;
int found;
@@ -551,16 +556,16 @@ static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y)
* to the state the board was in when we started this function.
*
* After this, we don't add any changes to the undo system, but
- * ensure we get back to a point where we can Undo() our changes
- * by resetting the connections with ResetConnections() before
- * calling Undo() at the end of the procedure.
+ * ensure we get back to a point where we can pcb_undo() our changes
+ * by resetting the connections with pcb_reset_conns() before
+ * calling pcb_undo() at the end of the procedure.
*/
- ResetConnections(pcb_true);
- IncrementUndoSerialNumber();
+ pcb_reset_conns(pcb_true);
+ pcb_undo_inc_serial();
- for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) {
- const char *netname = PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2;
- const char *list_entry = PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Entry[0].ListEntry;
+ for (ni = 0; ni < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; ni++) {
+ const char *netname = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Name + 2;
+ const char *list_entry = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Entry[0].ListEntry;
char *ename;
char *pname;
pcb_bool got_one = 0;
@@ -573,11 +578,11 @@ static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y)
}
*pname++ = 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- char *es = element->Name[NAMEONPCB_INDEX].TextString;
+ char *es = element->Name[PCB_ELEMNAME_IDX_REFDES].TextString;
if (es && strcmp(es, ename) == 0) {
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
if (strcmp(pin->Number, pname) == 0) {
x = pin->X;
@@ -586,8 +591,8 @@ static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y)
break;
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
if (strcmp(pad->Number, pname) == 0) {
x = (pad->Point1.X + pad->Point2.X) / 2;
@@ -596,15 +601,15 @@ static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y)
break;
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- END_LOOP;
+ PCB_END_LOOP;
if (got_one) {
char buf[50];
const char *units_name = argv[0];
- Coord length;
+ pcb_coord_t length;
if (argc < 1)
units_name = conf_core.editor.grid_unit->suffix;
@@ -612,104 +617,104 @@ static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y)
length = XYtoNetLength(x, y, &found);
/* Reset connectors for the next lookup */
- ResetConnections(pcb_false);
+ pcb_reset_conns(pcb_false);
pcb_snprintf(buf, sizeof(buf), "%$m*", units_name, length);
- gui->log("Net %s length %s\n", netname, buf);
+ pcb_gui->log("Net %s length %s\n", netname, buf);
}
}
- ResetConnections(pcb_false);
- Undo(pcb_true);
+ pcb_reset_conns(pcb_false);
+ pcb_undo(pcb_true);
return 0;
}
-static int ReportNetLength(int argc, const char **argv, Coord x, Coord y)
+static int ReportNetLength(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- Coord length = 0;
+ pcb_coord_t length = 0;
char *netname = 0;
int found = 0;
- gui->get_coords("Click on a connection", &x, &y);
+ pcb_gui->get_coords("Click on a connection", &x, &y);
/* Reset all connection flags and save an undo-state to get back
* to the state the board was in when we started this function.
*
* After this, we don't add any changes to the undo system, but
- * ensure we get back to a point where we can Undo() our changes
- * by resetting the connections with ResetConnections() before
- * calling Undo() at the end of the procedure.
+ * ensure we get back to a point where we can pcb_undo() our changes
+ * by resetting the connections with pcb_reset_conns() before
+ * calling pcb_undo() at the end of the procedure.
*/
- ResetConnections(pcb_true);
- IncrementUndoSerialNumber();
+ pcb_reset_conns(pcb_true);
+ pcb_undo_inc_serial();
length = XYtoNetLength(x, y, &found);
if (!found) {
- ResetConnections(pcb_false);
- Undo(pcb_true);
- gui->log("No net under cursor.\n");
+ pcb_reset_conns(pcb_false);
+ pcb_undo(pcb_true);
+ pcb_gui->log("No net under cursor.\n");
return 1;
}
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, pin)) {
int ni, nei;
- char *ename = element->Name[NAMEONPCB_INDEX].TextString;
+ char *ename = element->Name[PCB_ELEMNAME_IDX_REFDES].TextString;
char *pname = pin->Number;
char *n;
if (ename && pname) {
- n = Concat(ename, "-", pname, NULL);
- for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++)
- for (nei = 0; nei < PCB->NetlistLib[NETLIST_EDITED].Menu[ni].EntryN; nei++) {
- if (strcmp(PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry, n) == 0) {
- netname = PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2;
+ n = pcb_concat(ename, "-", pname, NULL);
+ for (ni = 0; ni < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; ni++)
+ for (nei = 0; nei < PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].EntryN; nei++) {
+ if (strcmp(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry, n) == 0) {
+ netname = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Name + 2;
goto got_net_name; /* four for loops deep */
}
}
}
}
}
- END_LOOP;
- PAD_LOOP(element);
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
{
- if (TEST_FLAG(PCB_FLAG_FOUND, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, pad)) {
int ni, nei;
- char *ename = element->Name[NAMEONPCB_INDEX].TextString;
+ char *ename = element->Name[PCB_ELEMNAME_IDX_REFDES].TextString;
char *pname = pad->Number;
char *n;
if (ename && pname) {
- n = Concat(ename, "-", pname, NULL);
- for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++)
- for (nei = 0; nei < PCB->NetlistLib[NETLIST_EDITED].Menu[ni].EntryN; nei++) {
- if (strcmp(PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry, n) == 0) {
- netname = PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2;
+ n = pcb_concat(ename, "-", pname, NULL);
+ for (ni = 0; ni < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; ni++)
+ for (nei = 0; nei < PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].EntryN; nei++) {
+ if (strcmp(PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry, n) == 0) {
+ netname = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu[ni].Name + 2;
goto got_net_name; /* four for loops deep */
}
}
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
got_net_name:
- ResetConnections(pcb_false);
- Undo(pcb_true);
+ pcb_reset_conns(pcb_false);
+ pcb_undo(pcb_true);
{
char buf[50];
pcb_snprintf(buf, sizeof(buf), "%$m*", conf_core.editor.grid_unit->suffix, length);
if (netname)
- gui->log("Net \"%s\" length: %s\n", netname, buf);
+ pcb_gui->log("Net \"%s\" length: %s\n", netname, buf);
else
- gui->log("Net length: %s\n", buf);
+ pcb_gui->log("Net length: %s\n", buf);
}
return 0;
@@ -718,11 +723,11 @@ got_net_name:
static int ReportNetLengthByName(const char *tofind, int x, int y)
{
char *netname = 0;
- Coord length = 0;
+ pcb_coord_t length = 0;
int found = 0;
int i;
- LibraryMenuType *net;
- ConnectionType conn;
+ pcb_lib_menu_t *net;
+ pcb_connection_t conn;
int net_found = 0;
int use_re = 0;
re_sei_t *regex;
@@ -734,42 +739,42 @@ static int ReportNetLengthByName(const char *tofind, int x, int y)
return 1;
use_re = 1;
- for (i = 0; i < PCB->NetlistLib[NETLIST_EDITED].MenuN; i++) {
- net = PCB->NetlistLib[NETLIST_EDITED].Menu + i;
- if (strcasecmp(tofind, net->Name + 2) == 0)
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; i++) {
+ net = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu + i;
+ if (pcb_strcasecmp(tofind, net->Name + 2) == 0)
use_re = 0;
}
if (use_re) {
regex = re_sei_comp(tofind);
if (re_sei_errno(regex) != 0) {
- Message(PCB_MSG_DEFAULT, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
+ pcb_message(PCB_MSG_ERROR, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
re_sei_free(regex);
return (1);
}
}
- for (i = 0; i < PCB->NetlistLib[NETLIST_EDITED].MenuN; i++) {
- net = PCB->NetlistLib[NETLIST_EDITED].Menu + i;
+ for (i = 0; i < PCB->NetlistLib[PCB_NETLIST_EDITED].MenuN; i++) {
+ net = PCB->NetlistLib[PCB_NETLIST_EDITED].Menu + i;
if (use_re) {
if (re_sei_exec(regex, net->Name + 2) == 0)
continue;
}
else {
- if (strcasecmp(net->Name + 2, tofind))
+ if (pcb_strcasecmp(net->Name + 2, tofind))
continue;
}
- if (SeekPad(net->Entry, &conn, pcb_false)) {
+ if (pcb_rat_seek_pad(net->Entry, &conn, pcb_false)) {
switch (conn.type) {
case PCB_TYPE_PIN:
- x = ((PinType *) (conn.ptr2))->X;
- y = ((PinType *) (conn.ptr2))->Y;
+ x = ((pcb_pin_t *) (conn.ptr2))->X;
+ y = ((pcb_pin_t *) (conn.ptr2))->Y;
net_found = 1;
break;
case PCB_TYPE_PAD:
- x = ((PadType *) (conn.ptr2))->Point1.X;
- y = ((PadType *) (conn.ptr2))->Point1.Y;
+ x = ((pcb_pad_t *) (conn.ptr2))->Point1.X;
+ y = ((pcb_pad_t *) (conn.ptr2))->Point1.Y;
net_found = 1;
break;
}
@@ -779,7 +784,7 @@ static int ReportNetLengthByName(const char *tofind, int x, int y)
}
if (!net_found) {
- gui->log("No net named %s\n", tofind);
+ pcb_gui->log("No net named %s\n", tofind);
return 1;
}
@@ -790,24 +795,24 @@ static int ReportNetLengthByName(const char *tofind, int x, int y)
* to the state the board was in when we started.
*
* After this, we don't add any changes to the undo system, but
- * ensure we get back to a point where we can Undo() our changes
- * by resetting the connections with ResetConnections() before
- * calling Undo() when we are finished.
+ * ensure we get back to a point where we can pcb_undo() our changes
+ * by resetting the connections with pcb_reset_conns() before
+ * calling pcb_undo() when we are finished.
*/
- ResetConnections(pcb_true);
- IncrementUndoSerialNumber();
+ pcb_reset_conns(pcb_true);
+ pcb_undo_inc_serial();
length = XYtoNetLength(x, y, &found);
netname = net->Name + 2;
- ResetConnections(pcb_false);
- Undo(pcb_true);
+ pcb_reset_conns(pcb_false);
+ pcb_undo(pcb_true);
if (!found) {
if (net_found)
- gui->log("Net found, but no lines or arcs were flagged.\n");
+ pcb_gui->log("Net found, but no lines or arcs were flagged.\n");
else
- gui->log("Net not found.\n");
+ pcb_gui->log("Net not found.\n");
return 1;
}
@@ -816,9 +821,9 @@ static int ReportNetLengthByName(const char *tofind, int x, int y)
char buf[50];
pcb_snprintf(buf, sizeof(buf), "%$m*", conf_core.editor.grid_unit->suffix, length);
if (netname)
- gui->log("Net \"%s\" length: %s\n", netname, buf);
+ pcb_gui->log("Net \"%s\" length: %s\n", netname, buf);
else
- gui->log("Net length: %s\n", buf);
+ pcb_gui->log("Net length: %s\n", buf);
}
return 0;
@@ -862,32 +867,32 @@ units
%end-doc */
-static int Report(int argc, const char **argv, Coord x, Coord y)
+static int Report(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if ((argc < 1) || (argc > 2))
AUSAGE(report);
- else if (strcasecmp(argv[0], "Object") == 0) {
- gui->get_coords("Click on an object", &x, &y);
+ else if (pcb_strcasecmp(argv[0], "Object") == 0) {
+ pcb_gui->get_coords("Click on an object", &x, &y);
return ReportDialog(argc - 1, argv + 1, x, y);
}
- else if (strcasecmp(argv[0], "DrillReport") == 0)
+ else if (pcb_strcasecmp(argv[0], "DrillReport") == 0)
return ReportDrills(argc - 1, argv + 1, x, y);
- else if (strcasecmp(argv[0], "FoundPins") == 0)
+ else if (pcb_strcasecmp(argv[0], "FoundPins") == 0)
return ReportFoundPins(argc - 1, argv + 1, x, y);
- else if ((strcasecmp(argv[0], "NetLength") == 0) && (argc == 1))
+ else if ((pcb_strcasecmp(argv[0], "NetLength") == 0) && (argc == 1))
return ReportNetLength(argc - 1, argv + 1, x, y);
- else if (strcasecmp(argv[0], "AllNetLengths") == 0)
+ else if (pcb_strcasecmp(argv[0], "AllNetLengths") == 0)
return ReportAllNetLengths(argc - 1, argv + 1, x, y);
- else if ((strcasecmp(argv[0], "NetLength") == 0) && (argc == 2))
+ else if ((pcb_strcasecmp(argv[0], "NetLength") == 0) && (argc == 2))
return ReportNetLengthByName(argv[1], x, y);
else if (argc == 2)
AUSAGE(report);
else
- AFAIL(report);
+ PCB_AFAIL(report);
return 1;
}
-HID_Action report_action_list[] = {
+pcb_hid_action_t report_action_list[] = {
{"ReportObject", "Click on an object", ReportDialog,
reportdialog_help, reportdialog_syntax}
,
@@ -897,17 +902,17 @@ HID_Action report_action_list[] = {
static const char *report_cookie = "report plugin";
-REGISTER_ACTIONS(report_action_list, report_cookie)
+PCB_REGISTER_ACTIONS(report_action_list, report_cookie)
static void hid_report_uninit(void)
{
- hid_remove_actions_by_cookie(report_cookie);
+ pcb_hid_remove_actions_by_cookie(report_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_report_init(void)
{
- REGISTER_ACTIONS(report_action_list, report_cookie)
+ PCB_REGISTER_ACTIONS(report_action_list, report_cookie)
#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \
conf_reg_field(conf_report, field,isarray,type_name,cpath,cname,desc,flags);
#include "report_conf_fields.h"
diff --git a/src_plugins/report/report.h b/src_plugins/report/report.h
index 10e2deb..92dc5ee 100644
--- a/src_plugins/report/report.h
+++ b/src_plugins/report/report.h
@@ -27,7 +27,7 @@
#ifndef PCB_REPORT_H
#define PCB_REPORT_H
-#include "global.h"
+#include "config.h"
#define REPORT_TYPES \
(PCB_TYPE_VIA | PCB_TYPE_LINE | PCB_TYPE_TEXT | PCB_TYPE_POLYGON | PCB_TYPE_ELEMENT | \
diff --git a/src_plugins/rubberband_orig/Makefile b/src_plugins/rubberband_orig/Makefile
new file mode 100644
index 0000000..f427a80
--- /dev/null
+++ b/src_plugins/rubberband_orig/Makefile
@@ -0,0 +1,6 @@
+all:
+ cd ../../src && $(MAKE) mod_rubberband_orig
+
+
+clean:
+ rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/rubberband_orig/Plug.tmpasm b/src_plugins/rubberband_orig/Plug.tmpasm
new file mode 100644
index 0000000..db38e20
--- /dev/null
+++ b/src_plugins/rubberband_orig/Plug.tmpasm
@@ -0,0 +1,8 @@
+put /local/pcb/mod {rubberband_orig}
+put /local/pcb/mod/OBJS [@ $(PLUGDIR)/rubberband_orig/rubberband.o @]
+
+switch /local/pcb/rubberband_orig/controls
+ case {buildin} include /local/pcb/tmpasm/buildin; end;
+ case {plugin} include /local/pcb/tmpasm/plugin; end;
+ case {disable} include /local/pcb/tmpasm/disable; end;
+end
diff --git a/src_plugins/rubberband_orig/README b/src_plugins/rubberband_orig/README
new file mode 100644
index 0000000..ce45eb3
--- /dev/null
+++ b/src_plugins/rubberband_orig/README
@@ -0,0 +1,5 @@
+The original rubberband code.
+
+#state: works
+#default: buildin
+#implements: (feature)
diff --git a/src_plugins/rubberband_orig/rubberband.c b/src_plugins/rubberband_orig/rubberband.c
new file mode 100644
index 0000000..3e417ad
--- /dev/null
+++ b/src_plugins/rubberband_orig/rubberband.c
@@ -0,0 +1,815 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+/* functions used by 'rubberband moves' */
+
+#define STEP_RUBBERBAND 100
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include <math.h>
+
+#include "board.h"
+#include "data.h"
+#include "error.h"
+#include "event.h"
+#include "undo.h"
+#include "operation.h"
+#include "rotate.h"
+#include "draw.h"
+#include "obj_rat_draw.h"
+#include "obj_line_op.h"
+#include "obj_line_draw.h"
+#include "plugins.h"
+#include "conf_core.h"
+
+#include "polygon.h"
+
+typedef struct { /* rubberband lines for element moves */
+ pcb_layer_t *Layer; /* layer that holds the line */
+ pcb_line_t *Line; /* the line itself */
+ pcb_point_t *MovedPoint; /* and finally the point */
+} pcb_rubberband_t;
+
+typedef struct {
+ pcb_cardinal_t RubberbandN, /* number of lines in array */
+ RubberbandMax;
+ pcb_rubberband_t *Rubberband;
+} rubber_ctx_t;
+static rubber_ctx_t rubber_band_state;
+
+
+struct rubber_info {
+ pcb_coord_t radius;
+ pcb_coord_t X, Y;
+ pcb_line_t *line;
+ pcb_box_t box;
+ pcb_layer_t *layer;
+ rubber_ctx_t *rbnd;
+};
+
+
+static pcb_rubberband_t *pcb_rubber_band_alloc(rubber_ctx_t *rbnd);
+static pcb_rubberband_t *pcb_rubber_band_create(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *MovedPoint);
+static void CheckPadForRubberbandConnection(rubber_ctx_t *rbnd, pcb_pad_t *);
+static void CheckPinForRubberbandConnection(rubber_ctx_t *rbnd, pcb_pin_t *);
+static void CheckLinePointForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *, pcb_line_t *, pcb_point_t *, pcb_bool);
+static void CheckArcPointForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *, pcb_arc_t *, int *, pcb_bool);
+static void CheckPolygonForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *, pcb_polygon_t *);
+static void CheckLinePointForRat(rubber_ctx_t *rbnd, pcb_layer_t *, pcb_point_t *);
+static pcb_r_dir_t rubber_callback(const pcb_box_t *b, void *cl);
+
+
+
+
+
+static pcb_r_dir_t rubber_callback(const pcb_box_t * b, void *cl)
+{
+ pcb_line_t *line = (pcb_line_t *) b;
+ struct rubber_info *i = (struct rubber_info *) cl;
+ rubber_ctx_t *rbnd = i->rbnd;
+ double x, y, rad, dist1, dist2;
+ pcb_coord_t t;
+ int n, touches = 0;
+
+ t = line->Thickness / 2;
+
+ for(n = 0; n < rbnd->RubberbandN; n++)
+ if (rbnd->Rubberband[n].Line == line)
+ return PCB_R_DIR_NOT_FOUND;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, line))
+ return PCB_R_DIR_NOT_FOUND;
+
+ if (line == i->line)
+ return PCB_R_DIR_NOT_FOUND;
+
+ /*
+ * Check to see if the line touches a rectangular region.
+ * To do this we need to look for the intersection of a circular
+ * region and a rectangular region.
+ */
+ if (i->radius == 0) {
+ int found = 0;
+
+ if (line->Point1.X + t >= i->box.X1 && line->Point1.X - t <= i->box.X2
+ && line->Point1.Y + t >= i->box.Y1 && line->Point1.Y - t <= i->box.Y2) {
+ if (((i->box.X1 <= line->Point1.X) &&
+ (line->Point1.X <= i->box.X2)) || ((i->box.Y1 <= line->Point1.Y) && (line->Point1.Y <= i->box.Y2))) {
+ /*
+ * The circle is positioned such that the closest point
+ * on the rectangular region boundary is not at a corner
+ * of the rectangle. i.e. the shortest line from circle
+ * center to rectangle intersects the rectangle at 90
+ * degrees. In this case our first test is sufficient
+ */
+ touches = 1;
+ }
+ else {
+ /*
+ * Now we must check the distance from the center of the
+ * circle to the corners of the rectangle since the
+ * closest part of the rectangular region is the corner.
+ */
+ x = MIN(coord_abs(i->box.X1 - line->Point1.X), coord_abs(i->box.X2 - line->Point1.X));
+ x *= x;
+ y = MIN(coord_abs(i->box.Y1 - line->Point1.Y), coord_abs(i->box.Y2 - line->Point1.Y));
+ y *= y;
+ x = x + y - (t * t);
+
+ if (x <= 0)
+ touches = 1;
+ }
+ if (touches) {
+ pcb_rubber_band_create(rbnd, i->layer, line, &line->Point1);
+ found++;
+ }
+ }
+ if (line->Point2.X + t >= i->box.X1 && line->Point2.X - t <= i->box.X2
+ && line->Point2.Y + t >= i->box.Y1 && line->Point2.Y - t <= i->box.Y2) {
+ if (((i->box.X1 <= line->Point2.X) &&
+ (line->Point2.X <= i->box.X2)) || ((i->box.Y1 <= line->Point2.Y) && (line->Point2.Y <= i->box.Y2))) {
+ touches = 1;
+ }
+ else {
+ x = MIN(coord_abs(i->box.X1 - line->Point2.X), coord_abs(i->box.X2 - line->Point2.X));
+ x *= x;
+ y = MIN(coord_abs(i->box.Y1 - line->Point2.Y), coord_abs(i->box.Y2 - line->Point2.Y));
+ y *= y;
+ x = x + y - (t * t);
+
+ if (x <= 0)
+ touches = 1;
+ }
+ if (touches) {
+ pcb_rubber_band_create(rbnd, i->layer, line, &line->Point2);
+ found++;
+ }
+ }
+ return found ? PCB_R_DIR_FOUND_CONTINUE : PCB_R_DIR_NOT_FOUND;
+ }
+ /* circular search region */
+ if (i->radius < 0)
+ rad = 0; /* require exact match */
+ else
+ rad = PCB_SQUARE(i->radius + t);
+
+ x = (i->X - line->Point1.X);
+ x *= x;
+ y = (i->Y - line->Point1.Y);
+ y *= y;
+ dist1 = x + y - rad;
+
+ x = (i->X - line->Point2.X);
+ x *= x;
+ y = (i->Y - line->Point2.Y);
+ y *= y;
+ dist2 = x + y - rad;
+
+ if (dist1 > 0 && dist2 > 0)
+ return PCB_R_DIR_NOT_FOUND;
+
+#ifdef CLOSEST_ONLY /* keep this to remind me */
+ if (dist1 < dist2)
+ pcb_rubber_band_create(rbnd, i->layer, line, &line->Point1);
+ else
+ pcb_rubber_band_create(rbnd, i->layer, line, &line->Point2);
+#else
+ if (dist1 <= 0)
+ pcb_rubber_band_create(rbnd, i->layer, line, &line->Point1);
+ if (dist2 <= 0)
+ pcb_rubber_band_create(rbnd, i->layer, line, &line->Point2);
+#endif
+ return PCB_R_DIR_FOUND_CONTINUE;
+}
+
+/* ---------------------------------------------------------------------------
+ * checks all visible lines which belong to the same layergroup as the
+ * passed pad. If one of the endpoints of the line lays inside the pad,
+ * the line is added to the 'rubberband' list
+ */
+static void CheckPadForRubberbandConnection(rubber_ctx_t *rbnd, pcb_pad_t *Pad)
+{
+ pcb_coord_t half = Pad->Thickness / 2;
+ pcb_layergrp_id_t i, group;
+ struct rubber_info info;
+
+ info.box.X1 = MIN(Pad->Point1.X, Pad->Point2.X) - half;
+ info.box.Y1 = MIN(Pad->Point1.Y, Pad->Point2.Y) - half;
+ info.box.X2 = MAX(Pad->Point1.X, Pad->Point2.X) + half;
+ info.box.Y2 = MAX(Pad->Point1.Y, Pad->Point2.Y) + half;
+ info.radius = 0;
+ info.line = NULL;
+ info.rbnd = rbnd;
+ i = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Pad) ? pcb_solder_silk_layer : pcb_component_silk_layer;
+ group = pcb_layer_get_group(i);
+
+ /* check all visible layers in the same group */
+ GROUP_LOOP(PCB->Data, group);
+ {
+ /* check all visible lines of the group member */
+ info.layer = layer;
+ if (info.layer->On) {
+ pcb_r_search(info.layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
+ }
+ }
+ PCB_END_LOOP;
+}
+
+struct rinfo {
+ int type;
+ pcb_layergrp_id_t group;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
+ pcb_point_t *point;
+ rubber_ctx_t *rbnd;
+};
+
+static pcb_r_dir_t rat_callback(const pcb_box_t * box, void *cl)
+{
+ pcb_rat_t *rat = (pcb_rat_t *) box;
+ struct rinfo *i = (struct rinfo *) cl;
+ rubber_ctx_t *rbnd = i->rbnd;
+
+ switch (i->type) {
+ case PCB_TYPE_PIN:
+ if (rat->Point1.X == i->pin->X && rat->Point1.Y == i->pin->Y)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point1);
+ else if (rat->Point2.X == i->pin->X && rat->Point2.Y == i->pin->Y)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point2);
+ break;
+ case PCB_TYPE_PAD:
+ if (rat->Point1.X == i->pad->Point1.X && rat->Point1.Y == i->pad->Point1.Y && rat->group1 == i->group)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point1);
+ else if (rat->Point2.X == i->pad->Point1.X && rat->Point2.Y == i->pad->Point1.Y && rat->group2 == i->group)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point2);
+ else if (rat->Point1.X == i->pad->Point2.X && rat->Point1.Y == i->pad->Point2.Y && rat->group1 == i->group)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point1);
+ else if (rat->Point2.X == i->pad->Point2.X && rat->Point2.Y == i->pad->Point2.Y && rat->group2 == i->group)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point2);
+ else
+ if (rat->Point1.X == (i->pad->Point1.X + i->pad->Point2.X) / 2 &&
+ rat->Point1.Y == (i->pad->Point1.Y + i->pad->Point2.Y) / 2 && rat->group1 == i->group)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point1);
+ else
+ if (rat->Point2.X == (i->pad->Point1.X + i->pad->Point2.X) / 2 &&
+ rat->Point2.Y == (i->pad->Point1.Y + i->pad->Point2.Y) / 2 && rat->group2 == i->group)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point2);
+ break;
+ case PCB_TYPE_LINE_POINT:
+ if (rat->group1 == i->group && rat->Point1.X == i->point->X && rat->Point1.Y == i->point->Y)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point1);
+ else if (rat->group2 == i->group && rat->Point2.X == i->point->X && rat->Point2.Y == i->point->Y)
+ pcb_rubber_band_create(rbnd, NULL, (pcb_line_t *) rat, &rat->Point2);
+ break;
+ default:
+ pcb_message(PCB_MSG_ERROR, "hace: bad rubber-rat lookup callback\n");
+ }
+ return PCB_R_DIR_NOT_FOUND;
+}
+
+static void CheckPadForRat(rubber_ctx_t *rbnd, pcb_pad_t *Pad)
+{
+ struct rinfo info;
+ pcb_cardinal_t i;
+
+ i = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Pad) ? pcb_solder_silk_layer : pcb_component_silk_layer;
+ info.group = pcb_layer_get_group(i);
+ info.pad = Pad;
+ info.type = PCB_TYPE_PAD;
+ info.rbnd = rbnd;
+
+ pcb_r_search(PCB->Data->rat_tree, &Pad->BoundingBox, NULL, rat_callback, &info, NULL);
+}
+
+static void CheckPinForRat(rubber_ctx_t *rbnd, pcb_pin_t *Pin)
+{
+ struct rinfo info;
+
+ info.type = PCB_TYPE_PIN;
+ info.pin = Pin;
+ info.rbnd = rbnd;
+ pcb_r_search(PCB->Data->rat_tree, &Pin->BoundingBox, NULL, rat_callback, &info, NULL);
+}
+
+static void CheckLinePointForRat(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_point_t *Point)
+{
+ struct rinfo info;
+ info.group = pcb_layer_get_group_(Layer);
+ info.point = Point;
+ info.type = PCB_TYPE_LINE_POINT;
+ info.rbnd = rbnd;
+
+ pcb_r_search(PCB->Data->rat_tree, (pcb_box_t *) Point, NULL, rat_callback, &info, NULL);
+}
+
+/* ---------------------------------------------------------------------------
+ * checks all visible lines. If one of the endpoints of the line lays
+ * inside the pin, the line is added to the 'rubberband' list
+ *
+ * Square pins are handled as if they were round. Speed
+ * and readability is more important then the few %
+ * of failures that are immediately recognized
+ */
+static void CheckPinForRubberbandConnection(rubber_ctx_t *rbnd, pcb_pin_t *Pin)
+{
+ struct rubber_info info;
+ pcb_cardinal_t n;
+ pcb_coord_t t = Pin->Thickness / 2;
+
+ info.box.X1 = Pin->X - t;
+ info.box.X2 = Pin->X + t;
+ info.box.Y1 = Pin->Y - t;
+ info.box.Y2 = Pin->Y + t;
+ info.line = NULL;
+ info.rbnd = rbnd;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pin))
+ info.radius = 0;
+ else {
+ info.radius = t;
+ info.X = Pin->X;
+ info.Y = Pin->Y;
+ }
+
+ for (n = 0; n < pcb_max_copper_layer; n++) {
+ info.layer = LAYER_PTR(n);
+ pcb_r_search(info.layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * checks all visible lines which belong to the same group as the passed line.
+ * If one of the endpoints of the line lays * inside the passed line,
+ * the scanned line is added to the 'rubberband' list
+ */
+static void CheckLinePointForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *LinePoint, pcb_bool Exact)
+{
+ pcb_layergrp_id_t group;
+ struct rubber_info info;
+ pcb_coord_t t = Line->Thickness / 2;
+
+ /* lookup layergroup and check all visible lines in this group */
+ info.radius = Exact ? -1 : MAX(Line->Thickness / 2, 1);
+ info.box.X1 = LinePoint->X - t;
+ info.box.X2 = LinePoint->X + t;
+ info.box.Y1 = LinePoint->Y - t;
+ info.box.Y2 = LinePoint->Y + t;
+ info.line = Line;
+ info.rbnd = rbnd;
+ info.X = LinePoint->X;
+ info.Y = LinePoint->Y;
+
+ group = pcb_layer_get_group_(Layer);
+ GROUP_LOOP(PCB->Data, group);
+ {
+ /* check all visible lines of the group member */
+ if (layer->On) {
+ info.layer = layer;
+ pcb_r_search(layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
+ }
+ }
+ PCB_END_LOOP;
+}
+
+/* ---------------------------------------------------------------------------
+ * checks all visible lines which belong to the same group as the passed arc.
+ * If one of the endpoints of the line is on the selected arc end,
+ * the scanned line is added to the 'rubberband' list
+ */
+static void CheckArcPointForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_arc_t *Arc, int *end_pt, pcb_bool Exact)
+{
+ pcb_layergrp_id_t group;
+ struct rubber_info info;
+ pcb_coord_t t = Arc->Thickness / 2, ex, ey;
+
+ pcb_arc_get_end(Arc, (end_pt != pcb_arc_start_ptr), &ex, &ey);
+
+ /* lookup layergroup and check all visible lines in this group */
+ info.radius = Exact ? -1 : MAX(Arc->Thickness / 2, 1);
+ info.box.X1 = ex - t;
+ info.box.X2 = ex + t;
+ info.box.Y1 = ey - t;
+ info.box.Y2 = ey + t;
+ info.line = NULL; /* used only to make sure the current object is not added - we are adding lines only and the current object is an arc */
+ info.rbnd = rbnd;
+ info.X = ex;
+ info.Y = ey;
+
+ group = pcb_layer_get_group_(Layer);
+ GROUP_LOOP(PCB->Data, group);
+ {
+ /* check all visible lines of the group member */
+ if (layer->On) {
+ info.layer = layer;
+ pcb_r_search(layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL);
+ }
+ }
+ PCB_END_LOOP;
+}
+
+/* ---------------------------------------------------------------------------
+ * checks all visible lines which belong to the same group as the passed polygon.
+ * If one of the endpoints of the line lays inside the passed polygon,
+ * the scanned line is added to the 'rubberband' list
+ */
+static void CheckPolygonForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_polygon_t *Polygon)
+{
+ pcb_layergrp_id_t group;
+
+ /* lookup layergroup and check all visible lines in this group */
+ group = pcb_layer_get_group_(Layer);
+ GROUP_LOOP(PCB->Data, group);
+ {
+ if (layer->On) {
+ pcb_coord_t thick;
+
+ /* the following code just stupidly compares the endpoints
+ * of the lines
+ */
+ PCB_LINE_LOOP(layer);
+ {
+ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, line))
+ continue;
+ if (PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, line))
+ continue;
+ thick = (line->Thickness + 1) / 2;
+ if (pcb_poly_is_point_in_p(line->Point1.X, line->Point1.Y, thick, Polygon))
+ pcb_rubber_band_create(rbnd, layer, line, &line->Point1);
+ if (pcb_poly_is_point_in_p(line->Point2.X, line->Point2.Y, thick, Polygon))
+ pcb_rubber_band_create(rbnd, layer, line, &line->Point2);
+ }
+ PCB_END_LOOP;
+ }
+ }
+ PCB_END_LOOP;
+}
+
+/* ---------------------------------------------------------------------------
+ * lookup all lines that are connected to an object and save the
+ * data to 'pcb_crosshair.AttachedObject.Rubberband'
+ * lookup is only done for visible layers
+ */
+static void pcb_rubber_band_lookup_lines(rubber_ctx_t *rbnd, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+{
+
+ /* the function is only supported for some types
+ * check all visible lines;
+ * it is only necessary to check if one of the endpoints
+ * is connected
+ */
+ switch (Type) {
+ case PCB_TYPE_ELEMENT:
+ {
+ pcb_element_t *element = (pcb_element_t *) Ptr1;
+
+ /* square pins are handled as if they are round. Speed
+ * and readability is more important then the few %
+ * of failures that are immediately recognized
+ */
+ PCB_PIN_LOOP(element);
+ {
+ CheckPinForRubberbandConnection(rbnd, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ CheckPadForRubberbandConnection(rbnd, pad);
+ }
+ PCB_END_LOOP;
+ break;
+ }
+
+ case PCB_TYPE_LINE:
+ {
+ pcb_layer_t *layer = (pcb_layer_t *) Ptr1;
+ pcb_line_t *line = (pcb_line_t *) Ptr2;
+ if (pcb_layer_id(PCB->Data, layer) < pcb_max_copper_layer) {
+ CheckLinePointForRubberbandConnection(rbnd, layer, line, &line->Point1, pcb_false);
+ CheckLinePointForRubberbandConnection(rbnd, layer, line, &line->Point2, pcb_false);
+ }
+ break;
+ }
+
+ case PCB_TYPE_LINE_POINT:
+ if (pcb_layer_id(PCB->Data, (pcb_layer_t *) Ptr1) < pcb_max_copper_layer)
+ CheckLinePointForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_line_t *) Ptr2, (pcb_point_t *) Ptr3, pcb_true);
+ break;
+
+ case PCB_TYPE_ARC_POINT:
+ if (pcb_layer_id(PCB->Data, (pcb_layer_t *) Ptr1) < pcb_max_copper_layer)
+ CheckArcPointForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_arc_t *) Ptr2, (int *) Ptr3, pcb_true);
+ break;
+
+ case PCB_TYPE_VIA:
+ CheckPinForRubberbandConnection(rbnd, (pcb_pin_t *) Ptr1);
+ break;
+
+ case PCB_TYPE_POLYGON:
+ if (pcb_layer_id(PCB->Data, (pcb_layer_t *) Ptr1) < pcb_max_copper_layer)
+ CheckPolygonForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_polygon_t *) Ptr2);
+ break;
+ }
+}
+
+static void pcb_rubber_band_lookup_rat_lines(rubber_ctx_t *rbnd, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
+{
+ switch (Type) {
+ case PCB_TYPE_ELEMENT:
+ {
+ pcb_element_t *element = (pcb_element_t *) Ptr1;
+
+ PCB_PIN_LOOP(element);
+ {
+ CheckPinForRat(rbnd, pin);
+ }
+ PCB_END_LOOP;
+ PCB_PAD_LOOP(element);
+ {
+ CheckPadForRat(rbnd, pad);
+ }
+ PCB_END_LOOP;
+ break;
+ }
+
+ case PCB_TYPE_LINE:
+ {
+ pcb_layer_t *layer = (pcb_layer_t *) Ptr1;
+ pcb_line_t *line = (pcb_line_t *) Ptr2;
+
+ CheckLinePointForRat(rbnd, layer, &line->Point1);
+ CheckLinePointForRat(rbnd, layer, &line->Point2);
+ break;
+ }
+
+ case PCB_TYPE_LINE_POINT:
+ CheckLinePointForRat(rbnd, (pcb_layer_t *) Ptr1, (pcb_point_t *) Ptr3);
+ break;
+
+ case PCB_TYPE_VIA:
+ CheckPinForRat(rbnd, (pcb_pin_t *) Ptr1);
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * get next slot for a rubberband connection, allocates memory if necessary
+ */
+static pcb_rubberband_t *pcb_rubber_band_alloc(rubber_ctx_t *rbnd)
+{
+ pcb_rubberband_t *ptr = rbnd->Rubberband;
+
+ /* realloc new memory if necessary and clear it */
+ if (rbnd->RubberbandN >= rbnd->RubberbandMax) {
+ rbnd->RubberbandMax += STEP_RUBBERBAND;
+ ptr = (pcb_rubberband_t *) realloc(ptr, rbnd->RubberbandMax * sizeof(pcb_rubberband_t));
+ rbnd->Rubberband = ptr;
+ memset(ptr + rbnd->RubberbandN, 0, STEP_RUBBERBAND * sizeof(pcb_rubberband_t));
+ }
+ return (ptr + rbnd->RubberbandN++);
+}
+
+/* ---------------------------------------------------------------------------
+ * adds a new line to the rubberband list of 'pcb_crosshair.AttachedObject'
+ * if Layer == 0 it is a rat line
+ */
+static pcb_rubberband_t *pcb_rubber_band_create(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *MovedPoint)
+{
+ pcb_rubberband_t *ptr = pcb_rubber_band_alloc(rbnd);
+
+ /* we toggle the PCB_FLAG_RUBBEREND of the line to determine if */
+ /* both points are being moved. */
+ PCB_FLAG_TOGGLE(PCB_FLAG_RUBBEREND, Line);
+ ptr->Layer = Layer;
+ ptr->Line = Line;
+ ptr->MovedPoint = MovedPoint;
+ return (ptr);
+}
+
+/*** event handlers ***/
+static void rbe_reset(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ rbnd->RubberbandN = 0;
+}
+
+static void rbe_remove_element(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ pcb_rubberband_t *ptr;
+ void *ptr1 = argv[1].d.p, *ptr2 = argv[2].d.p, *ptr3 = argv[3].d.p;
+ int i, type = PCB_TYPE_ELEMENT;
+
+ rbnd->RubberbandN = 0;
+ pcb_rubber_band_lookup_rat_lines(rbnd, type, ptr1, ptr2, ptr3);
+ ptr = rbnd->Rubberband;
+ for (i = 0; i < rbnd->RubberbandN; i++) {
+ if (PCB->RatOn)
+ EraseRat((pcb_rat_t *) ptr->Line);
+ if (PCB_FLAG_TEST(PCB_FLAG_RUBBEREND, ptr->Line))
+ pcb_undo_move_obj_to_remove(PCB_TYPE_RATLINE, ptr->Line, ptr->Line, ptr->Line);
+ else
+ PCB_FLAG_TOGGLE(PCB_FLAG_RUBBEREND, ptr->Line); /* only remove line once */
+ ptr++;
+ }
+}
+
+static void rbe_move(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ pcb_rubberband_t *ptr;
+ pcb_coord_t DX = argv[1].d.c, DY = argv[2].d.c;
+ pcb_opctx_t *ctx = argv[3].d.p;
+
+ if (DX == 0 && DY == 0) {
+ int n;
+
+ /* first clear any marks that we made in the line flags */
+ for(n = 0, ptr = rbnd->Rubberband; n < rbnd->RubberbandN; n++, ptr++)
+ PCB_FLAG_CLEAR(PCB_FLAG_RUBBEREND, ptr->Line);
+
+ return;
+ }
+
+ /* move all the lines... and reset the counter */
+ ptr = rbnd->Rubberband;
+ while (rbnd->RubberbandN) {
+ /* first clear any marks that we made in the line flags */
+ PCB_FLAG_CLEAR(PCB_FLAG_RUBBEREND, ptr->Line);
+ pcb_undo_add_obj_to_move(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, DX, DY);
+ MoveLinePoint(ctx, ptr->Layer, ptr->Line, ptr->MovedPoint);
+ rbnd->RubberbandN--;
+ ptr++;
+ }
+}
+
+static void rbe_draw(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ pcb_rubberband_t *ptr;
+ pcb_cardinal_t i;
+ pcb_coord_t dx = argv[1].d.c, dy = argv[2].d.c;
+
+
+ /* draw the attached rubberband lines too */
+ i = rbnd->RubberbandN;
+ ptr = rbnd->Rubberband;
+ while (i) {
+ pcb_point_t *point1, *point2;
+
+ if (PCB_FLAG_TEST(PCB_FLAG_VIA, ptr->Line)) {
+ /* this is a rat going to a polygon. do not draw for rubberband */ ;
+ }
+ else if (PCB_FLAG_TEST(PCB_FLAG_RUBBEREND, ptr->Line)) {
+ /* 'point1' is always the fix-point */
+ if (ptr->MovedPoint == &ptr->Line->Point1) {
+ point1 = &ptr->Line->Point2;
+ point2 = &ptr->Line->Point1;
+ }
+ else {
+ point1 = &ptr->Line->Point1;
+ point2 = &ptr->Line->Point2;
+ }
+ XORDrawAttachedLine(point1->X, point1->Y, point2->X + dx, point2->Y + dy, ptr->Line->Thickness);
+ }
+ else if (ptr->MovedPoint == &ptr->Line->Point1)
+ XORDrawAttachedLine(ptr->Line->Point1.X + dx,
+ ptr->Line->Point1.Y + dy, ptr->Line->Point2.X + dx, ptr->Line->Point2.Y + dy, ptr->Line->Thickness);
+
+ ptr++;
+ i--;
+ }
+}
+
+static void rbe_rotate90(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ pcb_rubberband_t *ptr;
+/* int Type = argv[1].d.i; */
+/* void *ptr1 = argv[2].d.p, *ptr2 = argv[3].d.p, *ptr3 = argv[4].d.p; */
+ pcb_coord_t cx = argv[5].d.c, cy = argv[6].d.c;
+ int steps = argv[7].d.i;
+ int *changed = argv[8].d.p;
+
+
+ /* move all the rubberband lines... and reset the counter */
+ ptr = rbnd->Rubberband;
+ while (rbnd->RubberbandN) {
+ *changed = 1;
+ PCB_FLAG_CLEAR(PCB_FLAG_RUBBEREND, ptr->Line);
+ pcb_undo_add_obj_to_rotate(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, cx, cy, steps);
+ EraseLine(ptr->Line);
+ if (ptr->Layer) {
+ pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, ptr->Layer, ptr->Line);
+ pcb_r_delete_entry(ptr->Layer->line_tree, (pcb_box_t *) ptr->Line);
+ }
+ else
+ pcb_r_delete_entry(PCB->Data->rat_tree, (pcb_box_t *) ptr->Line);
+ pcb_point_rotate90(ptr->MovedPoint, cx, cy, steps);
+ pcb_line_bbox(ptr->Line);
+ if (ptr->Layer) {
+ pcb_r_insert_entry(ptr->Layer->line_tree, (pcb_box_t *) ptr->Line, 0);
+ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, ptr->Layer, ptr->Line);
+ DrawLine(ptr->Layer, ptr->Line);
+ }
+ else {
+ pcb_r_insert_entry(PCB->Data->rat_tree, (pcb_box_t *) ptr->Line, 0);
+ DrawRat((pcb_rat_t *) ptr->Line);
+ }
+ rbnd->RubberbandN--;
+ ptr++;
+ }
+}
+
+static void rbe_rename(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ int type = argv[1].d.i;
+ void *ptr1 = argv[2].d.p, *ptr2 = argv[3].d.p, *ptr3 = argv[4].d.p;
+/* int pinnum = argv[5].d.i;*/
+
+ if (type == PCB_TYPE_ELEMENT) {
+ pcb_rubberband_t *ptr;
+ int i;
+
+ pcb_undo_restore_serial();
+ rbnd->RubberbandN = 0;
+ pcb_rubber_band_lookup_rat_lines(rbnd, type, ptr1, ptr2, ptr3);
+ ptr = rbnd->Rubberband;
+ for (i = 0; i < rbnd->RubberbandN; i++, ptr++) {
+ if (PCB->RatOn)
+ EraseRat((pcb_rat_t *) ptr->Line);
+ pcb_undo_move_obj_to_remove(PCB_TYPE_RATLINE, ptr->Line, ptr->Line, ptr->Line);
+ }
+ pcb_undo_inc_serial();
+ pcb_draw();
+ }
+}
+
+static void rbe_lookup_lines(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ int type = argv[1].d.i;
+ void *ptr1 = argv[2].d.p, *ptr2 = argv[3].d.p, *ptr3 = argv[4].d.p;
+
+ if (conf_core.editor.rubber_band_mode)
+ pcb_rubber_band_lookup_lines(rbnd, type, ptr1, ptr2, ptr3);
+}
+
+static void rbe_lookup_rats(void *user_data, int argc, pcb_event_arg_t argv[])
+{
+ rubber_ctx_t *rbnd = user_data;
+ int type = argv[1].d.i;
+ void *ptr1 = argv[2].d.p, *ptr2 = argv[3].d.p, *ptr3 = argv[4].d.p;
+
+ pcb_rubber_band_lookup_rat_lines(rbnd, type, ptr1, ptr2, ptr3);
+}
+
+
+static const char *rubber_cookie = "old rubberband";
+
+void rb_uninit(void)
+{
+ pcb_event_unbind_allcookie(rubber_cookie);
+}
+
+pcb_uninit_t hid_rubberband_orig_init(void)
+{
+ void *ctx = &rubber_band_state;
+ pcb_event_bind(PCB_EVENT_RUBBER_RESET, rbe_reset, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_REMOVE_ELEMENT, rbe_remove_element, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_MOVE, rbe_move, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_MOVE_DRAW, rbe_draw, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_ROTATE90, rbe_rotate90, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_RENAME, rbe_rename, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_LOOKUP_LINES, rbe_lookup_lines, ctx, rubber_cookie);
+ pcb_event_bind(PCB_EVENT_RUBBER_LOOKUP_RATS, rbe_lookup_rats, ctx, rubber_cookie);
+
+ return rb_uninit;
+}
+
diff --git a/src_plugins/rubberband_orig/rubberband.h b/src_plugins/rubberband_orig/rubberband.h
new file mode 100644
index 0000000..48c5845
--- /dev/null
+++ b/src_plugins/rubberband_orig/rubberband.h
@@ -0,0 +1,36 @@
+/*
+ * 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 at rz.uni-ulm.de
+ *
+ */
+
+/* prototypes for rubberband routines
+ */
+
+#ifndef PCB_RUBBERBAND_H
+#define PCB_RUBBERBAND_H
+
+/* temporary call until rubber band is moved out into a plugin */
+void pcb_rubberband_init(void);
+
+#endif
diff --git a/src_plugins/shand_cmd/Makefile b/src_plugins/shand_cmd/Makefile
index 35dccf5..794ac30 100644
--- a/src_plugins/shand_cmd/Makefile
+++ b/src_plugins/shand_cmd/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_shand_cmd
+ cd ../../src && $(MAKE) mod_shand_cmd
clean:
diff --git a/src_plugins/shand_cmd/command.c b/src_plugins/shand_cmd/command.c
index 8583c9e..9bde3eb 100644
--- a/src_plugins/shand_cmd/command.c
+++ b/src_plugins/shand_cmd/command.c
@@ -34,20 +34,19 @@
#include <string.h>
#include <ctype.h>
-#include "global.h"
+#include "board.h"
+#include "build_run.h"
#include "action_helper.h"
#include "buffer.h"
#include "command.h"
#include "data.h"
#include "error.h"
#include "plug_io.h"
-#include "mymem.h"
-#include "misc.h"
#include "rats.h"
-#include "set.h"
#include "plugins.h"
#include "hid_actions.h"
#include "compat_misc.h"
+#include "misc_util.h"
/* ---------------------------------------------------------------------- */
@@ -76,9 +75,9 @@ static const char h_help[] = "Print a help message for commands.";
%end-doc */
-static int CommandHelp(int argc, const char **argv, Coord x, Coord y)
+static int CommandHelp(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- Message(PCB_MSG_DEFAULT, "following commands are supported:\n"
+ pcb_message(PCB_MSG_INFO, "following commands are supported:\n"
" Command() execute an action command (too numerous to list)\n"
" see the manual for the list of action commands\n"
" h display this help message\n"
@@ -110,7 +109,7 @@ will popup.
%end-doc */
-static int CommandLoadLayout(int argc, const char **argv, Coord x, Coord y)
+static int CommandLoadLayout(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *filename, *format = NULL;
@@ -122,12 +121,12 @@ static int CommandLoadLayout(int argc, const char **argv, Coord x, Coord y)
break;
default: /* usage */
- Message(PCB_MSG_DEFAULT, "Usage: l [name]\n loads layout data\n");
+ pcb_message(PCB_MSG_ERROR, "Usage: l [name]\n loads layout data\n");
return (1);
}
- if (!PCB->Changed || gui->confirm_dialog("OK to override layout data?", 0))
- LoadPCB(filename, format, pcb_true, 0);
+ if (!PCB->Changed || pcb_gui->confirm_dialog("OK to override layout data?", 0))
+ pcb_load_pcb(filename, format, pcb_true, 0);
return (0);
}
@@ -146,19 +145,19 @@ element loader. If no filename is specified a file select box will popup.
%end-doc */
-static int CommandLoadElementToBuffer(int argc, const char **argv, Coord x, Coord y)
+static int CommandLoadElementToBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *filename;
switch (argc) {
case 1: /* filename is passed in commandline */
filename = argv[0];
- if (filename && LoadElementToBuffer(PASTEBUFFER, filename))
- SetMode(PCB_MODE_PASTE_BUFFER);
+ if (filename && pcb_element_load_to_buffer(PCB_PASTEBUFFER, filename))
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
break;
default: /* usage */
- Message(PCB_MSG_DEFAULT, pcb_false, "Usage: le [name]\n loads element data to buffer\n");
+ pcb_message(PCB_MSG_ERROR, pcb_false, "Usage: le [name]\n loads element data to buffer\n");
return (1);
}
return (0);
@@ -180,7 +179,7 @@ If no filename is specified a file select box will popup.
%end-doc */
-static int CommandLoadLayoutToBuffer(int argc, const char **argv, Coord x, Coord y)
+static int CommandLoadLayoutToBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *filename, *format = NULL;
@@ -189,12 +188,12 @@ static int CommandLoadLayoutToBuffer(int argc, const char **argv, Coord x, Coord
format = argv[1];
case 1: /* filename is passed in commandline */
filename = argv[0];
- if (filename && LoadLayoutToBuffer(PASTEBUFFER, filename, format))
- SetMode(PCB_MODE_PASTE_BUFFER);
+ if (filename && pcb_buffer_load_layout(PCB_PASTEBUFFER, filename, format))
+ pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER);
break;
default: /* usage */
- Message(PCB_MSG_DEFAULT, "Usage: m [name]\n loads layout data to buffer\n");
+ pcb_message(PCB_MSG_ERROR, "Usage: m [name]\n loads layout data to buffer\n");
return (1);
}
return (0);
@@ -215,10 +214,10 @@ save) before quitting.
%end-doc */
-static int CommandQuit(int argc, const char **argv, Coord x, Coord y)
+static int CommandQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- if (!PCB->Changed || gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK)
- QuitApplication();
+ if (!PCB->Changed || pcb_gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK)
+ pcb_quit_app();
return 0;
}
@@ -235,9 +234,9 @@ confirmation.
%end-doc */
-static int CommandReallyQuit(int argc, const char **argv, Coord x, Coord y)
+static int CommandReallyQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- QuitApplication();
+ pcb_quit_app();
return 0;
}
@@ -261,7 +260,7 @@ for verifying the board layout (which is also accomplished by the
%end-doc */
-static int CommandLoadNetlist(int argc, const char **argv, Coord x, Coord y)
+static int CommandLoadNetlist(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *filename;
@@ -271,12 +270,12 @@ static int CommandLoadNetlist(int argc, const char **argv, Coord x, Coord y)
break;
default: /* usage */
- Message(PCB_MSG_DEFAULT, "Usage: rn [name]\n reads in a netlist file\n");
+ pcb_message(PCB_MSG_ERROR, "Usage: rn [name]\n reads in a netlist file\n");
return (1);
}
if (PCB->Netlistname)
free(PCB->Netlistname);
- PCB->Netlistname = StripWhiteSpaceAndDup(filename);
+ PCB->Netlistname = pcb_strdup_strip_wspace(filename);
return (0);
}
@@ -311,30 +310,30 @@ and has the same functionality as @code{s}.
%end-doc */
-static int CommandSaveLayout(int argc, const char **argv, Coord x, Coord y)
+static int CommandSaveLayout(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
switch (argc) {
case 0:
if (PCB->Filename) {
- if (SavePCB(PCB->Filename, NULL) == 0)
- SetChangedFlag(pcb_false);
+ if (pcb_save_pcb(PCB->Filename, NULL) == 0)
+ pcb_board_set_changed_flag(pcb_false);
}
else
- Message(PCB_MSG_DEFAULT, "No filename to save to yet\n");
+ pcb_message(PCB_MSG_ERROR, "No filename to save to yet\n");
break;
case 1:
- if (SavePCB(argv[0], NULL) == 0) {
- SetChangedFlag(pcb_false);
+ if (pcb_save_pcb(argv[0], NULL) == 0) {
+ pcb_board_set_changed_flag(pcb_false);
free(PCB->Filename);
PCB->Filename = pcb_strdup(argv[0]);
- if (gui->notify_filename_changed != NULL)
- gui->notify_filename_changed();
+ if (pcb_gui->notify_filename_changed != NULL)
+ pcb_gui->notify_filename_changed();
}
break;
default:
- Message(PCB_MSG_DEFAULT, "Usage: s [name] | w [name]\n saves layout data\n");
+ pcb_message(PCB_MSG_ERROR, "Usage: s [name] | w [name]\n saves layout data\n");
return (1);
}
return (0);
@@ -355,7 +354,7 @@ has the same functionality as @code{s} combined with @code{q}.
%end-doc */
-static int CommandSaveLayoutAndQuit(int argc, const char **argv, Coord x, Coord y)
+static int CommandSaveLayoutAndQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
if (!CommandSaveLayout(argc, argv, x, y))
return CommandQuit(0, 0, 0, 0);
@@ -364,7 +363,7 @@ static int CommandSaveLayoutAndQuit(int argc, const char **argv, Coord x, Coord
/* --------------------------------------------------------------------------- */
-HID_Action shand_cmd_action_list[] = {
+pcb_hid_action_t shand_cmd_action_list[] = {
{"h", 0, CommandHelp,
h_help, h_syntax}
,
@@ -399,16 +398,16 @@ HID_Action shand_cmd_action_list[] = {
static const char *shand_cmd_cookie = "shand_cmd plugin";
-REGISTER_ACTIONS(shand_cmd_action_list, shand_cmd_cookie)
+PCB_REGISTER_ACTIONS(shand_cmd_action_list, shand_cmd_cookie)
static void hid_shand_cmd_uninit(void)
{
- hid_remove_actions_by_cookie(shand_cmd_cookie);
+ pcb_hid_remove_actions_by_cookie(shand_cmd_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_shand_cmd_init(void)
{
- REGISTER_ACTIONS(shand_cmd_action_list, shand_cmd_cookie)
+ PCB_REGISTER_ACTIONS(shand_cmd_action_list, shand_cmd_cookie)
return hid_shand_cmd_uninit;
}
diff --git a/src_plugins/shand_cmd/command.h b/src_plugins/shand_cmd/command.h
index d28760c..d596aa7 100644
--- a/src_plugins/shand_cmd/command.h
+++ b/src_plugins/shand_cmd/command.h
@@ -29,7 +29,7 @@
#ifndef PCB_COMMAND_H
#define PCB_COMMAND_H
-#include "global.h"
+#include "config.h"
void ExecuteUserCommand(char *);
void CallActionProc(char *action, char **arg, int argc);
diff --git a/src_plugins/smartdisperse/Makefile b/src_plugins/smartdisperse/Makefile
index 869ea87..f22fe0f 100644
--- a/src_plugins/smartdisperse/Makefile
+++ b/src_plugins/smartdisperse/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_smartdisperse
+ cd ../../src && $(MAKE) mod_smartdisperse
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/smartdisperse/smartdisperse.c b/src_plugins/smartdisperse/smartdisperse.c
index 4fc8911..3d9d873 100644
--- a/src_plugins/smartdisperse/smartdisperse.c
+++ b/src_plugins/smartdisperse/smartdisperse.c
@@ -26,37 +26,36 @@
#include <genht/htpi.h>
#include "config.h"
-#include "global.h"
+#include "board.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "rats.h"
#include "error.h"
#include "move.h"
#include "draw.h"
-#include "set.h"
#include "plugins.h"
+#include "action_helper.h"
#include "hid_actions.h"
+#include "compat_nls.h"
#define GAP 10000
-static Coord minx;
-static Coord miny;
-static Coord maxx;
-static Coord maxy;
+static pcb_coord_t minx;
+static pcb_coord_t miny;
+static pcb_coord_t maxx;
+static pcb_coord_t maxy;
/*!
* \brief Place one element.
*
* Must initialize statics above before calling for the first time.
*
- * This is taken almost entirely from ActionDisperseElements, with cleanup
+ * This is taken almost entirely from pcb_act_DisperseElements, with cleanup
*/
-static void place(ElementType * element)
+static void place(pcb_element_t * element)
{
- Coord dx, dy;
+ pcb_coord_t dx, dy;
/* figure out how much to move the element */
dx = minx - element->BoundingBox.X1;
@@ -83,10 +82,10 @@ static void place(ElementType * element)
}
/* move the element */
- MoveElementLowLevel(PCB->Data, element, dx, dy);
+ pcb_element_move(PCB->Data, element, dx, dy);
/* and add to the undo list so we can undo this operation */
- AddObjectToMoveUndoList(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
+ pcb_undo_add_obj_to_move(PCB_TYPE_ELEMENT, NULL, NULL, element, dx, dy);
/* keep track of how tall this row is */
minx += element->BoundingBox.X2 - element->BoundingBox.X1 + GAP;
@@ -99,10 +98,10 @@ static void place(ElementType * element)
* \brief Return the X location of a connection's pad or pin within its
* element.
*/
-static Coord padDX(ConnectionType * conn)
+static pcb_coord_t padDX(pcb_connection_t * conn)
{
- ElementType *element = (ElementType *) conn->ptr1;
- AnyLineObjectType *line = (AnyLineObjectType *) conn->ptr2;
+ pcb_element_t *element = (pcb_element_t *) conn->ptr1;
+ pcb_any_line_t *line = (pcb_any_line_t *) conn->ptr2;
return line->BoundingBox.X1 - (element->BoundingBox.X1 + element->BoundingBox.X2) / 2;
}
@@ -111,9 +110,9 @@ static Coord padDX(ConnectionType * conn)
* \brief Return true if ea,eb would be the best order, else eb,ea,
* based on pad loc.
*/
-static int padorder(ConnectionType * conna, ConnectionType * connb)
+static int padorder(pcb_connection_t * conna, pcb_connection_t * connb)
{
- Coord dxa, dxb;
+ pcb_coord_t dxa, dxb;
dxa = padDX(conna);
dxb = padDX(connb);
@@ -136,10 +135,10 @@ static const char smartdisperse_syntax[] = "SmartDisperse([All|Selected])";
#define is_visited(element) htpi_has(&visited, ((void *)(element)))
-static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
+static int smartdisperse(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *function = ARG(0);
- NetListType *Nets;
+ pcb_netlist_t *Nets;
htpi_t visited;
/* PointerListType stack = { 0, 0, NULL };*/
int all;
@@ -156,12 +155,12 @@ static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
all = 0;
}
else {
- AFAIL(smartdisperse);
+ PCB_AFAIL(smartdisperse);
}
- Nets = ProcNetlist(&PCB->NetlistLib[0]);
+ Nets = pcb_rat_proc_netlist(&PCB->NetlistLib[0]);
if (!Nets) {
- Message(PCB_MSG_ERROR, _("Can't use SmartDisperse because no netlist is loaded.\n"));
+ pcb_message(PCB_MSG_ERROR, _("Can't use SmartDisperse because no netlist is loaded.\n"));
return 0;
}
@@ -169,13 +168,13 @@ static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
htpi_init(&visited, ptrhash, ptrkeyeq);
/* if we're not doing all, mark the unselected elements as "visited" */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- if (!(all || TEST_FLAG(PCB_FLAG_SELECTED, element))) {
+ if (!(all || PCB_FLAG_TEST(PCB_FLAG_SELECTED, element))) {
set_visited(element);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* initialize variables for place() */
minx = GAP;
@@ -188,11 +187,11 @@ static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
* elaborate algorithm to walk serial nets, but the datastructures
* are too gross so I'm going with the 80% solution.
*/
- NET_LOOP(Nets);
+ PCB_NET_LOOP(Nets);
{
- ConnectionType *conna, *connb;
- ElementType *ea, *eb;
-/* ElementType *epp;*/
+ pcb_connection_t *conna, *connb;
+ pcb_element_t *ea, *eb;
+/* pcb_element_t *epp;*/
if (net->ConnectionN != 2)
continue;
@@ -202,8 +201,8 @@ static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
if (!IS_ELEMENT(conna) || !IS_ELEMENT(conna))
continue;
- ea = (ElementType *) conna->ptr1;
- eb = (ElementType *) connb->ptr1;
+ ea = (pcb_element_t *) conna->ptr1;
+ eb = (pcb_element_t *) connb->ptr1;
/* place this pair if possible */
if (is_visited(ea) || is_visited(eb))
@@ -221,19 +220,19 @@ static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
place(ea);
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* Place larger nets, still grouping by net */
- NET_LOOP(Nets);
+ PCB_NET_LOOP(Nets);
{
- CONNECTION_LOOP(net);
+ PCB_CONNECTION_LOOP(net);
{
- ElementType *element;
+ pcb_element_t *element;
if (!IS_ELEMENT(connection))
continue;
- element = (ElementType *) connection->ptr1;
+ element = (pcb_element_t *) connection->ptr1;
/* place this one if needed */
if (is_visited(element))
@@ -241,44 +240,44 @@ static int smartdisperse(int argc, const char **argv, Coord x, Coord y)
set_visited(element);
place(element);
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
/* Place up anything else */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
if (!is_visited(element)) {
place(element);
}
}
- END_LOOP;
+ PCB_END_LOOP;
htpi_uninit(&visited);
- IncrementUndoSerialNumber();
- Redraw();
- SetChangedFlag(1);
+ pcb_undo_inc_serial();
+ pcb_redraw();
+ pcb_board_set_changed_flag(1);
return 0;
}
-static HID_Action smartdisperse_action_list[] = {
+static pcb_hid_action_t smartdisperse_action_list[] = {
{"smartdisperse", NULL, smartdisperse, NULL, NULL}
};
char *smartdisperse_cookie = "smartdisperse plugin";
-REGISTER_ACTIONS(smartdisperse_action_list, smartdisperse_cookie)
+PCB_REGISTER_ACTIONS(smartdisperse_action_list, smartdisperse_cookie)
static void hid_smartdisperse_uninit(void)
{
- hid_remove_actions_by_cookie(smartdisperse_cookie);
+ pcb_hid_remove_actions_by_cookie(smartdisperse_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_smartdisperse_init()
{
- REGISTER_ACTIONS(smartdisperse_action_list, smartdisperse_cookie);
+ PCB_REGISTER_ACTIONS(smartdisperse_action_list, smartdisperse_cookie);
return hid_smartdisperse_uninit;
}
diff --git a/src_plugins/stroke/Makefile b/src_plugins/stroke/Makefile
index 07b7c21..6fe9ed3 100644
--- a/src_plugins/stroke/Makefile
+++ b/src_plugins/stroke/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_stroke
+ cd ../../src && $(MAKE) mod_stroke
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/stroke/stroke.c b/src_plugins/stroke/stroke.c
index 1e59986..4130b61 100644
--- a/src_plugins/stroke/stroke.c
+++ b/src_plugins/stroke/stroke.c
@@ -27,7 +27,8 @@
#include "config.h"
#include <stroke.h>
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "conf.h"
#include "conf_core.h"
#include "data.h"
@@ -35,14 +36,13 @@
#include "stub_stroke.h"
#include "rotate.h"
#include "undo.h"
-#include "set.h"
#include "error.h"
-#include "misc.h"
#include "plugins.h"
+#include "compat_nls.h"
void FinishStroke(void);
-BoxType StrokeBox;
+pcb_box_t StrokeBox;
/* ---------------------------------------------------------------------------
* FinishStroke - try to recognize the stroke sent
@@ -52,13 +52,13 @@ static void real_stroke_finish(void)
char msg[255];
unsigned long num;
- mid_stroke = pcb_false;
+ pcb_mid_stroke = pcb_false;
if (stroke_trans(msg)) {
num = atoi(msg);
switch (num) {
case 456:
if (conf_core.editor.mode == PCB_MODE_LINE) {
- SetMode(PCB_MODE_LINE);
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
}
break;
case 9874123:
@@ -66,33 +66,33 @@ static void real_stroke_finish(void)
case 987412:
case 8741236:
case 874123:
- RotateScreenObject(StrokeBox.X1, StrokeBox.Y1, SWAP_IDENT ? 1 : 3);
+ pcb_screen_obj_rotate90(StrokeBox.X1, StrokeBox.Y1, PCB_SWAP_IDENT ? 1 : 3);
break;
case 7896321:
case 786321:
case 789632:
case 896321:
- RotateScreenObject(StrokeBox.X1, StrokeBox.Y1, SWAP_IDENT ? 3 : 1);
+ pcb_screen_obj_rotate90(StrokeBox.X1, StrokeBox.Y1, PCB_SWAP_IDENT ? 3 : 1);
break;
case 258:
- SetMode(PCB_MODE_LINE);
+ pcb_crosshair_set_mode(PCB_MODE_LINE);
break;
case 852:
- SetMode(PCB_MODE_ARROW);
+ pcb_crosshair_set_mode(PCB_MODE_ARROW);
break;
case 1478963:
- ActionUndo(0, NULL, 0, 0);
+ pcb_act_Undo(0, NULL, 0, 0);
break;
case 147423:
case 147523:
case 1474123:
- Redo(pcb_true);
+ pcb_redo(pcb_true);
break;
case 148963:
case 147863:
case 147853:
case 145863:
- SetMode(PCB_MODE_VIA);
+ pcb_crosshair_set_mode(PCB_MODE_VIA);
break;
case 951:
case 9651:
@@ -115,8 +115,8 @@ static void real_stroke_finish(void)
case 12589:
case 14589:
{
- Coord x = (StrokeBox.X1 + StrokeBox.X2) / 2;
- Coord y = (StrokeBox.Y1 + StrokeBox.Y2) / 2;
+ pcb_coord_t x = (StrokeBox.X1 + StrokeBox.X2) / 2;
+ pcb_coord_t y = (StrokeBox.Y1 + StrokeBox.Y2) / 2;
double z;
/* XXX: PCB->MaxWidth and PCB->MaxHeight may be the wrong
* divisors below. The old code WAS broken, but this
@@ -126,17 +126,17 @@ static void real_stroke_finish(void)
z = MAX(z, 1 + log(fabs(StrokeBox.Y2 - StrokeBox.Y1) / PCB->MaxHeight) / log(2.0));
PCB->Zoom = z;
- CenterDisplay(x, y);
+ pcb_center_display(x, y);
break;
}
default:
- Message(PCB_MSG_DEFAULT, _("Unknown stroke %s\n"), msg);
+ pcb_message(PCB_MSG_INFO, _("Unknown stroke %s\n"), msg);
break;
}
}
else
- gui->beep();
+ pcb_gui->beep();
}
static void real_stroke_record(int ev_x, int ev_y)
@@ -151,17 +151,17 @@ static void real_stroke_record(int ev_x, int ev_y)
static void real_stroke_start(void)
{
fprintf(stderr, "stroke: MIID!\n");
- mid_stroke = pcb_true;
- StrokeBox.X1 = Crosshair.X;
- StrokeBox.Y1 = Crosshair.Y;
+ pcb_mid_stroke = pcb_true;
+ StrokeBox.X1 = pcb_crosshair.X;
+ StrokeBox.Y1 = pcb_crosshair.Y;
}
pcb_uninit_t hid_stroke_init(void)
{
stroke_init();
- stub_stroke_record = real_stroke_record;
- stub_stroke_start = real_stroke_start;
- stub_stroke_finish = real_stroke_finish;
+ pcb_stub_stroke_record = real_stroke_record;
+ pcb_stub_stroke_start = real_stroke_start;
+ pcb_stub_stroke_finish = real_stroke_finish;
return NULL;
}
diff --git a/src_plugins/teardrops/Makefile b/src_plugins/teardrops/Makefile
index f934ca0..54d36e0 100644
--- a/src_plugins/teardrops/Makefile
+++ b/src_plugins/teardrops/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_teardrops
+ cd ../../src && $(MAKE) mod_teardrops
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/teardrops/teardrops.c b/src_plugins/teardrops/teardrops.c
index 8e9a1c2..2cdcccd 100644
--- a/src_plugins/teardrops/teardrops.c
+++ b/src_plugins/teardrops/teardrops.c
@@ -17,15 +17,15 @@
#include <math.h>
#include "config.h"
-#include "global.h"
+#include "math_helper.h"
+#include "board.h"
#include "data.h"
#include "hid.h"
-#include "misc.h"
-#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "plugins.h"
#include "hid_actions.h"
+#include "obj_all.h"
#define MIN_LINE_LENGTH 700
#define MAX_DISTANCE 700
@@ -36,12 +36,12 @@
/* 1 mm */
/* #define MAX_DISTANCE 1000000 */
-static PinType *pin;
-static PadType *pad;
+static pcb_pin_t *pin;
+static pcb_pad_t *pad;
static int layer;
static int px, py;
-static Coord thickness;
-static ElementType *element;
+static pcb_coord_t thickness;
+static pcb_element_t *element;
static int new_arcs = 0;
@@ -56,10 +56,10 @@ int distance_between_points(int x1, int y1, int x2, int y2)
return distance;
}
-static r_dir_t check_line_callback(const BoxType * box, void *cl)
+static pcb_r_dir_t check_line_callback(const pcb_box_t * box, void *cl)
{
- LayerType *lay = &PCB->Data->Layer[layer];
- LineType *l = (LineType *) box;
+ pcb_layer_t *lay = &PCB->Data->Layer[layer];
+ pcb_line_t *l = (pcb_line_t *) box;
int x1, x2, y1, y2;
double a, b, c, x, r, t;
double dx, dy, len;
@@ -67,7 +67,7 @@ static r_dir_t check_line_callback(const BoxType * box, void *cl)
double ldist, adist, radius;
double vx, vy, vr, vl;
int delta, aoffset, count;
- ArcType *arc;
+ pcb_arc_t *arc;
fprintf(stderr, "...Line ((%.6f, %.6f), (%.6f, %.6f)): ",
PCB_COORD_TO_MM(l->Point1.X), PCB_COORD_TO_MM(l->Point1.Y), PCB_COORD_TO_MM(l->Point2.X), PCB_COORD_TO_MM(l->Point2.Y));
@@ -169,18 +169,18 @@ static r_dir_t check_line_callback(const BoxType * box, void *cl)
ax = lx - dy * adist;
ay = ly + dx * adist;
- arc = CreateNewArcOnLayer(lay, (int) ax, (int) ay, (int) radius,
+ arc = pcb_arc_new(lay, (int) ax, (int) ay, (int) radius,
(int) radius, (int) theta + 90 + aoffset, delta - aoffset, l->Thickness, l->Clearance, l->Flags);
if (arc)
- AddObjectToCreateUndoList(PCB_TYPE_ARC, lay, arc, arc);
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, lay, arc, arc);
ax = lx + dy * (x + t);
ay = ly - dx * (x + t);
- arc = CreateNewArcOnLayer(lay, (int) ax, (int) ay, (int) radius,
+ arc = pcb_arc_new(lay, (int) ax, (int) ay, (int) radius,
(int) radius, (int) theta - 90 - aoffset, -delta + aoffset, l->Thickness, l->Clearance, l->Flags);
if (arc)
- AddObjectToCreateUndoList(PCB_TYPE_ARC, lay, arc, arc);
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, lay, arc, arc);
radius += t * 1.9;
aoffset = acos((double) adist / radius) * 180.0 / M_PI;
@@ -192,9 +192,9 @@ static r_dir_t check_line_callback(const BoxType * box, void *cl)
return 1;
}
-static void check_pin(PinType * _pin)
+static void check_pin(pcb_pin_t * _pin)
{
- BoxType spot;
+ pcb_box_t spot;
pin = _pin;
@@ -207,22 +207,22 @@ static void check_pin(PinType * _pin)
spot.X2 = px + 10;
spot.Y2 = py + 10;
- element = (ElementType *) pin->Element;
+ element = (pcb_element_t *) pin->Element;
- fprintf(stderr, "Pin %s (%s) at %.6f, %.6f (element %s, %s, %s)\n", EMPTY(pin->Number), EMPTY(pin->Name),
+ fprintf(stderr, "Pin %s (%s) at %.6f, %.6f (element %s, %s, %s)\n", PCB_EMPTY(pin->Number), PCB_EMPTY(pin->Name),
/* 0.01 * pin->X, 0.01 * pin->Y, */
PCB_COORD_TO_MM(pin->X), PCB_COORD_TO_MM(pin->Y),
- EMPTY(NAMEONPCB_NAME(element)), EMPTY(VALUE_NAME(element)), EMPTY(DESCRIPTION_NAME(element)));
+ PCB_EMPTY(PCB_ELEM_NAME_REFDES(element)), PCB_EMPTY(PCB_ELEM_NAME_VALUE(element)), PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(element)));
- for (layer = 0; layer < max_copper_layer; layer++) {
- LayerType *l = &(PCB->Data->Layer[layer]);
- r_search(l->line_tree, &spot, NULL, check_line_callback, l, NULL);
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
+ pcb_layer_t *l = &(PCB->Data->Layer[layer]);
+ pcb_r_search(l->line_tree, &spot, NULL, check_line_callback, l, NULL);
}
}
-static void check_via(PinType * _pin)
+static void check_via(pcb_pin_t * _pin)
{
- BoxType spot;
+ pcb_box_t spot;
pin = _pin;
@@ -236,94 +236,94 @@ static void check_via(PinType * _pin)
fprintf(stderr, "Via at %.6f, %.6f\n", PCB_COORD_TO_MM(pin->X), PCB_COORD_TO_MM(pin->Y));
- for (layer = 0; layer < max_copper_layer; layer++) {
- LayerType *l = &(PCB->Data->Layer[layer]);
- r_search(l->line_tree, &spot, NULL, check_line_callback, l, NULL);
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
+ pcb_layer_t *l = &(PCB->Data->Layer[layer]);
+ pcb_r_search(l->line_tree, &spot, NULL, check_line_callback, l, NULL);
}
}
/*!
* \brief Draw teardrops for pads.
*/
-static void check_pad(PadType * _pad)
+static void check_pad(pcb_pad_t * _pad)
{
pad = _pad;
px = (pad->BoundingBox.X1 + pad->BoundingBox.X2) / 2;
py = (pad->BoundingBox.Y1 + pad->BoundingBox.Y2) / 2;
thickness = pad->Thickness;
- element = (ElementType *) pad->Element;
+ element = (pcb_element_t *) pad->Element;
fprintf(stderr,
"Pad %s (%s) at %.6f, %.6f (element %s, %s, %s) \n",
- EMPTY(pad->Number), EMPTY(pad->Name),
+ PCB_EMPTY(pad->Number), PCB_EMPTY(pad->Name),
PCB_COORD_TO_MM((pad->BoundingBox.X1 + pad->BoundingBox.X2) / 2),
PCB_COORD_TO_MM((pad->BoundingBox.Y1 + pad->BoundingBox.Y2) / 2),
- EMPTY(NAMEONPCB_NAME(element)), EMPTY(VALUE_NAME(element)), EMPTY(DESCRIPTION_NAME(element)));
+ PCB_EMPTY(PCB_ELEM_NAME_REFDES(element)), PCB_EMPTY(PCB_ELEM_NAME_VALUE(element)), PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(element)));
/* fprintf(stderr, */
/* "Pad %s (%s) at ((%.6f, %.6f), (%.6f, %.6f)) (element %s, %s, %s) \n", */
- /* EMPTY (pad->Number), EMPTY (pad->Name), */
+ /* PCB_EMPTY(pad->Number), PCB_EMPTY(pad->Name), */
/* PCB_COORD_TO_MM(pad->BoundingBox.X1), */
/* PCB_COORD_TO_MM(pad->BoundingBox.Y1), */
/* PCB_COORD_TO_MM(pad->BoundingBox.X2), */
/* PCB_COORD_TO_MM(pad->BoundingBox.Y2), */
- /* EMPTY (NAMEONPCB_NAME (element)), */
- /* EMPTY (VALUE_NAME (element)), */
- /* EMPTY (DESCRIPTION_NAME (element))); */
+ /* PCB_EMPTY(PCB_ELEM_NAME_REFDES(element)), */
+ /* PCB_EMPTY(PCB_ELEM_NAME_VALUE(element)), */
+ /* PCB_EMPTY(PCB_ELEM_NAME_DESCRIPTION(element))); */
- for (layer = 0; layer < max_copper_layer; layer++) {
- LayerType *l = &(PCB->Data->Layer[layer]);
- r_search(l->line_tree, &(pad->BoundingBox), NULL, check_line_callback, l, NULL);
+ for (layer = 0; layer < pcb_max_copper_layer; layer++) {
+ pcb_layer_t *l = &(PCB->Data->Layer[layer]);
+ pcb_r_search(l->line_tree, &(pad->BoundingBox), NULL, check_line_callback, l, NULL);
}
}
-static int teardrops(int argc, const char **argv, Coord x, Coord y)
+static int teardrops(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
new_arcs = 0;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
check_via(via);
}
- END_LOOP;
+ PCB_END_LOOP;
- ALLPIN_LOOP(PCB->Data);
+ PCB_PIN_ALL_LOOP(PCB->Data);
{
check_pin(pin);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
check_pad(pad);
}
- ENDALL_LOOP;
+ PCB_ENDALL_LOOP;
- gui->invalidate_all();
+ pcb_gui->invalidate_all();
if (new_arcs)
- IncrementUndoSerialNumber();
+ pcb_undo_inc_serial();
return 0;
}
-static HID_Action teardrops_action_list[] = {
+static pcb_hid_action_t teardrops_action_list[] = {
{"Teardrops", NULL, teardrops, NULL, NULL}
};
char *teardrops_cookie = "teardrops plugin";
-REGISTER_ACTIONS(teardrops_action_list, teardrops_cookie)
+PCB_REGISTER_ACTIONS(teardrops_action_list, teardrops_cookie)
static void hid_teardrops_uninit(void)
{
- hid_remove_actions_by_cookie(teardrops_cookie);
+ pcb_hid_remove_actions_by_cookie(teardrops_cookie);
}
#include "dolists.h"
pcb_uninit_t hid_teardrops_init()
{
- REGISTER_ACTIONS(teardrops_action_list, teardrops_cookie);
+ PCB_REGISTER_ACTIONS(teardrops_action_list, teardrops_cookie);
return hid_teardrops_uninit;
}
diff --git a/src_plugins/toporouter/Makefile b/src_plugins/toporouter/Makefile
index 4d838d9..aee1245 100644
--- a/src_plugins/toporouter/Makefile
+++ b/src_plugins/toporouter/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_toporouter
+ cd ../../src && $(MAKE) mod_toporouter
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/toporouter/Plug.tmpasm b/src_plugins/toporouter/Plug.tmpasm
index 5031aa9..dec04f9 100644
--- a/src_plugins/toporouter/Plug.tmpasm
+++ b/src_plugins/toporouter/Plug.tmpasm
@@ -21,5 +21,8 @@ switch /local/pcb/toporouter/controls
append /local/pcb/toporouter/OBJS { ../src_3rd/gts/libgts.a }
include /local/pcb/tmpasm/plugin
end
- case {disable} include /local/pcb/tmpasm/disable; end;
+ case {disable}
+ put /local/pcb/mod/OBJS {}
+ include /local/pcb/tmpasm/disable
+ end
end
diff --git a/src_plugins/toporouter/toporouter.c b/src_plugins/toporouter/toporouter.c
index 4e8ee50..60f4e88 100644
--- a/src_plugins/toporouter/toporouter.c
+++ b/src_plugins/toporouter/toporouter.c
@@ -53,8 +53,10 @@
*
*/
+#include "config.h"
#include "toporouter.h"
#include "pcb-printf.h"
+#include "compat_nls.h"
static void toporouter_edge_init(toporouter_edge_t * edge)
{
@@ -303,8 +305,8 @@ gint toporouter_draw_vertex(gpointer item, gpointer data)
#if TOPO_OUTPUT_ENABLED
drawing_context_t *dc = (drawing_context_t *) data;
toporouter_vertex_t *tv;
- PinType *pin;
- PadType *pad;
+ pcb_pin_t *pin;
+ pcb_pad_t *pad;
gdouble blue;
if (TOPOROUTER_IS_VERTEX((GtsObject *) item)) {
@@ -332,8 +334,8 @@ gint toporouter_draw_vertex(gpointer item, gpointer data)
/* printf("tv->type = %d\n", tv->type); */
if (!dc->mode) {
if (tv->bbox) {
- pin = (PinType *) tv->bbox->data;
- pad = (PadType *) tv->bbox->data;
+ pin = (pcb_pin_t *) tv->bbox->data;
+ pad = (pcb_pad_t *) tv->bbox->data;
blue = 0.0f;
switch (tv->bbox->type) {
@@ -595,16 +597,16 @@ gdouble vertex_net_thickness(toporouter_vertex_t * v)
}
else {
if (box->type == PIN || box->type == VIA) {
- PinType *pin = (PinType *) box->data;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin) || TEST_FLAG(PCB_FLAG_OCTAGON, pin)) {
+ pcb_pin_t *pin = (pcb_pin_t *) box->data;
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin) || PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pin)) {
return 0.;
}
-/* return ((PinType *)box->data)->Thickness + 1.;*/
- return ((PinType *) box->data)->Thickness;
+/* return ((pcb_pin_t *)box->data)->Thickness + 1.;*/
+ return ((pcb_pin_t *) box->data)->Thickness;
}
else if (box->type == PAD) {
- PadType *pad = (PadType *) box->data;
- if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y && !TEST_FLAG(PCB_FLAG_SQUARE, pad)) {
+ pcb_pad_t *pad = (pcb_pad_t *) box->data;
+ if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y && !PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) {
return pad->Thickness;
}
return 0.;
@@ -613,7 +615,7 @@ gdouble vertex_net_thickness(toporouter_vertex_t * v)
return 0.;
}
else if (box->type == LINE) {
- LineType *line = (LineType *) box->data;
+ pcb_line_t *line = (pcb_line_t *) box->data;
return line->Thickness;
}
else if (box->type == POLYGON) {
@@ -642,9 +644,9 @@ gdouble vertex_net_clearance(toporouter_vertex_t * v)
}
else {
/* if(box->type == PIN || box->type == VIA)
- return ((PinType *)box->data)->Clearance;
+ return ((pcb_pin_t *)box->data)->Clearance;
else if(box->type == PAD)
- return ((PadType *)box->data)->Clearance; */
+ return ((pcb_pad_t *)box->data)->Clearance; */
}
@@ -1176,7 +1178,7 @@ guint groupcount(void)
int group;
guint count = 0;
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
if (PCB->LayerGroups.Number[group] > 0)
count++;
}
@@ -1205,7 +1207,7 @@ void toporouter_free(toporouter_t * r)
usecs += 1000;
}
- Message(PCB_MSG_DEFAULT, _("Elapsed time: %d.%02d seconds\n"), secs, usecs);
+ pcb_message(PCB_MSG_INFO, _("Elapsed time: %d.%02d seconds\n"), secs, usecs);
free(r->layers);
free(r);
@@ -1747,12 +1749,12 @@ GtsPoint *midpoint(GtsPoint * a, GtsPoint * b)
return gts_point_new(gts_point_class(), (a->x + b->x) / 2., (a->y + b->y) / 2., 0.);
}
-static inline gdouble pad_rad(PadType * pad)
+static inline gdouble pad_rad(pcb_pad_t * pad)
{
return (lookup_thickness(pad->Name) / 2.) + lookup_clearance(pad->Name);
}
-static inline gdouble pin_rad(PinType * pin)
+static inline gdouble pin_rad(pcb_pin_t * pin)
{
return (lookup_thickness(pin->Name) / 2.) + lookup_clearance(pin->Name);
}
@@ -1802,8 +1804,8 @@ int read_pads(toporouter_t * r, toporouter_layer_t * l, guint layer)
GList *vlist = NULL;
toporouter_bbox_t *bbox = NULL;
- guint front = GetLayerGroupNumberByNumber(component_silk_layer);
- guint back = GetLayerGroupNumberByNumber(solder_silk_layer);
+ pcb_layergrp_id_t front = pcb_layer_get_group(pcb_component_silk_layer);
+ pcb_layergrp_id_t back = pcb_layer_get_group(pcb_solder_silk_layer);
/* printf("read_pads: front = %d back = %d layer = %d\n",
front, back, layer);*/
@@ -1812,11 +1814,11 @@ int read_pads(toporouter_t * r, toporouter_layer_t * l, guint layer)
if (l - r->layers != front && l - r->layers != back)
return 0;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PAD_LOOP(element);
+ PCB_PAD_LOOP(element);
{
- if ((l - r->layers == back && TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) || (l - r->layers == front && !TEST_FLAG(PCB_FLAG_ONSOLDER, pad))) {
+ if ((l - r->layers == back && PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad)) || (l - r->layers == front && !PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad))) {
t = (gdouble) pad->Thickness / 2.0f;
x[0] = pad->Point1.X;
@@ -1825,7 +1827,7 @@ int read_pads(toporouter_t * r, toporouter_layer_t * l, guint layer)
y[1] = pad->Point2.Y;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) {
/* Square or oblong pad. Four points and four constraint edges are
* used */
@@ -1956,9 +1958,9 @@ int read_pads(toporouter_t * r, toporouter_layer_t * l, guint layer)
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
@@ -1975,16 +1977,16 @@ int read_points(toporouter_t * r, toporouter_layer_t * l, int layer)
GList *vlist = NULL;
toporouter_bbox_t *bbox = NULL;
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
t = (gdouble) pin->Thickness / 2.0f;
x = pin->X;
y = pin->Y;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) {
vlist = rect_with_attachments(pin_rad(pin), x - t, y - t, x - t, y + t, x + t, y + t, x + t, y - t, l - r->layers);
bbox = toporouter_bbox_create(l - r->layers, vlist, PIN, pin);
@@ -1994,7 +1996,7 @@ int read_points(toporouter_t * r, toporouter_layer_t * l, int layer)
bbox->point = GTS_POINT(insert_vertex(r, l, x, y, bbox));
}
- else if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) {
+ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pin)) {
/* TODO: Handle octagon pins */
fprintf(stderr, "No support for octagon pins yet\n");
}
@@ -2006,20 +2008,20 @@ int read_points(toporouter_t * r, toporouter_layer_t * l, int layer)
bbox->point = GTS_POINT(insert_vertex(r, l, x, y, bbox));
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
- END_LOOP;
+ PCB_END_LOOP;
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
t = (gdouble) via->Thickness / 2.0f;
x = via->X;
y = via->Y;
- if (TEST_FLAG(PCB_FLAG_SQUARE, via)) {
+ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, via)) {
- vlist = rect_with_attachments(pin_rad((PinType *) via),
+ vlist = rect_with_attachments(pin_rad((pcb_pin_t *) via),
x - t, y - t, x - t, y + t, x + t, y + t, x + t, y - t, l - r->layers);
bbox = toporouter_bbox_create(l - r->layers, vlist, VIA, via);
r->bboxes = g_slist_prepend(r->bboxes, bbox);
@@ -2028,13 +2030,13 @@ int read_points(toporouter_t * r, toporouter_layer_t * l, int layer)
bbox->point = GTS_POINT(insert_vertex(r, l, x, y, bbox));
}
- else if (TEST_FLAG(PCB_FLAG_OCTAGON, via)) {
+ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, via)) {
/* TODO: Handle octagon vias */
fprintf(stderr, "No support for octagon vias yet\n");
}
else {
- vlist = rect_with_attachments(pin_rad((PinType *) via),
+ vlist = rect_with_attachments(pin_rad((pcb_pin_t *) via),
x - t, y - t, x - t, y + t, x + t, y + t, x + t, y - t, l - r->layers);
bbox = toporouter_bbox_create(l - r->layers, vlist, VIA, via);
r->bboxes = g_slist_prepend(r->bboxes, bbox);
@@ -2044,7 +2046,7 @@ int read_points(toporouter_t * r, toporouter_layer_t * l, int layer)
}
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
@@ -2053,7 +2055,7 @@ int read_points(toporouter_t * r, toporouter_layer_t * l, int layer)
*
* Inserts points and constraints into GLists
*/
-int read_lines(toporouter_t * r, toporouter_layer_t * l, LayerType * layer, int ln)
+int read_lines(toporouter_t * r, toporouter_layer_t * l, pcb_layer_t * layer, int ln)
{
gdouble xs[2], ys[2];
@@ -2062,7 +2064,7 @@ int read_lines(toporouter_t * r, toporouter_layer_t * l, LayerType * layer, int
GtsVertexClass *vertex_class = GTS_VERTEX_CLASS(toporouter_vertex_class());
- LINE_LOOP(layer);
+ PCB_LINE_LOOP(layer);
{
xs[0] = line->Point1.X;
xs[1] = line->Point2.X;
@@ -2072,7 +2074,7 @@ int read_lines(toporouter_t * r, toporouter_layer_t * l, LayerType * layer, int
vlist = g_list_prepend(NULL, gts_vertex_new(vertex_class, xs[0], ys[0], l - r->layers));
vlist = g_list_prepend(vlist, gts_vertex_new(vertex_class, xs[1], ys[1], l - r->layers));
/* TODO: replace this with surface version */
- bbox = toporouter_bbox_create_from_points(GetLayerGroupNumberByNumber(ln), vlist, LINE, line);
+ bbox = toporouter_bbox_create_from_points(pcb_layer_get_group(ln), vlist, LINE, line);
r->bboxes = g_slist_prepend(r->bboxes, bbox);
/*new;;
//insert_constraints_from_list(r, l, vlist, bbox); */
@@ -2083,7 +2085,7 @@ int read_lines(toporouter_t * r, toporouter_layer_t * l, LayerType * layer, int
g_list_concat(bbox->constraints, insert_constraint_edge(r, l, xs[0], ys[0], 0, xs[1], ys[1], 0, bbox));
}
}
- END_LOOP;
+ PCB_END_LOOP;
return 0;
}
@@ -2695,26 +2697,26 @@ toporouter_netlist_t *netlist_create(toporouter_t * r, char *netlist, char *styl
void import_clusters(toporouter_t * r)
{
- NetListListType nets;
- ResetConnections(pcb_false);
- nets = CollectSubnets(pcb_false);
- NETLIST_LOOP(&nets);
+ pcb_netlist_list_t nets;
+ pcb_reset_conns(pcb_false);
+ nets = pcb_rat_collect_subnets(pcb_false);
+ PCB_NETLIST_LOOP(&nets);
{
if (netlist->NetN > 0) {
toporouter_netlist_t *nl = netlist_create(r, netlist->Net->Connection->menu->Name, netlist->Net->Connection->menu->Style);
- NET_LOOP(netlist);
+ PCB_NET_LOOP(netlist);
{
toporouter_cluster_t *cluster = cluster_create(r, nl);
#ifdef DEBUG_MERGING
printf("NET:\n");
#endif
- CONNECTION_LOOP(net);
+ PCB_CONNECTION_LOOP(net);
{
if (connection->type == PCB_TYPE_LINE) {
- LineType *line = (LineType *) connection->ptr2;
+ pcb_line_t *line = (pcb_line_t *) connection->ptr2;
toporouter_bbox_t *box = toporouter_bbox_locate(r, LINE, line, connection->X, connection->Y, connection->group);
cluster_join_bbox(cluster, box);
@@ -2723,7 +2725,7 @@ void import_clusters(toporouter_t * r)
#endif
}
else if (connection->type == PCB_TYPE_PAD) {
- PadType *pad = (PadType *) connection->ptr2;
+ pcb_pad_t *pad = (pcb_pad_t *) connection->ptr2;
toporouter_bbox_t *box = toporouter_bbox_locate(r, PAD, pad, connection->X, connection->Y, connection->group);
cluster_join_bbox(cluster, box);
@@ -2734,7 +2736,7 @@ void import_clusters(toporouter_t * r)
else if (connection->type == PCB_TYPE_PIN) {
guint m;
for (m = 0; m < groupcount(); m++) {
- PinType *pin = (PinType *) connection->ptr2;
+ pcb_pin_t *pin = (pcb_pin_t *) connection->ptr2;
toporouter_bbox_t *box = toporouter_bbox_locate(r, PIN, pin, connection->X, connection->Y, m);
cluster_join_bbox(cluster, box);
}
@@ -2746,7 +2748,7 @@ void import_clusters(toporouter_t * r)
else if (connection->type == PCB_TYPE_VIA) {
guint m;
for (m = 0; m < groupcount(); m++) {
- PinType *pin = (PinType *) connection->ptr2;
+ pcb_pin_t *pin = (pcb_pin_t *) connection->ptr2;
toporouter_bbox_t *box = toporouter_bbox_locate(r, VIA, pin, connection->X, connection->Y, m);
cluster_join_bbox(cluster, box);
}
@@ -2756,7 +2758,7 @@ void import_clusters(toporouter_t * r)
#endif
}
else if (connection->type == PCB_TYPE_POLYGON) {
- PolygonType *polygon = (PolygonType *) connection->ptr2;
+ pcb_polygon_t *polygon = (pcb_polygon_t *) connection->ptr2;
toporouter_bbox_t *box =
toporouter_bbox_locate(r, POLYGON, polygon, connection->X, connection->Y, connection->group);
cluster_join_bbox(cluster, box);
@@ -2767,17 +2769,17 @@ void import_clusters(toporouter_t * r)
}
}
- END_LOOP;
+ PCB_END_LOOP;
#ifdef DEBUG_MERGING
printf("\n");
#endif
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- END_LOOP;
- FreeNetListListMemory(&nets);
+ PCB_END_LOOP;
+ pcb_netlist_list_free(&nets);
}
void import_geometry(toporouter_t * r)
@@ -2787,7 +2789,7 @@ void import_geometry(toporouter_t * r)
int group;
#ifdef DEBUG_IMPORT
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
printf("Group %d: Number %d:\n", group, PCB->LayerGroups.Number[group]);
for (int entry = 0; entry < PCB->LayerGroups.Number[group]; entry++) {
@@ -2799,7 +2801,7 @@ void import_geometry(toporouter_t * r)
cur_layer = r->layers = (toporouter_layer_t *) malloc(groupcount() * sizeof(toporouter_layer_t));
/* Foreach layer, read in pad vertices and constraints, and build CDT */
- for (group = 0; group < max_group; group++) {
+ for (group = 0; group < pcb_max_group; group++) {
#ifdef DEBUG_IMPORT
printf("*** LAYER GROUP %d ***\n", group);
#endif
@@ -2829,7 +2831,7 @@ void import_geometry(toporouter_t * r)
read_lines(r, cur_layer, layer, number);
}
- END_LOOP;
+ PCB_END_LOOP;
@@ -2911,7 +2913,7 @@ toporouter_cluster_t *cluster_find(toporouter_t * r, gdouble x, gdouble y, gdoub
if (box->layer == (int) z) {
if (box->type != BOARD) {
if (box->type == LINE) {
- LineType *line = (LineType *) box->data;
+ pcb_line_t *line = (pcb_line_t *) box->data;
gint linewind = coord_wind(line->Point1.X, line->Point1.Y, x, y, line->Point2.X, line->Point2.Y);
if (line->Point1.X > x - EPSILON && line->Point1.X < x + EPSILON &&
@@ -4891,9 +4893,9 @@ GList *route(toporouter_t * r, toporouter_route_t * data, guint debug)
}
}
- gts_eheap_insert(openlist, curpoint);
+ gts_epcb_heap_insert(openlist, curpoint);
- while (gts_eheap_size(openlist) > 0) {
+ while (gts_epcb_heap_size(openlist) > 0) {
GList *candidatepoints;
data->curpoint = curpoint;
/*draw_route_status(r, closelist, openlist, curpoint, data, count++); */
@@ -5025,7 +5027,7 @@ GList *route(toporouter_t * r, toporouter_route_t * data, guint debug)
temppoint->hcost = simple_h_cost(r, temppoint, destv);
/* if(cur_layer != dest_layer) temppoint->hcost += r->viacost;*/
- gts_eheap_insert(openlist, temppoint);
+ gts_epcb_heap_insert(openlist, temppoint);
}
}
@@ -5109,7 +5111,7 @@ route_finish:
if(restartv) {
clean_routing_edges(r, data);
- gts_eheap_destroy(openlist);
+ gts_epcb_heap_destroy(openlist);
g_list_free(closelist);
openlist = gts_eheap_new(route_heap_cmp, NULL);
closelist = NULL;
@@ -5203,7 +5205,7 @@ routing_return:
g_list_free(data->srcvertices);
data->destvertices = NULL;
data->srcvertices = NULL;
- gts_eheap_destroy(openlist);
+ gts_epcb_heap_destroy(openlist);
g_list_free(closelist);
data->alltemppoints = NULL;
@@ -5528,12 +5530,12 @@ void print_oproute(toporouter_oproute_t * oproute)
gdouble export_pcb_drawline(guint layer, guint x0, guint y0, guint x1, guint y1, guint thickness, guint clearance)
{
gdouble d = 0.;
- LineTypePtr line;
- line = CreateDrawnLineOnLayer(LAYER_PTR(layer), x0, y0, x1, y1,
- thickness, clearance, MakeFlags(PCB_FLAG_AUTO | (TEST_FLAG(CLEARNEWFLAG, PCB) ? PCB_FLAG_CLEARLINE : 0)));
+ pcb_line_t *line;
+ line = pcb_line_new_merge(LAYER_PTR(layer), x0, y0, x1, y1,
+ thickness, clearance, pcb_flag_make(PCB_FLAG_AUTO | (PCB_FLAG_TEST(PCB_CLEARNEWFLAG, PCB) ? PCB_FLAG_CLEARLINE : 0)));
if (line) {
- AddObjectToCreateUndoList(PCB_TYPE_LINE, LAYER_PTR(layer), line, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, LAYER_PTR(layer), line, line);
d = coord_distance((double) x0, (double) y0, (double) x1, (double) y1) / 100.;
}
return d;
@@ -5555,7 +5557,7 @@ gdouble export_pcb_drawarc(guint layer, toporouter_arc_t * a, guint thickness, g
{
gdouble sa, da, theta;
gdouble d = 0.;
- ArcTypePtr arc;
+ pcb_arc_t *arc;
gint wind;
wind = coord_wind(a->x0, a->y0, a->x1, a->y1, vx(a->centre), vy(a->centre));
@@ -5577,12 +5579,12 @@ gdouble export_pcb_drawarc(guint layer, toporouter_arc_t * a, guint thickness, g
if (da > 359. || da < -359.)
return 0.;
- arc = CreateNewArcOnLayer(LAYER_PTR(layer), vx(a->centre), vy(a->centre), a->r, a->r,
+ arc = pcb_arc_new(LAYER_PTR(layer), vx(a->centre), vy(a->centre), a->r, a->r,
sa, da, thickness, clearance,
- MakeFlags(PCB_FLAG_AUTO | (TEST_FLAG(CLEARNEWFLAG, PCB) ? PCB_FLAG_CLEARLINE : 0)));
+ pcb_flag_make(PCB_FLAG_AUTO | (PCB_FLAG_TEST(PCB_CLEARNEWFLAG, PCB) ? PCB_FLAG_CLEARLINE : 0)));
if (arc) {
- AddObjectToCreateUndoList(PCB_TYPE_ARC, LAYER_PTR(layer), arc, arc);
+ pcb_undo_add_obj_to_create(PCB_TYPE_ARC, LAYER_PTR(layer), arc, arc);
d = a->r * theta / 100.;
}
@@ -6965,8 +6967,8 @@ void toporouter_export(toporouter_t * r)
i = i->next;
}
- Message(PCB_MSG_DEFAULT, _("Reticulating splines... successful\n\n"));
- Message(PCB_MSG_DEFAULT, _("Wiring cost: %f inches\n"), r->wiring_score / 1000.);
+ pcb_message(PCB_MSG_INFO, _("Reticulating splines... successful\n\n"));
+ pcb_message(PCB_MSG_INFO, _("Wiring cost: %f inches\n"), r->wiring_score / 1000.);
printf("Wiring cost: %f inches\n", r->wiring_score / 1000.);
g_list_free(oproutes);
@@ -7009,7 +7011,7 @@ print_routedata(toporouter_route_t *routedata)
g_list_free(destvertices);
}*/
-toporouter_route_t *import_route(toporouter_t * r, RatType * line)
+toporouter_route_t *import_route(toporouter_t * r, pcb_rat_t * line)
{
toporouter_route_t *routedata = routedata_create();
@@ -7767,7 +7769,7 @@ gint roar_router(toporouter_t * r, gint failcount, gint threshold)
guint j;
gint pfailcount = failcount + 1;
- Message(PCB_MSG_DEFAULT, _("ROAR router: "));
+ pcb_message(PCB_MSG_INFO, _("ROAR router: "));
for (j = 0; j < 6; j++) {
GList *failed = g_list_copy(r->failednets), *k = failed;
@@ -7781,10 +7783,10 @@ gint roar_router(toporouter_t * r, gint failcount, gint threshold)
printf("\tROAR pass %d - %d routed - %d failed\n", j, g_list_length(r->routednets), g_list_length(r->failednets));
if (!failcount || failcount >= pfailcount) {
- Message(PCB_MSG_DEFAULT, _("%d nets remaining\n"), failcount);
+ pcb_message(PCB_MSG_INFO, _("%d nets remaining\n"), failcount);
break;
}
- Message(PCB_MSG_DEFAULT, _("%d -> "), failcount);
+ pcb_message(PCB_MSG_INFO, _("%d -> "), failcount);
pfailcount = failcount;
}
@@ -7965,7 +7967,7 @@ guint hybrid_router(toporouter_t * r)
r->flags |= TOPOROUTER_FLAG_AFTERRUBIX;
failcount = rubix_router(r, failcount);
- Message(PCB_MSG_DEFAULT, _("RUBIX router: %d nets remaining\n"), failcount);
+ pcb_message(PCB_MSG_INFO, _("RUBIX router: %d nets remaining\n"), failcount);
printf("RUBIX router: %d nets remaining\n", failcount);
r->flags |= TOPOROUTER_FLAG_GOFAR;
@@ -8005,9 +8007,9 @@ void parse_arguments(toporouter_t * r, int argc, char **argv)
}
}
- for (group = 0; group < max_group; group++)
+ for (group = 0; group < pcb_max_group; group++)
for (i = 0; i < PCB->LayerGroups.Number[group]; i++)
- if ((PCB->LayerGroups.Entries[group][i] < max_copper_layer) && !(PCB->Data->Layer[PCB->LayerGroups.Entries[group][i]].On)) {
+ if ((PCB->LayerGroups.Entries[group][i] < pcb_max_copper_layer) && !(PCB->Data->Layer[PCB->LayerGroups.Entries[group][i]].On)) {
gdouble *layer = (gdouble *) malloc(sizeof(gdouble));
*layer = (double) group;
r->keepoutlayers = g_list_prepend(r->keepoutlayers, layer);
@@ -8053,24 +8055,24 @@ toporouter_t *toporouter_new(void)
gts_predicates_init();
- Message(PCB_MSG_DEFAULT, _("Topological Autorouter\n"));
- Message(PCB_MSG_DEFAULT, _("Started %s"), asctime(localtime(<ime)));
- Message(PCB_MSG_DEFAULT, _("-------------------------------------\n"));
- Message(PCB_MSG_DEFAULT, _("Copyright 2009 Anthony Blake (tonyb33 at gmail.com)\n\n"));
+ pcb_message(PCB_MSG_INFO, _("Topological Autorouter\n"));
+ pcb_message(PCB_MSG_INFO, _("Started %s"), asctime(localtime(<ime)));
+ pcb_message(PCB_MSG_INFO, _("-------------------------------------\n"));
+ pcb_message(PCB_MSG_INFO, _("Copyright 2009 Anthony Blake (tonyb33 at gmail.com)\n\n"));
return r;
}
void acquire_twonets(toporouter_t * r)
{
- RAT_LOOP(PCB->Data);
- if (TEST_FLAG(PCB_FLAG_SELECTED, line))
+ PCB_RAT_LOOP(PCB->Data);
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line))
import_route(r, line);
- END_LOOP;
+ PCB_END_LOOP;
if (!r->routes->len) {
- RAT_LOOP(PCB->Data);
+ PCB_RAT_LOOP(PCB->Data);
import_route(r, line);
- END_LOOP;
+ PCB_END_LOOP;
}
}
@@ -8093,7 +8095,7 @@ gint toporouter_set_pair(toporouter_t * r, toporouter_netlist_t * n1, toporouter
return 1;
}
-static int toporouter(int argc, char **argv, Coord x, Coord y)
+static int toporouter(int argc, char **argv, pcb_coord_t x, pcb_coord_t y)
{
toporouter_t *r = toporouter_new();
parse_arguments(r, argc, argv);
@@ -8121,18 +8123,18 @@ static int toporouter(int argc, char **argv, Coord x, Coord y)
toporouter_export(r);
toporouter_free(r);
- SaveUndoSerialNumber();
- DeleteRats(pcb_false);
- RestoreUndoSerialNumber();
- AddAllRats(pcb_false, NULL);
- RestoreUndoSerialNumber();
- IncrementUndoSerialNumber();
- Redraw();
+ pcb_undo_save_serial();
+ pcb_rats_destroy(pcb_false);
+ pcb_undo_restore_serial();
+ pcb_rat_add_all(pcb_false, NULL);
+ pcb_undo_restore_serial();
+ pcb_undo_inc_serial();
+ pcb_redraw();
return 0;
}
-static int escape(int argc, char **argv, Coord x, Coord y)
+static int escape(int argc, char **argv, pcb_coord_t x, pcb_coord_t y)
{
guint dir, viax, viay;
gdouble pitch, length, dx, dy;
@@ -8143,14 +8145,14 @@ static int escape(int argc, char **argv, Coord x, Coord y)
dir = atoi(argv[0]);
- ALLPAD_LOOP(PCB->Data);
+ PCB_PAD_ALL_LOOP(PCB->Data);
{
- if (TEST_FLAG(PCB_FLAG_SELECTED, pad)) {
- PinTypePtr via;
- LineTypePtr line;
+ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, pad)) {
+ pcb_pin_t *via;
+ pcb_line_t *line;
- PadType *pad0 = element->Pad->data;
- PadType *pad1 = g_list_next(element->Pad)->data;
+ pcb_pad_t *pad0 = element->Pad->data;
+ pcb_pad_t *pad1 = g_list_next(element->Pad)->data;
pitch = sqrt(pow(abs(pad0->Point1.X - pad1->Point1.X), 2) + pow(abs(pad0->Point1.Y - pad1->Point1.Y), 2));
length = sqrt(pow(pitch, 2) + pow(pitch, 2)) / 2.;
@@ -8196,17 +8198,17 @@ static int escape(int argc, char **argv, Coord x, Coord y)
return 1;
}
- if ((via = CreateNewVia(PCB->Data, viax, viay,
+ if ((via = pcb_via_new(PCB->Data, viax, viay,
Settings.ViaThickness, 2 * Settings.Clearance,
- 0, Settings.ViaDrillingHole, NULL, NoFlags())) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via);
+ 0, Settings.ViaDrillingHole, NULL, pcb_no_flags())) != NULL) {
+ pcb_undo_add_obj_to_create(PCB_TYPE_VIA, via, via, via);
/* if (gui->shift_is_pressed ())
- ChangeObjectThermal (PCB_TYPE_VIA, via, via, via, PCB->ThermStyle);*/
+ pcb_chg_obj_thermal(PCB_TYPE_VIA, via, via, via, PCB->ThermStyle);*/
DrawVia(via);
- if ((line = CreateDrawnLineOnLayer(CURRENT, pad->Point1.X + 1., pad->Point1.Y + 1., viax + 1., viay + 1.,
- Settings.LineThickness, 2 * Settings.Clearance, NoFlags()))) {
+ if ((line = pcb_line_new_merge(CURRENT, pad->Point1.X + 1., pad->Point1.Y + 1., viax + 1., viay + 1.,
+ Settings.LineThickness, 2 * Settings.Clearance, pcb_no_flags()))) {
- AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, line, line);
+ pcb_undo_add_obj_to_create(PCB_TYPE_LINE, CURRENT, line, line);
DrawLine(CURRENT, line);
}
@@ -8215,24 +8217,24 @@ static int escape(int argc, char **argv, Coord x, Coord y)
}
}
- END_LOOP;
- END_LOOP;
+ PCB_END_LOOP;
+ PCB_END_LOOP;
- IncrementUndoSerialNumber();
- Draw();
+ pcb_undo_inc_serial();
+ pcb_draw();
return 0;
}
-static HID_Action toporouter_action_list[] = {
+static pcb_hid_action_t toporouter_action_list[] = {
{"Escape", "Select a set of pads", escape, "Pad escape", "Escape()"},
{"Toporouter", "Select net(s)", toporouter, "Topological autorouter", "Toporouter()"}
};
-REGISTER_ACTIONS(toporouter_action_list, toporouter_cookie)
+PCB_REGISTER_ACTIONS(toporouter_action_list, toporouter_cookie)
static void hid_toporouter_uninit(void)
{
- hid_remove_actions_by_cookie(toporouter_cookie);
+ pcb_hid_remove_actions_by_cookie(toporouter_cookie);
}
pcb_uninit_t hid_toporouter_init()
diff --git a/src_plugins/toporouter/toporouter.h b/src_plugins/toporouter/toporouter.h
index 882e118..4f8cc54 100644
--- a/src_plugins/toporouter/toporouter.h
+++ b/src_plugins/toporouter/toporouter.h
@@ -33,20 +33,17 @@
#include "macro.h"
#include "../autoroute/autoroute.h"
#include "box.h"
-#include "create.h"
#include "draw.h"
#include "error.h"
#include "find.h"
#include "heap.h"
#include "rtree.h"
-#include "misc.h"
-#include "mymem.h"
#include "polygon.h"
#include "rats.h"
#include "remove.h"
-#include "thermal.h"
+#include "obj_pinvia_therm.h"
#include "undo.h"
-#include "global.h"
+#include "config.h"
#include "gts.h"
@@ -164,7 +161,7 @@ typedef struct _toporouter_bbox_class_t toporouter_bbox_class_t;
struct _toporouter_edge_t {
GtsEdge e;
- /*NetListType *netlist; */
+ /*pcb_netlist_t *netlist; */
guint flags;
diff --git a/src_plugins/vendordrill/Makefile b/src_plugins/vendordrill/Makefile
index 402f804..4bc1979 100644
--- a/src_plugins/vendordrill/Makefile
+++ b/src_plugins/vendordrill/Makefile
@@ -1,5 +1,5 @@
all:
- cd ../../src && make mod_vendordrill
+ cd ../../src && $(MAKE) mod_vendordrill
clean:
rm *.o *.so 2>/dev/null ; true
diff --git a/src_plugins/vendordrill/vendor.c b/src_plugins/vendordrill/vendor.c
index 38a9375..92d74f6 100644
--- a/src_plugins/vendordrill/vendor.c
+++ b/src_plugins/vendordrill/vendor.c
@@ -32,20 +32,23 @@
#include <genregex/regex_sei.h>
#include "change.h"
+#include "board.h"
#include "data.h"
#include "draw.h"
#include "error.h"
-#include "global.h"
-#include "set.h"
#include "undo.h"
#include "vendor.h"
#include "stub_vendor.h"
#include "plugins.h"
+#include "action_helper.h"
#include "hid_flags.h"
#include "hid_actions.h"
#include "hid_cfg.h"
#include "vendor_conf.h"
#include "compat_misc.h"
+#include "compat_nls.h"
+#include "obj_pinvia.h"
+#include "event.h"
#include <liblihata/lihata.h>
#include <liblihata/tree.h>
@@ -101,9 +104,9 @@ This will modify all of your drill holes to match the list of allowed
sizes for your vendor.
%end-doc */
-int ActionApplyVendor(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_ApplyVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
- hid_action("Busy");
+ pcb_event(PCB_EVENT_BUSY, NULL);
apply_vendor_map();
return 0;
}
@@ -122,7 +125,7 @@ static const char unload_vendor_help[] = "Unloads the current vendor drill mappi
%end-doc */
-int ActionUnloadVendor(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_UnloadVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
cached_drill = -1;
@@ -150,7 +153,7 @@ be prompted to enter one.
%end-doc */
-int ActionLoadVendorFrom(int argc, const char **argv, Coord x, Coord y)
+int pcb_act_LoadVendorFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y)
{
const char *fname = NULL;
static char *default_file = NULL;
@@ -164,13 +167,13 @@ int ActionLoadVendorFrom(int argc, const char **argv, Coord x, Coord y)
fname = argc ? argv[0] : NULL;
if (!fname || !*fname) {
- fname = gui->fileselect(_("Load Vendor Resource File..."),
+ fname = pcb_gui->fileselect(_("Load Vendor Resource File..."),
_("Picks a vendor resource file to load.\n"
"This file can contain drc settings for a\n"
"particular vendor as well as a list of\n"
"predefined drills which are allowed."), default_file, ".res", "vendor", HID_FILESELECT_READ);
if (fname == NULL)
- AFAIL(load_vendor);
+ PCB_AFAIL(load_vendor);
free_fname = pcb_true;
@@ -184,46 +187,46 @@ int ActionLoadVendorFrom(int argc, const char **argv, Coord x, Coord y)
vendor_free_all();
/* load the resource file */
- doc = hid_cfg_load_lht(fname);
+ doc = pcb_hid_cfg_load_lht(fname);
if (doc == NULL) {
- Message(PCB_MSG_DEFAULT, _("Could not load vendor resource file \"%s\"\n"), fname);
+ pcb_message(PCB_MSG_ERROR, _("Could not load vendor resource file \"%s\"\n"), fname);
return 1;
}
/* figure out the vendor name, if specified */
- vendor_name = (char *) UNKNOWN(hid_cfg_text_value(doc, "vendor"));
+ vendor_name = (char *) PCB_UNKNOWN(pcb_hid_cfg_text_value(doc, "vendor"));
/* figure out the units, if specified */
- sval = hid_cfg_text_value(doc, "/units");
+ sval = pcb_hid_cfg_text_value(doc, "/units");
if (sval == NULL) {
sf = PCB_MIL_TO_COORD(1);
}
- else if ((NSTRCMP(sval, "mil") == 0) || (NSTRCMP(sval, "mils") == 0)) {
+ else if ((PCB_NSTRCMP(sval, "mil") == 0) || (PCB_NSTRCMP(sval, "mils") == 0)) {
sf = PCB_MIL_TO_COORD(1);
}
- else if ((NSTRCMP(sval, "inch") == 0) || (NSTRCMP(sval, "inches") == 0)) {
+ else if ((PCB_NSTRCMP(sval, "inch") == 0) || (PCB_NSTRCMP(sval, "inches") == 0)) {
sf = PCB_INCH_TO_COORD(1);
}
- else if (NSTRCMP(sval, "mm") == 0) {
+ else if (PCB_NSTRCMP(sval, "mm") == 0) {
sf = PCB_MM_TO_COORD(1);
}
else {
- Message(PCB_MSG_DEFAULT, "\"%s\" is not a supported units. Defaulting to inch\n", sval);
+ pcb_message(PCB_MSG_ERROR, "\"%s\" is not a supported units. Defaulting to inch\n", sval);
sf = PCB_INCH_TO_COORD(1);
}
/* default to ROUND_UP */
rounding_method = ROUND_UP;
- sval = hid_cfg_text_value(doc, "/round");
+ sval = pcb_hid_cfg_text_value(doc, "/round");
if (sval != NULL) {
- if (NSTRCMP(sval, "up") == 0) {
+ if (PCB_NSTRCMP(sval, "up") == 0) {
rounding_method = ROUND_UP;
}
- else if (NSTRCMP(sval, "nearest") == 0) {
+ else if (PCB_NSTRCMP(sval, "nearest") == 0) {
rounding_method = CLOSEST;
}
else {
- Message(PCB_MSG_DEFAULT, _("\"%s\" is not a valid rounding type. Defaulting to up\n"), sval);
+ pcb_message(PCB_MSG_ERROR, _("\"%s\" is not a valid rounding type. Defaulting to up\n"), sval);
rounding_method = ROUND_UP;
}
}
@@ -237,54 +240,54 @@ int ActionLoadVendorFrom(int argc, const char **argv, Coord x, Coord y)
lht_node_t *n;
for(n = drlres->data.list.first; n != NULL; n = n->next) {
if (n->type != LHT_TEXT)
- hid_cfg_error(n, "Broken drillmap: /drillmap should contain text children only\n");
+ pcb_hid_cfg_error(n, "Broken drillmap: /drillmap should contain text children only\n");
else
add_to_drills(n->data.text.value);
}
}
- Message(PCB_MSG_DEFAULT, _("Broken drillmap: /drillmap should be a list\n"));
+ pcb_message(PCB_MSG_ERROR, _("Broken drillmap: /drillmap should be a list\n"));
}
else
- Message(PCB_MSG_DEFAULT, _("No drillmap resource found\n"));
+ pcb_message(PCB_MSG_ERROR, _("No drillmap resource found\n"));
- sval = hid_cfg_text_value(doc, "/drc/copper_space");
+ sval = pcb_hid_cfg_text_value(doc, "/drc/copper_space");
if (sval != NULL) {
PCB->Bloat = floor(sf * atof(sval) + 0.5);
- Message(PCB_MSG_DEFAULT, _("Set DRC minimum copper spacing to %.2f mils\n"), 0.01 * PCB->Bloat);
+ pcb_message(PCB_MSG_INFO, _("Set DRC minimum copper spacing to %.2f mils\n"), 0.01 * PCB->Bloat);
}
- sval = hid_cfg_text_value(doc, "/drc/copper_overlap");
+ sval = pcb_hid_cfg_text_value(doc, "/drc/copper_overlap");
if (sval != NULL) {
PCB->Shrink = floor(sf * atof(sval) + 0.5);
- Message(PCB_MSG_DEFAULT, _("Set DRC minimum copper overlap to %.2f mils\n"), 0.01 * PCB->Shrink);
+ pcb_message(PCB_MSG_INFO, _("Set DRC minimum copper overlap to %.2f mils\n"), 0.01 * PCB->Shrink);
}
- sval = hid_cfg_text_value(doc, "/drc/copper_width");
+ sval = pcb_hid_cfg_text_value(doc, "/drc/copper_width");
if (sval != NULL) {
PCB->minWid = floor(sf * atof(sval) + 0.5);
- Message(PCB_MSG_DEFAULT, _("Set DRC minimum copper spacing to %.2f mils\n"), 0.01 * PCB->minWid);
+ pcb_message(PCB_MSG_INFO, _("Set DRC minimum copper spacing to %.2f mils\n"), 0.01 * PCB->minWid);
}
- sval = hid_cfg_text_value(doc, "/drc/silk_width");
+ sval = pcb_hid_cfg_text_value(doc, "/drc/silk_width");
if (sval != NULL) {
PCB->minSlk = floor(sf * atof(sval) + 0.5);
- Message(PCB_MSG_DEFAULT, _("Set DRC minimum silk width to %.2f mils\n"), 0.01 * PCB->minSlk);
+ pcb_message(PCB_MSG_INFO, _("Set DRC minimum silk width to %.2f mils\n"), 0.01 * PCB->minSlk);
}
- sval = hid_cfg_text_value(doc, "/drc/min_drill");
+ sval = pcb_hid_cfg_text_value(doc, "/drc/min_drill");
if (sval != NULL) {
PCB->minDrill = floor(sf * atof(sval) + 0.5);
- Message(PCB_MSG_DEFAULT, _("Set DRC minimum drill diameter to %.2f mils\n"), 0.01 * PCB->minDrill);
+ pcb_message(PCB_MSG_INFO, _("Set DRC minimum drill diameter to %.2f mils\n"), 0.01 * PCB->minDrill);
}
- sval = hid_cfg_text_value(doc, "/drc/min_ring");
+ sval = pcb_hid_cfg_text_value(doc, "/drc/min_ring");
if (sval != NULL) {
PCB->minRing = floor(sf * atof(sval) + 0.5);
- Message(PCB_MSG_DEFAULT, _("Set DRC minimum annular ring to %.2f mils\n"), 0.01 * PCB->minRing);
+ pcb_message(PCB_MSG_INFO, _("Set DRC minimum annular ring to %.2f mils\n"), 0.01 * PCB->minRing);
}
- Message(PCB_MSG_DEFAULT, _("Loaded %d vendor drills from %s\n"), n_vendor_drills, fname);
- Message(PCB_MSG_DEFAULT, _("Loaded %d RefDes skips, %d Value skips, %d Descr skips\n"), n_refdes, n_value, n_descr);
+ pcb_message(PCB_MSG_INFO, _("Loaded %d vendor drills from %s\n"), n_vendor_drills, fname);
+ pcb_message(PCB_MSG_INFO, _("Loaded %d RefDes skips, %d Value skips, %d Descr skips\n"), n_refdes, n_value, n_descr);
conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE);
@@ -313,30 +316,30 @@ static void apply_vendor_map(void)
if (n_vendor_drills > 0) {
/* first all the vias */
- VIA_LOOP(PCB->Data);
+ PCB_VIA_LOOP(PCB->Data);
{
tot++;
if (via->DrillingHole != vendorDrillMap(via->DrillingHole)) {
/* only change unlocked vias */
- if (!TEST_FLAG(PCB_FLAG_LOCK, via)) {
- if (ChangeObject2ndSize(PCB_TYPE_VIA, via, NULL, NULL, vendorDrillMap(via->DrillingHole), pcb_true, pcb_false))
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, via)) {
+ if (pcb_chg_obj_2nd_size(PCB_TYPE_VIA, via, NULL, NULL, vendorDrillMap(via->DrillingHole), pcb_true, pcb_false))
changed++;
else {
- Message(PCB_MSG_DEFAULT, _
+ pcb_message(PCB_MSG_WARNING, _
("Via at %.2f, %.2f not changed. Possible reasons:\n"
"\t- pad size too small\n"
"\t- new size would be too large or too small\n"), 0.01 * via->X, 0.01 * via->Y);
}
}
else {
- Message(PCB_MSG_DEFAULT, _("Locked via at %.2f, %.2f not changed.\n"), 0.01 * via->X, 0.01 * via->Y);
+ pcb_message(PCB_MSG_WARNING, _("Locked via at %.2f, %.2f not changed.\n"), 0.01 * via->X, 0.01 * via->Y);
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
/* and now the pins */
- ELEMENT_LOOP(PCB->Data);
+ PCB_ELEMENT_LOOP(PCB->Data);
{
/*
* first figure out if this element should be skipped for some
@@ -344,35 +347,35 @@ static void apply_vendor_map(void)
*/
if (vendorIsElementMappable(element)) {
/* the element is ok to modify, so iterate over its pins */
- PIN_LOOP(element);
+ PCB_PIN_LOOP(element);
{
tot++;
if (pin->DrillingHole != vendorDrillMap(pin->DrillingHole)) {
- if (!TEST_FLAG(PCB_FLAG_LOCK, pin)) {
- if (ChangeObject2ndSize(PCB_TYPE_PIN, element, pin, NULL, vendorDrillMap(pin->DrillingHole), pcb_true, pcb_false))
+ if (!PCB_FLAG_TEST(PCB_FLAG_LOCK, pin)) {
+ if (pcb_chg_obj_2nd_size(PCB_TYPE_PIN, element, pin, NULL, vendorDrillMap(pin->DrillingHole), pcb_true, pcb_false))
changed++;
else {
- Message(PCB_MSG_DEFAULT, _
+ pcb_message(PCB_MSG_WARNING, _
("Pin %s (%s) at %.2f, %.2f (element %s, %s, %s) not changed.\n"
"\tPossible reasons:\n"
"\t- pad size too small\n"
"\t- new size would be too large or too small\n"),
- UNKNOWN(pin->Number), UNKNOWN(pin->Name),
+ PCB_UNKNOWN(pin->Number), PCB_UNKNOWN(pin->Name),
0.01 * pin->X, 0.01 * pin->Y,
- UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(VALUE_NAME(element)), UNKNOWN(DESCRIPTION_NAME(element)));
+ PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)), PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)));
}
}
else {
- Message(PCB_MSG_DEFAULT, _("Locked pin at %-6.2f, %-6.2f not changed.\n"), 0.01 * pin->X, 0.01 * pin->Y);
+ pcb_message(PCB_MSG_WARNING, _("Locked pin at %-6.2f, %-6.2f not changed.\n"), 0.01 * pin->X, 0.01 * pin->Y);
}
}
}
- END_LOOP;
+ PCB_END_LOOP;
}
}
- END_LOOP;
+ PCB_END_LOOP;
- Message(PCB_MSG_DEFAULT, _("Updated %d drill sizes out of %d total\n"), changed, tot);
+ pcb_message(PCB_MSG_INFO, _("Updated %d drill sizes out of %d total\n"), changed, tot);
#warning TODO: this should not happen; modify some local setting?
#if 0
@@ -380,7 +383,7 @@ static void apply_vendor_map(void)
if (conf_core.design.via_drilling_hole != vendorDrillMap(Settings.ViaDrillingHole)) {
changed++;
Settings.ViaDrillingHole = vendorDrillMap(Settings.ViaDrillingHole);
- Message(PCB_MSG_DEFAULT, _("Adjusted active via hole size to be %6.2f mils\n"), 0.01 * Settings.ViaDrillingHole);
+ pcb_message(PCB_MSG_INFO, _("Adjusted active via hole size to be %6.2f mils\n"), 0.01 * Settings.ViaDrillingHole);
}
/* and update the vias for the various routing styles */
@@ -388,12 +391,12 @@ static void apply_vendor_map(void)
if (PCB->RouteStyle[i].Hole != vendorDrillMap(PCB->RouteStyle[i].Hole)) {
changed++;
PCB->RouteStyle[i].Hole = vendorDrillMap(PCB->RouteStyle[i].Hole);
- Message(PCB_MSG_DEFAULT, _
+ pcb_message(PCB_MSG_INFO, _
("Adjusted %s routing style via hole size to be %6.2f mils\n"),
PCB->RouteStyle[i].Name, 0.01 * PCB->RouteStyle[i].Hole);
- if (PCB->RouteStyle[i].Diameter < PCB->RouteStyle[i].Hole + MIN_PINORVIACOPPER) {
- PCB->RouteStyle[i].Diameter = PCB->RouteStyle[i].Hole + MIN_PINORVIACOPPER;
- Message(PCB_MSG_DEFAULT, _
+ if (PCB->RouteStyle[i].Diameter < PCB->RouteStyle[i].Hole + PCB_MIN_PINORVIACOPPER) {
+ PCB->RouteStyle[i].Diameter = PCB->RouteStyle[i].Hole + PCB_MIN_PINORVIACOPPER;
+ pcb_message(PCB_MSG_INFO, _
("Increased %s routing style via diameter to %6.2f mils\n"),
PCB->RouteStyle[i].Name, 0.01 * PCB->RouteStyle[i].Diameter);
}
@@ -405,9 +408,9 @@ static void apply_vendor_map(void)
* file, redraw things, and make sure we can undo.
*/
if (changed) {
- SetChangedFlag(pcb_true);
- Redraw();
- IncrementUndoSerialNumber();
+ pcb_board_set_changed_flag(pcb_true);
+ pcb_redraw();
+ pcb_undo_inc_serial();
}
}
@@ -439,7 +442,7 @@ int vendorDrillMap(int in)
/* are we larger than the largest drill? */
if (in > vendor_drills[n_vendor_drills - 1]) {
- Message(PCB_MSG_DEFAULT, _("Vendor drill list does not contain a drill >= %6.2f mil\n"
+ pcb_message(PCB_MSG_ERROR, _("Vendor drill list does not contain a drill >= %6.2f mil\n"
"Using %6.2f mil instead.\n"), 0.01 * in, 0.01 * vendor_drills[n_vendor_drills - 1]);
cached_map = vendor_drills[n_vendor_drills - 1];
return vendor_drills[n_vendor_drills - 1];
@@ -531,24 +534,24 @@ static void process_skips(lht_node_t *res)
return;
if (res->type != LHT_LIST)
- hid_cfg_error(res, "skips must be a list.\n");
+ pcb_hid_cfg_error(res, "skips must be a list.\n");
for(n = res->data.list.first; n != NULL; n = n->next) {
if (n->type == LHT_TEXT) {
- if (NSTRCMP(n->name, "refdes") == 0) {
+ if (PCB_NSTRCMP(n->name, "refdes") == 0) {
cnt = &n_refdes;
lst = &ignore_refdes;
}
- else if (NSTRCMP(n->name, "value") == 0) {
+ else if (PCB_NSTRCMP(n->name, "value") == 0) {
cnt = &n_value;
lst = &ignore_value;
}
- else if (NSTRCMP(n->name, "descr") == 0) {
+ else if (PCB_NSTRCMP(n->name, "descr") == 0) {
cnt = &n_descr;
lst = &ignore_descr;
}
else {
- hid_cfg_error(n, "invalid skip name; must be one of refdes, value, descr");
+ pcb_hid_cfg_error(n, "invalid skip name; must be one of refdes, value, descr");
continue;
}
/* add the entry to the appropriate list */
@@ -561,11 +564,11 @@ static void process_skips(lht_node_t *res)
(*lst)[*cnt - 1] = pcb_strdup(sval);
}
else
- hid_cfg_error(n, "invalid skip type; must be text");
+ pcb_hid_cfg_error(n, "invalid skip type; must be text");
}
}
-pcb_bool vendorIsElementMappable(ElementTypePtr element)
+pcb_bool vendorIsElementMappable(pcb_element_t *element)
{
int i;
int noskip;
@@ -575,35 +578,35 @@ pcb_bool vendorIsElementMappable(ElementTypePtr element)
noskip = 1;
for (i = 0; i < n_refdes; i++) {
- if ((NSTRCMP(UNKNOWN(NAMEONPCB_NAME(element)), ignore_refdes[i]) == 0)
- || rematch(ignore_refdes[i], UNKNOWN(NAMEONPCB_NAME(element)))) {
- Message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because refdes = %s matches %s\n"), UNKNOWN(NAMEONPCB_NAME(element)), ignore_refdes[i]);
+ if ((PCB_NSTRCMP(PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), ignore_refdes[i]) == 0)
+ || rematch(ignore_refdes[i], PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)))) {
+ pcb_message(PCB_MSG_INFO, _("Vendor mapping skipped because refdes = %s matches %s\n"), PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)), ignore_refdes[i]);
noskip = 0;
}
}
if (noskip)
for (i = 0; i < n_value; i++) {
- if ((NSTRCMP(UNKNOWN(VALUE_NAME(element)), ignore_value[i]) == 0)
- || rematch(ignore_value[i], UNKNOWN(VALUE_NAME(element)))) {
- Message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because value = %s matches %s\n"), UNKNOWN(VALUE_NAME(element)), ignore_value[i]);
+ if ((PCB_NSTRCMP(PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)), ignore_value[i]) == 0)
+ || rematch(ignore_value[i], PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)))) {
+ pcb_message(PCB_MSG_INFO, _("Vendor mapping skipped because value = %s matches %s\n"), PCB_UNKNOWN(PCB_ELEM_NAME_VALUE(element)), ignore_value[i]);
noskip = 0;
}
}
if (noskip)
for (i = 0; i < n_descr; i++) {
- if ((NSTRCMP(UNKNOWN(DESCRIPTION_NAME(element)), ignore_descr[i])
+ if ((PCB_NSTRCMP(PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)), ignore_descr[i])
== 0)
- || rematch(ignore_descr[i], UNKNOWN(DESCRIPTION_NAME(element)))) {
- Message(PCB_MSG_DEFAULT, _
+ || rematch(ignore_descr[i], PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)))) {
+ pcb_message(PCB_MSG_INFO, _
("Vendor mapping skipped because descr = %s matches %s\n"),
- UNKNOWN(DESCRIPTION_NAME(element)), ignore_descr[i]);
+ PCB_UNKNOWN(PCB_ELEM_NAME_DESCRIPTION(element)), ignore_descr[i]);
noskip = 0;
}
}
- if (noskip && TEST_FLAG(PCB_FLAG_LOCK, element)) {
- Message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because element %s is locked\n"), UNKNOWN(NAMEONPCB_NAME(element)));
+ if (noskip && PCB_FLAG_TEST(PCB_FLAG_LOCK, element)) {
+ pcb_message(PCB_MSG_INFO, _("Vendor mapping skipped because element %s is locked\n"), PCB_UNKNOWN(PCB_ELEM_NAME_REFDES(element)));
noskip = 0;
}
@@ -621,7 +624,7 @@ static pcb_bool rematch(const char *re, const char *s)
/* compile the regular expression */
regex = re_sei_comp(re);
if (re_sei_errno(regex) != 0) {
- Message(PCB_MSG_DEFAULT, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
+ pcb_message(PCB_MSG_ERROR, _("regexp error: %s\n"), re_error_str(re_sei_errno(regex)));
re_sei_free(regex);
return pcb_false;
}
@@ -637,18 +640,18 @@ static pcb_bool rematch(const char *re, const char *s)
static const char *vendor_cookie = "vendor drill mapping";
-HID_Action vendor_action_list[] = {
- {"ApplyVendor", 0, ActionApplyVendor,
+pcb_hid_action_t vendor_action_list[] = {
+ {"ApplyVendor", 0, pcb_act_ApplyVendor,
apply_vendor_help, apply_vendor_syntax}
,
- {"UnloadVendor", 0, ActionUnloadVendor,
+ {"UnloadVendor", 0, pcb_act_UnloadVendor,
unload_vendor_help, unload_vendor_syntax}
,
- {"LoadVendorFrom", 0, ActionLoadVendorFrom,
+ {"LoadVendorFrom", 0, pcb_act_LoadVendorFrom,
load_vendor_help, load_vendor_syntax}
};
-REGISTER_ACTIONS(vendor_action_list, vendor_cookie)
+PCB_REGISTER_ACTIONS(vendor_action_list, vendor_cookie)
static char **vendor_free_vect(char **lst, int *len)
{
@@ -678,7 +681,7 @@ static void vendor_free_all(void)
static void hid_vendordrill_uninit(void)
{
- hid_remove_actions_by_cookie(vendor_cookie);
+ pcb_hid_remove_actions_by_cookie(vendor_cookie);
vendor_free_all();
conf_unreg_fields("plugins/vendor/");
}
@@ -690,9 +693,9 @@ pcb_uninit_t hid_vendordrill_init(void)
conf_reg_field(conf_vendor, field,isarray,type_name,cpath,cname,desc,flags);
#include "vendor_conf_fields.h"
- stub_vendorDrillMap = vendorDrillMap;
- stub_vendorIsElementMappable = vendorIsElementMappable;
+ pcb_stub_vendor_drill_map = vendorDrillMap;
+ pcb_stub_vendor_is_element_mappable = vendorIsElementMappable;
- REGISTER_ACTIONS(vendor_action_list, vendor_cookie)
+ PCB_REGISTER_ACTIONS(vendor_action_list, vendor_cookie)
return hid_vendordrill_uninit;
}
diff --git a/src_plugins/vendordrill/vendor.h b/src_plugins/vendordrill/vendor.h
index 9d4c454..1c9fcf5 100644
--- a/src_plugins/vendordrill/vendor.h
+++ b/src_plugins/vendordrill/vendor.h
@@ -24,6 +24,6 @@
#define PCB_VENDOR_H
int vendorDrillMap(int);
-pcb_bool vendorIsElementMappable(ElementTypePtr);
+pcb_bool vendorIsElementMappable(pcb_element_t *);
#endif /* __VENDOR_H__ */
diff --git a/tests/Makefile b/tests/Makefile
index a6098e9..167d442 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,7 +1,24 @@
test:
- cd pcbflags && make all && make test
- cd conf && make all && make test
- cd strflags && make all && make test
- cd pcb-printf && make all && make test
- cd uniq_name && make all && make test
- cd propedit && make all && make test
+ cd pcbflags && $(MAKE) all && $(MAKE) test
+ cd conf && $(MAKE) all && $(MAKE) test
+ cd strflags && $(MAKE) all && $(MAKE) test
+ cd pcb-printf && $(MAKE) all && $(MAKE) test
+ cd uniq_name && $(MAKE) all && $(MAKE) test
+ cd propedit && $(MAKE) all && $(MAKE) test
+ cd remote && $(MAKE) all && $(MAKE) test
+# cd gsch2pcb-rnd && $(MAKE) all && $(MAKE) test
+ @echo " "
+ @echo "+-------------------------------------------------+"
+ @echo "+ All tests passed, pcb-rnd is safe to install. +"
+ @echo "+-------------------------------------------------+"
+
+clean:
+ cd pcbflags && $(MAKE) clean
+ cd conf && $(MAKE) clean
+ cd strflags && $(MAKE) clean
+ cd pcb-printf && $(MAKE) clean
+ cd uniq_name && $(MAKE) clean
+ cd propedit && $(MAKE) clean
+ cd remote && $(MAKE) clean
+# cd gsch2pcb-rnd && $(MAKE) clean
+
diff --git a/tests/RTT/Export.sh b/tests/RTT/Export.sh
new file mode 100755
index 0000000..779b231
--- /dev/null
+++ b/tests/RTT/Export.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+
+TRUNK=../..
+
+all=0
+valg=0
+global_args="-c rc/quiet=1"
+
+if test -z "$pcb_rnd_bin"
+then
+ pcb_rnd_bin="$TRUNK/src/pcb-rnd"
+fi
+
+fmt_args=""
+
+set_fmt_args()
+{
+ case "$fmt" in
+ bom) ext=.bom ;;
+ dsn) ext=.dsn ;;
+ IPC-D-356) ext=.net;;
+ ps) ext=.ps ;;
+ XY) ext=.xy ;;
+ png)
+ fmt_args="--dpi 1200"
+ ext=.png
+ ;;
+ gerber)
+ fmt_args="-c plugins/draw_fab/omit_date=1"
+# multifile: do not set ext
+ ;;
+ remote)
+ ext=.remote
+ ;;
+ svg)
+ ext=.svg
+ ;;
+ esac
+}
+
+move_out()
+{
+ local raw_out="$1" final_out="$2" n
+
+# remove variable sections
+ case "$fmt" in
+ dsn) sed -i 's/[(]host_version[^)]*[)]/(host_version "<version>")/g' $raw_out ;;
+ bom|XY) sed -i "s/^# Date:.*$/# Date: <date>/" $raw_out ;;
+ IPC-D-356)
+ sed -i '
+ s/^C File created on .*$/C File created on <date>/
+ s/^C IPC-D-356 Netlist generated by.*$/C IPC-D-356 Netlist generated by <version>/
+ ' $raw_out ;;
+ gerber)
+ sed -i '
+ s/^G04 CreationDate:.*$/G04 CreationDate: <date>/
+ s/^G04 Creator:.*$/G04 Creator: <version>/
+ ' $raw_out.*.gbr
+ ;;
+ esac
+
+# move the output file(s) to their final subdir (for multifile formats) and/or
+# compress them (for large text files)
+ case "$fmt" in
+ gerber)
+ mkdir -p $final_out.gbr
+ mv $raw_out.*.gbr $final_out.gbr
+ ;;
+ remote|ps)
+ gzip $raw_out
+ mv $raw_out.gz $final_out.gz
+ ;;
+ *)
+ # common, single file output
+ if test -f "$raw_out"
+ then
+ mv $raw_out $final_out
+ fi
+ ;;
+ esac
+}
+
+cmp_fmt()
+{
+ local ref="$1" out="$2" n bn
+ case "$fmt" in
+ png)
+ echo "$ref" "$out"
+ ;;
+ gerber)
+ for n in $ref.gbr/*.gbr
+ do
+ bn=`basename $n`
+ diff -u "$n" "$out.gbr/$bn"
+ done
+ ;;
+ *)
+ # simple text files: byte-to-byte match required
+ diff -u "$ref" "$out"
+ ;;
+ esac
+}
+
+run_test()
+{
+ local fn="$1" valgr
+
+ if test "$valg" -gt 0
+ then
+ valgr="valgrind -v --log-file=$fn.vlog"
+ fi
+
+ $valgr $pcb_rnd_bin -x "$fmt" $global_args $fmt_args "$fn"
+
+ base=${fn%%.pcb}
+ ref_fn=ref/$base$ext
+ fmt_fn=$base$ext
+ out_fn=out/$base$ext
+
+ move_out "$fmt_fn" "$out_fn"
+ cmp_fmt "$ref_fn" "$out_fn"
+}
+
+while test $# -gt 0
+do
+ case "$1"
+ in
+ -f|-x) fmt=$2; shift 1;;
+ -b) pcb_rnd_bin=$2; shift 1;;
+ -a) all=1;;
+ -V) valg=1;;
+ *)
+ if test -z "$fn"
+ then
+ fn="$1"
+ else
+ echo "unknown switch $1; try --help" >&2
+ exit 1
+ fi
+ ;;
+ esac
+ shift 1
+done
+
+if test -z "$fmt"
+then
+ echo "need a format" >&2
+fi
+
+set_fmt_args
+
+if test "$all" -gt 0
+then
+ for n in `ls *.lht *.pcb`
+ do
+ run_test "$n"
+ done
+else
+ run_test "$fn"
+fi
diff --git a/tests/RTT/Proto.pcb b/tests/RTT/Proto.pcb
new file mode 100644
index 0000000..68598bf
--- /dev/null
+++ b/tests/RTT/Proto.pcb
@@ -0,0 +1,43 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/README b/tests/RTT/README
new file mode 100644
index 0000000..15debdf
--- /dev/null
+++ b/tests/RTT/README
@@ -0,0 +1,3 @@
+This directory contains a set of round-trip-test designs. Each design
+demonstrates a feature, as purely as possible. The purpose is to use these
+as test cases for automatic mapping of file format compatibility (TODO).
diff --git a/tests/RTT/RTT_kicad_legacy_summary.txt b/tests/RTT/RTT_kicad_legacy_summary.txt
new file mode 100644
index 0000000..fe031ca
--- /dev/null
+++ b/tests/RTT/RTT_kicad_legacy_summary.txt
@@ -0,0 +1,17 @@
+feature supported partial_support unsupported reason test_case
+round pins Y X X universal, lossless x
+octagonal pins X Y X gEDA native, no kicad support, export as round x
+rectangular SMD Y X X gEDA native, kicad native support x
+copper arcs X Y X converted to lines on export x
+copper line Y X X universal, lossless x
+silk line Y X X universal, lossless x
+silk arc X Y X kicad supports multiples of 90 degrees only x
+silk circle Y X X universal, lossless x
+element value, name X Y X gEDA does not store text label locations x
+layout modules/footprints Y X X geometry preserved x
+track netlist X X Y gEDA does not store netlist for tracks x
+via X Y X kicad uses polygonal zones to manage via thermal properties within it x
+copper pours X Y X kicad applies pullback to margins of polygonal zones x
+polygon windows X X Y yet to be implemented x
+text labels X Y X font kerning, placement not exact x
+
diff --git a/tests/RTT/RTT_kicad_summary.txt b/tests/RTT/RTT_kicad_summary.txt
new file mode 100644
index 0000000..95d88c7
--- /dev/null
+++ b/tests/RTT/RTT_kicad_summary.txt
@@ -0,0 +1,26 @@
+feature supported partial_support unsupported reason test_case
+round pins Y X X universal x
+octagonal pins X Y X gEDA native, no kicad support, export as round x
+rectangular SMD Y X X gEDA native, kicad native support x
+trapezoidal SMD X Y X converted to rectangular on import x
+rounded corner SMD X Y X converted to rectangular on import x
+copper arcs X Y X converted to lines on export x
+copper line Y X X universal, lossless x
+track clearance X Y X per track clearance not preserved x
+silk line Y X X universal, lossless x
+silk arc X Y X kicad supports multiples of 90deg only x
+silk circle Y X X universal, lossless x
+element value, name X Y X gEDA does not store text label locations x
+layout modules/footprints Y X X geometry preserved x
+track netlist X X Y gEDA does not store netlist for tracks x
+rat lines X X Y kicad does not have an equivalent x
+via X Y X kicad uses polygonal zones to manage thermal properties within it x
+copper pours X Y X kicad applied pullback to margins of polygonal zones x
+polygon windows X X Y yet to be implemented x
+text labels X Y X font kerning, placement not exact x
+text style X X Y italic, bold, unsupported on import x
+text size X Y X font size, kerning, placement not exact x
+text clearline flag X X Y no kicad equivalent x
+font data X X Y font symbol not preserved on export x
+layer naming X Y X non standard kicad layer names are not preserved layer_outline.pcb
+layer order Y X X layer order preserved, but names may not be x
diff --git a/tests/RTT/Remote_dump.sh b/tests/RTT/Remote_dump.sh
new file mode 100755
index 0000000..d7666b2
--- /dev/null
+++ b/tests/RTT/Remote_dump.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# dump remote HID communication
+
+echo '
+ MakeGC(1)
+ Ready()
+ MakeGC(2)
+ MakeGC(3)
+ MakeGC(4)
+' | pcb-rnd --gui remote $1 | grep -v "^[A-Z]:" > out/${1%%.pcb}.remote
+rm -f out/${1%%.pcb}.remote.gz
+gzip out/${1%%.pcb}.remote
diff --git a/tests/RTT/Rtt.sh b/tests/RTT/Rtt.sh
new file mode 100755
index 0000000..df44d8e
--- /dev/null
+++ b/tests/RTT/Rtt.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# local wrapper around pcb-rtrip so it all can be executed from the source
+# tree, without installation
+
+TRUNK=../..
+pcb_rnd_bin="$TRUNK/src/pcb-rnd"
+RTRIP="$TRUNK/util/devhelpers/pcb-rtrip"
+
+(
+ . $RTRIP
+ if test -f core
+ then
+ mv core "$fn.core"
+ fi
+) 2>&1 | grep -v "PCBChanged\|readres=-1\|No PCB loaded\|pcb-gpmi hid is loaded\|has no font information, using default font\|WARNING.*is not uninited\|but first saves\|WARNING.*left registered\|gpmi dirs:"
diff --git a/tests/RTT/Rtt_all.sh b/tests/RTT/Rtt_all.sh
new file mode 100755
index 0000000..c5b3fb9
--- /dev/null
+++ b/tests/RTT/Rtt_all.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+ulimit -c unlimited
+rm core
+all=`ls *.pcb | grep -v "[.]new[.]pcb$\|[.]orig[.]pcb$\|^[.]"`
+num_all=`echo "$all" | wc -l`
+
+cnt=0
+for n in $all
+do
+ cnt=$(($cnt+1))
+ echo "----------------------$n"
+ echo "----------------------$n $cnt/$num_all" >&2
+ ./Rtt.sh $n "$@"
+done > All.log
+
diff --git a/tests/RTT/Vailidation.txt b/tests/RTT/Vailidation.txt
new file mode 100644
index 0000000..9f2bdba
--- /dev/null
+++ b/tests/RTT/Vailidation.txt
@@ -0,0 +1,33 @@
+# Validation state of references
+#
+# Each line is a file from ref/, in the following format:
+# The first word is the file name, relative to ref/
+# The second word is either "good" or "bad"
+# The third word is the revision number the output file had at the moment of
+# check (the "Last Changed Revision line in 'svn info ref/filename')
+# The rest of the line is a real short summary on whaty's broken, if the
+# second column was "bad".
+#
+# There's no particular order of lines. If you recheck a file, edit the exiting
+# line, each ref file should have only one line in this file. If you are doing
+# checks, please insert new lines somewhere in the list, preferrably not at the
+# end, so we can avoid svn conflicts in concurrent edits.
+#
+# Test method: open the .pcb file with pcb-rnd, open the ref/ file with
+# the appropriate viewer, look at them side by side and decide if the reference
+# output fully matches the input, in all relevant details. What relevent
+# details are can be file format specific.
+#
+
+Proto.bom good r5452
+coord_rounding.bom good r5652
+elem_pads.bom good r5652
+elem_pads_ds.bom good r5652
+elem_pins.bom good r5652
+elem_sides_smd.bom good r5652
+elem_sides_trh.bom good r5652
+arc_f_clear.bom good r5652
+arc_normal.bom good r5652
+arc_offpage.bom good r5652
+arc_sizes.bom good r5652
+arc_angles.bom good r5452
diff --git a/tests/RTT/arc_angles.pcb b/tests/RTT/arc_angles.pcb
new file mode 100644
index 0000000..0c54a4b
--- /dev/null
+++ b/tests/RTT/arc_angles.pcb
@@ -0,0 +1,46 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["arcs with different strange angles" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 635000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Arc[100mil 100mil 50mil 50mil 254000nm 1016000nm 0 750 ""]
+ Arc[300mil 100mil 50mil 50mil 254000nm 1016000nm 0 0 ""]
+ Arc[400mil 100mil 50mil 50mil 254000nm 1016000nm 0 -750 ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/arc_f_clear.pcb b/tests/RTT/arc_f_clear.pcb
new file mode 100644
index 0000000..736eeae
--- /dev/null
+++ b/tests/RTT/arc_f_clear.pcb
@@ -0,0 +1,51 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Arc with clearline flag" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Arc[5080000nm 5715000nm 3175000nm 3175000nm 254000nm 1016000nm 0 90 "clearline"]
+ Arc[4445000nm 5715000nm 2540000nm 2540000nm 508000nm 1016000nm -10 -80 ""]
+ Arc[7620000nm 6985000nm 635000nm 635000nm 254000nm 1016000nm 0 300 "clearline"]
+ Arc[6350000nm 5715000nm 3175000nm 3175000nm 762000nm 1016000nm -70 -90 ""]
+ Polygon("clearpoly")
+ (
+ [635000nm 3810000nm] [12065000nm 3810000nm] [12065000nm 12065000nm] [635000nm 12065000nm]
+ )
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/arc_normal.pcb b/tests/RTT/arc_normal.pcb
new file mode 100644
index 0000000..11ad403
--- /dev/null
+++ b/tests/RTT/arc_normal.pcb
@@ -0,0 +1,47 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Arcs with different sizes, normal cases" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 635000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Arc[5080000nm 5715000nm 3175000nm 3175000nm 254000nm 1016000nm 0 90 ""]
+ Arc[4445000nm 5715000nm 2540000nm 2540000nm 508000nm 1016000nm -10 -80 ""]
+ Arc[7620000nm 6985000nm 635000nm 635000nm 254000nm 1016000nm 0 300 ""]
+ Arc[6350000nm 5715000nm 3175000nm 3175000nm 762000nm 1016000nm -70 -90 ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/arc_offpage.pcb b/tests/RTT/arc_offpage.pcb
new file mode 100644
index 0000000..8a1e08e
--- /dev/null
+++ b/tests/RTT/arc_offpage.pcb
@@ -0,0 +1,44 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Arcs with some parts off the page" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 635000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Arc[50mil 50mil 100mil 100mil 254000nm 1016000nm 0 230 ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/arc_sizes.pcb b/tests/RTT/arc_sizes.pcb
new file mode 100644
index 0000000..e52aa5f
--- /dev/null
+++ b/tests/RTT/arc_sizes.pcb
@@ -0,0 +1,47 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["arcs with different strange sizes" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 635000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Arc[100mil 200mil 0mil 50mil 254000nm 1016000nm 0 90 ""]
+ Arc[200mil 200mil 50mil 0mil 254000nm 1016000nm 0 90 ""]
+ Arc[300mil 200mil 0mil 0mil 254000nm 1016000nm 0 90 ""]
+
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/coord_rounding.pcb b/tests/RTT/coord_rounding.pcb
new file mode 100644
index 0000000..b87f334
--- /dev/null
+++ b/tests/RTT/coord_rounding.pcb
@@ -0,0 +1,45 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["odd coordinates to check rounding errors" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[1270000nm 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Line[6000000nm 6100000nm 6110000nm 6111000nm 1mm 1mm ""]
+ Line[6111100nm 6111110nm 6111111nm 6111000nm 1mm 1mm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/default_font b/tests/RTT/default_font
new file mode 100644
index 0000000..41a5f3d
--- /dev/null
+++ b/tests/RTT/default_font
@@ -0,0 +1,309 @@
+# Minimal symbol set: space, 1..9, A..Z
+Symbol(' ' 18)
+(
+)
+Symbol('1' 12)
+(
+ SymbolLine( 0 8 8 0 8)
+ SymbolLine( 8 0 8 40 8)
+ SymbolLine( 0 40 15 40 8)
+)
+Symbol('2' 12)
+(
+ SymbolLine(0 5 5 0 8)
+ SymbolLine(5 0 20 0 8)
+ SymbolLine(20 0 25 5 8)
+ SymbolLine(25 5 25 15 8)
+ SymbolLine(0 40 25 15 8)
+ SymbolLine(0 40 25 40 8)
+)
+Symbol('3' 12)
+(
+ SymbolLine( 0 5 5 0 8)
+ SymbolLine( 5 0 15 0 8)
+ SymbolLine(15 0 20 5 8)
+ SymbolLine(15 40 20 35 8)
+ SymbolLine( 5 40 15 40 8)
+ SymbolLine( 0 35 5 40 8)
+
+ SymbolLine( 5 18 15 18 8)
+ SymbolLine(20 5 20 13 8)
+ SymbolLine(20 23 20 35 8)
+ SymbolLine(20 23 15 18 8)
+ SymbolLine(20 13 15 18 8)
+)
+Symbol('4' 12)
+(
+ SymbolLine(0 25 20 0 8)
+ SymbolLine(0 25 25 25 8)
+ SymbolLine(20 0 20 40 8)
+)
+Symbol('5' 12)
+(
+ SymbolLine(0 0 20 0 8)
+ SymbolLine(0 0 0 20 8)
+ SymbolLine(0 20 5 15 8)
+ SymbolLine(5 15 15 15 8)
+ SymbolLine(15 15 20 20 8)
+ SymbolLine(20 20 20 35 8)
+ SymbolLine(15 40 20 35 8)
+ SymbolLine(5 40 15 40 8)
+ SymbolLine(0 35 5 40 8)
+)
+Symbol('6' 12)
+(
+ SymbolLine(15 0 20 5 8)
+ SymbolLine( 5 0 15 0 8)
+ SymbolLine( 0 5 5 0 8)
+ SymbolLine( 0 5 0 35 8)
+ SymbolLine( 0 35 5 40 8)
+ SymbolLine(15 18 20 23 8)
+ SymbolLine( 0 18 15 18 8)
+ SymbolLine( 5 40 15 40 8)
+ SymbolLine(15 40 20 35 8)
+ SymbolLine(20 23 20 35 8)
+)
+Symbol('7' 12)
+(
+ SymbolLine( 5 40 25 0 8)
+ SymbolLine( 0 0 25 0 8)
+)
+Symbol('8' 12)
+(
+ SymbolLine( 0 35 5 40 8)
+ SymbolLine( 0 27 0 35 8)
+ SymbolLine( 0 27 7 20 8)
+ SymbolLine( 7 20 13 20 8)
+ SymbolLine(13 20 20 27 8)
+ SymbolLine(20 27 20 35 8)
+ SymbolLine(15 40 20 35 8)
+ SymbolLine( 5 40 15 40 8)
+ SymbolLine( 0 13 7 20 8)
+ SymbolLine( 0 5 0 13 8)
+ SymbolLine( 0 5 5 0 8)
+ SymbolLine( 5 0 15 0 8)
+ SymbolLine(15 0 20 5 8)
+ SymbolLine(20 5 20 13 8)
+ SymbolLine(13 20 20 13 8)
+)
+Symbol('9' 12)
+(
+ SymbolLine(5 40 20 20 8)
+ SymbolLine(20 5 20 20 8)
+ SymbolLine(15 0 20 5 8)
+ SymbolLine(5 0 15 0 8)
+ SymbolLine(0 5 5 0 8)
+ SymbolLine(0 5 0 15 8)
+ SymbolLine(0 15 5 20 8)
+ SymbolLine(5 20 20 20 8)
+)
+Symbol('A' 12)
+(
+ SymbolLine( 0 10 0 40 8)
+ SymbolLine( 0 10 7 0 8)
+ SymbolLine( 7 0 18 0 8)
+ SymbolLine(18 0 25 10 8)
+ SymbolLine(25 10 25 40 8)
+ SymbolLine( 0 20 25 20 8)
+)
+Symbol('B' 12)
+(
+ SymbolLine( 0 40 20 40 8)
+ SymbolLine(20 40 25 35 8)
+ SymbolLine(25 23 25 35 8)
+ SymbolLine(20 18 25 23 8)
+ SymbolLine( 5 18 20 18 8)
+ SymbolLine( 5 0 5 40 8)
+ SymbolLine( 0 0 20 0 8)
+ SymbolLine(20 0 25 5 8)
+ SymbolLine(25 5 25 13 8)
+ SymbolLine(20 18 25 13 8)
+)
+Symbol('C' 12)
+(
+ SymbolLine(7 40 20 40 8)
+ SymbolLine(0 33 7 40 8)
+ SymbolLine(0 7 0 33 8)
+ SymbolLine(0 7 7 0 8)
+ SymbolLine(7 0 20 0 8)
+)
+Symbol('D' 12)
+(
+ SymbolLine( 5 0 5 40 8)
+ SymbolLine(18 0 25 7 8)
+ SymbolLine(25 7 25 33 8)
+ SymbolLine(18 40 25 33 8)
+ SymbolLine( 0 40 18 40 8)
+ SymbolLine( 0 0 18 0 8)
+)
+Symbol('E' 12)
+(
+ SymbolLine(0 18 15 18 8)
+ SymbolLine(0 40 20 40 8)
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(0 0 20 0 8)
+)
+Symbol('F' 12)
+(
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(0 0 20 0 8)
+ SymbolLine(0 18 15 18 8)
+)
+Symbol('G' 12)
+(
+ SymbolLine(20 0 25 5 8)
+ SymbolLine(5 0 20 0 8)
+ SymbolLine(0 5 5 0 8)
+ SymbolLine(0 5 0 35 8)
+ SymbolLine(0 35 5 40 8)
+ SymbolLine(5 40 20 40 8)
+ SymbolLine(20 40 25 35 8)
+ SymbolLine(25 25 25 35 8)
+ SymbolLine(20 20 25 25 8)
+ SymbolLine(10 20 20 20 8)
+)
+Symbol('H' 12)
+(
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(25 0 25 40 8)
+ SymbolLine(0 20 25 20 8)
+)
+Symbol('I' 12)
+(
+ SymbolLine(0 0 10 0 8)
+ SymbolLine(5 0 5 40 8)
+ SymbolLine(0 40 10 40 8)
+)
+Symbol('J' 12)
+(
+ SymbolLine( 7 0 15 0 8)
+ SymbolLine(15 0 15 35 8)
+ SymbolLine(10 40 15 35 8)
+ SymbolLine( 5 40 10 40 8)
+ SymbolLine( 0 35 5 40 8)
+ SymbolLine( 0 35 0 30 8)
+)
+Symbol('K' 12)
+(
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(0 20 20 0 8)
+ SymbolLine(0 20 20 40 8)
+)
+Symbol('L' 12)
+(
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(0 40 20 40 8)
+)
+Symbol('M' 12)
+(
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(0 0 15 20 8)
+ SymbolLine(15 20 30 0 8)
+ SymbolLine(30 0 30 40 8)
+)
+Symbol('N' 12)
+(
+ SymbolLine(0 0 0 40 8)
+ SymbolLine(0 0 25 40 8)
+ SymbolLine(25 0 25 40 8)
+)
+Symbol('O' 12)
+(
+ SymbolLine(0 5 0 35 8)
+ SymbolLine(0 5 5 0 8)
+ SymbolLine(5 0 15 0 8)
+ SymbolLine(15 0 20 5 8)
+ SymbolLine(20 5 20 35 8)
+ SymbolLine(15 40 20 35 8)
+ SymbolLine(5 40 15 40 8)
+ SymbolLine(0 35 5 40 8)
+)
+Symbol('P' 12)
+(
+ SymbolLine(5 0 5 40 8)
+ SymbolLine(0 0 20 0 8)
+ SymbolLine(20 0 25 5 8)
+ SymbolLine(25 5 25 15 8)
+ SymbolLine(20 20 25 15 8)
+ SymbolLine(5 20 20 20 8)
+)
+Symbol('Q' 12)
+(
+ SymbolLine( 0 5 0 35 8)
+ SymbolLine( 0 5 5 0 8)
+ SymbolLine( 5 0 15 0 8)
+ SymbolLine(15 0 20 5 8)
+ SymbolLine(20 5 20 30 8)
+ SymbolLine(10 40 20 30 8)
+ SymbolLine( 5 40 10 40 8)
+ SymbolLine( 0 35 5 40 8)
+ SymbolLine(10 25 20 40 8)
+)
+Symbol('R' 12)
+(
+ SymbolLine( 0 0 20 0 8)
+ SymbolLine(20 0 25 5 8)
+ SymbolLine(25 5 25 15 8)
+ SymbolLine(20 20 25 15 8)
+ SymbolLine( 5 20 20 20 8)
+ SymbolLine( 5 0 5 40 8)
+ SymbolLine(13 20 25 40 8)
+)
+Symbol('S' 12)
+(
+ SymbolLine(20 0 25 5 8)
+ SymbolLine(5 0 20 0 8)
+ SymbolLine(0 5 5 0 8)
+ SymbolLine(0 5 0 15 8)
+ SymbolLine(0 15 5 20 8)
+ SymbolLine(5 20 20 20 8)
+ SymbolLine(20 20 25 25 8)
+ SymbolLine(25 25 25 35 8)
+ SymbolLine(20 40 25 35 8)
+ SymbolLine(5 40 20 40 8)
+ SymbolLine(0 35 5 40 8)
+)
+Symbol('T' 12)
+(
+ SymbolLine(0 0 20 0 8)
+ SymbolLine(10 0 10 40 8)
+)
+Symbol('U' 12)
+(
+ SymbolLine(0 0 0 35 8)
+ SymbolLine(0 35 5 40 8)
+ SymbolLine(5 40 15 40 8)
+ SymbolLine(15 40 20 35 8)
+ SymbolLine(20 0 20 35 8)
+)
+Symbol('V' 12)
+(
+ SymbolLine( 0 0 10 40 8)
+ SymbolLine(10 40 20 0 8)
+)
+Symbol('W' 12)
+(
+ SymbolLine( 0 0 0 20 8)
+ SymbolLine( 0 20 5 40 8)
+ SymbolLine( 5 40 15 20 8)
+ SymbolLine(15 20 25 40 8)
+ SymbolLine(25 40 30 20 8)
+ SymbolLine(30 20 30 0 8)
+)
+Symbol('X' 12)
+(
+ SymbolLine( 0 40 25 0 8)
+ SymbolLine( 0 0 25 40 8)
+)
+Symbol('Y' 12)
+(
+ SymbolLine( 0 0 10 20 8)
+ SymbolLine(10 20 20 0 8)
+ SymbolLine(10 20 10 40 8)
+)
+Symbol('Z' 12)
+(
+ SymbolLine( 0 0 25 0 8)
+ SymbolLine( 0 40 25 0 8)
+ SymbolLine( 0 40 25 40 8)
+)
diff --git a/tests/RTT/elem_pads.pcb b/tests/RTT/elem_pads.pcb
new file mode 100644
index 0000000..b2ae4db
--- /dev/null
+++ b/tests/RTT/elem_pads.pcb
@@ -0,0 +1,68 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["pads with different geometry" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "Standard SMT resistor, capacitor etc" "R1" "1206" 6350000nm 2540000nm -800100nm 1104900nm 0 100 ""]
+(
+ Pad[-1499870nm -299974nm -1499870nm 299974nm 1299972nm 508000nm 1452372nm "1" "1" "square"]
+ Pad[1499870nm -299974nm 1499870nm 299974nm 1299972nm 508000nm 1452372nm "2" "2" "square"]
+ ElementLine [-599948nm -949960nm 599948nm -949960nm 203200nm]
+ ElementLine [-599948nm 949960nm 599948nm 949960nm 203200nm]
+
+ )
+
+Element["" "SMT transistor, 5 pins" "U1" "SOT325" 5689600nm 9525000nm 25400nm 1016000nm 0 100 ""]
+(
+ Pad[0 -254000nm 0 254000nm 381000nm 762000nm 533400nm "1" "1" "square,edge2"]
+ Pad[1295400nm -254000nm 1295400nm 254000nm 381000nm 762000nm 533400nm "2" "2" "square,edge2"]
+ Pad[1295400nm -2032000nm 1295400nm -1524000nm 381000nm 762000nm 533400nm "3" "3" "square"]
+ Pad[660400nm -2032000nm 660400nm -1524000nm 381000nm 762000nm 533400nm "4" "4" "square"]
+ Pad[0 -2032000nm 0 -1524000nm 381000nm 762000nm 533400nm "5" "5" "square"]
+ ElementLine [-355600nm -2387600nm -355600nm 635000nm 254000nm]
+ ElementLine [-355600nm 635000nm 1676400nm 635000nm 254000nm]
+ ElementLine [1676400nm 635000nm 1676400nm -2387600nm 254000nm]
+ ElementLine [1676400nm -2387600nm -355600nm -2387600nm 254000nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/elem_pads_ds.pcb b/tests/RTT/elem_pads_ds.pcb
new file mode 100644
index 0000000..0166de8
--- /dev/null
+++ b/tests/RTT/elem_pads_ds.pcb
@@ -0,0 +1,53 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["element with pads on both sides" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "" "" "" 4445000nm 3810000nm 0 0 0 100 ""]
+(
+ Pad[0 0 1905000nm 0 254000nm 1016000nm 1270000nm "" "1" ""]
+ Pad[2540000nm 635000nm 2540000nm 2540000nm 254000nm 1016000nm 1270000nm "" "2" "onsolder,edge2"]
+ ElementLine [0 0 0 2540000nm 254000nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/elem_pins.pcb b/tests/RTT/elem_pins.pcb
new file mode 100644
index 0000000..296b5df
--- /dev/null
+++ b/tests/RTT/elem_pins.pcb
@@ -0,0 +1,71 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["pins with different shapes" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 1905000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "dip(2)" "U1" "2*300" 1905000nm 3175000nm 0 -2540000nm 0 100 ""]
+(
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "" "1" "square,edge2"]
+ Pin[7620000nm 0 2032000nm 1270000nm 2184400nm 999998nm "" "2" "edge2"]
+ ElementLine [-1270000nm -1270000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [8890000nm 1270000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [8890000nm 1270000nm 8890000nm -1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 2540000nm -1270000nm 254000nm]
+ ElementLine [5080000nm -1270000nm 8890000nm -1270000nm 254000nm]
+ ElementArc [3810000nm -1270000nm 1270000nm 1270000nm 0 180 254000nm]
+
+ )
+
+Element["" "dip(2)" "U2" "2*300" 1905000nm 8255000nm 0 -2540000nm 0 100 ""]
+(
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "" "1" "square,edge2,shape(2)"]
+ Pin[7620000nm 0 2032000nm 1270000nm 2184400nm 999998nm "" "2" "square,edge2,shape(12)"]
+ ElementLine [-1270000nm -1270000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [8890000nm 1270000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [8890000nm 1270000nm 8890000nm -1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 2540000nm -1270000nm 254000nm]
+ ElementLine [5080000nm -1270000nm 8890000nm -1270000nm 254000nm]
+ ElementArc [3810000nm -1270000nm 1270000nm 1270000nm 0 180 254000nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/elem_sides_smd.pcb b/tests/RTT/elem_sides_smd.pcb
new file mode 100644
index 0000000..631fda5
--- /dev/null
+++ b/tests/RTT/elem_sides_smd.pcb
@@ -0,0 +1,63 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["smd elements on both sides" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "Standard SMT resistor, capacitor etc" "R1" "1206" 5715000nm 3175000nm 3009900nm -800100nm 0 100 ""]
+(
+ Pad[-1499870nm -299974nm -1499870nm 299974nm 1299972nm 508000nm 1452372nm "1" "1" "square"]
+ Pad[1499870nm -299974nm 1499870nm 299974nm 1299972nm 508000nm 1452372nm "2" "2" "square"]
+ ElementLine [-599948nm -949960nm 599948nm -949960nm 203200nm]
+ ElementLine [-599948nm 949960nm 599948nm 949960nm 203200nm]
+
+ )
+
+Element["onsolder" "Standard SMT resistor, capacitor etc" "R2" "1206" 5715000nm 8890000nm 3009900nm 800100nm 0 100 "auto"]
+(
+ Pad[-1499870nm 299974nm -1499870nm -299974nm 1299972nm 508000nm 1452372nm "1" "1" "onsolder,square"]
+ Pad[1499870nm 299974nm 1499870nm -299974nm 1299972nm 508000nm 1452372nm "2" "2" "onsolder,square"]
+ ElementLine [-599948nm 949960nm 599948nm 949960nm 203200nm]
+ ElementLine [-599948nm -949960nm 599948nm -949960nm 203200nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/elem_sides_trh.pcb b/tests/RTT/elem_sides_trh.pcb
new file mode 100644
index 0000000..6855fa6
--- /dev/null
+++ b/tests/RTT/elem_sides_trh.pcb
@@ -0,0 +1,71 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["thru-hole elements on both sides" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "dip(2)" "U1" "2*300" 2540000nm 3810000nm 0 -2540000nm 0 100 ""]
+(
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "" "1" "square,edge2"]
+ Pin[7620000nm 0 2032000nm 1270000nm 2184400nm 999998nm "" "2" "edge2"]
+ ElementLine [-1270000nm -1270000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [8890000nm 1270000nm -1270000nm 1270000nm 254000nm]
+ ElementLine [8890000nm 1270000nm 8890000nm -1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 2540000nm -1270000nm 254000nm]
+ ElementLine [5080000nm -1270000nm 8890000nm -1270000nm 254000nm]
+ ElementArc [3810000nm -1270000nm 1270000nm 1270000nm 0 180 254000nm]
+
+ )
+
+Element["onsolder" "dip(2)" "U2" "2*300" 2540000nm 8890000nm 0 2540000nm 0 100 "auto"]
+(
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "" "1" "square,edge2"]
+ Pin[7620000nm 0 2032000nm 1270000nm 2184400nm 999998nm "" "2" "edge2"]
+ ElementLine [-1270000nm 1270000nm -1270000nm -1270000nm 254000nm]
+ ElementLine [8890000nm -1270000nm -1270000nm -1270000nm 254000nm]
+ ElementLine [8890000nm -1270000nm 8890000nm 1270000nm 254000nm]
+ ElementLine [-1270000nm 1270000nm 2540000nm 1270000nm 254000nm]
+ ElementLine [5080000nm 1270000nm 8890000nm 1270000nm 254000nm]
+ ElementArc [3810000nm 1270000nm 1270000nm 1270000nm -0 -180 254000nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/layer_copper.pcb b/tests/RTT/layer_copper.pcb
new file mode 100644
index 0000000..c882ef3
--- /dev/null
+++ b/tests/RTT/layer_copper.pcb
@@ -0,0 +1,48 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["one line per each type of copper layer" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Layer(1 "comp1")
+(
+ Line[1270000nm 1905000nm 1270000nm 8890000nm 254000nm 1016000nm "clearline"]
+)
+Layer(2 "solder1")
+(
+ Line[1905000nm 1905000nm 10160000nm 1905000nm 254000nm 1016000nm "clearline"]
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+ Line[2540000nm 3810000nm 8255000nm 9525000nm 254000nm 1016000nm "clearline"]
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/layer_outline.pcb b/tests/RTT/layer_outline.pcb
new file mode 100644
index 0000000..6de193f
--- /dev/null
+++ b/tests/RTT/layer_outline.pcb
@@ -0,0 +1,48 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["outline layer triangle" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+ Line[1905000nm 2540000nm 1905000nm 10160000nm 254000nm 1016000nm "clearline"]
+ Line[1905000nm 10160000nm 9525000nm 10160000nm 254000nm 1016000nm "clearline"]
+ Line[9525000nm 10160000nm 1905000nm 2540000nm 254000nm 1016000nm "clearline"]
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/layer_silk.pcb b/tests/RTT/layer_silk.pcb
new file mode 100644
index 0000000..5e07add
--- /dev/null
+++ b/tests/RTT/layer_silk.pcb
@@ -0,0 +1,47 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["one line on each silk layer" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+ Line[1905000nm 10795000nm 7620000nm 5080000nm 254000nm 1016000nm "clearline"]
+)
+Layer(9 "silk")
+(
+ Line[1270000nm 1270000nm 1270000nm 10795000nm 254000nm 1016000nm "clearline"]
+)
diff --git a/tests/RTT/layer_spc.pcb b/tests/RTT/layer_spc.pcb
new file mode 100644
index 0000000..65807a0
--- /dev/null
+++ b/tests/RTT/layer_spc.pcb
@@ -0,0 +1,43 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["space (and other dangerous characters) in layer name" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "component 1")
+(
+)
+Layer(2 "solder 1")
+(
+)
+Layer(3 " ")
+(
+)
+Layer(4 "solder{2}")
+(
+)
+Layer(5 "inner(1)")
+(
+)
+Layer(6 "inner/2")
+(
+)
+Layer(7 "out:line")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_f_clear.pcb b/tests/RTT/line_f_clear.pcb
new file mode 100644
index 0000000..00a7f85
--- /dev/null
+++ b/tests/RTT/line_f_clear.pcb
@@ -0,0 +1,51 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Clear and no-clear lines" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Line[3175000nm 6350000nm 10160000nm 6350000nm 381000nm 609602nm "clearline"]
+ Line[6350000nm 3175000nm 6350000nm 9525000nm 254000nm 2133600nm "clearline"]
+ Line[6350000nm 6350000nm 10160000nm 5080000nm 508000nm 1016000nm ""]
+ Line[6350000nm 6350000nm 3810000nm 3810000nm 127000nm 1016000nm ""]
+ Polygon("clearpoly")
+ (
+ [635000nm 635000nm] [12065000nm 635000nm] [12065000nm 12065000nm] [635000nm 12065000nm]
+ )
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_normal.pcb b/tests/RTT/line_normal.pcb
new file mode 100644
index 0000000..7f695f7
--- /dev/null
+++ b/tests/RTT/line_normal.pcb
@@ -0,0 +1,47 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Normal lines at different size and angle" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[1270000nm 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Line[3175000nm 6350000nm 10160000nm 6350000nm 381000nm 1016000nm ""]
+ Line[6350000nm 3175000nm 6350000nm 9525000nm 254000nm 1016000nm ""]
+ Line[6350000nm 6350000nm 10160000nm 5080000nm 508000nm 1016000nm ""]
+ Line[6350000nm 6350000nm 3810000nm 3810000nm 127000nm 1016000nm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_offpage.pcb b/tests/RTT/line_offpage.pcb
new file mode 100644
index 0000000..8ea43cd
--- /dev/null
+++ b/tests/RTT/line_offpage.pcb
@@ -0,0 +1,44 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["A single line that extends beyond board boundary" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[0.0 50.0mil 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Line[100mil 200mil 600mil 200mil 254000nm 1016000nm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_overlap1.pcb b/tests/RTT/line_overlap1.pcb
new file mode 100644
index 0000000..6f64aed
--- /dev/null
+++ b/tests/RTT/line_overlap1.pcb
@@ -0,0 +1,45 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Two lines partially overlapping" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[50.0mil 0.0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Line[200mil 200mil 250mil 200mil 381000nm 1016000nm ""]
+ Line[220mil 200mil 300mil 200mil 381000nm 1016000nm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_overlap2.pcb b/tests/RTT/line_overlap2.pcb
new file mode 100644
index 0000000..fd21ec5
--- /dev/null
+++ b/tests/RTT/line_overlap2.pcb
@@ -0,0 +1,45 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Two lines, one over the other, full cover" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[50.0mil 0.0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Line[200mil 200mil 350mil 200mil 381000nm 1016000nm ""]
+ Line[220mil 200mil 300mil 200mil 381000nm 1016000nm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_overlap3.pcb b/tests/RTT/line_overlap3.pcb
new file mode 100644
index 0000000..cfd5b9e
--- /dev/null
+++ b/tests/RTT/line_overlap3.pcb
@@ -0,0 +1,45 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Full overlap: the same line twice" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[50.0mil 0.0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Line[200mil 200mil 350mil 200mil 381000nm 1016000nm ""]
+ Line[200mil 200mil 350mil 200mil 381000nm 1016000nm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_overlap4.pcb b/tests/RTT/line_overlap4.pcb
new file mode 100644
index 0000000..f3f1ce9
--- /dev/null
+++ b/tests/RTT/line_overlap4.pcb
@@ -0,0 +1,49 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Full overlap: the same line twice with different settings" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[635000nm 635000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999994nm,800100nm,508000nm:style2,508000nm,2199894nm,999996nm,508000nm:style3,2032000nm,3500118nm,1199894nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Layer(1 "comp1")
+(
+ Line[5080000nm 5080000nm 8890000nm 5080000nm 127000nm 1016000nm "clearline"]
+ Line[5080000nm 5080000nm 8890000nm 5080000nm 381000nm 1016000nm ""]
+ Polygon("clearpoly")
+ (
+ [3810000nm 3810000nm] [7620000nm 3810000nm] [7620000nm 8255000nm] [3810000nm 8255000nm]
+ )
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/line_zerolen.pcb b/tests/RTT/line_zerolen.pcb
new file mode 100644
index 0000000..f41a899
--- /dev/null
+++ b/tests/RTT/line_zerolen.pcb
@@ -0,0 +1,44 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["A single zero length line" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[50.0mil 0.0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Line[200mil 200mil 200mil 200mil 381000nm 1016000nm ""]
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/netlist.pcb b/tests/RTT/netlist.pcb
new file mode 100644
index 0000000..24baac9
--- /dev/null
+++ b/tests/RTT/netlist.pcb
@@ -0,0 +1,74 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["board with minimal netlist" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 3810000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "dip(4)" "U1" "4*300" 2540000nm 4445000nm 0 -2540000nm 0 100 ""]
+(
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "" "1" "square,edge2"]
+ Pin[7620000nm 0 2032000nm 1270000nm 2184400nm 999998nm "" "4" "edge2"]
+ Pin[0 2540000nm 2032000nm 1270000nm 2184400nm 999998nm "" "2" "edge2"]
+ Pin[7620000nm 2540000nm 2032000nm 1270000nm 2184400nm 999998nm "" "3" "edge2"]
+ ElementLine [-1270000nm -1270000nm -1270000nm 3810000nm 254000nm]
+ ElementLine [8890000nm 3810000nm -1270000nm 3810000nm 254000nm]
+ ElementLine [8890000nm 3810000nm 8890000nm -1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 2540000nm -1270000nm 254000nm]
+ ElementLine [5080000nm -1270000nm 8890000nm -1270000nm 254000nm]
+ ElementArc [3810000nm -1270000nm 1270000nm 1270000nm 0 180 254000nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
+
+NetList()
+(
+ Net("foo" "(unknown)")
+ (
+ Connect("U1-1")
+ Connect("U1-3")
+ )
+ Net("bar" "(unknown)")
+ (
+ Connect("U1-2")
+ Connect("U1-4")
+ )
+)
diff --git a/tests/RTT/netlist_ba.pcb b/tests/RTT/netlist_ba.pcb
new file mode 100644
index 0000000..411806b
--- /dev/null
+++ b/tests/RTT/netlist_ba.pcb
@@ -0,0 +1,81 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["board with minimal netlist and some back-annotation changes" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 3810000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Element["" "dip(4)" "U1" "4*300" 2540000nm 4445000nm 0 -2540000nm 0 100 ""]
+(
+ Pin[0 0 2032000nm 1270000nm 2184400nm 999998nm "" "1" "square,edge2"]
+ Pin[7620000nm 0 2032000nm 1270000nm 2184400nm 999998nm "" "4" "edge2"]
+ Pin[0 2540000nm 2032000nm 1270000nm 2184400nm 999998nm "" "2" "edge2"]
+ Pin[7620000nm 2540000nm 2032000nm 1270000nm 2184400nm 999998nm "" "3" "edge2"]
+ ElementLine [-1270000nm -1270000nm -1270000nm 3810000nm 254000nm]
+ ElementLine [8890000nm 3810000nm -1270000nm 3810000nm 254000nm]
+ ElementLine [8890000nm 3810000nm 8890000nm -1270000nm 254000nm]
+ ElementLine [-1270000nm -1270000nm 2540000nm -1270000nm 254000nm]
+ ElementLine [5080000nm -1270000nm 8890000nm -1270000nm 254000nm]
+ ElementArc [3810000nm -1270000nm 1270000nm 1270000nm 0 180 254000nm]
+
+ )
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
+
+NetList()
+(
+ Net("foo" "(unknown)")
+ (
+ Connect("U1-1")
+ Connect("U1-3")
+ )
+ Net("bar" "(unknown)")
+ (
+ Connect("U1-2")
+ Connect("U1-4")
+ )
+)
+
+NetListPatch()
+(
+ del_conn("U1-1" "foo")
+ add_conn("U1-1" "bar")
+ change_attrib("bar" "impedance" "50 ohm")
+)
diff --git a/tests/RTT/poly_hole.pcb b/tests/RTT/poly_hole.pcb
new file mode 100644
index 0000000..645ae0f
--- /dev/null
+++ b/tests/RTT/poly_hole.pcb
@@ -0,0 +1,77 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20100606]
+
+PCB["Polygons with holes" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,alldirection,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999994nm,800100nm,508000nm:style2,508000nm,2199894nm,999996nm,508000nm:style3,2032000nm,3500118nm,1199894nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Layer(1 "comp1")
+(
+ Polygon("clearpoly")
+ (
+ [635000nm 635000nm] [3175000nm 635000nm] [635000nm 3175000nm]
+ Hole (
+ [1270000nm 1270000nm] [1270000nm 1905000nm] [1905000nm 1270000nm]
+ )
+ )
+ Polygon("clearpoly")
+ (
+ [635000nm 3810000nm] [3810000nm 635000nm] [3810000nm 3810000nm]
+ Hole (
+ [1905000nm 3175000nm] [3175000nm 3175000nm] [3175000nm 2540000nm] [2540000nm 2540000nm]
+ )
+ )
+ Polygon("clearpoly")
+ (
+ [4445000nm 3810000nm] [7620000nm 635000nm] [10795000nm 3810000nm]
+ Hole (
+ [6985000nm 1905000nm] [6985000nm 3175000nm] [8255000nm 3175000nm] [8255000nm 1905000nm]
+ )
+ )
+ Polygon("clearpoly")
+ (
+ [635000nm 4445000nm] [7620000nm 5080000nm] [1270000nm 8890000nm]
+ Hole (
+ [3810000nm 5715000nm] [3810000nm 6350000nm] [4445000nm 6350000nm] [4445000nm 5715000nm]
+ )
+ Hole (
+ [1905000nm 5715000nm] [1905000nm 6985000nm] [2540000nm 7620000nm] [3175000nm 6985000nm] [3175000nm 6350000nm]
+ [2540000nm 5715000nm]
+ )
+ )
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/poly_rect.pcb b/tests/RTT/poly_rect.pcb
new file mode 100644
index 0000000..6ca95d9
--- /dev/null
+++ b/tests/RTT/poly_rect.pcb
@@ -0,0 +1,59 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Normal rectangular polygons" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[0.0 150.0mil 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Polygon("")
+ (
+ [1270000nm 635000nm] [1905000nm 635000nm] [1905000nm 11430000nm] [1270000nm 11430000nm]
+ )
+ Polygon("")
+ (
+ [3175000nm 635000nm] [12065000nm 635000nm] [12065000nm 1270000nm] [3175000nm 1270000nm]
+ )
+ Polygon("")
+ (
+ [10795000nm 10795000nm] [11430000nm 10795000nm] [11430000nm 11430000nm] [10795000nm 11430000nm]
+ )
+ Polygon("")
+ (
+ [3175000nm 1905000nm] [10160000nm 1905000nm] [10160000nm 11430000nm] [3175000nm 11430000nm]
+ )
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/poly_triangle.pcb b/tests/RTT/poly_triangle.pcb
new file mode 100644
index 0000000..cffa86d
--- /dev/null
+++ b/tests/RTT/poly_triangle.pcb
@@ -0,0 +1,59 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["Normal triangular polygons" 500.0mil 500.0mil]
+
+Grid[25.0mil 0.0 0.0 1]
+Cursor[25.0mil 0.0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[12.0mil 9.0mil 10.0mil 7.0mil 15.0mil 10.0mil]
+Flags("nameonpcb,alldirection,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,10.0mil,78.7399606mil,31.5mil,20.0mil:style2,20.0mil,86.61mil,39.3699606mil,20.0mil:style3,80.0mil,137.7999606mil,47.2399606mil,25.0mil:style4,100.0mil,64.0mil,31.5mil,100.0mil"]
+
+Layer(1 "comp1")
+(
+ Polygon("clearpoly")
+ (
+ [635000nm 635000nm] [635000nm 3175000nm] [3175000nm 635000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [635000nm 3810000nm] [3810000nm 635000nm] [3810000nm 3810000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [4445000nm 3810000nm] [7620000nm 635000nm] [10795000nm 3810000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [635000nm 4445000nm] [1270000nm 8890000nm] [7620000nm 5080000nm]
+ )
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/rat.pcb b/tests/RTT/rat.pcb
new file mode 100644
index 0000000..4b63a2d
--- /dev/null
+++ b/tests/RTT/rat.pcb
@@ -0,0 +1,46 @@
+# release: pcb-rnd 1.1.0
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["a rat line" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Rat[10000000nm 10000000nm 1 20000000nm 20000000nm 1 ""]
+
+
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/ref/Proto.bom b/tests/RTT/ref/Proto.bom
new file mode 100644
index 0000000..7a38186
--- /dev/null
+++ b/tests/RTT/ref/Proto.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: (unknown) - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/Proto.dsn b/tests/RTT/ref/Proto.dsn
new file mode 100644
index 0000000..61b3a2f
--- /dev/null
+++ b/tests/RTT/ref/Proto.dsn
@@ -0,0 +1,57 @@
+(pcb notnamed
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/Proto.gbr/Proto.fab.gbr b/tests/RTT/ref/Proto.gbr/Proto.fab.gbr
new file mode 100644
index 0000000..b76c56e
--- /dev/null
+++ b/tests/RTT/ref/Proto.gbr/Proto.fab.gbr
@@ -0,0 +1,1692 @@
+G04 start of page 2 for group -1 layer_idx -1 *
+G04 Title: (unknown), TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD13C,0.0100*%
+%ADD12C,0.0001*%
+%ADD11C,0.0060*%
+G54D11*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D12*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D11*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D12*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D11*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D12*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D11*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D12*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D11*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D12*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D11*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D12*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D13*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D11*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D12*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D11*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D12*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D11*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D12*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D11*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D12*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D11*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D12*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D11*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D12*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D11*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D12*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D11*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D12*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D11*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D12*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D11*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D12*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D11*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D12*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X272300D02*Y104000D01*
+X276800D01*
+Y110000D01*
+X272300D01*
+G37*
+G36*
+X277700D02*Y104000D01*
+X282200D01*
+Y110000D01*
+X277700D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G54D11*X293900D02*Y104000D01*
+Y110000D02*X296900D01*
+X293900Y107300D02*X296150D01*
+G54D12*G36*
+X298700Y110000D02*Y104000D01*
+X303200D01*
+Y110000D01*
+X298700D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X320300D02*Y104000D01*
+X324800D01*
+Y110000D01*
+X320300D01*
+G37*
+G36*
+X325700D02*Y104000D01*
+X330200D01*
+Y110000D01*
+X325700D01*
+G37*
+G36*
+X331100D02*Y104000D01*
+X335600D01*
+Y110000D01*
+X331100D01*
+G37*
+G36*
+X336500D02*Y104000D01*
+X341000D01*
+Y110000D01*
+X336500D01*
+G37*
+G36*
+X341900D02*Y104000D01*
+X346400D01*
+Y110000D01*
+X341900D01*
+G37*
+G36*
+X347300D02*Y104000D01*
+X351800D01*
+Y110000D01*
+X347300D01*
+G37*
+G54D11*X356150D02*Y104000D01*
+X358100Y110000D02*X359150Y108950D01*
+Y105050D01*
+X358100Y104000D02*X359150Y105050D01*
+X355400Y104000D02*X358100D01*
+X355400Y110000D02*X358100D01*
+G54D12*G36*
+X360950D02*Y104000D01*
+X365450D01*
+Y110000D01*
+X360950D01*
+G37*
+G36*
+X366350D02*Y104000D01*
+X370850D01*
+Y110000D01*
+X366350D01*
+G37*
+G36*
+X371750D02*Y104000D01*
+X376250D01*
+Y110000D01*
+X371750D01*
+G37*
+G36*
+X377150D02*Y104000D01*
+X381650D01*
+Y110000D01*
+X377150D01*
+G37*
+G36*
+X382550D02*Y104000D01*
+X387050D01*
+Y110000D01*
+X382550D01*
+G37*
+G36*
+X387950D02*Y104000D01*
+X392450D01*
+Y110000D01*
+X387950D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/Proto.net b/tests/RTT/ref/Proto.net
new file mode 100644
index 0000000..b117de5
--- /dev/null
+++ b/tests/RTT/ref/Proto.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Proto.pcb
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/Proto.png b/tests/RTT/ref/Proto.png
new file mode 100644
index 0000000..852eb60
Binary files /dev/null and b/tests/RTT/ref/Proto.png differ
diff --git a/tests/RTT/ref/Proto.ps.gz b/tests/RTT/ref/Proto.ps.gz
new file mode 100644
index 0000000..5f43e1e
Binary files /dev/null and b/tests/RTT/ref/Proto.ps.gz differ
diff --git a/tests/RTT/ref/Proto.remote.gz b/tests/RTT/ref/Proto.remote.gz
new file mode 100644
index 0000000..be5ed50
Binary files /dev/null and b/tests/RTT/ref/Proto.remote.gz differ
diff --git a/tests/RTT/ref/Proto.svg b/tests/RTT/ref/Proto.svg
new file mode 100644
index 0000000..6ac2399
--- /dev/null
+++ b/tests/RTT/ref/Proto.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/Proto.xy b/tests/RTT/ref/Proto.xy
new file mode 100644
index 0000000..022aa5b
--- /dev/null
+++ b/tests/RTT/ref/Proto.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: (unknown) - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_angles.bom b/tests/RTT/ref/arc_angles.bom
new file mode 100644
index 0000000..79d5355
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: arcs with different strange angles - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_angles.dsn b/tests/RTT/ref/arc_angles.dsn
new file mode 100644
index 0000000..364a8ec
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.dsn
@@ -0,0 +1,57 @@
+(pcb arcs with different strange angles
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/arc_angles.gbr/arc_angles.fab.gbr b/tests/RTT/ref/arc_angles.gbr/arc_angles.fab.gbr
new file mode 100644
index 0000000..d7a7cec
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.gbr/arc_angles.fab.gbr
@@ -0,0 +1,1818 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: arcs with different strange angles, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X283100D02*Y104000D01*
+X287600D01*
+Y110000D01*
+X283100D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X366800D02*Y104000D01*
+X371300D01*
+Y110000D01*
+X366800D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G36*
+X396500D02*Y104000D01*
+X401000D01*
+Y110000D01*
+X396500D01*
+G37*
+G36*
+X401900D02*Y104000D01*
+X406400D01*
+Y110000D01*
+X401900D01*
+G37*
+G36*
+X410000D02*Y104000D01*
+X414500D01*
+Y110000D01*
+X410000D01*
+G37*
+G54D12*X418100D02*Y104000D01*
+Y110000D02*X421100D01*
+X418100Y107300D02*X420350D01*
+G54D13*G36*
+X422900Y110000D02*Y104000D01*
+X427400D01*
+Y110000D01*
+X422900D01*
+G37*
+G36*
+X428300D02*Y104000D01*
+X432800D01*
+Y110000D01*
+X428300D01*
+G37*
+G36*
+X433700D02*Y104000D01*
+X438200D01*
+Y110000D01*
+X433700D01*
+G37*
+G36*
+X439100D02*Y104000D01*
+X443600D01*
+Y110000D01*
+X439100D01*
+G37*
+G36*
+X444500D02*Y104000D01*
+X449000D01*
+Y110000D01*
+X444500D01*
+G37*
+G36*
+X449900D02*Y104000D01*
+X454400D01*
+Y110000D01*
+X449900D01*
+G37*
+G36*
+X455300D02*Y104000D01*
+X459800D01*
+Y110000D01*
+X455300D01*
+G37*
+G36*
+X460700D02*Y104000D01*
+X465200D01*
+Y110000D01*
+X460700D01*
+G37*
+G36*
+X466100D02*Y104000D01*
+X470600D01*
+Y110000D01*
+X466100D01*
+G37*
+G36*
+X471500D02*Y104000D01*
+X476000D01*
+Y110000D01*
+X471500D01*
+G37*
+G54D12*X480350D02*Y104000D01*
+X482300Y110000D02*X483350Y108950D01*
+Y105050D01*
+X482300Y104000D02*X483350Y105050D01*
+X479600Y104000D02*X482300D01*
+X479600Y110000D02*X482300D01*
+G54D13*G36*
+X485150D02*Y104000D01*
+X489650D01*
+Y110000D01*
+X485150D01*
+G37*
+G36*
+X490550D02*Y104000D01*
+X495050D01*
+Y110000D01*
+X490550D01*
+G37*
+G36*
+X495950D02*Y104000D01*
+X500450D01*
+Y110000D01*
+X495950D01*
+G37*
+G36*
+X501350D02*Y104000D01*
+X505850D01*
+Y110000D01*
+X501350D01*
+G37*
+G36*
+X506750D02*Y104000D01*
+X511250D01*
+Y110000D01*
+X506750D01*
+G37*
+G36*
+X512150D02*Y104000D01*
+X516650D01*
+Y110000D01*
+X512150D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/arc_angles.gbr/arc_angles.top.gbr b/tests/RTT/ref/arc_angles.gbr/arc_angles.top.gbr
new file mode 100644
index 0000000..4691cde
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.gbr/arc_angles.top.gbr
@@ -0,0 +1,18 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: arcs with different strange angles, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0100*%
+G54D11*X5000Y40000D02*G75*G03X15000Y40000I5000J0D01*G01*
+G75*G03X5000Y40000I-5000J0D01*G01*
+X25000Y40000D03*
+X35000D02*G75*G02X45000Y40000I5000J0D01*G01*
+G75*G02X35000Y40000I-5000J0D01*G01*
+M02*
diff --git a/tests/RTT/ref/arc_angles.net b/tests/RTT/ref/arc_angles.net
new file mode 100644
index 0000000..5618581
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB arcs with different strange angles
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/arc_angles.png b/tests/RTT/ref/arc_angles.png
new file mode 100644
index 0000000..e56f163
Binary files /dev/null and b/tests/RTT/ref/arc_angles.png differ
diff --git a/tests/RTT/ref/arc_angles.png.text b/tests/RTT/ref/arc_angles.png.text
new file mode 100644
index 0000000..75c7f15
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.png.text
@@ -0,0 +1,22 @@
+
+right circle
+132 pixels horizontally
+132 pixels vertically
+13 pixels wall thickness
+
+left circle
+132 pixels horizontally
+132 pixels vertically
+13 pixels wall thickness
+
+central dot
+13 pixel diameter
+
+air gap between right circle and central dot
+107 pixels
+
+air gap between left circle and central dot
+108 pixels
+
+
+
diff --git a/tests/RTT/ref/arc_angles.ps.gz b/tests/RTT/ref/arc_angles.ps.gz
new file mode 100644
index 0000000..668a985
Binary files /dev/null and b/tests/RTT/ref/arc_angles.ps.gz differ
diff --git a/tests/RTT/ref/arc_angles.remote.gz b/tests/RTT/ref/arc_angles.remote.gz
new file mode 100644
index 0000000..cb5a8dc
Binary files /dev/null and b/tests/RTT/ref/arc_angles.remote.gz differ
diff --git a/tests/RTT/ref/arc_angles.svg b/tests/RTT/ref/arc_angles.svg
new file mode 100644
index 0000000..f2a32b5
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <path d="M 1.2700 2.5400 A 1.2700 1.2700 0 0 0 1.2700 2.5400" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 6.3500 2.5400 A 1.2700 1.2700 0 0 0 6.3500 2.5400" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 8.8900 2.5400 A 1.2700 1.2700 0 0 0 8.8900 2.5400" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/arc_angles.xy b/tests/RTT/ref/arc_angles.xy
new file mode 100644
index 0000000..3044e35
--- /dev/null
+++ b/tests/RTT/ref/arc_angles.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: arcs with different strange angles - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_f_clear.bom b/tests/RTT/ref/arc_f_clear.bom
new file mode 100644
index 0000000..b6e3fcb
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Arc with clearline flag - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_f_clear.dsn b/tests/RTT/ref/arc_f_clear.dsn
new file mode 100644
index 0000000..39f7356
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.dsn
@@ -0,0 +1,57 @@
+(pcb Arc with clearline flag
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.fab.gbr b/tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.fab.gbr
new file mode 100644
index 0000000..8d32444
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.fab.gbr
@@ -0,0 +1,1758 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Arc with clearline flag, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD17C,0.0100*%
+%ADD16C,0.0001*%
+%ADD15C,0.0060*%
+G54D15*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D16*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D15*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D16*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D15*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D16*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D15*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D16*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D15*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D16*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D15*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D16*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D17*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D15*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D16*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D15*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D16*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D15*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D16*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D15*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D16*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D15*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D16*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D15*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D16*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D15*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D16*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D15*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D16*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D15*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D16*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D15*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D16*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D15*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D16*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D15*X234500Y108500D02*Y104000D01*
+Y108500D02*X235550Y110000D01*
+X237200D01*
+X238250Y108500D01*
+Y104000D01*
+X234500Y107000D02*X238250D01*
+G54D16*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X253550D02*Y104000D01*
+X258050D01*
+Y110000D01*
+X253550D01*
+G37*
+G36*
+X258950D02*Y104000D01*
+X263450D01*
+Y110000D01*
+X258950D01*
+G37*
+G36*
+X264350D02*Y104000D01*
+X268850D01*
+Y110000D01*
+X264350D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X277850D02*Y104000D01*
+X282350D01*
+Y110000D01*
+X277850D01*
+G37*
+G36*
+X283250D02*Y104000D01*
+X287750D01*
+Y110000D01*
+X283250D01*
+G37*
+G36*
+X288650D02*Y104000D01*
+X293150D01*
+Y110000D01*
+X288650D01*
+G37*
+G36*
+X294050D02*Y104000D01*
+X298550D01*
+Y110000D01*
+X294050D01*
+G37*
+G36*
+X299450D02*Y104000D01*
+X303950D01*
+Y110000D01*
+X299450D01*
+G37*
+G36*
+X304850D02*Y104000D01*
+X309350D01*
+Y110000D01*
+X304850D01*
+G37*
+G36*
+X310250D02*Y104000D01*
+X314750D01*
+Y110000D01*
+X310250D01*
+G37*
+G36*
+X315650D02*Y104000D01*
+X320150D01*
+Y110000D01*
+X315650D01*
+G37*
+G36*
+X321050D02*Y104000D01*
+X325550D01*
+Y110000D01*
+X321050D01*
+G37*
+G36*
+X329150D02*Y104000D01*
+X333650D01*
+Y110000D01*
+X329150D01*
+G37*
+G36*
+X334550D02*Y104000D01*
+X339050D01*
+Y110000D01*
+X334550D01*
+G37*
+G36*
+X339950D02*Y104000D01*
+X344450D01*
+Y110000D01*
+X339950D01*
+G37*
+G36*
+X345350D02*Y104000D01*
+X349850D01*
+Y110000D01*
+X345350D01*
+G37*
+G36*
+X353450D02*Y104000D01*
+X357950D01*
+Y110000D01*
+X353450D01*
+G37*
+G54D15*X361550D02*Y104000D01*
+Y110000D02*X364550D01*
+X361550Y107300D02*X363800D01*
+G54D16*G36*
+X366350Y110000D02*Y104000D01*
+X370850D01*
+Y110000D01*
+X366350D01*
+G37*
+G36*
+X371750D02*Y104000D01*
+X376250D01*
+Y110000D01*
+X371750D01*
+G37*
+G36*
+X377150D02*Y104000D01*
+X381650D01*
+Y110000D01*
+X377150D01*
+G37*
+G36*
+X382550D02*Y104000D01*
+X387050D01*
+Y110000D01*
+X382550D01*
+G37*
+G36*
+X387950D02*Y104000D01*
+X392450D01*
+Y110000D01*
+X387950D01*
+G37*
+G36*
+X393350D02*Y104000D01*
+X397850D01*
+Y110000D01*
+X393350D01*
+G37*
+G36*
+X398750D02*Y104000D01*
+X403250D01*
+Y110000D01*
+X398750D01*
+G37*
+G36*
+X404150D02*Y104000D01*
+X408650D01*
+Y110000D01*
+X404150D01*
+G37*
+G36*
+X409550D02*Y104000D01*
+X414050D01*
+Y110000D01*
+X409550D01*
+G37*
+G36*
+X414950D02*Y104000D01*
+X419450D01*
+Y110000D01*
+X414950D01*
+G37*
+G54D15*X423800D02*Y104000D01*
+X425750Y110000D02*X426800Y108950D01*
+Y105050D01*
+X425750Y104000D02*X426800Y105050D01*
+X423050Y104000D02*X425750D01*
+X423050Y110000D02*X425750D01*
+G54D16*G36*
+X428600D02*Y104000D01*
+X433100D01*
+Y110000D01*
+X428600D01*
+G37*
+G36*
+X434000D02*Y104000D01*
+X438500D01*
+Y110000D01*
+X434000D01*
+G37*
+G36*
+X439400D02*Y104000D01*
+X443900D01*
+Y110000D01*
+X439400D01*
+G37*
+G36*
+X444800D02*Y104000D01*
+X449300D01*
+Y110000D01*
+X444800D01*
+G37*
+G36*
+X450200D02*Y104000D01*
+X454700D01*
+Y110000D01*
+X450200D01*
+G37*
+G36*
+X455600D02*Y104000D01*
+X460100D01*
+Y110000D01*
+X455600D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.top.gbr b/tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.top.gbr
new file mode 100644
index 0000000..adc965e
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.gbr/arc_f_clear.top.gbr
@@ -0,0 +1,198 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Arc with clearline flag, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD14C,0.0300*%
+%ADD13C,0.0200*%
+%ADD12C,0.0100*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X30002Y35000D02*X47500D01*
+Y2500D01*
+X30002D01*
+Y17495D01*
+X30436Y17514D01*
+X30869Y17571D01*
+X31295Y17666D01*
+X31712Y17797D01*
+X32115Y17964D01*
+X32502Y18166D01*
+X32871Y18400D01*
+X33217Y18666D01*
+X33539Y18961D01*
+X33834Y19283D01*
+X34100Y19629D01*
+X34334Y19998D01*
+X34389Y20109D01*
+X34536Y20385D01*
+X34703Y20788D01*
+X34834Y21205D01*
+X34929Y21631D01*
+X34986Y22064D01*
+X35005Y22500D01*
+X34986Y22936D01*
+X34929Y23369D01*
+X34834Y23795D01*
+X34703Y24212D01*
+X34536Y24615D01*
+X34334Y25002D01*
+X34100Y25371D01*
+X33834Y25717D01*
+X33539Y26039D01*
+X33217Y26334D01*
+X32871Y26600D01*
+X32502Y26834D01*
+X32115Y27036D01*
+X31712Y27203D01*
+X31295Y27334D01*
+X30869Y27429D01*
+X30436Y27486D01*
+X30002Y27505D01*
+Y35000D01*
+G37*
+G36*
+X13759D02*X30002D01*
+Y27505D01*
+X30000Y27505D01*
+X29564Y27486D01*
+X29131Y27429D01*
+X28705Y27334D01*
+X28288Y27203D01*
+X27885Y27036D01*
+X27498Y26834D01*
+X27172Y26614D01*
+X26886Y26343D01*
+X26647Y26031D01*
+X26459Y25685D01*
+X26328Y25314D01*
+X26256Y24927D01*
+X26249Y24666D01*
+X26026Y24529D01*
+X25727Y24273D01*
+X25471Y23974D01*
+X25266Y23638D01*
+X25115Y23275D01*
+X25023Y22892D01*
+X25000Y22500D01*
+X25014Y22064D01*
+X25071Y21631D01*
+X25166Y21205D01*
+X25297Y20788D01*
+X25464Y20385D01*
+X25666Y19998D01*
+X25900Y19629D01*
+X26166Y19283D01*
+X26461Y18961D01*
+X26783Y18666D01*
+X27129Y18400D01*
+X27498Y18166D01*
+X27885Y17964D01*
+X28288Y17797D01*
+X28705Y17666D01*
+X29131Y17571D01*
+X29564Y17514D01*
+X30000Y17495D01*
+X30002Y17495D01*
+Y2500D01*
+X13759D01*
+Y13849D01*
+X14865Y13391D01*
+X16114Y12997D01*
+X17393Y12714D01*
+X18691Y12543D01*
+X20000Y12486D01*
+X20394Y12514D01*
+X20778Y12606D01*
+X21143Y12757D01*
+X21480Y12963D01*
+X21780Y13220D01*
+X22036Y13520D01*
+X22243Y13857D01*
+X22394Y14222D01*
+X22486Y14606D01*
+X22517Y15000D01*
+X22486Y15394D01*
+X22394Y15778D01*
+X22243Y16143D01*
+X22036Y16480D01*
+X21780Y16780D01*
+X21480Y17037D01*
+X21143Y17243D01*
+X20778Y17394D01*
+X20394Y17486D01*
+X20000Y17510D01*
+X19128Y17538D01*
+X18264Y17652D01*
+X17412Y17841D01*
+X16580Y18103D01*
+X15774Y18437D01*
+X15000Y18840D01*
+X14264Y19308D01*
+X13759Y19696D01*
+Y35000D01*
+G37*
+G36*
+X2500D02*X13759D01*
+Y19696D01*
+X13572Y19840D01*
+X12929Y20429D01*
+X12340Y21072D01*
+X11808Y21764D01*
+X11340Y22500D01*
+X10937Y23274D01*
+X10603Y24080D01*
+X10341Y24912D01*
+X10152Y25764D01*
+X10038Y26628D01*
+X10000Y27500D01*
+X9977Y27892D01*
+X9885Y28275D01*
+X9734Y28638D01*
+X9529Y28974D01*
+X9273Y29273D01*
+X8974Y29529D01*
+X8638Y29734D01*
+X8275Y29885D01*
+X7892Y29977D01*
+X7500Y30008D01*
+X7108Y29977D01*
+X6725Y29885D01*
+X6362Y29734D01*
+X6026Y29529D01*
+X5727Y29273D01*
+X5471Y28974D01*
+X5266Y28638D01*
+X5115Y28275D01*
+X5023Y27892D01*
+X5000Y27500D01*
+X5043Y26191D01*
+X5214Y24893D01*
+X5497Y23614D01*
+X5891Y22365D01*
+X6392Y21155D01*
+X6997Y19993D01*
+X7701Y18888D01*
+X8498Y17849D01*
+X9383Y16883D01*
+X10349Y15998D01*
+X11388Y15201D01*
+X12493Y14497D01*
+X13655Y13892D01*
+X13759Y13849D01*
+Y2500D01*
+X2500D01*
+Y35000D01*
+G37*
+G54D12*X7500Y27500D02*G75*G03X20000Y15000I12500J0D01*G01*
+G54D13*X7652Y29236D02*G75*G02X17500Y37500I9848J-1736D01*G01*
+G54D12*X27500Y22500D02*G75*G03X32500Y22500I2500J0D01*G01*
+G75*G03X28750Y24665I-2500J0D01*G01*
+G54D14*X20725Y39246D02*G75*G02X36746Y31775I4275J-11746D01*G01*
+M02*
diff --git a/tests/RTT/ref/arc_f_clear.net b/tests/RTT/ref/arc_f_clear.net
new file mode 100644
index 0000000..7492f83
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Arc with clearline flag
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/arc_f_clear.png b/tests/RTT/ref/arc_f_clear.png
new file mode 100644
index 0000000..c9138f9
Binary files /dev/null and b/tests/RTT/ref/arc_f_clear.png differ
diff --git a/tests/RTT/ref/arc_f_clear.png.text b/tests/RTT/ref/arc_f_clear.png.text
new file mode 100644
index 0000000..6419c45
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.png.text
@@ -0,0 +1,24 @@
+
+polygone
+width 541 pixels
+height 391 pixels
+
+small near circle completely in polygon
+width 13 pixels
+clearance on the left 22 pixels
+clearance on the right 25 pixels
+clearance on the top 23 pixels
+clearance on the bottom 25 pixels
+
+longer arc completely in polygon
+line width 13 pixels
+width 163 pixels
+height 162 pixels
+clearance on the bottom right end 25 pixels
+clearance on the top right end 23 pixels
+clearance on the end right end 25 pixels
+clearance on the right top end 22 pixels
+clearance on the left top end 23 pixels
+
+
+
diff --git a/tests/RTT/ref/arc_f_clear.ps.gz b/tests/RTT/ref/arc_f_clear.ps.gz
new file mode 100644
index 0000000..eb5b870
Binary files /dev/null and b/tests/RTT/ref/arc_f_clear.ps.gz differ
diff --git a/tests/RTT/ref/arc_f_clear.remote.gz b/tests/RTT/ref/arc_f_clear.remote.gz
new file mode 100644
index 0000000..2a648da
Binary files /dev/null and b/tests/RTT/ref/arc_f_clear.remote.gz differ
diff --git a/tests/RTT/ref/arc_f_clear.svg b/tests/RTT/ref/arc_f_clear.svg
new file mode 100644
index 0000000..b15b3e2
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="7.6206,3.8100 12.0650,3.8100 12.0650,12.0650 7.6206,12.0650 7.6206,8.2562 7.7308,8.2514 7.8407,8.2369 7.9490,8.2129 8.0548,8.1795 8.1572,8.1371 8.2556,8.0859 8.3491,8.0263 8.4371,7.9588 8.5189,7.8839 8.5938,7.8021 8.6613,7.7141 8.7209,7.6206 8.7347,7.5922 8.7721,7.5222 8.8145,7.4198 8.8479,7.3140 8.8719,7.2057 8.8864,7.0958 8.8912,6.9850 8.8864,6.8742 8.8719,6.7643 8.8479,6.6560 8.8145,6.5502 8.7721,6.4478 8.7209,6.3494 8.6613,6.2559 8.5938,6.1679 8.5189,6.0861 8.4371,6 [...]
+ <polygon points="3.4947,3.8100 7.6206,3.8100 7.6206,5.7138 7.6200,5.7138 7.5092,5.7186 7.3993,5.7331 7.2910,5.7571 7.1852,5.7905 7.0828,5.8329 6.9844,5.8841 6.9016,5.9401 6.8291,6.0089 6.7683,6.0882 6.7206,6.1760 6.6872,6.2702 6.6690,6.3685 6.6673,6.4350 6.6106,6.4697 6.5346,6.5346 6.4697,6.6106 6.4175,6.6958 6.3792,6.7882 6.3559,6.8854 6.3500,6.9850 6.3536,7.0958 6.3681,7.2057 6.3921,7.3140 6.4255,7.4198 6.4679,7.5222 6.5191,7.6206 6.5787,7.7141 6.6462,7.8021 6.7211,7.8839 6.8029,7.958 [...]
+ <polygon points="0.6350,3.8100 3.4947,3.8100 3.4947,7.6971 3.4473,7.6608 3.2839,7.5111 3.1342,7.3477 2.9994,7.1719 2.8803,6.9850 2.7780,6.7885 2.6932,6.5837 2.6265,6.3724 2.5786,6.1561 2.5497,5.9364 2.5400,5.7150 2.5341,5.6154 2.5108,5.5182 2.4725,5.4258 2.4203,5.3406 2.3554,5.2646 2.2794,5.1997 2.1942,5.1475 2.1018,5.1092 2.0046,5.0859 1.9050,5.0780 1.8054,5.0859 1.7082,5.1092 1.6158,5.1475 1.5306,5.1997 1.4546,5.2646 1.3897,5.3406 1.3375,5.4258 1.2992,5.5182 1.2759,5.6154 1.2700,5.715 [...]
+ <path d="M 1.9050 5.7150 A 3.1750 3.1750 0 0 0 5.0800 8.8900" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 4.4450 3.1750 A 2.5400 2.5400 0 0 0 1.9436 5.2739" stroke-width="0.5080" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 6.9850 6.9850 A 0.6350 0.6350 0 0 0 7.3025 6.4351" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 9.3335 4.6291 A 3.1750 3.1750 0 0 0 5.2641 2.7315" stroke-width="0.7620" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/arc_f_clear.xy b/tests/RTT/ref/arc_f_clear.xy
new file mode 100644
index 0000000..3285ac2
--- /dev/null
+++ b/tests/RTT/ref/arc_f_clear.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Arc with clearline flag - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_normal.bom b/tests/RTT/ref/arc_normal.bom
new file mode 100644
index 0000000..6d407b9
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Arcs with different sizes, normal cases - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_normal.dsn b/tests/RTT/ref/arc_normal.dsn
new file mode 100644
index 0000000..bf8faf5
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.dsn
@@ -0,0 +1,57 @@
+(pcb Arcs with different sizes, normal cases
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/arc_normal.gbr/arc_normal.fab.gbr b/tests/RTT/ref/arc_normal.gbr/arc_normal.fab.gbr
new file mode 100644
index 0000000..091fb4b
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.gbr/arc_normal.fab.gbr
@@ -0,0 +1,1842 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Arcs with different sizes, normal cases, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD16C,0.0100*%
+%ADD15C,0.0001*%
+%ADD14C,0.0060*%
+G54D14*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D15*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D14*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D15*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D14*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D15*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D14*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D15*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D14*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D15*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D14*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D15*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D16*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D14*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D15*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D14*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D15*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D14*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D15*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D14*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D15*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D14*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D15*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D14*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D15*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D14*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D15*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D14*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D15*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D14*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D15*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D14*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D15*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D14*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D15*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D14*X234500Y108500D02*Y104000D01*
+Y108500D02*X235550Y110000D01*
+X237200D01*
+X238250Y108500D01*
+Y104000D01*
+X234500Y107000D02*X238250D01*
+G54D15*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X250850D02*Y104000D01*
+X255350D01*
+Y110000D01*
+X250850D01*
+G37*
+G36*
+X258950D02*Y104000D01*
+X263450D01*
+Y110000D01*
+X258950D01*
+G37*
+G36*
+X264350D02*Y104000D01*
+X268850D01*
+Y110000D01*
+X264350D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X275150D02*Y104000D01*
+X279650D01*
+Y110000D01*
+X275150D01*
+G37*
+G36*
+X283250D02*Y104000D01*
+X287750D01*
+Y110000D01*
+X283250D01*
+G37*
+G36*
+X288650D02*Y104000D01*
+X293150D01*
+Y110000D01*
+X288650D01*
+G37*
+G36*
+X294050D02*Y104000D01*
+X298550D01*
+Y110000D01*
+X294050D01*
+G37*
+G36*
+X299450D02*Y104000D01*
+X303950D01*
+Y110000D01*
+X299450D01*
+G37*
+G36*
+X304850D02*Y104000D01*
+X309350D01*
+Y110000D01*
+X304850D01*
+G37*
+G36*
+X310250D02*Y104000D01*
+X314750D01*
+Y110000D01*
+X310250D01*
+G37*
+G36*
+X315650D02*Y104000D01*
+X320150D01*
+Y110000D01*
+X315650D01*
+G37*
+G36*
+X321050D02*Y104000D01*
+X325550D01*
+Y110000D01*
+X321050D01*
+G37*
+G36*
+X326450D02*Y104000D01*
+X330950D01*
+Y110000D01*
+X326450D01*
+G37*
+G36*
+X334550D02*Y104000D01*
+X339050D01*
+Y110000D01*
+X334550D01*
+G37*
+G36*
+X339950D02*Y104000D01*
+X344450D01*
+Y110000D01*
+X339950D01*
+G37*
+G36*
+X345350D02*Y104000D01*
+X349850D01*
+Y110000D01*
+X345350D01*
+G37*
+G36*
+X350750D02*Y104000D01*
+X355250D01*
+Y110000D01*
+X350750D01*
+G37*
+G36*
+X356150D02*Y104000D01*
+X360650D01*
+Y110000D01*
+X356150D01*
+G37*
+G36*
+X361550D02*Y104000D01*
+X366050D01*
+Y110000D01*
+X361550D01*
+G37*
+G36*
+X369650D02*Y104000D01*
+X374150D01*
+Y110000D01*
+X369650D01*
+G37*
+G36*
+X375050D02*Y104000D01*
+X379550D01*
+Y110000D01*
+X375050D01*
+G37*
+G36*
+X380450D02*Y104000D01*
+X384950D01*
+Y110000D01*
+X380450D01*
+G37*
+G36*
+X385850D02*Y104000D01*
+X390350D01*
+Y110000D01*
+X385850D01*
+G37*
+G36*
+X391250D02*Y104000D01*
+X395750D01*
+Y110000D01*
+X391250D01*
+G37*
+G36*
+X396650D02*Y104000D01*
+X401150D01*
+Y110000D01*
+X396650D01*
+G37*
+G36*
+X404750D02*Y104000D01*
+X409250D01*
+Y110000D01*
+X404750D01*
+G37*
+G36*
+X410150D02*Y104000D01*
+X414650D01*
+Y110000D01*
+X410150D01*
+G37*
+G36*
+X415550D02*Y104000D01*
+X420050D01*
+Y110000D01*
+X415550D01*
+G37*
+G36*
+X420950D02*Y104000D01*
+X425450D01*
+Y110000D01*
+X420950D01*
+G37*
+G36*
+X426350D02*Y104000D01*
+X430850D01*
+Y110000D01*
+X426350D01*
+G37*
+G36*
+X434450D02*Y104000D01*
+X438950D01*
+Y110000D01*
+X434450D01*
+G37*
+G54D14*X442550D02*Y104000D01*
+Y110000D02*X445550D01*
+X442550Y107300D02*X444800D01*
+G54D15*G36*
+X447350Y110000D02*Y104000D01*
+X451850D01*
+Y110000D01*
+X447350D01*
+G37*
+G36*
+X452750D02*Y104000D01*
+X457250D01*
+Y110000D01*
+X452750D01*
+G37*
+G36*
+X458150D02*Y104000D01*
+X462650D01*
+Y110000D01*
+X458150D01*
+G37*
+G36*
+X463550D02*Y104000D01*
+X468050D01*
+Y110000D01*
+X463550D01*
+G37*
+G36*
+X468950D02*Y104000D01*
+X473450D01*
+Y110000D01*
+X468950D01*
+G37*
+G36*
+X474350D02*Y104000D01*
+X478850D01*
+Y110000D01*
+X474350D01*
+G37*
+G36*
+X479750D02*Y104000D01*
+X484250D01*
+Y110000D01*
+X479750D01*
+G37*
+G36*
+X485150D02*Y104000D01*
+X489650D01*
+Y110000D01*
+X485150D01*
+G37*
+G36*
+X490550D02*Y104000D01*
+X495050D01*
+Y110000D01*
+X490550D01*
+G37*
+G36*
+X495950D02*Y104000D01*
+X500450D01*
+Y110000D01*
+X495950D01*
+G37*
+G54D14*X504800D02*Y104000D01*
+X506750Y110000D02*X507800Y108950D01*
+Y105050D01*
+X506750Y104000D02*X507800Y105050D01*
+X504050Y104000D02*X506750D01*
+X504050Y110000D02*X506750D01*
+G54D15*G36*
+X509600D02*Y104000D01*
+X514100D01*
+Y110000D01*
+X509600D01*
+G37*
+G36*
+X515000D02*Y104000D01*
+X519500D01*
+Y110000D01*
+X515000D01*
+G37*
+G36*
+X520400D02*Y104000D01*
+X524900D01*
+Y110000D01*
+X520400D01*
+G37*
+G36*
+X525800D02*Y104000D01*
+X530300D01*
+Y110000D01*
+X525800D01*
+G37*
+G36*
+X531200D02*Y104000D01*
+X535700D01*
+Y110000D01*
+X531200D01*
+G37*
+G36*
+X536600D02*Y104000D01*
+X541100D01*
+Y110000D01*
+X536600D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/arc_normal.gbr/arc_normal.top.gbr b/tests/RTT/ref/arc_normal.gbr/arc_normal.top.gbr
new file mode 100644
index 0000000..85703bf
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.gbr/arc_normal.top.gbr
@@ -0,0 +1,20 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Arcs with different sizes, normal cases, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD13C,0.0300*%
+%ADD12C,0.0200*%
+%ADD11C,0.0100*%
+G54D11*X7500Y27500D02*G75*G03X20000Y15000I12500J0D01*G01*
+G54D12*X7652Y29236D02*G75*G02X17500Y37500I9848J-1736D01*G01*
+G54D11*X27500Y22500D02*G75*G03X32500Y22500I2500J0D01*G01*
+G75*G03X28750Y24665I-2500J0D01*G01*
+G54D13*X20725Y39246D02*G75*G02X36746Y31775I4275J-11746D01*G01*
+M02*
diff --git a/tests/RTT/ref/arc_normal.net b/tests/RTT/ref/arc_normal.net
new file mode 100644
index 0000000..6ca91a8
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Arcs with different sizes, normal cases
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/arc_normal.png b/tests/RTT/ref/arc_normal.png
new file mode 100644
index 0000000..136f1e2
Binary files /dev/null and b/tests/RTT/ref/arc_normal.png differ
diff --git a/tests/RTT/ref/arc_normal.png.text b/tests/RTT/ref/arc_normal.png.text
new file mode 100644
index 0000000..9be4650
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.png.text
@@ -0,0 +1,21 @@
+
+top left arc
+25 pixel line width
+124 pixels tall
+142 pixesl wide
+
+top right arc
+37 pixel line width
+227 pixels wide
+135 pixels tall
+
+lower left arc
+13 pixel line width
+162 pixels wide
+162 pixels tall
+
+lower right arc
+13 pixel line width
+72 pixels diameter
+
+
diff --git a/tests/RTT/ref/arc_normal.ps.gz b/tests/RTT/ref/arc_normal.ps.gz
new file mode 100644
index 0000000..b03593b
Binary files /dev/null and b/tests/RTT/ref/arc_normal.ps.gz differ
diff --git a/tests/RTT/ref/arc_normal.remote.gz b/tests/RTT/ref/arc_normal.remote.gz
new file mode 100644
index 0000000..0155ebf
Binary files /dev/null and b/tests/RTT/ref/arc_normal.remote.gz differ
diff --git a/tests/RTT/ref/arc_normal.svg b/tests/RTT/ref/arc_normal.svg
new file mode 100644
index 0000000..30b4af4
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <path d="M 1.9050 5.7150 A 3.1750 3.1750 0 0 0 5.0800 8.8900" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 4.4450 3.1750 A 2.5400 2.5400 0 0 0 1.9436 5.2739" stroke-width="0.5080" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 6.9850 6.9850 A 0.6350 0.6350 0 0 0 7.3025 6.4351" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 9.3335 4.6291 A 3.1750 3.1750 0 0 0 5.2641 2.7315" stroke-width="0.7620" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/arc_normal.xy b/tests/RTT/ref/arc_normal.xy
new file mode 100644
index 0000000..dc6b4db
--- /dev/null
+++ b/tests/RTT/ref/arc_normal.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Arcs with different sizes, normal cases - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_offpage.bom b/tests/RTT/ref/arc_offpage.bom
new file mode 100644
index 0000000..6247d33
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Arcs with some parts off the page - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_offpage.dsn b/tests/RTT/ref/arc_offpage.dsn
new file mode 100644
index 0000000..343c8fb
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.dsn
@@ -0,0 +1,57 @@
+(pcb Arcs with some parts off the page
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/arc_offpage.gbr/arc_offpage.fab.gbr b/tests/RTT/ref/arc_offpage.gbr/arc_offpage.fab.gbr
new file mode 100644
index 0000000..c6cf0d0
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.gbr/arc_offpage.fab.gbr
@@ -0,0 +1,1800 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Arcs with some parts off the page, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500Y108500D02*Y104000D01*
+Y108500D02*X235550Y110000D01*
+X237200D01*
+X238250Y108500D01*
+Y104000D01*
+X234500Y107000D02*X238250D01*
+G54D13*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X250850D02*Y104000D01*
+X255350D01*
+Y110000D01*
+X250850D01*
+G37*
+G36*
+X258950D02*Y104000D01*
+X263450D01*
+Y110000D01*
+X258950D01*
+G37*
+G36*
+X264350D02*Y104000D01*
+X268850D01*
+Y110000D01*
+X264350D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X275150D02*Y104000D01*
+X279650D01*
+Y110000D01*
+X275150D01*
+G37*
+G36*
+X283250D02*Y104000D01*
+X287750D01*
+Y110000D01*
+X283250D01*
+G37*
+G36*
+X288650D02*Y104000D01*
+X293150D01*
+Y110000D01*
+X288650D01*
+G37*
+G36*
+X294050D02*Y104000D01*
+X298550D01*
+Y110000D01*
+X294050D01*
+G37*
+G36*
+X299450D02*Y104000D01*
+X303950D01*
+Y110000D01*
+X299450D01*
+G37*
+G36*
+X307550D02*Y104000D01*
+X312050D01*
+Y110000D01*
+X307550D01*
+G37*
+G36*
+X312950D02*Y104000D01*
+X317450D01*
+Y110000D01*
+X312950D01*
+G37*
+G36*
+X318350D02*Y104000D01*
+X322850D01*
+Y110000D01*
+X318350D01*
+G37*
+G36*
+X323750D02*Y104000D01*
+X328250D01*
+Y110000D01*
+X323750D01*
+G37*
+G36*
+X329150D02*Y104000D01*
+X333650D01*
+Y110000D01*
+X329150D01*
+G37*
+G36*
+X337250D02*Y104000D01*
+X341750D01*
+Y110000D01*
+X337250D01*
+G37*
+G36*
+X342650D02*Y104000D01*
+X347150D01*
+Y110000D01*
+X342650D01*
+G37*
+G36*
+X348050D02*Y104000D01*
+X352550D01*
+Y110000D01*
+X348050D01*
+G37*
+G36*
+X356150D02*Y104000D01*
+X360650D01*
+Y110000D01*
+X356150D01*
+G37*
+G36*
+X361550D02*Y104000D01*
+X366050D01*
+Y110000D01*
+X361550D01*
+G37*
+G36*
+X366950D02*Y104000D01*
+X371450D01*
+Y110000D01*
+X366950D01*
+G37*
+G36*
+X375050D02*Y104000D01*
+X379550D01*
+Y110000D01*
+X375050D01*
+G37*
+G36*
+X380450D02*Y104000D01*
+X384950D01*
+Y110000D01*
+X380450D01*
+G37*
+G36*
+X385850D02*Y104000D01*
+X390350D01*
+Y110000D01*
+X385850D01*
+G37*
+G36*
+X391250D02*Y104000D01*
+X395750D01*
+Y110000D01*
+X391250D01*
+G37*
+G36*
+X399350D02*Y104000D01*
+X403850D01*
+Y110000D01*
+X399350D01*
+G37*
+G54D12*X407450D02*Y104000D01*
+Y110000D02*X410450D01*
+X407450Y107300D02*X409700D01*
+G54D13*G36*
+X412250Y110000D02*Y104000D01*
+X416750D01*
+Y110000D01*
+X412250D01*
+G37*
+G36*
+X417650D02*Y104000D01*
+X422150D01*
+Y110000D01*
+X417650D01*
+G37*
+G36*
+X423050D02*Y104000D01*
+X427550D01*
+Y110000D01*
+X423050D01*
+G37*
+G36*
+X428450D02*Y104000D01*
+X432950D01*
+Y110000D01*
+X428450D01*
+G37*
+G36*
+X433850D02*Y104000D01*
+X438350D01*
+Y110000D01*
+X433850D01*
+G37*
+G36*
+X439250D02*Y104000D01*
+X443750D01*
+Y110000D01*
+X439250D01*
+G37*
+G36*
+X444650D02*Y104000D01*
+X449150D01*
+Y110000D01*
+X444650D01*
+G37*
+G36*
+X450050D02*Y104000D01*
+X454550D01*
+Y110000D01*
+X450050D01*
+G37*
+G36*
+X455450D02*Y104000D01*
+X459950D01*
+Y110000D01*
+X455450D01*
+G37*
+G36*
+X460850D02*Y104000D01*
+X465350D01*
+Y110000D01*
+X460850D01*
+G37*
+G54D12*X469700D02*Y104000D01*
+X471650Y110000D02*X472700Y108950D01*
+Y105050D01*
+X471650Y104000D02*X472700Y105050D01*
+X468950Y104000D02*X471650D01*
+X468950Y110000D02*X471650D01*
+G54D13*G36*
+X474500D02*Y104000D01*
+X479000D01*
+Y110000D01*
+X474500D01*
+G37*
+G36*
+X479900D02*Y104000D01*
+X484400D01*
+Y110000D01*
+X479900D01*
+G37*
+G36*
+X485300D02*Y104000D01*
+X489800D01*
+Y110000D01*
+X485300D01*
+G37*
+G36*
+X490700D02*Y104000D01*
+X495200D01*
+Y110000D01*
+X490700D01*
+G37*
+G36*
+X496100D02*Y104000D01*
+X500600D01*
+Y110000D01*
+X496100D01*
+G37*
+G36*
+X501500D02*Y104000D01*
+X506000D01*
+Y110000D01*
+X501500D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/arc_offpage.gbr/arc_offpage.top.gbr b/tests/RTT/ref/arc_offpage.gbr/arc_offpage.top.gbr
new file mode 100644
index 0000000..954dabe
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.gbr/arc_offpage.top.gbr
@@ -0,0 +1,15 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Arcs with some parts off the page, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0100*%
+G54D11*X-5000Y45000D02*G75*G03X15000Y45000I10000J0D01*G01*
+Y45000D02*G75*G03X11428Y52660I-10000J0D01*G01*
+M02*
diff --git a/tests/RTT/ref/arc_offpage.net b/tests/RTT/ref/arc_offpage.net
new file mode 100644
index 0000000..3809a87
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Arcs with some parts off the page
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/arc_offpage.png b/tests/RTT/ref/arc_offpage.png
new file mode 100644
index 0000000..ec9272a
Binary files /dev/null and b/tests/RTT/ref/arc_offpage.png differ
diff --git a/tests/RTT/ref/arc_offpage.png.text b/tests/RTT/ref/arc_offpage.png.text
new file mode 100644
index 0000000..beda1c2
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.png.text
@@ -0,0 +1,6 @@
+
+arc
+13 pixel line width
+185 pixels tall
+185 pixels wide
+
diff --git a/tests/RTT/ref/arc_offpage.ps.gz b/tests/RTT/ref/arc_offpage.ps.gz
new file mode 100644
index 0000000..ed38e15
Binary files /dev/null and b/tests/RTT/ref/arc_offpage.ps.gz differ
diff --git a/tests/RTT/ref/arc_offpage.remote.gz b/tests/RTT/ref/arc_offpage.remote.gz
new file mode 100644
index 0000000..7afd43c
Binary files /dev/null and b/tests/RTT/ref/arc_offpage.remote.gz differ
diff --git a/tests/RTT/ref/arc_offpage.svg b/tests/RTT/ref/arc_offpage.svg
new file mode 100644
index 0000000..ed87196
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <path d="M -1.2700 1.2700 A 2.5400 2.5400 0 0 0 2.9027 -0.6758" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/arc_offpage.xy b/tests/RTT/ref/arc_offpage.xy
new file mode 100644
index 0000000..557fb78
--- /dev/null
+++ b/tests/RTT/ref/arc_offpage.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Arcs with some parts off the page - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_sizes.bom b/tests/RTT/ref/arc_sizes.bom
new file mode 100644
index 0000000..e2fab72
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: arcs with different strange sizes - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/arc_sizes.dsn b/tests/RTT/ref/arc_sizes.dsn
new file mode 100644
index 0000000..8022e27
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.dsn
@@ -0,0 +1,57 @@
+(pcb arcs with different strange sizes
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/arc_sizes.gbr/arc_sizes.fab.gbr b/tests/RTT/ref/arc_sizes.gbr/arc_sizes.fab.gbr
new file mode 100644
index 0000000..98e1d58
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.gbr/arc_sizes.fab.gbr
@@ -0,0 +1,1812 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: arcs with different strange sizes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X283100D02*Y104000D01*
+X287600D01*
+Y110000D01*
+X283100D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X366800D02*Y104000D01*
+X371300D01*
+Y110000D01*
+X366800D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G36*
+X396500D02*Y104000D01*
+X401000D01*
+Y110000D01*
+X396500D01*
+G37*
+G36*
+X404600D02*Y104000D01*
+X409100D01*
+Y110000D01*
+X404600D01*
+G37*
+G54D12*X412700D02*Y104000D01*
+Y110000D02*X415700D01*
+X412700Y107300D02*X414950D01*
+G54D13*G36*
+X417500Y110000D02*Y104000D01*
+X422000D01*
+Y110000D01*
+X417500D01*
+G37*
+G36*
+X422900D02*Y104000D01*
+X427400D01*
+Y110000D01*
+X422900D01*
+G37*
+G36*
+X428300D02*Y104000D01*
+X432800D01*
+Y110000D01*
+X428300D01*
+G37*
+G36*
+X433700D02*Y104000D01*
+X438200D01*
+Y110000D01*
+X433700D01*
+G37*
+G36*
+X439100D02*Y104000D01*
+X443600D01*
+Y110000D01*
+X439100D01*
+G37*
+G36*
+X444500D02*Y104000D01*
+X449000D01*
+Y110000D01*
+X444500D01*
+G37*
+G36*
+X449900D02*Y104000D01*
+X454400D01*
+Y110000D01*
+X449900D01*
+G37*
+G36*
+X455300D02*Y104000D01*
+X459800D01*
+Y110000D01*
+X455300D01*
+G37*
+G36*
+X460700D02*Y104000D01*
+X465200D01*
+Y110000D01*
+X460700D01*
+G37*
+G36*
+X466100D02*Y104000D01*
+X470600D01*
+Y110000D01*
+X466100D01*
+G37*
+G54D12*X474950D02*Y104000D01*
+X476900Y110000D02*X477950Y108950D01*
+Y105050D01*
+X476900Y104000D02*X477950Y105050D01*
+X474200Y104000D02*X476900D01*
+X474200Y110000D02*X476900D01*
+G54D13*G36*
+X479750D02*Y104000D01*
+X484250D01*
+Y110000D01*
+X479750D01*
+G37*
+G36*
+X485150D02*Y104000D01*
+X489650D01*
+Y110000D01*
+X485150D01*
+G37*
+G36*
+X490550D02*Y104000D01*
+X495050D01*
+Y110000D01*
+X490550D01*
+G37*
+G36*
+X495950D02*Y104000D01*
+X500450D01*
+Y110000D01*
+X495950D01*
+G37*
+G36*
+X501350D02*Y104000D01*
+X505850D01*
+Y110000D01*
+X501350D01*
+G37*
+G36*
+X506750D02*Y104000D01*
+X511250D01*
+Y110000D01*
+X506750D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/arc_sizes.gbr/arc_sizes.top.gbr b/tests/RTT/ref/arc_sizes.gbr/arc_sizes.top.gbr
new file mode 100644
index 0000000..91d7ecc
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.gbr/arc_sizes.top.gbr
@@ -0,0 +1,52 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: arcs with different strange sizes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0100*%
+G54D11*X10000Y30000D02*Y29587D01*
+Y29177D01*
+Y28773D01*
+Y28377D01*
+Y27992D01*
+Y27620D01*
+Y27265D01*
+Y26929D01*
+Y26614D01*
+Y26321D01*
+Y26054D01*
+Y25814D01*
+Y25603D01*
+Y25421D01*
+Y25271D01*
+Y25153D01*
+Y25068D01*
+Y25017D01*
+Y25000D01*
+X15000Y30000D02*X15017D01*
+X15068D01*
+X15153D01*
+X15271D01*
+X15421D01*
+X15603D01*
+X15814D01*
+X16054D01*
+X16321D01*
+X16614D01*
+X16929D01*
+X17265D01*
+X17620D01*
+X17992D01*
+X18376D01*
+X18773D01*
+X19177D01*
+X19587D01*
+X20000D01*
+X30000D02*G75*G03X30000Y30000I0J0D01*G01*
+M02*
diff --git a/tests/RTT/ref/arc_sizes.net b/tests/RTT/ref/arc_sizes.net
new file mode 100644
index 0000000..1e6ad0c
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB arcs with different strange sizes
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/arc_sizes.png b/tests/RTT/ref/arc_sizes.png
new file mode 100644
index 0000000..91cf8cf
Binary files /dev/null and b/tests/RTT/ref/arc_sizes.png differ
diff --git a/tests/RTT/ref/arc_sizes.png.text b/tests/RTT/ref/arc_sizes.png.text
new file mode 100644
index 0000000..9784a77
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.png.text
@@ -0,0 +1,17 @@
+
+weird dot thing in the far right
+12 pixels across
+12 pixels tall
+
+weird dot to line (horizontal) 108 pixels
+
+horizontal line
+72 pixels long
+12 pixels wide
+
+vertical line
+72 pixels long
+12 pixels wide
+
+
+
diff --git a/tests/RTT/ref/arc_sizes.ps.gz b/tests/RTT/ref/arc_sizes.ps.gz
new file mode 100644
index 0000000..7a4b4a8
Binary files /dev/null and b/tests/RTT/ref/arc_sizes.ps.gz differ
diff --git a/tests/RTT/ref/arc_sizes.remote.gz b/tests/RTT/ref/arc_sizes.remote.gz
new file mode 100644
index 0000000..2a87e4c
Binary files /dev/null and b/tests/RTT/ref/arc_sizes.remote.gz differ
diff --git a/tests/RTT/ref/arc_sizes.svg b/tests/RTT/ref/arc_sizes.svg
new file mode 100644
index 0000000..538fb37
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <path d="M 2.5400 5.0800 A 0.0000 0.0000 0 0 0 2.5400 5.0800" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 3.8100 5.0800 A 1.2700 1.2700 0 0 0 5.0800 6.3500" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+ <path d="M 7.6200 5.0800 A 0.0000 0.0000 0 0 0 7.6200 5.0800" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/arc_sizes.xy b/tests/RTT/ref/arc_sizes.xy
new file mode 100644
index 0000000..eaafcbe
--- /dev/null
+++ b/tests/RTT/ref/arc_sizes.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: arcs with different strange sizes - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/clearance.bom b/tests/RTT/ref/clearance.bom
new file mode 100644
index 0000000..7a38186
--- /dev/null
+++ b/tests/RTT/ref/clearance.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: (unknown) - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/clearance.dsn b/tests/RTT/ref/clearance.dsn
new file mode 100644
index 0000000..c0a79a3
--- /dev/null
+++ b/tests/RTT/ref/clearance.dsn
@@ -0,0 +1,59 @@
+(pcb notnamed
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.254000 5.999988 2.700020 5.999988 9.700006)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/clearance.gbr/clearance.fab.gbr b/tests/RTT/ref/clearance.gbr/clearance.fab.gbr
new file mode 100644
index 0000000..4093e31
--- /dev/null
+++ b/tests/RTT/ref/clearance.gbr/clearance.fab.gbr
@@ -0,0 +1,1692 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: (unknown), TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD15C,0.0100*%
+%ADD14C,0.0001*%
+%ADD13C,0.0060*%
+G54D13*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D14*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D13*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D14*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D13*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D14*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D13*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D14*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D13*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D14*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D13*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D14*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D15*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D13*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D14*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D13*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D14*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D13*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D14*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D13*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D14*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D13*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D14*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D13*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D14*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D13*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D14*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D13*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D14*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D13*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D14*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D13*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D14*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D13*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D14*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X272300D02*Y104000D01*
+X276800D01*
+Y110000D01*
+X272300D01*
+G37*
+G36*
+X277700D02*Y104000D01*
+X282200D01*
+Y110000D01*
+X277700D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G54D13*X293900D02*Y104000D01*
+Y110000D02*X296900D01*
+X293900Y107300D02*X296150D01*
+G54D14*G36*
+X298700Y110000D02*Y104000D01*
+X303200D01*
+Y110000D01*
+X298700D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X320300D02*Y104000D01*
+X324800D01*
+Y110000D01*
+X320300D01*
+G37*
+G36*
+X325700D02*Y104000D01*
+X330200D01*
+Y110000D01*
+X325700D01*
+G37*
+G36*
+X331100D02*Y104000D01*
+X335600D01*
+Y110000D01*
+X331100D01*
+G37*
+G36*
+X336500D02*Y104000D01*
+X341000D01*
+Y110000D01*
+X336500D01*
+G37*
+G36*
+X341900D02*Y104000D01*
+X346400D01*
+Y110000D01*
+X341900D01*
+G37*
+G36*
+X347300D02*Y104000D01*
+X351800D01*
+Y110000D01*
+X347300D01*
+G37*
+G54D13*X356150D02*Y104000D01*
+X358100Y110000D02*X359150Y108950D01*
+Y105050D01*
+X358100Y104000D02*X359150Y105050D01*
+X355400Y104000D02*X358100D01*
+X355400Y110000D02*X358100D01*
+G54D14*G36*
+X360950D02*Y104000D01*
+X365450D01*
+Y110000D01*
+X360950D01*
+G37*
+G36*
+X366350D02*Y104000D01*
+X370850D01*
+Y110000D01*
+X366350D01*
+G37*
+G36*
+X371750D02*Y104000D01*
+X376250D01*
+Y110000D01*
+X371750D01*
+G37*
+G36*
+X377150D02*Y104000D01*
+X381650D01*
+Y110000D01*
+X377150D01*
+G37*
+G36*
+X382550D02*Y104000D01*
+X387050D01*
+Y110000D01*
+X382550D01*
+G37*
+G36*
+X387950D02*Y104000D01*
+X392450D01*
+Y110000D01*
+X387950D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/clearance.gbr/clearance.top.gbr b/tests/RTT/ref/clearance.gbr/clearance.top.gbr
new file mode 100644
index 0000000..b81b588
--- /dev/null
+++ b/tests/RTT/ref/clearance.gbr/clearance.top.gbr
@@ -0,0 +1,44 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: (unknown), TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD12C,0.0100*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X3937Y46063D02*X47244D01*
+Y22441D01*
+X26122D01*
+Y38189D01*
+X26099Y38581D01*
+X26007Y38964D01*
+X25856Y39327D01*
+X25651Y39663D01*
+X25395Y39962D01*
+X25096Y40218D01*
+X24760Y40423D01*
+X24397Y40574D01*
+X24014Y40666D01*
+X23622Y40697D01*
+X23230Y40666D01*
+X22847Y40574D01*
+X22484Y40423D01*
+X22148Y40218D01*
+X21849Y39962D01*
+X21593Y39663D01*
+X21388Y39327D01*
+X21237Y38964D01*
+X21145Y38581D01*
+X21122Y38189D01*
+Y22441D01*
+X3937D01*
+Y46063D01*
+G37*
+G54D12*X23622Y10630D02*Y38189D01*
+M02*
diff --git a/tests/RTT/ref/clearance.net b/tests/RTT/ref/clearance.net
new file mode 100644
index 0000000..f630b8f
--- /dev/null
+++ b/tests/RTT/ref/clearance.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB clearance.pcb
+P CODE 00
+P UNITS CUST 1
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/clearance.png b/tests/RTT/ref/clearance.png
new file mode 100644
index 0000000..0a01467
Binary files /dev/null and b/tests/RTT/ref/clearance.png differ
diff --git a/tests/RTT/ref/clearance.png.text b/tests/RTT/ref/clearance.png.text
new file mode 100644
index 0000000..9564e67
--- /dev/null
+++ b/tests/RTT/ref/clearance.png.text
@@ -0,0 +1,11 @@
+
+line
+width 12 pixels
+clearance 23 pixels
+length 343 pixels
+
+polygon
+width 520 pixels
+height 284 pixels
+
+
diff --git a/tests/RTT/ref/clearance.ps.gz b/tests/RTT/ref/clearance.ps.gz
new file mode 100644
index 0000000..07339b2
Binary files /dev/null and b/tests/RTT/ref/clearance.ps.gz differ
diff --git a/tests/RTT/ref/clearance.remote.gz b/tests/RTT/ref/clearance.remote.gz
new file mode 100644
index 0000000..f312172
Binary files /dev/null and b/tests/RTT/ref/clearance.remote.gz differ
diff --git a/tests/RTT/ref/clearance.svg b/tests/RTT/ref/clearance.svg
new file mode 100644
index 0000000..754da76
--- /dev/null
+++ b/tests/RTT/ref/clearance.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="1.0000,1.0000 12.0000,1.0000 12.0000,7.0000 6.6350,7.0000 6.6350,3.0000 6.6291,2.9004 6.6058,2.8032 6.5675,2.7108 6.5153,2.6256 6.4504,2.5496 6.3744,2.4847 6.2892,2.4325 6.1968,2.3942 6.0996,2.3709 6.0000,2.3630 5.9003,2.3709 5.8032,2.3942 5.7108,2.4325 5.6256,2.4847 5.5496,2.5496 5.4847,2.6256 5.4325,2.7108 5.3942,2.8032 5.3709,2.9004 5.3650,3.0000 5.3650,7.0000 1.0000,7.0000 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <line x1="6.0000" y1="10.0000" x2="6.0000" y2="3.0000" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/clearance.xy b/tests/RTT/ref/clearance.xy
new file mode 100644
index 0000000..75e7d9e
--- /dev/null
+++ b/tests/RTT/ref/clearance.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: (unknown) - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mm. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/coord_rounding.bom b/tests/RTT/ref/coord_rounding.bom
new file mode 100644
index 0000000..fca1e46
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: odd coordinates to check rounding errors - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/coord_rounding.dsn b/tests/RTT/ref/coord_rounding.dsn
new file mode 100644
index 0000000..1aaacd8
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.dsn
@@ -0,0 +1,61 @@
+(pcb odd coordinates to check rounding errors
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 1.000000 6.000000 6.600000 6.110000 6.589000)
+ (type protect))
+ (wire (path comp1 1.000000 6.111100 6.588890 6.111111 6.589000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/coord_rounding.gbr/coord_rounding.fab.gbr b/tests/RTT/ref/coord_rounding.gbr/coord_rounding.fab.gbr
new file mode 100644
index 0000000..393f7ca
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.gbr/coord_rounding.fab.gbr
@@ -0,0 +1,1848 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: odd coordinates to check rounding errors, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X253400D02*Y104000D01*
+X257900D01*
+Y110000D01*
+X253400D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X296600D02*Y104000D01*
+X301100D01*
+Y110000D01*
+X296600D01*
+G37*
+G36*
+X302000D02*Y104000D01*
+X306500D01*
+Y110000D01*
+X302000D01*
+G37*
+G36*
+X307400D02*Y104000D01*
+X311900D01*
+Y110000D01*
+X307400D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X329000D02*Y104000D01*
+X333500D01*
+Y110000D01*
+X329000D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X358700D02*Y104000D01*
+X363200D01*
+Y110000D01*
+X358700D01*
+G37*
+G36*
+X364100D02*Y104000D01*
+X368600D01*
+Y110000D01*
+X364100D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G36*
+X396500D02*Y104000D01*
+X401000D01*
+Y110000D01*
+X396500D01*
+G37*
+G36*
+X404600D02*Y104000D01*
+X409100D01*
+Y110000D01*
+X404600D01*
+G37*
+G36*
+X410000D02*Y104000D01*
+X414500D01*
+Y110000D01*
+X410000D01*
+G37*
+G36*
+X415400D02*Y104000D01*
+X419900D01*
+Y110000D01*
+X415400D01*
+G37*
+G36*
+X420800D02*Y104000D01*
+X425300D01*
+Y110000D01*
+X420800D01*
+G37*
+G36*
+X426200D02*Y104000D01*
+X430700D01*
+Y110000D01*
+X426200D01*
+G37*
+G36*
+X431600D02*Y104000D01*
+X436100D01*
+Y110000D01*
+X431600D01*
+G37*
+G36*
+X439700D02*Y104000D01*
+X444200D01*
+Y110000D01*
+X439700D01*
+G37*
+G54D12*X447800D02*Y104000D01*
+Y110000D02*X450800D01*
+X447800Y107300D02*X450050D01*
+G54D13*G36*
+X452600Y110000D02*Y104000D01*
+X457100D01*
+Y110000D01*
+X452600D01*
+G37*
+G36*
+X458000D02*Y104000D01*
+X462500D01*
+Y110000D01*
+X458000D01*
+G37*
+G36*
+X463400D02*Y104000D01*
+X467900D01*
+Y110000D01*
+X463400D01*
+G37*
+G36*
+X468800D02*Y104000D01*
+X473300D01*
+Y110000D01*
+X468800D01*
+G37*
+G36*
+X474200D02*Y104000D01*
+X478700D01*
+Y110000D01*
+X474200D01*
+G37*
+G36*
+X479600D02*Y104000D01*
+X484100D01*
+Y110000D01*
+X479600D01*
+G37*
+G36*
+X485000D02*Y104000D01*
+X489500D01*
+Y110000D01*
+X485000D01*
+G37*
+G36*
+X490400D02*Y104000D01*
+X494900D01*
+Y110000D01*
+X490400D01*
+G37*
+G36*
+X495800D02*Y104000D01*
+X500300D01*
+Y110000D01*
+X495800D01*
+G37*
+G36*
+X501200D02*Y104000D01*
+X505700D01*
+Y110000D01*
+X501200D01*
+G37*
+G54D12*X510050D02*Y104000D01*
+X512000Y110000D02*X513050Y108950D01*
+Y105050D01*
+X512000Y104000D02*X513050Y105050D01*
+X509300Y104000D02*X512000D01*
+X509300Y110000D02*X512000D01*
+G54D13*G36*
+X514850D02*Y104000D01*
+X519350D01*
+Y110000D01*
+X514850D01*
+G37*
+G36*
+X520250D02*Y104000D01*
+X524750D01*
+Y110000D01*
+X520250D01*
+G37*
+G36*
+X525650D02*Y104000D01*
+X530150D01*
+Y110000D01*
+X525650D01*
+G37*
+G36*
+X531050D02*Y104000D01*
+X535550D01*
+Y110000D01*
+X531050D01*
+G37*
+G36*
+X536450D02*Y104000D01*
+X540950D01*
+Y110000D01*
+X536450D01*
+G37*
+G36*
+X541850D02*Y104000D01*
+X546350D01*
+Y110000D01*
+X541850D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/coord_rounding.gbr/coord_rounding.top.gbr b/tests/RTT/ref/coord_rounding.gbr/coord_rounding.top.gbr
new file mode 100644
index 0000000..163e457
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.gbr/coord_rounding.top.gbr
@@ -0,0 +1,15 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: odd coordinates to check rounding errors, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0394*%
+G54D11*X23622Y25984D02*X24055Y25941D01*
+X24059Y25941D02*X24059Y25941D01*
+M02*
diff --git a/tests/RTT/ref/coord_rounding.net b/tests/RTT/ref/coord_rounding.net
new file mode 100644
index 0000000..8a4167e
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB odd coordinates to check rounding errors
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/coord_rounding.png b/tests/RTT/ref/coord_rounding.png
new file mode 100644
index 0000000..1d1103b
Binary files /dev/null and b/tests/RTT/ref/coord_rounding.png differ
diff --git a/tests/RTT/ref/coord_rounding.png.text b/tests/RTT/ref/coord_rounding.png.text
new file mode 100644
index 0000000..a898d6f
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.png.text
@@ -0,0 +1,5 @@
+
+weird dot thing
+47 pixels tall
+52 pixels wide
+
diff --git a/tests/RTT/ref/coord_rounding.ps.gz b/tests/RTT/ref/coord_rounding.ps.gz
new file mode 100644
index 0000000..7e5469f
Binary files /dev/null and b/tests/RTT/ref/coord_rounding.ps.gz differ
diff --git a/tests/RTT/ref/coord_rounding.remote.gz b/tests/RTT/ref/coord_rounding.remote.gz
new file mode 100644
index 0000000..1f5118c
Binary files /dev/null and b/tests/RTT/ref/coord_rounding.remote.gz differ
diff --git a/tests/RTT/ref/coord_rounding.svg b/tests/RTT/ref/coord_rounding.svg
new file mode 100644
index 0000000..0cd0131
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="6.0000" y1="6.1000" x2="6.1100" y2="6.1110" stroke-width="1.0000" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.1111" y1="6.1111" x2="6.1111" y2="6.1110" stroke-width="1.0000" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/coord_rounding.xy b/tests/RTT/ref/coord_rounding.xy
new file mode 100644
index 0000000..2cb69b3
--- /dev/null
+++ b/tests/RTT/ref/coord_rounding.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: odd coordinates to check rounding errors - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/elem_pads.bom b/tests/RTT/ref/elem_pads.bom
new file mode 100644
index 0000000..abed9fa
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.bom
@@ -0,0 +1,9 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: pads with different geometry - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+1,"Standard SMT resistor, capacitor etc","1206",R1
+1,"SMT transistor, 5 pins","SOT325",U1
diff --git a/tests/RTT/ref/elem_pads.dsn b/tests/RTT/ref/elem_pads.dsn
new file mode 100644
index 0000000..67edab4
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.dsn
@@ -0,0 +1,82 @@
+(pcb pads with different geometry
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "R1" 6.350000 10.160000 front 0 (PN 0))
+ )
+ (component 16
+ (place "U1" 6.339840 4.241800 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Smd_rect_1299972x1899920 "1" -1.499870 0.000000)
+ (pin Smd_rect_1299972x1899920 "2" 1.499870 0.000000)
+ )
+ (image 16
+ (pin Smd_rect_381000x889000 "1" -0.650240 -1.066800)
+ (pin Smd_rect_381000x889000 "2" 0.645160 -1.066800)
+ (pin Smd_rect_381000x889000 "3" 0.645160 0.711200)
+ (pin Smd_rect_381000x889000 "4" 0.010160 0.711200)
+ (pin Smd_rect_381000x889000 "5" -0.650240 0.711200)
+ )
+ (padstack Smd_rect_1299972x1899920
+ (shape (rect "comp1" -0.649986 -0.949960 0.649986 0.949960))
+ (attach off)
+ )
+ (padstack Smd_rect_381000x889000
+ (shape (rect "comp1" -0.190500 -0.444500 0.190500 0.444500))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/elem_pads.gbr/elem_pads.fab.gbr b/tests/RTT/ref/elem_pads.gbr/elem_pads.fab.gbr
new file mode 100644
index 0000000..07a6efb
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.gbr/elem_pads.fab.gbr
@@ -0,0 +1,1788 @@
+G04 start of page 6 for group -1 layer_idx -1 *
+G04 Title: pads with different geometry, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD22C,0.0100*%
+%ADD21C,0.0001*%
+%ADD20C,0.0060*%
+G54D20*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D21*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D20*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D21*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D20*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D21*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D20*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D21*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D20*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D21*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D20*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D21*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D22*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D20*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D21*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D20*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D21*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D20*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D21*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D20*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D21*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D20*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D21*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D20*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D21*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D20*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D21*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D20*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D21*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D20*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D21*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D20*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D21*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D20*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D21*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X283100D02*Y104000D01*
+X287600D01*
+Y110000D01*
+X283100D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X366800D02*Y104000D01*
+X371300D01*
+Y110000D01*
+X366800D01*
+G37*
+G36*
+X372200D02*Y104000D01*
+X376700D01*
+Y110000D01*
+X372200D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G54D20*X388400D02*Y104000D01*
+Y110000D02*X391400D01*
+X388400Y107300D02*X390650D01*
+G54D21*G36*
+X393200Y110000D02*Y104000D01*
+X397700D01*
+Y110000D01*
+X393200D01*
+G37*
+G36*
+X398600D02*Y104000D01*
+X403100D01*
+Y110000D01*
+X398600D01*
+G37*
+G36*
+X404000D02*Y104000D01*
+X408500D01*
+Y110000D01*
+X404000D01*
+G37*
+G36*
+X409400D02*Y104000D01*
+X413900D01*
+Y110000D01*
+X409400D01*
+G37*
+G36*
+X414800D02*Y104000D01*
+X419300D01*
+Y110000D01*
+X414800D01*
+G37*
+G36*
+X420200D02*Y104000D01*
+X424700D01*
+Y110000D01*
+X420200D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G36*
+X436400D02*Y104000D01*
+X440900D01*
+Y110000D01*
+X436400D01*
+G37*
+G36*
+X441800D02*Y104000D01*
+X446300D01*
+Y110000D01*
+X441800D01*
+G37*
+G54D20*X450650D02*Y104000D01*
+X452600Y110000D02*X453650Y108950D01*
+Y105050D01*
+X452600Y104000D02*X453650Y105050D01*
+X449900Y104000D02*X452600D01*
+X449900Y110000D02*X452600D01*
+G54D21*G36*
+X455450D02*Y104000D01*
+X459950D01*
+Y110000D01*
+X455450D01*
+G37*
+G36*
+X460850D02*Y104000D01*
+X465350D01*
+Y110000D01*
+X460850D01*
+G37*
+G36*
+X466250D02*Y104000D01*
+X470750D01*
+Y110000D01*
+X466250D01*
+G37*
+G36*
+X471650D02*Y104000D01*
+X476150D01*
+Y110000D01*
+X471650D01*
+G37*
+G36*
+X477050D02*Y104000D01*
+X481550D01*
+Y110000D01*
+X477050D01*
+G37*
+G36*
+X482450D02*Y104000D01*
+X486950D01*
+Y110000D01*
+X482450D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_pads.gbr/elem_pads.top.gbr b/tests/RTT/ref/elem_pads.gbr/elem_pads.top.gbr
new file mode 100644
index 0000000..28a265f
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.gbr/elem_pads.top.gbr
@@ -0,0 +1,21 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: pads with different geometry, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD12R,0.0512X0.0512*%
+%ADD11R,0.0150X0.0150*%
+G54D11*X22400Y13500D02*Y11500D01*
+X27500Y13500D02*Y11500D01*
+Y20500D02*Y18500D01*
+X25000Y20500D02*Y18500D01*
+X22400Y20500D02*Y18500D01*
+G54D12*X19095Y41181D02*Y38819D01*
+X30905Y41181D02*Y38819D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads.gbr/elem_pads.topmask.gbr b/tests/RTT/ref/elem_pads.gbr/elem_pads.topmask.gbr
new file mode 100644
index 0000000..f4a2af9
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.gbr/elem_pads.topmask.gbr
@@ -0,0 +1,21 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: pads with different geometry, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD14R,0.0572X0.0572*%
+%ADD13R,0.0210X0.0210*%
+G54D13*X22400Y13500D02*Y11500D01*
+X27500Y13500D02*Y11500D01*
+Y20500D02*Y18500D01*
+X25000Y20500D02*Y18500D01*
+X22400Y20500D02*Y18500D01*
+G54D14*X19095Y41181D02*Y38819D01*
+X30905Y41181D02*Y38819D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads.gbr/elem_pads.toppaste.gbr b/tests/RTT/ref/elem_pads.gbr/elem_pads.toppaste.gbr
new file mode 100644
index 0000000..3058898
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.gbr/elem_pads.toppaste.gbr
@@ -0,0 +1,21 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: pads with different geometry, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPPASTE*%
+%ADD19R,0.0150X0.0150*%
+%ADD18R,0.0512X0.0512*%
+G54D18*X19095Y41181D02*Y38819D01*
+X30905Y41181D02*Y38819D01*
+G54D19*X22400Y13500D02*Y11500D01*
+X27500Y13500D02*Y11500D01*
+Y20500D02*Y18500D01*
+X25000Y20500D02*Y18500D01*
+X22400Y20500D02*Y18500D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads.gbr/elem_pads.topsilk.gbr b/tests/RTT/ref/elem_pads.gbr/elem_pads.topsilk.gbr
new file mode 100644
index 0000000..90f0bd0
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.gbr/elem_pads.topsilk.gbr
@@ -0,0 +1,39 @@
+G04 start of page 4 for group 0 layer_idx 8 *
+G04 Title: pads with different geometry, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD17C,0.0070*%
+%ADD16C,0.0100*%
+%ADD15C,0.0080*%
+G54D15*X22638Y43740D02*X27362D01*
+X22638Y36260D02*X27362D01*
+G54D16*X21000Y21900D02*Y10000D01*
+X29000D01*
+Y21900D01*
+X21000D01*
+G54D17*X21850Y35650D02*X23850D01*
+X24350Y35150D01*
+Y34150D01*
+X23850Y33650D02*X24350Y34150D01*
+X22350Y33650D02*X23850D01*
+X22350Y35650D02*Y31650D01*
+X23150Y33650D02*X24350Y31650D01*
+X25550Y34850D02*X26350Y35650D01*
+Y31650D01*
+X25550D02*X27050D01*
+X22500Y8500D02*Y5000D01*
+X23000Y4500D01*
+X24000D01*
+X24500Y5000D01*
+Y8500D02*Y5000D01*
+X25700Y7700D02*X26500Y8500D01*
+Y4500D01*
+X25700D02*X27200D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads.net b/tests/RTT/ref/elem_pads.net
new file mode 100644
index 0000000..38b0b56
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.net
@@ -0,0 +1,19 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB pads with different geometry
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+327N/C R1 -1 A01X+001909Y+004000X0511Y0748R000 S1
+327N/C R1 -2 A01X+003090Y+004000X0511Y0748R000 S1
+327N/C U1 -1 A01X+002240Y+001250X0150Y0350R000 S1
+327N/C U1 -2 A01X+002750Y+001250X0150Y0350R000 S1
+327N/C U1 -3 A01X+002750Y+001950X0150Y0350R000 S1
+327N/C U1 -4 A01X+002500Y+001950X0150Y0350R000 S1
+327N/C U1 -5 A01X+002240Y+001950X0150Y0350R000 S1
+999
diff --git a/tests/RTT/ref/elem_pads.png b/tests/RTT/ref/elem_pads.png
new file mode 100644
index 0000000..ca43f43
Binary files /dev/null and b/tests/RTT/ref/elem_pads.png differ
diff --git a/tests/RTT/ref/elem_pads.ps.gz b/tests/RTT/ref/elem_pads.ps.gz
new file mode 100644
index 0000000..f3d44f7
Binary files /dev/null and b/tests/RTT/ref/elem_pads.ps.gz differ
diff --git a/tests/RTT/ref/elem_pads.remote.gz b/tests/RTT/ref/elem_pads.remote.gz
new file mode 100644
index 0000000..ba000de
Binary files /dev/null and b/tests/RTT/ref/elem_pads.remote.gz differ
diff --git a/tests/RTT/ref/elem_pads.svg b/tests/RTT/ref/elem_pads.svg
new file mode 100644
index 0000000..bde4e53
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.svg
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="5.6896" y1="9.2710" x2="5.6896" y2="9.7790" stroke-width="0.3810" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="6.9850" y1="9.2710" x2="6.9850" y2="9.7790" stroke-width="0.3810" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="6.9850" y1="7.4930" x2="6.9850" y2="8.0010" stroke-width="0.3810" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="6.3500" y1="7.4930" x2="6.3500" y2="8.0010" stroke-width="0.3810" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="5.6896" y1="7.4930" x2="5.6896" y2="8.0010" stroke-width="0.3810" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="4.8501" y1="2.2400" x2="4.8501" y2="2.8400" stroke-width="1.3000" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="7.8499" y1="2.2400" x2="7.8499" y2="2.8400" stroke-width="1.3000" stroke="#4d4d4d" stroke-linecap="square"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="5.7501" y1="1.5900" x2="6.9499" y2="1.5900" stroke-width="0.2032" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7501" y1="3.4900" x2="6.9499" y2="3.4900" stroke-width="0.2032" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.3340" y1="7.1374" x2="5.3340" y2="10.1600" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.3340" y1="10.1600" x2="7.3660" y2="10.1600" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.3660" y1="10.1600" x2="7.3660" y2="7.1374" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.3660" y1="7.1374" x2="5.3340" y2="7.1374" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.5499" y1="3.6449" x2="6.0579" y2="3.6449" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.0579" y1="3.6449" x2="6.1849" y2="3.7719" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.1849" y1="3.7719" x2="6.1849" y2="4.0259" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.0579" y1="4.1529" x2="6.1849" y2="4.0259" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6769" y1="4.1529" x2="6.0579" y2="4.1529" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6769" y1="3.6449" x2="5.6769" y2="4.6609" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.8801" y1="4.1529" x2="6.1849" y2="4.6609" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.4897" y1="3.8481" x2="6.6929" y2="3.6449" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.6929" y1="3.6449" x2="6.6929" y2="4.6609" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.4897" y1="4.6609" x2="6.8707" y2="4.6609" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7150" y1="10.5410" x2="5.7150" y2="11.4300" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7150" y1="11.4300" x2="5.8420" y2="11.5570" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.8420" y1="11.5570" x2="6.0960" y2="11.5570" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.0960" y1="11.5570" x2="6.2230" y2="11.4300" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.2230" y1="10.5410" x2="6.2230" y2="11.4300" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.5278" y1="10.7442" x2="6.7310" y2="10.5410" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.7310" y1="10.5410" x2="6.7310" y2="11.5570" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.5278" y1="11.5570" x2="6.9088" y2="11.5570" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/elem_pads.xy b/tests/RTT/ref/elem_pads.xy
new file mode 100644
index 0000000..8934220
--- /dev/null
+++ b/tests/RTT/ref/elem_pads.xy
@@ -0,0 +1,10 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: pads with different geometry - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+R1,"Standard SMT resistor, capacitor etc","1206",250.00,400.00,0,top
+U1,"SMT transistor, 5 pins","SOT325",249.60,167.00,90,top
diff --git a/tests/RTT/ref/elem_pads_ds.bom b/tests/RTT/ref/elem_pads_ds.bom
new file mode 100644
index 0000000..fc3da8f
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.bom
@@ -0,0 +1,8 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: element with pads on both sides - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+1,"(unknown)","(unknown)",(unknown)
diff --git a/tests/RTT/ref/elem_pads_ds.dsn b/tests/RTT/ref/elem_pads_ds.dsn
new file mode 100644
index 0000000..bbe5788
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.dsn
@@ -0,0 +1,72 @@
+(pcb element with pads on both sides
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "null" 6.191250 8.096250 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Smd_rect_2159000x254000 "1" -0.793750 0.793750)
+ (pin Smd_rect_254000x2159000 "2" 0.793750 -0.793750)
+ )
+ (padstack Smd_rect_2159000x254000
+ (shape (rect "comp1" -1.079500 -0.127000 1.079500 0.127000))
+ (attach off)
+ )
+ (padstack Smd_rect_254000x2159000
+ (shape (rect "comp1" -0.127000 -1.079500 0.127000 1.079500))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottom.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottom.gbr
new file mode 100644
index 0000000..dd2ba70
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottom.gbr
@@ -0,0 +1,14 @@
+G04 start of page 3 for group 1 layer_idx 1 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOM*%
+%ADD12C,0.0100*%
+G54D12*X27500Y32500D02*Y25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottommask.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottommask.gbr
new file mode 100644
index 0000000..16f6960
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottommask.gbr
@@ -0,0 +1,14 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMMASK*%
+%ADD14C,0.0500*%
+G54D14*X27500Y32500D02*Y25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottompaste.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottompaste.gbr
new file mode 100644
index 0000000..43b4852
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.bottompaste.gbr
@@ -0,0 +1,14 @@
+G04 start of page 8 for group -1 layer_idx -1 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMPASTE*%
+%ADD17C,0.0100*%
+G54D17*X27500Y32500D02*Y25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.fab.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.fab.gbr
new file mode 100644
index 0000000..52994fd
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.fab.gbr
@@ -0,0 +1,1794 @@
+G04 start of page 9 for group -1 layer_idx -1 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD20C,0.0100*%
+%ADD19C,0.0001*%
+%ADD18C,0.0060*%
+G54D18*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D19*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D18*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D19*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D18*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D19*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D18*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D19*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D18*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D19*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D18*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D19*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D20*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D18*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D19*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D18*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D19*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D18*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D19*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D18*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D19*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D18*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D19*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D18*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D19*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D18*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D19*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D18*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D19*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D18*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D19*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D18*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D19*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D18*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D19*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X323600D02*Y104000D01*
+X328100D01*
+Y110000D01*
+X323600D01*
+G37*
+G36*
+X329000D02*Y104000D01*
+X333500D01*
+Y110000D01*
+X329000D01*
+G37*
+G36*
+X337100D02*Y104000D01*
+X341600D01*
+Y110000D01*
+X337100D01*
+G37*
+G36*
+X342500D02*Y104000D01*
+X347000D01*
+Y110000D01*
+X342500D01*
+G37*
+G36*
+X347900D02*Y104000D01*
+X352400D01*
+Y110000D01*
+X347900D01*
+G37*
+G36*
+X353300D02*Y104000D01*
+X357800D01*
+Y110000D01*
+X353300D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X366800D02*Y104000D01*
+X371300D01*
+Y110000D01*
+X366800D01*
+G37*
+G36*
+X372200D02*Y104000D01*
+X376700D01*
+Y110000D01*
+X372200D01*
+G37*
+G36*
+X377600D02*Y104000D01*
+X382100D01*
+Y110000D01*
+X377600D01*
+G37*
+G36*
+X383000D02*Y104000D01*
+X387500D01*
+Y110000D01*
+X383000D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G54D18*X399200D02*Y104000D01*
+Y110000D02*X402200D01*
+X399200Y107300D02*X401450D01*
+G54D19*G36*
+X404000Y110000D02*Y104000D01*
+X408500D01*
+Y110000D01*
+X404000D01*
+G37*
+G36*
+X409400D02*Y104000D01*
+X413900D01*
+Y110000D01*
+X409400D01*
+G37*
+G36*
+X414800D02*Y104000D01*
+X419300D01*
+Y110000D01*
+X414800D01*
+G37*
+G36*
+X420200D02*Y104000D01*
+X424700D01*
+Y110000D01*
+X420200D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G36*
+X436400D02*Y104000D01*
+X440900D01*
+Y110000D01*
+X436400D01*
+G37*
+G36*
+X441800D02*Y104000D01*
+X446300D01*
+Y110000D01*
+X441800D01*
+G37*
+G36*
+X447200D02*Y104000D01*
+X451700D01*
+Y110000D01*
+X447200D01*
+G37*
+G36*
+X452600D02*Y104000D01*
+X457100D01*
+Y110000D01*
+X452600D01*
+G37*
+G54D18*X461450D02*Y104000D01*
+X463400Y110000D02*X464450Y108950D01*
+Y105050D01*
+X463400Y104000D02*X464450Y105050D01*
+X460700Y104000D02*X463400D01*
+X460700Y110000D02*X463400D01*
+G54D19*G36*
+X466250D02*Y104000D01*
+X470750D01*
+Y110000D01*
+X466250D01*
+G37*
+G36*
+X471650D02*Y104000D01*
+X476150D01*
+Y110000D01*
+X471650D01*
+G37*
+G36*
+X477050D02*Y104000D01*
+X481550D01*
+Y110000D01*
+X477050D01*
+G37*
+G36*
+X482450D02*Y104000D01*
+X486950D01*
+Y110000D01*
+X482450D01*
+G37*
+G36*
+X487850D02*Y104000D01*
+X492350D01*
+Y110000D01*
+X487850D01*
+G37*
+G36*
+X493250D02*Y104000D01*
+X497750D01*
+Y110000D01*
+X493250D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.top.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.top.gbr
new file mode 100644
index 0000000..2a989b2
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.top.gbr
@@ -0,0 +1,14 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0100*%
+G54D11*X17500Y35000D02*X25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.topmask.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.topmask.gbr
new file mode 100644
index 0000000..36f6877
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.topmask.gbr
@@ -0,0 +1,14 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD13C,0.0500*%
+G54D13*X17500Y35000D02*X25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.toppaste.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.toppaste.gbr
new file mode 100644
index 0000000..64eb44c
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.toppaste.gbr
@@ -0,0 +1,14 @@
+G04 start of page 7 for group -1 layer_idx -1 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPPASTE*%
+%ADD16C,0.0100*%
+G54D16*X17500Y35000D02*X25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.topsilk.gbr b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.topsilk.gbr
new file mode 100644
index 0000000..e2b9245
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.gbr/elem_pads_ds.topsilk.gbr
@@ -0,0 +1,14 @@
+G04 start of page 6 for group 0 layer_idx 8 *
+G04 Title: element with pads on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD15C,0.0100*%
+G54D15*X17500Y35000D02*Y25000D01*
+M02*
diff --git a/tests/RTT/ref/elem_pads_ds.png b/tests/RTT/ref/elem_pads_ds.png
new file mode 100644
index 0000000..9d9a036
Binary files /dev/null and b/tests/RTT/ref/elem_pads_ds.png differ
diff --git a/tests/RTT/ref/elem_pads_ds.ps.gz b/tests/RTT/ref/elem_pads_ds.ps.gz
new file mode 100644
index 0000000..867a51f
Binary files /dev/null and b/tests/RTT/ref/elem_pads_ds.ps.gz differ
diff --git a/tests/RTT/ref/elem_pads_ds.remote.gz b/tests/RTT/ref/elem_pads_ds.remote.gz
new file mode 100644
index 0000000..df2c3f5
Binary files /dev/null and b/tests/RTT/ref/elem_pads_ds.remote.gz differ
diff --git a/tests/RTT/ref/elem_pads_ds.svg b/tests/RTT/ref/elem_pads_ds.svg
new file mode 100644
index 0000000..87da67c
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <line x1="6.9850" y1="4.4450" x2="6.9850" y2="6.3500" stroke-width="0.2540" stroke="#cccccc" stroke-linecap="round"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="4.4450" y1="3.8100" x2="6.3500" y2="3.8100" stroke-width="0.2540" stroke="#4d4d4d" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="4.4450" y1="3.8100" x2="4.4450" y2="6.3500" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/elem_pads_ds.xy b/tests/RTT/ref/elem_pads_ds.xy
new file mode 100644
index 0000000..889e1cb
--- /dev/null
+++ b/tests/RTT/ref/elem_pads_ds.xy
@@ -0,0 +1,9 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: element with pads on both sides - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+(unknown),"(unknown)","(unknown)",243.75,318.75,0,top
diff --git a/tests/RTT/ref/elem_pins.bom b/tests/RTT/ref/elem_pins.bom
new file mode 100644
index 0000000..62ff547
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.bom
@@ -0,0 +1,8 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: pins with different shapes - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+2,"dip(2)","2*300",U1 U2
diff --git a/tests/RTT/ref/elem_pins.dsn b/tests/RTT/ref/elem_pins.dsn
new file mode 100644
index 0000000..08ca2ab
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.dsn
@@ -0,0 +1,79 @@
+(pcb pins with different shapes
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "U1" 5.715000 9.525000 front 0 (PN 0))
+ )
+ (component 20
+ (place "U2" 5.715000 4.445000 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Th_square_2032000 "1" -3.810000 0.000000)
+ (pin Th_round_2032000 "2" 3.810000 0.000000)
+ )
+ (image 20
+ (pin Th_square_2032000 "1" -3.810000 0.000000)
+ (pin Th_square_2032000 "2" 3.810000 0.000000)
+ )
+ (padstack Th_square_2032000
+ (shape (rect signal -1.016000 -1.016000 1.016000 1.016000))
+ (attach off)
+ )
+ (padstack Th_round_2032000
+ (shape (circle signal 2.032000))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/elem_pins.gbr/elem_pins.bottommask.gbr b/tests/RTT/ref/elem_pins.gbr/elem_pins.bottommask.gbr
new file mode 100644
index 0000000..f1ff4d5
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.gbr/elem_pins.bottommask.gbr
@@ -0,0 +1,41 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: pins with different shapes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMMASK*%
+%ADD15C,0.0860*%
+%ADD14C,0.0001*%
+G54D14*G36*
+X3200Y41800D02*Y33200D01*
+X11800D01*
+Y41800D01*
+X3200D01*
+G37*
+G54D15*X37500Y37500D03*
+G54D14*G36*
+X16100Y19281D02*X11062Y21800D01*
+X5719D01*
+X3200Y19281D01*
+Y15719D01*
+X5719Y13200D01*
+X11062D01*
+X16100Y15719D01*
+Y19281D01*
+G37*
+G36*
+X46100Y21062D02*X41062Y26100D01*
+X33938D01*
+X28900Y21062D01*
+Y15719D01*
+X33938Y13200D01*
+X41062D01*
+X46100Y15719D01*
+Y21062D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_pins.gbr/elem_pins.fab.gbr b/tests/RTT/ref/elem_pins.gbr/elem_pins.fab.gbr
new file mode 100644
index 0000000..f304524
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.gbr/elem_pins.fab.gbr
@@ -0,0 +1,1834 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: pins with different shapes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD19C,0.0100*%
+%ADD18C,0.0001*%
+%ADD17C,0.0060*%
+%ADD16C,0.0080*%
+G54D16*X7500Y37500D02*Y35900D01*
+Y37500D02*X8887Y38300D01*
+X7500Y37500D02*X6113Y38300D01*
+X37500Y37500D02*Y35900D01*
+Y37500D02*X38887Y38300D01*
+X37500Y37500D02*X36113Y38300D01*
+X7500Y17500D02*Y15900D01*
+Y17500D02*X8887Y18300D01*
+X7500Y17500D02*X6113Y18300D01*
+X37500Y17500D02*Y15900D01*
+Y17500D02*X38887Y18300D01*
+X37500Y17500D02*X36113Y18300D01*
+X15000Y106250D02*Y104650D01*
+Y106250D02*X16387Y107050D01*
+X15000Y106250D02*X13613Y107050D01*
+G54D17*X135000Y110000D02*X136500Y107000D01*
+X138000Y110000D01*
+X136500Y107000D02*Y104000D01*
+X139800Y107300D02*X142050D01*
+X139800Y104000D02*X142800D01*
+X139800Y110000D02*Y104000D01*
+Y110000D02*X142800D01*
+X147600D02*X148350Y109250D01*
+X145350Y110000D02*X147600D01*
+X144600Y109250D02*X145350Y110000D01*
+X144600Y109250D02*Y107750D01*
+X145350Y107000D01*
+X147600D01*
+X148350Y106250D01*
+Y104750D01*
+X147600Y104000D02*X148350Y104750D01*
+X145350Y104000D02*X147600D01*
+X144600Y104750D02*X145350Y104000D01*
+X98000Y106250D02*X101000Y110000D01*
+X98000Y106250D02*X101750D01*
+X101000Y110000D02*Y104000D01*
+G54D18*G36*
+X45000Y110000D02*Y104000D01*
+X49500D01*
+Y110000D01*
+X45000D01*
+G37*
+G36*
+X50400D02*Y104000D01*
+X54900D01*
+Y110000D01*
+X50400D01*
+G37*
+G36*
+X55800D02*Y104000D01*
+X60300D01*
+Y110000D01*
+X55800D01*
+G37*
+G54D17*X61200Y106250D02*X64200Y110000D01*
+X61200Y106250D02*X64950D01*
+X64200Y110000D02*Y104000D01*
+G54D18*G36*
+X66750Y110000D02*Y104000D01*
+X71250D01*
+Y110000D01*
+X66750D01*
+G37*
+G54D17*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D18*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D17*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D18*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D17*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D18*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D17*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D18*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D17*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D18*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D17*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D18*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G54D17*X48000Y138800D02*X49200Y140000D01*
+Y134000D01*
+X48000D02*X50250D01*
+G54D18*G36*
+X54750Y140000D02*Y134000D01*
+X59250D01*
+Y140000D01*
+X54750D01*
+G37*
+G36*
+X60150D02*Y134000D01*
+X64650D01*
+Y140000D01*
+X60150D01*
+G37*
+G36*
+X65550D02*Y134000D01*
+X70050D01*
+Y140000D01*
+X65550D01*
+G37*
+G36*
+X70950D02*Y134000D01*
+X75450D01*
+Y140000D01*
+X70950D01*
+G37*
+G36*
+X76350D02*Y134000D01*
+X80850D01*
+Y140000D01*
+X76350D01*
+G37*
+G36*
+X81750D02*Y134000D01*
+X86250D01*
+Y140000D01*
+X81750D01*
+G37*
+G36*
+X87150D02*Y134000D01*
+X91650D01*
+Y140000D01*
+X87150D01*
+G37*
+G36*
+X92550D02*Y134000D01*
+X97050D01*
+Y140000D01*
+X92550D01*
+G37*
+G36*
+X97950D02*Y134000D01*
+X102450D01*
+Y140000D01*
+X97950D01*
+G37*
+G36*
+X106050D02*Y134000D01*
+X110550D01*
+Y140000D01*
+X106050D01*
+G37*
+G36*
+X111450D02*Y134000D01*
+X115950D01*
+Y140000D01*
+X111450D01*
+G37*
+G36*
+X116850D02*Y134000D01*
+X121350D01*
+Y140000D01*
+X116850D01*
+G37*
+G36*
+X122250D02*Y134000D01*
+X126750D01*
+Y140000D01*
+X122250D01*
+G37*
+G36*
+X127650D02*Y134000D01*
+X132150D01*
+Y140000D01*
+X127650D01*
+G37*
+G36*
+X135750D02*Y134000D01*
+X140250D01*
+Y140000D01*
+X135750D01*
+G37*
+G36*
+X141150D02*Y134000D01*
+X145650D01*
+Y140000D01*
+X141150D01*
+G37*
+G36*
+X146550D02*Y134000D01*
+X151050D01*
+Y140000D01*
+X146550D01*
+G37*
+G36*
+X151950D02*Y134000D01*
+X156450D01*
+Y140000D01*
+X151950D01*
+G37*
+G36*
+X157350D02*Y134000D01*
+X161850D01*
+Y140000D01*
+X157350D01*
+G37*
+G36*
+X165450D02*Y134000D01*
+X169950D01*
+Y140000D01*
+X165450D01*
+G37*
+G36*
+X170850D02*Y134000D01*
+X175350D01*
+Y140000D01*
+X170850D01*
+G37*
+G36*
+X176250D02*Y134000D01*
+X180750D01*
+Y140000D01*
+X176250D01*
+G37*
+G36*
+X181650D02*Y134000D01*
+X186150D01*
+Y140000D01*
+X181650D01*
+G37*
+G36*
+X189750D02*Y134000D01*
+X194250D01*
+Y140000D01*
+X189750D01*
+G37*
+G36*
+X195150D02*Y134000D01*
+X199650D01*
+Y140000D01*
+X195150D01*
+G37*
+G36*
+X203250D02*Y134000D01*
+X207750D01*
+Y140000D01*
+X203250D01*
+G37*
+G36*
+X208650D02*Y134000D01*
+X213150D01*
+Y140000D01*
+X208650D01*
+G37*
+G36*
+X214050D02*Y134000D01*
+X218550D01*
+Y140000D01*
+X214050D01*
+G37*
+G36*
+X219450D02*Y134000D01*
+X223950D01*
+Y140000D01*
+X219450D01*
+G37*
+G36*
+X227550D02*Y134000D01*
+X232050D01*
+Y140000D01*
+X227550D01*
+G37*
+G36*
+X232950D02*Y134000D01*
+X237450D01*
+Y140000D01*
+X232950D01*
+G37*
+G36*
+X238350D02*Y134000D01*
+X242850D01*
+Y140000D01*
+X238350D01*
+G37*
+G36*
+X243750D02*Y134000D01*
+X248250D01*
+Y140000D01*
+X243750D01*
+G37*
+G36*
+X249150D02*Y134000D01*
+X253650D01*
+Y140000D01*
+X249150D01*
+G37*
+G36*
+X254550D02*Y134000D01*
+X259050D01*
+Y140000D01*
+X254550D01*
+G37*
+G36*
+X259950D02*Y134000D01*
+X264450D01*
+Y140000D01*
+X259950D01*
+G37*
+G54D17*X268050Y136250D02*X271050Y140000D01*
+X268050Y136250D02*X271800D01*
+X271050Y140000D02*Y134000D01*
+G54D18*G36*
+X276300Y140000D02*Y134000D01*
+X280800D01*
+Y140000D01*
+X276300D01*
+G37*
+G36*
+X281700D02*Y134000D01*
+X286200D01*
+Y140000D01*
+X281700D01*
+G37*
+G36*
+X287100D02*Y134000D01*
+X291600D01*
+Y140000D01*
+X287100D01*
+G37*
+G36*
+X292500D02*Y134000D01*
+X297000D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297900D02*Y134000D01*
+X302400D01*
+Y140000D01*
+X297900D01*
+G37*
+G36*
+X306000D02*Y134000D01*
+X310500D01*
+Y140000D01*
+X306000D01*
+G37*
+G36*
+X311400D02*Y134000D01*
+X315900D01*
+Y140000D01*
+X311400D01*
+G37*
+G36*
+X316800D02*Y134000D01*
+X321300D01*
+Y140000D01*
+X316800D01*
+G37*
+G36*
+X322200D02*Y134000D01*
+X326700D01*
+Y140000D01*
+X322200D01*
+G37*
+G36*
+X327600D02*Y134000D01*
+X332100D01*
+Y140000D01*
+X327600D01*
+G37*
+G54D19*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D17*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D18*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D17*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D18*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D17*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D18*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D17*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D18*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D17*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D18*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D17*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D18*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D17*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D18*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D17*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D18*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D17*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D18*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D17*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D18*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D17*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D18*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X283100D02*Y104000D01*
+X287600D01*
+Y110000D01*
+X283100D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G54D17*X377600D02*Y104000D01*
+Y110000D02*X380600D01*
+X377600Y107300D02*X379850D01*
+G54D18*G36*
+X382400Y110000D02*Y104000D01*
+X386900D01*
+Y110000D01*
+X382400D01*
+G37*
+G36*
+X387800D02*Y104000D01*
+X392300D01*
+Y110000D01*
+X387800D01*
+G37*
+G36*
+X393200D02*Y104000D01*
+X397700D01*
+Y110000D01*
+X393200D01*
+G37*
+G36*
+X398600D02*Y104000D01*
+X403100D01*
+Y110000D01*
+X398600D01*
+G37*
+G36*
+X404000D02*Y104000D01*
+X408500D01*
+Y110000D01*
+X404000D01*
+G37*
+G36*
+X409400D02*Y104000D01*
+X413900D01*
+Y110000D01*
+X409400D01*
+G37*
+G36*
+X414800D02*Y104000D01*
+X419300D01*
+Y110000D01*
+X414800D01*
+G37*
+G36*
+X420200D02*Y104000D01*
+X424700D01*
+Y110000D01*
+X420200D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G54D17*X439850D02*Y104000D01*
+X441800Y110000D02*X442850Y108950D01*
+Y105050D01*
+X441800Y104000D02*X442850Y105050D01*
+X439100Y104000D02*X441800D01*
+X439100Y110000D02*X441800D01*
+G54D18*G36*
+X444650D02*Y104000D01*
+X449150D01*
+Y110000D01*
+X444650D01*
+G37*
+G36*
+X450050D02*Y104000D01*
+X454550D01*
+Y110000D01*
+X450050D01*
+G37*
+G36*
+X455450D02*Y104000D01*
+X459950D01*
+Y110000D01*
+X455450D01*
+G37*
+G36*
+X460850D02*Y104000D01*
+X465350D01*
+Y110000D01*
+X460850D01*
+G37*
+G36*
+X466250D02*Y104000D01*
+X470750D01*
+Y110000D01*
+X466250D01*
+G37*
+G36*
+X471650D02*Y104000D01*
+X476150D01*
+Y110000D01*
+X471650D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_pins.gbr/elem_pins.topmask.gbr b/tests/RTT/ref/elem_pins.gbr/elem_pins.topmask.gbr
new file mode 100644
index 0000000..c7875e7
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.gbr/elem_pins.topmask.gbr
@@ -0,0 +1,41 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: pins with different shapes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD13C,0.0860*%
+%ADD12C,0.0001*%
+G54D12*G36*
+X3200Y41800D02*Y33200D01*
+X11800D01*
+Y41800D01*
+X3200D01*
+G37*
+G54D13*X37500Y37500D03*
+G54D12*G36*
+X16100Y19281D02*X11062Y21800D01*
+X5719D01*
+X3200Y19281D01*
+Y15719D01*
+X5719Y13200D01*
+X11062D01*
+X16100Y15719D01*
+Y19281D01*
+G37*
+G36*
+X46100Y21062D02*X41062Y26100D01*
+X33938D01*
+X28900Y21062D01*
+Y15719D01*
+X33938Y13200D01*
+X41062D01*
+X46100Y15719D01*
+Y21062D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_pins.net b/tests/RTT/ref/elem_pins.net
new file mode 100644
index 0000000..30cb0bd
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.net
@@ -0,0 +1,16 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB pins with different shapes
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+317N/C U1 -1 D0393PA00X+000750Y+003750X0800Y0800R000 S0
+317N/C U1 -2 D0393PA00X+003750Y+003750X0800Y0000R000 S0
+317N/C U2 -1 D0393PA00X+000750Y+001750X0800Y0800R000 S0
+317N/C U2 -2 D0393PA00X+003750Y+001750X0800Y0800R000 S0
+999
diff --git a/tests/RTT/ref/elem_pins.png b/tests/RTT/ref/elem_pins.png
new file mode 100644
index 0000000..67bb0a0
Binary files /dev/null and b/tests/RTT/ref/elem_pins.png differ
diff --git a/tests/RTT/ref/elem_pins.ps.gz b/tests/RTT/ref/elem_pins.ps.gz
new file mode 100644
index 0000000..7d79429
Binary files /dev/null and b/tests/RTT/ref/elem_pins.ps.gz differ
diff --git a/tests/RTT/ref/elem_pins.remote.gz b/tests/RTT/ref/elem_pins.remote.gz
new file mode 100644
index 0000000..68fa620
Binary files /dev/null and b/tests/RTT/ref/elem_pins.remote.gz differ
diff --git a/tests/RTT/ref/elem_pins.svg b/tests/RTT/ref/elem_pins.svg
new file mode 100644
index 0000000..e64ec42
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.svg
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+<!--normal-->
+ <rect x="0.8890" y="2.1590" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <polygon points="3.9370,7.8342 2.7467,7.2390 1.4842,7.2390 0.8890,7.8342 0.8890,8.6758 1.4842,9.2710 2.7467,9.2710 3.9370,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <polygon points="11.5570,7.4133 10.3667,6.2230 8.6833,6.2230 7.4930,7.4133 7.4930,8.6758 8.6833,9.2710 10.3667,9.2710 11.5570,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <circle cx="1.9050" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="1.9050" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <rect x="0.8890" y="2.1590" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <polygon points="3.9370,7.8342 2.7467,7.2390 1.4842,7.2390 0.8890,7.8342 0.8890,8.6758 1.4842,9.2710 2.7467,9.2710 3.9370,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <polygon points="11.5570,7.4133 10.3667,6.2230 8.6833,6.2230 7.4930,7.4133 7.4930,8.6758 8.6833,9.2710 10.3667,9.2710 11.5570,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <circle cx="1.9050" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="1.9050" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <rect x="0.8890" y="2.1590" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <polygon points="3.9370,7.8342 2.7467,7.2390 1.4842,7.2390 0.8890,7.8342 0.8890,8.6758 1.4842,9.2710 2.7467,9.2710 3.9370,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <polygon points="11.5570,7.4133 10.3667,6.2230 8.6833,6.2230 7.4930,7.4133 7.4930,8.6758 8.6833,9.2710 10.3667,9.2710 11.5570,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <circle cx="1.9050" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="1.9050" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <rect x="0.8890" y="2.1590" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <polygon points="3.9370,7.8342 2.7467,7.2390 1.4842,7.2390 0.8890,7.8342 0.8890,8.6758 1.4842,9.2710 2.7467,9.2710 3.9370,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <polygon points="11.5570,7.4133 10.3667,6.2230 8.6833,6.2230 7.4930,7.4133 7.4930,8.6758 8.6833,9.2710 10.3667,9.2710 11.5570,8.6758 " stroke-width="0.075" stroke="#4d4d4d" fill="#4d4d4d"/>
+ <circle cx="1.9050" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="1.9050" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="0.6350" y1="1.9050" x2="0.6350" y2="4.4450" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="10.7950" y1="4.4450" x2="0.6350" y2="4.4450" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="10.7950" y1="4.4450" x2="10.7950" y2="1.9050" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="0.6350" y1="1.9050" x2="4.4450" y2="1.9050" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.9850" y1="1.9050" x2="10.7950" y2="1.9050" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <path d="M 4.4450 1.9050 A 1.2700 1.2700 0 0 0 6.9850 1.9050" stroke-width="0.2540" stroke="#000000" stroke-linecap="round" fill="none"/>
+ <line x1="0.6350" y1="6.9850" x2="0.6350" y2="9.5250" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="10.7950" y1="9.5250" x2="0.6350" y2="9.5250" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="10.7950" y1="9.5250" x2="10.7950" y2="6.9850" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="0.6350" y1="6.9850" x2="4.4450" y2="6.9850" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.9850" y1="6.9850" x2="10.7950" y2="6.9850" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <path d="M 4.4450 6.9850 A 1.2700 1.2700 0 0 0 6.9850 6.9850" stroke-width="0.2540" stroke="#000000" stroke-linecap="round" fill="none"/>
+ <line x1="1.9050" y1="0.6350" x2="1.9050" y2="1.5240" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.9050" y1="1.5240" x2="2.0320" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.0320" y1="1.6510" x2="2.2860" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.2860" y1="1.6510" x2="2.4130" y2="1.5240" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.4130" y1="0.6350" x2="2.4130" y2="1.5240" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.7178" y1="0.8382" x2="2.9210" y2="0.6350" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.9210" y1="0.6350" x2="2.9210" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.7178" y1="1.6510" x2="3.0988" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.9050" y1="5.7150" x2="1.9050" y2="6.6040" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.9050" y1="6.6040" x2="2.0320" y2="6.7310" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.0320" y1="6.7310" x2="2.2860" y2="6.7310" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.2860" y1="6.7310" x2="2.4130" y2="6.6040" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.4130" y1="5.7150" x2="2.4130" y2="6.6040" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.7178" y1="5.8420" x2="2.8448" y2="5.7150" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.8448" y1="5.7150" x2="3.2258" y2="5.7150" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.2258" y1="5.7150" x2="3.3528" y2="5.8420" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="5.8420" x2="3.3528" y2="6.0960" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.7178" y1="6.7310" x2="3.3528" y2="6.0960" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.7178" y1="6.7310" x2="3.3528" y2="6.7310" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+<g id="layer_-4048_plated-drill">
+<!--normal-->
+ <circle cx="1.9050" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="3.1750" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="1.9050" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="9.5250" cy="8.2550" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/elem_pins.xy b/tests/RTT/ref/elem_pins.xy
new file mode 100644
index 0000000..e7e0b60
--- /dev/null
+++ b/tests/RTT/ref/elem_pins.xy
@@ -0,0 +1,10 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: pins with different shapes - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+U1,"dip(2)","2*300",225.00,375.00,0,top
+U2,"dip(2)","2*300",225.00,175.00,0,top
diff --git a/tests/RTT/ref/elem_sides_smd.bom b/tests/RTT/ref/elem_sides_smd.bom
new file mode 100644
index 0000000..c9332d9
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.bom
@@ -0,0 +1,8 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: smd elements on both sides - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+2,"Standard SMT resistor, capacitor etc","1206",R1 R2
diff --git a/tests/RTT/ref/elem_sides_smd.dsn b/tests/RTT/ref/elem_sides_smd.dsn
new file mode 100644
index 0000000..1da78b0
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.dsn
@@ -0,0 +1,75 @@
+(pcb smd elements on both sides
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "R1" 5.715000 9.525000 front 0 (PN 0))
+ )
+ (component 16
+ (place "R2" 5.715000 3.810000 back 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Smd_rect_1299972x1899920 "1" -1.499870 0.000000)
+ (pin Smd_rect_1299972x1899920 "2" 1.499870 0.000000)
+ )
+ (image 16
+ (pin Smd_rect_1299972x1899920 "1" 1.499870 0.000000)
+ (pin Smd_rect_1299972x1899920 "2" -1.499870 0.000000)
+ )
+ (padstack Smd_rect_1299972x1899920
+ (shape (rect "comp1" -0.649986 -0.949960 0.649986 0.949960))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottom.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottom.gbr
new file mode 100644
index 0000000..7596fd9
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottom.gbr
@@ -0,0 +1,15 @@
+G04 start of page 3 for group 1 layer_idx 1 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOM*%
+%ADD12R,0.0512X0.0512*%
+G54D12*X16595Y16181D02*Y13819D01*
+X28405Y16181D02*Y13819D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottommask.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottommask.gbr
new file mode 100644
index 0000000..d4402a5
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottommask.gbr
@@ -0,0 +1,15 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMMASK*%
+%ADD14R,0.0572X0.0572*%
+G54D14*X16595Y16181D02*Y13819D01*
+X28405Y16181D02*Y13819D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottompaste.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottompaste.gbr
new file mode 100644
index 0000000..9aff108
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottompaste.gbr
@@ -0,0 +1,15 @@
+G04 start of page 9 for group -1 layer_idx -1 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMPASTE*%
+%ADD20R,0.0512X0.0512*%
+G54D20*X16595Y16181D02*Y13819D01*
+X28405Y16181D02*Y13819D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottomsilk.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottomsilk.gbr
new file mode 100644
index 0000000..969f973
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.bottomsilk.gbr
@@ -0,0 +1,29 @@
+G04 start of page 7 for group 1 layer_idx 7 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMSILK*%
+%ADD18C,0.0070*%
+%ADD17C,0.0080*%
+G54D17*X20138Y11260D02*X24862D01*
+X20138Y18740D02*X24862D01*
+G54D18*X34350Y11850D02*X36350D01*
+X36850Y12350D01*
+Y13350D01*
+X36350Y13850D02*X36850Y13350D01*
+X34850Y13850D02*X36350D01*
+X34850Y11850D02*Y15850D01*
+X35650Y13850D02*X36850Y15850D01*
+X38050Y12350D02*X38550Y11850D01*
+X40050D01*
+X40550Y12350D01*
+Y13350D01*
+X38050Y15850D02*X40550Y13350D01*
+X38050Y15850D02*X40550D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.fab.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.fab.gbr
new file mode 100644
index 0000000..466cc68
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.fab.gbr
@@ -0,0 +1,1770 @@
+G04 start of page 10 for group -1 layer_idx -1 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD23C,0.0100*%
+%ADD22C,0.0001*%
+%ADD21C,0.0060*%
+G54D21*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D22*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D21*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D22*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D21*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D22*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D21*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D22*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D21*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D22*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D21*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D22*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D23*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D21*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D22*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D21*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D22*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D21*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D22*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D21*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D22*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D21*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D22*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D21*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D22*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D21*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D22*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D21*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D22*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D21*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D22*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D21*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D22*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D21*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D22*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X253400D02*Y104000D01*
+X257900D01*
+Y110000D01*
+X253400D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X312800D02*Y104000D01*
+X317300D01*
+Y110000D01*
+X312800D01*
+G37*
+G36*
+X318200D02*Y104000D01*
+X322700D01*
+Y110000D01*
+X318200D01*
+G37*
+G36*
+X323600D02*Y104000D01*
+X328100D01*
+Y110000D01*
+X323600D01*
+G37*
+G36*
+X329000D02*Y104000D01*
+X333500D01*
+Y110000D01*
+X329000D01*
+G37*
+G36*
+X337100D02*Y104000D01*
+X341600D01*
+Y110000D01*
+X337100D01*
+G37*
+G36*
+X342500D02*Y104000D01*
+X347000D01*
+Y110000D01*
+X342500D01*
+G37*
+G36*
+X347900D02*Y104000D01*
+X352400D01*
+Y110000D01*
+X347900D01*
+G37*
+G36*
+X353300D02*Y104000D01*
+X357800D01*
+Y110000D01*
+X353300D01*
+G37*
+G36*
+X358700D02*Y104000D01*
+X363200D01*
+Y110000D01*
+X358700D01*
+G37*
+G36*
+X366800D02*Y104000D01*
+X371300D01*
+Y110000D01*
+X366800D01*
+G37*
+G54D21*X374900D02*Y104000D01*
+Y110000D02*X377900D01*
+X374900Y107300D02*X377150D01*
+G54D22*G36*
+X379700Y110000D02*Y104000D01*
+X384200D01*
+Y110000D01*
+X379700D01*
+G37*
+G36*
+X385100D02*Y104000D01*
+X389600D01*
+Y110000D01*
+X385100D01*
+G37*
+G36*
+X390500D02*Y104000D01*
+X395000D01*
+Y110000D01*
+X390500D01*
+G37*
+G36*
+X395900D02*Y104000D01*
+X400400D01*
+Y110000D01*
+X395900D01*
+G37*
+G36*
+X401300D02*Y104000D01*
+X405800D01*
+Y110000D01*
+X401300D01*
+G37*
+G36*
+X406700D02*Y104000D01*
+X411200D01*
+Y110000D01*
+X406700D01*
+G37*
+G36*
+X412100D02*Y104000D01*
+X416600D01*
+Y110000D01*
+X412100D01*
+G37*
+G36*
+X417500D02*Y104000D01*
+X422000D01*
+Y110000D01*
+X417500D01*
+G37*
+G36*
+X422900D02*Y104000D01*
+X427400D01*
+Y110000D01*
+X422900D01*
+G37*
+G36*
+X428300D02*Y104000D01*
+X432800D01*
+Y110000D01*
+X428300D01*
+G37*
+G54D21*X437150D02*Y104000D01*
+X439100Y110000D02*X440150Y108950D01*
+Y105050D01*
+X439100Y104000D02*X440150Y105050D01*
+X436400Y104000D02*X439100D01*
+X436400Y110000D02*X439100D01*
+G54D22*G36*
+X441950D02*Y104000D01*
+X446450D01*
+Y110000D01*
+X441950D01*
+G37*
+G36*
+X447350D02*Y104000D01*
+X451850D01*
+Y110000D01*
+X447350D01*
+G37*
+G36*
+X452750D02*Y104000D01*
+X457250D01*
+Y110000D01*
+X452750D01*
+G37*
+G36*
+X458150D02*Y104000D01*
+X462650D01*
+Y110000D01*
+X458150D01*
+G37*
+G36*
+X463550D02*Y104000D01*
+X468050D01*
+Y110000D01*
+X463550D01*
+G37*
+G36*
+X468950D02*Y104000D01*
+X473450D01*
+Y110000D01*
+X468950D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.top.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.top.gbr
new file mode 100644
index 0000000..7e0d2c0
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.top.gbr
@@ -0,0 +1,15 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11R,0.0512X0.0512*%
+G54D11*X16595Y38681D02*Y36319D01*
+X28405Y38681D02*Y36319D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.topmask.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.topmask.gbr
new file mode 100644
index 0000000..0a9d0aa
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.topmask.gbr
@@ -0,0 +1,15 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD13R,0.0572X0.0572*%
+G54D13*X16595Y38681D02*Y36319D01*
+X28405Y38681D02*Y36319D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.toppaste.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.toppaste.gbr
new file mode 100644
index 0000000..ec06272
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.toppaste.gbr
@@ -0,0 +1,15 @@
+G04 start of page 8 for group -1 layer_idx -1 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPPASTE*%
+%ADD19R,0.0512X0.0512*%
+G54D19*X16595Y38681D02*Y36319D01*
+X28405Y38681D02*Y36319D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.topsilk.gbr b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.topsilk.gbr
new file mode 100644
index 0000000..79f4234
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.gbr/elem_sides_smd.topsilk.gbr
@@ -0,0 +1,26 @@
+G04 start of page 6 for group 0 layer_idx 8 *
+G04 Title: smd elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD16C,0.0070*%
+%ADD15C,0.0080*%
+G54D15*X20138Y41240D02*X24862D01*
+X20138Y33760D02*X24862D01*
+G54D16*X34350Y40650D02*X36350D01*
+X36850Y40150D01*
+Y39150D01*
+X36350Y38650D02*X36850Y39150D01*
+X34850Y38650D02*X36350D01*
+X34850Y40650D02*Y36650D01*
+X35650Y38650D02*X36850Y36650D01*
+X38050Y39850D02*X38850Y40650D01*
+Y36650D01*
+X38050D02*X39550D01*
+M02*
diff --git a/tests/RTT/ref/elem_sides_smd.net b/tests/RTT/ref/elem_sides_smd.net
new file mode 100644
index 0000000..e3bf7a2
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.net
@@ -0,0 +1,16 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB smd elements on both sides
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+327N/C R1 -1 A01X+001659Y+003750X0511Y0748R000 S1
+327N/C R1 -2 A01X+002840Y+003750X0511Y0748R000 S1
+327N/C R2 -1 A02X+001659Y+001500X0511Y0748R000 S2
+327N/C R2 -2 A02X+002840Y+001500X0511Y0748R000 S2
+999
diff --git a/tests/RTT/ref/elem_sides_smd.png b/tests/RTT/ref/elem_sides_smd.png
new file mode 100644
index 0000000..debde9b
Binary files /dev/null and b/tests/RTT/ref/elem_sides_smd.png differ
diff --git a/tests/RTT/ref/elem_sides_smd.ps.gz b/tests/RTT/ref/elem_sides_smd.ps.gz
new file mode 100644
index 0000000..61883ca
Binary files /dev/null and b/tests/RTT/ref/elem_sides_smd.ps.gz differ
diff --git a/tests/RTT/ref/elem_sides_smd.remote.gz b/tests/RTT/ref/elem_sides_smd.remote.gz
new file mode 100644
index 0000000..64f0aaa
Binary files /dev/null and b/tests/RTT/ref/elem_sides_smd.remote.gz differ
diff --git a/tests/RTT/ref/elem_sides_smd.svg b/tests/RTT/ref/elem_sides_smd.svg
new file mode 100644
index 0000000..c0779dd
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.svg
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <line x1="4.2151" y1="8.5900" x2="4.2151" y2="9.1900" stroke-width="1.3000" stroke="#cccccc" stroke-linecap="square"/>
+ <line x1="7.2149" y1="8.5900" x2="7.2149" y2="9.1900" stroke-width="1.3000" stroke="#cccccc" stroke-linecap="square"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="4.2151" y1="2.8750" x2="4.2151" y2="3.4750" stroke-width="1.3000" stroke="#4d4d4d" stroke-linecap="square"/>
+ <line x1="7.2149" y1="2.8750" x2="7.2149" y2="3.4750" stroke-width="1.3000" stroke="#4d4d4d" stroke-linecap="square"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="5.1151" y1="2.2250" x2="6.3149" y2="2.2250" stroke-width="0.2032" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.1151" y1="4.1250" x2="6.3149" y2="4.1250" stroke-width="0.2032" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.7249" y1="2.3749" x2="9.2329" y2="2.3749" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.2329" y1="2.3749" x2="9.3599" y2="2.5019" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.3599" y1="2.5019" x2="9.3599" y2="2.7559" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.2329" y1="2.8829" x2="9.3599" y2="2.7559" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.8519" y1="2.8829" x2="9.2329" y2="2.8829" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.8519" y1="2.3749" x2="8.8519" y2="3.3909" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.0551" y1="2.8829" x2="9.3599" y2="3.3909" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.6647" y1="2.5781" x2="9.8679" y2="2.3749" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.8679" y1="2.3749" x2="9.8679" y2="3.3909" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="9.6647" y1="3.3909" x2="10.0457" y2="3.3909" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/elem_sides_smd.xy b/tests/RTT/ref/elem_sides_smd.xy
new file mode 100644
index 0000000..850be1a
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_smd.xy
@@ -0,0 +1,10 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: smd elements on both sides - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+R1,"Standard SMT resistor, capacitor etc","1206",225.00,375.00,0,top
+R2,"Standard SMT resistor, capacitor etc","1206",225.00,150.00,180,bottom
diff --git a/tests/RTT/ref/elem_sides_trh.bom b/tests/RTT/ref/elem_sides_trh.bom
new file mode 100644
index 0000000..e36ce0f
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.bom
@@ -0,0 +1,8 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: thru-hole elements on both sides - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+2,"dip(2)","2*300",U1 U2
diff --git a/tests/RTT/ref/elem_sides_trh.dsn b/tests/RTT/ref/elem_sides_trh.dsn
new file mode 100644
index 0000000..2cc921f
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.dsn
@@ -0,0 +1,79 @@
+(pcb thru-hole elements on both sides
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "U1" 6.350000 8.890000 front 0 (PN 0))
+ )
+ (component 20
+ (place "U2" 6.350000 3.810000 back 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Th_square_2032000 "1" -3.810000 0.000000)
+ (pin Th_round_2032000 "2" 3.810000 0.000000)
+ )
+ (image 20
+ (pin Th_square_2032000 "1" 3.810000 0.000000)
+ (pin Th_round_2032000 "2" -3.810000 0.000000)
+ )
+ (padstack Th_square_2032000
+ (shape (rect signal -1.016000 -1.016000 1.016000 1.016000))
+ (attach off)
+ )
+ (padstack Th_round_2032000
+ (shape (circle signal 2.032000))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.bottommask.gbr b/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.bottommask.gbr
new file mode 100644
index 0000000..ed00a46
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.bottommask.gbr
@@ -0,0 +1,28 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: thru-hole elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMMASK*%
+%ADD15C,0.0860*%
+%ADD14C,0.0001*%
+G54D14*G36*
+X5700Y39300D02*Y30700D01*
+X14300D01*
+Y39300D01*
+X5700D01*
+G37*
+G54D15*X40000Y35000D03*
+G54D14*G36*
+X5700Y19300D02*Y10700D01*
+X14300D01*
+Y19300D01*
+X5700D01*
+G37*
+G54D15*X40000Y15000D03*
+M02*
diff --git a/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.fab.gbr b/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.fab.gbr
new file mode 100644
index 0000000..1fdc3b9
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.fab.gbr
@@ -0,0 +1,1864 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: thru-hole elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD19C,0.0100*%
+%ADD18C,0.0001*%
+%ADD17C,0.0060*%
+%ADD16C,0.0080*%
+G54D16*X10000Y35000D02*Y33400D01*
+Y35000D02*X11387Y35800D01*
+X10000Y35000D02*X8613Y35800D01*
+X40000Y35000D02*Y33400D01*
+Y35000D02*X41387Y35800D01*
+X40000Y35000D02*X38613Y35800D01*
+X10000Y15000D02*Y13400D01*
+Y15000D02*X11387Y15800D01*
+X10000Y15000D02*X8613Y15800D01*
+X40000Y15000D02*Y13400D01*
+Y15000D02*X41387Y15800D01*
+X40000Y15000D02*X38613Y15800D01*
+X15000Y106250D02*Y104650D01*
+Y106250D02*X16387Y107050D01*
+X15000Y106250D02*X13613Y107050D01*
+G54D17*X135000Y110000D02*X136500Y107000D01*
+X138000Y110000D01*
+X136500Y107000D02*Y104000D01*
+X139800Y107300D02*X142050D01*
+X139800Y104000D02*X142800D01*
+X139800Y110000D02*Y104000D01*
+Y110000D02*X142800D01*
+X147600D02*X148350Y109250D01*
+X145350Y110000D02*X147600D01*
+X144600Y109250D02*X145350Y110000D01*
+X144600Y109250D02*Y107750D01*
+X145350Y107000D01*
+X147600D01*
+X148350Y106250D01*
+Y104750D01*
+X147600Y104000D02*X148350Y104750D01*
+X145350Y104000D02*X147600D01*
+X144600Y104750D02*X145350Y104000D01*
+X98000Y106250D02*X101000Y110000D01*
+X98000Y106250D02*X101750D01*
+X101000Y110000D02*Y104000D01*
+G54D18*G36*
+X45000Y110000D02*Y104000D01*
+X49500D01*
+Y110000D01*
+X45000D01*
+G37*
+G36*
+X50400D02*Y104000D01*
+X54900D01*
+Y110000D01*
+X50400D01*
+G37*
+G36*
+X55800D02*Y104000D01*
+X60300D01*
+Y110000D01*
+X55800D01*
+G37*
+G54D17*X61200Y106250D02*X64200Y110000D01*
+X61200Y106250D02*X64950D01*
+X64200Y110000D02*Y104000D01*
+G54D18*G36*
+X66750Y110000D02*Y104000D01*
+X71250D01*
+Y110000D01*
+X66750D01*
+G37*
+G54D17*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D18*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D17*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D18*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D17*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D18*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D17*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D18*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D17*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D18*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D17*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D18*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G54D17*X48000Y138800D02*X49200Y140000D01*
+Y134000D01*
+X48000D02*X50250D01*
+G54D18*G36*
+X54750Y140000D02*Y134000D01*
+X59250D01*
+Y140000D01*
+X54750D01*
+G37*
+G36*
+X60150D02*Y134000D01*
+X64650D01*
+Y140000D01*
+X60150D01*
+G37*
+G36*
+X65550D02*Y134000D01*
+X70050D01*
+Y140000D01*
+X65550D01*
+G37*
+G36*
+X70950D02*Y134000D01*
+X75450D01*
+Y140000D01*
+X70950D01*
+G37*
+G36*
+X76350D02*Y134000D01*
+X80850D01*
+Y140000D01*
+X76350D01*
+G37*
+G36*
+X81750D02*Y134000D01*
+X86250D01*
+Y140000D01*
+X81750D01*
+G37*
+G36*
+X87150D02*Y134000D01*
+X91650D01*
+Y140000D01*
+X87150D01*
+G37*
+G36*
+X92550D02*Y134000D01*
+X97050D01*
+Y140000D01*
+X92550D01*
+G37*
+G36*
+X97950D02*Y134000D01*
+X102450D01*
+Y140000D01*
+X97950D01*
+G37*
+G36*
+X106050D02*Y134000D01*
+X110550D01*
+Y140000D01*
+X106050D01*
+G37*
+G36*
+X111450D02*Y134000D01*
+X115950D01*
+Y140000D01*
+X111450D01*
+G37*
+G36*
+X116850D02*Y134000D01*
+X121350D01*
+Y140000D01*
+X116850D01*
+G37*
+G36*
+X122250D02*Y134000D01*
+X126750D01*
+Y140000D01*
+X122250D01*
+G37*
+G36*
+X127650D02*Y134000D01*
+X132150D01*
+Y140000D01*
+X127650D01*
+G37*
+G36*
+X135750D02*Y134000D01*
+X140250D01*
+Y140000D01*
+X135750D01*
+G37*
+G36*
+X141150D02*Y134000D01*
+X145650D01*
+Y140000D01*
+X141150D01*
+G37*
+G36*
+X146550D02*Y134000D01*
+X151050D01*
+Y140000D01*
+X146550D01*
+G37*
+G36*
+X151950D02*Y134000D01*
+X156450D01*
+Y140000D01*
+X151950D01*
+G37*
+G36*
+X157350D02*Y134000D01*
+X161850D01*
+Y140000D01*
+X157350D01*
+G37*
+G36*
+X165450D02*Y134000D01*
+X169950D01*
+Y140000D01*
+X165450D01*
+G37*
+G36*
+X170850D02*Y134000D01*
+X175350D01*
+Y140000D01*
+X170850D01*
+G37*
+G36*
+X176250D02*Y134000D01*
+X180750D01*
+Y140000D01*
+X176250D01*
+G37*
+G36*
+X181650D02*Y134000D01*
+X186150D01*
+Y140000D01*
+X181650D01*
+G37*
+G36*
+X189750D02*Y134000D01*
+X194250D01*
+Y140000D01*
+X189750D01*
+G37*
+G36*
+X195150D02*Y134000D01*
+X199650D01*
+Y140000D01*
+X195150D01*
+G37*
+G36*
+X203250D02*Y134000D01*
+X207750D01*
+Y140000D01*
+X203250D01*
+G37*
+G36*
+X208650D02*Y134000D01*
+X213150D01*
+Y140000D01*
+X208650D01*
+G37*
+G36*
+X214050D02*Y134000D01*
+X218550D01*
+Y140000D01*
+X214050D01*
+G37*
+G36*
+X219450D02*Y134000D01*
+X223950D01*
+Y140000D01*
+X219450D01*
+G37*
+G36*
+X227550D02*Y134000D01*
+X232050D01*
+Y140000D01*
+X227550D01*
+G37*
+G36*
+X232950D02*Y134000D01*
+X237450D01*
+Y140000D01*
+X232950D01*
+G37*
+G36*
+X238350D02*Y134000D01*
+X242850D01*
+Y140000D01*
+X238350D01*
+G37*
+G36*
+X243750D02*Y134000D01*
+X248250D01*
+Y140000D01*
+X243750D01*
+G37*
+G36*
+X249150D02*Y134000D01*
+X253650D01*
+Y140000D01*
+X249150D01*
+G37*
+G36*
+X254550D02*Y134000D01*
+X259050D01*
+Y140000D01*
+X254550D01*
+G37*
+G36*
+X259950D02*Y134000D01*
+X264450D01*
+Y140000D01*
+X259950D01*
+G37*
+G54D17*X268050Y136250D02*X271050Y140000D01*
+X268050Y136250D02*X271800D01*
+X271050Y140000D02*Y134000D01*
+G54D18*G36*
+X276300Y140000D02*Y134000D01*
+X280800D01*
+Y140000D01*
+X276300D01*
+G37*
+G36*
+X281700D02*Y134000D01*
+X286200D01*
+Y140000D01*
+X281700D01*
+G37*
+G36*
+X287100D02*Y134000D01*
+X291600D01*
+Y140000D01*
+X287100D01*
+G37*
+G36*
+X292500D02*Y134000D01*
+X297000D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297900D02*Y134000D01*
+X302400D01*
+Y140000D01*
+X297900D01*
+G37*
+G36*
+X306000D02*Y134000D01*
+X310500D01*
+Y140000D01*
+X306000D01*
+G37*
+G36*
+X311400D02*Y134000D01*
+X315900D01*
+Y140000D01*
+X311400D01*
+G37*
+G36*
+X316800D02*Y134000D01*
+X321300D01*
+Y140000D01*
+X316800D01*
+G37*
+G36*
+X322200D02*Y134000D01*
+X326700D01*
+Y140000D01*
+X322200D01*
+G37*
+G36*
+X327600D02*Y134000D01*
+X332100D01*
+Y140000D01*
+X327600D01*
+G37*
+G54D19*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D17*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D18*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D17*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D18*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D17*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D18*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D17*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D18*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D17*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D18*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D17*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D18*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D17*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D18*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D17*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D18*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D17*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D18*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D17*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D18*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D17*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D18*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X272300D02*Y104000D01*
+X276800D01*
+Y110000D01*
+X272300D01*
+G37*
+G36*
+X277700D02*Y104000D01*
+X282200D01*
+Y110000D01*
+X277700D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X296600D02*Y104000D01*
+X301100D01*
+Y110000D01*
+X296600D01*
+G37*
+G36*
+X302000D02*Y104000D01*
+X306500D01*
+Y110000D01*
+X302000D01*
+G37*
+G36*
+X307400D02*Y104000D01*
+X311900D01*
+Y110000D01*
+X307400D01*
+G37*
+G36*
+X312800D02*Y104000D01*
+X317300D01*
+Y110000D01*
+X312800D01*
+G37*
+G36*
+X318200D02*Y104000D01*
+X322700D01*
+Y110000D01*
+X318200D01*
+G37*
+G36*
+X323600D02*Y104000D01*
+X328100D01*
+Y110000D01*
+X323600D01*
+G37*
+G36*
+X331700D02*Y104000D01*
+X336200D01*
+Y110000D01*
+X331700D01*
+G37*
+G36*
+X337100D02*Y104000D01*
+X341600D01*
+Y110000D01*
+X337100D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G36*
+X399200D02*Y104000D01*
+X403700D01*
+Y110000D01*
+X399200D01*
+G37*
+G54D17*X407300D02*Y104000D01*
+Y110000D02*X410300D01*
+X407300Y107300D02*X409550D01*
+G54D18*G36*
+X412100Y110000D02*Y104000D01*
+X416600D01*
+Y110000D01*
+X412100D01*
+G37*
+G36*
+X417500D02*Y104000D01*
+X422000D01*
+Y110000D01*
+X417500D01*
+G37*
+G36*
+X422900D02*Y104000D01*
+X427400D01*
+Y110000D01*
+X422900D01*
+G37*
+G36*
+X428300D02*Y104000D01*
+X432800D01*
+Y110000D01*
+X428300D01*
+G37*
+G36*
+X433700D02*Y104000D01*
+X438200D01*
+Y110000D01*
+X433700D01*
+G37*
+G36*
+X439100D02*Y104000D01*
+X443600D01*
+Y110000D01*
+X439100D01*
+G37*
+G36*
+X444500D02*Y104000D01*
+X449000D01*
+Y110000D01*
+X444500D01*
+G37*
+G36*
+X449900D02*Y104000D01*
+X454400D01*
+Y110000D01*
+X449900D01*
+G37*
+G36*
+X455300D02*Y104000D01*
+X459800D01*
+Y110000D01*
+X455300D01*
+G37*
+G36*
+X460700D02*Y104000D01*
+X465200D01*
+Y110000D01*
+X460700D01*
+G37*
+G54D17*X469550D02*Y104000D01*
+X471500Y110000D02*X472550Y108950D01*
+Y105050D01*
+X471500Y104000D02*X472550Y105050D01*
+X468800Y104000D02*X471500D01*
+X468800Y110000D02*X471500D01*
+G54D18*G36*
+X474350D02*Y104000D01*
+X478850D01*
+Y110000D01*
+X474350D01*
+G37*
+G36*
+X479750D02*Y104000D01*
+X484250D01*
+Y110000D01*
+X479750D01*
+G37*
+G36*
+X485150D02*Y104000D01*
+X489650D01*
+Y110000D01*
+X485150D01*
+G37*
+G36*
+X490550D02*Y104000D01*
+X495050D01*
+Y110000D01*
+X490550D01*
+G37*
+G36*
+X495950D02*Y104000D01*
+X500450D01*
+Y110000D01*
+X495950D01*
+G37*
+G36*
+X501350D02*Y104000D01*
+X505850D01*
+Y110000D01*
+X501350D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.topmask.gbr b/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.topmask.gbr
new file mode 100644
index 0000000..fa84f32
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.gbr/elem_sides_trh.topmask.gbr
@@ -0,0 +1,28 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: thru-hole elements on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD13C,0.0860*%
+%ADD12C,0.0001*%
+G54D12*G36*
+X5700Y39300D02*Y30700D01*
+X14300D01*
+Y39300D01*
+X5700D01*
+G37*
+G54D13*X40000Y35000D03*
+G54D12*G36*
+X5700Y19300D02*Y10700D01*
+X14300D01*
+Y19300D01*
+X5700D01*
+G37*
+G54D13*X40000Y15000D03*
+M02*
diff --git a/tests/RTT/ref/elem_sides_trh.net b/tests/RTT/ref/elem_sides_trh.net
new file mode 100644
index 0000000..1800fd8
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.net
@@ -0,0 +1,16 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB thru-hole elements on both sides
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+317N/C U1 -1 D0393PA00X+001000Y+003500X0800Y0800R000 S0
+317N/C U1 -2 D0393PA00X+004000Y+003500X0800Y0000R000 S0
+317N/C U2 -1 D0393PA00X+001000Y+001500X0800Y0800R000 S0
+317N/C U2 -2 D0393PA00X+004000Y+001500X0800Y0000R000 S0
+999
diff --git a/tests/RTT/ref/elem_sides_trh.png b/tests/RTT/ref/elem_sides_trh.png
new file mode 100644
index 0000000..0e87c23
Binary files /dev/null and b/tests/RTT/ref/elem_sides_trh.png differ
diff --git a/tests/RTT/ref/elem_sides_trh.ps.gz b/tests/RTT/ref/elem_sides_trh.ps.gz
new file mode 100644
index 0000000..0ff4742
Binary files /dev/null and b/tests/RTT/ref/elem_sides_trh.ps.gz differ
diff --git a/tests/RTT/ref/elem_sides_trh.remote.gz b/tests/RTT/ref/elem_sides_trh.remote.gz
new file mode 100644
index 0000000..bb465aa
Binary files /dev/null and b/tests/RTT/ref/elem_sides_trh.remote.gz differ
diff --git a/tests/RTT/ref/elem_sides_trh.svg b/tests/RTT/ref/elem_sides_trh.svg
new file mode 100644
index 0000000..5d0a9eb
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+<!--normal-->
+ <rect x="1.5240" y="2.7940" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <rect x="1.5240" y="7.8740" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <rect x="1.5240" y="2.7940" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <rect x="1.5240" y="7.8740" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <rect x="1.5240" y="2.7940" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <rect x="1.5240" y="7.8740" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <rect x="1.5240" y="2.7940" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <rect x="1.5240" y="7.8740" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="1.2700" y1="2.5400" x2="1.2700" y2="5.0800" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="11.4300" y1="5.0800" x2="1.2700" y2="5.0800" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="11.4300" y1="5.0800" x2="11.4300" y2="2.5400" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="2.5400" x2="5.0800" y2="2.5400" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.6200" y1="2.5400" x2="11.4300" y2="2.5400" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <path d="M 5.0800 2.5400 A 1.2700 1.2700 0 0 0 7.6200 2.5400" stroke-width="0.2540" stroke="#000000" stroke-linecap="round" fill="none"/>
+ <line x1="2.5400" y1="1.2700" x2="2.5400" y2="2.1590" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.5400" y1="2.1590" x2="2.6670" y2="2.2860" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.6670" y1="2.2860" x2="2.9210" y2="2.2860" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.9210" y1="2.2860" x2="3.0480" y2="2.1590" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.0480" y1="1.2700" x2="3.0480" y2="2.1590" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="1.4732" x2="3.5560" y2="1.2700" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.5560" y1="1.2700" x2="3.5560" y2="2.2860" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="2.2860" x2="3.7338" y2="2.2860" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+<g id="layer_-4048_plated-drill">
+<!--normal-->
+ <circle cx="2.5400" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="3.8100" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="8.8900" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/elem_sides_trh.xy b/tests/RTT/ref/elem_sides_trh.xy
new file mode 100644
index 0000000..cf2f82a
--- /dev/null
+++ b/tests/RTT/ref/elem_sides_trh.xy
@@ -0,0 +1,10 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: thru-hole elements on both sides - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+U1,"dip(2)","2*300",250.00,350.00,0,top
+U2,"dip(2)","2*300",250.00,150.00,180,bottom
diff --git a/tests/RTT/ref/layer_copper.bom b/tests/RTT/ref/layer_copper.bom
new file mode 100644
index 0000000..e0cfafc
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: one line per each type of copper layer - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_copper.dsn b/tests/RTT/ref/layer_copper.dsn
new file mode 100644
index 0000000..3e2a87d
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.dsn
@@ -0,0 +1,63 @@
+(pcb one line per each type of copper layer
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.254000 1.270000 10.795000 1.270000 3.810000)
+ (type protect))
+ (wire (path inner1 0.254000 2.540000 8.890000 8.255000 3.175000)
+ (type protect))
+ (wire (path solder1 0.254000 1.905000 10.795000 10.160000 10.795000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/layer_copper.gbr/layer_copper.bottom.gbr b/tests/RTT/ref/layer_copper.gbr/layer_copper.bottom.gbr
new file mode 100644
index 0000000..532e494
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.gbr/layer_copper.bottom.gbr
@@ -0,0 +1,14 @@
+G04 start of page 3 for group 1 layer_idx 1 *
+G04 Title: one line per each type of copper layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOM*%
+%ADD12C,0.0100*%
+G54D12*X7500Y42500D02*X40000D01*
+M02*
diff --git a/tests/RTT/ref/layer_copper.gbr/layer_copper.fab.gbr b/tests/RTT/ref/layer_copper.gbr/layer_copper.fab.gbr
new file mode 100644
index 0000000..f3767f3
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.gbr/layer_copper.fab.gbr
@@ -0,0 +1,1824 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: one line per each type of copper layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD16C,0.0100*%
+%ADD15C,0.0001*%
+%ADD14C,0.0060*%
+G54D14*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D15*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D14*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D15*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D14*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D15*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D14*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D15*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D14*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D15*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D14*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D15*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D16*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D14*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D15*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D14*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D15*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D14*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D15*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D14*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D15*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D14*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D15*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D14*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D15*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D14*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D15*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D14*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D15*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D14*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D15*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D14*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D15*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D14*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D15*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X253400D02*Y104000D01*
+X257900D01*
+Y110000D01*
+X253400D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X277700D02*Y104000D01*
+X282200D01*
+Y110000D01*
+X277700D01*
+G37*
+G36*
+X283100D02*Y104000D01*
+X287600D01*
+Y110000D01*
+X283100D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X296600D02*Y104000D01*
+X301100D01*
+Y110000D01*
+X296600D01*
+G37*
+G36*
+X302000D02*Y104000D01*
+X306500D01*
+Y110000D01*
+X302000D01*
+G37*
+G36*
+X307400D02*Y104000D01*
+X311900D01*
+Y110000D01*
+X307400D01*
+G37*
+G36*
+X312800D02*Y104000D01*
+X317300D01*
+Y110000D01*
+X312800D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X331700D02*Y104000D01*
+X336200D01*
+Y110000D01*
+X331700D01*
+G37*
+G36*
+X337100D02*Y104000D01*
+X341600D01*
+Y110000D01*
+X337100D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X358700D02*Y104000D01*
+X363200D01*
+Y110000D01*
+X358700D01*
+G37*
+G36*
+X364100D02*Y104000D01*
+X368600D01*
+Y110000D01*
+X364100D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X393800D02*Y104000D01*
+X398300D01*
+Y110000D01*
+X393800D01*
+G37*
+G36*
+X399200D02*Y104000D01*
+X403700D01*
+Y110000D01*
+X399200D01*
+G37*
+G36*
+X404600D02*Y104000D01*
+X409100D01*
+Y110000D01*
+X404600D01*
+G37*
+G36*
+X410000D02*Y104000D01*
+X414500D01*
+Y110000D01*
+X410000D01*
+G37*
+G36*
+X415400D02*Y104000D01*
+X419900D01*
+Y110000D01*
+X415400D01*
+G37*
+G36*
+X423500D02*Y104000D01*
+X428000D01*
+Y110000D01*
+X423500D01*
+G37*
+G54D14*X431600D02*Y104000D01*
+Y110000D02*X434600D01*
+X431600Y107300D02*X433850D01*
+G54D15*G36*
+X436400Y110000D02*Y104000D01*
+X440900D01*
+Y110000D01*
+X436400D01*
+G37*
+G36*
+X441800D02*Y104000D01*
+X446300D01*
+Y110000D01*
+X441800D01*
+G37*
+G36*
+X447200D02*Y104000D01*
+X451700D01*
+Y110000D01*
+X447200D01*
+G37*
+G36*
+X452600D02*Y104000D01*
+X457100D01*
+Y110000D01*
+X452600D01*
+G37*
+G36*
+X458000D02*Y104000D01*
+X462500D01*
+Y110000D01*
+X458000D01*
+G37*
+G36*
+X463400D02*Y104000D01*
+X467900D01*
+Y110000D01*
+X463400D01*
+G37*
+G36*
+X468800D02*Y104000D01*
+X473300D01*
+Y110000D01*
+X468800D01*
+G37*
+G36*
+X474200D02*Y104000D01*
+X478700D01*
+Y110000D01*
+X474200D01*
+G37*
+G36*
+X479600D02*Y104000D01*
+X484100D01*
+Y110000D01*
+X479600D01*
+G37*
+G36*
+X485000D02*Y104000D01*
+X489500D01*
+Y110000D01*
+X485000D01*
+G37*
+G54D14*X493850D02*Y104000D01*
+X495800Y110000D02*X496850Y108950D01*
+Y105050D01*
+X495800Y104000D02*X496850Y105050D01*
+X493100Y104000D02*X495800D01*
+X493100Y110000D02*X495800D01*
+G54D15*G36*
+X498650D02*Y104000D01*
+X503150D01*
+Y110000D01*
+X498650D01*
+G37*
+G36*
+X504050D02*Y104000D01*
+X508550D01*
+Y110000D01*
+X504050D01*
+G37*
+G36*
+X509450D02*Y104000D01*
+X513950D01*
+Y110000D01*
+X509450D01*
+G37*
+G36*
+X514850D02*Y104000D01*
+X519350D01*
+Y110000D01*
+X514850D01*
+G37*
+G36*
+X520250D02*Y104000D01*
+X524750D01*
+Y110000D01*
+X520250D01*
+G37*
+G36*
+X525650D02*Y104000D01*
+X530150D01*
+Y110000D01*
+X525650D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/layer_copper.gbr/layer_copper.group2.gbr b/tests/RTT/ref/layer_copper.gbr/layer_copper.group2.gbr
new file mode 100644
index 0000000..3a94227
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.gbr/layer_copper.group2.gbr
@@ -0,0 +1,14 @@
+G04 start of page 4 for group 2 layer_idx 4 *
+G04 Title: one line per each type of copper layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNGROUP2*%
+%ADD13C,0.0100*%
+G54D13*X10000Y35000D02*X32500Y12500D01*
+M02*
diff --git a/tests/RTT/ref/layer_copper.gbr/layer_copper.top.gbr b/tests/RTT/ref/layer_copper.gbr/layer_copper.top.gbr
new file mode 100644
index 0000000..24a17ac
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.gbr/layer_copper.top.gbr
@@ -0,0 +1,14 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: one line per each type of copper layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0100*%
+G54D11*X5000Y42500D02*Y15000D01*
+M02*
diff --git a/tests/RTT/ref/layer_copper.net b/tests/RTT/ref/layer_copper.net
new file mode 100644
index 0000000..8c4788d
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB one line per each type of copper layer
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/layer_copper.png b/tests/RTT/ref/layer_copper.png
new file mode 100644
index 0000000..9e8ce3d
Binary files /dev/null and b/tests/RTT/ref/layer_copper.png differ
diff --git a/tests/RTT/ref/layer_copper.ps.gz b/tests/RTT/ref/layer_copper.ps.gz
new file mode 100644
index 0000000..9e03ad5
Binary files /dev/null and b/tests/RTT/ref/layer_copper.ps.gz differ
diff --git a/tests/RTT/ref/layer_copper.remote.gz b/tests/RTT/ref/layer_copper.remote.gz
new file mode 100644
index 0000000..6d625a4
Binary files /dev/null and b/tests/RTT/ref/layer_copper.remote.gz differ
diff --git a/tests/RTT/ref/layer_copper.svg b/tests/RTT/ref/layer_copper.svg
new file mode 100644
index 0000000..9218cfd
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <line x1="2.5400" y1="3.8100" x2="8.2550" y2="9.5250" stroke-width="0.2540" stroke="#548b54" stroke-linecap="round"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <line x1="1.9050" y1="1.9050" x2="10.1600" y2="1.9050" stroke-width="0.2540" stroke="#3a5fcd" stroke-linecap="round"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="1.2700" y1="1.9050" x2="1.2700" y2="8.8900" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/layer_copper.xy b/tests/RTT/ref/layer_copper.xy
new file mode 100644
index 0000000..3dd4500
--- /dev/null
+++ b/tests/RTT/ref/layer_copper.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: one line per each type of copper layer - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_outline.bom b/tests/RTT/ref/layer_outline.bom
new file mode 100644
index 0000000..78391fa
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: outline layer triangle - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_outline.dsn b/tests/RTT/ref/layer_outline.dsn
new file mode 100644
index 0000000..0c90e12
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.dsn
@@ -0,0 +1,63 @@
+(pcb outline layer triangle
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path outline 0.254000 1.905000 10.160000 1.905000 2.540000)
+ (type protect))
+ (wire (path outline 0.254000 1.905000 2.540000 9.525000 2.540000)
+ (type protect))
+ (wire (path outline 0.254000 9.525000 2.540000 1.905000 10.160000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/layer_outline.gbr/layer_outline.fab.gbr b/tests/RTT/ref/layer_outline.gbr/layer_outline.fab.gbr
new file mode 100644
index 0000000..296ba7b
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.gbr/layer_outline.fab.gbr
@@ -0,0 +1,1126 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: outline layer triangle, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X7500Y40000D02*Y10000D01*
+X37500D01*
+X7500Y40000D01*
+G54D12*X12775Y-8000D02*X15775D01*
+X16525Y-7250D01*
+Y-5450D02*Y-7250D01*
+X15775Y-4700D02*X16525Y-5450D01*
+X13525Y-4700D02*X15775D01*
+X13525Y-2000D02*Y-8000D01*
+X12775Y-2000D02*X15775D01*
+X16525Y-2750D01*
+Y-3950D01*
+X15775Y-4700D02*X16525Y-3950D01*
+G54D13*G36*
+X18325Y-2000D02*Y-8000D01*
+X22825D01*
+Y-2000D01*
+X18325D01*
+G37*
+G36*
+X23725D02*Y-8000D01*
+X28225D01*
+Y-2000D01*
+X23725D01*
+G37*
+G36*
+X29125D02*Y-8000D01*
+X33625D01*
+Y-2000D01*
+X29125D01*
+G37*
+G36*
+X34525D02*Y-8000D01*
+X39025D01*
+Y-2000D01*
+X34525D01*
+G37*
+G36*
+X42625D02*Y-8000D01*
+X47125D01*
+Y-2000D01*
+X42625D01*
+G37*
+G36*
+X48025D02*Y-8000D01*
+X52525D01*
+Y-2000D01*
+X48025D01*
+G37*
+G36*
+X53425D02*Y-8000D01*
+X57925D01*
+Y-2000D01*
+X53425D01*
+G37*
+G36*
+X58825D02*Y-8000D01*
+X63325D01*
+Y-2000D01*
+X58825D01*
+G37*
+G36*
+X64225D02*Y-8000D01*
+X68725D01*
+Y-2000D01*
+X64225D01*
+G37*
+G36*
+X69625D02*Y-8000D01*
+X74125D01*
+Y-2000D01*
+X69625D01*
+G37*
+G36*
+X75025D02*Y-8000D01*
+X79525D01*
+Y-2000D01*
+X75025D01*
+G37*
+G36*
+X83125D02*Y-8000D01*
+X87625D01*
+Y-2000D01*
+X83125D01*
+G37*
+G36*
+X88525D02*Y-8000D01*
+X93025D01*
+Y-2000D01*
+X88525D01*
+G37*
+G36*
+X96625D02*Y-8000D01*
+X101125D01*
+Y-2000D01*
+X96625D01*
+G37*
+G36*
+X102025D02*Y-8000D01*
+X106525D01*
+Y-2000D01*
+X102025D01*
+G37*
+G36*
+X107425D02*Y-8000D01*
+X111925D01*
+Y-2000D01*
+X107425D01*
+G37*
+G36*
+X115525D02*Y-8000D01*
+X120025D01*
+Y-2000D01*
+X115525D01*
+G37*
+G36*
+X120925D02*Y-8000D01*
+X125425D01*
+Y-2000D01*
+X120925D01*
+G37*
+G36*
+X126325D02*Y-8000D01*
+X130825D01*
+Y-2000D01*
+X126325D01*
+G37*
+G36*
+X131725D02*Y-8000D01*
+X136225D01*
+Y-2000D01*
+X131725D01*
+G37*
+G36*
+X137125D02*Y-8000D01*
+X141625D01*
+Y-2000D01*
+X137125D01*
+G37*
+G36*
+X142525D02*Y-8000D01*
+X147025D01*
+Y-2000D01*
+X142525D01*
+G37*
+G36*
+X147925D02*Y-8000D01*
+X152425D01*
+Y-2000D01*
+X147925D01*
+G37*
+G36*
+X153325D02*Y-8000D01*
+X157825D01*
+Y-2000D01*
+X153325D01*
+G37*
+G36*
+X158725D02*Y-8000D01*
+X163225D01*
+Y-2000D01*
+X158725D01*
+G37*
+G36*
+X164125D02*Y-8000D01*
+X168625D01*
+Y-2000D01*
+X164125D01*
+G37*
+G36*
+X172225D02*Y-8000D01*
+X176725D01*
+Y-2000D01*
+X172225D01*
+G37*
+G36*
+X177625D02*Y-8000D01*
+X182125D01*
+Y-2000D01*
+X177625D01*
+G37*
+G36*
+X185725D02*Y-8000D01*
+X190225D01*
+Y-2000D01*
+X185725D01*
+G37*
+G36*
+X191125D02*Y-8000D01*
+X195625D01*
+Y-2000D01*
+X191125D01*
+G37*
+G36*
+X196525D02*Y-8000D01*
+X201025D01*
+Y-2000D01*
+X196525D01*
+G37*
+G36*
+X201925D02*Y-8000D01*
+X206425D01*
+Y-2000D01*
+X201925D01*
+G37*
+G36*
+X210025D02*Y-8000D01*
+X214525D01*
+Y-2000D01*
+X210025D01*
+G37*
+G36*
+X215425D02*Y-8000D01*
+X219925D01*
+Y-2000D01*
+X215425D01*
+G37*
+G36*
+X220825D02*Y-8000D01*
+X225325D01*
+Y-2000D01*
+X220825D01*
+G37*
+G36*
+X226225D02*Y-8000D01*
+X230725D01*
+Y-2000D01*
+X226225D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X296600D02*Y104000D01*
+X301100D01*
+Y110000D01*
+X296600D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X331700D02*Y104000D01*
+X336200D01*
+Y110000D01*
+X331700D01*
+G37*
+G36*
+X337100D02*Y104000D01*
+X341600D01*
+Y110000D01*
+X337100D01*
+G37*
+G36*
+X342500D02*Y104000D01*
+X347000D01*
+Y110000D01*
+X342500D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G54D12*X358700D02*Y104000D01*
+Y110000D02*X361700D01*
+X358700Y107300D02*X360950D01*
+G54D13*G36*
+X363500Y110000D02*Y104000D01*
+X368000D01*
+Y110000D01*
+X363500D01*
+G37*
+G36*
+X368900D02*Y104000D01*
+X373400D01*
+Y110000D01*
+X368900D01*
+G37*
+G36*
+X374300D02*Y104000D01*
+X378800D01*
+Y110000D01*
+X374300D01*
+G37*
+G36*
+X379700D02*Y104000D01*
+X384200D01*
+Y110000D01*
+X379700D01*
+G37*
+G36*
+X385100D02*Y104000D01*
+X389600D01*
+Y110000D01*
+X385100D01*
+G37*
+G36*
+X390500D02*Y104000D01*
+X395000D01*
+Y110000D01*
+X390500D01*
+G37*
+G36*
+X395900D02*Y104000D01*
+X400400D01*
+Y110000D01*
+X395900D01*
+G37*
+G36*
+X401300D02*Y104000D01*
+X405800D01*
+Y110000D01*
+X401300D01*
+G37*
+G36*
+X406700D02*Y104000D01*
+X411200D01*
+Y110000D01*
+X406700D01*
+G37*
+G36*
+X412100D02*Y104000D01*
+X416600D01*
+Y110000D01*
+X412100D01*
+G37*
+G54D12*X420950D02*Y104000D01*
+X422900Y110000D02*X423950Y108950D01*
+Y105050D01*
+X422900Y104000D02*X423950Y105050D01*
+X420200Y104000D02*X422900D01*
+X420200Y110000D02*X422900D01*
+G54D13*G36*
+X425750D02*Y104000D01*
+X430250D01*
+Y110000D01*
+X425750D01*
+G37*
+G36*
+X431150D02*Y104000D01*
+X435650D01*
+Y110000D01*
+X431150D01*
+G37*
+G36*
+X436550D02*Y104000D01*
+X441050D01*
+Y110000D01*
+X436550D01*
+G37*
+G36*
+X441950D02*Y104000D01*
+X446450D01*
+Y110000D01*
+X441950D01*
+G37*
+G36*
+X447350D02*Y104000D01*
+X451850D01*
+Y110000D01*
+X447350D01*
+G37*
+G36*
+X452750D02*Y104000D01*
+X457250D01*
+Y110000D01*
+X452750D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/layer_outline.gbr/layer_outline.outline.gbr b/tests/RTT/ref/layer_outline.gbr/layer_outline.outline.gbr
new file mode 100644
index 0000000..a62866e
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.gbr/layer_outline.outline.gbr
@@ -0,0 +1,16 @@
+G04 start of page 2 for group 4 layer_idx 6 *
+G04 Title: outline layer triangle, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNOUTLINE*%
+%ADD11C,0.0100*%
+G54D11*X7500Y40000D02*Y10000D01*
+X37500D01*
+X7500Y40000D01*
+M02*
diff --git a/tests/RTT/ref/layer_outline.net b/tests/RTT/ref/layer_outline.net
new file mode 100644
index 0000000..53e5d0d
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB outline layer triangle
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/layer_outline.png b/tests/RTT/ref/layer_outline.png
new file mode 100644
index 0000000..ada51ac
Binary files /dev/null and b/tests/RTT/ref/layer_outline.png differ
diff --git a/tests/RTT/ref/layer_outline.ps.gz b/tests/RTT/ref/layer_outline.ps.gz
new file mode 100644
index 0000000..43767d5
Binary files /dev/null and b/tests/RTT/ref/layer_outline.ps.gz differ
diff --git a/tests/RTT/ref/layer_outline.remote.gz b/tests/RTT/ref/layer_outline.remote.gz
new file mode 100644
index 0000000..2859abc
Binary files /dev/null and b/tests/RTT/ref/layer_outline.remote.gz differ
diff --git a/tests/RTT/ref/layer_outline.svg b/tests/RTT/ref/layer_outline.svg
new file mode 100644
index 0000000..dfe913a
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <line x1="1.9050" y1="2.5400" x2="1.9050" y2="10.1600" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round"/>
+ <line x1="1.9050" y1="10.1600" x2="9.5250" y2="10.1600" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round"/>
+ <line x1="9.5250" y1="10.1600" x2="1.9050" y2="2.5400" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/layer_outline.xy b/tests/RTT/ref/layer_outline.xy
new file mode 100644
index 0000000..0a7732e
--- /dev/null
+++ b/tests/RTT/ref/layer_outline.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: outline layer triangle - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_silk.bom b/tests/RTT/ref/layer_silk.bom
new file mode 100644
index 0000000..91d18d9
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: one line on each silk layer - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_silk.dsn b/tests/RTT/ref/layer_silk.dsn
new file mode 100644
index 0000000..f65c09a
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.dsn
@@ -0,0 +1,57 @@
+(pcb one line on each silk layer
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/layer_silk.gbr/layer_silk.bottomsilk.gbr b/tests/RTT/ref/layer_silk.gbr/layer_silk.bottomsilk.gbr
new file mode 100644
index 0000000..6c3a509
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.gbr/layer_silk.bottomsilk.gbr
@@ -0,0 +1,14 @@
+G04 start of page 3 for group 1 layer_idx 7 *
+G04 Title: one line on each silk layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMSILK*%
+%ADD12C,0.0100*%
+G54D12*X7500Y7500D02*X30000Y30000D01*
+M02*
diff --git a/tests/RTT/ref/layer_silk.gbr/layer_silk.fab.gbr b/tests/RTT/ref/layer_silk.gbr/layer_silk.fab.gbr
new file mode 100644
index 0000000..8ca3956
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.gbr/layer_silk.fab.gbr
@@ -0,0 +1,1770 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: one line on each silk layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD15C,0.0100*%
+%ADD14C,0.0001*%
+%ADD13C,0.0060*%
+G54D13*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D14*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D13*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D14*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D13*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D14*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D13*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D14*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D13*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D14*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D13*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D14*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D15*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D13*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D14*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D13*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D14*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D13*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D14*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D13*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D14*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D13*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D14*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D13*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D14*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D13*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D14*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D13*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D14*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D13*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D14*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D13*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D14*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D13*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D14*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X253400D02*Y104000D01*
+X257900D01*
+Y110000D01*
+X253400D01*
+G37*
+G36*
+X258800D02*Y104000D01*
+X263300D01*
+Y110000D01*
+X258800D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X277700D02*Y104000D01*
+X282200D01*
+Y110000D01*
+X277700D01*
+G37*
+G36*
+X283100D02*Y104000D01*
+X287600D01*
+Y110000D01*
+X283100D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X296600D02*Y104000D01*
+X301100D01*
+Y110000D01*
+X296600D01*
+G37*
+G36*
+X302000D02*Y104000D01*
+X306500D01*
+Y110000D01*
+X302000D01*
+G37*
+G36*
+X307400D02*Y104000D01*
+X311900D01*
+Y110000D01*
+X307400D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X331700D02*Y104000D01*
+X336200D01*
+Y110000D01*
+X331700D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G54D13*X377600D02*Y104000D01*
+Y110000D02*X380600D01*
+X377600Y107300D02*X379850D01*
+G54D14*G36*
+X382400Y110000D02*Y104000D01*
+X386900D01*
+Y110000D01*
+X382400D01*
+G37*
+G36*
+X387800D02*Y104000D01*
+X392300D01*
+Y110000D01*
+X387800D01*
+G37*
+G36*
+X393200D02*Y104000D01*
+X397700D01*
+Y110000D01*
+X393200D01*
+G37*
+G36*
+X398600D02*Y104000D01*
+X403100D01*
+Y110000D01*
+X398600D01*
+G37*
+G36*
+X404000D02*Y104000D01*
+X408500D01*
+Y110000D01*
+X404000D01*
+G37*
+G36*
+X409400D02*Y104000D01*
+X413900D01*
+Y110000D01*
+X409400D01*
+G37*
+G36*
+X414800D02*Y104000D01*
+X419300D01*
+Y110000D01*
+X414800D01*
+G37*
+G36*
+X420200D02*Y104000D01*
+X424700D01*
+Y110000D01*
+X420200D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G54D13*X439850D02*Y104000D01*
+X441800Y110000D02*X442850Y108950D01*
+Y105050D01*
+X441800Y104000D02*X442850Y105050D01*
+X439100Y104000D02*X441800D01*
+X439100Y110000D02*X441800D01*
+G54D14*G36*
+X444650D02*Y104000D01*
+X449150D01*
+Y110000D01*
+X444650D01*
+G37*
+G36*
+X450050D02*Y104000D01*
+X454550D01*
+Y110000D01*
+X450050D01*
+G37*
+G36*
+X455450D02*Y104000D01*
+X459950D01*
+Y110000D01*
+X455450D01*
+G37*
+G36*
+X460850D02*Y104000D01*
+X465350D01*
+Y110000D01*
+X460850D01*
+G37*
+G36*
+X466250D02*Y104000D01*
+X470750D01*
+Y110000D01*
+X466250D01*
+G37*
+G36*
+X471650D02*Y104000D01*
+X476150D01*
+Y110000D01*
+X471650D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/layer_silk.gbr/layer_silk.topsilk.gbr b/tests/RTT/ref/layer_silk.gbr/layer_silk.topsilk.gbr
new file mode 100644
index 0000000..3acfda2
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.gbr/layer_silk.topsilk.gbr
@@ -0,0 +1,14 @@
+G04 start of page 2 for group 0 layer_idx 8 *
+G04 Title: one line on each silk layer, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD11C,0.0100*%
+G54D11*X5000Y45000D02*Y7500D01*
+M02*
diff --git a/tests/RTT/ref/layer_silk.net b/tests/RTT/ref/layer_silk.net
new file mode 100644
index 0000000..6a4049c
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB one line on each silk layer
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/layer_silk.png b/tests/RTT/ref/layer_silk.png
new file mode 100644
index 0000000..df4d309
Binary files /dev/null and b/tests/RTT/ref/layer_silk.png differ
diff --git a/tests/RTT/ref/layer_silk.png.text b/tests/RTT/ref/layer_silk.png.text
new file mode 100644
index 0000000..a15e370
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.png.text
@@ -0,0 +1,6 @@
+
+
+line
+width 12 pixels
+length 462 pixels
+
diff --git a/tests/RTT/ref/layer_silk.ps.gz b/tests/RTT/ref/layer_silk.ps.gz
new file mode 100644
index 0000000..48b2816
Binary files /dev/null and b/tests/RTT/ref/layer_silk.ps.gz differ
diff --git a/tests/RTT/ref/layer_silk.remote.gz b/tests/RTT/ref/layer_silk.remote.gz
new file mode 100644
index 0000000..d0d188d
Binary files /dev/null and b/tests/RTT/ref/layer_silk.remote.gz differ
diff --git a/tests/RTT/ref/layer_silk.svg b/tests/RTT/ref/layer_silk.svg
new file mode 100644
index 0000000..496f815
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="1.2700" y1="1.2700" x2="1.2700" y2="10.7950" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/layer_silk.xy b/tests/RTT/ref/layer_silk.xy
new file mode 100644
index 0000000..58cc297
--- /dev/null
+++ b/tests/RTT/ref/layer_silk.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: one line on each silk layer - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_spc.bom b/tests/RTT/ref/layer_spc.bom
new file mode 100644
index 0000000..b1bf8c2
--- /dev/null
+++ b/tests/RTT/ref/layer_spc.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: space (and other dangerous characters) in layer name - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/layer_spc.dsn b/tests/RTT/ref/layer_spc.dsn
new file mode 100644
index 0000000..3339f81
--- /dev/null
+++ b/tests/RTT/ref/layer_spc.dsn
@@ -0,0 +1,57 @@
+(pcb space (and other dangerous characters) in layer name
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "component 1"
+ (type signal)
+ )
+ (layer "inner(1)"
+ (type signal)
+ )
+ (layer "inner/2"
+ (type signal)
+ )
+ (layer "out:line"
+ (type signal)
+ )
+ (layer "solder 1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/layer_spc.gbr/layer_spc.fab.gbr b/tests/RTT/ref/layer_spc.gbr/layer_spc.fab.gbr
new file mode 100644
index 0000000..aa3ef01
--- /dev/null
+++ b/tests/RTT/ref/layer_spc.gbr/layer_spc.fab.gbr
@@ -0,0 +1,1908 @@
+G04 start of page 2 for group -1 layer_idx -1 *
+G04 Title: space (and other dangerous characters) in layer name, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD13C,0.0100*%
+%ADD12C,0.0001*%
+%ADD11C,0.0060*%
+G54D11*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D12*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D11*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D12*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D11*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D12*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D11*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D12*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D11*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D12*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D11*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D12*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D13*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D11*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D12*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D11*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D12*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D11*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D12*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D11*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D12*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D11*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D12*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D11*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D12*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D11*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D12*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D11*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D12*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D11*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D12*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D11*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D12*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D11*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D12*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X318200D02*Y104000D01*
+X322700D01*
+Y110000D01*
+X318200D01*
+G37*
+G36*
+X323600D02*Y104000D01*
+X328100D01*
+Y110000D01*
+X323600D01*
+G37*
+G36*
+X329000D02*Y104000D01*
+X333500D01*
+Y110000D01*
+X329000D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G36*
+X396500D02*Y104000D01*
+X401000D01*
+Y110000D01*
+X396500D01*
+G37*
+G36*
+X401900D02*Y104000D01*
+X406400D01*
+Y110000D01*
+X401900D01*
+G37*
+G36*
+X407300D02*Y104000D01*
+X411800D01*
+Y110000D01*
+X407300D01*
+G37*
+G36*
+X412700D02*Y104000D01*
+X417200D01*
+Y110000D01*
+X412700D01*
+G37*
+G36*
+X418100D02*Y104000D01*
+X422600D01*
+Y110000D01*
+X418100D01*
+G37*
+G36*
+X423500D02*Y104000D01*
+X428000D01*
+Y110000D01*
+X423500D01*
+G37*
+G36*
+X431600D02*Y104000D01*
+X436100D01*
+Y110000D01*
+X431600D01*
+G37*
+G36*
+X437000D02*Y104000D01*
+X441500D01*
+Y110000D01*
+X437000D01*
+G37*
+G36*
+X445100D02*Y104000D01*
+X449600D01*
+Y110000D01*
+X445100D01*
+G37*
+G36*
+X450500D02*Y104000D01*
+X455000D01*
+Y110000D01*
+X450500D01*
+G37*
+G36*
+X455900D02*Y104000D01*
+X460400D01*
+Y110000D01*
+X455900D01*
+G37*
+G36*
+X461300D02*Y104000D01*
+X465800D01*
+Y110000D01*
+X461300D01*
+G37*
+G36*
+X466700D02*Y104000D01*
+X471200D01*
+Y110000D01*
+X466700D01*
+G37*
+G36*
+X474800D02*Y104000D01*
+X479300D01*
+Y110000D01*
+X474800D01*
+G37*
+G36*
+X480200D02*Y104000D01*
+X484700D01*
+Y110000D01*
+X480200D01*
+G37*
+G36*
+X485600D02*Y104000D01*
+X490100D01*
+Y110000D01*
+X485600D01*
+G37*
+G36*
+X491000D02*Y104000D01*
+X495500D01*
+Y110000D01*
+X491000D01*
+G37*
+G36*
+X499100D02*Y104000D01*
+X503600D01*
+Y110000D01*
+X499100D01*
+G37*
+G54D11*X507200D02*Y104000D01*
+Y110000D02*X510200D01*
+X507200Y107300D02*X509450D01*
+G54D12*G36*
+X512000Y110000D02*Y104000D01*
+X516500D01*
+Y110000D01*
+X512000D01*
+G37*
+G36*
+X517400D02*Y104000D01*
+X521900D01*
+Y110000D01*
+X517400D01*
+G37*
+G36*
+X522800D02*Y104000D01*
+X527300D01*
+Y110000D01*
+X522800D01*
+G37*
+G36*
+X528200D02*Y104000D01*
+X532700D01*
+Y110000D01*
+X528200D01*
+G37*
+G36*
+X533600D02*Y104000D01*
+X538100D01*
+Y110000D01*
+X533600D01*
+G37*
+G36*
+X539000D02*Y104000D01*
+X543500D01*
+Y110000D01*
+X539000D01*
+G37*
+G36*
+X544400D02*Y104000D01*
+X548900D01*
+Y110000D01*
+X544400D01*
+G37*
+G36*
+X549800D02*Y104000D01*
+X554300D01*
+Y110000D01*
+X549800D01*
+G37*
+G36*
+X555200D02*Y104000D01*
+X559700D01*
+Y110000D01*
+X555200D01*
+G37*
+G36*
+X560600D02*Y104000D01*
+X565100D01*
+Y110000D01*
+X560600D01*
+G37*
+G54D11*X569450D02*Y104000D01*
+X571400Y110000D02*X572450Y108950D01*
+Y105050D01*
+X571400Y104000D02*X572450Y105050D01*
+X568700Y104000D02*X571400D01*
+X568700Y110000D02*X571400D01*
+G54D12*G36*
+X574250D02*Y104000D01*
+X578750D01*
+Y110000D01*
+X574250D01*
+G37*
+G36*
+X579650D02*Y104000D01*
+X584150D01*
+Y110000D01*
+X579650D01*
+G37*
+G36*
+X585050D02*Y104000D01*
+X589550D01*
+Y110000D01*
+X585050D01*
+G37*
+G36*
+X590450D02*Y104000D01*
+X594950D01*
+Y110000D01*
+X590450D01*
+G37*
+G36*
+X595850D02*Y104000D01*
+X600350D01*
+Y110000D01*
+X595850D01*
+G37*
+G36*
+X601250D02*Y104000D01*
+X605750D01*
+Y110000D01*
+X601250D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/layer_spc.net b/tests/RTT/ref/layer_spc.net
new file mode 100644
index 0000000..50d3283
--- /dev/null
+++ b/tests/RTT/ref/layer_spc.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB space (and other dangerous characters) in layer name
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/layer_spc.png b/tests/RTT/ref/layer_spc.png
new file mode 100644
index 0000000..852eb60
Binary files /dev/null and b/tests/RTT/ref/layer_spc.png differ
diff --git a/tests/RTT/ref/layer_spc.ps.gz b/tests/RTT/ref/layer_spc.ps.gz
new file mode 100644
index 0000000..7c66117
Binary files /dev/null and b/tests/RTT/ref/layer_spc.ps.gz differ
diff --git a/tests/RTT/ref/layer_spc.remote.gz b/tests/RTT/ref/layer_spc.remote.gz
new file mode 100644
index 0000000..6764471
Binary files /dev/null and b/tests/RTT/ref/layer_spc.remote.gz differ
diff --git a/tests/RTT/ref/layer_spc.svg b/tests/RTT/ref/layer_spc.svg
new file mode 100644
index 0000000..1e3d86f
--- /dev/null
+++ b/tests/RTT/ref/layer_spc.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/layer_spc.xy b/tests/RTT/ref/layer_spc.xy
new file mode 100644
index 0000000..8291806
--- /dev/null
+++ b/tests/RTT/ref/layer_spc.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: space (and other dangerous characters) in layer name - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_f_clear.bom b/tests/RTT/ref/line_f_clear.bom
new file mode 100644
index 0000000..d128977
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Clear and no-clear lines - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_f_clear.dsn b/tests/RTT/ref/line_f_clear.dsn
new file mode 100644
index 0000000..8f426d9
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.dsn
@@ -0,0 +1,65 @@
+(pcb Clear and no-clear lines
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.381000 3.175000 6.350000 10.160000 6.350000)
+ (type protect))
+ (wire (path comp1 0.254000 6.350000 9.525000 6.350000 3.175000)
+ (type protect))
+ (wire (path comp1 0.508000 6.350000 6.350000 10.160000 7.620000)
+ (type protect))
+ (wire (path comp1 0.127000 6.350000 6.350000 3.810000 8.890000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_f_clear.gbr/line_f_clear.fab.gbr b/tests/RTT/ref/line_f_clear.gbr/line_f_clear.fab.gbr
new file mode 100644
index 0000000..d946f35
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.gbr/line_f_clear.fab.gbr
@@ -0,0 +1,1763 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Clear and no-clear lines, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD18C,0.0100*%
+%ADD17C,0.0001*%
+%ADD16C,0.0060*%
+G54D16*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D17*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D16*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D17*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D16*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D17*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D16*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D17*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D16*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D17*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D16*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D17*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D18*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D16*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D17*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D16*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D17*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D16*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D17*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D16*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D17*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D16*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D17*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D16*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D17*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D16*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D17*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D16*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D17*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D16*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D17*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D16*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D17*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D16*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D17*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D16*X235550Y104000D02*X237500D01*
+X234500Y105050D02*X235550Y104000D01*
+X234500Y108950D02*Y105050D01*
+Y108950D02*X235550Y110000D01*
+X237500D01*
+G54D17*G36*
+X239300D02*Y104000D01*
+X243800D01*
+Y110000D01*
+X239300D01*
+G37*
+G36*
+X244700D02*Y104000D01*
+X249200D01*
+Y110000D01*
+X244700D01*
+G37*
+G36*
+X250100D02*Y104000D01*
+X254600D01*
+Y110000D01*
+X250100D01*
+G37*
+G36*
+X255500D02*Y104000D01*
+X260000D01*
+Y110000D01*
+X255500D01*
+G37*
+G36*
+X263600D02*Y104000D01*
+X268100D01*
+Y110000D01*
+X263600D01*
+G37*
+G36*
+X269000D02*Y104000D01*
+X273500D01*
+Y110000D01*
+X269000D01*
+G37*
+G36*
+X274400D02*Y104000D01*
+X278900D01*
+Y110000D01*
+X274400D01*
+G37*
+G36*
+X282500D02*Y104000D01*
+X287000D01*
+Y110000D01*
+X282500D01*
+G37*
+G36*
+X287900D02*Y104000D01*
+X292400D01*
+Y110000D01*
+X287900D01*
+G37*
+G36*
+X293300D02*Y104000D01*
+X297800D01*
+Y110000D01*
+X293300D01*
+G37*
+G36*
+X298700D02*Y104000D01*
+X303200D01*
+Y110000D01*
+X298700D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X320300D02*Y104000D01*
+X324800D01*
+Y110000D01*
+X320300D01*
+G37*
+G36*
+X328400D02*Y104000D01*
+X332900D01*
+Y110000D01*
+X328400D01*
+G37*
+G36*
+X333800D02*Y104000D01*
+X338300D01*
+Y110000D01*
+X333800D01*
+G37*
+G36*
+X339200D02*Y104000D01*
+X343700D01*
+Y110000D01*
+X339200D01*
+G37*
+G36*
+X344600D02*Y104000D01*
+X349100D01*
+Y110000D01*
+X344600D01*
+G37*
+G36*
+X350000D02*Y104000D01*
+X354500D01*
+Y110000D01*
+X350000D01*
+G37*
+G36*
+X358100D02*Y104000D01*
+X362600D01*
+Y110000D01*
+X358100D01*
+G37*
+G54D16*X366200D02*Y104000D01*
+Y110000D02*X369200D01*
+X366200Y107300D02*X368450D01*
+G54D17*G36*
+X371000Y110000D02*Y104000D01*
+X375500D01*
+Y110000D01*
+X371000D01*
+G37*
+G36*
+X376400D02*Y104000D01*
+X380900D01*
+Y110000D01*
+X376400D01*
+G37*
+G36*
+X381800D02*Y104000D01*
+X386300D01*
+Y110000D01*
+X381800D01*
+G37*
+G36*
+X387200D02*Y104000D01*
+X391700D01*
+Y110000D01*
+X387200D01*
+G37*
+G36*
+X392600D02*Y104000D01*
+X397100D01*
+Y110000D01*
+X392600D01*
+G37*
+G36*
+X398000D02*Y104000D01*
+X402500D01*
+Y110000D01*
+X398000D01*
+G37*
+G36*
+X403400D02*Y104000D01*
+X407900D01*
+Y110000D01*
+X403400D01*
+G37*
+G36*
+X408800D02*Y104000D01*
+X413300D01*
+Y110000D01*
+X408800D01*
+G37*
+G36*
+X414200D02*Y104000D01*
+X418700D01*
+Y110000D01*
+X414200D01*
+G37*
+G36*
+X419600D02*Y104000D01*
+X424100D01*
+Y110000D01*
+X419600D01*
+G37*
+G54D16*X428450D02*Y104000D01*
+X430400Y110000D02*X431450Y108950D01*
+Y105050D01*
+X430400Y104000D02*X431450Y105050D01*
+X427700Y104000D02*X430400D01*
+X427700Y110000D02*X430400D01*
+G54D17*G36*
+X433250D02*Y104000D01*
+X437750D01*
+Y110000D01*
+X433250D01*
+G37*
+G36*
+X438650D02*Y104000D01*
+X443150D01*
+Y110000D01*
+X438650D01*
+G37*
+G36*
+X444050D02*Y104000D01*
+X448550D01*
+Y110000D01*
+X444050D01*
+G37*
+G36*
+X449450D02*Y104000D01*
+X453950D01*
+Y110000D01*
+X449450D01*
+G37*
+G36*
+X454850D02*Y104000D01*
+X459350D01*
+Y110000D01*
+X454850D01*
+G37*
+G36*
+X460250D02*Y104000D01*
+X464750D01*
+Y110000D01*
+X460250D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_f_clear.gbr/line_f_clear.top.gbr b/tests/RTT/ref/line_f_clear.gbr/line_f_clear.top.gbr
new file mode 100644
index 0000000..9dfe4ae
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.gbr/line_f_clear.top.gbr
@@ -0,0 +1,125 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Clear and no-clear lines, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD15C,0.0050*%
+%ADD14C,0.0200*%
+%ADD13C,0.0100*%
+%ADD12C,0.0150*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X26250Y47500D02*X47500D01*
+Y2500D01*
+X26250D01*
+Y7967D01*
+X26457Y8016D01*
+X27140Y8299D01*
+X27771Y8686D01*
+X28334Y9166D01*
+X28814Y9729D01*
+X29201Y10360D01*
+X29484Y11043D01*
+X29656Y11762D01*
+X29700Y12500D01*
+Y23050D01*
+X40000D01*
+X40306Y23068D01*
+X40604Y23140D01*
+X40888Y23257D01*
+X41150Y23418D01*
+X41383Y23617D01*
+X41582Y23850D01*
+X41743Y24112D01*
+X41860Y24396D01*
+X41932Y24694D01*
+X41956Y25000D01*
+X41932Y25306D01*
+X41860Y25604D01*
+X41743Y25888D01*
+X41582Y26150D01*
+X41383Y26383D01*
+X41150Y26582D01*
+X40888Y26743D01*
+X40604Y26860D01*
+X40306Y26932D01*
+X40000Y26950D01*
+X29700D01*
+Y37500D01*
+X29656Y38238D01*
+X29484Y38957D01*
+X29201Y39640D01*
+X28814Y40271D01*
+X28334Y40834D01*
+X27771Y41314D01*
+X27140Y41701D01*
+X26457Y41984D01*
+X26250Y42033D01*
+Y47500D01*
+G37*
+G36*
+X2500D02*X26250D01*
+Y42033D01*
+X25738Y42156D01*
+X25000Y42214D01*
+X24262Y42156D01*
+X23543Y41984D01*
+X22860Y41701D01*
+X22229Y41314D01*
+X21666Y40834D01*
+X21186Y40271D01*
+X20799Y39640D01*
+X20516Y38957D01*
+X20344Y38238D01*
+X20300Y37500D01*
+Y26950D01*
+X12500D01*
+X12194Y26932D01*
+X11896Y26860D01*
+X11612Y26743D01*
+X11350Y26582D01*
+X11117Y26383D01*
+X10918Y26150D01*
+X10757Y25888D01*
+X10640Y25604D01*
+X10568Y25306D01*
+X10544Y25000D01*
+X10568Y24694D01*
+X10640Y24396D01*
+X10757Y24112D01*
+X10918Y23850D01*
+X11117Y23617D01*
+X11350Y23418D01*
+X11612Y23257D01*
+X11896Y23140D01*
+X12194Y23068D01*
+X12500Y23050D01*
+X20300D01*
+Y12500D01*
+X20344Y11762D01*
+X20516Y11043D01*
+X20799Y10360D01*
+X21186Y9729D01*
+X21666Y9166D01*
+X22229Y8686D01*
+X22860Y8299D01*
+X23543Y8016D01*
+X24262Y7844D01*
+X25000Y7786D01*
+X25738Y7844D01*
+X26250Y7967D01*
+Y2500D01*
+X2500D01*
+Y47500D01*
+G37*
+G54D12*X12500Y25000D02*X40000D01*
+G54D13*X25000Y37500D02*Y12500D01*
+G54D14*Y25000D02*X40000Y30000D01*
+G54D15*X25000Y25000D02*X15000Y35000D01*
+M02*
diff --git a/tests/RTT/ref/line_f_clear.net b/tests/RTT/ref/line_f_clear.net
new file mode 100644
index 0000000..fc0c066
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Clear and no-clear lines
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_f_clear.png b/tests/RTT/ref/line_f_clear.png
new file mode 100644
index 0000000..70da439
Binary files /dev/null and b/tests/RTT/ref/line_f_clear.png differ
diff --git a/tests/RTT/ref/line_f_clear.png.text b/tests/RTT/ref/line_f_clear.png.text
new file mode 100644
index 0000000..1eaf269
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.png.text
@@ -0,0 +1,23 @@
+
+
+rectangle
+width 541 pixels
+height 541 pixels
+
+veritcal line
+width 12 pixels
+length 312 pixels
+clearance 49/51 pixels (left/right)
+
+horizontal line
+width 348 pixels
+length 348 pixels
+clearance 14/15 pixels (top/bottom)
+
+left diangonal line
+45 degrees
+
+right diagonal line
+18 degrees
+
+
diff --git a/tests/RTT/ref/line_f_clear.ps.gz b/tests/RTT/ref/line_f_clear.ps.gz
new file mode 100644
index 0000000..a6456de
Binary files /dev/null and b/tests/RTT/ref/line_f_clear.ps.gz differ
diff --git a/tests/RTT/ref/line_f_clear.remote.gz b/tests/RTT/ref/line_f_clear.remote.gz
new file mode 100644
index 0000000..97ab8e9
Binary files /dev/null and b/tests/RTT/ref/line_f_clear.remote.gz differ
diff --git a/tests/RTT/ref/line_f_clear.svg b/tests/RTT/ref/line_f_clear.svg
new file mode 100644
index 0000000..1275afa
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="6.6675,0.6350 12.0650,0.6350 12.0650,12.0650 6.6675,12.0650 6.6675,10.6765 6.7200,10.6639 6.8936,10.5920 7.0539,10.4938 7.1967,10.3717 7.3188,10.2289 7.4170,10.0686 7.4889,9.8950 7.5327,9.7123 7.5438,9.5250 7.5438,6.8453 10.1600,6.8453 10.2377,6.8407 10.3135,6.8225 10.3856,6.7927 10.4520,6.7519 10.5113,6.7013 10.5619,6.6420 10.6027,6.5756 10.6325,6.5035 10.6507,6.4277 10.6568,6.3500 10.6507,6.2723 10.6325,6.1965 10.6027,6.1244 10.5619,6.0580 10.5113,5.9987 10.4520,5.948 [...]
+ <polygon points="0.6350,0.6350 6.6675,0.6350 6.6675,2.0235 6.5373,1.9923 6.3500,1.9775 6.1627,1.9923 5.9800,2.0361 5.8064,2.1080 5.6461,2.2062 5.5033,2.3283 5.3812,2.4711 5.2830,2.6314 5.2111,2.8050 5.1673,2.9877 5.1562,3.1750 5.1562,5.8547 3.1750,5.8547 3.0973,5.8593 3.0215,5.8775 2.9494,5.9073 2.8830,5.9481 2.8237,5.9987 2.7731,6.0580 2.7323,6.1244 2.7025,6.1965 2.6843,6.2723 2.6782,6.3500 2.6843,6.4277 2.7025,6.5035 2.7323,6.5756 2.7731,6.6420 2.8237,6.7013 2.8830,6.7519 2.9494,6.792 [...]
+ <line x1="3.1750" y1="6.3500" x2="10.1600" y2="6.3500" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.3500" y1="3.1750" x2="6.3500" y2="9.5250" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.3500" y1="6.3500" x2="10.1600" y2="5.0800" stroke-width="0.5080" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.3500" y1="6.3500" x2="3.8100" y2="3.8100" stroke-width="0.1270" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_f_clear.xy b/tests/RTT/ref/line_f_clear.xy
new file mode 100644
index 0000000..ed7f51f
--- /dev/null
+++ b/tests/RTT/ref/line_f_clear.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Clear and no-clear lines - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_normal.bom b/tests/RTT/ref/line_normal.bom
new file mode 100644
index 0000000..8be2f6f
--- /dev/null
+++ b/tests/RTT/ref/line_normal.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Normal lines at different size and angle - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_normal.dsn b/tests/RTT/ref/line_normal.dsn
new file mode 100644
index 0000000..b245c94
--- /dev/null
+++ b/tests/RTT/ref/line_normal.dsn
@@ -0,0 +1,65 @@
+(pcb Normal lines at different size and angle
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.381000 3.175000 6.350000 10.160000 6.350000)
+ (type protect))
+ (wire (path comp1 0.254000 6.350000 9.525000 6.350000 3.175000)
+ (type protect))
+ (wire (path comp1 0.508000 6.350000 6.350000 10.160000 7.620000)
+ (type protect))
+ (wire (path comp1 0.127000 6.350000 6.350000 3.810000 8.890000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_normal.gbr/line_normal.fab.gbr b/tests/RTT/ref/line_normal.gbr/line_normal.fab.gbr
new file mode 100644
index 0000000..7dd57c3
--- /dev/null
+++ b/tests/RTT/ref/line_normal.gbr/line_normal.fab.gbr
@@ -0,0 +1,1839 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Normal lines at different size and angle, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD17C,0.0100*%
+%ADD16C,0.0001*%
+%ADD15C,0.0060*%
+G54D15*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D16*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D15*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D16*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D15*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D16*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D15*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D16*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D15*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D16*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D15*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D16*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D17*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D15*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D16*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D15*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D16*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D15*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D16*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D15*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D16*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D15*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D16*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D15*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D16*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D15*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D16*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D15*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D16*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D15*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D16*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D15*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D16*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D15*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D16*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D15*X234500D02*Y104000D01*
+Y110000D02*X238250Y104000D01*
+Y110000D02*Y104000D01*
+G54D16*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X250850D02*Y104000D01*
+X255350D01*
+Y110000D01*
+X250850D01*
+G37*
+G36*
+X256250D02*Y104000D01*
+X260750D01*
+Y110000D01*
+X256250D01*
+G37*
+G36*
+X261650D02*Y104000D01*
+X266150D01*
+Y110000D01*
+X261650D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X275150D02*Y104000D01*
+X279650D01*
+Y110000D01*
+X275150D01*
+G37*
+G36*
+X280550D02*Y104000D01*
+X285050D01*
+Y110000D01*
+X280550D01*
+G37*
+G36*
+X285950D02*Y104000D01*
+X290450D01*
+Y110000D01*
+X285950D01*
+G37*
+G36*
+X291350D02*Y104000D01*
+X295850D01*
+Y110000D01*
+X291350D01*
+G37*
+G36*
+X299450D02*Y104000D01*
+X303950D01*
+Y110000D01*
+X299450D01*
+G37*
+G36*
+X304850D02*Y104000D01*
+X309350D01*
+Y110000D01*
+X304850D01*
+G37*
+G36*
+X312950D02*Y104000D01*
+X317450D01*
+Y110000D01*
+X312950D01*
+G37*
+G36*
+X318350D02*Y104000D01*
+X322850D01*
+Y110000D01*
+X318350D01*
+G37*
+G36*
+X323750D02*Y104000D01*
+X328250D01*
+Y110000D01*
+X323750D01*
+G37*
+G36*
+X329150D02*Y104000D01*
+X333650D01*
+Y110000D01*
+X329150D01*
+G37*
+G36*
+X334550D02*Y104000D01*
+X339050D01*
+Y110000D01*
+X334550D01*
+G37*
+G36*
+X339950D02*Y104000D01*
+X344450D01*
+Y110000D01*
+X339950D01*
+G37*
+G36*
+X345350D02*Y104000D01*
+X349850D01*
+Y110000D01*
+X345350D01*
+G37*
+G36*
+X350750D02*Y104000D01*
+X355250D01*
+Y110000D01*
+X350750D01*
+G37*
+G36*
+X356150D02*Y104000D01*
+X360650D01*
+Y110000D01*
+X356150D01*
+G37*
+G36*
+X364250D02*Y104000D01*
+X368750D01*
+Y110000D01*
+X364250D01*
+G37*
+G36*
+X369650D02*Y104000D01*
+X374150D01*
+Y110000D01*
+X369650D01*
+G37*
+G36*
+X375050D02*Y104000D01*
+X379550D01*
+Y110000D01*
+X375050D01*
+G37*
+G36*
+X380450D02*Y104000D01*
+X384950D01*
+Y110000D01*
+X380450D01*
+G37*
+G36*
+X388550D02*Y104000D01*
+X393050D01*
+Y110000D01*
+X388550D01*
+G37*
+G36*
+X393950D02*Y104000D01*
+X398450D01*
+Y110000D01*
+X393950D01*
+G37*
+G36*
+X399350D02*Y104000D01*
+X403850D01*
+Y110000D01*
+X399350D01*
+G37*
+G36*
+X407450D02*Y104000D01*
+X411950D01*
+Y110000D01*
+X407450D01*
+G37*
+G36*
+X412850D02*Y104000D01*
+X417350D01*
+Y110000D01*
+X412850D01*
+G37*
+G36*
+X418250D02*Y104000D01*
+X422750D01*
+Y110000D01*
+X418250D01*
+G37*
+G36*
+X423650D02*Y104000D01*
+X428150D01*
+Y110000D01*
+X423650D01*
+G37*
+G36*
+X429050D02*Y104000D01*
+X433550D01*
+Y110000D01*
+X429050D01*
+G37*
+G36*
+X437150D02*Y104000D01*
+X441650D01*
+Y110000D01*
+X437150D01*
+G37*
+G54D15*X445250D02*Y104000D01*
+Y110000D02*X448250D01*
+X445250Y107300D02*X447500D01*
+G54D16*G36*
+X450050Y110000D02*Y104000D01*
+X454550D01*
+Y110000D01*
+X450050D01*
+G37*
+G36*
+X455450D02*Y104000D01*
+X459950D01*
+Y110000D01*
+X455450D01*
+G37*
+G36*
+X460850D02*Y104000D01*
+X465350D01*
+Y110000D01*
+X460850D01*
+G37*
+G36*
+X466250D02*Y104000D01*
+X470750D01*
+Y110000D01*
+X466250D01*
+G37*
+G36*
+X471650D02*Y104000D01*
+X476150D01*
+Y110000D01*
+X471650D01*
+G37*
+G36*
+X477050D02*Y104000D01*
+X481550D01*
+Y110000D01*
+X477050D01*
+G37*
+G36*
+X482450D02*Y104000D01*
+X486950D01*
+Y110000D01*
+X482450D01*
+G37*
+G36*
+X487850D02*Y104000D01*
+X492350D01*
+Y110000D01*
+X487850D01*
+G37*
+G36*
+X493250D02*Y104000D01*
+X497750D01*
+Y110000D01*
+X493250D01*
+G37*
+G36*
+X498650D02*Y104000D01*
+X503150D01*
+Y110000D01*
+X498650D01*
+G37*
+G54D15*X507500D02*Y104000D01*
+X509450Y110000D02*X510500Y108950D01*
+Y105050D01*
+X509450Y104000D02*X510500Y105050D01*
+X506750Y104000D02*X509450D01*
+X506750Y110000D02*X509450D01*
+G54D16*G36*
+X512300D02*Y104000D01*
+X516800D01*
+Y110000D01*
+X512300D01*
+G37*
+G36*
+X517700D02*Y104000D01*
+X522200D01*
+Y110000D01*
+X517700D01*
+G37*
+G36*
+X523100D02*Y104000D01*
+X527600D01*
+Y110000D01*
+X523100D01*
+G37*
+G36*
+X528500D02*Y104000D01*
+X533000D01*
+Y110000D01*
+X528500D01*
+G37*
+G36*
+X533900D02*Y104000D01*
+X538400D01*
+Y110000D01*
+X533900D01*
+G37*
+G36*
+X539300D02*Y104000D01*
+X543800D01*
+Y110000D01*
+X539300D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_normal.gbr/line_normal.top.gbr b/tests/RTT/ref/line_normal.gbr/line_normal.top.gbr
new file mode 100644
index 0000000..99e0bba
--- /dev/null
+++ b/tests/RTT/ref/line_normal.gbr/line_normal.top.gbr
@@ -0,0 +1,20 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Normal lines at different size and angle, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD14C,0.0050*%
+%ADD13C,0.0200*%
+%ADD12C,0.0100*%
+%ADD11C,0.0150*%
+G54D11*X12500Y25000D02*X40000D01*
+G54D12*X25000Y37500D02*Y12500D01*
+G54D13*Y25000D02*X40000Y30000D01*
+G54D14*X25000Y25000D02*X15000Y35000D01*
+M02*
diff --git a/tests/RTT/ref/line_normal.net b/tests/RTT/ref/line_normal.net
new file mode 100644
index 0000000..36f13cd
--- /dev/null
+++ b/tests/RTT/ref/line_normal.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Normal lines at different size and angle
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_normal.png b/tests/RTT/ref/line_normal.png
new file mode 100644
index 0000000..bf6905e
Binary files /dev/null and b/tests/RTT/ref/line_normal.png differ
diff --git a/tests/RTT/ref/line_normal.ps.gz b/tests/RTT/ref/line_normal.ps.gz
new file mode 100644
index 0000000..929981b
Binary files /dev/null and b/tests/RTT/ref/line_normal.ps.gz differ
diff --git a/tests/RTT/ref/line_normal.remote.gz b/tests/RTT/ref/line_normal.remote.gz
new file mode 100644
index 0000000..427c128
Binary files /dev/null and b/tests/RTT/ref/line_normal.remote.gz differ
diff --git a/tests/RTT/ref/line_normal.svg b/tests/RTT/ref/line_normal.svg
new file mode 100644
index 0000000..575ed1a
--- /dev/null
+++ b/tests/RTT/ref/line_normal.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="3.1750" y1="6.3500" x2="10.1600" y2="6.3500" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.3500" y1="3.1750" x2="6.3500" y2="9.5250" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.3500" y1="6.3500" x2="10.1600" y2="5.0800" stroke-width="0.5080" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="6.3500" y1="6.3500" x2="3.8100" y2="3.8100" stroke-width="0.1270" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_normal.xy b/tests/RTT/ref/line_normal.xy
new file mode 100644
index 0000000..47f8297
--- /dev/null
+++ b/tests/RTT/ref/line_normal.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Normal lines at different size and angle - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_offpage.bom b/tests/RTT/ref/line_offpage.bom
new file mode 100644
index 0000000..1f5f01f
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: A single line that extends beyond board boundary - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_offpage.dsn b/tests/RTT/ref/line_offpage.dsn
new file mode 100644
index 0000000..2879e42
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.dsn
@@ -0,0 +1,59 @@
+(pcb A single line that extends beyond board boundary
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.254000 2.540000 7.620000 15.240000 7.620000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_offpage.gbr/line_offpage.fab.gbr b/tests/RTT/ref/line_offpage.gbr/line_offpage.fab.gbr
new file mode 100644
index 0000000..57a29d2
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.gbr/line_offpage.fab.gbr
@@ -0,0 +1,1884 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: A single line that extends beyond board boundary, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500Y108500D02*Y104000D01*
+Y108500D02*X235550Y110000D01*
+X237200D01*
+X238250Y108500D01*
+Y104000D01*
+X234500Y107000D02*X238250D01*
+G54D13*G36*
+X242750Y110000D02*Y104000D01*
+X247250D01*
+Y110000D01*
+X242750D01*
+G37*
+G36*
+X248150D02*Y104000D01*
+X252650D01*
+Y110000D01*
+X248150D01*
+G37*
+G36*
+X253550D02*Y104000D01*
+X258050D01*
+Y110000D01*
+X253550D01*
+G37*
+G36*
+X258950D02*Y104000D01*
+X263450D01*
+Y110000D01*
+X258950D01*
+G37*
+G36*
+X264350D02*Y104000D01*
+X268850D01*
+Y110000D01*
+X264350D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X277850D02*Y104000D01*
+X282350D01*
+Y110000D01*
+X277850D01*
+G37*
+G36*
+X283250D02*Y104000D01*
+X287750D01*
+Y110000D01*
+X283250D01*
+G37*
+G36*
+X288650D02*Y104000D01*
+X293150D01*
+Y110000D01*
+X288650D01*
+G37*
+G36*
+X294050D02*Y104000D01*
+X298550D01*
+Y110000D01*
+X294050D01*
+G37*
+G36*
+X302150D02*Y104000D01*
+X306650D01*
+Y110000D01*
+X302150D01*
+G37*
+G36*
+X307550D02*Y104000D01*
+X312050D01*
+Y110000D01*
+X307550D01*
+G37*
+G36*
+X312950D02*Y104000D01*
+X317450D01*
+Y110000D01*
+X312950D01*
+G37*
+G36*
+X318350D02*Y104000D01*
+X322850D01*
+Y110000D01*
+X318350D01*
+G37*
+G36*
+X326450D02*Y104000D01*
+X330950D01*
+Y110000D01*
+X326450D01*
+G37*
+G36*
+X331850D02*Y104000D01*
+X336350D01*
+Y110000D01*
+X331850D01*
+G37*
+G36*
+X337250D02*Y104000D01*
+X341750D01*
+Y110000D01*
+X337250D01*
+G37*
+G36*
+X342650D02*Y104000D01*
+X347150D01*
+Y110000D01*
+X342650D01*
+G37*
+G36*
+X348050D02*Y104000D01*
+X352550D01*
+Y110000D01*
+X348050D01*
+G37*
+G36*
+X353450D02*Y104000D01*
+X357950D01*
+Y110000D01*
+X353450D01*
+G37*
+G36*
+X358850D02*Y104000D01*
+X363350D01*
+Y110000D01*
+X358850D01*
+G37*
+G36*
+X366950D02*Y104000D01*
+X371450D01*
+Y110000D01*
+X366950D01*
+G37*
+G36*
+X372350D02*Y104000D01*
+X376850D01*
+Y110000D01*
+X372350D01*
+G37*
+G36*
+X377750D02*Y104000D01*
+X382250D01*
+Y110000D01*
+X377750D01*
+G37*
+G36*
+X383150D02*Y104000D01*
+X387650D01*
+Y110000D01*
+X383150D01*
+G37*
+G36*
+X388550D02*Y104000D01*
+X393050D01*
+Y110000D01*
+X388550D01*
+G37*
+G36*
+X393950D02*Y104000D01*
+X398450D01*
+Y110000D01*
+X393950D01*
+G37*
+G36*
+X402050D02*Y104000D01*
+X406550D01*
+Y110000D01*
+X402050D01*
+G37*
+G36*
+X407450D02*Y104000D01*
+X411950D01*
+Y110000D01*
+X407450D01*
+G37*
+G36*
+X412850D02*Y104000D01*
+X417350D01*
+Y110000D01*
+X412850D01*
+G37*
+G36*
+X418250D02*Y104000D01*
+X422750D01*
+Y110000D01*
+X418250D01*
+G37*
+G36*
+X423650D02*Y104000D01*
+X428150D01*
+Y110000D01*
+X423650D01*
+G37*
+G36*
+X431750D02*Y104000D01*
+X436250D01*
+Y110000D01*
+X431750D01*
+G37*
+G36*
+X437150D02*Y104000D01*
+X441650D01*
+Y110000D01*
+X437150D01*
+G37*
+G36*
+X442550D02*Y104000D01*
+X447050D01*
+Y110000D01*
+X442550D01*
+G37*
+G36*
+X447950D02*Y104000D01*
+X452450D01*
+Y110000D01*
+X447950D01*
+G37*
+G36*
+X453350D02*Y104000D01*
+X457850D01*
+Y110000D01*
+X453350D01*
+G37*
+G36*
+X458750D02*Y104000D01*
+X463250D01*
+Y110000D01*
+X458750D01*
+G37*
+G36*
+X464150D02*Y104000D01*
+X468650D01*
+Y110000D01*
+X464150D01*
+G37*
+G36*
+X469550D02*Y104000D01*
+X474050D01*
+Y110000D01*
+X469550D01*
+G37*
+G36*
+X477650D02*Y104000D01*
+X482150D01*
+Y110000D01*
+X477650D01*
+G37*
+G54D12*X485750D02*Y104000D01*
+Y110000D02*X488750D01*
+X485750Y107300D02*X488000D01*
+G54D13*G36*
+X490550Y110000D02*Y104000D01*
+X495050D01*
+Y110000D01*
+X490550D01*
+G37*
+G36*
+X495950D02*Y104000D01*
+X500450D01*
+Y110000D01*
+X495950D01*
+G37*
+G36*
+X501350D02*Y104000D01*
+X505850D01*
+Y110000D01*
+X501350D01*
+G37*
+G36*
+X506750D02*Y104000D01*
+X511250D01*
+Y110000D01*
+X506750D01*
+G37*
+G36*
+X512150D02*Y104000D01*
+X516650D01*
+Y110000D01*
+X512150D01*
+G37*
+G36*
+X517550D02*Y104000D01*
+X522050D01*
+Y110000D01*
+X517550D01*
+G37*
+G36*
+X522950D02*Y104000D01*
+X527450D01*
+Y110000D01*
+X522950D01*
+G37*
+G36*
+X528350D02*Y104000D01*
+X532850D01*
+Y110000D01*
+X528350D01*
+G37*
+G36*
+X533750D02*Y104000D01*
+X538250D01*
+Y110000D01*
+X533750D01*
+G37*
+G36*
+X539150D02*Y104000D01*
+X543650D01*
+Y110000D01*
+X539150D01*
+G37*
+G54D12*X548000D02*Y104000D01*
+X549950Y110000D02*X551000Y108950D01*
+Y105050D01*
+X549950Y104000D02*X551000Y105050D01*
+X547250Y104000D02*X549950D01*
+X547250Y110000D02*X549950D01*
+G54D13*G36*
+X552800D02*Y104000D01*
+X557300D01*
+Y110000D01*
+X552800D01*
+G37*
+G36*
+X558200D02*Y104000D01*
+X562700D01*
+Y110000D01*
+X558200D01*
+G37*
+G36*
+X563600D02*Y104000D01*
+X568100D01*
+Y110000D01*
+X563600D01*
+G37*
+G36*
+X569000D02*Y104000D01*
+X573500D01*
+Y110000D01*
+X569000D01*
+G37*
+G36*
+X574400D02*Y104000D01*
+X578900D01*
+Y110000D01*
+X574400D01*
+G37*
+G36*
+X579800D02*Y104000D01*
+X584300D01*
+Y110000D01*
+X579800D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_offpage.gbr/line_offpage.top.gbr b/tests/RTT/ref/line_offpage.gbr/line_offpage.top.gbr
new file mode 100644
index 0000000..2bcc5cb
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.gbr/line_offpage.top.gbr
@@ -0,0 +1,14 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: A single line that extends beyond board boundary, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0100*%
+G54D11*X10000Y30000D02*X60000D01*
+M02*
diff --git a/tests/RTT/ref/line_offpage.net b/tests/RTT/ref/line_offpage.net
new file mode 100644
index 0000000..1d76cfd
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB A single line that extends beyond board boundary
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_offpage.png b/tests/RTT/ref/line_offpage.png
new file mode 100644
index 0000000..65bc1ec
Binary files /dev/null and b/tests/RTT/ref/line_offpage.png differ
diff --git a/tests/RTT/ref/line_offpage.ps.gz b/tests/RTT/ref/line_offpage.ps.gz
new file mode 100644
index 0000000..9175741
Binary files /dev/null and b/tests/RTT/ref/line_offpage.ps.gz differ
diff --git a/tests/RTT/ref/line_offpage.remote.gz b/tests/RTT/ref/line_offpage.remote.gz
new file mode 100644
index 0000000..da4143d
Binary files /dev/null and b/tests/RTT/ref/line_offpage.remote.gz differ
diff --git a/tests/RTT/ref/line_offpage.svg b/tests/RTT/ref/line_offpage.svg
new file mode 100644
index 0000000..08e947e
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="2.5400" y1="5.0800" x2="15.2400" y2="5.0800" stroke-width="0.2540" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_offpage.xy b/tests/RTT/ref/line_offpage.xy
new file mode 100644
index 0000000..31c5c2b
--- /dev/null
+++ b/tests/RTT/ref/line_offpage.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: A single line that extends beyond board boundary - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap1.bom b/tests/RTT/ref/line_overlap1.bom
new file mode 100644
index 0000000..b400c18
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Two lines partially overlapping - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap1.dsn b/tests/RTT/ref/line_overlap1.dsn
new file mode 100644
index 0000000..e4db8bf
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.dsn
@@ -0,0 +1,61 @@
+(pcb Two lines partially overlapping
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.381000 5.080000 7.620000 6.350000 7.620000)
+ (type protect))
+ (wire (path comp1 0.381000 5.588000 7.620000 7.620000 7.620000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_overlap1.gbr/line_overlap1.fab.gbr b/tests/RTT/ref/line_overlap1.gbr/line_overlap1.fab.gbr
new file mode 100644
index 0000000..c70c567
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.gbr/line_overlap1.fab.gbr
@@ -0,0 +1,1802 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Two lines partially overlapping, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500D02*X237500D01*
+X236000D02*Y104000D01*
+G54D13*G36*
+X239300Y110000D02*Y104000D01*
+X243800D01*
+Y110000D01*
+X239300D01*
+G37*
+G36*
+X244700D02*Y104000D01*
+X249200D01*
+Y110000D01*
+X244700D01*
+G37*
+G36*
+X252800D02*Y104000D01*
+X257300D01*
+Y110000D01*
+X252800D01*
+G37*
+G36*
+X258200D02*Y104000D01*
+X262700D01*
+Y110000D01*
+X258200D01*
+G37*
+G36*
+X263600D02*Y104000D01*
+X268100D01*
+Y110000D01*
+X263600D01*
+G37*
+G36*
+X269000D02*Y104000D01*
+X273500D01*
+Y110000D01*
+X269000D01*
+G37*
+G36*
+X274400D02*Y104000D01*
+X278900D01*
+Y110000D01*
+X274400D01*
+G37*
+G36*
+X282500D02*Y104000D01*
+X287000D01*
+Y110000D01*
+X282500D01*
+G37*
+G36*
+X287900D02*Y104000D01*
+X292400D01*
+Y110000D01*
+X287900D01*
+G37*
+G36*
+X293300D02*Y104000D01*
+X297800D01*
+Y110000D01*
+X293300D01*
+G37*
+G36*
+X298700D02*Y104000D01*
+X303200D01*
+Y110000D01*
+X298700D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X320300D02*Y104000D01*
+X324800D01*
+Y110000D01*
+X320300D01*
+G37*
+G36*
+X325700D02*Y104000D01*
+X330200D01*
+Y110000D01*
+X325700D01*
+G37*
+G36*
+X333800D02*Y104000D01*
+X338300D01*
+Y110000D01*
+X333800D01*
+G37*
+G36*
+X339200D02*Y104000D01*
+X343700D01*
+Y110000D01*
+X339200D01*
+G37*
+G36*
+X344600D02*Y104000D01*
+X349100D01*
+Y110000D01*
+X344600D01*
+G37*
+G36*
+X350000D02*Y104000D01*
+X354500D01*
+Y110000D01*
+X350000D01*
+G37*
+G36*
+X355400D02*Y104000D01*
+X359900D01*
+Y110000D01*
+X355400D01*
+G37*
+G36*
+X360800D02*Y104000D01*
+X365300D01*
+Y110000D01*
+X360800D01*
+G37*
+G36*
+X366200D02*Y104000D01*
+X370700D01*
+Y110000D01*
+X366200D01*
+G37*
+G36*
+X371600D02*Y104000D01*
+X376100D01*
+Y110000D01*
+X371600D01*
+G37*
+G36*
+X377000D02*Y104000D01*
+X381500D01*
+Y110000D01*
+X377000D01*
+G37*
+G36*
+X382400D02*Y104000D01*
+X386900D01*
+Y110000D01*
+X382400D01*
+G37*
+G36*
+X387800D02*Y104000D01*
+X392300D01*
+Y110000D01*
+X387800D01*
+G37*
+G36*
+X395900D02*Y104000D01*
+X400400D01*
+Y110000D01*
+X395900D01*
+G37*
+G54D12*X404000D02*Y104000D01*
+Y110000D02*X407000D01*
+X404000Y107300D02*X406250D01*
+G54D13*G36*
+X408800Y110000D02*Y104000D01*
+X413300D01*
+Y110000D01*
+X408800D01*
+G37*
+G36*
+X414200D02*Y104000D01*
+X418700D01*
+Y110000D01*
+X414200D01*
+G37*
+G36*
+X419600D02*Y104000D01*
+X424100D01*
+Y110000D01*
+X419600D01*
+G37*
+G36*
+X425000D02*Y104000D01*
+X429500D01*
+Y110000D01*
+X425000D01*
+G37*
+G36*
+X430400D02*Y104000D01*
+X434900D01*
+Y110000D01*
+X430400D01*
+G37*
+G36*
+X435800D02*Y104000D01*
+X440300D01*
+Y110000D01*
+X435800D01*
+G37*
+G36*
+X441200D02*Y104000D01*
+X445700D01*
+Y110000D01*
+X441200D01*
+G37*
+G36*
+X446600D02*Y104000D01*
+X451100D01*
+Y110000D01*
+X446600D01*
+G37*
+G36*
+X452000D02*Y104000D01*
+X456500D01*
+Y110000D01*
+X452000D01*
+G37*
+G36*
+X457400D02*Y104000D01*
+X461900D01*
+Y110000D01*
+X457400D01*
+G37*
+G54D12*X466250D02*Y104000D01*
+X468200Y110000D02*X469250Y108950D01*
+Y105050D01*
+X468200Y104000D02*X469250Y105050D01*
+X465500Y104000D02*X468200D01*
+X465500Y110000D02*X468200D01*
+G54D13*G36*
+X471050D02*Y104000D01*
+X475550D01*
+Y110000D01*
+X471050D01*
+G37*
+G36*
+X476450D02*Y104000D01*
+X480950D01*
+Y110000D01*
+X476450D01*
+G37*
+G36*
+X481850D02*Y104000D01*
+X486350D01*
+Y110000D01*
+X481850D01*
+G37*
+G36*
+X487250D02*Y104000D01*
+X491750D01*
+Y110000D01*
+X487250D01*
+G37*
+G36*
+X492650D02*Y104000D01*
+X497150D01*
+Y110000D01*
+X492650D01*
+G37*
+G36*
+X498050D02*Y104000D01*
+X502550D01*
+Y110000D01*
+X498050D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_overlap1.gbr/line_overlap1.top.gbr b/tests/RTT/ref/line_overlap1.gbr/line_overlap1.top.gbr
new file mode 100644
index 0000000..e53e028
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.gbr/line_overlap1.top.gbr
@@ -0,0 +1,15 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Two lines partially overlapping, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0150*%
+G54D11*X20000Y30000D02*X25000D01*
+X22000D02*X30000D01*
+M02*
diff --git a/tests/RTT/ref/line_overlap1.net b/tests/RTT/ref/line_overlap1.net
new file mode 100644
index 0000000..40b59b0
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Two lines partially overlapping
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_overlap1.png b/tests/RTT/ref/line_overlap1.png
new file mode 100644
index 0000000..b44c55a
Binary files /dev/null and b/tests/RTT/ref/line_overlap1.png differ
diff --git a/tests/RTT/ref/line_overlap1.ps.gz b/tests/RTT/ref/line_overlap1.ps.gz
new file mode 100644
index 0000000..8500433
Binary files /dev/null and b/tests/RTT/ref/line_overlap1.ps.gz differ
diff --git a/tests/RTT/ref/line_overlap1.remote.gz b/tests/RTT/ref/line_overlap1.remote.gz
new file mode 100644
index 0000000..6b261d2
Binary files /dev/null and b/tests/RTT/ref/line_overlap1.remote.gz differ
diff --git a/tests/RTT/ref/line_overlap1.svg b/tests/RTT/ref/line_overlap1.svg
new file mode 100644
index 0000000..d700af0
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="5.0800" y1="5.0800" x2="6.3500" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="5.5880" y1="5.0800" x2="7.6200" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_overlap1.xy b/tests/RTT/ref/line_overlap1.xy
new file mode 100644
index 0000000..c8c4b82
--- /dev/null
+++ b/tests/RTT/ref/line_overlap1.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Two lines partially overlapping - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap2.bom b/tests/RTT/ref/line_overlap2.bom
new file mode 100644
index 0000000..67c604e
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Two lines, one over the other, full cover - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap2.dsn b/tests/RTT/ref/line_overlap2.dsn
new file mode 100644
index 0000000..b3a2341
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.dsn
@@ -0,0 +1,61 @@
+(pcb Two lines, one over the other, full cover
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.381000 5.080000 7.620000 8.890000 7.620000)
+ (type protect))
+ (wire (path comp1 0.381000 5.588000 7.620000 7.620000 7.620000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_overlap2.gbr/line_overlap2.fab.gbr b/tests/RTT/ref/line_overlap2.gbr/line_overlap2.fab.gbr
new file mode 100644
index 0000000..98127a2
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.gbr/line_overlap2.fab.gbr
@@ -0,0 +1,1838 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Two lines, one over the other, full cover, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500D02*X237500D01*
+X236000D02*Y104000D01*
+G54D13*G36*
+X239300Y110000D02*Y104000D01*
+X243800D01*
+Y110000D01*
+X239300D01*
+G37*
+G36*
+X244700D02*Y104000D01*
+X249200D01*
+Y110000D01*
+X244700D01*
+G37*
+G36*
+X252800D02*Y104000D01*
+X257300D01*
+Y110000D01*
+X252800D01*
+G37*
+G36*
+X258200D02*Y104000D01*
+X262700D01*
+Y110000D01*
+X258200D01*
+G37*
+G36*
+X263600D02*Y104000D01*
+X268100D01*
+Y110000D01*
+X263600D01*
+G37*
+G36*
+X269000D02*Y104000D01*
+X273500D01*
+Y110000D01*
+X269000D01*
+G37*
+G36*
+X274400D02*Y104000D01*
+X278900D01*
+Y110000D01*
+X274400D01*
+G37*
+G36*
+X279800D02*Y104000D01*
+X284300D01*
+Y110000D01*
+X279800D01*
+G37*
+G36*
+X287900D02*Y104000D01*
+X292400D01*
+Y110000D01*
+X287900D01*
+G37*
+G36*
+X293300D02*Y104000D01*
+X297800D01*
+Y110000D01*
+X293300D01*
+G37*
+G36*
+X298700D02*Y104000D01*
+X303200D01*
+Y110000D01*
+X298700D01*
+G37*
+G36*
+X306800D02*Y104000D01*
+X311300D01*
+Y110000D01*
+X306800D01*
+G37*
+G36*
+X312200D02*Y104000D01*
+X316700D01*
+Y110000D01*
+X312200D01*
+G37*
+G36*
+X317600D02*Y104000D01*
+X322100D01*
+Y110000D01*
+X317600D01*
+G37*
+G36*
+X323000D02*Y104000D01*
+X327500D01*
+Y110000D01*
+X323000D01*
+G37*
+G36*
+X331100D02*Y104000D01*
+X335600D01*
+Y110000D01*
+X331100D01*
+G37*
+G36*
+X336500D02*Y104000D01*
+X341000D01*
+Y110000D01*
+X336500D01*
+G37*
+G36*
+X341900D02*Y104000D01*
+X346400D01*
+Y110000D01*
+X341900D01*
+G37*
+G36*
+X350000D02*Y104000D01*
+X354500D01*
+Y110000D01*
+X350000D01*
+G37*
+G36*
+X355400D02*Y104000D01*
+X359900D01*
+Y110000D01*
+X355400D01*
+G37*
+G36*
+X360800D02*Y104000D01*
+X365300D01*
+Y110000D01*
+X360800D01*
+G37*
+G36*
+X366200D02*Y104000D01*
+X370700D01*
+Y110000D01*
+X366200D01*
+G37*
+G36*
+X371600D02*Y104000D01*
+X376100D01*
+Y110000D01*
+X371600D01*
+G37*
+G36*
+X377000D02*Y104000D01*
+X381500D01*
+Y110000D01*
+X377000D01*
+G37*
+G36*
+X385100D02*Y104000D01*
+X389600D01*
+Y110000D01*
+X385100D01*
+G37*
+G36*
+X390500D02*Y104000D01*
+X395000D01*
+Y110000D01*
+X390500D01*
+G37*
+G36*
+X395900D02*Y104000D01*
+X400400D01*
+Y110000D01*
+X395900D01*
+G37*
+G36*
+X401300D02*Y104000D01*
+X405800D01*
+Y110000D01*
+X401300D01*
+G37*
+G36*
+X409400D02*Y104000D01*
+X413900D01*
+Y110000D01*
+X409400D01*
+G37*
+G36*
+X414800D02*Y104000D01*
+X419300D01*
+Y110000D01*
+X414800D01*
+G37*
+G36*
+X420200D02*Y104000D01*
+X424700D01*
+Y110000D01*
+X420200D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G36*
+X439100D02*Y104000D01*
+X443600D01*
+Y110000D01*
+X439100D01*
+G37*
+G54D12*X447200D02*Y104000D01*
+Y110000D02*X450200D01*
+X447200Y107300D02*X449450D01*
+G54D13*G36*
+X452000Y110000D02*Y104000D01*
+X456500D01*
+Y110000D01*
+X452000D01*
+G37*
+G36*
+X457400D02*Y104000D01*
+X461900D01*
+Y110000D01*
+X457400D01*
+G37*
+G36*
+X462800D02*Y104000D01*
+X467300D01*
+Y110000D01*
+X462800D01*
+G37*
+G36*
+X468200D02*Y104000D01*
+X472700D01*
+Y110000D01*
+X468200D01*
+G37*
+G36*
+X473600D02*Y104000D01*
+X478100D01*
+Y110000D01*
+X473600D01*
+G37*
+G36*
+X479000D02*Y104000D01*
+X483500D01*
+Y110000D01*
+X479000D01*
+G37*
+G36*
+X484400D02*Y104000D01*
+X488900D01*
+Y110000D01*
+X484400D01*
+G37*
+G36*
+X489800D02*Y104000D01*
+X494300D01*
+Y110000D01*
+X489800D01*
+G37*
+G36*
+X495200D02*Y104000D01*
+X499700D01*
+Y110000D01*
+X495200D01*
+G37*
+G36*
+X500600D02*Y104000D01*
+X505100D01*
+Y110000D01*
+X500600D01*
+G37*
+G54D12*X509450D02*Y104000D01*
+X511400Y110000D02*X512450Y108950D01*
+Y105050D01*
+X511400Y104000D02*X512450Y105050D01*
+X508700Y104000D02*X511400D01*
+X508700Y110000D02*X511400D01*
+G54D13*G36*
+X514250D02*Y104000D01*
+X518750D01*
+Y110000D01*
+X514250D01*
+G37*
+G36*
+X519650D02*Y104000D01*
+X524150D01*
+Y110000D01*
+X519650D01*
+G37*
+G36*
+X525050D02*Y104000D01*
+X529550D01*
+Y110000D01*
+X525050D01*
+G37*
+G36*
+X530450D02*Y104000D01*
+X534950D01*
+Y110000D01*
+X530450D01*
+G37*
+G36*
+X535850D02*Y104000D01*
+X540350D01*
+Y110000D01*
+X535850D01*
+G37*
+G36*
+X541250D02*Y104000D01*
+X545750D01*
+Y110000D01*
+X541250D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_overlap2.gbr/line_overlap2.top.gbr b/tests/RTT/ref/line_overlap2.gbr/line_overlap2.top.gbr
new file mode 100644
index 0000000..4b231d6
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.gbr/line_overlap2.top.gbr
@@ -0,0 +1,15 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Two lines, one over the other, full cover, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0150*%
+G54D11*X20000Y30000D02*X35000D01*
+X22000D02*X30000D01*
+M02*
diff --git a/tests/RTT/ref/line_overlap2.net b/tests/RTT/ref/line_overlap2.net
new file mode 100644
index 0000000..b53cd6c
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Two lines, one over the other, full cover
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_overlap2.png b/tests/RTT/ref/line_overlap2.png
new file mode 100644
index 0000000..24bc2ec
Binary files /dev/null and b/tests/RTT/ref/line_overlap2.png differ
diff --git a/tests/RTT/ref/line_overlap2.ps.gz b/tests/RTT/ref/line_overlap2.ps.gz
new file mode 100644
index 0000000..e737cf5
Binary files /dev/null and b/tests/RTT/ref/line_overlap2.ps.gz differ
diff --git a/tests/RTT/ref/line_overlap2.remote.gz b/tests/RTT/ref/line_overlap2.remote.gz
new file mode 100644
index 0000000..88a4453
Binary files /dev/null and b/tests/RTT/ref/line_overlap2.remote.gz differ
diff --git a/tests/RTT/ref/line_overlap2.svg b/tests/RTT/ref/line_overlap2.svg
new file mode 100644
index 0000000..d11d1a7
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="5.0800" y1="5.0800" x2="8.8900" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="5.5880" y1="5.0800" x2="7.6200" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_overlap2.xy b/tests/RTT/ref/line_overlap2.xy
new file mode 100644
index 0000000..afee78f
--- /dev/null
+++ b/tests/RTT/ref/line_overlap2.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Two lines, one over the other, full cover - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap3.bom b/tests/RTT/ref/line_overlap3.bom
new file mode 100644
index 0000000..11e4200
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Full overlap: the same line twice - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap3.dsn b/tests/RTT/ref/line_overlap3.dsn
new file mode 100644
index 0000000..078a754
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.dsn
@@ -0,0 +1,61 @@
+(pcb Full overlap: the same line twice
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.381000 5.080000 7.620000 8.890000 7.620000)
+ (type protect))
+ (wire (path comp1 0.381000 5.080000 7.620000 8.890000 7.620000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_overlap3.gbr/line_overlap3.fab.gbr b/tests/RTT/ref/line_overlap3.gbr/line_overlap3.fab.gbr
new file mode 100644
index 0000000..b555d76
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.gbr/line_overlap3.fab.gbr
@@ -0,0 +1,1803 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Full overlap: the same line twice, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500D02*Y104000D01*
+Y110000D02*X237500D01*
+X234500Y107300D02*X236750D01*
+G54D13*G36*
+X239300Y110000D02*Y104000D01*
+X243800D01*
+Y110000D01*
+X239300D01*
+G37*
+G36*
+X244700D02*Y104000D01*
+X249200D01*
+Y110000D01*
+X244700D01*
+G37*
+G36*
+X250100D02*Y104000D01*
+X254600D01*
+Y110000D01*
+X250100D01*
+G37*
+G36*
+X258200D02*Y104000D01*
+X262700D01*
+Y110000D01*
+X258200D01*
+G37*
+G36*
+X263600D02*Y104000D01*
+X268100D01*
+Y110000D01*
+X263600D01*
+G37*
+G36*
+X269000D02*Y104000D01*
+X273500D01*
+Y110000D01*
+X269000D01*
+G37*
+G36*
+X274400D02*Y104000D01*
+X278900D01*
+Y110000D01*
+X274400D01*
+G37*
+G36*
+X279800D02*Y104000D01*
+X284300D01*
+Y110000D01*
+X279800D01*
+G37*
+G36*
+X285200D02*Y104000D01*
+X289700D01*
+Y110000D01*
+X285200D01*
+G37*
+G36*
+X290600D02*Y104000D01*
+X295100D01*
+Y110000D01*
+X290600D01*
+G37*
+G36*
+X296000D02*Y104000D01*
+X300500D01*
+Y110000D01*
+X296000D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X323000D02*Y104000D01*
+X327500D01*
+Y110000D01*
+X323000D01*
+G37*
+G36*
+X328400D02*Y104000D01*
+X332900D01*
+Y110000D01*
+X328400D01*
+G37*
+G36*
+X333800D02*Y104000D01*
+X338300D01*
+Y110000D01*
+X333800D01*
+G37*
+G36*
+X339200D02*Y104000D01*
+X343700D01*
+Y110000D01*
+X339200D01*
+G37*
+G36*
+X347300D02*Y104000D01*
+X351800D01*
+Y110000D01*
+X347300D01*
+G37*
+G36*
+X352700D02*Y104000D01*
+X357200D01*
+Y110000D01*
+X352700D01*
+G37*
+G36*
+X358100D02*Y104000D01*
+X362600D01*
+Y110000D01*
+X358100D01*
+G37*
+G36*
+X363500D02*Y104000D01*
+X368000D01*
+Y110000D01*
+X363500D01*
+G37*
+G36*
+X371600D02*Y104000D01*
+X376100D01*
+Y110000D01*
+X371600D01*
+G37*
+G36*
+X377000D02*Y104000D01*
+X381500D01*
+Y110000D01*
+X377000D01*
+G37*
+G36*
+X382400D02*Y104000D01*
+X386900D01*
+Y110000D01*
+X382400D01*
+G37*
+G36*
+X387800D02*Y104000D01*
+X392300D01*
+Y110000D01*
+X387800D01*
+G37*
+G36*
+X393200D02*Y104000D01*
+X397700D01*
+Y110000D01*
+X393200D01*
+G37*
+G36*
+X401300D02*Y104000D01*
+X405800D01*
+Y110000D01*
+X401300D01*
+G37*
+G54D12*X409400D02*Y104000D01*
+Y110000D02*X412400D01*
+X409400Y107300D02*X411650D01*
+G54D13*G36*
+X414200Y110000D02*Y104000D01*
+X418700D01*
+Y110000D01*
+X414200D01*
+G37*
+G36*
+X419600D02*Y104000D01*
+X424100D01*
+Y110000D01*
+X419600D01*
+G37*
+G36*
+X425000D02*Y104000D01*
+X429500D01*
+Y110000D01*
+X425000D01*
+G37*
+G36*
+X430400D02*Y104000D01*
+X434900D01*
+Y110000D01*
+X430400D01*
+G37*
+G36*
+X435800D02*Y104000D01*
+X440300D01*
+Y110000D01*
+X435800D01*
+G37*
+G36*
+X441200D02*Y104000D01*
+X445700D01*
+Y110000D01*
+X441200D01*
+G37*
+G36*
+X446600D02*Y104000D01*
+X451100D01*
+Y110000D01*
+X446600D01*
+G37*
+G36*
+X452000D02*Y104000D01*
+X456500D01*
+Y110000D01*
+X452000D01*
+G37*
+G36*
+X457400D02*Y104000D01*
+X461900D01*
+Y110000D01*
+X457400D01*
+G37*
+G36*
+X462800D02*Y104000D01*
+X467300D01*
+Y110000D01*
+X462800D01*
+G37*
+G54D12*X471650D02*Y104000D01*
+X473600Y110000D02*X474650Y108950D01*
+Y105050D01*
+X473600Y104000D02*X474650Y105050D01*
+X470900Y104000D02*X473600D01*
+X470900Y110000D02*X473600D01*
+G54D13*G36*
+X476450D02*Y104000D01*
+X480950D01*
+Y110000D01*
+X476450D01*
+G37*
+G36*
+X481850D02*Y104000D01*
+X486350D01*
+Y110000D01*
+X481850D01*
+G37*
+G36*
+X487250D02*Y104000D01*
+X491750D01*
+Y110000D01*
+X487250D01*
+G37*
+G36*
+X492650D02*Y104000D01*
+X497150D01*
+Y110000D01*
+X492650D01*
+G37*
+G36*
+X498050D02*Y104000D01*
+X502550D01*
+Y110000D01*
+X498050D01*
+G37*
+G36*
+X503450D02*Y104000D01*
+X507950D01*
+Y110000D01*
+X503450D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_overlap3.gbr/line_overlap3.top.gbr b/tests/RTT/ref/line_overlap3.gbr/line_overlap3.top.gbr
new file mode 100644
index 0000000..876e0d7
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.gbr/line_overlap3.top.gbr
@@ -0,0 +1,15 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Full overlap: the same line twice, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0150*%
+G54D11*X20000Y30000D02*X35000D01*
+X20000D02*X35000D01*
+M02*
diff --git a/tests/RTT/ref/line_overlap3.net b/tests/RTT/ref/line_overlap3.net
new file mode 100644
index 0000000..0f3955c
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Full overlap: the same line twice
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_overlap3.png b/tests/RTT/ref/line_overlap3.png
new file mode 100644
index 0000000..24bc2ec
Binary files /dev/null and b/tests/RTT/ref/line_overlap3.png differ
diff --git a/tests/RTT/ref/line_overlap3.ps.gz b/tests/RTT/ref/line_overlap3.ps.gz
new file mode 100644
index 0000000..799705d
Binary files /dev/null and b/tests/RTT/ref/line_overlap3.ps.gz differ
diff --git a/tests/RTT/ref/line_overlap3.remote.gz b/tests/RTT/ref/line_overlap3.remote.gz
new file mode 100644
index 0000000..7da0186
Binary files /dev/null and b/tests/RTT/ref/line_overlap3.remote.gz differ
diff --git a/tests/RTT/ref/line_overlap3.svg b/tests/RTT/ref/line_overlap3.svg
new file mode 100644
index 0000000..6d036bc
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="5.0800" y1="5.0800" x2="8.8900" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="5.0800" y1="5.0800" x2="8.8900" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_overlap3.xy b/tests/RTT/ref/line_overlap3.xy
new file mode 100644
index 0000000..c3c9ab2
--- /dev/null
+++ b/tests/RTT/ref/line_overlap3.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Full overlap: the same line twice - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap4.bom b/tests/RTT/ref/line_overlap4.bom
new file mode 100644
index 0000000..6836542
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Full overlap: the same line twice with different settings - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_overlap4.dsn b/tests/RTT/ref/line_overlap4.dsn
new file mode 100644
index 0000000..dde2bce
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.dsn
@@ -0,0 +1,61 @@
+(pcb Full overlap: the same line twice with different settings
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.127000 5.080000 7.620000 8.890000 7.620000)
+ (type protect))
+ (wire (path comp1 0.381000 5.080000 7.620000 8.890000 7.620000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_overlap4.gbr/line_overlap4.fab.gbr b/tests/RTT/ref/line_overlap4.gbr/line_overlap4.fab.gbr
new file mode 100644
index 0000000..e94f11e
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.gbr/line_overlap4.fab.gbr
@@ -0,0 +1,1929 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Full overlap: the same line twice with different settings, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD16C,0.0100*%
+%ADD15C,0.0001*%
+%ADD14C,0.0060*%
+G54D14*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D15*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D14*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D15*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D14*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D15*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D14*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D15*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D14*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D15*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D14*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D15*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D16*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D14*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D15*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D14*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D15*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D14*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D15*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D14*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D15*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D14*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D15*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D14*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D15*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D14*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D15*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D14*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D15*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D14*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D15*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D14*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D15*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D14*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D15*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D14*X234500D02*Y104000D01*
+Y110000D02*X237500D01*
+X234500Y107300D02*X236750D01*
+G54D15*G36*
+X239300Y110000D02*Y104000D01*
+X243800D01*
+Y110000D01*
+X239300D01*
+G37*
+G36*
+X244700D02*Y104000D01*
+X249200D01*
+Y110000D01*
+X244700D01*
+G37*
+G36*
+X250100D02*Y104000D01*
+X254600D01*
+Y110000D01*
+X250100D01*
+G37*
+G36*
+X258200D02*Y104000D01*
+X262700D01*
+Y110000D01*
+X258200D01*
+G37*
+G36*
+X263600D02*Y104000D01*
+X268100D01*
+Y110000D01*
+X263600D01*
+G37*
+G36*
+X269000D02*Y104000D01*
+X273500D01*
+Y110000D01*
+X269000D01*
+G37*
+G36*
+X274400D02*Y104000D01*
+X278900D01*
+Y110000D01*
+X274400D01*
+G37*
+G36*
+X279800D02*Y104000D01*
+X284300D01*
+Y110000D01*
+X279800D01*
+G37*
+G36*
+X285200D02*Y104000D01*
+X289700D01*
+Y110000D01*
+X285200D01*
+G37*
+G36*
+X290600D02*Y104000D01*
+X295100D01*
+Y110000D01*
+X290600D01*
+G37*
+G36*
+X296000D02*Y104000D01*
+X300500D01*
+Y110000D01*
+X296000D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X323000D02*Y104000D01*
+X327500D01*
+Y110000D01*
+X323000D01*
+G37*
+G36*
+X328400D02*Y104000D01*
+X332900D01*
+Y110000D01*
+X328400D01*
+G37*
+G36*
+X333800D02*Y104000D01*
+X338300D01*
+Y110000D01*
+X333800D01*
+G37*
+G36*
+X339200D02*Y104000D01*
+X343700D01*
+Y110000D01*
+X339200D01*
+G37*
+G36*
+X347300D02*Y104000D01*
+X351800D01*
+Y110000D01*
+X347300D01*
+G37*
+G36*
+X352700D02*Y104000D01*
+X357200D01*
+Y110000D01*
+X352700D01*
+G37*
+G36*
+X358100D02*Y104000D01*
+X362600D01*
+Y110000D01*
+X358100D01*
+G37*
+G36*
+X363500D02*Y104000D01*
+X368000D01*
+Y110000D01*
+X363500D01*
+G37*
+G36*
+X371600D02*Y104000D01*
+X376100D01*
+Y110000D01*
+X371600D01*
+G37*
+G36*
+X377000D02*Y104000D01*
+X381500D01*
+Y110000D01*
+X377000D01*
+G37*
+G36*
+X382400D02*Y104000D01*
+X386900D01*
+Y110000D01*
+X382400D01*
+G37*
+G36*
+X387800D02*Y104000D01*
+X392300D01*
+Y110000D01*
+X387800D01*
+G37*
+G36*
+X393200D02*Y104000D01*
+X397700D01*
+Y110000D01*
+X393200D01*
+G37*
+G36*
+X401300D02*Y104000D01*
+X405800D01*
+Y110000D01*
+X401300D01*
+G37*
+G36*
+X406700D02*Y104000D01*
+X411200D01*
+Y110000D01*
+X406700D01*
+G37*
+G36*
+X412100D02*Y104000D01*
+X416600D01*
+Y110000D01*
+X412100D01*
+G37*
+G36*
+X417500D02*Y104000D01*
+X422000D01*
+Y110000D01*
+X417500D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G36*
+X436400D02*Y104000D01*
+X440900D01*
+Y110000D01*
+X436400D01*
+G37*
+G36*
+X441800D02*Y104000D01*
+X446300D01*
+Y110000D01*
+X441800D01*
+G37*
+G36*
+X447200D02*Y104000D01*
+X451700D01*
+Y110000D01*
+X447200D01*
+G37*
+G36*
+X452600D02*Y104000D01*
+X457100D01*
+Y110000D01*
+X452600D01*
+G37*
+G36*
+X458000D02*Y104000D01*
+X462500D01*
+Y110000D01*
+X458000D01*
+G37*
+G36*
+X463400D02*Y104000D01*
+X467900D01*
+Y110000D01*
+X463400D01*
+G37*
+G36*
+X468800D02*Y104000D01*
+X473300D01*
+Y110000D01*
+X468800D01*
+G37*
+G36*
+X476900D02*Y104000D01*
+X481400D01*
+Y110000D01*
+X476900D01*
+G37*
+G36*
+X482300D02*Y104000D01*
+X486800D01*
+Y110000D01*
+X482300D01*
+G37*
+G36*
+X487700D02*Y104000D01*
+X492200D01*
+Y110000D01*
+X487700D01*
+G37*
+G36*
+X493100D02*Y104000D01*
+X497600D01*
+Y110000D01*
+X493100D01*
+G37*
+G36*
+X498500D02*Y104000D01*
+X503000D01*
+Y110000D01*
+X498500D01*
+G37*
+G36*
+X503900D02*Y104000D01*
+X508400D01*
+Y110000D01*
+X503900D01*
+G37*
+G36*
+X509300D02*Y104000D01*
+X513800D01*
+Y110000D01*
+X509300D01*
+G37*
+G36*
+X514700D02*Y104000D01*
+X519200D01*
+Y110000D01*
+X514700D01*
+G37*
+G36*
+X522800D02*Y104000D01*
+X527300D01*
+Y110000D01*
+X522800D01*
+G37*
+G54D14*X530900D02*Y104000D01*
+Y110000D02*X533900D01*
+X530900Y107300D02*X533150D01*
+G54D15*G36*
+X535700Y110000D02*Y104000D01*
+X540200D01*
+Y110000D01*
+X535700D01*
+G37*
+G36*
+X541100D02*Y104000D01*
+X545600D01*
+Y110000D01*
+X541100D01*
+G37*
+G36*
+X546500D02*Y104000D01*
+X551000D01*
+Y110000D01*
+X546500D01*
+G37*
+G36*
+X551900D02*Y104000D01*
+X556400D01*
+Y110000D01*
+X551900D01*
+G37*
+G36*
+X557300D02*Y104000D01*
+X561800D01*
+Y110000D01*
+X557300D01*
+G37*
+G36*
+X562700D02*Y104000D01*
+X567200D01*
+Y110000D01*
+X562700D01*
+G37*
+G36*
+X568100D02*Y104000D01*
+X572600D01*
+Y110000D01*
+X568100D01*
+G37*
+G36*
+X573500D02*Y104000D01*
+X578000D01*
+Y110000D01*
+X573500D01*
+G37*
+G36*
+X578900D02*Y104000D01*
+X583400D01*
+Y110000D01*
+X578900D01*
+G37*
+G36*
+X584300D02*Y104000D01*
+X588800D01*
+Y110000D01*
+X584300D01*
+G37*
+G54D14*X593150D02*Y104000D01*
+X595100Y110000D02*X596150Y108950D01*
+Y105050D01*
+X595100Y104000D02*X596150Y105050D01*
+X592400Y104000D02*X595100D01*
+X592400Y110000D02*X595100D01*
+G54D15*G36*
+X597950D02*Y104000D01*
+X602450D01*
+Y110000D01*
+X597950D01*
+G37*
+G36*
+X603350D02*Y104000D01*
+X607850D01*
+Y110000D01*
+X603350D01*
+G37*
+G36*
+X608750D02*Y104000D01*
+X613250D01*
+Y110000D01*
+X608750D01*
+G37*
+G36*
+X614150D02*Y104000D01*
+X618650D01*
+Y110000D01*
+X614150D01*
+G37*
+G36*
+X619550D02*Y104000D01*
+X624050D01*
+Y110000D01*
+X619550D01*
+G37*
+G36*
+X624950D02*Y104000D01*
+X629450D01*
+Y110000D01*
+X624950D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_overlap4.gbr/line_overlap4.top.gbr b/tests/RTT/ref/line_overlap4.gbr/line_overlap4.top.gbr
new file mode 100644
index 0000000..1ce4670
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.gbr/line_overlap4.top.gbr
@@ -0,0 +1,46 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Full overlap: the same line twice with different settings, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD13C,0.0150*%
+%ADD12C,0.0050*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X15000Y35000D02*X30000D01*
+Y32250D01*
+X20000D01*
+X19647Y32229D01*
+X19303Y32146D01*
+X18975Y32011D01*
+X18673Y31826D01*
+X18404Y31596D01*
+X18174Y31327D01*
+X17989Y31025D01*
+X17854Y30697D01*
+X17771Y30353D01*
+X17743Y30000D01*
+X17771Y29647D01*
+X17854Y29303D01*
+X17989Y28975D01*
+X18174Y28673D01*
+X18404Y28404D01*
+X18673Y28174D01*
+X18975Y27989D01*
+X19303Y27854D01*
+X19647Y27771D01*
+X20000Y27750D01*
+X30000D01*
+Y17500D01*
+X15000D01*
+Y35000D01*
+G37*
+G54D12*X20000Y30000D02*X35000D01*
+G54D13*X20000D02*X35000D01*
+M02*
diff --git a/tests/RTT/ref/line_overlap4.net b/tests/RTT/ref/line_overlap4.net
new file mode 100644
index 0000000..e6ea5ed
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Full overlap: the same line twice with different settings
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_overlap4.png b/tests/RTT/ref/line_overlap4.png
new file mode 100644
index 0000000..cf41506
Binary files /dev/null and b/tests/RTT/ref/line_overlap4.png differ
diff --git a/tests/RTT/ref/line_overlap4.ps.gz b/tests/RTT/ref/line_overlap4.ps.gz
new file mode 100644
index 0000000..cc6e5e3
Binary files /dev/null and b/tests/RTT/ref/line_overlap4.ps.gz differ
diff --git a/tests/RTT/ref/line_overlap4.remote.gz b/tests/RTT/ref/line_overlap4.remote.gz
new file mode 100644
index 0000000..f6e363d
Binary files /dev/null and b/tests/RTT/ref/line_overlap4.remote.gz differ
diff --git a/tests/RTT/ref/line_overlap4.svg b/tests/RTT/ref/line_overlap4.svg
new file mode 100644
index 0000000..56e95c9
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="3.8100,3.8100 7.6200,3.8100 7.6200,4.5085 5.0800,4.5085 4.9903,4.5138 4.9029,4.5348 4.8197,4.5692 4.7430,4.6162 4.6746,4.6746 4.6162,4.7430 4.5692,4.8197 4.5348,4.9029 4.5138,4.9903 4.5067,5.0800 4.5138,5.1697 4.5348,5.2571 4.5692,5.3403 4.6162,5.4170 4.6746,5.4854 4.7430,5.5438 4.8197,5.5908 4.9029,5.6252 4.9903,5.6462 5.0800,5.6515 7.6200,5.6515 7.6200,8.2550 3.8100,8.2550 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <line x1="5.0800" y1="5.0800" x2="8.8900" y2="5.0800" stroke-width="0.1270" stroke="#8b2323" stroke-linecap="round"/>
+ <line x1="5.0800" y1="5.0800" x2="8.8900" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_overlap4.xy b/tests/RTT/ref/line_overlap4.xy
new file mode 100644
index 0000000..7af8c66
--- /dev/null
+++ b/tests/RTT/ref/line_overlap4.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Full overlap: the same line twice with different settings - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_zerolen.bom b/tests/RTT/ref/line_zerolen.bom
new file mode 100644
index 0000000..07da810
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: A single zero length line - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/line_zerolen.dsn b/tests/RTT/ref/line_zerolen.dsn
new file mode 100644
index 0000000..dffd266
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.dsn
@@ -0,0 +1,59 @@
+(pcb A single zero length line
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+ (wire (path comp1 0.381000 5.080000 7.620000 5.080000 7.620000)
+ (type protect))
+
+ )
+)
diff --git a/tests/RTT/ref/line_zerolen.gbr/line_zerolen.fab.gbr b/tests/RTT/ref/line_zerolen.gbr/line_zerolen.fab.gbr
new file mode 100644
index 0000000..e1a2655
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.gbr/line_zerolen.fab.gbr
@@ -0,0 +1,1764 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: A single zero length line, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500Y108500D02*Y104000D01*
+Y108500D02*X235550Y110000D01*
+X237200D01*
+X238250Y108500D01*
+Y104000D01*
+X234500Y107000D02*X238250D01*
+G54D13*G36*
+X242750Y110000D02*Y104000D01*
+X247250D01*
+Y110000D01*
+X242750D01*
+G37*
+G36*
+X248150D02*Y104000D01*
+X252650D01*
+Y110000D01*
+X248150D01*
+G37*
+G36*
+X253550D02*Y104000D01*
+X258050D01*
+Y110000D01*
+X253550D01*
+G37*
+G36*
+X258950D02*Y104000D01*
+X263450D01*
+Y110000D01*
+X258950D01*
+G37*
+G36*
+X264350D02*Y104000D01*
+X268850D01*
+Y110000D01*
+X264350D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X277850D02*Y104000D01*
+X282350D01*
+Y110000D01*
+X277850D01*
+G37*
+G36*
+X283250D02*Y104000D01*
+X287750D01*
+Y110000D01*
+X283250D01*
+G37*
+G36*
+X288650D02*Y104000D01*
+X293150D01*
+Y110000D01*
+X288650D01*
+G37*
+G36*
+X294050D02*Y104000D01*
+X298550D01*
+Y110000D01*
+X294050D01*
+G37*
+G36*
+X302150D02*Y104000D01*
+X306650D01*
+Y110000D01*
+X302150D01*
+G37*
+G36*
+X307550D02*Y104000D01*
+X312050D01*
+Y110000D01*
+X307550D01*
+G37*
+G36*
+X312950D02*Y104000D01*
+X317450D01*
+Y110000D01*
+X312950D01*
+G37*
+G36*
+X318350D02*Y104000D01*
+X322850D01*
+Y110000D01*
+X318350D01*
+G37*
+G36*
+X323750D02*Y104000D01*
+X328250D01*
+Y110000D01*
+X323750D01*
+G37*
+G36*
+X329150D02*Y104000D01*
+X333650D01*
+Y110000D01*
+X329150D01*
+G37*
+G36*
+X337250D02*Y104000D01*
+X341750D01*
+Y110000D01*
+X337250D01*
+G37*
+G36*
+X342650D02*Y104000D01*
+X347150D01*
+Y110000D01*
+X342650D01*
+G37*
+G36*
+X348050D02*Y104000D01*
+X352550D01*
+Y110000D01*
+X348050D01*
+G37*
+G36*
+X353450D02*Y104000D01*
+X357950D01*
+Y110000D01*
+X353450D01*
+G37*
+G36*
+X361550D02*Y104000D01*
+X366050D01*
+Y110000D01*
+X361550D01*
+G37*
+G54D12*X369650D02*Y104000D01*
+Y110000D02*X372650D01*
+X369650Y107300D02*X371900D01*
+G54D13*G36*
+X374450Y110000D02*Y104000D01*
+X378950D01*
+Y110000D01*
+X374450D01*
+G37*
+G36*
+X379850D02*Y104000D01*
+X384350D01*
+Y110000D01*
+X379850D01*
+G37*
+G36*
+X385250D02*Y104000D01*
+X389750D01*
+Y110000D01*
+X385250D01*
+G37*
+G36*
+X390650D02*Y104000D01*
+X395150D01*
+Y110000D01*
+X390650D01*
+G37*
+G36*
+X396050D02*Y104000D01*
+X400550D01*
+Y110000D01*
+X396050D01*
+G37*
+G36*
+X401450D02*Y104000D01*
+X405950D01*
+Y110000D01*
+X401450D01*
+G37*
+G36*
+X406850D02*Y104000D01*
+X411350D01*
+Y110000D01*
+X406850D01*
+G37*
+G36*
+X412250D02*Y104000D01*
+X416750D01*
+Y110000D01*
+X412250D01*
+G37*
+G36*
+X417650D02*Y104000D01*
+X422150D01*
+Y110000D01*
+X417650D01*
+G37*
+G36*
+X423050D02*Y104000D01*
+X427550D01*
+Y110000D01*
+X423050D01*
+G37*
+G54D12*X431900D02*Y104000D01*
+X433850Y110000D02*X434900Y108950D01*
+Y105050D01*
+X433850Y104000D02*X434900Y105050D01*
+X431150Y104000D02*X433850D01*
+X431150Y110000D02*X433850D01*
+G54D13*G36*
+X436700D02*Y104000D01*
+X441200D01*
+Y110000D01*
+X436700D01*
+G37*
+G36*
+X442100D02*Y104000D01*
+X446600D01*
+Y110000D01*
+X442100D01*
+G37*
+G36*
+X447500D02*Y104000D01*
+X452000D01*
+Y110000D01*
+X447500D01*
+G37*
+G36*
+X452900D02*Y104000D01*
+X457400D01*
+Y110000D01*
+X452900D01*
+G37*
+G36*
+X458300D02*Y104000D01*
+X462800D01*
+Y110000D01*
+X458300D01*
+G37*
+G36*
+X463700D02*Y104000D01*
+X468200D01*
+Y110000D01*
+X463700D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/line_zerolen.gbr/line_zerolen.top.gbr b/tests/RTT/ref/line_zerolen.gbr/line_zerolen.top.gbr
new file mode 100644
index 0000000..3783e46
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.gbr/line_zerolen.top.gbr
@@ -0,0 +1,14 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: A single zero length line, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0150*%
+G54D11*X20000Y30000D03*
+M02*
diff --git a/tests/RTT/ref/line_zerolen.net b/tests/RTT/ref/line_zerolen.net
new file mode 100644
index 0000000..8957e7c
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB A single zero length line
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/line_zerolen.png b/tests/RTT/ref/line_zerolen.png
new file mode 100644
index 0000000..34922b6
Binary files /dev/null and b/tests/RTT/ref/line_zerolen.png differ
diff --git a/tests/RTT/ref/line_zerolen.ps.gz b/tests/RTT/ref/line_zerolen.ps.gz
new file mode 100644
index 0000000..c3c3f24
Binary files /dev/null and b/tests/RTT/ref/line_zerolen.ps.gz differ
diff --git a/tests/RTT/ref/line_zerolen.remote.gz b/tests/RTT/ref/line_zerolen.remote.gz
new file mode 100644
index 0000000..3de3ace
Binary files /dev/null and b/tests/RTT/ref/line_zerolen.remote.gz differ
diff --git a/tests/RTT/ref/line_zerolen.svg b/tests/RTT/ref/line_zerolen.svg
new file mode 100644
index 0000000..d11b68b
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <line x1="5.0800" y1="5.0800" x2="5.0800" y2="5.0800" stroke-width="0.3810" stroke="#8b2323" stroke-linecap="round"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/line_zerolen.xy b/tests/RTT/ref/line_zerolen.xy
new file mode 100644
index 0000000..e15af53
--- /dev/null
+++ b/tests/RTT/ref/line_zerolen.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: A single zero length line - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/netlist.bom b/tests/RTT/ref/netlist.bom
new file mode 100644
index 0000000..52f2bcb
--- /dev/null
+++ b/tests/RTT/ref/netlist.bom
@@ -0,0 +1,8 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: board with minimal netlist - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+1,"dip(4)","4*300",U1
diff --git a/tests/RTT/ref/netlist.dsn b/tests/RTT/ref/netlist.dsn
new file mode 100644
index 0000000..ad2dbc6
--- /dev/null
+++ b/tests/RTT/ref/netlist.dsn
@@ -0,0 +1,80 @@
+(pcb board with minimal netlist
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "U1" 6.350000 6.985000 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Th_square_2032000 "1" -3.810000 1.270000)
+ (pin Th_round_2032000 "4" 3.810000 1.270000)
+ (pin Th_round_2032000 "2" -3.810000 -1.270000)
+ (pin Th_round_2032000 "3" 3.810000 -1.270000)
+ )
+ (padstack Th_square_2032000
+ (shape (rect signal -1.016000 -1.016000 1.016000 1.016000))
+ (attach off)
+ )
+ (padstack Th_round_2032000
+ (shape (circle signal 2.032000))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (net "bar"
+ (pins "U1"-"2" "U1"-"4")
+ )
+ (net "foo"
+ (pins "U1"-"1" "U1"-"3")
+ )
+ (class geda_default "bar" "foo"
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/netlist.gbr/netlist.bottommask.gbr b/tests/RTT/ref/netlist.gbr/netlist.bottommask.gbr
new file mode 100644
index 0000000..366e9e1
--- /dev/null
+++ b/tests/RTT/ref/netlist.gbr/netlist.bottommask.gbr
@@ -0,0 +1,23 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: board with minimal netlist, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMMASK*%
+%ADD15C,0.0860*%
+%ADD14C,0.0001*%
+G54D14*G36*
+X5700Y36800D02*Y28200D01*
+X14300D01*
+Y36800D01*
+X5700D01*
+G37*
+G54D15*X40000Y32500D03*
+X10000Y22500D03*
+X40000D03*
+M02*
diff --git a/tests/RTT/ref/netlist.gbr/netlist.fab.gbr b/tests/RTT/ref/netlist.gbr/netlist.fab.gbr
new file mode 100644
index 0000000..f94c237
--- /dev/null
+++ b/tests/RTT/ref/netlist.gbr/netlist.fab.gbr
@@ -0,0 +1,1834 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: board with minimal netlist, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD19C,0.0100*%
+%ADD18C,0.0001*%
+%ADD17C,0.0060*%
+%ADD16C,0.0080*%
+G54D16*X10000Y32500D02*Y30900D01*
+Y32500D02*X11387Y33300D01*
+X10000Y32500D02*X8613Y33300D01*
+X40000Y32500D02*Y30900D01*
+Y32500D02*X41387Y33300D01*
+X40000Y32500D02*X38613Y33300D01*
+X10000Y22500D02*Y20900D01*
+Y22500D02*X11387Y23300D01*
+X10000Y22500D02*X8613Y23300D01*
+X40000Y22500D02*Y20900D01*
+Y22500D02*X41387Y23300D01*
+X40000Y22500D02*X38613Y23300D01*
+X15000Y106250D02*Y104650D01*
+Y106250D02*X16387Y107050D01*
+X15000Y106250D02*X13613Y107050D01*
+G54D17*X135000Y110000D02*X136500Y107000D01*
+X138000Y110000D01*
+X136500Y107000D02*Y104000D01*
+X139800Y107300D02*X142050D01*
+X139800Y104000D02*X142800D01*
+X139800Y110000D02*Y104000D01*
+Y110000D02*X142800D01*
+X147600D02*X148350Y109250D01*
+X145350Y110000D02*X147600D01*
+X144600Y109250D02*X145350Y110000D01*
+X144600Y109250D02*Y107750D01*
+X145350Y107000D01*
+X147600D01*
+X148350Y106250D01*
+Y104750D01*
+X147600Y104000D02*X148350Y104750D01*
+X145350Y104000D02*X147600D01*
+X144600Y104750D02*X145350Y104000D01*
+X98000Y106250D02*X101000Y110000D01*
+X98000Y106250D02*X101750D01*
+X101000Y110000D02*Y104000D01*
+G54D18*G36*
+X45000Y110000D02*Y104000D01*
+X49500D01*
+Y110000D01*
+X45000D01*
+G37*
+G36*
+X50400D02*Y104000D01*
+X54900D01*
+Y110000D01*
+X50400D01*
+G37*
+G36*
+X55800D02*Y104000D01*
+X60300D01*
+Y110000D01*
+X55800D01*
+G37*
+G54D17*X61200Y106250D02*X64200Y110000D01*
+X61200Y106250D02*X64950D01*
+X64200Y110000D02*Y104000D01*
+G54D18*G36*
+X66750Y110000D02*Y104000D01*
+X71250D01*
+Y110000D01*
+X66750D01*
+G37*
+G54D17*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D18*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D17*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D18*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D17*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D18*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D17*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D18*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D17*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D18*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D17*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D18*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G54D17*X48000Y138800D02*X49200Y140000D01*
+Y134000D01*
+X48000D02*X50250D01*
+G54D18*G36*
+X54750Y140000D02*Y134000D01*
+X59250D01*
+Y140000D01*
+X54750D01*
+G37*
+G36*
+X60150D02*Y134000D01*
+X64650D01*
+Y140000D01*
+X60150D01*
+G37*
+G36*
+X65550D02*Y134000D01*
+X70050D01*
+Y140000D01*
+X65550D01*
+G37*
+G36*
+X70950D02*Y134000D01*
+X75450D01*
+Y140000D01*
+X70950D01*
+G37*
+G36*
+X76350D02*Y134000D01*
+X80850D01*
+Y140000D01*
+X76350D01*
+G37*
+G36*
+X81750D02*Y134000D01*
+X86250D01*
+Y140000D01*
+X81750D01*
+G37*
+G36*
+X87150D02*Y134000D01*
+X91650D01*
+Y140000D01*
+X87150D01*
+G37*
+G36*
+X92550D02*Y134000D01*
+X97050D01*
+Y140000D01*
+X92550D01*
+G37*
+G36*
+X97950D02*Y134000D01*
+X102450D01*
+Y140000D01*
+X97950D01*
+G37*
+G36*
+X106050D02*Y134000D01*
+X110550D01*
+Y140000D01*
+X106050D01*
+G37*
+G36*
+X111450D02*Y134000D01*
+X115950D01*
+Y140000D01*
+X111450D01*
+G37*
+G36*
+X116850D02*Y134000D01*
+X121350D01*
+Y140000D01*
+X116850D01*
+G37*
+G36*
+X122250D02*Y134000D01*
+X126750D01*
+Y140000D01*
+X122250D01*
+G37*
+G36*
+X127650D02*Y134000D01*
+X132150D01*
+Y140000D01*
+X127650D01*
+G37*
+G36*
+X135750D02*Y134000D01*
+X140250D01*
+Y140000D01*
+X135750D01*
+G37*
+G36*
+X141150D02*Y134000D01*
+X145650D01*
+Y140000D01*
+X141150D01*
+G37*
+G36*
+X146550D02*Y134000D01*
+X151050D01*
+Y140000D01*
+X146550D01*
+G37*
+G36*
+X151950D02*Y134000D01*
+X156450D01*
+Y140000D01*
+X151950D01*
+G37*
+G36*
+X157350D02*Y134000D01*
+X161850D01*
+Y140000D01*
+X157350D01*
+G37*
+G36*
+X165450D02*Y134000D01*
+X169950D01*
+Y140000D01*
+X165450D01*
+G37*
+G36*
+X170850D02*Y134000D01*
+X175350D01*
+Y140000D01*
+X170850D01*
+G37*
+G36*
+X176250D02*Y134000D01*
+X180750D01*
+Y140000D01*
+X176250D01*
+G37*
+G36*
+X181650D02*Y134000D01*
+X186150D01*
+Y140000D01*
+X181650D01*
+G37*
+G36*
+X189750D02*Y134000D01*
+X194250D01*
+Y140000D01*
+X189750D01*
+G37*
+G36*
+X195150D02*Y134000D01*
+X199650D01*
+Y140000D01*
+X195150D01*
+G37*
+G36*
+X203250D02*Y134000D01*
+X207750D01*
+Y140000D01*
+X203250D01*
+G37*
+G36*
+X208650D02*Y134000D01*
+X213150D01*
+Y140000D01*
+X208650D01*
+G37*
+G36*
+X214050D02*Y134000D01*
+X218550D01*
+Y140000D01*
+X214050D01*
+G37*
+G36*
+X219450D02*Y134000D01*
+X223950D01*
+Y140000D01*
+X219450D01*
+G37*
+G36*
+X227550D02*Y134000D01*
+X232050D01*
+Y140000D01*
+X227550D01*
+G37*
+G36*
+X232950D02*Y134000D01*
+X237450D01*
+Y140000D01*
+X232950D01*
+G37*
+G36*
+X238350D02*Y134000D01*
+X242850D01*
+Y140000D01*
+X238350D01*
+G37*
+G36*
+X243750D02*Y134000D01*
+X248250D01*
+Y140000D01*
+X243750D01*
+G37*
+G36*
+X249150D02*Y134000D01*
+X253650D01*
+Y140000D01*
+X249150D01*
+G37*
+G36*
+X254550D02*Y134000D01*
+X259050D01*
+Y140000D01*
+X254550D01*
+G37*
+G36*
+X259950D02*Y134000D01*
+X264450D01*
+Y140000D01*
+X259950D01*
+G37*
+G54D17*X268050Y136250D02*X271050Y140000D01*
+X268050Y136250D02*X271800D01*
+X271050Y140000D02*Y134000D01*
+G54D18*G36*
+X276300Y140000D02*Y134000D01*
+X280800D01*
+Y140000D01*
+X276300D01*
+G37*
+G36*
+X281700D02*Y134000D01*
+X286200D01*
+Y140000D01*
+X281700D01*
+G37*
+G36*
+X287100D02*Y134000D01*
+X291600D01*
+Y140000D01*
+X287100D01*
+G37*
+G36*
+X292500D02*Y134000D01*
+X297000D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297900D02*Y134000D01*
+X302400D01*
+Y140000D01*
+X297900D01*
+G37*
+G36*
+X306000D02*Y134000D01*
+X310500D01*
+Y140000D01*
+X306000D01*
+G37*
+G36*
+X311400D02*Y134000D01*
+X315900D01*
+Y140000D01*
+X311400D01*
+G37*
+G36*
+X316800D02*Y134000D01*
+X321300D01*
+Y140000D01*
+X316800D01*
+G37*
+G36*
+X322200D02*Y134000D01*
+X326700D01*
+Y140000D01*
+X322200D01*
+G37*
+G36*
+X327600D02*Y134000D01*
+X332100D01*
+Y140000D01*
+X327600D01*
+G37*
+G54D19*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D17*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D18*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D17*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D18*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D17*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D18*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D17*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D18*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D17*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D18*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D17*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D18*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D17*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D18*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D17*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D18*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D17*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D18*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D17*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D18*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D17*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D18*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X329000D02*Y104000D01*
+X333500D01*
+Y110000D01*
+X329000D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G54D17*X377600D02*Y104000D01*
+Y110000D02*X380600D01*
+X377600Y107300D02*X379850D01*
+G54D18*G36*
+X382400Y110000D02*Y104000D01*
+X386900D01*
+Y110000D01*
+X382400D01*
+G37*
+G36*
+X387800D02*Y104000D01*
+X392300D01*
+Y110000D01*
+X387800D01*
+G37*
+G36*
+X393200D02*Y104000D01*
+X397700D01*
+Y110000D01*
+X393200D01*
+G37*
+G36*
+X398600D02*Y104000D01*
+X403100D01*
+Y110000D01*
+X398600D01*
+G37*
+G36*
+X404000D02*Y104000D01*
+X408500D01*
+Y110000D01*
+X404000D01*
+G37*
+G36*
+X409400D02*Y104000D01*
+X413900D01*
+Y110000D01*
+X409400D01*
+G37*
+G36*
+X414800D02*Y104000D01*
+X419300D01*
+Y110000D01*
+X414800D01*
+G37*
+G36*
+X420200D02*Y104000D01*
+X424700D01*
+Y110000D01*
+X420200D01*
+G37*
+G36*
+X425600D02*Y104000D01*
+X430100D01*
+Y110000D01*
+X425600D01*
+G37*
+G36*
+X431000D02*Y104000D01*
+X435500D01*
+Y110000D01*
+X431000D01*
+G37*
+G54D17*X439850D02*Y104000D01*
+X441800Y110000D02*X442850Y108950D01*
+Y105050D01*
+X441800Y104000D02*X442850Y105050D01*
+X439100Y104000D02*X441800D01*
+X439100Y110000D02*X441800D01*
+G54D18*G36*
+X444650D02*Y104000D01*
+X449150D01*
+Y110000D01*
+X444650D01*
+G37*
+G36*
+X450050D02*Y104000D01*
+X454550D01*
+Y110000D01*
+X450050D01*
+G37*
+G36*
+X455450D02*Y104000D01*
+X459950D01*
+Y110000D01*
+X455450D01*
+G37*
+G36*
+X460850D02*Y104000D01*
+X465350D01*
+Y110000D01*
+X460850D01*
+G37*
+G36*
+X466250D02*Y104000D01*
+X470750D01*
+Y110000D01*
+X466250D01*
+G37*
+G36*
+X471650D02*Y104000D01*
+X476150D01*
+Y110000D01*
+X471650D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/netlist.gbr/netlist.topmask.gbr b/tests/RTT/ref/netlist.gbr/netlist.topmask.gbr
new file mode 100644
index 0000000..bae0237
--- /dev/null
+++ b/tests/RTT/ref/netlist.gbr/netlist.topmask.gbr
@@ -0,0 +1,23 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: board with minimal netlist, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD13C,0.0860*%
+%ADD12C,0.0001*%
+G54D12*G36*
+X5700Y36800D02*Y28200D01*
+X14300D01*
+Y36800D01*
+X5700D01*
+G37*
+G54D13*X40000Y32500D03*
+X10000Y22500D03*
+X40000D03*
+M02*
diff --git a/tests/RTT/ref/netlist.net b/tests/RTT/ref/netlist.net
new file mode 100644
index 0000000..a020dea
--- /dev/null
+++ b/tests/RTT/ref/netlist.net
@@ -0,0 +1,16 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB board with minimal netlist
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+317foo U1 -1 D0393PA00X+001000Y+003250X0800Y0800R000 S0
+317bar U1 -4 D0393PA00X+004000Y+003250X0800Y0000R000 S0
+317bar U1 -2 D0393PA00X+001000Y+002250X0800Y0000R000 S0
+317foo U1 -3 D0393PA00X+004000Y+002250X0800Y0000R000 S0
+999
diff --git a/tests/RTT/ref/netlist.png b/tests/RTT/ref/netlist.png
new file mode 100644
index 0000000..8f68bb1
Binary files /dev/null and b/tests/RTT/ref/netlist.png differ
diff --git a/tests/RTT/ref/netlist.ps.gz b/tests/RTT/ref/netlist.ps.gz
new file mode 100644
index 0000000..49713d8
Binary files /dev/null and b/tests/RTT/ref/netlist.ps.gz differ
diff --git a/tests/RTT/ref/netlist.remote.gz b/tests/RTT/ref/netlist.remote.gz
new file mode 100644
index 0000000..454b3fa
Binary files /dev/null and b/tests/RTT/ref/netlist.remote.gz differ
diff --git a/tests/RTT/ref/netlist.svg b/tests/RTT/ref/netlist.svg
new file mode 100644
index 0000000..db15ae8
--- /dev/null
+++ b/tests/RTT/ref/netlist.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="1.2700" y1="3.1750" x2="1.2700" y2="8.2550" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="11.4300" y1="8.2550" x2="1.2700" y2="8.2550" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="11.4300" y1="8.2550" x2="11.4300" y2="3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="3.1750" x2="5.0800" y2="3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.6200" y1="3.1750" x2="11.4300" y2="3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <path d="M 5.0800 3.1750 A 1.2700 1.2700 0 0 0 7.6200 3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round" fill="none"/>
+ <line x1="2.5400" y1="1.9050" x2="2.5400" y2="2.7940" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.5400" y1="2.7940" x2="2.6670" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.6670" y1="2.9210" x2="2.9210" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.9210" y1="2.9210" x2="3.0480" y2="2.7940" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.0480" y1="1.9050" x2="3.0480" y2="2.7940" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="2.1082" x2="3.5560" y2="1.9050" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.5560" y1="1.9050" x2="3.5560" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="2.9210" x2="3.7338" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+<g id="layer_-4048_plated-drill">
+<!--normal-->
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/netlist.xy b/tests/RTT/ref/netlist.xy
new file mode 100644
index 0000000..799148d
--- /dev/null
+++ b/tests/RTT/ref/netlist.xy
@@ -0,0 +1,9 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: board with minimal netlist - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+U1,"dip(4)","4*300",250.00,275.00,0,top
diff --git a/tests/RTT/ref/netlist_ba.bom b/tests/RTT/ref/netlist_ba.bom
new file mode 100644
index 0000000..ebb21d1
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.bom
@@ -0,0 +1,8 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: board with minimal netlist and some back-annotation changes - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
+1,"dip(4)","4*300",U1
diff --git a/tests/RTT/ref/netlist_ba.dsn b/tests/RTT/ref/netlist_ba.dsn
new file mode 100644
index 0000000..0f0c1c5
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.dsn
@@ -0,0 +1,80 @@
+(pcb board with minimal netlist and some back-annotation changes
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 8
+ (place "U1" 6.350000 6.985000 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 8
+ (pin Th_square_2032000 "1" -3.810000 1.270000)
+ (pin Th_round_2032000 "4" 3.810000 1.270000)
+ (pin Th_round_2032000 "2" -3.810000 -1.270000)
+ (pin Th_round_2032000 "3" 3.810000 -1.270000)
+ )
+ (padstack Th_square_2032000
+ (shape (rect signal -1.016000 -1.016000 1.016000 1.016000))
+ (attach off)
+ )
+ (padstack Th_round_2032000
+ (shape (circle signal 2.032000))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (net "bar"
+ (pins "U1"-"2" "U1"-"4" "U1"-"1")
+ )
+ (net "foo"
+ (pins "U1"-"3")
+ )
+ (class geda_default "bar" "foo"
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/netlist_ba.gbr/netlist_ba.bottommask.gbr b/tests/RTT/ref/netlist_ba.gbr/netlist_ba.bottommask.gbr
new file mode 100644
index 0000000..de1b800
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.gbr/netlist_ba.bottommask.gbr
@@ -0,0 +1,23 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: board with minimal netlist and some back-annotation changes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMMASK*%
+%ADD15C,0.0860*%
+%ADD14C,0.0001*%
+G54D14*G36*
+X5700Y36800D02*Y28200D01*
+X14300D01*
+Y36800D01*
+X5700D01*
+G37*
+G54D15*X40000Y32500D03*
+X10000Y22500D03*
+X40000D03*
+M02*
diff --git a/tests/RTT/ref/netlist_ba.gbr/netlist_ba.fab.gbr b/tests/RTT/ref/netlist_ba.gbr/netlist_ba.fab.gbr
new file mode 100644
index 0000000..2f38212
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.gbr/netlist_ba.fab.gbr
@@ -0,0 +1,2008 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: board with minimal netlist and some back-annotation changes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD19C,0.0100*%
+%ADD18C,0.0001*%
+%ADD17C,0.0060*%
+%ADD16C,0.0080*%
+G54D16*X10000Y32500D02*Y30900D01*
+Y32500D02*X11387Y33300D01*
+X10000Y32500D02*X8613Y33300D01*
+X40000Y32500D02*Y30900D01*
+Y32500D02*X41387Y33300D01*
+X40000Y32500D02*X38613Y33300D01*
+X10000Y22500D02*Y20900D01*
+Y22500D02*X11387Y23300D01*
+X10000Y22500D02*X8613Y23300D01*
+X40000Y22500D02*Y20900D01*
+Y22500D02*X41387Y23300D01*
+X40000Y22500D02*X38613Y23300D01*
+X15000Y106250D02*Y104650D01*
+Y106250D02*X16387Y107050D01*
+X15000Y106250D02*X13613Y107050D01*
+G54D17*X135000Y110000D02*X136500Y107000D01*
+X138000Y110000D01*
+X136500Y107000D02*Y104000D01*
+X139800Y107300D02*X142050D01*
+X139800Y104000D02*X142800D01*
+X139800Y110000D02*Y104000D01*
+Y110000D02*X142800D01*
+X147600D02*X148350Y109250D01*
+X145350Y110000D02*X147600D01*
+X144600Y109250D02*X145350Y110000D01*
+X144600Y109250D02*Y107750D01*
+X145350Y107000D01*
+X147600D01*
+X148350Y106250D01*
+Y104750D01*
+X147600Y104000D02*X148350Y104750D01*
+X145350Y104000D02*X147600D01*
+X144600Y104750D02*X145350Y104000D01*
+X98000Y106250D02*X101000Y110000D01*
+X98000Y106250D02*X101750D01*
+X101000Y110000D02*Y104000D01*
+G54D18*G36*
+X45000Y110000D02*Y104000D01*
+X49500D01*
+Y110000D01*
+X45000D01*
+G37*
+G36*
+X50400D02*Y104000D01*
+X54900D01*
+Y110000D01*
+X50400D01*
+G37*
+G36*
+X55800D02*Y104000D01*
+X60300D01*
+Y110000D01*
+X55800D01*
+G37*
+G54D17*X61200Y106250D02*X64200Y110000D01*
+X61200Y106250D02*X64950D01*
+X64200Y110000D02*Y104000D01*
+G54D18*G36*
+X66750Y110000D02*Y104000D01*
+X71250D01*
+Y110000D01*
+X66750D01*
+G37*
+G54D17*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D18*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D17*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D18*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D17*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D18*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D17*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D18*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D17*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D18*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D17*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D18*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G54D17*X48000Y138800D02*X49200Y140000D01*
+Y134000D01*
+X48000D02*X50250D01*
+G54D18*G36*
+X54750Y140000D02*Y134000D01*
+X59250D01*
+Y140000D01*
+X54750D01*
+G37*
+G36*
+X60150D02*Y134000D01*
+X64650D01*
+Y140000D01*
+X60150D01*
+G37*
+G36*
+X65550D02*Y134000D01*
+X70050D01*
+Y140000D01*
+X65550D01*
+G37*
+G36*
+X70950D02*Y134000D01*
+X75450D01*
+Y140000D01*
+X70950D01*
+G37*
+G36*
+X76350D02*Y134000D01*
+X80850D01*
+Y140000D01*
+X76350D01*
+G37*
+G36*
+X81750D02*Y134000D01*
+X86250D01*
+Y140000D01*
+X81750D01*
+G37*
+G36*
+X87150D02*Y134000D01*
+X91650D01*
+Y140000D01*
+X87150D01*
+G37*
+G36*
+X92550D02*Y134000D01*
+X97050D01*
+Y140000D01*
+X92550D01*
+G37*
+G36*
+X97950D02*Y134000D01*
+X102450D01*
+Y140000D01*
+X97950D01*
+G37*
+G36*
+X106050D02*Y134000D01*
+X110550D01*
+Y140000D01*
+X106050D01*
+G37*
+G36*
+X111450D02*Y134000D01*
+X115950D01*
+Y140000D01*
+X111450D01*
+G37*
+G36*
+X116850D02*Y134000D01*
+X121350D01*
+Y140000D01*
+X116850D01*
+G37*
+G36*
+X122250D02*Y134000D01*
+X126750D01*
+Y140000D01*
+X122250D01*
+G37*
+G36*
+X127650D02*Y134000D01*
+X132150D01*
+Y140000D01*
+X127650D01*
+G37*
+G36*
+X135750D02*Y134000D01*
+X140250D01*
+Y140000D01*
+X135750D01*
+G37*
+G36*
+X141150D02*Y134000D01*
+X145650D01*
+Y140000D01*
+X141150D01*
+G37*
+G36*
+X146550D02*Y134000D01*
+X151050D01*
+Y140000D01*
+X146550D01*
+G37*
+G36*
+X151950D02*Y134000D01*
+X156450D01*
+Y140000D01*
+X151950D01*
+G37*
+G36*
+X157350D02*Y134000D01*
+X161850D01*
+Y140000D01*
+X157350D01*
+G37*
+G36*
+X165450D02*Y134000D01*
+X169950D01*
+Y140000D01*
+X165450D01*
+G37*
+G36*
+X170850D02*Y134000D01*
+X175350D01*
+Y140000D01*
+X170850D01*
+G37*
+G36*
+X176250D02*Y134000D01*
+X180750D01*
+Y140000D01*
+X176250D01*
+G37*
+G36*
+X181650D02*Y134000D01*
+X186150D01*
+Y140000D01*
+X181650D01*
+G37*
+G36*
+X189750D02*Y134000D01*
+X194250D01*
+Y140000D01*
+X189750D01*
+G37*
+G36*
+X195150D02*Y134000D01*
+X199650D01*
+Y140000D01*
+X195150D01*
+G37*
+G36*
+X203250D02*Y134000D01*
+X207750D01*
+Y140000D01*
+X203250D01*
+G37*
+G36*
+X208650D02*Y134000D01*
+X213150D01*
+Y140000D01*
+X208650D01*
+G37*
+G36*
+X214050D02*Y134000D01*
+X218550D01*
+Y140000D01*
+X214050D01*
+G37*
+G36*
+X219450D02*Y134000D01*
+X223950D01*
+Y140000D01*
+X219450D01*
+G37*
+G36*
+X227550D02*Y134000D01*
+X232050D01*
+Y140000D01*
+X227550D01*
+G37*
+G36*
+X232950D02*Y134000D01*
+X237450D01*
+Y140000D01*
+X232950D01*
+G37*
+G36*
+X238350D02*Y134000D01*
+X242850D01*
+Y140000D01*
+X238350D01*
+G37*
+G36*
+X243750D02*Y134000D01*
+X248250D01*
+Y140000D01*
+X243750D01*
+G37*
+G36*
+X249150D02*Y134000D01*
+X253650D01*
+Y140000D01*
+X249150D01*
+G37*
+G36*
+X254550D02*Y134000D01*
+X259050D01*
+Y140000D01*
+X254550D01*
+G37*
+G36*
+X259950D02*Y134000D01*
+X264450D01*
+Y140000D01*
+X259950D01*
+G37*
+G54D17*X268050Y136250D02*X271050Y140000D01*
+X268050Y136250D02*X271800D01*
+X271050Y140000D02*Y134000D01*
+G54D18*G36*
+X276300Y140000D02*Y134000D01*
+X280800D01*
+Y140000D01*
+X276300D01*
+G37*
+G36*
+X281700D02*Y134000D01*
+X286200D01*
+Y140000D01*
+X281700D01*
+G37*
+G36*
+X287100D02*Y134000D01*
+X291600D01*
+Y140000D01*
+X287100D01*
+G37*
+G36*
+X292500D02*Y134000D01*
+X297000D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297900D02*Y134000D01*
+X302400D01*
+Y140000D01*
+X297900D01*
+G37*
+G36*
+X306000D02*Y134000D01*
+X310500D01*
+Y140000D01*
+X306000D01*
+G37*
+G36*
+X311400D02*Y134000D01*
+X315900D01*
+Y140000D01*
+X311400D01*
+G37*
+G36*
+X316800D02*Y134000D01*
+X321300D01*
+Y140000D01*
+X316800D01*
+G37*
+G36*
+X322200D02*Y134000D01*
+X326700D01*
+Y140000D01*
+X322200D01*
+G37*
+G36*
+X327600D02*Y134000D01*
+X332100D01*
+Y140000D01*
+X327600D01*
+G37*
+G54D19*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D17*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D18*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D17*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D18*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D17*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D18*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D17*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D18*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D17*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D18*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D17*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D18*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D17*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D18*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D17*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D18*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D17*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D18*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D17*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D18*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D17*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D18*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X264200D02*Y104000D01*
+X268700D01*
+Y110000D01*
+X264200D01*
+G37*
+G36*
+X269600D02*Y104000D01*
+X274100D01*
+Y110000D01*
+X269600D01*
+G37*
+G36*
+X275000D02*Y104000D01*
+X279500D01*
+Y110000D01*
+X275000D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X288500D02*Y104000D01*
+X293000D01*
+Y110000D01*
+X288500D01*
+G37*
+G36*
+X293900D02*Y104000D01*
+X298400D01*
+Y110000D01*
+X293900D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X329000D02*Y104000D01*
+X333500D01*
+Y110000D01*
+X329000D01*
+G37*
+G36*
+X334400D02*Y104000D01*
+X338900D01*
+Y110000D01*
+X334400D01*
+G37*
+G36*
+X339800D02*Y104000D01*
+X344300D01*
+Y110000D01*
+X339800D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X369500D02*Y104000D01*
+X374000D01*
+Y110000D01*
+X369500D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X388400D02*Y104000D01*
+X392900D01*
+Y110000D01*
+X388400D01*
+G37*
+G36*
+X393800D02*Y104000D01*
+X398300D01*
+Y110000D01*
+X393800D01*
+G37*
+G36*
+X399200D02*Y104000D01*
+X403700D01*
+Y110000D01*
+X399200D01*
+G37*
+G36*
+X404600D02*Y104000D01*
+X409100D01*
+Y110000D01*
+X404600D01*
+G37*
+G36*
+X412700D02*Y104000D01*
+X417200D01*
+Y110000D01*
+X412700D01*
+G37*
+G36*
+X418100D02*Y104000D01*
+X422600D01*
+Y110000D01*
+X418100D01*
+G37*
+G36*
+X423500D02*Y104000D01*
+X428000D01*
+Y110000D01*
+X423500D01*
+G37*
+G36*
+X428900D02*Y104000D01*
+X433400D01*
+Y110000D01*
+X428900D01*
+G37*
+G36*
+X434300D02*Y104000D01*
+X438800D01*
+Y110000D01*
+X434300D01*
+G37*
+G36*
+X439700D02*Y104000D01*
+X444200D01*
+Y110000D01*
+X439700D01*
+G37*
+G36*
+X445100D02*Y104000D01*
+X449600D01*
+Y110000D01*
+X445100D01*
+G37*
+G36*
+X450500D02*Y104000D01*
+X455000D01*
+Y110000D01*
+X450500D01*
+G37*
+G36*
+X455900D02*Y104000D01*
+X460400D01*
+Y110000D01*
+X455900D01*
+G37*
+G36*
+X461300D02*Y104000D01*
+X465800D01*
+Y110000D01*
+X461300D01*
+G37*
+G36*
+X466700D02*Y104000D01*
+X471200D01*
+Y110000D01*
+X466700D01*
+G37*
+G36*
+X472100D02*Y104000D01*
+X476600D01*
+Y110000D01*
+X472100D01*
+G37*
+G36*
+X477500D02*Y104000D01*
+X482000D01*
+Y110000D01*
+X477500D01*
+G37*
+G36*
+X482900D02*Y104000D01*
+X487400D01*
+Y110000D01*
+X482900D01*
+G37*
+G36*
+X488300D02*Y104000D01*
+X492800D01*
+Y110000D01*
+X488300D01*
+G37*
+G36*
+X496400D02*Y104000D01*
+X500900D01*
+Y110000D01*
+X496400D01*
+G37*
+G36*
+X501800D02*Y104000D01*
+X506300D01*
+Y110000D01*
+X501800D01*
+G37*
+G36*
+X507200D02*Y104000D01*
+X511700D01*
+Y110000D01*
+X507200D01*
+G37*
+G36*
+X512600D02*Y104000D01*
+X517100D01*
+Y110000D01*
+X512600D01*
+G37*
+G36*
+X518000D02*Y104000D01*
+X522500D01*
+Y110000D01*
+X518000D01*
+G37*
+G36*
+X523400D02*Y104000D01*
+X527900D01*
+Y110000D01*
+X523400D01*
+G37*
+G36*
+X528800D02*Y104000D01*
+X533300D01*
+Y110000D01*
+X528800D01*
+G37*
+G36*
+X536900D02*Y104000D01*
+X541400D01*
+Y110000D01*
+X536900D01*
+G37*
+G54D17*X545000D02*Y104000D01*
+Y110000D02*X548000D01*
+X545000Y107300D02*X547250D01*
+G54D18*G36*
+X549800Y110000D02*Y104000D01*
+X554300D01*
+Y110000D01*
+X549800D01*
+G37*
+G36*
+X555200D02*Y104000D01*
+X559700D01*
+Y110000D01*
+X555200D01*
+G37*
+G36*
+X560600D02*Y104000D01*
+X565100D01*
+Y110000D01*
+X560600D01*
+G37*
+G36*
+X566000D02*Y104000D01*
+X570500D01*
+Y110000D01*
+X566000D01*
+G37*
+G36*
+X571400D02*Y104000D01*
+X575900D01*
+Y110000D01*
+X571400D01*
+G37*
+G36*
+X576800D02*Y104000D01*
+X581300D01*
+Y110000D01*
+X576800D01*
+G37*
+G36*
+X582200D02*Y104000D01*
+X586700D01*
+Y110000D01*
+X582200D01*
+G37*
+G36*
+X587600D02*Y104000D01*
+X592100D01*
+Y110000D01*
+X587600D01*
+G37*
+G36*
+X593000D02*Y104000D01*
+X597500D01*
+Y110000D01*
+X593000D01*
+G37*
+G36*
+X598400D02*Y104000D01*
+X602900D01*
+Y110000D01*
+X598400D01*
+G37*
+G54D17*X607250D02*Y104000D01*
+X609200Y110000D02*X610250Y108950D01*
+Y105050D01*
+X609200Y104000D02*X610250Y105050D01*
+X606500Y104000D02*X609200D01*
+X606500Y110000D02*X609200D01*
+G54D18*G36*
+X612050D02*Y104000D01*
+X616550D01*
+Y110000D01*
+X612050D01*
+G37*
+G36*
+X617450D02*Y104000D01*
+X621950D01*
+Y110000D01*
+X617450D01*
+G37*
+G36*
+X622850D02*Y104000D01*
+X627350D01*
+Y110000D01*
+X622850D01*
+G37*
+G36*
+X628250D02*Y104000D01*
+X632750D01*
+Y110000D01*
+X628250D01*
+G37*
+G36*
+X633650D02*Y104000D01*
+X638150D01*
+Y110000D01*
+X633650D01*
+G37*
+G36*
+X639050D02*Y104000D01*
+X643550D01*
+Y110000D01*
+X639050D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/netlist_ba.gbr/netlist_ba.topmask.gbr b/tests/RTT/ref/netlist_ba.gbr/netlist_ba.topmask.gbr
new file mode 100644
index 0000000..1f85f39
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.gbr/netlist_ba.topmask.gbr
@@ -0,0 +1,23 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: board with minimal netlist and some back-annotation changes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPMASK*%
+%ADD13C,0.0860*%
+%ADD12C,0.0001*%
+G54D12*G36*
+X5700Y36800D02*Y28200D01*
+X14300D01*
+Y36800D01*
+X5700D01*
+G37*
+G54D13*X40000Y32500D03*
+X10000Y22500D03*
+X40000D03*
+M02*
diff --git a/tests/RTT/ref/netlist_ba.net b/tests/RTT/ref/netlist_ba.net
new file mode 100644
index 0000000..d464194
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.net
@@ -0,0 +1,16 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB board with minimal netlist and some back-annotation changes
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+317bar U1 -1 D0393PA00X+001000Y+003250X0800Y0800R000 S0
+317bar U1 -4 D0393PA00X+004000Y+003250X0800Y0000R000 S0
+317bar U1 -2 D0393PA00X+001000Y+002250X0800Y0000R000 S0
+317foo U1 -3 D0393PA00X+004000Y+002250X0800Y0000R000 S0
+999
diff --git a/tests/RTT/ref/netlist_ba.png b/tests/RTT/ref/netlist_ba.png
new file mode 100644
index 0000000..8f68bb1
Binary files /dev/null and b/tests/RTT/ref/netlist_ba.png differ
diff --git a/tests/RTT/ref/netlist_ba.ps.gz b/tests/RTT/ref/netlist_ba.ps.gz
new file mode 100644
index 0000000..6652f28
Binary files /dev/null and b/tests/RTT/ref/netlist_ba.ps.gz differ
diff --git a/tests/RTT/ref/netlist_ba.remote.gz b/tests/RTT/ref/netlist_ba.remote.gz
new file mode 100644
index 0000000..7a47664
Binary files /dev/null and b/tests/RTT/ref/netlist_ba.remote.gz differ
diff --git a/tests/RTT/ref/netlist_ba.svg b/tests/RTT/ref/netlist_ba.svg
new file mode 100644
index 0000000..db15ae8
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <rect x="1.5240" y="3.4290" width="2.0320" height="2.0320" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="1.0160" stroke-width="0.2540" fill="#4d4d4d" stroke="none"/>
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="1.2700" y1="3.1750" x2="1.2700" y2="8.2550" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="11.4300" y1="8.2550" x2="1.2700" y2="8.2550" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="11.4300" y1="8.2550" x2="11.4300" y2="3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="3.1750" x2="5.0800" y2="3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.6200" y1="3.1750" x2="11.4300" y2="3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round"/>
+ <path d="M 5.0800 3.1750 A 1.2700 1.2700 0 0 0 7.6200 3.1750" stroke-width="0.2540" stroke="#000000" stroke-linecap="round" fill="none"/>
+ <line x1="2.5400" y1="1.9050" x2="2.5400" y2="2.7940" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.5400" y1="2.7940" x2="2.6670" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.6670" y1="2.9210" x2="2.9210" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.9210" y1="2.9210" x2="3.0480" y2="2.7940" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.0480" y1="1.9050" x2="3.0480" y2="2.7940" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="2.1082" x2="3.5560" y2="1.9050" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.5560" y1="1.9050" x2="3.5560" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3528" y1="2.9210" x2="3.7338" y2="2.9210" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+<g id="layer_-4048_plated-drill">
+<!--normal-->
+ <circle cx="2.5400" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="4.4450" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="10.1600" cy="6.9850" r="0.5000" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/netlist_ba.xy b/tests/RTT/ref/netlist_ba.xy
new file mode 100644
index 0000000..fa5d754
--- /dev/null
+++ b/tests/RTT/ref/netlist_ba.xy
@@ -0,0 +1,9 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: board with minimal netlist and some back-annotation changes - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
+U1,"dip(4)","4*300",250.00,275.00,0,top
diff --git a/tests/RTT/ref/poly_hole.bom b/tests/RTT/ref/poly_hole.bom
new file mode 100644
index 0000000..1627d89
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Polygons with holes - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/poly_hole.dsn b/tests/RTT/ref/poly_hole.dsn
new file mode 100644
index 0000000..febe955
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.dsn
@@ -0,0 +1,57 @@
+(pcb Polygons with holes
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/poly_hole.gbr/poly_hole.fab.gbr b/tests/RTT/ref/poly_hole.gbr/poly_hole.fab.gbr
new file mode 100644
index 0000000..8908930
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.gbr/poly_hole.fab.gbr
@@ -0,0 +1,1740 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Polygons with holes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X235250D02*Y104000D01*
+X234500Y110000D02*X237500D01*
+X238250Y109250D01*
+Y107750D01*
+X237500Y107000D02*X238250Y107750D01*
+X235250Y107000D02*X237500D01*
+G54D13*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X250850D02*Y104000D01*
+X255350D01*
+Y110000D01*
+X250850D01*
+G37*
+G36*
+X256250D02*Y104000D01*
+X260750D01*
+Y110000D01*
+X256250D01*
+G37*
+G36*
+X261650D02*Y104000D01*
+X266150D01*
+Y110000D01*
+X261650D01*
+G37*
+G36*
+X267050D02*Y104000D01*
+X271550D01*
+Y110000D01*
+X267050D01*
+G37*
+G36*
+X272450D02*Y104000D01*
+X276950D01*
+Y110000D01*
+X272450D01*
+G37*
+G36*
+X280550D02*Y104000D01*
+X285050D01*
+Y110000D01*
+X280550D01*
+G37*
+G36*
+X285950D02*Y104000D01*
+X290450D01*
+Y110000D01*
+X285950D01*
+G37*
+G36*
+X291350D02*Y104000D01*
+X295850D01*
+Y110000D01*
+X291350D01*
+G37*
+G36*
+X296750D02*Y104000D01*
+X301250D01*
+Y110000D01*
+X296750D01*
+G37*
+G36*
+X304850D02*Y104000D01*
+X309350D01*
+Y110000D01*
+X304850D01*
+G37*
+G36*
+X310250D02*Y104000D01*
+X314750D01*
+Y110000D01*
+X310250D01*
+G37*
+G36*
+X315650D02*Y104000D01*
+X320150D01*
+Y110000D01*
+X315650D01*
+G37*
+G36*
+X321050D02*Y104000D01*
+X325550D01*
+Y110000D01*
+X321050D01*
+G37*
+G36*
+X326450D02*Y104000D01*
+X330950D01*
+Y110000D01*
+X326450D01*
+G37*
+G36*
+X334550D02*Y104000D01*
+X339050D01*
+Y110000D01*
+X334550D01*
+G37*
+G54D12*X342650D02*Y104000D01*
+Y110000D02*X345650D01*
+X342650Y107300D02*X344900D01*
+G54D13*G36*
+X347450Y110000D02*Y104000D01*
+X351950D01*
+Y110000D01*
+X347450D01*
+G37*
+G36*
+X352850D02*Y104000D01*
+X357350D01*
+Y110000D01*
+X352850D01*
+G37*
+G36*
+X358250D02*Y104000D01*
+X362750D01*
+Y110000D01*
+X358250D01*
+G37*
+G36*
+X363650D02*Y104000D01*
+X368150D01*
+Y110000D01*
+X363650D01*
+G37*
+G36*
+X369050D02*Y104000D01*
+X373550D01*
+Y110000D01*
+X369050D01*
+G37*
+G36*
+X374450D02*Y104000D01*
+X378950D01*
+Y110000D01*
+X374450D01*
+G37*
+G36*
+X379850D02*Y104000D01*
+X384350D01*
+Y110000D01*
+X379850D01*
+G37*
+G36*
+X385250D02*Y104000D01*
+X389750D01*
+Y110000D01*
+X385250D01*
+G37*
+G36*
+X390650D02*Y104000D01*
+X395150D01*
+Y110000D01*
+X390650D01*
+G37*
+G36*
+X396050D02*Y104000D01*
+X400550D01*
+Y110000D01*
+X396050D01*
+G37*
+G54D12*X404900D02*Y104000D01*
+X406850Y110000D02*X407900Y108950D01*
+Y105050D01*
+X406850Y104000D02*X407900Y105050D01*
+X404150Y104000D02*X406850D01*
+X404150Y110000D02*X406850D01*
+G54D13*G36*
+X409700D02*Y104000D01*
+X414200D01*
+Y110000D01*
+X409700D01*
+G37*
+G36*
+X415100D02*Y104000D01*
+X419600D01*
+Y110000D01*
+X415100D01*
+G37*
+G36*
+X420500D02*Y104000D01*
+X425000D01*
+Y110000D01*
+X420500D01*
+G37*
+G36*
+X425900D02*Y104000D01*
+X430400D01*
+Y110000D01*
+X425900D01*
+G37*
+G36*
+X431300D02*Y104000D01*
+X435800D01*
+Y110000D01*
+X431300D01*
+G37*
+G36*
+X436700D02*Y104000D01*
+X441200D01*
+Y110000D01*
+X436700D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/poly_hole.gbr/poly_hole.top.gbr b/tests/RTT/ref/poly_hole.gbr/poly_hole.top.gbr
new file mode 100644
index 0000000..1e6bfa2
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.gbr/poly_hole.top.gbr
@@ -0,0 +1,100 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Polygons with holes, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X6250Y47500D02*X12500D01*
+X6250Y41250D01*
+Y43750D01*
+X7500Y45000D01*
+X6250D01*
+Y47500D01*
+G37*
+G36*
+X2500D02*X6250D01*
+Y45000D01*
+X5000D01*
+Y42500D01*
+X6250Y43750D01*
+Y41250D01*
+X2500Y37500D01*
+Y47500D01*
+G37*
+G36*
+X10000Y42500D02*X15000Y47500D01*
+Y35000D01*
+X10000D01*
+Y37500D01*
+X12500D01*
+Y40000D01*
+X10000D01*
+Y42500D01*
+G37*
+G36*
+X2500Y35000D02*X10000Y42500D01*
+Y40000D01*
+X7500Y37500D01*
+X10000D01*
+Y35000D01*
+X2500D01*
+G37*
+G36*
+X30000Y47500D02*X42500Y35000D01*
+X30000D01*
+Y37500D01*
+X32500D01*
+Y42500D01*
+X30000D01*
+Y47500D01*
+G37*
+G36*
+X17500Y35000D02*X30000Y47500D01*
+Y42500D01*
+X27500D01*
+Y37500D01*
+X30000D01*
+Y35000D01*
+X17500D01*
+G37*
+G36*
+X16250Y31250D02*X30000Y30000D01*
+X16250Y21750D01*
+Y25000D01*
+X17500D01*
+Y27500D01*
+X16250D01*
+Y31250D01*
+G37*
+G36*
+X10000Y31818D02*X16250Y31250D01*
+Y27500D01*
+X15000D01*
+Y25000D01*
+X16250D01*
+Y21750D01*
+X10000Y18000D01*
+Y20000D01*
+X12500Y22500D01*
+Y25000D01*
+X10000Y27500D01*
+Y31818D01*
+G37*
+G36*
+X2500Y32500D02*X10000Y31818D01*
+Y27500D01*
+X7500D01*
+Y22500D01*
+X10000Y20000D01*
+Y18000D01*
+X5000Y15000D01*
+X2500Y32500D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/poly_hole.net b/tests/RTT/ref/poly_hole.net
new file mode 100644
index 0000000..0f4afd0
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Polygons with holes
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/poly_hole.png b/tests/RTT/ref/poly_hole.png
new file mode 100644
index 0000000..dd628dc
Binary files /dev/null and b/tests/RTT/ref/poly_hole.png differ
diff --git a/tests/RTT/ref/poly_hole.ps.gz b/tests/RTT/ref/poly_hole.ps.gz
new file mode 100644
index 0000000..7c15916
Binary files /dev/null and b/tests/RTT/ref/poly_hole.ps.gz differ
diff --git a/tests/RTT/ref/poly_hole.remote.gz b/tests/RTT/ref/poly_hole.remote.gz
new file mode 100644
index 0000000..a0346ff
Binary files /dev/null and b/tests/RTT/ref/poly_hole.remote.gz differ
diff --git a/tests/RTT/ref/poly_hole.svg b/tests/RTT/ref/poly_hole.svg
new file mode 100644
index 0000000..7f49d45
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="1.5875,0.6350 3.1750,0.6350 1.5875,2.2225 1.5875,1.5875 1.9050,1.2700 1.5875,1.2700 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="0.6350,0.6350 1.5875,0.6350 1.5875,1.2700 1.2700,1.2700 1.2700,1.9050 1.5875,1.5875 1.5875,2.2225 0.6350,3.1750 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="2.5400,1.9050 3.8100,0.6350 3.8100,3.8100 2.5400,3.8100 2.5400,3.1750 3.1750,3.1750 3.1750,2.5400 2.5400,2.5400 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="0.6350,3.8100 2.5400,1.9050 2.5400,2.5400 1.9050,3.1750 2.5400,3.1750 2.5400,3.8100 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="7.6200,0.6350 10.7950,3.8100 7.6200,3.8100 7.6200,3.1750 8.2550,3.1750 8.2550,1.9050 7.6200,1.9050 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="4.4450,3.8100 7.6200,0.6350 7.6200,1.9050 6.9850,1.9050 6.9850,3.1750 7.6200,3.1750 7.6200,3.8100 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="4.1275,4.7625 7.6200,5.0800 4.1275,7.1755 4.1275,6.3500 4.4450,6.3500 4.4450,5.7150 4.1275,5.7150 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="2.5400,4.6182 4.1275,4.7625 4.1275,5.7150 3.8100,5.7150 3.8100,6.3500 4.1275,6.3500 4.1275,7.1755 2.5400,8.1280 2.5400,7.6200 3.1750,6.9850 3.1750,6.3500 2.5400,5.7150 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="0.6350,4.4450 2.5400,4.6182 2.5400,5.7150 1.9050,5.7150 1.9050,6.9850 2.5400,7.6200 2.5400,8.1280 1.2700,8.8900 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/poly_hole.xy b/tests/RTT/ref/poly_hole.xy
new file mode 100644
index 0000000..e4f60de
--- /dev/null
+++ b/tests/RTT/ref/poly_hole.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Polygons with holes - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/poly_rect.bom b/tests/RTT/ref/poly_rect.bom
new file mode 100644
index 0000000..c7a5c8e
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Normal rectangular polygons - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/poly_rect.dsn b/tests/RTT/ref/poly_rect.dsn
new file mode 100644
index 0000000..74a8aa5
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.dsn
@@ -0,0 +1,57 @@
+(pcb Normal rectangular polygons
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/poly_rect.gbr/poly_rect.fab.gbr b/tests/RTT/ref/poly_rect.gbr/poly_rect.fab.gbr
new file mode 100644
index 0000000..f97949e
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.gbr/poly_rect.fab.gbr
@@ -0,0 +1,1785 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Normal rectangular polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500D02*Y104000D01*
+Y110000D02*X238250Y104000D01*
+Y110000D02*Y104000D01*
+G54D13*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X250850D02*Y104000D01*
+X255350D01*
+Y110000D01*
+X250850D01*
+G37*
+G36*
+X256250D02*Y104000D01*
+X260750D01*
+Y110000D01*
+X256250D01*
+G37*
+G36*
+X261650D02*Y104000D01*
+X266150D01*
+Y110000D01*
+X261650D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X275150D02*Y104000D01*
+X279650D01*
+Y110000D01*
+X275150D01*
+G37*
+G36*
+X280550D02*Y104000D01*
+X285050D01*
+Y110000D01*
+X280550D01*
+G37*
+G36*
+X285950D02*Y104000D01*
+X290450D01*
+Y110000D01*
+X285950D01*
+G37*
+G36*
+X291350D02*Y104000D01*
+X295850D01*
+Y110000D01*
+X291350D01*
+G37*
+G36*
+X296750D02*Y104000D01*
+X301250D01*
+Y110000D01*
+X296750D01*
+G37*
+G36*
+X302150D02*Y104000D01*
+X306650D01*
+Y110000D01*
+X302150D01*
+G37*
+G36*
+X307550D02*Y104000D01*
+X312050D01*
+Y110000D01*
+X307550D01*
+G37*
+G36*
+X312950D02*Y104000D01*
+X317450D01*
+Y110000D01*
+X312950D01*
+G37*
+G36*
+X318350D02*Y104000D01*
+X322850D01*
+Y110000D01*
+X318350D01*
+G37*
+G36*
+X323750D02*Y104000D01*
+X328250D01*
+Y110000D01*
+X323750D01*
+G37*
+G36*
+X331850D02*Y104000D01*
+X336350D01*
+Y110000D01*
+X331850D01*
+G37*
+G36*
+X337250D02*Y104000D01*
+X341750D01*
+Y110000D01*
+X337250D01*
+G37*
+G36*
+X342650D02*Y104000D01*
+X347150D01*
+Y110000D01*
+X342650D01*
+G37*
+G36*
+X348050D02*Y104000D01*
+X352550D01*
+Y110000D01*
+X348050D01*
+G37*
+G36*
+X353450D02*Y104000D01*
+X357950D01*
+Y110000D01*
+X353450D01*
+G37*
+G36*
+X358850D02*Y104000D01*
+X363350D01*
+Y110000D01*
+X358850D01*
+G37*
+G36*
+X364250D02*Y104000D01*
+X368750D01*
+Y110000D01*
+X364250D01*
+G37*
+G36*
+X369650D02*Y104000D01*
+X374150D01*
+Y110000D01*
+X369650D01*
+G37*
+G36*
+X377750D02*Y104000D01*
+X382250D01*
+Y110000D01*
+X377750D01*
+G37*
+G54D12*X385850D02*Y104000D01*
+Y110000D02*X388850D01*
+X385850Y107300D02*X388100D01*
+G54D13*G36*
+X390650Y110000D02*Y104000D01*
+X395150D01*
+Y110000D01*
+X390650D01*
+G37*
+G36*
+X396050D02*Y104000D01*
+X400550D01*
+Y110000D01*
+X396050D01*
+G37*
+G36*
+X401450D02*Y104000D01*
+X405950D01*
+Y110000D01*
+X401450D01*
+G37*
+G36*
+X406850D02*Y104000D01*
+X411350D01*
+Y110000D01*
+X406850D01*
+G37*
+G36*
+X412250D02*Y104000D01*
+X416750D01*
+Y110000D01*
+X412250D01*
+G37*
+G36*
+X417650D02*Y104000D01*
+X422150D01*
+Y110000D01*
+X417650D01*
+G37*
+G36*
+X423050D02*Y104000D01*
+X427550D01*
+Y110000D01*
+X423050D01*
+G37*
+G36*
+X428450D02*Y104000D01*
+X432950D01*
+Y110000D01*
+X428450D01*
+G37*
+G36*
+X433850D02*Y104000D01*
+X438350D01*
+Y110000D01*
+X433850D01*
+G37*
+G36*
+X439250D02*Y104000D01*
+X443750D01*
+Y110000D01*
+X439250D01*
+G37*
+G54D12*X448100D02*Y104000D01*
+X450050Y110000D02*X451100Y108950D01*
+Y105050D01*
+X450050Y104000D02*X451100Y105050D01*
+X447350Y104000D02*X450050D01*
+X447350Y110000D02*X450050D01*
+G54D13*G36*
+X452900D02*Y104000D01*
+X457400D01*
+Y110000D01*
+X452900D01*
+G37*
+G36*
+X458300D02*Y104000D01*
+X462800D01*
+Y110000D01*
+X458300D01*
+G37*
+G36*
+X463700D02*Y104000D01*
+X468200D01*
+Y110000D01*
+X463700D01*
+G37*
+G36*
+X469100D02*Y104000D01*
+X473600D01*
+Y110000D01*
+X469100D01*
+G37*
+G36*
+X474500D02*Y104000D01*
+X479000D01*
+Y110000D01*
+X474500D01*
+G37*
+G36*
+X479900D02*Y104000D01*
+X484400D01*
+Y110000D01*
+X479900D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/poly_rect.gbr/poly_rect.top.gbr b/tests/RTT/ref/poly_rect.gbr/poly_rect.top.gbr
new file mode 100644
index 0000000..4c374e9
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.gbr/poly_rect.top.gbr
@@ -0,0 +1,37 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Normal rectangular polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X5000Y47500D02*X7500D01*
+Y5000D01*
+X5000D01*
+Y47500D01*
+G37*
+G36*
+X12500D02*X47500D01*
+Y45000D01*
+X12500D01*
+Y47500D01*
+G37*
+G36*
+X42500Y7500D02*X45000D01*
+Y5000D01*
+X42500D01*
+Y7500D01*
+G37*
+G36*
+X12500Y42500D02*X40000D01*
+Y5000D01*
+X12500D01*
+Y42500D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/poly_rect.net b/tests/RTT/ref/poly_rect.net
new file mode 100644
index 0000000..e33caa8
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Normal rectangular polygons
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/poly_rect.png b/tests/RTT/ref/poly_rect.png
new file mode 100644
index 0000000..c10d47f
Binary files /dev/null and b/tests/RTT/ref/poly_rect.png differ
diff --git a/tests/RTT/ref/poly_rect.ps.gz b/tests/RTT/ref/poly_rect.ps.gz
new file mode 100644
index 0000000..6b515a3
Binary files /dev/null and b/tests/RTT/ref/poly_rect.ps.gz differ
diff --git a/tests/RTT/ref/poly_rect.remote.gz b/tests/RTT/ref/poly_rect.remote.gz
new file mode 100644
index 0000000..9757c2d
Binary files /dev/null and b/tests/RTT/ref/poly_rect.remote.gz differ
diff --git a/tests/RTT/ref/poly_rect.svg b/tests/RTT/ref/poly_rect.svg
new file mode 100644
index 0000000..f8abece
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="1.2700,0.6350 1.9050,0.6350 1.9050,11.4300 1.2700,11.4300 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="3.1750,0.6350 12.0650,0.6350 12.0650,1.2700 3.1750,1.2700 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="10.7950,10.7950 11.4300,10.7950 11.4300,11.4300 10.7950,11.4300 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="3.1750,1.9050 10.1600,1.9050 10.1600,11.4300 3.1750,11.4300 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/poly_rect.xy b/tests/RTT/ref/poly_rect.xy
new file mode 100644
index 0000000..a352f32
--- /dev/null
+++ b/tests/RTT/ref/poly_rect.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Normal rectangular polygons - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/poly_triangle.bom b/tests/RTT/ref/poly_triangle.bom
new file mode 100644
index 0000000..1fb5796
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: Normal triangular polygons - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/poly_triangle.dsn b/tests/RTT/ref/poly_triangle.dsn
new file mode 100644
index 0000000..cdd0bf8
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.dsn
@@ -0,0 +1,57 @@
+(pcb Normal triangular polygons
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/poly_triangle.gbr/poly_triangle.fab.gbr b/tests/RTT/ref/poly_triangle.gbr/poly_triangle.fab.gbr
new file mode 100644
index 0000000..33befd8
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.gbr/poly_triangle.fab.gbr
@@ -0,0 +1,1779 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: Normal triangular polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD14C,0.0100*%
+%ADD13C,0.0001*%
+%ADD12C,0.0060*%
+G54D12*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D13*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D12*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D13*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D12*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D13*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D12*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D13*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D12*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D13*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D12*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D13*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D13*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D12*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D13*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D12*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D13*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D12*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D13*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D12*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D13*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D12*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D13*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D12*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D13*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D12*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D13*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D12*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D13*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D12*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D12*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D13*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G54D12*X234500D02*Y104000D01*
+Y110000D02*X238250Y104000D01*
+Y110000D02*Y104000D01*
+G54D13*G36*
+X240050Y110000D02*Y104000D01*
+X244550D01*
+Y110000D01*
+X240050D01*
+G37*
+G36*
+X245450D02*Y104000D01*
+X249950D01*
+Y110000D01*
+X245450D01*
+G37*
+G36*
+X250850D02*Y104000D01*
+X255350D01*
+Y110000D01*
+X250850D01*
+G37*
+G36*
+X256250D02*Y104000D01*
+X260750D01*
+Y110000D01*
+X256250D01*
+G37*
+G36*
+X261650D02*Y104000D01*
+X266150D01*
+Y110000D01*
+X261650D01*
+G37*
+G36*
+X269750D02*Y104000D01*
+X274250D01*
+Y110000D01*
+X269750D01*
+G37*
+G36*
+X275150D02*Y104000D01*
+X279650D01*
+Y110000D01*
+X275150D01*
+G37*
+G36*
+X280550D02*Y104000D01*
+X285050D01*
+Y110000D01*
+X280550D01*
+G37*
+G36*
+X285950D02*Y104000D01*
+X290450D01*
+Y110000D01*
+X285950D01*
+G37*
+G36*
+X291350D02*Y104000D01*
+X295850D01*
+Y110000D01*
+X291350D01*
+G37*
+G36*
+X296750D02*Y104000D01*
+X301250D01*
+Y110000D01*
+X296750D01*
+G37*
+G36*
+X302150D02*Y104000D01*
+X306650D01*
+Y110000D01*
+X302150D01*
+G37*
+G36*
+X307550D02*Y104000D01*
+X312050D01*
+Y110000D01*
+X307550D01*
+G37*
+G36*
+X312950D02*Y104000D01*
+X317450D01*
+Y110000D01*
+X312950D01*
+G37*
+G36*
+X318350D02*Y104000D01*
+X322850D01*
+Y110000D01*
+X318350D01*
+G37*
+G36*
+X326450D02*Y104000D01*
+X330950D01*
+Y110000D01*
+X326450D01*
+G37*
+G36*
+X331850D02*Y104000D01*
+X336350D01*
+Y110000D01*
+X331850D01*
+G37*
+G36*
+X337250D02*Y104000D01*
+X341750D01*
+Y110000D01*
+X337250D01*
+G37*
+G36*
+X342650D02*Y104000D01*
+X347150D01*
+Y110000D01*
+X342650D01*
+G37*
+G36*
+X348050D02*Y104000D01*
+X352550D01*
+Y110000D01*
+X348050D01*
+G37*
+G36*
+X353450D02*Y104000D01*
+X357950D01*
+Y110000D01*
+X353450D01*
+G37*
+G36*
+X358850D02*Y104000D01*
+X363350D01*
+Y110000D01*
+X358850D01*
+G37*
+G36*
+X364250D02*Y104000D01*
+X368750D01*
+Y110000D01*
+X364250D01*
+G37*
+G36*
+X372350D02*Y104000D01*
+X376850D01*
+Y110000D01*
+X372350D01*
+G37*
+G54D12*X380450D02*Y104000D01*
+Y110000D02*X383450D01*
+X380450Y107300D02*X382700D01*
+G54D13*G36*
+X385250Y110000D02*Y104000D01*
+X389750D01*
+Y110000D01*
+X385250D01*
+G37*
+G36*
+X390650D02*Y104000D01*
+X395150D01*
+Y110000D01*
+X390650D01*
+G37*
+G36*
+X396050D02*Y104000D01*
+X400550D01*
+Y110000D01*
+X396050D01*
+G37*
+G36*
+X401450D02*Y104000D01*
+X405950D01*
+Y110000D01*
+X401450D01*
+G37*
+G36*
+X406850D02*Y104000D01*
+X411350D01*
+Y110000D01*
+X406850D01*
+G37*
+G36*
+X412250D02*Y104000D01*
+X416750D01*
+Y110000D01*
+X412250D01*
+G37*
+G36*
+X417650D02*Y104000D01*
+X422150D01*
+Y110000D01*
+X417650D01*
+G37*
+G36*
+X423050D02*Y104000D01*
+X427550D01*
+Y110000D01*
+X423050D01*
+G37*
+G36*
+X428450D02*Y104000D01*
+X432950D01*
+Y110000D01*
+X428450D01*
+G37*
+G36*
+X433850D02*Y104000D01*
+X438350D01*
+Y110000D01*
+X433850D01*
+G37*
+G54D12*X442700D02*Y104000D01*
+X444650Y110000D02*X445700Y108950D01*
+Y105050D01*
+X444650Y104000D02*X445700Y105050D01*
+X441950Y104000D02*X444650D01*
+X441950Y110000D02*X444650D01*
+G54D13*G36*
+X447500D02*Y104000D01*
+X452000D01*
+Y110000D01*
+X447500D01*
+G37*
+G36*
+X452900D02*Y104000D01*
+X457400D01*
+Y110000D01*
+X452900D01*
+G37*
+G36*
+X458300D02*Y104000D01*
+X462800D01*
+Y110000D01*
+X458300D01*
+G37*
+G36*
+X463700D02*Y104000D01*
+X468200D01*
+Y110000D01*
+X463700D01*
+G37*
+G36*
+X469100D02*Y104000D01*
+X473600D01*
+Y110000D01*
+X469100D01*
+G37*
+G36*
+X474500D02*Y104000D01*
+X479000D01*
+Y110000D01*
+X474500D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/poly_triangle.gbr/poly_triangle.top.gbr b/tests/RTT/ref/poly_triangle.gbr/poly_triangle.top.gbr
new file mode 100644
index 0000000..8afed97
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.gbr/poly_triangle.top.gbr
@@ -0,0 +1,33 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: Normal triangular polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X2500Y47500D02*X12500D01*
+X2500Y37500D01*
+Y47500D01*
+G37*
+G36*
+Y35000D02*X15000Y47500D01*
+Y35000D01*
+X2500D01*
+G37*
+G36*
+X17500D02*X30000Y47500D01*
+X42500Y35000D01*
+X17500D01*
+G37*
+G36*
+X2500Y32500D02*X30000Y30000D01*
+X5000Y15000D01*
+X2500Y32500D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/poly_triangle.net b/tests/RTT/ref/poly_triangle.net
new file mode 100644
index 0000000..eb65b7c
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB Normal triangular polygons
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/poly_triangle.png b/tests/RTT/ref/poly_triangle.png
new file mode 100644
index 0000000..f1464e1
Binary files /dev/null and b/tests/RTT/ref/poly_triangle.png differ
diff --git a/tests/RTT/ref/poly_triangle.png.text b/tests/RTT/ref/poly_triangle.png.text
new file mode 100644
index 0000000..93d4e43
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.png.text
@@ -0,0 +1,31 @@
+
+upper left triangle
+121 pixels wide
+121 pixels tall
+
+gap from lower left triangle to upper left triangle
+29 pixels horizontally
+29 pixels vertically
+
+lower left triangle
+151 pixels wide
+151 pixels tall
+
+gap from lower left triangle to far right piramid
+29 pixels
+
+far right piramid
+151 pixels height
+301 pixels base
+
+bottom triangle
+331 pixels across
+211 pixels up
+top edge
+332.4 pixels long 5.18 degrees
+side edge
+213.1 pixels long 91.91 degrees
+bottom edge
+351.2 pixels long 31.02 degrees
+
+
diff --git a/tests/RTT/ref/poly_triangle.ps.gz b/tests/RTT/ref/poly_triangle.ps.gz
new file mode 100644
index 0000000..49a2b22
Binary files /dev/null and b/tests/RTT/ref/poly_triangle.ps.gz differ
diff --git a/tests/RTT/ref/poly_triangle.remote.gz b/tests/RTT/ref/poly_triangle.remote.gz
new file mode 100644
index 0000000..2b7aa12
Binary files /dev/null and b/tests/RTT/ref/poly_triangle.remote.gz differ
diff --git a/tests/RTT/ref/poly_triangle.svg b/tests/RTT/ref/poly_triangle.svg
new file mode 100644
index 0000000..138453e
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="0.6350,0.6350 3.1750,0.6350 0.6350,3.1750 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="0.6350,3.8100 3.8100,0.6350 3.8100,3.8100 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="4.4450,3.8100 7.6200,0.6350 10.7950,3.8100 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="0.6350,4.4450 7.6200,5.0800 1.2700,8.8900 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/poly_triangle.xy b/tests/RTT/ref/poly_triangle.xy
new file mode 100644
index 0000000..8121e1d
--- /dev/null
+++ b/tests/RTT/ref/poly_triangle.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: Normal triangular polygons - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/rat.bom b/tests/RTT/ref/rat.bom
new file mode 100644
index 0000000..a76e818
--- /dev/null
+++ b/tests/RTT/ref/rat.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: a rat line - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/rat.dsn b/tests/RTT/ref/rat.dsn
new file mode 100644
index 0000000..784636f
--- /dev/null
+++ b/tests/RTT/ref/rat.dsn
@@ -0,0 +1,57 @@
+(pcb a rat line
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/rat.gbr/rat.fab.gbr b/tests/RTT/ref/rat.gbr/rat.fab.gbr
new file mode 100644
index 0000000..a7fbbeb
--- /dev/null
+++ b/tests/RTT/ref/rat.gbr/rat.fab.gbr
@@ -0,0 +1,1686 @@
+G04 start of page 2 for group -1 layer_idx -1 *
+G04 Title: a rat line, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD13C,0.0100*%
+%ADD12C,0.0001*%
+%ADD11C,0.0060*%
+G54D11*X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D12*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D11*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D12*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D11*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D12*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D11*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D12*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D11*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D12*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D11*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D12*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G36*
+X48000D02*Y134000D01*
+X52500D01*
+Y140000D01*
+X48000D01*
+G37*
+G36*
+X56100D02*Y134000D01*
+X60600D01*
+Y140000D01*
+X56100D01*
+G37*
+G36*
+X61500D02*Y134000D01*
+X66000D01*
+Y140000D01*
+X61500D01*
+G37*
+G36*
+X66900D02*Y134000D01*
+X71400D01*
+Y140000D01*
+X66900D01*
+G37*
+G36*
+X72300D02*Y134000D01*
+X76800D01*
+Y140000D01*
+X72300D01*
+G37*
+G36*
+X77700D02*Y134000D01*
+X82200D01*
+Y140000D01*
+X77700D01*
+G37*
+G36*
+X83100D02*Y134000D01*
+X87600D01*
+Y140000D01*
+X83100D01*
+G37*
+G36*
+X88500D02*Y134000D01*
+X93000D01*
+Y140000D01*
+X88500D01*
+G37*
+G36*
+X93900D02*Y134000D01*
+X98400D01*
+Y140000D01*
+X93900D01*
+G37*
+G36*
+X99300D02*Y134000D01*
+X103800D01*
+Y140000D01*
+X99300D01*
+G37*
+G36*
+X107400D02*Y134000D01*
+X111900D01*
+Y140000D01*
+X107400D01*
+G37*
+G36*
+X112800D02*Y134000D01*
+X117300D01*
+Y140000D01*
+X112800D01*
+G37*
+G36*
+X118200D02*Y134000D01*
+X122700D01*
+Y140000D01*
+X118200D01*
+G37*
+G36*
+X123600D02*Y134000D01*
+X128100D01*
+Y140000D01*
+X123600D01*
+G37*
+G36*
+X129000D02*Y134000D01*
+X133500D01*
+Y140000D01*
+X129000D01*
+G37*
+G36*
+X137100D02*Y134000D01*
+X141600D01*
+Y140000D01*
+X137100D01*
+G37*
+G36*
+X142500D02*Y134000D01*
+X147000D01*
+Y140000D01*
+X142500D01*
+G37*
+G36*
+X147900D02*Y134000D01*
+X152400D01*
+Y140000D01*
+X147900D01*
+G37*
+G36*
+X153300D02*Y134000D01*
+X157800D01*
+Y140000D01*
+X153300D01*
+G37*
+G36*
+X158700D02*Y134000D01*
+X163200D01*
+Y140000D01*
+X158700D01*
+G37*
+G36*
+X166800D02*Y134000D01*
+X171300D01*
+Y140000D01*
+X166800D01*
+G37*
+G36*
+X172200D02*Y134000D01*
+X176700D01*
+Y140000D01*
+X172200D01*
+G37*
+G36*
+X177600D02*Y134000D01*
+X182100D01*
+Y140000D01*
+X177600D01*
+G37*
+G36*
+X183000D02*Y134000D01*
+X187500D01*
+Y140000D01*
+X183000D01*
+G37*
+G36*
+X191100D02*Y134000D01*
+X195600D01*
+Y140000D01*
+X191100D01*
+G37*
+G36*
+X196500D02*Y134000D01*
+X201000D01*
+Y140000D01*
+X196500D01*
+G37*
+G36*
+X204600D02*Y134000D01*
+X209100D01*
+Y140000D01*
+X204600D01*
+G37*
+G36*
+X210000D02*Y134000D01*
+X214500D01*
+Y140000D01*
+X210000D01*
+G37*
+G36*
+X215400D02*Y134000D01*
+X219900D01*
+Y140000D01*
+X215400D01*
+G37*
+G36*
+X220800D02*Y134000D01*
+X225300D01*
+Y140000D01*
+X220800D01*
+G37*
+G36*
+X228900D02*Y134000D01*
+X233400D01*
+Y140000D01*
+X228900D01*
+G37*
+G36*
+X234300D02*Y134000D01*
+X238800D01*
+Y140000D01*
+X234300D01*
+G37*
+G36*
+X239700D02*Y134000D01*
+X244200D01*
+Y140000D01*
+X239700D01*
+G37*
+G36*
+X245100D02*Y134000D01*
+X249600D01*
+Y140000D01*
+X245100D01*
+G37*
+G36*
+X250500D02*Y134000D01*
+X255000D01*
+Y140000D01*
+X250500D01*
+G37*
+G36*
+X255900D02*Y134000D01*
+X260400D01*
+Y140000D01*
+X255900D01*
+G37*
+G36*
+X261300D02*Y134000D01*
+X265800D01*
+Y140000D01*
+X261300D01*
+G37*
+G36*
+X269400D02*Y134000D01*
+X273900D01*
+Y140000D01*
+X269400D01*
+G37*
+G36*
+X277500D02*Y134000D01*
+X282000D01*
+Y140000D01*
+X277500D01*
+G37*
+G36*
+X282900D02*Y134000D01*
+X287400D01*
+Y140000D01*
+X282900D01*
+G37*
+G36*
+X288300D02*Y134000D01*
+X292800D01*
+Y140000D01*
+X288300D01*
+G37*
+G36*
+X293700D02*Y134000D01*
+X298200D01*
+Y140000D01*
+X293700D01*
+G37*
+G36*
+X299100D02*Y134000D01*
+X303600D01*
+Y140000D01*
+X299100D01*
+G37*
+G36*
+X307200D02*Y134000D01*
+X311700D01*
+Y140000D01*
+X307200D01*
+G37*
+G36*
+X312600D02*Y134000D01*
+X317100D01*
+Y140000D01*
+X312600D01*
+G37*
+G36*
+X318000D02*Y134000D01*
+X322500D01*
+Y140000D01*
+X318000D01*
+G37*
+G36*
+X323400D02*Y134000D01*
+X327900D01*
+Y140000D01*
+X323400D01*
+G37*
+G36*
+X328800D02*Y134000D01*
+X333300D01*
+Y140000D01*
+X328800D01*
+G37*
+G54D13*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D11*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D12*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D11*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D12*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D11*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D12*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D11*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D12*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D11*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D12*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D11*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D12*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D11*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D12*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D11*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D12*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D11*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D12*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D11*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D12*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D11*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D12*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X242600D02*Y104000D01*
+X247100D01*
+Y110000D01*
+X242600D01*
+G37*
+G36*
+X248000D02*Y104000D01*
+X252500D01*
+Y110000D01*
+X248000D01*
+G37*
+G36*
+X253400D02*Y104000D01*
+X257900D01*
+Y110000D01*
+X253400D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X272300D02*Y104000D01*
+X276800D01*
+Y110000D01*
+X272300D01*
+G37*
+G36*
+X277700D02*Y104000D01*
+X282200D01*
+Y110000D01*
+X277700D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G54D11*X293900D02*Y104000D01*
+Y110000D02*X296900D01*
+X293900Y107300D02*X296150D01*
+G54D12*G36*
+X298700Y110000D02*Y104000D01*
+X303200D01*
+Y110000D01*
+X298700D01*
+G37*
+G36*
+X304100D02*Y104000D01*
+X308600D01*
+Y110000D01*
+X304100D01*
+G37*
+G36*
+X309500D02*Y104000D01*
+X314000D01*
+Y110000D01*
+X309500D01*
+G37*
+G36*
+X314900D02*Y104000D01*
+X319400D01*
+Y110000D01*
+X314900D01*
+G37*
+G36*
+X320300D02*Y104000D01*
+X324800D01*
+Y110000D01*
+X320300D01*
+G37*
+G36*
+X325700D02*Y104000D01*
+X330200D01*
+Y110000D01*
+X325700D01*
+G37*
+G36*
+X331100D02*Y104000D01*
+X335600D01*
+Y110000D01*
+X331100D01*
+G37*
+G36*
+X336500D02*Y104000D01*
+X341000D01*
+Y110000D01*
+X336500D01*
+G37*
+G36*
+X341900D02*Y104000D01*
+X346400D01*
+Y110000D01*
+X341900D01*
+G37*
+G36*
+X347300D02*Y104000D01*
+X351800D01*
+Y110000D01*
+X347300D01*
+G37*
+G54D11*X356150D02*Y104000D01*
+X358100Y110000D02*X359150Y108950D01*
+Y105050D01*
+X358100Y104000D02*X359150Y105050D01*
+X355400Y104000D02*X358100D01*
+X355400Y110000D02*X358100D01*
+G54D12*G36*
+X360950D02*Y104000D01*
+X365450D01*
+Y110000D01*
+X360950D01*
+G37*
+G36*
+X366350D02*Y104000D01*
+X370850D01*
+Y110000D01*
+X366350D01*
+G37*
+G36*
+X371750D02*Y104000D01*
+X376250D01*
+Y110000D01*
+X371750D01*
+G37*
+G36*
+X377150D02*Y104000D01*
+X381650D01*
+Y110000D01*
+X377150D01*
+G37*
+G36*
+X382550D02*Y104000D01*
+X387050D01*
+Y110000D01*
+X382550D01*
+G37*
+G36*
+X387950D02*Y104000D01*
+X392450D01*
+Y110000D01*
+X387950D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/rat.net b/tests/RTT/ref/rat.net
new file mode 100644
index 0000000..c19f656
--- /dev/null
+++ b/tests/RTT/ref/rat.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB a rat line
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/rat.png b/tests/RTT/ref/rat.png
new file mode 100644
index 0000000..852eb60
Binary files /dev/null and b/tests/RTT/ref/rat.png differ
diff --git a/tests/RTT/ref/rat.ps.gz b/tests/RTT/ref/rat.ps.gz
new file mode 100644
index 0000000..0a9d0ae
Binary files /dev/null and b/tests/RTT/ref/rat.ps.gz differ
diff --git a/tests/RTT/ref/rat.remote.gz b/tests/RTT/ref/rat.remote.gz
new file mode 100644
index 0000000..c2b9853
Binary files /dev/null and b/tests/RTT/ref/rat.remote.gz differ
diff --git a/tests/RTT/ref/rat.svg b/tests/RTT/ref/rat.svg
new file mode 100644
index 0000000..6ac2399
--- /dev/null
+++ b/tests/RTT/ref/rat.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+</svg>
diff --git a/tests/RTT/ref/rat.xy b/tests/RTT/ref/rat.xy
new file mode 100644
index 0000000..9dcfab1
--- /dev/null
+++ b/tests/RTT/ref/rat.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: a rat line - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/text_rot.bom b/tests/RTT/ref/text_rot.bom
new file mode 100644
index 0000000..31ca6ea
--- /dev/null
+++ b/tests/RTT/ref/text_rot.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: text rotations - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/text_rot.dsn b/tests/RTT/ref/text_rot.dsn
new file mode 100644
index 0000000..36a7164
--- /dev/null
+++ b/tests/RTT/ref/text_rot.dsn
@@ -0,0 +1,57 @@
+(pcb text rotations
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/text_rot.gbr/text_rot.fab.gbr b/tests/RTT/ref/text_rot.gbr/text_rot.fab.gbr
new file mode 100644
index 0000000..c31989b
--- /dev/null
+++ b/tests/RTT/ref/text_rot.gbr/text_rot.fab.gbr
@@ -0,0 +1,1950 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: text rotations, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD15C,0.0060*%
+%ADD14C,0.0100*%
+%ADD13C,0.0080*%
+%ADD12C,0.0001*%
+G54D12*G36*
+X0Y125000D02*Y117500D01*
+X3750D01*
+Y125000D01*
+X0D01*
+G37*
+G36*
+X4500D02*Y117500D01*
+X8250D01*
+Y125000D01*
+X4500D01*
+G37*
+G36*
+X9000D02*Y117500D01*
+X12750D01*
+Y125000D01*
+X9000D01*
+G37*
+G36*
+X13500D02*Y117500D01*
+X17250D01*
+Y125000D01*
+X13500D01*
+G37*
+G36*
+X18000D02*Y117500D01*
+X21750D01*
+Y125000D01*
+X18000D01*
+G37*
+G36*
+X22500D02*Y117500D01*
+X26250D01*
+Y125000D01*
+X22500D01*
+G37*
+G54D13*X0Y116500D03*
+G54D12*G36*
+X41000Y125000D02*Y117500D01*
+X44750D01*
+Y125000D01*
+X41000D01*
+G37*
+G36*
+X45500D02*Y117500D01*
+X49250D01*
+Y125000D01*
+X45500D01*
+G37*
+G36*
+X50000D02*Y117500D01*
+X53750D01*
+Y125000D01*
+X50000D01*
+G37*
+G36*
+X54500D02*Y117500D01*
+X58250D01*
+Y125000D01*
+X54500D01*
+G37*
+G36*
+X59000D02*Y117500D01*
+X62750D01*
+Y125000D01*
+X59000D01*
+G37*
+G36*
+X63500D02*Y117500D01*
+X67250D01*
+Y125000D01*
+X63500D01*
+G37*
+G36*
+X68000D02*Y117500D01*
+X71750D01*
+Y125000D01*
+X68000D01*
+G37*
+G36*
+X72500D02*Y117500D01*
+X76250D01*
+Y125000D01*
+X72500D01*
+G37*
+G36*
+X77000D02*Y117500D01*
+X80750D01*
+Y125000D01*
+X77000D01*
+G37*
+G36*
+X81500D02*Y117500D01*
+X85250D01*
+Y125000D01*
+X81500D01*
+G37*
+G36*
+X86000D02*Y117500D01*
+X89750D01*
+Y125000D01*
+X86000D01*
+G37*
+G36*
+X90500D02*Y117500D01*
+X94250D01*
+Y125000D01*
+X90500D01*
+G37*
+G54D13*X41000Y116500D03*
+G54D12*G36*
+X95000Y125000D02*Y117500D01*
+X98750D01*
+Y125000D01*
+X95000D01*
+G37*
+G36*
+X99500D02*Y117500D01*
+X103250D01*
+Y125000D01*
+X99500D01*
+G37*
+G36*
+X104000D02*Y117500D01*
+X107750D01*
+Y125000D01*
+X104000D01*
+G37*
+G36*
+X108500D02*Y117500D01*
+X112250D01*
+Y125000D01*
+X108500D01*
+G37*
+G36*
+X113000D02*Y117500D01*
+X116750D01*
+Y125000D01*
+X113000D01*
+G37*
+G54D13*X95000Y116500D03*
+G54D12*G36*
+X130000Y125000D02*Y117500D01*
+X133750D01*
+Y125000D01*
+X130000D01*
+G37*
+G36*
+X134500D02*Y117500D01*
+X138250D01*
+Y125000D01*
+X134500D01*
+G37*
+G36*
+X139000D02*Y117500D01*
+X142750D01*
+Y125000D01*
+X139000D01*
+G37*
+G36*
+X143500D02*Y117500D01*
+X147250D01*
+Y125000D01*
+X143500D01*
+G37*
+G36*
+X148000D02*Y117500D01*
+X151750D01*
+Y125000D01*
+X148000D01*
+G37*
+G36*
+X152500D02*Y117500D01*
+X156250D01*
+Y125000D01*
+X152500D01*
+G37*
+G36*
+X157000D02*Y117500D01*
+X160750D01*
+Y125000D01*
+X157000D01*
+G37*
+G54D13*X130000Y116500D03*
+G54D12*G36*
+X0Y140000D02*Y132500D01*
+X3750D01*
+Y140000D01*
+X0D01*
+G37*
+G36*
+X4500D02*Y132500D01*
+X8250D01*
+Y140000D01*
+X4500D01*
+G37*
+G36*
+X9000D02*Y132500D01*
+X12750D01*
+Y140000D01*
+X9000D01*
+G37*
+G36*
+X13500D02*Y132500D01*
+X17250D01*
+Y140000D01*
+X13500D01*
+G37*
+G36*
+X18000D02*Y132500D01*
+X21750D01*
+Y140000D01*
+X18000D01*
+G37*
+G36*
+X22500D02*Y132500D01*
+X26250D01*
+Y140000D01*
+X22500D01*
+G37*
+G36*
+X27000D02*Y132500D01*
+X30750D01*
+Y140000D01*
+X27000D01*
+G37*
+G36*
+X31500D02*Y132500D01*
+X35250D01*
+Y140000D01*
+X31500D01*
+G37*
+G36*
+X36000D02*Y132500D01*
+X39750D01*
+Y140000D01*
+X36000D01*
+G37*
+G36*
+X40500D02*Y132500D01*
+X44250D01*
+Y140000D01*
+X40500D01*
+G37*
+G36*
+X45000D02*Y132500D01*
+X48750D01*
+Y140000D01*
+X45000D01*
+G37*
+G36*
+X49500D02*Y132500D01*
+X53250D01*
+Y140000D01*
+X49500D01*
+G37*
+G36*
+X54000D02*Y132500D01*
+X57750D01*
+Y140000D01*
+X54000D01*
+G37*
+G36*
+X58500D02*Y132500D01*
+X62250D01*
+Y140000D01*
+X58500D01*
+G37*
+G36*
+X63000D02*Y132500D01*
+X66750D01*
+Y140000D01*
+X63000D01*
+G37*
+G36*
+X67500D02*Y132500D01*
+X71250D01*
+Y140000D01*
+X67500D01*
+G37*
+G36*
+X72000D02*Y132500D01*
+X75750D01*
+Y140000D01*
+X72000D01*
+G37*
+G36*
+X76500D02*Y132500D01*
+X80250D01*
+Y140000D01*
+X76500D01*
+G37*
+G36*
+X81000D02*Y132500D01*
+X84750D01*
+Y140000D01*
+X81000D01*
+G37*
+G36*
+X85500D02*Y132500D01*
+X89250D01*
+Y140000D01*
+X85500D01*
+G37*
+G36*
+X90000D02*Y132500D01*
+X93750D01*
+Y140000D01*
+X90000D01*
+G37*
+G36*
+X94500D02*Y132500D01*
+X98250D01*
+Y140000D01*
+X94500D01*
+G37*
+G36*
+X99000D02*Y132500D01*
+X102750D01*
+Y140000D01*
+X99000D01*
+G37*
+G36*
+X103500D02*Y132500D01*
+X107250D01*
+Y140000D01*
+X103500D01*
+G37*
+G36*
+X108000D02*Y132500D01*
+X111750D01*
+Y140000D01*
+X108000D01*
+G37*
+G36*
+X112500D02*Y132500D01*
+X116250D01*
+Y140000D01*
+X112500D01*
+G37*
+G36*
+X117000D02*Y132500D01*
+X120750D01*
+Y140000D01*
+X117000D01*
+G37*
+G36*
+X121500D02*Y132500D01*
+X125250D01*
+Y140000D01*
+X121500D01*
+G37*
+G36*
+X126000D02*Y132500D01*
+X129750D01*
+Y140000D01*
+X126000D01*
+G37*
+G36*
+X130500D02*Y132500D01*
+X134250D01*
+Y140000D01*
+X130500D01*
+G37*
+G36*
+X135000D02*Y132500D01*
+X138750D01*
+Y140000D01*
+X135000D01*
+G37*
+G36*
+X139500D02*Y132500D01*
+X143250D01*
+Y140000D01*
+X139500D01*
+G37*
+G36*
+X144000D02*Y132500D01*
+X147750D01*
+Y140000D01*
+X144000D01*
+G37*
+G36*
+X148500D02*Y132500D01*
+X152250D01*
+Y140000D01*
+X148500D01*
+G37*
+G36*
+X153000D02*Y132500D01*
+X156750D01*
+Y140000D01*
+X153000D01*
+G37*
+G36*
+X157500D02*Y132500D01*
+X161250D01*
+Y140000D01*
+X157500D01*
+G37*
+G36*
+X162000D02*Y132500D01*
+X165750D01*
+Y140000D01*
+X162000D01*
+G37*
+G36*
+X166500D02*Y132500D01*
+X170250D01*
+Y140000D01*
+X166500D01*
+G37*
+G36*
+X171000D02*Y132500D01*
+X174750D01*
+Y140000D01*
+X171000D01*
+G37*
+G36*
+X175500D02*Y132500D01*
+X179250D01*
+Y140000D01*
+X175500D01*
+G37*
+G36*
+X180000D02*Y132500D01*
+X183750D01*
+Y140000D01*
+X180000D01*
+G37*
+G36*
+X184500D02*Y132500D01*
+X188250D01*
+Y140000D01*
+X184500D01*
+G37*
+G36*
+X189000D02*Y132500D01*
+X192750D01*
+Y140000D01*
+X189000D01*
+G37*
+G36*
+X193500D02*Y132500D01*
+X197250D01*
+Y140000D01*
+X193500D01*
+G37*
+G36*
+X198000D02*Y132500D01*
+X201750D01*
+Y140000D01*
+X198000D01*
+G37*
+G36*
+X202500D02*Y132500D01*
+X206250D01*
+Y140000D01*
+X202500D01*
+G37*
+G36*
+X207000D02*Y132500D01*
+X210750D01*
+Y140000D01*
+X207000D01*
+G37*
+G36*
+X211500D02*Y132500D01*
+X215250D01*
+Y140000D01*
+X211500D01*
+G37*
+G36*
+X216000D02*Y132500D01*
+X219750D01*
+Y140000D01*
+X216000D01*
+G37*
+G36*
+X220500D02*Y132500D01*
+X224250D01*
+Y140000D01*
+X220500D01*
+G37*
+G36*
+X225000D02*Y132500D01*
+X228750D01*
+Y140000D01*
+X225000D01*
+G37*
+G36*
+X229500D02*Y132500D01*
+X233250D01*
+Y140000D01*
+X229500D01*
+G37*
+G36*
+X234000D02*Y132500D01*
+X237750D01*
+Y140000D01*
+X234000D01*
+G37*
+G36*
+X238500D02*Y132500D01*
+X242250D01*
+Y140000D01*
+X238500D01*
+G37*
+G36*
+X243000D02*Y132500D01*
+X246750D01*
+Y140000D01*
+X243000D01*
+G37*
+G36*
+X247500D02*Y132500D01*
+X251250D01*
+Y140000D01*
+X247500D01*
+G37*
+G36*
+X252000D02*Y132500D01*
+X255750D01*
+Y140000D01*
+X252000D01*
+G37*
+G36*
+X256500D02*Y132500D01*
+X260250D01*
+Y140000D01*
+X256500D01*
+G37*
+G36*
+X261000D02*Y132500D01*
+X264750D01*
+Y140000D01*
+X261000D01*
+G37*
+G36*
+X265500D02*Y132500D01*
+X269250D01*
+Y140000D01*
+X265500D01*
+G37*
+G36*
+X270000D02*Y132500D01*
+X273750D01*
+Y140000D01*
+X270000D01*
+G37*
+G36*
+X274500D02*Y132500D01*
+X278250D01*
+Y140000D01*
+X274500D01*
+G37*
+G36*
+X279000D02*Y132500D01*
+X282750D01*
+Y140000D01*
+X279000D01*
+G37*
+G36*
+X283500D02*Y132500D01*
+X287250D01*
+Y140000D01*
+X283500D01*
+G37*
+G36*
+X288000D02*Y132500D01*
+X291750D01*
+Y140000D01*
+X288000D01*
+G37*
+G36*
+X292500D02*Y132500D01*
+X296250D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297000D02*Y132500D01*
+X300750D01*
+Y140000D01*
+X297000D01*
+G37*
+G36*
+X301500D02*Y132500D01*
+X305250D01*
+Y140000D01*
+X301500D01*
+G37*
+G54D14*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D12*G36*
+X200000Y65000D02*Y57500D01*
+X203750D01*
+Y65000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y57500D01*
+X208250D01*
+Y65000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y57500D01*
+X212750D01*
+Y65000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y57500D01*
+X217250D01*
+Y65000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y57500D01*
+X221750D01*
+Y65000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y57500D01*
+X226250D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y57500D01*
+X230750D01*
+Y65000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y57500D01*
+X235250D01*
+Y65000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y57500D01*
+X239750D01*
+Y65000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y57500D01*
+X244250D01*
+Y65000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y57500D01*
+X248750D01*
+Y65000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y57500D01*
+X253250D01*
+Y65000D01*
+X249500D01*
+G37*
+G36*
+X254000D02*Y57500D01*
+X257750D01*
+Y65000D01*
+X254000D01*
+G37*
+G36*
+X258500D02*Y57500D01*
+X262250D01*
+Y65000D01*
+X258500D01*
+G37*
+G36*
+X263000D02*Y57500D01*
+X266750D01*
+Y65000D01*
+X263000D01*
+G37*
+G36*
+X267500D02*Y57500D01*
+X271250D01*
+Y65000D01*
+X267500D01*
+G37*
+G36*
+X272000D02*Y57500D01*
+X275750D01*
+Y65000D01*
+X272000D01*
+G37*
+G36*
+X276500D02*Y57500D01*
+X280250D01*
+Y65000D01*
+X276500D01*
+G37*
+G36*
+X281000D02*Y57500D01*
+X284750D01*
+Y65000D01*
+X281000D01*
+G37*
+G36*
+X285500D02*Y57500D01*
+X289250D01*
+Y65000D01*
+X285500D01*
+G37*
+G36*
+X290000D02*Y57500D01*
+X293750D01*
+Y65000D01*
+X290000D01*
+G37*
+G36*
+X294500D02*Y57500D01*
+X298250D01*
+Y65000D01*
+X294500D01*
+G37*
+G36*
+X299000D02*Y57500D01*
+X302750D01*
+Y65000D01*
+X299000D01*
+G37*
+G36*
+X303500D02*Y57500D01*
+X307250D01*
+Y65000D01*
+X303500D01*
+G37*
+G36*
+X308000D02*Y57500D01*
+X311750D01*
+Y65000D01*
+X308000D01*
+G37*
+G36*
+X312500D02*Y57500D01*
+X316250D01*
+Y65000D01*
+X312500D01*
+G37*
+G36*
+X317000D02*Y57500D01*
+X320750D01*
+Y65000D01*
+X317000D01*
+G37*
+G36*
+X321500D02*Y57500D01*
+X325250D01*
+Y65000D01*
+X321500D01*
+G37*
+G36*
+X326000D02*Y57500D01*
+X329750D01*
+Y65000D01*
+X326000D01*
+G37*
+G36*
+X330500D02*Y57500D01*
+X334250D01*
+Y65000D01*
+X330500D01*
+G37*
+G36*
+X335000D02*Y57500D01*
+X338750D01*
+Y65000D01*
+X335000D01*
+G37*
+G36*
+X339500D02*Y57500D01*
+X343250D01*
+Y65000D01*
+X339500D01*
+G37*
+G36*
+X344000D02*Y57500D01*
+X347750D01*
+Y65000D01*
+X344000D01*
+G37*
+G36*
+X348500D02*Y57500D01*
+X352250D01*
+Y65000D01*
+X348500D01*
+G37*
+G36*
+X353000D02*Y57500D01*
+X356750D01*
+Y65000D01*
+X353000D01*
+G37*
+G36*
+X357500D02*Y57500D01*
+X361250D01*
+Y65000D01*
+X357500D01*
+G37*
+G36*
+X362000D02*Y57500D01*
+X365750D01*
+Y65000D01*
+X362000D01*
+G37*
+G36*
+X366500D02*Y57500D01*
+X370250D01*
+Y65000D01*
+X366500D01*
+G37*
+G36*
+X371000D02*Y57500D01*
+X374750D01*
+Y65000D01*
+X371000D01*
+G37*
+G36*
+X375500D02*Y57500D01*
+X379250D01*
+Y65000D01*
+X375500D01*
+G37*
+G36*
+X380000D02*Y57500D01*
+X383750D01*
+Y65000D01*
+X380000D01*
+G37*
+G36*
+X384500D02*Y57500D01*
+X388250D01*
+Y65000D01*
+X384500D01*
+G37*
+G36*
+X389000D02*Y57500D01*
+X392750D01*
+Y65000D01*
+X389000D01*
+G37*
+G36*
+X393500D02*Y57500D01*
+X397250D01*
+Y65000D01*
+X393500D01*
+G37*
+G36*
+X398000D02*Y57500D01*
+X401750D01*
+Y65000D01*
+X398000D01*
+G37*
+G36*
+X402500D02*Y57500D01*
+X406250D01*
+Y65000D01*
+X402500D01*
+G37*
+G36*
+X407000D02*Y57500D01*
+X410750D01*
+Y65000D01*
+X407000D01*
+G37*
+G36*
+X411500D02*Y57500D01*
+X415250D01*
+Y65000D01*
+X411500D01*
+G37*
+G36*
+X416000D02*Y57500D01*
+X419750D01*
+Y65000D01*
+X416000D01*
+G37*
+G36*
+X420500D02*Y57500D01*
+X424250D01*
+Y65000D01*
+X420500D01*
+G37*
+G36*
+X425000D02*Y57500D01*
+X428750D01*
+Y65000D01*
+X425000D01*
+G37*
+G36*
+X429500D02*Y57500D01*
+X433250D01*
+Y65000D01*
+X429500D01*
+G37*
+G36*
+X434000D02*Y57500D01*
+X437750D01*
+Y65000D01*
+X434000D01*
+G37*
+G36*
+X438500D02*Y57500D01*
+X442250D01*
+Y65000D01*
+X438500D01*
+G37*
+G36*
+X443000D02*Y57500D01*
+X446750D01*
+Y65000D01*
+X443000D01*
+G37*
+G36*
+X447500D02*Y57500D01*
+X451250D01*
+Y65000D01*
+X447500D01*
+G37*
+G36*
+X452000D02*Y57500D01*
+X455750D01*
+Y65000D01*
+X452000D01*
+G37*
+G36*
+X456500D02*Y57500D01*
+X460250D01*
+Y65000D01*
+X456500D01*
+G37*
+G36*
+X461000D02*Y57500D01*
+X464750D01*
+Y65000D01*
+X461000D01*
+G37*
+G36*
+X465500D02*Y57500D01*
+X469250D01*
+Y65000D01*
+X465500D01*
+G37*
+G36*
+X470000D02*Y57500D01*
+X473750D01*
+Y65000D01*
+X470000D01*
+G37*
+G36*
+X474500D02*Y57500D01*
+X478250D01*
+Y65000D01*
+X474500D01*
+G37*
+G36*
+X25000Y-2000D02*Y-9500D01*
+X28750D01*
+Y-2000D01*
+X25000D01*
+G37*
+G36*
+X29500D02*Y-9500D01*
+X33250D01*
+Y-2000D01*
+X29500D01*
+G37*
+G36*
+X34000D02*Y-9500D01*
+X37750D01*
+Y-2000D01*
+X34000D01*
+G37*
+G36*
+X38500D02*Y-9500D01*
+X42250D01*
+Y-2000D01*
+X38500D01*
+G37*
+G36*
+X43000D02*Y-9500D01*
+X46750D01*
+Y-2000D01*
+X43000D01*
+G37*
+G36*
+X47500D02*Y-9500D01*
+X51250D01*
+Y-2000D01*
+X47500D01*
+G37*
+G36*
+X52000D02*Y-9500D01*
+X55750D01*
+Y-2000D01*
+X52000D01*
+G37*
+G36*
+X56500D02*Y-9500D01*
+X60250D01*
+Y-2000D01*
+X56500D01*
+G37*
+G36*
+X61000D02*Y-9500D01*
+X64750D01*
+Y-2000D01*
+X61000D01*
+G37*
+G36*
+X65500D02*Y-9500D01*
+X69250D01*
+Y-2000D01*
+X65500D01*
+G37*
+G36*
+X70000D02*Y-9500D01*
+X73750D01*
+Y-2000D01*
+X70000D01*
+G37*
+G36*
+X74500D02*Y-9500D01*
+X78250D01*
+Y-2000D01*
+X74500D01*
+G37*
+G36*
+X79000D02*Y-9500D01*
+X82750D01*
+Y-2000D01*
+X79000D01*
+G37*
+G36*
+X83500D02*Y-9500D01*
+X87250D01*
+Y-2000D01*
+X83500D01*
+G37*
+G36*
+X88000D02*Y-9500D01*
+X91750D01*
+Y-2000D01*
+X88000D01*
+G37*
+G36*
+X92500D02*Y-9500D01*
+X96250D01*
+Y-2000D01*
+X92500D01*
+G37*
+G36*
+X97000D02*Y-9500D01*
+X100750D01*
+Y-2000D01*
+X97000D01*
+G37*
+G36*
+X101500D02*Y-9500D01*
+X105250D01*
+Y-2000D01*
+X101500D01*
+G37*
+G36*
+X106000D02*Y-9500D01*
+X109750D01*
+Y-2000D01*
+X106000D01*
+G37*
+G36*
+X110500D02*Y-9500D01*
+X114250D01*
+Y-2000D01*
+X110500D01*
+G37*
+G36*
+X115000D02*Y-9500D01*
+X118750D01*
+Y-2000D01*
+X115000D01*
+G37*
+G36*
+X119500D02*Y-9500D01*
+X123250D01*
+Y-2000D01*
+X119500D01*
+G37*
+G36*
+X124000D02*Y-9500D01*
+X127750D01*
+Y-2000D01*
+X124000D01*
+G37*
+G36*
+X128500D02*Y-9500D01*
+X132250D01*
+Y-2000D01*
+X128500D01*
+G37*
+G36*
+X133000D02*Y-9500D01*
+X136750D01*
+Y-2000D01*
+X133000D01*
+G37*
+G36*
+X137500D02*Y-9500D01*
+X141250D01*
+Y-2000D01*
+X137500D01*
+G37*
+G36*
+X142000D02*Y-9500D01*
+X145750D01*
+Y-2000D01*
+X142000D01*
+G37*
+G36*
+X146500D02*Y-9500D01*
+X150250D01*
+Y-2000D01*
+X146500D01*
+G37*
+G36*
+X151000D02*Y-9500D01*
+X154750D01*
+Y-2000D01*
+X151000D01*
+G37*
+G36*
+X155500D02*Y-9500D01*
+X159250D01*
+Y-2000D01*
+X155500D01*
+G37*
+G36*
+X160000D02*Y-9500D01*
+X163750D01*
+Y-2000D01*
+X160000D01*
+G37*
+G36*
+X164500D02*Y-9500D01*
+X168250D01*
+Y-2000D01*
+X164500D01*
+G37*
+G36*
+X169000D02*Y-9500D01*
+X172750D01*
+Y-2000D01*
+X169000D01*
+G37*
+G36*
+X173500D02*Y-9500D01*
+X177250D01*
+Y-2000D01*
+X173500D01*
+G37*
+G36*
+X178000D02*Y-9500D01*
+X181750D01*
+Y-2000D01*
+X178000D01*
+G37*
+G36*
+X182500D02*Y-9500D01*
+X186250D01*
+Y-2000D01*
+X182500D01*
+G37*
+G36*
+X187000D02*Y-9500D01*
+X190750D01*
+Y-2000D01*
+X187000D01*
+G37*
+G36*
+X191500D02*Y-9500D01*
+X195250D01*
+Y-2000D01*
+X191500D01*
+G37*
+G36*
+X196000D02*Y-9500D01*
+X199750D01*
+Y-2000D01*
+X196000D01*
+G37*
+G36*
+X200500D02*Y-9500D01*
+X204250D01*
+Y-2000D01*
+X200500D01*
+G37*
+G36*
+X205000D02*Y-9500D01*
+X208750D01*
+Y-2000D01*
+X205000D01*
+G37*
+G36*
+X209500D02*Y-9500D01*
+X213250D01*
+Y-2000D01*
+X209500D01*
+G37*
+G36*
+X214000D02*Y-9500D01*
+X217750D01*
+Y-2000D01*
+X214000D01*
+G37*
+G36*
+X218500D02*Y-9500D01*
+X222250D01*
+Y-2000D01*
+X218500D01*
+G37*
+G36*
+X223000D02*Y-9500D01*
+X226750D01*
+Y-2000D01*
+X223000D01*
+G37*
+G36*
+X227500D02*Y-9500D01*
+X231250D01*
+Y-2000D01*
+X227500D01*
+G37*
+G36*
+X232000D02*Y-9500D01*
+X235750D01*
+Y-2000D01*
+X232000D01*
+G37*
+G36*
+X236500D02*Y-9500D01*
+X240250D01*
+Y-2000D01*
+X236500D01*
+G37*
+G36*
+X241000D02*Y-9500D01*
+X244750D01*
+Y-2000D01*
+X241000D01*
+G37*
+G36*
+X245500D02*Y-9500D01*
+X249250D01*
+Y-2000D01*
+X245500D01*
+G37*
+G36*
+X250000D02*Y-9500D01*
+X253750D01*
+Y-2000D01*
+X250000D01*
+G37*
+G36*
+X254500D02*Y-9500D01*
+X258250D01*
+Y-2000D01*
+X254500D01*
+G37*
+G36*
+X259000D02*Y-9500D01*
+X262750D01*
+Y-2000D01*
+X259000D01*
+G37*
+G36*
+X263500D02*Y-9500D01*
+X267250D01*
+Y-2000D01*
+X263500D01*
+G37*
+G36*
+X268000D02*Y-9500D01*
+X271750D01*
+Y-2000D01*
+X268000D01*
+G37*
+G36*
+X272500D02*Y-9500D01*
+X276250D01*
+Y-2000D01*
+X272500D01*
+G37*
+G36*
+X277000D02*Y-9500D01*
+X280750D01*
+Y-2000D01*
+X277000D01*
+G37*
+G36*
+X281500D02*Y-9500D01*
+X285250D01*
+Y-2000D01*
+X281500D01*
+G37*
+G36*
+X286000D02*Y-9500D01*
+X289750D01*
+Y-2000D01*
+X286000D01*
+G37*
+G36*
+X290500D02*Y-9500D01*
+X294250D01*
+Y-2000D01*
+X290500D01*
+G37*
+G36*
+X295000D02*Y-9500D01*
+X298750D01*
+Y-2000D01*
+X295000D01*
+G37*
+G36*
+X299500D02*Y-9500D01*
+X303250D01*
+Y-2000D01*
+X299500D01*
+G37*
+G36*
+X304000D02*Y-9500D01*
+X307750D01*
+Y-2000D01*
+X304000D01*
+G37*
+G36*
+X308500D02*Y-9500D01*
+X312250D01*
+Y-2000D01*
+X308500D01*
+G37*
+G36*
+X313000D02*Y-9500D01*
+X316750D01*
+Y-2000D01*
+X313000D01*
+G37*
+G36*
+X317500D02*Y-9500D01*
+X321250D01*
+Y-2000D01*
+X317500D01*
+G37*
+G36*
+X322000D02*Y-9500D01*
+X325750D01*
+Y-2000D01*
+X322000D01*
+G37*
+G36*
+X326500D02*Y-9500D01*
+X330250D01*
+Y-2000D01*
+X326500D01*
+G37*
+G36*
+X331000D02*Y-9500D01*
+X334750D01*
+Y-2000D01*
+X331000D01*
+G37*
+G36*
+X335500D02*Y-9500D01*
+X339250D01*
+Y-2000D01*
+X335500D01*
+G37*
+G36*
+X340000D02*Y-9500D01*
+X343750D01*
+Y-2000D01*
+X340000D01*
+G37*
+G36*
+X344500D02*Y-9500D01*
+X348250D01*
+Y-2000D01*
+X344500D01*
+G37*
+G36*
+X349000D02*Y-9500D01*
+X352750D01*
+Y-2000D01*
+X349000D01*
+G37*
+G36*
+X353500D02*Y-9500D01*
+X357250D01*
+Y-2000D01*
+X353500D01*
+G37*
+G36*
+X358000D02*Y-9500D01*
+X361750D01*
+Y-2000D01*
+X358000D01*
+G37*
+G36*
+X362500D02*Y-9500D01*
+X366250D01*
+Y-2000D01*
+X362500D01*
+G37*
+G36*
+X367000D02*Y-9500D01*
+X370750D01*
+Y-2000D01*
+X367000D01*
+G37*
+G36*
+X371500D02*Y-9500D01*
+X375250D01*
+Y-2000D01*
+X371500D01*
+G37*
+G36*
+X376000D02*Y-9500D01*
+X379750D01*
+Y-2000D01*
+X376000D01*
+G37*
+G36*
+X380500D02*Y-9500D01*
+X384250D01*
+Y-2000D01*
+X380500D01*
+G37*
+G36*
+X385000D02*Y-9500D01*
+X388750D01*
+Y-2000D01*
+X385000D01*
+G37*
+G36*
+X389500D02*Y-9500D01*
+X393250D01*
+Y-2000D01*
+X389500D01*
+G37*
+G36*
+X394000D02*Y-9500D01*
+X397750D01*
+Y-2000D01*
+X394000D01*
+G37*
+G36*
+X398500D02*Y-9500D01*
+X402250D01*
+Y-2000D01*
+X398500D01*
+G37*
+G36*
+X403000D02*Y-9500D01*
+X406750D01*
+Y-2000D01*
+X403000D01*
+G37*
+G36*
+X407500D02*Y-9500D01*
+X411251D01*
+Y-2000D01*
+X407500D01*
+G37*
+G36*
+X412001D02*Y-9500D01*
+X415751D01*
+Y-2000D01*
+X412001D01*
+G37*
+G36*
+X416501D02*Y-9500D01*
+X420251D01*
+Y-2000D01*
+X416501D01*
+G37*
+G36*
+X421001D02*Y-9500D01*
+X424751D01*
+Y-2000D01*
+X421001D01*
+G37*
+G36*
+X425501D02*Y-9500D01*
+X429251D01*
+Y-2000D01*
+X425501D01*
+G37*
+G36*
+X430001D02*Y-9500D01*
+X433751D01*
+Y-2000D01*
+X430001D01*
+G37*
+G36*
+X434501D02*Y-9500D01*
+X438251D01*
+Y-2000D01*
+X434501D01*
+G37*
+G36*
+X439001D02*Y-9500D01*
+X442751D01*
+Y-2000D01*
+X439001D01*
+G37*
+G36*
+X443501D02*Y-9500D01*
+X447251D01*
+Y-2000D01*
+X443501D01*
+G37*
+G36*
+X448001D02*Y-9500D01*
+X451751D01*
+Y-2000D01*
+X448001D01*
+G37*
+G36*
+X452501D02*Y-9500D01*
+X456251D01*
+Y-2000D01*
+X452501D01*
+G37*
+G36*
+X457001D02*Y-9500D01*
+X460751D01*
+Y-2000D01*
+X457001D01*
+G37*
+G36*
+X461501D02*Y-9500D01*
+X465251D01*
+Y-2000D01*
+X461501D01*
+G37*
+G36*
+X200000Y80000D02*Y72500D01*
+X203750D01*
+Y80000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y72500D01*
+X208250D01*
+Y80000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y72500D01*
+X212750D01*
+Y80000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y72500D01*
+X217250D01*
+Y80000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y72500D01*
+X221750D01*
+Y80000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y72500D01*
+X226250D01*
+Y80000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y72500D01*
+X230750D01*
+Y80000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y72500D01*
+X235250D01*
+Y80000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y72500D01*
+X239750D01*
+Y80000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y72500D01*
+X244250D01*
+Y80000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y72500D01*
+X248750D01*
+Y80000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y72500D01*
+X253250D01*
+Y80000D01*
+X249500D01*
+G37*
+G54D15*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D12*G36*
+X205550Y95000D02*Y87500D01*
+X209300D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210050D02*Y87500D01*
+X213800D01*
+Y95000D01*
+X210050D01*
+G37*
+G36*
+X214550D02*Y87500D01*
+X218300D01*
+Y95000D01*
+X214550D01*
+G37*
+G36*
+X219050D02*Y87500D01*
+X222800D01*
+Y95000D01*
+X219050D01*
+G37*
+G36*
+X223550D02*Y87500D01*
+X227300D01*
+Y95000D01*
+X223550D01*
+G37*
+G36*
+X228050D02*Y87500D01*
+X231800D01*
+Y95000D01*
+X228050D01*
+G37*
+G36*
+X232550D02*Y87500D01*
+X236300D01*
+Y95000D01*
+X232550D01*
+G37*
+G36*
+X200000Y110000D02*Y102500D01*
+X203750D01*
+Y110000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y102500D01*
+X208250D01*
+Y110000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y102500D01*
+X212750D01*
+Y110000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y102500D01*
+X217250D01*
+Y110000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y102500D01*
+X221750D01*
+Y110000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y102500D01*
+X226250D01*
+Y110000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y102500D01*
+X230750D01*
+Y110000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y102500D01*
+X235250D01*
+Y110000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y102500D01*
+X239750D01*
+Y110000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y102500D01*
+X244250D01*
+Y110000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y102500D01*
+X248750D01*
+Y110000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y102500D01*
+X253250D01*
+Y110000D01*
+X249500D01*
+G37*
+G36*
+X254000D02*Y102500D01*
+X257750D01*
+Y110000D01*
+X254000D01*
+G37*
+G36*
+X258500D02*Y102500D01*
+X262250D01*
+Y110000D01*
+X258500D01*
+G37*
+G36*
+X263000D02*Y102500D01*
+X266750D01*
+Y110000D01*
+X263000D01*
+G37*
+G36*
+X267500D02*Y102500D01*
+X271250D01*
+Y110000D01*
+X267500D01*
+G37*
+G36*
+X272000D02*Y102500D01*
+X275750D01*
+Y110000D01*
+X272000D01*
+G37*
+G36*
+X276500D02*Y102500D01*
+X280250D01*
+Y110000D01*
+X276500D01*
+G37*
+G36*
+X281000D02*Y102500D01*
+X284750D01*
+Y110000D01*
+X281000D01*
+G37*
+G36*
+X285500D02*Y102500D01*
+X289250D01*
+Y110000D01*
+X285500D01*
+G37*
+G36*
+X290000D02*Y102500D01*
+X293750D01*
+Y110000D01*
+X290000D01*
+G37*
+G36*
+X294500D02*Y102500D01*
+X298250D01*
+Y110000D01*
+X294500D01*
+G37*
+G36*
+X299000D02*Y102500D01*
+X302750D01*
+Y110000D01*
+X299000D01*
+G37*
+G36*
+X303500D02*Y102500D01*
+X307250D01*
+Y110000D01*
+X303500D01*
+G37*
+G36*
+X308000D02*Y102500D01*
+X311750D01*
+Y110000D01*
+X308000D01*
+G37*
+G36*
+X312500D02*Y102500D01*
+X316250D01*
+Y110000D01*
+X312500D01*
+G37*
+G36*
+X317000D02*Y102500D01*
+X320750D01*
+Y110000D01*
+X317000D01*
+G37*
+G36*
+X321500D02*Y102500D01*
+X325250D01*
+Y110000D01*
+X321500D01*
+G37*
+G36*
+X326000D02*Y102500D01*
+X329750D01*
+Y110000D01*
+X326000D01*
+G37*
+G36*
+X330500D02*Y102500D01*
+X334250D01*
+Y110000D01*
+X330500D01*
+G37*
+G36*
+X335000D02*Y102500D01*
+X338750D01*
+Y110000D01*
+X335000D01*
+G37*
+G36*
+X339500D02*Y102500D01*
+X343250D01*
+Y110000D01*
+X339500D01*
+G37*
+G36*
+X344000D02*Y102500D01*
+X347750D01*
+Y110000D01*
+X344000D01*
+G37*
+G36*
+X348500D02*Y102500D01*
+X352250D01*
+Y110000D01*
+X348500D01*
+G37*
+G36*
+X353000D02*Y102500D01*
+X356750D01*
+Y110000D01*
+X353000D01*
+G37*
+G36*
+X357500D02*Y102500D01*
+X361250D01*
+Y110000D01*
+X357500D01*
+G37*
+G36*
+X362000D02*Y102500D01*
+X365750D01*
+Y110000D01*
+X362000D01*
+G37*
+G36*
+X366500D02*Y102500D01*
+X370250D01*
+Y110000D01*
+X366500D01*
+G37*
+G36*
+X371000D02*Y102500D01*
+X374750D01*
+Y110000D01*
+X371000D01*
+G37*
+G36*
+X375500D02*Y102500D01*
+X379250D01*
+Y110000D01*
+X375500D01*
+G37*
+G36*
+X380000D02*Y102500D01*
+X383750D01*
+Y110000D01*
+X380000D01*
+G37*
+G36*
+X384500D02*Y102500D01*
+X388250D01*
+Y110000D01*
+X384500D01*
+G37*
+G36*
+X389000D02*Y102500D01*
+X392750D01*
+Y110000D01*
+X389000D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/text_rot.gbr/text_rot.topsilk.gbr b/tests/RTT/ref/text_rot.gbr/text_rot.topsilk.gbr
new file mode 100644
index 0000000..e5e44fe
--- /dev/null
+++ b/tests/RTT/ref/text_rot.gbr/text_rot.topsilk.gbr
@@ -0,0 +1,60 @@
+G04 start of page 2 for group 0 layer_idx 8 *
+G04 Title: text rotations, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD11C,0.0070*%
+G54D11*X22500Y34000D02*Y31000D01*
+Y34000D02*X23200Y35000D01*
+X24300D01*
+X25000Y34000D01*
+Y31000D01*
+X22500Y33000D02*X25000D01*
+X26200Y34200D02*X27000Y35000D01*
+Y31000D01*
+X26200D02*X27700D01*
+X16000Y22500D02*X19000D01*
+X16000D02*X15000Y23200D01*
+Y24300D02*Y23200D01*
+Y24300D02*X16000Y25000D01*
+X19000D01*
+X17000D02*Y22500D01*
+X15500Y26200D02*X15000Y26700D01*
+Y28200D02*Y26700D01*
+Y28200D02*X15500Y28700D01*
+X16500D01*
+X19000Y26200D02*X16500Y28700D01*
+X19000D02*Y26200D01*
+X27500Y19000D02*Y16000D01*
+X26800Y15000D01*
+X25700D02*X26800D01*
+X25700D02*X25000Y16000D01*
+Y19000D02*Y16000D01*
+Y17000D02*X27500D01*
+X23800Y15500D02*X23300Y15000D01*
+X22300D02*X23300D01*
+X22300D02*X21800Y15500D01*
+X22300Y19000D02*X21800Y18500D01*
+X22300Y19000D02*X23300D01*
+X23800Y18500D02*X23300Y19000D01*
+X22300Y16800D02*X23300D01*
+X21800Y16300D02*Y15500D01*
+Y18500D02*Y17300D01*
+X22300Y16800D01*
+X21800Y16300D02*X22300Y16800D01*
+X31000Y27500D02*X34000D01*
+X35000Y26800D01*
+Y25700D01*
+X34000Y25000D01*
+X31000D02*X34000D01*
+X33000Y27500D02*Y25000D01*
+X32500Y23800D02*X35000Y21800D01*
+X32500Y23800D02*Y21300D01*
+X31000Y21800D02*X35000D01*
+M02*
diff --git a/tests/RTT/ref/text_rot.net b/tests/RTT/ref/text_rot.net
new file mode 100644
index 0000000..24d8910
--- /dev/null
+++ b/tests/RTT/ref/text_rot.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB text rotations
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/text_rot.png b/tests/RTT/ref/text_rot.png
new file mode 100644
index 0000000..78335a2
Binary files /dev/null and b/tests/RTT/ref/text_rot.png differ
diff --git a/tests/RTT/ref/text_rot.ps.gz b/tests/RTT/ref/text_rot.ps.gz
new file mode 100644
index 0000000..dedbdb1
Binary files /dev/null and b/tests/RTT/ref/text_rot.ps.gz differ
diff --git a/tests/RTT/ref/text_rot.remote.gz b/tests/RTT/ref/text_rot.remote.gz
new file mode 100644
index 0000000..58794d1
Binary files /dev/null and b/tests/RTT/ref/text_rot.remote.gz differ
diff --git a/tests/RTT/ref/text_rot.svg b/tests/RTT/ref/text_rot.svg
new file mode 100644
index 0000000..587caae
--- /dev/null
+++ b/tests/RTT/ref/text_rot.svg
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="5.7150" y1="4.0640" x2="5.7150" y2="4.8260" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7150" y1="4.0640" x2="5.8928" y2="3.8100" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.8928" y1="3.8100" x2="6.1722" y2="3.8100" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.1722" y1="3.8100" x2="6.3500" y2="4.0640" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.3500" y1="4.0640" x2="6.3500" y2="4.8260" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7150" y1="4.3180" x2="6.3500" y2="4.3180" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.6548" y1="4.0132" x2="6.8580" y2="3.8100" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.8580" y1="3.8100" x2="6.8580" y2="4.8260" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.6548" y1="4.8260" x2="7.0358" y2="4.8260" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.0640" y1="6.9850" x2="4.8260" y2="6.9850" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.0640" y1="6.9850" x2="3.8100" y2="6.8072" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.8100" y1="6.5278" x2="3.8100" y2="6.8072" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.8100" y1="6.5278" x2="4.0640" y2="6.3500" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.0640" y1="6.3500" x2="4.8260" y2="6.3500" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.3180" y1="6.3500" x2="4.3180" y2="6.9850" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.9370" y1="6.0452" x2="3.8100" y2="5.9182" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.8100" y1="5.5372" x2="3.8100" y2="5.9182" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.8100" y1="5.5372" x2="3.9370" y2="5.4102" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.9370" y1="5.4102" x2="4.1910" y2="5.4102" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.8260" y1="6.0452" x2="4.1910" y2="5.4102" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.8260" y1="5.4102" x2="4.8260" y2="6.0452" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.9850" y1="7.8740" x2="6.9850" y2="8.6360" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.9850" y1="8.6360" x2="6.8072" y2="8.8900" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.5278" y1="8.8900" x2="6.8072" y2="8.8900" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.5278" y1="8.8900" x2="6.3500" y2="8.6360" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.3500" y1="7.8740" x2="6.3500" y2="8.6360" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.3500" y1="8.3820" x2="6.9850" y2="8.3820" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.0452" y1="8.7630" x2="5.9182" y2="8.8900" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6642" y1="8.8900" x2="5.9182" y2="8.8900" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6642" y1="8.8900" x2="5.5372" y2="8.7630" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6642" y1="7.8740" x2="5.5372" y2="8.0010" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6642" y1="7.8740" x2="5.9182" y2="7.8740" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.0452" y1="8.0010" x2="5.9182" y2="7.8740" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.6642" y1="8.4328" x2="5.9182" y2="8.4328" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.5372" y1="8.5598" x2="5.5372" y2="8.7630" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.5372" y1="8.0010" x2="5.5372" y2="8.3058" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.5372" y1="8.3058" x2="5.6642" y2="8.4328" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.5372" y1="8.5598" x2="5.6642" y2="8.4328" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.8740" y1="5.7150" x2="8.6360" y2="5.7150" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.6360" y1="5.7150" x2="8.8900" y2="5.8928" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.8900" y1="5.8928" x2="8.8900" y2="6.1722" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.8900" y1="6.1722" x2="8.6360" y2="6.3500" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.8740" y1="6.3500" x2="8.6360" y2="6.3500" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.3820" y1="5.7150" x2="8.3820" y2="6.3500" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.2550" y1="6.6548" x2="8.8900" y2="7.1628" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="8.2550" y1="6.6548" x2="8.2550" y2="7.2898" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="7.8740" y1="7.1628" x2="8.8900" y2="7.1628" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/text_rot.xy b/tests/RTT/ref/text_rot.xy
new file mode 100644
index 0000000..971e614
--- /dev/null
+++ b/tests/RTT/ref/text_rot.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: text rotations - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/text_scale.bom b/tests/RTT/ref/text_scale.bom
new file mode 100644
index 0000000..864d741
--- /dev/null
+++ b/tests/RTT/ref/text_scale.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: text sizes (scales) - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/text_scale.dsn b/tests/RTT/ref/text_scale.dsn
new file mode 100644
index 0000000..1b0ee22
--- /dev/null
+++ b/tests/RTT/ref/text_scale.dsn
@@ -0,0 +1,57 @@
+(pcb text sizes (scales)
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/text_scale.gbr/text_scale.fab.gbr b/tests/RTT/ref/text_scale.gbr/text_scale.fab.gbr
new file mode 100644
index 0000000..2f0d1e0
--- /dev/null
+++ b/tests/RTT/ref/text_scale.gbr/text_scale.fab.gbr
@@ -0,0 +1,1980 @@
+G04 start of page 3 for group -1 layer_idx -1 *
+G04 Title: text sizes (scales), TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD16C,0.0060*%
+%ADD15C,0.0100*%
+%ADD14C,0.0080*%
+%ADD13C,0.0001*%
+G54D13*G36*
+X0Y125000D02*Y117500D01*
+X3750D01*
+Y125000D01*
+X0D01*
+G37*
+G36*
+X4500D02*Y117500D01*
+X8250D01*
+Y125000D01*
+X4500D01*
+G37*
+G36*
+X9000D02*Y117500D01*
+X12750D01*
+Y125000D01*
+X9000D01*
+G37*
+G36*
+X13500D02*Y117500D01*
+X17250D01*
+Y125000D01*
+X13500D01*
+G37*
+G36*
+X18000D02*Y117500D01*
+X21750D01*
+Y125000D01*
+X18000D01*
+G37*
+G36*
+X22500D02*Y117500D01*
+X26250D01*
+Y125000D01*
+X22500D01*
+G37*
+G54D14*X0Y116500D03*
+G54D13*G36*
+X41000Y125000D02*Y117500D01*
+X44750D01*
+Y125000D01*
+X41000D01*
+G37*
+G36*
+X45500D02*Y117500D01*
+X49250D01*
+Y125000D01*
+X45500D01*
+G37*
+G36*
+X50000D02*Y117500D01*
+X53750D01*
+Y125000D01*
+X50000D01*
+G37*
+G36*
+X54500D02*Y117500D01*
+X58250D01*
+Y125000D01*
+X54500D01*
+G37*
+G36*
+X59000D02*Y117500D01*
+X62750D01*
+Y125000D01*
+X59000D01*
+G37*
+G36*
+X63500D02*Y117500D01*
+X67250D01*
+Y125000D01*
+X63500D01*
+G37*
+G36*
+X68000D02*Y117500D01*
+X71750D01*
+Y125000D01*
+X68000D01*
+G37*
+G36*
+X72500D02*Y117500D01*
+X76250D01*
+Y125000D01*
+X72500D01*
+G37*
+G36*
+X77000D02*Y117500D01*
+X80750D01*
+Y125000D01*
+X77000D01*
+G37*
+G36*
+X81500D02*Y117500D01*
+X85250D01*
+Y125000D01*
+X81500D01*
+G37*
+G36*
+X86000D02*Y117500D01*
+X89750D01*
+Y125000D01*
+X86000D01*
+G37*
+G36*
+X90500D02*Y117500D01*
+X94250D01*
+Y125000D01*
+X90500D01*
+G37*
+G54D14*X41000Y116500D03*
+G54D13*G36*
+X95000Y125000D02*Y117500D01*
+X98750D01*
+Y125000D01*
+X95000D01*
+G37*
+G36*
+X99500D02*Y117500D01*
+X103250D01*
+Y125000D01*
+X99500D01*
+G37*
+G36*
+X104000D02*Y117500D01*
+X107750D01*
+Y125000D01*
+X104000D01*
+G37*
+G36*
+X108500D02*Y117500D01*
+X112250D01*
+Y125000D01*
+X108500D01*
+G37*
+G36*
+X113000D02*Y117500D01*
+X116750D01*
+Y125000D01*
+X113000D01*
+G37*
+G54D14*X95000Y116500D03*
+G54D13*G36*
+X130000Y125000D02*Y117500D01*
+X133750D01*
+Y125000D01*
+X130000D01*
+G37*
+G36*
+X134500D02*Y117500D01*
+X138250D01*
+Y125000D01*
+X134500D01*
+G37*
+G36*
+X139000D02*Y117500D01*
+X142750D01*
+Y125000D01*
+X139000D01*
+G37*
+G36*
+X143500D02*Y117500D01*
+X147250D01*
+Y125000D01*
+X143500D01*
+G37*
+G36*
+X148000D02*Y117500D01*
+X151750D01*
+Y125000D01*
+X148000D01*
+G37*
+G36*
+X152500D02*Y117500D01*
+X156250D01*
+Y125000D01*
+X152500D01*
+G37*
+G36*
+X157000D02*Y117500D01*
+X160750D01*
+Y125000D01*
+X157000D01*
+G37*
+G54D14*X130000Y116500D03*
+G54D13*G36*
+X0Y140000D02*Y132500D01*
+X3750D01*
+Y140000D01*
+X0D01*
+G37*
+G36*
+X4500D02*Y132500D01*
+X8250D01*
+Y140000D01*
+X4500D01*
+G37*
+G36*
+X9000D02*Y132500D01*
+X12750D01*
+Y140000D01*
+X9000D01*
+G37*
+G36*
+X13500D02*Y132500D01*
+X17250D01*
+Y140000D01*
+X13500D01*
+G37*
+G36*
+X18000D02*Y132500D01*
+X21750D01*
+Y140000D01*
+X18000D01*
+G37*
+G36*
+X22500D02*Y132500D01*
+X26250D01*
+Y140000D01*
+X22500D01*
+G37*
+G36*
+X27000D02*Y132500D01*
+X30750D01*
+Y140000D01*
+X27000D01*
+G37*
+G36*
+X31500D02*Y132500D01*
+X35250D01*
+Y140000D01*
+X31500D01*
+G37*
+G36*
+X36000D02*Y132500D01*
+X39750D01*
+Y140000D01*
+X36000D01*
+G37*
+G36*
+X40500D02*Y132500D01*
+X44250D01*
+Y140000D01*
+X40500D01*
+G37*
+G36*
+X45000D02*Y132500D01*
+X48750D01*
+Y140000D01*
+X45000D01*
+G37*
+G36*
+X49500D02*Y132500D01*
+X53250D01*
+Y140000D01*
+X49500D01*
+G37*
+G36*
+X54000D02*Y132500D01*
+X57750D01*
+Y140000D01*
+X54000D01*
+G37*
+G36*
+X58500D02*Y132500D01*
+X62250D01*
+Y140000D01*
+X58500D01*
+G37*
+G36*
+X63000D02*Y132500D01*
+X66750D01*
+Y140000D01*
+X63000D01*
+G37*
+G36*
+X67500D02*Y132500D01*
+X71250D01*
+Y140000D01*
+X67500D01*
+G37*
+G36*
+X72000D02*Y132500D01*
+X75750D01*
+Y140000D01*
+X72000D01*
+G37*
+G36*
+X76500D02*Y132500D01*
+X80250D01*
+Y140000D01*
+X76500D01*
+G37*
+G36*
+X81000D02*Y132500D01*
+X84750D01*
+Y140000D01*
+X81000D01*
+G37*
+G36*
+X85500D02*Y132500D01*
+X89250D01*
+Y140000D01*
+X85500D01*
+G37*
+G36*
+X90000D02*Y132500D01*
+X93750D01*
+Y140000D01*
+X90000D01*
+G37*
+G36*
+X94500D02*Y132500D01*
+X98250D01*
+Y140000D01*
+X94500D01*
+G37*
+G36*
+X99000D02*Y132500D01*
+X102750D01*
+Y140000D01*
+X99000D01*
+G37*
+G36*
+X103500D02*Y132500D01*
+X107250D01*
+Y140000D01*
+X103500D01*
+G37*
+G36*
+X108000D02*Y132500D01*
+X111750D01*
+Y140000D01*
+X108000D01*
+G37*
+G36*
+X112500D02*Y132500D01*
+X116250D01*
+Y140000D01*
+X112500D01*
+G37*
+G36*
+X117000D02*Y132500D01*
+X120750D01*
+Y140000D01*
+X117000D01*
+G37*
+G36*
+X121500D02*Y132500D01*
+X125250D01*
+Y140000D01*
+X121500D01*
+G37*
+G36*
+X126000D02*Y132500D01*
+X129750D01*
+Y140000D01*
+X126000D01*
+G37*
+G36*
+X130500D02*Y132500D01*
+X134250D01*
+Y140000D01*
+X130500D01*
+G37*
+G36*
+X135000D02*Y132500D01*
+X138750D01*
+Y140000D01*
+X135000D01*
+G37*
+G36*
+X139500D02*Y132500D01*
+X143250D01*
+Y140000D01*
+X139500D01*
+G37*
+G36*
+X144000D02*Y132500D01*
+X147750D01*
+Y140000D01*
+X144000D01*
+G37*
+G36*
+X148500D02*Y132500D01*
+X152250D01*
+Y140000D01*
+X148500D01*
+G37*
+G36*
+X153000D02*Y132500D01*
+X156750D01*
+Y140000D01*
+X153000D01*
+G37*
+G36*
+X157500D02*Y132500D01*
+X161250D01*
+Y140000D01*
+X157500D01*
+G37*
+G36*
+X162000D02*Y132500D01*
+X165750D01*
+Y140000D01*
+X162000D01*
+G37*
+G36*
+X166500D02*Y132500D01*
+X170250D01*
+Y140000D01*
+X166500D01*
+G37*
+G36*
+X171000D02*Y132500D01*
+X174750D01*
+Y140000D01*
+X171000D01*
+G37*
+G36*
+X175500D02*Y132500D01*
+X179250D01*
+Y140000D01*
+X175500D01*
+G37*
+G36*
+X180000D02*Y132500D01*
+X183750D01*
+Y140000D01*
+X180000D01*
+G37*
+G36*
+X184500D02*Y132500D01*
+X188250D01*
+Y140000D01*
+X184500D01*
+G37*
+G36*
+X189000D02*Y132500D01*
+X192750D01*
+Y140000D01*
+X189000D01*
+G37*
+G36*
+X193500D02*Y132500D01*
+X197250D01*
+Y140000D01*
+X193500D01*
+G37*
+G36*
+X198000D02*Y132500D01*
+X201750D01*
+Y140000D01*
+X198000D01*
+G37*
+G36*
+X202500D02*Y132500D01*
+X206250D01*
+Y140000D01*
+X202500D01*
+G37*
+G36*
+X207000D02*Y132500D01*
+X210750D01*
+Y140000D01*
+X207000D01*
+G37*
+G36*
+X211500D02*Y132500D01*
+X215250D01*
+Y140000D01*
+X211500D01*
+G37*
+G36*
+X216000D02*Y132500D01*
+X219750D01*
+Y140000D01*
+X216000D01*
+G37*
+G36*
+X220500D02*Y132500D01*
+X224250D01*
+Y140000D01*
+X220500D01*
+G37*
+G36*
+X225000D02*Y132500D01*
+X228750D01*
+Y140000D01*
+X225000D01*
+G37*
+G36*
+X229500D02*Y132500D01*
+X233250D01*
+Y140000D01*
+X229500D01*
+G37*
+G36*
+X234000D02*Y132500D01*
+X237750D01*
+Y140000D01*
+X234000D01*
+G37*
+G36*
+X238500D02*Y132500D01*
+X242250D01*
+Y140000D01*
+X238500D01*
+G37*
+G36*
+X243000D02*Y132500D01*
+X246750D01*
+Y140000D01*
+X243000D01*
+G37*
+G36*
+X247500D02*Y132500D01*
+X251250D01*
+Y140000D01*
+X247500D01*
+G37*
+G36*
+X252000D02*Y132500D01*
+X255750D01*
+Y140000D01*
+X252000D01*
+G37*
+G36*
+X256500D02*Y132500D01*
+X260250D01*
+Y140000D01*
+X256500D01*
+G37*
+G36*
+X261000D02*Y132500D01*
+X264750D01*
+Y140000D01*
+X261000D01*
+G37*
+G36*
+X265500D02*Y132500D01*
+X269250D01*
+Y140000D01*
+X265500D01*
+G37*
+G36*
+X270000D02*Y132500D01*
+X273750D01*
+Y140000D01*
+X270000D01*
+G37*
+G36*
+X274500D02*Y132500D01*
+X278250D01*
+Y140000D01*
+X274500D01*
+G37*
+G36*
+X279000D02*Y132500D01*
+X282750D01*
+Y140000D01*
+X279000D01*
+G37*
+G36*
+X283500D02*Y132500D01*
+X287250D01*
+Y140000D01*
+X283500D01*
+G37*
+G36*
+X288000D02*Y132500D01*
+X291750D01*
+Y140000D01*
+X288000D01*
+G37*
+G36*
+X292500D02*Y132500D01*
+X296250D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297000D02*Y132500D01*
+X300750D01*
+Y140000D01*
+X297000D01*
+G37*
+G36*
+X301500D02*Y132500D01*
+X305250D01*
+Y140000D01*
+X301500D01*
+G37*
+G54D15*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D13*G36*
+X200000Y65000D02*Y57500D01*
+X203750D01*
+Y65000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y57500D01*
+X208250D01*
+Y65000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y57500D01*
+X212750D01*
+Y65000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y57500D01*
+X217250D01*
+Y65000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y57500D01*
+X221750D01*
+Y65000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y57500D01*
+X226250D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y57500D01*
+X230750D01*
+Y65000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y57500D01*
+X235250D01*
+Y65000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y57500D01*
+X239750D01*
+Y65000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y57500D01*
+X244250D01*
+Y65000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y57500D01*
+X248750D01*
+Y65000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y57500D01*
+X253250D01*
+Y65000D01*
+X249500D01*
+G37*
+G36*
+X254000D02*Y57500D01*
+X257750D01*
+Y65000D01*
+X254000D01*
+G37*
+G36*
+X258500D02*Y57500D01*
+X262250D01*
+Y65000D01*
+X258500D01*
+G37*
+G36*
+X263000D02*Y57500D01*
+X266750D01*
+Y65000D01*
+X263000D01*
+G37*
+G36*
+X267500D02*Y57500D01*
+X271250D01*
+Y65000D01*
+X267500D01*
+G37*
+G36*
+X272000D02*Y57500D01*
+X275750D01*
+Y65000D01*
+X272000D01*
+G37*
+G36*
+X276500D02*Y57500D01*
+X280250D01*
+Y65000D01*
+X276500D01*
+G37*
+G36*
+X281000D02*Y57500D01*
+X284750D01*
+Y65000D01*
+X281000D01*
+G37*
+G36*
+X285500D02*Y57500D01*
+X289250D01*
+Y65000D01*
+X285500D01*
+G37*
+G36*
+X290000D02*Y57500D01*
+X293750D01*
+Y65000D01*
+X290000D01*
+G37*
+G36*
+X294500D02*Y57500D01*
+X298250D01*
+Y65000D01*
+X294500D01*
+G37*
+G36*
+X299000D02*Y57500D01*
+X302750D01*
+Y65000D01*
+X299000D01*
+G37*
+G36*
+X303500D02*Y57500D01*
+X307250D01*
+Y65000D01*
+X303500D01*
+G37*
+G36*
+X308000D02*Y57500D01*
+X311750D01*
+Y65000D01*
+X308000D01*
+G37*
+G36*
+X312500D02*Y57500D01*
+X316250D01*
+Y65000D01*
+X312500D01*
+G37*
+G36*
+X317000D02*Y57500D01*
+X320750D01*
+Y65000D01*
+X317000D01*
+G37*
+G36*
+X321500D02*Y57500D01*
+X325250D01*
+Y65000D01*
+X321500D01*
+G37*
+G36*
+X326000D02*Y57500D01*
+X329750D01*
+Y65000D01*
+X326000D01*
+G37*
+G36*
+X330500D02*Y57500D01*
+X334250D01*
+Y65000D01*
+X330500D01*
+G37*
+G36*
+X335000D02*Y57500D01*
+X338750D01*
+Y65000D01*
+X335000D01*
+G37*
+G36*
+X339500D02*Y57500D01*
+X343250D01*
+Y65000D01*
+X339500D01*
+G37*
+G36*
+X344000D02*Y57500D01*
+X347750D01*
+Y65000D01*
+X344000D01*
+G37*
+G36*
+X348500D02*Y57500D01*
+X352250D01*
+Y65000D01*
+X348500D01*
+G37*
+G36*
+X353000D02*Y57500D01*
+X356750D01*
+Y65000D01*
+X353000D01*
+G37*
+G36*
+X357500D02*Y57500D01*
+X361250D01*
+Y65000D01*
+X357500D01*
+G37*
+G36*
+X362000D02*Y57500D01*
+X365750D01*
+Y65000D01*
+X362000D01*
+G37*
+G36*
+X366500D02*Y57500D01*
+X370250D01*
+Y65000D01*
+X366500D01*
+G37*
+G36*
+X371000D02*Y57500D01*
+X374750D01*
+Y65000D01*
+X371000D01*
+G37*
+G36*
+X375500D02*Y57500D01*
+X379250D01*
+Y65000D01*
+X375500D01*
+G37*
+G36*
+X380000D02*Y57500D01*
+X383750D01*
+Y65000D01*
+X380000D01*
+G37*
+G36*
+X384500D02*Y57500D01*
+X388250D01*
+Y65000D01*
+X384500D01*
+G37*
+G36*
+X389000D02*Y57500D01*
+X392750D01*
+Y65000D01*
+X389000D01*
+G37*
+G36*
+X393500D02*Y57500D01*
+X397250D01*
+Y65000D01*
+X393500D01*
+G37*
+G36*
+X398000D02*Y57500D01*
+X401750D01*
+Y65000D01*
+X398000D01*
+G37*
+G36*
+X402500D02*Y57500D01*
+X406250D01*
+Y65000D01*
+X402500D01*
+G37*
+G36*
+X407000D02*Y57500D01*
+X410750D01*
+Y65000D01*
+X407000D01*
+G37*
+G36*
+X411500D02*Y57500D01*
+X415250D01*
+Y65000D01*
+X411500D01*
+G37*
+G36*
+X416000D02*Y57500D01*
+X419750D01*
+Y65000D01*
+X416000D01*
+G37*
+G36*
+X420500D02*Y57500D01*
+X424250D01*
+Y65000D01*
+X420500D01*
+G37*
+G36*
+X425000D02*Y57500D01*
+X428750D01*
+Y65000D01*
+X425000D01*
+G37*
+G36*
+X429500D02*Y57500D01*
+X433250D01*
+Y65000D01*
+X429500D01*
+G37*
+G36*
+X434000D02*Y57500D01*
+X437750D01*
+Y65000D01*
+X434000D01*
+G37*
+G36*
+X438500D02*Y57500D01*
+X442250D01*
+Y65000D01*
+X438500D01*
+G37*
+G36*
+X443000D02*Y57500D01*
+X446750D01*
+Y65000D01*
+X443000D01*
+G37*
+G36*
+X447500D02*Y57500D01*
+X451250D01*
+Y65000D01*
+X447500D01*
+G37*
+G36*
+X452000D02*Y57500D01*
+X455750D01*
+Y65000D01*
+X452000D01*
+G37*
+G36*
+X456500D02*Y57500D01*
+X460250D01*
+Y65000D01*
+X456500D01*
+G37*
+G36*
+X461000D02*Y57500D01*
+X464750D01*
+Y65000D01*
+X461000D01*
+G37*
+G36*
+X465500D02*Y57500D01*
+X469250D01*
+Y65000D01*
+X465500D01*
+G37*
+G36*
+X470000D02*Y57500D01*
+X473750D01*
+Y65000D01*
+X470000D01*
+G37*
+G36*
+X474500D02*Y57500D01*
+X478250D01*
+Y65000D01*
+X474500D01*
+G37*
+G36*
+X25000Y-2000D02*Y-9500D01*
+X28750D01*
+Y-2000D01*
+X25000D01*
+G37*
+G36*
+X29500D02*Y-9500D01*
+X33250D01*
+Y-2000D01*
+X29500D01*
+G37*
+G36*
+X34000D02*Y-9500D01*
+X37750D01*
+Y-2000D01*
+X34000D01*
+G37*
+G36*
+X38500D02*Y-9500D01*
+X42250D01*
+Y-2000D01*
+X38500D01*
+G37*
+G36*
+X43000D02*Y-9500D01*
+X46750D01*
+Y-2000D01*
+X43000D01*
+G37*
+G36*
+X47500D02*Y-9500D01*
+X51250D01*
+Y-2000D01*
+X47500D01*
+G37*
+G36*
+X52000D02*Y-9500D01*
+X55750D01*
+Y-2000D01*
+X52000D01*
+G37*
+G36*
+X56500D02*Y-9500D01*
+X60250D01*
+Y-2000D01*
+X56500D01*
+G37*
+G36*
+X61000D02*Y-9500D01*
+X64750D01*
+Y-2000D01*
+X61000D01*
+G37*
+G36*
+X65500D02*Y-9500D01*
+X69250D01*
+Y-2000D01*
+X65500D01*
+G37*
+G36*
+X70000D02*Y-9500D01*
+X73750D01*
+Y-2000D01*
+X70000D01*
+G37*
+G36*
+X74500D02*Y-9500D01*
+X78250D01*
+Y-2000D01*
+X74500D01*
+G37*
+G36*
+X79000D02*Y-9500D01*
+X82750D01*
+Y-2000D01*
+X79000D01*
+G37*
+G36*
+X83500D02*Y-9500D01*
+X87250D01*
+Y-2000D01*
+X83500D01*
+G37*
+G36*
+X88000D02*Y-9500D01*
+X91750D01*
+Y-2000D01*
+X88000D01*
+G37*
+G36*
+X92500D02*Y-9500D01*
+X96250D01*
+Y-2000D01*
+X92500D01*
+G37*
+G36*
+X97000D02*Y-9500D01*
+X100750D01*
+Y-2000D01*
+X97000D01*
+G37*
+G36*
+X101500D02*Y-9500D01*
+X105250D01*
+Y-2000D01*
+X101500D01*
+G37*
+G36*
+X106000D02*Y-9500D01*
+X109750D01*
+Y-2000D01*
+X106000D01*
+G37*
+G36*
+X110500D02*Y-9500D01*
+X114250D01*
+Y-2000D01*
+X110500D01*
+G37*
+G36*
+X115000D02*Y-9500D01*
+X118750D01*
+Y-2000D01*
+X115000D01*
+G37*
+G36*
+X119500D02*Y-9500D01*
+X123250D01*
+Y-2000D01*
+X119500D01*
+G37*
+G36*
+X124000D02*Y-9500D01*
+X127750D01*
+Y-2000D01*
+X124000D01*
+G37*
+G36*
+X128500D02*Y-9500D01*
+X132250D01*
+Y-2000D01*
+X128500D01*
+G37*
+G36*
+X133000D02*Y-9500D01*
+X136750D01*
+Y-2000D01*
+X133000D01*
+G37*
+G36*
+X137500D02*Y-9500D01*
+X141250D01*
+Y-2000D01*
+X137500D01*
+G37*
+G36*
+X142000D02*Y-9500D01*
+X145750D01*
+Y-2000D01*
+X142000D01*
+G37*
+G36*
+X146500D02*Y-9500D01*
+X150250D01*
+Y-2000D01*
+X146500D01*
+G37*
+G36*
+X151000D02*Y-9500D01*
+X154750D01*
+Y-2000D01*
+X151000D01*
+G37*
+G36*
+X155500D02*Y-9500D01*
+X159250D01*
+Y-2000D01*
+X155500D01*
+G37*
+G36*
+X160000D02*Y-9500D01*
+X163750D01*
+Y-2000D01*
+X160000D01*
+G37*
+G36*
+X164500D02*Y-9500D01*
+X168250D01*
+Y-2000D01*
+X164500D01*
+G37*
+G36*
+X169000D02*Y-9500D01*
+X172750D01*
+Y-2000D01*
+X169000D01*
+G37*
+G36*
+X173500D02*Y-9500D01*
+X177250D01*
+Y-2000D01*
+X173500D01*
+G37*
+G36*
+X178000D02*Y-9500D01*
+X181750D01*
+Y-2000D01*
+X178000D01*
+G37*
+G36*
+X182500D02*Y-9500D01*
+X186250D01*
+Y-2000D01*
+X182500D01*
+G37*
+G36*
+X187000D02*Y-9500D01*
+X190750D01*
+Y-2000D01*
+X187000D01*
+G37*
+G36*
+X191500D02*Y-9500D01*
+X195250D01*
+Y-2000D01*
+X191500D01*
+G37*
+G36*
+X196000D02*Y-9500D01*
+X199750D01*
+Y-2000D01*
+X196000D01*
+G37*
+G36*
+X200500D02*Y-9500D01*
+X204250D01*
+Y-2000D01*
+X200500D01*
+G37*
+G36*
+X205000D02*Y-9500D01*
+X208750D01*
+Y-2000D01*
+X205000D01*
+G37*
+G36*
+X209500D02*Y-9500D01*
+X213250D01*
+Y-2000D01*
+X209500D01*
+G37*
+G36*
+X214000D02*Y-9500D01*
+X217750D01*
+Y-2000D01*
+X214000D01*
+G37*
+G36*
+X218500D02*Y-9500D01*
+X222250D01*
+Y-2000D01*
+X218500D01*
+G37*
+G36*
+X223000D02*Y-9500D01*
+X226750D01*
+Y-2000D01*
+X223000D01*
+G37*
+G36*
+X227500D02*Y-9500D01*
+X231250D01*
+Y-2000D01*
+X227500D01*
+G37*
+G36*
+X232000D02*Y-9500D01*
+X235750D01*
+Y-2000D01*
+X232000D01*
+G37*
+G36*
+X236500D02*Y-9500D01*
+X240250D01*
+Y-2000D01*
+X236500D01*
+G37*
+G36*
+X241000D02*Y-9500D01*
+X244750D01*
+Y-2000D01*
+X241000D01*
+G37*
+G36*
+X245500D02*Y-9500D01*
+X249250D01*
+Y-2000D01*
+X245500D01*
+G37*
+G36*
+X250000D02*Y-9500D01*
+X253750D01*
+Y-2000D01*
+X250000D01*
+G37*
+G36*
+X254500D02*Y-9500D01*
+X258250D01*
+Y-2000D01*
+X254500D01*
+G37*
+G36*
+X259000D02*Y-9500D01*
+X262750D01*
+Y-2000D01*
+X259000D01*
+G37*
+G36*
+X263500D02*Y-9500D01*
+X267250D01*
+Y-2000D01*
+X263500D01*
+G37*
+G36*
+X268000D02*Y-9500D01*
+X271750D01*
+Y-2000D01*
+X268000D01*
+G37*
+G36*
+X272500D02*Y-9500D01*
+X276250D01*
+Y-2000D01*
+X272500D01*
+G37*
+G36*
+X277000D02*Y-9500D01*
+X280750D01*
+Y-2000D01*
+X277000D01*
+G37*
+G36*
+X281500D02*Y-9500D01*
+X285250D01*
+Y-2000D01*
+X281500D01*
+G37*
+G36*
+X286000D02*Y-9500D01*
+X289750D01*
+Y-2000D01*
+X286000D01*
+G37*
+G36*
+X290500D02*Y-9500D01*
+X294250D01*
+Y-2000D01*
+X290500D01*
+G37*
+G36*
+X295000D02*Y-9500D01*
+X298750D01*
+Y-2000D01*
+X295000D01*
+G37*
+G36*
+X299500D02*Y-9500D01*
+X303250D01*
+Y-2000D01*
+X299500D01*
+G37*
+G36*
+X304000D02*Y-9500D01*
+X307750D01*
+Y-2000D01*
+X304000D01*
+G37*
+G36*
+X308500D02*Y-9500D01*
+X312250D01*
+Y-2000D01*
+X308500D01*
+G37*
+G36*
+X313000D02*Y-9500D01*
+X316750D01*
+Y-2000D01*
+X313000D01*
+G37*
+G36*
+X317500D02*Y-9500D01*
+X321250D01*
+Y-2000D01*
+X317500D01*
+G37*
+G36*
+X322000D02*Y-9500D01*
+X325750D01*
+Y-2000D01*
+X322000D01*
+G37*
+G36*
+X326500D02*Y-9500D01*
+X330250D01*
+Y-2000D01*
+X326500D01*
+G37*
+G36*
+X331000D02*Y-9500D01*
+X334750D01*
+Y-2000D01*
+X331000D01*
+G37*
+G36*
+X335500D02*Y-9500D01*
+X339250D01*
+Y-2000D01*
+X335500D01*
+G37*
+G36*
+X340000D02*Y-9500D01*
+X343750D01*
+Y-2000D01*
+X340000D01*
+G37*
+G36*
+X344500D02*Y-9500D01*
+X348250D01*
+Y-2000D01*
+X344500D01*
+G37*
+G36*
+X349000D02*Y-9500D01*
+X352750D01*
+Y-2000D01*
+X349000D01*
+G37*
+G36*
+X353500D02*Y-9500D01*
+X357250D01*
+Y-2000D01*
+X353500D01*
+G37*
+G36*
+X358000D02*Y-9500D01*
+X361750D01*
+Y-2000D01*
+X358000D01*
+G37*
+G36*
+X362500D02*Y-9500D01*
+X366250D01*
+Y-2000D01*
+X362500D01*
+G37*
+G36*
+X367000D02*Y-9500D01*
+X370750D01*
+Y-2000D01*
+X367000D01*
+G37*
+G36*
+X371500D02*Y-9500D01*
+X375250D01*
+Y-2000D01*
+X371500D01*
+G37*
+G36*
+X376000D02*Y-9500D01*
+X379750D01*
+Y-2000D01*
+X376000D01*
+G37*
+G36*
+X380500D02*Y-9500D01*
+X384250D01*
+Y-2000D01*
+X380500D01*
+G37*
+G36*
+X385000D02*Y-9500D01*
+X388750D01*
+Y-2000D01*
+X385000D01*
+G37*
+G36*
+X389500D02*Y-9500D01*
+X393250D01*
+Y-2000D01*
+X389500D01*
+G37*
+G36*
+X394000D02*Y-9500D01*
+X397750D01*
+Y-2000D01*
+X394000D01*
+G37*
+G36*
+X398500D02*Y-9500D01*
+X402250D01*
+Y-2000D01*
+X398500D01*
+G37*
+G36*
+X403000D02*Y-9500D01*
+X406750D01*
+Y-2000D01*
+X403000D01*
+G37*
+G36*
+X407500D02*Y-9500D01*
+X411251D01*
+Y-2000D01*
+X407500D01*
+G37*
+G36*
+X412001D02*Y-9500D01*
+X415751D01*
+Y-2000D01*
+X412001D01*
+G37*
+G36*
+X416501D02*Y-9500D01*
+X420251D01*
+Y-2000D01*
+X416501D01*
+G37*
+G36*
+X421001D02*Y-9500D01*
+X424751D01*
+Y-2000D01*
+X421001D01*
+G37*
+G36*
+X425501D02*Y-9500D01*
+X429251D01*
+Y-2000D01*
+X425501D01*
+G37*
+G36*
+X430001D02*Y-9500D01*
+X433751D01*
+Y-2000D01*
+X430001D01*
+G37*
+G36*
+X434501D02*Y-9500D01*
+X438251D01*
+Y-2000D01*
+X434501D01*
+G37*
+G36*
+X439001D02*Y-9500D01*
+X442751D01*
+Y-2000D01*
+X439001D01*
+G37*
+G36*
+X443501D02*Y-9500D01*
+X447251D01*
+Y-2000D01*
+X443501D01*
+G37*
+G36*
+X448001D02*Y-9500D01*
+X451751D01*
+Y-2000D01*
+X448001D01*
+G37*
+G36*
+X452501D02*Y-9500D01*
+X456251D01*
+Y-2000D01*
+X452501D01*
+G37*
+G36*
+X457001D02*Y-9500D01*
+X460751D01*
+Y-2000D01*
+X457001D01*
+G37*
+G36*
+X461501D02*Y-9500D01*
+X465251D01*
+Y-2000D01*
+X461501D01*
+G37*
+G36*
+X200000Y80000D02*Y72500D01*
+X203750D01*
+Y80000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y72500D01*
+X208250D01*
+Y80000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y72500D01*
+X212750D01*
+Y80000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y72500D01*
+X217250D01*
+Y80000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y72500D01*
+X221750D01*
+Y80000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y72500D01*
+X226250D01*
+Y80000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y72500D01*
+X230750D01*
+Y80000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y72500D01*
+X235250D01*
+Y80000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y72500D01*
+X239750D01*
+Y80000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y72500D01*
+X244250D01*
+Y80000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y72500D01*
+X248750D01*
+Y80000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y72500D01*
+X253250D01*
+Y80000D01*
+X249500D01*
+G37*
+G54D16*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y87500D01*
+X209300D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210050D02*Y87500D01*
+X213800D01*
+Y95000D01*
+X210050D01*
+G37*
+G36*
+X214550D02*Y87500D01*
+X218300D01*
+Y95000D01*
+X214550D01*
+G37*
+G36*
+X219050D02*Y87500D01*
+X222800D01*
+Y95000D01*
+X219050D01*
+G37*
+G36*
+X223550D02*Y87500D01*
+X227300D01*
+Y95000D01*
+X223550D01*
+G37*
+G36*
+X228050D02*Y87500D01*
+X231800D01*
+Y95000D01*
+X228050D01*
+G37*
+G36*
+X232550D02*Y87500D01*
+X236300D01*
+Y95000D01*
+X232550D01*
+G37*
+G36*
+X200000Y110000D02*Y102500D01*
+X203750D01*
+Y110000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y102500D01*
+X208250D01*
+Y110000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y102500D01*
+X212750D01*
+Y110000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y102500D01*
+X217250D01*
+Y110000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y102500D01*
+X221750D01*
+Y110000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y102500D01*
+X226250D01*
+Y110000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y102500D01*
+X230750D01*
+Y110000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y102500D01*
+X235250D01*
+Y110000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y102500D01*
+X239750D01*
+Y110000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y102500D01*
+X244250D01*
+Y110000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y102500D01*
+X248750D01*
+Y110000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y102500D01*
+X253250D01*
+Y110000D01*
+X249500D01*
+G37*
+G36*
+X254000D02*Y102500D01*
+X257750D01*
+Y110000D01*
+X254000D01*
+G37*
+G36*
+X258500D02*Y102500D01*
+X262250D01*
+Y110000D01*
+X258500D01*
+G37*
+G36*
+X263000D02*Y102500D01*
+X266750D01*
+Y110000D01*
+X263000D01*
+G37*
+G36*
+X267500D02*Y102500D01*
+X271250D01*
+Y110000D01*
+X267500D01*
+G37*
+G36*
+X272000D02*Y102500D01*
+X275750D01*
+Y110000D01*
+X272000D01*
+G37*
+G36*
+X276500D02*Y102500D01*
+X280250D01*
+Y110000D01*
+X276500D01*
+G37*
+G36*
+X281000D02*Y102500D01*
+X284750D01*
+Y110000D01*
+X281000D01*
+G37*
+G36*
+X285500D02*Y102500D01*
+X289250D01*
+Y110000D01*
+X285500D01*
+G37*
+G36*
+X290000D02*Y102500D01*
+X293750D01*
+Y110000D01*
+X290000D01*
+G37*
+G36*
+X294500D02*Y102500D01*
+X298250D01*
+Y110000D01*
+X294500D01*
+G37*
+G36*
+X299000D02*Y102500D01*
+X302750D01*
+Y110000D01*
+X299000D01*
+G37*
+G36*
+X303500D02*Y102500D01*
+X307250D01*
+Y110000D01*
+X303500D01*
+G37*
+G36*
+X308000D02*Y102500D01*
+X311750D01*
+Y110000D01*
+X308000D01*
+G37*
+G36*
+X312500D02*Y102500D01*
+X316250D01*
+Y110000D01*
+X312500D01*
+G37*
+G36*
+X317000D02*Y102500D01*
+X320750D01*
+Y110000D01*
+X317000D01*
+G37*
+G36*
+X321500D02*Y102500D01*
+X325250D01*
+Y110000D01*
+X321500D01*
+G37*
+G36*
+X326000D02*Y102500D01*
+X329750D01*
+Y110000D01*
+X326000D01*
+G37*
+G36*
+X330500D02*Y102500D01*
+X334250D01*
+Y110000D01*
+X330500D01*
+G37*
+G36*
+X335000D02*Y102500D01*
+X338750D01*
+Y110000D01*
+X335000D01*
+G37*
+G36*
+X339500D02*Y102500D01*
+X343250D01*
+Y110000D01*
+X339500D01*
+G37*
+G36*
+X344000D02*Y102500D01*
+X347750D01*
+Y110000D01*
+X344000D01*
+G37*
+G36*
+X348500D02*Y102500D01*
+X352250D01*
+Y110000D01*
+X348500D01*
+G37*
+G36*
+X353000D02*Y102500D01*
+X356750D01*
+Y110000D01*
+X353000D01*
+G37*
+G36*
+X357500D02*Y102500D01*
+X361250D01*
+Y110000D01*
+X357500D01*
+G37*
+G36*
+X362000D02*Y102500D01*
+X365750D01*
+Y110000D01*
+X362000D01*
+G37*
+G36*
+X366500D02*Y102500D01*
+X370250D01*
+Y110000D01*
+X366500D01*
+G37*
+G36*
+X371000D02*Y102500D01*
+X374750D01*
+Y110000D01*
+X371000D01*
+G37*
+G36*
+X375500D02*Y102500D01*
+X379250D01*
+Y110000D01*
+X375500D01*
+G37*
+G36*
+X380000D02*Y102500D01*
+X383750D01*
+Y110000D01*
+X380000D01*
+G37*
+G36*
+X384500D02*Y102500D01*
+X388250D01*
+Y110000D01*
+X384500D01*
+G37*
+G36*
+X389000D02*Y102500D01*
+X392750D01*
+Y110000D01*
+X389000D01*
+G37*
+G36*
+X393500D02*Y102500D01*
+X397250D01*
+Y110000D01*
+X393500D01*
+G37*
+G36*
+X398000D02*Y102500D01*
+X401750D01*
+Y110000D01*
+X398000D01*
+G37*
+G36*
+X402500D02*Y102500D01*
+X406250D01*
+Y110000D01*
+X402500D01*
+G37*
+G36*
+X407000D02*Y102500D01*
+X410750D01*
+Y110000D01*
+X407000D01*
+G37*
+G36*
+X411500D02*Y102500D01*
+X415250D01*
+Y110000D01*
+X411500D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/text_scale.gbr/text_scale.topsilk.gbr b/tests/RTT/ref/text_scale.gbr/text_scale.topsilk.gbr
new file mode 100644
index 0000000..783eee5
--- /dev/null
+++ b/tests/RTT/ref/text_scale.gbr/text_scale.topsilk.gbr
@@ -0,0 +1,52 @@
+G04 start of page 2 for group 0 layer_idx 8 *
+G04 Title: text sizes (scales), TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD12C,0.0128*%
+%ADD11C,0.0070*%
+G54D11*X5000Y46500D02*Y43500D01*
+Y46500D02*X5700Y47500D01*
+X6800D01*
+X7500Y46500D01*
+Y43500D01*
+X5000Y45500D02*X7500D01*
+X8700Y46700D02*X9500Y47500D01*
+Y43500D01*
+X8700D02*X10200D01*
+X5000Y29900D02*Y29600D01*
+Y29900D02*X5070Y30000D01*
+X5180D01*
+X5250Y29900D01*
+Y29600D01*
+X5000Y29800D02*X5250D01*
+X5370Y29950D02*X5420Y30000D01*
+X5570D01*
+X5620Y29950D01*
+Y29850D01*
+X5370Y29600D02*X5620Y29850D01*
+X5370Y29600D02*X5620D01*
+G54D12*X5000Y16800D02*Y7200D01*
+Y16800D02*X7240Y20000D01*
+X10760D01*
+X13000Y16800D01*
+Y7200D01*
+X5000Y13600D02*X13000D01*
+X16840Y18400D02*X18440Y20000D01*
+X21640D01*
+X23240Y18400D01*
+X21640Y7200D02*X23240Y8800D01*
+X18440Y7200D02*X21640D01*
+X16840Y8800D02*X18440Y7200D01*
+Y14240D02*X21640D01*
+X23240Y18400D02*Y15840D01*
+Y12640D02*Y8800D01*
+Y12640D02*X21640Y14240D01*
+X23240Y15840D02*X21640Y14240D01*
+M02*
diff --git a/tests/RTT/ref/text_scale.net b/tests/RTT/ref/text_scale.net
new file mode 100644
index 0000000..30a9d5b
--- /dev/null
+++ b/tests/RTT/ref/text_scale.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB text sizes (scales)
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/text_scale.png b/tests/RTT/ref/text_scale.png
new file mode 100644
index 0000000..7f8e38b
Binary files /dev/null and b/tests/RTT/ref/text_scale.png differ
diff --git a/tests/RTT/ref/text_scale.png.text b/tests/RTT/ref/text_scale.png.text
new file mode 100644
index 0000000..4e3d99e
--- /dev/null
+++ b/tests/RTT/ref/text_scale.png.text
@@ -0,0 +1,23 @@
+
+top text A1
+A line width 8 pixels
+A width 38 pixels
+A height 56 pixels
+1 line width 8 pixels
+1 width 26 pixels
+1 height 56 pixels
+
+gap from A to 1 is 7 pixels
+
+dot thing in the page
+13 pixels tall
+16 pixels wide
+
+bottom text A3
+A line width 15 pixels
+A width 111 pixels
+A height 173 pixels
+3 line width 15 pixels
+3 width 91 pixels
+3 height 169 pixels
+
diff --git a/tests/RTT/ref/text_scale.ps.gz b/tests/RTT/ref/text_scale.ps.gz
new file mode 100644
index 0000000..8045b28
Binary files /dev/null and b/tests/RTT/ref/text_scale.ps.gz differ
diff --git a/tests/RTT/ref/text_scale.remote.gz b/tests/RTT/ref/text_scale.remote.gz
new file mode 100644
index 0000000..eab86be
Binary files /dev/null and b/tests/RTT/ref/text_scale.remote.gz differ
diff --git a/tests/RTT/ref/text_scale.svg b/tests/RTT/ref/text_scale.svg
new file mode 100644
index 0000000..df07e76
--- /dev/null
+++ b/tests/RTT/ref/text_scale.svg
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="1.2700" y1="0.8890" x2="1.2700" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="0.8890" x2="1.4478" y2="0.6350" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.4478" y1="0.6350" x2="1.7272" y2="0.6350" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.7272" y1="0.6350" x2="1.9050" y2="0.8890" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.9050" y1="0.8890" x2="1.9050" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="1.1430" x2="1.9050" y2="1.1430" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.2098" y1="0.8382" x2="2.4130" y2="0.6350" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.4130" y1="0.6350" x2="2.4130" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.2098" y1="1.6510" x2="2.5908" y2="1.6510" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="5.1054" x2="1.2700" y2="5.1816" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="5.1054" x2="1.2878" y2="5.0800" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2878" y1="5.0800" x2="1.3157" y2="5.0800" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.3157" y1="5.0800" x2="1.3335" y2="5.1054" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.3335" y1="5.1054" x2="1.3335" y2="5.1816" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="5.1308" x2="1.3335" y2="5.1308" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.3640" y1="5.0927" x2="1.3767" y2="5.0800" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.3767" y1="5.0800" x2="1.4148" y2="5.0800" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.4148" y1="5.0800" x2="1.4275" y2="5.0927" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.4275" y1="5.0927" x2="1.4275" y2="5.1181" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.3640" y1="5.1816" x2="1.4275" y2="5.1181" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.3640" y1="5.1816" x2="1.4275" y2="5.1816" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="8.4328" x2="1.2700" y2="10.8712" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="8.4328" x2="1.8390" y2="7.6200" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.8390" y1="7.6200" x2="2.7330" y2="7.6200" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="2.7330" y1="7.6200" x2="3.3020" y2="8.4328" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="3.3020" y1="8.4328" x2="3.3020" y2="10.8712" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="1.2700" y1="9.2456" x2="3.3020" y2="9.2456" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.2774" y1="8.0264" x2="4.6838" y2="7.6200" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.6838" y1="7.6200" x2="5.4966" y2="7.6200" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.4966" y1="7.6200" x2="5.9030" y2="8.0264" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.4966" y1="10.8712" x2="5.9030" y2="10.4648" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.6838" y1="10.8712" x2="5.4966" y2="10.8712" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.2774" y1="10.4648" x2="4.6838" y2="10.8712" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="4.6838" y1="9.0830" x2="5.4966" y2="9.0830" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.9030" y1="8.0264" x2="5.9030" y2="8.6766" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.9030" y1="9.4894" x2="5.9030" y2="10.4648" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.9030" y1="9.4894" x2="5.4966" y2="9.0830" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.9030" y1="8.6766" x2="5.4966" y2="9.0830" stroke-width="0.3251" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/text_scale.xy b/tests/RTT/ref/text_scale.xy
new file mode 100644
index 0000000..979c3de
--- /dev/null
+++ b/tests/RTT/ref/text_scale.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: text sizes (scales) - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/text_sides.bom b/tests/RTT/ref/text_sides.bom
new file mode 100644
index 0000000..9f95232
--- /dev/null
+++ b/tests/RTT/ref/text_sides.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: text on both sides - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/text_sides.dsn b/tests/RTT/ref/text_sides.dsn
new file mode 100644
index 0000000..484c1a7
--- /dev/null
+++ b/tests/RTT/ref/text_sides.dsn
@@ -0,0 +1,57 @@
+(pcb text on both sides
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ )
+ (library
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/text_sides.gbr/text_sides.bottomsilk.gbr b/tests/RTT/ref/text_sides.gbr/text_sides.bottomsilk.gbr
new file mode 100644
index 0000000..0fea6f0
--- /dev/null
+++ b/tests/RTT/ref/text_sides.gbr/text_sides.bottomsilk.gbr
@@ -0,0 +1,25 @@
+G04 start of page 3 for group 1 layer_idx 7 *
+G04 Title: text on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOMSILK*%
+%ADD12C,0.0070*%
+G54D12*X22500Y21000D02*Y24000D01*
+Y21000D02*X23200Y20000D01*
+X24300D01*
+X25000Y21000D01*
+Y24000D01*
+X22500Y22000D02*X25000D01*
+X26200Y20500D02*X26700Y20000D01*
+X28200D01*
+X28700Y20500D01*
+Y21500D01*
+X26200Y24000D02*X28700Y21500D01*
+X26200Y24000D02*X28700D01*
+M02*
diff --git a/tests/RTT/ref/text_sides.gbr/text_sides.fab.gbr b/tests/RTT/ref/text_sides.gbr/text_sides.fab.gbr
new file mode 100644
index 0000000..6372d54
--- /dev/null
+++ b/tests/RTT/ref/text_sides.gbr/text_sides.fab.gbr
@@ -0,0 +1,1974 @@
+G04 start of page 4 for group -1 layer_idx -1 *
+G04 Title: text on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD16C,0.0060*%
+%ADD15C,0.0100*%
+%ADD14C,0.0080*%
+%ADD13C,0.0001*%
+G54D13*G36*
+X0Y125000D02*Y117500D01*
+X3750D01*
+Y125000D01*
+X0D01*
+G37*
+G36*
+X4500D02*Y117500D01*
+X8250D01*
+Y125000D01*
+X4500D01*
+G37*
+G36*
+X9000D02*Y117500D01*
+X12750D01*
+Y125000D01*
+X9000D01*
+G37*
+G36*
+X13500D02*Y117500D01*
+X17250D01*
+Y125000D01*
+X13500D01*
+G37*
+G36*
+X18000D02*Y117500D01*
+X21750D01*
+Y125000D01*
+X18000D01*
+G37*
+G36*
+X22500D02*Y117500D01*
+X26250D01*
+Y125000D01*
+X22500D01*
+G37*
+G54D14*X0Y116500D03*
+G54D13*G36*
+X41000Y125000D02*Y117500D01*
+X44750D01*
+Y125000D01*
+X41000D01*
+G37*
+G36*
+X45500D02*Y117500D01*
+X49250D01*
+Y125000D01*
+X45500D01*
+G37*
+G36*
+X50000D02*Y117500D01*
+X53750D01*
+Y125000D01*
+X50000D01*
+G37*
+G36*
+X54500D02*Y117500D01*
+X58250D01*
+Y125000D01*
+X54500D01*
+G37*
+G36*
+X59000D02*Y117500D01*
+X62750D01*
+Y125000D01*
+X59000D01*
+G37*
+G36*
+X63500D02*Y117500D01*
+X67250D01*
+Y125000D01*
+X63500D01*
+G37*
+G36*
+X68000D02*Y117500D01*
+X71750D01*
+Y125000D01*
+X68000D01*
+G37*
+G36*
+X72500D02*Y117500D01*
+X76250D01*
+Y125000D01*
+X72500D01*
+G37*
+G36*
+X77000D02*Y117500D01*
+X80750D01*
+Y125000D01*
+X77000D01*
+G37*
+G36*
+X81500D02*Y117500D01*
+X85250D01*
+Y125000D01*
+X81500D01*
+G37*
+G36*
+X86000D02*Y117500D01*
+X89750D01*
+Y125000D01*
+X86000D01*
+G37*
+G36*
+X90500D02*Y117500D01*
+X94250D01*
+Y125000D01*
+X90500D01*
+G37*
+G54D14*X41000Y116500D03*
+G54D13*G36*
+X95000Y125000D02*Y117500D01*
+X98750D01*
+Y125000D01*
+X95000D01*
+G37*
+G36*
+X99500D02*Y117500D01*
+X103250D01*
+Y125000D01*
+X99500D01*
+G37*
+G36*
+X104000D02*Y117500D01*
+X107750D01*
+Y125000D01*
+X104000D01*
+G37*
+G36*
+X108500D02*Y117500D01*
+X112250D01*
+Y125000D01*
+X108500D01*
+G37*
+G36*
+X113000D02*Y117500D01*
+X116750D01*
+Y125000D01*
+X113000D01*
+G37*
+G54D14*X95000Y116500D03*
+G54D13*G36*
+X130000Y125000D02*Y117500D01*
+X133750D01*
+Y125000D01*
+X130000D01*
+G37*
+G36*
+X134500D02*Y117500D01*
+X138250D01*
+Y125000D01*
+X134500D01*
+G37*
+G36*
+X139000D02*Y117500D01*
+X142750D01*
+Y125000D01*
+X139000D01*
+G37*
+G36*
+X143500D02*Y117500D01*
+X147250D01*
+Y125000D01*
+X143500D01*
+G37*
+G36*
+X148000D02*Y117500D01*
+X151750D01*
+Y125000D01*
+X148000D01*
+G37*
+G36*
+X152500D02*Y117500D01*
+X156250D01*
+Y125000D01*
+X152500D01*
+G37*
+G36*
+X157000D02*Y117500D01*
+X160750D01*
+Y125000D01*
+X157000D01*
+G37*
+G54D14*X130000Y116500D03*
+G54D13*G36*
+X0Y140000D02*Y132500D01*
+X3750D01*
+Y140000D01*
+X0D01*
+G37*
+G36*
+X4500D02*Y132500D01*
+X8250D01*
+Y140000D01*
+X4500D01*
+G37*
+G36*
+X9000D02*Y132500D01*
+X12750D01*
+Y140000D01*
+X9000D01*
+G37*
+G36*
+X13500D02*Y132500D01*
+X17250D01*
+Y140000D01*
+X13500D01*
+G37*
+G36*
+X18000D02*Y132500D01*
+X21750D01*
+Y140000D01*
+X18000D01*
+G37*
+G36*
+X22500D02*Y132500D01*
+X26250D01*
+Y140000D01*
+X22500D01*
+G37*
+G36*
+X27000D02*Y132500D01*
+X30750D01*
+Y140000D01*
+X27000D01*
+G37*
+G36*
+X31500D02*Y132500D01*
+X35250D01*
+Y140000D01*
+X31500D01*
+G37*
+G36*
+X36000D02*Y132500D01*
+X39750D01*
+Y140000D01*
+X36000D01*
+G37*
+G36*
+X40500D02*Y132500D01*
+X44250D01*
+Y140000D01*
+X40500D01*
+G37*
+G36*
+X45000D02*Y132500D01*
+X48750D01*
+Y140000D01*
+X45000D01*
+G37*
+G36*
+X49500D02*Y132500D01*
+X53250D01*
+Y140000D01*
+X49500D01*
+G37*
+G36*
+X54000D02*Y132500D01*
+X57750D01*
+Y140000D01*
+X54000D01*
+G37*
+G36*
+X58500D02*Y132500D01*
+X62250D01*
+Y140000D01*
+X58500D01*
+G37*
+G36*
+X63000D02*Y132500D01*
+X66750D01*
+Y140000D01*
+X63000D01*
+G37*
+G36*
+X67500D02*Y132500D01*
+X71250D01*
+Y140000D01*
+X67500D01*
+G37*
+G36*
+X72000D02*Y132500D01*
+X75750D01*
+Y140000D01*
+X72000D01*
+G37*
+G36*
+X76500D02*Y132500D01*
+X80250D01*
+Y140000D01*
+X76500D01*
+G37*
+G36*
+X81000D02*Y132500D01*
+X84750D01*
+Y140000D01*
+X81000D01*
+G37*
+G36*
+X85500D02*Y132500D01*
+X89250D01*
+Y140000D01*
+X85500D01*
+G37*
+G36*
+X90000D02*Y132500D01*
+X93750D01*
+Y140000D01*
+X90000D01*
+G37*
+G36*
+X94500D02*Y132500D01*
+X98250D01*
+Y140000D01*
+X94500D01*
+G37*
+G36*
+X99000D02*Y132500D01*
+X102750D01*
+Y140000D01*
+X99000D01*
+G37*
+G36*
+X103500D02*Y132500D01*
+X107250D01*
+Y140000D01*
+X103500D01*
+G37*
+G36*
+X108000D02*Y132500D01*
+X111750D01*
+Y140000D01*
+X108000D01*
+G37*
+G36*
+X112500D02*Y132500D01*
+X116250D01*
+Y140000D01*
+X112500D01*
+G37*
+G36*
+X117000D02*Y132500D01*
+X120750D01*
+Y140000D01*
+X117000D01*
+G37*
+G36*
+X121500D02*Y132500D01*
+X125250D01*
+Y140000D01*
+X121500D01*
+G37*
+G36*
+X126000D02*Y132500D01*
+X129750D01*
+Y140000D01*
+X126000D01*
+G37*
+G36*
+X130500D02*Y132500D01*
+X134250D01*
+Y140000D01*
+X130500D01*
+G37*
+G36*
+X135000D02*Y132500D01*
+X138750D01*
+Y140000D01*
+X135000D01*
+G37*
+G36*
+X139500D02*Y132500D01*
+X143250D01*
+Y140000D01*
+X139500D01*
+G37*
+G36*
+X144000D02*Y132500D01*
+X147750D01*
+Y140000D01*
+X144000D01*
+G37*
+G36*
+X148500D02*Y132500D01*
+X152250D01*
+Y140000D01*
+X148500D01*
+G37*
+G36*
+X153000D02*Y132500D01*
+X156750D01*
+Y140000D01*
+X153000D01*
+G37*
+G36*
+X157500D02*Y132500D01*
+X161250D01*
+Y140000D01*
+X157500D01*
+G37*
+G36*
+X162000D02*Y132500D01*
+X165750D01*
+Y140000D01*
+X162000D01*
+G37*
+G36*
+X166500D02*Y132500D01*
+X170250D01*
+Y140000D01*
+X166500D01*
+G37*
+G36*
+X171000D02*Y132500D01*
+X174750D01*
+Y140000D01*
+X171000D01*
+G37*
+G36*
+X175500D02*Y132500D01*
+X179250D01*
+Y140000D01*
+X175500D01*
+G37*
+G36*
+X180000D02*Y132500D01*
+X183750D01*
+Y140000D01*
+X180000D01*
+G37*
+G36*
+X184500D02*Y132500D01*
+X188250D01*
+Y140000D01*
+X184500D01*
+G37*
+G36*
+X189000D02*Y132500D01*
+X192750D01*
+Y140000D01*
+X189000D01*
+G37*
+G36*
+X193500D02*Y132500D01*
+X197250D01*
+Y140000D01*
+X193500D01*
+G37*
+G36*
+X198000D02*Y132500D01*
+X201750D01*
+Y140000D01*
+X198000D01*
+G37*
+G36*
+X202500D02*Y132500D01*
+X206250D01*
+Y140000D01*
+X202500D01*
+G37*
+G36*
+X207000D02*Y132500D01*
+X210750D01*
+Y140000D01*
+X207000D01*
+G37*
+G36*
+X211500D02*Y132500D01*
+X215250D01*
+Y140000D01*
+X211500D01*
+G37*
+G36*
+X216000D02*Y132500D01*
+X219750D01*
+Y140000D01*
+X216000D01*
+G37*
+G36*
+X220500D02*Y132500D01*
+X224250D01*
+Y140000D01*
+X220500D01*
+G37*
+G36*
+X225000D02*Y132500D01*
+X228750D01*
+Y140000D01*
+X225000D01*
+G37*
+G36*
+X229500D02*Y132500D01*
+X233250D01*
+Y140000D01*
+X229500D01*
+G37*
+G36*
+X234000D02*Y132500D01*
+X237750D01*
+Y140000D01*
+X234000D01*
+G37*
+G36*
+X238500D02*Y132500D01*
+X242250D01*
+Y140000D01*
+X238500D01*
+G37*
+G36*
+X243000D02*Y132500D01*
+X246750D01*
+Y140000D01*
+X243000D01*
+G37*
+G36*
+X247500D02*Y132500D01*
+X251250D01*
+Y140000D01*
+X247500D01*
+G37*
+G36*
+X252000D02*Y132500D01*
+X255750D01*
+Y140000D01*
+X252000D01*
+G37*
+G36*
+X256500D02*Y132500D01*
+X260250D01*
+Y140000D01*
+X256500D01*
+G37*
+G36*
+X261000D02*Y132500D01*
+X264750D01*
+Y140000D01*
+X261000D01*
+G37*
+G36*
+X265500D02*Y132500D01*
+X269250D01*
+Y140000D01*
+X265500D01*
+G37*
+G36*
+X270000D02*Y132500D01*
+X273750D01*
+Y140000D01*
+X270000D01*
+G37*
+G36*
+X274500D02*Y132500D01*
+X278250D01*
+Y140000D01*
+X274500D01*
+G37*
+G36*
+X279000D02*Y132500D01*
+X282750D01*
+Y140000D01*
+X279000D01*
+G37*
+G36*
+X283500D02*Y132500D01*
+X287250D01*
+Y140000D01*
+X283500D01*
+G37*
+G36*
+X288000D02*Y132500D01*
+X291750D01*
+Y140000D01*
+X288000D01*
+G37*
+G36*
+X292500D02*Y132500D01*
+X296250D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297000D02*Y132500D01*
+X300750D01*
+Y140000D01*
+X297000D01*
+G37*
+G36*
+X301500D02*Y132500D01*
+X305250D01*
+Y140000D01*
+X301500D01*
+G37*
+G54D15*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D13*G36*
+X200000Y65000D02*Y57500D01*
+X203750D01*
+Y65000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y57500D01*
+X208250D01*
+Y65000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y57500D01*
+X212750D01*
+Y65000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y57500D01*
+X217250D01*
+Y65000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y57500D01*
+X221750D01*
+Y65000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y57500D01*
+X226250D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y57500D01*
+X230750D01*
+Y65000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y57500D01*
+X235250D01*
+Y65000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y57500D01*
+X239750D01*
+Y65000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y57500D01*
+X244250D01*
+Y65000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y57500D01*
+X248750D01*
+Y65000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y57500D01*
+X253250D01*
+Y65000D01*
+X249500D01*
+G37*
+G36*
+X254000D02*Y57500D01*
+X257750D01*
+Y65000D01*
+X254000D01*
+G37*
+G36*
+X258500D02*Y57500D01*
+X262250D01*
+Y65000D01*
+X258500D01*
+G37*
+G36*
+X263000D02*Y57500D01*
+X266750D01*
+Y65000D01*
+X263000D01*
+G37*
+G36*
+X267500D02*Y57500D01*
+X271250D01*
+Y65000D01*
+X267500D01*
+G37*
+G36*
+X272000D02*Y57500D01*
+X275750D01*
+Y65000D01*
+X272000D01*
+G37*
+G36*
+X276500D02*Y57500D01*
+X280250D01*
+Y65000D01*
+X276500D01*
+G37*
+G36*
+X281000D02*Y57500D01*
+X284750D01*
+Y65000D01*
+X281000D01*
+G37*
+G36*
+X285500D02*Y57500D01*
+X289250D01*
+Y65000D01*
+X285500D01*
+G37*
+G36*
+X290000D02*Y57500D01*
+X293750D01*
+Y65000D01*
+X290000D01*
+G37*
+G36*
+X294500D02*Y57500D01*
+X298250D01*
+Y65000D01*
+X294500D01*
+G37*
+G36*
+X299000D02*Y57500D01*
+X302750D01*
+Y65000D01*
+X299000D01*
+G37*
+G36*
+X303500D02*Y57500D01*
+X307250D01*
+Y65000D01*
+X303500D01*
+G37*
+G36*
+X308000D02*Y57500D01*
+X311750D01*
+Y65000D01*
+X308000D01*
+G37*
+G36*
+X312500D02*Y57500D01*
+X316250D01*
+Y65000D01*
+X312500D01*
+G37*
+G36*
+X317000D02*Y57500D01*
+X320750D01*
+Y65000D01*
+X317000D01*
+G37*
+G36*
+X321500D02*Y57500D01*
+X325250D01*
+Y65000D01*
+X321500D01*
+G37*
+G36*
+X326000D02*Y57500D01*
+X329750D01*
+Y65000D01*
+X326000D01*
+G37*
+G36*
+X330500D02*Y57500D01*
+X334250D01*
+Y65000D01*
+X330500D01*
+G37*
+G36*
+X335000D02*Y57500D01*
+X338750D01*
+Y65000D01*
+X335000D01*
+G37*
+G36*
+X339500D02*Y57500D01*
+X343250D01*
+Y65000D01*
+X339500D01*
+G37*
+G36*
+X344000D02*Y57500D01*
+X347750D01*
+Y65000D01*
+X344000D01*
+G37*
+G36*
+X348500D02*Y57500D01*
+X352250D01*
+Y65000D01*
+X348500D01*
+G37*
+G36*
+X353000D02*Y57500D01*
+X356750D01*
+Y65000D01*
+X353000D01*
+G37*
+G36*
+X357500D02*Y57500D01*
+X361250D01*
+Y65000D01*
+X357500D01*
+G37*
+G36*
+X362000D02*Y57500D01*
+X365750D01*
+Y65000D01*
+X362000D01*
+G37*
+G36*
+X366500D02*Y57500D01*
+X370250D01*
+Y65000D01*
+X366500D01*
+G37*
+G36*
+X371000D02*Y57500D01*
+X374750D01*
+Y65000D01*
+X371000D01*
+G37*
+G36*
+X375500D02*Y57500D01*
+X379250D01*
+Y65000D01*
+X375500D01*
+G37*
+G36*
+X380000D02*Y57500D01*
+X383750D01*
+Y65000D01*
+X380000D01*
+G37*
+G36*
+X384500D02*Y57500D01*
+X388250D01*
+Y65000D01*
+X384500D01*
+G37*
+G36*
+X389000D02*Y57500D01*
+X392750D01*
+Y65000D01*
+X389000D01*
+G37*
+G36*
+X393500D02*Y57500D01*
+X397250D01*
+Y65000D01*
+X393500D01*
+G37*
+G36*
+X398000D02*Y57500D01*
+X401750D01*
+Y65000D01*
+X398000D01*
+G37*
+G36*
+X402500D02*Y57500D01*
+X406250D01*
+Y65000D01*
+X402500D01*
+G37*
+G36*
+X407000D02*Y57500D01*
+X410750D01*
+Y65000D01*
+X407000D01*
+G37*
+G36*
+X411500D02*Y57500D01*
+X415250D01*
+Y65000D01*
+X411500D01*
+G37*
+G36*
+X416000D02*Y57500D01*
+X419750D01*
+Y65000D01*
+X416000D01*
+G37*
+G36*
+X420500D02*Y57500D01*
+X424250D01*
+Y65000D01*
+X420500D01*
+G37*
+G36*
+X425000D02*Y57500D01*
+X428750D01*
+Y65000D01*
+X425000D01*
+G37*
+G36*
+X429500D02*Y57500D01*
+X433250D01*
+Y65000D01*
+X429500D01*
+G37*
+G36*
+X434000D02*Y57500D01*
+X437750D01*
+Y65000D01*
+X434000D01*
+G37*
+G36*
+X438500D02*Y57500D01*
+X442250D01*
+Y65000D01*
+X438500D01*
+G37*
+G36*
+X443000D02*Y57500D01*
+X446750D01*
+Y65000D01*
+X443000D01*
+G37*
+G36*
+X447500D02*Y57500D01*
+X451250D01*
+Y65000D01*
+X447500D01*
+G37*
+G36*
+X452000D02*Y57500D01*
+X455750D01*
+Y65000D01*
+X452000D01*
+G37*
+G36*
+X456500D02*Y57500D01*
+X460250D01*
+Y65000D01*
+X456500D01*
+G37*
+G36*
+X461000D02*Y57500D01*
+X464750D01*
+Y65000D01*
+X461000D01*
+G37*
+G36*
+X465500D02*Y57500D01*
+X469250D01*
+Y65000D01*
+X465500D01*
+G37*
+G36*
+X470000D02*Y57500D01*
+X473750D01*
+Y65000D01*
+X470000D01*
+G37*
+G36*
+X474500D02*Y57500D01*
+X478250D01*
+Y65000D01*
+X474500D01*
+G37*
+G36*
+X25000Y-2000D02*Y-9500D01*
+X28750D01*
+Y-2000D01*
+X25000D01*
+G37*
+G36*
+X29500D02*Y-9500D01*
+X33250D01*
+Y-2000D01*
+X29500D01*
+G37*
+G36*
+X34000D02*Y-9500D01*
+X37750D01*
+Y-2000D01*
+X34000D01*
+G37*
+G36*
+X38500D02*Y-9500D01*
+X42250D01*
+Y-2000D01*
+X38500D01*
+G37*
+G36*
+X43000D02*Y-9500D01*
+X46750D01*
+Y-2000D01*
+X43000D01*
+G37*
+G36*
+X47500D02*Y-9500D01*
+X51250D01*
+Y-2000D01*
+X47500D01*
+G37*
+G36*
+X52000D02*Y-9500D01*
+X55750D01*
+Y-2000D01*
+X52000D01*
+G37*
+G36*
+X56500D02*Y-9500D01*
+X60250D01*
+Y-2000D01*
+X56500D01*
+G37*
+G36*
+X61000D02*Y-9500D01*
+X64750D01*
+Y-2000D01*
+X61000D01*
+G37*
+G36*
+X65500D02*Y-9500D01*
+X69250D01*
+Y-2000D01*
+X65500D01*
+G37*
+G36*
+X70000D02*Y-9500D01*
+X73750D01*
+Y-2000D01*
+X70000D01*
+G37*
+G36*
+X74500D02*Y-9500D01*
+X78250D01*
+Y-2000D01*
+X74500D01*
+G37*
+G36*
+X79000D02*Y-9500D01*
+X82750D01*
+Y-2000D01*
+X79000D01*
+G37*
+G36*
+X83500D02*Y-9500D01*
+X87250D01*
+Y-2000D01*
+X83500D01*
+G37*
+G36*
+X88000D02*Y-9500D01*
+X91750D01*
+Y-2000D01*
+X88000D01*
+G37*
+G36*
+X92500D02*Y-9500D01*
+X96250D01*
+Y-2000D01*
+X92500D01*
+G37*
+G36*
+X97000D02*Y-9500D01*
+X100750D01*
+Y-2000D01*
+X97000D01*
+G37*
+G36*
+X101500D02*Y-9500D01*
+X105250D01*
+Y-2000D01*
+X101500D01*
+G37*
+G36*
+X106000D02*Y-9500D01*
+X109750D01*
+Y-2000D01*
+X106000D01*
+G37*
+G36*
+X110500D02*Y-9500D01*
+X114250D01*
+Y-2000D01*
+X110500D01*
+G37*
+G36*
+X115000D02*Y-9500D01*
+X118750D01*
+Y-2000D01*
+X115000D01*
+G37*
+G36*
+X119500D02*Y-9500D01*
+X123250D01*
+Y-2000D01*
+X119500D01*
+G37*
+G36*
+X124000D02*Y-9500D01*
+X127750D01*
+Y-2000D01*
+X124000D01*
+G37*
+G36*
+X128500D02*Y-9500D01*
+X132250D01*
+Y-2000D01*
+X128500D01*
+G37*
+G36*
+X133000D02*Y-9500D01*
+X136750D01*
+Y-2000D01*
+X133000D01*
+G37*
+G36*
+X137500D02*Y-9500D01*
+X141250D01*
+Y-2000D01*
+X137500D01*
+G37*
+G36*
+X142000D02*Y-9500D01*
+X145750D01*
+Y-2000D01*
+X142000D01*
+G37*
+G36*
+X146500D02*Y-9500D01*
+X150250D01*
+Y-2000D01*
+X146500D01*
+G37*
+G36*
+X151000D02*Y-9500D01*
+X154750D01*
+Y-2000D01*
+X151000D01*
+G37*
+G36*
+X155500D02*Y-9500D01*
+X159250D01*
+Y-2000D01*
+X155500D01*
+G37*
+G36*
+X160000D02*Y-9500D01*
+X163750D01*
+Y-2000D01*
+X160000D01*
+G37*
+G36*
+X164500D02*Y-9500D01*
+X168250D01*
+Y-2000D01*
+X164500D01*
+G37*
+G36*
+X169000D02*Y-9500D01*
+X172750D01*
+Y-2000D01*
+X169000D01*
+G37*
+G36*
+X173500D02*Y-9500D01*
+X177250D01*
+Y-2000D01*
+X173500D01*
+G37*
+G36*
+X178000D02*Y-9500D01*
+X181750D01*
+Y-2000D01*
+X178000D01*
+G37*
+G36*
+X182500D02*Y-9500D01*
+X186250D01*
+Y-2000D01*
+X182500D01*
+G37*
+G36*
+X187000D02*Y-9500D01*
+X190750D01*
+Y-2000D01*
+X187000D01*
+G37*
+G36*
+X191500D02*Y-9500D01*
+X195250D01*
+Y-2000D01*
+X191500D01*
+G37*
+G36*
+X196000D02*Y-9500D01*
+X199750D01*
+Y-2000D01*
+X196000D01*
+G37*
+G36*
+X200500D02*Y-9500D01*
+X204250D01*
+Y-2000D01*
+X200500D01*
+G37*
+G36*
+X205000D02*Y-9500D01*
+X208750D01*
+Y-2000D01*
+X205000D01*
+G37*
+G36*
+X209500D02*Y-9500D01*
+X213250D01*
+Y-2000D01*
+X209500D01*
+G37*
+G36*
+X214000D02*Y-9500D01*
+X217750D01*
+Y-2000D01*
+X214000D01*
+G37*
+G36*
+X218500D02*Y-9500D01*
+X222250D01*
+Y-2000D01*
+X218500D01*
+G37*
+G36*
+X223000D02*Y-9500D01*
+X226750D01*
+Y-2000D01*
+X223000D01*
+G37*
+G36*
+X227500D02*Y-9500D01*
+X231250D01*
+Y-2000D01*
+X227500D01*
+G37*
+G36*
+X232000D02*Y-9500D01*
+X235750D01*
+Y-2000D01*
+X232000D01*
+G37*
+G36*
+X236500D02*Y-9500D01*
+X240250D01*
+Y-2000D01*
+X236500D01*
+G37*
+G36*
+X241000D02*Y-9500D01*
+X244750D01*
+Y-2000D01*
+X241000D01*
+G37*
+G36*
+X245500D02*Y-9500D01*
+X249250D01*
+Y-2000D01*
+X245500D01*
+G37*
+G36*
+X250000D02*Y-9500D01*
+X253750D01*
+Y-2000D01*
+X250000D01*
+G37*
+G36*
+X254500D02*Y-9500D01*
+X258250D01*
+Y-2000D01*
+X254500D01*
+G37*
+G36*
+X259000D02*Y-9500D01*
+X262750D01*
+Y-2000D01*
+X259000D01*
+G37*
+G36*
+X263500D02*Y-9500D01*
+X267250D01*
+Y-2000D01*
+X263500D01*
+G37*
+G36*
+X268000D02*Y-9500D01*
+X271750D01*
+Y-2000D01*
+X268000D01*
+G37*
+G36*
+X272500D02*Y-9500D01*
+X276250D01*
+Y-2000D01*
+X272500D01*
+G37*
+G36*
+X277000D02*Y-9500D01*
+X280750D01*
+Y-2000D01*
+X277000D01*
+G37*
+G36*
+X281500D02*Y-9500D01*
+X285250D01*
+Y-2000D01*
+X281500D01*
+G37*
+G36*
+X286000D02*Y-9500D01*
+X289750D01*
+Y-2000D01*
+X286000D01*
+G37*
+G36*
+X290500D02*Y-9500D01*
+X294250D01*
+Y-2000D01*
+X290500D01*
+G37*
+G36*
+X295000D02*Y-9500D01*
+X298750D01*
+Y-2000D01*
+X295000D01*
+G37*
+G36*
+X299500D02*Y-9500D01*
+X303250D01*
+Y-2000D01*
+X299500D01*
+G37*
+G36*
+X304000D02*Y-9500D01*
+X307750D01*
+Y-2000D01*
+X304000D01*
+G37*
+G36*
+X308500D02*Y-9500D01*
+X312250D01*
+Y-2000D01*
+X308500D01*
+G37*
+G36*
+X313000D02*Y-9500D01*
+X316750D01*
+Y-2000D01*
+X313000D01*
+G37*
+G36*
+X317500D02*Y-9500D01*
+X321250D01*
+Y-2000D01*
+X317500D01*
+G37*
+G36*
+X322000D02*Y-9500D01*
+X325750D01*
+Y-2000D01*
+X322000D01*
+G37*
+G36*
+X326500D02*Y-9500D01*
+X330250D01*
+Y-2000D01*
+X326500D01*
+G37*
+G36*
+X331000D02*Y-9500D01*
+X334750D01*
+Y-2000D01*
+X331000D01*
+G37*
+G36*
+X335500D02*Y-9500D01*
+X339250D01*
+Y-2000D01*
+X335500D01*
+G37*
+G36*
+X340000D02*Y-9500D01*
+X343750D01*
+Y-2000D01*
+X340000D01*
+G37*
+G36*
+X344500D02*Y-9500D01*
+X348250D01*
+Y-2000D01*
+X344500D01*
+G37*
+G36*
+X349000D02*Y-9500D01*
+X352750D01*
+Y-2000D01*
+X349000D01*
+G37*
+G36*
+X353500D02*Y-9500D01*
+X357250D01*
+Y-2000D01*
+X353500D01*
+G37*
+G36*
+X358000D02*Y-9500D01*
+X361750D01*
+Y-2000D01*
+X358000D01*
+G37*
+G36*
+X362500D02*Y-9500D01*
+X366250D01*
+Y-2000D01*
+X362500D01*
+G37*
+G36*
+X367000D02*Y-9500D01*
+X370750D01*
+Y-2000D01*
+X367000D01*
+G37*
+G36*
+X371500D02*Y-9500D01*
+X375250D01*
+Y-2000D01*
+X371500D01*
+G37*
+G36*
+X376000D02*Y-9500D01*
+X379750D01*
+Y-2000D01*
+X376000D01*
+G37*
+G36*
+X380500D02*Y-9500D01*
+X384250D01*
+Y-2000D01*
+X380500D01*
+G37*
+G36*
+X385000D02*Y-9500D01*
+X388750D01*
+Y-2000D01*
+X385000D01*
+G37*
+G36*
+X389500D02*Y-9500D01*
+X393250D01*
+Y-2000D01*
+X389500D01*
+G37*
+G36*
+X394000D02*Y-9500D01*
+X397750D01*
+Y-2000D01*
+X394000D01*
+G37*
+G36*
+X398500D02*Y-9500D01*
+X402250D01*
+Y-2000D01*
+X398500D01*
+G37*
+G36*
+X403000D02*Y-9500D01*
+X406750D01*
+Y-2000D01*
+X403000D01*
+G37*
+G36*
+X407500D02*Y-9500D01*
+X411251D01*
+Y-2000D01*
+X407500D01*
+G37*
+G36*
+X412001D02*Y-9500D01*
+X415751D01*
+Y-2000D01*
+X412001D01*
+G37*
+G36*
+X416501D02*Y-9500D01*
+X420251D01*
+Y-2000D01*
+X416501D01*
+G37*
+G36*
+X421001D02*Y-9500D01*
+X424751D01*
+Y-2000D01*
+X421001D01*
+G37*
+G36*
+X425501D02*Y-9500D01*
+X429251D01*
+Y-2000D01*
+X425501D01*
+G37*
+G36*
+X430001D02*Y-9500D01*
+X433751D01*
+Y-2000D01*
+X430001D01*
+G37*
+G36*
+X434501D02*Y-9500D01*
+X438251D01*
+Y-2000D01*
+X434501D01*
+G37*
+G36*
+X439001D02*Y-9500D01*
+X442751D01*
+Y-2000D01*
+X439001D01*
+G37*
+G36*
+X443501D02*Y-9500D01*
+X447251D01*
+Y-2000D01*
+X443501D01*
+G37*
+G36*
+X448001D02*Y-9500D01*
+X451751D01*
+Y-2000D01*
+X448001D01*
+G37*
+G36*
+X452501D02*Y-9500D01*
+X456251D01*
+Y-2000D01*
+X452501D01*
+G37*
+G36*
+X457001D02*Y-9500D01*
+X460751D01*
+Y-2000D01*
+X457001D01*
+G37*
+G36*
+X461501D02*Y-9500D01*
+X465251D01*
+Y-2000D01*
+X461501D01*
+G37*
+G36*
+X200000Y80000D02*Y72500D01*
+X203750D01*
+Y80000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y72500D01*
+X208250D01*
+Y80000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y72500D01*
+X212750D01*
+Y80000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y72500D01*
+X217250D01*
+Y80000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y72500D01*
+X221750D01*
+Y80000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y72500D01*
+X226250D01*
+Y80000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y72500D01*
+X230750D01*
+Y80000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y72500D01*
+X235250D01*
+Y80000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y72500D01*
+X239750D01*
+Y80000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y72500D01*
+X244250D01*
+Y80000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y72500D01*
+X248750D01*
+Y80000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y72500D01*
+X253250D01*
+Y80000D01*
+X249500D01*
+G37*
+G54D16*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D13*G36*
+X205550Y95000D02*Y87500D01*
+X209300D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210050D02*Y87500D01*
+X213800D01*
+Y95000D01*
+X210050D01*
+G37*
+G36*
+X214550D02*Y87500D01*
+X218300D01*
+Y95000D01*
+X214550D01*
+G37*
+G36*
+X219050D02*Y87500D01*
+X222800D01*
+Y95000D01*
+X219050D01*
+G37*
+G36*
+X223550D02*Y87500D01*
+X227300D01*
+Y95000D01*
+X223550D01*
+G37*
+G36*
+X228050D02*Y87500D01*
+X231800D01*
+Y95000D01*
+X228050D01*
+G37*
+G36*
+X232550D02*Y87500D01*
+X236300D01*
+Y95000D01*
+X232550D01*
+G37*
+G36*
+X200000Y110000D02*Y102500D01*
+X203750D01*
+Y110000D01*
+X200000D01*
+G37*
+G36*
+X204500D02*Y102500D01*
+X208250D01*
+Y110000D01*
+X204500D01*
+G37*
+G36*
+X209000D02*Y102500D01*
+X212750D01*
+Y110000D01*
+X209000D01*
+G37*
+G36*
+X213500D02*Y102500D01*
+X217250D01*
+Y110000D01*
+X213500D01*
+G37*
+G36*
+X218000D02*Y102500D01*
+X221750D01*
+Y110000D01*
+X218000D01*
+G37*
+G36*
+X222500D02*Y102500D01*
+X226250D01*
+Y110000D01*
+X222500D01*
+G37*
+G36*
+X227000D02*Y102500D01*
+X230750D01*
+Y110000D01*
+X227000D01*
+G37*
+G36*
+X231500D02*Y102500D01*
+X235250D01*
+Y110000D01*
+X231500D01*
+G37*
+G36*
+X236000D02*Y102500D01*
+X239750D01*
+Y110000D01*
+X236000D01*
+G37*
+G36*
+X240500D02*Y102500D01*
+X244250D01*
+Y110000D01*
+X240500D01*
+G37*
+G36*
+X245000D02*Y102500D01*
+X248750D01*
+Y110000D01*
+X245000D01*
+G37*
+G36*
+X249500D02*Y102500D01*
+X253250D01*
+Y110000D01*
+X249500D01*
+G37*
+G36*
+X254000D02*Y102500D01*
+X257750D01*
+Y110000D01*
+X254000D01*
+G37*
+G36*
+X258500D02*Y102500D01*
+X262250D01*
+Y110000D01*
+X258500D01*
+G37*
+G36*
+X263000D02*Y102500D01*
+X266750D01*
+Y110000D01*
+X263000D01*
+G37*
+G36*
+X267500D02*Y102500D01*
+X271250D01*
+Y110000D01*
+X267500D01*
+G37*
+G36*
+X272000D02*Y102500D01*
+X275750D01*
+Y110000D01*
+X272000D01*
+G37*
+G36*
+X276500D02*Y102500D01*
+X280250D01*
+Y110000D01*
+X276500D01*
+G37*
+G36*
+X281000D02*Y102500D01*
+X284750D01*
+Y110000D01*
+X281000D01*
+G37*
+G36*
+X285500D02*Y102500D01*
+X289250D01*
+Y110000D01*
+X285500D01*
+G37*
+G36*
+X290000D02*Y102500D01*
+X293750D01*
+Y110000D01*
+X290000D01*
+G37*
+G36*
+X294500D02*Y102500D01*
+X298250D01*
+Y110000D01*
+X294500D01*
+G37*
+G36*
+X299000D02*Y102500D01*
+X302750D01*
+Y110000D01*
+X299000D01*
+G37*
+G36*
+X303500D02*Y102500D01*
+X307250D01*
+Y110000D01*
+X303500D01*
+G37*
+G36*
+X308000D02*Y102500D01*
+X311750D01*
+Y110000D01*
+X308000D01*
+G37*
+G36*
+X312500D02*Y102500D01*
+X316250D01*
+Y110000D01*
+X312500D01*
+G37*
+G36*
+X317000D02*Y102500D01*
+X320750D01*
+Y110000D01*
+X317000D01*
+G37*
+G36*
+X321500D02*Y102500D01*
+X325250D01*
+Y110000D01*
+X321500D01*
+G37*
+G36*
+X326000D02*Y102500D01*
+X329750D01*
+Y110000D01*
+X326000D01*
+G37*
+G36*
+X330500D02*Y102500D01*
+X334250D01*
+Y110000D01*
+X330500D01*
+G37*
+G36*
+X335000D02*Y102500D01*
+X338750D01*
+Y110000D01*
+X335000D01*
+G37*
+G36*
+X339500D02*Y102500D01*
+X343250D01*
+Y110000D01*
+X339500D01*
+G37*
+G36*
+X344000D02*Y102500D01*
+X347750D01*
+Y110000D01*
+X344000D01*
+G37*
+G36*
+X348500D02*Y102500D01*
+X352250D01*
+Y110000D01*
+X348500D01*
+G37*
+G36*
+X353000D02*Y102500D01*
+X356750D01*
+Y110000D01*
+X353000D01*
+G37*
+G36*
+X357500D02*Y102500D01*
+X361250D01*
+Y110000D01*
+X357500D01*
+G37*
+G36*
+X362000D02*Y102500D01*
+X365750D01*
+Y110000D01*
+X362000D01*
+G37*
+G36*
+X366500D02*Y102500D01*
+X370250D01*
+Y110000D01*
+X366500D01*
+G37*
+G36*
+X371000D02*Y102500D01*
+X374750D01*
+Y110000D01*
+X371000D01*
+G37*
+G36*
+X375500D02*Y102500D01*
+X379250D01*
+Y110000D01*
+X375500D01*
+G37*
+G36*
+X380000D02*Y102500D01*
+X383750D01*
+Y110000D01*
+X380000D01*
+G37*
+G36*
+X384500D02*Y102500D01*
+X388250D01*
+Y110000D01*
+X384500D01*
+G37*
+G36*
+X389000D02*Y102500D01*
+X392750D01*
+Y110000D01*
+X389000D01*
+G37*
+G36*
+X393500D02*Y102500D01*
+X397250D01*
+Y110000D01*
+X393500D01*
+G37*
+G36*
+X398000D02*Y102500D01*
+X401750D01*
+Y110000D01*
+X398000D01*
+G37*
+G36*
+X402500D02*Y102500D01*
+X406250D01*
+Y110000D01*
+X402500D01*
+G37*
+G36*
+X407000D02*Y102500D01*
+X410750D01*
+Y110000D01*
+X407000D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/text_sides.gbr/text_sides.topsilk.gbr b/tests/RTT/ref/text_sides.gbr/text_sides.topsilk.gbr
new file mode 100644
index 0000000..2f4d9c2
--- /dev/null
+++ b/tests/RTT/ref/text_sides.gbr/text_sides.topsilk.gbr
@@ -0,0 +1,22 @@
+G04 start of page 2 for group 0 layer_idx 8 *
+G04 Title: text on both sides, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOPSILK*%
+%ADD11C,0.0070*%
+G54D11*X22500Y31500D02*Y28500D01*
+Y31500D02*X23200Y32500D01*
+X24300D01*
+X25000Y31500D01*
+Y28500D01*
+X22500Y30500D02*X25000D01*
+X26200Y31700D02*X27000Y32500D01*
+Y28500D01*
+X26200D02*X27700D01*
+M02*
diff --git a/tests/RTT/ref/text_sides.net b/tests/RTT/ref/text_sides.net
new file mode 100644
index 0000000..cfe0653
--- /dev/null
+++ b/tests/RTT/ref/text_sides.net
@@ -0,0 +1,12 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB text on both sides
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+999
diff --git a/tests/RTT/ref/text_sides.png b/tests/RTT/ref/text_sides.png
new file mode 100644
index 0000000..3d8dbef
Binary files /dev/null and b/tests/RTT/ref/text_sides.png differ
diff --git a/tests/RTT/ref/text_sides.ps.gz b/tests/RTT/ref/text_sides.ps.gz
new file mode 100644
index 0000000..2e4b300
Binary files /dev/null and b/tests/RTT/ref/text_sides.ps.gz differ
diff --git a/tests/RTT/ref/text_sides.remote.gz b/tests/RTT/ref/text_sides.remote.gz
new file mode 100644
index 0000000..f013a5c
Binary files /dev/null and b/tests/RTT/ref/text_sides.remote.gz differ
diff --git a/tests/RTT/ref/text_sides.svg b/tests/RTT/ref/text_sides.svg
new file mode 100644
index 0000000..49f2538
--- /dev/null
+++ b/tests/RTT/ref/text_sides.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+</g>
+<g id="layer_2_copper">
+</g>
+<g id="layer_1_copper">
+</g>
+<g id="layer_0_copper">
+</g>
+<g id="layer_-4079_topsilk">
+<!--normal-->
+ <line x1="5.7150" y1="4.6990" x2="5.7150" y2="5.4610" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7150" y1="4.6990" x2="5.8928" y2="4.4450" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.8928" y1="4.4450" x2="6.1722" y2="4.4450" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.1722" y1="4.4450" x2="6.3500" y2="4.6990" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.3500" y1="4.6990" x2="6.3500" y2="5.4610" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="5.7150" y1="4.9530" x2="6.3500" y2="4.9530" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.6548" y1="4.6482" x2="6.8580" y2="4.4450" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.8580" y1="4.4450" x2="6.8580" y2="5.4610" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+ <line x1="6.6548" y1="5.4610" x2="7.0358" y2="5.4610" stroke-width="0.1778" stroke="#000000" stroke-linecap="round"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/text_sides.xy b/tests/RTT/ref/text_sides.xy
new file mode 100644
index 0000000..5556bde
--- /dev/null
+++ b/tests/RTT/ref/text_sides.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: text on both sides - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/thermal_last.bom b/tests/RTT/ref/thermal_last.bom
new file mode 100644
index 0000000..08a41e3
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/thermal_last.dsn b/tests/RTT/ref/thermal_last.dsn
new file mode 100644
index 0000000..2cd40da
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.dsn
@@ -0,0 +1,67 @@
+(pcb thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 5
+ (place 5 2.540000 10.160000 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 5
+ (pin Th_round_3015995 1 0 0)
+ )
+ (padstack Th_round_3015995
+ (shape (circle signal 3.015995))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/thermal_last.gbr/thermal_last.fab.gbr b/tests/RTT/ref/thermal_last.gbr/thermal_last.fab.gbr
new file mode 100644
index 0000000..a26ae2c
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.gbr/thermal_last.fab.gbr
@@ -0,0 +1,2136 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD21C,0.0100*%
+%ADD20C,0.0075*%
+%ADD19C,0.0060*%
+%ADD18C,0.0080*%
+G54D18*X10000Y40000D02*Y38400D01*
+Y40000D02*X11387Y40800D01*
+X10000Y40000D02*X8613Y40800D01*
+X15000Y106250D02*Y104650D01*
+Y106250D02*X16387Y107050D01*
+X15000Y106250D02*X13613Y107050D01*
+G54D19*X135000Y108500D02*X136500Y105500D01*
+X138000Y108500D01*
+X136500Y105500D02*Y102500D01*
+X139800Y105800D02*X142050D01*
+X139800Y102500D02*X142800D01*
+X139800Y108500D02*Y102500D01*
+Y108500D02*X142800D01*
+X147600D02*X148350Y107750D01*
+X145350Y108500D02*X147600D01*
+X144600Y107750D02*X145350Y108500D01*
+X144600Y107750D02*Y106250D01*
+X145350Y105500D01*
+X147600D01*
+X148350Y104750D01*
+Y103250D01*
+X147600Y102500D02*X148350Y103250D01*
+X145350Y102500D02*X147600D01*
+X144600Y103250D02*X145350Y102500D01*
+X98000Y107300D02*X99200Y108500D01*
+Y102500D01*
+X98000D02*X100250D01*
+X45000Y103250D02*X45750Y102500D01*
+X45000Y107750D02*Y103250D01*
+Y107750D02*X45750Y108500D01*
+X47250D01*
+X48000Y107750D01*
+Y103250D01*
+X47250Y102500D02*X48000Y103250D01*
+X45750Y102500D02*X47250D01*
+X45000Y104000D02*X48000Y107000D01*
+X49800Y102500D02*X50550D01*
+X52350Y103250D02*X53100Y102500D01*
+X52350Y107750D02*Y103250D01*
+Y107750D02*X53100Y108500D01*
+X54600D01*
+X55350Y107750D01*
+Y103250D01*
+X54600Y102500D02*X55350Y103250D01*
+X53100Y102500D02*X54600D01*
+X52350Y104000D02*X55350Y107000D01*
+X57150Y107750D02*X57900Y108500D01*
+X59400D01*
+X60150Y107750D01*
+X59400Y102500D02*X60150Y103250D01*
+X57900Y102500D02*X59400D01*
+X57150Y103250D02*X57900Y102500D01*
+Y105800D02*X59400D01*
+X60150Y107750D02*Y106550D01*
+Y105050D02*Y103250D01*
+Y105050D02*X59400Y105800D01*
+X60150Y106550D02*X59400Y105800D01*
+X61950Y107750D02*X62700Y108500D01*
+X64950D01*
+X65700Y107750D01*
+Y106250D01*
+X61950Y102500D02*X65700Y106250D01*
+X61950Y102500D02*X65700D01*
+X3000Y123500D02*X3750Y122750D01*
+X750Y123500D02*X3000D01*
+X0Y122750D02*X750Y123500D01*
+X0Y122750D02*Y121250D01*
+X750Y120500D01*
+X3000D01*
+X3750Y119750D01*
+Y118250D01*
+X3000Y117500D02*X3750Y118250D01*
+X750Y117500D02*X3000D01*
+X0Y118250D02*X750Y117500D01*
+X5550Y120500D02*Y118250D01*
+X6300Y117500D01*
+X8550Y120500D02*Y116000D01*
+X7800Y115250D02*X8550Y116000D01*
+X6300Y115250D02*X7800D01*
+X5550Y116000D02*X6300Y115250D01*
+Y117500D02*X7800D01*
+X8550Y118250D01*
+X11100Y119750D02*Y117500D01*
+Y119750D02*X11850Y120500D01*
+X12600D01*
+X13350Y119750D01*
+Y117500D01*
+Y119750D02*X14100Y120500D01*
+X14850D01*
+X15600Y119750D01*
+Y117500D01*
+X10350Y120500D02*X11100Y119750D01*
+X17400Y123500D02*Y117500D01*
+Y118250D02*X18150Y117500D01*
+X19650D01*
+X20400Y118250D01*
+Y119750D02*Y118250D01*
+X19650Y120500D02*X20400Y119750D01*
+X18150Y120500D02*X19650D01*
+X17400Y119750D02*X18150Y120500D01*
+X22200Y119750D02*Y118250D01*
+Y119750D02*X22950Y120500D01*
+X24450D01*
+X25200Y119750D01*
+Y118250D01*
+X24450Y117500D02*X25200Y118250D01*
+X22950Y117500D02*X24450D01*
+X22200Y118250D02*X22950Y117500D01*
+X27000Y123500D02*Y118250D01*
+X27750Y117500D01*
+X0Y114250D02*X29250D01*
+X41750Y123500D02*Y117500D01*
+X43700Y123500D02*X44750Y122450D01*
+Y118550D01*
+X43700Y117500D02*X44750Y118550D01*
+X41000Y117500D02*X43700D01*
+X41000Y123500D02*X43700D01*
+G54D20*X46550Y122000D02*Y121850D01*
+G54D19*Y119750D02*Y117500D01*
+X50300Y120500D02*X51050Y119750D01*
+X48800Y120500D02*X50300D01*
+X48050Y119750D02*X48800Y120500D01*
+X48050Y119750D02*Y118250D01*
+X48800Y117500D01*
+X51050Y120500D02*Y118250D01*
+X51800Y117500D01*
+X48800D02*X50300D01*
+X51050Y118250D01*
+X54350Y119750D02*Y117500D01*
+Y119750D02*X55100Y120500D01*
+X55850D01*
+X56600Y119750D01*
+Y117500D01*
+Y119750D02*X57350Y120500D01*
+X58100D01*
+X58850Y119750D01*
+Y117500D01*
+X53600Y120500D02*X54350Y119750D01*
+X60650Y117500D02*X61400D01*
+X65900Y118250D02*X66650Y117500D01*
+X65900Y122750D02*X66650Y123500D01*
+X65900Y122750D02*Y118250D01*
+X68450Y123500D02*X69950D01*
+X69200D02*Y117500D01*
+X68450D02*X69950D01*
+X72500Y119750D02*Y117500D01*
+Y119750D02*X73250Y120500D01*
+X74000D01*
+X74750Y119750D01*
+Y117500D01*
+X71750Y120500D02*X72500Y119750D01*
+X77300Y120500D02*X79550D01*
+X76550Y119750D02*X77300Y120500D01*
+X76550Y119750D02*Y118250D01*
+X77300Y117500D01*
+X79550D01*
+X81350Y123500D02*Y117500D01*
+Y119750D02*X82100Y120500D01*
+X83600D01*
+X84350Y119750D01*
+Y117500D01*
+X86150Y123500D02*X86900Y122750D01*
+Y118250D01*
+X86150Y117500D02*X86900Y118250D01*
+X41000Y114250D02*X88700D01*
+X96050Y117500D02*X98000D01*
+X95000Y118550D02*X96050Y117500D01*
+X95000Y122450D02*Y118550D01*
+Y122450D02*X96050Y123500D01*
+X98000D01*
+X99800Y119750D02*Y118250D01*
+Y119750D02*X100550Y120500D01*
+X102050D01*
+X102800Y119750D01*
+Y118250D01*
+X102050Y117500D02*X102800Y118250D01*
+X100550Y117500D02*X102050D01*
+X99800Y118250D02*X100550Y117500D01*
+X104600Y120500D02*Y118250D01*
+X105350Y117500D01*
+X106850D01*
+X107600Y118250D01*
+Y120500D02*Y118250D01*
+X110150Y119750D02*Y117500D01*
+Y119750D02*X110900Y120500D01*
+X111650D01*
+X112400Y119750D01*
+Y117500D01*
+X109400Y120500D02*X110150Y119750D01*
+X114950Y123500D02*Y118250D01*
+X115700Y117500D01*
+X114200Y121250D02*X115700D01*
+X95000Y114250D02*X117200D01*
+X130750Y123500D02*Y117500D01*
+X130000Y123500D02*X133000D01*
+X133750Y122750D01*
+Y121250D01*
+X133000Y120500D02*X133750Y121250D01*
+X130750Y120500D02*X133000D01*
+X135550Y123500D02*Y118250D01*
+X136300Y117500D01*
+X140050Y120500D02*X140800Y119750D01*
+X138550Y120500D02*X140050D01*
+X137800Y119750D02*X138550Y120500D01*
+X137800Y119750D02*Y118250D01*
+X138550Y117500D01*
+X140800Y120500D02*Y118250D01*
+X141550Y117500D01*
+X138550D02*X140050D01*
+X140800Y118250D01*
+X144100Y123500D02*Y118250D01*
+X144850Y117500D01*
+X143350Y121250D02*X144850D01*
+X147100Y117500D02*X149350D01*
+X146350Y118250D02*X147100Y117500D01*
+X146350Y119750D02*Y118250D01*
+Y119750D02*X147100Y120500D01*
+X148600D01*
+X149350Y119750D01*
+X146350Y119000D02*X149350D01*
+Y119750D02*Y119000D01*
+X154150Y123500D02*Y117500D01*
+X153400D02*X154150Y118250D01*
+X151900Y117500D02*X153400D01*
+X151150Y118250D02*X151900Y117500D01*
+X151150Y119750D02*Y118250D01*
+Y119750D02*X151900Y120500D01*
+X153400D01*
+X154150Y119750D01*
+X157450Y120500D02*Y119750D01*
+Y118250D02*Y117500D01*
+X155950Y122750D02*Y122000D01*
+Y122750D02*X156700Y123500D01*
+X158200D01*
+X158950Y122750D01*
+Y122000D01*
+X157450Y120500D02*X158950Y122000D01*
+X130000Y114250D02*X160750D01*
+X0Y138500D02*X3000D01*
+X1500D02*Y132500D01*
+X4800Y138500D02*Y132500D01*
+Y134750D02*X5550Y135500D01*
+X7050D01*
+X7800Y134750D01*
+Y132500D01*
+X10350D02*X12600D01*
+X9600Y133250D02*X10350Y132500D01*
+X9600Y134750D02*Y133250D01*
+Y134750D02*X10350Y135500D01*
+X11850D01*
+X12600Y134750D01*
+X9600Y134000D02*X12600D01*
+Y134750D02*Y134000D01*
+X15150Y134750D02*Y132500D01*
+Y134750D02*X15900Y135500D01*
+X17400D01*
+X14400D02*X15150Y134750D01*
+X19950Y132500D02*X22200D01*
+X19200Y133250D02*X19950Y132500D01*
+X19200Y134750D02*Y133250D01*
+Y134750D02*X19950Y135500D01*
+X21450D01*
+X22200Y134750D01*
+X19200Y134000D02*X22200D01*
+Y134750D02*Y134000D01*
+X28950Y135500D02*X29700Y134750D01*
+X27450Y135500D02*X28950D01*
+X26700Y134750D02*X27450Y135500D01*
+X26700Y134750D02*Y133250D01*
+X27450Y132500D01*
+X29700Y135500D02*Y133250D01*
+X30450Y132500D01*
+X27450D02*X28950D01*
+X29700Y133250D01*
+X33000Y134750D02*Y132500D01*
+Y134750D02*X33750Y135500D01*
+X35250D01*
+X32250D02*X33000Y134750D01*
+X37800Y132500D02*X40050D01*
+X37050Y133250D02*X37800Y132500D01*
+X37050Y134750D02*Y133250D01*
+Y134750D02*X37800Y135500D01*
+X39300D01*
+X40050Y134750D01*
+X37050Y134000D02*X40050D01*
+Y134750D02*Y134000D01*
+X44550Y137300D02*X45750Y138500D01*
+Y132500D01*
+X44550D02*X46800D01*
+X54300Y138500D02*Y132500D01*
+X53550D02*X54300Y133250D01*
+X52050Y132500D02*X53550D01*
+X51300Y133250D02*X52050Y132500D01*
+X51300Y134750D02*Y133250D01*
+Y134750D02*X52050Y135500D01*
+X53550D01*
+X54300Y134750D01*
+G54D20*X56100Y137000D02*Y136850D01*
+G54D19*Y134750D02*Y132500D01*
+X58350Y137750D02*Y132500D01*
+Y137750D02*X59100Y138500D01*
+X59850D01*
+X57600Y135500D02*X59100D01*
+X62100Y137750D02*Y132500D01*
+Y137750D02*X62850Y138500D01*
+X63600D01*
+X61350Y135500D02*X62850D01*
+X65850Y132500D02*X68100D01*
+X65100Y133250D02*X65850Y132500D01*
+X65100Y134750D02*Y133250D01*
+Y134750D02*X65850Y135500D01*
+X67350D01*
+X68100Y134750D01*
+X65100Y134000D02*X68100D01*
+Y134750D02*Y134000D01*
+X70650Y134750D02*Y132500D01*
+Y134750D02*X71400Y135500D01*
+X72900D01*
+X69900D02*X70650Y134750D01*
+X75450Y132500D02*X77700D01*
+X74700Y133250D02*X75450Y132500D01*
+X74700Y134750D02*Y133250D01*
+Y134750D02*X75450Y135500D01*
+X76950D01*
+X77700Y134750D01*
+X74700Y134000D02*X77700D01*
+Y134750D02*Y134000D01*
+X80250Y134750D02*Y132500D01*
+Y134750D02*X81000Y135500D01*
+X81750D01*
+X82500Y134750D01*
+Y132500D01*
+X79500Y135500D02*X80250Y134750D01*
+X85050Y138500D02*Y133250D01*
+X85800Y132500D01*
+X84300Y136250D02*X85800D01*
+X93000Y138500D02*Y132500D01*
+X92250D02*X93000Y133250D01*
+X90750Y132500D02*X92250D01*
+X90000Y133250D02*X90750Y132500D01*
+X90000Y134750D02*Y133250D01*
+Y134750D02*X90750Y135500D01*
+X92250D01*
+X93000Y134750D01*
+X95550D02*Y132500D01*
+Y134750D02*X96300Y135500D01*
+X97800D01*
+X94800D02*X95550Y134750D01*
+G54D20*X99600Y137000D02*Y136850D01*
+G54D19*Y134750D02*Y132500D01*
+X101100Y138500D02*Y133250D01*
+X101850Y132500D01*
+X103350Y138500D02*Y133250D01*
+X104100Y132500D01*
+X109050D02*X111300D01*
+X112050Y133250D01*
+X111300Y134000D02*X112050Y133250D01*
+X109050Y134000D02*X111300D01*
+X108300Y134750D02*X109050Y134000D01*
+X108300Y134750D02*X109050Y135500D01*
+X111300D01*
+X112050Y134750D01*
+X108300Y133250D02*X109050Y132500D01*
+G54D20*X113850Y137000D02*Y136850D01*
+G54D19*Y134750D02*Y132500D01*
+X115350Y135500D02*X118350D01*
+X115350Y132500D02*X118350Y135500D01*
+X115350Y132500D02*X118350D01*
+X120900D02*X123150D01*
+X120150Y133250D02*X120900Y132500D01*
+X120150Y134750D02*Y133250D01*
+Y134750D02*X120900Y135500D01*
+X122400D01*
+X123150Y134750D01*
+X120150Y134000D02*X123150D01*
+Y134750D02*Y134000D01*
+X125700Y132500D02*X127950D01*
+X128700Y133250D01*
+X127950Y134000D02*X128700Y133250D01*
+X125700Y134000D02*X127950D01*
+X124950Y134750D02*X125700Y134000D01*
+X124950Y134750D02*X125700Y135500D01*
+X127950D01*
+X128700Y134750D01*
+X124950Y133250D02*X125700Y132500D01*
+X133200Y135500D02*Y133250D01*
+X133950Y132500D01*
+X135450D01*
+X136200Y133250D01*
+Y135500D02*Y133250D01*
+X138750Y132500D02*X141000D01*
+X141750Y133250D01*
+X141000Y134000D02*X141750Y133250D01*
+X138750Y134000D02*X141000D01*
+X138000Y134750D02*X138750Y134000D01*
+X138000Y134750D02*X138750Y135500D01*
+X141000D01*
+X141750Y134750D01*
+X138000Y133250D02*X138750Y132500D01*
+X144300D02*X146550D01*
+X143550Y133250D02*X144300Y132500D01*
+X143550Y134750D02*Y133250D01*
+Y134750D02*X144300Y135500D01*
+X145800D01*
+X146550Y134750D01*
+X143550Y134000D02*X146550D01*
+Y134750D02*Y134000D01*
+X151350Y138500D02*Y132500D01*
+X150600D02*X151350Y133250D01*
+X149100Y132500D02*X150600D01*
+X148350Y133250D02*X149100Y132500D01*
+X148350Y134750D02*Y133250D01*
+Y134750D02*X149100Y135500D01*
+X150600D01*
+X151350Y134750D01*
+G54D20*X155850Y137000D02*Y136850D01*
+G54D19*Y134750D02*Y132500D01*
+X158100Y134750D02*Y132500D01*
+Y134750D02*X158850Y135500D01*
+X159600D01*
+X160350Y134750D01*
+Y132500D01*
+X157350Y135500D02*X158100Y134750D01*
+X165600Y138500D02*Y133250D01*
+X166350Y132500D01*
+X164850Y136250D02*X166350D01*
+X167850Y138500D02*Y132500D01*
+Y134750D02*X168600Y135500D01*
+X170100D01*
+X170850Y134750D01*
+Y132500D01*
+G54D20*X172650Y137000D02*Y136850D01*
+G54D19*Y134750D02*Y132500D01*
+X174900D02*X177150D01*
+X177900Y133250D01*
+X177150Y134000D02*X177900Y133250D01*
+X174900Y134000D02*X177150D01*
+X174150Y134750D02*X174900Y134000D01*
+X174150Y134750D02*X174900Y135500D01*
+X177150D01*
+X177900Y134750D01*
+X174150Y133250D02*X174900Y132500D01*
+X182400Y138500D02*Y133250D01*
+X183150Y132500D01*
+X186900Y135500D02*X187650Y134750D01*
+X185400Y135500D02*X186900D01*
+X184650Y134750D02*X185400Y135500D01*
+X184650Y134750D02*Y133250D01*
+X185400Y132500D01*
+X187650Y135500D02*Y133250D01*
+X188400Y132500D01*
+X185400D02*X186900D01*
+X187650Y133250D01*
+X190200Y135500D02*Y133250D01*
+X190950Y132500D01*
+X193200Y135500D02*Y131000D01*
+X192450Y130250D02*X193200Y131000D01*
+X190950Y130250D02*X192450D01*
+X190200Y131000D02*X190950Y130250D01*
+Y132500D02*X192450D01*
+X193200Y133250D01*
+X195000Y134750D02*Y133250D01*
+Y134750D02*X195750Y135500D01*
+X197250D01*
+X198000Y134750D01*
+Y133250D01*
+X197250Y132500D02*X198000Y133250D01*
+X195750Y132500D02*X197250D01*
+X195000Y133250D02*X195750Y132500D01*
+X199800Y135500D02*Y133250D01*
+X200550Y132500D01*
+X202050D01*
+X202800Y133250D01*
+Y135500D02*Y133250D01*
+X205350Y138500D02*Y133250D01*
+X206100Y132500D01*
+X204600Y136250D02*X206100D01*
+X207600Y131000D02*X209100Y132500D01*
+X213600Y137300D02*X214800Y138500D01*
+Y132500D01*
+X213600D02*X215850D01*
+X220350Y138500D02*Y132500D01*
+Y134750D02*X221100Y135500D01*
+X222600D01*
+X223350Y134750D01*
+Y132500D01*
+X225150Y134750D02*Y133250D01*
+Y134750D02*X225900Y135500D01*
+X227400D01*
+X228150Y134750D01*
+Y133250D01*
+X227400Y132500D02*X228150Y133250D01*
+X225900Y132500D02*X227400D01*
+X225150Y133250D02*X225900Y132500D01*
+X229950Y138500D02*Y133250D01*
+X230700Y132500D01*
+X232950D02*X235200D01*
+X232200Y133250D02*X232950Y132500D01*
+X232200Y134750D02*Y133250D01*
+Y134750D02*X232950Y135500D01*
+X234450D01*
+X235200Y134750D01*
+X232200Y134000D02*X235200D01*
+Y134750D02*Y134000D01*
+X237750Y132500D02*X240000D01*
+X240750Y133250D01*
+X240000Y134000D02*X240750Y133250D01*
+X237750Y134000D02*X240000D01*
+X237000Y134750D02*X237750Y134000D01*
+X237000Y134750D02*X237750Y135500D01*
+X240000D01*
+X240750Y134750D01*
+X237000Y133250D02*X237750Y132500D01*
+X246000Y138500D02*Y133250D01*
+X246750Y132500D01*
+X245250Y136250D02*X246750D01*
+X248250Y134750D02*Y133250D01*
+Y134750D02*X249000Y135500D01*
+X250500D01*
+X251250Y134750D01*
+Y133250D01*
+X250500Y132500D02*X251250Y133250D01*
+X249000Y132500D02*X250500D01*
+X248250Y133250D02*X249000Y132500D01*
+X253800Y138500D02*Y133250D01*
+X254550Y132500D01*
+X253050Y136250D02*X254550D01*
+X258300Y135500D02*X259050Y134750D01*
+X256800Y135500D02*X258300D01*
+X256050Y134750D02*X256800Y135500D01*
+X256050Y134750D02*Y133250D01*
+X256800Y132500D01*
+X259050Y135500D02*Y133250D01*
+X259800Y132500D01*
+X256800D02*X258300D01*
+X259050Y133250D01*
+X261600Y138500D02*Y133250D01*
+X262350Y132500D01*
+G54D21*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D19*X200000Y63500D02*Y57500D01*
+Y63500D02*X202250Y60500D01*
+X204500Y63500D01*
+Y57500D01*
+X208550Y60500D02*X209300Y59750D01*
+X207050Y60500D02*X208550D01*
+X206300Y59750D02*X207050Y60500D01*
+X206300Y59750D02*Y58250D01*
+X207050Y57500D01*
+X209300Y60500D02*Y58250D01*
+X210050Y57500D01*
+X207050D02*X208550D01*
+X209300Y58250D01*
+X211850Y60500D02*X214850Y57500D01*
+X211850D02*X214850Y60500D01*
+G54D20*X216650Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X218900Y59750D02*Y57500D01*
+Y59750D02*X219650Y60500D01*
+X220400D01*
+X221150Y59750D01*
+Y57500D01*
+Y59750D02*X221900Y60500D01*
+X222650D01*
+X223400Y59750D01*
+Y57500D01*
+X218150Y60500D02*X218900Y59750D01*
+X225200Y60500D02*Y58250D01*
+X225950Y57500D01*
+X227450D01*
+X228200Y58250D01*
+Y60500D02*Y58250D01*
+X230750Y59750D02*Y57500D01*
+Y59750D02*X231500Y60500D01*
+X232250D01*
+X233000Y59750D01*
+Y57500D01*
+Y59750D02*X233750Y60500D01*
+X234500D01*
+X235250Y59750D01*
+Y57500D01*
+X230000Y60500D02*X230750Y59750D01*
+X240500Y63500D02*Y57500D01*
+X242450Y63500D02*X243500Y62450D01*
+Y58550D01*
+X242450Y57500D02*X243500Y58550D01*
+X239750Y57500D02*X242450D01*
+X239750Y63500D02*X242450D01*
+G54D20*X245300Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X247550Y59750D02*Y57500D01*
+Y59750D02*X248300Y60500D01*
+X249050D01*
+X249800Y59750D01*
+Y57500D01*
+Y59750D02*X250550Y60500D01*
+X251300D01*
+X252050Y59750D01*
+Y57500D01*
+X246800Y60500D02*X247550Y59750D01*
+X254600Y57500D02*X256850D01*
+X253850Y58250D02*X254600Y57500D01*
+X253850Y59750D02*Y58250D01*
+Y59750D02*X254600Y60500D01*
+X256100D01*
+X256850Y59750D01*
+X253850Y59000D02*X256850D01*
+Y59750D02*Y59000D01*
+X259400Y59750D02*Y57500D01*
+Y59750D02*X260150Y60500D01*
+X260900D01*
+X261650Y59750D01*
+Y57500D01*
+X258650Y60500D02*X259400Y59750D01*
+X264200Y57500D02*X266450D01*
+X267200Y58250D01*
+X266450Y59000D02*X267200Y58250D01*
+X264200Y59000D02*X266450D01*
+X263450Y59750D02*X264200Y59000D01*
+X263450Y59750D02*X264200Y60500D01*
+X266450D01*
+X267200Y59750D01*
+X263450Y58250D02*X264200Y57500D01*
+G54D20*X269000Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X270500Y59750D02*Y58250D01*
+Y59750D02*X271250Y60500D01*
+X272750D01*
+X273500Y59750D01*
+Y58250D01*
+X272750Y57500D02*X273500Y58250D01*
+X271250Y57500D02*X272750D01*
+X270500Y58250D02*X271250Y57500D01*
+X276050Y59750D02*Y57500D01*
+Y59750D02*X276800Y60500D01*
+X277550D01*
+X278300Y59750D01*
+Y57500D01*
+X275300Y60500D02*X276050Y59750D01*
+X280850Y57500D02*X283100D01*
+X283850Y58250D01*
+X283100Y59000D02*X283850Y58250D01*
+X280850Y59000D02*X283100D01*
+X280100Y59750D02*X280850Y59000D01*
+X280100Y59750D02*X280850Y60500D01*
+X283100D01*
+X283850Y59750D01*
+X280100Y58250D02*X280850Y57500D01*
+X285650Y61250D02*X286400D01*
+X285650Y59750D02*X286400D01*
+X290900Y63500D02*X293900D01*
+X290900D02*Y60500D01*
+X291650Y61250D01*
+X293150D01*
+X293900Y60500D01*
+Y58250D01*
+X293150Y57500D02*X293900Y58250D01*
+X291650Y57500D02*X293150D01*
+X290900Y58250D02*X291650Y57500D01*
+X295700Y58250D02*X296450Y57500D01*
+X295700Y62750D02*Y58250D01*
+Y62750D02*X296450Y63500D01*
+X297950D01*
+X298700Y62750D01*
+Y58250D01*
+X297950Y57500D02*X298700Y58250D01*
+X296450Y57500D02*X297950D01*
+X295700Y59000D02*X298700Y62000D01*
+X300500Y58250D02*X301250Y57500D01*
+X300500Y62750D02*Y58250D01*
+Y62750D02*X301250Y63500D01*
+X302750D01*
+X303500Y62750D01*
+Y58250D01*
+X302750Y57500D02*X303500Y58250D01*
+X301250Y57500D02*X302750D01*
+X300500Y59000D02*X303500Y62000D01*
+X305300Y57500D02*X306050D01*
+X307850Y58250D02*X308600Y57500D01*
+X307850Y62750D02*Y58250D01*
+Y62750D02*X308600Y63500D01*
+X310100D01*
+X310850Y62750D01*
+Y58250D01*
+X310100Y57500D02*X310850Y58250D01*
+X308600Y57500D02*X310100D01*
+X307850Y59000D02*X310850Y62000D01*
+X312650Y58250D02*X313400Y57500D01*
+X312650Y62750D02*Y58250D01*
+Y62750D02*X313400Y63500D01*
+X314900D01*
+X315650Y62750D01*
+Y58250D01*
+X314900Y57500D02*X315650Y58250D01*
+X313400Y57500D02*X314900D01*
+X312650Y59000D02*X315650Y62000D01*
+X317450Y58250D02*X318200Y57500D01*
+X317450Y62750D02*Y58250D01*
+Y62750D02*X318200Y63500D01*
+X319700D01*
+X320450Y62750D01*
+Y58250D01*
+X319700Y57500D02*X320450Y58250D01*
+X318200Y57500D02*X319700D01*
+X317450Y59000D02*X320450Y62000D01*
+X322250Y58250D02*X323000Y57500D01*
+X322250Y62750D02*Y58250D01*
+Y62750D02*X323000Y63500D01*
+X324500D01*
+X325250Y62750D01*
+Y58250D01*
+X324500Y57500D02*X325250Y58250D01*
+X323000Y57500D02*X324500D01*
+X322250Y59000D02*X325250Y62000D01*
+X327050Y58250D02*X327800Y57500D01*
+X327050Y62750D02*Y58250D01*
+Y62750D02*X327800Y63500D01*
+X329300D01*
+X330050Y62750D01*
+Y58250D01*
+X329300Y57500D02*X330050Y58250D01*
+X327800Y57500D02*X329300D01*
+X327050Y59000D02*X330050Y62000D01*
+X331850Y58250D02*X332600Y57500D01*
+X331850Y62750D02*Y58250D01*
+Y62750D02*X332600Y63500D01*
+X334100D01*
+X334850Y62750D01*
+Y58250D01*
+X334100Y57500D02*X334850Y58250D01*
+X332600Y57500D02*X334100D01*
+X331850Y59000D02*X334850Y62000D01*
+X340100Y59750D02*Y57500D01*
+Y59750D02*X340850Y60500D01*
+X341600D01*
+X342350Y59750D01*
+Y57500D01*
+Y59750D02*X343100Y60500D01*
+X343850D01*
+X344600Y59750D01*
+Y57500D01*
+X339350Y60500D02*X340100Y59750D01*
+G54D20*X346400Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X347900Y63500D02*Y58250D01*
+X348650Y57500D01*
+X350900D02*X353150D01*
+X353900Y58250D01*
+X353150Y59000D02*X353900Y58250D01*
+X350900Y59000D02*X353150D01*
+X350150Y59750D02*X350900Y59000D01*
+X350150Y59750D02*X350900Y60500D01*
+X353150D01*
+X353900Y59750D01*
+X350150Y58250D02*X350900Y57500D01*
+X358400Y60500D02*Y58250D01*
+X359150Y57500D01*
+X359900D01*
+X360650Y58250D01*
+Y60500D02*Y58250D01*
+X361400Y57500D01*
+X362150D01*
+X362900Y58250D01*
+Y60500D02*Y58250D01*
+G54D20*X364700Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X369200Y63500D02*Y57500D01*
+X368450D02*X369200Y58250D01*
+X366950Y57500D02*X368450D01*
+X366200Y58250D02*X366950Y57500D01*
+X366200Y59750D02*Y58250D01*
+Y59750D02*X366950Y60500D01*
+X368450D01*
+X369200Y59750D01*
+X371750Y57500D02*X374000D01*
+X371000Y58250D02*X371750Y57500D01*
+X371000Y59750D02*Y58250D01*
+Y59750D02*X371750Y60500D01*
+X373250D01*
+X374000Y59750D01*
+X371000Y59000D02*X374000D01*
+Y59750D02*Y59000D01*
+X375800Y56000D02*X377300Y57500D01*
+X381800Y63500D02*X384800D01*
+X381800D02*Y60500D01*
+X382550Y61250D01*
+X384050D01*
+X384800Y60500D01*
+Y58250D01*
+X384050Y57500D02*X384800Y58250D01*
+X382550Y57500D02*X384050D01*
+X381800Y58250D02*X382550Y57500D01*
+X386600Y58250D02*X387350Y57500D01*
+X386600Y62750D02*Y58250D01*
+Y62750D02*X387350Y63500D01*
+X388850D01*
+X389600Y62750D01*
+Y58250D01*
+X388850Y57500D02*X389600Y58250D01*
+X387350Y57500D02*X388850D01*
+X386600Y59000D02*X389600Y62000D01*
+X391400Y58250D02*X392150Y57500D01*
+X391400Y62750D02*Y58250D01*
+Y62750D02*X392150Y63500D01*
+X393650D01*
+X394400Y62750D01*
+Y58250D01*
+X393650Y57500D02*X394400Y58250D01*
+X392150Y57500D02*X393650D01*
+X391400Y59000D02*X394400Y62000D01*
+X396200Y57500D02*X396950D01*
+X398750Y58250D02*X399500Y57500D01*
+X398750Y62750D02*Y58250D01*
+Y62750D02*X399500Y63500D01*
+X401000D01*
+X401750Y62750D01*
+Y58250D01*
+X401000Y57500D02*X401750Y58250D01*
+X399500Y57500D02*X401000D01*
+X398750Y59000D02*X401750Y62000D01*
+X403550Y58250D02*X404300Y57500D01*
+X403550Y62750D02*Y58250D01*
+Y62750D02*X404300Y63500D01*
+X405800D01*
+X406550Y62750D01*
+Y58250D01*
+X405800Y57500D02*X406550Y58250D01*
+X404300Y57500D02*X405800D01*
+X403550Y59000D02*X406550Y62000D01*
+X408350Y58250D02*X409100Y57500D01*
+X408350Y62750D02*Y58250D01*
+Y62750D02*X409100Y63500D01*
+X410600D01*
+X411350Y62750D01*
+Y58250D01*
+X410600Y57500D02*X411350Y58250D01*
+X409100Y57500D02*X410600D01*
+X408350Y59000D02*X411350Y62000D01*
+X413150Y58250D02*X413900Y57500D01*
+X413150Y62750D02*Y58250D01*
+Y62750D02*X413900Y63500D01*
+X415400D01*
+X416150Y62750D01*
+Y58250D01*
+X415400Y57500D02*X416150Y58250D01*
+X413900Y57500D02*X415400D01*
+X413150Y59000D02*X416150Y62000D01*
+X417950Y58250D02*X418700Y57500D01*
+X417950Y62750D02*Y58250D01*
+Y62750D02*X418700Y63500D01*
+X420200D01*
+X420950Y62750D01*
+Y58250D01*
+X420200Y57500D02*X420950Y58250D01*
+X418700Y57500D02*X420200D01*
+X417950Y59000D02*X420950Y62000D01*
+X422750Y58250D02*X423500Y57500D01*
+X422750Y62750D02*Y58250D01*
+Y62750D02*X423500Y63500D01*
+X425000D01*
+X425750Y62750D01*
+Y58250D01*
+X425000Y57500D02*X425750Y58250D01*
+X423500Y57500D02*X425000D01*
+X422750Y59000D02*X425750Y62000D01*
+X431000Y59750D02*Y57500D01*
+Y59750D02*X431750Y60500D01*
+X432500D01*
+X433250Y59750D01*
+Y57500D01*
+Y59750D02*X434000Y60500D01*
+X434750D01*
+X435500Y59750D01*
+Y57500D01*
+X430250Y60500D02*X431000Y59750D01*
+G54D20*X437300Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X438800Y63500D02*Y58250D01*
+X439550Y57500D01*
+X441800D02*X444050D01*
+X444800Y58250D01*
+X444050Y59000D02*X444800Y58250D01*
+X441800Y59000D02*X444050D01*
+X441050Y59750D02*X441800Y59000D01*
+X441050Y59750D02*X441800Y60500D01*
+X444050D01*
+X444800Y59750D01*
+X441050Y58250D02*X441800Y57500D01*
+X449300Y63500D02*Y57500D01*
+Y59750D02*X450050Y60500D01*
+X451550D01*
+X452300Y59750D01*
+Y57500D01*
+G54D20*X454100Y62000D02*Y61850D01*
+G54D19*Y59750D02*Y57500D01*
+X457850Y60500D02*X458600Y59750D01*
+X456350Y60500D02*X457850D01*
+X455600Y59750D02*X456350Y60500D01*
+X455600Y59750D02*Y58250D01*
+X456350Y57500D01*
+X457850D01*
+X458600Y58250D01*
+X455600Y56000D02*X456350Y55250D01*
+X457850D01*
+X458600Y56000D01*
+Y60500D02*Y56000D01*
+X460400Y63500D02*Y57500D01*
+Y59750D02*X461150Y60500D01*
+X462650D01*
+X463400Y59750D01*
+Y57500D01*
+X0Y-9500D02*X3000D01*
+X3750Y-8750D01*
+Y-6950D02*Y-8750D01*
+X3000Y-6200D02*X3750Y-6950D01*
+X750Y-6200D02*X3000D01*
+X750Y-3500D02*Y-9500D01*
+X0Y-3500D02*X3000D01*
+X3750Y-4250D01*
+Y-5450D01*
+X3000Y-6200D02*X3750Y-5450D01*
+X5550Y-7250D02*Y-8750D01*
+Y-7250D02*X6300Y-6500D01*
+X7800D01*
+X8550Y-7250D01*
+Y-8750D01*
+X7800Y-9500D02*X8550Y-8750D01*
+X6300Y-9500D02*X7800D01*
+X5550Y-8750D02*X6300Y-9500D01*
+X12600Y-6500D02*X13350Y-7250D01*
+X11100Y-6500D02*X12600D01*
+X10350Y-7250D02*X11100Y-6500D01*
+X10350Y-7250D02*Y-8750D01*
+X11100Y-9500D01*
+X13350Y-6500D02*Y-8750D01*
+X14100Y-9500D01*
+X11100D02*X12600D01*
+X13350Y-8750D01*
+X16650Y-7250D02*Y-9500D01*
+Y-7250D02*X17400Y-6500D01*
+X18900D01*
+X15900D02*X16650Y-7250D01*
+X23700Y-3500D02*Y-9500D01*
+X22950D02*X23700Y-8750D01*
+X21450Y-9500D02*X22950D01*
+X20700Y-8750D02*X21450Y-9500D01*
+X20700Y-7250D02*Y-8750D01*
+Y-7250D02*X21450Y-6500D01*
+X22950D01*
+X23700Y-7250D01*
+X28200D02*Y-8750D01*
+Y-7250D02*X28950Y-6500D01*
+X30450D01*
+X31200Y-7250D01*
+Y-8750D01*
+X30450Y-9500D02*X31200Y-8750D01*
+X28950Y-9500D02*X30450D01*
+X28200Y-8750D02*X28950Y-9500D01*
+X33000Y-6500D02*Y-8750D01*
+X33750Y-9500D01*
+X35250D01*
+X36000Y-8750D01*
+Y-6500D02*Y-8750D01*
+X38550Y-3500D02*Y-8750D01*
+X39300Y-9500D01*
+X37800Y-5750D02*X39300D01*
+X40800Y-3500D02*Y-8750D01*
+X41550Y-9500D01*
+G54D20*X43050Y-5000D02*Y-5150D01*
+G54D19*Y-7250D02*Y-9500D01*
+X45300Y-7250D02*Y-9500D01*
+Y-7250D02*X46050Y-6500D01*
+X46800D01*
+X47550Y-7250D01*
+Y-9500D01*
+X44550Y-6500D02*X45300Y-7250D01*
+X50100Y-9500D02*X52350D01*
+X49350Y-8750D02*X50100Y-9500D01*
+X49350Y-7250D02*Y-8750D01*
+Y-7250D02*X50100Y-6500D01*
+X51600D01*
+X52350Y-7250D01*
+X49350Y-8000D02*X52350D01*
+Y-7250D02*Y-8000D01*
+G54D20*X56850Y-5000D02*Y-5150D01*
+G54D19*Y-7250D02*Y-9500D01*
+X59100D02*X61350D01*
+X62100Y-8750D01*
+X61350Y-8000D02*X62100Y-8750D01*
+X59100Y-8000D02*X61350D01*
+X58350Y-7250D02*X59100Y-8000D01*
+X58350Y-7250D02*X59100Y-6500D01*
+X61350D01*
+X62100Y-7250D01*
+X58350Y-8750D02*X59100Y-9500D01*
+X67350Y-3500D02*Y-8750D01*
+X68100Y-9500D01*
+X66600Y-5750D02*X68100D01*
+X69600Y-3500D02*Y-9500D01*
+Y-7250D02*X70350Y-6500D01*
+X71850D01*
+X72600Y-7250D01*
+Y-9500D01*
+X75150D02*X77400D01*
+X74400Y-8750D02*X75150Y-9500D01*
+X74400Y-7250D02*Y-8750D01*
+Y-7250D02*X75150Y-6500D01*
+X76650D01*
+X77400Y-7250D01*
+X74400Y-8000D02*X77400D01*
+Y-7250D02*Y-8000D01*
+X82650Y-6500D02*X84900D01*
+X81900Y-7250D02*X82650Y-6500D01*
+X81900Y-7250D02*Y-8750D01*
+X82650Y-9500D01*
+X84900D01*
+X87450D02*X89700D01*
+X86700Y-8750D02*X87450Y-9500D01*
+X86700Y-7250D02*Y-8750D01*
+Y-7250D02*X87450Y-6500D01*
+X88950D01*
+X89700Y-7250D01*
+X86700Y-8000D02*X89700D01*
+Y-7250D02*Y-8000D01*
+X92250Y-7250D02*Y-9500D01*
+Y-7250D02*X93000Y-6500D01*
+X93750D01*
+X94500Y-7250D01*
+Y-9500D01*
+X91500Y-6500D02*X92250Y-7250D01*
+X97050Y-3500D02*Y-8750D01*
+X97800Y-9500D01*
+X96300Y-5750D02*X97800D01*
+X100050Y-9500D02*X102300D01*
+X99300Y-8750D02*X100050Y-9500D01*
+X99300Y-7250D02*Y-8750D01*
+Y-7250D02*X100050Y-6500D01*
+X101550D01*
+X102300Y-7250D01*
+X99300Y-8000D02*X102300D01*
+Y-7250D02*Y-8000D01*
+X104850Y-7250D02*Y-9500D01*
+Y-7250D02*X105600Y-6500D01*
+X107100D01*
+X104100D02*X104850Y-7250D01*
+X108900Y-3500D02*Y-8750D01*
+X109650Y-9500D01*
+G54D20*X111150Y-5000D02*Y-5150D01*
+G54D19*Y-7250D02*Y-9500D01*
+X113400Y-7250D02*Y-9500D01*
+Y-7250D02*X114150Y-6500D01*
+X114900D01*
+X115650Y-7250D01*
+Y-9500D01*
+X112650Y-6500D02*X113400Y-7250D01*
+X118200Y-9500D02*X120450D01*
+X117450Y-8750D02*X118200Y-9500D01*
+X117450Y-7250D02*Y-8750D01*
+Y-7250D02*X118200Y-6500D01*
+X119700D01*
+X120450Y-7250D01*
+X117450Y-8000D02*X120450D01*
+Y-7250D02*Y-8000D01*
+X124950Y-7250D02*Y-8750D01*
+Y-7250D02*X125700Y-6500D01*
+X127200D01*
+X127950Y-7250D01*
+Y-8750D01*
+X127200Y-9500D02*X127950Y-8750D01*
+X125700Y-9500D02*X127200D01*
+X124950Y-8750D02*X125700Y-9500D01*
+X130500Y-4250D02*Y-9500D01*
+Y-4250D02*X131250Y-3500D01*
+X132000D01*
+X129750Y-6500D02*X131250D01*
+X136950Y-3500D02*Y-8750D01*
+X137700Y-9500D01*
+X136200Y-5750D02*X137700D01*
+X139200Y-3500D02*Y-9500D01*
+Y-7250D02*X139950Y-6500D01*
+X141450D01*
+X142200Y-7250D01*
+Y-9500D01*
+G54D20*X144000Y-5000D02*Y-5150D01*
+G54D19*Y-7250D02*Y-9500D01*
+X146250D02*X148500D01*
+X149250Y-8750D01*
+X148500Y-8000D02*X149250Y-8750D01*
+X146250Y-8000D02*X148500D01*
+X145500Y-7250D02*X146250Y-8000D01*
+X145500Y-7250D02*X146250Y-6500D01*
+X148500D01*
+X149250Y-7250D01*
+X145500Y-8750D02*X146250Y-9500D01*
+X153750Y-8750D02*X154500Y-9500D01*
+X153750Y-7550D02*Y-8750D01*
+Y-7550D02*X154800Y-6500D01*
+X155700D01*
+X156750Y-7550D01*
+Y-8750D01*
+X156000Y-9500D02*X156750Y-8750D01*
+X154500Y-9500D02*X156000D01*
+X153750Y-5450D02*X154800Y-6500D01*
+X153750Y-4250D02*Y-5450D01*
+Y-4250D02*X154500Y-3500D01*
+X156000D01*
+X156750Y-4250D01*
+Y-5450D01*
+X155700Y-6500D02*X156750Y-5450D01*
+X158550Y-9500D02*X159300D01*
+X161100Y-8750D02*X161850Y-9500D01*
+X161100Y-4250D02*Y-8750D01*
+Y-4250D02*X161850Y-3500D01*
+X163350D01*
+X164100Y-4250D01*
+Y-8750D01*
+X163350Y-9500D02*X164100Y-8750D01*
+X161850Y-9500D02*X163350D01*
+X161100Y-8000D02*X164100Y-5000D01*
+X165900Y-8750D02*X166650Y-9500D01*
+X165900Y-4250D02*Y-8750D01*
+Y-4250D02*X166650Y-3500D01*
+X168150D01*
+X168900Y-4250D01*
+Y-8750D01*
+X168150Y-9500D02*X168900Y-8750D01*
+X166650Y-9500D02*X168150D01*
+X165900Y-8000D02*X168900Y-5000D01*
+X170700Y-8750D02*X171450Y-9500D01*
+X170700Y-4250D02*Y-8750D01*
+Y-4250D02*X171450Y-3500D01*
+X172950D01*
+X173700Y-4250D01*
+Y-8750D01*
+X172950Y-9500D02*X173700Y-8750D01*
+X171450Y-9500D02*X172950D01*
+X170700Y-8000D02*X173700Y-5000D01*
+X175500Y-8750D02*X176250Y-9500D01*
+X175500Y-4250D02*Y-8750D01*
+Y-4250D02*X176250Y-3500D01*
+X177750D01*
+X178500Y-4250D01*
+Y-8750D01*
+X177750Y-9500D02*X178500Y-8750D01*
+X176250Y-9500D02*X177750D01*
+X175500Y-8000D02*X178500Y-5000D01*
+X180300Y-8750D02*X181050Y-9500D01*
+X180300Y-4250D02*Y-8750D01*
+Y-4250D02*X181050Y-3500D01*
+X182550D01*
+X183300Y-4250D01*
+Y-8750D01*
+X182550Y-9500D02*X183300Y-8750D01*
+X181050Y-9500D02*X182550D01*
+X180300Y-8000D02*X183300Y-5000D01*
+X185100Y-8750D02*X185850Y-9500D01*
+X185100Y-4250D02*Y-8750D01*
+Y-4250D02*X185850Y-3500D01*
+X187350D01*
+X188100Y-4250D01*
+Y-8750D01*
+X187350Y-9500D02*X188100Y-8750D01*
+X185850Y-9500D02*X187350D01*
+X185100Y-8000D02*X188100Y-5000D01*
+X193350Y-7250D02*Y-9500D01*
+Y-7250D02*X194100Y-6500D01*
+X194850D01*
+X195600Y-7250D01*
+Y-9500D01*
+Y-7250D02*X196350Y-6500D01*
+X197100D01*
+X197850Y-7250D01*
+Y-9500D01*
+X192600Y-6500D02*X193350Y-7250D01*
+G54D20*X199650Y-5000D02*Y-5150D01*
+G54D19*Y-7250D02*Y-9500D01*
+X201150Y-3500D02*Y-8750D01*
+X201900Y-9500D01*
+X206850Y-7250D02*Y-9500D01*
+Y-7250D02*X207600Y-6500D01*
+X209100D01*
+X206100D02*X206850Y-7250D01*
+X211650Y-9500D02*X213900D01*
+X210900Y-8750D02*X211650Y-9500D01*
+X210900Y-7250D02*Y-8750D01*
+Y-7250D02*X211650Y-6500D01*
+X213150D01*
+X213900Y-7250D01*
+X210900Y-8000D02*X213900D01*
+Y-7250D02*Y-8000D01*
+X216450Y-6500D02*X218700D01*
+X215700Y-7250D02*X216450Y-6500D01*
+X215700Y-7250D02*Y-8750D01*
+X216450Y-9500D01*
+X218700D01*
+X221250Y-3500D02*Y-8750D01*
+X222000Y-9500D01*
+X220500Y-5750D02*X222000D01*
+X225750Y-6500D02*X226500Y-7250D01*
+X224250Y-6500D02*X225750D01*
+X223500Y-7250D02*X224250Y-6500D01*
+X223500Y-7250D02*Y-8750D01*
+X224250Y-9500D01*
+X226500Y-6500D02*Y-8750D01*
+X227250Y-9500D01*
+X224250D02*X225750D01*
+X226500Y-8750D01*
+X229800Y-7250D02*Y-9500D01*
+Y-7250D02*X230550Y-6500D01*
+X231300D01*
+X232050Y-7250D01*
+Y-9500D01*
+X229050Y-6500D02*X229800Y-7250D01*
+X236100Y-6500D02*X236850Y-7250D01*
+X234600Y-6500D02*X236100D01*
+X233850Y-7250D02*X234600Y-6500D01*
+X233850Y-7250D02*Y-8750D01*
+X234600Y-9500D01*
+X236100D01*
+X236850Y-8750D01*
+X233850Y-11000D02*X234600Y-11750D01*
+X236100D01*
+X236850Y-11000D01*
+Y-6500D02*Y-11000D01*
+X238650Y-3500D02*Y-8750D01*
+X239400Y-9500D01*
+X241650D02*X243900D01*
+X240900Y-8750D02*X241650Y-9500D01*
+X240900Y-7250D02*Y-8750D01*
+Y-7250D02*X241650Y-6500D01*
+X243150D01*
+X243900Y-7250D01*
+X240900Y-8000D02*X243900D01*
+Y-7250D02*Y-8000D01*
+X248400Y-6500D02*X251400D01*
+X255900Y-8750D02*X256650Y-9500D01*
+X255900Y-4250D02*Y-8750D01*
+Y-4250D02*X256650Y-3500D01*
+X258150D01*
+X258900Y-4250D01*
+Y-8750D01*
+X258150Y-9500D02*X258900Y-8750D01*
+X256650Y-9500D02*X258150D01*
+X255900Y-8000D02*X258900Y-5000D01*
+X260700Y-11000D02*X262200Y-9500D01*
+X264000Y-8750D02*X264750Y-9500D01*
+X264000Y-4250D02*Y-8750D01*
+Y-4250D02*X264750Y-3500D01*
+X266250D01*
+X267000Y-4250D01*
+Y-8750D01*
+X266250Y-9500D02*X267000Y-8750D01*
+X264750Y-9500D02*X266250D01*
+X264000Y-8000D02*X267000Y-5000D01*
+X272250Y-3500D02*Y-8750D01*
+X273000Y-9500D01*
+X271500Y-5750D02*X273000D01*
+X274500Y-7250D02*Y-8750D01*
+Y-7250D02*X275250Y-6500D01*
+X276750D01*
+X277500Y-7250D01*
+Y-8750D01*
+X276750Y-9500D02*X277500Y-8750D01*
+X275250Y-9500D02*X276750D01*
+X274500Y-8750D02*X275250Y-9500D01*
+X282000Y-3500D02*X285000D01*
+X282000D02*Y-6500D01*
+X282750Y-5750D01*
+X284250D01*
+X285000Y-6500D01*
+Y-8750D01*
+X284250Y-9500D02*X285000Y-8750D01*
+X282750Y-9500D02*X284250D01*
+X282000Y-8750D02*X282750Y-9500D01*
+X286800Y-8750D02*X287550Y-9500D01*
+X286800Y-4250D02*Y-8750D01*
+Y-4250D02*X287550Y-3500D01*
+X289050D01*
+X289800Y-4250D01*
+Y-8750D01*
+X289050Y-9500D02*X289800Y-8750D01*
+X287550Y-9500D02*X289050D01*
+X286800Y-8000D02*X289800Y-5000D01*
+X291600Y-8750D02*X292350Y-9500D01*
+X291600Y-4250D02*Y-8750D01*
+Y-4250D02*X292350Y-3500D01*
+X293850D01*
+X294600Y-4250D01*
+Y-8750D01*
+X293850Y-9500D02*X294600Y-8750D01*
+X292350Y-9500D02*X293850D01*
+X291600Y-8000D02*X294600Y-5000D01*
+X296400Y-9500D02*X297150D01*
+X298950Y-8750D02*X299700Y-9500D01*
+X298950Y-4250D02*Y-8750D01*
+Y-4250D02*X299700Y-3500D01*
+X301200D01*
+X301950Y-4250D01*
+Y-8750D01*
+X301200Y-9500D02*X301950Y-8750D01*
+X299700Y-9500D02*X301200D01*
+X298950Y-8000D02*X301950Y-5000D01*
+X303750Y-8750D02*X304500Y-9500D01*
+X303750Y-4250D02*Y-8750D01*
+Y-4250D02*X304500Y-3500D01*
+X306000D01*
+X306750Y-4250D01*
+Y-8750D01*
+X306000Y-9500D02*X306750Y-8750D01*
+X304500Y-9500D02*X306000D01*
+X303750Y-8000D02*X306750Y-5000D01*
+X308550Y-8750D02*X309300Y-9500D01*
+X308550Y-4250D02*Y-8750D01*
+Y-4250D02*X309300Y-3500D01*
+X310800D01*
+X311550Y-4250D01*
+Y-8750D01*
+X310800Y-9500D02*X311550Y-8750D01*
+X309300Y-9500D02*X310800D01*
+X308550Y-8000D02*X311550Y-5000D01*
+X313350Y-8750D02*X314100Y-9500D01*
+X313350Y-4250D02*Y-8750D01*
+Y-4250D02*X314100Y-3500D01*
+X315600D01*
+X316350Y-4250D01*
+Y-8750D01*
+X315600Y-9500D02*X316350Y-8750D01*
+X314100Y-9500D02*X315600D01*
+X313350Y-8000D02*X316350Y-5000D01*
+X318150Y-8750D02*X318900Y-9500D01*
+X318150Y-4250D02*Y-8750D01*
+Y-4250D02*X318900Y-3500D01*
+X320400D01*
+X321150Y-4250D01*
+Y-8750D01*
+X320400Y-9500D02*X321150Y-8750D01*
+X318900Y-9500D02*X320400D01*
+X318150Y-8000D02*X321150Y-5000D01*
+X322950Y-8750D02*X323700Y-9500D01*
+X322950Y-4250D02*Y-8750D01*
+Y-4250D02*X323700Y-3500D01*
+X325200D01*
+X325950Y-4250D01*
+Y-8750D01*
+X325200Y-9500D02*X325950Y-8750D01*
+X323700Y-9500D02*X325200D01*
+X322950Y-8000D02*X325950Y-5000D01*
+X327750Y-11000D02*X329250Y-9500D01*
+X331050Y-3500D02*X334050D01*
+X331050D02*Y-6500D01*
+X331800Y-5750D01*
+X333300D01*
+X334050Y-6500D01*
+Y-8750D01*
+X333300Y-9500D02*X334050Y-8750D01*
+X331800Y-9500D02*X333300D01*
+X331050Y-8750D02*X331800Y-9500D01*
+X335850Y-8750D02*X336600Y-9500D01*
+X335850Y-4250D02*Y-8750D01*
+Y-4250D02*X336600Y-3500D01*
+X338100D01*
+X338850Y-4250D01*
+Y-8750D01*
+X338100Y-9500D02*X338850Y-8750D01*
+X336600Y-9500D02*X338100D01*
+X335850Y-8000D02*X338850Y-5000D01*
+X340650Y-8750D02*X341400Y-9500D01*
+X340650Y-4250D02*Y-8750D01*
+Y-4250D02*X341400Y-3500D01*
+X342900D01*
+X343650Y-4250D01*
+Y-8750D01*
+X342900Y-9500D02*X343650Y-8750D01*
+X341400Y-9500D02*X342900D01*
+X340650Y-8000D02*X343650Y-5000D01*
+X345450Y-9500D02*X346200D01*
+X348000Y-8750D02*X348750Y-9500D01*
+X348000Y-4250D02*Y-8750D01*
+Y-4250D02*X348750Y-3500D01*
+X350250D01*
+X351000Y-4250D01*
+Y-8750D01*
+X350250Y-9500D02*X351000Y-8750D01*
+X348750Y-9500D02*X350250D01*
+X348000Y-8000D02*X351000Y-5000D01*
+X352800Y-8750D02*X353550Y-9500D01*
+X352800Y-4250D02*Y-8750D01*
+Y-4250D02*X353550Y-3500D01*
+X355050D01*
+X355800Y-4250D01*
+Y-8750D01*
+X355050Y-9500D02*X355800Y-8750D01*
+X353550Y-9500D02*X355050D01*
+X352800Y-8000D02*X355800Y-5000D01*
+X357600Y-8750D02*X358350Y-9500D01*
+X357600Y-4250D02*Y-8750D01*
+Y-4250D02*X358350Y-3500D01*
+X359850D01*
+X360600Y-4250D01*
+Y-8750D01*
+X359850Y-9500D02*X360600Y-8750D01*
+X358350Y-9500D02*X359850D01*
+X357600Y-8000D02*X360600Y-5000D01*
+X362400Y-8750D02*X363150Y-9500D01*
+X362400Y-4250D02*Y-8750D01*
+Y-4250D02*X363150Y-3500D01*
+X364650D01*
+X365400Y-4250D01*
+Y-8750D01*
+X364650Y-9500D02*X365400Y-8750D01*
+X363150Y-9500D02*X364650D01*
+X362400Y-8000D02*X365400Y-5000D01*
+X367200Y-8750D02*X367950Y-9500D01*
+X367200Y-4250D02*Y-8750D01*
+Y-4250D02*X367950Y-3500D01*
+X369450D01*
+X370200Y-4250D01*
+Y-8750D01*
+X369450Y-9500D02*X370200Y-8750D01*
+X367950Y-9500D02*X369450D01*
+X367200Y-8000D02*X370200Y-5000D01*
+X372000Y-8750D02*X372750Y-9500D01*
+X372000Y-4250D02*Y-8750D01*
+Y-4250D02*X372750Y-3500D01*
+X374250D01*
+X375000Y-4250D01*
+Y-8750D01*
+X374250Y-9500D02*X375000Y-8750D01*
+X372750Y-9500D02*X374250D01*
+X372000Y-8000D02*X375000Y-5000D01*
+X380250Y-7250D02*Y-9500D01*
+Y-7250D02*X381000Y-6500D01*
+X381750D01*
+X382500Y-7250D01*
+Y-9500D01*
+Y-7250D02*X383250Y-6500D01*
+X384000D01*
+X384750Y-7250D01*
+Y-9500D01*
+X379500Y-6500D02*X380250Y-7250D01*
+G54D20*X386550Y-5000D02*Y-5150D01*
+G54D19*Y-7250D02*Y-9500D01*
+X388050Y-3500D02*Y-8750D01*
+X388800Y-9500D01*
+X391050D02*X393300D01*
+X394050Y-8750D01*
+X393300Y-8000D02*X394050Y-8750D01*
+X391050Y-8000D02*X393300D01*
+X390300Y-7250D02*X391050Y-8000D01*
+X390300Y-7250D02*X391050Y-6500D01*
+X393300D01*
+X394050Y-7250D01*
+X390300Y-8750D02*X391050Y-9500D01*
+X200750Y78500D02*Y72500D01*
+X202700Y78500D02*X203750Y77450D01*
+Y73550D01*
+X202700Y72500D02*X203750Y73550D01*
+X200000Y72500D02*X202700D01*
+X200000Y78500D02*X202700D01*
+X207800Y75500D02*X208550Y74750D01*
+X206300Y75500D02*X207800D01*
+X205550Y74750D02*X206300Y75500D01*
+X205550Y74750D02*Y73250D01*
+X206300Y72500D01*
+X208550Y75500D02*Y73250D01*
+X209300Y72500D01*
+X206300D02*X207800D01*
+X208550Y73250D01*
+X211850Y78500D02*Y73250D01*
+X212600Y72500D01*
+X211100Y76250D02*X212600D01*
+X214850Y72500D02*X217100D01*
+X214100Y73250D02*X214850Y72500D01*
+X214100Y74750D02*Y73250D01*
+Y74750D02*X214850Y75500D01*
+X216350D01*
+X217100Y74750D01*
+X214100Y74000D02*X217100D01*
+Y74750D02*Y74000D01*
+X218900Y76250D02*X219650D01*
+X218900Y74750D02*X219650D01*
+X224150Y75500D02*X225650Y77000D01*
+X224150Y75500D02*X225650Y74000D01*
+X230450Y78500D02*Y72500D01*
+X229700D02*X230450Y73250D01*
+X228200Y72500D02*X229700D01*
+X227450Y73250D02*X228200Y72500D01*
+X227450Y74750D02*Y73250D01*
+Y74750D02*X228200Y75500D01*
+X229700D01*
+X230450Y74750D01*
+X234500Y75500D02*X235250Y74750D01*
+X233000Y75500D02*X234500D01*
+X232250Y74750D02*X233000Y75500D01*
+X232250Y74750D02*Y73250D01*
+X233000Y72500D01*
+X235250Y75500D02*Y73250D01*
+X236000Y72500D01*
+X233000D02*X234500D01*
+X235250Y73250D01*
+X238550Y78500D02*Y73250D01*
+X239300Y72500D01*
+X237800Y76250D02*X239300D01*
+X241550Y72500D02*X243800D01*
+X240800Y73250D02*X241550Y72500D01*
+X240800Y74750D02*Y73250D01*
+Y74750D02*X241550Y75500D01*
+X243050D01*
+X243800Y74750D01*
+X240800Y74000D02*X243800D01*
+Y74750D02*Y74000D01*
+X245600Y77000D02*X247100Y75500D01*
+X245600Y74000D02*X247100Y75500D01*
+X200000Y92000D02*Y87500D01*
+Y92000D02*X201050Y93500D01*
+X202700D01*
+X203750Y92000D01*
+Y87500D01*
+X200000Y90500D02*X203750D01*
+X205550D02*Y88250D01*
+X206300Y87500D01*
+X207800D01*
+X208550Y88250D01*
+Y90500D02*Y88250D01*
+X211100Y93500D02*Y88250D01*
+X211850Y87500D01*
+X210350Y91250D02*X211850D01*
+X213350Y93500D02*Y87500D01*
+Y89750D02*X214100Y90500D01*
+X215600D01*
+X216350Y89750D01*
+Y87500D01*
+X218150Y89750D02*Y88250D01*
+Y89750D02*X218900Y90500D01*
+X220400D01*
+X221150Y89750D01*
+Y88250D01*
+X220400Y87500D02*X221150Y88250D01*
+X218900Y87500D02*X220400D01*
+X218150Y88250D02*X218900Y87500D01*
+X223700Y89750D02*Y87500D01*
+Y89750D02*X224450Y90500D01*
+X225950D01*
+X222950D02*X223700Y89750D01*
+X227750Y91250D02*X228500D01*
+X227750Y89750D02*X228500D01*
+X200000Y108500D02*X203000D01*
+X201500D02*Y102500D01*
+G54D20*X204800Y107000D02*Y106850D01*
+G54D19*Y104750D02*Y102500D01*
+X207050Y108500D02*Y103250D01*
+X207800Y102500D01*
+X206300Y106250D02*X207800D01*
+X209300Y108500D02*Y103250D01*
+X210050Y102500D01*
+X212300D02*X214550D01*
+X211550Y103250D02*X212300Y102500D01*
+X211550Y104750D02*Y103250D01*
+Y104750D02*X212300Y105500D01*
+X213800D01*
+X214550Y104750D01*
+X211550Y104000D02*X214550D01*
+Y104750D02*Y104000D01*
+X216350Y106250D02*X217100D01*
+X216350Y104750D02*X217100D01*
+X222350Y108500D02*Y103250D01*
+X223100Y102500D01*
+X221600Y106250D02*X223100D01*
+X224600Y108500D02*Y102500D01*
+Y104750D02*X225350Y105500D01*
+X226850D01*
+X227600Y104750D01*
+Y102500D01*
+X230150D02*X232400D01*
+X229400Y103250D02*X230150Y102500D01*
+X229400Y104750D02*Y103250D01*
+Y104750D02*X230150Y105500D01*
+X231650D01*
+X232400Y104750D01*
+X229400Y104000D02*X232400D01*
+Y104750D02*Y104000D01*
+X234950Y104750D02*Y102500D01*
+Y104750D02*X235700Y105500D01*
+X237200D01*
+X234200D02*X234950Y104750D01*
+X239750D02*Y102500D01*
+Y104750D02*X240500Y105500D01*
+X241250D01*
+X242000Y104750D01*
+Y102500D01*
+Y104750D02*X242750Y105500D01*
+X243500D01*
+X244250Y104750D01*
+Y102500D01*
+X239000Y105500D02*X239750Y104750D01*
+X248300Y105500D02*X249050Y104750D01*
+X246800Y105500D02*X248300D01*
+X246050Y104750D02*X246800Y105500D01*
+X246050Y104750D02*Y103250D01*
+X246800Y102500D01*
+X249050Y105500D02*Y103250D01*
+X249800Y102500D01*
+X246800D02*X248300D01*
+X249050Y103250D01*
+X251600Y108500D02*Y103250D01*
+X252350Y102500D01*
+X254600D02*X256850D01*
+X257600Y103250D01*
+X256850Y104000D02*X257600Y103250D01*
+X254600Y104000D02*X256850D01*
+X253850Y104750D02*X254600Y104000D01*
+X253850Y104750D02*X254600Y105500D01*
+X256850D01*
+X257600Y104750D01*
+X253850Y103250D02*X254600Y102500D01*
+X262100Y104750D02*Y103250D01*
+Y104750D02*X262850Y105500D01*
+X264350D01*
+X265100Y104750D01*
+Y103250D01*
+X264350Y102500D02*X265100Y103250D01*
+X262850Y102500D02*X264350D01*
+X262100Y103250D02*X262850Y102500D01*
+X267650Y104750D02*Y102500D01*
+Y104750D02*X268400Y105500D01*
+X269150D01*
+X269900Y104750D01*
+Y102500D01*
+X266900Y105500D02*X267650Y104750D01*
+X275150Y108500D02*Y103250D01*
+X275900Y102500D01*
+X274400Y106250D02*X275900D01*
+X277400Y108500D02*Y102500D01*
+Y104750D02*X278150Y105500D01*
+X279650D01*
+X280400Y104750D01*
+Y102500D01*
+X282950D02*X285200D01*
+X282200Y103250D02*X282950Y102500D01*
+X282200Y104750D02*Y103250D01*
+Y104750D02*X282950Y105500D01*
+X284450D01*
+X285200Y104750D01*
+X282200Y104000D02*X285200D01*
+Y104750D02*Y104000D01*
+X289700Y108500D02*Y103250D01*
+X290450Y102500D01*
+X294200Y105500D02*X294950Y104750D01*
+X292700Y105500D02*X294200D01*
+X291950Y104750D02*X292700Y105500D01*
+X291950Y104750D02*Y103250D01*
+X292700Y102500D01*
+X294950Y105500D02*Y103250D01*
+X295700Y102500D01*
+X292700D02*X294200D01*
+X294950Y103250D01*
+X298250Y102500D02*X300500D01*
+X301250Y103250D01*
+X300500Y104000D02*X301250Y103250D01*
+X298250Y104000D02*X300500D01*
+X297500Y104750D02*X298250Y104000D01*
+X297500Y104750D02*X298250Y105500D01*
+X300500D01*
+X301250Y104750D01*
+X297500Y103250D02*X298250Y102500D01*
+X303800Y108500D02*Y103250D01*
+X304550Y102500D01*
+X303050Y106250D02*X304550D01*
+X308750Y107750D02*X309500Y108500D01*
+X311750D01*
+X312500Y107750D01*
+Y106250D01*
+X308750Y102500D02*X312500Y106250D01*
+X308750Y102500D02*X312500D01*
+X317000Y108500D02*Y103250D01*
+X317750Y102500D01*
+X321500Y105500D02*X322250Y104750D01*
+X320000Y105500D02*X321500D01*
+X319250Y104750D02*X320000Y105500D01*
+X319250Y104750D02*Y103250D01*
+X320000Y102500D01*
+X322250Y105500D02*Y103250D01*
+X323000Y102500D01*
+X320000D02*X321500D01*
+X322250Y103250D01*
+X324800Y105500D02*Y103250D01*
+X325550Y102500D01*
+X327800Y105500D02*Y101000D01*
+X327050Y100250D02*X327800Y101000D01*
+X325550Y100250D02*X327050D01*
+X324800Y101000D02*X325550Y100250D01*
+Y102500D02*X327050D01*
+X327800Y103250D01*
+X330350Y102500D02*X332600D01*
+X329600Y103250D02*X330350Y102500D01*
+X329600Y104750D02*Y103250D01*
+Y104750D02*X330350Y105500D01*
+X331850D01*
+X332600Y104750D01*
+X329600Y104000D02*X332600D01*
+Y104750D02*Y104000D01*
+X335150Y104750D02*Y102500D01*
+Y104750D02*X335900Y105500D01*
+X337400D01*
+X334400D02*X335150Y104750D01*
+X339950Y102500D02*X342200D01*
+X342950Y103250D01*
+X342200Y104000D02*X342950Y103250D01*
+X339950Y104000D02*X342200D01*
+X339200Y104750D02*X339950Y104000D01*
+X339200Y104750D02*X339950Y105500D01*
+X342200D01*
+X342950Y104750D01*
+X339200Y103250D02*X339950Y102500D01*
+X347450Y105500D02*X350450D01*
+X355700D02*X357950D01*
+X354950Y104750D02*X355700Y105500D01*
+X354950Y104750D02*Y103250D01*
+X355700Y102500D01*
+X357950D01*
+X362000Y105500D02*X362750Y104750D01*
+X360500Y105500D02*X362000D01*
+X359750Y104750D02*X360500Y105500D01*
+X359750Y104750D02*Y103250D01*
+X360500Y102500D01*
+X362750Y105500D02*Y103250D01*
+X363500Y102500D01*
+X360500D02*X362000D01*
+X362750Y103250D01*
+X366050Y108500D02*Y103250D01*
+X366800Y102500D01*
+X365300Y106250D02*X366800D01*
+X369050Y105500D02*X371300D01*
+X368300Y104750D02*X369050Y105500D01*
+X368300Y104750D02*Y103250D01*
+X369050Y102500D01*
+X371300D01*
+X373100Y108500D02*Y102500D01*
+Y104750D02*X373850Y105500D01*
+X375350D01*
+X376100Y104750D01*
+Y102500D01*
+X380600Y104750D02*Y103250D01*
+Y104750D02*X381350Y105500D01*
+X382850D01*
+X383600Y104750D01*
+Y103250D01*
+X382850Y102500D02*X383600Y103250D01*
+X381350Y102500D02*X382850D01*
+X380600Y103250D02*X381350Y102500D01*
+X386150Y107750D02*Y102500D01*
+Y107750D02*X386900Y108500D01*
+X387650D01*
+X385400Y105500D02*X386900D01*
+X389900Y107750D02*Y102500D01*
+Y107750D02*X390650Y108500D01*
+X391400D01*
+X389150Y105500D02*X390650D01*
+X392900D02*X395900D01*
+X397700Y108500D02*Y102500D01*
+Y103250D02*X398450Y102500D01*
+X399950D01*
+X400700Y103250D01*
+Y104750D02*Y103250D01*
+X399950Y105500D02*X400700Y104750D01*
+X398450Y105500D02*X399950D01*
+X397700Y104750D02*X398450Y105500D01*
+X402500D02*Y103250D01*
+X403250Y102500D01*
+X405500Y105500D02*Y101000D01*
+X404750Y100250D02*X405500Y101000D01*
+X403250Y100250D02*X404750D01*
+X402500Y101000D02*X403250Y100250D01*
+Y102500D02*X404750D01*
+X405500Y103250D01*
+X407300Y105500D02*X410300D01*
+X412100Y104750D02*Y103250D01*
+Y104750D02*X412850Y105500D01*
+X414350D01*
+X415100Y104750D01*
+Y103250D01*
+X414350Y102500D02*X415100Y103250D01*
+X412850Y102500D02*X414350D01*
+X412100Y103250D02*X412850Y102500D01*
+X417650Y104750D02*Y102500D01*
+Y104750D02*X418400Y105500D01*
+X419150D01*
+X419900Y104750D01*
+Y102500D01*
+X416900Y105500D02*X417650Y104750D01*
+X422450Y102500D02*X424700D01*
+X421700Y103250D02*X422450Y102500D01*
+X421700Y104750D02*Y103250D01*
+Y104750D02*X422450Y105500D01*
+X423950D01*
+X424700Y104750D01*
+X421700Y104000D02*X424700D01*
+Y104750D02*Y104000D01*
+X429200Y108500D02*Y102500D01*
+Y103250D02*X429950Y102500D01*
+X431450D01*
+X432200Y103250D01*
+Y104750D02*Y103250D01*
+X431450Y105500D02*X432200Y104750D01*
+X429950Y105500D02*X431450D01*
+X429200Y104750D02*X429950Y105500D01*
+X434000D02*Y103250D01*
+X434750Y102500D01*
+X436250D01*
+X437000Y103250D01*
+Y105500D02*Y103250D01*
+X441050Y105500D02*X441800Y104750D01*
+X439550Y105500D02*X441050D01*
+X438800Y104750D02*X439550Y105500D01*
+X438800Y104750D02*Y103250D01*
+X439550Y102500D01*
+X441050D01*
+X441800Y103250D01*
+X438800Y101000D02*X439550Y100250D01*
+X441050D01*
+X441800Y101000D01*
+Y105500D02*Y101000D01*
+X444350Y102500D02*X446600D01*
+X447350Y103250D01*
+X446600Y104000D02*X447350Y103250D01*
+X444350Y104000D02*X446600D01*
+X443600Y104750D02*X444350Y104000D01*
+X443600Y104750D02*X444350Y105500D01*
+X446600D01*
+X447350Y104750D01*
+X443600Y103250D02*X444350Y102500D01*
+X454850Y108500D02*Y102500D01*
+X454100D02*X454850Y103250D01*
+X452600Y102500D02*X454100D01*
+X451850Y103250D02*X452600Y102500D01*
+X451850Y104750D02*Y103250D01*
+Y104750D02*X452600Y105500D01*
+X454100D01*
+X454850Y104750D01*
+X456650Y105500D02*Y103250D01*
+X457400Y102500D01*
+X458900D01*
+X459650Y103250D01*
+Y105500D02*Y103250D01*
+X462200Y102500D02*X464450D01*
+X461450Y103250D02*X462200Y102500D01*
+X461450Y104750D02*Y103250D01*
+Y104750D02*X462200Y105500D01*
+X463700D01*
+X464450Y104750D01*
+X461450Y104000D02*X464450D01*
+Y104750D02*Y104000D01*
+X469700Y108500D02*Y103250D01*
+X470450Y102500D01*
+X468950Y106250D02*X470450D01*
+X471950Y104750D02*Y103250D01*
+Y104750D02*X472700Y105500D01*
+X474200D01*
+X474950Y104750D01*
+Y103250D01*
+X474200Y102500D02*X474950Y103250D01*
+X472700Y102500D02*X474200D01*
+X471950Y103250D02*X472700Y102500D01*
+X480200Y108500D02*Y103250D01*
+X480950Y102500D01*
+X479450Y106250D02*X480950D01*
+X482450Y108500D02*Y102500D01*
+Y104750D02*X483200Y105500D01*
+X484700D01*
+X485450Y104750D01*
+Y102500D01*
+X488000D02*X490250D01*
+X487250Y103250D02*X488000Y102500D01*
+X487250Y104750D02*Y103250D01*
+Y104750D02*X488000Y105500D01*
+X489500D01*
+X490250Y104750D01*
+X487250Y104000D02*X490250D01*
+Y104750D02*Y104000D01*
+X494750Y103250D02*X495500Y102500D01*
+X494750Y107750D02*Y103250D01*
+Y107750D02*X495500Y108500D01*
+X497000D01*
+X497750Y107750D01*
+Y103250D01*
+X497000Y102500D02*X497750Y103250D01*
+X495500Y102500D02*X497000D01*
+X494750Y104000D02*X497750Y107000D01*
+X499550Y105500D02*X502550D01*
+X504350Y108500D02*Y102500D01*
+Y103250D02*X505100Y102500D01*
+X506600D01*
+X507350Y103250D01*
+Y104750D02*Y103250D01*
+X506600Y105500D02*X507350Y104750D01*
+X505100Y105500D02*X506600D01*
+X504350Y104750D02*X505100Y105500D01*
+X511400D02*X512150Y104750D01*
+X509900Y105500D02*X511400D01*
+X509150Y104750D02*X509900Y105500D01*
+X509150Y104750D02*Y103250D01*
+X509900Y102500D01*
+X512150Y105500D02*Y103250D01*
+X512900Y102500D01*
+X509900D02*X511400D01*
+X512150Y103250D01*
+X515450Y102500D02*X517700D01*
+X518450Y103250D01*
+X517700Y104000D02*X518450Y103250D01*
+X515450Y104000D02*X517700D01*
+X514700Y104750D02*X515450Y104000D01*
+X514700Y104750D02*X515450Y105500D01*
+X517700D01*
+X518450Y104750D01*
+X514700Y103250D02*X515450Y102500D01*
+X521000D02*X523250D01*
+X520250Y103250D02*X521000Y102500D01*
+X520250Y104750D02*Y103250D01*
+Y104750D02*X521000Y105500D01*
+X522500D01*
+X523250Y104750D01*
+X520250Y104000D02*X523250D01*
+Y104750D02*Y104000D01*
+G54D20*X527750Y107000D02*Y106850D01*
+G54D19*Y104750D02*Y102500D01*
+X530000Y104750D02*Y102500D01*
+Y104750D02*X530750Y105500D01*
+X531500D01*
+X532250Y104750D01*
+Y102500D01*
+X529250Y105500D02*X530000Y104750D01*
+X537050Y108500D02*Y102500D01*
+X536300D02*X537050Y103250D01*
+X534800Y102500D02*X536300D01*
+X534050Y103250D02*X534800Y102500D01*
+X534050Y104750D02*Y103250D01*
+Y104750D02*X534800Y105500D01*
+X536300D01*
+X537050Y104750D01*
+X539600Y102500D02*X541850D01*
+X538850Y103250D02*X539600Y102500D01*
+X538850Y104750D02*Y103250D01*
+Y104750D02*X539600Y105500D01*
+X541100D01*
+X541850Y104750D01*
+X538850Y104000D02*X541850D01*
+Y104750D02*Y104000D01*
+X543650Y105500D02*X546650Y102500D01*
+X543650D02*X546650Y105500D01*
+X551150Y104750D02*Y103250D01*
+Y104750D02*X551900Y105500D01*
+X553400D01*
+X554150Y104750D01*
+Y103250D01*
+X553400Y102500D02*X554150Y103250D01*
+X551900Y102500D02*X553400D01*
+X551150Y103250D02*X551900Y102500D01*
+X556700Y107750D02*Y102500D01*
+Y107750D02*X557450Y108500D01*
+X558200D01*
+X555950Y105500D02*X557450D01*
+X563150Y108500D02*Y103250D01*
+X563900Y102500D01*
+X562400Y106250D02*X563900D01*
+X565400Y108500D02*Y102500D01*
+Y104750D02*X566150Y105500D01*
+X567650D01*
+X568400Y104750D01*
+Y102500D01*
+X570950D02*X573200D01*
+X570200Y103250D02*X570950Y102500D01*
+X570200Y104750D02*Y103250D01*
+Y104750D02*X570950Y105500D01*
+X572450D01*
+X573200Y104750D01*
+X570200Y104000D02*X573200D01*
+Y104750D02*Y104000D01*
+X575750Y104750D02*Y102500D01*
+Y104750D02*X576500Y105500D01*
+X578000D01*
+X575000D02*X575750Y104750D01*
+X580550D02*Y102500D01*
+Y104750D02*X581300Y105500D01*
+X582050D01*
+X582800Y104750D01*
+Y102500D01*
+Y104750D02*X583550Y105500D01*
+X584300D01*
+X585050Y104750D01*
+Y102500D01*
+X579800Y105500D02*X580550Y104750D01*
+X589100Y105500D02*X589850Y104750D01*
+X587600Y105500D02*X589100D01*
+X586850Y104750D02*X587600Y105500D01*
+X586850Y104750D02*Y103250D01*
+X587600Y102500D01*
+X589850Y105500D02*Y103250D01*
+X590600Y102500D01*
+X587600D02*X589100D01*
+X589850Y103250D01*
+X592400Y108500D02*Y103250D01*
+X593150Y102500D01*
+X595400D02*X597650D01*
+X598400Y103250D01*
+X597650Y104000D02*X598400Y103250D01*
+X595400Y104000D02*X597650D01*
+X594650Y104750D02*X595400Y104000D01*
+X594650Y104750D02*X595400Y105500D01*
+X597650D01*
+X598400Y104750D01*
+X594650Y103250D02*X595400Y102500D01*
+X602900Y105500D02*X605900D01*
+X610400Y108500D02*Y102500D01*
+Y108500D02*X613400D01*
+X610400Y105800D02*X612650D01*
+X617450Y105500D02*X618200Y104750D01*
+X615950Y105500D02*X617450D01*
+X615200Y104750D02*X615950Y105500D01*
+X615200Y104750D02*Y103250D01*
+X615950Y102500D01*
+X618200Y105500D02*Y103250D01*
+X618950Y102500D01*
+X615950D02*X617450D01*
+X618200Y103250D01*
+X620750Y108500D02*Y102500D01*
+Y103250D02*X621500Y102500D01*
+X623000D01*
+X623750Y103250D01*
+Y104750D02*Y103250D01*
+X623000Y105500D02*X623750Y104750D01*
+X621500Y105500D02*X623000D01*
+X620750Y104750D02*X621500Y105500D01*
+X626300Y104750D02*Y102500D01*
+Y104750D02*X627050Y105500D01*
+X628550D01*
+X625550D02*X626300Y104750D01*
+G54D20*X630350Y107000D02*Y106850D01*
+G54D19*Y104750D02*Y102500D01*
+X632600Y105500D02*X634850D01*
+X631850Y104750D02*X632600Y105500D01*
+X631850Y104750D02*Y103250D01*
+X632600Y102500D01*
+X634850D01*
+X638901Y105500D02*X639651Y104750D01*
+X637401Y105500D02*X638901D01*
+X636651Y104750D02*X637401Y105500D01*
+X636651Y104750D02*Y103250D01*
+X637401Y102500D01*
+X639651Y105500D02*Y103250D01*
+X640401Y102500D01*
+X637401D02*X638901D01*
+X639651Y103250D01*
+X642951Y108500D02*Y103250D01*
+X643701Y102500D01*
+X642201Y106250D02*X643701D01*
+G54D20*X645201Y107000D02*Y106850D01*
+G54D19*Y104750D02*Y102500D01*
+X646701Y104750D02*Y103250D01*
+Y104750D02*X647451Y105500D01*
+X648951D01*
+X649701Y104750D01*
+Y103250D01*
+X648951Y102500D02*X649701Y103250D01*
+X647451Y102500D02*X648951D01*
+X646701Y103250D02*X647451Y102500D01*
+X652251Y104750D02*Y102500D01*
+Y104750D02*X653001Y105500D01*
+X653751D01*
+X654501Y104750D01*
+Y102500D01*
+X651501Y105500D02*X652251Y104750D01*
+X659751Y108500D02*Y102500D01*
+X661701Y108500D02*X662751Y107450D01*
+Y103550D01*
+X661701Y102500D02*X662751Y103550D01*
+X659001Y102500D02*X661701D01*
+X659001Y108500D02*X661701D01*
+X665301Y104750D02*Y102500D01*
+Y104750D02*X666051Y105500D01*
+X667551D01*
+X664551D02*X665301Y104750D01*
+X671601Y105500D02*X672351Y104750D01*
+X670101Y105500D02*X671601D01*
+X669351Y104750D02*X670101Y105500D01*
+X669351Y104750D02*Y103250D01*
+X670101Y102500D01*
+X672351Y105500D02*Y103250D01*
+X673101Y102500D01*
+X670101D02*X671601D01*
+X672351Y103250D01*
+X674901Y105500D02*Y103250D01*
+X675651Y102500D01*
+X676401D01*
+X677151Y103250D01*
+Y105500D02*Y103250D01*
+X677901Y102500D01*
+X678651D01*
+X679401Y103250D01*
+Y105500D02*Y103250D01*
+G54D20*X681201Y107000D02*Y106850D01*
+G54D19*Y104750D02*Y102500D01*
+X683451Y104750D02*Y102500D01*
+Y104750D02*X684201Y105500D01*
+X684951D01*
+X685701Y104750D01*
+Y102500D01*
+X682701Y105500D02*X683451Y104750D01*
+X689751Y105500D02*X690501Y104750D01*
+X688251Y105500D02*X689751D01*
+X687501Y104750D02*X688251Y105500D01*
+X687501Y104750D02*Y103250D01*
+X688251Y102500D01*
+X689751D01*
+X690501Y103250D01*
+X687501Y101000D02*X688251Y100250D01*
+X689751D01*
+X690501Y101000D01*
+Y105500D02*Y101000D01*
+M02*
diff --git a/tests/RTT/ref/thermal_last.gbr/thermal_last.group2.gbr b/tests/RTT/ref/thermal_last.gbr/thermal_last.group2.gbr
new file mode 100644
index 0000000..bfd2252
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.gbr/thermal_last.group2.gbr
@@ -0,0 +1,58 @@
+G04 start of page 2 for group 2 layer_idx 4 *
+G04 Title: thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNGROUP2*%
+%ADD13C,0.0315*%
+%ADD12C,0.0787*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X2500Y47500D02*X12500D01*
+Y45391D01*
+X11840Y45664D01*
+X10932Y45882D01*
+X10000Y45955D01*
+X9068Y45882D01*
+X8160Y45664D01*
+X7296Y45306D01*
+X6560Y44855D01*
+X8014Y43400D01*
+X8207Y43519D01*
+X8780Y43756D01*
+X9382Y43901D01*
+X10000Y43949D01*
+X10618Y43901D01*
+X11220Y43756D01*
+X11793Y43519D01*
+X11986Y43400D01*
+X12500Y43914D01*
+Y37500D01*
+X6086D01*
+X6600Y38014D01*
+X6481Y38207D01*
+X6244Y38780D01*
+X6099Y39382D01*
+X6051Y40000D01*
+X6099Y40618D01*
+X6244Y41220D01*
+X6481Y41793D01*
+X6600Y41986D01*
+X5145Y43440D01*
+X4694Y42704D01*
+X4336Y41840D01*
+X4118Y40932D01*
+X4045Y40000D01*
+X4118Y39068D01*
+X4336Y38160D01*
+X4609Y37500D01*
+X2500D01*
+Y47500D01*
+G37*
+G54D12*X10000Y40000D03*
+G54D13*M02*
diff --git a/tests/RTT/ref/thermal_last.gbr/thermal_last.group3.gbr b/tests/RTT/ref/thermal_last.gbr/thermal_last.group3.gbr
new file mode 100644
index 0000000..9ae4c0e
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.gbr/thermal_last.group3.gbr
@@ -0,0 +1,118 @@
+G04 start of page 3 for group 3 layer_idx 5 *
+G04 Title: thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNGROUP3*%
+%ADD16C,0.0315*%
+%ADD15C,0.0787*%
+%ADD14C,0.0001*%
+G54D14*G36*
+X7500Y42500D02*X13830D01*
+X13826Y42496D01*
+X13732Y42370D01*
+X13658Y42230D01*
+X13608Y42080D01*
+X13581Y41924D01*
+X13579Y41766D01*
+X13602Y41610D01*
+X13652Y41460D01*
+X13778Y41108D01*
+X13866Y40744D01*
+X13919Y40374D01*
+X13937Y40000D01*
+X13919Y39626D01*
+X13866Y39256D01*
+X13778Y38892D01*
+X13656Y38539D01*
+X13606Y38389D01*
+X13583Y38234D01*
+X13585Y38076D01*
+X13612Y37921D01*
+X13662Y37772D01*
+X13736Y37633D01*
+X13830Y37507D01*
+X13942Y37397D01*
+X14071Y37306D01*
+X14212Y37236D01*
+X14362Y37189D01*
+X14518Y37167D01*
+X14675Y37168D01*
+X14831Y37195D01*
+X14980Y37246D01*
+X15119Y37319D01*
+X15245Y37413D01*
+X15355Y37525D01*
+X15446Y37654D01*
+X15513Y37796D01*
+X15704Y38328D01*
+X15837Y38877D01*
+X15917Y39436D01*
+X15944Y40000D01*
+X15917Y40564D01*
+X15837Y41123D01*
+X15704Y41672D01*
+X15519Y42206D01*
+X15450Y42348D01*
+X15358Y42477D01*
+X15336Y42500D01*
+X17500D01*
+Y32500D01*
+X7500D01*
+Y34670D01*
+X7525Y34645D01*
+X7654Y34554D01*
+X7796Y34487D01*
+X8328Y34296D01*
+X8877Y34163D01*
+X9436Y34083D01*
+X10000Y34056D01*
+X10564Y34083D01*
+X11123Y34163D01*
+X11672Y34296D01*
+X12206Y34481D01*
+X12348Y34550D01*
+X12477Y34642D01*
+X12591Y34752D01*
+X12685Y34879D01*
+X12759Y35019D01*
+X12809Y35168D01*
+X12836Y35324D01*
+X12838Y35482D01*
+X12815Y35639D01*
+X12768Y35790D01*
+X12698Y35931D01*
+X12607Y36061D01*
+X12496Y36174D01*
+X12370Y36268D01*
+X12230Y36342D01*
+X12080Y36392D01*
+X11924Y36419D01*
+X11766Y36421D01*
+X11610Y36398D01*
+X11460Y36348D01*
+X11108Y36222D01*
+X10744Y36134D01*
+X10374Y36081D01*
+X10000Y36063D01*
+X9626Y36081D01*
+X9256Y36134D01*
+X8892Y36222D01*
+X8539Y36344D01*
+X8389Y36394D01*
+X8234Y36417D01*
+X8076Y36415D01*
+X7921Y36388D01*
+X7772Y36338D01*
+X7633Y36264D01*
+X7507Y36170D01*
+X7500Y36164D01*
+Y42500D01*
+G37*
+G54D15*X10000Y40000D03*
+G54D16*M02*
diff --git a/tests/RTT/ref/thermal_last.net b/tests/RTT/ref/thermal_last.net
new file mode 100644
index 0000000..a00822f
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.net
@@ -0,0 +1,13 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+317N/C VIA - D0315PA00X+001000Y+004000X0787Y0000R000 S3
+999
diff --git a/tests/RTT/ref/thermal_last.png b/tests/RTT/ref/thermal_last.png
new file mode 100644
index 0000000..473ba89
Binary files /dev/null and b/tests/RTT/ref/thermal_last.png differ
diff --git a/tests/RTT/ref/thermal_last.ps.gz b/tests/RTT/ref/thermal_last.ps.gz
new file mode 100644
index 0000000..ce830c6
Binary files /dev/null and b/tests/RTT/ref/thermal_last.ps.gz differ
diff --git a/tests/RTT/ref/thermal_last.remote.gz b/tests/RTT/ref/thermal_last.remote.gz
new file mode 100644
index 0000000..210355c
Binary files /dev/null and b/tests/RTT/ref/thermal_last.remote.gz differ
diff --git a/tests/RTT/ref/thermal_last.svg b/tests/RTT/ref/thermal_last.svg
new file mode 100644
index 0000000..ca5299c
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.svg
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+<!--normal-->
+ <polygon points="1.9050,1.9050 3.5128,1.9050 3.5119,1.9059 3.4879,1.9381 3.4692,1.9737 3.4563,2.0117 3.4495,2.0513 3.4490,2.0914 3.4548,2.1312 3.4675,2.1692 3.4996,2.2586 3.5220,2.3510 3.5355,2.4451 3.5400,2.5400 3.5355,2.6349 3.5220,2.7290 3.4996,2.8214 3.4686,2.9112 3.4559,2.9491 3.4502,2.9886 3.4507,3.0286 3.4574,3.0680 3.4702,3.1059 3.4888,3.1413 3.5127,3.1733 3.5414,3.2012 3.5740,3.2243 3.6098,3.2421 3.6480,3.2539 3.6876,3.2597 3.7275,3.2592 3.7670,3.2525 3.8048,3.2396 3.8402,3.221 [...]
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <polygon points="0.6350,0.6350 3.1750,0.6350 3.1750,1.1708 3.0074,1.1014 2.7766,1.0460 2.5400,1.0274 2.3034,1.0460 2.0726,1.1014 1.8533,1.1922 1.6661,1.3069 2.0355,1.6763 2.0846,1.6462 2.2300,1.5860 2.3831,1.5493 2.5400,1.5369 2.6969,1.5493 2.8500,1.5860 2.9954,1.6462 3.0445,1.6763 3.1750,1.5458 3.1750,3.1750 1.5458,3.1750 1.6763,3.0445 1.6462,2.9954 1.5860,2.8500 1.5493,2.6969 1.5369,2.5400 1.5493,2.3831 1.5860,2.2300 1.6462,2.0846 1.6763,2.0355 1.3069,1.6661 1.1922,1.8533 1.1014,2.072 [...]
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+<g id="layer_-4048_plated-drill">
+<!--normal-->
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/thermal_last.xy b/tests/RTT/ref/thermal_last.xy
new file mode 100644
index 0000000..22c58ef
--- /dev/null
+++ b/tests/RTT/ref/thermal_last.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/ref/thermal_layer.bom b/tests/RTT/ref/thermal_layer.bom
new file mode 100644
index 0000000..370d0e8
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.bom
@@ -0,0 +1,7 @@
+# $Id$
+# PcbBOM Version 1.0
+# Date: <date>
+# Author:
+# Title: thermals vs. multiple layer polygons - PCB BOM
+# Quantity, Description, Value, RefDes
+# --------------------------------------------
diff --git a/tests/RTT/ref/thermal_layer.dsn b/tests/RTT/ref/thermal_layer.dsn
new file mode 100644
index 0000000..26baf48
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.dsn
@@ -0,0 +1,85 @@
+(pcb thermals vs. multiple layer polygons
+ (parser
+ (string_quote ")
+ (space_in_quoted_tokens on)
+ (host_cad "gEDA pcb-rnd")
+ (host_version "<version>")
+ )
+ (resolution mm 1000000)
+ (structure
+ (layer "comp1"
+ (type signal)
+ )
+ (layer "inner1"
+ (type signal)
+ )
+ (layer "inner2"
+ (type signal)
+ )
+ (layer "outline"
+ (type signal)
+ )
+ (layer "solder1"
+ (type signal)
+ )
+ (boundary
+ (rect pcb 0.0 0.0 12.700000 12.700000)
+ )
+ (via via_685800_381000)
+ (rule
+ (width 0.2032)
+ (clear 0.2032)
+ (clear 0.2032 (type wire_area))
+ (clear 0.2032 (type via_smd via_pin))
+ (clear 0.2032 (type smd_smd))
+ (clear 0.2032 (type default_smd))
+ )
+ )
+ (placement
+ (component 5
+ (place 5 2.540000 10.160000 front 0 (PN 0))
+ )
+ (component 6
+ (place 6 6.985000 10.160000 front 0 (PN 0))
+ )
+ (component 7
+ (place 7 2.540000 5.715000 front 0 (PN 0))
+ )
+ (component 8
+ (place 8 6.985000 5.715000 front 0 (PN 0))
+ )
+ )
+ (library
+ (image 5
+ (pin Th_round_3015995 1 0 0)
+ )
+ (image 6
+ (pin Th_round_3015995 1 0 0)
+ )
+ (image 7
+ (pin Th_round_3015995 1 0 0)
+ )
+ (image 8
+ (pin Th_round_3015995 1 0 0)
+ )
+ (padstack Th_round_3015995
+ (shape (circle signal 3.015995))
+ (attach off)
+ )
+ (padstack via_685800_381000
+ (shape (circle signal 0.685800))
+ (attach off)
+ )
+ )
+ (network
+ (class geda_default
+ (circuit
+ (use_via via_685800_381000)
+ )
+ (rule (width 0.203200))
+ )
+ )
+ (wiring
+
+ )
+)
diff --git a/tests/RTT/ref/thermal_layer.gbr/thermal_layer.bottom.gbr b/tests/RTT/ref/thermal_layer.gbr/thermal_layer.bottom.gbr
new file mode 100644
index 0000000..440f7e3
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.gbr/thermal_layer.bottom.gbr
@@ -0,0 +1,67 @@
+G04 start of page 3 for group 1 layer_idx 1 *
+G04 Title: thermals vs. multiple layer polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNBOTTOM*%
+%ADD16C,0.0315*%
+%ADD15C,0.0787*%
+%ADD14C,0.0001*%
+G54D14*G36*
+X7500Y42500D02*X13914D01*
+X13400Y41986D01*
+X13519Y41793D01*
+X13756Y41220D01*
+X13901Y40618D01*
+X13937Y40000D01*
+X13901Y39382D01*
+X13756Y38780D01*
+X13519Y38207D01*
+X13400Y38014D01*
+X14855Y36560D01*
+X15306Y37296D01*
+X15664Y38160D01*
+X15882Y39068D01*
+X15937Y40000D01*
+X15882Y40932D01*
+X15664Y41840D01*
+X15391Y42500D01*
+X17500D01*
+Y32500D01*
+X7500D01*
+Y34609D01*
+X8160Y34336D01*
+X9068Y34118D01*
+X10000Y34045D01*
+X10932Y34118D01*
+X11840Y34336D01*
+X12704Y34694D01*
+X13440Y35145D01*
+X11986Y36600D01*
+X11793Y36481D01*
+X11220Y36244D01*
+X10618Y36099D01*
+X10000Y36051D01*
+X9382Y36099D01*
+X8780Y36244D01*
+X8207Y36481D01*
+X8014Y36600D01*
+X7500Y36086D01*
+Y42500D01*
+G37*
+G36*
+Y25000D02*X17500D01*
+Y15000D01*
+X7500D01*
+Y25000D01*
+G37*
+G54D15*X10000Y40000D03*
+X27500D03*
+X10000Y22500D03*
+X27500D03*
+G54D16*M02*
diff --git a/tests/RTT/ref/thermal_layer.gbr/thermal_layer.fab.gbr b/tests/RTT/ref/thermal_layer.gbr/thermal_layer.fab.gbr
new file mode 100644
index 0000000..8220add
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.gbr/thermal_layer.fab.gbr
@@ -0,0 +1,1896 @@
+G04 start of page 5 for group -1 layer_idx -1 *
+G04 Title: thermals vs. multiple layer polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNFAB*%
+%ADD21C,0.0100*%
+%ADD20C,0.0001*%
+%ADD19C,0.0060*%
+%ADD18C,0.0080*%
+G54D18*X10000Y40000D02*Y38400D01*
+Y40000D02*X11387Y40800D01*
+X10000Y40000D02*X8613Y40800D01*
+X27500Y40000D02*Y38400D01*
+Y40000D02*X28887Y40800D01*
+X27500Y40000D02*X26113Y40800D01*
+X10000Y22500D02*Y20900D01*
+Y22500D02*X11387Y23300D01*
+X10000Y22500D02*X8613Y23300D01*
+X27500Y22500D02*Y20900D01*
+Y22500D02*X28887Y23300D01*
+X27500Y22500D02*X26113Y23300D01*
+X15000Y106250D02*Y104650D01*
+Y106250D02*X16387Y107050D01*
+X15000Y106250D02*X13613Y107050D01*
+G54D19*X135000Y110000D02*X136500Y107000D01*
+X138000Y110000D01*
+X136500Y107000D02*Y104000D01*
+X139800Y107300D02*X142050D01*
+X139800Y104000D02*X142800D01*
+X139800Y110000D02*Y104000D01*
+Y110000D02*X142800D01*
+X147600D02*X148350Y109250D01*
+X145350Y110000D02*X147600D01*
+X144600Y109250D02*X145350Y110000D01*
+X144600Y109250D02*Y107750D01*
+X145350Y107000D01*
+X147600D01*
+X148350Y106250D01*
+Y104750D01*
+X147600Y104000D02*X148350Y104750D01*
+X145350Y104000D02*X147600D01*
+X144600Y104750D02*X145350Y104000D01*
+X98000Y106250D02*X101000Y110000D01*
+X98000Y106250D02*X101750D01*
+X101000Y110000D02*Y104000D01*
+G54D20*G36*
+X45000Y110000D02*Y104000D01*
+X49500D01*
+Y110000D01*
+X45000D01*
+G37*
+G36*
+X50400D02*Y104000D01*
+X54900D01*
+Y110000D01*
+X50400D01*
+G37*
+G36*
+X55800D02*Y104000D01*
+X60300D01*
+Y110000D01*
+X55800D01*
+G37*
+G54D19*X61200Y109250D02*X61950Y110000D01*
+X63450D01*
+X64200Y109250D01*
+X63450Y104000D02*X64200Y104750D01*
+X61950Y104000D02*X63450D01*
+X61200Y104750D02*X61950Y104000D01*
+Y107300D02*X63450D01*
+X64200Y109250D02*Y108050D01*
+Y106550D02*Y104750D01*
+Y106550D02*X63450Y107300D01*
+X64200Y108050D02*X63450Y107300D01*
+X66000Y109250D02*X66750Y110000D01*
+X69000D01*
+X69750Y109250D01*
+Y107750D01*
+X66000Y104000D02*X69750Y107750D01*
+X66000Y104000D02*X69750D01*
+X3000Y125000D02*X3750Y124250D01*
+X750Y125000D02*X3000D01*
+X0Y124250D02*X750Y125000D01*
+X0Y124250D02*Y122750D01*
+X750Y122000D01*
+X3000D01*
+X3750Y121250D01*
+Y119750D01*
+X3000Y119000D02*X3750Y119750D01*
+X750Y119000D02*X3000D01*
+X0Y119750D02*X750Y119000D01*
+G54D20*G36*
+X5550Y125000D02*Y119000D01*
+X10050D01*
+Y125000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y119000D01*
+X15450D01*
+Y125000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y119000D01*
+X20850D01*
+Y125000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y119000D01*
+X26250D01*
+Y125000D01*
+X21750D01*
+G37*
+G36*
+X27150D02*Y119000D01*
+X31650D01*
+Y125000D01*
+X27150D01*
+G37*
+G54D19*X0Y118000D02*X5550D01*
+X41750Y125000D02*Y119000D01*
+X43700Y125000D02*X44750Y123950D01*
+Y120050D01*
+X43700Y119000D02*X44750Y120050D01*
+X41000Y119000D02*X43700D01*
+X41000Y125000D02*X43700D01*
+G54D20*G36*
+X46550D02*Y119000D01*
+X51050D01*
+Y125000D01*
+X46550D01*
+G37*
+G36*
+X51950D02*Y119000D01*
+X56450D01*
+Y125000D01*
+X51950D01*
+G37*
+G36*
+X57350D02*Y119000D01*
+X61850D01*
+Y125000D01*
+X57350D01*
+G37*
+G36*
+X62750D02*Y119000D01*
+X67250D01*
+Y125000D01*
+X62750D01*
+G37*
+G36*
+X70850D02*Y119000D01*
+X75350D01*
+Y125000D01*
+X70850D01*
+G37*
+G54D19*X76250D02*X77750D01*
+X77000D02*Y119000D01*
+X76250D02*X77750D01*
+G54D20*G36*
+X79550Y125000D02*Y119000D01*
+X84050D01*
+Y125000D01*
+X79550D01*
+G37*
+G36*
+X84950D02*Y119000D01*
+X89450D01*
+Y125000D01*
+X84950D01*
+G37*
+G36*
+X90350D02*Y119000D01*
+X94850D01*
+Y125000D01*
+X90350D01*
+G37*
+G36*
+X95750D02*Y119000D01*
+X100250D01*
+Y125000D01*
+X95750D01*
+G37*
+G54D19*X41000Y118000D02*X52550D01*
+X96050Y119000D02*X98000D01*
+X95000Y120050D02*X96050Y119000D01*
+X95000Y123950D02*Y120050D01*
+Y123950D02*X96050Y125000D01*
+X98000D01*
+G54D20*G36*
+X99800D02*Y119000D01*
+X104300D01*
+Y125000D01*
+X99800D01*
+G37*
+G36*
+X105200D02*Y119000D01*
+X109700D01*
+Y125000D01*
+X105200D01*
+G37*
+G36*
+X110600D02*Y119000D01*
+X115100D01*
+Y125000D01*
+X110600D01*
+G37*
+G36*
+X116000D02*Y119000D01*
+X120500D01*
+Y125000D01*
+X116000D01*
+G37*
+G54D19*X95000Y118000D02*X99800D01*
+X130750Y125000D02*Y119000D01*
+X130000Y125000D02*X133000D01*
+X133750Y124250D01*
+Y122750D01*
+X133000Y122000D02*X133750Y122750D01*
+X130750Y122000D02*X133000D01*
+G54D20*G36*
+X135550Y125000D02*Y119000D01*
+X140050D01*
+Y125000D01*
+X135550D01*
+G37*
+G36*
+X140950D02*Y119000D01*
+X145450D01*
+Y125000D01*
+X140950D01*
+G37*
+G36*
+X146350D02*Y119000D01*
+X150850D01*
+Y125000D01*
+X146350D01*
+G37*
+G36*
+X151750D02*Y119000D01*
+X156250D01*
+Y125000D01*
+X151750D01*
+G37*
+G36*
+X157150D02*Y119000D01*
+X161650D01*
+Y125000D01*
+X157150D01*
+G37*
+G36*
+X162550D02*Y119000D01*
+X167050D01*
+Y125000D01*
+X162550D01*
+G37*
+G54D19*X130000Y118000D02*X135550D01*
+X0Y140000D02*X3000D01*
+X1500D02*Y134000D01*
+G54D20*G36*
+X4800Y140000D02*Y134000D01*
+X9300D01*
+Y140000D01*
+X4800D01*
+G37*
+G36*
+X10200D02*Y134000D01*
+X14700D01*
+Y140000D01*
+X10200D01*
+G37*
+G36*
+X15600D02*Y134000D01*
+X20100D01*
+Y140000D01*
+X15600D01*
+G37*
+G36*
+X21000D02*Y134000D01*
+X25500D01*
+Y140000D01*
+X21000D01*
+G37*
+G36*
+X29100D02*Y134000D01*
+X33600D01*
+Y140000D01*
+X29100D01*
+G37*
+G36*
+X34500D02*Y134000D01*
+X39000D01*
+Y140000D01*
+X34500D01*
+G37*
+G36*
+X39900D02*Y134000D01*
+X44400D01*
+Y140000D01*
+X39900D01*
+G37*
+G54D19*X48000Y138800D02*X49200Y140000D01*
+Y134000D01*
+X48000D02*X50250D01*
+G54D20*G36*
+X54750Y140000D02*Y134000D01*
+X59250D01*
+Y140000D01*
+X54750D01*
+G37*
+G36*
+X60150D02*Y134000D01*
+X64650D01*
+Y140000D01*
+X60150D01*
+G37*
+G36*
+X65550D02*Y134000D01*
+X70050D01*
+Y140000D01*
+X65550D01*
+G37*
+G36*
+X70950D02*Y134000D01*
+X75450D01*
+Y140000D01*
+X70950D01*
+G37*
+G36*
+X76350D02*Y134000D01*
+X80850D01*
+Y140000D01*
+X76350D01*
+G37*
+G36*
+X81750D02*Y134000D01*
+X86250D01*
+Y140000D01*
+X81750D01*
+G37*
+G36*
+X87150D02*Y134000D01*
+X91650D01*
+Y140000D01*
+X87150D01*
+G37*
+G36*
+X92550D02*Y134000D01*
+X97050D01*
+Y140000D01*
+X92550D01*
+G37*
+G36*
+X97950D02*Y134000D01*
+X102450D01*
+Y140000D01*
+X97950D01*
+G37*
+G36*
+X106050D02*Y134000D01*
+X110550D01*
+Y140000D01*
+X106050D01*
+G37*
+G36*
+X111450D02*Y134000D01*
+X115950D01*
+Y140000D01*
+X111450D01*
+G37*
+G36*
+X116850D02*Y134000D01*
+X121350D01*
+Y140000D01*
+X116850D01*
+G37*
+G36*
+X122250D02*Y134000D01*
+X126750D01*
+Y140000D01*
+X122250D01*
+G37*
+G36*
+X127650D02*Y134000D01*
+X132150D01*
+Y140000D01*
+X127650D01*
+G37*
+G36*
+X135750D02*Y134000D01*
+X140250D01*
+Y140000D01*
+X135750D01*
+G37*
+G36*
+X141150D02*Y134000D01*
+X145650D01*
+Y140000D01*
+X141150D01*
+G37*
+G36*
+X146550D02*Y134000D01*
+X151050D01*
+Y140000D01*
+X146550D01*
+G37*
+G36*
+X151950D02*Y134000D01*
+X156450D01*
+Y140000D01*
+X151950D01*
+G37*
+G36*
+X157350D02*Y134000D01*
+X161850D01*
+Y140000D01*
+X157350D01*
+G37*
+G36*
+X165450D02*Y134000D01*
+X169950D01*
+Y140000D01*
+X165450D01*
+G37*
+G36*
+X170850D02*Y134000D01*
+X175350D01*
+Y140000D01*
+X170850D01*
+G37*
+G36*
+X176250D02*Y134000D01*
+X180750D01*
+Y140000D01*
+X176250D01*
+G37*
+G36*
+X181650D02*Y134000D01*
+X186150D01*
+Y140000D01*
+X181650D01*
+G37*
+G36*
+X189750D02*Y134000D01*
+X194250D01*
+Y140000D01*
+X189750D01*
+G37*
+G36*
+X195150D02*Y134000D01*
+X199650D01*
+Y140000D01*
+X195150D01*
+G37*
+G36*
+X203250D02*Y134000D01*
+X207750D01*
+Y140000D01*
+X203250D01*
+G37*
+G36*
+X208650D02*Y134000D01*
+X213150D01*
+Y140000D01*
+X208650D01*
+G37*
+G36*
+X214050D02*Y134000D01*
+X218550D01*
+Y140000D01*
+X214050D01*
+G37*
+G36*
+X219450D02*Y134000D01*
+X223950D01*
+Y140000D01*
+X219450D01*
+G37*
+G36*
+X227550D02*Y134000D01*
+X232050D01*
+Y140000D01*
+X227550D01*
+G37*
+G36*
+X232950D02*Y134000D01*
+X237450D01*
+Y140000D01*
+X232950D01*
+G37*
+G36*
+X238350D02*Y134000D01*
+X242850D01*
+Y140000D01*
+X238350D01*
+G37*
+G36*
+X243750D02*Y134000D01*
+X248250D01*
+Y140000D01*
+X243750D01*
+G37*
+G36*
+X249150D02*Y134000D01*
+X253650D01*
+Y140000D01*
+X249150D01*
+G37*
+G36*
+X254550D02*Y134000D01*
+X259050D01*
+Y140000D01*
+X254550D01*
+G37*
+G36*
+X259950D02*Y134000D01*
+X264450D01*
+Y140000D01*
+X259950D01*
+G37*
+G54D19*X268050Y136250D02*X271050Y140000D01*
+X268050Y136250D02*X271800D01*
+X271050Y140000D02*Y134000D01*
+G54D20*G36*
+X276300Y140000D02*Y134000D01*
+X280800D01*
+Y140000D01*
+X276300D01*
+G37*
+G36*
+X281700D02*Y134000D01*
+X286200D01*
+Y140000D01*
+X281700D01*
+G37*
+G36*
+X287100D02*Y134000D01*
+X291600D01*
+Y140000D01*
+X287100D01*
+G37*
+G36*
+X292500D02*Y134000D01*
+X297000D01*
+Y140000D01*
+X292500D01*
+G37*
+G36*
+X297900D02*Y134000D01*
+X302400D01*
+Y140000D01*
+X297900D01*
+G37*
+G36*
+X306000D02*Y134000D01*
+X310500D01*
+Y140000D01*
+X306000D01*
+G37*
+G36*
+X311400D02*Y134000D01*
+X315900D01*
+Y140000D01*
+X311400D01*
+G37*
+G36*
+X316800D02*Y134000D01*
+X321300D01*
+Y140000D01*
+X316800D01*
+G37*
+G36*
+X322200D02*Y134000D01*
+X326700D01*
+Y140000D01*
+X322200D01*
+G37*
+G36*
+X327600D02*Y134000D01*
+X332100D01*
+Y140000D01*
+X327600D01*
+G37*
+G54D21*X0Y50000D02*X50000D01*
+X0D02*Y0D01*
+X50000Y50000D02*Y0D01*
+X0D02*X50000D01*
+G54D19*X200000Y65000D02*Y59000D01*
+Y65000D02*X202250Y62000D01*
+X204500Y65000D01*
+Y59000D01*
+G54D20*G36*
+X206300Y65000D02*Y59000D01*
+X210800D01*
+Y65000D01*
+X206300D01*
+G37*
+G36*
+X211700D02*Y59000D01*
+X216200D01*
+Y65000D01*
+X211700D01*
+G37*
+G36*
+X217100D02*Y59000D01*
+X221600D01*
+Y65000D01*
+X217100D01*
+G37*
+G36*
+X222500D02*Y59000D01*
+X227000D01*
+Y65000D01*
+X222500D01*
+G37*
+G36*
+X227900D02*Y59000D01*
+X232400D01*
+Y65000D01*
+X227900D01*
+G37*
+G36*
+X233300D02*Y59000D01*
+X237800D01*
+Y65000D01*
+X233300D01*
+G37*
+G54D19*X242150D02*Y59000D01*
+X244100Y65000D02*X245150Y63950D01*
+Y60050D01*
+X244100Y59000D02*X245150Y60050D01*
+X241400Y59000D02*X244100D01*
+X241400Y65000D02*X244100D01*
+G54D20*G36*
+X246950D02*Y59000D01*
+X251450D01*
+Y65000D01*
+X246950D01*
+G37*
+G36*
+X252350D02*Y59000D01*
+X256850D01*
+Y65000D01*
+X252350D01*
+G37*
+G36*
+X257750D02*Y59000D01*
+X262250D01*
+Y65000D01*
+X257750D01*
+G37*
+G36*
+X263150D02*Y59000D01*
+X267650D01*
+Y65000D01*
+X263150D01*
+G37*
+G36*
+X268550D02*Y59000D01*
+X273050D01*
+Y65000D01*
+X268550D01*
+G37*
+G36*
+X273950D02*Y59000D01*
+X278450D01*
+Y65000D01*
+X273950D01*
+G37*
+G36*
+X279350D02*Y59000D01*
+X283850D01*
+Y65000D01*
+X279350D01*
+G37*
+G36*
+X284750D02*Y59000D01*
+X289250D01*
+Y65000D01*
+X284750D01*
+G37*
+G36*
+X290150D02*Y59000D01*
+X294650D01*
+Y65000D01*
+X290150D01*
+G37*
+G36*
+X295550D02*Y59000D01*
+X300050D01*
+Y65000D01*
+X295550D01*
+G37*
+G54D19*X303650D02*X306650D01*
+X303650D02*Y62000D01*
+X304400Y62750D01*
+X305900D01*
+X306650Y62000D01*
+Y59750D01*
+X305900Y59000D02*X306650Y59750D01*
+X304400Y59000D02*X305900D01*
+X303650Y59750D02*X304400Y59000D01*
+G54D20*G36*
+X308450Y65000D02*Y59000D01*
+X312950D01*
+Y65000D01*
+X308450D01*
+G37*
+G36*
+X313850D02*Y59000D01*
+X318350D01*
+Y65000D01*
+X313850D01*
+G37*
+G36*
+X319250D02*Y59000D01*
+X323750D01*
+Y65000D01*
+X319250D01*
+G37*
+G36*
+X324650D02*Y59000D01*
+X329150D01*
+Y65000D01*
+X324650D01*
+G37*
+G36*
+X330050D02*Y59000D01*
+X334550D01*
+Y65000D01*
+X330050D01*
+G37*
+G36*
+X335450D02*Y59000D01*
+X339950D01*
+Y65000D01*
+X335450D01*
+G37*
+G36*
+X340850D02*Y59000D01*
+X345350D01*
+Y65000D01*
+X340850D01*
+G37*
+G36*
+X346250D02*Y59000D01*
+X350750D01*
+Y65000D01*
+X346250D01*
+G37*
+G36*
+X351650D02*Y59000D01*
+X356150D01*
+Y65000D01*
+X351650D01*
+G37*
+G36*
+X359750D02*Y59000D01*
+X364250D01*
+Y65000D01*
+X359750D01*
+G37*
+G36*
+X365150D02*Y59000D01*
+X369650D01*
+Y65000D01*
+X365150D01*
+G37*
+G36*
+X370550D02*Y59000D01*
+X375050D01*
+Y65000D01*
+X370550D01*
+G37*
+G36*
+X375950D02*Y59000D01*
+X380450D01*
+Y65000D01*
+X375950D01*
+G37*
+G36*
+X384050D02*Y59000D01*
+X388550D01*
+Y65000D01*
+X384050D01*
+G37*
+G36*
+X389450D02*Y59000D01*
+X393950D01*
+Y65000D01*
+X389450D01*
+G37*
+G36*
+X394850D02*Y59000D01*
+X399350D01*
+Y65000D01*
+X394850D01*
+G37*
+G36*
+X400250D02*Y59000D01*
+X404750D01*
+Y65000D01*
+X400250D01*
+G37*
+G36*
+X405650D02*Y59000D01*
+X410150D01*
+Y65000D01*
+X405650D01*
+G37*
+G54D19*X413750D02*X416750D01*
+X413750D02*Y62000D01*
+X414500Y62750D01*
+X416000D01*
+X416750Y62000D01*
+Y59750D01*
+X416000Y59000D02*X416750Y59750D01*
+X414500Y59000D02*X416000D01*
+X413750Y59750D02*X414500Y59000D01*
+G54D20*G36*
+X418550Y65000D02*Y59000D01*
+X423050D01*
+Y65000D01*
+X418550D01*
+G37*
+G36*
+X423950D02*Y59000D01*
+X428450D01*
+Y65000D01*
+X423950D01*
+G37*
+G36*
+X429350D02*Y59000D01*
+X433850D01*
+Y65000D01*
+X429350D01*
+G37*
+G36*
+X434750D02*Y59000D01*
+X439250D01*
+Y65000D01*
+X434750D01*
+G37*
+G36*
+X440150D02*Y59000D01*
+X444650D01*
+Y65000D01*
+X440150D01*
+G37*
+G36*
+X445550D02*Y59000D01*
+X450050D01*
+Y65000D01*
+X445550D01*
+G37*
+G36*
+X450950D02*Y59000D01*
+X455450D01*
+Y65000D01*
+X450950D01*
+G37*
+G36*
+X456350D02*Y59000D01*
+X460850D01*
+Y65000D01*
+X456350D01*
+G37*
+G36*
+X461750D02*Y59000D01*
+X466250D01*
+Y65000D01*
+X461750D01*
+G37*
+G36*
+X469850D02*Y59000D01*
+X474350D01*
+Y65000D01*
+X469850D01*
+G37*
+G36*
+X475250D02*Y59000D01*
+X479750D01*
+Y65000D01*
+X475250D01*
+G37*
+G36*
+X480650D02*Y59000D01*
+X485150D01*
+Y65000D01*
+X480650D01*
+G37*
+G36*
+X486050D02*Y59000D01*
+X490550D01*
+Y65000D01*
+X486050D01*
+G37*
+G36*
+X494150D02*Y59000D01*
+X498650D01*
+Y65000D01*
+X494150D01*
+G37*
+G36*
+X499550D02*Y59000D01*
+X504050D01*
+Y65000D01*
+X499550D01*
+G37*
+G36*
+X504950D02*Y59000D01*
+X509450D01*
+Y65000D01*
+X504950D01*
+G37*
+G36*
+X510350D02*Y59000D01*
+X514850D01*
+Y65000D01*
+X510350D01*
+G37*
+G54D19*X0Y-8000D02*X3000D01*
+X3750Y-7250D01*
+Y-5450D02*Y-7250D01*
+X3000Y-4700D02*X3750Y-5450D01*
+X750Y-4700D02*X3000D01*
+X750Y-2000D02*Y-8000D01*
+X0Y-2000D02*X3000D01*
+X3750Y-2750D01*
+Y-3950D01*
+X3000Y-4700D02*X3750Y-3950D01*
+G54D20*G36*
+X5550Y-2000D02*Y-8000D01*
+X10050D01*
+Y-2000D01*
+X5550D01*
+G37*
+G36*
+X10950D02*Y-8000D01*
+X15450D01*
+Y-2000D01*
+X10950D01*
+G37*
+G36*
+X16350D02*Y-8000D01*
+X20850D01*
+Y-2000D01*
+X16350D01*
+G37*
+G36*
+X21750D02*Y-8000D01*
+X26250D01*
+Y-2000D01*
+X21750D01*
+G37*
+G36*
+X29850D02*Y-8000D01*
+X34350D01*
+Y-2000D01*
+X29850D01*
+G37*
+G36*
+X35250D02*Y-8000D01*
+X39750D01*
+Y-2000D01*
+X35250D01*
+G37*
+G36*
+X40650D02*Y-8000D01*
+X45150D01*
+Y-2000D01*
+X40650D01*
+G37*
+G36*
+X46050D02*Y-8000D01*
+X50550D01*
+Y-2000D01*
+X46050D01*
+G37*
+G36*
+X51450D02*Y-8000D01*
+X55950D01*
+Y-2000D01*
+X51450D01*
+G37*
+G36*
+X56850D02*Y-8000D01*
+X61350D01*
+Y-2000D01*
+X56850D01*
+G37*
+G36*
+X62250D02*Y-8000D01*
+X66750D01*
+Y-2000D01*
+X62250D01*
+G37*
+G36*
+X70350D02*Y-8000D01*
+X74850D01*
+Y-2000D01*
+X70350D01*
+G37*
+G36*
+X75750D02*Y-8000D01*
+X80250D01*
+Y-2000D01*
+X75750D01*
+G37*
+G36*
+X83850D02*Y-8000D01*
+X88350D01*
+Y-2000D01*
+X83850D01*
+G37*
+G36*
+X89250D02*Y-8000D01*
+X93750D01*
+Y-2000D01*
+X89250D01*
+G37*
+G36*
+X94650D02*Y-8000D01*
+X99150D01*
+Y-2000D01*
+X94650D01*
+G37*
+G36*
+X102750D02*Y-8000D01*
+X107250D01*
+Y-2000D01*
+X102750D01*
+G37*
+G36*
+X108150D02*Y-8000D01*
+X112650D01*
+Y-2000D01*
+X108150D01*
+G37*
+G36*
+X113550D02*Y-8000D01*
+X118050D01*
+Y-2000D01*
+X113550D01*
+G37*
+G36*
+X118950D02*Y-8000D01*
+X123450D01*
+Y-2000D01*
+X118950D01*
+G37*
+G36*
+X124350D02*Y-8000D01*
+X128850D01*
+Y-2000D01*
+X124350D01*
+G37*
+G36*
+X129750D02*Y-8000D01*
+X134250D01*
+Y-2000D01*
+X129750D01*
+G37*
+G36*
+X135150D02*Y-8000D01*
+X139650D01*
+Y-2000D01*
+X135150D01*
+G37*
+G36*
+X140550D02*Y-8000D01*
+X145050D01*
+Y-2000D01*
+X140550D01*
+G37*
+G36*
+X145950D02*Y-8000D01*
+X150450D01*
+Y-2000D01*
+X145950D01*
+G37*
+G36*
+X151350D02*Y-8000D01*
+X155850D01*
+Y-2000D01*
+X151350D01*
+G37*
+G36*
+X159450D02*Y-8000D01*
+X163950D01*
+Y-2000D01*
+X159450D01*
+G37*
+G36*
+X164850D02*Y-8000D01*
+X169350D01*
+Y-2000D01*
+X164850D01*
+G37*
+G36*
+X172950D02*Y-8000D01*
+X177450D01*
+Y-2000D01*
+X172950D01*
+G37*
+G36*
+X178350D02*Y-8000D01*
+X182850D01*
+Y-2000D01*
+X178350D01*
+G37*
+G36*
+X183750D02*Y-8000D01*
+X188250D01*
+Y-2000D01*
+X183750D01*
+G37*
+G36*
+X189150D02*Y-8000D01*
+X193650D01*
+Y-2000D01*
+X189150D01*
+G37*
+G54D19*X197250Y-7250D02*X198000Y-8000D01*
+X197250Y-6050D02*Y-7250D01*
+Y-6050D02*X198300Y-5000D01*
+X199200D01*
+X200250Y-6050D01*
+Y-7250D01*
+X199500Y-8000D02*X200250Y-7250D01*
+X198000Y-8000D02*X199500D01*
+X197250Y-3950D02*X198300Y-5000D01*
+X197250Y-2750D02*Y-3950D01*
+Y-2750D02*X198000Y-2000D01*
+X199500D01*
+X200250Y-2750D01*
+Y-3950D01*
+X199200Y-5000D02*X200250Y-3950D01*
+G54D20*G36*
+X202050Y-2000D02*Y-8000D01*
+X206550D01*
+Y-2000D01*
+X202050D01*
+G37*
+G36*
+X207450D02*Y-8000D01*
+X211950D01*
+Y-2000D01*
+X207450D01*
+G37*
+G36*
+X212850D02*Y-8000D01*
+X217350D01*
+Y-2000D01*
+X212850D01*
+G37*
+G36*
+X218250D02*Y-8000D01*
+X222750D01*
+Y-2000D01*
+X218250D01*
+G37*
+G36*
+X223650D02*Y-8000D01*
+X228150D01*
+Y-2000D01*
+X223650D01*
+G37*
+G36*
+X229050D02*Y-8000D01*
+X233550D01*
+Y-2000D01*
+X229050D01*
+G37*
+G36*
+X234450D02*Y-8000D01*
+X238950D01*
+Y-2000D01*
+X234450D01*
+G37*
+G36*
+X242550D02*Y-8000D01*
+X247050D01*
+Y-2000D01*
+X242550D01*
+G37*
+G36*
+X247950D02*Y-8000D01*
+X252450D01*
+Y-2000D01*
+X247950D01*
+G37*
+G36*
+X253350D02*Y-8000D01*
+X257850D01*
+Y-2000D01*
+X253350D01*
+G37*
+G36*
+X261450D02*Y-8000D01*
+X265950D01*
+Y-2000D01*
+X261450D01*
+G37*
+G36*
+X266850D02*Y-8000D01*
+X271350D01*
+Y-2000D01*
+X266850D01*
+G37*
+G36*
+X272250D02*Y-8000D01*
+X276750D01*
+Y-2000D01*
+X272250D01*
+G37*
+G36*
+X277650D02*Y-8000D01*
+X282150D01*
+Y-2000D01*
+X277650D01*
+G37*
+G36*
+X283050D02*Y-8000D01*
+X287550D01*
+Y-2000D01*
+X283050D01*
+G37*
+G36*
+X288450D02*Y-8000D01*
+X292950D01*
+Y-2000D01*
+X288450D01*
+G37*
+G36*
+X293850D02*Y-8000D01*
+X298350D01*
+Y-2000D01*
+X293850D01*
+G37*
+G36*
+X299250D02*Y-8000D01*
+X303750D01*
+Y-2000D01*
+X299250D01*
+G37*
+G36*
+X304650D02*Y-8000D01*
+X309150D01*
+Y-2000D01*
+X304650D01*
+G37*
+G36*
+X312750D02*Y-8000D01*
+X317250D01*
+Y-2000D01*
+X312750D01*
+G37*
+G36*
+X320850D02*Y-8000D01*
+X325350D01*
+Y-2000D01*
+X320850D01*
+G37*
+G36*
+X326250D02*Y-8000D01*
+X330750D01*
+Y-2000D01*
+X326250D01*
+G37*
+G36*
+X331650D02*Y-8000D01*
+X336150D01*
+Y-2000D01*
+X331650D01*
+G37*
+G36*
+X339750D02*Y-8000D01*
+X344250D01*
+Y-2000D01*
+X339750D01*
+G37*
+G36*
+X345150D02*Y-8000D01*
+X349650D01*
+Y-2000D01*
+X345150D01*
+G37*
+G54D19*X353250D02*X356250D01*
+X353250D02*Y-5000D01*
+X354000Y-4250D01*
+X355500D01*
+X356250Y-5000D01*
+Y-7250D01*
+X355500Y-8000D02*X356250Y-7250D01*
+X354000Y-8000D02*X355500D01*
+X353250Y-7250D02*X354000Y-8000D01*
+G54D20*G36*
+X358050Y-2000D02*Y-8000D01*
+X362550D01*
+Y-2000D01*
+X358050D01*
+G37*
+G36*
+X363450D02*Y-8000D01*
+X367950D01*
+Y-2000D01*
+X363450D01*
+G37*
+G36*
+X368850D02*Y-8000D01*
+X373350D01*
+Y-2000D01*
+X368850D01*
+G37*
+G36*
+X374250D02*Y-8000D01*
+X378750D01*
+Y-2000D01*
+X374250D01*
+G37*
+G36*
+X379650D02*Y-8000D01*
+X384150D01*
+Y-2000D01*
+X379650D01*
+G37*
+G36*
+X385050D02*Y-8000D01*
+X389550D01*
+Y-2000D01*
+X385050D01*
+G37*
+G36*
+X390450D02*Y-8000D01*
+X394950D01*
+Y-2000D01*
+X390450D01*
+G37*
+G36*
+X395850D02*Y-8000D01*
+X400350D01*
+Y-2000D01*
+X395850D01*
+G37*
+G36*
+X401250D02*Y-8000D01*
+X405750D01*
+Y-2000D01*
+X401250D01*
+G37*
+G36*
+X406650D02*Y-8000D01*
+X411150D01*
+Y-2000D01*
+X406650D01*
+G37*
+G54D19*X412050D02*X415050D01*
+X412050D02*Y-5000D01*
+X412800Y-4250D01*
+X414300D01*
+X415050Y-5000D01*
+Y-7250D01*
+X414300Y-8000D02*X415050Y-7250D01*
+X412800Y-8000D02*X414300D01*
+X412050Y-7250D02*X412800Y-8000D01*
+G54D20*G36*
+X416850Y-2000D02*Y-8000D01*
+X421350D01*
+Y-2000D01*
+X416850D01*
+G37*
+G36*
+X422250D02*Y-8000D01*
+X426750D01*
+Y-2000D01*
+X422250D01*
+G37*
+G36*
+X427650D02*Y-8000D01*
+X432150D01*
+Y-2000D01*
+X427650D01*
+G37*
+G36*
+X433050D02*Y-8000D01*
+X437550D01*
+Y-2000D01*
+X433050D01*
+G37*
+G36*
+X438450D02*Y-8000D01*
+X442950D01*
+Y-2000D01*
+X438450D01*
+G37*
+G36*
+X443850D02*Y-8000D01*
+X448350D01*
+Y-2000D01*
+X443850D01*
+G37*
+G36*
+X449250D02*Y-8000D01*
+X453750D01*
+Y-2000D01*
+X449250D01*
+G37*
+G36*
+X454650D02*Y-8000D01*
+X459150D01*
+Y-2000D01*
+X454650D01*
+G37*
+G36*
+X460050D02*Y-8000D01*
+X464550D01*
+Y-2000D01*
+X460050D01*
+G37*
+G36*
+X468150D02*Y-8000D01*
+X472650D01*
+Y-2000D01*
+X468150D01*
+G37*
+G36*
+X473550D02*Y-8000D01*
+X478050D01*
+Y-2000D01*
+X473550D01*
+G37*
+G36*
+X478950D02*Y-8000D01*
+X483450D01*
+Y-2000D01*
+X478950D01*
+G37*
+G36*
+X484350D02*Y-8000D01*
+X488850D01*
+Y-2000D01*
+X484350D01*
+G37*
+G54D19*X200750Y80000D02*Y74000D01*
+X202700Y80000D02*X203750Y78950D01*
+Y75050D01*
+X202700Y74000D02*X203750Y75050D01*
+X200000Y74000D02*X202700D01*
+X200000Y80000D02*X202700D01*
+G54D20*G36*
+X205550D02*Y74000D01*
+X210050D01*
+Y80000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y74000D01*
+X215450D01*
+Y80000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y74000D01*
+X220850D01*
+Y80000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y74000D01*
+X226250D01*
+Y80000D01*
+X221750D01*
+G37*
+G36*
+X229850D02*Y74000D01*
+X234350D01*
+Y80000D01*
+X229850D01*
+G37*
+G36*
+X235250D02*Y74000D01*
+X239750D01*
+Y80000D01*
+X235250D01*
+G37*
+G36*
+X240650D02*Y74000D01*
+X245150D01*
+Y80000D01*
+X240650D01*
+G37*
+G36*
+X246050D02*Y74000D01*
+X250550D01*
+Y80000D01*
+X246050D01*
+G37*
+G36*
+X251450D02*Y74000D01*
+X255950D01*
+Y80000D01*
+X251450D01*
+G37*
+G36*
+X256850D02*Y74000D01*
+X261350D01*
+Y80000D01*
+X256850D01*
+G37*
+G54D19*X200000Y93500D02*Y89000D01*
+Y93500D02*X201050Y95000D01*
+X202700D01*
+X203750Y93500D01*
+Y89000D01*
+X200000Y92000D02*X203750D01*
+G54D20*G36*
+X205550Y95000D02*Y89000D01*
+X210050D01*
+Y95000D01*
+X205550D01*
+G37*
+G36*
+X210950D02*Y89000D01*
+X215450D01*
+Y95000D01*
+X210950D01*
+G37*
+G36*
+X216350D02*Y89000D01*
+X220850D01*
+Y95000D01*
+X216350D01*
+G37*
+G36*
+X221750D02*Y89000D01*
+X226250D01*
+Y95000D01*
+X221750D01*
+G37*
+G36*
+X227150D02*Y89000D01*
+X231650D01*
+Y95000D01*
+X227150D01*
+G37*
+G36*
+X232550D02*Y89000D01*
+X237050D01*
+Y95000D01*
+X232550D01*
+G37*
+G54D19*X200000Y110000D02*X203000D01*
+X201500D02*Y104000D01*
+G54D20*G36*
+X204800Y110000D02*Y104000D01*
+X209300D01*
+Y110000D01*
+X204800D01*
+G37*
+G36*
+X210200D02*Y104000D01*
+X214700D01*
+Y110000D01*
+X210200D01*
+G37*
+G36*
+X215600D02*Y104000D01*
+X220100D01*
+Y110000D01*
+X215600D01*
+G37*
+G36*
+X221000D02*Y104000D01*
+X225500D01*
+Y110000D01*
+X221000D01*
+G37*
+G36*
+X226400D02*Y104000D01*
+X230900D01*
+Y110000D01*
+X226400D01*
+G37*
+G36*
+X234500D02*Y104000D01*
+X239000D01*
+Y110000D01*
+X234500D01*
+G37*
+G36*
+X239900D02*Y104000D01*
+X244400D01*
+Y110000D01*
+X239900D01*
+G37*
+G36*
+X245300D02*Y104000D01*
+X249800D01*
+Y110000D01*
+X245300D01*
+G37*
+G36*
+X250700D02*Y104000D01*
+X255200D01*
+Y110000D01*
+X250700D01*
+G37*
+G36*
+X256100D02*Y104000D01*
+X260600D01*
+Y110000D01*
+X256100D01*
+G37*
+G36*
+X261500D02*Y104000D01*
+X266000D01*
+Y110000D01*
+X261500D01*
+G37*
+G36*
+X266900D02*Y104000D01*
+X271400D01*
+Y110000D01*
+X266900D01*
+G37*
+G36*
+X272300D02*Y104000D01*
+X276800D01*
+Y110000D01*
+X272300D01*
+G37*
+G36*
+X280400D02*Y104000D01*
+X284900D01*
+Y110000D01*
+X280400D01*
+G37*
+G36*
+X285800D02*Y104000D01*
+X290300D01*
+Y110000D01*
+X285800D01*
+G37*
+G36*
+X291200D02*Y104000D01*
+X295700D01*
+Y110000D01*
+X291200D01*
+G37*
+G36*
+X299300D02*Y104000D01*
+X303800D01*
+Y110000D01*
+X299300D01*
+G37*
+G36*
+X304700D02*Y104000D01*
+X309200D01*
+Y110000D01*
+X304700D01*
+G37*
+G36*
+X310100D02*Y104000D01*
+X314600D01*
+Y110000D01*
+X310100D01*
+G37*
+G36*
+X315500D02*Y104000D01*
+X320000D01*
+Y110000D01*
+X315500D01*
+G37*
+G36*
+X320900D02*Y104000D01*
+X325400D01*
+Y110000D01*
+X320900D01*
+G37*
+G36*
+X326300D02*Y104000D01*
+X330800D01*
+Y110000D01*
+X326300D01*
+G37*
+G36*
+X331700D02*Y104000D01*
+X336200D01*
+Y110000D01*
+X331700D01*
+G37*
+G36*
+X337100D02*Y104000D01*
+X341600D01*
+Y110000D01*
+X337100D01*
+G37*
+G36*
+X345200D02*Y104000D01*
+X349700D01*
+Y110000D01*
+X345200D01*
+G37*
+G36*
+X350600D02*Y104000D01*
+X355100D01*
+Y110000D01*
+X350600D01*
+G37*
+G36*
+X356000D02*Y104000D01*
+X360500D01*
+Y110000D01*
+X356000D01*
+G37*
+G36*
+X361400D02*Y104000D01*
+X365900D01*
+Y110000D01*
+X361400D01*
+G37*
+G36*
+X366800D02*Y104000D01*
+X371300D01*
+Y110000D01*
+X366800D01*
+G37*
+G36*
+X374900D02*Y104000D01*
+X379400D01*
+Y110000D01*
+X374900D01*
+G37*
+G36*
+X380300D02*Y104000D01*
+X384800D01*
+Y110000D01*
+X380300D01*
+G37*
+G36*
+X385700D02*Y104000D01*
+X390200D01*
+Y110000D01*
+X385700D01*
+G37*
+G36*
+X391100D02*Y104000D01*
+X395600D01*
+Y110000D01*
+X391100D01*
+G37*
+G36*
+X396500D02*Y104000D01*
+X401000D01*
+Y110000D01*
+X396500D01*
+G37*
+G36*
+X401900D02*Y104000D01*
+X406400D01*
+Y110000D01*
+X401900D01*
+G37*
+G36*
+X407300D02*Y104000D01*
+X411800D01*
+Y110000D01*
+X407300D01*
+G37*
+G36*
+X412700D02*Y104000D01*
+X417200D01*
+Y110000D01*
+X412700D01*
+G37*
+G36*
+X420800D02*Y104000D01*
+X425300D01*
+Y110000D01*
+X420800D01*
+G37*
+G54D19*X428900D02*Y104000D01*
+Y110000D02*X431900D01*
+X428900Y107300D02*X431150D01*
+G54D20*G36*
+X433700Y110000D02*Y104000D01*
+X438200D01*
+Y110000D01*
+X433700D01*
+G37*
+G36*
+X439100D02*Y104000D01*
+X443600D01*
+Y110000D01*
+X439100D01*
+G37*
+G36*
+X444500D02*Y104000D01*
+X449000D01*
+Y110000D01*
+X444500D01*
+G37*
+G36*
+X449900D02*Y104000D01*
+X454400D01*
+Y110000D01*
+X449900D01*
+G37*
+G36*
+X455300D02*Y104000D01*
+X459800D01*
+Y110000D01*
+X455300D01*
+G37*
+G36*
+X460700D02*Y104000D01*
+X465200D01*
+Y110000D01*
+X460700D01*
+G37*
+G36*
+X466100D02*Y104000D01*
+X470600D01*
+Y110000D01*
+X466100D01*
+G37*
+G36*
+X471500D02*Y104000D01*
+X476000D01*
+Y110000D01*
+X471500D01*
+G37*
+G36*
+X476900D02*Y104000D01*
+X481400D01*
+Y110000D01*
+X476900D01*
+G37*
+G36*
+X482300D02*Y104000D01*
+X486800D01*
+Y110000D01*
+X482300D01*
+G37*
+G54D19*X491150D02*Y104000D01*
+X493100Y110000D02*X494150Y108950D01*
+Y105050D01*
+X493100Y104000D02*X494150Y105050D01*
+X490400Y104000D02*X493100D01*
+X490400Y110000D02*X493100D01*
+G54D20*G36*
+X495950D02*Y104000D01*
+X500450D01*
+Y110000D01*
+X495950D01*
+G37*
+G36*
+X501350D02*Y104000D01*
+X505850D01*
+Y110000D01*
+X501350D01*
+G37*
+G36*
+X506750D02*Y104000D01*
+X511250D01*
+Y110000D01*
+X506750D01*
+G37*
+G36*
+X512150D02*Y104000D01*
+X516650D01*
+Y110000D01*
+X512150D01*
+G37*
+G36*
+X517550D02*Y104000D01*
+X522050D01*
+Y110000D01*
+X517550D01*
+G37*
+G36*
+X522950D02*Y104000D01*
+X527450D01*
+Y110000D01*
+X522950D01*
+G37*
+M02*
diff --git a/tests/RTT/ref/thermal_layer.gbr/thermal_layer.top.gbr b/tests/RTT/ref/thermal_layer.gbr/thermal_layer.top.gbr
new file mode 100644
index 0000000..7dad94e
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.gbr/thermal_layer.top.gbr
@@ -0,0 +1,315 @@
+G04 start of page 2 for group 0 layer_idx 0 *
+G04 Title: thermals vs. multiple layer polygons, TODO:group_name *
+G04 Creator: <version>
+G04 CreationDate: <date>
+G04 For: *
+G04 Format: Gerber/RS-274X *
+G04 PCB-Dimensions: 50000 50000 *
+G04 PCB-Coordinate-Origin: lower left *
+%MOIN*%
+%FSLAX25Y25*%
+%LNTOP*%
+%ADD13C,0.0315*%
+%ADD12C,0.0787*%
+%ADD11C,0.0001*%
+G54D11*G36*
+X25000Y42500D02*X31414D01*
+X30900Y41986D01*
+X31019Y41793D01*
+X31256Y41220D01*
+X31401Y40618D01*
+X31437Y40000D01*
+X31401Y39382D01*
+X31256Y38780D01*
+X31019Y38207D01*
+X30900Y38014D01*
+X32355Y36560D01*
+X32806Y37296D01*
+X33164Y38160D01*
+X33382Y39068D01*
+X33437Y40000D01*
+X33382Y40932D01*
+X33164Y41840D01*
+X32891Y42500D01*
+X35000D01*
+Y32500D01*
+X25000D01*
+Y34609D01*
+X25660Y34336D01*
+X26568Y34118D01*
+X27500Y34045D01*
+X28432Y34118D01*
+X29340Y34336D01*
+X30204Y34694D01*
+X30940Y35145D01*
+X29486Y36600D01*
+X29293Y36481D01*
+X28720Y36244D01*
+X28118Y36099D01*
+X27500Y36051D01*
+X26882Y36099D01*
+X26280Y36244D01*
+X25707Y36481D01*
+X25514Y36600D01*
+X25000Y36086D01*
+Y42500D01*
+G37*
+G36*
+Y25000D02*X35000D01*
+Y15000D01*
+X25000D01*
+Y25000D01*
+G37*
+G36*
+X2500Y47500D02*X12500D01*
+Y45330D01*
+X12475Y45355D01*
+X12346Y45446D01*
+X12204Y45513D01*
+X11672Y45704D01*
+X11123Y45837D01*
+X10564Y45917D01*
+X10000Y45944D01*
+X9436Y45917D01*
+X8877Y45837D01*
+X8328Y45704D01*
+X7794Y45519D01*
+X7652Y45450D01*
+X7523Y45358D01*
+X7409Y45248D01*
+X7315Y45121D01*
+X7241Y44981D01*
+X7191Y44832D01*
+X7164Y44676D01*
+X7162Y44518D01*
+X7185Y44361D01*
+X7232Y44210D01*
+X7302Y44069D01*
+X7393Y43939D01*
+X7504Y43826D01*
+X7630Y43732D01*
+X7770Y43658D01*
+X7920Y43608D01*
+X8076Y43581D01*
+X8234Y43579D01*
+X8390Y43602D01*
+X8540Y43652D01*
+X8892Y43778D01*
+X9256Y43866D01*
+X9626Y43919D01*
+X10000Y43937D01*
+X10374Y43919D01*
+X10744Y43866D01*
+X11108Y43778D01*
+X11461Y43656D01*
+X11611Y43606D01*
+X11766Y43583D01*
+X11924Y43585D01*
+X12079Y43612D01*
+X12228Y43662D01*
+X12367Y43736D01*
+X12493Y43830D01*
+X12500Y43836D01*
+Y37500D01*
+X6170D01*
+X6174Y37504D01*
+X6268Y37630D01*
+X6342Y37770D01*
+X6392Y37920D01*
+X6419Y38076D01*
+X6421Y38234D01*
+X6398Y38390D01*
+X6348Y38540D01*
+X6222Y38892D01*
+X6134Y39256D01*
+X6081Y39626D01*
+X6063Y40000D01*
+X6081Y40374D01*
+X6134Y40744D01*
+X6222Y41108D01*
+X6344Y41461D01*
+X6394Y41611D01*
+X6417Y41766D01*
+X6415Y41924D01*
+X6388Y42079D01*
+X6338Y42228D01*
+X6264Y42367D01*
+X6170Y42493D01*
+X6058Y42603D01*
+X5929Y42694D01*
+X5788Y42764D01*
+X5638Y42811D01*
+X5482Y42833D01*
+X5325Y42832D01*
+X5169Y42805D01*
+X5020Y42754D01*
+X4881Y42681D01*
+X4755Y42587D01*
+X4645Y42475D01*
+X4554Y42346D01*
+X4487Y42204D01*
+X4296Y41672D01*
+X4163Y41123D01*
+X4083Y40564D01*
+X4056Y40000D01*
+X4083Y39436D01*
+X4163Y38877D01*
+X4296Y38328D01*
+X4481Y37794D01*
+X4550Y37652D01*
+X4642Y37523D01*
+X4664Y37500D01*
+X2500D01*
+Y47500D01*
+G37*
+G36*
+X20000D02*X30000D01*
+Y45330D01*
+X29975Y45355D01*
+X29846Y45446D01*
+X29704Y45513D01*
+X29172Y45704D01*
+X28623Y45837D01*
+X28064Y45917D01*
+X27500Y45944D01*
+X26936Y45917D01*
+X26377Y45837D01*
+X25828Y45704D01*
+X25294Y45519D01*
+X25152Y45450D01*
+X25023Y45358D01*
+X24909Y45248D01*
+X24815Y45121D01*
+X24741Y44981D01*
+X24691Y44832D01*
+X24664Y44676D01*
+X24662Y44518D01*
+X24685Y44361D01*
+X24732Y44210D01*
+X24802Y44069D01*
+X24893Y43939D01*
+X25004Y43826D01*
+X25130Y43732D01*
+X25270Y43658D01*
+X25420Y43608D01*
+X25576Y43581D01*
+X25734Y43579D01*
+X25890Y43602D01*
+X26040Y43652D01*
+X26392Y43778D01*
+X26756Y43866D01*
+X27126Y43919D01*
+X27500Y43937D01*
+X27874Y43919D01*
+X28244Y43866D01*
+X28608Y43778D01*
+X28961Y43656D01*
+X29111Y43606D01*
+X29266Y43583D01*
+X29424Y43585D01*
+X29579Y43612D01*
+X29728Y43662D01*
+X29867Y43736D01*
+X29993Y43830D01*
+X30000Y43836D01*
+Y37500D01*
+X23670D01*
+X23674Y37504D01*
+X23768Y37630D01*
+X23842Y37770D01*
+X23892Y37920D01*
+X23919Y38076D01*
+X23921Y38234D01*
+X23898Y38390D01*
+X23848Y38540D01*
+X23722Y38892D01*
+X23634Y39256D01*
+X23581Y39626D01*
+X23563Y40000D01*
+X23581Y40374D01*
+X23634Y40744D01*
+X23722Y41108D01*
+X23844Y41461D01*
+X23894Y41611D01*
+X23917Y41766D01*
+X23915Y41924D01*
+X23888Y42079D01*
+X23838Y42228D01*
+X23764Y42367D01*
+X23670Y42493D01*
+X23558Y42603D01*
+X23429Y42694D01*
+X23288Y42764D01*
+X23138Y42811D01*
+X22982Y42833D01*
+X22825Y42832D01*
+X22669Y42805D01*
+X22520Y42754D01*
+X22381Y42681D01*
+X22255Y42587D01*
+X22145Y42475D01*
+X22054Y42346D01*
+X21987Y42204D01*
+X21796Y41672D01*
+X21663Y41123D01*
+X21583Y40564D01*
+X21556Y40000D01*
+X21583Y39436D01*
+X21663Y38877D01*
+X21796Y38328D01*
+X21981Y37794D01*
+X22050Y37652D01*
+X22142Y37523D01*
+X22164Y37500D01*
+X20000D01*
+Y47500D01*
+G37*
+G36*
+X2500Y30000D02*X12500D01*
+Y27891D01*
+X11840Y28164D01*
+X10932Y28382D01*
+X10000Y28455D01*
+X9068Y28382D01*
+X8160Y28164D01*
+X7296Y27806D01*
+X6500Y27318D01*
+X5789Y26711D01*
+X5182Y26000D01*
+X4694Y25204D01*
+X4336Y24340D01*
+X4118Y23432D01*
+X4045Y22500D01*
+X4118Y21568D01*
+X4336Y20660D01*
+X4609Y20000D01*
+X2500D01*
+Y30000D01*
+G37*
+G36*
+X20000D02*X30000D01*
+Y27891D01*
+X29340Y28164D01*
+X28432Y28382D01*
+X27500Y28455D01*
+X26568Y28382D01*
+X25660Y28164D01*
+X24796Y27806D01*
+X24000Y27318D01*
+X23289Y26711D01*
+X22682Y26000D01*
+X22194Y25204D01*
+X21836Y24340D01*
+X21618Y23432D01*
+X21545Y22500D01*
+X21618Y21568D01*
+X21836Y20660D01*
+X22109Y20000D01*
+X20000D01*
+Y30000D01*
+G37*
+G54D12*X10000Y40000D03*
+X27500D03*
+X10000Y22500D03*
+X27500D03*
+G54D13*M02*
diff --git a/tests/RTT/ref/thermal_layer.net b/tests/RTT/ref/thermal_layer.net
new file mode 100644
index 0000000..22c7ab1
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.net
@@ -0,0 +1,16 @@
+C IPC-D-356 Netlist generated by <version>
+C
+C File created on <date>
+C
+P JOB thermals vs. multiple layer polygons
+P CODE 00
+P UNITS CUST 0
+P DIM N
+P VER IPC-D-356
+P IMAGE PRIMARY
+C
+317N/C VIA - D0315PA00X+001000Y+004000X0787Y0000R000 S3
+317N/C VIA - D0315PA00X+002750Y+004000X0787Y0000R000 S3
+317N/C VIA - D0315PA00X+001000Y+002250X0787Y0000R000 S3
+317N/C VIA - D0315PA00X+002750Y+002250X0787Y0000R000 S3
+999
diff --git a/tests/RTT/ref/thermal_layer.png b/tests/RTT/ref/thermal_layer.png
new file mode 100644
index 0000000..90a3e0d
Binary files /dev/null and b/tests/RTT/ref/thermal_layer.png differ
diff --git a/tests/RTT/ref/thermal_layer.ps.gz b/tests/RTT/ref/thermal_layer.ps.gz
new file mode 100644
index 0000000..29f9479
Binary files /dev/null and b/tests/RTT/ref/thermal_layer.ps.gz differ
diff --git a/tests/RTT/ref/thermal_layer.remote.gz b/tests/RTT/ref/thermal_layer.remote.gz
new file mode 100644
index 0000000..7016a25
Binary files /dev/null and b/tests/RTT/ref/thermal_layer.remote.gz differ
diff --git a/tests/RTT/ref/thermal_layer.svg b/tests/RTT/ref/thermal_layer.svg
new file mode 100644
index 0000000..39b0792
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.svg
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1625.6000" height="1625.6000" viewBox="-2.0000 -2.0000 17.7000 17.7000">
+<g id="layer_4_copper">
+<!--normal-->
+ <rect x="0.0000" y="0.0000" width="12.7000" height="12.7000" stroke-width="0.2540" stroke="#00868b" stroke-linecap="round" fill="none"/>
+</g>
+<g id="layer_3_copper">
+<!--normal-->
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_2_copper">
+<!--normal-->
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_1_copper">
+<!--normal-->
+ <polygon points="1.9050,1.9050 3.5342,1.9050 3.4037,2.0355 3.4338,2.0846 3.4940,2.2300 3.5307,2.3831 3.5400,2.5400 3.5307,2.6969 3.4940,2.8500 3.4338,2.9954 3.4037,3.0445 3.7731,3.4139 3.8878,3.2267 3.9786,3.0074 4.0340,2.7766 4.0480,2.5400 4.0340,2.3034 3.9786,2.0726 3.9092,1.9050 4.4450,1.9050 4.4450,4.4450 1.9050,4.4450 1.9050,3.9092 2.0726,3.9786 2.3034,4.0340 2.5400,4.0526 2.7766,4.0340 3.0074,3.9786 3.2267,3.8878 3.4139,3.7731 3.0445,3.4037 2.9954,3.4338 2.8500,3.4940 2.6969,3.530 [...]
+ <polygon points="1.9050,6.3500 4.4450,6.3500 4.4450,8.8900 1.9050,8.8900 " stroke-width="0.075" stroke="#3a5fcd" fill="#3a5fcd"/>
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_0_copper">
+<!--normal-->
+ <polygon points="6.3500,1.9050 7.9792,1.9050 7.8487,2.0355 7.8788,2.0846 7.9390,2.2300 7.9757,2.3831 7.9850,2.5400 7.9757,2.6969 7.9390,2.8500 7.8788,2.9954 7.8487,3.0445 8.2181,3.4139 8.3328,3.2267 8.4236,3.0074 8.4790,2.7766 8.4930,2.5400 8.4790,2.3034 8.4236,2.0726 8.3542,1.9050 8.8900,1.9050 8.8900,4.4450 6.3500,4.4450 6.3500,3.9092 6.5176,3.9786 6.7484,4.0340 6.9850,4.0526 7.2216,4.0340 7.4524,3.9786 7.6717,3.8878 7.8589,3.7731 7.4895,3.4037 7.4404,3.4338 7.2950,3.4940 7.1419,3.530 [...]
+ <polygon points="6.3500,6.3500 8.8900,6.3500 8.8900,8.8900 6.3500,8.8900 " stroke-width="0.075" stroke="#104e8b" fill="#104e8b"/>
+ <polygon points="0.6350,0.6350 3.1750,0.6350 3.1750,1.1861 3.1685,1.1798 3.1359,1.1567 3.0998,1.1397 2.9648,1.0913 2.8253,1.0575 2.6833,1.0371 2.5400,1.0303 2.3967,1.0371 2.2547,1.0575 2.1152,1.0913 1.9796,1.1382 1.9435,1.1557 1.9107,1.1789 1.8820,1.2070 1.8580,1.2392 1.8393,1.2747 1.8264,1.3128 1.8197,1.3523 1.8192,1.3925 1.8250,1.4322 1.8369,1.4706 1.8547,1.5066 1.8779,1.5394 1.9059,1.5681 1.9381,1.5921 1.9737,1.6108 2.0117,1.6237 2.0513,1.6305 2.0914,1.6310 2.1312,1.6252 2.1692,1.612 [...]
+ <polygon points="5.0800,0.6350 7.6200,0.6350 7.6200,1.1861 7.6135,1.1798 7.5809,1.1567 7.5448,1.1397 7.4098,1.0913 7.2703,1.0575 7.1283,1.0371 6.9850,1.0303 6.8417,1.0371 6.6997,1.0575 6.5602,1.0913 6.4246,1.1382 6.3885,1.1557 6.3557,1.1789 6.3270,1.2070 6.3030,1.2392 6.2843,1.2747 6.2714,1.3128 6.2647,1.3523 6.2642,1.3925 6.2700,1.4322 6.2819,1.4706 6.2997,1.5066 6.3229,1.5394 6.3509,1.5681 6.3831,1.5921 6.4187,1.6108 6.4567,1.6237 6.4963,1.6305 6.5364,1.6310 6.5762,1.6252 6.6142,1.612 [...]
+ <polygon points="0.6350,5.0800 3.1750,5.0800 3.1750,5.6158 3.0074,5.5464 2.7766,5.4910 2.5400,5.4724 2.3034,5.4910 2.0726,5.5464 1.8533,5.6372 1.6509,5.7612 1.4704,5.9154 1.3162,6.0959 1.1922,6.2983 1.1014,6.5176 1.0460,6.7484 1.0274,6.9850 1.0460,7.2216 1.1014,7.4524 1.1708,7.6200 0.6350,7.6200 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <polygon points="5.0800,5.0800 7.6200,5.0800 7.6200,5.6158 7.4524,5.5464 7.2216,5.4910 6.9850,5.4724 6.7484,5.4910 6.5176,5.5464 6.2983,5.6372 6.0959,5.7612 5.9154,5.9154 5.7612,6.0959 5.6372,6.2983 5.5464,6.5176 5.4910,6.7484 5.4724,6.9850 5.4910,7.2216 5.5464,7.4524 5.6158,7.6200 5.0800,7.6200 " stroke-width="0.075" stroke="#8b2323" fill="#8b2323"/>
+ <circle cx="2.5400" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="1.0000" stroke-width="0.2540" fill="#7f7f7f" stroke="none"/>
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+<g id="layer_-4079_topsilk">
+</g>
+<g id="layer_-4048_plated-drill">
+<!--normal-->
+ <circle cx="2.5400" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="2.5400" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="2.5400" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+ <circle cx="6.9850" cy="6.9850" r="0.4001" stroke-width="0.0000" fill="#ffffff" stroke="none"/>
+</g>
+</svg>
diff --git a/tests/RTT/ref/thermal_layer.xy b/tests/RTT/ref/thermal_layer.xy
new file mode 100644
index 0000000..a199829
--- /dev/null
+++ b/tests/RTT/ref/thermal_layer.xy
@@ -0,0 +1,8 @@
+# $Id$
+# PcbXY Version 1.0
+# Date: <date>
+# Author:
+# Title: thermals vs. multiple layer polygons - PCB X-Y
+# RefDes, Description, Value, X, Y, rotation, top/bottom
+# X,Y in mil. rotation in degrees.
+# --------------------------------------------
diff --git a/tests/RTT/text_rot.pcb b/tests/RTT/text_rot.pcb
new file mode 100644
index 0000000..5965b99
--- /dev/null
+++ b/tests/RTT/text_rot.pcb
@@ -0,0 +1,95 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["text rotations" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Symbol['A' 304800nm]
+(
+ SymbolLine[0 508000nm 0 1270000nm 203200nm]
+ SymbolLine[0 508000nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 457200nm 254000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 508000nm 203200nm]
+ SymbolLine[635000nm 508000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['1' 304800nm]
+(
+ SymbolLine[0 457200nm 203200nm 254000nm 203200nm]
+ SymbolLine[203200nm 254000nm 203200nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 381000nm 1270000nm 203200nm]
+)
+Symbol['2' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['3' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 584200nm 203200nm]
+ SymbolLine[508000nm 838200nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 838200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 584200nm 381000nm 711200nm 203200nm]
+)
+Symbol['4' 304800nm]
+(
+ SymbolLine[0 889000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 889000nm 635000nm 889000nm 203200nm]
+ SymbolLine[508000nm 254000nm 508000nm 1270000nm 203200nm]
+)
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+ Text[5715000nm 3810000nm 0 100 "A1" "clearline"]
+ Text[3810000nm 6985000nm 1 100 "A2" "clearline"]
+ Text[6985000nm 8890000nm 2 100 "A3" "clearline"]
+ Text[8890000nm 5715000nm 3 100 "A4" "clearline"]
+)
diff --git a/tests/RTT/text_scale.pcb b/tests/RTT/text_scale.pcb
new file mode 100644
index 0000000..3f4fe39
--- /dev/null
+++ b/tests/RTT/text_scale.pcb
@@ -0,0 +1,87 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["text sizes (scales)" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Symbol['A' 304800nm]
+(
+ SymbolLine[0 508000nm 0 1270000nm 203200nm]
+ SymbolLine[0 508000nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 457200nm 254000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 508000nm 203200nm]
+ SymbolLine[635000nm 508000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['1' 304800nm]
+(
+ SymbolLine[0 457200nm 203200nm 254000nm 203200nm]
+ SymbolLine[203200nm 254000nm 203200nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 381000nm 1270000nm 203200nm]
+)
+Symbol['2' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['3' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 584200nm 203200nm]
+ SymbolLine[508000nm 838200nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 838200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 584200nm 381000nm 711200nm 203200nm]
+)
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+ Text[1270000nm 635000nm 0 100 "A1" "clearline"]
+ Text[1270000nm 5080000nm 0 10 "A2" "clearline"]
+ Text[1270000nm 7620000nm 0 320 "A3" "clearline"]
+)
diff --git a/tests/RTT/text_sides.pcb b/tests/RTT/text_sides.pcb
new file mode 100644
index 0000000..17833b3
--- /dev/null
+++ b/tests/RTT/text_sides.pcb
@@ -0,0 +1,74 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["text on both sides" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[1905000nm 635000nm 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+
+Symbol['A' 304800nm]
+(
+ SymbolLine[0 508000nm 0 1270000nm 203200nm]
+ SymbolLine[0 508000nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 457200nm 254000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 508000nm 203200nm]
+ SymbolLine[635000nm 508000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['1' 304800nm]
+(
+ SymbolLine[0 457200nm 203200nm 254000nm 203200nm]
+ SymbolLine[203200nm 254000nm 203200nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 381000nm 1270000nm 203200nm]
+)
+Symbol['2' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+ Text[5715000nm 7620000nm 0 100 "A2" "clearline,onsolder"]
+)
+Layer(9 "silk")
+(
+ Text[5715000nm 4445000nm 0 100 "A1" "clearline"]
+)
diff --git a/tests/RTT/thermal_last.pcb b/tests/RTT/thermal_last.pcb
new file mode 100644
index 0000000..8ae71bc
--- /dev/null
+++ b/tests/RTT/thermal_last.pcb
@@ -0,0 +1,826 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["thermals on the last 2 layers - catch off-by-one bugs due to the 0-base index of thermals" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Symbol[' ' 457200nm]
+(
+)
+Symbol['!' 304800nm]
+(
+ SymbolLine[0 1143000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 0 889000nm 203200nm]
+)
+Symbol['"' 304800nm]
+(
+ SymbolLine[0 254000nm 0 508000nm 203200nm]
+ SymbolLine[254000nm 254000nm 254000nm 508000nm 203200nm]
+)
+Symbol['#' 304800nm]
+(
+ SymbolLine[0 889000nm 508000nm 889000nm 203200nm]
+ SymbolLine[0 635000nm 508000nm 635000nm 203200nm]
+ SymbolLine[381000nm 508000nm 381000nm 1016000nm 203200nm]
+ SymbolLine[127000nm 508000nm 127000nm 1016000nm 203200nm]
+)
+Symbol['$' 304800nm]
+(
+ SymbolLine[381000nm 381000nm 508000nm 508000nm 203200nm]
+ SymbolLine[127000nm 381000nm 381000nm 381000nm 203200nm]
+ SymbolLine[0 508000nm 127000nm 381000nm 203200nm]
+ SymbolLine[0 508000nm 0 635000nm 203200nm]
+ SymbolLine[0 635000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[381000nm 1143000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[0 1016000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[254000nm 254000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['%' 304800nm]
+(
+ SymbolLine[0 381000nm 0 508000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 254000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 381000nm 381000nm 203200nm]
+ SymbolLine[381000nm 381000nm 381000nm 508000nm 203200nm]
+ SymbolLine[254000nm 635000nm 381000nm 508000nm 203200nm]
+ SymbolLine[127000nm 635000nm 254000nm 635000nm 203200nm]
+ SymbolLine[0 508000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 1016000nm 254000nm 203200nm]
+ SymbolLine[889000nm 1270000nm 1016000nm 1143000nm 203200nm]
+ SymbolLine[1016000nm 1016000nm 1016000nm 1143000nm 203200nm]
+ SymbolLine[889000nm 889000nm 1016000nm 1016000nm 203200nm]
+ SymbolLine[762000nm 889000nm 889000nm 889000nm 203200nm]
+ SymbolLine[635000nm 1016000nm 762000nm 889000nm 203200nm]
+ SymbolLine[635000nm 1016000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[635000nm 1143000nm 762000nm 1270000nm 203200nm]
+ SymbolLine[762000nm 1270000nm 889000nm 1270000nm 203200nm]
+)
+Symbol['&' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 0 635000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 889000nm 381000nm 508000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[0 635000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 254000nm 254000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 381000nm 381000nm 203200nm]
+ SymbolLine[381000nm 381000nm 381000nm 508000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+)
+Symbol[''' 304800nm]
+(
+ SymbolLine[0 508000nm 254000nm 254000nm 203200nm]
+)
+Symbol['(' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+)
+Symbol[')' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 381000nm 203200nm]
+ SymbolLine[127000nm 381000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1143000nm 203200nm]
+)
+Symbol['*' 304800nm]
+(
+ SymbolLine[0 508000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[0 1016000nm 508000nm 508000nm 203200nm]
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[254000nm 508000nm 254000nm 1016000nm 203200nm]
+)
+Symbol['+' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[254000nm 508000nm 254000nm 1016000nm 203200nm]
+)
+Symbol[',' 304800nm]
+(
+ SymbolLine[0 1524000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['-' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol['.' 304800nm]
+(
+ SymbolLine[0 1270000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['/' 304800nm]
+(
+ SymbolLine[0 1143000nm 762000nm 381000nm 203200nm]
+)
+Symbol['0' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1016000nm 508000nm 508000nm 203200nm]
+)
+Symbol['1' 304800nm]
+(
+ SymbolLine[0 457200nm 203200nm 254000nm 203200nm]
+ SymbolLine[203200nm 254000nm 203200nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 381000nm 1270000nm 203200nm]
+)
+Symbol['2' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 635000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['3' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 584200nm 203200nm]
+ SymbolLine[508000nm 838200nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 838200nm 381000nm 711200nm 203200nm]
+ SymbolLine[508000nm 584200nm 381000nm 711200nm 203200nm]
+)
+Symbol['4' 304800nm]
+(
+ SymbolLine[0 889000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 889000nm 635000nm 889000nm 203200nm]
+ SymbolLine[508000nm 254000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['5' 304800nm]
+(
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 0 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 635000nm 203200nm]
+ SymbolLine[127000nm 635000nm 381000nm 635000nm 203200nm]
+ SymbolLine[381000nm 635000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['6' 304800nm]
+(
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 711200nm 508000nm 838200nm 203200nm]
+ SymbolLine[0 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 838200nm 508000nm 1143000nm 203200nm]
+)
+Symbol['7' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 635000nm 254000nm 203200nm]
+)
+Symbol['8' 304800nm]
+(
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 939800nm 0 1143000nm 203200nm]
+ SymbolLine[0 939800nm 177800nm 762000nm 203200nm]
+ SymbolLine[177800nm 762000nm 330200nm 762000nm 203200nm]
+ SymbolLine[330200nm 762000nm 508000nm 939800nm 203200nm]
+ SymbolLine[508000nm 939800nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 584200nm 177800nm 762000nm 203200nm]
+ SymbolLine[0 381000nm 0 584200nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 584200nm 203200nm]
+ SymbolLine[330200nm 762000nm 508000nm 584200nm 203200nm]
+)
+Symbol['9' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 762000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 635000nm 203200nm]
+ SymbolLine[0 635000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol[':' 304800nm]
+(
+ SymbolLine[0 635000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 889000nm 203200nm]
+)
+Symbol[';' 304800nm]
+(
+ SymbolLine[0 1270000nm 254000nm 1016000nm 203200nm]
+ SymbolLine[254000nm 635000nm 254000nm 762000nm 203200nm]
+)
+Symbol['<' 304800nm]
+(
+ SymbolLine[0 762000nm 254000nm 508000nm 203200nm]
+ SymbolLine[0 762000nm 254000nm 1016000nm 203200nm]
+)
+Symbol['=' 304800nm]
+(
+ SymbolLine[0 635000nm 508000nm 635000nm 203200nm]
+ SymbolLine[0 889000nm 508000nm 889000nm 203200nm]
+)
+Symbol['>' 304800nm]
+(
+ SymbolLine[0 508000nm 254000nm 762000nm 203200nm]
+ SymbolLine[0 1016000nm 254000nm 762000nm 203200nm]
+)
+Symbol['?' 304800nm]
+(
+ SymbolLine[254000nm 762000nm 254000nm 889000nm 203200nm]
+ SymbolLine[254000nm 1143000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 381000nm 0 508000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 508000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 508000nm 203200nm]
+)
+Symbol['@' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1016000nm 203200nm]
+ SymbolLine[0 1016000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 1016000nm 1270000nm 203200nm]
+ SymbolLine[1270000nm 889000nm 1270000nm 254000nm 203200nm]
+ SymbolLine[1270000nm 254000nm 1016000nm 0 203200nm]
+ SymbolLine[1016000nm 0 254000nm 0 203200nm]
+ SymbolLine[254000nm 0 0 254000nm 203200nm]
+ SymbolLine[381000nm 508000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 762000nm 889000nm 203200nm]
+ SymbolLine[762000nm 889000nm 889000nm 762000nm 203200nm]
+ SymbolLine[889000nm 762000nm 1016000nm 889000nm 203200nm]
+ SymbolLine[889000nm 762000nm 889000nm 381000nm 203200nm]
+ SymbolLine[889000nm 508000nm 762000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 762000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 381000nm 508000nm 203200nm]
+ SymbolLine[1016000nm 889000nm 1270000nm 889000nm 203200nm]
+)
+Symbol['A' 304800nm]
+(
+ SymbolLine[0 508000nm 0 1270000nm 203200nm]
+ SymbolLine[0 508000nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 457200nm 254000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 508000nm 203200nm]
+ SymbolLine[635000nm 508000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['B' 304800nm]
+(
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[635000nm 838200nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 711200nm 635000nm 838200nm 203200nm]
+ SymbolLine[127000nm 711200nm 508000nm 711200nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 584200nm 203200nm]
+ SymbolLine[508000nm 711200nm 635000nm 584200nm 203200nm]
+)
+Symbol['C' 304800nm]
+(
+ SymbolLine[177800nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1092200nm 177800nm 1270000nm 203200nm]
+ SymbolLine[0 431800nm 0 1092200nm 203200nm]
+ SymbolLine[0 431800nm 177800nm 254000nm 203200nm]
+ SymbolLine[177800nm 254000nm 508000nm 254000nm 203200nm]
+)
+Symbol['D' 304800nm]
+(
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[457200nm 254000nm 635000nm 431800nm 203200nm]
+ SymbolLine[635000nm 431800nm 635000nm 1092200nm 203200nm]
+ SymbolLine[457200nm 1270000nm 635000nm 1092200nm 203200nm]
+ SymbolLine[0 1270000nm 457200nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 457200nm 254000nm 203200nm]
+)
+Symbol['E' 304800nm]
+(
+ SymbolLine[0 711200nm 381000nm 711200nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+)
+Symbol['F' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 711200nm 381000nm 711200nm 203200nm]
+)
+Symbol['G' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[635000nm 889000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol['H' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[635000nm 254000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 635000nm 762000nm 203200nm]
+)
+Symbol['I' 304800nm]
+(
+ SymbolLine[0 254000nm 254000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['J' 304800nm]
+(
+ SymbolLine[177800nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 0 1016000nm 203200nm]
+)
+Symbol['K' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 762000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 762000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['L' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['M' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 762000nm 254000nm 203200nm]
+ SymbolLine[762000nm 254000nm 762000nm 1270000nm 203200nm]
+)
+Symbol['N' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 254000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[635000nm 254000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['O' 304800nm]
+(
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['P' 304800nm]
+(
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 635000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+)
+Symbol['Q' 304800nm]
+(
+ SymbolLine[0 381000nm 0 1143000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[381000nm 254000nm 508000nm 381000nm 203200nm]
+ SymbolLine[508000nm 381000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 889000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['R' 304800nm]
+(
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[635000nm 381000nm 635000nm 635000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 635000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[330200nm 762000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['S' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 635000nm 381000nm 203200nm]
+ SymbolLine[127000nm 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 381000nm 0 635000nm 203200nm]
+ SymbolLine[0 635000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[635000nm 889000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['T' 304800nm]
+(
+ SymbolLine[0 254000nm 508000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['U' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 254000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['V' 304800nm]
+(
+ SymbolLine[0 254000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 254000nm 203200nm]
+)
+Symbol['W' 304800nm]
+(
+ SymbolLine[0 254000nm 0 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[635000nm 1270000nm 762000nm 762000nm 203200nm]
+ SymbolLine[762000nm 762000nm 762000nm 254000nm 203200nm]
+)
+Symbol['X' 304800nm]
+(
+ SymbolLine[0 1270000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['Y' 304800nm]
+(
+ SymbolLine[0 254000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 254000nm 203200nm]
+ SymbolLine[254000nm 762000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['Z' 304800nm]
+(
+ SymbolLine[0 254000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 254000nm 203200nm]
+ SymbolLine[0 1270000nm 635000nm 1270000nm 203200nm]
+)
+Symbol['[' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 254000nm 203200nm]
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['\' 304800nm]
+(
+ SymbolLine[0 381000nm 762000nm 1143000nm 203200nm]
+)
+Symbol[']' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['^' 304800nm]
+(
+ SymbolLine[0 381000nm 127000nm 254000nm 203200nm]
+ SymbolLine[127000nm 254000nm 254000nm 381000nm 203200nm]
+)
+Symbol['_' 304800nm]
+(
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['a' 304800nm]
+(
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1143000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['b' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+)
+Symbol['c' 304800nm]
+(
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['d' 304800nm]
+(
+ SymbolLine[508000nm 254000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+)
+Symbol['e' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[0 1016000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[508000nm 1016000nm 508000nm 889000nm 203200nm]
+)
+Symbol['f' 254000nm]
+(
+ SymbolLine[127000nm 381000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 381000nm 254000nm 254000nm 203200nm]
+ SymbolLine[254000nm 254000nm 381000nm 254000nm 203200nm]
+ SymbolLine[0 762000nm 254000nm 762000nm 203200nm]
+)
+Symbol['g' 304800nm]
+(
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[0 1524000nm 127000nm 1651000nm 203200nm]
+ SymbolLine[127000nm 1651000nm 381000nm 1651000nm 203200nm]
+ SymbolLine[381000nm 1651000nm 508000nm 1524000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1524000nm 203200nm]
+)
+Symbol['h' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['i' 254000nm]
+(
+ SymbolLine[0 508000nm 0 533400nm 254000nm]
+ SymbolLine[0 889000nm 0 1270000nm 203200nm]
+)
+Symbol['j' 254000nm]
+(
+ SymbolLine[127000nm 508000nm 127000nm 533400nm 254000nm]
+ SymbolLine[127000nm 889000nm 127000nm 1524000nm 203200nm]
+ SymbolLine[0 1651000nm 127000nm 1524000nm 203200nm]
+)
+Symbol['k' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+ SymbolLine[0 889000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 889000nm 254000nm 635000nm 203200nm]
+)
+Symbol['l' 254000nm]
+(
+ SymbolLine[0 254000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['m' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 889000nm 635000nm 762000nm 203200nm]
+ SymbolLine[635000nm 762000nm 762000nm 762000nm 203200nm]
+ SymbolLine[762000nm 762000nm 889000nm 889000nm 203200nm]
+ SymbolLine[889000nm 889000nm 889000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['n' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['o' 304800nm]
+(
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['p' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1651000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[635000nm 889000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['q' 304800nm]
+(
+ SymbolLine[508000nm 889000nm 508000nm 1651000nm 203200nm]
+ SymbolLine[381000nm 762000nm 508000nm 889000nm 203200nm]
+ SymbolLine[127000nm 762000nm 381000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[0 889000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['r' 304800nm]
+(
+ SymbolLine[127000nm 889000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+)
+Symbol['s' 304800nm]
+(
+ SymbolLine[127000nm 1270000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 1016000nm 635000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1016000nm 508000nm 1016000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 1016000nm 203200nm]
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[508000nm 762000nm 635000nm 889000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+)
+Symbol['t' 254000nm]
+(
+ SymbolLine[127000nm 254000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[0 635000nm 254000nm 635000nm 203200nm]
+)
+Symbol['u' 304800nm]
+(
+ SymbolLine[0 762000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['v' 304800nm]
+(
+ SymbolLine[0 762000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 762000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['w' 304800nm]
+(
+ SymbolLine[0 762000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 254000nm 1270000nm 203200nm]
+ SymbolLine[254000nm 1270000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 762000nm 381000nm 1143000nm 203200nm]
+ SymbolLine[381000nm 1143000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 1270000nm 635000nm 1270000nm 203200nm]
+ SymbolLine[635000nm 1270000nm 762000nm 1143000nm 203200nm]
+ SymbolLine[762000nm 762000nm 762000nm 1143000nm 203200nm]
+)
+Symbol['x' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 1270000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 762000nm 203200nm]
+)
+Symbol['y' 304800nm]
+(
+ SymbolLine[0 762000nm 0 1143000nm 203200nm]
+ SymbolLine[0 1143000nm 127000nm 1270000nm 203200nm]
+ SymbolLine[508000nm 762000nm 508000nm 1524000nm 203200nm]
+ SymbolLine[381000nm 1651000nm 508000nm 1524000nm 203200nm]
+ SymbolLine[127000nm 1651000nm 381000nm 1651000nm 203200nm]
+ SymbolLine[0 1524000nm 127000nm 1651000nm 203200nm]
+ SymbolLine[127000nm 1270000nm 381000nm 1270000nm 203200nm]
+ SymbolLine[381000nm 1270000nm 508000nm 1143000nm 203200nm]
+)
+Symbol['z' 304800nm]
+(
+ SymbolLine[0 762000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 762000nm 203200nm]
+ SymbolLine[0 1270000nm 508000nm 1270000nm 203200nm]
+)
+Symbol['{' 304800nm]
+(
+ SymbolLine[127000nm 381000nm 254000nm 254000nm 203200nm]
+ SymbolLine[127000nm 381000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 635000nm 203200nm]
+ SymbolLine[0 762000nm 127000nm 889000nm 203200nm]
+ SymbolLine[127000nm 889000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[127000nm 1143000nm 254000nm 1270000nm 203200nm]
+)
+Symbol['|' 304800nm]
+(
+ SymbolLine[0 254000nm 0 1270000nm 203200nm]
+)
+Symbol['}' 304800nm]
+(
+ SymbolLine[0 254000nm 127000nm 381000nm 203200nm]
+ SymbolLine[127000nm 381000nm 127000nm 635000nm 203200nm]
+ SymbolLine[127000nm 635000nm 254000nm 762000nm 203200nm]
+ SymbolLine[127000nm 889000nm 254000nm 762000nm 203200nm]
+ SymbolLine[127000nm 889000nm 127000nm 1143000nm 203200nm]
+ SymbolLine[0 1270000nm 127000nm 1143000nm 203200nm]
+)
+Symbol['~' 304800nm]
+(
+ SymbolLine[0 889000nm 127000nm 762000nm 203200nm]
+ SymbolLine[127000nm 762000nm 254000nm 762000nm 203200nm]
+ SymbolLine[254000nm 762000nm 381000nm 889000nm 203200nm]
+ SymbolLine[381000nm 889000nm 508000nm 889000nm 203200nm]
+ SymbolLine[508000nm 889000nm 635000nm 762000nm 203200nm]
+)
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Via[2540000nm 2540000nm 1999995nm 1016000nm 0 800100nm "" "thermal(4,5X)"]
+Layer(1 "comp1")
+(
+)
+Layer(2 "solder1")
+(
+)
+Layer(3 "com2")
+(
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+ Polygon("clearpoly")
+ (
+ [635000nm 635000nm] [3175000nm 635000nm] [3175000nm 3175000nm] [635000nm 3175000nm]
+ )
+)
+Layer(6 "inner2")
+(
+ Polygon("clearpoly")
+ (
+ [1905000nm 1905000nm] [4445000nm 1905000nm] [4445000nm 4445000nm] [1905000nm 4445000nm]
+ )
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/RTT/thermal_layer.pcb b/tests/RTT/thermal_layer.pcb
new file mode 100644
index 0000000..da005bb
--- /dev/null
+++ b/tests/RTT/thermal_layer.pcb
@@ -0,0 +1,81 @@
+# release: pcb-rnd 1.1.1
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["thermals vs. multiple layer polygons" 12700000nm 12700000nm]
+
+Grid[635000nm 0 0 1]
+Cursor[0 0 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[304800nm 228600nm 254000nm 177800nm 381000nm 254000nm]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,c:2,4,s:5:6:7")
+Styles["style1,254000nm,1999995nm,800100nm,508000nm:style2,508000nm,2199894nm,999997nm,508000nm:style3,2032000nm,3500119nm,1199895nm,635000nm:style4,2540000nm,1625600nm,800100nm,2540000nm"]
+
+Attribute("PCB::grid::unit" "mil")
+Attribute("PCB::conf::editor/draw_grid" "true")
+Via[2540000nm 2540000nm 1999995nm 1016000nm 0 800100nm "" "thermal(0X,1)"]
+Via[6985000nm 2540000nm 1999995nm 1016000nm 0 800100nm "" "thermal(0X,2)"]
+Via[2540000nm 6985000nm 1999995nm 1016000nm 0 800100nm "" "thermal(1S)"]
+Via[6985000nm 6985000nm 1999995nm 1016000nm 0 800100nm "" "thermal(2S)"]
+Layer(1 "comp1")
+(
+ Polygon("clearpoly")
+ (
+ [635000nm 635000nm] [3175000nm 635000nm] [3175000nm 3175000nm] [635000nm 3175000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [5080000nm 635000nm] [7620000nm 635000nm] [7620000nm 3175000nm] [5080000nm 3175000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [635000nm 5080000nm] [3175000nm 5080000nm] [3175000nm 7620000nm] [635000nm 7620000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [5080000nm 5080000nm] [7620000nm 5080000nm] [7620000nm 7620000nm] [5080000nm 7620000nm]
+ )
+)
+Layer(2 "solder1")
+(
+ Polygon("clearpoly")
+ (
+ [1905000nm 1905000nm] [4445000nm 1905000nm] [4445000nm 4445000nm] [1905000nm 4445000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [1905000nm 6350000nm] [4445000nm 6350000nm] [4445000nm 8890000nm] [1905000nm 8890000nm]
+ )
+)
+Layer(3 "com2")
+(
+ Polygon("clearpoly")
+ (
+ [6350000nm 1905000nm] [8890000nm 1905000nm] [8890000nm 4445000nm] [6350000nm 4445000nm]
+ )
+ Polygon("clearpoly")
+ (
+ [6350000nm 6350000nm] [8890000nm 6350000nm] [8890000nm 8890000nm] [6350000nm 8890000nm]
+ )
+)
+Layer(4 "solder2")
+(
+)
+Layer(5 "inner1")
+(
+)
+Layer(6 "inner2")
+(
+)
+Layer(7 "outline")
+(
+)
+Layer(8 "silk")
+(
+)
+Layer(9 "silk")
+(
+)
diff --git a/tests/conf/Makefile b/tests/conf/Makefile
index 3663b61..44a801d 100644
--- a/tests/conf/Makefile
+++ b/tests/conf/Makefile
@@ -1,5 +1,5 @@
CFLAGS = -Wall -g -I../.. -I../../src_3rd -I../../src
-LDFLAGS = -lm
+LDLIBS = -lm
LIB_PCB_OBJS= \
../../src/hid_cfg.o \
@@ -16,7 +16,7 @@ LIB_PCB_OBJS= \
../../src/compat_fs.o
LIB_PLUGIN_OBJS=\
- ../../src_plugins/debug/debug_conf.o
+ ../../src_plugins/diag/diag_conf.o
LIB_3RD_OBJS= \
../../src_3rd/liblihata/parser.o \
@@ -40,9 +40,12 @@ LIB_3RD_OBJS= \
../../src_3rd/genvector/gds_char.o \
../../src_3rd/genvector/vtp0.o
+OBJS = conftest.o help.o
+
all: conftest
-conftest: conftest.o help.o $(LIB_3RD_OBJS) $(LIB_PCB_OBJS) $(LIB_PLUGIN_OBJS)
+conftest: $(OBJS) $(LIB_3RD_OBJS) $(LIB_PCB_OBJS) $(LIB_PLUGIN_OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) $(LIB_3RD_OBJS) $(LIB_PCB_OBJS) $(LIB_PLUGIN_OBJS) $(LDLIBS) -o conftest
conftest.o: conftest.c
@@ -52,4 +55,7 @@ $(LIB_3RD_OBJS) $(LIB_PCB_OBJS):
cd ../../src && make
test:
- cd tests && make all
+ cd tests && $(MAKE) all
+
+clean:
+ -rm conftest tests/*.out $(OBJS)
diff --git a/tests/conf/conftest.c b/tests/conf/conftest.c
index 269196e..c4ed1e3 100644
--- a/tests/conf/conftest.c
+++ b/tests/conf/conftest.c
@@ -5,14 +5,14 @@
#include "conf_hid.h"
#include "conf_core.h"
#include "compat_misc.h"
-#include "src_plugins/debug/debug_conf.h"
+#include "src_plugins/diag/diag_conf.h"
int lineno = 0;
int global_notify = 0;
conf_hid_id_t hid_id;
const char *hid_cookie = "conftest cookie";
-void Message(const char *Format, ...)
+void pcb_message(enum pcb_message_level level, const char *Format, ...)
{
va_list args;
@@ -25,6 +25,17 @@ void Message(const char *Format, ...)
fprintf(stderr, "\n");
}
+const char *pcb_board_get_filename(void)
+{
+ return "dummy_brd.lht";
+}
+
+const char *pcb_board_get_name(void)
+{
+ return "dummy_brd";
+}
+
+
void watch_pre(conf_native_t *cfg)
{
printf("watch_pre: '%s' old value\n", cfg->hash_path);
@@ -55,7 +66,7 @@ extern lht_doc_t *conf_root[];
void cmd_dump(char *arg)
{
if (arg == NULL) {
- Message("Need an arg: native or lihata");
+ pcb_message(PCB_MSG_ERROR, "Need an arg: native or lihata");
return;
}
if (strncmp(arg, "native", 6) == 0) {
@@ -68,7 +79,7 @@ void cmd_dump(char *arg)
while(isspace(*arg)) arg++;
conf_role_t role = conf_role_parse(arg);
if (role == CFR_invalid) {
- Message("Invalid role: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", arg);
return;
}
if (conf_root[role] != NULL)
@@ -77,7 +88,7 @@ void cmd_dump(char *arg)
printf("<empty>\n");
}
else
- Message("Invalid dump mode: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid dump mode: '%s'", arg);
}
void cmd_print(char *arg)
@@ -86,12 +97,12 @@ void cmd_print(char *arg)
gds_t s;
if (arg == NULL) {
- Message("Need an arg: a native path");
+ pcb_message(PCB_MSG_ERROR, "Need an arg: a native path");
return;
}
node = conf_get_field(arg);
if (node == NULL) {
- Message("No such path: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "No such path: '%s'", arg);
return;
}
gds_init(&s);
@@ -107,7 +118,7 @@ void cmd_load(char *arg, int is_text)
if (arg == NULL) {
help:;
- Message("Need 2 args: role and %s", (is_text ? "lihata text" : "file name"));
+ pcb_message(PCB_MSG_ERROR, "Need 2 args: role and %s", (is_text ? "lihata text" : "file name"));
return;
}
@@ -125,7 +136,7 @@ void cmd_load(char *arg, int is_text)
role = conf_role_parse(arg);
if (role == CFR_invalid) {
- Message("Invalid role: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", arg);
return;
}
printf("Result: %d\n", conf_load_as(role, fn, is_text));
@@ -139,7 +150,7 @@ void cmd_policy(char *arg)
{
conf_policy_t np = conf_policy_parse(arg);
if (np == POL_invalid)
- Message("Invalid/unknown policy: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid/unknown policy: '%s'", arg);
else
current_policy = np;
}
@@ -148,7 +159,7 @@ void cmd_role(char *arg)
{
conf_role_t nr = conf_role_parse(arg);
if (nr == CFR_invalid)
- Message("Invalid/unknown role: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid/unknown role: '%s'", arg);
else
current_role = nr;
}
@@ -160,10 +171,10 @@ void cmd_chprio(char *arg)
lht_node_t *first;
if ((*end != '\0') || (np < 0)) {
- Message("Invalid integer prio: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid integer prio: '%s'", arg);
return;
}
- first = conf_lht_get_first(current_role);
+ first = conf_lht_get_first(current_role, 0);
if (first != NULL) {
char tmp[128];
char *end;
@@ -183,16 +194,16 @@ void cmd_chpolicy(char *arg)
lht_node_t *first;
if (arg == NULL) {
- Message("need a policy", arg);
+ pcb_message(PCB_MSG_ERROR, "need a policy", arg);
return;
}
np = conf_policy_parse(arg);
if (np == POL_invalid) {
- Message("Invalid integer policy: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid integer policy: '%s'", arg);
return;
}
- first = conf_lht_get_first(current_role);
+ first = conf_lht_get_first(current_role, 0);
if (first != NULL) {
char tmp[128];
char *end;
@@ -218,7 +229,7 @@ void cmd_set(char *arg)
path = arg;
val = strpbrk(path, " \t=");
if (val == NULL) {
- Message("set needs a value");
+ pcb_message(PCB_MSG_ERROR, "set needs a value");
return;
}
*val = '\0';
@@ -234,7 +245,7 @@ void cmd_watch(char *arg, int add)
{
conf_native_t *n = conf_get_field(arg);
if (n == NULL) {
- Message("unknown path");
+ pcb_message(PCB_MSG_ERROR, "unknown path");
return;
}
conf_hid_set_cb(n, hid_id, (add ? &watch_cbs : NULL));
@@ -270,7 +281,7 @@ void cmd_reset(char *arg)
else {
conf_role_t role = conf_role_parse(arg);
if (role == CFR_invalid) {
- Message("Invalid role: '%s'", arg);
+ pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", arg);
return;
}
conf_reset(role, "<cmd_reset role>");
@@ -373,9 +384,10 @@ int main()
else if (strcmp(cmd, "help") == 0)
cmd_help(arg);
else
- Message("unknown command '%s'", cmd);
+ pcb_message(PCB_MSG_ERROR, "unknown command '%s'", cmd);
}
conf_hid_unreg(hid_cookie);
conf_uninit();
+ return 0;
}
diff --git a/tests/conf/tests/Makefile b/tests/conf/tests/Makefile
index 06b6b93..eb8a8c6 100644
--- a/tests/conf/tests/Makefile
+++ b/tests/conf/tests/Makefile
@@ -8,8 +8,7 @@ TESTS = \
.SUFFIXES: .ref .test .out .diff .REF
all: $(TESTS)
- @echo "*** QC pass. ***"
-
+ @echo "conf: *** QC PASS ***"
.test.out:
@../conftest < $*.test >$*.out
diff --git a/tests/gsch2pcb-rnd/Makefile b/tests/gsch2pcb-rnd/Makefile
new file mode 100644
index 0000000..77b07bc
--- /dev/null
+++ b/tests/gsch2pcb-rnd/Makefile
@@ -0,0 +1,12 @@
+all:
+ cd simple && $(MAKE) all
+
+test:
+ cd simple && $(MAKE) test
+ @echo "gsch2pcb-rnd: *** QC PASS ***"
+
+clean:
+ cd simple && $(MAKE) clean
+
+distclean:
+ cd simple && $(MAKE) distclean
diff --git a/tests/gsch2pcb-rnd/simple/Makefile b/tests/gsch2pcb-rnd/simple/Makefile
index d0283b3..d11b305 100644
--- a/tests/gsch2pcb-rnd/simple/Makefile
+++ b/tests/gsch2pcb-rnd/simple/Makefile
@@ -5,5 +5,5 @@ include ../Makefile.common
test: FORCE
@rm main.pcb main.pcb.new main.cmd main.net main.out 2>/dev/null; true
- @$(GSCH2PCB) $(CONF) main.sch > main.out
+ @$(GSCH2PCB) -m pcb $(CONF) main.sch > main.out
@$(DIFF) main.pcb.ref main.pcb
diff --git a/tests/pcb-printf/Makefile b/tests/pcb-printf/Makefile
index 2cb5a0c..27c994c 100644
--- a/tests/pcb-printf/Makefile
+++ b/tests/pcb-printf/Makefile
@@ -2,23 +2,26 @@ TRUNK = ../..
SRC=$(TRUNK)/src
CFLAGS_OP = -O3
CFLAGS = -I$(TRUNK) -I$(SRC) -I$(TRUNK)/src_3rd -I$(TRUNK)/src_3rd/liblihata
-LDFLAGS = -lm
+LDLIBS = -lm
GDS= $(TRUNK)/src_3rd/genvector/gds_char.o
+LIBPCB_BASE= $(SRC)/unit.o $(SRC)/compat_misc.o
all: tester_spd prcli
test: tester.diff
- @echo "*** all ok, QC PASS ***"
+ @echo "pcb-printf: *** QC PASS ***"
@rm tester.stdout ; true
-prcli: prcli.o $(SRC)/pcb-printf.o $(SRC)/unit.o $(GDS) $(SRC)/misc_util.o $(GDS)
+prcli: prcli.o $(SRC)/pcb-printf.o $(SRC)/misc_util.o $(LIBPCB_BASE) $(GDS)
prcli.o: prcli.c
-tester: tester.o $(SRC)/pcb-printf.o $(SRC)/unit.o $(GDS)
+tester: tester.o $(SRC)/pcb-printf.o $(LIBPCB_BASE) $(GDS)
+ $(CC) $(LDFLAGS) -o tester tester.o $(SRC)/pcb-printf.o $(LIBPCB_BASE) $(GDS) $(LDLIBS)
-tester_spd: tester_spd.o $(SRC)/pcb-printf_spd.o $(SRC)/unit.o $(GDS)
+tester_spd: tester_spd.o $(SRC)/pcb-printf_spd.o $(LIBPCB_BASE) $(GDS)
+ $(CC) $(LDFLAGS) -o tester_spd tester_spd.o $(SRC)/pcb-printf_spd.o $(LIBPCB_BASE) $(GDS) $(LDLIBS)
tester.o: tester.c
$(CC) -c $(CFLAGS) -o $@ tester.c
@@ -40,5 +43,5 @@ $(SRC)/pcb-printf_spd.o: $(SRC)/pcb-printf.c $(SRC)/pcb-printf.h
$(CC) -c $(CFLAGS_OP) -DSPEED $(CFLAGS) -o $@ $(SRC)/pcb-printf.c
clean:
- rm tester tester.o 2>/dev/null ; true
+ -rm tester tester.o prcli prcli.o tester_spd tester_spd.o $(SRC)/pcb-printf_spd.o 2>/dev/null
diff --git a/tests/pcb-printf/prcli.c b/tests/pcb-printf/prcli.c
index a83b8c4..c9a9c6f 100644
--- a/tests/pcb-printf/prcli.c
+++ b/tests/pcb-printf/prcli.c
@@ -6,16 +6,16 @@
int main(int argc, char *argv[])
{
const char *fmt = argv[1];
- Coord crd;
+ pcb_coord_t crd;
int n;
pcb_printf_slot[0] = "%mr";
for(n = 2; n < argc; n++) {
pcb_bool success;
- double val = GetValueEx(argv[n], NULL, NULL, NULL, "", &success);
+ double val = pcb_get_value_ex(argv[n], NULL, NULL, NULL, "", &success);
if (!success) {
- fprintf(stderr, "Unable to convert '%s' to coord\n", argv[n]);
+ fprintf(stderr, "Unable to convert '%s' to pcb_coord_t\n", argv[n]);
return 1;
}
crd = val;
@@ -26,4 +26,4 @@ int main(int argc, char *argv[])
printf("\n");
return 0;
-}
\ No newline at end of file
+}
diff --git a/tests/pcb-printf/tester.c b/tests/pcb-printf/tester.c
index 5f1c6a8..4f97408 100644
--- a/tests/pcb-printf/tester.c
+++ b/tests/pcb-printf/tester.c
@@ -1,7 +1,6 @@
#include <time.h>
#include <locale.h>
#include "config.h"
-#include "global.h"
#include "pcb-printf.h"
#ifdef SPEED
@@ -20,7 +19,7 @@
int main()
{
- Coord c[] = {0, 1, 1024, 1024*1024, 1024*1024*1024};
+ pcb_coord_t c[] = {0, 1, 1024, 1024*1024, 1024*1024*1024};
char *fmt[] = {
"%mI", "%mm", "%mM", "%ml", "%mL", "%ms", "%mS", "%md", "%mD", "%m3", "%mr",
"%$mI", "%$mm", "%$mM", "%$ml", "%$mL", "%$ms", "%$mS", "%$md", "%$mD", "%$m3", "%$mr",
@@ -50,10 +49,10 @@ int main()
PCB_PRINTF("ma=%ma\n", 130.1234);
PCB_PRINTF("ma=%ma\n", 555.1234);
- PCB_PRINTF("m+=%m+%mS mil\n", ALLOW_MIL, c[n]);
- PCB_PRINTF("m+=%m+%mS mm\n", ALLOW_MM, c[n]);
- PCB_PRINTF("m+=%m+%mS m\n", ALLOW_M, c[n]);
- PCB_PRINTF("m+=%m+%mS mm or m\n", ALLOW_MM | ALLOW_M, c[n]);
+ PCB_PRINTF("m+=%m+%mS mil\n", PCB_UNIT_ALLOW_MIL, c[n]);
+ PCB_PRINTF("m+=%m+%mS mm\n", PCB_UNIT_ALLOW_MM, c[n]);
+ PCB_PRINTF("m+=%m+%mS m\n", PCB_UNIT_ALLOW_M, c[n]);
+ PCB_PRINTF("m+=%m+%mS mm or m\n", PCB_UNIT_ALLOW_MM | PCB_UNIT_ALLOW_M, c[n]);
}
}
diff --git a/tests/pcb-printf/tester.ref b/tests/pcb-printf/tester.ref
index eb6811c..ace7210 100644
--- a/tests/pcb-printf/tester.ref
+++ b/tests/pcb-printf/tester.ref
@@ -65,25 +65,25 @@ m+=0.0000 mm or m
---------------
mI=1024
mm=0.0010
-mM=1.02
+mM=1024
ml=0.04
mL=4
ms=0.0010
-mS=1.02
+mS=1024
md=(0.0010, 0.0010)
-mD=(1.02, 1.02)
-m3=(1.02, 1.02, 1.02)
+mD=(1024, 1024)
+m3=(1024, 1024, 1024)
mr=4
$mI=1024
$mm=0.0010 mm
-$mM=1.02 um
+$mM=1024 nm
$ml=0.04 mil
$mL=4 cmil
$ms=0.0010 mm
-$mS=1.02 um
+$mS=1024 nm
$md=(0.0010, 0.0010) mm
-$mD=(1.02, 1.02) um
-$m3=(1.02, 1.02, 1.02) um
+$mD=(1024, 1024) nm
+$m3=(1024, 1024, 1024) nm
$mr=4
m*=0.04 mil
m*=0.0010 mm
@@ -97,25 +97,25 @@ m+=0.0010 mm or m
---------------
mI=1048576
mm=1.0486
-mM=1.0486
+mM=1048.58
ml=41.28
mL=41.28
ms=1.0486
-mS=1.0486
+mS=1048.58
md=(1.0486, 1.0486)
-mD=(1.0486, 1.0486)
-m3=(1.0486, 1.0486, 1.0486)
+mD=(1048.58, 1048.58)
+m3=(1048.58, 1048.58, 1048.58)
mr=4128
$mI=1048576
$mm=1.0486 mm
-$mM=1.0486 mm
+$mM=1048.58 um
$ml=41.28 mil
$mL=41.28 mil
$ms=1.0486 mm
-$mS=1.0486 mm
+$mS=1048.58 um
$md=(1.0486, 1.0486) mm
-$mD=(1.0486, 1.0486) mm
-$m3=(1.0486, 1.0486, 1.0486) mm
+$mD=(1048.58, 1048.58) um
+$m3=(1048.58, 1048.58, 1048.58) um
$mr=4128
m*=41.28 mil
m*=1.0486 mm
@@ -129,25 +129,25 @@ m+=1.0486 mm or m
---------------
mI=1073741824
mm=1073.7418
-mM=1.07374
+mM=107.37418
ml=42273.30
mL=42.27330
ms=1073.7418
-mS=1.07374
+mS=1073.7418
md=(1073.7418, 1073.7418)
-mD=(1.07374, 1.07374)
-m3=(1.07374, 1.07374, 1.07374)
+mD=(107.37418, 107.37418)
+m3=(107.37418, 107.37418, 107.37418)
mr=4227330
$mI=1073741824
$mm=1073.7418 mm
-$mM=1.07374 m
+$mM=107.37418 cm
$ml=42273.30 mil
$mL=42.27330 in
$ms=1073.7418 mm
-$mS=1.07374 m
+$mS=1073.7418 mm
$md=(1073.7418, 1073.7418) mm
-$mD=(1.07374, 1.07374) m
-$m3=(1.07374, 1.07374, 1.07374) m
+$mD=(107.37418, 107.37418) cm
+$m3=(107.37418, 107.37418, 107.37418) cm
$mr=4227330
m*=42273.30 mil
m*=1073.7418 mm
@@ -157,4 +157,4 @@ ma=555
m+=42273.30 mil
m+=1073.7418 mm
m+=1.07374 m
-m+=1.07374 mm or m
+m+=1073.7418 mm or m
diff --git a/tests/pcbflags/Makefile b/tests/pcbflags/Makefile
index b5c8c46..7a6c523 100644
--- a/tests/pcbflags/Makefile
+++ b/tests/pcbflags/Makefile
@@ -1,4 +1,9 @@
all:
test:
- @./test.sh
+ @./test.sh && echo "pcbflags: *** QC PASS ***"
+
+clean:
+ mv vanilla.pcb vanilla.save
+ -rm *.pcb *.log
+ mv vanilla.save vanilla.pcb
diff --git a/tests/pcbflags/test.sh b/tests/pcbflags/test.sh
index 40b307d..e00ec53 100755
--- a/tests/pcbflags/test.sh
+++ b/tests/pcbflags/test.sh
@@ -10,7 +10,10 @@ run_pcb()
then
fn="$pwd/$1"
fi
- shift 1
+ if test $# -gt 1
+ then
+ shift 1
+ fi
(
cd "$src_dir"
if test -z "$fn"
@@ -67,6 +70,13 @@ dumpconf(lihata,design)
return 0
}
+diag=`cd "$src_dir" && ./pcb-rnd --dump-plugins | grep diag`
+if test -z "$diag"
+then
+ echo "pcbflags: can't run tests because the diag plugin is not compiled."
+ exit 0
+fi
+
test_flag "plugins/mincut/enable" "true" "enablemincut"
test_flag "editor/show_number" "true" "shownumber"
@@ -81,7 +91,6 @@ test_flag "editor/full_poly" "true" "newfullpoly"
test_flag "editor/snap_pin" "true" "snappin"
test_flag "editor/orthogonal_moves" "true" "orthomove"
test_flag "editor/live_routing" "true" "liveroute"
-test_flag "editor/enable_stroke" "true" "enablestroke"
test_flag "editor/only_names" "true" "onlynames"
test_flag "editor/lock_names" "true" "locknames"
test_flag "editor/hide_names" "true" "hidenames"
diff --git a/tests/propedit/Makefile b/tests/propedit/Makefile
index 99ceb50..81f1402 100644
--- a/tests/propedit/Makefile
+++ b/tests/propedit/Makefile
@@ -4,6 +4,7 @@ LHT=$(ROOT)/src_3rd/liblihata
SRC=$(ROOT)/src
CFLAGS = -g -Wall -I$(PED) -I$(LHT) -I$(SRC) -I$(ROOT) -I$(ROOT)/src_3rd
+LDLIBS = -lm
LIB_OBJS = \
$(LHT)/genht/htsp.o \
$(LHT)/genht/hash.o \
@@ -12,13 +13,16 @@ LIB_OBJS = \
$(SRC)/unit.o \
$(ROOT)/src_3rd/genvector/gds_char.o
+OBJS = tester.o $(PED)/props.o
+
all: tester
test: tester.diff
- @echo "*** All ok, QC passed ***"
+ @echo "propedit: *** QC PASS ***"
@rm tester.out
-tester: tester.o $(PED)/props.o $(LIB_OBJS)
+tester: $(OBJS) $(LIB_OBJS)
+ $(CC) $(LDFLAGS) -o tester $(OBJS) $(LIB_OBJS) $(LDLIBS)
tester.o: tester.c $(PED)/props.h
@@ -30,3 +34,5 @@ tester.diff: tester.ref tester.out
tester.out: tester
./tester > tester.out
+clean:
+ -rm tester.out tester $(OBJS)
diff --git a/tests/propedit/tester.c b/tests/propedit/tester.c
index cdcb382..93983fb 100644
--- a/tests/propedit/tester.c
+++ b/tests/propedit/tester.c
@@ -2,6 +2,24 @@
#include <assert.h>
#include "props.h"
+void *pcb_gui = NULL;
+
+int pcb_propsel_set(const char *prop, const char *value)
+{
+ return 0;
+}
+
+int pcb_propsel_del(const char *key)
+{
+ return 0;
+}
+
+void pcb_propsel_map_core(htsp_t *props)
+{
+}
+
+
+
static void print_val(pcb_prop_type_t type, pcb_propval_t val)
{
switch(type) {
diff --git a/tests/remote/Makefile b/tests/remote/Makefile
new file mode 100644
index 0000000..23b58d1
--- /dev/null
+++ b/tests/remote/Makefile
@@ -0,0 +1,16 @@
+ROOT=../..
+REM=$(ROOT)/src_plugins/hid_remote
+CFLAGS = -Wall -g -I$(REM) -I$(ROOT)/src -I$(ROOT)
+
+all: test_parse
+
+test_parse: test_parse.o
+ $(CC) $(LDFLAGS) -o test_parse test_parse.o $(LDLIBS)
+
+test_parse.o: test_parse.c $(REM)/proto_lowcommon.h $(REM)/proto_lowparse.h $(REM)/proto_lowdbg.h
+
+test:
+ @./test_all.sh
+
+clean:
+ -rm test_parse test_parse.o
diff --git a/tests/remote/bin.msg b/tests/remote/bin.msg
new file mode 100644
index 0000000..8f37e5a
--- /dev/null
+++ b/tests/remote/bin.msg
@@ -0,0 +1,6 @@
+cmd{B=1 C=ab D=123}
+empty{A= A= A=}
+nasty{D={}
+ D= #=}
+
+
diff --git a/tests/remote/bin.ref b/tests/remote/bin.ref
new file mode 100644
index 0000000..07b18af
--- /dev/null
+++ b/tests/remote/bin.ref
@@ -0,0 +1,18 @@
+msg 'cmd'
+ list (bin):
+ str (bin): 1/'1'
+ str (bin): 2/'ab'
+ str (bin): 3/'123'
+
+msg 'empty'
+ list (bin):
+ str (bin): 0/'(null)'
+ str (bin): 0/'(null)'
+ str (bin): 0/'(null)'
+
+msg 'nasty'
+ list (bin):
+ str (bin): 3/'{}
+'
+ str (bin): 3/' #='
+
diff --git a/tests/remote/lists.msg b/tests/remote/lists.msg
new file mode 100644
index 0000000..3e68fc2
--- /dev/null
+++ b/tests/remote/lists.msg
@@ -0,0 +1 @@
+bar((A B)(1 2 3){B=a B=b {C=11 C=12}})
diff --git a/tests/remote/lists.ref b/tests/remote/lists.ref
new file mode 100644
index 0000000..4b9928c
--- /dev/null
+++ b/tests/remote/lists.ref
@@ -0,0 +1,16 @@
+msg 'bar'
+ list (text):
+ list (text):
+ str (text): 1/'A'
+ str (text): 1/'B'
+ list (text):
+ str (text): 1/'1'
+ str (text): 1/'2'
+ str (text): 1/'3'
+ list (bin):
+ str (bin): 1/'a'
+ str (bin): 1/'b'
+ list (bin):
+ str (bin): 2/'11'
+ str (bin): 2/'12'
+
diff --git a/tests/remote/simple.msg b/tests/remote/simple.msg
new file mode 100644
index 0000000..5e2c3c3
--- /dev/null
+++ b/tests/remote/simple.msg
@@ -0,0 +1,2 @@
+foo()
+bar{}
diff --git a/tests/remote/simple.ref b/tests/remote/simple.ref
new file mode 100644
index 0000000..0a28f43
--- /dev/null
+++ b/tests/remote/simple.ref
@@ -0,0 +1,6 @@
+msg 'foo'
+ list (text):
+
+msg 'bar'
+ list (bin):
+
diff --git a/tests/remote/test_all.sh b/tests/remote/test_all.sh
new file mode 100755
index 0000000..9addeb8
--- /dev/null
+++ b/tests/remote/test_all.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+fail=0
+all=0
+for ref in *.ref
+do
+ bn=${ref%%.ref}
+ ./test_parse < $bn.msg > $bn.out
+ diff -u $bn.ref $bn.out
+ if test $? = 0
+ then
+ rm $bn.out
+ else
+ fail=$(($fail+1))
+ fi
+ all=$(($all+1))
+done
+
+if test $fail = 0
+then
+ echo "remote: *** QC PASS ***"
+else
+ echo "remote: FAIL: $fail of $all"
+fi
diff --git a/tests/remote/test_parse.c b/tests/remote/test_parse.c
new file mode 100644
index 0000000..6c09e0f
--- /dev/null
+++ b/tests/remote/test_parse.c
@@ -0,0 +1,41 @@
+#include <string.h>
+#include "base64.c"
+#include "proto_lowcommon.h"
+#include "proto_lowparse.h"
+#include "proto_lowdbg.h"
+
+int main()
+{
+ int line = 1, col = 1;
+ proto_ctx_t pctx;
+
+ memset(&pctx, 0, sizeof(pctx));
+
+ for(;;) {
+ parse_res_t res;
+ int c = getchar();
+ if (c == EOF)
+ return -1;
+ if (c == '\n') {
+ col = 1;
+ line++;
+ }
+ else
+ col++;
+ res = parse_char(&pctx, c);
+ switch(res) {
+ case PRES_ERR:
+ printf("parse error at %d:%d\n", line, col);
+ return 1;
+ case PRES_GOT_MSG:
+ printf("msg '%s'\n", pctx.pcmd);
+ proto_node_print(pctx.targ, 1);
+ printf("\n");
+ proto_node_free(pctx.targ);
+ break;
+ case PRES_PROCEED:
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/tests/remote/text.msg b/tests/remote/text.msg
new file mode 100644
index 0000000..3ff241f
--- /dev/null
+++ b/tests/remote/text.msg
@@ -0,0 +1 @@
+cmd(a e _ # foo bar)
diff --git a/tests/remote/text.ref b/tests/remote/text.ref
new file mode 100644
index 0000000..dc1a098
--- /dev/null
+++ b/tests/remote/text.ref
@@ -0,0 +1,9 @@
+msg 'cmd'
+ list (text):
+ str (text): 1/'a'
+ str (text): 1/'e'
+ str (text): 1/'_'
+ str (text): 1/'#'
+ str (text): 3/'foo'
+ str (text): 3/'bar'
+
diff --git a/tests/strflags/Makefile b/tests/strflags/Makefile
index fc44613..698ba1f 100644
--- a/tests/strflags/Makefile
+++ b/tests/strflags/Makefile
@@ -1,15 +1,17 @@
TRUNK=../..
IO=$(TRUNK)/src_plugins/io_pcb
CFLAGS = -O3 -I$(TRUNK) -I$(TRUNK)/src -I$(IO) -I$(TRUNK)/src_3rd
+LDLIBS = -lm
GDS= $(TRUNK)/src_3rd/genvector/gds_char.o
all: tester
test: tester.diff
- @echo "*** all ok, QC PASS ***"
+ @echo "strflags: *** QC PASS ***"
@rm tester.stdout
tester: tester.o $(GDS)
+ $(CC) $(LDFLAGS) -o tester tester.o $(GDS) $(LDLIBS)
tester.o: tester.c
$(CC) -c $(CFLAGS) -o $@ tester.c
diff --git a/tests/strflags/tester.c b/tests/strflags/tester.c
index 4eabe32..fbd6d58 100644
--- a/tests/strflags/tester.c
+++ b/tests/strflags/tester.c
@@ -31,28 +31,19 @@
#include "compat_misc.h"
#define FLAG_TEST
-#include "strflags.c"
-#include "flags.c"
+#include "flag_str.c"
+#include "flag.c"
#include "compat_misc.c"
-static void dump_flag(FlagType * f)
+static void dump_flag(pcb_flag_t * f)
{
int l;
printf("F:%08x T:[", f->f);
- for (l = 0; l < (MAX_LAYER + 7) / 8; l++)
+ for (l = 0; l < (PCB_MAX_LAYER + 7) / 8; l++)
printf(" %02x", f->t[l]);
printf("]");
}
-
-int mem_any_set(unsigned char *ptr, int bytes)
-{
- while (bytes--)
- if (*ptr++)
- return 1;
- return 0;
-}
-
int main()
{
time_t now;
@@ -81,34 +72,34 @@ int main()
while (count < 1000000) {
FlagHolder fh;
char *str;
- FlagType new_flags;
+ pcb_flag_t new_flags;
int i;
int otype;
otype = PCB_TYPEMASK_ALL;
fh.Flags = empty_flags;
- for (i = 0; i < ENTRIES(object_flagbits); i++) {
- if (TEST_FLAG(object_flagbits[i].mask, &fh))
+ for (i = 0; i < PCB_ENTRIES(pcb_object_flagbits); i++) {
+ if (PCB_FLAG_TEST(pcb_object_flagbits[i].mask, &fh))
continue;
- if ((otype & object_flagbits[i].object_types) == 0)
+ if ((otype & pcb_object_flagbits[i].object_types) == 0)
continue;
if ((random() & 4) == 0)
continue;
- otype &= object_flagbits[i].object_types;
- SET_FLAG(object_flagbits[i].mask, &fh);
+ otype &= pcb_object_flagbits[i].object_types;
+ PCB_FLAG_SET(pcb_object_flagbits[i].mask, &fh);
}
if (otype & PCB_TYPEMASK_PIN)
- for (i = 0; i < MAX_LAYER; i++)
+ for (i = 0; i < PCB_MAX_LAYER; i++)
if (random() & 4)
- ASSIGN_THERM(i, 3, &fh);
+ PCB_FLAG_THERM_ASSIGN(i, 3, &fh);
- str = flags_to_string(fh.Flags, otype);
- new_flags = string_to_flags(str, 0);
+ str = pcb_strflg_f2s(fh.Flags, otype);
+ new_flags = pcb_strflg_s2f(str, 0);
count++;
- if (FLAGS_EQUAL(fh.Flags, new_flags))
+ if (PCB_FLAG_EQ(fh.Flags, new_flags))
continue;
dump_flag(&fh.Flags);
printf(" ");
@@ -121,27 +112,27 @@ int main()
while (count < 1000000) {
FlagHolder fh;
char *str;
- FlagType new_flags;
+ pcb_flag_t new_flags;
int i;
int otype;
otype = PCB_TYPEMASK_ALL;
fh.Flags = empty_flags;
- for (i = 0; i < ENTRIES(pcb_flagbits); i++) {
- if (TEST_FLAG(pcb_flagbits[i].mask, &fh))
+ for (i = 0; i < PCB_ENTRIES(pcb_flagbits); i++) {
+ if (PCB_FLAG_TEST(pcb_flagbits[i].mask, &fh))
continue;
if ((random() & 4) == 0)
continue;
otype &= pcb_flagbits[i].object_types;
- SET_FLAG(pcb_flagbits[i].mask, &fh);
+ PCB_FLAG_SET(pcb_flagbits[i].mask, &fh);
}
- str = pcbflags_to_string(fh.Flags);
- new_flags = string_to_pcbflags(str, 0);
+ str = pcb_strflg_board_f2s(fh.Flags);
+ new_flags = pcb_strflg_board_s2f(str, 0);
count++;
- if (FLAGS_EQUAL(fh.Flags, new_flags))
+ if (PCB_FLAG_EQ(fh.Flags, new_flags))
continue;
dump_flag(&fh.Flags);
diff --git a/tests/uniq_name/Makefile b/tests/uniq_name/Makefile
index a6265fb..6e245a1 100644
--- a/tests/uniq_name/Makefile
+++ b/tests/uniq_name/Makefile
@@ -1,18 +1,20 @@
ROOT=../..
-UNM=$(ROOT)/src_plugins/io_kicad_legacy
+UNM=$(ROOT)/src_plugins/io_kicad
LHT=$(ROOT)/src_3rd/liblihata
SRC=$(ROOT)/src
CFLAGS = -Wall -I$(UNM) -I$(LHT) -I$(SRC) -I$(ROOT)
+LDLIBS = -lm
LIB_OBJS=$(LHT)/genht/htsp.o $(LHT)/genht/hash.o $(SRC)/compat_misc.o
all: tester
test: tester.diff
- @echo "*** All ok, QC passed ***"
+ @echo "uniq_name: *** QC PASS ***"
@rm tester.out
tester: tester.o $(UNM)/uniq_name.o $(LIB_OBJS)
+ $(CC) $(LDFLAGS) -o tester tester.o $(UNM)/uniq_name.o $(LIB_OBJS) $(LDLIBS)
tester.o: tester.c $(UNM)/uniq_name.h
@@ -24,3 +26,5 @@ tester.diff: tester.ref tester.out
tester.out: tester
./tester > tester.out
+clean:
+ -rm tester.out tester tester.o
diff --git a/tests/uniq_name/tester.c b/tests/uniq_name/tester.c
index 0a540c0..67d31f2 100644
--- a/tests/uniq_name/tester.c
+++ b/tests/uniq_name/tester.c
@@ -49,10 +49,16 @@ int main()
Warning: order is not guaranteed. */
{
htsp_entry_t *e;
- for (e = htsp_first(&group1.seen); e; e = htsp_next(&group1.seen, e))
- printf("name='%s' user_data='%p'\n", e->key, e->value);
+ for (e = htsp_first(&group1.seen); e; e = htsp_next(&group1.seen, e)) {
+ printf("name='%s' user_data='", e->key);
+ if (e->value == NULL)
+ printf("(nil)'\n");
+ else
+ printf("%p'\n", e->value);
+ }
}
/* Release all memory */
unm_uninit(&group1);
+ return 0;
}
diff --git a/util/Makefile b/util/Makefile
index 9a22c8f..2378775 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -1,30 +1,32 @@
# plain old hand crafted Makefile
all:
- cd gsch2pcb-rnd && make all
+ cd gsch2pcb-rnd && $(MAKE) all
include ../Makefile.conf
clean:
- cd gsch2pcb-rnd && make clean
+ cd gsch2pcb-rnd && $(MAKE) clean
install_:
$(MKDIR) "$(BINDIR)" "$(LIBDIR)"
$(CPC) "`pwd`/fp2anim" "$(BINDIR)/fp2anim"
$(CPC) "`pwd`/pcb-strip" "$(BINDIR)/pcb-strip"
+ $(CPC) "`pwd`/pcb-prj2lht" "$(BINDIR)/pcb-prj2lht"
$(CPC) "`pwd`/gnet-pcbrndfwd.scm" "$(LIBDIR)/gnet-pcbrndfwd.scm"
$(CPC) "`pwd`/gnet-pcbrndfwd_elem.scm" "$(LIBDIR)/gnet-pcbrndfwd_elem.scm"
- cd gsch2pcb-rnd && make install_ CPC="$(CPC)"
+ cd gsch2pcb-rnd && $(MAKE) install_ CPC="$(CPC)"
install:
- make install_ CPC="$(CP)"
+ $(MAKE) install_ CPC="$(CP)"
linstall:
- make install_ CPC="$(LN)"
+ $(MAKE) install_ CPC="$(LN)"
uninstall:
$(RM) "$(BINDIR)/fp2anim"
$(RM) "$(BINDIR)/pcb-strip"
+ $(RM) "$(BINDIR)/pcb-prj2lht"
$(RM) "$(LIBDIR)/gnet-pcbrndfwd.scm"
$(RM) "$(LIBDIR)/gnet-pcbrndfwd_elem.scm"
- cd gsch2pcb-rnd && make uninstall
+ cd gsch2pcb-rnd && $(MAKE) uninstall
diff --git a/util/devhelpers/chgstat.sh b/util/devhelpers/chgstat.sh
index 7576683..628ee0e 100755
--- a/util/devhelpers/chgstat.sh
+++ b/util/devhelpers/chgstat.sh
@@ -55,11 +55,15 @@ do
done| awk -v import=$import '
{
rev=int($1)
- if (((rev >= 3871) && (rev <= 3914)) || ((rev >= 4065) && (rev <= 4068)) || (rev == 4023) || (rev == 4033)) {
+ if (((rev >= 3871) && (rev <= 3914)) || ((rev >= 4065) && (rev <= 4068)) || (rev == 4023) || (rev == 4033) || (rev == 4095) || (rev == 4096) || (rev == 4122)) {
# old plugins and export plugin import
old++
}
- else if ((rev <= import) || (rev == 1022) || (rev == 3539))
+ else if ((rev == 4550) || ((rev <= 4548) && (rev >= 4536)) || ((rev <= 4534) && (rev >= 4530)) || ((rev <= 4528) && (rev >= 4524)) || ((rev <= 4522) && (rev >= 4502)) || ((rev <= 4500) && (rev >= 4493)) || ((rev <= 4491) && (rev >= 4486)) || ((rev <= 4633) && (rev >= 4562)) || (rev == 4776) || (rev == 4847) || (rev == 4850) || (rev == 4856) || (rev == 4863) || (rev == 4866) || (rev == 4878) || (rev == 4914) || (rev == 4916) || (rev == 5002) || (rev == 5014)) {
+# unravel
+ old++
+ }
+ else if ((rev <= import) || (rev == 1022) || (rev == 3539) || (rev == 4187))
old++
else
new++
diff --git a/util/devhelpers/inc_valid.sh b/util/devhelpers/inc_valid.sh
new file mode 100755
index 0000000..a251ce8
--- /dev/null
+++ b/util/devhelpers/inc_valid.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# inc_weed_out - check whether a source file has valid #includes for pcb-rnd
+# Copyright (C) 2016 Tibor 'Igor2' Palinkas
+#
+# 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.
+#
+# http://repo.hu/projects/pcb-rnd
+
+# include validation:
+# - in .c files config.h must be included
+# - warn for duplicate #includes
+
+# Usage:
+# 1. compile the whole project so that all dependencies of the target file are compiled
+# 2. inc_valid.sh foo.c
+# 3. check the output, fix #includes
+# 4. compile by hand to check
+#
+# NOTE: conditional code also requires manual examination
+
+# set up file names
+fn_c=$1
+
+# comment one #include (index is $1, save output in $2, print the #include line to stdout)
+valid()
+{
+ awk -v "fn=$1" '
+ /^#[ \t]*include/ {
+ SEEN[$2]++
+ }
+ END {
+ for(h in SEEN)
+ if (SEEN[h] > 1)
+ print "W " fn ": multiple include of " h
+ if ((fn ~ "[.]c$") && (! ("\"config.h\"" in SEEN)))
+ print "E " fn ": missing config.h"
+ }
+ ' < "$1"
+}
+
+for n in "$@"
+do
+ valid "$n"
+done
diff --git a/util/devhelpers/pcb-rtrip b/util/devhelpers/pcb-rtrip
index 9b18de3..3124b7c 100755
--- a/util/devhelpers/pcb-rtrip
+++ b/util/devhelpers/pcb-rtrip
@@ -33,7 +33,7 @@ LoadFrom(Layout, '$fn'.orig.pcb)
SaveTo(LayoutAs, '$fn'.trgt.'$ext', '$fmt')
LoadFrom(Layout, '$fn'.trgt.'$ext', '$fmt')
SaveTo(LayoutAs, '$fn'.new.pcb, pcb)
-' | $valg $bin --gui batch "$fn"
+' | $valg $pcb_rnd_bin --gui batch "$fn"
if test -f "$fn.orig.pcb" -a -f "$fn.new.pcb"
then
@@ -81,7 +81,10 @@ help()
fmt="lihata"
fn=""
remtgt=""
-bin="pcb-rnd"
+if test -z "$pcb_rnd_bin"
+then
+ pcb_rnd_bin="pcb-rnd"
+fi
valg=""
while test $# -gt 0
@@ -90,7 +93,7 @@ do
in
--help) help "$0"; exit 0;;
-f) fmt=$2; shift 1;;
- -b) bin=$2; shift 1;;
+ -b) pcb_rnd_bin=$2; shift 1;;
-V) valg="valgrind -v";;
-r) remtgt=1;;
*)
diff --git a/util/devhelpers/renamea.sh b/util/devhelpers/renamea.sh
new file mode 100755
index 0000000..163840b
--- /dev/null
+++ b/util/devhelpers/renamea.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+echo "Renaming action $1" >&2
+
+na=`echo $1 | sed "s/^Action//"`
+lc=`echo $na | tr "[A-Z]" "[a-z]"`
+
+./renameo.sh "$1" "pcb_act_$na"
+./renameo.sh "${lc}_help" "pcb_acth_$na"
+./renameo.sh "${lc}_syntax" "pcb_acts_$na"
+./rename.sh "s/\\([^a-zA-Z0-9_]\\)AFAIL[(]${lc}[)]/\\1PCB_ACT_FAIL($na)/g"
diff --git a/util/devhelpers/renamef.sh b/util/devhelpers/renamef.sh
new file mode 100755
index 0000000..b1cb986
--- /dev/null
+++ b/util/devhelpers/renamef.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Rename a function and log
+
+./rename.sh "s/\\([^a-zA-Z0-9_]\\)${1}[ \t]*[(]/\\1$2(/g"
+./rename.sh "s/^${1}[ \t]*[(]/$2(/g"
+
+echo "$1 -> $2" >> doc/developer/renames
diff --git a/util/devhelpers/renameo.sh b/util/devhelpers/renameo.sh
new file mode 100755
index 0000000..5f9029b
--- /dev/null
+++ b/util/devhelpers/renameo.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+./rename.sh "
+ s/\\([^a-zA-Z0-9_]\\)${1}\\([^a-zA-Z0-9_]\\)/\\1$2\\2/g;
+ s/^${1}\\([^a-zA-Z0-9_]\\)/$2\\1/g;
+ s/\\([^a-zA-Z0-9_]\\)${1}$/\\1$2/g;
+"
+
+echo "$1 -> $2" >> doc/developer/renames
diff --git a/util/gsch2pcb-rnd/Makefile.in b/util/gsch2pcb-rnd/Makefile.in
index 35bf4fc..90afa4c 100644
--- a/util/gsch2pcb-rnd/Makefile.in
+++ b/util/gsch2pcb-rnd/Makefile.in
@@ -1,10 +1,12 @@
-put /local/pcb/CFLAGS {-I../.. -I../../src_3rd -I../../src_3rd/liblihata -DSCMDIR="\\"$(LIBDIR)\\""}
+put /local/pcb/CFLAGS cc/cflags
+append /local/pcb/CFLAGS {-I../.. -I../../src_3rd -I../../src_3rd/liblihata -DSCMDIR="\\"$(LIBDIR)\\""}
+append /local/pcb/LDFLAGS cc/ldflags
include {../scconfig/template/debug.tmpasm}
print [@
PLUGDIR=../../src_plugins
CFLAGS=@/local/pcb/c89flags@ @/local/pcb/CFLAGS@
-LDFLAGS=-lm
+LDFLAGS=-lm @/local/pcb/LDFLAGS@
CC=@cc/cc@
HASHOBJ=../../src_3rd/liblihata/genht/hash.o ../../src_3rd/liblihata/genht/htsp.o ../../src_3rd/liblihata/genht/htpp.o
@@ -57,8 +59,8 @@ OBJS = \
method_import.o
all:
- make revcheck
- make gsch2pcb-rnd$(EXE)
+ $(MAKE) revcheck
+ $(MAKE) gsch2pcb-rnd$(EXE)
revcheck:
cd ../../scconfig && ./revtest Rev.stamp < Rev.tab
@@ -116,10 +118,10 @@ install_:
$(CPC) "`pwd`/gnet-gsch2pcb-rnd.scm" "$(LIBDIR)/gnet-gsch2pcb-rnd.scm"
install:
- make install_ CPC="$(CP)"
+ $(MAKE) install_ CPC="$(CP)"
linstall:
- make install_ CPC="$(LN)"
+ $(MAKE) install_ CPC="$(LN)"
uninstall:
$(RM) "$(BINDIR)/gsch2pcb-rnd$(EXE)"
@@ -127,7 +129,10 @@ uninstall:
clean:
- $(RM) gsch2pcb-rnd$(EXE) $(OBJS) gsch2pcb_rnd_conf_fields.h
+ -$(RM) gsch2pcb-rnd$(EXE) $(OBJS) gsch2pcb_rnd_conf_fields.h
+
+distclean: clean
+ -$(RM) fp_init.c fp_init.h
include ../../Makefile.conf
diff --git a/util/gsch2pcb-rnd/glue.c b/util/gsch2pcb-rnd/glue.c
index 3d1d437..6462a21 100644
--- a/util/gsch2pcb-rnd/glue.c
+++ b/util/gsch2pcb-rnd/glue.c
@@ -22,22 +22,22 @@
/* glue for pcb-rnd core */
-void ChdirErrorMessage(const char *DirName)
+void pcb_chdir_error_message(const char *DirName)
{
- fprintf(stderr, "gsch2pcb-rnd: warning: can't cd to %s\n", DirName);
+ pcb_message(PCB_MSG_WARNING, "warning: can't cd to %s\n", DirName);
}
-void OpendirErrorMessage(const char *DirName)
+void pcb_opendir_error_message(const char *DirName)
{
- fprintf(stderr, "gsch2pcb-rnd: warning: can't opendir %s\n", DirName);
+ pcb_message(PCB_MSG_WARNING, "warning: can't opendir %s\n", DirName);
}
-void PopenErrorMessage(const char *cmd)
+void pcb_popen_error_message(const char *cmd)
{
- fprintf(stderr, "gsch2pcb-rnd: warning: can't popen %s\n", cmd);
+ pcb_message(PCB_MSG_WARNING, "warning: can't popen %s\n", cmd);
}
-void Message(enum pcb_message_level level, const char *fmt, ...)
+void pcb_message(enum pcb_message_level level, const char *fmt, ...)
{
va_list args;
fprintf(stderr, "gsch2pcb-rnd: ");
diff --git a/util/gsch2pcb-rnd/gsch2pcb.c b/util/gsch2pcb-rnd/gsch2pcb.c
index 3bdf73f..a554308 100644
--- a/util/gsch2pcb-rnd/gsch2pcb.c
+++ b/util/gsch2pcb-rnd/gsch2pcb.c
@@ -25,10 +25,14 @@
- use pcb-rnd's conf system
- use popen() instead of glib's spawn (stderr is always printed to stderr)
*/
+
#include "config.h"
+#define LOCAL_PROJECT_FILE "project.lht"
+
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
#include "../src/plug_footprint.h"
#include "../src/conf.h"
#include "../src/conf_core.h"
@@ -37,6 +41,7 @@
#include "../src/error.h"
#include "../src/plugins.h"
#include "../src/compat_misc.h"
+#include "../src/compat_fs.h"
#include "method.h"
#include "help.h"
#include "gsch2pcb_rnd_conf.h"
@@ -44,7 +49,7 @@
#include "method_pcb.h"
#include "method_import.h"
-static const char *want_method_default = "pcb";
+static const char *want_method_default = "import";
gdl_list_t pcb_element_list; /* initialized to 0 */
gadl_list_t schematics, extra_gnetlist_arg_list, extra_gnetlist_list;
@@ -75,7 +80,7 @@ method_t *method_find(const char *name)
}
/* Return a pointer to the suffix if inp ends in that suffix */
-static char *loc_str_has_suffix(char *inp, const char *suffix, int suff_len)
+static const char *loc_str_has_suffix(const char *inp, const char *suffix, int suff_len)
{
int len = strlen(inp);
if ((len >= suff_len) && (strcmp(inp + len - suff_len, suffix) == 0))
@@ -95,14 +100,14 @@ char *fix_spaces(char * str)
return str;
}
-static void add_schematic(char * sch)
+static void add_schematic(const char *sch)
{
char **n;
n = gadl_new(&schematics);
*n = pcb_strdup(sch);
gadl_append(&schematics, n);
if (!conf_g2pr.utils.gsch2pcb_rnd.sch_basename) {
- char *suff = loc_str_has_suffix(sch, ".sch", 4);
+ const char *suff = loc_str_has_suffix(sch, ".sch", 4);
if (suff != NULL) {
char *tmp = pcb_strndup(sch, suff - sch);
conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_basename", -1, tmp, POL_OVERWRITE);
@@ -169,13 +174,13 @@ static int parse_config(char * config, char * arg)
else if (!strcmp(config, "elements-dir") || !strcmp(config, "d")) {
static int warned = 0;
if (!warned) {
- fprintf(stderr, "WARNING: using elements-dir from %s - this overrides the normal pcb-rnd configured library search paths\n", config);
+ pcb_message(PCB_MSG_WARNING, "WARNING: using elements-dir from %s - this overrides the normal pcb-rnd configured library search paths\n", config);
warned = 1;
}
conf_set(CFR_CLI, "rc/library_search_paths", -1, arg, POL_PREPEND);
}
else if (!strcmp(config, "output-name") || !strcmp(config, "o"))
- conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_base", -1, arg, POL_OVERWRITE);
+ conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_basename", -1, arg, POL_OVERWRITE);
else if (!strcmp(config, "default-pcb") || !strcmp(config, "P"))
conf_set(CFR_CLI, "utils/gsch2pcb_rnd/default_pcb", -1, arg, POL_OVERWRITE);
else if (!strcmp(config, "schematics"))
@@ -198,10 +203,30 @@ static void load_project(char * path)
{
FILE *f;
char *s, buf[1024], config[32], arg[768];
+ int n;
f = fopen(path, "r");
if (!f)
return;
+
+ /* check if we have a lihata project file or config file by looking at the first 16 non-comments */
+ for(n = 0; n < 16;) {
+ if (fgets(buf, sizeof(buf), f) == NULL)
+ break;
+ s = buf;
+ while(isspace(*s)) s++;
+ if ((*s == '#') || (*s == '\r') || (*s == '\n') || (*s == '\0'))
+ continue;
+ /* look for known lihata roots */
+ if (strncmp(s, "ha:geda-project-v1", 18) == 0)
+ goto lihata_prj;
+ if (strncmp(s, "li:pcb-rnd-conf-v1", 18) == 0)
+ goto lihata_prj;
+ n++;
+ }
+
+ rewind(f);
+
if (conf_g2pr.utils.gsch2pcb_rnd.verbose)
printf("Reading project file: %s\n", path);
while (fgets(buf, sizeof(buf), f)) {
@@ -213,6 +238,15 @@ static void load_project(char * path)
parse_config(config, arg);
}
fclose(f);
+ return;
+
+lihata_prj:;
+ fclose(f);
+ if (conf_load_as(CFR_PROJECT, path, 0) != 0) {
+ pcb_message(PCB_MSG_ERROR, "Failed to parse project file %s.\n", path);
+ exit(1);
+ }
+ conf_update(NULL); /* because of our new project file */
}
static void load_extra_project_files(void)
@@ -233,7 +267,8 @@ static void load_extra_project_files(void)
done = TRUE;
}
-int have_project_file = 0;
+int have_cli_project_file = 0;
+int have_cli_schematics = 0;
static void get_args(int argc, char ** argv)
{
char *opt, *arg;
@@ -258,7 +293,7 @@ static void get_args(int argc, char ** argv)
}
else if (!strcmp(opt, "m") || !strcmp(opt, "method")) {
if (method_find(arg) == NULL) {
- Message(PCB_MSG_ERROR, "Error: can't use unknown method '%s'; try --help\n", arg);
+ pcb_message(PCB_MSG_ERROR, "Error: can't use unknown method '%s'; try --help\n", arg);
exit(1);
}
conf_set(CFR_CLI, "utils/gsch2pcb_rnd/method", -1, arg, POL_OVERWRITE);
@@ -299,20 +334,28 @@ static void get_args(int argc, char ** argv)
}
else {
if (loc_str_has_suffix(argv[i], ".sch", 4) == NULL) {
+ if (have_cli_project_file) {
+ pcb_message(PCB_MSG_ERROR, "ERROR: multiple project files specified on the command line (last one: %s). Either use multiple schematics or a single project file. Try %s --help\n", argv[i], argv[0]);
+ exit(1);
+ }
load_extra_project_files();
load_project(argv[i]);
- have_project_file = 1;
+ have_cli_project_file = 1;
}
- else
+ else {
add_schematic(argv[i]);
+ have_cli_schematics = 1;
+ }
}
}
}
-void plugin_register(const char *name, const char *path, void *handle, int dynamic_loaded, void (*uninit)(void))
+pcb_plugin_info_t *pcb_plugin_register(const char *name, const char *path, void *handle, int dynamic_loaded, void (*uninit)(void))
{
+ static pcb_plugin_info_t pif;
if (conf_g2pr.utils.gsch2pcb_rnd.verbose)
printf("Plugin loaded: %s (%s)\n", name, path);
+ return &pif;
}
void free_strlist(gadl_list_t *lst)
@@ -326,6 +369,15 @@ void free_strlist(gadl_list_t *lst)
}
}
+void require_gnetlist_backend(const char *dir, const char *backend)
+{
+ char *path = pcb_strdup_printf("%s/gnet-%s.scm", dir, backend);
+ if (!pcb_file_readable(path))
+ pcb_message(PCB_MSG_WARNING, "WARNING: %s is not found, gnetlist will probably fail; please check your pcb-rnd installation!\n", path);
+ free(path);
+}
+
+
#include "fp_init.h"
const char *local_project_pcb_name = NULL;
@@ -338,11 +390,9 @@ int main(int argc, char ** argv)
method_pcb_register();
method_import_register();
- if (argc < 2)
- usage();
-
conf_init();
conf_core_init();
+ conf_core_postproc(); /* to get all the paths initialized */
gadl_list_init(&schematics, sizeof(char *), NULL, NULL);
gadl_list_init(&extra_gnetlist_arg_list, sizeof(char *), NULL, NULL);
@@ -363,14 +413,52 @@ int main(int argc, char ** argv)
}
load_extra_project_files();
+ conf_update(NULL); /* because of CLI changes */
+ if (!have_cli_project_file && !have_cli_schematics) {
+ if (!pcb_file_readable(LOCAL_PROJECT_FILE)) {
+ pcb_message(PCB_MSG_ERROR, "Don't know what to do: no project or schematics given, no local project file %s found. Try %s --help\n", LOCAL_PROJECT_FILE, argv[0]);
+ exit(1);
+ }
+ if (conf_load_as(CFR_PROJECT, LOCAL_PROJECT_FILE, 0) != 0) {
+ pcb_message(PCB_MSG_ERROR, "Failed to load project file %s. Try %s --help\n", LOCAL_PROJECT_FILE, argv[0]);
+ exit(1);
+ }
+ conf_update(NULL); /* because of our new project file */
+ }
+ else if ((local_project_pcb_name != NULL) && (!have_cli_project_file))
+ conf_load_project(NULL, local_project_pcb_name);
- conf_update(NULL); /* because of CLI changes */
+ if (!have_cli_schematics) { /* load all schematics from the project file unless we have schematics from the cli */
+ conf_native_t *nat = conf_get_field("utils/gsch2pcb_rnd/schematics");
+ if (nat != NULL) {
+ conf_listitem_t *ci;
+ for (ci = conflist_first(nat->val.list); ci != NULL; ci = conflist_next(ci)) {
+ const char *p = ci->val.string[0];
+ if (ci->type != CFN_STRING)
+ continue;
+ add_schematic(p);
+ }
+ }
+ else {
+ pcb_message(PCB_MSG_ERROR, "No schematics specified on the cli or in project files. Try %s --help\n", argv[0]);
+ exit(1);
+ }
+ }
+
+ if (gadl_length(&schematics) == 0) {
+ pcb_message(PCB_MSG_ERROR, "No schematics specified on the cli; can't find any in the project files/configs either. Try %s --help\n", argv[0]);
+ exit(1);
+ }
+
+ conf_update(NULL); /* because of the project file */
want_method = conf_g2pr.utils.gsch2pcb_rnd.method;
if (want_method == NULL) {
method_t *m;
for(m = methods; m != NULL; m = m->next) {
+ if (m->not_by_guess)
+ continue;
if (m->guess_out_name()) {
current_method = m;
break;
@@ -378,14 +466,14 @@ int main(int argc, char ** argv)
}
if (current_method == NULL) {
want_method = want_method_default;
- Message(PCB_MSG_WARNING, "Warning: method not specified for a project without a board; defaulting to %s. This warning is harmless if you are running gsch2pcb-rnd for the first time on this project and you are fine with this default method.", want_method);
+ pcb_message(PCB_MSG_WARNING, "Warning: method not specified for a project (that has no board or project file yet); defaulting to -m %s. This warning is harmless if you are running gsch2pcb-rnd for the first time on this project and you are fine with this method.", want_method);
}
}
if (current_method == NULL) {
current_method = method_find(want_method);
if (current_method == NULL) {
- Message(PCB_MSG_ERROR, "Error: can't find method %s\n", want_method);
+ pcb_message(PCB_MSG_ERROR, "Error: can't find method %s\n", want_method);
exit(1);
}
}
@@ -393,12 +481,6 @@ int main(int argc, char ** argv)
current_method->init();
conf_update(NULL);
- if (gadl_length(&schematics) == 0)
- usage();
-
- if ((local_project_pcb_name != NULL) && (!have_project_file))
- conf_load_project(NULL, local_project_pcb_name);
- conf_update(NULL); /* because of the project file */
current_method->go(); /* the traditional, "parse element and edit the pcb file" approach */
diff --git a/util/gsch2pcb-rnd/gsch2pcb.h b/util/gsch2pcb-rnd/gsch2pcb.h
index def40f7..f29fd58 100644
--- a/util/gsch2pcb-rnd/gsch2pcb.h
+++ b/util/gsch2pcb-rnd/gsch2pcb.h
@@ -46,3 +46,5 @@ extern int bak_done, need_PKG_purge;
const char *local_project_pcb_name; /* file name of the design from which the local project file name shall be derived */
char *fix_spaces(char * str);
+void require_gnetlist_backend(const char *dir, const char *backend);
+
diff --git a/util/gsch2pcb-rnd/gsch2pcb_rnd_conf.h b/util/gsch2pcb-rnd/gsch2pcb_rnd_conf.h
index 2070a59..760f21e 100644
--- a/util/gsch2pcb-rnd/gsch2pcb_rnd_conf.h
+++ b/util/gsch2pcb-rnd/gsch2pcb_rnd_conf.h
@@ -15,6 +15,7 @@ typedef struct {
CFT_STRING default_pcb; /* override default pcb with a given file */
CFT_STRING empty_footprint_name;
CFT_STRING method;
+ CFT_LIST schematics; /* use these schematics as input */
} gsch2pcb_rnd;
} utils;
} conf_gsch2pcb_rnd_t;
diff --git a/util/gsch2pcb-rnd/method.h b/util/gsch2pcb-rnd/method.h
index 3663e36..9452e90 100644
--- a/util/gsch2pcb-rnd/method.h
+++ b/util/gsch2pcb-rnd/method.h
@@ -7,6 +7,7 @@ struct method_s {
void (*go)(void);
void (*uninit)(void);
int (*guess_out_name)(void); /* returns 1 if the output file of the format exists for the current project */
+ int not_by_guess; /* if non-zero, never try to use this method automatically, guessing from file names or anything else */
method_t *next;
};
diff --git a/util/gsch2pcb-rnd/method_import.c b/util/gsch2pcb-rnd/method_import.c
index 0c7a3b3..dbef1b6 100644
--- a/util/gsch2pcb-rnd/method_import.c
+++ b/util/gsch2pcb-rnd/method_import.c
@@ -54,6 +54,7 @@ static void import_go(int sep_net)
verbose_str = "-q";
backend = sep_net ? "pcbrndfwd_elem" : "pcbrndfwd";
+ require_gnetlist_backend(SCMDIR, backend);
if (!build_and_run_command("%s %s -L %s -g %s -o %s %L %L", gnetlist, verbose_str, PCBLIBDIR, backend, cmd_file_name, &extra_gnetlist_arg_list, &schematics)) {
fprintf(stderr, "Failed to run gnetlist with backend %s to generate the elements\n", backend);
exit(1);
@@ -129,6 +130,7 @@ void method_import_register(void)
method_import.go = method_import_go;
method_import.uninit = method_import_uninit;
method_import.guess_out_name = method_import_guess_out_name;
+ method_import.not_by_guess = 0;
method_register(&method_import);
method_import_sep.name = "importsep";
@@ -137,5 +139,6 @@ void method_import_register(void)
method_import_sep.go = method_import_sep_go;
method_import_sep.uninit = method_import_uninit;
method_import_sep.guess_out_name = method_import_guess_out_name;
+ method_import_sep.not_by_guess = 1;
method_register(&method_import_sep);
}
diff --git a/util/gsch2pcb-rnd/method_pcb.c b/util/gsch2pcb-rnd/method_pcb.c
index 16904c2..798b372 100644
--- a/util/gsch2pcb-rnd/method_pcb.c
+++ b/util/gsch2pcb-rnd/method_pcb.c
@@ -29,6 +29,7 @@
#include "method.h"
#include "../src/plug_footprint.h"
#include "../src/paths.h"
+#include "../src/error.h"
#include "../src/conf.h"
#include "../src/conf_core.h"
#include "../src/compat_misc.h"
@@ -147,12 +148,12 @@ fprintf(stderr, " val: %s\n", value);*/
el->omit_PKG = TRUE;
}
else if (!strcmp(el->description, "none")) {
- fprintf(stderr, "WARNING: %s has a footprint attribute \"%s\" so won't be in the layout.\n", el->refdes, el->description);
+ pcb_message(PCB_MSG_WARNING, "WARNING: %s has a footprint attribute \"%s\" so won't be in the layout.\n", el->refdes, el->description);
n_none += 1;
el->omit_PKG = TRUE;
}
else if (!strcmp(el->description, "unknown")) {
- fprintf(stderr, "WARNING: %s has no footprint attribute so won't be in the layout.\n", el->refdes);
+ pcb_message(PCB_MSG_WARNING, "WARNING: %s has no footprint attribute so won't be in the layout.\n", el->refdes);
n_unknown += 1;
el->omit_PKG = TRUE;
}
@@ -447,7 +448,7 @@ static int add_elements(char * pcb_file)
int total, paren_level = 0;
int skipping = FALSE;
int dpcb;
- fp_fopen_ctx_t fctx;
+ pcb_fp_fopen_ctx_t fctx;
if ((f_in = fopen(pcb_file, "r")) == NULL)
return 0;
@@ -500,7 +501,7 @@ static int add_elements(char * pcb_file)
if (conf_g2pr.utils.gsch2pcb_rnd.verbose)
printf("%s: need new element for footprint %s (value=%s)\n", el->refdes, el->description, el->value);
- fp = fp_fopen(element_search_path, el->description, &fctx);
+ fp = pcb_fp_fopen(element_search_path, el->description, &fctx);
if (fp == NULL && conf_g2pr.utils.gsch2pcb_rnd.verbose)
printf("\tNo file element found.\n");
@@ -522,7 +523,7 @@ static int add_elements(char * pcb_file)
}
}
if (fp != NULL)
- fp_fclose(fp, &fctx);
+ pcb_fp_fclose(fp, &fctx);
}
pcb_element_free(el);
@@ -642,7 +643,7 @@ static char *pcb_file_name, *pcb_new_file_name, *bak_file_name, *pins_file_name,
static void method_pcb_init(void)
{
- fp_init();
+ pcb_fp_init();
pins_file_name = str_concat(NULL, conf_g2pr.utils.gsch2pcb_rnd.sch_basename, ".cmd", NULL);
net_file_name = str_concat(NULL, conf_g2pr.utils.gsch2pcb_rnd.sch_basename, ".net", NULL);
pcb_file_name = str_concat(NULL, conf_g2pr.utils.gsch2pcb_rnd.sch_basename, ".pcb", NULL);
@@ -680,7 +681,10 @@ static void method_pcb_go()
int initial_pcb = TRUE;
int created_pcb_file = TRUE;
- element_search_path = fp_default_search_path();
+ if (!conf_g2pr.utils.gsch2pcb_rnd.quiet_mode)
+ pcb_message(PCB_MSG_WARNING, "WARNING: Please consider switching from -m pcb to -m import because -m pcb is deprecated. (This warning can be suppressed with -q).\n");
+
+ element_search_path = pcb_fp_default_search_path();
{ /* set bak_file_name, finding the first number that results in a non-existing bak */
int len;
@@ -809,5 +813,6 @@ void method_pcb_register(void)
method_pcb.go = method_pcb_go;
method_pcb.uninit = method_pcb_uninit;
method_pcb.guess_out_name = method_pcb_guess_out_name;
+ method_pcb.not_by_guess = 0;
method_register(&method_pcb);
}
diff --git a/util/gsch2pcb-rnd/netlister.c b/util/gsch2pcb-rnd/netlister.c
index e716c78..e9eaa80 100644
--- a/util/gsch2pcb-rnd/netlister.c
+++ b/util/gsch2pcb-rnd/netlister.c
@@ -69,6 +69,7 @@ int run_gnetlist(const char *pins_file, const char *net_file, const char *pcb_fi
if (!conf_g2pr.utils.gsch2pcb_rnd.verbose)
verbose_str = "-q";
+
if (!build_and_run_command("%s %s -g pcbpins -o %s %L %L", gnetlist, verbose_str, pins_file, &extra_gnetlist_arg_list, largs))
return FALSE;
@@ -77,6 +78,8 @@ int run_gnetlist(const char *pins_file, const char *net_file, const char *pcb_fi
mtime = (stat(pcb_file, &st) == 0) ? st.st_mtime : 0;
+ require_gnetlist_backend(SCMDIR, "gsch2pcb-rnd");
+
if (!build_and_run_command("%s %s -L " SCMDIR " -g gsch2pcb-rnd -o %s %L %L",
gnetlist, verbose_str, pcb_file, &extra_gnetlist_arg_list, largs)) {
if (stat(pcb_file, &st) != 0 || mtime == st.st_mtime) {
diff --git a/util/keylist.sh b/util/keylist.sh
index 985f17e..a064e97 100755
--- a/util/keylist.sh
+++ b/util/keylist.sh
@@ -170,7 +170,18 @@ gen_html()
}
END {
- print "<html><body>"
+ q="\""
+ print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
+ print "<html>"
+ print "<!-- This file is generated by util/keylist.sh. DO NOT EDIT. -->"
+ print "<head>"
+ print "\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=us-ascii\">"
+ print "\t<title> Key to action bindings </title>"
+ print "<!--AUTO head begin-->"
+ print "<link rel=\"icon\" href=\"http://repo.hu/projects/pcb-rnd/resources/logo16.png\">"
+ print "<!--AUTO head end-->"
+ print "</head>"
+ print "<body>"
print "<h1> Key to action bindings </h1>"
print "<table border=1 cellspacing=0>"
printf("<tr><th> key")
@@ -183,7 +194,7 @@ gen_html()
for(n = 0; n < key_combos; n++) {
clr_cnt++
key = LIST[n]
- print "<tr bgcolor=" CLR[clr_cnt % 2] ">"
+ print "<tr bgcolor=" q CLR[clr_cnt % 2] q ">"
kv = split(key, K, ";")
keystr = ""
@@ -199,6 +210,7 @@ gen_html()
print " <th align=left>" keystr
for(h in HIDS) {
mn = MENUNAME[h, key]
+ gsub("\260", "\\°", mn)
act = ACTION[h, key]
if ((act == "") && (mn == ""))
act = " "
diff --git a/util/pcb-prj2lht b/util/pcb-prj2lht
new file mode 100755
index 0000000..b1e78ba
--- /dev/null
+++ b/util/pcb-prj2lht
@@ -0,0 +1,158 @@
+#!/bin/sh
+# pcb-prj2lht - convert an old gsch2pcb project file to geda project lht
+# Copyright (C) 2016 Tibor 'Igor2' Palinkas
+#
+# 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.
+#
+# http://repo.hu/projects/pcb-rnd
+
+# Convert and old gsch2pcb-rnd project file to the new, multi-program
+# geda project lihata file format.
+
+prj2lht() {
+ awk '
+ BEGIN {
+ INDENT["elements-dir"] = " "
+ INDENT["schematics"] = " "
+ }
+
+ function lht_quote(s) {
+ if (s ~ "[^a-zA-Z0-9_.-]")
+ return "{" s "}"
+ return s
+ }
+
+ function parse() {
+ name = $1
+ $1=""
+ CFG[name] = $0
+ sub("^[ \t]*", "", CFG[name])
+ }
+
+ function list_add(key, val) {
+ CFG[key] = CFG[key] INDENT[key] lht_quote(val) "\n"
+ }
+
+ function list_add_split(key, val ,n,v,T) {
+ v = split(val, T, "[ \t]+")
+ for(n = 1; n <= v; n++)
+ if (T[n] != "")
+ list_add(key, T[n])
+ }
+
+ function qparse( tmp,name) {
+ name = $1
+ $1=""
+ tmp=$0
+ sub("^[ \t]*", "", tmp)
+ while(match(tmp, "\"[^\"]*\"")) {
+ list_add_split(name, substr(tmp, 1, RSTART-1))
+ list_add(name, substr(tmp, RSTART+1, RLENGTH-2))
+ tmp = substr(tmp, RSTART+RLENGTH, length(tmp))
+ }
+ # leftover after the last quote
+ list_add_split(name, tmp)
+ }
+
+ ($1 == "elements-dir") { qparse() }
+ ($1 == "elements-shell") { parse() }
+ ($1 == "schematics") { qparse() }
+ ($1 == "output-name") { parse() }
+ ($1 == "remove-unfound") { CFG["remove-unfound"] = 1 }
+ ($1 == "keep-unfound") { CFG["remove-unfound"] = 0 }
+ ($1 == "quiet") { CFG[$1] = 1 }
+ ($1 == "preserve") { CFG[$1] = 1 }
+ ($1 == "default-pcb") { parse() }
+ ($1 == "gnetlist") { parse() }
+ ($1 == "enpty-footprint") { parse() }
+
+ function print_val(cfgkey, outkey) {
+ if (cfgkey in CFG)
+ print " " outkey " = " lht_quote(CFG[cfgkey])
+ }
+
+ END {
+ print "ha:geda-project-v1 {"
+ print " li:pcb-rnd-conf-v1 {"
+
+ print " ha:overwrite {"
+ print " ha:utils {"
+ print " ha:gsch2pcb_rnd {"
+ print_val("remove-unfound", "remove_unfound_elements")
+ print_val("quiet", "quiet_mode")
+ print_val("preserve", "preserve")
+ print_val("output-name", "sch_basename")
+ print_val("default-pcb", "default_pcb")
+ print_val("gnetlist", "gnetlist")
+ print_val("empty-footprint", "empty_footprint_name")
+ if ("schematics" in CFG) {
+ print " li:schematics {"
+ printf("%s", CFG["schematics"])
+ print " }"
+ }
+ print " }"
+ print " }"
+ print " ha:rc {"
+ print_val("elements-shell", "library_shell")
+ print " }"
+ print " }"
+
+ if ("elements-dir" in CFG) {
+ print " ha:prepend {"
+ print " ha:rc {"
+ print " li:library_search_paths {"
+ printf("%s", CFG["elements-dir"])
+ print " }"
+ print " }"
+ print " }"
+ }
+
+ print " }"
+ print "}"
+ }
+ '
+}
+
+help()
+{
+ echo "pcb-prj2lht - convert a gsch2pcb project file to pcb-rnd lihata project file"
+ echo ""
+ echo "Invocation: pcb-prj2lht [something.prj]"
+ echo ""
+ echo "If the project file is specified, a new file is created with the .prj"
+ echo "part replaced with .lht. If no file name specified, read the project"
+ echo "on STDIN and write the result to STDOUT."
+ echo ""
+}
+
+########## main ##########
+
+if test "$1" = "--help"
+then
+ help
+ exit
+fi
+
+if test $# -gt 0
+then
+ for n in "$@"
+ do
+ out=${n%%.prj}.lht
+ prj2lht < $n > $out || echo "Failed to convert $n to $out" >&2
+ done
+else
+ # stdio operation
+ prj2lht
+fi
diff --git a/util/pcblib-param.cgi b/util/pcblib-param.cgi
index 3ddc425..e906619 100755
--- a/util/pcblib-param.cgi
+++ b/util/pcblib-param.cgi
@@ -396,12 +396,12 @@ to the m4 footprints in pcb. The goal was to fix three problems.
<ul>
<li> 1. Languages: m4 should not be mandatory for footprint generators - the user should be free to choose any language
<li> 2. Simplicity: references to m4 should not be hardwired in pcb, gsch2pcb and gsch2pcb.scm, but footprint generation should be generic, transparent and external
- <li> 3. Unambiguity: gsch2pcb should not be guessing whether to use file elements or call a generator. Instead of complex heuristics, there should eb a simple, distinct syntax for parametric footprints.
+ <li> 3. Unambiguity: gsch2pcb should not be guessing whether to use file elements or call a generator. Instead of complex heuristics, there should be a simple, distinct syntax for parametric footprints.
</ul>
<p>
The new syntax is that if a footprint attribute contains parenthesis, it is
a parametric footprint, else it is a file footprint. Parametric footprints
-are sort of a function call. The actual syntax is similar to the on in
+are sort of a function call. The actual syntax is similar to the one in
<a href="http://www.openscad.org"> openscad </a>:
parameters are separated by commas, and they are either positional (value)
or named (name=value).
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/pcb-rnd.git
More information about the Pkg-electronics-commits
mailing list